@nowline/embed 0.4.0 → 0.4.2

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.
@@ -1,101 +1,101 @@
1
- /*! @nowline/embed 0.4.0 sha=86c53d1 built=2026-05-27T13:21:30.695Z env=prod */
2
- "use strict";var nowline=(()=>{var UP=Object.create;var hc=Object.defineProperty;var BP=Object.getOwnPropertyDescriptor;var XP=Object.getOwnPropertyNames;var GP=Object.getPrototypeOf,HP=Object.prototype.hasOwnProperty;var jP=(t,e,r)=>e in t?hc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var bE=(t,e)=>()=>(t&&(e=t(t=0)),e);var ce=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),tn=(t,e)=>{for(var r in e)hc(t,r,{get:e[r],enumerable:!0})},Wu=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of XP(e))!HP.call(t,i)&&i!==r&&hc(t,i,{get:()=>e[i],enumerable:!(n=BP(e,i))||n.enumerable});return t},Ie=(t,e,r)=>(Wu(t,e,"default"),r&&Wu(r,e,"default")),rm=(t,e,r)=>(r=t!=null?UP(GP(t)):{},Wu(e||!t||!t.__esModule?hc(r,"default",{value:t,enumerable:!0}):r,t)),qu=t=>Wu(hc({},"__esModule",{value:!0}),t);var le=(t,e,r)=>jP(t,typeof e!="symbol"?e+"":e,r);var Dd={};tn(Dd,{AnnotatedTextEdit:()=>Xn,ChangeAnnotation:()=>bo,ChangeAnnotationIdentifier:()=>Lt,CodeAction:()=>hy,CodeActionContext:()=>py,CodeActionKind:()=>dy,CodeActionTriggerKind:()=>ul,CodeDescription:()=>Hg,CodeLens:()=>my,Color:()=>vd,ColorInformation:()=>Mg,ColorPresentation:()=>Fg,Command:()=>wo,CompletionItem:()=>ey,CompletionItemKind:()=>Vg,CompletionItemLabelDetails:()=>Qg,CompletionItemTag:()=>Kg,CompletionList:()=>ty,CreateFile:()=>zs,DeleteFile:()=>Ys,Diagnostic:()=>sl,DiagnosticRelatedInformation:()=>kd,DiagnosticSeverity:()=>Xg,DiagnosticTag:()=>Gg,DocumentHighlight:()=>sy,DocumentHighlightKind:()=>oy,DocumentLink:()=>yy,DocumentSymbol:()=>fy,DocumentUri:()=>Lg,EOL:()=>iF,FoldingRange:()=>Bg,FoldingRangeKind:()=>Ug,FormattingOptions:()=>gy,Hover:()=>ry,InlayHint:()=>Iy,InlayHintKind:()=>Od,InlayHintLabelPart:()=>Ld,InlineCompletionContext:()=>Cy,InlineCompletionItem:()=>vy,InlineCompletionList:()=>ky,InlineCompletionTriggerKind:()=>Ny,InlineValueContext:()=>Ay,InlineValueEvaluatableExpression:()=>wy,InlineValueText:()=>Ry,InlineValueVariableLookup:()=>by,InsertReplaceEdit:()=>Zg,InsertTextFormat:()=>Yg,InsertTextMode:()=>Jg,Location:()=>ol,LocationLink:()=>$g,MarkedString:()=>ll,MarkupContent:()=>Ks,MarkupKind:()=>Cd,OptionalVersionedTextDocumentIdentifier:()=>cl,ParameterInformation:()=>ny,Position:()=>ke,Range:()=>_e,RenameFile:()=>Vs,SelectedCompletionInfo:()=>Py,SelectionRange:()=>xy,SemanticTokenModifiers:()=>_y,SemanticTokenTypes:()=>Ty,SemanticTokens:()=>Ey,SignatureInformation:()=>iy,StringValue:()=>Sy,SymbolInformation:()=>ly,SymbolKind:()=>ay,SymbolTag:()=>cy,TextDocument:()=>Ly,TextDocumentEdit:()=>al,TextDocumentIdentifier:()=>Wg,TextDocumentItem:()=>zg,TextEdit:()=>un,URI:()=>Sd,VersionedTextDocumentIdentifier:()=>qg,WorkspaceChange:()=>jg,WorkspaceEdit:()=>Nd,WorkspaceFolder:()=>Oy,WorkspaceSymbol:()=>uy,integer:()=>Dg,uinteger:()=>il});var Lg,Sd,Dg,il,ke,_e,ol,$g,vd,Mg,Fg,Ug,Bg,kd,Xg,Gg,Hg,sl,wo,un,bo,Lt,Xn,al,zs,Vs,Ys,Nd,qs,Pd,jg,Wg,qg,cl,zg,Cd,Ks,Vg,Yg,Kg,Zg,Jg,Qg,ey,ty,ll,ry,ny,iy,oy,sy,ay,cy,ly,uy,fy,dy,ul,py,hy,my,gy,yy,xy,Ty,_y,Ey,Ry,by,wy,Ay,Od,Ld,Iy,Sy,vy,ky,Ny,Py,Cy,Oy,iF,Ly,Dy,b,Zs=bE(()=>{"use strict";(function(t){function e(r){return typeof r=="string"}t.is=e})(Lg||(Lg={}));(function(t){function e(r){return typeof r=="string"}t.is=e})(Sd||(Sd={}));(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(Dg||(Dg={}));(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(il||(il={}));(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=il.MAX_VALUE),i===Number.MAX_VALUE&&(i=il.MAX_VALUE),{line:n,character:i}}t.create=e;function r(n){let i=n;return b.objectLiteral(i)&&b.uinteger(i.line)&&b.uinteger(i.character)}t.is=r})(ke||(ke={}));(function(t){function e(n,i,o,s){if(b.uinteger(n)&&b.uinteger(i)&&b.uinteger(o)&&b.uinteger(s))return{start:ke.create(n,i),end:ke.create(o,s)};if(ke.is(n)&&ke.is(i))return{start:n,end:i};throw new Error(`Range#create called with invalid arguments[${n}, ${i}, ${o}, ${s}]`)}t.create=e;function r(n){let i=n;return b.objectLiteral(i)&&ke.is(i.start)&&ke.is(i.end)}t.is=r})(_e||(_e={}));(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return b.objectLiteral(i)&&_e.is(i.range)&&(b.string(i.uri)||b.undefined(i.uri))}t.is=r})(ol||(ol={}));(function(t){function e(n,i,o,s){return{targetUri:n,targetRange:i,targetSelectionRange:o,originSelectionRange:s}}t.create=e;function r(n){let i=n;return b.objectLiteral(i)&&_e.is(i.targetRange)&&b.string(i.targetUri)&&_e.is(i.targetSelectionRange)&&(_e.is(i.originSelectionRange)||b.undefined(i.originSelectionRange))}t.is=r})($g||($g={}));(function(t){function e(n,i,o,s){return{red:n,green:i,blue:o,alpha:s}}t.create=e;function r(n){let i=n;return b.objectLiteral(i)&&b.numberRange(i.red,0,1)&&b.numberRange(i.green,0,1)&&b.numberRange(i.blue,0,1)&&b.numberRange(i.alpha,0,1)}t.is=r})(vd||(vd={}));(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){let i=n;return b.objectLiteral(i)&&_e.is(i.range)&&vd.is(i.color)}t.is=r})(Mg||(Mg={}));(function(t){function e(n,i,o){return{label:n,textEdit:i,additionalTextEdits:o}}t.create=e;function r(n){let i=n;return b.objectLiteral(i)&&b.string(i.label)&&(b.undefined(i.textEdit)||un.is(i))&&(b.undefined(i.additionalTextEdits)||b.typedArray(i.additionalTextEdits,un.is))}t.is=r})(Fg||(Fg={}));(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Ug||(Ug={}));(function(t){function e(n,i,o,s,a,c){let l={startLine:n,endLine:i};return b.defined(o)&&(l.startCharacter=o),b.defined(s)&&(l.endCharacter=s),b.defined(a)&&(l.kind=a),b.defined(c)&&(l.collapsedText=c),l}t.create=e;function r(n){let i=n;return b.objectLiteral(i)&&b.uinteger(i.startLine)&&b.uinteger(i.startLine)&&(b.undefined(i.startCharacter)||b.uinteger(i.startCharacter))&&(b.undefined(i.endCharacter)||b.uinteger(i.endCharacter))&&(b.undefined(i.kind)||b.string(i.kind))}t.is=r})(Bg||(Bg={}));(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return b.defined(i)&&ol.is(i.location)&&b.string(i.message)}t.is=r})(kd||(kd={}));(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Xg||(Xg={}));(function(t){t.Unnecessary=1,t.Deprecated=2})(Gg||(Gg={}));(function(t){function e(r){let n=r;return b.objectLiteral(n)&&b.string(n.href)}t.is=e})(Hg||(Hg={}));(function(t){function e(n,i,o,s,a,c){let l={range:n,message:i};return b.defined(o)&&(l.severity=o),b.defined(s)&&(l.code=s),b.defined(a)&&(l.source=a),b.defined(c)&&(l.relatedInformation=c),l}t.create=e;function r(n){var i;let o=n;return b.defined(o)&&_e.is(o.range)&&b.string(o.message)&&(b.number(o.severity)||b.undefined(o.severity))&&(b.integer(o.code)||b.string(o.code)||b.undefined(o.code))&&(b.undefined(o.codeDescription)||b.string((i=o.codeDescription)===null||i===void 0?void 0:i.href))&&(b.string(o.source)||b.undefined(o.source))&&(b.undefined(o.relatedInformation)||b.typedArray(o.relatedInformation,kd.is))}t.is=r})(sl||(sl={}));(function(t){function e(n,i,...o){let s={title:n,command:i};return b.defined(o)&&o.length>0&&(s.arguments=o),s}t.create=e;function r(n){let i=n;return b.defined(i)&&b.string(i.title)&&b.string(i.command)}t.is=r})(wo||(wo={}));(function(t){function e(o,s){return{range:o,newText:s}}t.replace=e;function r(o,s){return{range:{start:o,end:o},newText:s}}t.insert=r;function n(o){return{range:o,newText:""}}t.del=n;function i(o){let s=o;return b.objectLiteral(s)&&b.string(s.newText)&&_e.is(s.range)}t.is=i})(un||(un={}));(function(t){function e(n,i,o){let s={label:n};return i!==void 0&&(s.needsConfirmation=i),o!==void 0&&(s.description=o),s}t.create=e;function r(n){let i=n;return b.objectLiteral(i)&&b.string(i.label)&&(b.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(b.string(i.description)||i.description===void 0)}t.is=r})(bo||(bo={}));(function(t){function e(r){let n=r;return b.string(n)}t.is=e})(Lt||(Lt={}));(function(t){function e(o,s,a){return{range:o,newText:s,annotationId:a}}t.replace=e;function r(o,s,a){return{range:{start:o,end:o},newText:s,annotationId:a}}t.insert=r;function n(o,s){return{range:o,newText:"",annotationId:s}}t.del=n;function i(o){let s=o;return un.is(s)&&(bo.is(s.annotationId)||Lt.is(s.annotationId))}t.is=i})(Xn||(Xn={}));(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return b.defined(i)&&cl.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(al||(al={}));(function(t){function e(n,i,o){let s={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(s.options=i),o!==void 0&&(s.annotationId=o),s}t.create=e;function r(n){let i=n;return i&&i.kind==="create"&&b.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||b.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||b.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Lt.is(i.annotationId))}t.is=r})(zs||(zs={}));(function(t){function e(n,i,o,s){let a={kind:"rename",oldUri:n,newUri:i};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(a.options=o),s!==void 0&&(a.annotationId=s),a}t.create=e;function r(n){let i=n;return i&&i.kind==="rename"&&b.string(i.oldUri)&&b.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||b.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||b.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Lt.is(i.annotationId))}t.is=r})(Vs||(Vs={}));(function(t){function e(n,i,o){let s={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(s.options=i),o!==void 0&&(s.annotationId=o),s}t.create=e;function r(n){let i=n;return i&&i.kind==="delete"&&b.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||b.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||b.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Lt.is(i.annotationId))}t.is=r})(Ys||(Ys={}));(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(i=>b.string(i.kind)?zs.is(i)||Vs.is(i)||Ys.is(i):al.is(i)))}t.is=e})(Nd||(Nd={}));qs=class{constructor(e,r){this.edits=e,this.changeAnnotations=r}insert(e,r,n){let i,o;if(n===void 0?i=un.insert(e,r):Lt.is(n)?(o=n,i=Xn.insert(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),i=Xn.insert(e,r,o)),this.edits.push(i),o!==void 0)return o}replace(e,r,n){let i,o;if(n===void 0?i=un.replace(e,r):Lt.is(n)?(o=n,i=Xn.replace(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),i=Xn.replace(e,r,o)),this.edits.push(i),o!==void 0)return o}delete(e,r){let n,i;if(r===void 0?n=un.del(e):Lt.is(r)?(i=r,n=Xn.del(e,r)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(r),n=Xn.del(e,i)),this.edits.push(n),i!==void 0)return i}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},Pd=class{constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,r){let n;if(Lt.is(e)?n=e:(n=this.nextId(),r=e),this._annotations[n]!==void 0)throw new Error(`Id ${n} is already in use.`);if(r===void 0)throw new Error(`No annotation provided for id ${n}`);return this._annotations[n]=r,this._size++,n}nextId(){return this._counter++,this._counter.toString()}},jg=class{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Pd(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(r=>{if(al.is(r)){let n=new qs(r.edits,this._changeAnnotations);this._textEditChanges[r.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(r=>{let n=new qs(e.changes[r]);this._textEditChanges[r]=n})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(cl.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let r={uri:e.uri,version:e.version},n=this._textEditChanges[r.uri];if(!n){let i=[],o={textDocument:r,edits:i};this._workspaceEdit.documentChanges.push(o),n=new qs(i,this._changeAnnotations),this._textEditChanges[r.uri]=n}return n}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let r=this._textEditChanges[e];if(!r){let n=[];this._workspaceEdit.changes[e]=n,r=new qs(n),this._textEditChanges[e]=r}return r}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Pd,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;bo.is(r)||Lt.is(r)?i=r:n=r;let o,s;if(i===void 0?o=zs.create(e,n):(s=Lt.is(i)?i:this._changeAnnotations.manage(i),o=zs.create(e,n,s)),this._workspaceEdit.documentChanges.push(o),s!==void 0)return s}renameFile(e,r,n,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let o;bo.is(n)||Lt.is(n)?o=n:i=n;let s,a;if(o===void 0?s=Vs.create(e,r,i):(a=Lt.is(o)?o:this._changeAnnotations.manage(o),s=Vs.create(e,r,i,a)),this._workspaceEdit.documentChanges.push(s),a!==void 0)return a}deleteFile(e,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;bo.is(r)||Lt.is(r)?i=r:n=r;let o,s;if(i===void 0?o=Ys.create(e,n):(s=Lt.is(i)?i:this._changeAnnotations.manage(i),o=Ys.create(e,n,s)),this._workspaceEdit.documentChanges.push(o),s!==void 0)return s}};(function(t){function e(n){return{uri:n}}t.create=e;function r(n){let i=n;return b.defined(i)&&b.string(i.uri)}t.is=r})(Wg||(Wg={}));(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return b.defined(i)&&b.string(i.uri)&&b.integer(i.version)}t.is=r})(qg||(qg={}));(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return b.defined(i)&&b.string(i.uri)&&(i.version===null||b.integer(i.version))}t.is=r})(cl||(cl={}));(function(t){function e(n,i,o,s){return{uri:n,languageId:i,version:o,text:s}}t.create=e;function r(n){let i=n;return b.defined(i)&&b.string(i.uri)&&b.string(i.languageId)&&b.integer(i.version)&&b.string(i.text)}t.is=r})(zg||(zg={}));(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){let n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(Cd||(Cd={}));(function(t){function e(r){let n=r;return b.objectLiteral(r)&&Cd.is(n.kind)&&b.string(n.value)}t.is=e})(Ks||(Ks={}));(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(Vg||(Vg={}));(function(t){t.PlainText=1,t.Snippet=2})(Yg||(Yg={}));(function(t){t.Deprecated=1})(Kg||(Kg={}));(function(t){function e(n,i,o){return{newText:n,insert:i,replace:o}}t.create=e;function r(n){let i=n;return i&&b.string(i.newText)&&_e.is(i.insert)&&_e.is(i.replace)}t.is=r})(Zg||(Zg={}));(function(t){t.asIs=1,t.adjustIndentation=2})(Jg||(Jg={}));(function(t){function e(r){let n=r;return n&&(b.string(n.detail)||n.detail===void 0)&&(b.string(n.description)||n.description===void 0)}t.is=e})(Qg||(Qg={}));(function(t){function e(r){return{label:r}}t.create=e})(ey||(ey={}));(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(ty||(ty={}));(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function r(n){let i=n;return b.string(i)||b.objectLiteral(i)&&b.string(i.language)&&b.string(i.value)}t.is=r})(ll||(ll={}));(function(t){function e(r){let n=r;return!!n&&b.objectLiteral(n)&&(Ks.is(n.contents)||ll.is(n.contents)||b.typedArray(n.contents,ll.is))&&(r.range===void 0||_e.is(r.range))}t.is=e})(ry||(ry={}));(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(ny||(ny={}));(function(t){function e(r,n,...i){let o={label:r};return b.defined(n)&&(o.documentation=n),b.defined(i)?o.parameters=i:o.parameters=[],o}t.create=e})(iy||(iy={}));(function(t){t.Text=1,t.Read=2,t.Write=3})(oy||(oy={}));(function(t){function e(r,n){let i={range:r};return b.number(n)&&(i.kind=n),i}t.create=e})(sy||(sy={}));(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(ay||(ay={}));(function(t){t.Deprecated=1})(cy||(cy={}));(function(t){function e(r,n,i,o,s){let a={name:r,kind:n,location:{uri:o,range:i}};return s&&(a.containerName=s),a}t.create=e})(ly||(ly={}));(function(t){function e(r,n,i,o){return o!==void 0?{name:r,kind:n,location:{uri:i,range:o}}:{name:r,kind:n,location:{uri:i}}}t.create=e})(uy||(uy={}));(function(t){function e(n,i,o,s,a,c){let l={name:n,detail:i,kind:o,range:s,selectionRange:a};return c!==void 0&&(l.children=c),l}t.create=e;function r(n){let i=n;return i&&b.string(i.name)&&b.number(i.kind)&&_e.is(i.range)&&_e.is(i.selectionRange)&&(i.detail===void 0||b.string(i.detail))&&(i.deprecated===void 0||b.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=r})(fy||(fy={}));(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(dy||(dy={}));(function(t){t.Invoked=1,t.Automatic=2})(ul||(ul={}));(function(t){function e(n,i,o){let s={diagnostics:n};return i!=null&&(s.only=i),o!=null&&(s.triggerKind=o),s}t.create=e;function r(n){let i=n;return b.defined(i)&&b.typedArray(i.diagnostics,sl.is)&&(i.only===void 0||b.typedArray(i.only,b.string))&&(i.triggerKind===void 0||i.triggerKind===ul.Invoked||i.triggerKind===ul.Automatic)}t.is=r})(py||(py={}));(function(t){function e(n,i,o){let s={title:n},a=!0;return typeof i=="string"?(a=!1,s.kind=i):wo.is(i)?s.command=i:s.edit=i,a&&o!==void 0&&(s.kind=o),s}t.create=e;function r(n){let i=n;return i&&b.string(i.title)&&(i.diagnostics===void 0||b.typedArray(i.diagnostics,sl.is))&&(i.kind===void 0||b.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||wo.is(i.command))&&(i.isPreferred===void 0||b.boolean(i.isPreferred))&&(i.edit===void 0||Nd.is(i.edit))}t.is=r})(hy||(hy={}));(function(t){function e(n,i){let o={range:n};return b.defined(i)&&(o.data=i),o}t.create=e;function r(n){let i=n;return b.defined(i)&&_e.is(i.range)&&(b.undefined(i.command)||wo.is(i.command))}t.is=r})(my||(my={}));(function(t){function e(n,i){return{tabSize:n,insertSpaces:i}}t.create=e;function r(n){let i=n;return b.defined(i)&&b.uinteger(i.tabSize)&&b.boolean(i.insertSpaces)}t.is=r})(gy||(gy={}));(function(t){function e(n,i,o){return{range:n,target:i,data:o}}t.create=e;function r(n){let i=n;return b.defined(i)&&_e.is(i.range)&&(b.undefined(i.target)||b.string(i.target))}t.is=r})(yy||(yy={}));(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return b.objectLiteral(i)&&_e.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(xy||(xy={}));(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(Ty||(Ty={}));(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(_y||(_y={}));(function(t){function e(r){let n=r;return b.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}t.is=e})(Ey||(Ey={}));(function(t){function e(n,i){return{range:n,text:i}}t.create=e;function r(n){let i=n;return i!=null&&_e.is(i.range)&&b.string(i.text)}t.is=r})(Ry||(Ry={}));(function(t){function e(n,i,o){return{range:n,variableName:i,caseSensitiveLookup:o}}t.create=e;function r(n){let i=n;return i!=null&&_e.is(i.range)&&b.boolean(i.caseSensitiveLookup)&&(b.string(i.variableName)||i.variableName===void 0)}t.is=r})(by||(by={}));(function(t){function e(n,i){return{range:n,expression:i}}t.create=e;function r(n){let i=n;return i!=null&&_e.is(i.range)&&(b.string(i.expression)||i.expression===void 0)}t.is=r})(wy||(wy={}));(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){let i=n;return b.defined(i)&&_e.is(n.stoppedLocation)}t.is=r})(Ay||(Ay={}));(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(Od||(Od={}));(function(t){function e(n){return{value:n}}t.create=e;function r(n){let i=n;return b.objectLiteral(i)&&(i.tooltip===void 0||b.string(i.tooltip)||Ks.is(i.tooltip))&&(i.location===void 0||ol.is(i.location))&&(i.command===void 0||wo.is(i.command))}t.is=r})(Ld||(Ld={}));(function(t){function e(n,i,o){let s={position:n,label:i};return o!==void 0&&(s.kind=o),s}t.create=e;function r(n){let i=n;return b.objectLiteral(i)&&ke.is(i.position)&&(b.string(i.label)||b.typedArray(i.label,Ld.is))&&(i.kind===void 0||Od.is(i.kind))&&i.textEdits===void 0||b.typedArray(i.textEdits,un.is)&&(i.tooltip===void 0||b.string(i.tooltip)||Ks.is(i.tooltip))&&(i.paddingLeft===void 0||b.boolean(i.paddingLeft))&&(i.paddingRight===void 0||b.boolean(i.paddingRight))}t.is=r})(Iy||(Iy={}));(function(t){function e(r){return{kind:"snippet",value:r}}t.createSnippet=e})(Sy||(Sy={}));(function(t){function e(r,n,i,o){return{insertText:r,filterText:n,range:i,command:o}}t.create=e})(vy||(vy={}));(function(t){function e(r){return{items:r}}t.create=e})(ky||(ky={}));(function(t){t.Invoked=0,t.Automatic=1})(Ny||(Ny={}));(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(Py||(Py={}));(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(Cy||(Cy={}));(function(t){function e(r){let n=r;return b.objectLiteral(n)&&Sd.is(n.uri)&&b.string(n.name)}t.is=e})(Oy||(Oy={}));iF=[`
1
+ /*! @nowline/embed 0.4.2 sha=1625fac built=2026-05-29T01:31:09.978Z env=prod */
2
+ "use strict";var nowline=(()=>{var xC=Object.create;var _c=Object.defineProperty;var TC=Object.getOwnPropertyDescriptor;var _C=Object.getOwnPropertyNames;var EC=Object.getPrototypeOf,vC=Object.prototype.hasOwnProperty;var RC=(t,e,r)=>e in t?_c(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var BE=(t,e)=>()=>(t&&(e=t(t=0)),e);var ue=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),on=(t,e)=>{for(var r in e)_c(t,r,{get:e[r],enumerable:!0})},ef=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _C(e))!vC.call(t,i)&&i!==r&&_c(t,i,{get:()=>e[i],enumerable:!(n=TC(e,i))||n.enumerable});return t},Ae=(t,e,r)=>(ef(t,e,"default"),r&&ef(r,e,"default")),dm=(t,e,r)=>(r=t!=null?xC(EC(t)):{},ef(e||!t||!t.__esModule?_c(r,"default",{value:t,enumerable:!0}):r,t)),tf=t=>ef(_c({},"__esModule",{value:!0}),t);var fe=(t,e,r)=>RC(t,typeof e!="symbol"?e+"":e,r);var jd={};on(jd,{AnnotatedTextEdit:()=>jn,ChangeAnnotation:()=>Io,ChangeAnnotationIdentifier:()=>Dt,CodeAction:()=>wy,CodeActionContext:()=>Ry,CodeActionKind:()=>vy,CodeActionTriggerKind:()=>gl,CodeDescription:()=>Qg,CodeLens:()=>by,Color:()=>Md,ColorInformation:()=>Wg,ColorPresentation:()=>Vg,Command:()=>ko,CompletionItem:()=>uy,CompletionItemKind:()=>iy,CompletionItemLabelDetails:()=>ly,CompletionItemTag:()=>sy,CompletionList:()=>fy,CreateFile:()=>Qs,DeleteFile:()=>ta,Diagnostic:()=>dl,DiagnosticRelatedInformation:()=>Fd,DiagnosticSeverity:()=>Zg,DiagnosticTag:()=>Jg,DocumentHighlight:()=>gy,DocumentHighlightKind:()=>my,DocumentLink:()=>Sy,DocumentSymbol:()=>Ey,DocumentUri:()=>jg,EOL:()=>MF,FoldingRange:()=>Kg,FoldingRangeKind:()=>Yg,FormattingOptions:()=>Ay,Hover:()=>dy,InlayHint:()=>$y,InlayHintKind:()=>Xd,InlayHintLabelPart:()=>Hd,InlineCompletionContext:()=>Xy,InlineCompletionItem:()=>Fy,InlineCompletionList:()=>Uy,InlineCompletionTriggerKind:()=>By,InlineValueContext:()=>Dy,InlineValueEvaluatableExpression:()=>Ly,InlineValueText:()=>Cy,InlineValueVariableLookup:()=>Oy,InsertReplaceEdit:()=>ay,InsertTextFormat:()=>oy,InsertTextMode:()=>cy,Location:()=>fl,LocationLink:()=>qg,MarkedString:()=>ml,MarkupContent:()=>ra,MarkupKind:()=>Gd,OptionalVersionedTextDocumentIdentifier:()=>hl,ParameterInformation:()=>py,Position:()=>ke,Range:()=>ve,RenameFile:()=>ea,SelectedCompletionInfo:()=>Gy,SelectionRange:()=>Iy,SemanticTokenModifiers:()=>Ny,SemanticTokenTypes:()=>ky,SemanticTokens:()=>Py,SignatureInformation:()=>hy,StringValue:()=>My,SymbolInformation:()=>Ty,SymbolKind:()=>yy,SymbolTag:()=>xy,TextDocument:()=>jy,TextDocumentEdit:()=>pl,TextDocumentIdentifier:()=>ty,TextDocumentItem:()=>ny,TextEdit:()=>pn,URI:()=>$d,VersionedTextDocumentIdentifier:()=>ry,WorkspaceChange:()=>ey,WorkspaceEdit:()=>Ud,WorkspaceFolder:()=>Hy,WorkspaceSymbol:()=>_y,integer:()=>zg,uinteger:()=>ul});var jg,$d,zg,ul,ke,ve,fl,qg,Md,Wg,Vg,Yg,Kg,Fd,Zg,Jg,Qg,dl,ko,pn,Io,Dt,jn,pl,Qs,ea,ta,Ud,Js,Bd,ey,ty,ry,hl,ny,Gd,ra,iy,oy,sy,ay,cy,ly,uy,fy,ml,dy,py,hy,my,gy,yy,xy,Ty,_y,Ey,vy,gl,Ry,wy,by,Ay,Sy,Iy,ky,Ny,Py,Cy,Oy,Ly,Dy,Xd,Hd,$y,My,Fy,Uy,By,Gy,Xy,Hy,MF,jy,zy,w,na=BE(()=>{"use strict";(function(t){function e(r){return typeof r=="string"}t.is=e})(jg||(jg={}));(function(t){function e(r){return typeof r=="string"}t.is=e})($d||($d={}));(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(zg||(zg={}));(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(ul||(ul={}));(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=ul.MAX_VALUE),i===Number.MAX_VALUE&&(i=ul.MAX_VALUE),{line:n,character:i}}t.create=e;function r(n){let i=n;return w.objectLiteral(i)&&w.uinteger(i.line)&&w.uinteger(i.character)}t.is=r})(ke||(ke={}));(function(t){function e(n,i,o,s){if(w.uinteger(n)&&w.uinteger(i)&&w.uinteger(o)&&w.uinteger(s))return{start:ke.create(n,i),end:ke.create(o,s)};if(ke.is(n)&&ke.is(i))return{start:n,end:i};throw new Error(`Range#create called with invalid arguments[${n}, ${i}, ${o}, ${s}]`)}t.create=e;function r(n){let i=n;return w.objectLiteral(i)&&ke.is(i.start)&&ke.is(i.end)}t.is=r})(ve||(ve={}));(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return w.objectLiteral(i)&&ve.is(i.range)&&(w.string(i.uri)||w.undefined(i.uri))}t.is=r})(fl||(fl={}));(function(t){function e(n,i,o,s){return{targetUri:n,targetRange:i,targetSelectionRange:o,originSelectionRange:s}}t.create=e;function r(n){let i=n;return w.objectLiteral(i)&&ve.is(i.targetRange)&&w.string(i.targetUri)&&ve.is(i.targetSelectionRange)&&(ve.is(i.originSelectionRange)||w.undefined(i.originSelectionRange))}t.is=r})(qg||(qg={}));(function(t){function e(n,i,o,s){return{red:n,green:i,blue:o,alpha:s}}t.create=e;function r(n){let i=n;return w.objectLiteral(i)&&w.numberRange(i.red,0,1)&&w.numberRange(i.green,0,1)&&w.numberRange(i.blue,0,1)&&w.numberRange(i.alpha,0,1)}t.is=r})(Md||(Md={}));(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){let i=n;return w.objectLiteral(i)&&ve.is(i.range)&&Md.is(i.color)}t.is=r})(Wg||(Wg={}));(function(t){function e(n,i,o){return{label:n,textEdit:i,additionalTextEdits:o}}t.create=e;function r(n){let i=n;return w.objectLiteral(i)&&w.string(i.label)&&(w.undefined(i.textEdit)||pn.is(i))&&(w.undefined(i.additionalTextEdits)||w.typedArray(i.additionalTextEdits,pn.is))}t.is=r})(Vg||(Vg={}));(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Yg||(Yg={}));(function(t){function e(n,i,o,s,a,c){let l={startLine:n,endLine:i};return w.defined(o)&&(l.startCharacter=o),w.defined(s)&&(l.endCharacter=s),w.defined(a)&&(l.kind=a),w.defined(c)&&(l.collapsedText=c),l}t.create=e;function r(n){let i=n;return w.objectLiteral(i)&&w.uinteger(i.startLine)&&w.uinteger(i.startLine)&&(w.undefined(i.startCharacter)||w.uinteger(i.startCharacter))&&(w.undefined(i.endCharacter)||w.uinteger(i.endCharacter))&&(w.undefined(i.kind)||w.string(i.kind))}t.is=r})(Kg||(Kg={}));(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return w.defined(i)&&fl.is(i.location)&&w.string(i.message)}t.is=r})(Fd||(Fd={}));(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Zg||(Zg={}));(function(t){t.Unnecessary=1,t.Deprecated=2})(Jg||(Jg={}));(function(t){function e(r){let n=r;return w.objectLiteral(n)&&w.string(n.href)}t.is=e})(Qg||(Qg={}));(function(t){function e(n,i,o,s,a,c){let l={range:n,message:i};return w.defined(o)&&(l.severity=o),w.defined(s)&&(l.code=s),w.defined(a)&&(l.source=a),w.defined(c)&&(l.relatedInformation=c),l}t.create=e;function r(n){var i;let o=n;return w.defined(o)&&ve.is(o.range)&&w.string(o.message)&&(w.number(o.severity)||w.undefined(o.severity))&&(w.integer(o.code)||w.string(o.code)||w.undefined(o.code))&&(w.undefined(o.codeDescription)||w.string((i=o.codeDescription)===null||i===void 0?void 0:i.href))&&(w.string(o.source)||w.undefined(o.source))&&(w.undefined(o.relatedInformation)||w.typedArray(o.relatedInformation,Fd.is))}t.is=r})(dl||(dl={}));(function(t){function e(n,i,...o){let s={title:n,command:i};return w.defined(o)&&o.length>0&&(s.arguments=o),s}t.create=e;function r(n){let i=n;return w.defined(i)&&w.string(i.title)&&w.string(i.command)}t.is=r})(ko||(ko={}));(function(t){function e(o,s){return{range:o,newText:s}}t.replace=e;function r(o,s){return{range:{start:o,end:o},newText:s}}t.insert=r;function n(o){return{range:o,newText:""}}t.del=n;function i(o){let s=o;return w.objectLiteral(s)&&w.string(s.newText)&&ve.is(s.range)}t.is=i})(pn||(pn={}));(function(t){function e(n,i,o){let s={label:n};return i!==void 0&&(s.needsConfirmation=i),o!==void 0&&(s.description=o),s}t.create=e;function r(n){let i=n;return w.objectLiteral(i)&&w.string(i.label)&&(w.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(w.string(i.description)||i.description===void 0)}t.is=r})(Io||(Io={}));(function(t){function e(r){let n=r;return w.string(n)}t.is=e})(Dt||(Dt={}));(function(t){function e(o,s,a){return{range:o,newText:s,annotationId:a}}t.replace=e;function r(o,s,a){return{range:{start:o,end:o},newText:s,annotationId:a}}t.insert=r;function n(o,s){return{range:o,newText:"",annotationId:s}}t.del=n;function i(o){let s=o;return pn.is(s)&&(Io.is(s.annotationId)||Dt.is(s.annotationId))}t.is=i})(jn||(jn={}));(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return w.defined(i)&&hl.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(pl||(pl={}));(function(t){function e(n,i,o){let s={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(s.options=i),o!==void 0&&(s.annotationId=o),s}t.create=e;function r(n){let i=n;return i&&i.kind==="create"&&w.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||w.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||w.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Dt.is(i.annotationId))}t.is=r})(Qs||(Qs={}));(function(t){function e(n,i,o,s){let a={kind:"rename",oldUri:n,newUri:i};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(a.options=o),s!==void 0&&(a.annotationId=s),a}t.create=e;function r(n){let i=n;return i&&i.kind==="rename"&&w.string(i.oldUri)&&w.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||w.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||w.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Dt.is(i.annotationId))}t.is=r})(ea||(ea={}));(function(t){function e(n,i,o){let s={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(s.options=i),o!==void 0&&(s.annotationId=o),s}t.create=e;function r(n){let i=n;return i&&i.kind==="delete"&&w.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||w.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||w.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Dt.is(i.annotationId))}t.is=r})(ta||(ta={}));(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(i=>w.string(i.kind)?Qs.is(i)||ea.is(i)||ta.is(i):pl.is(i)))}t.is=e})(Ud||(Ud={}));Js=class{constructor(e,r){this.edits=e,this.changeAnnotations=r}insert(e,r,n){let i,o;if(n===void 0?i=pn.insert(e,r):Dt.is(n)?(o=n,i=jn.insert(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),i=jn.insert(e,r,o)),this.edits.push(i),o!==void 0)return o}replace(e,r,n){let i,o;if(n===void 0?i=pn.replace(e,r):Dt.is(n)?(o=n,i=jn.replace(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),i=jn.replace(e,r,o)),this.edits.push(i),o!==void 0)return o}delete(e,r){let n,i;if(r===void 0?n=pn.del(e):Dt.is(r)?(i=r,n=jn.del(e,r)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(r),n=jn.del(e,i)),this.edits.push(n),i!==void 0)return i}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},Bd=class{constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,r){let n;if(Dt.is(e)?n=e:(n=this.nextId(),r=e),this._annotations[n]!==void 0)throw new Error(`Id ${n} is already in use.`);if(r===void 0)throw new Error(`No annotation provided for id ${n}`);return this._annotations[n]=r,this._size++,n}nextId(){return this._counter++,this._counter.toString()}},ey=class{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Bd(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(r=>{if(pl.is(r)){let n=new Js(r.edits,this._changeAnnotations);this._textEditChanges[r.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(r=>{let n=new Js(e.changes[r]);this._textEditChanges[r]=n})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(hl.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let r={uri:e.uri,version:e.version},n=this._textEditChanges[r.uri];if(!n){let i=[],o={textDocument:r,edits:i};this._workspaceEdit.documentChanges.push(o),n=new Js(i,this._changeAnnotations),this._textEditChanges[r.uri]=n}return n}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let r=this._textEditChanges[e];if(!r){let n=[];this._workspaceEdit.changes[e]=n,r=new Js(n),this._textEditChanges[e]=r}return r}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Bd,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;Io.is(r)||Dt.is(r)?i=r:n=r;let o,s;if(i===void 0?o=Qs.create(e,n):(s=Dt.is(i)?i:this._changeAnnotations.manage(i),o=Qs.create(e,n,s)),this._workspaceEdit.documentChanges.push(o),s!==void 0)return s}renameFile(e,r,n,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let o;Io.is(n)||Dt.is(n)?o=n:i=n;let s,a;if(o===void 0?s=ea.create(e,r,i):(a=Dt.is(o)?o:this._changeAnnotations.manage(o),s=ea.create(e,r,i,a)),this._workspaceEdit.documentChanges.push(s),a!==void 0)return a}deleteFile(e,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;Io.is(r)||Dt.is(r)?i=r:n=r;let o,s;if(i===void 0?o=ta.create(e,n):(s=Dt.is(i)?i:this._changeAnnotations.manage(i),o=ta.create(e,n,s)),this._workspaceEdit.documentChanges.push(o),s!==void 0)return s}};(function(t){function e(n){return{uri:n}}t.create=e;function r(n){let i=n;return w.defined(i)&&w.string(i.uri)}t.is=r})(ty||(ty={}));(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return w.defined(i)&&w.string(i.uri)&&w.integer(i.version)}t.is=r})(ry||(ry={}));(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return w.defined(i)&&w.string(i.uri)&&(i.version===null||w.integer(i.version))}t.is=r})(hl||(hl={}));(function(t){function e(n,i,o,s){return{uri:n,languageId:i,version:o,text:s}}t.create=e;function r(n){let i=n;return w.defined(i)&&w.string(i.uri)&&w.string(i.languageId)&&w.integer(i.version)&&w.string(i.text)}t.is=r})(ny||(ny={}));(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){let n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(Gd||(Gd={}));(function(t){function e(r){let n=r;return w.objectLiteral(r)&&Gd.is(n.kind)&&w.string(n.value)}t.is=e})(ra||(ra={}));(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(iy||(iy={}));(function(t){t.PlainText=1,t.Snippet=2})(oy||(oy={}));(function(t){t.Deprecated=1})(sy||(sy={}));(function(t){function e(n,i,o){return{newText:n,insert:i,replace:o}}t.create=e;function r(n){let i=n;return i&&w.string(i.newText)&&ve.is(i.insert)&&ve.is(i.replace)}t.is=r})(ay||(ay={}));(function(t){t.asIs=1,t.adjustIndentation=2})(cy||(cy={}));(function(t){function e(r){let n=r;return n&&(w.string(n.detail)||n.detail===void 0)&&(w.string(n.description)||n.description===void 0)}t.is=e})(ly||(ly={}));(function(t){function e(r){return{label:r}}t.create=e})(uy||(uy={}));(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(fy||(fy={}));(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function r(n){let i=n;return w.string(i)||w.objectLiteral(i)&&w.string(i.language)&&w.string(i.value)}t.is=r})(ml||(ml={}));(function(t){function e(r){let n=r;return!!n&&w.objectLiteral(n)&&(ra.is(n.contents)||ml.is(n.contents)||w.typedArray(n.contents,ml.is))&&(r.range===void 0||ve.is(r.range))}t.is=e})(dy||(dy={}));(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(py||(py={}));(function(t){function e(r,n,...i){let o={label:r};return w.defined(n)&&(o.documentation=n),w.defined(i)?o.parameters=i:o.parameters=[],o}t.create=e})(hy||(hy={}));(function(t){t.Text=1,t.Read=2,t.Write=3})(my||(my={}));(function(t){function e(r,n){let i={range:r};return w.number(n)&&(i.kind=n),i}t.create=e})(gy||(gy={}));(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(yy||(yy={}));(function(t){t.Deprecated=1})(xy||(xy={}));(function(t){function e(r,n,i,o,s){let a={name:r,kind:n,location:{uri:o,range:i}};return s&&(a.containerName=s),a}t.create=e})(Ty||(Ty={}));(function(t){function e(r,n,i,o){return o!==void 0?{name:r,kind:n,location:{uri:i,range:o}}:{name:r,kind:n,location:{uri:i}}}t.create=e})(_y||(_y={}));(function(t){function e(n,i,o,s,a,c){let l={name:n,detail:i,kind:o,range:s,selectionRange:a};return c!==void 0&&(l.children=c),l}t.create=e;function r(n){let i=n;return i&&w.string(i.name)&&w.number(i.kind)&&ve.is(i.range)&&ve.is(i.selectionRange)&&(i.detail===void 0||w.string(i.detail))&&(i.deprecated===void 0||w.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=r})(Ey||(Ey={}));(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(vy||(vy={}));(function(t){t.Invoked=1,t.Automatic=2})(gl||(gl={}));(function(t){function e(n,i,o){let s={diagnostics:n};return i!=null&&(s.only=i),o!=null&&(s.triggerKind=o),s}t.create=e;function r(n){let i=n;return w.defined(i)&&w.typedArray(i.diagnostics,dl.is)&&(i.only===void 0||w.typedArray(i.only,w.string))&&(i.triggerKind===void 0||i.triggerKind===gl.Invoked||i.triggerKind===gl.Automatic)}t.is=r})(Ry||(Ry={}));(function(t){function e(n,i,o){let s={title:n},a=!0;return typeof i=="string"?(a=!1,s.kind=i):ko.is(i)?s.command=i:s.edit=i,a&&o!==void 0&&(s.kind=o),s}t.create=e;function r(n){let i=n;return i&&w.string(i.title)&&(i.diagnostics===void 0||w.typedArray(i.diagnostics,dl.is))&&(i.kind===void 0||w.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||ko.is(i.command))&&(i.isPreferred===void 0||w.boolean(i.isPreferred))&&(i.edit===void 0||Ud.is(i.edit))}t.is=r})(wy||(wy={}));(function(t){function e(n,i){let o={range:n};return w.defined(i)&&(o.data=i),o}t.create=e;function r(n){let i=n;return w.defined(i)&&ve.is(i.range)&&(w.undefined(i.command)||ko.is(i.command))}t.is=r})(by||(by={}));(function(t){function e(n,i){return{tabSize:n,insertSpaces:i}}t.create=e;function r(n){let i=n;return w.defined(i)&&w.uinteger(i.tabSize)&&w.boolean(i.insertSpaces)}t.is=r})(Ay||(Ay={}));(function(t){function e(n,i,o){return{range:n,target:i,data:o}}t.create=e;function r(n){let i=n;return w.defined(i)&&ve.is(i.range)&&(w.undefined(i.target)||w.string(i.target))}t.is=r})(Sy||(Sy={}));(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return w.objectLiteral(i)&&ve.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(Iy||(Iy={}));(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(ky||(ky={}));(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(Ny||(Ny={}));(function(t){function e(r){let n=r;return w.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}t.is=e})(Py||(Py={}));(function(t){function e(n,i){return{range:n,text:i}}t.create=e;function r(n){let i=n;return i!=null&&ve.is(i.range)&&w.string(i.text)}t.is=r})(Cy||(Cy={}));(function(t){function e(n,i,o){return{range:n,variableName:i,caseSensitiveLookup:o}}t.create=e;function r(n){let i=n;return i!=null&&ve.is(i.range)&&w.boolean(i.caseSensitiveLookup)&&(w.string(i.variableName)||i.variableName===void 0)}t.is=r})(Oy||(Oy={}));(function(t){function e(n,i){return{range:n,expression:i}}t.create=e;function r(n){let i=n;return i!=null&&ve.is(i.range)&&(w.string(i.expression)||i.expression===void 0)}t.is=r})(Ly||(Ly={}));(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){let i=n;return w.defined(i)&&ve.is(n.stoppedLocation)}t.is=r})(Dy||(Dy={}));(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(Xd||(Xd={}));(function(t){function e(n){return{value:n}}t.create=e;function r(n){let i=n;return w.objectLiteral(i)&&(i.tooltip===void 0||w.string(i.tooltip)||ra.is(i.tooltip))&&(i.location===void 0||fl.is(i.location))&&(i.command===void 0||ko.is(i.command))}t.is=r})(Hd||(Hd={}));(function(t){function e(n,i,o){let s={position:n,label:i};return o!==void 0&&(s.kind=o),s}t.create=e;function r(n){let i=n;return w.objectLiteral(i)&&ke.is(i.position)&&(w.string(i.label)||w.typedArray(i.label,Hd.is))&&(i.kind===void 0||Xd.is(i.kind))&&i.textEdits===void 0||w.typedArray(i.textEdits,pn.is)&&(i.tooltip===void 0||w.string(i.tooltip)||ra.is(i.tooltip))&&(i.paddingLeft===void 0||w.boolean(i.paddingLeft))&&(i.paddingRight===void 0||w.boolean(i.paddingRight))}t.is=r})($y||($y={}));(function(t){function e(r){return{kind:"snippet",value:r}}t.createSnippet=e})(My||(My={}));(function(t){function e(r,n,i,o){return{insertText:r,filterText:n,range:i,command:o}}t.create=e})(Fy||(Fy={}));(function(t){function e(r){return{items:r}}t.create=e})(Uy||(Uy={}));(function(t){t.Invoked=0,t.Automatic=1})(By||(By={}));(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(Gy||(Gy={}));(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(Xy||(Xy={}));(function(t){function e(r){let n=r;return w.objectLiteral(n)&&$d.is(n.uri)&&w.string(n.name)}t.is=e})(Hy||(Hy={}));MF=[`
3
3
  `,`\r
4
- `,"\r"];(function(t){function e(o,s,a,c){return new Dy(o,s,a,c)}t.create=e;function r(o){let s=o;return!!(b.defined(s)&&b.string(s.uri)&&(b.undefined(s.languageId)||b.string(s.languageId))&&b.uinteger(s.lineCount)&&b.func(s.getText)&&b.func(s.positionAt)&&b.func(s.offsetAt))}t.is=r;function n(o,s){let a=o.getText(),c=i(s,(u,f)=>{let d=u.range.start.line-f.range.start.line;return d===0?u.range.start.character-f.range.start.character:d}),l=a.length;for(let u=c.length-1;u>=0;u--){let f=c[u],d=o.offsetAt(f.range.start),p=o.offsetAt(f.range.end);if(p<=l)a=a.substring(0,d)+f.newText+a.substring(p,a.length);else throw new Error("Overlapping edit");l=d}return a}t.applyEdits=n;function i(o,s){if(o.length<=1)return o;let a=o.length/2|0,c=o.slice(0,a),l=o.slice(a);i(c,s),i(l,s);let u=0,f=0,d=0;for(;u<c.length&&f<l.length;)s(c[u],l[f])<=0?o[d++]=c[u++]:o[d++]=l[f++];for(;u<c.length;)o[d++]=c[u++];for(;f<l.length;)o[d++]=l[f++];return o}})(Ly||(Ly={}));Dy=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){this._content=e.text,this._version=r,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],r=this._content,n=!0;for(let i=0;i<r.length;i++){n&&(e.push(i),n=!1);let o=r.charAt(i);n=o==="\r"||o===`
4
+ `,"\r"];(function(t){function e(o,s,a,c){return new zy(o,s,a,c)}t.create=e;function r(o){let s=o;return!!(w.defined(s)&&w.string(s.uri)&&(w.undefined(s.languageId)||w.string(s.languageId))&&w.uinteger(s.lineCount)&&w.func(s.getText)&&w.func(s.positionAt)&&w.func(s.offsetAt))}t.is=r;function n(o,s){let a=o.getText(),c=i(s,(u,f)=>{let d=u.range.start.line-f.range.start.line;return d===0?u.range.start.character-f.range.start.character:d}),l=a.length;for(let u=c.length-1;u>=0;u--){let f=c[u],d=o.offsetAt(f.range.start),p=o.offsetAt(f.range.end);if(p<=l)a=a.substring(0,d)+f.newText+a.substring(p,a.length);else throw new Error("Overlapping edit");l=d}return a}t.applyEdits=n;function i(o,s){if(o.length<=1)return o;let a=o.length/2|0,c=o.slice(0,a),l=o.slice(a);i(c,s),i(l,s);let u=0,f=0,d=0;for(;u<c.length&&f<l.length;)s(c[u],l[f])<=0?o[d++]=c[u++]:o[d++]=l[f++];for(;u<c.length;)o[d++]=c[u++];for(;f<l.length;)o[d++]=l[f++];return o}})(jy||(jy={}));zy=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){this._content=e.text,this._version=r,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],r=this._content,n=!0;for(let i=0;i<r.length;i++){n&&(e.push(i),n=!1);let o=r.charAt(i);n=o==="\r"||o===`
5
5
  `,o==="\r"&&i+1<r.length&&r.charAt(i+1)===`
6
- `&&i++}n&&r.length>0&&e.push(r.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return ke.create(0,e);for(;n<i;){let s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}let o=n-1;return ke.create(o,e-r[o])}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1<r.length?r[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)}get lineCount(){return this.getLineOffsets().length}};(function(t){let e=Object.prototype.toString;function r(p){return typeof p<"u"}t.defined=r;function n(p){return typeof p>"u"}t.undefined=n;function i(p){return p===!0||p===!1}t.boolean=i;function o(p){return e.call(p)==="[object String]"}t.string=o;function s(p){return e.call(p)==="[object Number]"}t.number=s;function a(p,m,y){return e.call(p)==="[object Number]"&&m<=p&&p<=y}t.numberRange=a;function c(p){return e.call(p)==="[object Number]"&&-2147483648<=p&&p<=2147483647}t.integer=c;function l(p){return e.call(p)==="[object Number]"&&0<=p&&p<=2147483647}t.uinteger=l;function u(p){return e.call(p)==="[object Function]"}t.func=u;function f(p){return p!==null&&typeof p=="object"}t.objectLiteral=f;function d(p,m){return Array.isArray(p)&&p.every(m)}t.typedArray=d})(b||(b={}))});var qy=ce(Wy=>{"use strict";Object.defineProperty(Wy,"__esModule",{value:!0});var Hy;function jy(){if(Hy===void 0)throw new Error("No runtime abstraction layer installed");return Hy}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");Hy=r}t.install=e})(jy||(jy={}));Wy.default=jy});var NA=ce(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.stringArray=Ut.array=Ut.func=Ut.error=Ut.number=Ut.string=Ut.boolean=void 0;function gF(t){return t===!0||t===!1}Ut.boolean=gF;function vA(t){return typeof t=="string"||t instanceof String}Ut.string=vA;function yF(t){return typeof t=="number"||t instanceof Number}Ut.number=yF;function xF(t){return t instanceof Error}Ut.error=xF;function TF(t){return typeof t=="function"}Ut.func=TF;function kA(t){return Array.isArray(t)}Ut.array=kA;function _F(t){return kA(t)&&t.every(e=>vA(e))}Ut.stringArray=_F});var Vy=ce(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.Emitter=ea.Event=void 0;var EF=qy(),PA;(function(t){let e={dispose(){}};t.None=function(){return e}})(PA||(ea.Event=PA={}));var zy=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=n.length;o<s;o++)try{r.push(n[o].apply(i[o],e))}catch(a){(0,EF.default)().console.error(a)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Bd=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new zy),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};ea.Emitter=Bd;Bd._noop=function(){}});var CA=ce(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.CancellationTokenSource=ta.CancellationToken=void 0;var RF=qy(),bF=NA(),Yy=Vy(),Xd;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Yy.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Yy.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||bF.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(Xd||(ta.CancellationToken=Xd={}));var wF=Object.freeze(function(t,e){let r=(0,RF.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),Gd=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?wF:(this._emitter||(this._emitter=new Yy.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Ky=class{get token(){return this._token||(this._token=new Gd),this._token}cancel(){this._token?this._token.cancel():this._token=Xd.Cancelled}dispose(){this._token?this._token instanceof Gd&&this._token.dispose():this._token=Xd.None}};ta.CancellationTokenSource=Ky});var ca=ce(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.stringArray=Xt.array=Xt.func=Xt.error=Xt.number=Xt.string=Xt.boolean=void 0;function SF(t){return t===!0||t===!1}Xt.boolean=SF;function jA(t){return typeof t=="string"||t instanceof String}Xt.string=jA;function vF(t){return typeof t=="number"||t instanceof Number}Xt.number=vF;function kF(t){return t instanceof Error}Xt.error=kF;function NF(t){return typeof t=="function"}Xt.func=NF;function WA(t){return Array.isArray(t)}Xt.array=WA;function PF(t){return WA(t)&&t.every(e=>jA(e))}Xt.stringArray=PF});var Ax=ce(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.Message=Q.NotificationType9=Q.NotificationType8=Q.NotificationType7=Q.NotificationType6=Q.NotificationType5=Q.NotificationType4=Q.NotificationType3=Q.NotificationType2=Q.NotificationType1=Q.NotificationType0=Q.NotificationType=Q.RequestType9=Q.RequestType8=Q.RequestType7=Q.RequestType6=Q.RequestType5=Q.RequestType4=Q.RequestType3=Q.RequestType2=Q.RequestType1=Q.RequestType=Q.RequestType0=Q.AbstractMessageSignature=Q.ParameterStructures=Q.ResponseError=Q.ErrorCodes=void 0;var Lo=ca(),tx;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(tx||(Q.ErrorCodes=tx={}));var rx=class t extends Error{constructor(e,r,n){super(r),this.code=Lo.number(e)?e:tx.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};Q.ResponseError=rx;var rr=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};Q.ParameterStructures=rr;rr.auto=new rr("auto");rr.byPosition=new rr("byPosition");rr.byName=new rr("byName");var nt=class{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return rr.auto}};Q.AbstractMessageSignature=nt;var nx=class extends nt{constructor(e){super(e,0)}};Q.RequestType0=nx;var ix=class extends nt{constructor(e,r=rr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};Q.RequestType=ix;var ox=class extends nt{constructor(e,r=rr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};Q.RequestType1=ox;var sx=class extends nt{constructor(e){super(e,2)}};Q.RequestType2=sx;var ax=class extends nt{constructor(e){super(e,3)}};Q.RequestType3=ax;var cx=class extends nt{constructor(e){super(e,4)}};Q.RequestType4=cx;var lx=class extends nt{constructor(e){super(e,5)}};Q.RequestType5=lx;var ux=class extends nt{constructor(e){super(e,6)}};Q.RequestType6=ux;var fx=class extends nt{constructor(e){super(e,7)}};Q.RequestType7=fx;var dx=class extends nt{constructor(e){super(e,8)}};Q.RequestType8=dx;var px=class extends nt{constructor(e){super(e,9)}};Q.RequestType9=px;var hx=class extends nt{constructor(e,r=rr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};Q.NotificationType=hx;var mx=class extends nt{constructor(e){super(e,0)}};Q.NotificationType0=mx;var gx=class extends nt{constructor(e,r=rr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};Q.NotificationType1=gx;var yx=class extends nt{constructor(e){super(e,2)}};Q.NotificationType2=yx;var xx=class extends nt{constructor(e){super(e,3)}};Q.NotificationType3=xx;var Tx=class extends nt{constructor(e){super(e,4)}};Q.NotificationType4=Tx;var _x=class extends nt{constructor(e){super(e,5)}};Q.NotificationType5=_x;var Ex=class extends nt{constructor(e){super(e,6)}};Q.NotificationType6=Ex;var Rx=class extends nt{constructor(e){super(e,7)}};Q.NotificationType7=Rx;var bx=class extends nt{constructor(e){super(e,8)}};Q.NotificationType8=bx;var wx=class extends nt{constructor(e){super(e,9)}};Q.NotificationType9=wx;var qA;(function(t){function e(i){let o=i;return o&&Lo.string(o.method)&&(Lo.string(o.id)||Lo.number(o.id))}t.isRequest=e;function r(i){let o=i;return o&&Lo.string(o.method)&&i.id===void 0}t.isNotification=r;function n(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(Lo.string(o.id)||Lo.number(o.id)||o.id===null)}t.isResponse=n})(qA||(Q.Message=qA={}))});var Sx=ce(bi=>{"use strict";var zA;Object.defineProperty(bi,"__esModule",{value:!0});bi.LRUCache=bi.LinkedMap=bi.Touch=void 0;var Gt;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Gt||(bi.Touch=Gt={}));var Yd=class{constructor(){this[zA]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=Gt.None){let n=this._map.get(e);if(n)return r!==Gt.None&&this.touch(n,r),n.value}set(e,r,n=Gt.None){let i=this._map.get(e);if(i)i.value=r,n!==Gt.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case Gt.None:this.addItemLast(i);break;case Gt.First:this.addItemFirst(i);break;case Gt.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(zA=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==Gt.First&&r!==Gt.Last)){if(r===Gt.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===Gt.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};bi.LinkedMap=Yd;var Ix=class extends Yd{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=Gt.AsNew){return super.get(e,r)}peek(e){return super.get(e,Gt.None)}set(e,r){return super.set(e,r,Gt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};bi.LRUCache=Ix});var YA=ce(Kd=>{"use strict";Object.defineProperty(Kd,"__esModule",{value:!0});Kd.Disposable=void 0;var VA;(function(t){function e(r){return{dispose:r}}t.create=e})(VA||(Kd.Disposable=VA={}))});var wi=ce(Nx=>{"use strict";Object.defineProperty(Nx,"__esModule",{value:!0});var vx;function kx(){if(vx===void 0)throw new Error("No runtime abstraction layer installed");return vx}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");vx=r}t.install=e})(kx||(kx={}));Nx.default=kx});var ua=ce(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.Emitter=la.Event=void 0;var CF=wi(),KA;(function(t){let e={dispose(){}};t.None=function(){return e}})(KA||(la.Event=KA={}));var Px=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=n.length;o<s;o++)try{r.push(n[o].apply(i[o],e))}catch(a){(0,CF.default)().console.error(a)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Zd=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new Px),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};la.Emitter=Zd;Zd._noop=function(){}});var ep=ce(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});fa.CancellationTokenSource=fa.CancellationToken=void 0;var OF=wi(),LF=ca(),Cx=ua(),Jd;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Cx.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Cx.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||LF.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(Jd||(fa.CancellationToken=Jd={}));var DF=Object.freeze(function(t,e){let r=(0,OF.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),Qd=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?DF:(this._emitter||(this._emitter=new Cx.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Ox=class{get token(){return this._token||(this._token=new Qd),this._token}cancel(){this._token?this._token.cancel():this._token=Jd.Cancelled}dispose(){this._token?this._token instanceof Qd&&this._token.dispose():this._token=Jd.None}};fa.CancellationTokenSource=Ox});var ZA=ce(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.SharedArrayReceiverStrategy=da.SharedArraySenderStrategy=void 0;var $F=ep(),Ll;(function(t){t.Continue=0,t.Cancelled=1})(Ll||(Ll={}));var Lx=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=Ll.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let i=new Int32Array(n,0,1);Atomics.store(i,0,Ll.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};da.SharedArraySenderStrategy=Lx;var Dx=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Ll.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},$x=class{constructor(e){this.token=new Dx(e)}cancel(){}dispose(){}},Mx=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new $F.CancellationTokenSource:new $x(r)}};da.SharedArrayReceiverStrategy=Mx});var Ux=ce(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});tp.Semaphore=void 0;var MF=wi(),Fx=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,MF.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};tp.Semaphore=Fx});var QA=ce(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.ReadableStreamMessageReader=Ai.AbstractMessageReader=Ai.MessageReader=void 0;var Xx=wi(),pa=ca(),Bx=ua(),FF=Ux(),JA;(function(t){function e(r){let n=r;return n&&pa.func(n.listen)&&pa.func(n.dispose)&&pa.func(n.onError)&&pa.func(n.onClose)&&pa.func(n.onPartialMessage)}t.is=e})(JA||(Ai.MessageReader=JA={}));var rp=class{constructor(){this.errorEmitter=new Bx.Emitter,this.closeEmitter=new Bx.Emitter,this.partialMessageEmitter=new Bx.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${pa.string(e.message)?e.message:"unknown"}`)}};Ai.AbstractMessageReader=rp;var Gx;(function(t){function e(r){let n,i,o,s=new Map,a,c=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(o=r.contentDecoder,s.set(o.name,o)),r.contentDecoders!==void 0)for(let l of r.contentDecoders)s.set(l.name,l);if(r.contentTypeDecoder!==void 0&&(a=r.contentTypeDecoder,c.set(a.name,a)),r.contentTypeDecoders!==void 0)for(let l of r.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,Xx.default)().applicationJson.decoder,c.set(a.name,a)),{charset:n,contentDecoder:o,contentDecoders:s,contentTypeDecoder:a,contentTypeDecoders:c}}t.fromOptions=e})(Gx||(Gx={}));var Hx=class extends rp{constructor(e,r){super(),this.readable=e,this.options=Gx.fromOptions(r),this.buffer=(0,Xx.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new FF.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let i=n.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
7
- ${JSON.stringify(Object.fromEntries(n))}`));return}let o=parseInt(i);if(isNaN(o)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=o}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,i=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(i)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Xx.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Ai.ReadableStreamMessageReader=Hx});var i0=ce(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.WriteableStreamMessageWriter=Ii.AbstractMessageWriter=Ii.MessageWriter=void 0;var e0=wi(),Dl=ca(),UF=Ux(),t0=ua(),BF="Content-Length: ",r0=`\r
8
- `,n0;(function(t){function e(r){let n=r;return n&&Dl.func(n.dispose)&&Dl.func(n.onClose)&&Dl.func(n.onError)&&Dl.func(n.write)}t.is=e})(n0||(Ii.MessageWriter=n0={}));var np=class{constructor(){this.errorEmitter=new t0.Emitter,this.closeEmitter=new t0.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${Dl.string(e.message)?e.message:"unknown"}`)}};Ii.AbstractMessageWriter=np;var jx;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,e0.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,e0.default)().applicationJson.encoder}}t.fromOptions=e})(jx||(jx={}));var Wx=class extends np{constructor(e,r){super(),this.writable=e,this.options=jx.fromOptions(r),this.errorCount=0,this.writeSemaphore=new UF.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(BF,n.byteLength.toString(),r0),i.push(r0),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};Ii.WriteableStreamMessageWriter=Wx});var o0=ce(ip=>{"use strict";Object.defineProperty(ip,"__esModule",{value:!0});ip.AbstractMessageBuffer=void 0;var XF=13,GF=10,HF=`\r
9
- `,qx=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,i=0,o=0;e:for(;n<this._chunks.length;){let l=this._chunks[n];for(i=0;i<l.length;){switch(l[i]){case XF:switch(r){case 0:r=1;break;case 2:r=3;break;default:r=0}break;case GF:switch(r){case 1:r=2;break;case 3:r=4,i++;break e;default:r=0}break;default:r=0}i++}o+=l.byteLength,n++}if(r!==4)return;let s=this._read(o+i),a=new Map,c=this.toString(s,"ascii").split(HF);if(c.length<2)return a;for(let l=0;l<c.length-2;l++){let u=c[l],f=u.indexOf(":");if(f===-1)throw new Error(`Message header must separate key and value using ':'
10
- ${u}`);let d=u.substr(0,f),p=u.substr(f+1).trim();a.set(e?d.toLowerCase():d,p)}return a}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let o=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(o)}if(this._chunks[0].byteLength>e){let o=this._chunks[0],s=this.asNative(o,e);return this._chunks[0]=o.slice(e),this._totalLength-=e,s}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let o=this._chunks[i];if(o.byteLength>e){let s=o.slice(0,e);r.set(s,n),n+=e,this._chunks[i]=o.slice(e),this._totalLength-=e,e-=e}else r.set(o,n),n+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,e-=o.byteLength}return r}};ip.AbstractMessageBuffer=qx});var u0=ce(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.createMessageConnection=fe.ConnectionOptions=fe.MessageStrategy=fe.CancellationStrategy=fe.CancellationSenderStrategy=fe.CancellationReceiverStrategy=fe.RequestCancellationReceiverStrategy=fe.IdCancellationReceiverStrategy=fe.ConnectionStrategy=fe.ConnectionError=fe.ConnectionErrors=fe.LogTraceNotification=fe.SetTraceNotification=fe.TraceFormat=fe.TraceValues=fe.Trace=fe.NullLogger=fe.ProgressType=fe.ProgressToken=void 0;var s0=wi(),gt=ca(),ae=Ax(),a0=Sx(),$l=ua(),zx=ep(),Ul;(function(t){t.type=new ae.NotificationType("$/cancelRequest")})(Ul||(Ul={}));var Vx;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(Vx||(fe.ProgressToken=Vx={}));var Ml;(function(t){t.type=new ae.NotificationType("$/progress")})(Ml||(Ml={}));var Yx=class{constructor(){}};fe.ProgressType=Yx;var Kx;(function(t){function e(r){return gt.func(r)}t.is=e})(Kx||(Kx={}));fe.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var De;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(De||(fe.Trace=De={}));var c0;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(c0||(fe.TraceValues=c0={}));(function(t){function e(n){if(!gt.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=r})(De||(fe.Trace=De={}));var hr;(function(t){t.Text="text",t.JSON="json"})(hr||(fe.TraceFormat=hr={}));(function(t){function e(r){return gt.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(hr||(fe.TraceFormat=hr={}));var Zx;(function(t){t.type=new ae.NotificationType("$/setTrace")})(Zx||(fe.SetTraceNotification=Zx={}));var op;(function(t){t.type=new ae.NotificationType("$/logTrace")})(op||(fe.LogTraceNotification=op={}));var Fl;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Fl||(fe.ConnectionErrors=Fl={}));var ha=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};fe.ConnectionError=ha;var Jx;(function(t){function e(r){let n=r;return n&&gt.func(n.cancelUndispatched)}t.is=e})(Jx||(fe.ConnectionStrategy=Jx={}));var sp;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&gt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||gt.func(n.dispose))}t.is=e})(sp||(fe.IdCancellationReceiverStrategy=sp={}));var Qx;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&gt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||gt.func(n.dispose))}t.is=e})(Qx||(fe.RequestCancellationReceiverStrategy=Qx={}));var ap;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new zx.CancellationTokenSource}});function e(r){return sp.is(r)||Qx.is(r)}t.is=e})(ap||(fe.CancellationReceiverStrategy=ap={}));var cp;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(Ul.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&gt.func(n.sendCancellation)&&gt.func(n.cleanup)}t.is=e})(cp||(fe.CancellationSenderStrategy=cp={}));var lp;(function(t){t.Message=Object.freeze({receiver:ap.Message,sender:cp.Message});function e(r){let n=r;return n&&ap.is(n.receiver)&&cp.is(n.sender)}t.is=e})(lp||(fe.CancellationStrategy=lp={}));var up;(function(t){function e(r){let n=r;return n&&gt.func(n.handleMessage)}t.is=e})(up||(fe.MessageStrategy=up={}));var l0;(function(t){function e(r){let n=r;return n&&(lp.is(n.cancellationStrategy)||Jx.is(n.connectionStrategy)||up.is(n.messageStrategy))}t.is=e})(l0||(fe.ConnectionOptions=l0={}));var Gr;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(Gr||(Gr={}));function jF(t,e,r,n){let i=r!==void 0?r:fe.NullLogger,o=0,s=0,a=0,c="2.0",l,u=new Map,f,d=new Map,p=new Map,m,y=new a0.LinkedMap,R=new Map,T=new Set,E=new Map,_=De.Off,k=hr.Text,D,C=Gr.New,j=new $l.Emitter,V=new $l.Emitter,ie=new $l.Emitter,Ae=new $l.Emitter,O=new $l.Emitter,w=n&&n.cancellationStrategy?n.cancellationStrategy:lp.Message;function L(x){if(x===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+x.toString()}function M(x){return x===null?"res-unknown-"+(++a).toString():"res-"+x.toString()}function A(){return"not-"+(++s).toString()}function I(x,N){ae.Message.isRequest(N)?x.set(L(N.id),N):ae.Message.isResponse(N)?x.set(M(N.id),N):x.set(A(),N)}function S(x){}function B(){return C===Gr.Listening}function H(){return C===Gr.Closed}function $(){return C===Gr.Disposed}function q(){(C===Gr.New||C===Gr.Listening)&&(C=Gr.Closed,V.fire(void 0))}function K(x){j.fire([x,void 0,void 0])}function xe(x){j.fire(x)}t.onClose(q),t.onError(K),e.onClose(q),e.onError(xe);function Y(){m||y.size===0||(m=(0,s0.default)().timer.setImmediate(()=>{m=void 0,it()}))}function pe(x){ae.Message.isRequest(x)?Ye(x):ae.Message.isNotification(x)?Z(x):ae.Message.isResponse(x)?G(x):ee(x)}function it(){if(y.size===0)return;let x=y.shift();try{let N=n?.messageStrategy;up.is(N)?N.handleMessage(x,pe):pe(x)}finally{Y()}}let We=x=>{try{if(ae.Message.isNotification(x)&&x.method===Ul.type.method){let N=x.params.id,X=L(N),z=y.get(X);if(ae.Message.isRequest(z)){let Se=n?.connectionStrategy,Le=Se&&Se.cancelUndispatched?Se.cancelUndispatched(z,S):void 0;if(Le&&(Le.error!==void 0||Le.result!==void 0)){y.delete(X),E.delete(N),Le.id=z.id,Ue(Le,x.method,Date.now()),e.write(Le).catch(()=>i.error("Sending response for canceled message failed."));return}}let Be=E.get(N);if(Be!==void 0){Be.cancel(),U(x);return}else T.add(N)}I(y,x)}finally{Y()}};function Ye(x){if($())return;function N(ye,$e,ve){let dt={jsonrpc:c,id:x.id};ye instanceof ae.ResponseError?dt.error=ye.toJson():dt.result=ye===void 0?null:ye,Ue(dt,$e,ve),e.write(dt).catch(()=>i.error("Sending response failed."))}function X(ye,$e,ve){let dt={jsonrpc:c,id:x.id,error:ye.toJson()};Ue(dt,$e,ve),e.write(dt).catch(()=>i.error("Sending response failed."))}function z(ye,$e,ve){ye===void 0&&(ye=null);let dt={jsonrpc:c,id:x.id,result:ye};Ue(dt,$e,ve),e.write(dt).catch(()=>i.error("Sending response failed."))}ft(x);let Be=u.get(x.method),Se,Le;Be&&(Se=Be.type,Le=Be.handler);let je=Date.now();if(Le||l){let ye=x.id??String(Date.now()),$e=sp.is(w.receiver)?w.receiver.createCancellationTokenSource(ye):w.receiver.createCancellationTokenSource(x);x.id!==null&&T.has(x.id)&&$e.cancel(),x.id!==null&&E.set(ye,$e);try{let ve;if(Le)if(x.params===void 0){if(Se!==void 0&&Se.numberOfParams!==0){X(new ae.ResponseError(ae.ErrorCodes.InvalidParams,`Request ${x.method} defines ${Se.numberOfParams} params but received none.`),x.method,je);return}ve=Le($e.token)}else if(Array.isArray(x.params)){if(Se!==void 0&&Se.parameterStructures===ae.ParameterStructures.byName){X(new ae.ResponseError(ae.ErrorCodes.InvalidParams,`Request ${x.method} defines parameters by name but received parameters by position`),x.method,je);return}ve=Le(...x.params,$e.token)}else{if(Se!==void 0&&Se.parameterStructures===ae.ParameterStructures.byPosition){X(new ae.ResponseError(ae.ErrorCodes.InvalidParams,`Request ${x.method} defines parameters by position but received parameters by name`),x.method,je);return}ve=Le(x.params,$e.token)}else l&&(ve=l(x.method,x.params,$e.token));let dt=ve;ve?dt.then?dt.then(et=>{E.delete(ye),N(et,x.method,je)},et=>{E.delete(ye),et instanceof ae.ResponseError?X(et,x.method,je):et&&gt.string(et.message)?X(new ae.ResponseError(ae.ErrorCodes.InternalError,`Request ${x.method} failed with message: ${et.message}`),x.method,je):X(new ae.ResponseError(ae.ErrorCodes.InternalError,`Request ${x.method} failed unexpectedly without providing any details.`),x.method,je)}):(E.delete(ye),N(ve,x.method,je)):(E.delete(ye),z(ve,x.method,je))}catch(ve){E.delete(ye),ve instanceof ae.ResponseError?N(ve,x.method,je):ve&&gt.string(ve.message)?X(new ae.ResponseError(ae.ErrorCodes.InternalError,`Request ${x.method} failed with message: ${ve.message}`),x.method,je):X(new ae.ResponseError(ae.ErrorCodes.InternalError,`Request ${x.method} failed unexpectedly without providing any details.`),x.method,je)}}else X(new ae.ResponseError(ae.ErrorCodes.MethodNotFound,`Unhandled method ${x.method}`),x.method,je)}function G(x){if(!$())if(x.id===null)x.error?i.error(`Received response message without id: Error is:
11
- ${JSON.stringify(x.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let N=x.id,X=R.get(N);if(Nr(x,X),X!==void 0){R.delete(N);try{if(x.error){let z=x.error;X.reject(new ae.ResponseError(z.code,z.message,z.data))}else if(x.result!==void 0)X.resolve(x.result);else throw new Error("Should never happen.")}catch(z){z.message?i.error(`Response handler '${X.method}' failed with message: ${z.message}`):i.error(`Response handler '${X.method}' failed unexpectedly.`)}}}}function Z(x){if($())return;let N,X;if(x.method===Ul.type.method){let z=x.params.id;T.delete(z),U(x);return}else{let z=d.get(x.method);z&&(X=z.handler,N=z.type)}if(X||f)try{if(U(x),X)if(x.params===void 0)N!==void 0&&N.numberOfParams!==0&&N.parameterStructures!==ae.ParameterStructures.byName&&i.error(`Notification ${x.method} defines ${N.numberOfParams} params but received none.`),X();else if(Array.isArray(x.params)){let z=x.params;x.method===Ml.type.method&&z.length===2&&Vx.is(z[0])?X({token:z[0],value:z[1]}):(N!==void 0&&(N.parameterStructures===ae.ParameterStructures.byName&&i.error(`Notification ${x.method} defines parameters by name but received parameters by position`),N.numberOfParams!==x.params.length&&i.error(`Notification ${x.method} defines ${N.numberOfParams} params but received ${z.length} arguments`)),X(...z))}else N!==void 0&&N.parameterStructures===ae.ParameterStructures.byPosition&&i.error(`Notification ${x.method} defines parameters by position but received parameters by name`),X(x.params);else f&&f(x.method,x.params)}catch(z){z.message?i.error(`Notification handler '${x.method}' failed with message: ${z.message}`):i.error(`Notification handler '${x.method}' failed unexpectedly.`)}else ie.fire(x)}function ee(x){if(!x){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
12
- ${JSON.stringify(x,null,4)}`);let N=x;if(gt.string(N.id)||gt.number(N.id)){let X=N.id,z=R.get(X);z&&z.reject(new Error("The received response has neither a result nor an error property."))}}function P(x){if(x!=null)switch(_){case De.Verbose:return JSON.stringify(x,null,4);case De.Compact:return JSON.stringify(x);default:return}}function Te(x){if(!(_===De.Off||!D))if(k===hr.Text){let N;(_===De.Verbose||_===De.Compact)&&x.params&&(N=`Params: ${P(x.params)}
6
+ `&&i++}n&&r.length>0&&e.push(r.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return ke.create(0,e);for(;n<i;){let s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}let o=n-1;return ke.create(o,e-r[o])}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1<r.length?r[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)}get lineCount(){return this.getLineOffsets().length}};(function(t){let e=Object.prototype.toString;function r(p){return typeof p<"u"}t.defined=r;function n(p){return typeof p>"u"}t.undefined=n;function i(p){return p===!0||p===!1}t.boolean=i;function o(p){return e.call(p)==="[object String]"}t.string=o;function s(p){return e.call(p)==="[object Number]"}t.number=s;function a(p,m,g){return e.call(p)==="[object Number]"&&m<=p&&p<=g}t.numberRange=a;function c(p){return e.call(p)==="[object Number]"&&-2147483648<=p&&p<=2147483647}t.integer=c;function l(p){return e.call(p)==="[object Number]"&&0<=p&&p<=2147483647}t.uinteger=l;function u(p){return e.call(p)==="[object Function]"}t.func=u;function f(p){return p!==null&&typeof p=="object"}t.objectLiteral=f;function d(p,m){return Array.isArray(p)&&p.every(m)}t.typedArray=d})(w||(w={}))});var rx=ue(tx=>{"use strict";Object.defineProperty(tx,"__esModule",{value:!0});var Qy;function ex(){if(Qy===void 0)throw new Error("No runtime abstraction layer installed");return Qy}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");Qy=r}t.install=e})(ex||(ex={}));tx.default=ex});var Ww=ue(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.stringArray=Bt.array=Bt.func=Bt.error=Bt.number=Bt.string=Bt.boolean=void 0;function YF(t){return t===!0||t===!1}Bt.boolean=YF;function zw(t){return typeof t=="string"||t instanceof String}Bt.string=zw;function KF(t){return typeof t=="number"||t instanceof Number}Bt.number=KF;function ZF(t){return t instanceof Error}Bt.error=ZF;function JF(t){return typeof t=="function"}Bt.func=JF;function qw(t){return Array.isArray(t)}Bt.array=qw;function QF(t){return qw(t)&&t.every(e=>zw(e))}Bt.stringArray=QF});var ix=ue(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.Emitter=sa.Event=void 0;var e2=rx(),Vw;(function(t){let e={dispose(){}};t.None=function(){return e}})(Vw||(sa.Event=Vw={}));var nx=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=n.length;o<s;o++)try{r.push(n[o].apply(i[o],e))}catch(a){(0,e2.default)().console.error(a)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Yd=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new nx),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};sa.Emitter=Yd;Yd._noop=function(){}});var Yw=ue(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.CancellationTokenSource=aa.CancellationToken=void 0;var t2=rx(),r2=Ww(),ox=ix(),Kd;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ox.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ox.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||r2.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(Kd||(aa.CancellationToken=Kd={}));var n2=Object.freeze(function(t,e){let r=(0,t2.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),Zd=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?n2:(this._emitter||(this._emitter=new ox.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},sx=class{get token(){return this._token||(this._token=new Zd),this._token}cancel(){this._token?this._token.cancel():this._token=Kd.Cancelled}dispose(){this._token?this._token instanceof Zd&&this._token.dispose():this._token=Kd.None}};aa.CancellationTokenSource=sx});var ha=ue(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.stringArray=Xt.array=Xt.func=Xt.error=Xt.number=Xt.string=Xt.boolean=void 0;function s2(t){return t===!0||t===!1}Xt.boolean=s2;function ab(t){return typeof t=="string"||t instanceof String}Xt.string=ab;function a2(t){return typeof t=="number"||t instanceof Number}Xt.number=a2;function c2(t){return t instanceof Error}Xt.error=c2;function l2(t){return typeof t=="function"}Xt.func=l2;function cb(t){return Array.isArray(t)}Xt.array=cb;function u2(t){return cb(t)&&t.every(e=>ab(e))}Xt.stringArray=u2});var Dx=ue(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.Message=re.NotificationType9=re.NotificationType8=re.NotificationType7=re.NotificationType6=re.NotificationType5=re.NotificationType4=re.NotificationType3=re.NotificationType2=re.NotificationType1=re.NotificationType0=re.NotificationType=re.RequestType9=re.RequestType8=re.RequestType7=re.RequestType6=re.RequestType5=re.RequestType4=re.RequestType3=re.RequestType2=re.RequestType1=re.RequestType=re.RequestType0=re.AbstractMessageSignature=re.ParameterStructures=re.ResponseError=re.ErrorCodes=void 0;var Uo=ha(),fx;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(fx||(re.ErrorCodes=fx={}));var dx=class t extends Error{constructor(e,r,n){super(r),this.code=Uo.number(e)?e:fx.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};re.ResponseError=dx;var nr=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};re.ParameterStructures=nr;nr.auto=new nr("auto");nr.byPosition=new nr("byPosition");nr.byName=new nr("byName");var ot=class{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return nr.auto}};re.AbstractMessageSignature=ot;var px=class extends ot{constructor(e){super(e,0)}};re.RequestType0=px;var hx=class extends ot{constructor(e,r=nr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};re.RequestType=hx;var mx=class extends ot{constructor(e,r=nr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};re.RequestType1=mx;var gx=class extends ot{constructor(e){super(e,2)}};re.RequestType2=gx;var yx=class extends ot{constructor(e){super(e,3)}};re.RequestType3=yx;var xx=class extends ot{constructor(e){super(e,4)}};re.RequestType4=xx;var Tx=class extends ot{constructor(e){super(e,5)}};re.RequestType5=Tx;var _x=class extends ot{constructor(e){super(e,6)}};re.RequestType6=_x;var Ex=class extends ot{constructor(e){super(e,7)}};re.RequestType7=Ex;var vx=class extends ot{constructor(e){super(e,8)}};re.RequestType8=vx;var Rx=class extends ot{constructor(e){super(e,9)}};re.RequestType9=Rx;var wx=class extends ot{constructor(e,r=nr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};re.NotificationType=wx;var bx=class extends ot{constructor(e){super(e,0)}};re.NotificationType0=bx;var Ax=class extends ot{constructor(e,r=nr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};re.NotificationType1=Ax;var Sx=class extends ot{constructor(e){super(e,2)}};re.NotificationType2=Sx;var Ix=class extends ot{constructor(e){super(e,3)}};re.NotificationType3=Ix;var kx=class extends ot{constructor(e){super(e,4)}};re.NotificationType4=kx;var Nx=class extends ot{constructor(e){super(e,5)}};re.NotificationType5=Nx;var Px=class extends ot{constructor(e){super(e,6)}};re.NotificationType6=Px;var Cx=class extends ot{constructor(e){super(e,7)}};re.NotificationType7=Cx;var Ox=class extends ot{constructor(e){super(e,8)}};re.NotificationType8=Ox;var Lx=class extends ot{constructor(e){super(e,9)}};re.NotificationType9=Lx;var lb;(function(t){function e(i){let o=i;return o&&Uo.string(o.method)&&(Uo.string(o.id)||Uo.number(o.id))}t.isRequest=e;function r(i){let o=i;return o&&Uo.string(o.method)&&i.id===void 0}t.isNotification=r;function n(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(Uo.string(o.id)||Uo.number(o.id)||o.id===null)}t.isResponse=n})(lb||(re.Message=lb={}))});var Mx=ue(Ii=>{"use strict";var ub;Object.defineProperty(Ii,"__esModule",{value:!0});Ii.LRUCache=Ii.LinkedMap=Ii.Touch=void 0;var Ht;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Ht||(Ii.Touch=Ht={}));var ip=class{constructor(){this[ub]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=Ht.None){let n=this._map.get(e);if(n)return r!==Ht.None&&this.touch(n,r),n.value}set(e,r,n=Ht.None){let i=this._map.get(e);if(i)i.value=r,n!==Ht.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case Ht.None:this.addItemLast(i);break;case Ht.First:this.addItemFirst(i);break;case Ht.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(ub=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==Ht.First&&r!==Ht.Last)){if(r===Ht.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===Ht.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};Ii.LinkedMap=ip;var $x=class extends ip{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=Ht.AsNew){return super.get(e,r)}peek(e){return super.get(e,Ht.None)}set(e,r){return super.set(e,r,Ht.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Ii.LRUCache=$x});var db=ue(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});op.Disposable=void 0;var fb;(function(t){function e(r){return{dispose:r}}t.create=e})(fb||(op.Disposable=fb={}))});var ki=ue(Bx=>{"use strict";Object.defineProperty(Bx,"__esModule",{value:!0});var Fx;function Ux(){if(Fx===void 0)throw new Error("No runtime abstraction layer installed");return Fx}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");Fx=r}t.install=e})(Ux||(Ux={}));Bx.default=Ux});var ga=ue(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.Emitter=ma.Event=void 0;var f2=ki(),pb;(function(t){let e={dispose(){}};t.None=function(){return e}})(pb||(ma.Event=pb={}));var Gx=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=n.length;o<s;o++)try{r.push(n[o].apply(i[o],e))}catch(a){(0,f2.default)().console.error(a)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},sp=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new Gx),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};ma.Emitter=sp;sp._noop=function(){}});var lp=ue(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.CancellationTokenSource=ya.CancellationToken=void 0;var d2=ki(),p2=ha(),Xx=ga(),ap;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Xx.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Xx.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||p2.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(ap||(ya.CancellationToken=ap={}));var h2=Object.freeze(function(t,e){let r=(0,d2.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),cp=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?h2:(this._emitter||(this._emitter=new Xx.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Hx=class{get token(){return this._token||(this._token=new cp),this._token}cancel(){this._token?this._token.cancel():this._token=ap.Cancelled}dispose(){this._token?this._token instanceof cp&&this._token.dispose():this._token=ap.None}};ya.CancellationTokenSource=Hx});var hb=ue(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.SharedArrayReceiverStrategy=xa.SharedArraySenderStrategy=void 0;var m2=lp(),Bl;(function(t){t.Continue=0,t.Cancelled=1})(Bl||(Bl={}));var jx=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=Bl.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let i=new Int32Array(n,0,1);Atomics.store(i,0,Bl.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};xa.SharedArraySenderStrategy=jx;var zx=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Bl.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},qx=class{constructor(e){this.token=new zx(e)}cancel(){}dispose(){}},Wx=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new m2.CancellationTokenSource:new qx(r)}};xa.SharedArrayReceiverStrategy=Wx});var Yx=ue(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});up.Semaphore=void 0;var g2=ki(),Vx=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,g2.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};up.Semaphore=Vx});var gb=ue(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.ReadableStreamMessageReader=Ni.AbstractMessageReader=Ni.MessageReader=void 0;var Zx=ki(),Ta=ha(),Kx=ga(),y2=Yx(),mb;(function(t){function e(r){let n=r;return n&&Ta.func(n.listen)&&Ta.func(n.dispose)&&Ta.func(n.onError)&&Ta.func(n.onClose)&&Ta.func(n.onPartialMessage)}t.is=e})(mb||(Ni.MessageReader=mb={}));var fp=class{constructor(){this.errorEmitter=new Kx.Emitter,this.closeEmitter=new Kx.Emitter,this.partialMessageEmitter=new Kx.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${Ta.string(e.message)?e.message:"unknown"}`)}};Ni.AbstractMessageReader=fp;var Jx;(function(t){function e(r){let n,i,o,s=new Map,a,c=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(o=r.contentDecoder,s.set(o.name,o)),r.contentDecoders!==void 0)for(let l of r.contentDecoders)s.set(l.name,l);if(r.contentTypeDecoder!==void 0&&(a=r.contentTypeDecoder,c.set(a.name,a)),r.contentTypeDecoders!==void 0)for(let l of r.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,Zx.default)().applicationJson.decoder,c.set(a.name,a)),{charset:n,contentDecoder:o,contentDecoders:s,contentTypeDecoder:a,contentTypeDecoders:c}}t.fromOptions=e})(Jx||(Jx={}));var Qx=class extends fp{constructor(e,r){super(),this.readable=e,this.options=Jx.fromOptions(r),this.buffer=(0,Zx.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new y2.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let i=n.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
7
+ ${JSON.stringify(Object.fromEntries(n))}`));return}let o=parseInt(i);if(isNaN(o)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=o}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,i=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(i)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Zx.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Ni.ReadableStreamMessageReader=Qx});var Eb=ue(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.WriteableStreamMessageWriter=Pi.AbstractMessageWriter=Pi.MessageWriter=void 0;var yb=ki(),Gl=ha(),x2=Yx(),xb=ga(),T2="Content-Length: ",Tb=`\r
8
+ `,_b;(function(t){function e(r){let n=r;return n&&Gl.func(n.dispose)&&Gl.func(n.onClose)&&Gl.func(n.onError)&&Gl.func(n.write)}t.is=e})(_b||(Pi.MessageWriter=_b={}));var dp=class{constructor(){this.errorEmitter=new xb.Emitter,this.closeEmitter=new xb.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${Gl.string(e.message)?e.message:"unknown"}`)}};Pi.AbstractMessageWriter=dp;var eT;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,yb.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,yb.default)().applicationJson.encoder}}t.fromOptions=e})(eT||(eT={}));var tT=class extends dp{constructor(e,r){super(),this.writable=e,this.options=eT.fromOptions(r),this.errorCount=0,this.writeSemaphore=new x2.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(T2,n.byteLength.toString(),Tb),i.push(Tb),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};Pi.WriteableStreamMessageWriter=tT});var vb=ue(pp=>{"use strict";Object.defineProperty(pp,"__esModule",{value:!0});pp.AbstractMessageBuffer=void 0;var _2=13,E2=10,v2=`\r
9
+ `,rT=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,i=0,o=0;e:for(;n<this._chunks.length;){let l=this._chunks[n];for(i=0;i<l.length;){switch(l[i]){case _2:switch(r){case 0:r=1;break;case 2:r=3;break;default:r=0}break;case E2:switch(r){case 1:r=2;break;case 3:r=4,i++;break e;default:r=0}break;default:r=0}i++}o+=l.byteLength,n++}if(r!==4)return;let s=this._read(o+i),a=new Map,c=this.toString(s,"ascii").split(v2);if(c.length<2)return a;for(let l=0;l<c.length-2;l++){let u=c[l],f=u.indexOf(":");if(f===-1)throw new Error(`Message header must separate key and value using ':'
10
+ ${u}`);let d=u.substr(0,f),p=u.substr(f+1).trim();a.set(e?d.toLowerCase():d,p)}return a}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let o=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(o)}if(this._chunks[0].byteLength>e){let o=this._chunks[0],s=this.asNative(o,e);return this._chunks[0]=o.slice(e),this._totalLength-=e,s}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let o=this._chunks[i];if(o.byteLength>e){let s=o.slice(0,e);r.set(s,n),n+=e,this._chunks[i]=o.slice(e),this._totalLength-=e,e-=e}else r.set(o,n),n+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,e-=o.byteLength}return r}};pp.AbstractMessageBuffer=rT});var Sb=ue(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.createMessageConnection=he.ConnectionOptions=he.MessageStrategy=he.CancellationStrategy=he.CancellationSenderStrategy=he.CancellationReceiverStrategy=he.RequestCancellationReceiverStrategy=he.IdCancellationReceiverStrategy=he.ConnectionStrategy=he.ConnectionError=he.ConnectionErrors=he.LogTraceNotification=he.SetTraceNotification=he.TraceFormat=he.TraceValues=he.Trace=he.NullLogger=he.ProgressType=he.ProgressToken=void 0;var Rb=ki(),yt=ha(),ce=Dx(),wb=Mx(),Xl=ga(),nT=lp(),zl;(function(t){t.type=new ce.NotificationType("$/cancelRequest")})(zl||(zl={}));var iT;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(iT||(he.ProgressToken=iT={}));var Hl;(function(t){t.type=new ce.NotificationType("$/progress")})(Hl||(Hl={}));var oT=class{constructor(){}};he.ProgressType=oT;var sT;(function(t){function e(r){return yt.func(r)}t.is=e})(sT||(sT={}));he.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var $e;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})($e||(he.Trace=$e={}));var bb;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(bb||(he.TraceValues=bb={}));(function(t){function e(n){if(!yt.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=r})($e||(he.Trace=$e={}));var mr;(function(t){t.Text="text",t.JSON="json"})(mr||(he.TraceFormat=mr={}));(function(t){function e(r){return yt.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(mr||(he.TraceFormat=mr={}));var aT;(function(t){t.type=new ce.NotificationType("$/setTrace")})(aT||(he.SetTraceNotification=aT={}));var hp;(function(t){t.type=new ce.NotificationType("$/logTrace")})(hp||(he.LogTraceNotification=hp={}));var jl;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(jl||(he.ConnectionErrors=jl={}));var _a=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};he.ConnectionError=_a;var cT;(function(t){function e(r){let n=r;return n&&yt.func(n.cancelUndispatched)}t.is=e})(cT||(he.ConnectionStrategy=cT={}));var mp;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&yt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||yt.func(n.dispose))}t.is=e})(mp||(he.IdCancellationReceiverStrategy=mp={}));var lT;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&yt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||yt.func(n.dispose))}t.is=e})(lT||(he.RequestCancellationReceiverStrategy=lT={}));var gp;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new nT.CancellationTokenSource}});function e(r){return mp.is(r)||lT.is(r)}t.is=e})(gp||(he.CancellationReceiverStrategy=gp={}));var yp;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(zl.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&yt.func(n.sendCancellation)&&yt.func(n.cleanup)}t.is=e})(yp||(he.CancellationSenderStrategy=yp={}));var xp;(function(t){t.Message=Object.freeze({receiver:gp.Message,sender:yp.Message});function e(r){let n=r;return n&&gp.is(n.receiver)&&yp.is(n.sender)}t.is=e})(xp||(he.CancellationStrategy=xp={}));var Tp;(function(t){function e(r){let n=r;return n&&yt.func(n.handleMessage)}t.is=e})(Tp||(he.MessageStrategy=Tp={}));var Ab;(function(t){function e(r){let n=r;return n&&(xp.is(n.cancellationStrategy)||cT.is(n.connectionStrategy)||Tp.is(n.messageStrategy))}t.is=e})(Ab||(he.ConnectionOptions=Ab={}));var jr;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(jr||(jr={}));function R2(t,e,r,n){let i=r!==void 0?r:he.NullLogger,o=0,s=0,a=0,c="2.0",l,u=new Map,f,d=new Map,p=new Map,m,g=new wb.LinkedMap,v=new Map,T=new Set,_=new Map,E=$e.Off,I=mr.Text,D,k=jr.New,B=new Xl.Emitter,U=new Xl.Emitter,z=new Xl.Emitter,le=new Xl.Emitter,O=new Xl.Emitter,R=n&&n.cancellationStrategy?n.cancellationStrategy:xp.Message;function L(x){if(x===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+x.toString()}function $(x){return x===null?"res-unknown-"+(++a).toString():"res-"+x.toString()}function b(){return"not-"+(++s).toString()}function A(x,C){ce.Message.isRequest(C)?x.set(L(C.id),C):ce.Message.isResponse(C)?x.set($(C.id),C):x.set(b(),C)}function S(x){}function M(){return k===jr.Listening}function X(){return k===jr.Closed}function F(){return k===jr.Disposed}function W(){(k===jr.New||k===jr.Listening)&&(k=jr.Closed,U.fire(void 0))}function K(x){B.fire([x,void 0,void 0])}function pe(x){B.fire(x)}t.onClose(W),t.onError(K),e.onClose(W),e.onError(pe);function V(){m||g.size===0||(m=(0,Rb.default)().timer.setImmediate(()=>{m=void 0,Le()}))}function ee(x){ce.Message.isRequest(x)?Ue(x):ce.Message.isNotification(x)?J(x):ce.Message.isResponse(x)?q(x):te(x)}function Le(){if(g.size===0)return;let x=g.shift();try{let C=n?.messageStrategy;Tp.is(C)?C.handleMessage(x,ee):ee(x)}finally{V()}}let Fe=x=>{try{if(ce.Message.isNotification(x)&&x.method===zl.type.method){let C=x.params.id,j=L(C),Z=g.get(j);if(ce.Message.isRequest(Z)){let Se=n?.connectionStrategy,De=Se&&Se.cancelUndispatched?Se.cancelUndispatched(Z,S):void 0;if(De&&(De.error!==void 0||De.result!==void 0)){g.delete(j),_.delete(C),De.id=Z.id,He(De,x.method,Date.now()),e.write(De).catch(()=>i.error("Sending response for canceled message failed."));return}}let je=_.get(C);if(je!==void 0){je.cancel(),H(x);return}else T.add(C)}A(g,x)}finally{V()}};function Ue(x){if(F())return;function C(Ee,Be,Ie){let pt={jsonrpc:c,id:x.id};Ee instanceof ce.ResponseError?pt.error=Ee.toJson():pt.result=Ee===void 0?null:Ee,He(pt,Be,Ie),e.write(pt).catch(()=>i.error("Sending response failed."))}function j(Ee,Be,Ie){let pt={jsonrpc:c,id:x.id,error:Ee.toJson()};He(pt,Be,Ie),e.write(pt).catch(()=>i.error("Sending response failed."))}function Z(Ee,Be,Ie){Ee===void 0&&(Ee=null);let pt={jsonrpc:c,id:x.id,result:Ee};He(pt,Be,Ie),e.write(pt).catch(()=>i.error("Sending response failed."))}dt(x);let je=u.get(x.method),Se,De;je&&(Se=je.type,De=je.handler);let Ve=Date.now();if(De||l){let Ee=x.id??String(Date.now()),Be=mp.is(R.receiver)?R.receiver.createCancellationTokenSource(Ee):R.receiver.createCancellationTokenSource(x);x.id!==null&&T.has(x.id)&&Be.cancel(),x.id!==null&&_.set(Ee,Be);try{let Ie;if(De)if(x.params===void 0){if(Se!==void 0&&Se.numberOfParams!==0){j(new ce.ResponseError(ce.ErrorCodes.InvalidParams,`Request ${x.method} defines ${Se.numberOfParams} params but received none.`),x.method,Ve);return}Ie=De(Be.token)}else if(Array.isArray(x.params)){if(Se!==void 0&&Se.parameterStructures===ce.ParameterStructures.byName){j(new ce.ResponseError(ce.ErrorCodes.InvalidParams,`Request ${x.method} defines parameters by name but received parameters by position`),x.method,Ve);return}Ie=De(...x.params,Be.token)}else{if(Se!==void 0&&Se.parameterStructures===ce.ParameterStructures.byPosition){j(new ce.ResponseError(ce.ErrorCodes.InvalidParams,`Request ${x.method} defines parameters by position but received parameters by name`),x.method,Ve);return}Ie=De(x.params,Be.token)}else l&&(Ie=l(x.method,x.params,Be.token));let pt=Ie;Ie?pt.then?pt.then(rt=>{_.delete(Ee),C(rt,x.method,Ve)},rt=>{_.delete(Ee),rt instanceof ce.ResponseError?j(rt,x.method,Ve):rt&&yt.string(rt.message)?j(new ce.ResponseError(ce.ErrorCodes.InternalError,`Request ${x.method} failed with message: ${rt.message}`),x.method,Ve):j(new ce.ResponseError(ce.ErrorCodes.InternalError,`Request ${x.method} failed unexpectedly without providing any details.`),x.method,Ve)}):(_.delete(Ee),C(Ie,x.method,Ve)):(_.delete(Ee),Z(Ie,x.method,Ve))}catch(Ie){_.delete(Ee),Ie instanceof ce.ResponseError?C(Ie,x.method,Ve):Ie&&yt.string(Ie.message)?j(new ce.ResponseError(ce.ErrorCodes.InternalError,`Request ${x.method} failed with message: ${Ie.message}`),x.method,Ve):j(new ce.ResponseError(ce.ErrorCodes.InternalError,`Request ${x.method} failed unexpectedly without providing any details.`),x.method,Ve)}}else j(new ce.ResponseError(ce.ErrorCodes.MethodNotFound,`Unhandled method ${x.method}`),x.method,Ve)}function q(x){if(!F())if(x.id===null)x.error?i.error(`Received response message without id: Error is:
11
+ ${JSON.stringify(x.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let C=x.id,j=v.get(C);if(Cr(x,j),j!==void 0){v.delete(C);try{if(x.error){let Z=x.error;j.reject(new ce.ResponseError(Z.code,Z.message,Z.data))}else if(x.result!==void 0)j.resolve(x.result);else throw new Error("Should never happen.")}catch(Z){Z.message?i.error(`Response handler '${j.method}' failed with message: ${Z.message}`):i.error(`Response handler '${j.method}' failed unexpectedly.`)}}}}function J(x){if(F())return;let C,j;if(x.method===zl.type.method){let Z=x.params.id;T.delete(Z),H(x);return}else{let Z=d.get(x.method);Z&&(j=Z.handler,C=Z.type)}if(j||f)try{if(H(x),j)if(x.params===void 0)C!==void 0&&C.numberOfParams!==0&&C.parameterStructures!==ce.ParameterStructures.byName&&i.error(`Notification ${x.method} defines ${C.numberOfParams} params but received none.`),j();else if(Array.isArray(x.params)){let Z=x.params;x.method===Hl.type.method&&Z.length===2&&iT.is(Z[0])?j({token:Z[0],value:Z[1]}):(C!==void 0&&(C.parameterStructures===ce.ParameterStructures.byName&&i.error(`Notification ${x.method} defines parameters by name but received parameters by position`),C.numberOfParams!==x.params.length&&i.error(`Notification ${x.method} defines ${C.numberOfParams} params but received ${Z.length} arguments`)),j(...Z))}else C!==void 0&&C.parameterStructures===ce.ParameterStructures.byPosition&&i.error(`Notification ${x.method} defines parameters by position but received parameters by name`),j(x.params);else f&&f(x.method,x.params)}catch(Z){Z.message?i.error(`Notification handler '${x.method}' failed with message: ${Z.message}`):i.error(`Notification handler '${x.method}' failed unexpectedly.`)}else z.fire(x)}function te(x){if(!x){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
12
+ ${JSON.stringify(x,null,4)}`);let C=x;if(yt.string(C.id)||yt.number(C.id)){let j=C.id,Z=v.get(j);Z&&Z.reject(new Error("The received response has neither a result nor an error property."))}}function P(x){if(x!=null)switch(E){case $e.Verbose:return JSON.stringify(x,null,4);case $e.Compact:return JSON.stringify(x);default:return}}function ge(x){if(!(E===$e.Off||!D))if(I===mr.Text){let C;(E===$e.Verbose||E===$e.Compact)&&x.params&&(C=`Params: ${P(x.params)}
13
13
 
14
- `),D.log(`Sending request '${x.method} - (${x.id})'.`,N)}else Pr("send-request",x)}function Ee(x){if(!(_===De.Off||!D))if(k===hr.Text){let N;(_===De.Verbose||_===De.Compact)&&(x.params?N=`Params: ${P(x.params)}
14
+ `),D.log(`Sending request '${x.method} - (${x.id})'.`,C)}else Or("send-request",x)}function xe(x){if(!(E===$e.Off||!D))if(I===mr.Text){let C;(E===$e.Verbose||E===$e.Compact)&&(x.params?C=`Params: ${P(x.params)}
15
15
 
16
- `:N=`No parameters provided.
16
+ `:C=`No parameters provided.
17
17
 
18
- `),D.log(`Sending notification '${x.method}'.`,N)}else Pr("send-notification",x)}function Ue(x,N,X){if(!(_===De.Off||!D))if(k===hr.Text){let z;(_===De.Verbose||_===De.Compact)&&(x.error&&x.error.data?z=`Error data: ${P(x.error.data)}
18
+ `),D.log(`Sending notification '${x.method}'.`,C)}else Or("send-notification",x)}function He(x,C,j){if(!(E===$e.Off||!D))if(I===mr.Text){let Z;(E===$e.Verbose||E===$e.Compact)&&(x.error&&x.error.data?Z=`Error data: ${P(x.error.data)}
19
19
 
20
- `:x.result?z=`Result: ${P(x.result)}
20
+ `:x.result?Z=`Result: ${P(x.result)}
21
21
 
22
- `:x.error===void 0&&(z=`No result returned.
22
+ `:x.error===void 0&&(Z=`No result returned.
23
23
 
24
- `)),D.log(`Sending response '${N} - (${x.id})'. Processing request took ${Date.now()-X}ms`,z)}else Pr("send-response",x)}function ft(x){if(!(_===De.Off||!D))if(k===hr.Text){let N;(_===De.Verbose||_===De.Compact)&&x.params&&(N=`Params: ${P(x.params)}
24
+ `)),D.log(`Sending response '${C} - (${x.id})'. Processing request took ${Date.now()-j}ms`,Z)}else Or("send-response",x)}function dt(x){if(!(E===$e.Off||!D))if(I===mr.Text){let C;(E===$e.Verbose||E===$e.Compact)&&x.params&&(C=`Params: ${P(x.params)}
25
25
 
26
- `),D.log(`Received request '${x.method} - (${x.id})'.`,N)}else Pr("receive-request",x)}function U(x){if(!(_===De.Off||!D||x.method===op.type.method))if(k===hr.Text){let N;(_===De.Verbose||_===De.Compact)&&(x.params?N=`Params: ${P(x.params)}
26
+ `),D.log(`Received request '${x.method} - (${x.id})'.`,C)}else Or("receive-request",x)}function H(x){if(!(E===$e.Off||!D||x.method===hp.type.method))if(I===mr.Text){let C;(E===$e.Verbose||E===$e.Compact)&&(x.params?C=`Params: ${P(x.params)}
27
27
 
28
- `:N=`No parameters provided.
28
+ `:C=`No parameters provided.
29
29
 
30
- `),D.log(`Received notification '${x.method}'.`,N)}else Pr("receive-notification",x)}function Nr(x,N){if(!(_===De.Off||!D))if(k===hr.Text){let X;if((_===De.Verbose||_===De.Compact)&&(x.error&&x.error.data?X=`Error data: ${P(x.error.data)}
30
+ `),D.log(`Received notification '${x.method}'.`,C)}else Or("receive-notification",x)}function Cr(x,C){if(!(E===$e.Off||!D))if(I===mr.Text){let j;if((E===$e.Verbose||E===$e.Compact)&&(x.error&&x.error.data?j=`Error data: ${P(x.error.data)}
31
31
 
32
- `:x.result?X=`Result: ${P(x.result)}
32
+ `:x.result?j=`Result: ${P(x.result)}
33
33
 
34
- `:x.error===void 0&&(X=`No result returned.
34
+ `:x.error===void 0&&(j=`No result returned.
35
35
 
36
- `)),N){let z=x.error?` Request failed: ${x.error.message} (${x.error.code}).`:"";D.log(`Received response '${N.method} - (${x.id})' in ${Date.now()-N.timerStart}ms.${z}`,X)}else D.log(`Received response ${x.id} without active response promise.`,X)}else Pr("receive-response",x)}function Pr(x,N){if(!D||_===De.Off)return;let X={isLSPMessage:!0,type:x,message:N,timestamp:Date.now()};D.log(X)}function de(){if(H())throw new ha(Fl.Closed,"Connection is closed.");if($())throw new ha(Fl.Disposed,"Connection is disposed.")}function Wi(){if(B())throw new ha(Fl.AlreadyListening,"Connection is already listening")}function qi(){if(!B())throw new Error("Call listen() first.")}function Cr(x){return x===void 0?null:x}function es(x){if(x!==null)return x}function xr(x){return x!=null&&!Array.isArray(x)&&typeof x=="object"}function Ot(x,N){switch(x){case ae.ParameterStructures.auto:return xr(N)?es(N):[Cr(N)];case ae.ParameterStructures.byName:if(!xr(N))throw new Error("Received parameters by name but param is not an object literal.");return es(N);case ae.ParameterStructures.byPosition:return[Cr(N)];default:throw new Error(`Unknown parameter structure ${x.toString()}`)}}function en(x,N){let X,z=x.numberOfParams;switch(z){case 0:X=void 0;break;case 1:X=Ot(x.parameterStructures,N[0]);break;default:X=[];for(let Be=0;Be<N.length&&Be<z;Be++)X.push(Cr(N[Be]));if(N.length<z)for(let Be=N.length;Be<z;Be++)X.push(null);break}return X}let jt={sendNotification:(x,...N)=>{de();let X,z;if(gt.string(x)){X=x;let Se=N[0],Le=0,je=ae.ParameterStructures.auto;ae.ParameterStructures.is(Se)&&(Le=1,je=Se);let ye=N.length,$e=ye-Le;switch($e){case 0:z=void 0;break;case 1:z=Ot(je,N[Le]);break;default:if(je===ae.ParameterStructures.byName)throw new Error(`Received ${$e} parameters for 'by Name' notification parameter structure.`);z=N.slice(Le,ye).map(ve=>Cr(ve));break}}else{let Se=N;X=x.method,z=en(x,Se)}let Be={jsonrpc:c,method:X,params:z};return Ee(Be),e.write(Be).catch(Se=>{throw i.error("Sending notification failed."),Se})},onNotification:(x,N)=>{de();let X;return gt.func(x)?f=x:N&&(gt.string(x)?(X=x,d.set(x,{type:void 0,handler:N})):(X=x.method,d.set(x.method,{type:x,handler:N}))),{dispose:()=>{X!==void 0?d.delete(X):f=void 0}}},onProgress:(x,N,X)=>{if(p.has(N))throw new Error(`Progress handler for token ${N} already registered`);return p.set(N,X),{dispose:()=>{p.delete(N)}}},sendProgress:(x,N,X)=>jt.sendNotification(Ml.type,{token:N,value:X}),onUnhandledProgress:Ae.event,sendRequest:(x,...N)=>{de(),qi();let X,z,Be;if(gt.string(x)){X=x;let ye=N[0],$e=N[N.length-1],ve=0,dt=ae.ParameterStructures.auto;ae.ParameterStructures.is(ye)&&(ve=1,dt=ye);let et=N.length;zx.CancellationToken.is($e)&&(et=et-1,Be=$e);let cr=et-ve;switch(cr){case 0:z=void 0;break;case 1:z=Ot(dt,N[ve]);break;default:if(dt===ae.ParameterStructures.byName)throw new Error(`Received ${cr} parameters for 'by Name' request parameter structure.`);z=N.slice(ve,et).map($t=>Cr($t));break}}else{let ye=N;X=x.method,z=en(x,ye);let $e=x.numberOfParams;Be=zx.CancellationToken.is(ye[$e])?ye[$e]:void 0}let Se=o++,Le;Be&&(Le=Be.onCancellationRequested(()=>{let ye=w.sender.sendCancellation(jt,Se);return ye===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${Se}`),Promise.resolve()):ye.catch(()=>{i.log(`Sending cancellation messages for id ${Se} failed`)})}));let je={jsonrpc:c,id:Se,method:X,params:z};return Te(je),typeof w.sender.enableCancellation=="function"&&w.sender.enableCancellation(je),new Promise(async(ye,$e)=>{let ve=cr=>{ye(cr),w.sender.cleanup(Se),Le?.dispose()},dt=cr=>{$e(cr),w.sender.cleanup(Se),Le?.dispose()},et={method:X,timerStart:Date.now(),resolve:ve,reject:dt};try{await e.write(je),R.set(Se,et)}catch(cr){throw i.error("Sending request failed."),et.reject(new ae.ResponseError(ae.ErrorCodes.MessageWriteError,cr.message?cr.message:"Unknown reason")),cr}})},onRequest:(x,N)=>{de();let X=null;return Kx.is(x)?(X=void 0,l=x):gt.string(x)?(X=null,N!==void 0&&(X=x,u.set(x,{handler:N,type:void 0}))):N!==void 0&&(X=x.method,u.set(x.method,{type:x,handler:N})),{dispose:()=>{X!==null&&(X!==void 0?u.delete(X):l=void 0)}}},hasPendingResponse:()=>R.size>0,trace:async(x,N,X)=>{let z=!1,Be=hr.Text;X!==void 0&&(gt.boolean(X)?z=X:(z=X.sendNotification||!1,Be=X.traceFormat||hr.Text)),_=x,k=Be,_===De.Off?D=void 0:D=N,z&&!H()&&!$()&&await jt.sendNotification(Zx.type,{value:De.toString(x)})},onError:j.event,onClose:V.event,onUnhandledNotification:ie.event,onDispose:O.event,end:()=>{e.end()},dispose:()=>{if($())return;C=Gr.Disposed,O.fire(void 0);let x=new ae.ResponseError(ae.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let N of R.values())N.reject(x);R=new Map,E=new Map,T=new Set,y=new a0.LinkedMap,gt.func(e.dispose)&&e.dispose(),gt.func(t.dispose)&&t.dispose()},listen:()=>{de(),Wi(),C=Gr.Listening,t.listen(We)},inspect:()=>{(0,s0.default)().console.log("inspect")}};return jt.onNotification(op.type,x=>{if(_===De.Off||!D)return;let N=_===De.Verbose||_===De.Compact;D.log(x.message,N?x.verbose:void 0)}),jt.onNotification(Ml.type,x=>{let N=p.get(x.token);N?N(x.value):Ae.fire(x)}),jt}fe.createMessageConnection=jF});var fp=ce(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.ProgressType=v.ProgressToken=v.createMessageConnection=v.NullLogger=v.ConnectionOptions=v.ConnectionStrategy=v.AbstractMessageBuffer=v.WriteableStreamMessageWriter=v.AbstractMessageWriter=v.MessageWriter=v.ReadableStreamMessageReader=v.AbstractMessageReader=v.MessageReader=v.SharedArrayReceiverStrategy=v.SharedArraySenderStrategy=v.CancellationToken=v.CancellationTokenSource=v.Emitter=v.Event=v.Disposable=v.LRUCache=v.Touch=v.LinkedMap=v.ParameterStructures=v.NotificationType9=v.NotificationType8=v.NotificationType7=v.NotificationType6=v.NotificationType5=v.NotificationType4=v.NotificationType3=v.NotificationType2=v.NotificationType1=v.NotificationType0=v.NotificationType=v.ErrorCodes=v.ResponseError=v.RequestType9=v.RequestType8=v.RequestType7=v.RequestType6=v.RequestType5=v.RequestType4=v.RequestType3=v.RequestType2=v.RequestType1=v.RequestType0=v.RequestType=v.Message=v.RAL=void 0;v.MessageStrategy=v.CancellationStrategy=v.CancellationSenderStrategy=v.CancellationReceiverStrategy=v.ConnectionError=v.ConnectionErrors=v.LogTraceNotification=v.SetTraceNotification=v.TraceFormat=v.TraceValues=v.Trace=void 0;var Qe=Ax();Object.defineProperty(v,"Message",{enumerable:!0,get:function(){return Qe.Message}});Object.defineProperty(v,"RequestType",{enumerable:!0,get:function(){return Qe.RequestType}});Object.defineProperty(v,"RequestType0",{enumerable:!0,get:function(){return Qe.RequestType0}});Object.defineProperty(v,"RequestType1",{enumerable:!0,get:function(){return Qe.RequestType1}});Object.defineProperty(v,"RequestType2",{enumerable:!0,get:function(){return Qe.RequestType2}});Object.defineProperty(v,"RequestType3",{enumerable:!0,get:function(){return Qe.RequestType3}});Object.defineProperty(v,"RequestType4",{enumerable:!0,get:function(){return Qe.RequestType4}});Object.defineProperty(v,"RequestType5",{enumerable:!0,get:function(){return Qe.RequestType5}});Object.defineProperty(v,"RequestType6",{enumerable:!0,get:function(){return Qe.RequestType6}});Object.defineProperty(v,"RequestType7",{enumerable:!0,get:function(){return Qe.RequestType7}});Object.defineProperty(v,"RequestType8",{enumerable:!0,get:function(){return Qe.RequestType8}});Object.defineProperty(v,"RequestType9",{enumerable:!0,get:function(){return Qe.RequestType9}});Object.defineProperty(v,"ResponseError",{enumerable:!0,get:function(){return Qe.ResponseError}});Object.defineProperty(v,"ErrorCodes",{enumerable:!0,get:function(){return Qe.ErrorCodes}});Object.defineProperty(v,"NotificationType",{enumerable:!0,get:function(){return Qe.NotificationType}});Object.defineProperty(v,"NotificationType0",{enumerable:!0,get:function(){return Qe.NotificationType0}});Object.defineProperty(v,"NotificationType1",{enumerable:!0,get:function(){return Qe.NotificationType1}});Object.defineProperty(v,"NotificationType2",{enumerable:!0,get:function(){return Qe.NotificationType2}});Object.defineProperty(v,"NotificationType3",{enumerable:!0,get:function(){return Qe.NotificationType3}});Object.defineProperty(v,"NotificationType4",{enumerable:!0,get:function(){return Qe.NotificationType4}});Object.defineProperty(v,"NotificationType5",{enumerable:!0,get:function(){return Qe.NotificationType5}});Object.defineProperty(v,"NotificationType6",{enumerable:!0,get:function(){return Qe.NotificationType6}});Object.defineProperty(v,"NotificationType7",{enumerable:!0,get:function(){return Qe.NotificationType7}});Object.defineProperty(v,"NotificationType8",{enumerable:!0,get:function(){return Qe.NotificationType8}});Object.defineProperty(v,"NotificationType9",{enumerable:!0,get:function(){return Qe.NotificationType9}});Object.defineProperty(v,"ParameterStructures",{enumerable:!0,get:function(){return Qe.ParameterStructures}});var eT=Sx();Object.defineProperty(v,"LinkedMap",{enumerable:!0,get:function(){return eT.LinkedMap}});Object.defineProperty(v,"LRUCache",{enumerable:!0,get:function(){return eT.LRUCache}});Object.defineProperty(v,"Touch",{enumerable:!0,get:function(){return eT.Touch}});var WF=YA();Object.defineProperty(v,"Disposable",{enumerable:!0,get:function(){return WF.Disposable}});var f0=ua();Object.defineProperty(v,"Event",{enumerable:!0,get:function(){return f0.Event}});Object.defineProperty(v,"Emitter",{enumerable:!0,get:function(){return f0.Emitter}});var d0=ep();Object.defineProperty(v,"CancellationTokenSource",{enumerable:!0,get:function(){return d0.CancellationTokenSource}});Object.defineProperty(v,"CancellationToken",{enumerable:!0,get:function(){return d0.CancellationToken}});var p0=ZA();Object.defineProperty(v,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return p0.SharedArraySenderStrategy}});Object.defineProperty(v,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return p0.SharedArrayReceiverStrategy}});var tT=QA();Object.defineProperty(v,"MessageReader",{enumerable:!0,get:function(){return tT.MessageReader}});Object.defineProperty(v,"AbstractMessageReader",{enumerable:!0,get:function(){return tT.AbstractMessageReader}});Object.defineProperty(v,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return tT.ReadableStreamMessageReader}});var rT=i0();Object.defineProperty(v,"MessageWriter",{enumerable:!0,get:function(){return rT.MessageWriter}});Object.defineProperty(v,"AbstractMessageWriter",{enumerable:!0,get:function(){return rT.AbstractMessageWriter}});Object.defineProperty(v,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return rT.WriteableStreamMessageWriter}});var qF=o0();Object.defineProperty(v,"AbstractMessageBuffer",{enumerable:!0,get:function(){return qF.AbstractMessageBuffer}});var Dt=u0();Object.defineProperty(v,"ConnectionStrategy",{enumerable:!0,get:function(){return Dt.ConnectionStrategy}});Object.defineProperty(v,"ConnectionOptions",{enumerable:!0,get:function(){return Dt.ConnectionOptions}});Object.defineProperty(v,"NullLogger",{enumerable:!0,get:function(){return Dt.NullLogger}});Object.defineProperty(v,"createMessageConnection",{enumerable:!0,get:function(){return Dt.createMessageConnection}});Object.defineProperty(v,"ProgressToken",{enumerable:!0,get:function(){return Dt.ProgressToken}});Object.defineProperty(v,"ProgressType",{enumerable:!0,get:function(){return Dt.ProgressType}});Object.defineProperty(v,"Trace",{enumerable:!0,get:function(){return Dt.Trace}});Object.defineProperty(v,"TraceValues",{enumerable:!0,get:function(){return Dt.TraceValues}});Object.defineProperty(v,"TraceFormat",{enumerable:!0,get:function(){return Dt.TraceFormat}});Object.defineProperty(v,"SetTraceNotification",{enumerable:!0,get:function(){return Dt.SetTraceNotification}});Object.defineProperty(v,"LogTraceNotification",{enumerable:!0,get:function(){return Dt.LogTraceNotification}});Object.defineProperty(v,"ConnectionErrors",{enumerable:!0,get:function(){return Dt.ConnectionErrors}});Object.defineProperty(v,"ConnectionError",{enumerable:!0,get:function(){return Dt.ConnectionError}});Object.defineProperty(v,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Dt.CancellationReceiverStrategy}});Object.defineProperty(v,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Dt.CancellationSenderStrategy}});Object.defineProperty(v,"CancellationStrategy",{enumerable:!0,get:function(){return Dt.CancellationStrategy}});Object.defineProperty(v,"MessageStrategy",{enumerable:!0,get:function(){return Dt.MessageStrategy}});var zF=wi();v.RAL=zF.default});var m0=ce(sT=>{"use strict";Object.defineProperty(sT,"__esModule",{value:!0});var hn=fp(),dp=class t extends hn.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return new TextEncoder().encode(e)}toString(e,r){return r==="ascii"?this.asciiDecoder.decode(e):new TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e:e.slice(0,r)}allocNative(e){return new Uint8Array(e)}};dp.emptyBuffer=new Uint8Array(0);var nT=class{constructor(e){this.socket=e,this._onData=new hn.Emitter,this._messageListener=r=>{r.data.arrayBuffer().then(i=>{this._onData.fire(new Uint8Array(i))},()=>{(0,hn.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),hn.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),hn.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),hn.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}},iT=class{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),hn.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),hn.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),hn.Disposable.create(()=>this.socket.removeEventListener("end",e))}write(e,r){if(typeof e=="string"){if(r!==void 0&&r!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${r}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}},VF=new TextEncoder,h0=Object.freeze({messageBuffer:Object.freeze({create:t=>new dp(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{if(e.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${e.charset}`);return Promise.resolve(VF.encode(JSON.stringify(t,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{if(!(t instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(e.charset).decode(t)))}})}),stream:Object.freeze({asReadableStream:t=>new nT(t),asWritableStream:t=>new iT(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setTimeout(t,0,...e);return{dispose:()=>clearTimeout(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function oT(){return h0}(function(t){function e(){hn.RAL.install(h0)}t.install=e})(oT||(oT={}));sT.default=oT});var Do=ce(mr=>{"use strict";var YF=mr&&mr.__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]})),KF=mr&&mr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&YF(e,t,r)};Object.defineProperty(mr,"__esModule",{value:!0});mr.createMessageConnection=mr.BrowserMessageWriter=mr.BrowserMessageReader=void 0;var ZF=m0();ZF.default.install();var ma=fp();KF(fp(),mr);var aT=class extends ma.AbstractMessageReader{constructor(e){super(),this._onData=new ma.Emitter,this._messageListener=r=>{this._onData.fire(r.data)},e.addEventListener("error",r=>this.fireError(r)),e.onmessage=this._messageListener}listen(e){return this._onData.event(e)}};mr.BrowserMessageReader=aT;var cT=class extends ma.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.addEventListener("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};mr.BrowserMessageWriter=cT;function JF(t,e,r,n){return r===void 0&&(r=ma.NullLogger),ma.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,ma.createMessageConnection)(t,e,r,n)}mr.createMessageConnection=JF});var lT=ce((J9,g0)=>{"use strict";g0.exports=Do()});var ut=ce(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.ProtocolNotificationType=nr.ProtocolNotificationType0=nr.ProtocolRequestType=nr.ProtocolRequestType0=nr.RegistrationType=nr.MessageDirection=void 0;var ga=Do(),y0;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(y0||(nr.MessageDirection=y0={}));var uT=class{constructor(e){this.method=e}};nr.RegistrationType=uT;var fT=class extends ga.RequestType0{constructor(e){super(e)}};nr.ProtocolRequestType0=fT;var dT=class extends ga.RequestType{constructor(e){super(e,ga.ParameterStructures.byName)}};nr.ProtocolRequestType=dT;var pT=class extends ga.NotificationType0{constructor(e){super(e)}};nr.ProtocolNotificationType0=pT;var hT=class extends ga.NotificationType{constructor(e){super(e,ga.ParameterStructures.byName)}};nr.ProtocolNotificationType=hT});var pp=ce(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.objectLiteral=bt.typedArray=bt.stringArray=bt.array=bt.func=bt.error=bt.number=bt.string=bt.boolean=void 0;function QF(t){return t===!0||t===!1}bt.boolean=QF;function x0(t){return typeof t=="string"||t instanceof String}bt.string=x0;function eU(t){return typeof t=="number"||t instanceof Number}bt.number=eU;function tU(t){return t instanceof Error}bt.error=tU;function rU(t){return typeof t=="function"}bt.func=rU;function T0(t){return Array.isArray(t)}bt.array=T0;function nU(t){return T0(t)&&t.every(e=>x0(e))}bt.stringArray=nU;function iU(t,e){return Array.isArray(t)&&t.every(e)}bt.typedArray=iU;function oU(t){return t!==null&&typeof t=="object"}bt.objectLiteral=oU});var R0=ce(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});hp.ImplementationRequest=void 0;var _0=ut(),E0;(function(t){t.method="textDocument/implementation",t.messageDirection=_0.MessageDirection.clientToServer,t.type=new _0.ProtocolRequestType(t.method)})(E0||(hp.ImplementationRequest=E0={}))});var A0=ce(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});mp.TypeDefinitionRequest=void 0;var b0=ut(),w0;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=b0.MessageDirection.clientToServer,t.type=new b0.ProtocolRequestType(t.method)})(w0||(mp.TypeDefinitionRequest=w0={}))});var v0=ce(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.DidChangeWorkspaceFoldersNotification=ya.WorkspaceFoldersRequest=void 0;var gp=ut(),I0;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=gp.MessageDirection.serverToClient,t.type=new gp.ProtocolRequestType0(t.method)})(I0||(ya.WorkspaceFoldersRequest=I0={}));var S0;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=gp.MessageDirection.clientToServer,t.type=new gp.ProtocolNotificationType(t.method)})(S0||(ya.DidChangeWorkspaceFoldersNotification=S0={}))});var P0=ce(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});yp.ConfigurationRequest=void 0;var k0=ut(),N0;(function(t){t.method="workspace/configuration",t.messageDirection=k0.MessageDirection.serverToClient,t.type=new k0.ProtocolRequestType(t.method)})(N0||(yp.ConfigurationRequest=N0={}))});var L0=ce(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.ColorPresentationRequest=xa.DocumentColorRequest=void 0;var xp=ut(),C0;(function(t){t.method="textDocument/documentColor",t.messageDirection=xp.MessageDirection.clientToServer,t.type=new xp.ProtocolRequestType(t.method)})(C0||(xa.DocumentColorRequest=C0={}));var O0;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=xp.MessageDirection.clientToServer,t.type=new xp.ProtocolRequestType(t.method)})(O0||(xa.ColorPresentationRequest=O0={}))});var M0=ce(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.FoldingRangeRefreshRequest=Ta.FoldingRangeRequest=void 0;var Tp=ut(),D0;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Tp.MessageDirection.clientToServer,t.type=new Tp.ProtocolRequestType(t.method)})(D0||(Ta.FoldingRangeRequest=D0={}));var $0;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Tp.MessageDirection.serverToClient,t.type=new Tp.ProtocolRequestType0(t.method)})($0||(Ta.FoldingRangeRefreshRequest=$0={}))});var B0=ce(_p=>{"use strict";Object.defineProperty(_p,"__esModule",{value:!0});_p.DeclarationRequest=void 0;var F0=ut(),U0;(function(t){t.method="textDocument/declaration",t.messageDirection=F0.MessageDirection.clientToServer,t.type=new F0.ProtocolRequestType(t.method)})(U0||(_p.DeclarationRequest=U0={}))});var H0=ce(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});Ep.SelectionRangeRequest=void 0;var X0=ut(),G0;(function(t){t.method="textDocument/selectionRange",t.messageDirection=X0.MessageDirection.clientToServer,t.type=new X0.ProtocolRequestType(t.method)})(G0||(Ep.SelectionRangeRequest=G0={}))});var z0=ce(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.WorkDoneProgressCancelNotification=Si.WorkDoneProgressCreateRequest=Si.WorkDoneProgress=void 0;var sU=Do(),Rp=ut(),j0;(function(t){t.type=new sU.ProgressType;function e(r){return r===t.type}t.is=e})(j0||(Si.WorkDoneProgress=j0={}));var W0;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Rp.MessageDirection.serverToClient,t.type=new Rp.ProtocolRequestType(t.method)})(W0||(Si.WorkDoneProgressCreateRequest=W0={}));var q0;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Rp.MessageDirection.clientToServer,t.type=new Rp.ProtocolNotificationType(t.method)})(q0||(Si.WorkDoneProgressCancelNotification=q0={}))});var Z0=ce(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.CallHierarchyOutgoingCallsRequest=vi.CallHierarchyIncomingCallsRequest=vi.CallHierarchyPrepareRequest=void 0;var _a=ut(),V0;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=_a.MessageDirection.clientToServer,t.type=new _a.ProtocolRequestType(t.method)})(V0||(vi.CallHierarchyPrepareRequest=V0={}));var Y0;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=_a.MessageDirection.clientToServer,t.type=new _a.ProtocolRequestType(t.method)})(Y0||(vi.CallHierarchyIncomingCallsRequest=Y0={}));var K0;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=_a.MessageDirection.clientToServer,t.type=new _a.ProtocolRequestType(t.method)})(K0||(vi.CallHierarchyOutgoingCallsRequest=K0={}))});var nI=ce(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.SemanticTokensRefreshRequest=ir.SemanticTokensRangeRequest=ir.SemanticTokensDeltaRequest=ir.SemanticTokensRequest=ir.SemanticTokensRegistrationType=ir.TokenFormat=void 0;var Gn=ut(),J0;(function(t){t.Relative="relative"})(J0||(ir.TokenFormat=J0={}));var Bl;(function(t){t.method="textDocument/semanticTokens",t.type=new Gn.RegistrationType(t.method)})(Bl||(ir.SemanticTokensRegistrationType=Bl={}));var Q0;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=Gn.MessageDirection.clientToServer,t.type=new Gn.ProtocolRequestType(t.method),t.registrationMethod=Bl.method})(Q0||(ir.SemanticTokensRequest=Q0={}));var eI;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=Gn.MessageDirection.clientToServer,t.type=new Gn.ProtocolRequestType(t.method),t.registrationMethod=Bl.method})(eI||(ir.SemanticTokensDeltaRequest=eI={}));var tI;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=Gn.MessageDirection.clientToServer,t.type=new Gn.ProtocolRequestType(t.method),t.registrationMethod=Bl.method})(tI||(ir.SemanticTokensRangeRequest=tI={}));var rI;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=Gn.MessageDirection.serverToClient,t.type=new Gn.ProtocolRequestType0(t.method)})(rI||(ir.SemanticTokensRefreshRequest=rI={}))});var sI=ce(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});bp.ShowDocumentRequest=void 0;var iI=ut(),oI;(function(t){t.method="window/showDocument",t.messageDirection=iI.MessageDirection.serverToClient,t.type=new iI.ProtocolRequestType(t.method)})(oI||(bp.ShowDocumentRequest=oI={}))});var lI=ce(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});wp.LinkedEditingRangeRequest=void 0;var aI=ut(),cI;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=aI.MessageDirection.clientToServer,t.type=new aI.ProtocolRequestType(t.method)})(cI||(wp.LinkedEditingRangeRequest=cI={}))});var yI=ce(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.WillDeleteFilesRequest=Ht.DidDeleteFilesNotification=Ht.DidRenameFilesNotification=Ht.WillRenameFilesRequest=Ht.DidCreateFilesNotification=Ht.WillCreateFilesRequest=Ht.FileOperationPatternKind=void 0;var Ar=ut(),uI;(function(t){t.file="file",t.folder="folder"})(uI||(Ht.FileOperationPatternKind=uI={}));var fI;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Ar.MessageDirection.clientToServer,t.type=new Ar.ProtocolRequestType(t.method)})(fI||(Ht.WillCreateFilesRequest=fI={}));var dI;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Ar.MessageDirection.clientToServer,t.type=new Ar.ProtocolNotificationType(t.method)})(dI||(Ht.DidCreateFilesNotification=dI={}));var pI;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Ar.MessageDirection.clientToServer,t.type=new Ar.ProtocolRequestType(t.method)})(pI||(Ht.WillRenameFilesRequest=pI={}));var hI;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Ar.MessageDirection.clientToServer,t.type=new Ar.ProtocolNotificationType(t.method)})(hI||(Ht.DidRenameFilesNotification=hI={}));var mI;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Ar.MessageDirection.clientToServer,t.type=new Ar.ProtocolNotificationType(t.method)})(mI||(Ht.DidDeleteFilesNotification=mI={}));var gI;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Ar.MessageDirection.clientToServer,t.type=new Ar.ProtocolRequestType(t.method)})(gI||(Ht.WillDeleteFilesRequest=gI={}))});var RI=ce(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.MonikerRequest=ki.MonikerKind=ki.UniquenessLevel=void 0;var xI=ut(),TI;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(TI||(ki.UniquenessLevel=TI={}));var _I;(function(t){t.$import="import",t.$export="export",t.local="local"})(_I||(ki.MonikerKind=_I={}));var EI;(function(t){t.method="textDocument/moniker",t.messageDirection=xI.MessageDirection.clientToServer,t.type=new xI.ProtocolRequestType(t.method)})(EI||(ki.MonikerRequest=EI={}))});var II=ce(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.TypeHierarchySubtypesRequest=Ni.TypeHierarchySupertypesRequest=Ni.TypeHierarchyPrepareRequest=void 0;var Ea=ut(),bI;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Ea.MessageDirection.clientToServer,t.type=new Ea.ProtocolRequestType(t.method)})(bI||(Ni.TypeHierarchyPrepareRequest=bI={}));var wI;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Ea.MessageDirection.clientToServer,t.type=new Ea.ProtocolRequestType(t.method)})(wI||(Ni.TypeHierarchySupertypesRequest=wI={}));var AI;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Ea.MessageDirection.clientToServer,t.type=new Ea.ProtocolRequestType(t.method)})(AI||(Ni.TypeHierarchySubtypesRequest=AI={}))});var kI=ce(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.InlineValueRefreshRequest=Ra.InlineValueRequest=void 0;var Ap=ut(),SI;(function(t){t.method="textDocument/inlineValue",t.messageDirection=Ap.MessageDirection.clientToServer,t.type=new Ap.ProtocolRequestType(t.method)})(SI||(Ra.InlineValueRequest=SI={}));var vI;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=Ap.MessageDirection.serverToClient,t.type=new Ap.ProtocolRequestType0(t.method)})(vI||(Ra.InlineValueRefreshRequest=vI={}))});var OI=ce(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.InlayHintRefreshRequest=Pi.InlayHintResolveRequest=Pi.InlayHintRequest=void 0;var ba=ut(),NI;(function(t){t.method="textDocument/inlayHint",t.messageDirection=ba.MessageDirection.clientToServer,t.type=new ba.ProtocolRequestType(t.method)})(NI||(Pi.InlayHintRequest=NI={}));var PI;(function(t){t.method="inlayHint/resolve",t.messageDirection=ba.MessageDirection.clientToServer,t.type=new ba.ProtocolRequestType(t.method)})(PI||(Pi.InlayHintResolveRequest=PI={}));var CI;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=ba.MessageDirection.serverToClient,t.type=new ba.ProtocolRequestType0(t.method)})(CI||(Pi.InlayHintRefreshRequest=CI={}))});var BI=ce(Ir=>{"use strict";Object.defineProperty(Ir,"__esModule",{value:!0});Ir.DiagnosticRefreshRequest=Ir.WorkspaceDiagnosticRequest=Ir.DocumentDiagnosticRequest=Ir.DocumentDiagnosticReportKind=Ir.DiagnosticServerCancellationData=void 0;var UI=Do(),aU=pp(),wa=ut(),LI;(function(t){function e(r){let n=r;return n&&aU.boolean(n.retriggerRequest)}t.is=e})(LI||(Ir.DiagnosticServerCancellationData=LI={}));var DI;(function(t){t.Full="full",t.Unchanged="unchanged"})(DI||(Ir.DocumentDiagnosticReportKind=DI={}));var $I;(function(t){t.method="textDocument/diagnostic",t.messageDirection=wa.MessageDirection.clientToServer,t.type=new wa.ProtocolRequestType(t.method),t.partialResult=new UI.ProgressType})($I||(Ir.DocumentDiagnosticRequest=$I={}));var MI;(function(t){t.method="workspace/diagnostic",t.messageDirection=wa.MessageDirection.clientToServer,t.type=new wa.ProtocolRequestType(t.method),t.partialResult=new UI.ProgressType})(MI||(Ir.WorkspaceDiagnosticRequest=MI={}));var FI;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=wa.MessageDirection.serverToClient,t.type=new wa.ProtocolRequestType0(t.method)})(FI||(Ir.DiagnosticRefreshRequest=FI={}))});var zI=ce(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.DidCloseNotebookDocumentNotification=Tt.DidSaveNotebookDocumentNotification=Tt.DidChangeNotebookDocumentNotification=Tt.NotebookCellArrayChange=Tt.DidOpenNotebookDocumentNotification=Tt.NotebookDocumentSyncRegistrationType=Tt.NotebookDocument=Tt.NotebookCell=Tt.ExecutionSummary=Tt.NotebookCellKind=void 0;var Xl=(Zs(),qu(Dd)),Hr=pp(),mn=ut(),mT;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(mT||(Tt.NotebookCellKind=mT={}));var gT;(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 Hr.objectLiteral(o)&&Xl.uinteger.is(o.executionOrder)&&(o.success===void 0||Hr.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})(gT||(Tt.ExecutionSummary=gT={}));var Ip;(function(t){function e(o,s){return{kind:o,document:s}}t.create=e;function r(o){let s=o;return Hr.objectLiteral(s)&&mT.is(s.kind)&&Xl.DocumentUri.is(s.document)&&(s.metadata===void 0||Hr.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)&&!gT.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),c=Array.isArray(s);if(a!==c)return!1;if(a&&c){if(o.length!==s.length)return!1;for(let l=0;l<o.length;l++)if(!i(o[l],s[l]))return!1}if(Hr.objectLiteral(o)&&Hr.objectLiteral(s)){let l=Object.keys(o),u=Object.keys(s);if(l.length!==u.length||(l.sort(),u.sort(),!i(l,u)))return!1;for(let f=0;f<l.length;f++){let d=l[f];if(!i(o[d],s[d]))return!1}}return!0}})(Ip||(Tt.NotebookCell=Ip={}));var XI;(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 Hr.objectLiteral(i)&&Hr.string(i.uri)&&Xl.integer.is(i.version)&&Hr.typedArray(i.cells,Ip.is)}t.is=r})(XI||(Tt.NotebookDocument=XI={}));var Aa;(function(t){t.method="notebookDocument/sync",t.messageDirection=mn.MessageDirection.clientToServer,t.type=new mn.RegistrationType(t.method)})(Aa||(Tt.NotebookDocumentSyncRegistrationType=Aa={}));var GI;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=mn.MessageDirection.clientToServer,t.type=new mn.ProtocolNotificationType(t.method),t.registrationMethod=Aa.method})(GI||(Tt.DidOpenNotebookDocumentNotification=GI={}));var HI;(function(t){function e(n){let i=n;return Hr.objectLiteral(i)&&Xl.uinteger.is(i.start)&&Xl.uinteger.is(i.deleteCount)&&(i.cells===void 0||Hr.typedArray(i.cells,Ip.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})(HI||(Tt.NotebookCellArrayChange=HI={}));var jI;(function(t){t.method="notebookDocument/didChange",t.messageDirection=mn.MessageDirection.clientToServer,t.type=new mn.ProtocolNotificationType(t.method),t.registrationMethod=Aa.method})(jI||(Tt.DidChangeNotebookDocumentNotification=jI={}));var WI;(function(t){t.method="notebookDocument/didSave",t.messageDirection=mn.MessageDirection.clientToServer,t.type=new mn.ProtocolNotificationType(t.method),t.registrationMethod=Aa.method})(WI||(Tt.DidSaveNotebookDocumentNotification=WI={}));var qI;(function(t){t.method="notebookDocument/didClose",t.messageDirection=mn.MessageDirection.clientToServer,t.type=new mn.ProtocolNotificationType(t.method),t.registrationMethod=Aa.method})(qI||(Tt.DidCloseNotebookDocumentNotification=qI={}))});var KI=ce(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});Sp.InlineCompletionRequest=void 0;var VI=ut(),YI;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=VI.MessageDirection.clientToServer,t.type=new VI.ProtocolRequestType(t.method)})(YI||(Sp.InlineCompletionRequest=YI={}))});var lv=ce(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});g.WorkspaceSymbolRequest=g.CodeActionResolveRequest=g.CodeActionRequest=g.DocumentSymbolRequest=g.DocumentHighlightRequest=g.ReferencesRequest=g.DefinitionRequest=g.SignatureHelpRequest=g.SignatureHelpTriggerKind=g.HoverRequest=g.CompletionResolveRequest=g.CompletionRequest=g.CompletionTriggerKind=g.PublishDiagnosticsNotification=g.WatchKind=g.RelativePattern=g.FileChangeType=g.DidChangeWatchedFilesNotification=g.WillSaveTextDocumentWaitUntilRequest=g.WillSaveTextDocumentNotification=g.TextDocumentSaveReason=g.DidSaveTextDocumentNotification=g.DidCloseTextDocumentNotification=g.DidChangeTextDocumentNotification=g.TextDocumentContentChangeEvent=g.DidOpenTextDocumentNotification=g.TextDocumentSyncKind=g.TelemetryEventNotification=g.LogMessageNotification=g.ShowMessageRequest=g.ShowMessageNotification=g.MessageType=g.DidChangeConfigurationNotification=g.ExitNotification=g.ShutdownRequest=g.InitializedNotification=g.InitializeErrorCodes=g.InitializeRequest=g.WorkDoneProgressOptions=g.TextDocumentRegistrationOptions=g.StaticRegistrationOptions=g.PositionEncodingKind=g.FailureHandlingKind=g.ResourceOperationKind=g.UnregistrationRequest=g.RegistrationRequest=g.DocumentSelector=g.NotebookCellTextDocumentFilter=g.NotebookDocumentFilter=g.TextDocumentFilter=void 0;g.MonikerRequest=g.MonikerKind=g.UniquenessLevel=g.WillDeleteFilesRequest=g.DidDeleteFilesNotification=g.WillRenameFilesRequest=g.DidRenameFilesNotification=g.WillCreateFilesRequest=g.DidCreateFilesNotification=g.FileOperationPatternKind=g.LinkedEditingRangeRequest=g.ShowDocumentRequest=g.SemanticTokensRegistrationType=g.SemanticTokensRefreshRequest=g.SemanticTokensRangeRequest=g.SemanticTokensDeltaRequest=g.SemanticTokensRequest=g.TokenFormat=g.CallHierarchyPrepareRequest=g.CallHierarchyOutgoingCallsRequest=g.CallHierarchyIncomingCallsRequest=g.WorkDoneProgressCancelNotification=g.WorkDoneProgressCreateRequest=g.WorkDoneProgress=g.SelectionRangeRequest=g.DeclarationRequest=g.FoldingRangeRefreshRequest=g.FoldingRangeRequest=g.ColorPresentationRequest=g.DocumentColorRequest=g.ConfigurationRequest=g.DidChangeWorkspaceFoldersNotification=g.WorkspaceFoldersRequest=g.TypeDefinitionRequest=g.ImplementationRequest=g.ApplyWorkspaceEditRequest=g.ExecuteCommandRequest=g.PrepareRenameRequest=g.RenameRequest=g.PrepareSupportDefaultBehavior=g.DocumentOnTypeFormattingRequest=g.DocumentRangesFormattingRequest=g.DocumentRangeFormattingRequest=g.DocumentFormattingRequest=g.DocumentLinkResolveRequest=g.DocumentLinkRequest=g.CodeLensRefreshRequest=g.CodeLensResolveRequest=g.CodeLensRequest=g.WorkspaceSymbolResolveRequest=void 0;g.InlineCompletionRequest=g.DidCloseNotebookDocumentNotification=g.DidSaveNotebookDocumentNotification=g.DidChangeNotebookDocumentNotification=g.NotebookCellArrayChange=g.DidOpenNotebookDocumentNotification=g.NotebookDocumentSyncRegistrationType=g.NotebookDocument=g.NotebookCell=g.ExecutionSummary=g.NotebookCellKind=g.DiagnosticRefreshRequest=g.WorkspaceDiagnosticRequest=g.DocumentDiagnosticRequest=g.DocumentDiagnosticReportKind=g.DiagnosticServerCancellationData=g.InlayHintRefreshRequest=g.InlayHintResolveRequest=g.InlayHintRequest=g.InlineValueRefreshRequest=g.InlineValueRequest=g.TypeHierarchySupertypesRequest=g.TypeHierarchySubtypesRequest=g.TypeHierarchyPrepareRequest=void 0;var F=ut(),ZI=(Zs(),qu(Dd)),Nt=pp(),cU=R0();Object.defineProperty(g,"ImplementationRequest",{enumerable:!0,get:function(){return cU.ImplementationRequest}});var lU=A0();Object.defineProperty(g,"TypeDefinitionRequest",{enumerable:!0,get:function(){return lU.TypeDefinitionRequest}});var ov=v0();Object.defineProperty(g,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return ov.WorkspaceFoldersRequest}});Object.defineProperty(g,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return ov.DidChangeWorkspaceFoldersNotification}});var uU=P0();Object.defineProperty(g,"ConfigurationRequest",{enumerable:!0,get:function(){return uU.ConfigurationRequest}});var sv=L0();Object.defineProperty(g,"DocumentColorRequest",{enumerable:!0,get:function(){return sv.DocumentColorRequest}});Object.defineProperty(g,"ColorPresentationRequest",{enumerable:!0,get:function(){return sv.ColorPresentationRequest}});var av=M0();Object.defineProperty(g,"FoldingRangeRequest",{enumerable:!0,get:function(){return av.FoldingRangeRequest}});Object.defineProperty(g,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return av.FoldingRangeRefreshRequest}});var fU=B0();Object.defineProperty(g,"DeclarationRequest",{enumerable:!0,get:function(){return fU.DeclarationRequest}});var dU=H0();Object.defineProperty(g,"SelectionRangeRequest",{enumerable:!0,get:function(){return dU.SelectionRangeRequest}});var ET=z0();Object.defineProperty(g,"WorkDoneProgress",{enumerable:!0,get:function(){return ET.WorkDoneProgress}});Object.defineProperty(g,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return ET.WorkDoneProgressCreateRequest}});Object.defineProperty(g,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return ET.WorkDoneProgressCancelNotification}});var RT=Z0();Object.defineProperty(g,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return RT.CallHierarchyIncomingCallsRequest}});Object.defineProperty(g,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return RT.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(g,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return RT.CallHierarchyPrepareRequest}});var Ia=nI();Object.defineProperty(g,"TokenFormat",{enumerable:!0,get:function(){return Ia.TokenFormat}});Object.defineProperty(g,"SemanticTokensRequest",{enumerable:!0,get:function(){return Ia.SemanticTokensRequest}});Object.defineProperty(g,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Ia.SemanticTokensDeltaRequest}});Object.defineProperty(g,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Ia.SemanticTokensRangeRequest}});Object.defineProperty(g,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Ia.SemanticTokensRefreshRequest}});Object.defineProperty(g,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Ia.SemanticTokensRegistrationType}});var pU=sI();Object.defineProperty(g,"ShowDocumentRequest",{enumerable:!0,get:function(){return pU.ShowDocumentRequest}});var hU=lI();Object.defineProperty(g,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return hU.LinkedEditingRangeRequest}});var $o=yI();Object.defineProperty(g,"FileOperationPatternKind",{enumerable:!0,get:function(){return $o.FileOperationPatternKind}});Object.defineProperty(g,"DidCreateFilesNotification",{enumerable:!0,get:function(){return $o.DidCreateFilesNotification}});Object.defineProperty(g,"WillCreateFilesRequest",{enumerable:!0,get:function(){return $o.WillCreateFilesRequest}});Object.defineProperty(g,"DidRenameFilesNotification",{enumerable:!0,get:function(){return $o.DidRenameFilesNotification}});Object.defineProperty(g,"WillRenameFilesRequest",{enumerable:!0,get:function(){return $o.WillRenameFilesRequest}});Object.defineProperty(g,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return $o.DidDeleteFilesNotification}});Object.defineProperty(g,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return $o.WillDeleteFilesRequest}});var bT=RI();Object.defineProperty(g,"UniquenessLevel",{enumerable:!0,get:function(){return bT.UniquenessLevel}});Object.defineProperty(g,"MonikerKind",{enumerable:!0,get:function(){return bT.MonikerKind}});Object.defineProperty(g,"MonikerRequest",{enumerable:!0,get:function(){return bT.MonikerRequest}});var wT=II();Object.defineProperty(g,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return wT.TypeHierarchyPrepareRequest}});Object.defineProperty(g,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return wT.TypeHierarchySubtypesRequest}});Object.defineProperty(g,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return wT.TypeHierarchySupertypesRequest}});var cv=kI();Object.defineProperty(g,"InlineValueRequest",{enumerable:!0,get:function(){return cv.InlineValueRequest}});Object.defineProperty(g,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return cv.InlineValueRefreshRequest}});var AT=OI();Object.defineProperty(g,"InlayHintRequest",{enumerable:!0,get:function(){return AT.InlayHintRequest}});Object.defineProperty(g,"InlayHintResolveRequest",{enumerable:!0,get:function(){return AT.InlayHintResolveRequest}});Object.defineProperty(g,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return AT.InlayHintRefreshRequest}});var Gl=BI();Object.defineProperty(g,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Gl.DiagnosticServerCancellationData}});Object.defineProperty(g,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Gl.DocumentDiagnosticReportKind}});Object.defineProperty(g,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Gl.DocumentDiagnosticRequest}});Object.defineProperty(g,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Gl.WorkspaceDiagnosticRequest}});Object.defineProperty(g,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Gl.DiagnosticRefreshRequest}});var gn=zI();Object.defineProperty(g,"NotebookCellKind",{enumerable:!0,get:function(){return gn.NotebookCellKind}});Object.defineProperty(g,"ExecutionSummary",{enumerable:!0,get:function(){return gn.ExecutionSummary}});Object.defineProperty(g,"NotebookCell",{enumerable:!0,get:function(){return gn.NotebookCell}});Object.defineProperty(g,"NotebookDocument",{enumerable:!0,get:function(){return gn.NotebookDocument}});Object.defineProperty(g,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return gn.NotebookDocumentSyncRegistrationType}});Object.defineProperty(g,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return gn.DidOpenNotebookDocumentNotification}});Object.defineProperty(g,"NotebookCellArrayChange",{enumerable:!0,get:function(){return gn.NotebookCellArrayChange}});Object.defineProperty(g,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return gn.DidChangeNotebookDocumentNotification}});Object.defineProperty(g,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return gn.DidSaveNotebookDocumentNotification}});Object.defineProperty(g,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return gn.DidCloseNotebookDocumentNotification}});var mU=KI();Object.defineProperty(g,"InlineCompletionRequest",{enumerable:!0,get:function(){return mU.InlineCompletionRequest}});var yT;(function(t){function e(r){let n=r;return Nt.string(n)||Nt.string(n.language)||Nt.string(n.scheme)||Nt.string(n.pattern)}t.is=e})(yT||(g.TextDocumentFilter=yT={}));var xT;(function(t){function e(r){let n=r;return Nt.objectLiteral(n)&&(Nt.string(n.notebookType)||Nt.string(n.scheme)||Nt.string(n.pattern))}t.is=e})(xT||(g.NotebookDocumentFilter=xT={}));var TT;(function(t){function e(r){let n=r;return Nt.objectLiteral(n)&&(Nt.string(n.notebook)||xT.is(n.notebook))&&(n.language===void 0||Nt.string(n.language))}t.is=e})(TT||(g.NotebookCellTextDocumentFilter=TT={}));var _T;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!Nt.string(n)&&!yT.is(n)&&!TT.is(n))return!1;return!0}t.is=e})(_T||(g.DocumentSelector=_T={}));var JI;(function(t){t.method="client/registerCapability",t.messageDirection=F.MessageDirection.serverToClient,t.type=new F.ProtocolRequestType(t.method)})(JI||(g.RegistrationRequest=JI={}));var QI;(function(t){t.method="client/unregisterCapability",t.messageDirection=F.MessageDirection.serverToClient,t.type=new F.ProtocolRequestType(t.method)})(QI||(g.UnregistrationRequest=QI={}));var eS;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(eS||(g.ResourceOperationKind=eS={}));var tS;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(tS||(g.FailureHandlingKind=tS={}));var rS;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(rS||(g.PositionEncodingKind=rS={}));var nS;(function(t){function e(r){let n=r;return n&&Nt.string(n.id)&&n.id.length>0}t.hasId=e})(nS||(g.StaticRegistrationOptions=nS={}));var iS;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||_T.is(n.documentSelector))}t.is=e})(iS||(g.TextDocumentRegistrationOptions=iS={}));var oS;(function(t){function e(n){let i=n;return Nt.objectLiteral(i)&&(i.workDoneProgress===void 0||Nt.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&Nt.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})(oS||(g.WorkDoneProgressOptions=oS={}));var sS;(function(t){t.method="initialize",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(sS||(g.InitializeRequest=sS={}));var aS;(function(t){t.unknownProtocolVersion=1})(aS||(g.InitializeErrorCodes=aS={}));var cS;(function(t){t.method="initialized",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolNotificationType(t.method)})(cS||(g.InitializedNotification=cS={}));var lS;(function(t){t.method="shutdown",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType0(t.method)})(lS||(g.ShutdownRequest=lS={}));var uS;(function(t){t.method="exit",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolNotificationType0(t.method)})(uS||(g.ExitNotification=uS={}));var fS;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolNotificationType(t.method)})(fS||(g.DidChangeConfigurationNotification=fS={}));var dS;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(dS||(g.MessageType=dS={}));var pS;(function(t){t.method="window/showMessage",t.messageDirection=F.MessageDirection.serverToClient,t.type=new F.ProtocolNotificationType(t.method)})(pS||(g.ShowMessageNotification=pS={}));var hS;(function(t){t.method="window/showMessageRequest",t.messageDirection=F.MessageDirection.serverToClient,t.type=new F.ProtocolRequestType(t.method)})(hS||(g.ShowMessageRequest=hS={}));var mS;(function(t){t.method="window/logMessage",t.messageDirection=F.MessageDirection.serverToClient,t.type=new F.ProtocolNotificationType(t.method)})(mS||(g.LogMessageNotification=mS={}));var gS;(function(t){t.method="telemetry/event",t.messageDirection=F.MessageDirection.serverToClient,t.type=new F.ProtocolNotificationType(t.method)})(gS||(g.TelemetryEventNotification=gS={}));var yS;(function(t){t.None=0,t.Full=1,t.Incremental=2})(yS||(g.TextDocumentSyncKind=yS={}));var xS;(function(t){t.method="textDocument/didOpen",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolNotificationType(t.method)})(xS||(g.DidOpenTextDocumentNotification=xS={}));var TS;(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})(TS||(g.TextDocumentContentChangeEvent=TS={}));var _S;(function(t){t.method="textDocument/didChange",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolNotificationType(t.method)})(_S||(g.DidChangeTextDocumentNotification=_S={}));var ES;(function(t){t.method="textDocument/didClose",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolNotificationType(t.method)})(ES||(g.DidCloseTextDocumentNotification=ES={}));var RS;(function(t){t.method="textDocument/didSave",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolNotificationType(t.method)})(RS||(g.DidSaveTextDocumentNotification=RS={}));var bS;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(bS||(g.TextDocumentSaveReason=bS={}));var wS;(function(t){t.method="textDocument/willSave",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolNotificationType(t.method)})(wS||(g.WillSaveTextDocumentNotification=wS={}));var AS;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(AS||(g.WillSaveTextDocumentWaitUntilRequest=AS={}));var IS;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolNotificationType(t.method)})(IS||(g.DidChangeWatchedFilesNotification=IS={}));var SS;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(SS||(g.FileChangeType=SS={}));var vS;(function(t){function e(r){let n=r;return Nt.objectLiteral(n)&&(ZI.URI.is(n.baseUri)||ZI.WorkspaceFolder.is(n.baseUri))&&Nt.string(n.pattern)}t.is=e})(vS||(g.RelativePattern=vS={}));var kS;(function(t){t.Create=1,t.Change=2,t.Delete=4})(kS||(g.WatchKind=kS={}));var NS;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=F.MessageDirection.serverToClient,t.type=new F.ProtocolNotificationType(t.method)})(NS||(g.PublishDiagnosticsNotification=NS={}));var PS;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(PS||(g.CompletionTriggerKind=PS={}));var CS;(function(t){t.method="textDocument/completion",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(CS||(g.CompletionRequest=CS={}));var OS;(function(t){t.method="completionItem/resolve",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(OS||(g.CompletionResolveRequest=OS={}));var LS;(function(t){t.method="textDocument/hover",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(LS||(g.HoverRequest=LS={}));var DS;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(DS||(g.SignatureHelpTriggerKind=DS={}));var $S;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})($S||(g.SignatureHelpRequest=$S={}));var MS;(function(t){t.method="textDocument/definition",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(MS||(g.DefinitionRequest=MS={}));var FS;(function(t){t.method="textDocument/references",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(FS||(g.ReferencesRequest=FS={}));var US;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(US||(g.DocumentHighlightRequest=US={}));var BS;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(BS||(g.DocumentSymbolRequest=BS={}));var XS;(function(t){t.method="textDocument/codeAction",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(XS||(g.CodeActionRequest=XS={}));var GS;(function(t){t.method="codeAction/resolve",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(GS||(g.CodeActionResolveRequest=GS={}));var HS;(function(t){t.method="workspace/symbol",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(HS||(g.WorkspaceSymbolRequest=HS={}));var jS;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(jS||(g.WorkspaceSymbolResolveRequest=jS={}));var WS;(function(t){t.method="textDocument/codeLens",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(WS||(g.CodeLensRequest=WS={}));var qS;(function(t){t.method="codeLens/resolve",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(qS||(g.CodeLensResolveRequest=qS={}));var zS;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=F.MessageDirection.serverToClient,t.type=new F.ProtocolRequestType0(t.method)})(zS||(g.CodeLensRefreshRequest=zS={}));var VS;(function(t){t.method="textDocument/documentLink",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(VS||(g.DocumentLinkRequest=VS={}));var YS;(function(t){t.method="documentLink/resolve",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(YS||(g.DocumentLinkResolveRequest=YS={}));var KS;(function(t){t.method="textDocument/formatting",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(KS||(g.DocumentFormattingRequest=KS={}));var ZS;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(ZS||(g.DocumentRangeFormattingRequest=ZS={}));var JS;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(JS||(g.DocumentRangesFormattingRequest=JS={}));var QS;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(QS||(g.DocumentOnTypeFormattingRequest=QS={}));var ev;(function(t){t.Identifier=1})(ev||(g.PrepareSupportDefaultBehavior=ev={}));var tv;(function(t){t.method="textDocument/rename",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(tv||(g.RenameRequest=tv={}));var rv;(function(t){t.method="textDocument/prepareRename",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(rv||(g.PrepareRenameRequest=rv={}));var nv;(function(t){t.method="workspace/executeCommand",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(nv||(g.ExecuteCommandRequest=nv={}));var iv;(function(t){t.method="workspace/applyEdit",t.messageDirection=F.MessageDirection.serverToClient,t.type=new F.ProtocolRequestType("workspace/applyEdit")})(iv||(g.ApplyWorkspaceEditRequest=iv={}))});var fv=ce(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});vp.createProtocolConnection=void 0;var uv=Do();function gU(t,e,r,n){return uv.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,uv.createMessageConnection)(t,e,r,n)}vp.createProtocolConnection=gU});var pv=ce(or=>{"use strict";var yU=or&&or.__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]})),kp=or&&or.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yU(e,t,r)};Object.defineProperty(or,"__esModule",{value:!0});or.LSPErrorCodes=or.createProtocolConnection=void 0;kp(Do(),or);kp((Zs(),qu(Dd)),or);kp(ut(),or);kp(lv(),or);var xU=fv();Object.defineProperty(or,"createProtocolConnection",{enumerable:!0,get:function(){return xU.createProtocolConnection}});var dv;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(dv||(or.LSPErrorCodes=dv={}))});var mv=ce(yn=>{"use strict";var TU=yn&&yn.__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]})),hv=yn&&yn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&TU(e,t,r)};Object.defineProperty(yn,"__esModule",{value:!0});yn.createProtocolConnection=void 0;var _U=lT();hv(lT(),yn);hv(pv(),yn);function EU(t,e,r,n){return(0,_U.createMessageConnection)(t,e,r,n)}yn.createProtocolConnection=EU});var Hv={};tn(Hv,{nodeReadFile:()=>HU});async function HU(){throw new Error("nowline: filesystem readers are unavailable in the browser embed")}var jv=bE(()=>{});var VH={};tn(VH,{EmbedRenderError:()=>Hu,__resetForTests:()=>zH,init:()=>_E,initialize:()=>HH,parse:()=>WH,render:()=>jH,run:()=>qH,sha:()=>XH,version:()=>BH});var wE="0.4.0",AE="86c53d1";var WP=/did you mean ['"]?([^'"?]+)['"]?\??/i;function IE(t,e){return{severity:t.severity===2?"warning":"error",code:qP(t),message:t.message,suggestion:VP(t.message),file:e,line:(t.range?.start.line??0)+1,column:(t.range?.start.character??0)+1}}function SE(t,e){return{severity:"error",code:"parse-error",message:t.message,file:e,line:t.token?.startLine??1,column:t.token?.startColumn??1}}function vE(t,e){return{severity:"error",code:"lex-error",message:t.message,file:e,line:t.line??1,column:t.column??1}}function kE(t){return{severity:t.severity,code:"include",message:t.message,file:t.sourcePath,line:t.line!==void 0?t.line+1:1,column:1}}function NE(t,e,r="warning"){return{severity:r,code:"render.warning",message:t,file:e,line:1,column:1}}function qP(t){return typeof t.code=="string"&&t.code!==""?t.code:typeof t.code=="number"?String(t.code):zP(t.message)}function zP(t){let e=t.toLowerCase();return e.includes("duplicate identifier")?"duplicate-identifier":e.includes("unknown reference")||e.includes("did you mean")?"unknown-reference":e.includes("circular")?"circular-dependency":e.includes("requires")&&e.includes("date:")?"missing-date":e.includes("duration")?"duration":e.includes("include")?"include":e.includes("indent")?"indentation":"validation"}function VP(t){let e=t.match(WP);return e?e[1].trim():void 0}var PE="__nowline_browser_noop_include__";async function CE(t){throw new Error(`${PE}: include "${t}" was skipped \u2014 running in single-file mode.`)}function OE(t){return t.includes(PE)}var lt={};tn(lt,{AbstractAstReflection:()=>zi,AbstractCstNode:()=>dl,AbstractLangiumParser:()=>pl,AbstractParserErrorMessageProvider:()=>Md,AbstractThreadedAsyncParser:()=>OT,AstUtils:()=>Yu,BiMap:()=>Po,Cancellation:()=>ne,CompositeCstNodeImpl:()=>Io,ContextCache:()=>Co,CstNodeBuilder:()=>fl,CstUtils:()=>gf,DEFAULT_TOKENIZE_OPTIONS:()=>Np,DONE_RESULT:()=>Mt,DatatypeSymbol:()=>$d,DefaultAstNodeDescriptionProvider:()=>Nl,DefaultAstNodeLocator:()=>Cl,DefaultAsyncParser:()=>Zl,DefaultCommentProvider:()=>Kl,DefaultConfigurationProvider:()=>Ol,DefaultDocumentBuilder:()=>Hl,DefaultDocumentValidator:()=>kl,DefaultHydrator:()=>Ql,DefaultIndexManager:()=>jl,DefaultJsonSerializer:()=>Il,DefaultLangiumDocumentFactory:()=>yl,DefaultLangiumDocuments:()=>xl,DefaultLangiumProfiler:()=>MT,DefaultLexer:()=>Mo,DefaultLexerErrorMessageProvider:()=>ql,DefaultLinker:()=>Tl,DefaultNameProvider:()=>_l,DefaultReferenceDescriptionProvider:()=>Pl,DefaultReferences:()=>El,DefaultScopeComputation:()=>Rl,DefaultScopeProvider:()=>Al,DefaultServiceRegistry:()=>Sl,DefaultTokenBuilder:()=>vo,DefaultValueConverter:()=>ko,DefaultWorkspaceLock:()=>Jl,DefaultWorkspaceManager:()=>Wl,Deferred:()=>Jt,Disposable:()=>Ci,DisposableCache:()=>sa,DocumentCache:()=>qd,DocumentState:()=>he,DocumentValidator:()=>wr,EMPTY_SCOPE:()=>IF,EMPTY_STREAM:()=>Zn,EmptyFileSystem:()=>iu,EmptyFileSystemProvider:()=>Lp,ErrorWithLocation:()=>co,GrammarAST:()=>Sc,GrammarUtils:()=>gs,IndentationAwareLexer:()=>nu,IndentationAwareTokenBuilder:()=>va,JSDocDocumentationProvider:()=>Yl,LangiumCompletionParser:()=>ml,LangiumParser:()=>hl,LangiumParserErrorMessageProvider:()=>Qs,LeafCstNodeImpl:()=>Ao,LexingMode:()=>Uo,MapScope:()=>Qy,Module:()=>DT,MultiMap:()=>Bt,MultiMapScope:()=>bl,OperationCancelled:()=>br,ParserWorker:()=>LT,ProfilingTask:()=>$p,Reduction:()=>ts,RefResolving:()=>No,RegExpUtils:()=>Tf,RootCstNodeImpl:()=>Js,SimpleCache:()=>wl,StreamImpl:()=>ur,StreamScope:()=>oa,TextDocument:()=>ra,TreeStreamImpl:()=>rn,URI:()=>mt,UriTrie:()=>ia,UriUtils:()=>_t,VALIDATE_EACH_NODE:()=>XA,ValidationCategory:()=>zd,ValidationRegistry:()=>vl,ValueConverter:()=>dn,WorkspaceCache:()=>aa,assertCondition:()=>BE,assertUnreachable:()=>sn,createCompletionParser:()=>Xy,createDefaultCoreModule:()=>eu,createDefaultSharedCoreModule:()=>tu,createGrammarConfig:()=>zm,createLangiumParser:()=>Gy,createParser:()=>gl,delayNextTick:()=>Zy,diagnosticData:()=>Oo,eagerLoad:()=>Av,getDiagnosticRange:()=>GA,indentationBuilderDefaultOptions:()=>$T,inject:()=>Fo,interruptAndCheck:()=>ht,isAstNode:()=>pt,isAstNodeDescription:()=>nm,isAstNodeWithComment:()=>ex,isCompositeCstNode:()=>Or,isIMultiModeLexerDefinition:()=>ST,isJSDoc:()=>PT,isLeafCstNode:()=>Kn,isLinkingError:()=>Vi,isMultiReference:()=>lr,isNamed:()=>UA,isOperationCancelled:()=>pn,isReference:()=>wt,isRootCstNode:()=>mc,isTokenTypeArray:()=>Pp,isTokenTypeDictionary:()=>IT,loadGrammarFromJson:()=>Dp,parseJSDoc:()=>NT,prepareLangiumParser:()=>SA,setInterruptionPeriod:()=>LA,startCancelableOperation:()=>jd,stream:()=>me,toDiagnosticData:()=>HA,toDiagnosticSeverity:()=>Vd});var gf={};tn(gf,{DefaultNameRegexp:()=>mf,RangeComparison:()=>on,compareRange:()=>$E,findCommentNode:()=>vm,findDeclarationNodeAtOffset:()=>yC,findLeafNodeAtOffset:()=>km,findLeafNodeBeforeOffset:()=>ME,flattenCst:()=>gC,getDatatypeNode:()=>mC,getInteriorNodes:()=>_C,getNextNode:()=>xC,getPreviousNode:()=>UE,getStartlineNode:()=>TC,inRange:()=>am,isChildNode:()=>Sm,isCommentNode:()=>Im,streamCst:()=>so,toDocumentSegment:()=>ao,tokenToRange:()=>ds});function pt(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function wt(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}function lr(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}function nm(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function Vi(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}var zi=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){let r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);let n=r.properties[e.property]?.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){let r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return pt(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.types[e],s=o?o.superTypes.some(a=>this.isSubtype(a,r)):!1;return n[r]=s,s}}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 Or(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function Kn(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function mc(t){return Or(t)&&typeof t.fullText=="string"}var ur=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){return new t(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return Mt})}join(e=","){let r=this.iterator(),n="",i,o=!1;do i=r.next(),i.done||(o&&(n+=e),n+=KP(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?Mt:{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 Mt})}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(zu(o))r.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}}while(r.iterator);return Mt})}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(zu(o))n.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}while(n.iterator);return Mt})}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?Mt:this.nextFn(r.state)))}distinct(e){return new t(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){let i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return Mt})}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 KP(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function zu(t){return!!t&&typeof t[Symbol.iterator]=="function"}var Zn=new ur(()=>{},()=>Mt),Mt=Object.freeze({done:!0,value:void 0});function me(...t){if(t.length===1){let e=t[0];if(e instanceof ur)return e;if(zu(e))return new ur(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new ur(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:Mt)}return t.length>1?new ur(()=>({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++];zu(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return Mt}):Zn}var rn=class extends ur{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 Mt})}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}},ts;(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})(ts||(ts={}));var Yu={};tn(Yu,{assignMandatoryProperties:()=>sm,copyAstNode:()=>om,findRootNode:()=>ns,getContainerOfType:()=>An,getDocument:()=>Ft,getReferenceNodes:()=>Vu,hasContainerOfType:()=>ZP,linkContentToContainer:()=>rs,streamAllContents:()=>Lr,streamAst:()=>Wt,streamContents:()=>gc,streamReferences:()=>Jn});function rs(t,e={}){for(let[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,o)=>{pt(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=o,e.deep&&rs(i,e))}):pt(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&rs(n,e)))}function An(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function ZP(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}function Ft(t){let r=ns(t).$document;if(!r)throw new Error("AST node has no document.");return r}function ns(t){for(;t.$container;)t=t.$container;return t}function Vu(t){return wt(t)?t.ref?[t.ref]:[]:lr(t)?t.items.map(e=>e.ref):[]}function gc(t,e){if(!t)throw new Error("Node must be an AstNode.");let r=e?.range;return new ur(()=>({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(pt(o)){if(n.keyIndex++,im(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(pt(a)&&im(a,r))return{done:!1,value:a}}n.arrayIndex=0}}n.keyIndex++}return Mt})}function Lr(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new rn(t,r=>gc(r,e))}function Wt(t,e){if(t){if(e?.range&&!im(t,e.range))return new rn(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new rn(t,r=>gc(r,e),{includeRoot:!0})}function im(t,e){if(!e)return!0;let r=t.$cstNode?.range;return r?am(r,e):!1}function Jn(t){return new ur(()=>({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(wt(n)||lr(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(wt(o)||lr(n))return{done:!1,value:{reference:o,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Mt})}function sm(t,e){let r=t.getTypeMetaData(e.$type),n=e;for(let i of Object.values(r.properties))i.defaultValue!==void 0&&n[i.name]===void 0&&(n[i.name]=LE(i.defaultValue))}function LE(t){return Array.isArray(t)?[...t.map(LE)]:t}function om(t,e,r){let n={$type:t.$type};r&&(r.set(t,n),r.set(n,t));for(let[i,o]of Object.entries(t))if(!i.startsWith("$"))if(pt(o))n[i]=om(o,e,r);else if(wt(o))n[i]=e(n,i,o.$refNode,o.$refText,o);else if(Array.isArray(o)){let s=[];for(let a of o)pt(a)?s.push(om(a,e,r)):wt(a)?s.push(e(n,i,a.$refNode,a.$refText,a)):s.push(a);n[i]=s}else n[i]=o;return rs(n,{deep:!0}),n}var Sc={};tn(Sc,{AbstractElement:()=>Qt,AbstractParserRule:()=>yc,AbstractRule:()=>is,AbstractType:()=>fr,Action:()=>Qn,Alternatives:()=>xc,ArrayLiteral:()=>Ku,ArrayType:()=>Zu,Assignment:()=>ei,BooleanLiteral:()=>Ju,CharacterRange:()=>ti,Condition:()=>ri,Conjunction:()=>Tc,CrossReference:()=>ni,Disjunction:()=>_c,EndOfFile:()=>Qu,Grammar:()=>In,GrammarImport:()=>ef,Group:()=>Yi,InferredType:()=>tf,InfixRule:()=>nn,InfixRuleOperatorList:()=>Ec,InfixRuleOperators:()=>rf,Interface:()=>os,Keyword:()=>ss,LangiumGrammarAstReflection:()=>fs,LangiumGrammarTerminals:()=>JP,NamedArgument:()=>as,NegatedToken:()=>Ki,Negation:()=>nf,NumberLiteral:()=>of,Parameter:()=>cs,ParameterReference:()=>sf,ParserRule:()=>Dr,ReferenceType:()=>Rc,RegexToken:()=>Zi,ReturnType:()=>af,RuleCall:()=>Ji,SimpleType:()=>ls,StringLiteral:()=>cf,TerminalAlternatives:()=>Qi,TerminalElement:()=>er,TerminalGroup:()=>eo,TerminalRule:()=>Sn,TerminalRuleCall:()=>to,Type:()=>bc,TypeAttribute:()=>ro,TypeDefinition:()=>no,UnionType:()=>lf,UnorderedGroup:()=>wc,UntilToken:()=>io,ValueLiteral:()=>oo,Wildcard:()=>us,isAbstractElement:()=>Ac,isAbstractParserRule:()=>vn,isAbstractRule:()=>QP,isAbstractType:()=>eC,isAction:()=>kn,isAlternatives:()=>uf,isArrayLiteral:()=>tC,isArrayType:()=>cm,isAssignment:()=>$r,isBooleanLiteral:()=>lm,isCharacterRange:()=>um,isCondition:()=>rC,isConjunction:()=>fm,isCrossReference:()=>Mr,isDisjunction:()=>dm,isEndOfFile:()=>pm,isGrammar:()=>nC,isGrammarImport:()=>iC,isGroup:()=>ii,isInferredType:()=>Ic,isInfixRule:()=>oi,isInfixRuleOperatorList:()=>oC,isInfixRuleOperators:()=>sC,isInterface:()=>hm,isKeyword:()=>Er,isNamedArgument:()=>aC,isNegatedToken:()=>mm,isNegation:()=>gm,isNumberLiteral:()=>cC,isParameter:()=>lC,isParameterReference:()=>ym,isParserRule:()=>St,isReferenceType:()=>xm,isRegexToken:()=>Tm,isReturnType:()=>_m,isRuleCall:()=>Fr,isSimpleType:()=>ff,isStringLiteral:()=>uC,isTerminalAlternatives:()=>Em,isTerminalElement:()=>fC,isTerminalGroup:()=>Rm,isTerminalRule:()=>qt,isTerminalRuleCall:()=>df,isType:()=>pf,isTypeAttribute:()=>dC,isTypeDefinition:()=>pC,isUnionType:()=>bm,isUnorderedGroup:()=>hf,isUntilToken:()=>wm,isValueLiteral:()=>hC,isWildcard:()=>Am,reflection:()=>re});var JP={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]*/},Qt={$type:"AbstractElement",cardinality:"cardinality"};function Ac(t){return re.isInstance(t,Qt.$type)}var yc={$type:"AbstractParserRule"};function vn(t){return re.isInstance(t,yc.$type)}var is={$type:"AbstractRule"};function QP(t){return re.isInstance(t,is.$type)}var fr={$type:"AbstractType"};function eC(t){return re.isInstance(t,fr.$type)}var Qn={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function kn(t){return re.isInstance(t,Qn.$type)}var xc={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function uf(t){return re.isInstance(t,xc.$type)}var Ku={$type:"ArrayLiteral",elements:"elements"};function tC(t){return re.isInstance(t,Ku.$type)}var Zu={$type:"ArrayType",elementType:"elementType"};function cm(t){return re.isInstance(t,Zu.$type)}var ei={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function $r(t){return re.isInstance(t,ei.$type)}var Ju={$type:"BooleanLiteral",true:"true"};function lm(t){return re.isInstance(t,Ju.$type)}var ti={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function um(t){return re.isInstance(t,ti.$type)}var ri={$type:"Condition"};function rC(t){return re.isInstance(t,ri.$type)}var Tc={$type:"Conjunction",left:"left",right:"right"};function fm(t){return re.isInstance(t,Tc.$type)}var ni={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Mr(t){return re.isInstance(t,ni.$type)}var _c={$type:"Disjunction",left:"left",right:"right"};function dm(t){return re.isInstance(t,_c.$type)}var Qu={$type:"EndOfFile",cardinality:"cardinality"};function pm(t){return re.isInstance(t,Qu.$type)}var In={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function nC(t){return re.isInstance(t,In.$type)}var ef={$type:"GrammarImport",path:"path"};function iC(t){return re.isInstance(t,ef.$type)}var Yi={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function ii(t){return re.isInstance(t,Yi.$type)}var tf={$type:"InferredType",name:"name"};function Ic(t){return re.isInstance(t,tf.$type)}var nn={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function oi(t){return re.isInstance(t,nn.$type)}var Ec={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function oC(t){return re.isInstance(t,Ec.$type)}var rf={$type:"InfixRuleOperators",precedences:"precedences"};function sC(t){return re.isInstance(t,rf.$type)}var os={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function hm(t){return re.isInstance(t,os.$type)}var ss={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Er(t){return re.isInstance(t,ss.$type)}var as={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function aC(t){return re.isInstance(t,as.$type)}var Ki={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function mm(t){return re.isInstance(t,Ki.$type)}var nf={$type:"Negation",value:"value"};function gm(t){return re.isInstance(t,nf.$type)}var of={$type:"NumberLiteral",value:"value"};function cC(t){return re.isInstance(t,of.$type)}var cs={$type:"Parameter",name:"name"};function lC(t){return re.isInstance(t,cs.$type)}var sf={$type:"ParameterReference",parameter:"parameter"};function ym(t){return re.isInstance(t,sf.$type)}var Dr={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function St(t){return re.isInstance(t,Dr.$type)}var Rc={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function xm(t){return re.isInstance(t,Rc.$type)}var Zi={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function Tm(t){return re.isInstance(t,Zi.$type)}var af={$type:"ReturnType",name:"name"};function _m(t){return re.isInstance(t,af.$type)}var Ji={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Fr(t){return re.isInstance(t,Ji.$type)}var ls={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function ff(t){return re.isInstance(t,ls.$type)}var cf={$type:"StringLiteral",value:"value"};function uC(t){return re.isInstance(t,cf.$type)}var Qi={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Em(t){return re.isInstance(t,Qi.$type)}var er={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function fC(t){return re.isInstance(t,er.$type)}var eo={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Rm(t){return re.isInstance(t,eo.$type)}var Sn={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function qt(t){return re.isInstance(t,Sn.$type)}var to={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function df(t){return re.isInstance(t,to.$type)}var bc={$type:"Type",name:"name",type:"type"};function pf(t){return re.isInstance(t,bc.$type)}var ro={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function dC(t){return re.isInstance(t,ro.$type)}var no={$type:"TypeDefinition"};function pC(t){return re.isInstance(t,no.$type)}var lf={$type:"UnionType",types:"types"};function bm(t){return re.isInstance(t,lf.$type)}var wc={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function hf(t){return re.isInstance(t,wc.$type)}var io={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function wm(t){return re.isInstance(t,io.$type)}var oo={$type:"ValueLiteral"};function hC(t){return re.isInstance(t,oo.$type)}var us={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function Am(t){return re.isInstance(t,us.$type)}var fs=class extends zi{constructor(){super(...arguments),this.types={AbstractElement:{name:Qt.$type,properties:{cardinality:{name:Qt.cardinality}},superTypes:[]},AbstractParserRule:{name:yc.$type,properties:{},superTypes:[is.$type,fr.$type]},AbstractRule:{name:is.$type,properties:{},superTypes:[]},AbstractType:{name:fr.$type,properties:{},superTypes:[]},Action:{name:Qn.$type,properties:{cardinality:{name:Qn.cardinality},feature:{name:Qn.feature},inferredType:{name:Qn.inferredType},operator:{name:Qn.operator},type:{name:Qn.type,referenceType:fr.$type}},superTypes:[Qt.$type]},Alternatives:{name:xc.$type,properties:{cardinality:{name:xc.cardinality},elements:{name:xc.elements,defaultValue:[]}},superTypes:[Qt.$type]},ArrayLiteral:{name:Ku.$type,properties:{elements:{name:Ku.elements,defaultValue:[]}},superTypes:[oo.$type]},ArrayType:{name:Zu.$type,properties:{elementType:{name:Zu.elementType}},superTypes:[no.$type]},Assignment:{name:ei.$type,properties:{cardinality:{name:ei.cardinality},feature:{name:ei.feature},operator:{name:ei.operator},predicate:{name:ei.predicate},terminal:{name:ei.terminal}},superTypes:[Qt.$type]},BooleanLiteral:{name:Ju.$type,properties:{true:{name:Ju.true,defaultValue:!1}},superTypes:[ri.$type,oo.$type]},CharacterRange:{name:ti.$type,properties:{cardinality:{name:ti.cardinality},left:{name:ti.left},lookahead:{name:ti.lookahead},parenthesized:{name:ti.parenthesized,defaultValue:!1},right:{name:ti.right}},superTypes:[er.$type]},Condition:{name:ri.$type,properties:{},superTypes:[]},Conjunction:{name:Tc.$type,properties:{left:{name:Tc.left},right:{name:Tc.right}},superTypes:[ri.$type]},CrossReference:{name:ni.$type,properties:{cardinality:{name:ni.cardinality},deprecatedSyntax:{name:ni.deprecatedSyntax,defaultValue:!1},isMulti:{name:ni.isMulti,defaultValue:!1},terminal:{name:ni.terminal},type:{name:ni.type,referenceType:fr.$type}},superTypes:[Qt.$type]},Disjunction:{name:_c.$type,properties:{left:{name:_c.left},right:{name:_c.right}},superTypes:[ri.$type]},EndOfFile:{name:Qu.$type,properties:{cardinality:{name:Qu.cardinality}},superTypes:[Qt.$type]},Grammar:{name:In.$type,properties:{imports:{name:In.imports,defaultValue:[]},interfaces:{name:In.interfaces,defaultValue:[]},isDeclared:{name:In.isDeclared,defaultValue:!1},name:{name:In.name},rules:{name:In.rules,defaultValue:[]},types:{name:In.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:ef.$type,properties:{path:{name:ef.path}},superTypes:[]},Group:{name:Yi.$type,properties:{cardinality:{name:Yi.cardinality},elements:{name:Yi.elements,defaultValue:[]},guardCondition:{name:Yi.guardCondition},predicate:{name:Yi.predicate}},superTypes:[Qt.$type]},InferredType:{name:tf.$type,properties:{name:{name:tf.name}},superTypes:[fr.$type]},InfixRule:{name:nn.$type,properties:{call:{name:nn.call},dataType:{name:nn.dataType},inferredType:{name:nn.inferredType},name:{name:nn.name},operators:{name:nn.operators},parameters:{name:nn.parameters,defaultValue:[]},returnType:{name:nn.returnType,referenceType:fr.$type}},superTypes:[yc.$type]},InfixRuleOperatorList:{name:Ec.$type,properties:{associativity:{name:Ec.associativity},operators:{name:Ec.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:rf.$type,properties:{precedences:{name:rf.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:os.$type,properties:{attributes:{name:os.attributes,defaultValue:[]},name:{name:os.name},superTypes:{name:os.superTypes,defaultValue:[],referenceType:fr.$type}},superTypes:[fr.$type]},Keyword:{name:ss.$type,properties:{cardinality:{name:ss.cardinality},predicate:{name:ss.predicate},value:{name:ss.value}},superTypes:[Qt.$type]},NamedArgument:{name:as.$type,properties:{calledByName:{name:as.calledByName,defaultValue:!1},parameter:{name:as.parameter,referenceType:cs.$type},value:{name:as.value}},superTypes:[]},NegatedToken:{name:Ki.$type,properties:{cardinality:{name:Ki.cardinality},lookahead:{name:Ki.lookahead},parenthesized:{name:Ki.parenthesized,defaultValue:!1},terminal:{name:Ki.terminal}},superTypes:[er.$type]},Negation:{name:nf.$type,properties:{value:{name:nf.value}},superTypes:[ri.$type]},NumberLiteral:{name:of.$type,properties:{value:{name:of.value}},superTypes:[oo.$type]},Parameter:{name:cs.$type,properties:{name:{name:cs.name}},superTypes:[]},ParameterReference:{name:sf.$type,properties:{parameter:{name:sf.parameter,referenceType:cs.$type}},superTypes:[ri.$type]},ParserRule:{name:Dr.$type,properties:{dataType:{name:Dr.dataType},definition:{name:Dr.definition},entry:{name:Dr.entry,defaultValue:!1},fragment:{name:Dr.fragment,defaultValue:!1},inferredType:{name:Dr.inferredType},name:{name:Dr.name},parameters:{name:Dr.parameters,defaultValue:[]},returnType:{name:Dr.returnType,referenceType:fr.$type}},superTypes:[yc.$type]},ReferenceType:{name:Rc.$type,properties:{isMulti:{name:Rc.isMulti,defaultValue:!1},referenceType:{name:Rc.referenceType}},superTypes:[no.$type]},RegexToken:{name:Zi.$type,properties:{cardinality:{name:Zi.cardinality},lookahead:{name:Zi.lookahead},parenthesized:{name:Zi.parenthesized,defaultValue:!1},regex:{name:Zi.regex}},superTypes:[er.$type]},ReturnType:{name:af.$type,properties:{name:{name:af.name}},superTypes:[]},RuleCall:{name:Ji.$type,properties:{arguments:{name:Ji.arguments,defaultValue:[]},cardinality:{name:Ji.cardinality},predicate:{name:Ji.predicate},rule:{name:Ji.rule,referenceType:is.$type}},superTypes:[Qt.$type]},SimpleType:{name:ls.$type,properties:{primitiveType:{name:ls.primitiveType},stringType:{name:ls.stringType},typeRef:{name:ls.typeRef,referenceType:fr.$type}},superTypes:[no.$type]},StringLiteral:{name:cf.$type,properties:{value:{name:cf.value}},superTypes:[oo.$type]},TerminalAlternatives:{name:Qi.$type,properties:{cardinality:{name:Qi.cardinality},elements:{name:Qi.elements,defaultValue:[]},lookahead:{name:Qi.lookahead},parenthesized:{name:Qi.parenthesized,defaultValue:!1}},superTypes:[er.$type]},TerminalElement:{name:er.$type,properties:{cardinality:{name:er.cardinality},lookahead:{name:er.lookahead},parenthesized:{name:er.parenthesized,defaultValue:!1}},superTypes:[Qt.$type]},TerminalGroup:{name:eo.$type,properties:{cardinality:{name:eo.cardinality},elements:{name:eo.elements,defaultValue:[]},lookahead:{name:eo.lookahead},parenthesized:{name:eo.parenthesized,defaultValue:!1}},superTypes:[er.$type]},TerminalRule:{name:Sn.$type,properties:{definition:{name:Sn.definition},fragment:{name:Sn.fragment,defaultValue:!1},hidden:{name:Sn.hidden,defaultValue:!1},name:{name:Sn.name},type:{name:Sn.type}},superTypes:[is.$type]},TerminalRuleCall:{name:to.$type,properties:{cardinality:{name:to.cardinality},lookahead:{name:to.lookahead},parenthesized:{name:to.parenthesized,defaultValue:!1},rule:{name:to.rule,referenceType:Sn.$type}},superTypes:[er.$type]},Type:{name:bc.$type,properties:{name:{name:bc.name},type:{name:bc.type}},superTypes:[fr.$type]},TypeAttribute:{name:ro.$type,properties:{defaultValue:{name:ro.defaultValue},isOptional:{name:ro.isOptional,defaultValue:!1},name:{name:ro.name},type:{name:ro.type}},superTypes:[]},TypeDefinition:{name:no.$type,properties:{},superTypes:[]},UnionType:{name:lf.$type,properties:{types:{name:lf.types,defaultValue:[]}},superTypes:[no.$type]},UnorderedGroup:{name:wc.$type,properties:{cardinality:{name:wc.cardinality},elements:{name:wc.elements,defaultValue:[]}},superTypes:[Qt.$type]},UntilToken:{name:io.$type,properties:{cardinality:{name:io.cardinality},lookahead:{name:io.lookahead},parenthesized:{name:io.parenthesized,defaultValue:!1},terminal:{name:io.terminal}},superTypes:[er.$type]},ValueLiteral:{name:oo.$type,properties:{},superTypes:[]},Wildcard:{name:us.$type,properties:{cardinality:{name:us.cardinality},lookahead:{name:us.lookahead},parenthesized:{name:us.parenthesized,defaultValue:!1}},superTypes:[er.$type]}}}},re=new fs;function mC(t){let e=t,r=!1;for(;e;){let n=An(e.grammarSource,St);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}function so(t){return new rn(t,e=>Or(e)?e.content:[],{includeRoot:!0})}function gC(t){return so(t).filter(Kn)}function Sm(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function ds(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function ao(t){if(!t)return;let{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}var on;(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",t[t.Outside=5]="Outside"})(on||(on={}));function $E(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return on.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return on.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?on.Inside:r?on.OverlapBack:n?on.OverlapFront:on.Outside}function am(t,e){return $E(t,e)>on.After}var mf=/^[\w\p{L}]$/u;function yC(t,e,r=mf){if(t){if(e>0){let n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return km(t,e)}}function vm(t,e){if(t){let r=UE(t,!0);if(r&&Im(r,e))return r;if(mc(t)){let n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){let o=t.content[i];if(Im(o,e))return o}}}}function Im(t,e){return Kn(t)&&e.includes(t.tokenType.name)}function km(t,e){if(Kn(t))return t;if(Or(t)){let r=FE(t,e,!1);if(r)return km(r,e)}}function ME(t,e){if(Kn(t))return t;if(Or(t)){let r=FE(t,e,!0);if(r)return ME(r,e)}}function FE(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 UE(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 xC(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 TC(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 _C(t,e){let r=EC(t,e);return r?r.parent.content.slice(r.a+1,r.b):[]}function EC(t,e){let r=DE(t),n=DE(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 DE(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 gs={};tn(gs,{findAssignment:()=>jm,findNameAssignment:()=>_f,findNodeForKeyword:()=>Gm,findNodeForProperty:()=>Oc,findNodesForKeyword:()=>IC,findNodesForKeywordInternal:()=>Hm,findNodesForProperty:()=>Bm,getActionAtElement:()=>VE,getActionType:()=>KE,getAllReachableRules:()=>Cc,getAllRulesUsedForCrossReferences:()=>AC,getCrossReferenceTerminal:()=>Fm,getEntryRule:()=>jE,getExplicitRuleType:()=>Ef,getHiddenRules:()=>WE,getRuleType:()=>Wm,getRuleTypeName:()=>PC,getTypeName:()=>ai,isArrayCardinality:()=>vC,isArrayOperator:()=>kC,isCommentTerminal:()=>Um,isDataType:()=>NC,isDataTypeRule:()=>Lc,isOptionalCardinality:()=>SC,terminalRegex:()=>hs});var co=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}};function sn(t,e="Error: Got unexpected value."){throw new Error(e)}function BE(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}var Tf={};tn(Tf,{NEWLINE_REGEXP:()=>Om,escapeRegExp:()=>si,getTerminalParts:()=>wC,isMultilineComment:()=>Lm,isWhitespace:()=>Pc,partialMatches:()=>Dm,partialRegExp:()=>HE,whitespaceCharacters:()=>GE});function oe(t){return t.charCodeAt(0)}function yf(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function ps(t,e){if(t[e]===!0)throw"duplicate flag "+e;let r=t[e];t[e]=!0}function lo(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function vc(){throw Error("Internal Error - Should never get here!")}function Nm(t){return t.type==="Character"}var kc=[];for(let t=oe("0");t<=oe("9");t++)kc.push(t);var Nc=[oe("_")].concat(kc);for(let t=oe("a");t<=oe("z");t++)Nc.push(t);for(let t=oe("A");t<=oe("Z");t++)Nc.push(t);var Pm=[oe(" "),oe("\f"),oe(`
37
- `),oe("\r"),oe(" "),oe("\v"),oe(" "),oe("\xA0"),oe("\u1680"),oe("\u2000"),oe("\u2001"),oe("\u2002"),oe("\u2003"),oe("\u2004"),oe("\u2005"),oe("\u2006"),oe("\u2007"),oe("\u2008"),oe("\u2009"),oe("\u200A"),oe("\u2028"),oe("\u2029"),oe("\u202F"),oe("\u205F"),oe("\u3000"),oe("\uFEFF")];var RC=/[0-9a-fA-F]/,xf=/[0-9]/,bC=/[1-9]/,uo=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":ps(n,"global");break;case"i":ps(n,"ignoreCase");break;case"m":ps(n,"multiLine");break;case"u":ps(n,"unicode");break;case"y":ps(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;case"<":{switch(this.popChar()){case"=":r="Lookbehind";break;case"!":r="NegativeLookbehind"}break}}lo(r);let n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return vc()}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;lo(r);break}if(!(e===!0&&r===void 0)&&lo(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()),lo(e)?(e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):vc()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[oe(`
38
- `),oe("\r"),oe("\u2028"),oe("\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=kc;break;case"D":e=kc,r=!0;break;case"s":e=Pm;break;case"S":e=Pm,r=!0;break;case"w":e=Nc;break;case"W":e=Nc,r=!0;break}return lo(e)?{type:"Set",value:e,complement:r}:vc()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=oe("\f");break;case"n":e=oe(`
39
- `);break;case"r":e=oe("\r");break;case"t":e=oe(" ");break;case"v":e=oe("\v");break}return lo(e)?{type:"Character",value:e}:vc()}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:oe("\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:oe(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
40
- `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let e=this.popChar();return{type:"Character",value:oe(e)}}}characterClass(){let e=[],r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){let n=this.classAtom(),i=n.type==="Character";if(Nm(n)&&this.isRangeDash()){this.consumeChar("-");let o=this.classAtom(),s=o.type==="Character";if(Nm(o)){if(o.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:o.value})}else yf(n.value,e),e.push(oe("-")),yf(o.value,e)}else yf(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
41
- `:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:oe("\b")};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()}}group(){let e=!0;this.consumeChar("("),this.peekChar(0)==="?"?(this.consumeChar("?"),this.consumeChar(":"),e=!1):this.groupIdx++;let r=this.disjunction();this.consumeChar(")");let n={type:"Group",capturing:e,value:r};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(bC.test(e)===!1)throw Error("Expecting a positive integer");for(;xf.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(xf.test(e)===!1)throw Error("Expecting an integer");for(;xf.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`
42
- `:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:oe(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return xf.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
36
+ `)),C){let Z=x.error?` Request failed: ${x.error.message} (${x.error.code}).`:"";D.log(`Received response '${C.method} - (${x.id})' in ${Date.now()-C.timerStart}ms.${Z}`,j)}else D.log(`Received response ${x.id} without active response promise.`,j)}else Or("receive-response",x)}function Or(x,C){if(!D||E===$e.Off)return;let j={isLSPMessage:!0,type:x,message:C,timestamp:Date.now()};D.log(j)}function me(){if(X())throw new _a(jl.Closed,"Connection is closed.");if(F())throw new _a(jl.Disposed,"Connection is disposed.")}function Ki(){if(M())throw new _a(jl.AlreadyListening,"Connection is already listening")}function Zi(){if(!M())throw new Error("Call listen() first.")}function Lr(x){return x===void 0?null:x}function ss(x){if(x!==null)return x}function _r(x){return x!=null&&!Array.isArray(x)&&typeof x=="object"}function Lt(x,C){switch(x){case ce.ParameterStructures.auto:return _r(C)?ss(C):[Lr(C)];case ce.ParameterStructures.byName:if(!_r(C))throw new Error("Received parameters by name but param is not an object literal.");return ss(C);case ce.ParameterStructures.byPosition:return[Lr(C)];default:throw new Error(`Unknown parameter structure ${x.toString()}`)}}function nn(x,C){let j,Z=x.numberOfParams;switch(Z){case 0:j=void 0;break;case 1:j=Lt(x.parameterStructures,C[0]);break;default:j=[];for(let je=0;je<C.length&&je<Z;je++)j.push(Lr(C[je]));if(C.length<Z)for(let je=C.length;je<Z;je++)j.push(null);break}return j}let zt={sendNotification:(x,...C)=>{me();let j,Z;if(yt.string(x)){j=x;let Se=C[0],De=0,Ve=ce.ParameterStructures.auto;ce.ParameterStructures.is(Se)&&(De=1,Ve=Se);let Ee=C.length,Be=Ee-De;switch(Be){case 0:Z=void 0;break;case 1:Z=Lt(Ve,C[De]);break;default:if(Ve===ce.ParameterStructures.byName)throw new Error(`Received ${Be} parameters for 'by Name' notification parameter structure.`);Z=C.slice(De,Ee).map(Ie=>Lr(Ie));break}}else{let Se=C;j=x.method,Z=nn(x,Se)}let je={jsonrpc:c,method:j,params:Z};return xe(je),e.write(je).catch(Se=>{throw i.error("Sending notification failed."),Se})},onNotification:(x,C)=>{me();let j;return yt.func(x)?f=x:C&&(yt.string(x)?(j=x,d.set(x,{type:void 0,handler:C})):(j=x.method,d.set(x.method,{type:x,handler:C}))),{dispose:()=>{j!==void 0?d.delete(j):f=void 0}}},onProgress:(x,C,j)=>{if(p.has(C))throw new Error(`Progress handler for token ${C} already registered`);return p.set(C,j),{dispose:()=>{p.delete(C)}}},sendProgress:(x,C,j)=>zt.sendNotification(Hl.type,{token:C,value:j}),onUnhandledProgress:le.event,sendRequest:(x,...C)=>{me(),Zi();let j,Z,je;if(yt.string(x)){j=x;let Ee=C[0],Be=C[C.length-1],Ie=0,pt=ce.ParameterStructures.auto;ce.ParameterStructures.is(Ee)&&(Ie=1,pt=Ee);let rt=C.length;nT.CancellationToken.is(Be)&&(rt=rt-1,je=Be);let lr=rt-Ie;switch(lr){case 0:Z=void 0;break;case 1:Z=Lt(pt,C[Ie]);break;default:if(pt===ce.ParameterStructures.byName)throw new Error(`Received ${lr} parameters for 'by Name' request parameter structure.`);Z=C.slice(Ie,rt).map(Mt=>Lr(Mt));break}}else{let Ee=C;j=x.method,Z=nn(x,Ee);let Be=x.numberOfParams;je=nT.CancellationToken.is(Ee[Be])?Ee[Be]:void 0}let Se=o++,De;je&&(De=je.onCancellationRequested(()=>{let Ee=R.sender.sendCancellation(zt,Se);return Ee===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${Se}`),Promise.resolve()):Ee.catch(()=>{i.log(`Sending cancellation messages for id ${Se} failed`)})}));let Ve={jsonrpc:c,id:Se,method:j,params:Z};return ge(Ve),typeof R.sender.enableCancellation=="function"&&R.sender.enableCancellation(Ve),new Promise(async(Ee,Be)=>{let Ie=lr=>{Ee(lr),R.sender.cleanup(Se),De?.dispose()},pt=lr=>{Be(lr),R.sender.cleanup(Se),De?.dispose()},rt={method:j,timerStart:Date.now(),resolve:Ie,reject:pt};try{await e.write(Ve),v.set(Se,rt)}catch(lr){throw i.error("Sending request failed."),rt.reject(new ce.ResponseError(ce.ErrorCodes.MessageWriteError,lr.message?lr.message:"Unknown reason")),lr}})},onRequest:(x,C)=>{me();let j=null;return sT.is(x)?(j=void 0,l=x):yt.string(x)?(j=null,C!==void 0&&(j=x,u.set(x,{handler:C,type:void 0}))):C!==void 0&&(j=x.method,u.set(x.method,{type:x,handler:C})),{dispose:()=>{j!==null&&(j!==void 0?u.delete(j):l=void 0)}}},hasPendingResponse:()=>v.size>0,trace:async(x,C,j)=>{let Z=!1,je=mr.Text;j!==void 0&&(yt.boolean(j)?Z=j:(Z=j.sendNotification||!1,je=j.traceFormat||mr.Text)),E=x,I=je,E===$e.Off?D=void 0:D=C,Z&&!X()&&!F()&&await zt.sendNotification(aT.type,{value:$e.toString(x)})},onError:B.event,onClose:U.event,onUnhandledNotification:z.event,onDispose:O.event,end:()=>{e.end()},dispose:()=>{if(F())return;k=jr.Disposed,O.fire(void 0);let x=new ce.ResponseError(ce.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let C of v.values())C.reject(x);v=new Map,_=new Map,T=new Set,g=new wb.LinkedMap,yt.func(e.dispose)&&e.dispose(),yt.func(t.dispose)&&t.dispose()},listen:()=>{me(),Ki(),k=jr.Listening,t.listen(Fe)},inspect:()=>{(0,Rb.default)().console.log("inspect")}};return zt.onNotification(hp.type,x=>{if(E===$e.Off||!D)return;let C=E===$e.Verbose||E===$e.Compact;D.log(x.message,C?x.verbose:void 0)}),zt.onNotification(Hl.type,x=>{let C=p.get(x.token);C?C(x.value):le.fire(x)}),zt}he.createMessageConnection=R2});var _p=ue(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.ProgressType=N.ProgressToken=N.createMessageConnection=N.NullLogger=N.ConnectionOptions=N.ConnectionStrategy=N.AbstractMessageBuffer=N.WriteableStreamMessageWriter=N.AbstractMessageWriter=N.MessageWriter=N.ReadableStreamMessageReader=N.AbstractMessageReader=N.MessageReader=N.SharedArrayReceiverStrategy=N.SharedArraySenderStrategy=N.CancellationToken=N.CancellationTokenSource=N.Emitter=N.Event=N.Disposable=N.LRUCache=N.Touch=N.LinkedMap=N.ParameterStructures=N.NotificationType9=N.NotificationType8=N.NotificationType7=N.NotificationType6=N.NotificationType5=N.NotificationType4=N.NotificationType3=N.NotificationType2=N.NotificationType1=N.NotificationType0=N.NotificationType=N.ErrorCodes=N.ResponseError=N.RequestType9=N.RequestType8=N.RequestType7=N.RequestType6=N.RequestType5=N.RequestType4=N.RequestType3=N.RequestType2=N.RequestType1=N.RequestType0=N.RequestType=N.Message=N.RAL=void 0;N.MessageStrategy=N.CancellationStrategy=N.CancellationSenderStrategy=N.CancellationReceiverStrategy=N.ConnectionError=N.ConnectionErrors=N.LogTraceNotification=N.SetTraceNotification=N.TraceFormat=N.TraceValues=N.Trace=void 0;var tt=Dx();Object.defineProperty(N,"Message",{enumerable:!0,get:function(){return tt.Message}});Object.defineProperty(N,"RequestType",{enumerable:!0,get:function(){return tt.RequestType}});Object.defineProperty(N,"RequestType0",{enumerable:!0,get:function(){return tt.RequestType0}});Object.defineProperty(N,"RequestType1",{enumerable:!0,get:function(){return tt.RequestType1}});Object.defineProperty(N,"RequestType2",{enumerable:!0,get:function(){return tt.RequestType2}});Object.defineProperty(N,"RequestType3",{enumerable:!0,get:function(){return tt.RequestType3}});Object.defineProperty(N,"RequestType4",{enumerable:!0,get:function(){return tt.RequestType4}});Object.defineProperty(N,"RequestType5",{enumerable:!0,get:function(){return tt.RequestType5}});Object.defineProperty(N,"RequestType6",{enumerable:!0,get:function(){return tt.RequestType6}});Object.defineProperty(N,"RequestType7",{enumerable:!0,get:function(){return tt.RequestType7}});Object.defineProperty(N,"RequestType8",{enumerable:!0,get:function(){return tt.RequestType8}});Object.defineProperty(N,"RequestType9",{enumerable:!0,get:function(){return tt.RequestType9}});Object.defineProperty(N,"ResponseError",{enumerable:!0,get:function(){return tt.ResponseError}});Object.defineProperty(N,"ErrorCodes",{enumerable:!0,get:function(){return tt.ErrorCodes}});Object.defineProperty(N,"NotificationType",{enumerable:!0,get:function(){return tt.NotificationType}});Object.defineProperty(N,"NotificationType0",{enumerable:!0,get:function(){return tt.NotificationType0}});Object.defineProperty(N,"NotificationType1",{enumerable:!0,get:function(){return tt.NotificationType1}});Object.defineProperty(N,"NotificationType2",{enumerable:!0,get:function(){return tt.NotificationType2}});Object.defineProperty(N,"NotificationType3",{enumerable:!0,get:function(){return tt.NotificationType3}});Object.defineProperty(N,"NotificationType4",{enumerable:!0,get:function(){return tt.NotificationType4}});Object.defineProperty(N,"NotificationType5",{enumerable:!0,get:function(){return tt.NotificationType5}});Object.defineProperty(N,"NotificationType6",{enumerable:!0,get:function(){return tt.NotificationType6}});Object.defineProperty(N,"NotificationType7",{enumerable:!0,get:function(){return tt.NotificationType7}});Object.defineProperty(N,"NotificationType8",{enumerable:!0,get:function(){return tt.NotificationType8}});Object.defineProperty(N,"NotificationType9",{enumerable:!0,get:function(){return tt.NotificationType9}});Object.defineProperty(N,"ParameterStructures",{enumerable:!0,get:function(){return tt.ParameterStructures}});var uT=Mx();Object.defineProperty(N,"LinkedMap",{enumerable:!0,get:function(){return uT.LinkedMap}});Object.defineProperty(N,"LRUCache",{enumerable:!0,get:function(){return uT.LRUCache}});Object.defineProperty(N,"Touch",{enumerable:!0,get:function(){return uT.Touch}});var w2=db();Object.defineProperty(N,"Disposable",{enumerable:!0,get:function(){return w2.Disposable}});var Ib=ga();Object.defineProperty(N,"Event",{enumerable:!0,get:function(){return Ib.Event}});Object.defineProperty(N,"Emitter",{enumerable:!0,get:function(){return Ib.Emitter}});var kb=lp();Object.defineProperty(N,"CancellationTokenSource",{enumerable:!0,get:function(){return kb.CancellationTokenSource}});Object.defineProperty(N,"CancellationToken",{enumerable:!0,get:function(){return kb.CancellationToken}});var Nb=hb();Object.defineProperty(N,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return Nb.SharedArraySenderStrategy}});Object.defineProperty(N,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return Nb.SharedArrayReceiverStrategy}});var fT=gb();Object.defineProperty(N,"MessageReader",{enumerable:!0,get:function(){return fT.MessageReader}});Object.defineProperty(N,"AbstractMessageReader",{enumerable:!0,get:function(){return fT.AbstractMessageReader}});Object.defineProperty(N,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return fT.ReadableStreamMessageReader}});var dT=Eb();Object.defineProperty(N,"MessageWriter",{enumerable:!0,get:function(){return dT.MessageWriter}});Object.defineProperty(N,"AbstractMessageWriter",{enumerable:!0,get:function(){return dT.AbstractMessageWriter}});Object.defineProperty(N,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return dT.WriteableStreamMessageWriter}});var b2=vb();Object.defineProperty(N,"AbstractMessageBuffer",{enumerable:!0,get:function(){return b2.AbstractMessageBuffer}});var $t=Sb();Object.defineProperty(N,"ConnectionStrategy",{enumerable:!0,get:function(){return $t.ConnectionStrategy}});Object.defineProperty(N,"ConnectionOptions",{enumerable:!0,get:function(){return $t.ConnectionOptions}});Object.defineProperty(N,"NullLogger",{enumerable:!0,get:function(){return $t.NullLogger}});Object.defineProperty(N,"createMessageConnection",{enumerable:!0,get:function(){return $t.createMessageConnection}});Object.defineProperty(N,"ProgressToken",{enumerable:!0,get:function(){return $t.ProgressToken}});Object.defineProperty(N,"ProgressType",{enumerable:!0,get:function(){return $t.ProgressType}});Object.defineProperty(N,"Trace",{enumerable:!0,get:function(){return $t.Trace}});Object.defineProperty(N,"TraceValues",{enumerable:!0,get:function(){return $t.TraceValues}});Object.defineProperty(N,"TraceFormat",{enumerable:!0,get:function(){return $t.TraceFormat}});Object.defineProperty(N,"SetTraceNotification",{enumerable:!0,get:function(){return $t.SetTraceNotification}});Object.defineProperty(N,"LogTraceNotification",{enumerable:!0,get:function(){return $t.LogTraceNotification}});Object.defineProperty(N,"ConnectionErrors",{enumerable:!0,get:function(){return $t.ConnectionErrors}});Object.defineProperty(N,"ConnectionError",{enumerable:!0,get:function(){return $t.ConnectionError}});Object.defineProperty(N,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return $t.CancellationReceiverStrategy}});Object.defineProperty(N,"CancellationSenderStrategy",{enumerable:!0,get:function(){return $t.CancellationSenderStrategy}});Object.defineProperty(N,"CancellationStrategy",{enumerable:!0,get:function(){return $t.CancellationStrategy}});Object.defineProperty(N,"MessageStrategy",{enumerable:!0,get:function(){return $t.MessageStrategy}});var A2=ki();N.RAL=A2.default});var Cb=ue(gT=>{"use strict";Object.defineProperty(gT,"__esModule",{value:!0});var yn=_p(),Ep=class t extends yn.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return new TextEncoder().encode(e)}toString(e,r){return r==="ascii"?this.asciiDecoder.decode(e):new TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e:e.slice(0,r)}allocNative(e){return new Uint8Array(e)}};Ep.emptyBuffer=new Uint8Array(0);var pT=class{constructor(e){this.socket=e,this._onData=new yn.Emitter,this._messageListener=r=>{r.data.arrayBuffer().then(i=>{this._onData.fire(new Uint8Array(i))},()=>{(0,yn.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),yn.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),yn.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),yn.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}},hT=class{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),yn.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),yn.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),yn.Disposable.create(()=>this.socket.removeEventListener("end",e))}write(e,r){if(typeof e=="string"){if(r!==void 0&&r!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${r}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}},S2=new TextEncoder,Pb=Object.freeze({messageBuffer:Object.freeze({create:t=>new Ep(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{if(e.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${e.charset}`);return Promise.resolve(S2.encode(JSON.stringify(t,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{if(!(t instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(e.charset).decode(t)))}})}),stream:Object.freeze({asReadableStream:t=>new pT(t),asWritableStream:t=>new hT(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setTimeout(t,0,...e);return{dispose:()=>clearTimeout(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function mT(){return Pb}(function(t){function e(){yn.RAL.install(Pb)}t.install=e})(mT||(mT={}));gT.default=mT});var Bo=ue(gr=>{"use strict";var I2=gr&&gr.__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]})),k2=gr&&gr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&I2(e,t,r)};Object.defineProperty(gr,"__esModule",{value:!0});gr.createMessageConnection=gr.BrowserMessageWriter=gr.BrowserMessageReader=void 0;var N2=Cb();N2.default.install();var Ea=_p();k2(_p(),gr);var yT=class extends Ea.AbstractMessageReader{constructor(e){super(),this._onData=new Ea.Emitter,this._messageListener=r=>{this._onData.fire(r.data)},e.addEventListener("error",r=>this.fireError(r)),e.onmessage=this._messageListener}listen(e){return this._onData.event(e)}};gr.BrowserMessageReader=yT;var xT=class extends Ea.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.addEventListener("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};gr.BrowserMessageWriter=xT;function P2(t,e,r,n){return r===void 0&&(r=Ea.NullLogger),Ea.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,Ea.createMessageConnection)(t,e,r,n)}gr.createMessageConnection=P2});var TT=ue((XZ,Ob)=>{"use strict";Ob.exports=Bo()});var ft=ue(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.ProtocolNotificationType=ir.ProtocolNotificationType0=ir.ProtocolRequestType=ir.ProtocolRequestType0=ir.RegistrationType=ir.MessageDirection=void 0;var va=Bo(),Lb;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(Lb||(ir.MessageDirection=Lb={}));var _T=class{constructor(e){this.method=e}};ir.RegistrationType=_T;var ET=class extends va.RequestType0{constructor(e){super(e)}};ir.ProtocolRequestType0=ET;var vT=class extends va.RequestType{constructor(e){super(e,va.ParameterStructures.byName)}};ir.ProtocolRequestType=vT;var RT=class extends va.NotificationType0{constructor(e){super(e)}};ir.ProtocolNotificationType0=RT;var wT=class extends va.NotificationType{constructor(e){super(e,va.ParameterStructures.byName)}};ir.ProtocolNotificationType=wT});var vp=ue(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.objectLiteral=bt.typedArray=bt.stringArray=bt.array=bt.func=bt.error=bt.number=bt.string=bt.boolean=void 0;function C2(t){return t===!0||t===!1}bt.boolean=C2;function Db(t){return typeof t=="string"||t instanceof String}bt.string=Db;function O2(t){return typeof t=="number"||t instanceof Number}bt.number=O2;function L2(t){return t instanceof Error}bt.error=L2;function D2(t){return typeof t=="function"}bt.func=D2;function $b(t){return Array.isArray(t)}bt.array=$b;function $2(t){return $b(t)&&t.every(e=>Db(e))}bt.stringArray=$2;function M2(t,e){return Array.isArray(t)&&t.every(e)}bt.typedArray=M2;function F2(t){return t!==null&&typeof t=="object"}bt.objectLiteral=F2});var Ub=ue(Rp=>{"use strict";Object.defineProperty(Rp,"__esModule",{value:!0});Rp.ImplementationRequest=void 0;var Mb=ft(),Fb;(function(t){t.method="textDocument/implementation",t.messageDirection=Mb.MessageDirection.clientToServer,t.type=new Mb.ProtocolRequestType(t.method)})(Fb||(Rp.ImplementationRequest=Fb={}))});var Xb=ue(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});wp.TypeDefinitionRequest=void 0;var Bb=ft(),Gb;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=Bb.MessageDirection.clientToServer,t.type=new Bb.ProtocolRequestType(t.method)})(Gb||(wp.TypeDefinitionRequest=Gb={}))});var zb=ue(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.DidChangeWorkspaceFoldersNotification=Ra.WorkspaceFoldersRequest=void 0;var bp=ft(),Hb;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=bp.MessageDirection.serverToClient,t.type=new bp.ProtocolRequestType0(t.method)})(Hb||(Ra.WorkspaceFoldersRequest=Hb={}));var jb;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=bp.MessageDirection.clientToServer,t.type=new bp.ProtocolNotificationType(t.method)})(jb||(Ra.DidChangeWorkspaceFoldersNotification=jb={}))});var Vb=ue(Ap=>{"use strict";Object.defineProperty(Ap,"__esModule",{value:!0});Ap.ConfigurationRequest=void 0;var qb=ft(),Wb;(function(t){t.method="workspace/configuration",t.messageDirection=qb.MessageDirection.serverToClient,t.type=new qb.ProtocolRequestType(t.method)})(Wb||(Ap.ConfigurationRequest=Wb={}))});var Zb=ue(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.ColorPresentationRequest=wa.DocumentColorRequest=void 0;var Sp=ft(),Yb;(function(t){t.method="textDocument/documentColor",t.messageDirection=Sp.MessageDirection.clientToServer,t.type=new Sp.ProtocolRequestType(t.method)})(Yb||(wa.DocumentColorRequest=Yb={}));var Kb;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Sp.MessageDirection.clientToServer,t.type=new Sp.ProtocolRequestType(t.method)})(Kb||(wa.ColorPresentationRequest=Kb={}))});var eA=ue(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.FoldingRangeRefreshRequest=ba.FoldingRangeRequest=void 0;var Ip=ft(),Jb;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Ip.MessageDirection.clientToServer,t.type=new Ip.ProtocolRequestType(t.method)})(Jb||(ba.FoldingRangeRequest=Jb={}));var Qb;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Ip.MessageDirection.serverToClient,t.type=new Ip.ProtocolRequestType0(t.method)})(Qb||(ba.FoldingRangeRefreshRequest=Qb={}))});var nA=ue(kp=>{"use strict";Object.defineProperty(kp,"__esModule",{value:!0});kp.DeclarationRequest=void 0;var tA=ft(),rA;(function(t){t.method="textDocument/declaration",t.messageDirection=tA.MessageDirection.clientToServer,t.type=new tA.ProtocolRequestType(t.method)})(rA||(kp.DeclarationRequest=rA={}))});var sA=ue(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});Np.SelectionRangeRequest=void 0;var iA=ft(),oA;(function(t){t.method="textDocument/selectionRange",t.messageDirection=iA.MessageDirection.clientToServer,t.type=new iA.ProtocolRequestType(t.method)})(oA||(Np.SelectionRangeRequest=oA={}))});var uA=ue(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.WorkDoneProgressCancelNotification=Ci.WorkDoneProgressCreateRequest=Ci.WorkDoneProgress=void 0;var U2=Bo(),Pp=ft(),aA;(function(t){t.type=new U2.ProgressType;function e(r){return r===t.type}t.is=e})(aA||(Ci.WorkDoneProgress=aA={}));var cA;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Pp.MessageDirection.serverToClient,t.type=new Pp.ProtocolRequestType(t.method)})(cA||(Ci.WorkDoneProgressCreateRequest=cA={}));var lA;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Pp.MessageDirection.clientToServer,t.type=new Pp.ProtocolNotificationType(t.method)})(lA||(Ci.WorkDoneProgressCancelNotification=lA={}))});var hA=ue(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.CallHierarchyOutgoingCallsRequest=Oi.CallHierarchyIncomingCallsRequest=Oi.CallHierarchyPrepareRequest=void 0;var Aa=ft(),fA;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Aa.MessageDirection.clientToServer,t.type=new Aa.ProtocolRequestType(t.method)})(fA||(Oi.CallHierarchyPrepareRequest=fA={}));var dA;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Aa.MessageDirection.clientToServer,t.type=new Aa.ProtocolRequestType(t.method)})(dA||(Oi.CallHierarchyIncomingCallsRequest=dA={}));var pA;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Aa.MessageDirection.clientToServer,t.type=new Aa.ProtocolRequestType(t.method)})(pA||(Oi.CallHierarchyOutgoingCallsRequest=pA={}))});var _A=ue(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.SemanticTokensRefreshRequest=or.SemanticTokensRangeRequest=or.SemanticTokensDeltaRequest=or.SemanticTokensRequest=or.SemanticTokensRegistrationType=or.TokenFormat=void 0;var zn=ft(),mA;(function(t){t.Relative="relative"})(mA||(or.TokenFormat=mA={}));var ql;(function(t){t.method="textDocument/semanticTokens",t.type=new zn.RegistrationType(t.method)})(ql||(or.SemanticTokensRegistrationType=ql={}));var gA;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=zn.MessageDirection.clientToServer,t.type=new zn.ProtocolRequestType(t.method),t.registrationMethod=ql.method})(gA||(or.SemanticTokensRequest=gA={}));var yA;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=zn.MessageDirection.clientToServer,t.type=new zn.ProtocolRequestType(t.method),t.registrationMethod=ql.method})(yA||(or.SemanticTokensDeltaRequest=yA={}));var xA;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=zn.MessageDirection.clientToServer,t.type=new zn.ProtocolRequestType(t.method),t.registrationMethod=ql.method})(xA||(or.SemanticTokensRangeRequest=xA={}));var TA;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=zn.MessageDirection.serverToClient,t.type=new zn.ProtocolRequestType0(t.method)})(TA||(or.SemanticTokensRefreshRequest=TA={}))});var RA=ue(Cp=>{"use strict";Object.defineProperty(Cp,"__esModule",{value:!0});Cp.ShowDocumentRequest=void 0;var EA=ft(),vA;(function(t){t.method="window/showDocument",t.messageDirection=EA.MessageDirection.serverToClient,t.type=new EA.ProtocolRequestType(t.method)})(vA||(Cp.ShowDocumentRequest=vA={}))});var AA=ue(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});Op.LinkedEditingRangeRequest=void 0;var wA=ft(),bA;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=wA.MessageDirection.clientToServer,t.type=new wA.ProtocolRequestType(t.method)})(bA||(Op.LinkedEditingRangeRequest=bA={}))});var LA=ue(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.WillDeleteFilesRequest=jt.DidDeleteFilesNotification=jt.DidRenameFilesNotification=jt.WillRenameFilesRequest=jt.DidCreateFilesNotification=jt.WillCreateFilesRequest=jt.FileOperationPatternKind=void 0;var Sr=ft(),SA;(function(t){t.file="file",t.folder="folder"})(SA||(jt.FileOperationPatternKind=SA={}));var IA;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Sr.MessageDirection.clientToServer,t.type=new Sr.ProtocolRequestType(t.method)})(IA||(jt.WillCreateFilesRequest=IA={}));var kA;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Sr.MessageDirection.clientToServer,t.type=new Sr.ProtocolNotificationType(t.method)})(kA||(jt.DidCreateFilesNotification=kA={}));var NA;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Sr.MessageDirection.clientToServer,t.type=new Sr.ProtocolRequestType(t.method)})(NA||(jt.WillRenameFilesRequest=NA={}));var PA;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Sr.MessageDirection.clientToServer,t.type=new Sr.ProtocolNotificationType(t.method)})(PA||(jt.DidRenameFilesNotification=PA={}));var CA;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Sr.MessageDirection.clientToServer,t.type=new Sr.ProtocolNotificationType(t.method)})(CA||(jt.DidDeleteFilesNotification=CA={}));var OA;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Sr.MessageDirection.clientToServer,t.type=new Sr.ProtocolRequestType(t.method)})(OA||(jt.WillDeleteFilesRequest=OA={}))});var UA=ue(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.MonikerRequest=Li.MonikerKind=Li.UniquenessLevel=void 0;var DA=ft(),$A;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})($A||(Li.UniquenessLevel=$A={}));var MA;(function(t){t.$import="import",t.$export="export",t.local="local"})(MA||(Li.MonikerKind=MA={}));var FA;(function(t){t.method="textDocument/moniker",t.messageDirection=DA.MessageDirection.clientToServer,t.type=new DA.ProtocolRequestType(t.method)})(FA||(Li.MonikerRequest=FA={}))});var HA=ue(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.TypeHierarchySubtypesRequest=Di.TypeHierarchySupertypesRequest=Di.TypeHierarchyPrepareRequest=void 0;var Sa=ft(),BA;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Sa.MessageDirection.clientToServer,t.type=new Sa.ProtocolRequestType(t.method)})(BA||(Di.TypeHierarchyPrepareRequest=BA={}));var GA;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Sa.MessageDirection.clientToServer,t.type=new Sa.ProtocolRequestType(t.method)})(GA||(Di.TypeHierarchySupertypesRequest=GA={}));var XA;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Sa.MessageDirection.clientToServer,t.type=new Sa.ProtocolRequestType(t.method)})(XA||(Di.TypeHierarchySubtypesRequest=XA={}))});var qA=ue(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.InlineValueRefreshRequest=Ia.InlineValueRequest=void 0;var Lp=ft(),jA;(function(t){t.method="textDocument/inlineValue",t.messageDirection=Lp.MessageDirection.clientToServer,t.type=new Lp.ProtocolRequestType(t.method)})(jA||(Ia.InlineValueRequest=jA={}));var zA;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=Lp.MessageDirection.serverToClient,t.type=new Lp.ProtocolRequestType0(t.method)})(zA||(Ia.InlineValueRefreshRequest=zA={}))});var KA=ue($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.InlayHintRefreshRequest=$i.InlayHintResolveRequest=$i.InlayHintRequest=void 0;var ka=ft(),WA;(function(t){t.method="textDocument/inlayHint",t.messageDirection=ka.MessageDirection.clientToServer,t.type=new ka.ProtocolRequestType(t.method)})(WA||($i.InlayHintRequest=WA={}));var VA;(function(t){t.method="inlayHint/resolve",t.messageDirection=ka.MessageDirection.clientToServer,t.type=new ka.ProtocolRequestType(t.method)})(VA||($i.InlayHintResolveRequest=VA={}));var YA;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=ka.MessageDirection.serverToClient,t.type=new ka.ProtocolRequestType0(t.method)})(YA||($i.InlayHintRefreshRequest=YA={}))});var nS=ue(Ir=>{"use strict";Object.defineProperty(Ir,"__esModule",{value:!0});Ir.DiagnosticRefreshRequest=Ir.WorkspaceDiagnosticRequest=Ir.DocumentDiagnosticRequest=Ir.DocumentDiagnosticReportKind=Ir.DiagnosticServerCancellationData=void 0;var rS=Bo(),B2=vp(),Na=ft(),ZA;(function(t){function e(r){let n=r;return n&&B2.boolean(n.retriggerRequest)}t.is=e})(ZA||(Ir.DiagnosticServerCancellationData=ZA={}));var JA;(function(t){t.Full="full",t.Unchanged="unchanged"})(JA||(Ir.DocumentDiagnosticReportKind=JA={}));var QA;(function(t){t.method="textDocument/diagnostic",t.messageDirection=Na.MessageDirection.clientToServer,t.type=new Na.ProtocolRequestType(t.method),t.partialResult=new rS.ProgressType})(QA||(Ir.DocumentDiagnosticRequest=QA={}));var eS;(function(t){t.method="workspace/diagnostic",t.messageDirection=Na.MessageDirection.clientToServer,t.type=new Na.ProtocolRequestType(t.method),t.partialResult=new rS.ProgressType})(eS||(Ir.WorkspaceDiagnosticRequest=eS={}));var tS;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=Na.MessageDirection.serverToClient,t.type=new Na.ProtocolRequestType0(t.method)})(tS||(Ir.DiagnosticRefreshRequest=tS={}))});var uS=ue(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});_t.DidCloseNotebookDocumentNotification=_t.DidSaveNotebookDocumentNotification=_t.DidChangeNotebookDocumentNotification=_t.NotebookCellArrayChange=_t.DidOpenNotebookDocumentNotification=_t.NotebookDocumentSyncRegistrationType=_t.NotebookDocument=_t.NotebookCell=_t.ExecutionSummary=_t.NotebookCellKind=void 0;var Wl=(na(),tf(jd)),zr=vp(),xn=ft(),bT;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(bT||(_t.NotebookCellKind=bT={}));var AT;(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 zr.objectLiteral(o)&&Wl.uinteger.is(o.executionOrder)&&(o.success===void 0||zr.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})(AT||(_t.ExecutionSummary=AT={}));var Dp;(function(t){function e(o,s){return{kind:o,document:s}}t.create=e;function r(o){let s=o;return zr.objectLiteral(s)&&bT.is(s.kind)&&Wl.DocumentUri.is(s.document)&&(s.metadata===void 0||zr.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)&&!AT.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),c=Array.isArray(s);if(a!==c)return!1;if(a&&c){if(o.length!==s.length)return!1;for(let l=0;l<o.length;l++)if(!i(o[l],s[l]))return!1}if(zr.objectLiteral(o)&&zr.objectLiteral(s)){let l=Object.keys(o),u=Object.keys(s);if(l.length!==u.length||(l.sort(),u.sort(),!i(l,u)))return!1;for(let f=0;f<l.length;f++){let d=l[f];if(!i(o[d],s[d]))return!1}}return!0}})(Dp||(_t.NotebookCell=Dp={}));var iS;(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 zr.objectLiteral(i)&&zr.string(i.uri)&&Wl.integer.is(i.version)&&zr.typedArray(i.cells,Dp.is)}t.is=r})(iS||(_t.NotebookDocument=iS={}));var Pa;(function(t){t.method="notebookDocument/sync",t.messageDirection=xn.MessageDirection.clientToServer,t.type=new xn.RegistrationType(t.method)})(Pa||(_t.NotebookDocumentSyncRegistrationType=Pa={}));var oS;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=xn.MessageDirection.clientToServer,t.type=new xn.ProtocolNotificationType(t.method),t.registrationMethod=Pa.method})(oS||(_t.DidOpenNotebookDocumentNotification=oS={}));var sS;(function(t){function e(n){let i=n;return zr.objectLiteral(i)&&Wl.uinteger.is(i.start)&&Wl.uinteger.is(i.deleteCount)&&(i.cells===void 0||zr.typedArray(i.cells,Dp.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})(sS||(_t.NotebookCellArrayChange=sS={}));var aS;(function(t){t.method="notebookDocument/didChange",t.messageDirection=xn.MessageDirection.clientToServer,t.type=new xn.ProtocolNotificationType(t.method),t.registrationMethod=Pa.method})(aS||(_t.DidChangeNotebookDocumentNotification=aS={}));var cS;(function(t){t.method="notebookDocument/didSave",t.messageDirection=xn.MessageDirection.clientToServer,t.type=new xn.ProtocolNotificationType(t.method),t.registrationMethod=Pa.method})(cS||(_t.DidSaveNotebookDocumentNotification=cS={}));var lS;(function(t){t.method="notebookDocument/didClose",t.messageDirection=xn.MessageDirection.clientToServer,t.type=new xn.ProtocolNotificationType(t.method),t.registrationMethod=Pa.method})(lS||(_t.DidCloseNotebookDocumentNotification=lS={}))});var pS=ue($p=>{"use strict";Object.defineProperty($p,"__esModule",{value:!0});$p.InlineCompletionRequest=void 0;var fS=ft(),dS;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=fS.MessageDirection.clientToServer,t.type=new fS.ProtocolRequestType(t.method)})(dS||($p.InlineCompletionRequest=dS={}))});var AI=ue(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.WorkspaceSymbolRequest=y.CodeActionResolveRequest=y.CodeActionRequest=y.DocumentSymbolRequest=y.DocumentHighlightRequest=y.ReferencesRequest=y.DefinitionRequest=y.SignatureHelpRequest=y.SignatureHelpTriggerKind=y.HoverRequest=y.CompletionResolveRequest=y.CompletionRequest=y.CompletionTriggerKind=y.PublishDiagnosticsNotification=y.WatchKind=y.RelativePattern=y.FileChangeType=y.DidChangeWatchedFilesNotification=y.WillSaveTextDocumentWaitUntilRequest=y.WillSaveTextDocumentNotification=y.TextDocumentSaveReason=y.DidSaveTextDocumentNotification=y.DidCloseTextDocumentNotification=y.DidChangeTextDocumentNotification=y.TextDocumentContentChangeEvent=y.DidOpenTextDocumentNotification=y.TextDocumentSyncKind=y.TelemetryEventNotification=y.LogMessageNotification=y.ShowMessageRequest=y.ShowMessageNotification=y.MessageType=y.DidChangeConfigurationNotification=y.ExitNotification=y.ShutdownRequest=y.InitializedNotification=y.InitializeErrorCodes=y.InitializeRequest=y.WorkDoneProgressOptions=y.TextDocumentRegistrationOptions=y.StaticRegistrationOptions=y.PositionEncodingKind=y.FailureHandlingKind=y.ResourceOperationKind=y.UnregistrationRequest=y.RegistrationRequest=y.DocumentSelector=y.NotebookCellTextDocumentFilter=y.NotebookDocumentFilter=y.TextDocumentFilter=void 0;y.MonikerRequest=y.MonikerKind=y.UniquenessLevel=y.WillDeleteFilesRequest=y.DidDeleteFilesNotification=y.WillRenameFilesRequest=y.DidRenameFilesNotification=y.WillCreateFilesRequest=y.DidCreateFilesNotification=y.FileOperationPatternKind=y.LinkedEditingRangeRequest=y.ShowDocumentRequest=y.SemanticTokensRegistrationType=y.SemanticTokensRefreshRequest=y.SemanticTokensRangeRequest=y.SemanticTokensDeltaRequest=y.SemanticTokensRequest=y.TokenFormat=y.CallHierarchyPrepareRequest=y.CallHierarchyOutgoingCallsRequest=y.CallHierarchyIncomingCallsRequest=y.WorkDoneProgressCancelNotification=y.WorkDoneProgressCreateRequest=y.WorkDoneProgress=y.SelectionRangeRequest=y.DeclarationRequest=y.FoldingRangeRefreshRequest=y.FoldingRangeRequest=y.ColorPresentationRequest=y.DocumentColorRequest=y.ConfigurationRequest=y.DidChangeWorkspaceFoldersNotification=y.WorkspaceFoldersRequest=y.TypeDefinitionRequest=y.ImplementationRequest=y.ApplyWorkspaceEditRequest=y.ExecuteCommandRequest=y.PrepareRenameRequest=y.RenameRequest=y.PrepareSupportDefaultBehavior=y.DocumentOnTypeFormattingRequest=y.DocumentRangesFormattingRequest=y.DocumentRangeFormattingRequest=y.DocumentFormattingRequest=y.DocumentLinkResolveRequest=y.DocumentLinkRequest=y.CodeLensRefreshRequest=y.CodeLensResolveRequest=y.CodeLensRequest=y.WorkspaceSymbolResolveRequest=void 0;y.InlineCompletionRequest=y.DidCloseNotebookDocumentNotification=y.DidSaveNotebookDocumentNotification=y.DidChangeNotebookDocumentNotification=y.NotebookCellArrayChange=y.DidOpenNotebookDocumentNotification=y.NotebookDocumentSyncRegistrationType=y.NotebookDocument=y.NotebookCell=y.ExecutionSummary=y.NotebookCellKind=y.DiagnosticRefreshRequest=y.WorkspaceDiagnosticRequest=y.DocumentDiagnosticRequest=y.DocumentDiagnosticReportKind=y.DiagnosticServerCancellationData=y.InlayHintRefreshRequest=y.InlayHintResolveRequest=y.InlayHintRequest=y.InlineValueRefreshRequest=y.InlineValueRequest=y.TypeHierarchySupertypesRequest=y.TypeHierarchySubtypesRequest=y.TypeHierarchyPrepareRequest=void 0;var G=ft(),hS=(na(),tf(jd)),Ct=vp(),G2=Ub();Object.defineProperty(y,"ImplementationRequest",{enumerable:!0,get:function(){return G2.ImplementationRequest}});var X2=Xb();Object.defineProperty(y,"TypeDefinitionRequest",{enumerable:!0,get:function(){return X2.TypeDefinitionRequest}});var vI=zb();Object.defineProperty(y,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return vI.WorkspaceFoldersRequest}});Object.defineProperty(y,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return vI.DidChangeWorkspaceFoldersNotification}});var H2=Vb();Object.defineProperty(y,"ConfigurationRequest",{enumerable:!0,get:function(){return H2.ConfigurationRequest}});var RI=Zb();Object.defineProperty(y,"DocumentColorRequest",{enumerable:!0,get:function(){return RI.DocumentColorRequest}});Object.defineProperty(y,"ColorPresentationRequest",{enumerable:!0,get:function(){return RI.ColorPresentationRequest}});var wI=eA();Object.defineProperty(y,"FoldingRangeRequest",{enumerable:!0,get:function(){return wI.FoldingRangeRequest}});Object.defineProperty(y,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return wI.FoldingRangeRefreshRequest}});var j2=nA();Object.defineProperty(y,"DeclarationRequest",{enumerable:!0,get:function(){return j2.DeclarationRequest}});var z2=sA();Object.defineProperty(y,"SelectionRangeRequest",{enumerable:!0,get:function(){return z2.SelectionRangeRequest}});var PT=uA();Object.defineProperty(y,"WorkDoneProgress",{enumerable:!0,get:function(){return PT.WorkDoneProgress}});Object.defineProperty(y,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return PT.WorkDoneProgressCreateRequest}});Object.defineProperty(y,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return PT.WorkDoneProgressCancelNotification}});var CT=hA();Object.defineProperty(y,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return CT.CallHierarchyIncomingCallsRequest}});Object.defineProperty(y,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return CT.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(y,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return CT.CallHierarchyPrepareRequest}});var Ca=_A();Object.defineProperty(y,"TokenFormat",{enumerable:!0,get:function(){return Ca.TokenFormat}});Object.defineProperty(y,"SemanticTokensRequest",{enumerable:!0,get:function(){return Ca.SemanticTokensRequest}});Object.defineProperty(y,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Ca.SemanticTokensDeltaRequest}});Object.defineProperty(y,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Ca.SemanticTokensRangeRequest}});Object.defineProperty(y,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Ca.SemanticTokensRefreshRequest}});Object.defineProperty(y,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Ca.SemanticTokensRegistrationType}});var q2=RA();Object.defineProperty(y,"ShowDocumentRequest",{enumerable:!0,get:function(){return q2.ShowDocumentRequest}});var W2=AA();Object.defineProperty(y,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return W2.LinkedEditingRangeRequest}});var Go=LA();Object.defineProperty(y,"FileOperationPatternKind",{enumerable:!0,get:function(){return Go.FileOperationPatternKind}});Object.defineProperty(y,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Go.DidCreateFilesNotification}});Object.defineProperty(y,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Go.WillCreateFilesRequest}});Object.defineProperty(y,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Go.DidRenameFilesNotification}});Object.defineProperty(y,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Go.WillRenameFilesRequest}});Object.defineProperty(y,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Go.DidDeleteFilesNotification}});Object.defineProperty(y,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Go.WillDeleteFilesRequest}});var OT=UA();Object.defineProperty(y,"UniquenessLevel",{enumerable:!0,get:function(){return OT.UniquenessLevel}});Object.defineProperty(y,"MonikerKind",{enumerable:!0,get:function(){return OT.MonikerKind}});Object.defineProperty(y,"MonikerRequest",{enumerable:!0,get:function(){return OT.MonikerRequest}});var LT=HA();Object.defineProperty(y,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return LT.TypeHierarchyPrepareRequest}});Object.defineProperty(y,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return LT.TypeHierarchySubtypesRequest}});Object.defineProperty(y,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return LT.TypeHierarchySupertypesRequest}});var bI=qA();Object.defineProperty(y,"InlineValueRequest",{enumerable:!0,get:function(){return bI.InlineValueRequest}});Object.defineProperty(y,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return bI.InlineValueRefreshRequest}});var DT=KA();Object.defineProperty(y,"InlayHintRequest",{enumerable:!0,get:function(){return DT.InlayHintRequest}});Object.defineProperty(y,"InlayHintResolveRequest",{enumerable:!0,get:function(){return DT.InlayHintResolveRequest}});Object.defineProperty(y,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return DT.InlayHintRefreshRequest}});var Vl=nS();Object.defineProperty(y,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Vl.DiagnosticServerCancellationData}});Object.defineProperty(y,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Vl.DocumentDiagnosticReportKind}});Object.defineProperty(y,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Vl.DocumentDiagnosticRequest}});Object.defineProperty(y,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Vl.WorkspaceDiagnosticRequest}});Object.defineProperty(y,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Vl.DiagnosticRefreshRequest}});var Tn=uS();Object.defineProperty(y,"NotebookCellKind",{enumerable:!0,get:function(){return Tn.NotebookCellKind}});Object.defineProperty(y,"ExecutionSummary",{enumerable:!0,get:function(){return Tn.ExecutionSummary}});Object.defineProperty(y,"NotebookCell",{enumerable:!0,get:function(){return Tn.NotebookCell}});Object.defineProperty(y,"NotebookDocument",{enumerable:!0,get:function(){return Tn.NotebookDocument}});Object.defineProperty(y,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Tn.NotebookDocumentSyncRegistrationType}});Object.defineProperty(y,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Tn.DidOpenNotebookDocumentNotification}});Object.defineProperty(y,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Tn.NotebookCellArrayChange}});Object.defineProperty(y,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Tn.DidChangeNotebookDocumentNotification}});Object.defineProperty(y,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Tn.DidSaveNotebookDocumentNotification}});Object.defineProperty(y,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Tn.DidCloseNotebookDocumentNotification}});var V2=pS();Object.defineProperty(y,"InlineCompletionRequest",{enumerable:!0,get:function(){return V2.InlineCompletionRequest}});var ST;(function(t){function e(r){let n=r;return Ct.string(n)||Ct.string(n.language)||Ct.string(n.scheme)||Ct.string(n.pattern)}t.is=e})(ST||(y.TextDocumentFilter=ST={}));var IT;(function(t){function e(r){let n=r;return Ct.objectLiteral(n)&&(Ct.string(n.notebookType)||Ct.string(n.scheme)||Ct.string(n.pattern))}t.is=e})(IT||(y.NotebookDocumentFilter=IT={}));var kT;(function(t){function e(r){let n=r;return Ct.objectLiteral(n)&&(Ct.string(n.notebook)||IT.is(n.notebook))&&(n.language===void 0||Ct.string(n.language))}t.is=e})(kT||(y.NotebookCellTextDocumentFilter=kT={}));var NT;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!Ct.string(n)&&!ST.is(n)&&!kT.is(n))return!1;return!0}t.is=e})(NT||(y.DocumentSelector=NT={}));var mS;(function(t){t.method="client/registerCapability",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolRequestType(t.method)})(mS||(y.RegistrationRequest=mS={}));var gS;(function(t){t.method="client/unregisterCapability",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolRequestType(t.method)})(gS||(y.UnregistrationRequest=gS={}));var yS;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(yS||(y.ResourceOperationKind=yS={}));var xS;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(xS||(y.FailureHandlingKind=xS={}));var TS;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(TS||(y.PositionEncodingKind=TS={}));var _S;(function(t){function e(r){let n=r;return n&&Ct.string(n.id)&&n.id.length>0}t.hasId=e})(_S||(y.StaticRegistrationOptions=_S={}));var ES;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||NT.is(n.documentSelector))}t.is=e})(ES||(y.TextDocumentRegistrationOptions=ES={}));var vS;(function(t){function e(n){let i=n;return Ct.objectLiteral(i)&&(i.workDoneProgress===void 0||Ct.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&Ct.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})(vS||(y.WorkDoneProgressOptions=vS={}));var RS;(function(t){t.method="initialize",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(RS||(y.InitializeRequest=RS={}));var wS;(function(t){t.unknownProtocolVersion=1})(wS||(y.InitializeErrorCodes=wS={}));var bS;(function(t){t.method="initialized",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(bS||(y.InitializedNotification=bS={}));var AS;(function(t){t.method="shutdown",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType0(t.method)})(AS||(y.ShutdownRequest=AS={}));var SS;(function(t){t.method="exit",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType0(t.method)})(SS||(y.ExitNotification=SS={}));var IS;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(IS||(y.DidChangeConfigurationNotification=IS={}));var kS;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(kS||(y.MessageType=kS={}));var NS;(function(t){t.method="window/showMessage",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolNotificationType(t.method)})(NS||(y.ShowMessageNotification=NS={}));var PS;(function(t){t.method="window/showMessageRequest",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolRequestType(t.method)})(PS||(y.ShowMessageRequest=PS={}));var CS;(function(t){t.method="window/logMessage",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolNotificationType(t.method)})(CS||(y.LogMessageNotification=CS={}));var OS;(function(t){t.method="telemetry/event",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolNotificationType(t.method)})(OS||(y.TelemetryEventNotification=OS={}));var LS;(function(t){t.None=0,t.Full=1,t.Incremental=2})(LS||(y.TextDocumentSyncKind=LS={}));var DS;(function(t){t.method="textDocument/didOpen",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(DS||(y.DidOpenTextDocumentNotification=DS={}));var $S;(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})($S||(y.TextDocumentContentChangeEvent=$S={}));var MS;(function(t){t.method="textDocument/didChange",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(MS||(y.DidChangeTextDocumentNotification=MS={}));var FS;(function(t){t.method="textDocument/didClose",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(FS||(y.DidCloseTextDocumentNotification=FS={}));var US;(function(t){t.method="textDocument/didSave",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(US||(y.DidSaveTextDocumentNotification=US={}));var BS;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(BS||(y.TextDocumentSaveReason=BS={}));var GS;(function(t){t.method="textDocument/willSave",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(GS||(y.WillSaveTextDocumentNotification=GS={}));var XS;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(XS||(y.WillSaveTextDocumentWaitUntilRequest=XS={}));var HS;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolNotificationType(t.method)})(HS||(y.DidChangeWatchedFilesNotification=HS={}));var jS;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(jS||(y.FileChangeType=jS={}));var zS;(function(t){function e(r){let n=r;return Ct.objectLiteral(n)&&(hS.URI.is(n.baseUri)||hS.WorkspaceFolder.is(n.baseUri))&&Ct.string(n.pattern)}t.is=e})(zS||(y.RelativePattern=zS={}));var qS;(function(t){t.Create=1,t.Change=2,t.Delete=4})(qS||(y.WatchKind=qS={}));var WS;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolNotificationType(t.method)})(WS||(y.PublishDiagnosticsNotification=WS={}));var VS;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(VS||(y.CompletionTriggerKind=VS={}));var YS;(function(t){t.method="textDocument/completion",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(YS||(y.CompletionRequest=YS={}));var KS;(function(t){t.method="completionItem/resolve",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(KS||(y.CompletionResolveRequest=KS={}));var ZS;(function(t){t.method="textDocument/hover",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(ZS||(y.HoverRequest=ZS={}));var JS;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(JS||(y.SignatureHelpTriggerKind=JS={}));var QS;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(QS||(y.SignatureHelpRequest=QS={}));var eI;(function(t){t.method="textDocument/definition",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(eI||(y.DefinitionRequest=eI={}));var tI;(function(t){t.method="textDocument/references",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(tI||(y.ReferencesRequest=tI={}));var rI;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(rI||(y.DocumentHighlightRequest=rI={}));var nI;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(nI||(y.DocumentSymbolRequest=nI={}));var iI;(function(t){t.method="textDocument/codeAction",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(iI||(y.CodeActionRequest=iI={}));var oI;(function(t){t.method="codeAction/resolve",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(oI||(y.CodeActionResolveRequest=oI={}));var sI;(function(t){t.method="workspace/symbol",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(sI||(y.WorkspaceSymbolRequest=sI={}));var aI;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(aI||(y.WorkspaceSymbolResolveRequest=aI={}));var cI;(function(t){t.method="textDocument/codeLens",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(cI||(y.CodeLensRequest=cI={}));var lI;(function(t){t.method="codeLens/resolve",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(lI||(y.CodeLensResolveRequest=lI={}));var uI;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolRequestType0(t.method)})(uI||(y.CodeLensRefreshRequest=uI={}));var fI;(function(t){t.method="textDocument/documentLink",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(fI||(y.DocumentLinkRequest=fI={}));var dI;(function(t){t.method="documentLink/resolve",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(dI||(y.DocumentLinkResolveRequest=dI={}));var pI;(function(t){t.method="textDocument/formatting",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(pI||(y.DocumentFormattingRequest=pI={}));var hI;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(hI||(y.DocumentRangeFormattingRequest=hI={}));var mI;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(mI||(y.DocumentRangesFormattingRequest=mI={}));var gI;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(gI||(y.DocumentOnTypeFormattingRequest=gI={}));var yI;(function(t){t.Identifier=1})(yI||(y.PrepareSupportDefaultBehavior=yI={}));var xI;(function(t){t.method="textDocument/rename",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(xI||(y.RenameRequest=xI={}));var TI;(function(t){t.method="textDocument/prepareRename",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(TI||(y.PrepareRenameRequest=TI={}));var _I;(function(t){t.method="workspace/executeCommand",t.messageDirection=G.MessageDirection.clientToServer,t.type=new G.ProtocolRequestType(t.method)})(_I||(y.ExecuteCommandRequest=_I={}));var EI;(function(t){t.method="workspace/applyEdit",t.messageDirection=G.MessageDirection.serverToClient,t.type=new G.ProtocolRequestType("workspace/applyEdit")})(EI||(y.ApplyWorkspaceEditRequest=EI={}))});var II=ue(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});Mp.createProtocolConnection=void 0;var SI=Bo();function Y2(t,e,r,n){return SI.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,SI.createMessageConnection)(t,e,r,n)}Mp.createProtocolConnection=Y2});var NI=ue(sr=>{"use strict";var K2=sr&&sr.__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]})),Fp=sr&&sr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&K2(e,t,r)};Object.defineProperty(sr,"__esModule",{value:!0});sr.LSPErrorCodes=sr.createProtocolConnection=void 0;Fp(Bo(),sr);Fp((na(),tf(jd)),sr);Fp(ft(),sr);Fp(AI(),sr);var Z2=II();Object.defineProperty(sr,"createProtocolConnection",{enumerable:!0,get:function(){return Z2.createProtocolConnection}});var kI;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(kI||(sr.LSPErrorCodes=kI={}))});var CI=ue(_n=>{"use strict";var J2=_n&&_n.__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]})),PI=_n&&_n.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&J2(e,t,r)};Object.defineProperty(_n,"__esModule",{value:!0});_n.createProtocolConnection=void 0;var Q2=TT();PI(TT(),_n);PI(NI(),_n);function eU(t,e,r,n){return(0,Q2.createMessageConnection)(t,e,r,n)}_n.createProtocolConnection=eU});var sk={};on(sk,{nodeReadFile:()=>vU});async function vU(){throw new Error("nowline: filesystem readers are unavailable in the browser embed")}var ak=BE(()=>{});var FX={};on(FX,{EmbedRenderError:()=>Yu,__resetForTests:()=>MX,init:()=>ME,initialize:()=>OX,parse:()=>DX,render:()=>LX,run:()=>$X,sha:()=>PX,version:()=>NX});var GE="0.4.2",XE="1625fac";var wC=/did you mean ['"]?([^'"?]+)['"]?\??/i;function HE(t,e){return{severity:t.severity===2?"warning":"error",code:bC(t),message:t.message,suggestion:SC(t.message),file:e,line:(t.range?.start.line??0)+1,column:(t.range?.start.character??0)+1}}function jE(t,e){return{severity:"error",code:"parse-error",message:t.message,file:e,line:t.token?.startLine??1,column:t.token?.startColumn??1}}function zE(t,e){return{severity:"error",code:"lex-error",message:t.message,file:e,line:t.line??1,column:t.column??1}}function qE(t){return{severity:t.severity,code:"include",message:t.message,file:t.sourcePath,line:t.line!==void 0?t.line+1:1,column:1}}function WE(t,e,r="warning"){return{severity:r,code:"render.warning",message:t,file:e,line:1,column:1}}function bC(t){return typeof t.code=="string"&&t.code!==""?t.code:typeof t.code=="number"?String(t.code):AC(t.message)}function AC(t){let e=t.toLowerCase();return e.includes("duplicate identifier")?"duplicate-identifier":e.includes("unknown reference")||e.includes("did you mean")?"unknown-reference":e.includes("circular")?"circular-dependency":e.includes("requires")&&e.includes("date:")?"missing-date":e.includes("duration")?"duration":e.includes("include")?"include":e.includes("indent")?"indentation":"validation"}function SC(t){let e=t.match(wC);return e?e[1].trim():void 0}var VE="__nowline_browser_noop_include__";async function YE(t){throw new Error(`${VE}: include "${t}" was skipped \u2014 running in single-file mode.`)}function KE(t){return t.includes(VE)}var ut={};on(ut,{AbstractAstReflection:()=>Ji,AbstractCstNode:()=>xl,AbstractLangiumParser:()=>Tl,AbstractParserErrorMessageProvider:()=>qd,AbstractThreadedAsyncParser:()=>HT,AstUtils:()=>of,BiMap:()=>$o,Cancellation:()=>oe,CompositeCstNodeImpl:()=>Po,ContextCache:()=>Mo,CstNodeBuilder:()=>yl,CstUtils:()=>bf,DEFAULT_TOKENIZE_OPTIONS:()=>Up,DONE_RESULT:()=>Ft,DatatypeSymbol:()=>zd,DefaultAstNodeDescriptionProvider:()=>$l,DefaultAstNodeLocator:()=>Fl,DefaultAsyncParser:()=>nu,DefaultCommentProvider:()=>ru,DefaultConfigurationProvider:()=>Ul,DefaultDocumentBuilder:()=>Yl,DefaultDocumentValidator:()=>Dl,DefaultHydrator:()=>ou,DefaultIndexManager:()=>Kl,DefaultJsonSerializer:()=>Cl,DefaultLangiumDocumentFactory:()=>Rl,DefaultLangiumDocuments:()=>wl,DefaultLangiumProfiler:()=>WT,DefaultLexer:()=>Xo,DefaultLexerErrorMessageProvider:()=>Jl,DefaultLinker:()=>bl,DefaultNameProvider:()=>Al,DefaultReferenceDescriptionProvider:()=>Ml,DefaultReferences:()=>Sl,DefaultScopeComputation:()=>Il,DefaultScopeProvider:()=>Pl,DefaultServiceRegistry:()=>Ol,DefaultTokenBuilder:()=>Oo,DefaultValueConverter:()=>Lo,DefaultWorkspaceLock:()=>iu,DefaultWorkspaceManager:()=>Zl,Deferred:()=>Qt,Disposable:()=>Mi,DisposableCache:()=>da,DocumentCache:()=>tp,DocumentState:()=>ye,DocumentValidator:()=>Ar,EMPTY_SCOPE:()=>o2,EMPTY_STREAM:()=>ri,EmptyFileSystem:()=>uu,EmptyFileSystemProvider:()=>Hp,ErrorWithLocation:()=>ho,GrammarAST:()=>Oc,GrammarUtils:()=>vs,IndentationAwareLexer:()=>lu,IndentationAwareTokenBuilder:()=>La,JSDocDocumentationProvider:()=>tu,LangiumCompletionParser:()=>El,LangiumParser:()=>_l,LangiumParserErrorMessageProvider:()=>oa,LeafCstNodeImpl:()=>No,LexingMode:()=>jo,MapScope:()=>lx,Module:()=>zT,MultiMap:()=>Gt,MultiMapScope:()=>kl,OperationCancelled:()=>br,ParserWorker:()=>jT,ProfilingTask:()=>zp,Reduction:()=>as,RefResolving:()=>Do,RegExpUtils:()=>If,RootCstNodeImpl:()=>ia,SimpleCache:()=>Nl,StreamImpl:()=>fr,StreamScope:()=>fa,TextDocument:()=>ca,TreeStreamImpl:()=>sn,URI:()=>gt,UriTrie:()=>ua,UriUtils:()=>vt,VALIDATE_EACH_NODE:()=>ib,ValidationCategory:()=>rp,ValidationRegistry:()=>Ll,ValueConverter:()=>mn,WorkspaceCache:()=>pa,assertCondition:()=>n0,assertUnreachable:()=>ln,createCompletionParser:()=>Zy,createDefaultCoreModule:()=>su,createDefaultSharedCoreModule:()=>au,createGrammarConfig:()=>ng,createLangiumParser:()=>Jy,createParser:()=>vl,delayNextTick:()=>ax,diagnosticData:()=>Fo,eagerLoad:()=>XI,getDiagnosticRange:()=>ob,indentationBuilderDefaultOptions:()=>qT,inject:()=>Ho,interruptAndCheck:()=>mt,isAstNode:()=>ht,isAstNodeDescription:()=>pm,isAstNodeWithComment:()=>ux,isCompositeCstNode:()=>Dr,isIMultiModeLexerDefinition:()=>MT,isJSDoc:()=>GT,isLeafCstNode:()=>ti,isLinkingError:()=>Qi,isMultiReference:()=>ur,isNamed:()=>rb,isOperationCancelled:()=>gn,isReference:()=>At,isRootCstNode:()=>Ec,isTokenTypeArray:()=>Bp,isTokenTypeDictionary:()=>$T,loadGrammarFromJson:()=>jp,parseJSDoc:()=>BT,prepareLangiumParser:()=>jw,setInterruptionPeriod:()=>Zw,startCancelableOperation:()=>Qd,stream:()=>Te,toDiagnosticData:()=>sb,toDiagnosticSeverity:()=>np});var bf={};on(bf,{DefaultNameRegexp:()=>wf,RangeComparison:()=>cn,compareRange:()=>QE,findCommentNode:()=>Fm,findDeclarationNodeAtOffset:()=>KC,findLeafNodeAtOffset:()=>Um,findLeafNodeBeforeOffset:()=>e0,flattenCst:()=>YC,getDatatypeNode:()=>VC,getInteriorNodes:()=>QC,getNextNode:()=>ZC,getPreviousNode:()=>r0,getStartlineNode:()=>JC,inRange:()=>ym,isChildNode:()=>Mm,isCommentNode:()=>$m,streamCst:()=>fo,toDocumentSegment:()=>po,tokenToRange:()=>xs});function ht(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function At(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}function ur(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}function pm(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function Qi(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}var Ji=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){let r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);let n=r.properties[e.property]?.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){let r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return ht(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.types[e],s=o?o.superTypes.some(a=>this.isSubtype(a,r)):!1;return n[r]=s,s}}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 Dr(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function ti(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function Ec(t){return Dr(t)&&typeof t.fullText=="string"}var fr=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){return new t(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return Ft})}join(e=","){let r=this.iterator(),n="",i,o=!1;do i=r.next(),i.done||(o&&(n+=e),n+=kC(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?Ft:{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 Ft})}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(rf(o))r.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}}while(r.iterator);return Ft})}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(rf(o))n.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}while(n.iterator);return Ft})}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?Ft:this.nextFn(r.state)))}distinct(e){return new t(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){let i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return Ft})}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 kC(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function rf(t){return!!t&&typeof t[Symbol.iterator]=="function"}var ri=new fr(()=>{},()=>Ft),Ft=Object.freeze({done:!0,value:void 0});function Te(...t){if(t.length===1){let e=t[0];if(e instanceof fr)return e;if(rf(e))return new fr(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new fr(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:Ft)}return t.length>1?new fr(()=>({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++];rf(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return Ft}):ri}var sn=class extends fr{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 Ft})}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}},as;(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})(as||(as={}));var of={};on(of,{assignMandatoryProperties:()=>gm,copyAstNode:()=>mm,findRootNode:()=>ls,getContainerOfType:()=>In,getDocument:()=>Ut,getReferenceNodes:()=>nf,hasContainerOfType:()=>NC,linkContentToContainer:()=>cs,streamAllContents:()=>$r,streamAst:()=>qt,streamContents:()=>vc,streamReferences:()=>ni});function cs(t,e={}){for(let[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,o)=>{ht(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=o,e.deep&&cs(i,e))}):ht(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&cs(n,e)))}function In(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function NC(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}function Ut(t){let r=ls(t).$document;if(!r)throw new Error("AST node has no document.");return r}function ls(t){for(;t.$container;)t=t.$container;return t}function nf(t){return At(t)?t.ref?[t.ref]:[]:ur(t)?t.items.map(e=>e.ref):[]}function vc(t,e){if(!t)throw new Error("Node must be an AstNode.");let r=e?.range;return new fr(()=>({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(ht(o)){if(n.keyIndex++,hm(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(ht(a)&&hm(a,r))return{done:!1,value:a}}n.arrayIndex=0}}n.keyIndex++}return Ft})}function $r(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new sn(t,r=>vc(r,e))}function qt(t,e){if(t){if(e?.range&&!hm(t,e.range))return new sn(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new sn(t,r=>vc(r,e),{includeRoot:!0})}function hm(t,e){if(!e)return!0;let r=t.$cstNode?.range;return r?ym(r,e):!1}function ni(t){return new fr(()=>({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(At(n)||ur(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(At(o)||ur(n))return{done:!1,value:{reference:o,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Ft})}function gm(t,e){let r=t.getTypeMetaData(e.$type),n=e;for(let i of Object.values(r.properties))i.defaultValue!==void 0&&n[i.name]===void 0&&(n[i.name]=ZE(i.defaultValue))}function ZE(t){return Array.isArray(t)?[...t.map(ZE)]:t}function mm(t,e,r){let n={$type:t.$type};r&&(r.set(t,n),r.set(n,t));for(let[i,o]of Object.entries(t))if(!i.startsWith("$"))if(ht(o))n[i]=mm(o,e,r);else if(At(o))n[i]=e(n,i,o.$refNode,o.$refText,o);else if(Array.isArray(o)){let s=[];for(let a of o)ht(a)?s.push(mm(a,e,r)):At(a)?s.push(e(n,i,a.$refNode,a.$refText,a)):s.push(a);n[i]=s}else n[i]=o;return cs(n,{deep:!0}),n}var Oc={};on(Oc,{AbstractElement:()=>er,AbstractParserRule:()=>Rc,AbstractRule:()=>us,AbstractType:()=>dr,Action:()=>ii,Alternatives:()=>wc,ArrayLiteral:()=>sf,ArrayType:()=>af,Assignment:()=>oi,BooleanLiteral:()=>cf,CharacterRange:()=>si,Condition:()=>ai,Conjunction:()=>bc,CrossReference:()=>ci,Disjunction:()=>Ac,EndOfFile:()=>lf,Grammar:()=>kn,GrammarImport:()=>uf,Group:()=>eo,InferredType:()=>ff,InfixRule:()=>an,InfixRuleOperatorList:()=>Sc,InfixRuleOperators:()=>df,Interface:()=>fs,Keyword:()=>ds,LangiumGrammarAstReflection:()=>ys,LangiumGrammarTerminals:()=>PC,NamedArgument:()=>ps,NegatedToken:()=>to,Negation:()=>pf,NumberLiteral:()=>hf,Parameter:()=>hs,ParameterReference:()=>mf,ParserRule:()=>Mr,ReferenceType:()=>Ic,RegexToken:()=>ro,ReturnType:()=>gf,RuleCall:()=>no,SimpleType:()=>ms,StringLiteral:()=>yf,TerminalAlternatives:()=>io,TerminalElement:()=>tr,TerminalGroup:()=>oo,TerminalRule:()=>Nn,TerminalRuleCall:()=>so,Type:()=>kc,TypeAttribute:()=>ao,TypeDefinition:()=>co,UnionType:()=>xf,UnorderedGroup:()=>Nc,UntilToken:()=>lo,ValueLiteral:()=>uo,Wildcard:()=>gs,isAbstractElement:()=>Pc,isAbstractParserRule:()=>Pn,isAbstractRule:()=>CC,isAbstractType:()=>OC,isAction:()=>Cn,isAlternatives:()=>Tf,isArrayLiteral:()=>LC,isArrayType:()=>xm,isAssignment:()=>Fr,isBooleanLiteral:()=>Tm,isCharacterRange:()=>_m,isCondition:()=>DC,isConjunction:()=>Em,isCrossReference:()=>Ur,isDisjunction:()=>vm,isEndOfFile:()=>Rm,isGrammar:()=>$C,isGrammarImport:()=>MC,isGroup:()=>li,isInferredType:()=>Cc,isInfixRule:()=>ui,isInfixRuleOperatorList:()=>FC,isInfixRuleOperators:()=>UC,isInterface:()=>wm,isKeyword:()=>Rr,isNamedArgument:()=>BC,isNegatedToken:()=>bm,isNegation:()=>Am,isNumberLiteral:()=>GC,isParameter:()=>XC,isParameterReference:()=>Sm,isParserRule:()=>kt,isReferenceType:()=>Im,isRegexToken:()=>km,isReturnType:()=>Nm,isRuleCall:()=>Br,isSimpleType:()=>_f,isStringLiteral:()=>HC,isTerminalAlternatives:()=>Pm,isTerminalElement:()=>jC,isTerminalGroup:()=>Cm,isTerminalRule:()=>Wt,isTerminalRuleCall:()=>Ef,isType:()=>vf,isTypeAttribute:()=>zC,isTypeDefinition:()=>qC,isUnionType:()=>Om,isUnorderedGroup:()=>Rf,isUntilToken:()=>Lm,isValueLiteral:()=>WC,isWildcard:()=>Dm,reflection:()=>ie});var PC={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]*/},er={$type:"AbstractElement",cardinality:"cardinality"};function Pc(t){return ie.isInstance(t,er.$type)}var Rc={$type:"AbstractParserRule"};function Pn(t){return ie.isInstance(t,Rc.$type)}var us={$type:"AbstractRule"};function CC(t){return ie.isInstance(t,us.$type)}var dr={$type:"AbstractType"};function OC(t){return ie.isInstance(t,dr.$type)}var ii={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Cn(t){return ie.isInstance(t,ii.$type)}var wc={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Tf(t){return ie.isInstance(t,wc.$type)}var sf={$type:"ArrayLiteral",elements:"elements"};function LC(t){return ie.isInstance(t,sf.$type)}var af={$type:"ArrayType",elementType:"elementType"};function xm(t){return ie.isInstance(t,af.$type)}var oi={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function Fr(t){return ie.isInstance(t,oi.$type)}var cf={$type:"BooleanLiteral",true:"true"};function Tm(t){return ie.isInstance(t,cf.$type)}var si={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function _m(t){return ie.isInstance(t,si.$type)}var ai={$type:"Condition"};function DC(t){return ie.isInstance(t,ai.$type)}var bc={$type:"Conjunction",left:"left",right:"right"};function Em(t){return ie.isInstance(t,bc.$type)}var ci={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Ur(t){return ie.isInstance(t,ci.$type)}var Ac={$type:"Disjunction",left:"left",right:"right"};function vm(t){return ie.isInstance(t,Ac.$type)}var lf={$type:"EndOfFile",cardinality:"cardinality"};function Rm(t){return ie.isInstance(t,lf.$type)}var kn={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function $C(t){return ie.isInstance(t,kn.$type)}var uf={$type:"GrammarImport",path:"path"};function MC(t){return ie.isInstance(t,uf.$type)}var eo={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function li(t){return ie.isInstance(t,eo.$type)}var ff={$type:"InferredType",name:"name"};function Cc(t){return ie.isInstance(t,ff.$type)}var an={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function ui(t){return ie.isInstance(t,an.$type)}var Sc={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function FC(t){return ie.isInstance(t,Sc.$type)}var df={$type:"InfixRuleOperators",precedences:"precedences"};function UC(t){return ie.isInstance(t,df.$type)}var fs={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function wm(t){return ie.isInstance(t,fs.$type)}var ds={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Rr(t){return ie.isInstance(t,ds.$type)}var ps={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function BC(t){return ie.isInstance(t,ps.$type)}var to={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function bm(t){return ie.isInstance(t,to.$type)}var pf={$type:"Negation",value:"value"};function Am(t){return ie.isInstance(t,pf.$type)}var hf={$type:"NumberLiteral",value:"value"};function GC(t){return ie.isInstance(t,hf.$type)}var hs={$type:"Parameter",name:"name"};function XC(t){return ie.isInstance(t,hs.$type)}var mf={$type:"ParameterReference",parameter:"parameter"};function Sm(t){return ie.isInstance(t,mf.$type)}var Mr={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function kt(t){return ie.isInstance(t,Mr.$type)}var Ic={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function Im(t){return ie.isInstance(t,Ic.$type)}var ro={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function km(t){return ie.isInstance(t,ro.$type)}var gf={$type:"ReturnType",name:"name"};function Nm(t){return ie.isInstance(t,gf.$type)}var no={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Br(t){return ie.isInstance(t,no.$type)}var ms={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function _f(t){return ie.isInstance(t,ms.$type)}var yf={$type:"StringLiteral",value:"value"};function HC(t){return ie.isInstance(t,yf.$type)}var io={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Pm(t){return ie.isInstance(t,io.$type)}var tr={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function jC(t){return ie.isInstance(t,tr.$type)}var oo={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Cm(t){return ie.isInstance(t,oo.$type)}var Nn={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function Wt(t){return ie.isInstance(t,Nn.$type)}var so={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function Ef(t){return ie.isInstance(t,so.$type)}var kc={$type:"Type",name:"name",type:"type"};function vf(t){return ie.isInstance(t,kc.$type)}var ao={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function zC(t){return ie.isInstance(t,ao.$type)}var co={$type:"TypeDefinition"};function qC(t){return ie.isInstance(t,co.$type)}var xf={$type:"UnionType",types:"types"};function Om(t){return ie.isInstance(t,xf.$type)}var Nc={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function Rf(t){return ie.isInstance(t,Nc.$type)}var lo={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Lm(t){return ie.isInstance(t,lo.$type)}var uo={$type:"ValueLiteral"};function WC(t){return ie.isInstance(t,uo.$type)}var gs={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function Dm(t){return ie.isInstance(t,gs.$type)}var ys=class extends Ji{constructor(){super(...arguments),this.types={AbstractElement:{name:er.$type,properties:{cardinality:{name:er.cardinality}},superTypes:[]},AbstractParserRule:{name:Rc.$type,properties:{},superTypes:[us.$type,dr.$type]},AbstractRule:{name:us.$type,properties:{},superTypes:[]},AbstractType:{name:dr.$type,properties:{},superTypes:[]},Action:{name:ii.$type,properties:{cardinality:{name:ii.cardinality},feature:{name:ii.feature},inferredType:{name:ii.inferredType},operator:{name:ii.operator},type:{name:ii.type,referenceType:dr.$type}},superTypes:[er.$type]},Alternatives:{name:wc.$type,properties:{cardinality:{name:wc.cardinality},elements:{name:wc.elements,defaultValue:[]}},superTypes:[er.$type]},ArrayLiteral:{name:sf.$type,properties:{elements:{name:sf.elements,defaultValue:[]}},superTypes:[uo.$type]},ArrayType:{name:af.$type,properties:{elementType:{name:af.elementType}},superTypes:[co.$type]},Assignment:{name:oi.$type,properties:{cardinality:{name:oi.cardinality},feature:{name:oi.feature},operator:{name:oi.operator},predicate:{name:oi.predicate},terminal:{name:oi.terminal}},superTypes:[er.$type]},BooleanLiteral:{name:cf.$type,properties:{true:{name:cf.true,defaultValue:!1}},superTypes:[ai.$type,uo.$type]},CharacterRange:{name:si.$type,properties:{cardinality:{name:si.cardinality},left:{name:si.left},lookahead:{name:si.lookahead},parenthesized:{name:si.parenthesized,defaultValue:!1},right:{name:si.right}},superTypes:[tr.$type]},Condition:{name:ai.$type,properties:{},superTypes:[]},Conjunction:{name:bc.$type,properties:{left:{name:bc.left},right:{name:bc.right}},superTypes:[ai.$type]},CrossReference:{name:ci.$type,properties:{cardinality:{name:ci.cardinality},deprecatedSyntax:{name:ci.deprecatedSyntax,defaultValue:!1},isMulti:{name:ci.isMulti,defaultValue:!1},terminal:{name:ci.terminal},type:{name:ci.type,referenceType:dr.$type}},superTypes:[er.$type]},Disjunction:{name:Ac.$type,properties:{left:{name:Ac.left},right:{name:Ac.right}},superTypes:[ai.$type]},EndOfFile:{name:lf.$type,properties:{cardinality:{name:lf.cardinality}},superTypes:[er.$type]},Grammar:{name:kn.$type,properties:{imports:{name:kn.imports,defaultValue:[]},interfaces:{name:kn.interfaces,defaultValue:[]},isDeclared:{name:kn.isDeclared,defaultValue:!1},name:{name:kn.name},rules:{name:kn.rules,defaultValue:[]},types:{name:kn.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:uf.$type,properties:{path:{name:uf.path}},superTypes:[]},Group:{name:eo.$type,properties:{cardinality:{name:eo.cardinality},elements:{name:eo.elements,defaultValue:[]},guardCondition:{name:eo.guardCondition},predicate:{name:eo.predicate}},superTypes:[er.$type]},InferredType:{name:ff.$type,properties:{name:{name:ff.name}},superTypes:[dr.$type]},InfixRule:{name:an.$type,properties:{call:{name:an.call},dataType:{name:an.dataType},inferredType:{name:an.inferredType},name:{name:an.name},operators:{name:an.operators},parameters:{name:an.parameters,defaultValue:[]},returnType:{name:an.returnType,referenceType:dr.$type}},superTypes:[Rc.$type]},InfixRuleOperatorList:{name:Sc.$type,properties:{associativity:{name:Sc.associativity},operators:{name:Sc.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:df.$type,properties:{precedences:{name:df.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:fs.$type,properties:{attributes:{name:fs.attributes,defaultValue:[]},name:{name:fs.name},superTypes:{name:fs.superTypes,defaultValue:[],referenceType:dr.$type}},superTypes:[dr.$type]},Keyword:{name:ds.$type,properties:{cardinality:{name:ds.cardinality},predicate:{name:ds.predicate},value:{name:ds.value}},superTypes:[er.$type]},NamedArgument:{name:ps.$type,properties:{calledByName:{name:ps.calledByName,defaultValue:!1},parameter:{name:ps.parameter,referenceType:hs.$type},value:{name:ps.value}},superTypes:[]},NegatedToken:{name:to.$type,properties:{cardinality:{name:to.cardinality},lookahead:{name:to.lookahead},parenthesized:{name:to.parenthesized,defaultValue:!1},terminal:{name:to.terminal}},superTypes:[tr.$type]},Negation:{name:pf.$type,properties:{value:{name:pf.value}},superTypes:[ai.$type]},NumberLiteral:{name:hf.$type,properties:{value:{name:hf.value}},superTypes:[uo.$type]},Parameter:{name:hs.$type,properties:{name:{name:hs.name}},superTypes:[]},ParameterReference:{name:mf.$type,properties:{parameter:{name:mf.parameter,referenceType:hs.$type}},superTypes:[ai.$type]},ParserRule:{name:Mr.$type,properties:{dataType:{name:Mr.dataType},definition:{name:Mr.definition},entry:{name:Mr.entry,defaultValue:!1},fragment:{name:Mr.fragment,defaultValue:!1},inferredType:{name:Mr.inferredType},name:{name:Mr.name},parameters:{name:Mr.parameters,defaultValue:[]},returnType:{name:Mr.returnType,referenceType:dr.$type}},superTypes:[Rc.$type]},ReferenceType:{name:Ic.$type,properties:{isMulti:{name:Ic.isMulti,defaultValue:!1},referenceType:{name:Ic.referenceType}},superTypes:[co.$type]},RegexToken:{name:ro.$type,properties:{cardinality:{name:ro.cardinality},lookahead:{name:ro.lookahead},parenthesized:{name:ro.parenthesized,defaultValue:!1},regex:{name:ro.regex}},superTypes:[tr.$type]},ReturnType:{name:gf.$type,properties:{name:{name:gf.name}},superTypes:[]},RuleCall:{name:no.$type,properties:{arguments:{name:no.arguments,defaultValue:[]},cardinality:{name:no.cardinality},predicate:{name:no.predicate},rule:{name:no.rule,referenceType:us.$type}},superTypes:[er.$type]},SimpleType:{name:ms.$type,properties:{primitiveType:{name:ms.primitiveType},stringType:{name:ms.stringType},typeRef:{name:ms.typeRef,referenceType:dr.$type}},superTypes:[co.$type]},StringLiteral:{name:yf.$type,properties:{value:{name:yf.value}},superTypes:[uo.$type]},TerminalAlternatives:{name:io.$type,properties:{cardinality:{name:io.cardinality},elements:{name:io.elements,defaultValue:[]},lookahead:{name:io.lookahead},parenthesized:{name:io.parenthesized,defaultValue:!1}},superTypes:[tr.$type]},TerminalElement:{name:tr.$type,properties:{cardinality:{name:tr.cardinality},lookahead:{name:tr.lookahead},parenthesized:{name:tr.parenthesized,defaultValue:!1}},superTypes:[er.$type]},TerminalGroup:{name:oo.$type,properties:{cardinality:{name:oo.cardinality},elements:{name:oo.elements,defaultValue:[]},lookahead:{name:oo.lookahead},parenthesized:{name:oo.parenthesized,defaultValue:!1}},superTypes:[tr.$type]},TerminalRule:{name:Nn.$type,properties:{definition:{name:Nn.definition},fragment:{name:Nn.fragment,defaultValue:!1},hidden:{name:Nn.hidden,defaultValue:!1},name:{name:Nn.name},type:{name:Nn.type}},superTypes:[us.$type]},TerminalRuleCall:{name:so.$type,properties:{cardinality:{name:so.cardinality},lookahead:{name:so.lookahead},parenthesized:{name:so.parenthesized,defaultValue:!1},rule:{name:so.rule,referenceType:Nn.$type}},superTypes:[tr.$type]},Type:{name:kc.$type,properties:{name:{name:kc.name},type:{name:kc.type}},superTypes:[dr.$type]},TypeAttribute:{name:ao.$type,properties:{defaultValue:{name:ao.defaultValue},isOptional:{name:ao.isOptional,defaultValue:!1},name:{name:ao.name},type:{name:ao.type}},superTypes:[]},TypeDefinition:{name:co.$type,properties:{},superTypes:[]},UnionType:{name:xf.$type,properties:{types:{name:xf.types,defaultValue:[]}},superTypes:[co.$type]},UnorderedGroup:{name:Nc.$type,properties:{cardinality:{name:Nc.cardinality},elements:{name:Nc.elements,defaultValue:[]}},superTypes:[er.$type]},UntilToken:{name:lo.$type,properties:{cardinality:{name:lo.cardinality},lookahead:{name:lo.lookahead},parenthesized:{name:lo.parenthesized,defaultValue:!1},terminal:{name:lo.terminal}},superTypes:[tr.$type]},ValueLiteral:{name:uo.$type,properties:{},superTypes:[]},Wildcard:{name:gs.$type,properties:{cardinality:{name:gs.cardinality},lookahead:{name:gs.lookahead},parenthesized:{name:gs.parenthesized,defaultValue:!1}},superTypes:[tr.$type]}}}},ie=new ys;function VC(t){let e=t,r=!1;for(;e;){let n=In(e.grammarSource,kt);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}function fo(t){return new sn(t,e=>Dr(e)?e.content:[],{includeRoot:!0})}function YC(t){return fo(t).filter(ti)}function Mm(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function xs(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function po(t){if(!t)return;let{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}var cn;(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",t[t.Outside=5]="Outside"})(cn||(cn={}));function QE(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return cn.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return cn.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?cn.Inside:r?cn.OverlapBack:n?cn.OverlapFront:cn.Outside}function ym(t,e){return QE(t,e)>cn.After}var wf=/^[\w\p{L}]$/u;function KC(t,e,r=wf){if(t){if(e>0){let n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return Um(t,e)}}function Fm(t,e){if(t){let r=r0(t,!0);if(r&&$m(r,e))return r;if(Ec(t)){let n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){let o=t.content[i];if($m(o,e))return o}}}}function $m(t,e){return ti(t)&&e.includes(t.tokenType.name)}function Um(t,e){if(ti(t))return t;if(Dr(t)){let r=t0(t,e,!1);if(r)return Um(r,e)}}function e0(t,e){if(ti(t))return t;if(Dr(t)){let r=t0(t,e,!0);if(r)return e0(r,e)}}function t0(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 r0(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 ZC(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 JC(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 QC(t,e){let r=eO(t,e);return r?r.parent.content.slice(r.a+1,r.b):[]}function eO(t,e){let r=JE(t),n=JE(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 JE(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 vs={};on(vs,{findAssignment:()=>eg,findNameAssignment:()=>kf,findNodeForKeyword:()=>Jm,findNodeForProperty:()=>Uc,findNodesForKeyword:()=>oO,findNodesForKeywordInternal:()=>Qm,findNodesForProperty:()=>Km,getActionAtElement:()=>f0,getActionType:()=>p0,getAllReachableRules:()=>Fc,getAllRulesUsedForCrossReferences:()=>iO,getCrossReferenceTerminal:()=>Vm,getEntryRule:()=>a0,getExplicitRuleType:()=>Nf,getHiddenRules:()=>c0,getRuleType:()=>tg,getRuleTypeName:()=>uO,getTypeName:()=>di,isArrayCardinality:()=>aO,isArrayOperator:()=>cO,isCommentTerminal:()=>Ym,isDataType:()=>lO,isDataTypeRule:()=>Bc,isOptionalCardinality:()=>sO,terminalRegex:()=>_s});var ho=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}};function ln(t,e="Error: Got unexpected value."){throw new Error(e)}function n0(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}var If={};on(If,{NEWLINE_REGEXP:()=>Hm,escapeRegExp:()=>fi,getTerminalParts:()=>nO,isMultilineComment:()=>jm,isWhitespace:()=>Mc,partialMatches:()=>zm,partialRegExp:()=>s0,whitespaceCharacters:()=>o0});function se(t){return t.charCodeAt(0)}function Af(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function Ts(t,e){if(t[e]===!0)throw"duplicate flag "+e;let r=t[e];t[e]=!0}function mo(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function Lc(){throw Error("Internal Error - Should never get here!")}function Bm(t){return t.type==="Character"}var Dc=[];for(let t=se("0");t<=se("9");t++)Dc.push(t);var $c=[se("_")].concat(Dc);for(let t=se("a");t<=se("z");t++)$c.push(t);for(let t=se("A");t<=se("Z");t++)$c.push(t);var Gm=[se(" "),se("\f"),se(`
37
+ `),se("\r"),se(" "),se("\v"),se(" "),se("\xA0"),se("\u1680"),se("\u2000"),se("\u2001"),se("\u2002"),se("\u2003"),se("\u2004"),se("\u2005"),se("\u2006"),se("\u2007"),se("\u2008"),se("\u2009"),se("\u200A"),se("\u2028"),se("\u2029"),se("\u202F"),se("\u205F"),se("\u3000"),se("\uFEFF")];var tO=/[0-9a-fA-F]/,Sf=/[0-9]/,rO=/[1-9]/,go=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":Ts(n,"global");break;case"i":Ts(n,"ignoreCase");break;case"m":Ts(n,"multiLine");break;case"u":Ts(n,"unicode");break;case"y":Ts(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;case"<":{switch(this.popChar()){case"=":r="Lookbehind";break;case"!":r="NegativeLookbehind"}break}}mo(r);let n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return Lc()}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;mo(r);break}if(!(e===!0&&r===void 0)&&mo(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()),mo(e)?(e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):Lc()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[se(`
38
+ `),se("\r"),se("\u2028"),se("\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=Dc;break;case"D":e=Dc,r=!0;break;case"s":e=Gm;break;case"S":e=Gm,r=!0;break;case"w":e=$c;break;case"W":e=$c,r=!0;break}return mo(e)?{type:"Set",value:e,complement:r}:Lc()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=se("\f");break;case"n":e=se(`
39
+ `);break;case"r":e=se("\r");break;case"t":e=se(" ");break;case"v":e=se("\v");break}return mo(e)?{type:"Character",value:e}:Lc()}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:se("\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:se(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
40
+ `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let e=this.popChar();return{type:"Character",value:se(e)}}}characterClass(){let e=[],r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){let n=this.classAtom(),i=n.type==="Character";if(Bm(n)&&this.isRangeDash()){this.consumeChar("-");let o=this.classAtom(),s=o.type==="Character";if(Bm(o)){if(o.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:o.value})}else Af(n.value,e),e.push(se("-")),Af(o.value,e)}else Af(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
41
+ `:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:se("\b")};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()}}group(){let e=!0;this.consumeChar("("),this.peekChar(0)==="?"?(this.consumeChar("?"),this.consumeChar(":"),e=!1):this.groupIdx++;let r=this.disjunction();this.consumeChar(")");let n={type:"Group",capturing:e,value:r};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(rO.test(e)===!1)throw Error("Expecting a positive integer");for(;Sf.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Sf.test(e)===!1)throw Error("Expecting an integer");for(;Sf.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`
42
+ `:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:se(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return Sf.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
43
43
  `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!"||this.peekChar(2)==="<"&&(this.peekChar(3)==="="||this.peekChar(3)==="!"));default:return!1}}isQuantifier(){let e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
44
- `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i<e;i++){let o=this.popChar();if(RC.test(o)===!1)throw Error("Expecting a HexDecimal digits");r+=o}return{type:"Character",value:parseInt(r,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){let e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};var an=class{visitChildren(e){for(let r in e){let n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}};var Om=/\r?\n/gm,XE=new uo,Cm=class extends an{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){let r=String.fromCharCode(e.value);if(!this.multiline&&r===`
45
- `&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let n=si(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){let r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!`
46
- `.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},fo=new Cm;function wC(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;let e=XE.pattern(t),r=[];for(let n of e.value.value)fo.reset(t),fo.visit(n),r.push({start:fo.startRegexp,end:fo.endRegex});return r}catch{return[]}}function Lm(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),fo.reset(t),fo.visit(XE.pattern(t)),fo.multiline}catch{return!1}}var GE=`\f
47
- \r \v \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`.split("");function Pc(t){let e=typeof t=="string"?new RegExp(t):t;return GE.some(r=>e.test(r))}function si(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Dm(t,e){let r=HE(t),n=e.match(r);return!!n&&n[0].length>0}function HE(t){typeof t=="string"&&(t=new RegExp(t));let e=t,r=t.source,n=0;function i(){let o="",s;function a(l){o+=r.substr(n,l),n+=l}function c(l){o+="(?:"+r.substr(n,l)+"|$)",n+=l}for(;n<r.length;)switch(r[n]){case"\\":switch(r[n+1]){case"c":c(3);break;case"x":c(4);break;case"u":e.unicode?r[n+2]==="{"?c(r.indexOf("}",n)-n+1):c(6):c(2);break;case"p":case"P":e.unicode?c(r.indexOf("}",n)-n+1):c(2);break;case"k":c(r.indexOf(">",n)-n+1);break;default:c(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],c(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":a(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?a(s[0].length):c(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":o+="(?:",n+=3,o+=i()+"|$)";break;case"=":o+="(?=",n+=3,o+=i()+")";break;case"!":s=n,n+=3,i(),o+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),o+=r.substr(s,n-s);break;default:a(r.indexOf(">",n)-n+1),o+=i()+"|$)";break}break}else a(1),o+=i()+"|$)";break;case")":return++n,o;default:c(1);break}return o}return new RegExp(i(),t.flags)}function jE(t){return t.rules.find(e=>St(e)&&e.entry)}function WE(t){return t.rules.filter(e=>qt(e)&&e.hidden)}function Cc(t,e){let r=new Set,n=jE(t);if(!n)return new Set(t.rules);let i=[n].concat(WE(t));for(let s of i)qE(s,r,e);let o=new Set;for(let s of t.rules)(r.has(s.name)||qt(s)&&s.hidden)&&o.add(s);return o}function qE(t,e,r){e.add(t.name),Lr(t).forEach(n=>{if(Fr(n)||r&&df(n)){let i=n.rule.ref;i&&!e.has(i.name)&&qE(i,e,r)}})}function AC(t){let e=new Set;return Lr(t).forEach(r=>{Mr(r)&&(St(r.type.ref)&&e.add(r.type.ref),Ic(r.type.ref)&&St(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}function Fm(t){if(t.terminal)return t.terminal;if(t.type.ref)return _f(t.type.ref)?.terminal}function Um(t){return t.hidden&&!Pc(hs(t))}function Bm(t,e){return!t||!e?[]:Xm(t,e,t.astNode,!0)}function Oc(t,e,r){if(!t||!e)return;let n=Xm(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function Xm(t,e,r,n){if(!n){let i=An(t.grammarSource,$r);if(i&&i.feature===e)return[t]}return Or(t)&&t.astNode===r?t.content.flatMap(i=>Xm(i,e,r,!1)):[]}function IC(t,e){return t?Hm(t,e,t?.astNode):[]}function Gm(t,e,r){if(!t)return;let n=Hm(t,e,t?.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function Hm(t,e,r){if(t.astNode!==r)return[];if(Er(t.grammarSource)&&t.grammarSource.value===e)return[t];let n=so(t).iterator(),i,o=[];do if(i=n.next(),!i.done){let s=i.value;s.astNode===r?Er(s.grammarSource)&&s.grammarSource.value===e&&o.push(s):n.prune()}while(!i.done);return o}function jm(t){let e=t.astNode;for(;e===t.container?.astNode;){let r=An(t.grammarSource,$r);if(r)return r;t=t.container}}function _f(t){let e=t;return Ic(e)&&(kn(e.$container)?e=e.$container.$container:vn(e.$container)?e=e.$container:sn(e.$container)),zE(t,e,new Map)}function zE(t,e,r){function n(i,o){let s;return An(i,$r)||(s=zE(o,o,r)),r.set(t,s),s}if(r.has(t))return r.get(t);r.set(t,void 0);for(let i of Lr(e)){if($r(i)&&i.feature.toLowerCase()==="name")return r.set(t,i),i;if(Fr(i)&&St(i.rule.ref))return n(i,i.rule.ref);if(ff(i)&&i.typeRef?.ref)return n(i,i.typeRef.ref)}}function VE(t){let e=t.$container;if(ii(e)){let r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){let o=r[i];if(kn(o))return o;{let s=Lr(r[i]).find(kn);if(s)return s}}}if(Ac(e))return VE(e)}function SC(t,e){return t==="?"||t==="*"||ii(e)&&!!e.guardCondition}function vC(t){return t==="*"||t==="+"}function kC(t){return t==="+="}function Lc(t){return YE(t,new Set)}function YE(t,e){if(e.has(t))return!0;e.add(t);for(let r of Lr(t))if(Fr(r)){if(!r.rule.ref||St(r.rule.ref)&&!YE(r.rule.ref,e)||oi(r.rule.ref))return!1}else{if($r(r))return!1;if(kn(r))return!1}return!!t.definition}function NC(t){return Mm(t.type,new Set)}function Mm(t,e){if(e.has(t))return!0;if(e.add(t),cm(t))return!1;if(xm(t))return!1;if(bm(t))return t.types.every(r=>Mm(r,e));if(ff(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){let r=t.typeRef.ref;return pf(r)?Mm(r.type,e):!1}else return!1}else return!1}function Ef(t){if(!qt(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){let e=t.returnType.ref;if(e)return e.name}}}function ai(t){if(vn(t))return St(t)&&Lc(t)?t.name:Ef(t)??t.name;if(hm(t)||pf(t)||_m(t))return t.name;if(kn(t)){let e=KE(t);if(e)return e}else if(Ic(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function KE(t){if(t.inferredType)return t.inferredType.name;if(t.type?.ref)return ai(t.type.ref)}function PC(t){return qt(t)?t.type?.name??"string":St(t)&&Lc(t)?t.name:Ef(t)??t.name}function Wm(t){return qt(t)?t.type?.name??"string":Ef(t)??t.name}function hs(t){let e={s:!1,i:!1,u:!1},r=ms(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}var qm=/[\s\S]/.source;function ms(t,e){if(Em(t))return CC(t);if(Rm(t))return OC(t);if(um(t))return $C(t);if(df(t)){let r=t.rule.ref;if(!r)throw new Error("Missing rule reference.");return Nn(ms(r.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(mm(t))return DC(t);if(wm(t))return LC(t);if(Tm(t)){let r=t.regex.lastIndexOf("/"),n=t.regex.substring(1,r),i=t.regex.substring(r+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),Nn(n,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(Am(t))return Nn(qm,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t?.$type}, ${t?.$cstNode?.text}`)}}}function CC(t){return Nn(t.elements.map(e=>ms(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function OC(t){return Nn(t.elements.map(e=>ms(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function LC(t){return Nn(`${qm}*?${ms(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function DC(t){return Nn(`(?!${ms(t.terminal)})${qm}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function $C(t){return t.right?Nn(`[${$m(t.left)}-${$m(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):Nn($m(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function $m(t){return si(t.value)}function Nn(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function zm(t){let e=[],r=t.Grammar;for(let n of r.rules)qt(n)&&Um(n)&&Lm(hs(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:mf}}function ys(t){console&&console.error&&console.error(`Error: ${t}`)}function Dc(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function $c(t){let e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function Mc(t){function e(){}e.prototype=t;let r=new e;function n(){return typeof r.bar}return n(),n(),t;(0,eval)(t)}function MC(t){return FC(t)?t.LABEL:t.name}function FC(t){return typeof t.LABEL=="string"&&t.LABEL!==""}var dr=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(r=>{r.accept(e)})}},Me=class extends dr{constructor(e){super([]),this.idx=1,Object.assign(this,cn(e))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},zt=class extends dr{constructor(e){super(e.definition),this.orgText="",Object.assign(this,cn(e))}},Ke=class extends dr{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,cn(e))}},Fe=class extends dr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,cn(e))}},Ze=class extends dr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,cn(e))}},Je=class extends dr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,cn(e))}},be=class extends dr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,cn(e))}},qe=class extends dr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,cn(e))}},ze=class extends dr{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,cn(e))}},ge=class{constructor(e){this.idx=1,Object.assign(this,cn(e))}accept(e){e.visit(this)}};function Rf(t){return t.map(xs)}function xs(t){function e(r){return r.map(xs)}if(t instanceof Me){let r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return typeof t.label=="string"&&(r.label=t.label),r}else{if(t instanceof Ke)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Fe)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Ze)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Je)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:xs(new ge({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof qe)return{type:"RepetitionWithSeparator",idx:t.idx,separator:xs(new ge({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof be)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof ze)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof ge){let r={type:"Terminal",name:t.terminalType.name,label:MC(t.terminalType),idx:t.idx};typeof t.label=="string"&&(r.terminalLabel=t.label);let n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=n instanceof RegExp?n.source:n),r}else{if(t instanceof zt)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}function cn(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0))}var Vt=class{visit(e){let r=e;switch(r.constructor){case Me:return this.visitNonTerminal(r);case Ke:return this.visitAlternative(r);case Fe:return this.visitOption(r);case Ze:return this.visitRepetitionMandatory(r);case Je:return this.visitRepetitionMandatoryWithSeparator(r);case qe:return this.visitRepetitionWithSeparator(r);case be:return this.visitRepetition(r);case ze:return this.visitAlternation(r);case ge:return this.visitTerminal(r);case zt:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function Vm(t){return t instanceof Ke||t instanceof Fe||t instanceof be||t instanceof Ze||t instanceof Je||t instanceof qe||t instanceof ge||t instanceof zt}function po(t,e=[]){return t instanceof Fe||t instanceof be||t instanceof qe?!0:t instanceof ze?t.definition.some(n=>po(n,e)):t instanceof Me&&e.includes(t)?!1:t instanceof dr?(t instanceof Me&&e.push(t),t.definition.every(n=>po(n,e))):!1}function Ym(t){return t instanceof ze}function tr(t){if(t instanceof Me)return"SUBRULE";if(t instanceof Fe)return"OPTION";if(t instanceof ze)return"OR";if(t instanceof Ze)return"AT_LEAST_ONE";if(t instanceof Je)return"AT_LEAST_ONE_SEP";if(t instanceof qe)return"MANY_SEP";if(t instanceof be)return"MANY";if(t instanceof ge)return"CONSUME";throw Error("non exhaustive match")}var Pn=class{walk(e,r=[]){e.definition.forEach((n,i)=>{let o=e.definition.slice(i+1);if(n instanceof Me)this.walkProdRef(n,o,r);else if(n instanceof ge)this.walkTerminal(n,o,r);else if(n instanceof Ke)this.walkFlat(n,o,r);else if(n instanceof Fe)this.walkOption(n,o,r);else if(n instanceof Ze)this.walkAtLeastOne(n,o,r);else if(n instanceof Je)this.walkAtLeastOneSep(n,o,r);else if(n instanceof qe)this.walkManySep(n,o,r);else if(n instanceof be)this.walkMany(n,o,r);else if(n instanceof ze)this.walkOr(n,o,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){let i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){let i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){let i=[new Fe({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){let i=ZE(e,r,n);this.walk(e,i)}walkMany(e,r,n){let i=[new Fe({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){let i=ZE(e,r,n);this.walk(e,i)}walkOr(e,r,n){let i=r.concat(n);e.definition.forEach(o=>{let s=new Ke({definition:[o]});this.walk(s,i)})}};function ZE(t,e,r){return[new Fe({definition:[new ge({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function ho(t){if(t instanceof Me)return ho(t.referencedRule);if(t instanceof ge)return XC(t);if(Vm(t))return UC(t);if(Ym(t))return BC(t);throw Error("non exhaustive match")}function UC(t){let e=[],r=t.definition,n=0,i=r.length>n,o,s=!0;for(;i&&s;)o=r[n],s=po(o),e=e.concat(ho(o)),n=n+1,i=r.length>n;return[...new Set(e)]}function BC(t){let e=t.definition.map(r=>ho(r));return[...new Set(e.flat())]}function XC(t){return[t.terminalType]}var bf="_~IN~_";var Km=class extends Pn{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){let i=GC(e.referencedRule,e.idx)+this.topProd.name,o=r.concat(n),s=new Ke({definition:o}),a=ho(s);this.follows[i]=a}};function JE(t){let e={};return t.forEach(r=>{let n=new Km(r).startWalking();Object.assign(e,n)}),e}function GC(t,e){return t.name+e+bf}var wf={},HC=new uo;function Ts(t){let e=t.toString();if(wf.hasOwnProperty(e))return wf[e];{let r=HC.pattern(e);return wf[e]=r,r}}function QE(){wf={}}var tR="Complement Sets are not supported for first char optimization",Fc=`Unable to use "first char" lexer optimizations:
48
- `;function rR(t,e=!1){try{let r=Ts(t);return Zm(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===tR)e&&Dc(`${Fc} Unable to optimize: < ${t.toString()} >
44
+ `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i<e;i++){let o=this.popChar();if(tO.test(o)===!1)throw Error("Expecting a HexDecimal digits");r+=o}return{type:"Character",value:parseInt(r,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){let e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};var un=class{visitChildren(e){for(let r in e){let n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}};var Hm=/\r?\n/gm,i0=new go,Xm=class extends un{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){let r=String.fromCharCode(e.value);if(!this.multiline&&r===`
45
+ `&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let n=fi(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){let r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!`
46
+ `.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},yo=new Xm;function nO(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;let e=i0.pattern(t),r=[];for(let n of e.value.value)yo.reset(t),yo.visit(n),r.push({start:yo.startRegexp,end:yo.endRegex});return r}catch{return[]}}function jm(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),yo.reset(t),yo.visit(i0.pattern(t)),yo.multiline}catch{return!1}}var o0=`\f
47
+ \r \v \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`.split("");function Mc(t){let e=typeof t=="string"?new RegExp(t):t;return o0.some(r=>e.test(r))}function fi(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function zm(t,e){let r=s0(t),n=e.match(r);return!!n&&n[0].length>0}function s0(t){typeof t=="string"&&(t=new RegExp(t));let e=t,r=t.source,n=0;function i(){let o="",s;function a(l){o+=r.substr(n,l),n+=l}function c(l){o+="(?:"+r.substr(n,l)+"|$)",n+=l}for(;n<r.length;)switch(r[n]){case"\\":switch(r[n+1]){case"c":c(3);break;case"x":c(4);break;case"u":e.unicode?r[n+2]==="{"?c(r.indexOf("}",n)-n+1):c(6):c(2);break;case"p":case"P":e.unicode?c(r.indexOf("}",n)-n+1):c(2);break;case"k":c(r.indexOf(">",n)-n+1);break;default:c(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],c(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":a(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?a(s[0].length):c(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":o+="(?:",n+=3,o+=i()+"|$)";break;case"=":o+="(?=",n+=3,o+=i()+")";break;case"!":s=n,n+=3,i(),o+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),o+=r.substr(s,n-s);break;default:a(r.indexOf(">",n)-n+1),o+=i()+"|$)";break}break}else a(1),o+=i()+"|$)";break;case")":return++n,o;default:c(1);break}return o}return new RegExp(i(),t.flags)}function a0(t){return t.rules.find(e=>kt(e)&&e.entry)}function c0(t){return t.rules.filter(e=>Wt(e)&&e.hidden)}function Fc(t,e){let r=new Set,n=a0(t);if(!n)return new Set(t.rules);let i=[n].concat(c0(t));for(let s of i)l0(s,r,e);let o=new Set;for(let s of t.rules)(r.has(s.name)||Wt(s)&&s.hidden)&&o.add(s);return o}function l0(t,e,r){e.add(t.name),$r(t).forEach(n=>{if(Br(n)||r&&Ef(n)){let i=n.rule.ref;i&&!e.has(i.name)&&l0(i,e,r)}})}function iO(t){let e=new Set;return $r(t).forEach(r=>{Ur(r)&&(kt(r.type.ref)&&e.add(r.type.ref),Cc(r.type.ref)&&kt(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}function Vm(t){if(t.terminal)return t.terminal;if(t.type.ref)return kf(t.type.ref)?.terminal}function Ym(t){return t.hidden&&!Mc(_s(t))}function Km(t,e){return!t||!e?[]:Zm(t,e,t.astNode,!0)}function Uc(t,e,r){if(!t||!e)return;let n=Zm(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function Zm(t,e,r,n){if(!n){let i=In(t.grammarSource,Fr);if(i&&i.feature===e)return[t]}return Dr(t)&&t.astNode===r?t.content.flatMap(i=>Zm(i,e,r,!1)):[]}function oO(t,e){return t?Qm(t,e,t?.astNode):[]}function Jm(t,e,r){if(!t)return;let n=Qm(t,e,t?.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function Qm(t,e,r){if(t.astNode!==r)return[];if(Rr(t.grammarSource)&&t.grammarSource.value===e)return[t];let n=fo(t).iterator(),i,o=[];do if(i=n.next(),!i.done){let s=i.value;s.astNode===r?Rr(s.grammarSource)&&s.grammarSource.value===e&&o.push(s):n.prune()}while(!i.done);return o}function eg(t){let e=t.astNode;for(;e===t.container?.astNode;){let r=In(t.grammarSource,Fr);if(r)return r;t=t.container}}function kf(t){let e=t;return Cc(e)&&(Cn(e.$container)?e=e.$container.$container:Pn(e.$container)?e=e.$container:ln(e.$container)),u0(t,e,new Map)}function u0(t,e,r){function n(i,o){let s;return In(i,Fr)||(s=u0(o,o,r)),r.set(t,s),s}if(r.has(t))return r.get(t);r.set(t,void 0);for(let i of $r(e)){if(Fr(i)&&i.feature.toLowerCase()==="name")return r.set(t,i),i;if(Br(i)&&kt(i.rule.ref))return n(i,i.rule.ref);if(_f(i)&&i.typeRef?.ref)return n(i,i.typeRef.ref)}}function f0(t){let e=t.$container;if(li(e)){let r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){let o=r[i];if(Cn(o))return o;{let s=$r(r[i]).find(Cn);if(s)return s}}}if(Pc(e))return f0(e)}function sO(t,e){return t==="?"||t==="*"||li(e)&&!!e.guardCondition}function aO(t){return t==="*"||t==="+"}function cO(t){return t==="+="}function Bc(t){return d0(t,new Set)}function d0(t,e){if(e.has(t))return!0;e.add(t);for(let r of $r(t))if(Br(r)){if(!r.rule.ref||kt(r.rule.ref)&&!d0(r.rule.ref,e)||ui(r.rule.ref))return!1}else{if(Fr(r))return!1;if(Cn(r))return!1}return!!t.definition}function lO(t){return Wm(t.type,new Set)}function Wm(t,e){if(e.has(t))return!0;if(e.add(t),xm(t))return!1;if(Im(t))return!1;if(Om(t))return t.types.every(r=>Wm(r,e));if(_f(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){let r=t.typeRef.ref;return vf(r)?Wm(r.type,e):!1}else return!1}else return!1}function Nf(t){if(!Wt(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){let e=t.returnType.ref;if(e)return e.name}}}function di(t){if(Pn(t))return kt(t)&&Bc(t)?t.name:Nf(t)??t.name;if(wm(t)||vf(t)||Nm(t))return t.name;if(Cn(t)){let e=p0(t);if(e)return e}else if(Cc(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function p0(t){if(t.inferredType)return t.inferredType.name;if(t.type?.ref)return di(t.type.ref)}function uO(t){return Wt(t)?t.type?.name??"string":kt(t)&&Bc(t)?t.name:Nf(t)??t.name}function tg(t){return Wt(t)?t.type?.name??"string":Nf(t)??t.name}function _s(t){let e={s:!1,i:!1,u:!1},r=Es(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}var rg=/[\s\S]/.source;function Es(t,e){if(Pm(t))return fO(t);if(Cm(t))return dO(t);if(_m(t))return mO(t);if(Ef(t)){let r=t.rule.ref;if(!r)throw new Error("Missing rule reference.");return On(Es(r.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(bm(t))return hO(t);if(Lm(t))return pO(t);if(km(t)){let r=t.regex.lastIndexOf("/"),n=t.regex.substring(1,r),i=t.regex.substring(r+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),On(n,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(Dm(t))return On(rg,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t?.$type}, ${t?.$cstNode?.text}`)}}}function fO(t){return On(t.elements.map(e=>Es(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function dO(t){return On(t.elements.map(e=>Es(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function pO(t){return On(`${rg}*?${Es(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function hO(t){return On(`(?!${Es(t.terminal)})${rg}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function mO(t){return t.right?On(`[${qm(t.left)}-${qm(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):On(qm(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function qm(t){return fi(t.value)}function On(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function ng(t){let e=[],r=t.Grammar;for(let n of r.rules)Wt(n)&&Ym(n)&&jm(_s(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:wf}}function Rs(t){console&&console.error&&console.error(`Error: ${t}`)}function Gc(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function Xc(t){let e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function Hc(t){function e(){}e.prototype=t;let r=new e;function n(){return typeof r.bar}return n(),n(),t;(0,eval)(t)}function gO(t){return yO(t)?t.LABEL:t.name}function yO(t){return typeof t.LABEL=="string"&&t.LABEL!==""}var pr=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(r=>{r.accept(e)})}},Ge=class extends pr{constructor(e){super([]),this.idx=1,Object.assign(this,fn(e))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},Vt=class extends pr{constructor(e){super(e.definition),this.orgText="",Object.assign(this,fn(e))}},Je=class extends pr{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,fn(e))}},Xe=class extends pr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,fn(e))}},Qe=class extends pr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,fn(e))}},et=class extends pr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,fn(e))}},we=class extends pr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,fn(e))}},Ye=class extends pr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,fn(e))}},Ke=class extends pr{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,fn(e))}},_e=class{constructor(e){this.idx=1,Object.assign(this,fn(e))}accept(e){e.visit(this)}};function Pf(t){return t.map(ws)}function ws(t){function e(r){return r.map(ws)}if(t instanceof Ge){let r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return typeof t.label=="string"&&(r.label=t.label),r}else{if(t instanceof Je)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Xe)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Qe)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof et)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:ws(new _e({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Ye)return{type:"RepetitionWithSeparator",idx:t.idx,separator:ws(new _e({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof we)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof Ke)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof _e){let r={type:"Terminal",name:t.terminalType.name,label:gO(t.terminalType),idx:t.idx};typeof t.label=="string"&&(r.terminalLabel=t.label);let n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=n instanceof RegExp?n.source:n),r}else{if(t instanceof Vt)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}function fn(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0))}var Yt=class{visit(e){let r=e;switch(r.constructor){case Ge:return this.visitNonTerminal(r);case Je:return this.visitAlternative(r);case Xe:return this.visitOption(r);case Qe:return this.visitRepetitionMandatory(r);case et:return this.visitRepetitionMandatoryWithSeparator(r);case Ye:return this.visitRepetitionWithSeparator(r);case we:return this.visitRepetition(r);case Ke:return this.visitAlternation(r);case _e:return this.visitTerminal(r);case Vt:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function ig(t){return t instanceof Je||t instanceof Xe||t instanceof we||t instanceof Qe||t instanceof et||t instanceof Ye||t instanceof _e||t instanceof Vt}function xo(t,e=[]){return t instanceof Xe||t instanceof we||t instanceof Ye?!0:t instanceof Ke?t.definition.some(n=>xo(n,e)):t instanceof Ge&&e.includes(t)?!1:t instanceof pr?(t instanceof Ge&&e.push(t),t.definition.every(n=>xo(n,e))):!1}function og(t){return t instanceof Ke}function rr(t){if(t instanceof Ge)return"SUBRULE";if(t instanceof Xe)return"OPTION";if(t instanceof Ke)return"OR";if(t instanceof Qe)return"AT_LEAST_ONE";if(t instanceof et)return"AT_LEAST_ONE_SEP";if(t instanceof Ye)return"MANY_SEP";if(t instanceof we)return"MANY";if(t instanceof _e)return"CONSUME";throw Error("non exhaustive match")}var Ln=class{walk(e,r=[]){e.definition.forEach((n,i)=>{let o=e.definition.slice(i+1);if(n instanceof Ge)this.walkProdRef(n,o,r);else if(n instanceof _e)this.walkTerminal(n,o,r);else if(n instanceof Je)this.walkFlat(n,o,r);else if(n instanceof Xe)this.walkOption(n,o,r);else if(n instanceof Qe)this.walkAtLeastOne(n,o,r);else if(n instanceof et)this.walkAtLeastOneSep(n,o,r);else if(n instanceof Ye)this.walkManySep(n,o,r);else if(n instanceof we)this.walkMany(n,o,r);else if(n instanceof Ke)this.walkOr(n,o,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){let i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){let i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){let i=[new Xe({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){let i=h0(e,r,n);this.walk(e,i)}walkMany(e,r,n){let i=[new Xe({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){let i=h0(e,r,n);this.walk(e,i)}walkOr(e,r,n){let i=r.concat(n);e.definition.forEach(o=>{let s=new Je({definition:[o]});this.walk(s,i)})}};function h0(t,e,r){return[new Xe({definition:[new _e({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function To(t){if(t instanceof Ge)return To(t.referencedRule);if(t instanceof _e)return _O(t);if(ig(t))return xO(t);if(og(t))return TO(t);throw Error("non exhaustive match")}function xO(t){let e=[],r=t.definition,n=0,i=r.length>n,o,s=!0;for(;i&&s;)o=r[n],s=xo(o),e=e.concat(To(o)),n=n+1,i=r.length>n;return[...new Set(e)]}function TO(t){let e=t.definition.map(r=>To(r));return[...new Set(e.flat())]}function _O(t){return[t.terminalType]}var Cf="_~IN~_";var sg=class extends Ln{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){let i=EO(e.referencedRule,e.idx)+this.topProd.name,o=r.concat(n),s=new Je({definition:o}),a=To(s);this.follows[i]=a}};function m0(t){let e={};return t.forEach(r=>{let n=new sg(r).startWalking();Object.assign(e,n)}),e}function EO(t,e){return t.name+e+Cf}var Of={},vO=new go;function bs(t){let e=t.toString();if(Of.hasOwnProperty(e))return Of[e];{let r=vO.pattern(e);return Of[e]=r,r}}function g0(){Of={}}var x0="Complement Sets are not supported for first char optimization",jc=`Unable to use "first char" lexer optimizations:
48
+ `;function T0(t,e=!1){try{let r=bs(t);return ag(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===x0)e&&Gc(`${jc} Unable to optimize: < ${t.toString()} >
49
49
  Complement Sets cannot be automatically optimized.
50
50
  This will disable the lexer's first char optimizations.
51
51
  See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=`
52
52
  This will disable the lexer's first char optimizations.
53
- See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),ys(`${Fc}
53
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Rs(`${jc}
54
54
  Failed parsing: < ${t.toString()} >
55
55
  Using the @chevrotain/regexp-to-ast library
56
- Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function Zm(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)Zm(t.value[i],e,r);break;case"Alternative":let n=t.value;for(let i=0;i<n.length;i++){let o=n[i];switch(o.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"Lookbehind":case"NegativeLookbehind":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}let s=o;switch(s.type){case"Character":Af(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error(tR);s.value.forEach(c=>{if(typeof c=="number")Af(c,e,r);else{let l=c;if(r===!0)for(let u=l.from;u<=l.to;u++)Af(u,e,r);else{for(let u=l.from;u<=l.to&&u<_s;u++)Af(u,e,r);if(l.to>=_s){let u=l.from>=_s?l.from:_s,f=l.to,d=ln(u),p=ln(f);for(let m=d;m<=p;m++)e[m]=m}}}});break;case"Group":Zm(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}let a=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&Jm(s)===!1||s.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return Object.values(e)}function Af(t,e,r){let n=ln(t);e[n]=n,r===!0&&jC(t,e)}function jC(t,e){let r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){let i=ln(n.charCodeAt(0));e[i]=i}else{let i=r.toLowerCase();if(i!==r){let o=ln(i.charCodeAt(0));e[o]=o}}}function eR(t,e){return t.value.find(r=>{if(typeof r=="number")return e.includes(r);{let n=r;return e.find(i=>n.from<=i&&i<=n.to)!==void 0}})}function Jm(t){let e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Array.isArray(t.value)?t.value.every(Jm):Jm(t.value):!1}var Qm=class extends an{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){this.targetCharCodes.includes(e.value)&&(this.found=!0)}visitSet(e){e.complement?eR(e,this.targetCharCodes)===void 0&&(this.found=!0):eR(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function If(t,e){if(e instanceof RegExp){let r=Ts(e),n=new Qm(t);return n.visit(r),n.found}else{for(let r of e){let n=r.charCodeAt(0);if(t.includes(n))return!0}return!1}}var mo="PATTERN",Es="defaultMode",Sf="modes";function iR(t,e){e=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
57
- `],tracer:(E,_)=>_()},e);let r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{lO()});let n;r("Reject Lexer.NA",()=>{n=t.filter(E=>E[mo]!==at.NA)});let i=!1,o;r("Transform Patterns",()=>{i=!1,o=n.map(E=>{let _=E[mo];if(_ instanceof RegExp){let k=_.source;return k.length===1&&k!=="^"&&k!=="$"&&k!=="."&&!_.ignoreCase?k:k.length===2&&k[0]==="\\"&&!["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(k[1])?k[1]:nR(_)}else{if(typeof _=="function")return i=!0,{exec:_};if(typeof _=="object")return i=!0,_;if(typeof _=="string"){if(_.length===1)return _;{let k=_.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),D=new RegExp(k);return nR(D)}}else throw Error("non exhaustive match")}})});let s,a,c,l,u;r("misc mapping",()=>{s=n.map(E=>E.tokenTypeIdx),a=n.map(E=>{let _=E.GROUP;if(_!==at.SKIPPED){if(typeof _=="string")return _;if(_===void 0)return!1;throw Error("non exhaustive match")}}),c=n.map(E=>{let _=E.LONGER_ALT;if(_)return Array.isArray(_)?_.map(D=>n.indexOf(D)):[n.indexOf(_)]}),l=n.map(E=>E.PUSH_MODE),u=n.map(E=>Object.hasOwn(E,"POP_MODE"))});let f;r("Line Terminator Handling",()=>{let E=dR(e.lineTerminatorCharacters);f=n.map(_=>!1),e.positionTracking!=="onlyOffset"&&(f=n.map(_=>Object.hasOwn(_,"LINE_BREAKS")?!!_.LINE_BREAKS:fR(_,E)===!1&&If(E,_.PATTERN)))});let d,p,m,y;r("Misc Mapping #2",()=>{d=n.map(lR),p=o.map(aO),m=n.reduce((E,_)=>{let k=_.GROUP;return typeof k=="string"&&k!==at.SKIPPED&&(E[k]=[]),E},{}),y=o.map((E,_)=>({pattern:o[_],longerAlt:c[_],canLineTerminator:f[_],isCustom:d[_],short:p[_],group:a[_],push:l[_],pop:u[_],tokenTypeIdx:s[_],tokenType:n[_]}))});let R=!0,T=[];return e.safeMode||r("First Char Optimization",()=>{T=n.reduce((E,_,k)=>{if(typeof _.PATTERN=="string"){let D=_.PATTERN.charCodeAt(0),C=ln(D);eg(E,C,y[k])}else if(Array.isArray(_.START_CHARS_HINT)){let D;_.START_CHARS_HINT.forEach(C=>{let j=typeof C=="string"?C.charCodeAt(0):C,V=ln(j);D!==V&&(D=V,eg(E,V,y[k]))})}else if(_.PATTERN instanceof RegExp)if(_.PATTERN.unicode)R=!1,e.ensureOptimizations&&ys(`${Fc} Unable to analyze < ${_.PATTERN.toString()} > pattern.
56
+ Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function ag(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)ag(t.value[i],e,r);break;case"Alternative":let n=t.value;for(let i=0;i<n.length;i++){let o=n[i];switch(o.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"Lookbehind":case"NegativeLookbehind":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}let s=o;switch(s.type){case"Character":Lf(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error(x0);s.value.forEach(c=>{if(typeof c=="number")Lf(c,e,r);else{let l=c;if(r===!0)for(let u=l.from;u<=l.to;u++)Lf(u,e,r);else{for(let u=l.from;u<=l.to&&u<As;u++)Lf(u,e,r);if(l.to>=As){let u=l.from>=As?l.from:As,f=l.to,d=dn(u),p=dn(f);for(let m=d;m<=p;m++)e[m]=m}}}});break;case"Group":ag(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}let a=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&cg(s)===!1||s.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return Object.values(e)}function Lf(t,e,r){let n=dn(t);e[n]=n,r===!0&&RO(t,e)}function RO(t,e){let r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){let i=dn(n.charCodeAt(0));e[i]=i}else{let i=r.toLowerCase();if(i!==r){let o=dn(i.charCodeAt(0));e[o]=o}}}function y0(t,e){return t.value.find(r=>{if(typeof r=="number")return e.includes(r);{let n=r;return e.find(i=>n.from<=i&&i<=n.to)!==void 0}})}function cg(t){let e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Array.isArray(t.value)?t.value.every(cg):cg(t.value):!1}var lg=class extends un{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){this.targetCharCodes.includes(e.value)&&(this.found=!0)}visitSet(e){e.complement?y0(e,this.targetCharCodes)===void 0&&(this.found=!0):y0(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function Df(t,e){if(e instanceof RegExp){let r=bs(e),n=new lg(t);return n.visit(r),n.found}else{for(let r of e){let n=r.charCodeAt(0);if(t.includes(n))return!0}return!1}}var _o="PATTERN",Ss="defaultMode",$f="modes";function E0(t,e){e=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
57
+ `],tracer:(_,E)=>E()},e);let r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{XO()});let n;r("Reject Lexer.NA",()=>{n=t.filter(_=>_[_o]!==ct.NA)});let i=!1,o;r("Transform Patterns",()=>{i=!1,o=n.map(_=>{let E=_[_o];if(E instanceof RegExp){let I=E.source;return I.length===1&&I!=="^"&&I!=="$"&&I!=="."&&!E.ignoreCase?I:I.length===2&&I[0]==="\\"&&!["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(I[1])?I[1]:_0(E)}else{if(typeof E=="function")return i=!0,{exec:E};if(typeof E=="object")return i=!0,E;if(typeof E=="string"){if(E.length===1)return E;{let I=E.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),D=new RegExp(I);return _0(D)}}else throw Error("non exhaustive match")}})});let s,a,c,l,u;r("misc mapping",()=>{s=n.map(_=>_.tokenTypeIdx),a=n.map(_=>{let E=_.GROUP;if(E!==ct.SKIPPED){if(typeof E=="string")return E;if(E===void 0)return!1;throw Error("non exhaustive match")}}),c=n.map(_=>{let E=_.LONGER_ALT;if(E)return Array.isArray(E)?E.map(D=>n.indexOf(D)):[n.indexOf(E)]}),l=n.map(_=>_.PUSH_MODE),u=n.map(_=>Object.hasOwn(_,"POP_MODE"))});let f;r("Line Terminator Handling",()=>{let _=k0(e.lineTerminatorCharacters);f=n.map(E=>!1),e.positionTracking!=="onlyOffset"&&(f=n.map(E=>Object.hasOwn(E,"LINE_BREAKS")?!!E.LINE_BREAKS:I0(E,_)===!1&&Df(_,E.PATTERN)))});let d,p,m,g;r("Misc Mapping #2",()=>{d=n.map(A0),p=o.map(BO),m=n.reduce((_,E)=>{let I=E.GROUP;return typeof I=="string"&&I!==ct.SKIPPED&&(_[I]=[]),_},{}),g=o.map((_,E)=>({pattern:o[E],longerAlt:c[E],canLineTerminator:f[E],isCustom:d[E],short:p[E],group:a[E],push:l[E],pop:u[E],tokenTypeIdx:s[E],tokenType:n[E]}))});let v=!0,T=[];return e.safeMode||r("First Char Optimization",()=>{T=n.reduce((_,E,I)=>{if(typeof E.PATTERN=="string"){let D=E.PATTERN.charCodeAt(0),k=dn(D);ug(_,k,g[I])}else if(Array.isArray(E.START_CHARS_HINT)){let D;E.START_CHARS_HINT.forEach(k=>{let B=typeof k=="string"?k.charCodeAt(0):k,U=dn(B);D!==U&&(D=U,ug(_,U,g[I]))})}else if(E.PATTERN instanceof RegExp)if(E.PATTERN.unicode)v=!1,e.ensureOptimizations&&Rs(`${jc} Unable to analyze < ${E.PATTERN.toString()} > pattern.
58
58
  The regexp unicode flag is not currently supported by the regexp-to-ast library.
59
59
  This will disable the lexer's first char optimizations.
60
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let D=rR(_.PATTERN,e.ensureOptimizations);D.length===0&&(R=!1),D.forEach(C=>{eg(E,C,y[k])})}else e.ensureOptimizations&&ys(`${Fc} TokenType: <${_.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
60
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let D=T0(E.PATTERN,e.ensureOptimizations);D.length===0&&(v=!1),D.forEach(k=>{ug(_,k,g[I])})}else e.ensureOptimizations&&Rs(`${jc} TokenType: <${E.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
61
61
  This will disable the lexer's first char optimizations.
62
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),R=!1;return E},[])}),{emptyGroups:m,patternIdxToConfig:y,charCodeToPatternIdxToConfig:T,hasCustom:i,canBeOptimized:R}}function oR(t,e){let r=[],n=qC(t);r=r.concat(n.errors);let i=zC(n.valid),o=i.valid;return r=r.concat(i.errors),r=r.concat(WC(o)),r=r.concat(tO(o)),r=r.concat(rO(o,e)),r=r.concat(nO(o)),r}function WC(t){let e=[],r=t.filter(n=>n[mo]instanceof RegExp);return e=e.concat(YC(r)),e=e.concat(JC(r)),e=e.concat(QC(r)),e=e.concat(eO(r)),e=e.concat(KC(r)),e}function qC(t){let e=t.filter(i=>!Object.hasOwn(i,mo)),r=e.map(i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:st.MISSING_PATTERN,tokenTypes:[i]})),n=t.filter(i=>!e.includes(i));return{errors:r,valid:n}}function zC(t){let e=t.filter(i=>{let o=i[mo];return!(o instanceof RegExp)&&typeof o!="function"&&!Object.hasOwn(o,"exec")&&typeof o!="string"}),r=e.map(i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:st.INVALID_PATTERN,tokenTypes:[i]})),n=t.filter(i=>!e.includes(i));return{errors:r,valid:n}}var VC=/[^\\][$]/;function YC(t){class e extends an{constructor(){super(...arguments),this.found=!1}visitEndAnchor(o){this.found=!0}}return t.filter(i=>{let o=i.PATTERN;try{let s=Ts(o),a=new e;return a.visit(s),a.found}catch{return VC.test(o.source)}}).map(i=>({message:`Unexpected RegExp Anchor Error:
62
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),v=!1;return _},[])}),{emptyGroups:m,patternIdxToConfig:g,charCodeToPatternIdxToConfig:T,hasCustom:i,canBeOptimized:v}}function v0(t,e){let r=[],n=bO(t);r=r.concat(n.errors);let i=AO(n.valid),o=i.valid;return r=r.concat(i.errors),r=r.concat(wO(o)),r=r.concat(LO(o)),r=r.concat(DO(o,e)),r=r.concat($O(o)),r}function wO(t){let e=[],r=t.filter(n=>n[_o]instanceof RegExp);return e=e.concat(IO(r)),e=e.concat(PO(r)),e=e.concat(CO(r)),e=e.concat(OO(r)),e=e.concat(kO(r)),e}function bO(t){let e=t.filter(i=>!Object.hasOwn(i,_o)),r=e.map(i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:at.MISSING_PATTERN,tokenTypes:[i]})),n=t.filter(i=>!e.includes(i));return{errors:r,valid:n}}function AO(t){let e=t.filter(i=>{let o=i[_o];return!(o instanceof RegExp)&&typeof o!="function"&&!Object.hasOwn(o,"exec")&&typeof o!="string"}),r=e.map(i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:at.INVALID_PATTERN,tokenTypes:[i]})),n=t.filter(i=>!e.includes(i));return{errors:r,valid:n}}var SO=/[^\\][$]/;function IO(t){class e extends un{constructor(){super(...arguments),this.found=!1}visitEndAnchor(o){this.found=!0}}return t.filter(i=>{let o=i.PATTERN;try{let s=bs(o),a=new e;return a.visit(s),a.found}catch{return SO.test(o.source)}}).map(i=>({message:`Unexpected RegExp Anchor Error:
63
63
  Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
64
- See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:st.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function KC(t){return t.filter(n=>n.PATTERN.test("")).map(n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:st.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}var ZC=/[^\\[][\^]|^\^/;function JC(t){class e extends an{constructor(){super(...arguments),this.found=!1}visitStartAnchor(o){this.found=!0}}return t.filter(i=>{let o=i.PATTERN;try{let s=Ts(o),a=new e;return a.visit(s),a.found}catch{return ZC.test(o.source)}}).map(i=>({message:`Unexpected RegExp Anchor Error:
64
+ See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:at.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function kO(t){return t.filter(n=>n.PATTERN.test("")).map(n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:at.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}var NO=/[^\\[][\^]|^\^/;function PO(t){class e extends un{constructor(){super(...arguments),this.found=!1}visitStartAnchor(o){this.found=!0}}return t.filter(i=>{let o=i.PATTERN;try{let s=bs(o),a=new e;return a.visit(s),a.found}catch{return NO.test(o.source)}}).map(i=>({message:`Unexpected RegExp Anchor Error:
65
65
  Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
66
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:st.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function QC(t){return t.filter(n=>{let i=n[mo];return i instanceof RegExp&&(i.multiline||i.global)}).map(n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:st.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function eO(t){let e=[],r=t.map(o=>t.reduce((s,a)=>(o.PATTERN.source===a.PATTERN.source&&!e.includes(a)&&a.PATTERN!==at.NA&&(e.push(a),s.push(a)),s),[]));return r=r.filter(Boolean),r.filter(o=>o.length>1).map(o=>{let s=o.map(c=>c.name);return{message:`The same RegExp pattern ->${o[0].PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:st.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}})}function tO(t){return t.filter(n=>{if(!Object.hasOwn(n,"GROUP"))return!1;let i=n.GROUP;return i!==at.SKIPPED&&i!==at.NA&&typeof i!="string"}).map(n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:st.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function rO(t,e){return t.filter(i=>i.PUSH_MODE!==void 0&&!e.includes(i.PUSH_MODE)).map(i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:st.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function nO(t){let e=[],r=t.reduce((n,i,o)=>{let s=i.PATTERN;return s===at.NA||(typeof s=="string"?n.push({str:s,idx:o,tokenType:i}):s instanceof RegExp&&oO(s)&&n.push({str:s.source,idx:o,tokenType:i})),n},[]);return t.forEach((n,i)=>{r.forEach(({str:o,idx:s,tokenType:a})=>{if(i<s&&iO(o,n.PATTERN)){let c=`Token: ->${a.name}<- can never be matched.
66
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:at.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function CO(t){return t.filter(n=>{let i=n[_o];return i instanceof RegExp&&(i.multiline||i.global)}).map(n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:at.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function OO(t){let e=[],r=t.map(o=>t.reduce((s,a)=>(o.PATTERN.source===a.PATTERN.source&&!e.includes(a)&&a.PATTERN!==ct.NA&&(e.push(a),s.push(a)),s),[]));return r=r.filter(Boolean),r.filter(o=>o.length>1).map(o=>{let s=o.map(c=>c.name);return{message:`The same RegExp pattern ->${o[0].PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:at.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}})}function LO(t){return t.filter(n=>{if(!Object.hasOwn(n,"GROUP"))return!1;let i=n.GROUP;return i!==ct.SKIPPED&&i!==ct.NA&&typeof i!="string"}).map(n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:at.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function DO(t,e){return t.filter(i=>i.PUSH_MODE!==void 0&&!e.includes(i.PUSH_MODE)).map(i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:at.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function $O(t){let e=[],r=t.reduce((n,i,o)=>{let s=i.PATTERN;return s===ct.NA||(typeof s=="string"?n.push({str:s,idx:o,tokenType:i}):s instanceof RegExp&&FO(s)&&n.push({str:s.source,idx:o,tokenType:i})),n},[]);return t.forEach((n,i)=>{r.forEach(({str:o,idx:s,tokenType:a})=>{if(i<s&&MO(o,n.PATTERN)){let c=`Token: ->${a.name}<- can never be matched.
67
67
  Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition.
68
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:st.UNREACHABLE_PATTERN,tokenTypes:[n,a]})}})}),e}function iO(t,e){if(e instanceof RegExp){if(sO(e))return!1;let r=e.exec(t);return r!==null&&r.index===0}else{if(typeof e=="function")return e(t,0,[],{});if(Object.hasOwn(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function oO(t){return[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(r=>t.source.indexOf(r)!==-1)===void 0}function sO(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(t.source)}function nR(t){let e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function sR(t,e,r){let n=[];return Object.hasOwn(t,Es)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Es+`> property in its definition
69
- `,type:st.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(t,Sf)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Sf+`> property in its definition
70
- `,type:st.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(t,Sf)&&Object.hasOwn(t,Es)&&!Object.hasOwn(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${Es}: <${t.defaultMode}>which does not exist
71
- `,type:st.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(t,Sf)&&Object.keys(t.modes).forEach(i=>{let o=t.modes[i];o.forEach((s,a)=>{s===void 0?n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${i}> at index: <${a}>
72
- `,type:st.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Object.hasOwn(s,"LONGER_ALT")&&(Array.isArray(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT]).forEach(l=>{l!==void 0&&!o.includes(l)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${l.name}> on token <${s.name}> outside of mode <${i}>
73
- `,type:st.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),n}function aR(t,e,r){let n=[],i=!1,s=Object.values(t.modes||{}).flat().filter(Boolean).filter(c=>c[mo]!==at.NA),a=dR(r);return e&&s.forEach(c=>{let l=fR(c,a);if(l!==!1){let f={message:cO(c,l),type:l.issue,tokenType:c};n.push(f)}else Object.hasOwn(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(i=!0):If(a,c.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
68
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:at.UNREACHABLE_PATTERN,tokenTypes:[n,a]})}})}),e}function MO(t,e){if(e instanceof RegExp){if(UO(e))return!1;let r=e.exec(t);return r!==null&&r.index===0}else{if(typeof e=="function")return e(t,0,[],{});if(Object.hasOwn(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function FO(t){return[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(r=>t.source.indexOf(r)!==-1)===void 0}function UO(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(t.source)}function _0(t){let e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function R0(t,e,r){let n=[];return Object.hasOwn(t,Ss)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ss+`> property in its definition
69
+ `,type:at.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(t,$f)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+$f+`> property in its definition
70
+ `,type:at.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(t,$f)&&Object.hasOwn(t,Ss)&&!Object.hasOwn(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${Ss}: <${t.defaultMode}>which does not exist
71
+ `,type:at.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(t,$f)&&Object.keys(t.modes).forEach(i=>{let o=t.modes[i];o.forEach((s,a)=>{s===void 0?n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${i}> at index: <${a}>
72
+ `,type:at.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Object.hasOwn(s,"LONGER_ALT")&&(Array.isArray(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT]).forEach(l=>{l!==void 0&&!o.includes(l)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${l.name}> on token <${s.name}> outside of mode <${i}>
73
+ `,type:at.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),n}function w0(t,e,r){let n=[],i=!1,s=Object.values(t.modes||{}).flat().filter(Boolean).filter(c=>c[_o]!==ct.NA),a=k0(r);return e&&s.forEach(c=>{let l=I0(c,a);if(l!==!1){let f={message:GO(c,l),type:l.issue,tokenType:c};n.push(f)}else Object.hasOwn(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(i=!0):Df(a,c.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
74
74
  This Lexer has been defined to track line and column information,
75
75
  But none of the Token Types can be identified as matching a line terminator.
76
76
  See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
77
- for details.`,type:st.NO_LINE_BREAKS_FLAGS}),n}function cR(t){let e={};return Object.keys(t).forEach(n=>{let i=t[n];if(Array.isArray(i))e[n]=[];else throw Error("non exhaustive match")}),e}function lR(t){let e=t.PATTERN;if(e instanceof RegExp)return!1;if(typeof e=="function")return!0;if(Object.hasOwn(e,"exec"))return!0;if(typeof e=="string")return!1;throw Error("non exhaustive match")}function aO(t){return typeof t=="string"&&t.length===1?t.charCodeAt(0):!1}var uR={test:function(t){let e=t.length;for(let r=this.lastIndex;r<e;r++){let n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function fR(t,e){if(Object.hasOwn(t,"LINE_BREAKS"))return!1;if(t.PATTERN instanceof RegExp){try{If(e,t.PATTERN)}catch(r){return{issue:st.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(typeof t.PATTERN=="string")return!1;if(lR(t))return{issue:st.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function cO(t,e){if(e.issue===st.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
77
+ for details.`,type:at.NO_LINE_BREAKS_FLAGS}),n}function b0(t){let e={};return Object.keys(t).forEach(n=>{let i=t[n];if(Array.isArray(i))e[n]=[];else throw Error("non exhaustive match")}),e}function A0(t){let e=t.PATTERN;if(e instanceof RegExp)return!1;if(typeof e=="function")return!0;if(Object.hasOwn(e,"exec"))return!0;if(typeof e=="string")return!1;throw Error("non exhaustive match")}function BO(t){return typeof t=="string"&&t.length===1?t.charCodeAt(0):!1}var S0={test:function(t){let e=t.length;for(let r=this.lastIndex;r<e;r++){let n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function I0(t,e){if(Object.hasOwn(t,"LINE_BREAKS"))return!1;if(t.PATTERN instanceof RegExp){try{Df(e,t.PATTERN)}catch(r){return{issue:at.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(typeof t.PATTERN=="string")return!1;if(A0(t))return{issue:at.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function GO(t,e){if(e.issue===at.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
78
78
  The problem is in the <${t.name}> Token Type
79
79
  Root cause: ${e.errMsg}.
80
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===st.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
80
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===at.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
81
81
  The problem is in the <${t.name}> Token Type
82
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function dR(t){return t.map(r=>typeof r=="string"?r.charCodeAt(0):r)}function eg(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}var _s=256,vf=[];function ln(t){return t<_s?t:vf[t]}function lO(){if(vf.length===0){vf=new Array(65536);for(let t=0;t<65536;t++)vf[t]=t>255?255+~~(t/255):t}}function Cn(t,e){let r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function Rs(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}var pR=1,mR={};function On(t){let e=uO(t);fO(e),pO(e),dO(e),e.forEach(r=>{r.isParent=r.categoryMatches.length>0})}function uO(t){let e=[...t],r=t,n=!0;for(;n;){r=r.map(o=>o.CATEGORIES).flat().filter(Boolean);let i=r.filter(o=>!e.includes(o));e=e.concat(i),i.length===0?n=!1:r=i}return e}function fO(t){t.forEach(e=>{tg(e)||(mR[pR]=e,e.tokenTypeIdx=pR++),hR(e)&&!Array.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),hR(e)||(e.CATEGORIES=[]),hO(e)||(e.categoryMatches=[]),mO(e)||(e.categoryMatchesMap={})})}function dO(t){t.forEach(e=>{e.categoryMatches=[],Object.keys(e.categoryMatchesMap).forEach(r=>{e.categoryMatches.push(mR[r].tokenTypeIdx)})})}function pO(t){t.forEach(e=>{gR([],e)})}function gR(t,e){t.forEach(r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),e.CATEGORIES.forEach(r=>{let n=t.concat(e);n.includes(r)||gR(n,r)})}function tg(t){return Object.hasOwn(t??{},"tokenTypeIdx")}function hR(t){return Object.hasOwn(t??{},"CATEGORIES")}function hO(t){return Object.hasOwn(t??{},"categoryMatches")}function mO(t){return Object.hasOwn(t??{},"categoryMatchesMap")}function yR(t){return Object.hasOwn(t??{},"tokenTypeIdx")}var bs={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,o){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}};var st;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(st||(st={}));var Uc={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
83
- `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:bs,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Uc);var at=class{constructor(e,r=Uc){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,o)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${s}--> <${i}>`);let{time:a,value:c}=$c(o),l=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&l(`${s}<-- <${i}> time: ${a}ms`),this.traceInitIndent--,c}else return o()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
84
- a boolean 2nd argument is no longer supported`);this.config=Object.assign({},Uc,r);let n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,o=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Uc.lineTerminatorsPattern)this.config.lineTerminatorsPattern=uR;else if(this.config.lineTerminatorCharacters===Uc.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
85
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Array.isArray(e)?i={modes:{defaultMode:[...e]},defaultMode:Es}:(o=!1,i=Object.assign({},e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(sR(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(aR(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},Object.entries(i.modes).forEach(([a,c])=>{i.modes[a]=c.filter(l=>l!==void 0)});let s=Object.keys(i.modes);if(Object.entries(i.modes).forEach(([a,c])=>{this.TRACE_INIT(`Mode: <${a}> processing`,()=>{if(this.modes.push(a),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(oR(c,s))}),this.lexerDefinitionErrors.length===0){On(c);let l;this.TRACE_INIT("analyzeTokenTypes",()=>{l=iR(c,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[a]=l.patternIdxToConfig,this.charCodeToPatternIdxToConfig[a]=l.charCodeToPatternIdxToConfig,this.emptyGroups=Object.assign({},this.emptyGroups,l.emptyGroups),this.hasCustom=l.hasCustom||this.hasCustom,this.canModeBeOptimized[a]=l.canBeOptimized}})}),this.defaultMode=i.defaultMode,this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){let c=this.lexerDefinitionErrors.map(l=>l.message).join(`-----------------------
82
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function k0(t){return t.map(r=>typeof r=="string"?r.charCodeAt(0):r)}function ug(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}var As=256,Mf=[];function dn(t){return t<As?t:Mf[t]}function XO(){if(Mf.length===0){Mf=new Array(65536);for(let t=0;t<65536;t++)Mf[t]=t>255?255+~~(t/255):t}}function Dn(t,e){let r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function Is(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}var N0=1,C0={};function $n(t){let e=HO(t);jO(e),qO(e),zO(e),e.forEach(r=>{r.isParent=r.categoryMatches.length>0})}function HO(t){let e=[...t],r=t,n=!0;for(;n;){r=r.map(o=>o.CATEGORIES).flat().filter(Boolean);let i=r.filter(o=>!e.includes(o));e=e.concat(i),i.length===0?n=!1:r=i}return e}function jO(t){t.forEach(e=>{fg(e)||(C0[N0]=e,e.tokenTypeIdx=N0++),P0(e)&&!Array.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),P0(e)||(e.CATEGORIES=[]),WO(e)||(e.categoryMatches=[]),VO(e)||(e.categoryMatchesMap={})})}function zO(t){t.forEach(e=>{e.categoryMatches=[],Object.keys(e.categoryMatchesMap).forEach(r=>{e.categoryMatches.push(C0[r].tokenTypeIdx)})})}function qO(t){t.forEach(e=>{O0([],e)})}function O0(t,e){t.forEach(r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),e.CATEGORIES.forEach(r=>{let n=t.concat(e);n.includes(r)||O0(n,r)})}function fg(t){return Object.hasOwn(t??{},"tokenTypeIdx")}function P0(t){return Object.hasOwn(t??{},"CATEGORIES")}function WO(t){return Object.hasOwn(t??{},"categoryMatches")}function VO(t){return Object.hasOwn(t??{},"categoryMatchesMap")}function L0(t){return Object.hasOwn(t??{},"tokenTypeIdx")}var ks={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,o){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}};var at;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(at||(at={}));var zc={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
83
+ `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:ks,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(zc);var ct=class{constructor(e,r=zc){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,o)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${s}--> <${i}>`);let{time:a,value:c}=Xc(o),l=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&l(`${s}<-- <${i}> time: ${a}ms`),this.traceInitIndent--,c}else return o()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
84
+ a boolean 2nd argument is no longer supported`);this.config=Object.assign({},zc,r);let n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,o=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===zc.lineTerminatorsPattern)this.config.lineTerminatorsPattern=S0;else if(this.config.lineTerminatorCharacters===zc.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
85
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Array.isArray(e)?i={modes:{defaultMode:[...e]},defaultMode:Ss}:(o=!1,i=Object.assign({},e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(R0(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(w0(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},Object.entries(i.modes).forEach(([a,c])=>{i.modes[a]=c.filter(l=>l!==void 0)});let s=Object.keys(i.modes);if(Object.entries(i.modes).forEach(([a,c])=>{this.TRACE_INIT(`Mode: <${a}> processing`,()=>{if(this.modes.push(a),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(v0(c,s))}),this.lexerDefinitionErrors.length===0){$n(c);let l;this.TRACE_INIT("analyzeTokenTypes",()=>{l=E0(c,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[a]=l.patternIdxToConfig,this.charCodeToPatternIdxToConfig[a]=l.charCodeToPatternIdxToConfig,this.emptyGroups=Object.assign({},this.emptyGroups,l.emptyGroups),this.hasCustom=l.hasCustom||this.hasCustom,this.canModeBeOptimized[a]=l.canBeOptimized}})}),this.defaultMode=i.defaultMode,this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){let c=this.lexerDefinitionErrors.map(l=>l.message).join(`-----------------------
86
86
  `);throw new Error(`Errors detected in definition of Lexer:
87
- `+c)}this.lexerDefinitionWarning.forEach(a=>{Dc(a.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(o&&(this.handleModes=()=>{}),this.trackStartLines===!1&&(this.computeNewColumn=a=>a),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=()=>{}),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{let a=Object.entries(this.canModeBeOptimized).reduce((c,[l,u])=>(u===!1&&c.push(l),c),[]);if(r.ensureOptimizations&&a.length>0)throw Error(`Lexer Modes: < ${a.join(", ")} > cannot be optimized.
87
+ `+c)}this.lexerDefinitionWarning.forEach(a=>{Gc(a.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(o&&(this.handleModes=()=>{}),this.trackStartLines===!1&&(this.computeNewColumn=a=>a),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=()=>{}),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{let a=Object.entries(this.canModeBeOptimized).reduce((c,[l,u])=>(u===!1&&c.push(l),c),[]);if(r.ensureOptimizations&&a.length>0)throw Error(`Lexer Modes: < ${a.join(", ")} > cannot be optimized.
88
88
  Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
89
- Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{QE()}),this.TRACE_INIT("toFastProperties",()=>{Mc(this)})})}tokenize(e,r=this.defaultMode){if(this.lexerDefinitionErrors.length>0){let i=this.lexerDefinitionErrors.map(o=>o.message).join(`-----------------------
89
+ Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{g0()}),this.TRACE_INIT("toFastProperties",()=>{Hc(this)})})}tokenize(e,r=this.defaultMode){if(this.lexerDefinitionErrors.length>0){let i=this.lexerDefinitionErrors.map(o=>o.message).join(`-----------------------
90
90
  `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
91
- `+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,o,s,a,c,l,u,f,d,p,m,y,R,T,E=e,_=E.length,k=0,D=0,C=this.hasCustom?0:Math.floor(e.length/10),j=new Array(C),V=[],ie=this.trackStartLines?1:void 0,Ae=this.trackStartLines?1:void 0,O=cR(this.emptyGroups),w=this.trackStartLines,L=this.config.lineTerminatorsPattern,M=0,A=[],I=[],S=[],B=[];Object.freeze(B);let H=!1,$=Y=>{if(S.length===1&&Y.tokenType.PUSH_MODE===void 0){let pe=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Y);V.push({offset:Y.startOffset,line:Y.startLine,column:Y.startColumn,length:Y.image.length,message:pe})}else{S.pop();let pe=S.at(-1);A=this.patternIdxToConfig[pe],I=this.charCodeToPatternIdxToConfig[pe],M=A.length;let it=this.canModeBeOptimized[pe]&&this.config.safeMode===!1;I&&it?H=!0:H=!1}};function q(Y){S.push(Y),I=this.charCodeToPatternIdxToConfig[Y],A=this.patternIdxToConfig[Y],M=A.length,M=A.length;let pe=this.canModeBeOptimized[Y]&&this.config.safeMode===!1;I&&pe?H=!0:H=!1}q.call(this,r);let K,xe=this.config.recoveryEnabled;for(;k<_;){c=null,f=-1;let Y=E.charCodeAt(k),pe;if(H){let We=ln(Y),Ye=I[We];pe=Ye!==void 0?Ye:B}else pe=A;let it=pe.length;for(n=0;n<it;n++){K=pe[n];let We=K.pattern;l=null;let Ye=K.short;if(Ye!==!1?Y===Ye&&(f=1,c=We):K.isCustom===!0?(T=We.exec(E,k,j,O),T!==null?(c=T[0],f=c.length,T.payload!==void 0&&(l=T.payload)):c=null):(We.lastIndex=k,f=this.matchLength(We,e,k)),f!==-1){if(a=K.longerAlt,a!==void 0){c=e.substring(k,k+f);let G=a.length;for(o=0;o<G;o++){let Z=A[a[o]],ee=Z.pattern;if(u=null,Z.isCustom===!0?(T=ee.exec(E,k,j,O),T!==null?(s=T[0],T.payload!==void 0&&(u=T.payload)):s=null):(ee.lastIndex=k,s=this.match(ee,e,k)),s&&s.length>c.length){c=s,f=s.length,l=u,K=Z;break}}}break}}if(f!==-1){if(d=K.group,d!==void 0&&(c=c!==null?c:e.substring(k,k+f),p=K.tokenTypeIdx,m=this.createTokenInstance(c,k,p,K.tokenType,ie,Ae,f),this.handlePayload(m,l),d===!1?D=this.addToken(j,D,m):O[d].push(m)),w===!0&&K.canLineTerminator===!0){let We=0,Ye,G;L.lastIndex=0;do c=c!==null?c:e.substring(k,k+f),Ye=L.test(c),Ye===!0&&(G=L.lastIndex-1,We++);while(Ye===!0);We!==0?(ie=ie+We,Ae=f-G,this.updateTokenEndLineColumnLocation(m,d,G,We,ie,Ae,f)):Ae=this.computeNewColumn(Ae,f)}else Ae=this.computeNewColumn(Ae,f);k=k+f,this.handleModes(K,$,q,m)}else{let We=k,Ye=ie,G=Ae,Z=xe===!1;for(;Z===!1&&k<_;)for(k++,i=0;i<M;i++){let ee=A[i],P=ee.pattern,Te=ee.short;if(Te!==!1?E.charCodeAt(k)===Te&&(Z=!0):ee.isCustom===!0?Z=P.exec(E,k,j,O)!==null:(P.lastIndex=k,Z=P.exec(e)!==null),Z===!0)break}if(y=k-We,Ae=this.computeNewColumn(Ae,y),R=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(E,We,y,Ye,G,S.at(-1)),V.push({offset:We,line:Ye,column:G,length:y,message:R}),xe===!1)break}}return this.hasCustom||(j.length=D),{tokens:j,groups:O,errors:V}}handleModes(e,r,n,i){if(e.pop===!0){let o=e.push;r(i),o!==void 0&&n.call(this,o)}else e.push!==void 0&&n.call(this,e.push)}updateTokenEndLineColumnLocation(e,r,n,i,o,s,a){let c,l;r!==void 0&&(c=n===a-1,l=c?-1:0,i===1&&c===!0||(e.endLine=o+l,e.endColumn=s-1+-l))}computeNewColumn(e,r){return e+r}createOffsetOnlyToken(e,r,n,i){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:i}}createStartOnlyToken(e,r,n,i,o,s){return{image:e,startOffset:r,startLine:o,startColumn:s,tokenTypeIdx:n,tokenType:i}}createFullToken(e,r,n,i,o,s,a){return{image:e,startOffset:r,endOffset:r+a-1,startLine:o,endLine:o,startColumn:s,endColumn:s+a-1,tokenTypeIdx:n,tokenType:i}}addTokenUsingPush(e,r,n){return e.push(n),r}addTokenUsingMemberAccess(e,r,n){return e[r]=n,r++,r}handlePayloadNoCustom(e,r){}handlePayloadWithCustom(e,r){r!==null&&(e.payload=r)}match(e,r,n){return e.test(r)===!0?r.substring(n,e.lastIndex):null}matchLength(e,r,n){return e.test(r)===!0?e.lastIndex-n:-1}};at.SKIPPED="This marks a skipped Token pattern, this means each token identified by it will be consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";at.NA=/NOT_APPLICABLE/;function Ln(t){return rg(t)?t.LABEL:t.name}function rg(t){return typeof t.LABEL=="string"&&t.LABEL!==""}var gO="parent",xR="categories",TR="label",_R="group",ER="push_mode",RR="pop_mode",bR="longer_alt",wR="line_breaks",AR="start_chars_hint";function ci(t){return yO(t)}function yO(t){let e=t.pattern,r={};if(r.name=t.name,e!==void 0&&(r.PATTERN=e),Object.hasOwn(t,gO))throw`The parent property is no longer supported.
92
- See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Object.hasOwn(t,xR)&&(r.CATEGORIES=t[xR]),On([r]),Object.hasOwn(t,TR)&&(r.LABEL=t[TR]),Object.hasOwn(t,_R)&&(r.GROUP=t[_R]),Object.hasOwn(t,RR)&&(r.POP_MODE=t[RR]),Object.hasOwn(t,ER)&&(r.PUSH_MODE=t[ER]),Object.hasOwn(t,bR)&&(r.LONGER_ALT=t[bR]),Object.hasOwn(t,wR)&&(r.LINE_BREAKS=t[wR]),Object.hasOwn(t,AR)&&(r.START_CHARS_HINT=t[AR]),r}var Yt=ci({name:"EOF",pattern:at.NA});On([Yt]);function Dn(t,e,r,n,i,o,s,a){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:o,startColumn:s,endColumn:a,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function ws(t,e){return Cn(t,e)}var $n={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${rg(t)?`--> ${Ln(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){let o="Expecting: ",a=`
91
+ `+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,o,s,a,c,l,u,f,d,p,m,g,v,T,_=e,E=_.length,I=0,D=0,k=this.hasCustom?0:Math.floor(e.length/10),B=new Array(k),U=[],z=this.trackStartLines?1:void 0,le=this.trackStartLines?1:void 0,O=b0(this.emptyGroups),R=this.trackStartLines,L=this.config.lineTerminatorsPattern,$=0,b=[],A=[],S=[],M=[];Object.freeze(M);let X=!1,F=V=>{if(S.length===1&&V.tokenType.PUSH_MODE===void 0){let ee=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(V);U.push({offset:V.startOffset,line:V.startLine,column:V.startColumn,length:V.image.length,message:ee})}else{S.pop();let ee=S.at(-1);b=this.patternIdxToConfig[ee],A=this.charCodeToPatternIdxToConfig[ee],$=b.length;let Le=this.canModeBeOptimized[ee]&&this.config.safeMode===!1;A&&Le?X=!0:X=!1}};function W(V){S.push(V),A=this.charCodeToPatternIdxToConfig[V],b=this.patternIdxToConfig[V],$=b.length,$=b.length;let ee=this.canModeBeOptimized[V]&&this.config.safeMode===!1;A&&ee?X=!0:X=!1}W.call(this,r);let K,pe=this.config.recoveryEnabled;for(;I<E;){c=null,f=-1;let V=_.charCodeAt(I),ee;if(X){let Fe=dn(V),Ue=A[Fe];ee=Ue!==void 0?Ue:M}else ee=b;let Le=ee.length;for(n=0;n<Le;n++){K=ee[n];let Fe=K.pattern;l=null;let Ue=K.short;if(Ue!==!1?V===Ue&&(f=1,c=Fe):K.isCustom===!0?(T=Fe.exec(_,I,B,O),T!==null?(c=T[0],f=c.length,T.payload!==void 0&&(l=T.payload)):c=null):(Fe.lastIndex=I,f=this.matchLength(Fe,e,I)),f!==-1){if(a=K.longerAlt,a!==void 0){c=e.substring(I,I+f);let q=a.length;for(o=0;o<q;o++){let J=b[a[o]],te=J.pattern;if(u=null,J.isCustom===!0?(T=te.exec(_,I,B,O),T!==null?(s=T[0],T.payload!==void 0&&(u=T.payload)):s=null):(te.lastIndex=I,s=this.match(te,e,I)),s&&s.length>c.length){c=s,f=s.length,l=u,K=J;break}}}break}}if(f!==-1){if(d=K.group,d!==void 0&&(c=c!==null?c:e.substring(I,I+f),p=K.tokenTypeIdx,m=this.createTokenInstance(c,I,p,K.tokenType,z,le,f),this.handlePayload(m,l),d===!1?D=this.addToken(B,D,m):O[d].push(m)),R===!0&&K.canLineTerminator===!0){let Fe=0,Ue,q;L.lastIndex=0;do c=c!==null?c:e.substring(I,I+f),Ue=L.test(c),Ue===!0&&(q=L.lastIndex-1,Fe++);while(Ue===!0);Fe!==0?(z=z+Fe,le=f-q,this.updateTokenEndLineColumnLocation(m,d,q,Fe,z,le,f)):le=this.computeNewColumn(le,f)}else le=this.computeNewColumn(le,f);I=I+f,this.handleModes(K,F,W,m)}else{let Fe=I,Ue=z,q=le,J=pe===!1;for(;J===!1&&I<E;)for(I++,i=0;i<$;i++){let te=b[i],P=te.pattern,ge=te.short;if(ge!==!1?_.charCodeAt(I)===ge&&(J=!0):te.isCustom===!0?J=P.exec(_,I,B,O)!==null:(P.lastIndex=I,J=P.exec(e)!==null),J===!0)break}if(g=I-Fe,le=this.computeNewColumn(le,g),v=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(_,Fe,g,Ue,q,S.at(-1)),U.push({offset:Fe,line:Ue,column:q,length:g,message:v}),pe===!1)break}}return this.hasCustom||(B.length=D),{tokens:B,groups:O,errors:U}}handleModes(e,r,n,i){if(e.pop===!0){let o=e.push;r(i),o!==void 0&&n.call(this,o)}else e.push!==void 0&&n.call(this,e.push)}updateTokenEndLineColumnLocation(e,r,n,i,o,s,a){let c,l;r!==void 0&&(c=n===a-1,l=c?-1:0,i===1&&c===!0||(e.endLine=o+l,e.endColumn=s-1+-l))}computeNewColumn(e,r){return e+r}createOffsetOnlyToken(e,r,n,i){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:i}}createStartOnlyToken(e,r,n,i,o,s){return{image:e,startOffset:r,startLine:o,startColumn:s,tokenTypeIdx:n,tokenType:i}}createFullToken(e,r,n,i,o,s,a){return{image:e,startOffset:r,endOffset:r+a-1,startLine:o,endLine:o,startColumn:s,endColumn:s+a-1,tokenTypeIdx:n,tokenType:i}}addTokenUsingPush(e,r,n){return e.push(n),r}addTokenUsingMemberAccess(e,r,n){return e[r]=n,r++,r}handlePayloadNoCustom(e,r){}handlePayloadWithCustom(e,r){r!==null&&(e.payload=r)}match(e,r,n){return e.test(r)===!0?r.substring(n,e.lastIndex):null}matchLength(e,r,n){return e.test(r)===!0?e.lastIndex-n:-1}};ct.SKIPPED="This marks a skipped Token pattern, this means each token identified by it will be consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";ct.NA=/NOT_APPLICABLE/;function Mn(t){return dg(t)?t.LABEL:t.name}function dg(t){return typeof t.LABEL=="string"&&t.LABEL!==""}var YO="parent",D0="categories",$0="label",M0="group",F0="push_mode",U0="pop_mode",B0="longer_alt",G0="line_breaks",X0="start_chars_hint";function pi(t){return KO(t)}function KO(t){let e=t.pattern,r={};if(r.name=t.name,e!==void 0&&(r.PATTERN=e),Object.hasOwn(t,YO))throw`The parent property is no longer supported.
92
+ See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Object.hasOwn(t,D0)&&(r.CATEGORIES=t[D0]),$n([r]),Object.hasOwn(t,$0)&&(r.LABEL=t[$0]),Object.hasOwn(t,M0)&&(r.GROUP=t[M0]),Object.hasOwn(t,U0)&&(r.POP_MODE=t[U0]),Object.hasOwn(t,F0)&&(r.PUSH_MODE=t[F0]),Object.hasOwn(t,B0)&&(r.LONGER_ALT=t[B0]),Object.hasOwn(t,G0)&&(r.LINE_BREAKS=t[G0]),Object.hasOwn(t,X0)&&(r.START_CHARS_HINT=t[X0]),r}var Kt=pi({name:"EOF",pattern:ct.NA});$n([Kt]);function Fn(t,e,r,n,i,o,s,a){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:o,startColumn:s,endColumn:a,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function Ns(t,e){return Dn(t,e)}var Un={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${dg(t)?`--> ${Mn(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){let o="Expecting: ",a=`
93
93
  but found: '`+e[0].image+"'";if(n)return o+n+a;{let f=`one of these possible Token sequences:
94
- ${t.reduce((d,p)=>d.concat(p),[]).map(d=>`[${d.map(p=>Ln(p)).join(", ")}]`).map((d,p)=>` ${p+1}. ${d}`).join(`
94
+ ${t.reduce((d,p)=>d.concat(p),[]).map(d=>`[${d.map(p=>Mn(p)).join(", ")}]`).map((d,p)=>` ${p+1}. ${d}`).join(`
95
95
  `)}`;return o+f+a}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){let i="Expecting: ",s=`
96
96
  but found: '`+e[0].image+"'";if(r)return i+r+s;{let c=`expecting at least one iteration which starts with one of these possible Token sequences::
97
- <${t.map(l=>`[${l.map(u=>Ln(u)).join(",")}]`).join(" ,")}>`;return i+c+s}}};Object.freeze($n);var IR={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
98
- inside top level rule: ->`+t.name+"<-"}},Ur={buildDuplicateFoundError(t,e){function r(u){return u instanceof ge?u.terminalType.name:u instanceof Me?u.nonTerminalName:""}let n=t.name,i=e[0],o=i.idx,s=tr(i),a=r(i),c=o>0,l=`->${s}${c?o:""}<- ${a?`with argument: ->${a}<-`:""}
97
+ <${t.map(l=>`[${l.map(u=>Mn(u)).join(",")}]`).join(" ,")}>`;return i+c+s}}};Object.freeze(Un);var H0={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
98
+ inside top level rule: ->`+t.name+"<-"}},Gr={buildDuplicateFoundError(t,e){function r(u){return u instanceof _e?u.terminalType.name:u instanceof Ge?u.nonTerminalName:""}let n=t.name,i=e[0],o=i.idx,s=rr(i),a=r(i),c=o>0,l=`->${s}${c?o:""}<- ${a?`with argument: ->${a}<-`:""}
99
99
  appears more than once (${e.length} times) in the top level rule: ->${n}<-.
100
100
  For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
101
101
  `;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,`
@@ -103,16 +103,16 @@ inside top level rule: ->`+t.name+"<-"}},Ur={buildDuplicateFoundError(t,e){funct
103
103
  The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
104
104
  To resolve this make sure each Terminal and Non-Terminal names are unique
105
105
  This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
106
- and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){let e=t.prefixPath.map(i=>Ln(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
106
+ and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){let e=t.prefixPath.map(i=>Mn(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
107
107
  in <OR${r}> inside <${t.topLevelRule.name}> Rule,
108
108
  <${e}> may appears as a prefix path in all these alternatives.
109
109
  See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
110
110
  For Further details.`},buildAlternationAmbiguityError(t){let e=t.alternation.idx===0?"":t.alternation.idx,r=t.prefixPath.length===0,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${e}> inside <${t.topLevelRule.name}> Rule,
111
111
  `;if(r)n+=`These alternatives are all empty (match no tokens), making them indistinguishable.
112
112
  Only the last alternative may be empty.
113
- `;else{let i=t.prefixPath.map(o=>Ln(o)).join(", ");n+=`<${i}> may appears as a prefix path in all these alternatives.
113
+ `;else{let i=t.prefixPath.map(o=>Mn(o)).join(", ");n+=`<${i}> may appears as a prefix path in all these alternatives.
114
114
  `}return n+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
115
- For Further details.`,n},buildEmptyRepetitionError(t){let e=tr(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
115
+ For Further details.`,n},buildEmptyRepetitionError(t){let e=rr(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
116
116
  This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
117
117
  Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
118
118
  <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
@@ -121,44 +121,44 @@ rule: <${e}> can be invoked from itself (directly or indirectly)
121
121
  without consuming any Tokens. The grammar path that causes this is:
122
122
  ${n}
123
123
  To fix this refactor your grammar to remove the left recursion.
124
- see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof zt?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function SR(t,e){let r=new ng(t,e);return r.resolveRefs(),r.errors}var ng=class extends Vt{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){Object.values(this.nameToTopRule).forEach(e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:At.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}};var ig=class extends Pn{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=[...this.path.ruleStack].reverse(),this.occurrenceStack=[...this.path.occurrenceStack].reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){this.ruleStack.length===0?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},kf=class extends ig{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let i=r.concat(n),o=new Ke({definition:i});this.possibleTokTypes=ho(o),this.found=!0}}},As=class extends Pn{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},Nf=class extends As{walkMany(e,r,n){if(e.idx===this.occurrence){let i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof ge&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},Bc=class extends As{walkManySep(e,r,n){if(e.idx===this.occurrence){let i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof ge&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},Pf=class extends As{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){let i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof ge&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},Xc=class extends As{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){let i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof ge&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}};function Cf(t,e,r=[]){r=[...r];let n=[],i=0;function o(a){return a.concat(t.slice(i+1))}function s(a){let c=Cf(o(a),e,r);return n.concat(c)}for(;r.length<e&&i<t.length;){let a=t[i];if(a instanceof Ke)return s(a.definition);if(a instanceof Me)return s(a.definition);if(a instanceof Fe)n=s(a.definition);else if(a instanceof Ze){let c=a.definition.concat([new be({definition:a.definition})]);return s(c)}else if(a instanceof Je){let c=[new Ke({definition:a.definition}),new be({definition:[new ge({terminalType:a.separator})].concat(a.definition)})];return s(c)}else if(a instanceof qe){let c=a.definition.concat([new be({definition:[new ge({terminalType:a.separator})].concat(a.definition)})]);n=s(c)}else if(a instanceof be){let c=a.definition.concat([new be({definition:a.definition})]);n=s(c)}else{if(a instanceof ze)return a.definition.forEach(c=>{c.definition.length!==0&&(n=s(c.definition))}),n;if(a instanceof ge)r.push(a.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:t.slice(i)}),n}function vR(t,e,r,n){let i="EXIT_NONE_TERMINAL",o=[i],s="EXIT_ALTERNATIVE",a=!1,c=e.length,l=c-n-1,u=[],f=[];for(f.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});f.length!==0;){let d=f.pop();if(d===s){a&&f.at(-1).idx<=l&&f.pop();continue}let p=d.def,m=d.idx,y=d.ruleStack,R=d.occurrenceStack;if(p.length===0)continue;let T=p[0];if(T===i){let E={idx:m,def:p.slice(1),ruleStack:y.slice(0,-1),occurrenceStack:R.slice(0,-1)};f.push(E)}else if(T instanceof ge)if(m<c-1){let E=m+1,_=e[E];if(r(_,T.terminalType)){let k={idx:E,def:p.slice(1),ruleStack:y,occurrenceStack:R};f.push(k)}}else if(m===c-1)u.push({nextTokenType:T.terminalType,nextTokenOccurrence:T.idx,ruleStack:y,occurrenceStack:R}),a=!0;else throw Error("non exhaustive match");else if(T instanceof Me){let E=[...y];E.push(T.nonTerminalName);let _=[...R];_.push(T.idx);let k={idx:m,def:T.definition.concat(o,p.slice(1)),ruleStack:E,occurrenceStack:_};f.push(k)}else if(T instanceof Fe){let E={idx:m,def:p.slice(1),ruleStack:y,occurrenceStack:R};f.push(E),f.push(s);let _={idx:m,def:T.definition.concat(p.slice(1)),ruleStack:y,occurrenceStack:R};f.push(_)}else if(T instanceof Ze){let E=new be({definition:T.definition,idx:T.idx}),_=T.definition.concat([E],p.slice(1)),k={idx:m,def:_,ruleStack:y,occurrenceStack:R};f.push(k)}else if(T instanceof Je){let E=new ge({terminalType:T.separator}),_=new be({definition:[E].concat(T.definition),idx:T.idx}),k=T.definition.concat([_],p.slice(1)),D={idx:m,def:k,ruleStack:y,occurrenceStack:R};f.push(D)}else if(T instanceof qe){let E={idx:m,def:p.slice(1),ruleStack:y,occurrenceStack:R};f.push(E),f.push(s);let _=new ge({terminalType:T.separator}),k=new be({definition:[_].concat(T.definition),idx:T.idx}),D=T.definition.concat([k],p.slice(1)),C={idx:m,def:D,ruleStack:y,occurrenceStack:R};f.push(C)}else if(T instanceof be){let E={idx:m,def:p.slice(1),ruleStack:y,occurrenceStack:R};f.push(E),f.push(s);let _=new be({definition:T.definition,idx:T.idx}),k=T.definition.concat([_],p.slice(1)),D={idx:m,def:k,ruleStack:y,occurrenceStack:R};f.push(D)}else if(T instanceof ze)for(let E=T.definition.length-1;E>=0;E--){let _=T.definition[E],k={idx:m,def:_.definition.concat(p.slice(1)),ruleStack:y,occurrenceStack:R};f.push(k),f.push(s)}else if(T instanceof Ke)f.push({idx:m,def:T.definition.concat(p.slice(1)),ruleStack:y,occurrenceStack:R});else if(T instanceof zt)f.push(xO(T,m,y,R));else throw Error("non exhaustive match")}return u}function xO(t,e,r,n){let i=[...r];i.push(t.name);let o=[...n];return o.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:o}}var ct;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(ct||(ct={}));function Gc(t){if(t instanceof Fe||t==="Option")return ct.OPTION;if(t instanceof be||t==="Repetition")return ct.REPETITION;if(t instanceof Ze||t==="RepetitionMandatory")return ct.REPETITION_MANDATORY;if(t instanceof Je||t==="RepetitionMandatoryWithSeparator")return ct.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof qe||t==="RepetitionWithSeparator")return ct.REPETITION_WITH_SEPARATOR;if(t instanceof ze||t==="Alternation")return ct.ALTERNATION;throw Error("non exhaustive match")}function Lf(t){let{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,o=Gc(n);return o===ct.ALTERNATION?Is(e,r,i):Ss(e,r,o,i)}function NR(t,e,r,n,i,o){let s=Is(t,e,r),a=$R(s)?Rs:Cn;return o(s,n,a,i)}function PR(t,e,r,n,i,o){let s=Ss(t,e,i,r),a=$R(s)?Rs:Cn;return o(s[0],a,n)}function CR(t,e,r,n){let i=t.length,o=t.every(s=>s.every(a=>a.length===1));if(e)return function(s){let a=s.map(c=>c.GATE);for(let c=0;c<i;c++){let l=t[c],u=l.length,f=a[c];if(!(f!==void 0&&f.call(this)===!1))e:for(let d=0;d<u;d++){let p=l[d],m=p.length;for(let y=0;y<m;y++){let R=this.LA_FAST(y+1);if(r(R,p[y])===!1)continue e}return c}}};if(o&&!n){let a=t.map(c=>c.flat()).reduce((c,l,u)=>(l.forEach(f=>{f.tokenTypeIdx in c||(c[f.tokenTypeIdx]=u),f.categoryMatches.forEach(d=>{Object.hasOwn(c,d)||(c[d]=u)})}),c),{});return function(){let c=this.LA_FAST(1);return a[c.tokenTypeIdx]}}else return function(){for(let s=0;s<i;s++){let a=t[s],c=a.length;e:for(let l=0;l<c;l++){let u=a[l],f=u.length;for(let d=0;d<f;d++){let p=this.LA_FAST(d+1);if(r(p,u[d])===!1)continue e}return s}}}}function OR(t,e,r){let n=t.every(o=>o.length===1),i=t.length;if(n&&!r){let o=t.flat();if(o.length===1&&o[0].categoryMatches.length===0){let a=o[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===a}}else{let s=o.reduce((a,c,l)=>(a[c.tokenTypeIdx]=!0,c.categoryMatches.forEach(u=>{a[u]=!0}),a),[]);return function(){let a=this.LA_FAST(1);return s[a.tokenTypeIdx]===!0}}}else return function(){e:for(let o=0;o<i;o++){let s=t[o],a=s.length;for(let c=0;c<a;c++){let l=this.LA_FAST(c+1);if(e(l,s[c])===!1)continue e}return!0}return!1}}var sg=class extends Pn{constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,ct.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,ct.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,ct.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,ct.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,ct.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}},Of=class extends Vt{constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,ct.OPTION)}visitRepetition(e){this.checkIsTarget(e,ct.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,ct.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,ct.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,ct.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,ct.ALTERNATION)}};function kR(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function og(t){let e=[""];for(let r=0;r<t.length;r++){let n=t[r],i=[];for(let o=0;o<e.length;o++){let s=e[o];i.push(s+"_"+n.tokenTypeIdx);for(let a=0;a<n.categoryMatches.length;a++){let c="_"+n.categoryMatches[a];i.push(s+c)}}e=i}return e}function TO(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;let i=t[n];for(let o=0;o<e.length;o++){let s=e[o];if(i[s]===!0)return!1}}return!0}function LR(t,e){let r=t.map(s=>Cf([s],1)),n=kR(r.length),i=r.map(s=>{let a={};return s.forEach(c=>{og(c.partialPath).forEach(u=>{a[u]=!0})}),a}),o=r;for(let s=1;s<=e;s++){let a=o;o=kR(a.length);for(let c=0;c<a.length;c++){let l=a[c];for(let u=0;u<l.length;u++){let f=l[u].partialPath,d=l[u].suffixDef,p=og(f);if(TO(i,p,c)||d.length===0||f.length===e){let y=n[c];if(Df(y,f)===!1){y.push(f);for(let R=0;R<p.length;R++){let T=p[R];i[c][T]=!0}}}else{let y=Cf(d,s+1,f);o[c]=o[c].concat(y),y.forEach(R=>{og(R.partialPath).forEach(E=>{i[c][E]=!0})})}}}}return n}function Is(t,e,r,n){let i=new Of(t,ct.ALTERNATION,n);return e.accept(i),LR(i.result,r)}function Ss(t,e,r,n){let i=new Of(t,r);e.accept(i);let o=i.result,a=new sg(e,t,r).startWalking(),c=new Ke({definition:o}),l=new Ke({definition:a});return LR([c,l],n)}function Df(t,e){e:for(let r=0;r<t.length;r++){let n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){let o=e[i],s=n[i];if((o===s||s.categoryMatchesMap[o.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function DR(t,e){return t.length<e.length&&t.every((r,n)=>{let i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function $R(t){return t.every(e=>e.every(r=>r.every(n=>n.categoryMatches.length===0)))}function MR(t){return t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName}).map(r=>Object.assign({type:At.CUSTOM_LOOKAHEAD_VALIDATION},r))}function FR(t,e,r,n){let i=t.flatMap(c=>_O(c,r)),o=IO(t,e,r),s=t.flatMap(c=>bO(c,r)),a=t.flatMap(c=>RO(c,t,n,r));return i.concat(o,s,a)}function _O(t,e){let r=new ag;t.accept(r);let n=r.allProductions,i=Object.groupBy(n,EO),o=Object.fromEntries(Object.entries(i).filter(([a,c])=>c.length>1));return Object.values(o).map(a=>{let c=a[0],l=e.buildDuplicateFoundError(t,a),u=tr(c),f={message:l,type:At.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:u,occurrence:c.idx},d=UR(c);return d&&(f.parameter=d),f})}function EO(t){return`${tr(t)}_#_${t.idx}_#_${UR(t)}`}function UR(t){return t instanceof ge?t.terminalType.name:t instanceof Me?t.nonTerminalName:""}var ag=class extends Vt{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function RO(t,e,r,n){let i=[];if(e.reduce((s,a)=>a.name===t.name?s+1:s,0)>1){let s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:At.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function BR(t,e,r){let n=[],i;return e.includes(t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:At.INVALID_RULE_OVERRIDE,ruleName:t})),n}function lg(t,e,r,n=[]){let i=[],o=$f(e.definition);if(o.length===0)return[];{let s=t.name;o.includes(t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:At.LEFT_RECURSION,ruleName:s});let c=n.concat([t]),u=o.filter(f=>!c.includes(f)).flatMap(f=>{let d=[...n];return d.push(f),lg(t,f,r,d)});return i.concat(u)}}function $f(t){let e=[];if(t.length===0)return e;let r=t[0];if(r instanceof Me)e.push(r.referencedRule);else if(r instanceof Ke||r instanceof Fe||r instanceof Ze||r instanceof Je||r instanceof qe||r instanceof be)e=e.concat($f(r.definition));else if(r instanceof ze)e=r.definition.map(o=>$f(o.definition)).flat();else if(!(r instanceof ge))throw Error("non exhaustive match");let n=po(r),i=t.length>1;if(n&&i){let o=t.slice(1);return e.concat($f(o))}else return e}var Hc=class extends Vt{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function XR(t,e){let r=new Hc;return t.accept(r),r.alternations.flatMap(o=>o.definition.slice(0,-1).flatMap((a,c)=>vR([a],[],Cn,1).length===0?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:o,emptyChoiceIdx:c}),type:At.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:o.idx,alternative:c+1}]:[]))}function GR(t,e,r){let n=new Hc;t.accept(n);let i=n.alternations;return i=i.filter(s=>s.ignoreAmbiguities!==!0),i.flatMap(s=>{let a=s.idx,c=s.maxLookahead||e,l=Is(a,t,c,s),u=wO(l,s,t,r),f=AO(l,s,t,r);return u.concat(f)})}var cg=class extends Vt{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function bO(t,e){let r=new Hc;return t.accept(r),r.alternations.flatMap(o=>o.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:o}),type:At.TOO_MANY_ALTS,ruleName:t.name,occurrence:o.idx}]:[])}function HR(t,e,r){let n=[];return t.forEach(i=>{let o=new cg;i.accept(o),o.allProductions.forEach(a=>{let c=Gc(a),l=a.maxLookahead||e,u=a.idx;if(Ss(u,i,c,l)[0].flat().length===0){let p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:a});n.push({message:p,type:At.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function wO(t,e,r,n){let i=[];return t.reduce((a,c,l)=>(e.definition[l].ignoreAmbiguities===!0||c.forEach(u=>{let f=[l];t.forEach((d,p)=>{l!==p&&Df(d,u)&&e.definition[p].ignoreAmbiguities!==!0&&f.push(p)}),f.length>1&&!Df(i,u)&&(i.push(u),a.push({alts:f,path:u}))}),a),[]).map(a=>{let c=a.alts.map(u=>u+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:c,prefixPath:a.path}),type:At.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:a.alts}})}function AO(t,e,r,n){let i=t.reduce((s,a,c)=>{let l=a.map(u=>({idx:c,path:u}));return s.concat(l)},[]);return i.flatMap(s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];let c=s.idx,l=s.path;return i.filter(d=>e.definition[d.idx].ignoreAmbiguities!==!0&&d.idx<c&&DR(d.path,l)).map(d=>{let p=[d.idx+1,c+1],m=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:p,prefixPath:d.path}),type:At.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:m,alternatives:p}})})}function IO(t,e,r){let n=[],i=e.map(o=>o.name);return t.forEach(o=>{let s=o.name;if(i.includes(s)){let a=r.buildNamespaceConflictError(o);n.push({message:a,type:At.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function jR(t){let e=Object.assign({errMsgProvider:IR},t),r={};return t.rules.forEach(n=>{r[n.name]=n}),SR(r,e.errMsgProvider)}function WR(t){var e;let r=(e=t.errMsgProvider)!==null&&e!==void 0?e:Ur;return FR(t.rules,t.tokenTypes,r,t.grammarName)}var qR="MismatchedTokenException",zR="NoViableAltException",VR="EarlyExitException",YR="NotAllInputParsedException",KR=[qR,zR,VR,YR];Object.freeze(KR);function li(t){return KR.includes(t.name)}var vs=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},go=class extends vs{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=qR}},jc=class extends vs{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=zR}},Wc=class extends vs{constructor(e,r){super(e,r),this.name=YR}},qc=class extends vs{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=VR}};var ug={},dg="InRuleRecoveryException",fg=class extends Error{constructor(e){super(e),this.name=dg}},Mf=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:Kt.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=SO)}getTokenToInsert(e){let r=Dn(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){let o=this.findReSyncTokenType(),s=this.exportLexerState(),a=[],c=!1,l=this.LA_FAST(1),u=this.LA_FAST(1),f=()=>{let d=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:l,previous:d,ruleName:this.getCurrRuleFullName()}),m=new go(p,l,this.LA(0));m.resyncedTokens=a.slice(0,-1),this.SAVE_ERROR(m)};for(;!c;)if(this.tokenMatcher(u,i)){f();return}else if(n.call(this)){f(),e.apply(this,r);return}else this.tokenMatcher(u,o)?c=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,a));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA_FAST(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getNextPossibleTokenTypes(e){let r=e.ruleStack[0],i=this.getGAstProductions()[r];return new kf(i,e).startWalking()}getFollowsForInRuleRecovery(e,r){let n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new fg("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||r.length===0)return!1;let n=this.LA_FAST(1);return r.find(o=>this.tokenMatcher(n,o))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let r=this.getCurrFollowKey();return this.getFollowSetFromFollowKey(r).includes(e)}findReSyncTokenType(){let e=this.flattenFollowSet(),r=this.LA_FAST(1),n=2;for(;;){let i=e.find(o=>ws(r,o));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK_IDX===0)return ug;let e=this.currRuleShortName,r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK,n=this.RULE_STACK_IDX+1,i=new Array(n);for(let o=0;o<n;o++)o===0?i[o]=ug:i[o]={ruleName:this.shortRuleNameToFullName(e[o]),idxInCallingRule:r[o],inRule:this.shortRuleNameToFullName(e[o-1])};return i}flattenFollowSet(){return this.buildFullFollowKeyStack().map(r=>this.getFollowSetFromFollowKey(r)).flat()}getFollowSetFromFollowKey(e){if(e===ug)return[Yt];let r=e.ruleName+e.idxInCallingRule+bf+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,Yt)||r.push(e),r}reSyncTo(e){let r=[],n=this.LA_FAST(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return r.slice(0,-1)}attemptInRepetitionRecovery(e,r,n,i,o,s,a){}getCurrentGrammarPath(e,r){let n=this.getHumanReadableRuleStack(),i=this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){let e=this.RULE_STACK_IDX+1,r=new Array(e);for(let n=0;n<e;n++)r[n]=this.shortRuleNameToFullName(this.RULE_STACK[n]);return r}};function SO(t,e,r,n,i,o,s){let a=this.getKeyForAutomaticLookahead(n,i),c=this.firstAfterRepMap[a];if(c===void 0){let d=this.getCurrRuleFullName(),p=this.getGAstProductions()[d];c=new o(p,i).startWalking(),this.firstAfterRepMap[a]=c}let l=c.token,u=c.occurrence,f=c.isEndOfRule;this.RULE_STACK_IDX===0&&f&&l===void 0&&(l=Yt,u=1),!(l===void 0||u===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,u,s)&&this.tryInRepetitionRecovery(t,e,r,l)}function Ff(t,e,r){return r|e|t}var Mn=class{constructor(e){var r;this.maxLookahead=(r=e?.maxLookahead)!==null&&r!==void 0?r:Kt.maxLookahead}validate(e){let r=this.validateNoLeftRecursion(e.rules);if(r.length===0){let n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),o=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...o]}return r}validateNoLeftRecursion(e){return e.flatMap(r=>lg(r,r,Ur))}validateEmptyOrAlternatives(e){return e.flatMap(r=>XR(r,Ur))}validateAmbiguousAlternationAlternatives(e,r){return e.flatMap(n=>GR(n,r,Ur))}validateSomeNonEmptyLookaheadPath(e,r){return HR(e,r,Ur)}buildLookaheadForAlternation(e){return NR(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,CR)}buildLookaheadForOptional(e){return PR(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Gc(e.prodType),OR)}};var Bf=class{initLooksAhead(e){this.dynamicTokensEnabled=Object.hasOwn(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Kt.dynamicTokensEnabled,this.maxLookahead=Object.hasOwn(e,"maxLookahead")?e.maxLookahead:Kt.maxLookahead,this.lookaheadStrategy=Object.hasOwn(e,"lookaheadStrategy")?e.lookaheadStrategy:new Mn({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){e.forEach(r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:o,repetitionMandatory:s,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:c}=vO(r);n.forEach(l=>{let u=l.idx===0?"":l.idx;this.TRACE_INIT(`${tr(l)}${u}`,()=>{let f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:r,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),d=Ff(this.fullRuleNameToShort[r.name],256,l.idx);this.setLaFuncCache(d,f)})}),i.forEach(l=>{this.computeLookaheadFunc(r,l.idx,768,"Repetition",l.maxLookahead,tr(l))}),o.forEach(l=>{this.computeLookaheadFunc(r,l.idx,512,"Option",l.maxLookahead,tr(l))}),s.forEach(l=>{this.computeLookaheadFunc(r,l.idx,1024,"RepetitionMandatory",l.maxLookahead,tr(l))}),a.forEach(l=>{this.computeLookaheadFunc(r,l.idx,1536,"RepetitionMandatoryWithSeparator",l.maxLookahead,tr(l))}),c.forEach(l=>{this.computeLookaheadFunc(r,l.idx,1280,"RepetitionWithSeparator",l.maxLookahead,tr(l))})})})}computeLookaheadFunc(e,r,n,i,o,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{let a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:o||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),c=Ff(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(c,a)})}getKeyForAutomaticLookahead(e,r){return Ff(this.currRuleShortName,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},pg=class extends Vt{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},Uf=new pg;function vO(t){Uf.reset(),t.accept(Uf);let e=Uf.dslMethods;return Uf.reset(),e}function gg(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function yg(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function ZR(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function JR(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}var kO="name";function xg(t,e){Object.defineProperty(t,kO,{enumerable:!1,configurable:!0,writable:!1,value:e})}function NO(t,e){let r=Object.keys(t),n=r.length;for(let i=0;i<n;i++){let o=r[i],s=t[o],a=s.length;for(let c=0;c<a;c++){let l=s[c];l.tokenTypeIdx===void 0&&this[l.name](l.children,e)}}}function QR(t,e){let r=function(){};xg(r,t+"BaseSemantics");let n={visit:function(i,o){if(Array.isArray(i)&&(i=i[0]),i!==void 0)return this[i.name](i.children,o)},validateVisitor:function(){let i=PO(this,e);if(i.length!==0){let o=i.map(s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
124
+ see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Vt?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function j0(t,e){let r=new pg(t,e);return r.resolveRefs(),r.errors}var pg=class extends Yt{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){Object.values(this.nameToTopRule).forEach(e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:St.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}};var hg=class extends Ln{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=[...this.path.ruleStack].reverse(),this.occurrenceStack=[...this.path.occurrenceStack].reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){this.ruleStack.length===0?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},Ff=class extends hg{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let i=r.concat(n),o=new Je({definition:i});this.possibleTokTypes=To(o),this.found=!0}}},Ps=class extends Ln{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},Uf=class extends Ps{walkMany(e,r,n){if(e.idx===this.occurrence){let i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof _e&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},qc=class extends Ps{walkManySep(e,r,n){if(e.idx===this.occurrence){let i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof _e&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},Bf=class extends Ps{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){let i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof _e&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},Wc=class extends Ps{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){let i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof _e&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}};function Gf(t,e,r=[]){r=[...r];let n=[],i=0;function o(a){return a.concat(t.slice(i+1))}function s(a){let c=Gf(o(a),e,r);return n.concat(c)}for(;r.length<e&&i<t.length;){let a=t[i];if(a instanceof Je)return s(a.definition);if(a instanceof Ge)return s(a.definition);if(a instanceof Xe)n=s(a.definition);else if(a instanceof Qe){let c=a.definition.concat([new we({definition:a.definition})]);return s(c)}else if(a instanceof et){let c=[new Je({definition:a.definition}),new we({definition:[new _e({terminalType:a.separator})].concat(a.definition)})];return s(c)}else if(a instanceof Ye){let c=a.definition.concat([new we({definition:[new _e({terminalType:a.separator})].concat(a.definition)})]);n=s(c)}else if(a instanceof we){let c=a.definition.concat([new we({definition:a.definition})]);n=s(c)}else{if(a instanceof Ke)return a.definition.forEach(c=>{c.definition.length!==0&&(n=s(c.definition))}),n;if(a instanceof _e)r.push(a.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:t.slice(i)}),n}function z0(t,e,r,n){let i="EXIT_NONE_TERMINAL",o=[i],s="EXIT_ALTERNATIVE",a=!1,c=e.length,l=c-n-1,u=[],f=[];for(f.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});f.length!==0;){let d=f.pop();if(d===s){a&&f.at(-1).idx<=l&&f.pop();continue}let p=d.def,m=d.idx,g=d.ruleStack,v=d.occurrenceStack;if(p.length===0)continue;let T=p[0];if(T===i){let _={idx:m,def:p.slice(1),ruleStack:g.slice(0,-1),occurrenceStack:v.slice(0,-1)};f.push(_)}else if(T instanceof _e)if(m<c-1){let _=m+1,E=e[_];if(r(E,T.terminalType)){let I={idx:_,def:p.slice(1),ruleStack:g,occurrenceStack:v};f.push(I)}}else if(m===c-1)u.push({nextTokenType:T.terminalType,nextTokenOccurrence:T.idx,ruleStack:g,occurrenceStack:v}),a=!0;else throw Error("non exhaustive match");else if(T instanceof Ge){let _=[...g];_.push(T.nonTerminalName);let E=[...v];E.push(T.idx);let I={idx:m,def:T.definition.concat(o,p.slice(1)),ruleStack:_,occurrenceStack:E};f.push(I)}else if(T instanceof Xe){let _={idx:m,def:p.slice(1),ruleStack:g,occurrenceStack:v};f.push(_),f.push(s);let E={idx:m,def:T.definition.concat(p.slice(1)),ruleStack:g,occurrenceStack:v};f.push(E)}else if(T instanceof Qe){let _=new we({definition:T.definition,idx:T.idx}),E=T.definition.concat([_],p.slice(1)),I={idx:m,def:E,ruleStack:g,occurrenceStack:v};f.push(I)}else if(T instanceof et){let _=new _e({terminalType:T.separator}),E=new we({definition:[_].concat(T.definition),idx:T.idx}),I=T.definition.concat([E],p.slice(1)),D={idx:m,def:I,ruleStack:g,occurrenceStack:v};f.push(D)}else if(T instanceof Ye){let _={idx:m,def:p.slice(1),ruleStack:g,occurrenceStack:v};f.push(_),f.push(s);let E=new _e({terminalType:T.separator}),I=new we({definition:[E].concat(T.definition),idx:T.idx}),D=T.definition.concat([I],p.slice(1)),k={idx:m,def:D,ruleStack:g,occurrenceStack:v};f.push(k)}else if(T instanceof we){let _={idx:m,def:p.slice(1),ruleStack:g,occurrenceStack:v};f.push(_),f.push(s);let E=new we({definition:T.definition,idx:T.idx}),I=T.definition.concat([E],p.slice(1)),D={idx:m,def:I,ruleStack:g,occurrenceStack:v};f.push(D)}else if(T instanceof Ke)for(let _=T.definition.length-1;_>=0;_--){let E=T.definition[_],I={idx:m,def:E.definition.concat(p.slice(1)),ruleStack:g,occurrenceStack:v};f.push(I),f.push(s)}else if(T instanceof Je)f.push({idx:m,def:T.definition.concat(p.slice(1)),ruleStack:g,occurrenceStack:v});else if(T instanceof Vt)f.push(ZO(T,m,g,v));else throw Error("non exhaustive match")}return u}function ZO(t,e,r,n){let i=[...r];i.push(t.name);let o=[...n];return o.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:o}}var lt;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(lt||(lt={}));function Vc(t){if(t instanceof Xe||t==="Option")return lt.OPTION;if(t instanceof we||t==="Repetition")return lt.REPETITION;if(t instanceof Qe||t==="RepetitionMandatory")return lt.REPETITION_MANDATORY;if(t instanceof et||t==="RepetitionMandatoryWithSeparator")return lt.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof Ye||t==="RepetitionWithSeparator")return lt.REPETITION_WITH_SEPARATOR;if(t instanceof Ke||t==="Alternation")return lt.ALTERNATION;throw Error("non exhaustive match")}function Hf(t){let{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,o=Vc(n);return o===lt.ALTERNATION?Cs(e,r,i):Os(e,r,o,i)}function W0(t,e,r,n,i,o){let s=Cs(t,e,r),a=Q0(s)?Is:Dn;return o(s,n,a,i)}function V0(t,e,r,n,i,o){let s=Os(t,e,i,r),a=Q0(s)?Is:Dn;return o(s[0],a,n)}function Y0(t,e,r,n){let i=t.length,o=t.every(s=>s.every(a=>a.length===1));if(e)return function(s){let a=s.map(c=>c.GATE);for(let c=0;c<i;c++){let l=t[c],u=l.length,f=a[c];if(!(f!==void 0&&f.call(this)===!1))e:for(let d=0;d<u;d++){let p=l[d],m=p.length;for(let g=0;g<m;g++){let v=this.LA_FAST(g+1);if(r(v,p[g])===!1)continue e}return c}}};if(o&&!n){let a=t.map(c=>c.flat()).reduce((c,l,u)=>(l.forEach(f=>{f.tokenTypeIdx in c||(c[f.tokenTypeIdx]=u),f.categoryMatches.forEach(d=>{Object.hasOwn(c,d)||(c[d]=u)})}),c),{});return function(){let c=this.LA_FAST(1);return a[c.tokenTypeIdx]}}else return function(){for(let s=0;s<i;s++){let a=t[s],c=a.length;e:for(let l=0;l<c;l++){let u=a[l],f=u.length;for(let d=0;d<f;d++){let p=this.LA_FAST(d+1);if(r(p,u[d])===!1)continue e}return s}}}}function K0(t,e,r){let n=t.every(o=>o.length===1),i=t.length;if(n&&!r){let o=t.flat();if(o.length===1&&o[0].categoryMatches.length===0){let a=o[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===a}}else{let s=o.reduce((a,c,l)=>(a[c.tokenTypeIdx]=!0,c.categoryMatches.forEach(u=>{a[u]=!0}),a),[]);return function(){let a=this.LA_FAST(1);return s[a.tokenTypeIdx]===!0}}}else return function(){e:for(let o=0;o<i;o++){let s=t[o],a=s.length;for(let c=0;c<a;c++){let l=this.LA_FAST(c+1);if(e(l,s[c])===!1)continue e}return!0}return!1}}var gg=class extends Ln{constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,lt.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,lt.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,lt.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,lt.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,lt.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}},Xf=class extends Yt{constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,lt.OPTION)}visitRepetition(e){this.checkIsTarget(e,lt.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,lt.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,lt.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,lt.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,lt.ALTERNATION)}};function q0(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function mg(t){let e=[""];for(let r=0;r<t.length;r++){let n=t[r],i=[];for(let o=0;o<e.length;o++){let s=e[o];i.push(s+"_"+n.tokenTypeIdx);for(let a=0;a<n.categoryMatches.length;a++){let c="_"+n.categoryMatches[a];i.push(s+c)}}e=i}return e}function JO(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;let i=t[n];for(let o=0;o<e.length;o++){let s=e[o];if(i[s]===!0)return!1}}return!0}function Z0(t,e){let r=t.map(s=>Gf([s],1)),n=q0(r.length),i=r.map(s=>{let a={};return s.forEach(c=>{mg(c.partialPath).forEach(u=>{a[u]=!0})}),a}),o=r;for(let s=1;s<=e;s++){let a=o;o=q0(a.length);for(let c=0;c<a.length;c++){let l=a[c];for(let u=0;u<l.length;u++){let f=l[u].partialPath,d=l[u].suffixDef,p=mg(f);if(JO(i,p,c)||d.length===0||f.length===e){let g=n[c];if(jf(g,f)===!1){g.push(f);for(let v=0;v<p.length;v++){let T=p[v];i[c][T]=!0}}}else{let g=Gf(d,s+1,f);o[c]=o[c].concat(g),g.forEach(v=>{mg(v.partialPath).forEach(_=>{i[c][_]=!0})})}}}}return n}function Cs(t,e,r,n){let i=new Xf(t,lt.ALTERNATION,n);return e.accept(i),Z0(i.result,r)}function Os(t,e,r,n){let i=new Xf(t,r);e.accept(i);let o=i.result,a=new gg(e,t,r).startWalking(),c=new Je({definition:o}),l=new Je({definition:a});return Z0([c,l],n)}function jf(t,e){e:for(let r=0;r<t.length;r++){let n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){let o=e[i],s=n[i];if((o===s||s.categoryMatchesMap[o.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function J0(t,e){return t.length<e.length&&t.every((r,n)=>{let i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function Q0(t){return t.every(e=>e.every(r=>r.every(n=>n.categoryMatches.length===0)))}function ev(t){return t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName}).map(r=>Object.assign({type:St.CUSTOM_LOOKAHEAD_VALIDATION},r))}function tv(t,e,r,n){let i=t.flatMap(c=>QO(c,r)),o=oL(t,e,r),s=t.flatMap(c=>rL(c,r)),a=t.flatMap(c=>tL(c,t,n,r));return i.concat(o,s,a)}function QO(t,e){let r=new yg;t.accept(r);let n=r.allProductions,i=Object.groupBy(n,eL),o=Object.fromEntries(Object.entries(i).filter(([a,c])=>c.length>1));return Object.values(o).map(a=>{let c=a[0],l=e.buildDuplicateFoundError(t,a),u=rr(c),f={message:l,type:St.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:u,occurrence:c.idx},d=rv(c);return d&&(f.parameter=d),f})}function eL(t){return`${rr(t)}_#_${t.idx}_#_${rv(t)}`}function rv(t){return t instanceof _e?t.terminalType.name:t instanceof Ge?t.nonTerminalName:""}var yg=class extends Yt{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function tL(t,e,r,n){let i=[];if(e.reduce((s,a)=>a.name===t.name?s+1:s,0)>1){let s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:St.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function nv(t,e,r){let n=[],i;return e.includes(t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:St.INVALID_RULE_OVERRIDE,ruleName:t})),n}function Tg(t,e,r,n=[]){let i=[],o=zf(e.definition);if(o.length===0)return[];{let s=t.name;o.includes(t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:St.LEFT_RECURSION,ruleName:s});let c=n.concat([t]),u=o.filter(f=>!c.includes(f)).flatMap(f=>{let d=[...n];return d.push(f),Tg(t,f,r,d)});return i.concat(u)}}function zf(t){let e=[];if(t.length===0)return e;let r=t[0];if(r instanceof Ge)e.push(r.referencedRule);else if(r instanceof Je||r instanceof Xe||r instanceof Qe||r instanceof et||r instanceof Ye||r instanceof we)e=e.concat(zf(r.definition));else if(r instanceof Ke)e=r.definition.map(o=>zf(o.definition)).flat();else if(!(r instanceof _e))throw Error("non exhaustive match");let n=xo(r),i=t.length>1;if(n&&i){let o=t.slice(1);return e.concat(zf(o))}else return e}var Yc=class extends Yt{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function iv(t,e){let r=new Yc;return t.accept(r),r.alternations.flatMap(o=>o.definition.slice(0,-1).flatMap((a,c)=>z0([a],[],Dn,1).length===0?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:o,emptyChoiceIdx:c}),type:St.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:o.idx,alternative:c+1}]:[]))}function ov(t,e,r){let n=new Yc;t.accept(n);let i=n.alternations;return i=i.filter(s=>s.ignoreAmbiguities!==!0),i.flatMap(s=>{let a=s.idx,c=s.maxLookahead||e,l=Cs(a,t,c,s),u=nL(l,s,t,r),f=iL(l,s,t,r);return u.concat(f)})}var xg=class extends Yt{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function rL(t,e){let r=new Yc;return t.accept(r),r.alternations.flatMap(o=>o.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:o}),type:St.TOO_MANY_ALTS,ruleName:t.name,occurrence:o.idx}]:[])}function sv(t,e,r){let n=[];return t.forEach(i=>{let o=new xg;i.accept(o),o.allProductions.forEach(a=>{let c=Vc(a),l=a.maxLookahead||e,u=a.idx;if(Os(u,i,c,l)[0].flat().length===0){let p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:a});n.push({message:p,type:St.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function nL(t,e,r,n){let i=[];return t.reduce((a,c,l)=>(e.definition[l].ignoreAmbiguities===!0||c.forEach(u=>{let f=[l];t.forEach((d,p)=>{l!==p&&jf(d,u)&&e.definition[p].ignoreAmbiguities!==!0&&f.push(p)}),f.length>1&&!jf(i,u)&&(i.push(u),a.push({alts:f,path:u}))}),a),[]).map(a=>{let c=a.alts.map(u=>u+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:c,prefixPath:a.path}),type:St.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:a.alts}})}function iL(t,e,r,n){let i=t.reduce((s,a,c)=>{let l=a.map(u=>({idx:c,path:u}));return s.concat(l)},[]);return i.flatMap(s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];let c=s.idx,l=s.path;return i.filter(d=>e.definition[d.idx].ignoreAmbiguities!==!0&&d.idx<c&&J0(d.path,l)).map(d=>{let p=[d.idx+1,c+1],m=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:p,prefixPath:d.path}),type:St.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:m,alternatives:p}})})}function oL(t,e,r){let n=[],i=e.map(o=>o.name);return t.forEach(o=>{let s=o.name;if(i.includes(s)){let a=r.buildNamespaceConflictError(o);n.push({message:a,type:St.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function av(t){let e=Object.assign({errMsgProvider:H0},t),r={};return t.rules.forEach(n=>{r[n.name]=n}),j0(r,e.errMsgProvider)}function cv(t){var e;let r=(e=t.errMsgProvider)!==null&&e!==void 0?e:Gr;return tv(t.rules,t.tokenTypes,r,t.grammarName)}var lv="MismatchedTokenException",uv="NoViableAltException",fv="EarlyExitException",dv="NotAllInputParsedException",pv=[lv,uv,fv,dv];Object.freeze(pv);function hi(t){return pv.includes(t.name)}var Ls=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},Eo=class extends Ls{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=lv}},Kc=class extends Ls{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=uv}},Zc=class extends Ls{constructor(e,r){super(e,r),this.name=dv}},Jc=class extends Ls{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=fv}};var _g={},vg="InRuleRecoveryException",Eg=class extends Error{constructor(e){super(e),this.name=vg}},qf=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:Zt.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=sL)}getTokenToInsert(e){let r=Fn(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){let o=this.findReSyncTokenType(),s=this.exportLexerState(),a=[],c=!1,l=this.LA_FAST(1),u=this.LA_FAST(1),f=()=>{let d=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:l,previous:d,ruleName:this.getCurrRuleFullName()}),m=new Eo(p,l,this.LA(0));m.resyncedTokens=a.slice(0,-1),this.SAVE_ERROR(m)};for(;!c;)if(this.tokenMatcher(u,i)){f();return}else if(n.call(this)){f(),e.apply(this,r);return}else this.tokenMatcher(u,o)?c=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,a));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA_FAST(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getNextPossibleTokenTypes(e){let r=e.ruleStack[0],i=this.getGAstProductions()[r];return new Ff(i,e).startWalking()}getFollowsForInRuleRecovery(e,r){let n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new Eg("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||r.length===0)return!1;let n=this.LA_FAST(1);return r.find(o=>this.tokenMatcher(n,o))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let r=this.getCurrFollowKey();return this.getFollowSetFromFollowKey(r).includes(e)}findReSyncTokenType(){let e=this.flattenFollowSet(),r=this.LA_FAST(1),n=2;for(;;){let i=e.find(o=>Ns(r,o));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK_IDX===0)return _g;let e=this.currRuleShortName,r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK,n=this.RULE_STACK_IDX+1,i=new Array(n);for(let o=0;o<n;o++)o===0?i[o]=_g:i[o]={ruleName:this.shortRuleNameToFullName(e[o]),idxInCallingRule:r[o],inRule:this.shortRuleNameToFullName(e[o-1])};return i}flattenFollowSet(){return this.buildFullFollowKeyStack().map(r=>this.getFollowSetFromFollowKey(r)).flat()}getFollowSetFromFollowKey(e){if(e===_g)return[Kt];let r=e.ruleName+e.idxInCallingRule+Cf+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,Kt)||r.push(e),r}reSyncTo(e){let r=[],n=this.LA_FAST(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return r.slice(0,-1)}attemptInRepetitionRecovery(e,r,n,i,o,s,a){}getCurrentGrammarPath(e,r){let n=this.getHumanReadableRuleStack(),i=this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){let e=this.RULE_STACK_IDX+1,r=new Array(e);for(let n=0;n<e;n++)r[n]=this.shortRuleNameToFullName(this.RULE_STACK[n]);return r}};function sL(t,e,r,n,i,o,s){let a=this.getKeyForAutomaticLookahead(n,i),c=this.firstAfterRepMap[a];if(c===void 0){let d=this.getCurrRuleFullName(),p=this.getGAstProductions()[d];c=new o(p,i).startWalking(),this.firstAfterRepMap[a]=c}let l=c.token,u=c.occurrence,f=c.isEndOfRule;this.RULE_STACK_IDX===0&&f&&l===void 0&&(l=Kt,u=1),!(l===void 0||u===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,u,s)&&this.tryInRepetitionRecovery(t,e,r,l)}function Wf(t,e,r){return r|e|t}var Bn=class{constructor(e){var r;this.maxLookahead=(r=e?.maxLookahead)!==null&&r!==void 0?r:Zt.maxLookahead}validate(e){let r=this.validateNoLeftRecursion(e.rules);if(r.length===0){let n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),o=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...o]}return r}validateNoLeftRecursion(e){return e.flatMap(r=>Tg(r,r,Gr))}validateEmptyOrAlternatives(e){return e.flatMap(r=>iv(r,Gr))}validateAmbiguousAlternationAlternatives(e,r){return e.flatMap(n=>ov(n,r,Gr))}validateSomeNonEmptyLookaheadPath(e,r){return sv(e,r,Gr)}buildLookaheadForAlternation(e){return W0(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Y0)}buildLookaheadForOptional(e){return V0(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Vc(e.prodType),K0)}};var Yf=class{initLooksAhead(e){this.dynamicTokensEnabled=Object.hasOwn(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Zt.dynamicTokensEnabled,this.maxLookahead=Object.hasOwn(e,"maxLookahead")?e.maxLookahead:Zt.maxLookahead,this.lookaheadStrategy=Object.hasOwn(e,"lookaheadStrategy")?e.lookaheadStrategy:new Bn({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){e.forEach(r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:o,repetitionMandatory:s,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:c}=aL(r);n.forEach(l=>{let u=l.idx===0?"":l.idx;this.TRACE_INIT(`${rr(l)}${u}`,()=>{let f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:r,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),d=Wf(this.fullRuleNameToShort[r.name],256,l.idx);this.setLaFuncCache(d,f)})}),i.forEach(l=>{this.computeLookaheadFunc(r,l.idx,768,"Repetition",l.maxLookahead,rr(l))}),o.forEach(l=>{this.computeLookaheadFunc(r,l.idx,512,"Option",l.maxLookahead,rr(l))}),s.forEach(l=>{this.computeLookaheadFunc(r,l.idx,1024,"RepetitionMandatory",l.maxLookahead,rr(l))}),a.forEach(l=>{this.computeLookaheadFunc(r,l.idx,1536,"RepetitionMandatoryWithSeparator",l.maxLookahead,rr(l))}),c.forEach(l=>{this.computeLookaheadFunc(r,l.idx,1280,"RepetitionWithSeparator",l.maxLookahead,rr(l))})})})}computeLookaheadFunc(e,r,n,i,o,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{let a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:o||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),c=Wf(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(c,a)})}getKeyForAutomaticLookahead(e,r){return Wf(this.currRuleShortName,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},Rg=class extends Yt{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},Vf=new Rg;function aL(t){Vf.reset(),t.accept(Vf);let e=Vf.dslMethods;return Vf.reset(),e}function Ag(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function Sg(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function hv(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function mv(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}var cL="name";function Ig(t,e){Object.defineProperty(t,cL,{enumerable:!1,configurable:!0,writable:!1,value:e})}function lL(t,e){let r=Object.keys(t),n=r.length;for(let i=0;i<n;i++){let o=r[i],s=t[o],a=s.length;for(let c=0;c<a;c++){let l=s[c];l.tokenTypeIdx===void 0&&this[l.name](l.children,e)}}}function gv(t,e){let r=function(){};Ig(r,t+"BaseSemantics");let n={visit:function(i,o){if(Array.isArray(i)&&(i=i[0]),i!==void 0)return this[i.name](i.children,o)},validateVisitor:function(){let i=uL(this,e);if(i.length!==0){let o=i.map(s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
125
125
  ${o.join(`
126
126
 
127
127
  `).replace(/\n/g,`
128
- `)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function eb(t,e,r){let n=function(){};xg(n,t+"BaseSemanticsWithDefaults");let i=Object.create(r.prototype);return e.forEach(o=>{i[o]=NO}),n.prototype=i,n.prototype.constructor=n,n}var Tg;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Tg||(Tg={}));function PO(t,e){return CO(t,e)}function CO(t,e){return e.filter(i=>typeof t[i]!="function").map(i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:Tg.MISSING_METHOD,methodName:i})).filter(Boolean)}var jf=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,"nodeLocationTracking")?e.nodeLocationTracking:Kt.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{};else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=yg,this.setNodeLocationFromNode=yg,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=gg,this.setNodeLocationFromNode=gg,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=()=>{},this.setInitialNodeLocation=()=>{};else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA_FAST(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){let r=this.LA_FAST(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];ZR(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];JR(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(this.baseCstVisitorConstructor===void 0){let e=QR(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(this.baseCstVisitorWithDefaultsConstructor===void 0){let e=eb(this.className,Object.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}};var Wf=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVectorLength-2?(this.consumeToken(),this.LA_FAST(1)):Fn}LA_FAST(e){let r=this.currIdx+e;return this.tokVector[r]}LA(e){let r=this.currIdx+e;return r<0||this.tokVectorLength<=r?Fn:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}};var qf=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=ks){if(this.definedRulesNames.includes(e)){let s={message:Ur.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:At.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);let i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=ks){let i=BR(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let o=this.defineRule(e,r,n);return this[e]=o,o}BACKTRACK(e,r){var n;let i=(n=e.coreRule)!==null&&n!==void 0?n:e;return function(){this.isBackTrackingStack.push(1);let o=this.saveRecogState();try{return i.apply(this,r),!0}catch(s){if(li(s))return!1;throw s}finally{this.reloadRecogState(o),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Rf(Object.values(this.gastProductionsCache))}};var zf=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Rs,this.subruleIdx=0,this.currRuleShortName=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Object.hasOwn(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
128
+ `)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function yv(t,e,r){let n=function(){};Ig(n,t+"BaseSemanticsWithDefaults");let i=Object.create(r.prototype);return e.forEach(o=>{i[o]=lL}),n.prototype=i,n.prototype.constructor=n,n}var kg;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(kg||(kg={}));function uL(t,e){return fL(t,e)}function fL(t,e){return e.filter(i=>typeof t[i]!="function").map(i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:kg.MISSING_METHOD,methodName:i})).filter(Boolean)}var Qf=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,"nodeLocationTracking")?e.nodeLocationTracking:Zt.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{};else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Sg,this.setNodeLocationFromNode=Sg,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Ag,this.setNodeLocationFromNode=Ag,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=()=>{},this.setInitialNodeLocation=()=>{};else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA_FAST(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){let r=this.LA_FAST(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];hv(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];mv(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(this.baseCstVisitorConstructor===void 0){let e=gv(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(this.baseCstVisitorWithDefaultsConstructor===void 0){let e=yv(this.className,Object.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}};var ed=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVectorLength-2?(this.consumeToken(),this.LA_FAST(1)):Gn}LA_FAST(e){let r=this.currIdx+e;return this.tokVector[r]}LA(e){let r=this.currIdx+e;return r<0||this.tokVectorLength<=r?Gn:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}};var td=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=Ds){if(this.definedRulesNames.includes(e)){let s={message:Gr.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:St.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);let i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=Ds){let i=nv(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let o=this.defineRule(e,r,n);return this[e]=o,o}BACKTRACK(e,r){var n;let i=(n=e.coreRule)!==null&&n!==void 0?n:e;return function(){this.isBackTrackingStack.push(1);let o=this.saveRecogState();try{return i.apply(this,r),!0}catch(s){if(hi(s))return!1;throw s}finally{this.reloadRecogState(o),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Pf(Object.values(this.gastProductionsCache))}};var rd=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Is,this.subruleIdx=0,this.currRuleShortName=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Object.hasOwn(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
129
129
  See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
130
130
  For Further details.`);if(Array.isArray(e)){if(e.length===0)throw Error(`A Token Vocabulary cannot be empty.
131
131
  Note that the first argument for the parser constructor
132
132
  is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
133
133
  See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
134
- For Further details.`)}if(Array.isArray(e))this.tokensMap=e.reduce((o,s)=>(o[s.name]=s,o),{});else if(Object.hasOwn(e,"modes")&&Object.values(e.modes).flat().every(yR)){let o=Object.values(e.modes).flat(),s=[...new Set(o)];this.tokensMap=s.reduce((a,c)=>(a[c.name]=c,a),{})}else if(typeof e=="object"&&e!==null)this.tokensMap=Object.assign({},e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Yt;let i=(Object.hasOwn(e,"modes")?Object.values(e.modes).flat():Object.values(e)).every(o=>{var s;return((s=o.categoryMatches)===null||s===void 0?void 0:s.length)==0});this.tokenMatcher=i?Rs:Cn,On(Object.values(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
135
- Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=Object.hasOwn(n,"resyncEnabled")?n.resyncEnabled:ks.resyncEnabled,o=Object.hasOwn(n,"recoveryValueFunc")?n.recoveryValueFunc:ks.recoveryValueFunc,s=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let a;return this.outputCst===!0?a=function(...f){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,f);let d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}catch(d){return this.invokeRuleCatch(d,i,o)}finally{this.ruleFinallyStateUpdate()}}:a=function(...f){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,f)}catch(d){return this.invokeRuleCatch(d,i,o)}finally{this.ruleFinallyStateUpdate()}},Object.assign(function(...f){this.onBeforeParse(e);try{return a.apply(this,f)}finally{this.onAfterParse(e)}},{ruleName:e,originalGrammarAction:r,coreRule:a})}invokeRuleCatch(e,r,n){let i=this.RULE_STACK_IDX===0,o=r&&!this.isBackTracking()&&this.recoveryEnabled;if(li(e)){let s=e;if(o){let a=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))if(s.resyncedTokens=this.reSyncTo(a),this.outputCst){let c=this.CST_STACK[this.CST_STACK.length-1];return c.recoveredNode=!0,c}else return n(e);else{if(this.outputCst){let c=this.CST_STACK[this.CST_STACK.length-1];c.recoveredNode=!0,s.partialCstResult=c}throw s}}else{if(i)return this.moveToTerminatedState(),n(e);throw s}}else throw e}optionInternal(e,r){let n=this.getKeyForAutomaticLookahead(512,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof e!="function"){o=e.DEF;let s=e.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=e;if(i.call(this)===!0)return o.call(this)}atLeastOneInternal(e,r){let n=this.getKeyForAutomaticLookahead(1024,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let s=r.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=r;if(i.call(this)===!0){let s=this.doSingleRepetition(o);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o)}else throw this.raiseEarlyExitException(e,ct.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,1024,e,Pf)}atLeastOneSepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA_FAST(1),o);for(;this.tokenMatcher(this.LA_FAST(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,Xc],a,1536,e,Xc)}else throw this.raiseEarlyExitException(e,ct.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let a=r.GATE;if(a!==void 0){let c=i;i=()=>a.call(this)&&c.call(this)}}else o=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,768,e,Nf,s)}manySepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA_FAST(1),o);for(;this.tokenMatcher(this.LA_FAST(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,Bc],a,1280,e,Bc)}}repetitionSepSecondInternal(e,r,n,i,o){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,o],n,1536,e,o)}doSingleRepetition(e){let r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){let n=this.getKeyForAutomaticLookahead(256,r),i=Array.isArray(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){this.RULE_STACK_IDX--,this.RULE_OCCURRENCE_STACK_IDX--,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX]),this.cstFinallyStateUpdate()}subruleInternal(e,r,n){let i;try{let o=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.coreRule.apply(this,o),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(o){throw this.subruleInternalError(o,n,e.ruleName)}}subruleInternalError(e,r,n){throw li(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{let o=this.LA_FAST(1);this.tokenMatcher(o,e)===!0?(this.consumeToken(),i=o):this.consumeInternalError(e,o,n)}catch(o){i=this.consumeInternalRecovery(e,r,o)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i,o=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:o,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new go(i,r,o))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){let i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(o){throw o.name===dg?n:o}}else throw n}saveRecogState(){let e=this.errors,r=this.RULE_STACK.slice(0,this.RULE_STACK_IDX+1);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState);let r=e.RULE_STACK;for(let n=0;n<r.length;n++)this.RULE_STACK[n]=r[n];this.RULE_STACK_IDX=r.length-1,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX])}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX]=n,this.RULE_STACK[++this.RULE_STACK_IDX]=e,this.currRuleShortName=e,this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.currRuleShortName;return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Yt)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK_IDX=-1,this.CST_STACK=[]}onBeforeParse(e){for(let r=0;r<this.maxLookahead+1;r++)this.tokVector.push(Fn)}onAfterParse(e){if(this.isAtEndOfInput()===!1){let r=this.LA(1),n=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:r,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Wc(n,r))}for(;this.tokVector.at(-1)===Fn;)this.tokVector.pop()}};var Vf=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:Kt.errorMessageProvider}SAVE_ERROR(e){if(li(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return[...this._errors]}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){let i=this.getCurrRuleFullName(),o=this.getGAstProductions()[i],a=Ss(e,o,r,this.maxLookahead)[0],c=[];for(let u=1;u<=this.maxLookahead;u++)c.push(this.LA(u));let l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:c,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new qc(l,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],o=Is(e,i,this.maxLookahead),s=[];for(let l=1;l<=this.maxLookahead;l++)s.push(this.LA(l));let a=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:o,actual:s,previous:a,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new jc(c,this.LA(1),a))}};var Zf={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Zf);var tb=!0,rb=Math.pow(2,8)-1,ib=ci({name:"RECORDING_PHASE_TOKEN",pattern:at.NA});On([ib]);var ob=Dn(ib,`This IToken indicates the Parser is in Recording Phase
136
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(ob);var LO={name:`This CSTNode indicates the Parser is in Recording Phase
137
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Yf=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){let r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{let e=this;for(let r=0;r<10;r++){let n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return Fn}topLevelRuleRecord(e,r){try{let n=new zt({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
134
+ For Further details.`)}if(Array.isArray(e))this.tokensMap=e.reduce((o,s)=>(o[s.name]=s,o),{});else if(Object.hasOwn(e,"modes")&&Object.values(e.modes).flat().every(L0)){let o=Object.values(e.modes).flat(),s=[...new Set(o)];this.tokensMap=s.reduce((a,c)=>(a[c.name]=c,a),{})}else if(typeof e=="object"&&e!==null)this.tokensMap=Object.assign({},e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Kt;let i=(Object.hasOwn(e,"modes")?Object.values(e.modes).flat():Object.values(e)).every(o=>{var s;return((s=o.categoryMatches)===null||s===void 0?void 0:s.length)==0});this.tokenMatcher=i?Is:Dn,$n(Object.values(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
135
+ Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=Object.hasOwn(n,"resyncEnabled")?n.resyncEnabled:Ds.resyncEnabled,o=Object.hasOwn(n,"recoveryValueFunc")?n.recoveryValueFunc:Ds.recoveryValueFunc,s=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let a;return this.outputCst===!0?a=function(...f){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,f);let d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}catch(d){return this.invokeRuleCatch(d,i,o)}finally{this.ruleFinallyStateUpdate()}}:a=function(...f){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,f)}catch(d){return this.invokeRuleCatch(d,i,o)}finally{this.ruleFinallyStateUpdate()}},Object.assign(function(...f){this.onBeforeParse(e);try{return a.apply(this,f)}finally{this.onAfterParse(e)}},{ruleName:e,originalGrammarAction:r,coreRule:a})}invokeRuleCatch(e,r,n){let i=this.RULE_STACK_IDX===0,o=r&&!this.isBackTracking()&&this.recoveryEnabled;if(hi(e)){let s=e;if(o){let a=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))if(s.resyncedTokens=this.reSyncTo(a),this.outputCst){let c=this.CST_STACK[this.CST_STACK.length-1];return c.recoveredNode=!0,c}else return n(e);else{if(this.outputCst){let c=this.CST_STACK[this.CST_STACK.length-1];c.recoveredNode=!0,s.partialCstResult=c}throw s}}else{if(i)return this.moveToTerminatedState(),n(e);throw s}}else throw e}optionInternal(e,r){let n=this.getKeyForAutomaticLookahead(512,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof e!="function"){o=e.DEF;let s=e.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=e;if(i.call(this)===!0)return o.call(this)}atLeastOneInternal(e,r){let n=this.getKeyForAutomaticLookahead(1024,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let s=r.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=r;if(i.call(this)===!0){let s=this.doSingleRepetition(o);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o)}else throw this.raiseEarlyExitException(e,lt.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,1024,e,Bf)}atLeastOneSepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA_FAST(1),o);for(;this.tokenMatcher(this.LA_FAST(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,Wc],a,1536,e,Wc)}else throw this.raiseEarlyExitException(e,lt.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let a=r.GATE;if(a!==void 0){let c=i;i=()=>a.call(this)&&c.call(this)}}else o=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,768,e,Uf,s)}manySepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA_FAST(1),o);for(;this.tokenMatcher(this.LA_FAST(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,qc],a,1280,e,qc)}}repetitionSepSecondInternal(e,r,n,i,o){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,o],n,1536,e,o)}doSingleRepetition(e){let r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){let n=this.getKeyForAutomaticLookahead(256,r),i=Array.isArray(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){this.RULE_STACK_IDX--,this.RULE_OCCURRENCE_STACK_IDX--,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX]),this.cstFinallyStateUpdate()}subruleInternal(e,r,n){let i;try{let o=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.coreRule.apply(this,o),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(o){throw this.subruleInternalError(o,n,e.ruleName)}}subruleInternalError(e,r,n){throw hi(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{let o=this.LA_FAST(1);this.tokenMatcher(o,e)===!0?(this.consumeToken(),i=o):this.consumeInternalError(e,o,n)}catch(o){i=this.consumeInternalRecovery(e,r,o)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i,o=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:o,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Eo(i,r,o))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){let i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(o){throw o.name===vg?n:o}}else throw n}saveRecogState(){let e=this.errors,r=this.RULE_STACK.slice(0,this.RULE_STACK_IDX+1);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState);let r=e.RULE_STACK;for(let n=0;n<r.length;n++)this.RULE_STACK[n]=r[n];this.RULE_STACK_IDX=r.length-1,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX])}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX]=n,this.RULE_STACK[++this.RULE_STACK_IDX]=e,this.currRuleShortName=e,this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.currRuleShortName;return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Kt)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK_IDX=-1,this.CST_STACK=[]}onBeforeParse(e){for(let r=0;r<this.maxLookahead+1;r++)this.tokVector.push(Gn)}onAfterParse(e){if(this.isAtEndOfInput()===!1){let r=this.LA(1),n=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:r,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Zc(n,r))}for(;this.tokVector.at(-1)===Gn;)this.tokVector.pop()}};var nd=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:Zt.errorMessageProvider}SAVE_ERROR(e){if(hi(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return[...this._errors]}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){let i=this.getCurrRuleFullName(),o=this.getGAstProductions()[i],a=Os(e,o,r,this.maxLookahead)[0],c=[];for(let u=1;u<=this.maxLookahead;u++)c.push(this.LA(u));let l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:c,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new Jc(l,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],o=Cs(e,i,this.maxLookahead),s=[];for(let l=1;l<=this.maxLookahead;l++)s.push(this.LA(l));let a=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:o,actual:s,previous:a,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Kc(c,this.LA(1),a))}};var sd={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(sd);var xv=!0,Tv=Math.pow(2,8)-1,Ev=pi({name:"RECORDING_PHASE_TOKEN",pattern:ct.NA});$n([Ev]);var vv=Fn(Ev,`This IToken indicates the Parser is in Recording Phase
136
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(vv);var pL={name:`This CSTNode indicates the Parser is in Recording Phase
137
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},id=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){let r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{let e=this;for(let r=0;r<10;r++){let n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return Gn}topLevelRuleRecord(e,r){try{let n=new Vt({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
138
138
  This error was thrown during the "grammar recording phase" For more info see:
139
- https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return Vc.call(this,Fe,e,r)}atLeastOneInternalRecord(e,r){Vc.call(this,Ze,r,e)}atLeastOneSepFirstInternalRecord(e,r){Vc.call(this,Je,r,e,tb)}manyInternalRecord(e,r){Vc.call(this,be,r,e)}manySepFirstInternalRecord(e,r){Vc.call(this,qe,r,e,tb)}orInternalRecord(e,r){return DO.call(this,e,r)}subruleInternalRecord(e,r,n){if(Kf(r),!e||!Object.hasOwn(e,"ruleName")){let a=new Error(`<SUBRULE${nb(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
140
- inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}let i=this.recordingProdStack.at(-1),o=e.ruleName,s=new Me({idx:r,nonTerminalName:o,label:n?.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?LO:Zf}consumeInternalRecord(e,r,n){if(Kf(r),!tg(e)){let s=new Error(`<CONSUME${nb(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
141
- inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}let i=this.recordingProdStack.at(-1),o=new ge({idx:r,terminalType:e,label:n?.LABEL});return i.definition.push(o),ob}};function Vc(t,e,r,n=!1){Kf(r);let i=this.recordingProdStack.at(-1),o=typeof e=="function"?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),Object.hasOwn(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),o.call(this),i.definition.push(s),this.recordingProdStack.pop(),Zf}function DO(t,e){Kf(e);let r=this.recordingProdStack.at(-1),n=Array.isArray(t)===!1,i=n===!1?t:t.DEF,o=new ze({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});Object.hasOwn(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD);let s=i.some(a=>typeof a.GATE=="function");return o.hasPredicates=s,r.definition.push(o),i.forEach(a=>{let c=new Ke({definition:[]});o.definition.push(c),Object.hasOwn(a,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:Object.hasOwn(a,"GATE")&&(c.ignoreAmbiguities=!0),this.recordingProdStack.push(c),a.ALT.call(this),this.recordingProdStack.pop()}),Zf}function nb(t){return t===0?"":`${t}`}function Kf(t){if(t<0||t>rb){let e=new Error(`Invalid DSL Method idx value: <${t}>
142
- Idx value must be a none negative value smaller than ${rb+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}var Jf=class{initPerformanceTracer(e){if(Object.hasOwn(e,"traceInitPerf")){let r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=Kt.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);let{time:i,value:o}=$c(r),s=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${n}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,o}else return r()}};function sb(t,e){e.forEach(r=>{let n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;let o=Object.getOwnPropertyDescriptor(n,i);o&&(o.get||o.set)?Object.defineProperty(t.prototype,i,o):t.prototype[i]=r.prototype[i]})})}var Fn=Dn(Yt,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Fn);var Kt=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:$n,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),ks=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0}),At;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(At||(At={}));function Qf(t=void 0){return function(){return t}}var Yc=class t{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;let r=this.className;this.TRACE_INIT("toFastProps",()=>{Mc(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),this.definedRulesNames.forEach(i=>{let s=this[i].originalGrammarAction,a;this.TRACE_INIT(`${i} Rule`,()=>{a=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=a})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=jR({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(n.length===0&&this.skipValidations===!1){let i=WR({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:Ur,grammarName:r}),o=MR({lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,o)}}),this.definitionErrors.length===0&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{let i=JE(Object.values(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,o;(o=(i=this.lookaheadStrategy).initialize)===null||o===void 0||o.call(i,{rules:Object.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&this.definitionErrors.length!==0)throw e=this.definitionErrors.map(i=>i.message),new Error(`Parser Definition Errors detected:
139
+ https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return el.call(this,Xe,e,r)}atLeastOneInternalRecord(e,r){el.call(this,Qe,r,e)}atLeastOneSepFirstInternalRecord(e,r){el.call(this,et,r,e,xv)}manyInternalRecord(e,r){el.call(this,we,r,e)}manySepFirstInternalRecord(e,r){el.call(this,Ye,r,e,xv)}orInternalRecord(e,r){return hL.call(this,e,r)}subruleInternalRecord(e,r,n){if(od(r),!e||!Object.hasOwn(e,"ruleName")){let a=new Error(`<SUBRULE${_v(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
140
+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}let i=this.recordingProdStack.at(-1),o=e.ruleName,s=new Ge({idx:r,nonTerminalName:o,label:n?.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?pL:sd}consumeInternalRecord(e,r,n){if(od(r),!fg(e)){let s=new Error(`<CONSUME${_v(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
141
+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}let i=this.recordingProdStack.at(-1),o=new _e({idx:r,terminalType:e,label:n?.LABEL});return i.definition.push(o),vv}};function el(t,e,r,n=!1){od(r);let i=this.recordingProdStack.at(-1),o=typeof e=="function"?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),Object.hasOwn(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),o.call(this),i.definition.push(s),this.recordingProdStack.pop(),sd}function hL(t,e){od(e);let r=this.recordingProdStack.at(-1),n=Array.isArray(t)===!1,i=n===!1?t:t.DEF,o=new Ke({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});Object.hasOwn(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD);let s=i.some(a=>typeof a.GATE=="function");return o.hasPredicates=s,r.definition.push(o),i.forEach(a=>{let c=new Je({definition:[]});o.definition.push(c),Object.hasOwn(a,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:Object.hasOwn(a,"GATE")&&(c.ignoreAmbiguities=!0),this.recordingProdStack.push(c),a.ALT.call(this),this.recordingProdStack.pop()}),sd}function _v(t){return t===0?"":`${t}`}function od(t){if(t<0||t>Tv){let e=new Error(`Invalid DSL Method idx value: <${t}>
142
+ Idx value must be a none negative value smaller than ${Tv+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}var ad=class{initPerformanceTracer(e){if(Object.hasOwn(e,"traceInitPerf")){let r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=Zt.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);let{time:i,value:o}=Xc(r),s=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${n}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,o}else return r()}};function Rv(t,e){e.forEach(r=>{let n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;let o=Object.getOwnPropertyDescriptor(n,i);o&&(o.get||o.set)?Object.defineProperty(t.prototype,i,o):t.prototype[i]=r.prototype[i]})})}var Gn=Fn(Kt,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Gn);var Zt=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Un,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Ds=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0}),St;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(St||(St={}));function cd(t=void 0){return function(){return t}}var tl=class t{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;let r=this.className;this.TRACE_INIT("toFastProps",()=>{Hc(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),this.definedRulesNames.forEach(i=>{let s=this[i].originalGrammarAction,a;this.TRACE_INIT(`${i} Rule`,()=>{a=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=a})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=av({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(n.length===0&&this.skipValidations===!1){let i=cv({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:Gr,grammarName:r}),o=ev({lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,o)}}),this.definitionErrors.length===0&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{let i=m0(Object.values(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,o;(o=(i=this.lookaheadStrategy).initialize)===null||o===void 0||o.call(i,{rules:Object.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&this.definitionErrors.length!==0)throw e=this.definitionErrors.map(i=>i.message),new Error(`Parser Definition Errors detected:
143
143
  ${e.join(`
144
144
  -------------------------------
145
145
  `)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initGastRecorder(r),n.initPerformanceTracer(r),Object.hasOwn(r,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
146
146
  Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
147
147
  See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
148
- For further details.`);this.skipValidations=Object.hasOwn(r,"skipValidations")?r.skipValidations:Kt.skipValidations}};Yc.DEFER_DEFINITION_ERRORS_HANDLING=!1;sb(Yc,[Mf,Bf,jf,Wf,zf,qf,Vf,Yf,Jf]);var Kc=class extends Yc{constructor(e,r=Kt){let n=Object.assign({},r);n.outputCst=!1,super(e,n)}};function MO(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var ed=MO;function FO(){this.__data__=[],this.size=0}var ab=FO;function UO(t,e){return t===e||t!==t&&e!==e}var td=UO;function BO(t,e){for(var r=t.length;r--;)if(td(t[r][0],e))return r;return-1}var ui=BO;var XO=Array.prototype,GO=XO.splice;function HO(t){var e=this.__data__,r=ui(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():GO.call(e,r,1),--this.size,!0}var cb=HO;function jO(t){var e=this.__data__,r=ui(e,t);return r<0?void 0:e[r][1]}var lb=jO;function WO(t){return ui(this.__data__,t)>-1}var ub=WO;function qO(t,e){var r=this.__data__,n=ui(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var fb=qO;function Ns(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ns.prototype.clear=ab;Ns.prototype.delete=cb;Ns.prototype.get=lb;Ns.prototype.has=ub;Ns.prototype.set=fb;var fi=Ns;function zO(){this.__data__=new fi,this.size=0}var db=zO;function VO(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var pb=VO;function YO(t){return this.__data__.get(t)}var hb=YO;function KO(t){return this.__data__.has(t)}var mb=KO;var ZO=typeof global=="object"&&global&&global.Object===Object&&global,rd=ZO;var JO=typeof self=="object"&&self&&self.Object===Object&&self,QO=rd||JO||Function("return this")(),vt=QO;var eL=vt.Symbol,Zt=eL;var gb=Object.prototype,tL=gb.hasOwnProperty,rL=gb.toString,Zc=Zt?Zt.toStringTag:void 0;function nL(t){var e=tL.call(t,Zc),r=t[Zc];try{t[Zc]=void 0;var n=!0}catch{}var i=rL.call(t);return n&&(e?t[Zc]=r:delete t[Zc]),i}var yb=nL;var iL=Object.prototype,oL=iL.toString;function sL(t){return oL.call(t)}var xb=sL;var aL="[object Null]",cL="[object Undefined]",Tb=Zt?Zt.toStringTag:void 0;function lL(t){return t==null?t===void 0?cL:aL:Tb&&Tb in Object(t)?yb(t):xb(t)}var Br=lL;function uL(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ps=uL;var fL="[object AsyncFunction]",dL="[object Function]",pL="[object GeneratorFunction]",hL="[object Proxy]";function mL(t){if(!Ps(t))return!1;var e=Br(t);return e==dL||e==pL||e==fL||e==hL}var nd=mL;var gL=vt["__core-js_shared__"],id=gL;var _b=(function(){var t=/[^.]+$/.exec(id&&id.keys&&id.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function yL(t){return!!_b&&_b in t}var Eb=yL;var xL=Function.prototype,TL=xL.toString;function _L(t){if(t!=null){try{return TL.call(t)}catch{}try{return t+""}catch{}}return""}var Un=_L;var EL=/[\\^$.*+?()[\]{}|]/g,RL=/^\[object .+?Constructor\]$/,bL=Function.prototype,wL=Object.prototype,AL=bL.toString,IL=wL.hasOwnProperty,SL=RegExp("^"+AL.call(IL).replace(EL,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function vL(t){if(!Ps(t)||Eb(t))return!1;var e=nd(t)?SL:RL;return e.test(Un(t))}var Rb=vL;function kL(t,e){return t?.[e]}var bb=kL;function NL(t,e){var r=bb(t,e);return Rb(r)?r:void 0}var Rr=NL;var PL=Rr(vt,"Map"),di=PL;var CL=Rr(Object,"create"),Bn=CL;function OL(){this.__data__=Bn?Bn(null):{},this.size=0}var wb=OL;function LL(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Ab=LL;var DL="__lodash_hash_undefined__",$L=Object.prototype,ML=$L.hasOwnProperty;function FL(t){var e=this.__data__;if(Bn){var r=e[t];return r===DL?void 0:r}return ML.call(e,t)?e[t]:void 0}var Ib=FL;var UL=Object.prototype,BL=UL.hasOwnProperty;function XL(t){var e=this.__data__;return Bn?e[t]!==void 0:BL.call(e,t)}var Sb=XL;var GL="__lodash_hash_undefined__";function HL(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Bn&&e===void 0?GL:e,this}var vb=HL;function Cs(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Cs.prototype.clear=wb;Cs.prototype.delete=Ab;Cs.prototype.get=Ib;Cs.prototype.has=Sb;Cs.prototype.set=vb;var Eg=Cs;function jL(){this.size=0,this.__data__={hash:new Eg,map:new(di||fi),string:new Eg}}var kb=jL;function WL(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Nb=WL;function qL(t,e){var r=t.__data__;return Nb(e)?r[typeof e=="string"?"string":"hash"]:r.map}var pi=qL;function zL(t){var e=pi(this,t).delete(t);return this.size-=e?1:0,e}var Pb=zL;function VL(t){return pi(this,t).get(t)}var Cb=VL;function YL(t){return pi(this,t).has(t)}var Ob=YL;function KL(t,e){var r=pi(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var Lb=KL;function Os(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Os.prototype.clear=kb;Os.prototype.delete=Pb;Os.prototype.get=Cb;Os.prototype.has=Ob;Os.prototype.set=Lb;var yo=Os;var ZL=200;function JL(t,e){var r=this.__data__;if(r instanceof fi){var n=r.__data__;if(!di||n.length<ZL-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new yo(n)}return r.set(t,e),this.size=r.size,this}var Db=JL;function Ls(t){var e=this.__data__=new fi(t);this.size=e.size}Ls.prototype.clear=db;Ls.prototype.delete=pb;Ls.prototype.get=hb;Ls.prototype.has=mb;Ls.prototype.set=Db;var Ds=Ls;var QL="__lodash_hash_undefined__";function eD(t){return this.__data__.set(t,QL),this}var $b=eD;function tD(t){return this.__data__.has(t)}var Mb=tD;function od(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new yo;++e<r;)this.add(t[e])}od.prototype.add=od.prototype.push=$b;od.prototype.has=Mb;var sd=od;function rD(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var Fb=rD;function nD(t,e){return t.has(e)}var ad=nD;var iD=1,oD=2;function sD(t,e,r,n,i,o){var s=r&iD,a=t.length,c=e.length;if(a!=c&&!(s&&c>a))return!1;var l=o.get(t),u=o.get(e);if(l&&u)return l==e&&u==t;var f=-1,d=!0,p=r&oD?new sd:void 0;for(o.set(t,e),o.set(e,t);++f<a;){var m=t[f],y=e[f];if(n)var R=s?n(y,m,f,e,t,o):n(m,y,f,t,e,o);if(R!==void 0){if(R)continue;d=!1;break}if(p){if(!Fb(e,function(T,E){if(!ad(p,E)&&(m===T||i(m,T,r,n,o)))return p.push(E)})){d=!1;break}}else if(!(m===y||i(m,y,r,n,o))){d=!1;break}}return o.delete(t),o.delete(e),d}var cd=sD;var aD=vt.Uint8Array,Rg=aD;function cD(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}var Ub=cD;function lD(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var $s=lD;var uD=1,fD=2,dD="[object Boolean]",pD="[object Date]",hD="[object Error]",mD="[object Map]",gD="[object Number]",yD="[object RegExp]",xD="[object Set]",TD="[object String]",_D="[object Symbol]",ED="[object ArrayBuffer]",RD="[object DataView]",Bb=Zt?Zt.prototype:void 0,bg=Bb?Bb.valueOf:void 0;function bD(t,e,r,n,i,o,s){switch(r){case RD:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case ED:return!(t.byteLength!=e.byteLength||!o(new Rg(t),new Rg(e)));case dD:case pD:case gD:return td(+t,+e);case hD:return t.name==e.name&&t.message==e.message;case yD:case TD:return t==e+"";case mD:var a=Ub;case xD:var c=n&uD;if(a||(a=$s),t.size!=e.size&&!c)return!1;var l=s.get(t);if(l)return l==e;n|=fD,s.set(t,e);var u=cd(a(t),a(e),n,i,o,s);return s.delete(t),u;case _D:if(bg)return bg.call(t)==bg.call(e)}return!1}var Xb=bD;function wD(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var ld=wD;var AD=Array.isArray,Ge=AD;function ID(t,e,r){var n=e(t);return Ge(t)?n:ld(n,r(t))}var Gb=ID;function SD(t,e){for(var r=-1,n=t==null?0:t.length,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}var ud=SD;function vD(){return[]}var Hb=vD;var kD=Object.prototype,ND=kD.propertyIsEnumerable,jb=Object.getOwnPropertySymbols,PD=jb?function(t){return t==null?[]:(t=Object(t),ud(jb(t),function(e){return ND.call(t,e)}))}:Hb,Wb=PD;function CD(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var qb=CD;function OD(t){return t!=null&&typeof t=="object"}var Xr=OD;var LD="[object Arguments]";function DD(t){return Xr(t)&&Br(t)==LD}var wg=DD;var zb=Object.prototype,$D=zb.hasOwnProperty,MD=zb.propertyIsEnumerable,FD=wg((function(){return arguments})())?wg:function(t){return Xr(t)&&$D.call(t,"callee")&&!MD.call(t,"callee")},hi=FD;function UD(){return!1}var Vb=UD;var Zb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Yb=Zb&&typeof module=="object"&&module&&!module.nodeType&&module,BD=Yb&&Yb.exports===Zb,Kb=BD?vt.Buffer:void 0,XD=Kb?Kb.isBuffer:void 0,GD=XD||Vb,xo=GD;var HD=9007199254740991,jD=/^(?:0|[1-9]\d*)$/;function WD(t,e){var r=typeof t;return e=e??HD,!!e&&(r=="number"||r!="symbol"&&jD.test(t))&&t>-1&&t%1==0&&t<e}var fd=WD;var qD=9007199254740991;function zD(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=qD}var Ms=zD;var VD="[object Arguments]",YD="[object Array]",KD="[object Boolean]",ZD="[object Date]",JD="[object Error]",QD="[object Function]",e$="[object Map]",t$="[object Number]",r$="[object Object]",n$="[object RegExp]",i$="[object Set]",o$="[object String]",s$="[object WeakMap]",a$="[object ArrayBuffer]",c$="[object DataView]",l$="[object Float32Array]",u$="[object Float64Array]",f$="[object Int8Array]",d$="[object Int16Array]",p$="[object Int32Array]",h$="[object Uint8Array]",m$="[object Uint8ClampedArray]",g$="[object Uint16Array]",y$="[object Uint32Array]",tt={};tt[l$]=tt[u$]=tt[f$]=tt[d$]=tt[p$]=tt[h$]=tt[m$]=tt[g$]=tt[y$]=!0;tt[VD]=tt[YD]=tt[a$]=tt[KD]=tt[c$]=tt[ZD]=tt[JD]=tt[QD]=tt[e$]=tt[t$]=tt[r$]=tt[n$]=tt[i$]=tt[o$]=tt[s$]=!1;function x$(t){return Xr(t)&&Ms(t.length)&&!!tt[Br(t)]}var Jb=x$;function T$(t){return function(e){return t(e)}}var Qb=T$;var ew=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Jc=ew&&typeof module=="object"&&module&&!module.nodeType&&module,_$=Jc&&Jc.exports===ew,Ag=_$&&rd.process,E$=(function(){try{var t=Jc&&Jc.require&&Jc.require("util").types;return t||Ag&&Ag.binding&&Ag.binding("util")}catch{}})(),Ig=E$;var tw=Ig&&Ig.isTypedArray,R$=tw?Qb(tw):Jb,Fs=R$;var b$=Object.prototype,w$=b$.hasOwnProperty;function A$(t,e){var r=Ge(t),n=!r&&hi(t),i=!r&&!n&&xo(t),o=!r&&!n&&!i&&Fs(t),s=r||n||i||o,a=s?qb(t.length,String):[],c=a.length;for(var l in t)(e||w$.call(t,l))&&!(s&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||fd(l,c)))&&a.push(l);return a}var rw=A$;var I$=Object.prototype;function S$(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||I$;return t===r}var dd=S$;function v$(t,e){return function(r){return t(e(r))}}var nw=v$;var k$=nw(Object.keys,Object),iw=k$;var N$=Object.prototype,P$=N$.hasOwnProperty;function C$(t){if(!dd(t))return iw(t);var e=[];for(var r in Object(t))P$.call(t,r)&&r!="constructor"&&e.push(r);return e}var pd=C$;function O$(t){return t!=null&&Ms(t.length)&&!nd(t)}var mi=O$;function L$(t){return mi(t)?rw(t):pd(t)}var Us=L$;function D$(t){return Gb(t,Us,Wb)}var Sg=D$;var $$=1,M$=Object.prototype,F$=M$.hasOwnProperty;function U$(t,e,r,n,i,o){var s=r&$$,a=Sg(t),c=a.length,l=Sg(e),u=l.length;if(c!=u&&!s)return!1;for(var f=c;f--;){var d=a[f];if(!(s?d in e:F$.call(e,d)))return!1}var p=o.get(t),m=o.get(e);if(p&&m)return p==e&&m==t;var y=!0;o.set(t,e),o.set(e,t);for(var R=s;++f<c;){d=a[f];var T=t[d],E=e[d];if(n)var _=s?n(E,T,d,e,t,o):n(T,E,d,t,e,o);if(!(_===void 0?T===E||i(T,E,r,n,o):_)){y=!1;break}R||(R=d=="constructor")}if(y&&!R){var k=t.constructor,D=e.constructor;k!=D&&"constructor"in t&&"constructor"in e&&!(typeof k=="function"&&k instanceof k&&typeof D=="function"&&D instanceof D)&&(y=!1)}return o.delete(t),o.delete(e),y}var ow=U$;var B$=Rr(vt,"DataView"),hd=B$;var X$=Rr(vt,"Promise"),md=X$;var G$=Rr(vt,"Set"),gi=G$;var H$=Rr(vt,"WeakMap"),gd=H$;var sw="[object Map]",j$="[object Object]",aw="[object Promise]",cw="[object Set]",lw="[object WeakMap]",uw="[object DataView]",W$=Un(hd),q$=Un(di),z$=Un(md),V$=Un(gi),Y$=Un(gd),To=Br;(hd&&To(new hd(new ArrayBuffer(1)))!=uw||di&&To(new di)!=sw||md&&To(md.resolve())!=aw||gi&&To(new gi)!=cw||gd&&To(new gd)!=lw)&&(To=function(t){var e=Br(t),r=e==j$?t.constructor:void 0,n=r?Un(r):"";if(n)switch(n){case W$:return uw;case q$:return sw;case z$:return aw;case V$:return cw;case Y$:return lw}return e});var Qc=To;var K$=1,fw="[object Arguments]",dw="[object Array]",yd="[object Object]",Z$=Object.prototype,pw=Z$.hasOwnProperty;function J$(t,e,r,n,i,o){var s=Ge(t),a=Ge(e),c=s?dw:Qc(t),l=a?dw:Qc(e);c=c==fw?yd:c,l=l==fw?yd:l;var u=c==yd,f=l==yd,d=c==l;if(d&&xo(t)){if(!xo(e))return!1;s=!0,u=!1}if(d&&!u)return o||(o=new Ds),s||Fs(t)?cd(t,e,r,n,i,o):Xb(t,e,c,r,n,i,o);if(!(r&K$)){var p=u&&pw.call(t,"__wrapped__"),m=f&&pw.call(e,"__wrapped__");if(p||m){var y=p?t.value():t,R=m?e.value():e;return o||(o=new Ds),i(y,R,r,n,o)}}return d?(o||(o=new Ds),ow(t,e,r,n,i,o)):!1}var hw=J$;function mw(t,e,r,n,i){return t===e?!0:t==null||e==null||!Xr(t)&&!Xr(e)?t!==t&&e!==e:hw(t,e,r,n,mw,i)}var xd=mw;var Q$=1,eM=2;function tM(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=r[i];var c=a[0],l=t[c],u=a[1];if(s&&a[2]){if(l===void 0&&!(c in t))return!1}else{var f=new Ds;if(n)var d=n(l,u,c,t,e,f);if(!(d===void 0?xd(u,l,Q$|eM,n,f):d))return!1}}return!0}var gw=tM;function rM(t){return t===t&&!Ps(t)}var Td=rM;function nM(t){for(var e=Us(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,Td(i)]}return e}var yw=nM;function iM(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var _d=iM;function oM(t){var e=yw(t);return e.length==1&&e[0][2]?_d(e[0][0],e[0][1]):function(r){return r===t||gw(r,t,e)}}var xw=oM;var sM="[object Symbol]";function aM(t){return typeof t=="symbol"||Xr(t)&&Br(t)==sM}var yi=aM;var cM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,lM=/^\w*$/;function uM(t,e){if(Ge(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||yi(t)?!0:lM.test(t)||!cM.test(t)||e!=null&&t in Object(e)}var Bs=uM;var fM="Expected a function";function vg(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(fM);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(vg.Cache||yo),r}vg.Cache=yo;var Tw=vg;var dM=500;function pM(t){var e=Tw(t,function(n){return r.size===dM&&r.clear(),n}),r=e.cache;return e}var _w=pM;var hM=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,mM=/\\(\\)?/g,gM=_w(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(hM,function(r,n,i,o){e.push(i?o.replace(mM,"$1"):n||r)}),e}),Ew=gM;var yM=1/0,Rw=Zt?Zt.prototype:void 0,bw=Rw?Rw.toString:void 0;function ww(t){if(typeof t=="string")return t;if(Ge(t))return ed(t,ww)+"";if(yi(t))return bw?bw.call(t):"";var e=t+"";return e=="0"&&1/t==-yM?"-0":e}var Aw=ww;function xM(t){return t==null?"":Aw(t)}var Iw=xM;function TM(t,e){return Ge(t)?t:Bs(t,e)?[t]:Ew(Iw(t))}var Ed=TM;var _M=1/0;function EM(t){if(typeof t=="string"||yi(t))return t;var e=t+"";return e=="0"&&1/t==-_M?"-0":e}var xi=EM;function RM(t,e){e=Ed(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[xi(e[r++])];return r&&r==n?t:void 0}var Rd=RM;function bM(t,e,r){var n=t==null?void 0:Rd(t,e);return n===void 0?r:n}var Sw=bM;function wM(t,e){return t!=null&&e in Object(t)}var vw=wM;function AM(t,e,r){e=Ed(e,t);for(var n=-1,i=e.length,o=!1;++n<i;){var s=xi(e[n]);if(!(o=t!=null&&r(t,s)))break;t=t[s]}return o||++n!=i?o:(i=t==null?0:t.length,!!i&&Ms(i)&&fd(s,i)&&(Ge(t)||hi(t)))}var kw=AM;function IM(t,e){return t!=null&&kw(t,e,vw)}var Nw=IM;var SM=1,vM=2;function kM(t,e){return Bs(t)&&Td(e)?_d(xi(t),e):function(r){var n=Sw(r,t);return n===void 0&&n===e?Nw(r,t):xd(e,n,SM|vM)}}var Pw=kM;function NM(t){return t}var Xs=NM;function PM(t){return function(e){return e?.[t]}}var Cw=PM;function CM(t){return function(e){return Rd(e,t)}}var Ow=CM;function OM(t){return Bs(t)?Cw(xi(t)):Ow(t)}var Lw=OM;function LM(t){return typeof t=="function"?t:t==null?Xs:typeof t=="object"?Ge(t)?Pw(t[0],t[1]):xw(t):Lw(t)}var Ti=LM;function DM(t){return function(e,r,n){for(var i=-1,o=Object(e),s=n(e),a=s.length;a--;){var c=s[t?a:++i];if(r(o[c],c,o)===!1)break}return e}}var Dw=DM;var $M=Dw(),$w=$M;function MM(t,e){return t&&$w(t,e,Us)}var Mw=MM;function FM(t,e){return function(r,n){if(r==null)return r;if(!mi(r))return t(r,n);for(var i=r.length,o=e?i:-1,s=Object(r);(e?o--:++o<i)&&n(s[o],o,s)!==!1;);return r}}var Fw=FM;var UM=Fw(Mw),_i=UM;function BM(t,e){var r=-1,n=mi(t)?Array(t.length):[];return _i(t,function(i,o,s){n[++r]=e(i,o,s)}),n}var Uw=BM;function XM(t,e){var r=Ge(t)?ed:Uw;return r(t,Ti(e,3))}var pr=XM;function GM(t,e){var r=[];return _i(t,function(n,i,o){e(n,i,o)&&r.push(n)}),r}var Bw=GM;function HM(t,e){var r=Ge(t)?ud:Bw;return r(t,Ti(e,3))}var Xw=HM;function _o(t,e,r){return`${t.name}_${e}_${r}`}var Ei=1,jM=2,Gw=4,Hw=5;var Eo=7,WM=8,qM=9,zM=10,VM=11,jw=12,el=class{constructor(e){this.target=e}isEpsilon(){return!1}},Gs=class extends el{constructor(e,r){super(e),this.tokenType=r}},tl=class extends el{constructor(e){super(e)}isEpsilon(){return!0}},Hs=class extends el{constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}};function Ww(t){let e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};YM(e,t);let r=t.length;for(let n=0;n<r;n++){let i=t[n],o=Ro(e,i,i);o!==void 0&&s1(e,i,o)}return e}function YM(t,e){let r=e.length;for(let n=0;n<r;n++){let i=e[n],o=kt(t,i,void 0,{type:jM}),s=kt(t,i,void 0,{type:Eo});o.stop=s,t.ruleToStartState.set(i,o),t.ruleToStopState.set(i,s)}}function qw(t,e,r){return r instanceof ge?kg(t,e,r.terminalType,r):r instanceof Me?o1(t,e,r):r instanceof ze?e1(t,e,r):r instanceof Fe?t1(t,e,r):r instanceof be?KM(t,e,r):r instanceof qe?ZM(t,e,r):r instanceof Ze?JM(t,e,r):r instanceof Je?QM(t,e,r):Ro(t,e,r)}function KM(t,e,r){let n=kt(t,e,r,{type:Hw});Ri(t,n);let i=js(t,e,n,r,Ro(t,e,r));return Vw(t,e,r,i)}function ZM(t,e,r){let n=kt(t,e,r,{type:Hw});Ri(t,n);let i=js(t,e,n,r,Ro(t,e,r)),o=kg(t,e,r.separator,r);return Vw(t,e,r,i,o)}function JM(t,e,r){let n=kt(t,e,r,{type:Gw});Ri(t,n);let i=js(t,e,n,r,Ro(t,e,r));return zw(t,e,r,i)}function QM(t,e,r){let n=kt(t,e,r,{type:Gw});Ri(t,n);let i=js(t,e,n,r,Ro(t,e,r)),o=kg(t,e,r.separator,r);return zw(t,e,r,i,o)}function e1(t,e,r){let n=kt(t,e,r,{type:Ei});Ri(t,n);let i=pr(r.definition,s=>qw(t,e,s));return js(t,e,n,r,...i)}function t1(t,e,r){let n=kt(t,e,r,{type:Ei});Ri(t,n);let i=js(t,e,n,r,Ro(t,e,r));return r1(t,e,r,i)}function Ro(t,e,r){let n=Xw(pr(r.definition,i=>qw(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:i1(t,n)}function zw(t,e,r,n,i){let o=n.left,s=n.right,a=kt(t,e,r,{type:VM});Ri(t,a);let c=kt(t,e,r,{type:jw});return o.loopback=a,c.loopback=a,t.decisionMap[_o(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=a,Rt(s,a),i===void 0?(Rt(a,o),Rt(a,c)):(Rt(a,c),Rt(a,i.left),Rt(i.right,o)),{left:o,right:c}}function Vw(t,e,r,n,i){let o=n.left,s=n.right,a=kt(t,e,r,{type:zM});Ri(t,a);let c=kt(t,e,r,{type:jw}),l=kt(t,e,r,{type:qM});return a.loopback=l,c.loopback=l,Rt(a,o),Rt(a,c),Rt(s,l),i!==void 0?(Rt(l,c),Rt(l,i.left),Rt(i.right,o)):Rt(l,a),t.decisionMap[_o(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=a,{left:a,right:c}}function r1(t,e,r,n){let i=n.left,o=n.right;return Rt(i,o),t.decisionMap[_o(e,"Option",r.idx)]=i,n}function Ri(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function js(t,e,r,n,...i){let o=kt(t,e,n,{type:WM,start:r});r.end=o;for(let a of i)a!==void 0?(Rt(r,a.left),Rt(a.right,o)):Rt(r,o);let s={left:r,right:o};return t.decisionMap[_o(e,n1(n),n.idx)]=r,s}function n1(t){if(t instanceof ze)return"Alternation";if(t instanceof Fe)return"Option";if(t instanceof be)return"Repetition";if(t instanceof qe)return"RepetitionWithSeparator";if(t instanceof Ze)return"RepetitionMandatory";if(t instanceof Je)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function i1(t,e){let r=e.length;for(let o=0;o<r-1;o++){let s=e[o],a;s.left.transitions.length===1&&(a=s.left.transitions[0]);let c=a instanceof Hs,l=a,u=e[o+1].left;s.left.type===Ei&&s.right.type===Ei&&a!==void 0&&(c&&l.followState===s.right||a.target===s.right)?(c?l.followState=u:a.target=u,a1(t,s.right)):Rt(s.right,u)}let n=e[0],i=e[r-1];return{left:n.left,right:i.right}}function kg(t,e,r,n){let i=kt(t,e,n,{type:Ei}),o=kt(t,e,n,{type:Ei});return Ng(i,new Gs(o,r)),{left:i,right:o}}function o1(t,e,r){let n=r.referencedRule,i=t.ruleToStartState.get(n),o=kt(t,e,r,{type:Ei}),s=kt(t,e,r,{type:Ei}),a=new Hs(i,n,s);return Ng(o,a),{left:o,right:s}}function s1(t,e,r){let n=t.ruleToStartState.get(e);Rt(n,r.left);let i=t.ruleToStopState.get(e);return Rt(r.right,i),{left:n,right:i}}function Rt(t,e){let r=new tl(e);Ng(t,r)}function kt(t,e,r,n){let i=Object.assign({atn:t,production:r,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},n);return t.states.push(i),i}function Ng(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function a1(t,e){t.states.splice(t.states.indexOf(e),1)}var rl={},Ws=class{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){let r=Pg(e);r in this.map||(this.map[r]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return pr(this.configs,e=>e.alt)}get key(){let e="";for(let r in this.map)e+=r+":";return e}};function Pg(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}function c1(t,e,r){for(var n=-1,i=t.length;++n<i;){var o=t[n],s=e(o);if(s!=null&&(a===void 0?s===s&&!yi(s):r(s,a)))var a=s,c=o}return c}var Yw=c1;function l1(t,e){return t<e}var Kw=l1;function u1(t){return t&&t.length?Yw(t,Xs,Kw):void 0}var Zw=u1;var Jw=Zt?Zt.isConcatSpreadable:void 0;function f1(t){return Ge(t)||hi(t)||!!(Jw&&t&&t[Jw])}var Qw=f1;function eA(t,e,r,n,i){var o=-1,s=t.length;for(r||(r=Qw),i||(i=[]);++o<s;){var a=t[o];e>0&&r(a)?e>1?eA(a,e-1,r,n,i):ld(i,a):n||(i[i.length]=a)}return i}var bd=eA;function d1(t,e){return bd(pr(t,e),1)}var tA=d1;function p1(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}var rA=p1;function h1(t){return t!==t}var nA=h1;function m1(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}var iA=m1;function g1(t,e,r){return e===e?iA(t,e,r):rA(t,nA,r)}var oA=g1;function y1(t,e){var r=t==null?0:t.length;return!!r&&oA(t,e,0)>-1}var sA=y1;function x1(t,e,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}var aA=x1;function T1(){}var cA=T1;var _1=1/0,E1=gi&&1/$s(new gi([,-0]))[1]==_1?function(t){return new gi(t)}:cA,lA=E1;var R1=200;function b1(t,e,r){var n=-1,i=sA,o=t.length,s=!0,a=[],c=a;if(r)s=!1,i=aA;else if(o>=R1){var l=e?null:lA(t);if(l)return $s(l);s=!1,i=ad,c=new sd}else c=e?[]:a;e:for(;++n<o;){var u=t[n],f=e?e(u):u;if(u=r||u!==0?u:0,s&&f===f){for(var d=c.length;d--;)if(c[d]===f)continue e;e&&c.push(f),a.push(u)}else i(c,f,r)||(c!==a&&c.push(f),a.push(u))}return a}var uA=b1;function w1(t,e){return t&&t.length?uA(t,Ti(e,2)):[]}var fA=w1;function A1(t){var e=t==null?0:t.length;return e?bd(t,1):[]}var dA=A1;function I1(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var pA=I1;function S1(t){return typeof t=="function"?t:Xs}var hA=S1;function v1(t,e){var r=Ge(t)?pA:_i;return r(t,hA(e))}var wd=v1;var k1="[object Map]",N1="[object Set]",P1=Object.prototype,C1=P1.hasOwnProperty;function O1(t){if(t==null)return!0;if(mi(t)&&(Ge(t)||typeof t=="string"||typeof t.splice=="function"||xo(t)||Fs(t)||hi(t)))return!t.length;var e=Qc(t);if(e==k1||e==N1)return!t.size;if(dd(t))return!pd(t).length;for(var r in t)if(C1.call(t,r))return!1;return!0}var mA=O1;function L1(t,e,r,n){var i=-1,o=t==null?0:t.length;for(n&&o&&(r=t[++i]);++i<o;)r=e(r,t[i],i,t);return r}var gA=L1;function D1(t,e,r,n,i){return i(t,function(o,s,a){r=n?(n=!1,o):e(r,o,s,a)}),r}var yA=D1;function $1(t,e,r){var n=Ge(t)?gA:yA,i=arguments.length<3;return n(t,Ti(e,4),r,i,_i)}var Cg=$1;function M1(t,e){let r={};return n=>{let i=n.toString(),o=r[i];return o!==void 0||(o={atnStartState:t,decision:e,states:{}},r[i]=o),o}}var Ad=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="",r=this.predicates.length;for(let n=0;n<r;n++)e+=this.predicates[n]===!0?"1":"0";return e}},xA=new Ad,nl=class extends Mn{constructor(e){var r,n;super(),this.logging=(r=e?.logging)!==null&&r!==void 0?r:(i=>console.log(i)),this.incomplete=(n=e?.incomplete)!==null&&n!==void 0?n:!1}initialize(e){this.atn=Ww(e.rules),this.dfas=F1(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){let{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:o}=e,s=this.dfas,a=this.logging,c=this.incomplete,l=_o(n,"Alternation",r),f=this.atn.decisionMap[l].decision,d=pr(Lf({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),p=>pr(p,m=>m[0]));if(TA(d,!1)&&!o){let p=Cg(d,(m,y,R)=>(wd(y,T=>{T&&(m[T.tokenTypeIdx]=R,wd(T.categoryMatches,E=>{m[E]=R}))}),m),{});return i?function(m){var y;let R=this.LA_FAST(1),T=p[R.tokenTypeIdx];if(m!==void 0&&T!==void 0){let E=(y=m[T])===null||y===void 0?void 0:y.GATE;if(E!==void 0&&E.call(this)===!1)return}return T}:function(){let m=this.LA_FAST(1);return p[m.tokenTypeIdx]}}else return i?function(p){let m=new Ad,y=p===void 0?0:p.length;for(let T=0;T<y;T++){let E=p?.[T].GATE;m.set(T,E===void 0||E.call(this))}let R=Og.call(this,s,f,m,a,c);return typeof R=="number"?R:void 0}:function(){let p=Og.call(this,s,f,xA,a,c);return typeof p=="number"?p:void 0}}buildLookaheadForOptional(e){let{prodOccurrence:r,rule:n,prodType:i,dynamicTokensEnabled:o}=e,s=this.dfas,a=this.logging,c=this.incomplete,l=_o(n,i,r),f=this.atn.decisionMap[l].decision,d=pr(Lf({maxLookahead:1,occurrence:r,prodType:i,rule:n}),p=>pr(p,m=>m[0]));if(TA(d)&&d[0][0]&&!o){let p=d[0],m=dA(p);if(m.length===1&&mA(m[0].categoryMatches)){let R=m[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===R}}else{let y=Cg(m,(R,T)=>(T!==void 0&&(R[T.tokenTypeIdx]=!0,wd(T.categoryMatches,E=>{R[E]=!0})),R),{});return function(){let R=this.LA_FAST(1);return y[R.tokenTypeIdx]===!0}}}return function(){let p=Og.call(this,s,f,xA,a,c);return typeof p=="object"?!1:p===0}}};function TA(t,e=!0){let r=new Set;for(let n of t){let i=new Set;for(let o of n){if(o===void 0){if(e)break;return!1}let s=[o.tokenTypeIdx].concat(o.categoryMatches);for(let a of s)if(r.has(a)){if(!i.has(a))return!1}else r.add(a),i.add(a)}}return!0}function F1(t){let e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=M1(t.decisionStates[n],n);return r}function Og(t,e,r,n,i){let o=t[e](r),s=o.start;if(s===void 0){let c=Y1(o.atnStartState);s=RA(o,EA(c)),o.start=s}return U1.apply(this,[o,s,r,n,i])}function U1(t,e,r,n,i){let o=e,s=1,a=[],c=this.LA_FAST(s++);for(;;){let l=W1(o,c);if(l===void 0&&(l=B1.apply(this,[t,o,c,s,r,n])),l===rl)return j1(a,o,c);if(l.isAcceptState===!0){if(i===!0&&ws(c,Yt)){let u=nF(o,r);if(u!==void 0)return u}return l.prediction}o=l,a.push(c),c=this.LA(s++)}}function B1(t,e,r,n,i,o){let s=q1(e.configs,r,i);if(s.size===0)return _A(t,e,r,rl),rl;let a=EA(s),c=V1(s,i);if(c!==void 0)a.isAcceptState=!0,a.prediction=c,a.configs.uniqueAlt=c;else if(Q1(s)){let l=Zw(s.alts);a.isAcceptState=!0,a.prediction=l,a.configs.uniqueAlt=l,X1.apply(this,[t,n,s.alts,o])}return a=_A(t,e,r,a),a}function X1(t,e,r,n){let i=[];for(let l=1;l<=e;l++)i.push(this.LA(l).tokenType);let o=t.atnStartState,s=o.rule,a=o.production,c=G1({topLevelRule:s,ambiguityIndices:r,production:a,prefixPath:i});n(c)}function G1(t){let e=pr(t.prefixPath,i=>Ln(i)).join(", "),r=t.production.idx===0?"":t.production.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${H1(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,
148
+ For further details.`);this.skipValidations=Object.hasOwn(r,"skipValidations")?r.skipValidations:Zt.skipValidations}};tl.DEFER_DEFINITION_ERRORS_HANDLING=!1;Rv(tl,[qf,Yf,Qf,ed,rd,td,nd,id,ad]);var rl=class extends tl{constructor(e,r=Zt){let n=Object.assign({},r);n.outputCst=!1,super(e,n)}};function gL(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var ld=gL;function yL(){this.__data__=[],this.size=0}var wv=yL;function xL(t,e){return t===e||t!==t&&e!==e}var ud=xL;function TL(t,e){for(var r=t.length;r--;)if(ud(t[r][0],e))return r;return-1}var mi=TL;var _L=Array.prototype,EL=_L.splice;function vL(t){var e=this.__data__,r=mi(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():EL.call(e,r,1),--this.size,!0}var bv=vL;function RL(t){var e=this.__data__,r=mi(e,t);return r<0?void 0:e[r][1]}var Av=RL;function wL(t){return mi(this.__data__,t)>-1}var Sv=wL;function bL(t,e){var r=this.__data__,n=mi(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var Iv=bL;function $s(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}$s.prototype.clear=wv;$s.prototype.delete=bv;$s.prototype.get=Av;$s.prototype.has=Sv;$s.prototype.set=Iv;var gi=$s;function AL(){this.__data__=new gi,this.size=0}var kv=AL;function SL(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var Nv=SL;function IL(t){return this.__data__.get(t)}var Pv=IL;function kL(t){return this.__data__.has(t)}var Cv=kL;var NL=typeof global=="object"&&global&&global.Object===Object&&global,fd=NL;var PL=typeof self=="object"&&self&&self.Object===Object&&self,CL=fd||PL||Function("return this")(),Nt=CL;var OL=Nt.Symbol,Jt=OL;var Ov=Object.prototype,LL=Ov.hasOwnProperty,DL=Ov.toString,nl=Jt?Jt.toStringTag:void 0;function $L(t){var e=LL.call(t,nl),r=t[nl];try{t[nl]=void 0;var n=!0}catch{}var i=DL.call(t);return n&&(e?t[nl]=r:delete t[nl]),i}var Lv=$L;var ML=Object.prototype,FL=ML.toString;function UL(t){return FL.call(t)}var Dv=UL;var BL="[object Null]",GL="[object Undefined]",$v=Jt?Jt.toStringTag:void 0;function XL(t){return t==null?t===void 0?GL:BL:$v&&$v in Object(t)?Lv(t):Dv(t)}var Xr=XL;function HL(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ms=HL;var jL="[object AsyncFunction]",zL="[object Function]",qL="[object GeneratorFunction]",WL="[object Proxy]";function VL(t){if(!Ms(t))return!1;var e=Xr(t);return e==zL||e==qL||e==jL||e==WL}var dd=VL;var YL=Nt["__core-js_shared__"],pd=YL;var Mv=(function(){var t=/[^.]+$/.exec(pd&&pd.keys&&pd.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function KL(t){return!!Mv&&Mv in t}var Fv=KL;var ZL=Function.prototype,JL=ZL.toString;function QL(t){if(t!=null){try{return JL.call(t)}catch{}try{return t+""}catch{}}return""}var Xn=QL;var eD=/[\\^$.*+?()[\]{}|]/g,tD=/^\[object .+?Constructor\]$/,rD=Function.prototype,nD=Object.prototype,iD=rD.toString,oD=nD.hasOwnProperty,sD=RegExp("^"+iD.call(oD).replace(eD,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function aD(t){if(!Ms(t)||Fv(t))return!1;var e=dd(t)?sD:tD;return e.test(Xn(t))}var Uv=aD;function cD(t,e){return t?.[e]}var Bv=cD;function lD(t,e){var r=Bv(t,e);return Uv(r)?r:void 0}var wr=lD;var uD=wr(Nt,"Map"),yi=uD;var fD=wr(Object,"create"),Hn=fD;function dD(){this.__data__=Hn?Hn(null):{},this.size=0}var Gv=dD;function pD(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Xv=pD;var hD="__lodash_hash_undefined__",mD=Object.prototype,gD=mD.hasOwnProperty;function yD(t){var e=this.__data__;if(Hn){var r=e[t];return r===hD?void 0:r}return gD.call(e,t)?e[t]:void 0}var Hv=yD;var xD=Object.prototype,TD=xD.hasOwnProperty;function _D(t){var e=this.__data__;return Hn?e[t]!==void 0:TD.call(e,t)}var jv=_D;var ED="__lodash_hash_undefined__";function vD(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Hn&&e===void 0?ED:e,this}var zv=vD;function Fs(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Fs.prototype.clear=Gv;Fs.prototype.delete=Xv;Fs.prototype.get=Hv;Fs.prototype.has=jv;Fs.prototype.set=zv;var Pg=Fs;function RD(){this.size=0,this.__data__={hash:new Pg,map:new(yi||gi),string:new Pg}}var qv=RD;function wD(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Wv=wD;function bD(t,e){var r=t.__data__;return Wv(e)?r[typeof e=="string"?"string":"hash"]:r.map}var xi=bD;function AD(t){var e=xi(this,t).delete(t);return this.size-=e?1:0,e}var Vv=AD;function SD(t){return xi(this,t).get(t)}var Yv=SD;function ID(t){return xi(this,t).has(t)}var Kv=ID;function kD(t,e){var r=xi(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var Zv=kD;function Us(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Us.prototype.clear=qv;Us.prototype.delete=Vv;Us.prototype.get=Yv;Us.prototype.has=Kv;Us.prototype.set=Zv;var vo=Us;var ND=200;function PD(t,e){var r=this.__data__;if(r instanceof gi){var n=r.__data__;if(!yi||n.length<ND-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new vo(n)}return r.set(t,e),this.size=r.size,this}var Jv=PD;function Bs(t){var e=this.__data__=new gi(t);this.size=e.size}Bs.prototype.clear=kv;Bs.prototype.delete=Nv;Bs.prototype.get=Pv;Bs.prototype.has=Cv;Bs.prototype.set=Jv;var Gs=Bs;var CD="__lodash_hash_undefined__";function OD(t){return this.__data__.set(t,CD),this}var Qv=OD;function LD(t){return this.__data__.has(t)}var eR=LD;function hd(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new vo;++e<r;)this.add(t[e])}hd.prototype.add=hd.prototype.push=Qv;hd.prototype.has=eR;var md=hd;function DD(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var tR=DD;function $D(t,e){return t.has(e)}var gd=$D;var MD=1,FD=2;function UD(t,e,r,n,i,o){var s=r&MD,a=t.length,c=e.length;if(a!=c&&!(s&&c>a))return!1;var l=o.get(t),u=o.get(e);if(l&&u)return l==e&&u==t;var f=-1,d=!0,p=r&FD?new md:void 0;for(o.set(t,e),o.set(e,t);++f<a;){var m=t[f],g=e[f];if(n)var v=s?n(g,m,f,e,t,o):n(m,g,f,t,e,o);if(v!==void 0){if(v)continue;d=!1;break}if(p){if(!tR(e,function(T,_){if(!gd(p,_)&&(m===T||i(m,T,r,n,o)))return p.push(_)})){d=!1;break}}else if(!(m===g||i(m,g,r,n,o))){d=!1;break}}return o.delete(t),o.delete(e),d}var yd=UD;var BD=Nt.Uint8Array,Cg=BD;function GD(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}var rR=GD;function XD(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Xs=XD;var HD=1,jD=2,zD="[object Boolean]",qD="[object Date]",WD="[object Error]",VD="[object Map]",YD="[object Number]",KD="[object RegExp]",ZD="[object Set]",JD="[object String]",QD="[object Symbol]",e1="[object ArrayBuffer]",t1="[object DataView]",nR=Jt?Jt.prototype:void 0,Og=nR?nR.valueOf:void 0;function r1(t,e,r,n,i,o,s){switch(r){case t1:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case e1:return!(t.byteLength!=e.byteLength||!o(new Cg(t),new Cg(e)));case zD:case qD:case YD:return ud(+t,+e);case WD:return t.name==e.name&&t.message==e.message;case KD:case JD:return t==e+"";case VD:var a=rR;case ZD:var c=n&HD;if(a||(a=Xs),t.size!=e.size&&!c)return!1;var l=s.get(t);if(l)return l==e;n|=jD,s.set(t,e);var u=yd(a(t),a(e),n,i,o,s);return s.delete(t),u;case QD:if(Og)return Og.call(t)==Og.call(e)}return!1}var iR=r1;function n1(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var xd=n1;var i1=Array.isArray,qe=i1;function o1(t,e,r){var n=e(t);return qe(t)?n:xd(n,r(t))}var oR=o1;function s1(t,e){for(var r=-1,n=t==null?0:t.length,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}var Td=s1;function a1(){return[]}var sR=a1;var c1=Object.prototype,l1=c1.propertyIsEnumerable,aR=Object.getOwnPropertySymbols,u1=aR?function(t){return t==null?[]:(t=Object(t),Td(aR(t),function(e){return l1.call(t,e)}))}:sR,cR=u1;function f1(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var lR=f1;function d1(t){return t!=null&&typeof t=="object"}var Hr=d1;var p1="[object Arguments]";function h1(t){return Hr(t)&&Xr(t)==p1}var Lg=h1;var uR=Object.prototype,m1=uR.hasOwnProperty,g1=uR.propertyIsEnumerable,y1=Lg((function(){return arguments})())?Lg:function(t){return Hr(t)&&m1.call(t,"callee")&&!g1.call(t,"callee")},Ti=y1;function x1(){return!1}var fR=x1;var hR=typeof exports=="object"&&exports&&!exports.nodeType&&exports,dR=hR&&typeof module=="object"&&module&&!module.nodeType&&module,T1=dR&&dR.exports===hR,pR=T1?Nt.Buffer:void 0,_1=pR?pR.isBuffer:void 0,E1=_1||fR,Ro=E1;var v1=9007199254740991,R1=/^(?:0|[1-9]\d*)$/;function w1(t,e){var r=typeof t;return e=e??v1,!!e&&(r=="number"||r!="symbol"&&R1.test(t))&&t>-1&&t%1==0&&t<e}var _d=w1;var b1=9007199254740991;function A1(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=b1}var Hs=A1;var S1="[object Arguments]",I1="[object Array]",k1="[object Boolean]",N1="[object Date]",P1="[object Error]",C1="[object Function]",O1="[object Map]",L1="[object Number]",D1="[object Object]",$1="[object RegExp]",M1="[object Set]",F1="[object String]",U1="[object WeakMap]",B1="[object ArrayBuffer]",G1="[object DataView]",X1="[object Float32Array]",H1="[object Float64Array]",j1="[object Int8Array]",z1="[object Int16Array]",q1="[object Int32Array]",W1="[object Uint8Array]",V1="[object Uint8ClampedArray]",Y1="[object Uint16Array]",K1="[object Uint32Array]",nt={};nt[X1]=nt[H1]=nt[j1]=nt[z1]=nt[q1]=nt[W1]=nt[V1]=nt[Y1]=nt[K1]=!0;nt[S1]=nt[I1]=nt[B1]=nt[k1]=nt[G1]=nt[N1]=nt[P1]=nt[C1]=nt[O1]=nt[L1]=nt[D1]=nt[$1]=nt[M1]=nt[F1]=nt[U1]=!1;function Z1(t){return Hr(t)&&Hs(t.length)&&!!nt[Xr(t)]}var mR=Z1;function J1(t){return function(e){return t(e)}}var gR=J1;var yR=typeof exports=="object"&&exports&&!exports.nodeType&&exports,il=yR&&typeof module=="object"&&module&&!module.nodeType&&module,Q1=il&&il.exports===yR,Dg=Q1&&fd.process,e$=(function(){try{var t=il&&il.require&&il.require("util").types;return t||Dg&&Dg.binding&&Dg.binding("util")}catch{}})(),$g=e$;var xR=$g&&$g.isTypedArray,t$=xR?gR(xR):mR,js=t$;var r$=Object.prototype,n$=r$.hasOwnProperty;function i$(t,e){var r=qe(t),n=!r&&Ti(t),i=!r&&!n&&Ro(t),o=!r&&!n&&!i&&js(t),s=r||n||i||o,a=s?lR(t.length,String):[],c=a.length;for(var l in t)(e||n$.call(t,l))&&!(s&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||_d(l,c)))&&a.push(l);return a}var TR=i$;var o$=Object.prototype;function s$(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||o$;return t===r}var Ed=s$;function a$(t,e){return function(r){return t(e(r))}}var _R=a$;var c$=_R(Object.keys,Object),ER=c$;var l$=Object.prototype,u$=l$.hasOwnProperty;function f$(t){if(!Ed(t))return ER(t);var e=[];for(var r in Object(t))u$.call(t,r)&&r!="constructor"&&e.push(r);return e}var vd=f$;function d$(t){return t!=null&&Hs(t.length)&&!dd(t)}var _i=d$;function p$(t){return _i(t)?TR(t):vd(t)}var zs=p$;function h$(t){return oR(t,zs,cR)}var Mg=h$;var m$=1,g$=Object.prototype,y$=g$.hasOwnProperty;function x$(t,e,r,n,i,o){var s=r&m$,a=Mg(t),c=a.length,l=Mg(e),u=l.length;if(c!=u&&!s)return!1;for(var f=c;f--;){var d=a[f];if(!(s?d in e:y$.call(e,d)))return!1}var p=o.get(t),m=o.get(e);if(p&&m)return p==e&&m==t;var g=!0;o.set(t,e),o.set(e,t);for(var v=s;++f<c;){d=a[f];var T=t[d],_=e[d];if(n)var E=s?n(_,T,d,e,t,o):n(T,_,d,t,e,o);if(!(E===void 0?T===_||i(T,_,r,n,o):E)){g=!1;break}v||(v=d=="constructor")}if(g&&!v){var I=t.constructor,D=e.constructor;I!=D&&"constructor"in t&&"constructor"in e&&!(typeof I=="function"&&I instanceof I&&typeof D=="function"&&D instanceof D)&&(g=!1)}return o.delete(t),o.delete(e),g}var vR=x$;var T$=wr(Nt,"DataView"),Rd=T$;var _$=wr(Nt,"Promise"),wd=_$;var E$=wr(Nt,"Set"),Ei=E$;var v$=wr(Nt,"WeakMap"),bd=v$;var RR="[object Map]",R$="[object Object]",wR="[object Promise]",bR="[object Set]",AR="[object WeakMap]",SR="[object DataView]",w$=Xn(Rd),b$=Xn(yi),A$=Xn(wd),S$=Xn(Ei),I$=Xn(bd),wo=Xr;(Rd&&wo(new Rd(new ArrayBuffer(1)))!=SR||yi&&wo(new yi)!=RR||wd&&wo(wd.resolve())!=wR||Ei&&wo(new Ei)!=bR||bd&&wo(new bd)!=AR)&&(wo=function(t){var e=Xr(t),r=e==R$?t.constructor:void 0,n=r?Xn(r):"";if(n)switch(n){case w$:return SR;case b$:return RR;case A$:return wR;case S$:return bR;case I$:return AR}return e});var ol=wo;var k$=1,IR="[object Arguments]",kR="[object Array]",Ad="[object Object]",N$=Object.prototype,NR=N$.hasOwnProperty;function P$(t,e,r,n,i,o){var s=qe(t),a=qe(e),c=s?kR:ol(t),l=a?kR:ol(e);c=c==IR?Ad:c,l=l==IR?Ad:l;var u=c==Ad,f=l==Ad,d=c==l;if(d&&Ro(t)){if(!Ro(e))return!1;s=!0,u=!1}if(d&&!u)return o||(o=new Gs),s||js(t)?yd(t,e,r,n,i,o):iR(t,e,c,r,n,i,o);if(!(r&k$)){var p=u&&NR.call(t,"__wrapped__"),m=f&&NR.call(e,"__wrapped__");if(p||m){var g=p?t.value():t,v=m?e.value():e;return o||(o=new Gs),i(g,v,r,n,o)}}return d?(o||(o=new Gs),vR(t,e,r,n,i,o)):!1}var PR=P$;function CR(t,e,r,n,i){return t===e?!0:t==null||e==null||!Hr(t)&&!Hr(e)?t!==t&&e!==e:PR(t,e,r,n,CR,i)}var Sd=CR;var C$=1,O$=2;function L$(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=r[i];var c=a[0],l=t[c],u=a[1];if(s&&a[2]){if(l===void 0&&!(c in t))return!1}else{var f=new Gs;if(n)var d=n(l,u,c,t,e,f);if(!(d===void 0?Sd(u,l,C$|O$,n,f):d))return!1}}return!0}var OR=L$;function D$(t){return t===t&&!Ms(t)}var Id=D$;function $$(t){for(var e=zs(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,Id(i)]}return e}var LR=$$;function M$(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var kd=M$;function F$(t){var e=LR(t);return e.length==1&&e[0][2]?kd(e[0][0],e[0][1]):function(r){return r===t||OR(r,t,e)}}var DR=F$;var U$="[object Symbol]";function B$(t){return typeof t=="symbol"||Hr(t)&&Xr(t)==U$}var vi=B$;var G$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,X$=/^\w*$/;function H$(t,e){if(qe(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||vi(t)?!0:X$.test(t)||!G$.test(t)||e!=null&&t in Object(e)}var qs=H$;var j$="Expected a function";function Fg(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(j$);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(Fg.Cache||vo),r}Fg.Cache=vo;var $R=Fg;var z$=500;function q$(t){var e=$R(t,function(n){return r.size===z$&&r.clear(),n}),r=e.cache;return e}var MR=q$;var W$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V$=/\\(\\)?/g,Y$=MR(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(W$,function(r,n,i,o){e.push(i?o.replace(V$,"$1"):n||r)}),e}),FR=Y$;var K$=1/0,UR=Jt?Jt.prototype:void 0,BR=UR?UR.toString:void 0;function GR(t){if(typeof t=="string")return t;if(qe(t))return ld(t,GR)+"";if(vi(t))return BR?BR.call(t):"";var e=t+"";return e=="0"&&1/t==-K$?"-0":e}var XR=GR;function Z$(t){return t==null?"":XR(t)}var HR=Z$;function J$(t,e){return qe(t)?t:qs(t,e)?[t]:FR(HR(t))}var Nd=J$;var Q$=1/0;function eM(t){if(typeof t=="string"||vi(t))return t;var e=t+"";return e=="0"&&1/t==-Q$?"-0":e}var Ri=eM;function tM(t,e){e=Nd(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Ri(e[r++])];return r&&r==n?t:void 0}var Pd=tM;function rM(t,e,r){var n=t==null?void 0:Pd(t,e);return n===void 0?r:n}var jR=rM;function nM(t,e){return t!=null&&e in Object(t)}var zR=nM;function iM(t,e,r){e=Nd(e,t);for(var n=-1,i=e.length,o=!1;++n<i;){var s=Ri(e[n]);if(!(o=t!=null&&r(t,s)))break;t=t[s]}return o||++n!=i?o:(i=t==null?0:t.length,!!i&&Hs(i)&&_d(s,i)&&(qe(t)||Ti(t)))}var qR=iM;function oM(t,e){return t!=null&&qR(t,e,zR)}var WR=oM;var sM=1,aM=2;function cM(t,e){return qs(t)&&Id(e)?kd(Ri(t),e):function(r){var n=jR(r,t);return n===void 0&&n===e?WR(r,t):Sd(e,n,sM|aM)}}var VR=cM;function lM(t){return t}var Ws=lM;function uM(t){return function(e){return e?.[t]}}var YR=uM;function fM(t){return function(e){return Pd(e,t)}}var KR=fM;function dM(t){return qs(t)?YR(Ri(t)):KR(t)}var ZR=dM;function pM(t){return typeof t=="function"?t:t==null?Ws:typeof t=="object"?qe(t)?VR(t[0],t[1]):DR(t):ZR(t)}var wi=pM;function hM(t){return function(e,r,n){for(var i=-1,o=Object(e),s=n(e),a=s.length;a--;){var c=s[t?a:++i];if(r(o[c],c,o)===!1)break}return e}}var JR=hM;var mM=JR(),QR=mM;function gM(t,e){return t&&QR(t,e,zs)}var ew=gM;function yM(t,e){return function(r,n){if(r==null)return r;if(!_i(r))return t(r,n);for(var i=r.length,o=e?i:-1,s=Object(r);(e?o--:++o<i)&&n(s[o],o,s)!==!1;);return r}}var tw=yM;var xM=tw(ew),bi=xM;function TM(t,e){var r=-1,n=_i(t)?Array(t.length):[];return bi(t,function(i,o,s){n[++r]=e(i,o,s)}),n}var rw=TM;function _M(t,e){var r=qe(t)?ld:rw;return r(t,wi(e,3))}var hr=_M;function EM(t,e){var r=[];return bi(t,function(n,i,o){e(n,i,o)&&r.push(n)}),r}var nw=EM;function vM(t,e){var r=qe(t)?Td:nw;return r(t,wi(e,3))}var iw=vM;function bo(t,e,r){return`${t.name}_${e}_${r}`}var Ai=1,RM=2,ow=4,sw=5;var Ao=7,wM=8,bM=9,AM=10,SM=11,aw=12,sl=class{constructor(e){this.target=e}isEpsilon(){return!1}},Vs=class extends sl{constructor(e,r){super(e),this.tokenType=r}},al=class extends sl{constructor(e){super(e)}isEpsilon(){return!0}},Ys=class extends sl{constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}};function cw(t){let e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};IM(e,t);let r=t.length;for(let n=0;n<r;n++){let i=t[n],o=So(e,i,i);o!==void 0&&UM(e,i,o)}return e}function IM(t,e){let r=e.length;for(let n=0;n<r;n++){let i=e[n],o=Pt(t,i,void 0,{type:RM}),s=Pt(t,i,void 0,{type:Ao});o.stop=s,t.ruleToStartState.set(i,o),t.ruleToStopState.set(i,s)}}function lw(t,e,r){return r instanceof _e?Ug(t,e,r.terminalType,r):r instanceof Ge?FM(t,e,r):r instanceof Ke?OM(t,e,r):r instanceof Xe?LM(t,e,r):r instanceof we?kM(t,e,r):r instanceof Ye?NM(t,e,r):r instanceof Qe?PM(t,e,r):r instanceof et?CM(t,e,r):So(t,e,r)}function kM(t,e,r){let n=Pt(t,e,r,{type:sw});Si(t,n);let i=Ks(t,e,n,r,So(t,e,r));return fw(t,e,r,i)}function NM(t,e,r){let n=Pt(t,e,r,{type:sw});Si(t,n);let i=Ks(t,e,n,r,So(t,e,r)),o=Ug(t,e,r.separator,r);return fw(t,e,r,i,o)}function PM(t,e,r){let n=Pt(t,e,r,{type:ow});Si(t,n);let i=Ks(t,e,n,r,So(t,e,r));return uw(t,e,r,i)}function CM(t,e,r){let n=Pt(t,e,r,{type:ow});Si(t,n);let i=Ks(t,e,n,r,So(t,e,r)),o=Ug(t,e,r.separator,r);return uw(t,e,r,i,o)}function OM(t,e,r){let n=Pt(t,e,r,{type:Ai});Si(t,n);let i=hr(r.definition,s=>lw(t,e,s));return Ks(t,e,n,r,...i)}function LM(t,e,r){let n=Pt(t,e,r,{type:Ai});Si(t,n);let i=Ks(t,e,n,r,So(t,e,r));return DM(t,e,r,i)}function So(t,e,r){let n=iw(hr(r.definition,i=>lw(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:MM(t,n)}function uw(t,e,r,n,i){let o=n.left,s=n.right,a=Pt(t,e,r,{type:SM});Si(t,a);let c=Pt(t,e,r,{type:aw});return o.loopback=a,c.loopback=a,t.decisionMap[bo(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=a,wt(s,a),i===void 0?(wt(a,o),wt(a,c)):(wt(a,c),wt(a,i.left),wt(i.right,o)),{left:o,right:c}}function fw(t,e,r,n,i){let o=n.left,s=n.right,a=Pt(t,e,r,{type:AM});Si(t,a);let c=Pt(t,e,r,{type:aw}),l=Pt(t,e,r,{type:bM});return a.loopback=l,c.loopback=l,wt(a,o),wt(a,c),wt(s,l),i!==void 0?(wt(l,c),wt(l,i.left),wt(i.right,o)):wt(l,a),t.decisionMap[bo(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=a,{left:a,right:c}}function DM(t,e,r,n){let i=n.left,o=n.right;return wt(i,o),t.decisionMap[bo(e,"Option",r.idx)]=i,n}function Si(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function Ks(t,e,r,n,...i){let o=Pt(t,e,n,{type:wM,start:r});r.end=o;for(let a of i)a!==void 0?(wt(r,a.left),wt(a.right,o)):wt(r,o);let s={left:r,right:o};return t.decisionMap[bo(e,$M(n),n.idx)]=r,s}function $M(t){if(t instanceof Ke)return"Alternation";if(t instanceof Xe)return"Option";if(t instanceof we)return"Repetition";if(t instanceof Ye)return"RepetitionWithSeparator";if(t instanceof Qe)return"RepetitionMandatory";if(t instanceof et)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function MM(t,e){let r=e.length;for(let o=0;o<r-1;o++){let s=e[o],a;s.left.transitions.length===1&&(a=s.left.transitions[0]);let c=a instanceof Ys,l=a,u=e[o+1].left;s.left.type===Ai&&s.right.type===Ai&&a!==void 0&&(c&&l.followState===s.right||a.target===s.right)?(c?l.followState=u:a.target=u,BM(t,s.right)):wt(s.right,u)}let n=e[0],i=e[r-1];return{left:n.left,right:i.right}}function Ug(t,e,r,n){let i=Pt(t,e,n,{type:Ai}),o=Pt(t,e,n,{type:Ai});return Bg(i,new Vs(o,r)),{left:i,right:o}}function FM(t,e,r){let n=r.referencedRule,i=t.ruleToStartState.get(n),o=Pt(t,e,r,{type:Ai}),s=Pt(t,e,r,{type:Ai}),a=new Ys(i,n,s);return Bg(o,a),{left:o,right:s}}function UM(t,e,r){let n=t.ruleToStartState.get(e);wt(n,r.left);let i=t.ruleToStopState.get(e);return wt(r.right,i),{left:n,right:i}}function wt(t,e){let r=new al(e);Bg(t,r)}function Pt(t,e,r,n){let i=Object.assign({atn:t,production:r,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},n);return t.states.push(i),i}function Bg(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function BM(t,e){t.states.splice(t.states.indexOf(e),1)}var cl={},Zs=class{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){let r=Gg(e);r in this.map||(this.map[r]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return hr(this.configs,e=>e.alt)}get key(){let e="";for(let r in this.map)e+=r+":";return e}};function Gg(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}function GM(t,e,r){for(var n=-1,i=t.length;++n<i;){var o=t[n],s=e(o);if(s!=null&&(a===void 0?s===s&&!vi(s):r(s,a)))var a=s,c=o}return c}var dw=GM;function XM(t,e){return t<e}var pw=XM;function HM(t){return t&&t.length?dw(t,Ws,pw):void 0}var hw=HM;var mw=Jt?Jt.isConcatSpreadable:void 0;function jM(t){return qe(t)||Ti(t)||!!(mw&&t&&t[mw])}var gw=jM;function yw(t,e,r,n,i){var o=-1,s=t.length;for(r||(r=gw),i||(i=[]);++o<s;){var a=t[o];e>0&&r(a)?e>1?yw(a,e-1,r,n,i):xd(i,a):n||(i[i.length]=a)}return i}var Cd=yw;function zM(t,e){return Cd(hr(t,e),1)}var xw=zM;function qM(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}var Tw=qM;function WM(t){return t!==t}var _w=WM;function VM(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}var Ew=VM;function YM(t,e,r){return e===e?Ew(t,e,r):Tw(t,_w,r)}var vw=YM;function KM(t,e){var r=t==null?0:t.length;return!!r&&vw(t,e,0)>-1}var Rw=KM;function ZM(t,e,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}var ww=ZM;function JM(){}var bw=JM;var QM=1/0,eF=Ei&&1/Xs(new Ei([,-0]))[1]==QM?function(t){return new Ei(t)}:bw,Aw=eF;var tF=200;function rF(t,e,r){var n=-1,i=Rw,o=t.length,s=!0,a=[],c=a;if(r)s=!1,i=ww;else if(o>=tF){var l=e?null:Aw(t);if(l)return Xs(l);s=!1,i=gd,c=new md}else c=e?[]:a;e:for(;++n<o;){var u=t[n],f=e?e(u):u;if(u=r||u!==0?u:0,s&&f===f){for(var d=c.length;d--;)if(c[d]===f)continue e;e&&c.push(f),a.push(u)}else i(c,f,r)||(c!==a&&c.push(f),a.push(u))}return a}var Sw=rF;function nF(t,e){return t&&t.length?Sw(t,wi(e,2)):[]}var Iw=nF;function iF(t){var e=t==null?0:t.length;return e?Cd(t,1):[]}var kw=iF;function oF(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var Nw=oF;function sF(t){return typeof t=="function"?t:Ws}var Pw=sF;function aF(t,e){var r=qe(t)?Nw:bi;return r(t,Pw(e))}var Od=aF;var cF="[object Map]",lF="[object Set]",uF=Object.prototype,fF=uF.hasOwnProperty;function dF(t){if(t==null)return!0;if(_i(t)&&(qe(t)||typeof t=="string"||typeof t.splice=="function"||Ro(t)||js(t)||Ti(t)))return!t.length;var e=ol(t);if(e==cF||e==lF)return!t.size;if(Ed(t))return!vd(t).length;for(var r in t)if(fF.call(t,r))return!1;return!0}var Cw=dF;function pF(t,e,r,n){var i=-1,o=t==null?0:t.length;for(n&&o&&(r=t[++i]);++i<o;)r=e(r,t[i],i,t);return r}var Ow=pF;function hF(t,e,r,n,i){return i(t,function(o,s,a){r=n?(n=!1,o):e(r,o,s,a)}),r}var Lw=hF;function mF(t,e,r){var n=qe(t)?Ow:Lw,i=arguments.length<3;return n(t,wi(e,4),r,i,bi)}var Xg=mF;function gF(t,e){let r={};return n=>{let i=n.toString(),o=r[i];return o!==void 0||(o={atnStartState:t,decision:e,states:{}},r[i]=o),o}}var Ld=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="",r=this.predicates.length;for(let n=0;n<r;n++)e+=this.predicates[n]===!0?"1":"0";return e}},Dw=new Ld,ll=class extends Bn{constructor(e){var r,n;super(),this.logging=(r=e?.logging)!==null&&r!==void 0?r:(i=>console.log(i)),this.incomplete=(n=e?.incomplete)!==null&&n!==void 0?n:!1}initialize(e){this.atn=cw(e.rules),this.dfas=yF(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){let{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:o}=e,s=this.dfas,a=this.logging,c=this.incomplete,l=bo(n,"Alternation",r),f=this.atn.decisionMap[l].decision,d=hr(Hf({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),p=>hr(p,m=>m[0]));if($w(d,!1)&&!o){let p=Xg(d,(m,g,v)=>(Od(g,T=>{T&&(m[T.tokenTypeIdx]=v,Od(T.categoryMatches,_=>{m[_]=v}))}),m),{});return i?function(m){var g;let v=this.LA_FAST(1),T=p[v.tokenTypeIdx];if(m!==void 0&&T!==void 0){let _=(g=m[T])===null||g===void 0?void 0:g.GATE;if(_!==void 0&&_.call(this)===!1)return}return T}:function(){let m=this.LA_FAST(1);return p[m.tokenTypeIdx]}}else return i?function(p){let m=new Ld,g=p===void 0?0:p.length;for(let T=0;T<g;T++){let _=p?.[T].GATE;m.set(T,_===void 0||_.call(this))}let v=Hg.call(this,s,f,m,a,c);return typeof v=="number"?v:void 0}:function(){let p=Hg.call(this,s,f,Dw,a,c);return typeof p=="number"?p:void 0}}buildLookaheadForOptional(e){let{prodOccurrence:r,rule:n,prodType:i,dynamicTokensEnabled:o}=e,s=this.dfas,a=this.logging,c=this.incomplete,l=bo(n,i,r),f=this.atn.decisionMap[l].decision,d=hr(Hf({maxLookahead:1,occurrence:r,prodType:i,rule:n}),p=>hr(p,m=>m[0]));if($w(d)&&d[0][0]&&!o){let p=d[0],m=kw(p);if(m.length===1&&Cw(m[0].categoryMatches)){let v=m[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===v}}else{let g=Xg(m,(v,T)=>(T!==void 0&&(v[T.tokenTypeIdx]=!0,Od(T.categoryMatches,_=>{v[_]=!0})),v),{});return function(){let v=this.LA_FAST(1);return g[v.tokenTypeIdx]===!0}}}return function(){let p=Hg.call(this,s,f,Dw,a,c);return typeof p=="object"?!1:p===0}}};function $w(t,e=!0){let r=new Set;for(let n of t){let i=new Set;for(let o of n){if(o===void 0){if(e)break;return!1}let s=[o.tokenTypeIdx].concat(o.categoryMatches);for(let a of s)if(r.has(a)){if(!i.has(a))return!1}else r.add(a),i.add(a)}}return!0}function yF(t){let e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=gF(t.decisionStates[n],n);return r}function Hg(t,e,r,n,i){let o=t[e](r),s=o.start;if(s===void 0){let c=IF(o.atnStartState);s=Uw(o,Fw(c)),o.start=s}return xF.apply(this,[o,s,r,n,i])}function xF(t,e,r,n,i){let o=e,s=1,a=[],c=this.LA_FAST(s++);for(;;){let l=wF(o,c);if(l===void 0&&(l=TF.apply(this,[t,o,c,s,r,n])),l===cl)return RF(a,o,c);if(l.isAcceptState===!0){if(i===!0&&Ns(c,Kt)){let u=$F(o,r);if(u!==void 0)return u}return l.prediction}o=l,a.push(c),c=this.LA(s++)}}function TF(t,e,r,n,i,o){let s=bF(e.configs,r,i);if(s.size===0)return Mw(t,e,r,cl),cl;let a=Fw(s),c=SF(s,i);if(c!==void 0)a.isAcceptState=!0,a.prediction=c,a.configs.uniqueAlt=c;else if(CF(s)){let l=hw(s.alts);a.isAcceptState=!0,a.prediction=l,a.configs.uniqueAlt=l,_F.apply(this,[t,n,s.alts,o])}return a=Mw(t,e,r,a),a}function _F(t,e,r,n){let i=[];for(let l=1;l<=e;l++)i.push(this.LA(l).tokenType);let o=t.atnStartState,s=o.rule,a=o.production,c=EF({topLevelRule:s,ambiguityIndices:r,production:a,prefixPath:i});n(c)}function EF(t){let e=hr(t.prefixPath,i=>Mn(i)).join(", "),r=t.production.idx===0?"":t.production.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${vF(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,
149
149
  <${e}> may appears as a prefix path in all these alternatives.
150
150
  `;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
151
- For Further details.`,n}function H1(t){if(t instanceof Me)return"SUBRULE";if(t instanceof Fe)return"OPTION";if(t instanceof ze)return"OR";if(t instanceof Ze)return"AT_LEAST_ONE";if(t instanceof Je)return"AT_LEAST_ONE_SEP";if(t instanceof qe)return"MANY_SEP";if(t instanceof be)return"MANY";if(t instanceof ge)return"CONSUME";throw Error("non exhaustive match")}function j1(t,e,r){let n=tA(e.configs.elements,o=>o.state.transitions),i=fA(n.filter(o=>o instanceof Gs).map(o=>o.tokenType),o=>o.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function W1(t,e){return t.edges[e.tokenTypeIdx]}function q1(t,e,r){let n=new Ws,i=[];for(let s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===Eo){i.push(s);continue}let a=s.state.transitions.length;for(let c=0;c<a;c++){let l=s.state.transitions[c],u=z1(l,e);u!==void 0&&n.add({state:u,alt:s.alt,stack:s.stack})}}let o;if(i.length===0&&n.size===1&&(o=n),o===void 0){o=new Ws;for(let s of n.elements)Id(s,o)}if(i.length>0&&!Z1(o))for(let s of i)o.add(s);return o}function z1(t,e){if(t instanceof Gs&&ws(e,t.tokenType))return t.target}function V1(t,e){let r;for(let n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}function EA(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function _A(t,e,r,n){return n=RA(t,n),e.edges[r.tokenTypeIdx]=n,n}function RA(t,e){if(e===rl)return e;let r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}function Y1(t){let e=new Ws,r=t.transitions.length;for(let n=0;n<r;n++){let o={state:t.transitions[n].target,alt:n,stack:[]};Id(o,e)}return e}function Id(t,e){let r=t.state;if(r.type===Eo){if(t.stack.length>0){let i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};Id(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);let n=r.transitions.length;for(let i=0;i<n;i++){let o=r.transitions[i],s=K1(t,o);s!==void 0&&Id(s,e)}}function K1(t,e){if(e instanceof tl)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Hs){let r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}function Z1(t){for(let e of t.elements)if(e.state.type===Eo)return!0;return!1}function J1(t){for(let e of t.elements)if(e.state.type!==Eo)return!1;return!0}function Q1(t){if(J1(t))return!0;let e=eF(t.elements);return tF(e)&&!rF(e)}function eF(t){let e=new Map;for(let r of t){let n=Pg(r,!1),i=e.get(n);i===void 0&&(i={},e.set(n,i)),i[r.alt]=!0}return e}function tF(t){for(let e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function rF(t){for(let e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}function nF(t,e){let r;for(let n of t.configs.elements)if(!(e.is(n.alt)===!1||n.state.type===Eo)){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}Zs();var fl=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Js(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){let r=new Io;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){let n=new Ao(e.startOffset,e.image.length,ds(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){let r=e.container;if(r){let n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){let r=[];for(let o of e){let s=new Ao(o.startOffset,o.image.length,ds(o),o.tokenType,!0);s.root=this.rootNode,r.push(s)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){let o=n.container.content.indexOf(n);if(o>0){n.container.content.splice(o,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){let r=this.current;typeof e.$type=="string"&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=r;let n=this.nodeStack.pop();n?.content.length===0&&this.removeNode(n)}},dl=class{get hidden(){return!1}get astNode(){let e=typeof this._astNode?.$type=="string"?this._astNode:this.container?.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},Ao=class extends dl{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,o=!1){super(),this._hidden=o,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},Io=class extends dl{constructor(){super(...arguments),this.content=new $y(this)}get offset(){return this.firstNonHiddenNode?.offset??0}get length(){return this.end-this.offset}get end(){return this.lastNonHiddenNode?.end??0}get range(){let e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){let{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line<n.start.line?n.start:i.end}}return this._rangeCache}else return{start:ke.create(0,0),end:ke.create(0,0)}}get firstNonHiddenNode(){for(let e of this.content)if(!e.hidden)return e;return this.content[0]}get lastNonHiddenNode(){for(let e=this.content.length-1;e>=0;e--){let r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},$y=class t extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,t.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(let r of e)r.container=this.parent}},Js=class extends Io{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}};var $d=Symbol("Datatype");function My(t){return t.$type===$d}var bA="\u200B",wA=t=>t.endsWith(bA)?t:t+bA,pl=class{constructor(e,r){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;let n=this.lexer.definition,i=e.LanguageMetaData.mode==="production";e.shared.profilers.LangiumProfiler?.isActive("parsing")?this.wrapper=new Fy(n,{...e.parser.ParserConfig,skipValidations:i,errorMessageProvider:e.parser.ParserErrorMessageProvider},r,e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new Fd(n,{...e.parser.ParserConfig,skipValidations:i,errorMessageProvider:e.parser.ParserErrorMessageProvider},r)}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},hl=class extends pl{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e,!1),this.nodeBuilder=new fl,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){let n=this.computeRuleType(e),i;oi(e)&&(i=e.name,this.registerPrecedenceMap(e));let o=this.wrapper.DEFINE_RULE(wA(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,o),St(e)&&e.entry&&(this.mainRule=o),o}registerPrecedenceMap(e){let r=e.name,n=new Map;for(let i=0;i<e.operators.precedences.length;i++){let o=e.operators.precedences[i];for(let s of o.operators)n.set(s.value,{precedence:i,rightAssoc:o.associativity==="right"})}this.operatorPrecedence.set(r,n)}computeRuleType(e){return oi(e)?ai(e):e.fragment?void 0:Lc(e)?$d:ai(e)}parse(e,r={}){this.nodeBuilder.buildRootNode(e);let n=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=n.tokens;let i=r.rule?this.allRules.get(r.rule):this.mainRule;if(!i)throw new Error(r.rule?`No rule found with name '${r.rule}'`:"No main rule available.");let o=this.doParse(i);return this.nodeBuilder.addHiddenNodes(n.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,rs(o,{deep:!0}),{value:o,lexerErrors:n.errors,lexerReport:n.report,parserErrors:this.wrapper.errors}}doParse(e){let r=this.wrapper.rule(e);if(this.stack.length>0&&(r=this.construct()),r===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return r}startImplementation(e,r,n){return i=>{let o=!this.isRecording()&&e!==void 0;if(o){let s={$type:e};this.stack.push(s),e===$d?s.value="":r!==void 0&&(s.$infixName=r)}return n(i),o?this.construct():void 0}}extractHiddenTokens(e){let r=this.lexerResult.hidden;if(!r.length)return[];let n=e.startOffset;for(let i=0;i<r.length;i++)if(r[i].startOffset>n)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){let i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){let o=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(o);let s=this.nodeBuilder.buildLeafNode(i,n),{assignment:a,crossRef:c}=this.getAssignment(n),l=this.current;if(a){let u=Er(n)?i.image:this.converter.convert(i.image,s);this.assign(a.operator,a.feature,u,s,c)}else if(My(l)){let u=i.image;Er(n)||(u=this.converter.convert(u,s).toString()),l.value+=u}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,o){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));let a;try{a=this.wrapper.wrapSubrule(e,r,o)}finally{this.isRecording()||(a===void 0&&!n&&(a=this.construct()),a!==void 0&&s&&s.length>0&&this.performSubruleAssignment(a,i,s))}}performSubruleAssignment(e,r,n){let{assignment:i,crossRef:o}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,o);else if(!i){let s=this.current;if(My(s))s.value+=e.toString();else if(typeof e=="object"&&e){let c=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(c)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);let o={$type:e};this.stack.push(o),this.assign(r.operator,r.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;let e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):My(e)?this.converter.convert(e.value,e.$cstNode):(sm(this.astReflection,e),e)}constructInfix(e,r){let n=e.parts;if(!Array.isArray(n)||n.length===0)return;let i=e.operators;if(!Array.isArray(i)||n.length<2)return n[0];let o=0,s=-1;for(let y=0;y<i.length;y++){let R=i[y],T=r.get(R)??{precedence:1/0,rightAssoc:!1};T.precedence>s?(s=T.precedence,o=y):T.precedence===s&&(T.rightAssoc||(o=y))}let a=i.slice(0,o),c=i.slice(o+1),l=n.slice(0,o+1),u=n.slice(o+1),f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:l,operators:a},d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:c},p=this.constructInfix(f,r),m=this.constructInfix(d,r);return{$type:e.$type,$cstNode:e.$cstNode,left:p,operator:i[o],right:m}}getAssignment(e){if(!this.assignmentMap.has(e)){let r=An(e,$r);this.assignmentMap.set(e,{assignment:r,crossRef:r&&Mr(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,o){let s=this.current,a;switch(o==="single"&&typeof n=="string"?a=this.linker.buildReference(s,r,i,n):o==="multi"&&typeof n=="string"?a=this.linker.buildMultiReference(s,r,i,n):a=n,e){case"=":{s[r]=a;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(a)}}assignWithoutOverride(e,r){for(let[i,o]of Object.entries(r)){let s=e[i];s===void 0?e[i]=o:Array.isArray(s)&&Array.isArray(o)&&(o.push(...s),e[i]=o)}let n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},Md=class{buildMismatchTokenMessage(e){return $n.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return $n.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return $n.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return $n.buildEarlyExitMessage(e)}},Qs=class extends Md{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},ml=class extends pl{constructor(e){super(e,!0),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();let r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){let n=this.wrapper.DEFINE_RULE(wA(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{let n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){let e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,o){this.before(i),this.wrapper.wrapSubrule(e,r,o),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){let r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},oF={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Qs},Fd=class extends Kc{constructor(e,r,n){let i=r&&"maxLookahead"in r;super(e,{...oF,lookaheadStrategy:i?new Mn({maxLookahead:r.maxLookahead}):new nl({logging:r.skipValidations?()=>{}:void 0,incomplete:n}),...r})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r,n){return this.RULE(e,r,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r,void 0)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}rule(e){return e.call(this,{})}},Fy=class extends Fd{constructor(e,r,n,i){super(e,r,n),this.task=i}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,r,n){this.task.startSubTask(this.ruleName(r));try{return super.subrule(e,r,n)}finally{this.task.stopSubTask(this.ruleName(r))}}};function gl(t,e,r){return sF({parser:e,tokens:r,ruleNames:new Map},t),e}function sF(t,e){let r=Cc(e,!1),n=me(e.rules).filter(St).filter(o=>r.has(o));for(let o of n){let s={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(o,So(s,o.definition))}let i=me(e.rules).filter(oi).filter(o=>r.has(o));for(let o of i)t.parser.rule(o,aF(t,o))}function aF(t,e){let r=e.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(qt(r))throw new Error("Cannot use terminal rule in infix expression");let n=e.operators.precedences.flatMap(p=>p.operators),i={$type:"Group",elements:[]},o={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},s={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(o,s);let c={$container:s,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},l={...o,$container:s};s.elements.push(c,l);let f=n.map(p=>t.tokens[p.value]).map((p,m)=>({ALT:()=>t.parser.consume(m,p,c)})),d;return p=>{d??(d=By(t,r)),t.parser.subrule(0,d,!1,o,p),t.parser.many(0,{DEF:()=>{t.parser.alternatives(0,f),t.parser.subrule(1,d,!1,l,p)}})}}function So(t,e,r=!1){let n;if(Er(e))n=hF(t,e);else if(kn(e))n=cF(t,e);else if($r(e))n=So(t,e.terminal);else if(Mr(e))n=AA(t,e);else if(Fr(e))n=lF(t,e);else if(uf(e))n=fF(t,e);else if(hf(e))n=dF(t,e);else if(ii(e))n=pF(t,e);else if(pm(e)){let i=t.consume++;n=()=>t.parser.consume(i,Yt,e)}else throw new co(e.$cstNode,`Unexpected element type: ${e.$type}`);return IA(t,r?void 0:Ud(e),n,e.cardinality)}function cF(t,e){let r=ai(e);return()=>t.parser.action(r,e)}function lF(t,e){let r=e.rule.ref;if(vn(r)){let n=t.subrule++,i=St(r)&&r.fragment,o=e.arguments.length>0?uF(r,e.arguments):()=>({}),s;return a=>{s??(s=By(t,r)),t.parser.subrule(n,s,i,e,o(a))}}else if(qt(r)){let n=t.consume++,i=Uy(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)sn(r);else throw new co(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function uF(t,e){if(e.some(n=>n.calledByName)){let n=e.map(i=>({parameterName:i.parameter?.ref?.name,predicate:fn(i.value)}));return i=>{let o={};for(let{parameterName:s,predicate:a}of n)s&&(o[s]=a(i));return o}}else{let n=e.map(i=>fn(i.value));return i=>{let o={};for(let s=0;s<n.length;s++)if(s<t.parameters.length){let a=t.parameters[s].name,c=n[s];o[a]=c(i)}return o}}}function fn(t){if(dm(t)){let e=fn(t.left),r=fn(t.right);return n=>e(n)||r(n)}else if(fm(t)){let e=fn(t.left),r=fn(t.right);return n=>e(n)&&r(n)}else if(gm(t)){let e=fn(t.value);return r=>!e(r)}else if(ym(t)){let e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(lm(t)){let e=!!t.true;return()=>e}sn(t)}function fF(t,e){if(e.elements.length===1)return So(t,e.elements[0]);{let r=[];for(let i of e.elements){let o={ALT:So(t,i,!0)},s=Ud(i);s&&(o.GATE=fn(s)),r.push(o)}let n=t.or++;return i=>t.parser.alternatives(n,r.map(o=>{let s={ALT:()=>o.ALT(i)},a=o.GATE;return a&&(s.GATE=()=>a(i)),s}))}}function dF(t,e){if(e.elements.length===1)return So(t,e.elements[0]);let r=[];for(let a of e.elements){let c={ALT:So(t,a,!0)},l=Ud(a);l&&(c.GATE=fn(l)),r.push(c)}let n=t.or++,i=(a,c)=>{let l=c.getRuleStack().join("-");return`uGroup_${a}_${l}`},o=a=>t.parser.alternatives(n,r.map((c,l)=>{let u={ALT:()=>!0},f=t.parser;u.ALT=()=>{if(c.ALT(a),!f.isRecording()){let p=i(n,f);f.unorderedGroups.get(p)||f.unorderedGroups.set(p,[]);let m=f.unorderedGroups.get(p);typeof m?.[l]>"u"&&(m[l]=!0)}};let d=c.GATE;return d?u.GATE=()=>d(a):u.GATE=()=>!f.unorderedGroups.get(i(n,f))?.[l],u})),s=IA(t,Ud(e),o,"*");return a=>{s(a),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function pF(t,e){let r=e.elements.map(n=>So(t,n));return n=>r.forEach(i=>i(n))}function Ud(t){if(ii(t))return t.guardCondition}function AA(t,e,r=e.terminal){if(r)if(Fr(r)&&St(r.rule.ref)){let n=r.rule.ref,i=t.subrule++,o;return s=>{o??(o=By(t,n)),t.parser.subrule(i,o,!1,e,s)}}else if(Fr(r)&&qt(r.rule.ref)){let n=t.consume++,i=Uy(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Er(r)){let n=t.consume++,i=Uy(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);let i=_f(e.type.ref)?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+ai(e.type.ref));return AA(t,e,i)}}function hF(t,e){let r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}function IA(t,e,r,n){let i=e&&fn(e);if(!n)if(i){let o=t.or++;return s=>t.parser.alternatives(o,[{ALT:()=>r(s),GATE:()=>i(s)},{ALT:Qf(),GATE:()=>!i(s)}])}else return r;if(n==="*"){let o=t.many++;return s=>t.parser.many(o,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else if(n==="+"){let o=t.many++;if(i){let s=t.or++;return a=>t.parser.alternatives(s,[{ALT:()=>t.parser.atLeastOne(o,{DEF:()=>r(a)}),GATE:()=>i(a)},{ALT:Qf(),GATE:()=>!i(a)}])}else return s=>t.parser.atLeastOne(o,{DEF:()=>r(s)})}else if(n==="?"){let o=t.optional++;return s=>t.parser.optional(o,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else sn(n)}function By(t,e){let r=mF(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function mF(t,e){if(vn(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!St(n);)(ii(n)||uf(n)||hf(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}function Uy(t,e){let r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}function Xy(t){let e=t.Grammar,r=t.parser.Lexer,n=new ml(t);return gl(e,n,r.definition),n.finalize(),n}function Gy(t){let e=SA(t);return e.finalize(),e}function SA(t){let e=t.Grammar,r=t.parser.Lexer,n=new hl(t);return gl(e,n,r.definition)}var vo=class{constructor(){this.diagnostics=[]}buildTokens(e,r){let n=me(Cc(e,!1)),i=this.buildTerminalTokens(n),o=this.buildKeywordTokens(n,i,r);return o.push(...i),o}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){let e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(qt).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){let r=hs(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=Pc(r)?at.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){let r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(vn).flatMap(i=>Lr(i).filter(Er)).distinct(i=>i.value).toArray().sort((i,o)=>o.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!n?.caseInsensitive))}buildKeywordToken(e,r,n){let i=this.buildKeywordPattern(e,n),o={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(o.LINE_BREAKS=!0),o}buildKeywordPattern(e,r){return r?new RegExp(si(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{let o=i?.PATTERN;return o?.source&&Dm("^"+o.source+"$",e.value)&&n.push(i),n},[])}};var ko=class{convert(e,r){let n=r.grammarSource;if(Mr(n)&&(n=Fm(n)),Fr(n)){let i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){switch(e.name.toUpperCase()){case"INT":return dn.convertInt(r);case"STRING":return dn.convertString(r);case"ID":return dn.convertID(r)}switch(Wm(e)?.toLowerCase()){case"number":return dn.convertNumber(r);case"boolean":return dn.convertBoolean(r);case"bigint":return dn.convertBigint(r);case"date":return dn.convertDate(r);default:return r}}},dn;(function(t){function e(l){let u="";for(let f=1;f<l.length-1;f++){let d=l.charAt(f);if(d==="\\"){let p=l.charAt(++f);u+=r(p)}else u+=d}return u}t.convertString=e;function r(l){switch(l){case"b":return"\b";case"f":return"\f";case"n":return`
152
- `;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return l}}function n(l){return l.charAt(0)==="^"?l.substring(1):l}t.convertID=n;function i(l){return parseInt(l)}t.convertInt=i;function o(l){return BigInt(l)}t.convertBigint=o;function s(l){return new Date(l)}t.convertDate=s;function a(l){return Number(l)}t.convertNumber=a;function c(l){return l.toLowerCase()==="true"}t.convertBoolean=c})(dn||(dn={}));var ne={};Ie(ne,rm(CA(),1));function Zy(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}var Hd=0,OA=10;function jd(){return Hd=performance.now(),new ne.CancellationTokenSource}function LA(t){OA=t}var br=Symbol("OperationCancelled");function pn(t){return t===br}async function ht(t){if(t===ne.CancellationToken.None)return;let e=performance.now();if(e-Hd>=OA&&(Hd=e,await Zy(),Hd=performance.now()),t.isCancellationRequested)throw br}var Jt=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}};var Wd=class t{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(let n of e)if(t.isIncremental(n)){let i=MA(n.range),o=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,o)+n.text+this._content.substring(s,this._content.length);let a=Math.max(i.start.line,0),c=Math.max(i.end.line,0),l=this._lineOffsets,u=DA(n.text,!1,o);if(c-a===u.length)for(let d=0,p=u.length;d<p;d++)l[d+a+1]=u[d];else u.length<1e4?l.splice(a+1,c-a,...u):this._lineOffsets=l=l.slice(0,a+1).concat(u,l.slice(c+1));let f=n.text.length-(s-o);if(f!==0)for(let d=a+1+u.length,p=l.length;d<p;d++)l[d]=l[d]+f}else if(t.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=r}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=DA(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return{line:0,character:e};for(;n<i;){let s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}let o=n-1;return e=this.ensureBeforeEOL(e,r[o]),{line:o,character:e-r[o]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line];if(e.character<=0)return n;let i=e.line+1<r.length?r[e.line+1]:this._content.length,o=Math.min(n+e.character,i);return this.ensureBeforeEOL(o,n)}ensureBeforeEOL(e,r){for(;e>r&&$A(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},ra;(function(t){function e(i,o,s,a){return new Wd(i,o,s,a)}t.create=e;function r(i,o,s){if(i instanceof Wd)return i.update(o,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=r;function n(i,o){let s=i.getText(),a=Jy(o.map(AF),(u,f)=>{let d=u.range.start.line-f.range.start.line;return d===0?u.range.start.character-f.range.start.character:d}),c=0,l=[];for(let u of a){let f=i.offsetAt(u.range.start);if(f<c)throw new Error("Overlapping edit");f>c&&l.push(s.substring(c,f)),u.newText.length&&l.push(u.newText),c=i.offsetAt(u.range.end)}return l.push(s.substr(c)),l.join("")}t.applyEdits=n})(ra||(ra={}));function Jy(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);Jy(n,e),Jy(i,e);let o=0,s=0,a=0;for(;o<n.length&&s<i.length;)e(n[o],i[s])<=0?t[a++]=n[o++]:t[a++]=i[s++];for(;o<n.length;)t[a++]=n[o++];for(;s<i.length;)t[a++]=i[s++];return t}function DA(t,e,r=0){let n=e?[r]:[];for(let i=0;i<t.length;i++){let o=t.charCodeAt(i);$A(o)&&(o===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function $A(t){return t===13||t===10}function MA(t){let e=t.start,r=t.end;return e.line>r.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function AF(t){let e=MA(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var FA;(()=>{"use strict";var t={975:O=>{function w(A){if(typeof A!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(A))}function L(A,I){for(var S,B="",H=0,$=-1,q=0,K=0;K<=A.length;++K){if(K<A.length)S=A.charCodeAt(K);else{if(S===47)break;S=47}if(S===47){if(!($===K-1||q===1))if($!==K-1&&q===2){if(B.length<2||H!==2||B.charCodeAt(B.length-1)!==46||B.charCodeAt(B.length-2)!==46){if(B.length>2){var xe=B.lastIndexOf("/");if(xe!==B.length-1){xe===-1?(B="",H=0):H=(B=B.slice(0,xe)).length-1-B.lastIndexOf("/"),$=K,q=0;continue}}else if(B.length===2||B.length===1){B="",H=0,$=K,q=0;continue}}I&&(B.length>0?B+="/..":B="..",H=2)}else B.length>0?B+="/"+A.slice($+1,K):B=A.slice($+1,K),H=K-$-1;$=K,q=0}else S===46&&q!==-1?++q:q=-1}return B}var M={resolve:function(){for(var A,I="",S=!1,B=arguments.length-1;B>=-1&&!S;B--){var H;B>=0?H=arguments[B]:(A===void 0&&(A=process.cwd()),H=A),w(H),H.length!==0&&(I=H+"/"+I,S=H.charCodeAt(0)===47)}return I=L(I,!S),S?I.length>0?"/"+I:"/":I.length>0?I:"."},normalize:function(A){if(w(A),A.length===0)return".";var I=A.charCodeAt(0)===47,S=A.charCodeAt(A.length-1)===47;return(A=L(A,!I)).length!==0||I||(A="."),A.length>0&&S&&(A+="/"),I?"/"+A:A},isAbsolute:function(A){return w(A),A.length>0&&A.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var A,I=0;I<arguments.length;++I){var S=arguments[I];w(S),S.length>0&&(A===void 0?A=S:A+="/"+S)}return A===void 0?".":M.normalize(A)},relative:function(A,I){if(w(A),w(I),A===I||(A=M.resolve(A))===(I=M.resolve(I)))return"";for(var S=1;S<A.length&&A.charCodeAt(S)===47;++S);for(var B=A.length,H=B-S,$=1;$<I.length&&I.charCodeAt($)===47;++$);for(var q=I.length-$,K=H<q?H:q,xe=-1,Y=0;Y<=K;++Y){if(Y===K){if(q>K){if(I.charCodeAt($+Y)===47)return I.slice($+Y+1);if(Y===0)return I.slice($+Y)}else H>K&&(A.charCodeAt(S+Y)===47?xe=Y:Y===0&&(xe=0));break}var pe=A.charCodeAt(S+Y);if(pe!==I.charCodeAt($+Y))break;pe===47&&(xe=Y)}var it="";for(Y=S+xe+1;Y<=B;++Y)Y!==B&&A.charCodeAt(Y)!==47||(it.length===0?it+="..":it+="/..");return it.length>0?it+I.slice($+xe):($+=xe,I.charCodeAt($)===47&&++$,I.slice($))},_makeLong:function(A){return A},dirname:function(A){if(w(A),A.length===0)return".";for(var I=A.charCodeAt(0),S=I===47,B=-1,H=!0,$=A.length-1;$>=1;--$)if((I=A.charCodeAt($))===47){if(!H){B=$;break}}else H=!1;return B===-1?S?"/":".":S&&B===1?"//":A.slice(0,B)},basename:function(A,I){if(I!==void 0&&typeof I!="string")throw new TypeError('"ext" argument must be a string');w(A);var S,B=0,H=-1,$=!0;if(I!==void 0&&I.length>0&&I.length<=A.length){if(I.length===A.length&&I===A)return"";var q=I.length-1,K=-1;for(S=A.length-1;S>=0;--S){var xe=A.charCodeAt(S);if(xe===47){if(!$){B=S+1;break}}else K===-1&&($=!1,K=S+1),q>=0&&(xe===I.charCodeAt(q)?--q==-1&&(H=S):(q=-1,H=K))}return B===H?H=K:H===-1&&(H=A.length),A.slice(B,H)}for(S=A.length-1;S>=0;--S)if(A.charCodeAt(S)===47){if(!$){B=S+1;break}}else H===-1&&($=!1,H=S+1);return H===-1?"":A.slice(B,H)},extname:function(A){w(A);for(var I=-1,S=0,B=-1,H=!0,$=0,q=A.length-1;q>=0;--q){var K=A.charCodeAt(q);if(K!==47)B===-1&&(H=!1,B=q+1),K===46?I===-1?I=q:$!==1&&($=1):I!==-1&&($=-1);else if(!H){S=q+1;break}}return I===-1||B===-1||$===0||$===1&&I===B-1&&I===S+1?"":A.slice(I,B)},format:function(A){if(A===null||typeof A!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof A);return(function(I,S){var B=S.dir||S.root,H=S.base||(S.name||"")+(S.ext||"");return B?B===S.root?B+H:B+"/"+H:H})(0,A)},parse:function(A){w(A);var I={root:"",dir:"",base:"",ext:"",name:""};if(A.length===0)return I;var S,B=A.charCodeAt(0),H=B===47;H?(I.root="/",S=1):S=0;for(var $=-1,q=0,K=-1,xe=!0,Y=A.length-1,pe=0;Y>=S;--Y)if((B=A.charCodeAt(Y))!==47)K===-1&&(xe=!1,K=Y+1),B===46?$===-1?$=Y:pe!==1&&(pe=1):$!==-1&&(pe=-1);else if(!xe){q=Y+1;break}return $===-1||K===-1||pe===0||pe===1&&$===K-1&&$===q+1?K!==-1&&(I.base=I.name=q===0&&H?A.slice(1,K):A.slice(q,K)):(q===0&&H?(I.name=A.slice(1,$),I.base=A.slice(1,K)):(I.name=A.slice(q,$),I.base=A.slice(q,K)),I.ext=A.slice($,K)),q>0?I.dir=A.slice(0,q-1):H&&(I.dir="/"),I},sep:"/",delimiter:":",win32:null,posix:null};M.posix=M,O.exports=M}},e={};function r(O){var w=e[O];if(w!==void 0)return w.exports;var L=e[O]={exports:{}};return t[O](L,L.exports,r),L.exports}r.d=(O,w)=>{for(var L in w)r.o(w,L)&&!r.o(O,L)&&Object.defineProperty(O,L,{enumerable:!0,get:w[L]})},r.o=(O,w)=>Object.prototype.hasOwnProperty.call(O,w),r.r=O=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(O,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(O,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:()=>d,Utils:()=>Ae}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);let o=/^\w[\w\d+.-]*$/,s=/^\//,a=/^\/\//;function c(O,w){if(!O.scheme&&w)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${O.authority}", path: "${O.path}", query: "${O.query}", fragment: "${O.fragment}"}`);if(O.scheme&&!o.test(O.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(O.path){if(O.authority){if(!s.test(O.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(a.test(O.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}let l="",u="/",f=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class d{constructor(w,L,M,A,I,S=!1){le(this,"scheme");le(this,"authority");le(this,"path");le(this,"query");le(this,"fragment");typeof w=="object"?(this.scheme=w.scheme||l,this.authority=w.authority||l,this.path=w.path||l,this.query=w.query||l,this.fragment=w.fragment||l):(this.scheme=(function(B,H){return B||H?B:"file"})(w,S),this.authority=L||l,this.path=(function(B,H){switch(B){case"https":case"http":case"file":H?H[0]!==u&&(H=u+H):H=u}return H})(this.scheme,M||l),this.query=A||l,this.fragment=I||l,c(this,S))}static isUri(w){return w instanceof d||!!w&&typeof w.authority=="string"&&typeof w.fragment=="string"&&typeof w.path=="string"&&typeof w.query=="string"&&typeof w.scheme=="string"&&typeof w.fsPath=="string"&&typeof w.with=="function"&&typeof w.toString=="function"}get fsPath(){return E(this,!1)}with(w){if(!w)return this;let{scheme:L,authority:M,path:A,query:I,fragment:S}=w;return L===void 0?L=this.scheme:L===null&&(L=l),M===void 0?M=this.authority:M===null&&(M=l),A===void 0?A=this.path:A===null&&(A=l),I===void 0?I=this.query:I===null&&(I=l),S===void 0?S=this.fragment:S===null&&(S=l),L===this.scheme&&M===this.authority&&A===this.path&&I===this.query&&S===this.fragment?this:new m(L,M,A,I,S)}static parse(w,L=!1){let M=f.exec(w);return M?new m(M[2]||l,C(M[4]||l),C(M[5]||l),C(M[7]||l),C(M[9]||l),L):new m(l,l,l,l,l)}static file(w){let L=l;if(i&&(w=w.replace(/\\/g,u)),w[0]===u&&w[1]===u){let M=w.indexOf(u,2);M===-1?(L=w.substring(2),w=u):(L=w.substring(2,M),w=w.substring(M)||u)}return new m("file",L,w,l,l)}static from(w){let L=new m(w.scheme,w.authority,w.path,w.query,w.fragment);return c(L,!0),L}toString(w=!1){return _(this,w)}toJSON(){return this}static revive(w){if(w){if(w instanceof d)return w;{let L=new m(w);return L._formatted=w.external,L._fsPath=w._sep===p?w.fsPath:null,L}}return w}}let p=i?1:void 0;class m extends d{constructor(){super(...arguments);le(this,"_formatted",null);le(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=E(this,!1)),this._fsPath}toString(L=!1){return L?_(this,!0):(this._formatted||(this._formatted=_(this,!1)),this._formatted)}toJSON(){let L={$mid:1};return this._fsPath&&(L.fsPath=this._fsPath,L._sep=p),this._formatted&&(L.external=this._formatted),this.path&&(L.path=this.path),this.scheme&&(L.scheme=this.scheme),this.authority&&(L.authority=this.authority),this.query&&(L.query=this.query),this.fragment&&(L.fragment=this.fragment),L}}let y={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function R(O,w,L){let M,A=-1;for(let I=0;I<O.length;I++){let S=O.charCodeAt(I);if(S>=97&&S<=122||S>=65&&S<=90||S>=48&&S<=57||S===45||S===46||S===95||S===126||w&&S===47||L&&S===91||L&&S===93||L&&S===58)A!==-1&&(M+=encodeURIComponent(O.substring(A,I)),A=-1),M!==void 0&&(M+=O.charAt(I));else{M===void 0&&(M=O.substr(0,I));let B=y[S];B!==void 0?(A!==-1&&(M+=encodeURIComponent(O.substring(A,I)),A=-1),M+=B):A===-1&&(A=I)}}return A!==-1&&(M+=encodeURIComponent(O.substring(A))),M!==void 0?M:O}function T(O){let w;for(let L=0;L<O.length;L++){let M=O.charCodeAt(L);M===35||M===63?(w===void 0&&(w=O.substr(0,L)),w+=y[M]):w!==void 0&&(w+=O[L])}return w!==void 0?w:O}function E(O,w){let L;return L=O.authority&&O.path.length>1&&O.scheme==="file"?`//${O.authority}${O.path}`:O.path.charCodeAt(0)===47&&(O.path.charCodeAt(1)>=65&&O.path.charCodeAt(1)<=90||O.path.charCodeAt(1)>=97&&O.path.charCodeAt(1)<=122)&&O.path.charCodeAt(2)===58?w?O.path.substr(1):O.path[1].toLowerCase()+O.path.substr(2):O.path,i&&(L=L.replace(/\//g,"\\")),L}function _(O,w){let L=w?T:R,M="",{scheme:A,authority:I,path:S,query:B,fragment:H}=O;if(A&&(M+=A,M+=":"),(I||A==="file")&&(M+=u,M+=u),I){let $=I.indexOf("@");if($!==-1){let q=I.substr(0,$);I=I.substr($+1),$=q.lastIndexOf(":"),$===-1?M+=L(q,!1,!1):(M+=L(q.substr(0,$),!1,!1),M+=":",M+=L(q.substr($+1),!1,!0)),M+="@"}I=I.toLowerCase(),$=I.lastIndexOf(":"),$===-1?M+=L(I,!1,!0):(M+=L(I.substr(0,$),!1,!0),M+=I.substr($))}if(S){if(S.length>=3&&S.charCodeAt(0)===47&&S.charCodeAt(2)===58){let $=S.charCodeAt(1);$>=65&&$<=90&&(S=`/${String.fromCharCode($+32)}:${S.substr(3)}`)}else if(S.length>=2&&S.charCodeAt(1)===58){let $=S.charCodeAt(0);$>=65&&$<=90&&(S=`${String.fromCharCode($+32)}:${S.substr(2)}`)}M+=L(S,!0,!1)}return B&&(M+="?",M+=L(B,!1,!1)),H&&(M+="#",M+=w?H:R(H,!1,!1)),M}function k(O){try{return decodeURIComponent(O)}catch{return O.length>3?O.substr(0,3)+k(O.substr(3)):O}}let D=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function C(O){return O.match(D)?O.replace(D,(w=>k(w))):O}var j=r(975);let V=j.posix||j,ie="/";var Ae;(function(O){O.joinPath=function(w,...L){return w.with({path:V.join(w.path,...L)})},O.resolvePath=function(w,...L){let M=w.path,A=!1;M[0]!==ie&&(M=ie+M,A=!0);let I=V.resolve(M,...L);return A&&I[0]===ie&&!w.authority&&(I=I.substring(1)),w.with({path:I})},O.dirname=function(w){if(w.path.length===0||w.path===ie)return w;let L=V.dirname(w.path);return L.length===1&&L.charCodeAt(0)===46&&(L=""),w.with({path:L})},O.basename=function(w){return V.basename(w.path)},O.extname=function(w){return V.extname(w.path)}})(Ae||(Ae={})),FA=n})();var{URI:mt,Utils:na}=FA;var _t;(function(t){t.basename=na.basename,t.dirname=na.dirname,t.extname=na.extname,t.joinPath=na.joinPath,t.resolvePath=na.resolvePath;let e=typeof process=="object"&&process?.platform==="win32";function r(s,a){return s?.toString()===a?.toString()}t.equals=r;function n(s,a){let c=typeof s=="string"?mt.parse(s).path:s.path,l=typeof a=="string"?mt.parse(a).path:a.path,u=c.split("/").filter(y=>y.length>0),f=l.split("/").filter(y=>y.length>0);if(e){let y=/^[A-Z]:$/;if(u[0]&&y.test(u[0])&&(u[0]=u[0].toLowerCase()),f[0]&&y.test(f[0])&&(f[0]=f[0].toLowerCase()),u[0]!==f[0])return l.substring(1)}let d=0;for(;d<u.length&&u[d]===f[d];d++);let p="../".repeat(u.length-d),m=f.slice(d).join("/");return p+m}t.relative=n;function i(s){return mt.parse(s.toString()).toString()}t.normalize=i;function o(s,a){let c=typeof s=="string"?s:s.path,l=typeof a=="string"?a:a.path;return l.charAt(l.length-1)==="/"&&(l=l.slice(0,-1)),c.charAt(c.length-1)==="/"&&(c=c.slice(0,-1)),l===c?!0:l.length<c.length||l.charAt(c.length)!=="/"?!1:l.startsWith(c)}t.contains=o})(_t||(_t={}));var ia=class{constructor(){this.root={name:"",children:new Map}}normalizeUri(e){return _t.normalize(e)}clear(){this.root.children.clear()}insert(e,r){let n=this.getNode(this.normalizeUri(e),!0);n.element=r}delete(e){let r=this.getNode(this.normalizeUri(e),!1);r?.parent&&r.parent.children.delete(r.name)}has(e){return this.getNode(this.normalizeUri(e),!1)?.element!==void 0}hasNode(e){return this.getNode(this.normalizeUri(e),!1)!==void 0}find(e){return this.getNode(this.normalizeUri(e),!1)?.element}findNode(e){let r=this.normalizeUri(e),n=this.getNode(r,!1);if(n)return{name:n.name,uri:_t.joinPath(mt.parse(r),n.name).toString(),element:n.element}}findChildren(e){let r=this.normalizeUri(e),n=this.getNode(r,!1);return n?Array.from(n.children.values()).map(i=>({name:i.name,uri:_t.joinPath(mt.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){let r=this.getNode(_t.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){let n=e.split("/");e.charAt(e.length-1)==="/"&&n.pop();let i=this.root;for(let o of n){let s=i.children.get(o);if(!s)if(r)s={name:o,children:new Map,parent:i},i.children.set(o,s);else return;i=s}return i}collectValues(e){let r=[];e.element&&r.push(e.element);for(let n of e.children.values())r.push(...this.collectValues(n));return r}};var he;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(he||(he={}));var yl=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=ne.CancellationToken.None){let n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??mt.parse(e.uri),ne.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return ne.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){let i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){let i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{let i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){let i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{let i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let o;if(n)o={parseResult:e,uri:r,state:he.Parsed,references:[],textDocument:n};else{let s=this.createTextDocumentGetter(r,i);o={parseResult:e,uri:r,state:he.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=o,o}async update(e,r){let n=e.parseResult.value.$cstNode?.root.fullText,i=this.textDocuments?.get(e.uri.toString()),o=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{let s=this.createTextDocumentGetter(e.uri,o);Object.defineProperty(e,"textDocument",{get:s})}return n!==o&&(e.parseResult=await this.parseAsync(e.uri,o,r),e.parseResult.value.$document=e),e.state=he.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){let n=this.serviceRegistry,i;return()=>i??(i=ra.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},xl=class{constructor(e){this.documentTrie=new ia,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return me(this.documentTrie.all())}addDocument(e){let r=e.uri.toString();if(this.documentTrie.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentTrie.insert(r,e)}getDocument(e){let r=e.toString();return this.documentTrie.find(r)}getDocuments(e){let r=e.toString();return this.documentTrie.findAll(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{let i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){let r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,he.Changed),n}deleteDocument(e){let r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=he.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){let r=e.toString(),n=this.documentTrie.findAll(r);for(let i of n)i.state=he.Changed;return this.documentTrie.delete(r),n}};var No=Symbol("RefResolving"),Tl=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,r=ne.CancellationToken.None){if(this.profiler?.isActive("linking")){let n=this.profiler.createTask("linking",this.languageId);n.start();try{for(let i of Wt(e.parseResult.value))await ht(r),Jn(i).forEach(o=>{let s=`${i.$type}:${o.property}`;n.startSubTask(s);try{this.doLink(o,e)}finally{n.stopSubTask(s)}})}finally{n.stop()}}else for(let n of Wt(e.parseResult.value))await ht(r),Jn(n).forEach(i=>this.doLink(i,e))}doLink(e,r){let n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=No;try{let i=this.getCandidate(e);if(Vi(i))n._ref=i;else{n._nodeDescription=i;let o=this.loadAstNode(i);n._ref=o??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);let o=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${o}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=No;try{let i=this.getCandidates(e),o=[];if(Vi(i))n._linkingError=i;else for(let s of i){let a=this.loadAstNode(s);a&&o.push({ref:a,$nodeDescription:s})}n._items=o}catch(i){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${i}`},n._items=[]}r.references.push(n)}}unlink(e){for(let r of e.references)"_ref"in r?(r._ref=void 0,delete r._nodeDescription):"_items"in r&&(r._items=void 0,delete r._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){let n=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return n.length>0?n:this.createLinkingError(e)}buildReference(e,r,n,i){let o=this,s={$refNode:n,$refText:i,_ref:void 0,get ref(){if(pt(this._ref))return this._ref;if(nm(this._nodeDescription)){let a=o.loadAstNode(this._nodeDescription);this._ref=a??o.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=No;let a=ns(e).$document,c=o.getLinkedNode({reference:s,container:e,property:r});if(c.error&&a&&a.state<he.ComputedScopes)return this._ref=void 0;this._ref=c.node??c.error,this._nodeDescription=c.descr,a?.references.push(this)}else this._ref===No&&o.throwCyclicReferenceError(e,r,i);return pt(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return Vi(this._ref)?this._ref:void 0}};return s}buildMultiReference(e,r,n,i){let o=this,s={$refNode:n,$refText:i,_items:void 0,get items(){if(Array.isArray(this._items))return this._items;if(this._items===void 0){this._items=No;let a=ns(e).$document,c=o.getCandidates({reference:s,container:e,property:r}),l=[];if(Vi(c))this._linkingError=c;else for(let u of c){let f=o.loadAstNode(u);f&&l.push({ref:f,$nodeDescription:u})}this._items=l,a?.references.push(this)}else this._items===No&&o.throwCyclicReferenceError(e,r,i);return Array.isArray(this._items)?this._items:[]},get error(){if(this._linkingError)return this._linkingError;if(!(this.items.length>0))return this._linkingError=o.createLinkingError({reference:s,container:e,property:r})}};return s}throwCyclicReferenceError(e,r,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${n}')`)}getLinkedNode(e){try{let r=this.getCandidate(e);if(Vi(r))return{error:r};let n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);let n=r.message??String(r);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`}}}}loadAstNode(e){if(e.node)return e.node;let r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){let n=ns(e.container).$document;n&&n.state<he.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`);let i=this.reflection.getReferenceType(e);return{info:e,message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:r}}};function UA(t){return typeof t.name=="string"}var _l=class{getName(e){if(UA(e))return e.name}getNameNode(e){return Oc(e.$cstNode,"name")}};var El=class{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator,this.documents=e.shared.workspace.LangiumDocuments,this.hasMultiReference=Wt(e.Grammar).some(r=>Mr(r)&&r.isMulti)}findDeclarations(e){if(e){let r=jm(e),n=e.astNode;if(r&&n){let i=n[r.feature];if(wt(i)||lr(i))return Vu(i);if(Array.isArray(i)){for(let o of i)if((wt(o)||lr(o))&&o.$refNode&&o.$refNode.offset<=e.offset&&o.$refNode.end>=e.end)return Vu(o)}}if(n){let i=this.nameProvider.getNameNode(n);if(i&&(i===e||Sm(e,i)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){let r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(let i of Jn(n))if(lr(i.reference)&&i.reference.items.some(o=>o.ref===e))return i.reference.items.map(o=>o.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;let r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){let r=this.findDeclarations(e),n=[];for(let i of r){let o=this.nameProvider.getNameNode(i)??i.$cstNode;o&&n.push(o)}return n}findReferences(e,r){let n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(o=>_t.equals(o.sourceUri,r.documentUri))),n.push(...i),me(n)}getSelfReferences(e){let r=this.getSelfNodes(e),n=[];for(let i of r){let o=this.nameProvider.getNameNode(i);if(o){let s=Ft(i),a=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:a,targetUri:s.uri,targetPath:a,segment:ao(o),local:!0})}}return n}};var Bt=class{constructor(e){if(this.map=new Map,e)for(let[r,n]of e)this.add(r,n)}get size(){return ts.sum(me(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{let n=this.map.get(e);if(n){let i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){let r=this.map.get(e);return r?me(r):Zn}has(e,r){if(r===void 0)return this.map.has(e);{let n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return me(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return me(this.map.keys())}values(){return me(this.map.values()).flat()}entriesGroupedByKey(){return me(this.map.entries())}},Po=class{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(let[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){let r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}};var Rl=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=ne.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=gc,i=ne.CancellationToken.None){let o=[];this.addExportedSymbol(e,o,r);for(let s of n(e))await ht(i),this.addExportedSymbol(s,o,r);return o}addExportedSymbol(e,r,n){let i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=ne.CancellationToken.None){let n=e.parseResult.value,i=new Bt;for(let o of Lr(n))await ht(r),this.addLocalSymbol(o,e,i);return i}addLocalSymbol(e,r,n){let i=e.$container;if(i){let o=this.nameProvider.getName(e);o&&n.add(i,this.descriptions.createDescription(e,o,r))}}};var oa=class{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===r):this.elements.find(i=>i.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===r):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||n.isEmpty())&&this.outerScope?n.concat(this.outerScope.getElements(e)):n}},Qy=class{constructor(e,r,n){this.elements=new Map,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0;for(let i of e){let o=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(o,i)}this.outerScope=r}getElement(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r),i=n?[n]:[];return(this.concatOuterScope||i.length>0)&&this.outerScope?me(i).concat(this.outerScope.getElements(e)):me(i)}getAllElements(){let e=me(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},bl=class{constructor(e,r,n){this.elements=new Bt,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0;for(let i of e){let o=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(o,i)}this.outerScope=r}getElement(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r)[0];if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?me(n).concat(this.outerScope.getElements(e)):me(n)}getAllElements(){let e=me(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},IF={getElement(){},getElements(){return Zn},getAllElements(){return Zn}};var sa=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},wl=class extends sa{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){let n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},Co=class extends sa{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();let i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){let o=n();return i.set(r,o),o}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){let r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){let r=this.converter(e),n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},qd=class extends Co{constructor(e,r){super(n=>n.toString()),r?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(r,n=>{this.clear(n.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{for(let o of i)this.clear(o)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{let o=n.concat(i);for(let s of o)this.clear(s)}))}},aa=class extends wl{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}};var Al=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new aa(e.shared)}getScope(e){let r=[],n=this.reflection.getReferenceType(e),i=Ft(e.container).localSymbols;if(i){let s=e.container;do i.has(s)&&r.push(i.getStream(s).filter(a=>this.reflection.isSubtype(a.type,n))),s=s.$container;while(s)}let o=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)o=this.createScope(r[s],o);return o}createScope(e,r,n){return new oa(me(e),r,n)}createScopeForNodes(e,r,n){let i=me(e).map(o=>{let s=this.nameProvider.getName(o);if(s)return this.descriptions.createDescription(o,s)}).nonNullable();return new oa(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new bl(this.indexManager.allElements(e)))}};function ex(t){return typeof t.$comment=="string"}function BA(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}var Il=class{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){let n=r??{},i=r?.replacer,o=(a,c)=>this.replacer(a,c,n),s=i?(a,c)=>i(a,c,o):o;try{return this.currentDocument=Ft(e),JSON.stringify(e,s,r?.space)}finally{this.currentDocument=void 0}}deserialize(e,r){let n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:o,comments:s,uriConverter:a}){if(!this.ignoreProperties.has(e))if(wt(r)){let c=r.ref,l=n?r.$refText:void 0;if(c){let u=Ft(c),f="";this.currentDocument&&this.currentDocument!==u&&(a?f=a(u.uri,c):f=u.uri.toString());let d=this.astNodeLocator.getAstNodePath(c);return{$ref:`${f}#${d}`,$refText:l}}else return{$error:r.error?.message??"Could not resolve reference",$refText:l}}else if(lr(r)){let c=n?r.$refText:void 0,l=[];for(let u of r.items){let f=u.ref,d=Ft(u.ref),p="";this.currentDocument&&this.currentDocument!==d&&(a?p=a(d.uri,f):p=d.uri.toString());let m=this.astNodeLocator.getAstNodePath(f);l.push(`${p}#${m}`)}return{$refs:l,$refText:c}}else if(pt(r)){let c;if(o&&(c=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&c?.$textRegion&&(c.$textRegion.documentURI=this.currentDocument?.uri.toString())),i&&!e&&(c??(c={...r}),c.$sourceText=r.$cstNode?.text),s){c??(c={...r});let l=this.commentProvider.getComment(r);l&&(c.$comment=l.replace(/\r/g,""))}return c??r}else return r}addAstNodeRegionWithAssignmentsTo(e){let r=n=>({offset:n.offset,end:n.end,length:n.length,range:n.range});if(e.$cstNode){let n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(o=>!o.startsWith("$")).forEach(o=>{let s=Bm(e.$cstNode,o).map(r);s.length!==0&&(i[o]=s)}),e}}linkNode(e,r,n,i,o,s){for(let[c,l]of Object.entries(e))if(Array.isArray(l))for(let u=0;u<l.length;u++){let f=l[u];BA(f)?l[u]=this.reviveReference(e,c,r,f,n):pt(f)&&this.linkNode(f,r,n,e,c,u)}else BA(l)?e[c]=this.reviveReference(e,c,r,l,n):pt(l)&&this.linkNode(l,r,n,e,c);let a=e;a.$container=i,a.$containerProperty=o,a.$containerIndex=s}reviveReference(e,r,n,i,o){let s=i.$refText,a=i.$error,c;if(i.$ref){let l=this.getRefNode(n,i.$ref,o.uriConverter);if(pt(l))return s||(s=this.nameProvider.getName(l)),{$refText:s??"",ref:l};a=l}else if(i.$refs){let l=[];for(let u of i.$refs){let f=this.getRefNode(n,u,o.uriConverter);pt(f)&&l.push({ref:f})}if(l.length===0)c={$refText:s??"",items:l},a??(a="Could not resolve multi-reference");else return{$refText:s??"",items:l}}if(a)return c??(c={$refText:s??"",ref:void 0}),c.error={info:{container:e,property:r,reference:c},message:a},c}getRefNode(e,r,n){try{let i=r.indexOf("#");if(i===0){let c=this.astNodeLocator.getAstNode(e,r.substring(1));return c||"Could not resolve path: "+r}if(i<0){let c=n?n(r):mt.parse(r),l=this.langiumDocuments.getDocument(c);return l?l.parseResult.value:"Could not find document for URI: "+r}let o=n?n(r.substring(0,i)):mt.parse(r.substring(0,i)),s=this.langiumDocuments.getDocument(o);if(!s)return"Could not find document for URI: "+r;if(i===r.length-1)return s.parseResult.value;let a=this.astNodeLocator.getAstNode(s.parseResult.value,r.substring(i+1));return a||"Could not resolve URI: "+r}catch(i){return String(i)}}};var Sl=class{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.fileNameMap=new Map,this.textDocuments=e?.workspace.TextDocuments}register(e){let r=e.LanguageMetaData;for(let n of r.fileExtensions)this.fileExtensionMap.has(n)&&console.warn(`The file extension ${n} is used by multiple languages. It is now assigned to '${r.languageId}'.`),this.fileExtensionMap.set(n,e);if(r.fileNames)for(let n of r.fileNames)this.fileNameMap.has(n)&&console.warn(`The file name ${n} is used by multiple languages. It is now assigned to '${r.languageId}'.`),this.fileNameMap.set(n,e);this.languageIdMap.set(r.languageId,e)}getServices(e){if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");let r=this.textDocuments?.get(e)?.languageId;if(r!==void 0){let s=this.languageIdMap.get(r);if(s)return s}let n=_t.extname(e),i=_t.basename(e),o=this.fileNameMap.get(i)??this.fileExtensionMap.get(n);if(!o)throw r?new Error(`The service registry contains no services for the extension '${n}' for language '${r}'.`):new Error(`The service registry contains no services for the extension '${n}'.`);return o}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}};function Oo(t){return{code:t}}var zd;(function(t){t.defaults=["fast","slow","built-in"],t.all=t.defaults})(zd||(zd={}));var vl=class{constructor(e){this.entries=new Bt,this.knownCategories=new Set(zd.defaults),this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,r=this,n="fast"){if(n==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");this.knownCategories.add(n);for(let[i,o]of Object.entries(e)){let s=o;if(Array.isArray(s))for(let a of s){let c={check:this.wrapValidationException(a,r),category:n};this.addEntry(i,c)}else if(typeof s=="function"){let a={check:this.wrapValidationException(s,r),category:n};this.addEntry(i,a)}else sn(s)}}wrapValidationException(e,r){return async(n,i,o)=>{await this.handleException(()=>e.call(r,n,i,o),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(o){if(pn(o))throw o;console.error(`${r}:`,o),o instanceof Error&&o.stack&&console.error(o.stack);let s=o instanceof Error?o.message:String(o);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(let n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=me(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,o,s,a)=>{await this.handleException(()=>e.call(n,i,o,s,a),r,o,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}};var XA=Object.freeze({validateNode:!0,validateChildren:!0}),kl=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,r={},n=ne.CancellationToken.None){let i=e.parseResult,o=[];if(await ht(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,o,r),r.stopAfterLexingErrors&&o.some(s=>s.data?.code===wr.LexingError)||(this.processParsingErrors(i,o,r),r.stopAfterParsingErrors&&o.some(s=>s.data?.code===wr.ParsingError))||(this.processLinkingErrors(e,o,r),r.stopAfterLinkingErrors&&o.some(s=>s.data?.code===wr.LinkingError))))return o;try{o.push(...await this.validateAst(i.value,r,n))}catch(s){if(pn(s))throw s;console.error("An error occurred during validation:",s)}return await ht(n),o}processLexingErrors(e,r,n){let i=[...e.lexerErrors,...e.lexerReport?.diagnostics??[]];for(let o of i){let s=o.severity??"error",a={severity:Vd(s),range:{start:{line:o.line-1,character:o.column-1},end:{line:o.line-1,character:o.column+o.length-1}},message:o.message,data:HA(s),source:this.getSource()};r.push(a)}}processParsingErrors(e,r,n){for(let i of e.parserErrors){let o;if(isNaN(i.token.startOffset)){if("previousToken"in i){let s=i.previousToken;if(isNaN(s.startOffset)){let a={line:0,character:0};o={start:a,end:a}}else{let a={line:s.endLine-1,character:s.endColumn};o={start:a,end:a}}}}else o=ds(i.token);if(o){let s={severity:Vd("error"),range:o,message:i.message,data:Oo(wr.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){for(let i of e.references){let o=i.error;if(o){let s={node:o.info.container,range:i.$refNode?.range,property:o.info.property,index:o.info.index,data:{code:wr.LinkingError,containerType:o.info.container.$type,property:o.info.property,refText:o.info.reference.$refText}};r.push(this.toDiagnostic("error",o.message,s))}}}async validateAst(e,r,n=ne.CancellationToken.None){let i=[],o=(s,a,c)=>{i.push(this.toDiagnostic(s,a,c))};return await this.validateAstBefore(e,r,o,n),await this.validateAstNodes(e,r,o,n),await this.validateAstAfter(e,r,o,n),i}async validateAstBefore(e,r,n,i=ne.CancellationToken.None){let o=this.validationRegistry.checksBefore;for(let s of o)await ht(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=ne.CancellationToken.None){if(this.profiler?.isActive("validating")){let o=this.profiler.createTask("validating",this.languageId);o.start();try{let s=Wt(e).iterator();for(let a of s){o.startSubTask(a.$type);let c=this.validateSingleNodeOptions(a,r);if(c.validateNode)try{let l=this.validationRegistry.getChecks(a.$type,r.categories);for(let u of l)await u(a,n,i)}finally{o.stopSubTask(a.$type)}c.validateChildren||s.prune()}}finally{o.stop()}}else{let o=Wt(e).iterator();for(let s of o){await ht(i);let a=this.validateSingleNodeOptions(s,r);if(a.validateNode){let c=this.validationRegistry.getChecks(s.$type,r.categories);for(let l of c)await l(s,n,i)}a.validateChildren||o.prune()}}}validateSingleNodeOptions(e,r){return XA}async validateAstAfter(e,r,n,i=ne.CancellationToken.None){let o=this.validationRegistry.checksAfter;for(let s of o)await ht(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:GA(n),severity:Vd(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};function GA(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=Oc(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=Gm(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function Vd(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}function HA(t){switch(t){case"error":return Oo(wr.LexingError);case"warning":return Oo(wr.LexingWarning);case"info":return Oo(wr.LexingInfo);case"hint":return Oo(wr.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var wr;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(wr||(wr={}));var Nl=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){let i=n??Ft(e);r??(r=this.nameProvider.getName(e));let o=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${o} has no name.`);let s,a=()=>s??(s=ao(this.nameProvider.getNameNode(e)??e.$cstNode));return{node:e,name:r,get nameSegment(){return a()},selectionSegment:ao(e.$cstNode),type:e.$type,documentUri:i.uri,path:o}}},Pl=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=ne.CancellationToken.None){let n=[],i=e.parseResult.value;for(let o of Wt(i))await ht(r),Jn(o).forEach(s=>{s.reference.error||n.push(...this.createInfoDescriptions(s))});return n}createInfoDescriptions(e){let r=e.reference;if(r.error||!r.$refNode)return[];let n=[];wt(r)&&r.$nodeDescription?n=[r.$nodeDescription]:lr(r)&&(n=r.items.map(c=>c.$nodeDescription).filter(c=>c!==void 0));let i=Ft(e.container).uri,o=this.nodeLocator.getAstNodePath(e.container),s=[],a=ao(r.$refNode);for(let c of n)s.push({sourceUri:i,sourcePath:o,targetUri:c.documentUri,targetPath:c.path,segment:a,local:_t.equals(c.documentUri,i)});return s}};var Cl=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){let r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,o)=>{if(!i||o.length===0)return i;let s=o.indexOf(this.indexSeparator);if(s>0){let a=o.substring(0,s),c=parseInt(o.substring(s+1));return i[a]?.[c]}return i[o]},e)}};var rt={};Ie(rt,rm(Vy(),1));var Ol=class{constructor(e){this._ready=new Jt,this.onConfigurationSectionUpdateEmitter=new rt.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){this.workspaceConfig=e.capabilities.workspace?.configuration??!1}async initialized(e){if(this.workspaceConfig){if(e.register){let r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){let r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,o)=>{this.updateSectionConfiguration(i.section,n[o])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([r,n])=>{this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;let n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}};var Sa=rm(mv(),1);var Ci;(function(t){function e(r){return{dispose:async()=>await r()}}t.create=e})(Ci||(Ci={}));var Hl=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Bt,this.documentPhaseListeners=new Bt,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=he.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=ne.CancellationToken.None){for(let i of e){let o=i.uri.toString();if(i.state===he.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(i,he.IndexedReferences);else if(typeof r.validation=="object"){let s=this.findMissingValidationCategories(i,r);s.length>0&&(this.buildState.set(o,{completed:!1,options:{validation:{categories:s}},result:this.buildState.get(o)?.result}),i.state=he.IndexedReferences)}}else this.buildState.delete(o)}this.currentState=he.Changed,await this.emitUpdate(e.map(i=>i.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=ne.CancellationToken.None){this.currentState=he.Changed;let i=[];for(let c of r){let l=this.langiumDocuments.deleteDocuments(c);for(let u of l)i.push(u.uri),this.cleanUpDeleted(u)}let o=(await Promise.all(e.map(c=>this.findChangedUris(c)))).flat();for(let c of o){let l=this.langiumDocuments.getDocument(c);l===void 0&&(l=this.langiumDocumentFactory.fromModel({$type:"INVALID"},c),l.state=he.Changed,this.langiumDocuments.addDocument(l)),this.resetToState(l,he.Changed)}let s=me(o).concat(i).map(c=>c.toString()).toSet();this.langiumDocuments.all.filter(c=>!s.has(c.uri.toString())&&this.shouldRelink(c,s)).forEach(c=>this.resetToState(c,he.ComputedScopes)),await this.emitUpdate(o,i),await ht(n);let a=this.sortDocuments(this.langiumDocuments.all.filter(c=>c.state<he.Validated||!this.buildState.get(c.uri.toString())?.completed||this.resultsAreIncomplete(c,this.updateBuildOptions)).toArray());await this.buildDocuments(a,this.updateBuildOptions,n)}resultsAreIncomplete(e,r){return this.findMissingValidationCategories(e,r).length>=1}findMissingValidationCategories(e,r){let n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),o=n?.result?.validationChecks?new Set(n?.result?.validationChecks):n?.completed?i:new Set,s=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return me(s).filter(a=>!o.has(a)).toArray()}async findChangedUris(e){if(this.langiumDocuments.getDocument(e)??this.textDocuments?.get(e))return[e];try{let n=await this.fileSystemProvider.stat(e);if(n.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(n))return[e]}catch{}return[]}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r<n;){for(;r<e.length&&this.hasTextDocument(e[r]);)r++;for(;n>=0&&!this.hasTextDocument(e[n]);)n--;r<n&&([e[r],e[n]]=[e[n],e[r]])}return e}hasTextDocument(e){return!!this.textDocuments?.get(e.uri)}shouldRelink(e,r){return e.references.some(n=>n.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),Ci.create(()=>{let r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case he.Changed:case he.Parsed:this.indexManager.removeContent(e.uri);case he.IndexedContent:e.localSymbols=void 0;case he.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case he.Linked:this.indexManager.removeReferences(e.uri);case he.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case he.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=he.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,he.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,he.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,he.ComputedScopes,n,async s=>{let a=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await a.collectLocalSymbols(s,n)});let i=e.filter(s=>this.shouldLink(s));await this.runCancelable(i,he.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,he.IndexedReferences,n,s=>this.indexManager.updateReferences(s,n));let o=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(o,he.Validated,n,async s=>{await this.validate(s,n),this.markAsCompleted(s)})}markAsCompleted(e){let r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(let n of e){let i=n.uri.toString(),o=this.buildState.get(i);(!o||o.completed)&&this.buildState.set(i,{completed:!1,options:r,result:o?.result})}}async runCancelable(e,r,n,i){for(let s of e)s.state<r&&(await ht(n),await i(s),s.state=r,await this.notifyDocumentPhase(s,r,n));let o=e.filter(s=>s.state===r);await this.notifyBuildPhase(o,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),Ci.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),Ci.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=ne.CancellationToken.None),i?this.awaitDocumentState(e,i,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){let i=this.langiumDocuments.getDocument(r);if(i){if(i.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(br);if(this.currentState>=e&&e>i.state)return Promise.reject(new Sa.ResponseError(Sa.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${he[i.state]}, requiring ${he[e]}, but workspace state is already ${he[this.currentState]}. Returning undefined.`))}else return Promise.reject(new Sa.ResponseError(Sa.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((o,s)=>{let a=this.onDocumentPhase(e,l=>{_t.equals(l.uri,r)&&(a.dispose(),c.dispose(),o(l.uri))}),c=n.onCancellationRequested(()=>{a.dispose(),c.dispose(),s(br)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(br):new Promise((n,i)=>{let o=this.onBuildPhase(e,()=>{o.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{o.dispose(),s.dispose(),i(br)})})}async notifyDocumentPhase(e,r,n){let o=this.documentPhaseListeners.get(r).slice();for(let s of o)try{await ht(n),await s(e,n)}catch(a){if(!pn(a))throw a}}async notifyBuildPhase(e,r,n){if(e.length===0)return;let o=this.buildPhaseListeners.get(r).slice();for(let s of o)await ht(n),await s(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){let n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),o=typeof i.validation=="object"?{...i.validation}:{};o.categories=this.findMissingValidationCategories(e,i);let s=await n.validateDocument(e,o,r);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;let a=this.buildState.get(e.uri.toString());a&&(a.result??(a.result={}),a.result.validationChecks?a.result.validationChecks=me(a.result.validationChecks).concat(o.categories).distinct().toArray():a.result.validationChecks=[...o.categories])}getBuildOptions(e){return this.buildState.get(e.uri.toString())?.options??{}}};var jl=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Co,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){let n=Ft(e).uri,i=[];return this.referenceIndex.forEach(o=>{o.forEach(s=>{_t.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),me(i)}allElements(e,r){let n=me(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){return r?this.symbolByTypeIndex.get(e,r,()=>(this.symbolIndex.get(e)??[]).filter(o=>this.astReflection.isSubtype(o.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){let r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){let r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=ne.CancellationToken.None){let i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),o=e.uri.toString();this.symbolIndex.set(o,i),this.symbolByTypeIndex.clear(o)}async updateReferences(e,r=ne.CancellationToken.None){let i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){let n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}};var Wl=class{constructor(e){this.initialBuildOptions={},this._ready=new Jt,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(r=>this.initializeWorkspace(this.folders??[],r))}async initializeWorkspace(e,r=ne.CancellationToken.None){let n=await this.performStartup(e);await ht(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){let r=[],n=s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)};await this.loadAdditionalDocuments(e,n);let i=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,i)));let o=me(i).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(o,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{let i=await this.langiumDocuments.getOrCreateDocument(n);r(i)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return mt.parse(e.uri)}async traverseFolder(e,r){try{let n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,r):i.isFile&&r.push(i.uri))}))}catch(n){console.error("Failure to read directory content of "+e.toString(!0),n)}}async searchFolder(e){let r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){let r=_t.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}};var ql=class{buildUnexpectedCharactersMessage(e,r,n,i,o){return bs.buildUnexpectedCharactersMessage(e,r,n,i,o)}buildUnableToPopLexerModeMessage(e){return bs.buildUnableToPopLexerModeMessage(e)}},Np={mode:"full"},Mo=class{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;let r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);let n=IT(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new at(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=Np){let n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:this.tokenBuilder.flushLexingReport?.(e)}}toTokenTypeDictionary(e){if(IT(e))return e;let r=ST(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}};function Pp(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function ST(t){return t&&"modes"in t&&"defaultMode"in t}function IT(t){return!Pp(t)&&!ST(t)}Zs();function NT(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=ke.create(0,0));let o=xv(t),s=CT(n),a=bU({lines:o,position:i,options:s});return vU({index:0,tokens:a,position:i})}function PT(t,e){let r=CT(e),n=xv(t);if(n.length===0)return!1;let i=n[0],o=n[n.length-1],s=r.start,a=r.end;return!!s?.exec(i)&&!!a?.exec(o)}function xv(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(Om)}var gv=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,RU=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function bU(t){let e=[],r=t.position.line,n=t.position.character;for(let i=0;i<t.lines.length;i++){let o=i===0,s=i===t.lines.length-1,a=t.lines[i],c=0;if(o&&t.options.start){let u=t.options.start?.exec(a);u&&(c=u.index+u[0].length)}else{let u=t.options.line?.exec(a);u&&(c=u.index+u[0].length)}if(s){let u=t.options.end?.exec(a);u&&(a=a.substring(0,u.index))}if(a=a.substring(0,SU(a)),kT(a,c)>=a.length){if(e.length>0){let u=ke.create(r,n);e.push({type:"break",content:"",range:_e.create(u,u)})}}else{gv.lastIndex=c;let u=gv.exec(a);if(u){let f=u[0],d=u[1],p=ke.create(r,n+c),m=ke.create(r,n+c+f.length);e.push({type:"tag",content:d,range:_e.create(p,m)}),c+=f.length,c=kT(a,c)}if(c<a.length){let f=a.substring(c),d=Array.from(f.matchAll(RU));e.push(...wU(d,f,r,n+c))}}r++,n=0}return e.length>0&&e[e.length-1].type==="break"?e.slice(0,-1):e}function wU(t,e,r,n){let i=[];if(t.length===0){let o=ke.create(r,n),s=ke.create(r,n+e.length);i.push({type:"text",content:e,range:_e.create(o,s)})}else{let o=0;for(let a of t){let c=a.index,l=e.substring(o,c);l.length>0&&i.push({type:"text",content:e.substring(o,c),range:_e.create(ke.create(r,o+n),ke.create(r,c+n))});let u=l.length+1,f=a[1];if(i.push({type:"inline-tag",content:f,range:_e.create(ke.create(r,o+u+n),ke.create(r,o+u+f.length+n))}),u+=f.length,a.length===4){u+=a[2].length;let d=a[3];i.push({type:"text",content:d,range:_e.create(ke.create(r,o+u+n),ke.create(r,o+u+d.length+n))})}else i.push({type:"text",content:"",range:_e.create(ke.create(r,o+u+n),ke.create(r,o+u+n))});o=c+a[0].length}let s=e.substring(o);s.length>0&&i.push({type:"text",content:s,range:_e.create(ke.create(r,o+n),ke.create(r,o+n+s.length))})}return i}var AU=/\S/,IU=/\s*$/;function kT(t,e){let r=t.substring(e).match(AU);return r?e+r.index:t.length}function SU(t){let e=t.match(IU);if(e&&typeof e.index=="number")return e.index}function vU(t){let e=ke.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Cp([],_e.create(e,e));let r=[];for(;t.index<t.tokens.length;){let o=kU(t,r[r.length-1]);o&&r.push(o)}let n=r[0]?.range.start??e,i=r[r.length-1]?.range.end??e;return new Cp(r,_e.create(n,i))}function kU(t,e){let r=t.tokens[t.index];if(r.type==="tag")return _v(t,!1);if(r.type==="text"||r.type==="inline-tag")return Tv(t);NU(r,e),t.index++}function NU(t,e){if(e){let r=new Op("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function Tv(t){let e=t.tokens[t.index],r=e,n=e,i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(PU(t)),n=e,e=t.tokens[t.index];return new Vl(i,_e.create(r.range.start,n.range.end))}function PU(t){return t.tokens[t.index].type==="inline-tag"?_v(t,!0):Ev(t)}function _v(t,e){let r=t.tokens[t.index++],n=r.content.substring(1);if(t.tokens[t.index]?.type==="text")if(e){let o=Ev(t);return new zl(n,new Vl([o],o.range),e,_e.create(r.range.start,o.range.end))}else{let o=Tv(t);return new zl(n,o,e,_e.create(r.range.start,o.range.end))}else{let o=r.range;return new zl(n,new Vl([],o),e,o)}}function Ev(t){let e=t.tokens[t.index++];return new Op(e.content,e.range)}function CT(t){if(!t)return CT({start:"/**",end:"*/",line:"*"});let{start:e,end:r,line:n}=t;return{start:vT(e,!0),end:vT(r,!1),line:vT(n,!0)}}function vT(t,e){if(typeof t=="string"||typeof t=="object"){let r=typeof t=="string"?si(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}var Cp=class{constructor(e,r){this.elements=e,this.range=r}getTag(e){return this.getAllTags().find(r=>r.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(let r of this.elements)if(e.length===0)e=r.toString();else{let n=r.toString();e+=yv(e)+n}return e.trim()}toMarkdown(e){let r="";for(let n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{let i=n.toMarkdown(e);r+=yv(r)+i}return r.trim()}},zl=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`,r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e}
153
- ${r}`),this.inline?`{${e}}`:e}toMarkdown(e){return e?.renderTag?.(this)??this.toMarkdownDefault(e)}toMarkdownDefault(e){let r=this.content.toMarkdown(e);if(this.inline){let o=CU(this.name,r,e??{});if(typeof o=="string")return o}let n="";e?.tag==="italic"||e?.tag===void 0?n="*":e?.tag==="bold"?n="**":e?.tag==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} \u2014 ${r}`:this.content.inlines.length>1&&(i=`${i}
154
- ${r}`),this.inline?`{${i}}`:i}};function CU(t,e,r){if(t==="linkplain"||t==="linkcode"||t==="link"){let n=e.indexOf(" "),i=e;if(n>0){let s=kT(e,n);i=e.substring(s),e=e.substring(0,n)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(i=`\`${i}\``),r.renderLink?.(e,i)??OU(e,i)}}function OU(t,e){try{return mt.parse(t,!0),`[${e}](${t})`}catch{return t}}var Vl=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;r<this.inlines.length;r++){let n=this.inlines[r],i=this.inlines[r+1];e+=n.toString(),i&&i.range.start.line>n.range.start.line&&(e+=`
151
+ For Further details.`,n}function vF(t){if(t instanceof Ge)return"SUBRULE";if(t instanceof Xe)return"OPTION";if(t instanceof Ke)return"OR";if(t instanceof Qe)return"AT_LEAST_ONE";if(t instanceof et)return"AT_LEAST_ONE_SEP";if(t instanceof Ye)return"MANY_SEP";if(t instanceof we)return"MANY";if(t instanceof _e)return"CONSUME";throw Error("non exhaustive match")}function RF(t,e,r){let n=xw(e.configs.elements,o=>o.state.transitions),i=Iw(n.filter(o=>o instanceof Vs).map(o=>o.tokenType),o=>o.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function wF(t,e){return t.edges[e.tokenTypeIdx]}function bF(t,e,r){let n=new Zs,i=[];for(let s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===Ao){i.push(s);continue}let a=s.state.transitions.length;for(let c=0;c<a;c++){let l=s.state.transitions[c],u=AF(l,e);u!==void 0&&n.add({state:u,alt:s.alt,stack:s.stack})}}let o;if(i.length===0&&n.size===1&&(o=n),o===void 0){o=new Zs;for(let s of n.elements)Dd(s,o)}if(i.length>0&&!NF(o))for(let s of i)o.add(s);return o}function AF(t,e){if(t instanceof Vs&&Ns(e,t.tokenType))return t.target}function SF(t,e){let r;for(let n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}function Fw(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function Mw(t,e,r,n){return n=Uw(t,n),e.edges[r.tokenTypeIdx]=n,n}function Uw(t,e){if(e===cl)return e;let r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}function IF(t){let e=new Zs,r=t.transitions.length;for(let n=0;n<r;n++){let o={state:t.transitions[n].target,alt:n,stack:[]};Dd(o,e)}return e}function Dd(t,e){let r=t.state;if(r.type===Ao){if(t.stack.length>0){let i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};Dd(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);let n=r.transitions.length;for(let i=0;i<n;i++){let o=r.transitions[i],s=kF(t,o);s!==void 0&&Dd(s,e)}}function kF(t,e){if(e instanceof al)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Ys){let r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}function NF(t){for(let e of t.elements)if(e.state.type===Ao)return!0;return!1}function PF(t){for(let e of t.elements)if(e.state.type!==Ao)return!1;return!0}function CF(t){if(PF(t))return!0;let e=OF(t.elements);return LF(e)&&!DF(e)}function OF(t){let e=new Map;for(let r of t){let n=Gg(r,!1),i=e.get(n);i===void 0&&(i={},e.set(n,i)),i[r.alt]=!0}return e}function LF(t){for(let e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function DF(t){for(let e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}function $F(t,e){let r;for(let n of t.configs.elements)if(!(e.is(n.alt)===!1||n.state.type===Ao)){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}na();var yl=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new ia(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){let r=new Po;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){let n=new No(e.startOffset,e.image.length,xs(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){let r=e.container;if(r){let n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){let r=[];for(let o of e){let s=new No(o.startOffset,o.image.length,xs(o),o.tokenType,!0);s.root=this.rootNode,r.push(s)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){let o=n.container.content.indexOf(n);if(o>0){n.container.content.splice(o,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){let r=this.current;typeof e.$type=="string"&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=r;let n=this.nodeStack.pop();n?.content.length===0&&this.removeNode(n)}},xl=class{get hidden(){return!1}get astNode(){let e=typeof this._astNode?.$type=="string"?this._astNode:this.container?.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},No=class extends xl{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,o=!1){super(),this._hidden=o,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},Po=class extends xl{constructor(){super(...arguments),this.content=new qy(this)}get offset(){return this.firstNonHiddenNode?.offset??0}get length(){return this.end-this.offset}get end(){return this.lastNonHiddenNode?.end??0}get range(){let e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){let{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line<n.start.line?n.start:i.end}}return this._rangeCache}else return{start:ke.create(0,0),end:ke.create(0,0)}}get firstNonHiddenNode(){for(let e of this.content)if(!e.hidden)return e;return this.content[0]}get lastNonHiddenNode(){for(let e=this.content.length-1;e>=0;e--){let r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},qy=class t extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,t.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(let r of e)r.container=this.parent}},ia=class extends Po{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}};var zd=Symbol("Datatype");function Wy(t){return t.$type===zd}var Bw="\u200B",Gw=t=>t.endsWith(Bw)?t:t+Bw,Tl=class{constructor(e,r){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;let n=this.lexer.definition,i=e.LanguageMetaData.mode==="production";e.shared.profilers.LangiumProfiler?.isActive("parsing")?this.wrapper=new Vy(n,{...e.parser.ParserConfig,skipValidations:i,errorMessageProvider:e.parser.ParserErrorMessageProvider},r,e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new Wd(n,{...e.parser.ParserConfig,skipValidations:i,errorMessageProvider:e.parser.ParserErrorMessageProvider},r)}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},_l=class extends Tl{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e,!1),this.nodeBuilder=new yl,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){let n=this.computeRuleType(e),i;ui(e)&&(i=e.name,this.registerPrecedenceMap(e));let o=this.wrapper.DEFINE_RULE(Gw(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,o),kt(e)&&e.entry&&(this.mainRule=o),o}registerPrecedenceMap(e){let r=e.name,n=new Map;for(let i=0;i<e.operators.precedences.length;i++){let o=e.operators.precedences[i];for(let s of o.operators)n.set(s.value,{precedence:i,rightAssoc:o.associativity==="right"})}this.operatorPrecedence.set(r,n)}computeRuleType(e){return ui(e)?di(e):e.fragment?void 0:Bc(e)?zd:di(e)}parse(e,r={}){this.nodeBuilder.buildRootNode(e);let n=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=n.tokens;let i=r.rule?this.allRules.get(r.rule):this.mainRule;if(!i)throw new Error(r.rule?`No rule found with name '${r.rule}'`:"No main rule available.");let o=this.doParse(i);return this.nodeBuilder.addHiddenNodes(n.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,cs(o,{deep:!0}),{value:o,lexerErrors:n.errors,lexerReport:n.report,parserErrors:this.wrapper.errors}}doParse(e){let r=this.wrapper.rule(e);if(this.stack.length>0&&(r=this.construct()),r===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return r}startImplementation(e,r,n){return i=>{let o=!this.isRecording()&&e!==void 0;if(o){let s={$type:e};this.stack.push(s),e===zd?s.value="":r!==void 0&&(s.$infixName=r)}return n(i),o?this.construct():void 0}}extractHiddenTokens(e){let r=this.lexerResult.hidden;if(!r.length)return[];let n=e.startOffset;for(let i=0;i<r.length;i++)if(r[i].startOffset>n)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){let i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){let o=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(o);let s=this.nodeBuilder.buildLeafNode(i,n),{assignment:a,crossRef:c}=this.getAssignment(n),l=this.current;if(a){let u=Rr(n)?i.image:this.converter.convert(i.image,s);this.assign(a.operator,a.feature,u,s,c)}else if(Wy(l)){let u=i.image;Rr(n)||(u=this.converter.convert(u,s).toString()),l.value+=u}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,o){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));let a;try{a=this.wrapper.wrapSubrule(e,r,o)}finally{this.isRecording()||(a===void 0&&!n&&(a=this.construct()),a!==void 0&&s&&s.length>0&&this.performSubruleAssignment(a,i,s))}}performSubruleAssignment(e,r,n){let{assignment:i,crossRef:o}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,o);else if(!i){let s=this.current;if(Wy(s))s.value+=e.toString();else if(typeof e=="object"&&e){let c=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(c)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);let o={$type:e};this.stack.push(o),this.assign(r.operator,r.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;let e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):Wy(e)?this.converter.convert(e.value,e.$cstNode):(gm(this.astReflection,e),e)}constructInfix(e,r){let n=e.parts;if(!Array.isArray(n)||n.length===0)return;let i=e.operators;if(!Array.isArray(i)||n.length<2)return n[0];let o=0,s=-1;for(let g=0;g<i.length;g++){let v=i[g],T=r.get(v)??{precedence:1/0,rightAssoc:!1};T.precedence>s?(s=T.precedence,o=g):T.precedence===s&&(T.rightAssoc||(o=g))}let a=i.slice(0,o),c=i.slice(o+1),l=n.slice(0,o+1),u=n.slice(o+1),f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:l,operators:a},d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:c},p=this.constructInfix(f,r),m=this.constructInfix(d,r);return{$type:e.$type,$cstNode:e.$cstNode,left:p,operator:i[o],right:m}}getAssignment(e){if(!this.assignmentMap.has(e)){let r=In(e,Fr);this.assignmentMap.set(e,{assignment:r,crossRef:r&&Ur(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,o){let s=this.current,a;switch(o==="single"&&typeof n=="string"?a=this.linker.buildReference(s,r,i,n):o==="multi"&&typeof n=="string"?a=this.linker.buildMultiReference(s,r,i,n):a=n,e){case"=":{s[r]=a;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(a)}}assignWithoutOverride(e,r){for(let[i,o]of Object.entries(r)){let s=e[i];s===void 0?e[i]=o:Array.isArray(s)&&Array.isArray(o)&&(o.push(...s),e[i]=o)}let n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},qd=class{buildMismatchTokenMessage(e){return Un.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Un.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Un.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Un.buildEarlyExitMessage(e)}},oa=class extends qd{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},El=class extends Tl{constructor(e){super(e,!0),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();let r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){let n=this.wrapper.DEFINE_RULE(Gw(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{let n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){let e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,o){this.before(i),this.wrapper.wrapSubrule(e,r,o),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){let r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},FF={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new oa},Wd=class extends rl{constructor(e,r,n){let i=r&&"maxLookahead"in r;super(e,{...FF,lookaheadStrategy:i?new Bn({maxLookahead:r.maxLookahead}):new ll({logging:r.skipValidations?()=>{}:void 0,incomplete:n}),...r})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r,n){return this.RULE(e,r,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r,void 0)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}rule(e){return e.call(this,{})}},Vy=class extends Wd{constructor(e,r,n,i){super(e,r,n),this.task=i}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,r,n){this.task.startSubTask(this.ruleName(r));try{return super.subrule(e,r,n)}finally{this.task.stopSubTask(this.ruleName(r))}}};function vl(t,e,r){return UF({parser:e,tokens:r,ruleNames:new Map},t),e}function UF(t,e){let r=Fc(e,!1),n=Te(e.rules).filter(kt).filter(o=>r.has(o));for(let o of n){let s={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(o,Co(s,o.definition))}let i=Te(e.rules).filter(ui).filter(o=>r.has(o));for(let o of i)t.parser.rule(o,BF(t,o))}function BF(t,e){let r=e.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(Wt(r))throw new Error("Cannot use terminal rule in infix expression");let n=e.operators.precedences.flatMap(p=>p.operators),i={$type:"Group",elements:[]},o={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},s={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(o,s);let c={$container:s,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},l={...o,$container:s};s.elements.push(c,l);let f=n.map(p=>t.tokens[p.value]).map((p,m)=>({ALT:()=>t.parser.consume(m,p,c)})),d;return p=>{d??(d=Ky(t,r)),t.parser.subrule(0,d,!1,o,p),t.parser.many(0,{DEF:()=>{t.parser.alternatives(0,f),t.parser.subrule(1,d,!1,l,p)}})}}function Co(t,e,r=!1){let n;if(Rr(e))n=WF(t,e);else if(Cn(e))n=GF(t,e);else if(Fr(e))n=Co(t,e.terminal);else if(Ur(e))n=Xw(t,e);else if(Br(e))n=XF(t,e);else if(Tf(e))n=jF(t,e);else if(Rf(e))n=zF(t,e);else if(li(e))n=qF(t,e);else if(Rm(e)){let i=t.consume++;n=()=>t.parser.consume(i,Kt,e)}else throw new ho(e.$cstNode,`Unexpected element type: ${e.$type}`);return Hw(t,r?void 0:Vd(e),n,e.cardinality)}function GF(t,e){let r=di(e);return()=>t.parser.action(r,e)}function XF(t,e){let r=e.rule.ref;if(Pn(r)){let n=t.subrule++,i=kt(r)&&r.fragment,o=e.arguments.length>0?HF(r,e.arguments):()=>({}),s;return a=>{s??(s=Ky(t,r)),t.parser.subrule(n,s,i,e,o(a))}}else if(Wt(r)){let n=t.consume++,i=Yy(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)ln(r);else throw new ho(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function HF(t,e){if(e.some(n=>n.calledByName)){let n=e.map(i=>({parameterName:i.parameter?.ref?.name,predicate:hn(i.value)}));return i=>{let o={};for(let{parameterName:s,predicate:a}of n)s&&(o[s]=a(i));return o}}else{let n=e.map(i=>hn(i.value));return i=>{let o={};for(let s=0;s<n.length;s++)if(s<t.parameters.length){let a=t.parameters[s].name,c=n[s];o[a]=c(i)}return o}}}function hn(t){if(vm(t)){let e=hn(t.left),r=hn(t.right);return n=>e(n)||r(n)}else if(Em(t)){let e=hn(t.left),r=hn(t.right);return n=>e(n)&&r(n)}else if(Am(t)){let e=hn(t.value);return r=>!e(r)}else if(Sm(t)){let e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(Tm(t)){let e=!!t.true;return()=>e}ln(t)}function jF(t,e){if(e.elements.length===1)return Co(t,e.elements[0]);{let r=[];for(let i of e.elements){let o={ALT:Co(t,i,!0)},s=Vd(i);s&&(o.GATE=hn(s)),r.push(o)}let n=t.or++;return i=>t.parser.alternatives(n,r.map(o=>{let s={ALT:()=>o.ALT(i)},a=o.GATE;return a&&(s.GATE=()=>a(i)),s}))}}function zF(t,e){if(e.elements.length===1)return Co(t,e.elements[0]);let r=[];for(let a of e.elements){let c={ALT:Co(t,a,!0)},l=Vd(a);l&&(c.GATE=hn(l)),r.push(c)}let n=t.or++,i=(a,c)=>{let l=c.getRuleStack().join("-");return`uGroup_${a}_${l}`},o=a=>t.parser.alternatives(n,r.map((c,l)=>{let u={ALT:()=>!0},f=t.parser;u.ALT=()=>{if(c.ALT(a),!f.isRecording()){let p=i(n,f);f.unorderedGroups.get(p)||f.unorderedGroups.set(p,[]);let m=f.unorderedGroups.get(p);typeof m?.[l]>"u"&&(m[l]=!0)}};let d=c.GATE;return d?u.GATE=()=>d(a):u.GATE=()=>!f.unorderedGroups.get(i(n,f))?.[l],u})),s=Hw(t,Vd(e),o,"*");return a=>{s(a),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function qF(t,e){let r=e.elements.map(n=>Co(t,n));return n=>r.forEach(i=>i(n))}function Vd(t){if(li(t))return t.guardCondition}function Xw(t,e,r=e.terminal){if(r)if(Br(r)&&kt(r.rule.ref)){let n=r.rule.ref,i=t.subrule++,o;return s=>{o??(o=Ky(t,n)),t.parser.subrule(i,o,!1,e,s)}}else if(Br(r)&&Wt(r.rule.ref)){let n=t.consume++,i=Yy(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Rr(r)){let n=t.consume++,i=Yy(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);let i=kf(e.type.ref)?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+di(e.type.ref));return Xw(t,e,i)}}function WF(t,e){let r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}function Hw(t,e,r,n){let i=e&&hn(e);if(!n)if(i){let o=t.or++;return s=>t.parser.alternatives(o,[{ALT:()=>r(s),GATE:()=>i(s)},{ALT:cd(),GATE:()=>!i(s)}])}else return r;if(n==="*"){let o=t.many++;return s=>t.parser.many(o,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else if(n==="+"){let o=t.many++;if(i){let s=t.or++;return a=>t.parser.alternatives(s,[{ALT:()=>t.parser.atLeastOne(o,{DEF:()=>r(a)}),GATE:()=>i(a)},{ALT:cd(),GATE:()=>!i(a)}])}else return s=>t.parser.atLeastOne(o,{DEF:()=>r(s)})}else if(n==="?"){let o=t.optional++;return s=>t.parser.optional(o,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else ln(n)}function Ky(t,e){let r=VF(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function VF(t,e){if(Pn(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!kt(n);)(li(n)||Tf(n)||Rf(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}function Yy(t,e){let r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}function Zy(t){let e=t.Grammar,r=t.parser.Lexer,n=new El(t);return vl(e,n,r.definition),n.finalize(),n}function Jy(t){let e=jw(t);return e.finalize(),e}function jw(t){let e=t.Grammar,r=t.parser.Lexer,n=new _l(t);return vl(e,n,r.definition)}var Oo=class{constructor(){this.diagnostics=[]}buildTokens(e,r){let n=Te(Fc(e,!1)),i=this.buildTerminalTokens(n),o=this.buildKeywordTokens(n,i,r);return o.push(...i),o}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){let e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Wt).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){let r=_s(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=Mc(r)?ct.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){let r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(Pn).flatMap(i=>$r(i).filter(Rr)).distinct(i=>i.value).toArray().sort((i,o)=>o.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!n?.caseInsensitive))}buildKeywordToken(e,r,n){let i=this.buildKeywordPattern(e,n),o={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(o.LINE_BREAKS=!0),o}buildKeywordPattern(e,r){return r?new RegExp(fi(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{let o=i?.PATTERN;return o?.source&&zm("^"+o.source+"$",e.value)&&n.push(i),n},[])}};var Lo=class{convert(e,r){let n=r.grammarSource;if(Ur(n)&&(n=Vm(n)),Br(n)){let i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){switch(e.name.toUpperCase()){case"INT":return mn.convertInt(r);case"STRING":return mn.convertString(r);case"ID":return mn.convertID(r)}switch(tg(e)?.toLowerCase()){case"number":return mn.convertNumber(r);case"boolean":return mn.convertBoolean(r);case"bigint":return mn.convertBigint(r);case"date":return mn.convertDate(r);default:return r}}},mn;(function(t){function e(l){let u="";for(let f=1;f<l.length-1;f++){let d=l.charAt(f);if(d==="\\"){let p=l.charAt(++f);u+=r(p)}else u+=d}return u}t.convertString=e;function r(l){switch(l){case"b":return"\b";case"f":return"\f";case"n":return`
152
+ `;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return l}}function n(l){return l.charAt(0)==="^"?l.substring(1):l}t.convertID=n;function i(l){return parseInt(l)}t.convertInt=i;function o(l){return BigInt(l)}t.convertBigint=o;function s(l){return new Date(l)}t.convertDate=s;function a(l){return Number(l)}t.convertNumber=a;function c(l){return l.toLowerCase()==="true"}t.convertBoolean=c})(mn||(mn={}));var oe={};Ae(oe,dm(Yw(),1));function ax(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}var Jd=0,Kw=10;function Qd(){return Jd=performance.now(),new oe.CancellationTokenSource}function Zw(t){Kw=t}var br=Symbol("OperationCancelled");function gn(t){return t===br}async function mt(t){if(t===oe.CancellationToken.None)return;let e=performance.now();if(e-Jd>=Kw&&(Jd=e,await ax(),Jd=performance.now()),t.isCancellationRequested)throw br}var Qt=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}};var ep=class t{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(let n of e)if(t.isIncremental(n)){let i=eb(n.range),o=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,o)+n.text+this._content.substring(s,this._content.length);let a=Math.max(i.start.line,0),c=Math.max(i.end.line,0),l=this._lineOffsets,u=Jw(n.text,!1,o);if(c-a===u.length)for(let d=0,p=u.length;d<p;d++)l[d+a+1]=u[d];else u.length<1e4?l.splice(a+1,c-a,...u):this._lineOffsets=l=l.slice(0,a+1).concat(u,l.slice(c+1));let f=n.text.length-(s-o);if(f!==0)for(let d=a+1+u.length,p=l.length;d<p;d++)l[d]=l[d]+f}else if(t.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=r}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=Jw(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return{line:0,character:e};for(;n<i;){let s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}let o=n-1;return e=this.ensureBeforeEOL(e,r[o]),{line:o,character:e-r[o]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line];if(e.character<=0)return n;let i=e.line+1<r.length?r[e.line+1]:this._content.length,o=Math.min(n+e.character,i);return this.ensureBeforeEOL(o,n)}ensureBeforeEOL(e,r){for(;e>r&&Qw(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},ca;(function(t){function e(i,o,s,a){return new ep(i,o,s,a)}t.create=e;function r(i,o,s){if(i instanceof ep)return i.update(o,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=r;function n(i,o){let s=i.getText(),a=cx(o.map(i2),(u,f)=>{let d=u.range.start.line-f.range.start.line;return d===0?u.range.start.character-f.range.start.character:d}),c=0,l=[];for(let u of a){let f=i.offsetAt(u.range.start);if(f<c)throw new Error("Overlapping edit");f>c&&l.push(s.substring(c,f)),u.newText.length&&l.push(u.newText),c=i.offsetAt(u.range.end)}return l.push(s.substr(c)),l.join("")}t.applyEdits=n})(ca||(ca={}));function cx(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);cx(n,e),cx(i,e);let o=0,s=0,a=0;for(;o<n.length&&s<i.length;)e(n[o],i[s])<=0?t[a++]=n[o++]:t[a++]=i[s++];for(;o<n.length;)t[a++]=n[o++];for(;s<i.length;)t[a++]=i[s++];return t}function Jw(t,e,r=0){let n=e?[r]:[];for(let i=0;i<t.length;i++){let o=t.charCodeAt(i);Qw(o)&&(o===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function Qw(t){return t===13||t===10}function eb(t){let e=t.start,r=t.end;return e.line>r.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function i2(t){let e=eb(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var tb;(()=>{"use strict";var t={975:O=>{function R(b){if(typeof b!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(b))}function L(b,A){for(var S,M="",X=0,F=-1,W=0,K=0;K<=b.length;++K){if(K<b.length)S=b.charCodeAt(K);else{if(S===47)break;S=47}if(S===47){if(!(F===K-1||W===1))if(F!==K-1&&W===2){if(M.length<2||X!==2||M.charCodeAt(M.length-1)!==46||M.charCodeAt(M.length-2)!==46){if(M.length>2){var pe=M.lastIndexOf("/");if(pe!==M.length-1){pe===-1?(M="",X=0):X=(M=M.slice(0,pe)).length-1-M.lastIndexOf("/"),F=K,W=0;continue}}else if(M.length===2||M.length===1){M="",X=0,F=K,W=0;continue}}A&&(M.length>0?M+="/..":M="..",X=2)}else M.length>0?M+="/"+b.slice(F+1,K):M=b.slice(F+1,K),X=K-F-1;F=K,W=0}else S===46&&W!==-1?++W:W=-1}return M}var $={resolve:function(){for(var b,A="",S=!1,M=arguments.length-1;M>=-1&&!S;M--){var X;M>=0?X=arguments[M]:(b===void 0&&(b=process.cwd()),X=b),R(X),X.length!==0&&(A=X+"/"+A,S=X.charCodeAt(0)===47)}return A=L(A,!S),S?A.length>0?"/"+A:"/":A.length>0?A:"."},normalize:function(b){if(R(b),b.length===0)return".";var A=b.charCodeAt(0)===47,S=b.charCodeAt(b.length-1)===47;return(b=L(b,!A)).length!==0||A||(b="."),b.length>0&&S&&(b+="/"),A?"/"+b:b},isAbsolute:function(b){return R(b),b.length>0&&b.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var b,A=0;A<arguments.length;++A){var S=arguments[A];R(S),S.length>0&&(b===void 0?b=S:b+="/"+S)}return b===void 0?".":$.normalize(b)},relative:function(b,A){if(R(b),R(A),b===A||(b=$.resolve(b))===(A=$.resolve(A)))return"";for(var S=1;S<b.length&&b.charCodeAt(S)===47;++S);for(var M=b.length,X=M-S,F=1;F<A.length&&A.charCodeAt(F)===47;++F);for(var W=A.length-F,K=X<W?X:W,pe=-1,V=0;V<=K;++V){if(V===K){if(W>K){if(A.charCodeAt(F+V)===47)return A.slice(F+V+1);if(V===0)return A.slice(F+V)}else X>K&&(b.charCodeAt(S+V)===47?pe=V:V===0&&(pe=0));break}var ee=b.charCodeAt(S+V);if(ee!==A.charCodeAt(F+V))break;ee===47&&(pe=V)}var Le="";for(V=S+pe+1;V<=M;++V)V!==M&&b.charCodeAt(V)!==47||(Le.length===0?Le+="..":Le+="/..");return Le.length>0?Le+A.slice(F+pe):(F+=pe,A.charCodeAt(F)===47&&++F,A.slice(F))},_makeLong:function(b){return b},dirname:function(b){if(R(b),b.length===0)return".";for(var A=b.charCodeAt(0),S=A===47,M=-1,X=!0,F=b.length-1;F>=1;--F)if((A=b.charCodeAt(F))===47){if(!X){M=F;break}}else X=!1;return M===-1?S?"/":".":S&&M===1?"//":b.slice(0,M)},basename:function(b,A){if(A!==void 0&&typeof A!="string")throw new TypeError('"ext" argument must be a string');R(b);var S,M=0,X=-1,F=!0;if(A!==void 0&&A.length>0&&A.length<=b.length){if(A.length===b.length&&A===b)return"";var W=A.length-1,K=-1;for(S=b.length-1;S>=0;--S){var pe=b.charCodeAt(S);if(pe===47){if(!F){M=S+1;break}}else K===-1&&(F=!1,K=S+1),W>=0&&(pe===A.charCodeAt(W)?--W==-1&&(X=S):(W=-1,X=K))}return M===X?X=K:X===-1&&(X=b.length),b.slice(M,X)}for(S=b.length-1;S>=0;--S)if(b.charCodeAt(S)===47){if(!F){M=S+1;break}}else X===-1&&(F=!1,X=S+1);return X===-1?"":b.slice(M,X)},extname:function(b){R(b);for(var A=-1,S=0,M=-1,X=!0,F=0,W=b.length-1;W>=0;--W){var K=b.charCodeAt(W);if(K!==47)M===-1&&(X=!1,M=W+1),K===46?A===-1?A=W:F!==1&&(F=1):A!==-1&&(F=-1);else if(!X){S=W+1;break}}return A===-1||M===-1||F===0||F===1&&A===M-1&&A===S+1?"":b.slice(A,M)},format:function(b){if(b===null||typeof b!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof b);return(function(A,S){var M=S.dir||S.root,X=S.base||(S.name||"")+(S.ext||"");return M?M===S.root?M+X:M+"/"+X:X})(0,b)},parse:function(b){R(b);var A={root:"",dir:"",base:"",ext:"",name:""};if(b.length===0)return A;var S,M=b.charCodeAt(0),X=M===47;X?(A.root="/",S=1):S=0;for(var F=-1,W=0,K=-1,pe=!0,V=b.length-1,ee=0;V>=S;--V)if((M=b.charCodeAt(V))!==47)K===-1&&(pe=!1,K=V+1),M===46?F===-1?F=V:ee!==1&&(ee=1):F!==-1&&(ee=-1);else if(!pe){W=V+1;break}return F===-1||K===-1||ee===0||ee===1&&F===K-1&&F===W+1?K!==-1&&(A.base=A.name=W===0&&X?b.slice(1,K):b.slice(W,K)):(W===0&&X?(A.name=b.slice(1,F),A.base=b.slice(1,K)):(A.name=b.slice(W,F),A.base=b.slice(W,K)),A.ext=b.slice(F,K)),W>0?A.dir=b.slice(0,W-1):X&&(A.dir="/"),A},sep:"/",delimiter:":",win32:null,posix:null};$.posix=$,O.exports=$}},e={};function r(O){var R=e[O];if(R!==void 0)return R.exports;var L=e[O]={exports:{}};return t[O](L,L.exports,r),L.exports}r.d=(O,R)=>{for(var L in R)r.o(R,L)&&!r.o(O,L)&&Object.defineProperty(O,L,{enumerable:!0,get:R[L]})},r.o=(O,R)=>Object.prototype.hasOwnProperty.call(O,R),r.r=O=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(O,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(O,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:()=>d,Utils:()=>le}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);let o=/^\w[\w\d+.-]*$/,s=/^\//,a=/^\/\//;function c(O,R){if(!O.scheme&&R)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${O.authority}", path: "${O.path}", query: "${O.query}", fragment: "${O.fragment}"}`);if(O.scheme&&!o.test(O.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(O.path){if(O.authority){if(!s.test(O.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(a.test(O.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}let l="",u="/",f=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class d{constructor(R,L,$,b,A,S=!1){fe(this,"scheme");fe(this,"authority");fe(this,"path");fe(this,"query");fe(this,"fragment");typeof R=="object"?(this.scheme=R.scheme||l,this.authority=R.authority||l,this.path=R.path||l,this.query=R.query||l,this.fragment=R.fragment||l):(this.scheme=(function(M,X){return M||X?M:"file"})(R,S),this.authority=L||l,this.path=(function(M,X){switch(M){case"https":case"http":case"file":X?X[0]!==u&&(X=u+X):X=u}return X})(this.scheme,$||l),this.query=b||l,this.fragment=A||l,c(this,S))}static isUri(R){return R instanceof d||!!R&&typeof R.authority=="string"&&typeof R.fragment=="string"&&typeof R.path=="string"&&typeof R.query=="string"&&typeof R.scheme=="string"&&typeof R.fsPath=="string"&&typeof R.with=="function"&&typeof R.toString=="function"}get fsPath(){return _(this,!1)}with(R){if(!R)return this;let{scheme:L,authority:$,path:b,query:A,fragment:S}=R;return L===void 0?L=this.scheme:L===null&&(L=l),$===void 0?$=this.authority:$===null&&($=l),b===void 0?b=this.path:b===null&&(b=l),A===void 0?A=this.query:A===null&&(A=l),S===void 0?S=this.fragment:S===null&&(S=l),L===this.scheme&&$===this.authority&&b===this.path&&A===this.query&&S===this.fragment?this:new m(L,$,b,A,S)}static parse(R,L=!1){let $=f.exec(R);return $?new m($[2]||l,k($[4]||l),k($[5]||l),k($[7]||l),k($[9]||l),L):new m(l,l,l,l,l)}static file(R){let L=l;if(i&&(R=R.replace(/\\/g,u)),R[0]===u&&R[1]===u){let $=R.indexOf(u,2);$===-1?(L=R.substring(2),R=u):(L=R.substring(2,$),R=R.substring($)||u)}return new m("file",L,R,l,l)}static from(R){let L=new m(R.scheme,R.authority,R.path,R.query,R.fragment);return c(L,!0),L}toString(R=!1){return E(this,R)}toJSON(){return this}static revive(R){if(R){if(R instanceof d)return R;{let L=new m(R);return L._formatted=R.external,L._fsPath=R._sep===p?R.fsPath:null,L}}return R}}let p=i?1:void 0;class m extends d{constructor(){super(...arguments);fe(this,"_formatted",null);fe(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=_(this,!1)),this._fsPath}toString(L=!1){return L?E(this,!0):(this._formatted||(this._formatted=E(this,!1)),this._formatted)}toJSON(){let L={$mid:1};return this._fsPath&&(L.fsPath=this._fsPath,L._sep=p),this._formatted&&(L.external=this._formatted),this.path&&(L.path=this.path),this.scheme&&(L.scheme=this.scheme),this.authority&&(L.authority=this.authority),this.query&&(L.query=this.query),this.fragment&&(L.fragment=this.fragment),L}}let g={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function v(O,R,L){let $,b=-1;for(let A=0;A<O.length;A++){let S=O.charCodeAt(A);if(S>=97&&S<=122||S>=65&&S<=90||S>=48&&S<=57||S===45||S===46||S===95||S===126||R&&S===47||L&&S===91||L&&S===93||L&&S===58)b!==-1&&($+=encodeURIComponent(O.substring(b,A)),b=-1),$!==void 0&&($+=O.charAt(A));else{$===void 0&&($=O.substr(0,A));let M=g[S];M!==void 0?(b!==-1&&($+=encodeURIComponent(O.substring(b,A)),b=-1),$+=M):b===-1&&(b=A)}}return b!==-1&&($+=encodeURIComponent(O.substring(b))),$!==void 0?$:O}function T(O){let R;for(let L=0;L<O.length;L++){let $=O.charCodeAt(L);$===35||$===63?(R===void 0&&(R=O.substr(0,L)),R+=g[$]):R!==void 0&&(R+=O[L])}return R!==void 0?R:O}function _(O,R){let L;return L=O.authority&&O.path.length>1&&O.scheme==="file"?`//${O.authority}${O.path}`:O.path.charCodeAt(0)===47&&(O.path.charCodeAt(1)>=65&&O.path.charCodeAt(1)<=90||O.path.charCodeAt(1)>=97&&O.path.charCodeAt(1)<=122)&&O.path.charCodeAt(2)===58?R?O.path.substr(1):O.path[1].toLowerCase()+O.path.substr(2):O.path,i&&(L=L.replace(/\//g,"\\")),L}function E(O,R){let L=R?T:v,$="",{scheme:b,authority:A,path:S,query:M,fragment:X}=O;if(b&&($+=b,$+=":"),(A||b==="file")&&($+=u,$+=u),A){let F=A.indexOf("@");if(F!==-1){let W=A.substr(0,F);A=A.substr(F+1),F=W.lastIndexOf(":"),F===-1?$+=L(W,!1,!1):($+=L(W.substr(0,F),!1,!1),$+=":",$+=L(W.substr(F+1),!1,!0)),$+="@"}A=A.toLowerCase(),F=A.lastIndexOf(":"),F===-1?$+=L(A,!1,!0):($+=L(A.substr(0,F),!1,!0),$+=A.substr(F))}if(S){if(S.length>=3&&S.charCodeAt(0)===47&&S.charCodeAt(2)===58){let F=S.charCodeAt(1);F>=65&&F<=90&&(S=`/${String.fromCharCode(F+32)}:${S.substr(3)}`)}else if(S.length>=2&&S.charCodeAt(1)===58){let F=S.charCodeAt(0);F>=65&&F<=90&&(S=`${String.fromCharCode(F+32)}:${S.substr(2)}`)}$+=L(S,!0,!1)}return M&&($+="?",$+=L(M,!1,!1)),X&&($+="#",$+=R?X:v(X,!1,!1)),$}function I(O){try{return decodeURIComponent(O)}catch{return O.length>3?O.substr(0,3)+I(O.substr(3)):O}}let D=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function k(O){return O.match(D)?O.replace(D,(R=>I(R))):O}var B=r(975);let U=B.posix||B,z="/";var le;(function(O){O.joinPath=function(R,...L){return R.with({path:U.join(R.path,...L)})},O.resolvePath=function(R,...L){let $=R.path,b=!1;$[0]!==z&&($=z+$,b=!0);let A=U.resolve($,...L);return b&&A[0]===z&&!R.authority&&(A=A.substring(1)),R.with({path:A})},O.dirname=function(R){if(R.path.length===0||R.path===z)return R;let L=U.dirname(R.path);return L.length===1&&L.charCodeAt(0)===46&&(L=""),R.with({path:L})},O.basename=function(R){return U.basename(R.path)},O.extname=function(R){return U.extname(R.path)}})(le||(le={})),tb=n})();var{URI:gt,Utils:la}=tb;var vt;(function(t){t.basename=la.basename,t.dirname=la.dirname,t.extname=la.extname,t.joinPath=la.joinPath,t.resolvePath=la.resolvePath;let e=typeof process=="object"&&process?.platform==="win32";function r(s,a){return s?.toString()===a?.toString()}t.equals=r;function n(s,a){let c=typeof s=="string"?gt.parse(s).path:s.path,l=typeof a=="string"?gt.parse(a).path:a.path,u=c.split("/").filter(g=>g.length>0),f=l.split("/").filter(g=>g.length>0);if(e){let g=/^[A-Z]:$/;if(u[0]&&g.test(u[0])&&(u[0]=u[0].toLowerCase()),f[0]&&g.test(f[0])&&(f[0]=f[0].toLowerCase()),u[0]!==f[0])return l.substring(1)}let d=0;for(;d<u.length&&u[d]===f[d];d++);let p="../".repeat(u.length-d),m=f.slice(d).join("/");return p+m}t.relative=n;function i(s){return gt.parse(s.toString()).toString()}t.normalize=i;function o(s,a){let c=typeof s=="string"?s:s.path,l=typeof a=="string"?a:a.path;return l.charAt(l.length-1)==="/"&&(l=l.slice(0,-1)),c.charAt(c.length-1)==="/"&&(c=c.slice(0,-1)),l===c?!0:l.length<c.length||l.charAt(c.length)!=="/"?!1:l.startsWith(c)}t.contains=o})(vt||(vt={}));var ua=class{constructor(){this.root={name:"",children:new Map}}normalizeUri(e){return vt.normalize(e)}clear(){this.root.children.clear()}insert(e,r){let n=this.getNode(this.normalizeUri(e),!0);n.element=r}delete(e){let r=this.getNode(this.normalizeUri(e),!1);r?.parent&&r.parent.children.delete(r.name)}has(e){return this.getNode(this.normalizeUri(e),!1)?.element!==void 0}hasNode(e){return this.getNode(this.normalizeUri(e),!1)!==void 0}find(e){return this.getNode(this.normalizeUri(e),!1)?.element}findNode(e){let r=this.normalizeUri(e),n=this.getNode(r,!1);if(n)return{name:n.name,uri:vt.joinPath(gt.parse(r),n.name).toString(),element:n.element}}findChildren(e){let r=this.normalizeUri(e),n=this.getNode(r,!1);return n?Array.from(n.children.values()).map(i=>({name:i.name,uri:vt.joinPath(gt.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){let r=this.getNode(vt.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){let n=e.split("/");e.charAt(e.length-1)==="/"&&n.pop();let i=this.root;for(let o of n){let s=i.children.get(o);if(!s)if(r)s={name:o,children:new Map,parent:i},i.children.set(o,s);else return;i=s}return i}collectValues(e){let r=[];e.element&&r.push(e.element);for(let n of e.children.values())r.push(...this.collectValues(n));return r}};var ye;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(ye||(ye={}));var Rl=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=oe.CancellationToken.None){let n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??gt.parse(e.uri),oe.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return oe.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){let i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){let i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{let i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){let i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{let i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let o;if(n)o={parseResult:e,uri:r,state:ye.Parsed,references:[],textDocument:n};else{let s=this.createTextDocumentGetter(r,i);o={parseResult:e,uri:r,state:ye.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=o,o}async update(e,r){let n=e.parseResult.value.$cstNode?.root.fullText,i=this.textDocuments?.get(e.uri.toString()),o=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{let s=this.createTextDocumentGetter(e.uri,o);Object.defineProperty(e,"textDocument",{get:s})}return n!==o&&(e.parseResult=await this.parseAsync(e.uri,o,r),e.parseResult.value.$document=e),e.state=ye.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){let n=this.serviceRegistry,i;return()=>i??(i=ca.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},wl=class{constructor(e){this.documentTrie=new ua,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return Te(this.documentTrie.all())}addDocument(e){let r=e.uri.toString();if(this.documentTrie.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentTrie.insert(r,e)}getDocument(e){let r=e.toString();return this.documentTrie.find(r)}getDocuments(e){let r=e.toString();return this.documentTrie.findAll(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{let i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){let r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,ye.Changed),n}deleteDocument(e){let r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=ye.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){let r=e.toString(),n=this.documentTrie.findAll(r);for(let i of n)i.state=ye.Changed;return this.documentTrie.delete(r),n}};var Do=Symbol("RefResolving"),bl=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,r=oe.CancellationToken.None){if(this.profiler?.isActive("linking")){let n=this.profiler.createTask("linking",this.languageId);n.start();try{for(let i of qt(e.parseResult.value))await mt(r),ni(i).forEach(o=>{let s=`${i.$type}:${o.property}`;n.startSubTask(s);try{this.doLink(o,e)}finally{n.stopSubTask(s)}})}finally{n.stop()}}else for(let n of qt(e.parseResult.value))await mt(r),ni(n).forEach(i=>this.doLink(i,e))}doLink(e,r){let n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=Do;try{let i=this.getCandidate(e);if(Qi(i))n._ref=i;else{n._nodeDescription=i;let o=this.loadAstNode(i);n._ref=o??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);let o=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${o}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=Do;try{let i=this.getCandidates(e),o=[];if(Qi(i))n._linkingError=i;else for(let s of i){let a=this.loadAstNode(s);a&&o.push({ref:a,$nodeDescription:s})}n._items=o}catch(i){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${i}`},n._items=[]}r.references.push(n)}}unlink(e){for(let r of e.references)"_ref"in r?(r._ref=void 0,delete r._nodeDescription):"_items"in r&&(r._items=void 0,delete r._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){let n=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return n.length>0?n:this.createLinkingError(e)}buildReference(e,r,n,i){let o=this,s={$refNode:n,$refText:i,_ref:void 0,get ref(){if(ht(this._ref))return this._ref;if(pm(this._nodeDescription)){let a=o.loadAstNode(this._nodeDescription);this._ref=a??o.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=Do;let a=ls(e).$document,c=o.getLinkedNode({reference:s,container:e,property:r});if(c.error&&a&&a.state<ye.ComputedScopes)return this._ref=void 0;this._ref=c.node??c.error,this._nodeDescription=c.descr,a?.references.push(this)}else this._ref===Do&&o.throwCyclicReferenceError(e,r,i);return ht(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return Qi(this._ref)?this._ref:void 0}};return s}buildMultiReference(e,r,n,i){let o=this,s={$refNode:n,$refText:i,_items:void 0,get items(){if(Array.isArray(this._items))return this._items;if(this._items===void 0){this._items=Do;let a=ls(e).$document,c=o.getCandidates({reference:s,container:e,property:r}),l=[];if(Qi(c))this._linkingError=c;else for(let u of c){let f=o.loadAstNode(u);f&&l.push({ref:f,$nodeDescription:u})}this._items=l,a?.references.push(this)}else this._items===Do&&o.throwCyclicReferenceError(e,r,i);return Array.isArray(this._items)?this._items:[]},get error(){if(this._linkingError)return this._linkingError;if(!(this.items.length>0))return this._linkingError=o.createLinkingError({reference:s,container:e,property:r})}};return s}throwCyclicReferenceError(e,r,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${n}')`)}getLinkedNode(e){try{let r=this.getCandidate(e);if(Qi(r))return{error:r};let n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);let n=r.message??String(r);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`}}}}loadAstNode(e){if(e.node)return e.node;let r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){let n=ls(e.container).$document;n&&n.state<ye.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`);let i=this.reflection.getReferenceType(e);return{info:e,message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:r}}};function rb(t){return typeof t.name=="string"}var Al=class{getName(e){if(rb(e))return e.name}getNameNode(e){return Uc(e.$cstNode,"name")}};var Sl=class{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator,this.documents=e.shared.workspace.LangiumDocuments,this.hasMultiReference=qt(e.Grammar).some(r=>Ur(r)&&r.isMulti)}findDeclarations(e){if(e){let r=eg(e),n=e.astNode;if(r&&n){let i=n[r.feature];if(At(i)||ur(i))return nf(i);if(Array.isArray(i)){for(let o of i)if((At(o)||ur(o))&&o.$refNode&&o.$refNode.offset<=e.offset&&o.$refNode.end>=e.end)return nf(o)}}if(n){let i=this.nameProvider.getNameNode(n);if(i&&(i===e||Mm(e,i)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){let r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(let i of ni(n))if(ur(i.reference)&&i.reference.items.some(o=>o.ref===e))return i.reference.items.map(o=>o.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;let r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){let r=this.findDeclarations(e),n=[];for(let i of r){let o=this.nameProvider.getNameNode(i)??i.$cstNode;o&&n.push(o)}return n}findReferences(e,r){let n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(o=>vt.equals(o.sourceUri,r.documentUri))),n.push(...i),Te(n)}getSelfReferences(e){let r=this.getSelfNodes(e),n=[];for(let i of r){let o=this.nameProvider.getNameNode(i);if(o){let s=Ut(i),a=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:a,targetUri:s.uri,targetPath:a,segment:po(o),local:!0})}}return n}};var Gt=class{constructor(e){if(this.map=new Map,e)for(let[r,n]of e)this.add(r,n)}get size(){return as.sum(Te(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{let n=this.map.get(e);if(n){let i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){let r=this.map.get(e);return r?Te(r):ri}has(e,r){if(r===void 0)return this.map.has(e);{let n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return Te(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return Te(this.map.keys())}values(){return Te(this.map.values()).flat()}entriesGroupedByKey(){return Te(this.map.entries())}},$o=class{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(let[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){let r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}};var Il=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=oe.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=vc,i=oe.CancellationToken.None){let o=[];this.addExportedSymbol(e,o,r);for(let s of n(e))await mt(i),this.addExportedSymbol(s,o,r);return o}addExportedSymbol(e,r,n){let i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=oe.CancellationToken.None){let n=e.parseResult.value,i=new Gt;for(let o of $r(n))await mt(r),this.addLocalSymbol(o,e,i);return i}addLocalSymbol(e,r,n){let i=e.$container;if(i){let o=this.nameProvider.getName(e);o&&n.add(i,this.descriptions.createDescription(e,o,r))}}};var fa=class{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===r):this.elements.find(i=>i.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===r):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||n.isEmpty())&&this.outerScope?n.concat(this.outerScope.getElements(e)):n}},lx=class{constructor(e,r,n){this.elements=new Map,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0;for(let i of e){let o=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(o,i)}this.outerScope=r}getElement(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r),i=n?[n]:[];return(this.concatOuterScope||i.length>0)&&this.outerScope?Te(i).concat(this.outerScope.getElements(e)):Te(i)}getAllElements(){let e=Te(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},kl=class{constructor(e,r,n){this.elements=new Gt,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0;for(let i of e){let o=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(o,i)}this.outerScope=r}getElement(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r)[0];if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?Te(n).concat(this.outerScope.getElements(e)):Te(n)}getAllElements(){let e=Te(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},o2={getElement(){},getElements(){return ri},getAllElements(){return ri}};var da=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},Nl=class extends da{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){let n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},Mo=class extends da{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();let i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){let o=n();return i.set(r,o),o}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){let r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){let r=this.converter(e),n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},tp=class extends Mo{constructor(e,r){super(n=>n.toString()),r?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(r,n=>{this.clear(n.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{for(let o of i)this.clear(o)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{let o=n.concat(i);for(let s of o)this.clear(s)}))}},pa=class extends Nl{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}};var Pl=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new pa(e.shared)}getScope(e){let r=[],n=this.reflection.getReferenceType(e),i=Ut(e.container).localSymbols;if(i){let s=e.container;do i.has(s)&&r.push(i.getStream(s).filter(a=>this.reflection.isSubtype(a.type,n))),s=s.$container;while(s)}let o=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)o=this.createScope(r[s],o);return o}createScope(e,r,n){return new fa(Te(e),r,n)}createScopeForNodes(e,r,n){let i=Te(e).map(o=>{let s=this.nameProvider.getName(o);if(s)return this.descriptions.createDescription(o,s)}).nonNullable();return new fa(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new kl(this.indexManager.allElements(e)))}};function ux(t){return typeof t.$comment=="string"}function nb(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}var Cl=class{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){let n=r??{},i=r?.replacer,o=(a,c)=>this.replacer(a,c,n),s=i?(a,c)=>i(a,c,o):o;try{return this.currentDocument=Ut(e),JSON.stringify(e,s,r?.space)}finally{this.currentDocument=void 0}}deserialize(e,r){let n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:o,comments:s,uriConverter:a}){if(!this.ignoreProperties.has(e))if(At(r)){let c=r.ref,l=n?r.$refText:void 0;if(c){let u=Ut(c),f="";this.currentDocument&&this.currentDocument!==u&&(a?f=a(u.uri,c):f=u.uri.toString());let d=this.astNodeLocator.getAstNodePath(c);return{$ref:`${f}#${d}`,$refText:l}}else return{$error:r.error?.message??"Could not resolve reference",$refText:l}}else if(ur(r)){let c=n?r.$refText:void 0,l=[];for(let u of r.items){let f=u.ref,d=Ut(u.ref),p="";this.currentDocument&&this.currentDocument!==d&&(a?p=a(d.uri,f):p=d.uri.toString());let m=this.astNodeLocator.getAstNodePath(f);l.push(`${p}#${m}`)}return{$refs:l,$refText:c}}else if(ht(r)){let c;if(o&&(c=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&c?.$textRegion&&(c.$textRegion.documentURI=this.currentDocument?.uri.toString())),i&&!e&&(c??(c={...r}),c.$sourceText=r.$cstNode?.text),s){c??(c={...r});let l=this.commentProvider.getComment(r);l&&(c.$comment=l.replace(/\r/g,""))}return c??r}else return r}addAstNodeRegionWithAssignmentsTo(e){let r=n=>({offset:n.offset,end:n.end,length:n.length,range:n.range});if(e.$cstNode){let n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(o=>!o.startsWith("$")).forEach(o=>{let s=Km(e.$cstNode,o).map(r);s.length!==0&&(i[o]=s)}),e}}linkNode(e,r,n,i,o,s){for(let[c,l]of Object.entries(e))if(Array.isArray(l))for(let u=0;u<l.length;u++){let f=l[u];nb(f)?l[u]=this.reviveReference(e,c,r,f,n):ht(f)&&this.linkNode(f,r,n,e,c,u)}else nb(l)?e[c]=this.reviveReference(e,c,r,l,n):ht(l)&&this.linkNode(l,r,n,e,c);let a=e;a.$container=i,a.$containerProperty=o,a.$containerIndex=s}reviveReference(e,r,n,i,o){let s=i.$refText,a=i.$error,c;if(i.$ref){let l=this.getRefNode(n,i.$ref,o.uriConverter);if(ht(l))return s||(s=this.nameProvider.getName(l)),{$refText:s??"",ref:l};a=l}else if(i.$refs){let l=[];for(let u of i.$refs){let f=this.getRefNode(n,u,o.uriConverter);ht(f)&&l.push({ref:f})}if(l.length===0)c={$refText:s??"",items:l},a??(a="Could not resolve multi-reference");else return{$refText:s??"",items:l}}if(a)return c??(c={$refText:s??"",ref:void 0}),c.error={info:{container:e,property:r,reference:c},message:a},c}getRefNode(e,r,n){try{let i=r.indexOf("#");if(i===0){let c=this.astNodeLocator.getAstNode(e,r.substring(1));return c||"Could not resolve path: "+r}if(i<0){let c=n?n(r):gt.parse(r),l=this.langiumDocuments.getDocument(c);return l?l.parseResult.value:"Could not find document for URI: "+r}let o=n?n(r.substring(0,i)):gt.parse(r.substring(0,i)),s=this.langiumDocuments.getDocument(o);if(!s)return"Could not find document for URI: "+r;if(i===r.length-1)return s.parseResult.value;let a=this.astNodeLocator.getAstNode(s.parseResult.value,r.substring(i+1));return a||"Could not resolve URI: "+r}catch(i){return String(i)}}};var Ol=class{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.fileNameMap=new Map,this.textDocuments=e?.workspace.TextDocuments}register(e){let r=e.LanguageMetaData;for(let n of r.fileExtensions)this.fileExtensionMap.has(n)&&console.warn(`The file extension ${n} is used by multiple languages. It is now assigned to '${r.languageId}'.`),this.fileExtensionMap.set(n,e);if(r.fileNames)for(let n of r.fileNames)this.fileNameMap.has(n)&&console.warn(`The file name ${n} is used by multiple languages. It is now assigned to '${r.languageId}'.`),this.fileNameMap.set(n,e);this.languageIdMap.set(r.languageId,e)}getServices(e){if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");let r=this.textDocuments?.get(e)?.languageId;if(r!==void 0){let s=this.languageIdMap.get(r);if(s)return s}let n=vt.extname(e),i=vt.basename(e),o=this.fileNameMap.get(i)??this.fileExtensionMap.get(n);if(!o)throw r?new Error(`The service registry contains no services for the extension '${n}' for language '${r}'.`):new Error(`The service registry contains no services for the extension '${n}'.`);return o}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}};function Fo(t){return{code:t}}var rp;(function(t){t.defaults=["fast","slow","built-in"],t.all=t.defaults})(rp||(rp={}));var Ll=class{constructor(e){this.entries=new Gt,this.knownCategories=new Set(rp.defaults),this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,r=this,n="fast"){if(n==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");this.knownCategories.add(n);for(let[i,o]of Object.entries(e)){let s=o;if(Array.isArray(s))for(let a of s){let c={check:this.wrapValidationException(a,r),category:n};this.addEntry(i,c)}else if(typeof s=="function"){let a={check:this.wrapValidationException(s,r),category:n};this.addEntry(i,a)}else ln(s)}}wrapValidationException(e,r){return async(n,i,o)=>{await this.handleException(()=>e.call(r,n,i,o),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(o){if(gn(o))throw o;console.error(`${r}:`,o),o instanceof Error&&o.stack&&console.error(o.stack);let s=o instanceof Error?o.message:String(o);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(let n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=Te(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,o,s,a)=>{await this.handleException(()=>e.call(n,i,o,s,a),r,o,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}};var ib=Object.freeze({validateNode:!0,validateChildren:!0}),Dl=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,r={},n=oe.CancellationToken.None){let i=e.parseResult,o=[];if(await mt(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,o,r),r.stopAfterLexingErrors&&o.some(s=>s.data?.code===Ar.LexingError)||(this.processParsingErrors(i,o,r),r.stopAfterParsingErrors&&o.some(s=>s.data?.code===Ar.ParsingError))||(this.processLinkingErrors(e,o,r),r.stopAfterLinkingErrors&&o.some(s=>s.data?.code===Ar.LinkingError))))return o;try{o.push(...await this.validateAst(i.value,r,n))}catch(s){if(gn(s))throw s;console.error("An error occurred during validation:",s)}return await mt(n),o}processLexingErrors(e,r,n){let i=[...e.lexerErrors,...e.lexerReport?.diagnostics??[]];for(let o of i){let s=o.severity??"error",a={severity:np(s),range:{start:{line:o.line-1,character:o.column-1},end:{line:o.line-1,character:o.column+o.length-1}},message:o.message,data:sb(s),source:this.getSource()};r.push(a)}}processParsingErrors(e,r,n){for(let i of e.parserErrors){let o;if(isNaN(i.token.startOffset)){if("previousToken"in i){let s=i.previousToken;if(isNaN(s.startOffset)){let a={line:0,character:0};o={start:a,end:a}}else{let a={line:s.endLine-1,character:s.endColumn};o={start:a,end:a}}}}else o=xs(i.token);if(o){let s={severity:np("error"),range:o,message:i.message,data:Fo(Ar.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){for(let i of e.references){let o=i.error;if(o){let s={node:o.info.container,range:i.$refNode?.range,property:o.info.property,index:o.info.index,data:{code:Ar.LinkingError,containerType:o.info.container.$type,property:o.info.property,refText:o.info.reference.$refText}};r.push(this.toDiagnostic("error",o.message,s))}}}async validateAst(e,r,n=oe.CancellationToken.None){let i=[],o=(s,a,c)=>{i.push(this.toDiagnostic(s,a,c))};return await this.validateAstBefore(e,r,o,n),await this.validateAstNodes(e,r,o,n),await this.validateAstAfter(e,r,o,n),i}async validateAstBefore(e,r,n,i=oe.CancellationToken.None){let o=this.validationRegistry.checksBefore;for(let s of o)await mt(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=oe.CancellationToken.None){if(this.profiler?.isActive("validating")){let o=this.profiler.createTask("validating",this.languageId);o.start();try{let s=qt(e).iterator();for(let a of s){o.startSubTask(a.$type);let c=this.validateSingleNodeOptions(a,r);if(c.validateNode)try{let l=this.validationRegistry.getChecks(a.$type,r.categories);for(let u of l)await u(a,n,i)}finally{o.stopSubTask(a.$type)}c.validateChildren||s.prune()}}finally{o.stop()}}else{let o=qt(e).iterator();for(let s of o){await mt(i);let a=this.validateSingleNodeOptions(s,r);if(a.validateNode){let c=this.validationRegistry.getChecks(s.$type,r.categories);for(let l of c)await l(s,n,i)}a.validateChildren||o.prune()}}}validateSingleNodeOptions(e,r){return ib}async validateAstAfter(e,r,n,i=oe.CancellationToken.None){let o=this.validationRegistry.checksAfter;for(let s of o)await mt(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:ob(n),severity:np(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};function ob(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=Uc(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=Jm(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function np(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}function sb(t){switch(t){case"error":return Fo(Ar.LexingError);case"warning":return Fo(Ar.LexingWarning);case"info":return Fo(Ar.LexingInfo);case"hint":return Fo(Ar.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var Ar;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(Ar||(Ar={}));var $l=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){let i=n??Ut(e);r??(r=this.nameProvider.getName(e));let o=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${o} has no name.`);let s,a=()=>s??(s=po(this.nameProvider.getNameNode(e)??e.$cstNode));return{node:e,name:r,get nameSegment(){return a()},selectionSegment:po(e.$cstNode),type:e.$type,documentUri:i.uri,path:o}}},Ml=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=oe.CancellationToken.None){let n=[],i=e.parseResult.value;for(let o of qt(i))await mt(r),ni(o).forEach(s=>{s.reference.error||n.push(...this.createInfoDescriptions(s))});return n}createInfoDescriptions(e){let r=e.reference;if(r.error||!r.$refNode)return[];let n=[];At(r)&&r.$nodeDescription?n=[r.$nodeDescription]:ur(r)&&(n=r.items.map(c=>c.$nodeDescription).filter(c=>c!==void 0));let i=Ut(e.container).uri,o=this.nodeLocator.getAstNodePath(e.container),s=[],a=po(r.$refNode);for(let c of n)s.push({sourceUri:i,sourcePath:o,targetUri:c.documentUri,targetPath:c.path,segment:a,local:vt.equals(c.documentUri,i)});return s}};var Fl=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){let r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,o)=>{if(!i||o.length===0)return i;let s=o.indexOf(this.indexSeparator);if(s>0){let a=o.substring(0,s),c=parseInt(o.substring(s+1));return i[a]?.[c]}return i[o]},e)}};var it={};Ae(it,dm(ix(),1));var Ul=class{constructor(e){this._ready=new Qt,this.onConfigurationSectionUpdateEmitter=new it.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){this.workspaceConfig=e.capabilities.workspace?.configuration??!1}async initialized(e){if(this.workspaceConfig){if(e.register){let r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){let r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,o)=>{this.updateSectionConfiguration(i.section,n[o])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([r,n])=>{this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;let n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}};var Oa=dm(CI(),1);var Mi;(function(t){function e(r){return{dispose:async()=>await r()}}t.create=e})(Mi||(Mi={}));var Yl=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Gt,this.documentPhaseListeners=new Gt,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=ye.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=oe.CancellationToken.None){for(let i of e){let o=i.uri.toString();if(i.state===ye.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(i,ye.IndexedReferences);else if(typeof r.validation=="object"){let s=this.findMissingValidationCategories(i,r);s.length>0&&(this.buildState.set(o,{completed:!1,options:{validation:{categories:s}},result:this.buildState.get(o)?.result}),i.state=ye.IndexedReferences)}}else this.buildState.delete(o)}this.currentState=ye.Changed,await this.emitUpdate(e.map(i=>i.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=oe.CancellationToken.None){this.currentState=ye.Changed;let i=[];for(let c of r){let l=this.langiumDocuments.deleteDocuments(c);for(let u of l)i.push(u.uri),this.cleanUpDeleted(u)}let o=(await Promise.all(e.map(c=>this.findChangedUris(c)))).flat();for(let c of o){let l=this.langiumDocuments.getDocument(c);l===void 0&&(l=this.langiumDocumentFactory.fromModel({$type:"INVALID"},c),l.state=ye.Changed,this.langiumDocuments.addDocument(l)),this.resetToState(l,ye.Changed)}let s=Te(o).concat(i).map(c=>c.toString()).toSet();this.langiumDocuments.all.filter(c=>!s.has(c.uri.toString())&&this.shouldRelink(c,s)).forEach(c=>this.resetToState(c,ye.ComputedScopes)),await this.emitUpdate(o,i),await mt(n);let a=this.sortDocuments(this.langiumDocuments.all.filter(c=>c.state<ye.Validated||!this.buildState.get(c.uri.toString())?.completed||this.resultsAreIncomplete(c,this.updateBuildOptions)).toArray());await this.buildDocuments(a,this.updateBuildOptions,n)}resultsAreIncomplete(e,r){return this.findMissingValidationCategories(e,r).length>=1}findMissingValidationCategories(e,r){let n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),o=n?.result?.validationChecks?new Set(n?.result?.validationChecks):n?.completed?i:new Set,s=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return Te(s).filter(a=>!o.has(a)).toArray()}async findChangedUris(e){if(this.langiumDocuments.getDocument(e)??this.textDocuments?.get(e))return[e];try{let n=await this.fileSystemProvider.stat(e);if(n.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(n))return[e]}catch{}return[]}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r<n;){for(;r<e.length&&this.hasTextDocument(e[r]);)r++;for(;n>=0&&!this.hasTextDocument(e[n]);)n--;r<n&&([e[r],e[n]]=[e[n],e[r]])}return e}hasTextDocument(e){return!!this.textDocuments?.get(e.uri)}shouldRelink(e,r){return e.references.some(n=>n.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),Mi.create(()=>{let r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case ye.Changed:case ye.Parsed:this.indexManager.removeContent(e.uri);case ye.IndexedContent:e.localSymbols=void 0;case ye.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case ye.Linked:this.indexManager.removeReferences(e.uri);case ye.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case ye.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=ye.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,ye.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,ye.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,ye.ComputedScopes,n,async s=>{let a=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await a.collectLocalSymbols(s,n)});let i=e.filter(s=>this.shouldLink(s));await this.runCancelable(i,ye.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,ye.IndexedReferences,n,s=>this.indexManager.updateReferences(s,n));let o=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(o,ye.Validated,n,async s=>{await this.validate(s,n),this.markAsCompleted(s)})}markAsCompleted(e){let r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(let n of e){let i=n.uri.toString(),o=this.buildState.get(i);(!o||o.completed)&&this.buildState.set(i,{completed:!1,options:r,result:o?.result})}}async runCancelable(e,r,n,i){for(let s of e)s.state<r&&(await mt(n),await i(s),s.state=r,await this.notifyDocumentPhase(s,r,n));let o=e.filter(s=>s.state===r);await this.notifyBuildPhase(o,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),Mi.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),Mi.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=oe.CancellationToken.None),i?this.awaitDocumentState(e,i,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){let i=this.langiumDocuments.getDocument(r);if(i){if(i.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(br);if(this.currentState>=e&&e>i.state)return Promise.reject(new Oa.ResponseError(Oa.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${ye[i.state]}, requiring ${ye[e]}, but workspace state is already ${ye[this.currentState]}. Returning undefined.`))}else return Promise.reject(new Oa.ResponseError(Oa.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((o,s)=>{let a=this.onDocumentPhase(e,l=>{vt.equals(l.uri,r)&&(a.dispose(),c.dispose(),o(l.uri))}),c=n.onCancellationRequested(()=>{a.dispose(),c.dispose(),s(br)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(br):new Promise((n,i)=>{let o=this.onBuildPhase(e,()=>{o.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{o.dispose(),s.dispose(),i(br)})})}async notifyDocumentPhase(e,r,n){let o=this.documentPhaseListeners.get(r).slice();for(let s of o)try{await mt(n),await s(e,n)}catch(a){if(!gn(a))throw a}}async notifyBuildPhase(e,r,n){if(e.length===0)return;let o=this.buildPhaseListeners.get(r).slice();for(let s of o)await mt(n),await s(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){let n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),o=typeof i.validation=="object"?{...i.validation}:{};o.categories=this.findMissingValidationCategories(e,i);let s=await n.validateDocument(e,o,r);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;let a=this.buildState.get(e.uri.toString());a&&(a.result??(a.result={}),a.result.validationChecks?a.result.validationChecks=Te(a.result.validationChecks).concat(o.categories).distinct().toArray():a.result.validationChecks=[...o.categories])}getBuildOptions(e){return this.buildState.get(e.uri.toString())?.options??{}}};var Kl=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Mo,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){let n=Ut(e).uri,i=[];return this.referenceIndex.forEach(o=>{o.forEach(s=>{vt.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),Te(i)}allElements(e,r){let n=Te(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){return r?this.symbolByTypeIndex.get(e,r,()=>(this.symbolIndex.get(e)??[]).filter(o=>this.astReflection.isSubtype(o.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){let r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){let r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=oe.CancellationToken.None){let i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),o=e.uri.toString();this.symbolIndex.set(o,i),this.symbolByTypeIndex.clear(o)}async updateReferences(e,r=oe.CancellationToken.None){let i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){let n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}};var Zl=class{constructor(e){this.initialBuildOptions={},this._ready=new Qt,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(r=>this.initializeWorkspace(this.folders??[],r))}async initializeWorkspace(e,r=oe.CancellationToken.None){let n=await this.performStartup(e);await mt(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){let r=[],n=s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)};await this.loadAdditionalDocuments(e,n);let i=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,i)));let o=Te(i).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(o,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{let i=await this.langiumDocuments.getOrCreateDocument(n);r(i)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return gt.parse(e.uri)}async traverseFolder(e,r){try{let n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,r):i.isFile&&r.push(i.uri))}))}catch(n){console.error("Failure to read directory content of "+e.toString(!0),n)}}async searchFolder(e){let r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){let r=vt.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}};var Jl=class{buildUnexpectedCharactersMessage(e,r,n,i,o){return ks.buildUnexpectedCharactersMessage(e,r,n,i,o)}buildUnableToPopLexerModeMessage(e){return ks.buildUnableToPopLexerModeMessage(e)}},Up={mode:"full"},Xo=class{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;let r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);let n=$T(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new ct(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=Up){let n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:this.tokenBuilder.flushLexingReport?.(e)}}toTokenTypeDictionary(e){if($T(e))return e;let r=MT(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}};function Bp(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function MT(t){return t&&"modes"in t&&"defaultMode"in t}function $T(t){return!Bp(t)&&!MT(t)}na();function BT(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=ke.create(0,0));let o=DI(t),s=XT(n),a=rU({lines:o,position:i,options:s});return aU({index:0,tokens:a,position:i})}function GT(t,e){let r=XT(e),n=DI(t);if(n.length===0)return!1;let i=n[0],o=n[n.length-1],s=r.start,a=r.end;return!!s?.exec(i)&&!!a?.exec(o)}function DI(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(Hm)}var OI=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,tU=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function rU(t){let e=[],r=t.position.line,n=t.position.character;for(let i=0;i<t.lines.length;i++){let o=i===0,s=i===t.lines.length-1,a=t.lines[i],c=0;if(o&&t.options.start){let u=t.options.start?.exec(a);u&&(c=u.index+u[0].length)}else{let u=t.options.line?.exec(a);u&&(c=u.index+u[0].length)}if(s){let u=t.options.end?.exec(a);u&&(a=a.substring(0,u.index))}if(a=a.substring(0,sU(a)),UT(a,c)>=a.length){if(e.length>0){let u=ke.create(r,n);e.push({type:"break",content:"",range:ve.create(u,u)})}}else{OI.lastIndex=c;let u=OI.exec(a);if(u){let f=u[0],d=u[1],p=ke.create(r,n+c),m=ke.create(r,n+c+f.length);e.push({type:"tag",content:d,range:ve.create(p,m)}),c+=f.length,c=UT(a,c)}if(c<a.length){let f=a.substring(c),d=Array.from(f.matchAll(tU));e.push(...nU(d,f,r,n+c))}}r++,n=0}return e.length>0&&e[e.length-1].type==="break"?e.slice(0,-1):e}function nU(t,e,r,n){let i=[];if(t.length===0){let o=ke.create(r,n),s=ke.create(r,n+e.length);i.push({type:"text",content:e,range:ve.create(o,s)})}else{let o=0;for(let a of t){let c=a.index,l=e.substring(o,c);l.length>0&&i.push({type:"text",content:e.substring(o,c),range:ve.create(ke.create(r,o+n),ke.create(r,c+n))});let u=l.length+1,f=a[1];if(i.push({type:"inline-tag",content:f,range:ve.create(ke.create(r,o+u+n),ke.create(r,o+u+f.length+n))}),u+=f.length,a.length===4){u+=a[2].length;let d=a[3];i.push({type:"text",content:d,range:ve.create(ke.create(r,o+u+n),ke.create(r,o+u+d.length+n))})}else i.push({type:"text",content:"",range:ve.create(ke.create(r,o+u+n),ke.create(r,o+u+n))});o=c+a[0].length}let s=e.substring(o);s.length>0&&i.push({type:"text",content:s,range:ve.create(ke.create(r,o+n),ke.create(r,o+n+s.length))})}return i}var iU=/\S/,oU=/\s*$/;function UT(t,e){let r=t.substring(e).match(iU);return r?e+r.index:t.length}function sU(t){let e=t.match(oU);if(e&&typeof e.index=="number")return e.index}function aU(t){let e=ke.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Gp([],ve.create(e,e));let r=[];for(;t.index<t.tokens.length;){let o=cU(t,r[r.length-1]);o&&r.push(o)}let n=r[0]?.range.start??e,i=r[r.length-1]?.range.end??e;return new Gp(r,ve.create(n,i))}function cU(t,e){let r=t.tokens[t.index];if(r.type==="tag")return MI(t,!1);if(r.type==="text"||r.type==="inline-tag")return $I(t);lU(r,e),t.index++}function lU(t,e){if(e){let r=new Xp("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function $I(t){let e=t.tokens[t.index],r=e,n=e,i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(uU(t)),n=e,e=t.tokens[t.index];return new eu(i,ve.create(r.range.start,n.range.end))}function uU(t){return t.tokens[t.index].type==="inline-tag"?MI(t,!0):FI(t)}function MI(t,e){let r=t.tokens[t.index++],n=r.content.substring(1);if(t.tokens[t.index]?.type==="text")if(e){let o=FI(t);return new Ql(n,new eu([o],o.range),e,ve.create(r.range.start,o.range.end))}else{let o=$I(t);return new Ql(n,o,e,ve.create(r.range.start,o.range.end))}else{let o=r.range;return new Ql(n,new eu([],o),e,o)}}function FI(t){let e=t.tokens[t.index++];return new Xp(e.content,e.range)}function XT(t){if(!t)return XT({start:"/**",end:"*/",line:"*"});let{start:e,end:r,line:n}=t;return{start:FT(e,!0),end:FT(r,!1),line:FT(n,!0)}}function FT(t,e){if(typeof t=="string"||typeof t=="object"){let r=typeof t=="string"?fi(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}var Gp=class{constructor(e,r){this.elements=e,this.range=r}getTag(e){return this.getAllTags().find(r=>r.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(let r of this.elements)if(e.length===0)e=r.toString();else{let n=r.toString();e+=LI(e)+n}return e.trim()}toMarkdown(e){let r="";for(let n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{let i=n.toMarkdown(e);r+=LI(r)+i}return r.trim()}},Ql=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`,r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e}
153
+ ${r}`),this.inline?`{${e}}`:e}toMarkdown(e){return e?.renderTag?.(this)??this.toMarkdownDefault(e)}toMarkdownDefault(e){let r=this.content.toMarkdown(e);if(this.inline){let o=fU(this.name,r,e??{});if(typeof o=="string")return o}let n="";e?.tag==="italic"||e?.tag===void 0?n="*":e?.tag==="bold"?n="**":e?.tag==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} \u2014 ${r}`:this.content.inlines.length>1&&(i=`${i}
154
+ ${r}`),this.inline?`{${i}}`:i}};function fU(t,e,r){if(t==="linkplain"||t==="linkcode"||t==="link"){let n=e.indexOf(" "),i=e;if(n>0){let s=UT(e,n);i=e.substring(s),e=e.substring(0,n)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(i=`\`${i}\``),r.renderLink?.(e,i)??dU(e,i)}}function dU(t,e){try{return gt.parse(t,!0),`[${e}](${t})`}catch{return t}}var eu=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;r<this.inlines.length;r++){let n=this.inlines[r],i=this.inlines[r+1];e+=n.toString(),i&&i.range.start.line>n.range.start.line&&(e+=`
155
155
  `)}return e}toMarkdown(e){let r="";for(let n=0;n<this.inlines.length;n++){let i=this.inlines[n],o=this.inlines[n+1];r+=i.toMarkdown(e),o&&o.range.start.line>i.range.start.line&&(r+=`
156
- `)}return r}},Op=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}};function yv(t){return t.endsWith(`
156
+ `)}return r}},Xp=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}};function LI(t){return t.endsWith(`
157
157
  `)?`
158
158
  `:`
159
159
 
160
- `}var Yl=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){let r=this.commentProvider.getComment(e);if(r&&PT(r))return NT(r).toMarkdown({renderLink:(i,o)=>this.documentationLinkRenderer(e,i,o),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,r,n){let i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){let o=i.nameSegment.range.start.line+1,s=i.nameSegment.range.start.character+1,a=i.documentUri.with({fragment:`L${o},${s}`});return`[${n}](${a.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){let i=Ft(e).localSymbols;if(!i)return;let o=e;do{let a=i.getStream(o).find(c=>c.name===r);if(a)return a;o=o.$container}while(o)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}};var Kl=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){return ex(e)?e.$comment:vm(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}};var Zl=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},OT=class{constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length<this.threadCount;){let e=this.createWorker();e.onReady(()=>{if(this.queue.length>0){let r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){let n=await this.acquireParserWorker(r),i=new Jt,o,s=r.onCancellationRequested(()=>{o=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(a=>{let c=this.hydrator.hydrate(a);i.resolve(c)}).catch(a=>{i.reject(a)}).finally(()=>{s.dispose(),clearTimeout(o)}),i.promise}terminateWorker(e){e.terminate();let r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(let n of this.workerPool)if(n.ready)return n.lock(),n;let r=new Jt;return e.onCancellationRequested(()=>{let n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(br)}),this.queue.push(r),r.promise}},LT=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new rt.Emitter,this.deferred=new Jt,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(o=>{let s=o;this.deferred.resolve(s),this.unlock()}),n(o=>{this.deferred.reject(o),this.unlock()})}terminate(){this.deferred.reject(br),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new Jt,this.sendMessage(e),this.deferred.promise}};var Jl=class{constructor(){this.previousTokenSource=new ne.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();let r=jd();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=ne.CancellationToken.None){let i=new Jt,o={action:r,deferred:i,cancellationToken:n};return e.push(o),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;let e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{let o=await Promise.resolve().then(()=>r(i));n.resolve(o)}catch(o){pn(o)?n.resolve(void 0):n.reject(o)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}};var Ql=class{constructor(e){this.grammarElementIdMap=new Po,this.tokenTypeIdMap=new Po,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>({...r,message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){let r=new Map,n=new Map;for(let i of Wt(e))r.set(i,{});if(e.$cstNode)for(let i of so(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){let n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(let[i,o]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(o)){let s=[];n[i]=s;for(let a of o)pt(a)?s.push(this.dehydrateAstNode(a,r)):wt(a)?s.push(this.dehydrateReference(a,r)):s.push(a)}else pt(o)?n[i]=this.dehydrateAstNode(o,r):wt(o)?n[i]=this.dehydrateReference(o,r):o!==void 0&&(n[i]=o);return n}dehydrateReference(e,r){let n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){let n=r.cstNodes.get(e);return mc(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Or(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):Kn(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){let r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){let r=new Map,n=new Map;for(let o of Wt(e))r.set(o,{});let i;if(e.$cstNode)for(let o of so(e.$cstNode)){let s;"fullText"in o?(s=new Js(o.fullText),i=s):"content"in o?s=new Io:"tokenType"in o&&(s=this.hydrateCstLeafNode(o)),s&&(n.set(o,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){let n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(let[i,o]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(o)){let s=[];n[i]=s;for(let a of o)pt(a)?s.push(this.setParent(this.hydrateAstNode(a,r),n)):wt(a)?s.push(this.hydrateReference(a,n,i,r)):s.push(a)}else pt(o)?n[i]=this.setParent(this.hydrateAstNode(o,r),n):wt(o)?n[i]=this.hydrateReference(o,n,i,r):o!==void 0&&(n[i]=o);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){let i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),Or(i))for(let o of e.content){let s=this.hydrateCstNode(o,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){let r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,o=e.startLine,s=e.startColumn,a=e.endLine,c=e.endColumn,l=e.hidden;return new Ao(n,i,{start:{line:o,character:s},end:{line:a,character:c}},r,l)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(let r of Wt(this.grammar))Ac(r)&&this.grammarElementIdMap.set(r,e++)}};function eu(t){return{documentation:{CommentProvider:e=>new Kl(e),DocumentationProvider:e=>new Yl(e)},parser:{AsyncParser:e=>new Zl(e),GrammarConfig:e=>zm(e),LangiumParser:e=>Gy(e),CompletionParser:e=>Xy(e),ValueConverter:()=>new ko,TokenBuilder:()=>new vo,Lexer:e=>new Mo(e),ParserErrorMessageProvider:()=>new Qs,LexerErrorMessageProvider:()=>new ql},workspace:{AstNodeLocator:()=>new Cl,AstNodeDescriptionProvider:e=>new Nl(e),ReferenceDescriptionProvider:e=>new Pl(e)},references:{Linker:e=>new Tl(e),NameProvider:()=>new _l,ScopeProvider:e=>new Al(e),ScopeComputation:e=>new Rl(e),References:e=>new El(e)},serializer:{Hydrator:e=>new Ql(e),JsonSerializer:e=>new Il(e)},validation:{DocumentValidator:e=>new kl(e),ValidationRegistry:e=>new vl(e)},shared:()=>t.shared}}function tu(t){return{ServiceRegistry:e=>new Sl(e),workspace:{LangiumDocuments:e=>new xl(e),LangiumDocumentFactory:e=>new yl(e),DocumentBuilder:e=>new Hl(e),IndexManager:e=>new jl(e),WorkspaceManager:e=>new Wl(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new Jl,ConfigurationProvider:e=>new Ol(e)},profilers:{}}}var DT;(function(t){t.merge=(e,r)=>ru(ru({},e),r)})(DT||(DT={}));function Fo(t,e,r,n,i,o,s,a,c){let l=[t,e,r,n,i,o,s,a,c].reduce(ru,{});return Iv(l)}var wv=Symbol("isProxy");function Av(t){if(t&&t[wv])for(let e of Object.values(t))Av(e);return t}function Iv(t,e){let r=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(n,i)=>i===wv?!0:bv(n,i,t,e||r),getOwnPropertyDescriptor:(n,i)=>(bv(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),has:(n,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return r}var Rv=Symbol();function bv(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+t[e]);if(t[e]===Rv)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){let i=r[e];t[e]=Rv;try{t[e]=typeof i=="function"?i(n):Iv(i,n)}catch(o){throw t[e]=o instanceof Error?o:void 0,o}return t[e]}else return}function ru(t,e){if(e){for(let[r,n]of Object.entries(e))if(n!=null)if(typeof n=="object"){let i=t[r];typeof i=="object"&&i!==null?t[r]=ru(i,n):t[r]=ru({},n)}else t[r]=n}return t}var $T={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},Uo;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(Uo||(Uo={}));var va=class extends vo{constructor(e=$T){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...$T,...e},this.indentTokenType=ci({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=ci({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){let n=super.buildTokens(e,r);if(!Pp(n))throw new Error("Invalid tokens built by default builder");let{indentTokenName:i,dedentTokenName:o,whitespaceTokenName:s,ignoreIndentationDelimiters:a}=this.options,c,l,u,f=[];for(let d of n){for(let[p,m]of a)d.name===p?d.PUSH_MODE=Uo.IGNORE_INDENTATION:d.name===m&&(d.POP_MODE=!0);d.name===o?c=d:d.name===i?l=d:d.name===s?u=d:f.push(d)}if(!c||!l||!u)throw new Error("Some indentation/whitespace tokens not found!");return a.length>0?{modes:{[Uo.REGULAR]:[c,l,...f,u],[Uo.IGNORE_INDENTATION]:[...f,u]},defaultMode:Uo.REGULAR}:[c,l,u,...f]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,r){return r===0||`\r
161
- `.includes(e[r-1])}matchWhitespace(e,r,n,i){this.whitespaceRegExp.lastIndex=r;let o=this.whitespaceRegExp.exec(e);return{currIndentLevel:o?.[0].length??0,prevIndentLevel:this.indentationStack.at(-1),match:o}}createIndentationTokenInstance(e,r,n,i){let o=this.getLineNumber(r,i);return Dn(e,n,i,i+n.length,o,o,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\r\n|\r|\n/).length}indentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;let{currIndentLevel:o,prevIndentLevel:s,match:a}=this.matchWhitespace(e,r,n,i);return o<=s?null:(this.indentationStack.push(o),a)}dedentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;let{currIndentLevel:o,prevIndentLevel:s,match:a}=this.matchWhitespace(e,r,n,i);if(o>=s)return null;let c=this.indentationStack.lastIndexOf(o);if(c===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${o} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:a?.[0]?.length??0,line:this.getLineNumber(e,r),column:1}),null;let l=this.indentationStack.length-c-1,u=e.substring(0,r).match(/[\r\n]+$/)?.[0].length??1;for(let f=0;f<l;f++){let d=this.createIndentationTokenInstance(this.dedentTokenType,e,"",r-(u-1));n.push(d),this.indentationStack.pop()}return null}buildTerminalToken(e){let r=super.buildTerminalToken(e),{indentTokenName:n,dedentTokenName:i,whitespaceTokenName:o}=this.options;return r.name===n?this.indentTokenType:r.name===i?this.dedentTokenType:r.name===o?ci({name:o,pattern:this.whitespaceRegExp,group:at.SKIPPED}):r}flushRemainingDedents(e){let r=[];for(;this.indentationStack.length>1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},nu=class extends Mo{constructor(e){if(super(e),e.parser.TokenBuilder instanceof va)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=Np){let n=super.tokenize(e),i=n.report;r?.mode==="full"&&n.tokens.push(...i.remainingDedents),i.remainingDedents=[];let{indentTokenType:o,dedentTokenType:s}=this.indentationTokenBuilder,a=o.tokenTypeIdx,c=s.tokenTypeIdx,l=[],u=n.tokens.length-1;for(let f=0;f<u;f++){let d=n.tokens[f],p=n.tokens[f+1];if(d.tokenTypeIdx===a&&p.tokenTypeIdx===c){f++;continue}l.push(d)}return u>=0&&l.push(n.tokens[u]),n.tokens=l,n}};var Pe={};tn(Pe,{AstUtils:()=>Yu,BiMap:()=>Po,Cancellation:()=>ne,ContextCache:()=>Co,CstUtils:()=>gf,DONE_RESULT:()=>Mt,Deferred:()=>Jt,Disposable:()=>Ci,DisposableCache:()=>sa,DocumentCache:()=>qd,EMPTY_STREAM:()=>Zn,ErrorWithLocation:()=>co,GrammarUtils:()=>gs,MultiMap:()=>Bt,OperationCancelled:()=>br,Reduction:()=>ts,RegExpUtils:()=>Tf,SimpleCache:()=>wl,StreamImpl:()=>ur,TreeStreamImpl:()=>rn,URI:()=>mt,UriTrie:()=>ia,UriUtils:()=>_t,WorkspaceCache:()=>aa,assertCondition:()=>BE,assertUnreachable:()=>sn,delayNextTick:()=>Zy,interruptAndCheck:()=>ht,isOperationCancelled:()=>pn,loadGrammarFromJson:()=>Dp,setInterruptionPeriod:()=>LA,startCancelableOperation:()=>jd,stream:()=>me});Ie(Pe,rt);var Lp=class{stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},iu={fileSystemProvider:()=>new Lp};var LU={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},DU={AstReflection:()=>new fs};function $U(){let t=Fo(tu(iu),DU),e=Fo(eu({shared:t}),LU);return t.ServiceRegistry.register(e),e}function Dp(t){let e=$U(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,mt.parse(`memory:/${r.name??"grammar"}.langium`)),r}Ie(lt,Pe);var MT=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new Bt}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(r=>this.activeCategories.add(r)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(r=>this.activeCategories.delete(r)):this.activeCategories.clear()}createTask(e,r){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${r}'.`),new $p(n=>this.records.add(e,this.dumpRecord(e,n)),r)}dumpRecord(e,r){console.info(`Task ${e}.${r.identifier} executed in ${r.duration.toFixed(2)}ms and ended at ${r.date.toISOString()}`);let n=[];for(let s of r.entries.keys()){let a=r.entries.get(s),c=a.reduce((l,u)=>l+u);n.push({name:`${r.identifier}.${s}`,count:a.length,duration:c})}let i=r.duration-n.map(s=>s.duration).reduce((s,a)=>s+a,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((s,a)=>a.duration-s.duration);function o(s){return Math.round(100*s)/100}return console.table(n.map(s=>({Element:s.name,Count:s.count,"Self %":o(100*s.duration/r.duration),"Time (ms)":o(s.duration)}))),r}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(r=>e.some(n=>n===r[0])).flatMap(r=>r[1])}},$p=class{constructor(e,r){this.stack=[],this.entries=new Bt,this.addRecord=e,this.identifier=r}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(r=>r.id).join(", ")}.`);let e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){let r=this.stack.pop();if(!r)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(r.id!==e)throw new Error(`Sub-Task "${r.id}" is not already stopped.`);let n=performance.now()-r.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=n);let i=n-r.content;this.entries.add(e,i)}};var Na={$type:"AnchorDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Gp(t){return It.isInstance(t,Na.$type)}var FT={$type:"BlockProperty",key:"key",value:"value"};var HT={$type:"CalendarBlock",properties:"properties"};function Hp(t){return It.isInstance(t,HT.$type)}var ka={$type:"ConfigEntry"};var Xp={$type:"DefaultDeclaration",entityType:"entityType",properties:"properties"};function Oi(t){return It.isInstance(t,Xp.$type)}var jT={$type:"DescriptionDirective",text:"text"};function zT(t){return It.isInstance(t,jT.$type)}var Mp={$type:"EntityProperty",key:"key",value:"value",values:"values"};var Pa={$type:"FootnoteDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function jp(t){return It.isInstance(t,Pa.$type)}var Ca={$type:"GroupBlock",content:"content",name:"name",properties:"properties",title:"title"};function jr(t){return It.isInstance(t,Ca.$type)}var ou={$type:"GroupContent"};var UT={$type:"IncludeDeclaration",options:"options",path:"path"};var BT={$type:"IncludeOption",key:"key",value:"value"};var Oa={$type:"ItemDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function gr(t){return It.isInstance(t,Oa.$type)}var La={$type:"LabelDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Wp(t){return It.isInstance(t,La.$type)}var Da={$type:"MilestoneDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function qp(t){return It.isInstance(t,Da.$type)}var XT={$type:"NowlineDirective",properties:"properties",version:"version"};var Bo={$type:"NowlineFile",configEntries:"configEntries",directive:"directive",hasConfig:"hasConfig",includes:"includes",roadmapDecl:"roadmapDecl",roadmapEntries:"roadmapEntries"};var $a={$type:"ParallelBlock",content:"content",name:"name",properties:"properties",title:"title"};function Wr(t){return It.isInstance(t,$a.$type)}var Fp={$type:"ParallelContent"};var Ma={$type:"PersonDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Li(t){return It.isInstance(t,Ma.$type)}var WT={$type:"PersonMemberRef",ref:"ref"};function Sv(t){return It.isInstance(t,WT.$type)}var Up={$type:"RoadmapDeclaration",name:"name",properties:"properties",title:"title"};var xn={$type:"RoadmapEntry"};var qT={$type:"ScaleBlock",properties:"properties"};function vv(t){return It.isInstance(t,qT.$type)}var Fa={$type:"SizeDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Ha(t){return It.isInstance(t,Fa.$type)}var Ua={$type:"StatusDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function lu(t){return It.isInstance(t,Ua.$type)}var au={$type:"StyleDeclaration",name:"name",properties:"properties",title:"title"};function uu(t){return It.isInstance(t,au.$type)}var GT={$type:"StyleProperty",key:"key",value:"value"};var su={$type:"SwimlaneContent"};var Ba={$type:"SwimlaneDeclaration",content:"content",name:"name",properties:"properties",title:"title"};function qr(t){return It.isInstance(t,Ba.$type)}var Xa={$type:"SymbolDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function fu(t){return It.isInstance(t,Xa.$type)}var Bp={$type:"TeamContent"};var Ga={$type:"TeamDeclaration",content:"content",name:"name",properties:"properties",title:"title"};function zr(t){return It.isInstance(t,Ga.$type)}var cu=class extends zi{constructor(){super(...arguments);le(this,"types",{AnchorDeclaration:{name:Na.$type,properties:{description:{name:Na.description},name:{name:Na.name},properties:{name:Na.properties,defaultValue:[]},title:{name:Na.title}},superTypes:[xn.$type]},BlockProperty:{name:FT.$type,properties:{key:{name:FT.key},value:{name:FT.value}},superTypes:[]},CalendarBlock:{name:HT.$type,properties:{properties:{name:HT.properties,defaultValue:[]}},superTypes:[ka.$type]},ConfigEntry:{name:ka.$type,properties:{},superTypes:[]},DefaultDeclaration:{name:Xp.$type,properties:{entityType:{name:Xp.entityType},properties:{name:Xp.properties,defaultValue:[]}},superTypes:[ka.$type]},DescriptionDirective:{name:jT.$type,properties:{text:{name:jT.text}},superTypes:[ou.$type,Fp.$type,su.$type,Bp.$type]},EntityProperty:{name:Mp.$type,properties:{key:{name:Mp.key},value:{name:Mp.value},values:{name:Mp.values,defaultValue:[]}},superTypes:[]},FootnoteDeclaration:{name:Pa.$type,properties:{description:{name:Pa.description},name:{name:Pa.name},properties:{name:Pa.properties,defaultValue:[]},title:{name:Pa.title}},superTypes:[xn.$type]},GroupBlock:{name:Ca.$type,properties:{content:{name:Ca.content,defaultValue:[]},name:{name:Ca.name},properties:{name:Ca.properties,defaultValue:[]},title:{name:Ca.title}},superTypes:[ou.$type,Fp.$type,su.$type]},GroupContent:{name:ou.$type,properties:{},superTypes:[]},IncludeDeclaration:{name:UT.$type,properties:{options:{name:UT.options,defaultValue:[]},path:{name:UT.path}},superTypes:[]},IncludeOption:{name:BT.$type,properties:{key:{name:BT.key},value:{name:BT.value}},superTypes:[]},ItemDeclaration:{name:Oa.$type,properties:{description:{name:Oa.description},name:{name:Oa.name},properties:{name:Oa.properties,defaultValue:[]},title:{name:Oa.title}},superTypes:[ou.$type,Fp.$type,su.$type]},LabelDeclaration:{name:La.$type,properties:{description:{name:La.description},name:{name:La.name},properties:{name:La.properties,defaultValue:[]},title:{name:La.title}},superTypes:[xn.$type]},MilestoneDeclaration:{name:Da.$type,properties:{description:{name:Da.description},name:{name:Da.name},properties:{name:Da.properties,defaultValue:[]},title:{name:Da.title}},superTypes:[xn.$type]},NowlineDirective:{name:XT.$type,properties:{properties:{name:XT.properties,defaultValue:[]},version:{name:XT.version}},superTypes:[]},NowlineFile:{name:Bo.$type,properties:{configEntries:{name:Bo.configEntries,defaultValue:[]},directive:{name:Bo.directive},hasConfig:{name:Bo.hasConfig,defaultValue:!1},includes:{name:Bo.includes,defaultValue:[]},roadmapDecl:{name:Bo.roadmapDecl},roadmapEntries:{name:Bo.roadmapEntries,defaultValue:[]}},superTypes:[]},ParallelBlock:{name:$a.$type,properties:{content:{name:$a.content,defaultValue:[]},name:{name:$a.name},properties:{name:$a.properties,defaultValue:[]},title:{name:$a.title}},superTypes:[ou.$type,su.$type]},ParallelContent:{name:Fp.$type,properties:{},superTypes:[]},PersonDeclaration:{name:Ma.$type,properties:{description:{name:Ma.description},name:{name:Ma.name},properties:{name:Ma.properties,defaultValue:[]},title:{name:Ma.title}},superTypes:[xn.$type]},PersonMemberRef:{name:WT.$type,properties:{ref:{name:WT.ref}},superTypes:[Bp.$type]},RoadmapDeclaration:{name:Up.$type,properties:{name:{name:Up.name},properties:{name:Up.properties,defaultValue:[]},title:{name:Up.title}},superTypes:[]},RoadmapEntry:{name:xn.$type,properties:{},superTypes:[]},ScaleBlock:{name:qT.$type,properties:{properties:{name:qT.properties,defaultValue:[]}},superTypes:[ka.$type]},SizeDeclaration:{name:Fa.$type,properties:{description:{name:Fa.description},name:{name:Fa.name},properties:{name:Fa.properties,defaultValue:[]},title:{name:Fa.title}},superTypes:[xn.$type]},StatusDeclaration:{name:Ua.$type,properties:{description:{name:Ua.description},name:{name:Ua.name},properties:{name:Ua.properties,defaultValue:[]},title:{name:Ua.title}},superTypes:[xn.$type]},StyleDeclaration:{name:au.$type,properties:{name:{name:au.name},properties:{name:au.properties,defaultValue:[]},title:{name:au.title}},superTypes:[ka.$type]},StyleProperty:{name:GT.$type,properties:{key:{name:GT.key},value:{name:GT.value}},superTypes:[]},SwimlaneContent:{name:su.$type,properties:{},superTypes:[]},SwimlaneDeclaration:{name:Ba.$type,properties:{content:{name:Ba.content,defaultValue:[]},name:{name:Ba.name},properties:{name:Ba.properties,defaultValue:[]},title:{name:Ba.title}},superTypes:[xn.$type]},SymbolDeclaration:{name:Xa.$type,properties:{description:{name:Xa.description},name:{name:Xa.name},properties:{name:Xa.properties,defaultValue:[]},title:{name:Xa.title}},superTypes:[ka.$type]},TeamContent:{name:Bp.$type,properties:{},superTypes:[]},TeamDeclaration:{name:Ga.$type,properties:{content:{name:Ga.content,defaultValue:[]},name:{name:Ga.name},properties:{name:Ga.properties,defaultValue:[]},title:{name:Ga.title}},superTypes:[xn.$type,Bp.$type]}})}},It=new cu;var kv,Nv=()=>kv??(kv=Dp(`{
160
+ `}var tu=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){let r=this.commentProvider.getComment(e);if(r&&GT(r))return BT(r).toMarkdown({renderLink:(i,o)=>this.documentationLinkRenderer(e,i,o),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,r,n){let i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){let o=i.nameSegment.range.start.line+1,s=i.nameSegment.range.start.character+1,a=i.documentUri.with({fragment:`L${o},${s}`});return`[${n}](${a.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){let i=Ut(e).localSymbols;if(!i)return;let o=e;do{let a=i.getStream(o).find(c=>c.name===r);if(a)return a;o=o.$container}while(o)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}};var ru=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){return ux(e)?e.$comment:Fm(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}};var nu=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},HT=class{constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length<this.threadCount;){let e=this.createWorker();e.onReady(()=>{if(this.queue.length>0){let r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){let n=await this.acquireParserWorker(r),i=new Qt,o,s=r.onCancellationRequested(()=>{o=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(a=>{let c=this.hydrator.hydrate(a);i.resolve(c)}).catch(a=>{i.reject(a)}).finally(()=>{s.dispose(),clearTimeout(o)}),i.promise}terminateWorker(e){e.terminate();let r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(let n of this.workerPool)if(n.ready)return n.lock(),n;let r=new Qt;return e.onCancellationRequested(()=>{let n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(br)}),this.queue.push(r),r.promise}},jT=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new it.Emitter,this.deferred=new Qt,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(o=>{let s=o;this.deferred.resolve(s),this.unlock()}),n(o=>{this.deferred.reject(o),this.unlock()})}terminate(){this.deferred.reject(br),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new Qt,this.sendMessage(e),this.deferred.promise}};var iu=class{constructor(){this.previousTokenSource=new oe.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();let r=Qd();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=oe.CancellationToken.None){let i=new Qt,o={action:r,deferred:i,cancellationToken:n};return e.push(o),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;let e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{let o=await Promise.resolve().then(()=>r(i));n.resolve(o)}catch(o){gn(o)?n.resolve(void 0):n.reject(o)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}};var ou=class{constructor(e){this.grammarElementIdMap=new $o,this.tokenTypeIdMap=new $o,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>({...r,message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){let r=new Map,n=new Map;for(let i of qt(e))r.set(i,{});if(e.$cstNode)for(let i of fo(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){let n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(let[i,o]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(o)){let s=[];n[i]=s;for(let a of o)ht(a)?s.push(this.dehydrateAstNode(a,r)):At(a)?s.push(this.dehydrateReference(a,r)):s.push(a)}else ht(o)?n[i]=this.dehydrateAstNode(o,r):At(o)?n[i]=this.dehydrateReference(o,r):o!==void 0&&(n[i]=o);return n}dehydrateReference(e,r){let n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){let n=r.cstNodes.get(e);return Ec(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Dr(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):ti(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){let r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){let r=new Map,n=new Map;for(let o of qt(e))r.set(o,{});let i;if(e.$cstNode)for(let o of fo(e.$cstNode)){let s;"fullText"in o?(s=new ia(o.fullText),i=s):"content"in o?s=new Po:"tokenType"in o&&(s=this.hydrateCstLeafNode(o)),s&&(n.set(o,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){let n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(let[i,o]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(o)){let s=[];n[i]=s;for(let a of o)ht(a)?s.push(this.setParent(this.hydrateAstNode(a,r),n)):At(a)?s.push(this.hydrateReference(a,n,i,r)):s.push(a)}else ht(o)?n[i]=this.setParent(this.hydrateAstNode(o,r),n):At(o)?n[i]=this.hydrateReference(o,n,i,r):o!==void 0&&(n[i]=o);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){let i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),Dr(i))for(let o of e.content){let s=this.hydrateCstNode(o,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){let r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,o=e.startLine,s=e.startColumn,a=e.endLine,c=e.endColumn,l=e.hidden;return new No(n,i,{start:{line:o,character:s},end:{line:a,character:c}},r,l)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(let r of qt(this.grammar))Pc(r)&&this.grammarElementIdMap.set(r,e++)}};function su(t){return{documentation:{CommentProvider:e=>new ru(e),DocumentationProvider:e=>new tu(e)},parser:{AsyncParser:e=>new nu(e),GrammarConfig:e=>ng(e),LangiumParser:e=>Jy(e),CompletionParser:e=>Zy(e),ValueConverter:()=>new Lo,TokenBuilder:()=>new Oo,Lexer:e=>new Xo(e),ParserErrorMessageProvider:()=>new oa,LexerErrorMessageProvider:()=>new Jl},workspace:{AstNodeLocator:()=>new Fl,AstNodeDescriptionProvider:e=>new $l(e),ReferenceDescriptionProvider:e=>new Ml(e)},references:{Linker:e=>new bl(e),NameProvider:()=>new Al,ScopeProvider:e=>new Pl(e),ScopeComputation:e=>new Il(e),References:e=>new Sl(e)},serializer:{Hydrator:e=>new ou(e),JsonSerializer:e=>new Cl(e)},validation:{DocumentValidator:e=>new Dl(e),ValidationRegistry:e=>new Ll(e)},shared:()=>t.shared}}function au(t){return{ServiceRegistry:e=>new Ol(e),workspace:{LangiumDocuments:e=>new wl(e),LangiumDocumentFactory:e=>new Rl(e),DocumentBuilder:e=>new Yl(e),IndexManager:e=>new Kl(e),WorkspaceManager:e=>new Zl(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new iu,ConfigurationProvider:e=>new Ul(e)},profilers:{}}}var zT;(function(t){t.merge=(e,r)=>cu(cu({},e),r)})(zT||(zT={}));function Ho(t,e,r,n,i,o,s,a,c){let l=[t,e,r,n,i,o,s,a,c].reduce(cu,{});return HI(l)}var GI=Symbol("isProxy");function XI(t){if(t&&t[GI])for(let e of Object.values(t))XI(e);return t}function HI(t,e){let r=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(n,i)=>i===GI?!0:BI(n,i,t,e||r),getOwnPropertyDescriptor:(n,i)=>(BI(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),has:(n,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return r}var UI=Symbol();function BI(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+t[e]);if(t[e]===UI)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){let i=r[e];t[e]=UI;try{t[e]=typeof i=="function"?i(n):HI(i,n)}catch(o){throw t[e]=o instanceof Error?o:void 0,o}return t[e]}else return}function cu(t,e){if(e){for(let[r,n]of Object.entries(e))if(n!=null)if(typeof n=="object"){let i=t[r];typeof i=="object"&&i!==null?t[r]=cu(i,n):t[r]=cu({},n)}else t[r]=n}return t}var qT={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},jo;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(jo||(jo={}));var La=class extends Oo{constructor(e=qT){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...qT,...e},this.indentTokenType=pi({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=pi({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){let n=super.buildTokens(e,r);if(!Bp(n))throw new Error("Invalid tokens built by default builder");let{indentTokenName:i,dedentTokenName:o,whitespaceTokenName:s,ignoreIndentationDelimiters:a}=this.options,c,l,u,f=[];for(let d of n){for(let[p,m]of a)d.name===p?d.PUSH_MODE=jo.IGNORE_INDENTATION:d.name===m&&(d.POP_MODE=!0);d.name===o?c=d:d.name===i?l=d:d.name===s?u=d:f.push(d)}if(!c||!l||!u)throw new Error("Some indentation/whitespace tokens not found!");return a.length>0?{modes:{[jo.REGULAR]:[c,l,...f,u],[jo.IGNORE_INDENTATION]:[...f,u]},defaultMode:jo.REGULAR}:[c,l,u,...f]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,r){return r===0||`\r
161
+ `.includes(e[r-1])}matchWhitespace(e,r,n,i){this.whitespaceRegExp.lastIndex=r;let o=this.whitespaceRegExp.exec(e);return{currIndentLevel:o?.[0].length??0,prevIndentLevel:this.indentationStack.at(-1),match:o}}createIndentationTokenInstance(e,r,n,i){let o=this.getLineNumber(r,i);return Fn(e,n,i,i+n.length,o,o,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\r\n|\r|\n/).length}indentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;let{currIndentLevel:o,prevIndentLevel:s,match:a}=this.matchWhitespace(e,r,n,i);return o<=s?null:(this.indentationStack.push(o),a)}dedentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;let{currIndentLevel:o,prevIndentLevel:s,match:a}=this.matchWhitespace(e,r,n,i);if(o>=s)return null;let c=this.indentationStack.lastIndexOf(o);if(c===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${o} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:a?.[0]?.length??0,line:this.getLineNumber(e,r),column:1}),null;let l=this.indentationStack.length-c-1,u=e.substring(0,r).match(/[\r\n]+$/)?.[0].length??1;for(let f=0;f<l;f++){let d=this.createIndentationTokenInstance(this.dedentTokenType,e,"",r-(u-1));n.push(d),this.indentationStack.pop()}return null}buildTerminalToken(e){let r=super.buildTerminalToken(e),{indentTokenName:n,dedentTokenName:i,whitespaceTokenName:o}=this.options;return r.name===n?this.indentTokenType:r.name===i?this.dedentTokenType:r.name===o?pi({name:o,pattern:this.whitespaceRegExp,group:ct.SKIPPED}):r}flushRemainingDedents(e){let r=[];for(;this.indentationStack.length>1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},lu=class extends Xo{constructor(e){if(super(e),e.parser.TokenBuilder instanceof La)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=Up){let n=super.tokenize(e),i=n.report;r?.mode==="full"&&n.tokens.push(...i.remainingDedents),i.remainingDedents=[];let{indentTokenType:o,dedentTokenType:s}=this.indentationTokenBuilder,a=o.tokenTypeIdx,c=s.tokenTypeIdx,l=[],u=n.tokens.length-1;for(let f=0;f<u;f++){let d=n.tokens[f],p=n.tokens[f+1];if(d.tokenTypeIdx===a&&p.tokenTypeIdx===c){f++;continue}l.push(d)}return u>=0&&l.push(n.tokens[u]),n.tokens=l,n}};var Pe={};on(Pe,{AstUtils:()=>of,BiMap:()=>$o,Cancellation:()=>oe,ContextCache:()=>Mo,CstUtils:()=>bf,DONE_RESULT:()=>Ft,Deferred:()=>Qt,Disposable:()=>Mi,DisposableCache:()=>da,DocumentCache:()=>tp,EMPTY_STREAM:()=>ri,ErrorWithLocation:()=>ho,GrammarUtils:()=>vs,MultiMap:()=>Gt,OperationCancelled:()=>br,Reduction:()=>as,RegExpUtils:()=>If,SimpleCache:()=>Nl,StreamImpl:()=>fr,TreeStreamImpl:()=>sn,URI:()=>gt,UriTrie:()=>ua,UriUtils:()=>vt,WorkspaceCache:()=>pa,assertCondition:()=>n0,assertUnreachable:()=>ln,delayNextTick:()=>ax,interruptAndCheck:()=>mt,isOperationCancelled:()=>gn,loadGrammarFromJson:()=>jp,setInterruptionPeriod:()=>Zw,startCancelableOperation:()=>Qd,stream:()=>Te});Ae(Pe,it);var Hp=class{stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},uu={fileSystemProvider:()=>new Hp};var pU={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},hU={AstReflection:()=>new ys};function mU(){let t=Ho(au(uu),hU),e=Ho(su({shared:t}),pU);return t.ServiceRegistry.register(e),e}function jp(t){let e=mU(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,gt.parse(`memory:/${r.name??"grammar"}.langium`)),r}Ae(ut,Pe);var WT=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new Gt}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(r=>this.activeCategories.add(r)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(r=>this.activeCategories.delete(r)):this.activeCategories.clear()}createTask(e,r){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${r}'.`),new zp(n=>this.records.add(e,this.dumpRecord(e,n)),r)}dumpRecord(e,r){console.info(`Task ${e}.${r.identifier} executed in ${r.duration.toFixed(2)}ms and ended at ${r.date.toISOString()}`);let n=[];for(let s of r.entries.keys()){let a=r.entries.get(s),c=a.reduce((l,u)=>l+u);n.push({name:`${r.identifier}.${s}`,count:a.length,duration:c})}let i=r.duration-n.map(s=>s.duration).reduce((s,a)=>s+a,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((s,a)=>a.duration-s.duration);function o(s){return Math.round(100*s)/100}return console.table(n.map(s=>({Element:s.name,Count:s.count,"Self %":o(100*s.duration/r.duration),"Time (ms)":o(s.duration)}))),r}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(r=>e.some(n=>n===r[0])).flatMap(r=>r[1])}},zp=class{constructor(e,r){this.stack=[],this.entries=new Gt,this.addRecord=e,this.identifier=r}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(r=>r.id).join(", ")}.`);let e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){let r=this.stack.pop();if(!r)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(r.id!==e)throw new Error(`Sub-Task "${r.id}" is not already stopped.`);let n=performance.now()-r.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=n);let i=n-r.content;this.entries.add(e,i)}};var $a={$type:"AnchorDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Zp(t){return It.isInstance(t,$a.$type)}var VT={$type:"BlockProperty",key:"key",value:"value"};var QT={$type:"CalendarBlock",properties:"properties"};function Jp(t){return It.isInstance(t,QT.$type)}var Da={$type:"ConfigEntry"};var Kp={$type:"DefaultDeclaration",entityType:"entityType",properties:"properties"};function Fi(t){return It.isInstance(t,Kp.$type)}var e_={$type:"DescriptionDirective",text:"text"};function n_(t){return It.isInstance(t,e_.$type)}var qp={$type:"EntityProperty",key:"key",value:"value",values:"values"};var Ma={$type:"FootnoteDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Qp(t){return It.isInstance(t,Ma.$type)}var Fa={$type:"GroupBlock",content:"content",name:"name",properties:"properties",title:"title"};function qr(t){return It.isInstance(t,Fa.$type)}var fu={$type:"GroupContent"};var YT={$type:"IncludeDeclaration",options:"options",path:"path"};var KT={$type:"IncludeOption",key:"key",value:"value"};var Ua={$type:"ItemDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function yr(t){return It.isInstance(t,Ua.$type)}var Ba={$type:"LabelDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function eh(t){return It.isInstance(t,Ba.$type)}var Ga={$type:"MilestoneDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function th(t){return It.isInstance(t,Ga.$type)}var ZT={$type:"NowlineDirective",properties:"properties",version:"version"};var zo={$type:"NowlineFile",configEntries:"configEntries",directive:"directive",hasConfig:"hasConfig",includes:"includes",roadmapDecl:"roadmapDecl",roadmapEntries:"roadmapEntries"};var Xa={$type:"ParallelBlock",content:"content",name:"name",properties:"properties",title:"title"};function Wr(t){return It.isInstance(t,Xa.$type)}var Wp={$type:"ParallelContent"};var Ha={$type:"PersonDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Ui(t){return It.isInstance(t,Ha.$type)}var t_={$type:"PersonMemberRef",ref:"ref"};function jI(t){return It.isInstance(t,t_.$type)}var Vp={$type:"RoadmapDeclaration",name:"name",properties:"properties",title:"title"};var En={$type:"RoadmapEntry"};var r_={$type:"ScaleBlock",properties:"properties"};function zI(t){return It.isInstance(t,r_.$type)}var ja={$type:"SizeDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Ya(t){return It.isInstance(t,ja.$type)}var za={$type:"StatusDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function mu(t){return It.isInstance(t,za.$type)}var pu={$type:"StyleDeclaration",name:"name",properties:"properties",title:"title"};function gu(t){return It.isInstance(t,pu.$type)}var JT={$type:"StyleProperty",key:"key",value:"value"};var du={$type:"SwimlaneContent"};var qa={$type:"SwimlaneDeclaration",content:"content",name:"name",properties:"properties",title:"title"};function Vr(t){return It.isInstance(t,qa.$type)}var Wa={$type:"SymbolDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function yu(t){return It.isInstance(t,Wa.$type)}var Yp={$type:"TeamContent"};var Va={$type:"TeamDeclaration",content:"content",name:"name",properties:"properties",title:"title"};function Yr(t){return It.isInstance(t,Va.$type)}var hu=class extends Ji{constructor(){super(...arguments);fe(this,"types",{AnchorDeclaration:{name:$a.$type,properties:{description:{name:$a.description},name:{name:$a.name},properties:{name:$a.properties,defaultValue:[]},title:{name:$a.title}},superTypes:[En.$type]},BlockProperty:{name:VT.$type,properties:{key:{name:VT.key},value:{name:VT.value}},superTypes:[]},CalendarBlock:{name:QT.$type,properties:{properties:{name:QT.properties,defaultValue:[]}},superTypes:[Da.$type]},ConfigEntry:{name:Da.$type,properties:{},superTypes:[]},DefaultDeclaration:{name:Kp.$type,properties:{entityType:{name:Kp.entityType},properties:{name:Kp.properties,defaultValue:[]}},superTypes:[Da.$type]},DescriptionDirective:{name:e_.$type,properties:{text:{name:e_.text}},superTypes:[fu.$type,Wp.$type,du.$type,Yp.$type]},EntityProperty:{name:qp.$type,properties:{key:{name:qp.key},value:{name:qp.value},values:{name:qp.values,defaultValue:[]}},superTypes:[]},FootnoteDeclaration:{name:Ma.$type,properties:{description:{name:Ma.description},name:{name:Ma.name},properties:{name:Ma.properties,defaultValue:[]},title:{name:Ma.title}},superTypes:[En.$type]},GroupBlock:{name:Fa.$type,properties:{content:{name:Fa.content,defaultValue:[]},name:{name:Fa.name},properties:{name:Fa.properties,defaultValue:[]},title:{name:Fa.title}},superTypes:[fu.$type,Wp.$type,du.$type]},GroupContent:{name:fu.$type,properties:{},superTypes:[]},IncludeDeclaration:{name:YT.$type,properties:{options:{name:YT.options,defaultValue:[]},path:{name:YT.path}},superTypes:[]},IncludeOption:{name:KT.$type,properties:{key:{name:KT.key},value:{name:KT.value}},superTypes:[]},ItemDeclaration:{name:Ua.$type,properties:{description:{name:Ua.description},name:{name:Ua.name},properties:{name:Ua.properties,defaultValue:[]},title:{name:Ua.title}},superTypes:[fu.$type,Wp.$type,du.$type]},LabelDeclaration:{name:Ba.$type,properties:{description:{name:Ba.description},name:{name:Ba.name},properties:{name:Ba.properties,defaultValue:[]},title:{name:Ba.title}},superTypes:[En.$type]},MilestoneDeclaration:{name:Ga.$type,properties:{description:{name:Ga.description},name:{name:Ga.name},properties:{name:Ga.properties,defaultValue:[]},title:{name:Ga.title}},superTypes:[En.$type]},NowlineDirective:{name:ZT.$type,properties:{properties:{name:ZT.properties,defaultValue:[]},version:{name:ZT.version}},superTypes:[]},NowlineFile:{name:zo.$type,properties:{configEntries:{name:zo.configEntries,defaultValue:[]},directive:{name:zo.directive},hasConfig:{name:zo.hasConfig,defaultValue:!1},includes:{name:zo.includes,defaultValue:[]},roadmapDecl:{name:zo.roadmapDecl},roadmapEntries:{name:zo.roadmapEntries,defaultValue:[]}},superTypes:[]},ParallelBlock:{name:Xa.$type,properties:{content:{name:Xa.content,defaultValue:[]},name:{name:Xa.name},properties:{name:Xa.properties,defaultValue:[]},title:{name:Xa.title}},superTypes:[fu.$type,du.$type]},ParallelContent:{name:Wp.$type,properties:{},superTypes:[]},PersonDeclaration:{name:Ha.$type,properties:{description:{name:Ha.description},name:{name:Ha.name},properties:{name:Ha.properties,defaultValue:[]},title:{name:Ha.title}},superTypes:[En.$type]},PersonMemberRef:{name:t_.$type,properties:{ref:{name:t_.ref}},superTypes:[Yp.$type]},RoadmapDeclaration:{name:Vp.$type,properties:{name:{name:Vp.name},properties:{name:Vp.properties,defaultValue:[]},title:{name:Vp.title}},superTypes:[]},RoadmapEntry:{name:En.$type,properties:{},superTypes:[]},ScaleBlock:{name:r_.$type,properties:{properties:{name:r_.properties,defaultValue:[]}},superTypes:[Da.$type]},SizeDeclaration:{name:ja.$type,properties:{description:{name:ja.description},name:{name:ja.name},properties:{name:ja.properties,defaultValue:[]},title:{name:ja.title}},superTypes:[En.$type]},StatusDeclaration:{name:za.$type,properties:{description:{name:za.description},name:{name:za.name},properties:{name:za.properties,defaultValue:[]},title:{name:za.title}},superTypes:[En.$type]},StyleDeclaration:{name:pu.$type,properties:{name:{name:pu.name},properties:{name:pu.properties,defaultValue:[]},title:{name:pu.title}},superTypes:[Da.$type]},StyleProperty:{name:JT.$type,properties:{key:{name:JT.key},value:{name:JT.value}},superTypes:[]},SwimlaneContent:{name:du.$type,properties:{},superTypes:[]},SwimlaneDeclaration:{name:qa.$type,properties:{content:{name:qa.content,defaultValue:[]},name:{name:qa.name},properties:{name:qa.properties,defaultValue:[]},title:{name:qa.title}},superTypes:[En.$type]},SymbolDeclaration:{name:Wa.$type,properties:{description:{name:Wa.description},name:{name:Wa.name},properties:{name:Wa.properties,defaultValue:[]},title:{name:Wa.title}},superTypes:[Da.$type]},TeamContent:{name:Yp.$type,properties:{},superTypes:[]},TeamDeclaration:{name:Va.$type,properties:{content:{name:Va.content,defaultValue:[]},name:{name:Va.name},properties:{name:Va.properties,defaultValue:[]},title:{name:Va.title}},superTypes:[En.$type,Yp.$type]}})}},It=new hu;var qI,WI=()=>qI??(qI=jp(`{
162
162
  "$type": "Grammar",
163
163
  "isDeclared": true,
164
164
  "name": "Nowline",
@@ -2659,6 +2659,6 @@ ${r}`),this.inline?`{${i}}`:i}};function CU(t,e,r){if(t==="linkplain"||t==="link
2659
2659
  "imports": [],
2660
2660
  "interfaces": [],
2661
2661
  "types": []
2662
- }`));var MU={languageId:"nowline",fileExtensions:[".nowline"],caseInsensitive:!1,mode:"development"},Pv={AstReflection:()=>new cu},Cv={Grammar:()=>Nv(),LanguageMetaData:()=>MU,parser:{}};var Ov={"NL.E0001":()=>"Config section must appear before roadmap.","NL.E0002":()=>"Include declarations must appear before the config section.","NL.E0003":()=>"Include declarations must appear before the roadmap section.","NL.E0004":()=>"At least one swimlane is required.","NL.E0005":t=>`Line ${t.line}: mixed tabs and spaces in indentation. Use either tabs or spaces consistently.`,"NL.E0100":t=>`Invalid version format "${t.version}". Expected format: v1, v2, etc.`,"NL.E0101":t=>`This file requires Nowline ${t.version}, but the parser only supports up to ${t.supported}.`,"NL.E0102":t=>`Unknown directive property "${t.key}". Allowed: ${t.allowed}.`,"NL.E0103":t=>`Duplicate directive property "${t.key}".`,"NL.E0104":t=>`Invalid locale "${t.value}". Use a BCP-47 tag like "en-US", "fr", or "fr-CA".`,"NL.E0200":t=>`Invalid include mode "${t.value}". Must be merge, ignore, or isolate.`,"NL.E0201":t=>`Duplicate "${t.key}" option on include.`,"NL.E0300":t=>`Duplicate identifier "${t.name}". First declared at ${t.location}.`,"NL.E0301":t=>`${t.type} must have an identifier, a title, or both.`,"NL.E0400":t=>`Invalid duration "${t.value}". Use a raw duration literal like 0.5d, 2w, 1m, 2q. Use "size:NAME" to reference a declared size.`,"NL.E0401":t=>`Invalid size "${t.value}". Use the id of a declared size (e.g. xs, m, lg).`,"NL.E0402":t=>`Invalid effort "${t.value}". Use a raw duration literal like 0.5d, 2w, 1m, 2q.`,"NL.E0403":t=>`Invalid remaining value "${t.value}". Use a percentage like 30% or a duration literal like 1w, 0.5d.`,"NL.E0404":t=>`Remaining must be between 0% and 100%, got ${t.value}.`,"NL.E0405":t=>`Invalid ${t.key} "${t.value}". Use ISO 8601 format: YYYY-MM-DD.`,"NL.E0406":t=>`Invalid scale "${t.value}". Use a raw duration literal like 1w, 2w, 1q (no name lookup).`,"NL.E0407":t=>`Invalid calendar "${t.value}". Must be business, full, or custom.`,"NL.E0408":t=>`Property "${t.key}" requires at least one reference.`,"NL.E0410":t=>`"${t.key}:" accepts at most one inline date per direction; collapse the multiple dates to a single binding date or use a declared anchor.`,"NL.E0411":t=>`Inline date in "${t.key}:" is not allowed on ${t.type}. Allowed only on item, parallel, and group; for a milestone use "date:" instead.`,"NL.E0412":t=>`Inline date "${t.date}" in "${t.key}:" requires the roadmap to declare "start:". Add start:YYYY-MM-DD to the roadmap.`,"NL.E0413":t=>`Inline date "${t.date}" in "${t.key}:" is before roadmap start ${t.start}.`,"NL.E0500":t=>`Anchor "${t.name}" requires a "date:" property.`,"NL.E0501":t=>`Anchor "${t.name}" has a date but the roadmap is missing "start:". Add start:YYYY-MM-DD to the roadmap.`,"NL.E0502":t=>`Anchor "${t.name}" date ${t.date} is before roadmap start ${t.start}.`,"NL.E0503":t=>`Milestone "${t.name}" requires at least one of "date:" or "after:".`,"NL.E0504":t=>`Milestone "${t.name}" date ${t.date} is before roadmap start ${t.start}.`,"NL.E0505":()=>'Footnote requires an "on:" property referencing one or more entities.',"NL.E0600":t=>`Item "${t.name}" requires a "size:" or "duration:" property.`,"NL.W0700":t=>`Unknown property "${t.key}" on ${t.entity}. The renderer ignores it.${t.suggested?` Did you mean "${t.suggested}"?`:""}`};var Lv={"NL.E0001":()=>"La section config doit pr\xE9c\xE9der la section roadmap.","NL.E0002":()=>"Les d\xE9clarations include doivent pr\xE9c\xE9der la section config.","NL.E0003":()=>"Les d\xE9clarations include doivent pr\xE9c\xE9der la section roadmap.","NL.E0004":()=>"Au moins une swimlane est requise.","NL.E0005":t=>`Ligne ${t.line}\xA0: tabulations et espaces m\xE9lang\xE9s dans l'indentation. Utilisez l'un ou l'autre, mais pas les deux.`,"NL.E0100":t=>`Format de version invalide \xAB\xA0${t.version}\xA0\xBB. Format attendu\xA0: v1, v2, etc.`,"NL.E0101":t=>`Ce fichier requiert Nowline ${t.version}, mais l'analyseur ne prend en charge que jusqu'\xE0 ${t.supported}.`,"NL.E0102":t=>`Propri\xE9t\xE9 de directive inconnue \xAB\xA0${t.key}\xA0\xBB. Valeurs admises\xA0: ${t.allowed}.`,"NL.E0103":t=>`Propri\xE9t\xE9 de directive \xAB\xA0${t.key}\xA0\xBB en double.`,"NL.E0104":t=>`Locale invalide \xAB\xA0${t.value}\xA0\xBB. Utilisez une \xE9tiquette BCP-47 telle que \xAB\xA0en-US\xA0\xBB, \xAB\xA0fr\xA0\xBB ou \xAB\xA0fr-CA\xA0\xBB.`,"NL.E0200":t=>`Mode d'include invalide \xAB\xA0${t.value}\xA0\xBB. Doit \xEAtre merge, ignore ou isolate.`,"NL.E0201":t=>`Option \xAB\xA0${t.key}\xA0\xBB en double sur include.`,"NL.E0300":t=>`Identifiant en double \xAB\xA0${t.name}\xA0\xBB. Premi\xE8re d\xE9claration \xE0 ${t.location}.`,"NL.E0301":t=>`${t.type} doit comporter un identifiant, un titre, ou les deux.`,"NL.E0400":t=>`Dur\xE9e invalide \xAB\xA0${t.value}\xA0\xBB. Utilisez un litt\xE9ral de dur\xE9e brut comme 0.5d, 2w, 1m, 2q. Utilisez \xAB\xA0size:NOM\xA0\xBB pour r\xE9f\xE9rencer une taille d\xE9clar\xE9e.`,"NL.E0401":t=>`Taille invalide \xAB\xA0${t.value}\xA0\xBB. Utilisez l'identifiant d'une taille d\xE9clar\xE9e (p.\xA0ex. xs, m, lg).`,"NL.E0402":t=>`Effort invalide \xAB\xA0${t.value}\xA0\xBB. Utilisez un litt\xE9ral de dur\xE9e brut comme 0.5d, 2w, 1m, 2q.`,"NL.E0403":t=>`Valeur restante invalide \xAB\xA0${t.value}\xA0\xBB. Utilisez un pourcentage tel que 30% ou un litt\xE9ral de dur\xE9e comme 1w, 0.5d.`,"NL.E0404":t=>`La valeur restante doit \xEAtre comprise entre 0 % et 100 %, re\xE7u ${t.value}.`,"NL.E0405":t=>`${t.key} invalide \xAB\xA0${t.value}\xA0\xBB. Utilisez le format ISO 8601\xA0: AAAA-MM-JJ.`,"NL.E0406":t=>`\xC9chelle invalide \xAB\xA0${t.value}\xA0\xBB. Utilisez un litt\xE9ral de dur\xE9e brut comme 1w, 2w, 1q (pas de recherche par nom).`,"NL.E0407":t=>`Calendrier invalide \xAB\xA0${t.value}\xA0\xBB. Doit \xEAtre business, full ou custom.`,"NL.E0408":t=>`La propri\xE9t\xE9 \xAB\xA0${t.key}\xA0\xBB exige au moins une r\xE9f\xE9rence.`,"NL.E0410":t=>`\xAB\xA0${t.key}:\xA0\xBB n'accepte qu'une seule date inline par direction\xA0; regroupez les dates en une seule date contraignante ou utilisez une ancre d\xE9clar\xE9e.`,"NL.E0411":t=>`Une date inline dans \xAB\xA0${t.key}:\xA0\xBB n'est pas autoris\xE9e sur ${t.type}. Autoris\xE9e seulement sur item, parallel et group\xA0; pour un milestone utilisez \xAB\xA0date:\xA0\xBB \xE0 la place.`,"NL.E0412":t=>`La date inline \xAB\xA0${t.date}\xA0\xBB dans \xAB\xA0${t.key}:\xA0\xBB exige que la roadmap d\xE9clare \xAB\xA0start:\xA0\xBB. Ajoutez start:AAAA-MM-JJ \xE0 la roadmap.`,"NL.E0413":t=>`La date inline \xAB\xA0${t.date}\xA0\xBB dans \xAB\xA0${t.key}:\xA0\xBB pr\xE9c\xE8de le d\xE9but de la roadmap (${t.start}).`,"NL.E0500":t=>`L'ancre \xAB\xA0${t.name}\xA0\xBB exige une propri\xE9t\xE9 \xAB\xA0date:\xA0\xBB.`,"NL.E0501":t=>`L'ancre \xAB\xA0${t.name}\xA0\xBB a une date, mais \xAB\xA0start:\xA0\xBB manque sur la roadmap. Ajoutez start:AAAA-MM-JJ \xE0 la roadmap.`,"NL.E0502":t=>`La date ${t.date} de l'ancre \xAB\xA0${t.name}\xA0\xBB pr\xE9c\xE8de le d\xE9but de la roadmap (${t.start}).`,"NL.E0503":t=>`Le jalon \xAB\xA0${t.name}\xA0\xBB exige au moins l'une des propri\xE9t\xE9s \xAB\xA0date:\xA0\xBB ou \xAB\xA0after:\xA0\xBB.`,"NL.E0504":t=>`La date ${t.date} du jalon \xAB\xA0${t.name}\xA0\xBB pr\xE9c\xE8de le d\xE9but de la roadmap (${t.start}).`,"NL.E0505":()=>"Une note de bas de page exige une propri\xE9t\xE9 \xAB\xA0on:\xA0\xBB r\xE9f\xE9ren\xE7ant au moins une entit\xE9.","NL.E0600":t=>`L'\xE9l\xE9ment \xAB\xA0${t.name}\xA0\xBB exige une propri\xE9t\xE9 \xAB\xA0size:\xA0\xBB ou \xAB\xA0duration:\xA0\xBB.`,"NL.W0700":t=>`Propri\xE9t\xE9 inconnue \xAB\xA0${t.key}\xA0\xBB sur ${t.entity}. Le moteur de rendu l'ignore.${t.suggested?` Vouliez-vous dire \xAB\xA0${t.suggested}\xA0\xBB\xA0?`:""}`};var Dv={};var $v={};var FU=new Map([["en-US",Ov],["fr",Lv],["fr-CA",Dv],["fr-FR",$v]]);function Fv(t,e,...r){for(let n of UU(t)){let o=FU.get(n)?.[e];if(o)return o(...r)}return e}var Mv="en-US";function UU(t){let e=[],r=BU(t);for(;r.length>0;){e.includes(r)||e.push(r);let n=r.lastIndexOf("-");if(n<=0)break;r=r.slice(0,n)}return e.includes(Mv)||e.push(Mv),e}function BU(t){return t.split("-").map((r,n)=>n===0?r.toLowerCase():/^[a-zA-Z]{2}$/.test(r)?r.toUpperCase():r).join("-")}var XU=/[\\/]/;function Xv(t){for(let e=t.length-1;e>=0;e--){let r=t.charCodeAt(e);if(r===47||r===92)return e}return-1}function Uv(...t){for(let e of t)if(e){if(e.includes("\\")&&!e.includes("/"))return"\\";if(e.includes("/"))return"/"}return"/"}function GU(t){return t?t[0]==="/"||t[0]==="\\"?!0:t.length>=3&&/^[A-Za-z]:[\\/]/.test(t):!1}function Gv(t){let e=Xv(t);return e<0?".":e===0?t[0]:e===2&&/^[A-Za-z]:[\\/]/.test(t)?t.slice(0,3):t.slice(0,e)}function zp(t){let e=Xv(t);return e<0?t:t.slice(e+1)}function VT(t,e){if(GU(e))return Bv(e,Uv(e));let r=Uv(t,e);return Bv(`${t}${r}${e}`,r)}function Bv(t,e){let r="",n=t,i=/^([A-Za-z]:)([\\/])?/.exec(n);i?(r=i[1]+(i[2]?e:""),n=n.slice(i[0].length)):(n[0]==="/"||n[0]==="\\")&&(r=e,n=n.replace(/^[\\/]+/,""));let o=[];for(let s of n.split(XU))if(!(s===""||s===".")){if(s===".."){o.length>0&&o[o.length-1]!==".."?o.pop():r||o.push("..");continue}o.push(s)}return r+o.join(e)}var jU=/^\d{4}-\d{2}-\d{2}$/;function Wv(t){let e=t?.properties.find(r=>r.key==="start");if(e?.value&&jU.test(e.value)&&!Number.isNaN(new Date(e.value).getTime()))return e.value}function WU(t,e,r){return e&&r?`Included "${t}" declares start:${r}, which doesn't match this file's start:${e}. Both files must declare the same start date, or neither should.`:e?`Included "${t}" has no start:, but this file declares start:${e}. Both files must declare the same start date, or neither should.`:`Included "${t}" declares start:${r}, but this file has no start:. Both files must declare the same start date, or neither should.`}function qv(){return{styles:new Map,defaults:new Map,symbols:new Map}}function zv(){return{persons:new Map,teams:new Map,anchors:new Map,labels:new Map,sizes:new Map,statuses:new Map,swimlanes:new Map,milestones:new Map,footnotes:new Map,isolatedRegions:[]}}async function YT(t,e,r){let n=r.readFile??(async c=>{let{nodeReadFile:l}=await Promise.resolve().then(()=>(jv(),Hv));return l(c)}),i={services:r.services,diagnostics:[],resolving:[],processed:new Map,readFile:n},o=VT("",e),{config:s,content:a}=await Yv(t,o,i);return{config:s,content:a,diagnostics:i.diagnostics,processedFiles:new Set(i.processed.keys())}}async function Yv(t,e,r){if(r.processed.has(e))return r.processed.get(e);if(r.resolving.includes(e)){r.diagnostics.push({severity:"error",message:`Circular include detected: ${[...r.resolving,e].join(" \u2192 ")}`,sourcePath:e});let a={config:qv(),content:zv()};return r.processed.set(e,a),a}r.resolving.push(e);let n=qv(),i=zv();YU(n,t),ZU(i,t);let o=new Set;for(let a of t.includes){let c=a.path,l=VT(Gv(e),c);if(o.has(l)){r.diagnostics.push({severity:"error",message:`Duplicate include "${c}" in ${zp(e)}.`,sourcePath:e,line:a.$cstNode?.range.start.line});continue}o.add(l);let u=Vv(a,"config")??"merge",f=Vv(a,"roadmap")??"merge",d;try{let y=await r.readFile(l);d=await qU(r.services,y,l)}catch(y){r.diagnostics.push({severity:"error",message:`Could not read include "${c}": ${y.message}`,sourcePath:e,line:a.$cstNode?.range.start.line});continue}let{config:p,content:m}=await Yv(d,l,r);if(zU(n,p,u,l,r.diagnostics),VU(i,m,p,f,l,c,r.diagnostics),f==="isolate"&&!m.roadmap&&r.diagnostics.push({severity:"error",message:`Cannot isolate "${c}": it has no roadmap declaration.`,sourcePath:e,line:a.$cstNode?.range.start.line}),f!=="ignore"&&d.roadmapDecl){let y=Wv(t.roadmapDecl),R=Wv(d.roadmapDecl);y!==R&&r.diagnostics.push({severity:"error",message:WU(c,y,R),sourcePath:e,line:a.$cstNode?.range.start.line})}}r.resolving.pop();let s={config:n,content:i};return r.processed.set(e,s),s}function Vv(t,e){let r=t.options.find(n=>n.key===e);if(r&&(r.value==="merge"||r.value==="ignore"||r.value==="isolate"))return r.value}async function qU(t,e,r){let n=mt.file(r),o=t.shared.workspace.LangiumDocumentFactory.fromString(e,n);return await t.shared.workspace.DocumentBuilder.build([o],{validation:!1}),o.parseResult.value}function zU(t,e,r,n,i){if(r==="ignore"||r==="isolate")return;let o=(s,a)=>i.push({severity:"warning",message:`${a} "${s}" from ${zp(n)} is shadowed by the parent's definition.`,sourcePath:n});Sr(t.styles,e.styles,s=>o(s,"Style")),Sr(t.defaults,e.defaults,s=>o(s,"Default")),Sr(t.symbols,e.symbols,s=>o(s,"Symbol")),e.scale&&!t.scale&&(t.scale=e.scale),e.calendar&&!t.calendar&&(t.calendar=e.calendar)}function VU(t,e,r,n,i,o,s){if(n==="ignore")return;if(n==="isolate"){e.roadmap&&t.isolatedRegions.push({sourcePath:o,config:r,content:e});return}let a=(c,l)=>s.push({severity:"warning",message:`${l} "${c}" from ${zp(i)} is shadowed by the parent's definition.`,sourcePath:i});Sr(t.persons,e.persons,c=>a(c,"Person")),Sr(t.teams,e.teams,c=>a(c,"Team")),Sr(t.anchors,e.anchors,c=>a(c,"Anchor")),Sr(t.labels,e.labels,c=>a(c,"Label")),Sr(t.sizes,e.sizes,c=>a(c,"Size")),Sr(t.statuses,e.statuses,c=>a(c,"Status")),Sr(t.swimlanes,e.swimlanes,c=>a(c,"Swimlane")),Sr(t.milestones,e.milestones,c=>a(c,"Milestone")),Sr(t.footnotes,e.footnotes,c=>a(c,"Footnote")),e.roadmap&&!t.roadmap&&(t.roadmap=e.roadmap)}function Sr(t,e,r){for(let[n,i]of e){if(t.has(n)){r(n);continue}t.set(n,i)}}function YU(t,e){for(let r of e.configEntries)KU(t,r)}function KU(t,e){vv(e)?t.scale||(t.scale=e):Hp(e)?t.calendar||(t.calendar=e):uu(e)?e.name&&!t.styles.has(e.name)&&t.styles.set(e.name,e):fu(e)?e.name&&!t.symbols.has(e.name)&&t.symbols.set(e.name,e):Oi(e)&&(t.defaults.has(e.entityType)||t.defaults.set(e.entityType,e))}function ZU(t,e){e.roadmapDecl&&!t.roadmap&&(t.roadmap=e.roadmapDecl);for(let r of e.roadmapEntries)JU(t,r)}function JU(t,e){qr(e)?e.name&&!t.swimlanes.has(e.name)&&t.swimlanes.set(e.name,e):Li(e)?e.name&&!t.persons.has(e.name)&&t.persons.set(e.name,e):zr(e)?e.name&&!t.teams.has(e.name)&&t.teams.set(e.name,e):Gp(e)?e.name&&!t.anchors.has(e.name)&&t.anchors.set(e.name,e):Wp(e)?e.name&&!t.labels.has(e.name)&&t.labels.set(e.name,e):Ha(e)?e.name&&!t.sizes.has(e.name)&&t.sizes.set(e.name,e):lu(e)?e.name&&!t.statuses.has(e.name)&&t.statuses.set(e.name,e):qp(e)?e.name&&!t.milestones.has(e.name)&&t.milestones.set(e.name,e):jp(e)&&e.name&&!t.footnotes.has(e.name)&&t.footnotes.set(e.name,e)}var Kv="v1",KT=new Set(["planned","in-progress","active","done","completed","at-risk","blocked"]),Vp=new Set(["bg","fg","text","border","icon","shadow","font","weight","italic","text-size","padding","spacing","header-height","corner-radius","bracket","header-position","capacity-icon","timeline-position","minor-grid"]),t_=new Set(["none","multiplier","person","people","points","time"]),Yp=new Set([...t_,"shield","warning","lock","calendar"]),sk="none",Kp={border:new Set(["solid","dashed","dotted"]),shadow:new Set(["none","subtle","soft","hard"]),font:new Set(["sans","serif","mono"]),weight:new Set(["thin","light","normal","bold"]),italic:new Set(["true","false"]),"text-size":new Set(["none","xs","sm","md","lg","xl"]),padding:new Set(["none","xs","sm","md","lg","xl"]),spacing:new Set(["none","xs","sm","md","lg","xl"]),"header-height":new Set(["none","xs","sm","md","lg","xl"]),"corner-radius":new Set(["none","xs","sm","md","lg","xl","full"]),bracket:new Set(["none","solid","dashed"]),"header-position":new Set(["beside","above"]),"timeline-position":new Set(["top","bottom","both"]),"minor-grid":new Set(["true","false"])},QU=new Set(["red","blue","yellow","green","orange","purple","violet","gray","grey","navy","white","none"]),eB=new Set(["business","full","custom"]),ZT=new Set(["days-per-week","days-per-month","days-per-quarter","days-per-year"]),Zv=new Set(["name","label-every","label"]),Jv=new Set(["item","label","swimlane","roadmap","milestone","footnote","anchor","parallel","group"]),tB={item:new Set(["size","duration","after","before","remaining","link","description","owner"]),milestone:new Set(["date","after","link","description"]),anchor:new Set(["date","link","description"]),footnote:new Set(["on","link","description"]),label:new Set(["link","description"]),swimlane:new Set(["capacity"]),roadmap:new Set,parallel:new Set,group:new Set},Qv=new Set(["labels","link","style","description"]),rB={RoadmapDeclaration:new Set(["author","start","length","scale","calendar","logo","logo-size"]),AnchorDeclaration:new Set(["date"]),SwimlaneDeclaration:new Set(["owner","capacity","utilization-warn-at","utilization-over-at","status","after","before"]),ItemDeclaration:new Set(["size","duration","status","owner","after","before","remaining","capacity","date","start"]),ParallelBlock:new Set(["owner","after","before","status"]),GroupBlock:new Set(["owner","after","before","status"]),MilestoneDeclaration:new Set(["date","after"]),FootnoteDeclaration:new Set(["on"]),PersonDeclaration:new Set,TeamDeclaration:new Set,LabelDeclaration:new Set,SizeDeclaration:new Set(["effort"]),StatusDeclaration:new Set};function nB(t,e,r){if(t===e)return 0;let n=t.length,i=e.length;if(Math.abs(n-i)>r)return r+1;if(n===0)return i;if(i===0)return n;let o=new Array(i+1),s=new Array(i+1);for(let a=0;a<=i;a++)o[a]=a;for(let a=1;a<=n;a++){s[0]=a;let c=a;for(let u=1;u<=i;u++){let f=t.charCodeAt(a-1)===e.charCodeAt(u-1)?0:1;s[u]=Math.min(o[u]+1,s[u-1]+1,o[u-1]+f),s[u]<c&&(c=s[u])}if(c>r)return r+1;let l=o;o=s,s=l}return o[i]}function iB(t,e,r=2){let n,i=r+1;for(let o of e){let s=nB(t,o,r);if(s<i&&(n=o,i=s,s===0))break}return n}function Ne(t){return t.key.endsWith(":")?t.key.slice(0,-1):t.key}var du=/^\d+(?:\.\d+)?[dwmqy]$/,oB=/^\d+%$/,Di=/^\d{4}-\d{2}-\d{2}$/,sB=/^#[0-9a-fA-F]{3,8}$/,aB=/^v\d+$/,ek=/^\d+$/,cB=/^[dwmqy]$/,tk=/^\d+(\.\d+)?$/,r_=/^\d+(\.\d+)?%$/,ak=/^\d+\.\d+$/,lB=/^\d+$/,uB=/^[\x20-\x7E]{1,3}$/,fB=/^[a-zA-Z]{2,3}(-[a-zA-Z]{2}|-\d{3})?$/,dB=new Set(["merge","ignore","isolate"]),rk=new Set(["locale"]);function JT(t){let e=t?.roadmapDecl?.properties.find(i=>Ne(i)==="start");if(!e)return{kind:"missing"};let r=e.value;if(!r||!Di.test(r))return{kind:"invalid"};let n=new Date(r);return Number.isNaN(n.getTime())?{kind:"invalid"}:{kind:"valid",iso:r,date:n}}function Vr(t){return t.name??t.title??"<unnamed>"}function pB(t){return t.$type.replace(/Declaration$|Block$/,"").toLowerCase()}function we(t,e,r,n,...i){t(e,Fv("en-US",n,...i),{...r,data:{code:n,args:i}})}function ck(t){let e=t.validation.ValidationRegistry,r=t.validation.NowlineValidator,n={NowlineFile:[r.checkFileStructure,r.checkUniqueIdentifiers,r.checkSwimlaneRequired,r.checkIndentationConsistency,r.checkRoadmapOnlyKeywordsPosition,r.checkForwardReferences,r.checkReferenceResolution,r.checkInlineDatePins,r.checkCircularDependencies,r.checkDuplicateSizeIds,r.checkCalendarBlockConsistency,r.checkPersonDeclarations,r.checkDuplicateSymbolIds,r.checkSymbolReferences],NowlineDirective:[r.checkDirectiveVersion,r.checkDirectiveProperties],IncludeOption:[r.checkIncludeMode],IncludeDeclaration:[r.checkIncludeDuplicateOptions],EntityProperty:[r.checkPropertyValues],RoadmapDeclaration:[r.checkEntityIdOrTitle,r.checkRoadmapProperties,r.checkNoRawStyleProperties,r.checkUnknownEntityProperties],AnchorDeclaration:[r.checkEntityIdOrTitle,r.checkAnchorRequiredDate,r.checkAnchorAgainstStart,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],SwimlaneDeclaration:[r.checkEntityIdOrTitle,r.checkNoRawStyleProperties,r.checkUtilizationOrdering,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],ItemDeclaration:[r.checkEntityIdOrTitle,r.checkItemRequiredDuration,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],ParallelBlock:[r.checkParallelMinChildren,r.checkNoComputedProperties,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],GroupBlock:[r.checkGroupMinChildren,r.checkNoComputedProperties,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],MilestoneDeclaration:[r.checkEntityIdOrTitle,r.checkMilestoneRequirement,r.checkMilestoneAgainstStart,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],FootnoteDeclaration:[r.checkEntityIdOrTitle,r.checkFootnoteOn,r.checkNoRawStyleProperties,r.checkUnknownEntityProperties],PersonDeclaration:[r.checkEntityIdOrTitle,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],TeamDeclaration:[r.checkEntityIdOrTitle,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],StyleDeclaration:[r.checkEntityIdOrTitle],StyleProperty:[r.checkStylePropertyEnum],SymbolDeclaration:[r.checkEntityIdOrTitle,r.checkSymbolDeclaration],LabelDeclaration:[r.checkEntityIdOrTitle,r.checkNoRawStyleProperties,r.checkUnknownEntityProperties],SizeDeclaration:[r.checkEntityIdOrTitle,r.checkSizeDeclaration,r.checkNoRawStyleProperties,r.checkUnknownEntityProperties],StatusDeclaration:[r.checkEntityIdOrTitle,r.checkStatusDeclaration,r.checkNoRawStyleProperties,r.checkUnknownEntityProperties],DefaultDeclaration:[r.checkDefaultDeclaration,r.checkUtilizationOrdering],CalendarBlock:[r.checkCalendarBlock],ScaleBlock:[r.checkScaleBlock]};e.register(n,r)}var Jp=class{checkFileStructure(e,r){let n=e.hasConfig?gs.findNodeForKeyword(e.$cstNode,"config")?.offset:void 0,i=e.roadmapDecl?.$cstNode?.offset;n!==void 0&&i!==void 0&&n>i&&we(r,"error",{node:e,property:"hasConfig"},"NL.E0001");for(let o of e.includes){let s=o.$cstNode?.offset??0;n!==void 0&&s>n&&we(r,"error",{node:o},"NL.E0002"),i!==void 0&&s>i&&we(r,"error",{node:o},"NL.E0003")}}checkRoadmapOnlyKeywordsPosition(e,r){}checkDirectiveVersion(e,r){if(!aB.test(e.version)){we(r,"error",{node:e,property:"version"},"NL.E0100",{version:e.version});return}let n=parseInt(e.version.slice(1),10),i=parseInt(Kv.slice(1),10);n>i&&we(r,"error",{node:e,property:"version"},"NL.E0101",{version:e.version,supported:Kv})}checkDirectiveProperties(e,r){let n=new Set;for(let i of e.properties){let o=Ne(i);if(!rk.has(o)){we(r,"error",{node:i,property:"key"},"NL.E0102",{key:o,allowed:[...rk].join(", ")});continue}if(n.has(o)&&we(r,"error",{node:i,property:"key"},"NL.E0103",{key:o}),n.add(o),o==="locale"){let s=i.value;fB.test(s)||we(r,"error",{node:i,property:"value"},"NL.E0104",{value:s})}}}checkEntityIdOrTitle(e,r){!e.name&&!e.title&&we(r,"error",{node:e},"NL.E0301",{type:e.$type})}checkUniqueIdentifiers(e,r){let n=new Map,i=(o,s)=>{if(!o)return;let a=n.get(o);a?we(r,"error",{node:s},"NL.E0300",{name:o,location:Zp(a)}):n.set(o,s)};e.roadmapDecl?.name&&i(e.roadmapDecl.name,e.roadmapDecl);for(let o of e.roadmapEntries)gB(o,i);for(let o of e.configEntries)uu(o)&&o.name&&i(o.name,o)}checkIndentationConsistency(e,r){let n=e.$document?.textDocument.getText()??e.$cstNode?.text;if(!n)return;let i=n.split(/\r?\n/);for(let o=0;o<i.length;o++){let s=i[o];if(s.length===0)continue;let a=s.match(/^([\t ]+)/);if(!a)continue;let c=a[1];if(c.includes(" ")&&c.includes(" ")){we(r,"error",{node:e},"NL.E0005",{line:o+1});return}}}checkSwimlaneRequired(e,r){let n=e.roadmapEntries.some(qr);e.roadmapDecl&&!n&&we(r,"error",{node:e.roadmapDecl},"NL.E0004")}checkIncludeMode(e,r){dB.has(e.value)||we(r,"error",{node:e,property:"value"},"NL.E0200",{value:e.value})}checkIncludeDuplicateOptions(e,r){let n=new Set;for(let i of e.options){let o=i.key.replace(/:$/,"");n.has(o)&&we(r,"error",{node:i},"NL.E0201",{key:o}),n.add(o)}}checkPropertyValues(e,r){let n=Ne(e),i=e.value,o=e.values,s=i?[i]:o;switch(n){case"status":break;case"duration":i&&!du.test(i)&&we(r,"error",{node:e,property:"value"},"NL.E0400",{value:i});break;case"size":i&&!nk(i)&&we(r,"error",{node:e,property:"value"},"NL.E0401",{value:i});break;case"effort":i&&!du.test(i)&&we(r,"error",{node:e,property:"value"},"NL.E0402",{value:i});break;case"remaining":{if(i)if(oB.test(i)){let a=parseFloat(i);(a<0||a>100)&&we(r,"error",{node:e,property:"value"},"NL.E0404",{value:i})}else du.test(i)||we(r,"error",{node:e,property:"value"},"NL.E0403",{value:i});break}case"date":case"start":i&&(!Di.test(i)||Number.isNaN(new Date(i).getTime()))&&we(r,"error",{node:e,property:"value"},"NL.E0405",{key:n,value:i});break;case"scale":i&&!du.test(i)&&we(r,"error",{node:e,property:"value"},"NL.E0406",{value:i});break;case"calendar":i&&!eB.has(i)&&we(r,"error",{node:e,property:"value"},"NL.E0407",{value:i});break;case"on":case"after":case"before":s.length===0&&we(r,"error",{node:e},"NL.E0408",{key:n});break;case"capacity":{if(!i)break;let a=e.$container,c=hB(a);if(c==="invalid")break;c==="lane"?(!tk.test(i)||parseFloat(i)<=0)&&r("error",`Invalid swimlane capacity "${i}". Use a positive integer (e.g. capacity:5) or decimal (e.g. capacity:1.5). Percent literals are not allowed on swimlanes.`,{node:e,property:"value"}):r_.test(i)?parseFloat(i)<=0&&r("error",`Item capacity "${i}" must be positive.`,{node:e,property:"value"}):tk.test(i)?parseFloat(i)<=0&&r("error",`Item capacity "${i}" must be positive.`,{node:e,property:"value"}):r("error",`Invalid item capacity "${i}". Use a positive integer (capacity:2), decimal (capacity:0.5), or percent literal (capacity:50%).`,{node:e,property:"value"});break}case"overcapacity":{r("error",'"overcapacity:" was removed. Use "utilization-over-at:none" (and/or "utilization-warn-at:none") to suppress the lane utilization underline.',{node:e});break}case"utilization-warn-at":case"utilization-over-at":{if(!i)break;if(!mB(e.$container)){r("error",`"${n}:" is only valid on "swimlane" or "default swimlane".`,{node:e});break}if(i===sk)break;if(r_.test(i)){parseFloat(i)<=0&&r("error",`${n} value "${i}" must be positive.`,{node:e,property:"value"});break}if(ak.test(i)){parseFloat(i)<=0&&r("error",`${n} value "${i}" must be positive.`,{node:e,property:"value"});break}if(lB.test(i)){r("error",`Ambiguous ${n} value "${i}". Use the percent form ("${i}%") or the decimal-fraction form ("0.${i}") to make the intent explicit.`,{node:e,property:"value"});break}r("error",`Invalid ${n} value "${i}". Use a positive percent (e.g. 80%), a positive decimal fraction (e.g. 0.8), or "none" to opt out.`,{node:e,property:"value"});break}case"capacity-icon":break;case"icon":break;default:if(Vp.has(n)){if(n==="bg"||n==="fg"||n==="text")i&&!QT(i)&&r("error",`Invalid color "${i}" for "${n}". Use a named color, hex value, or "none".`,{node:e,property:"value"});else if(n in Kp){let a=Kp[n];i&&!a.has(i)&&!QT(i)&&r("error",`Invalid value "${i}" for "${n}". Allowed: ${[...a].join(", ")}.`,{node:e,property:"value"})}}break}}checkAnchorRequiredDate(e,r){e.properties.find(i=>Ne(i)==="date")||we(r,"error",{node:e},"NL.E0500",{name:Vr(e)})}checkAnchorAgainstStart(e,r){let n=e.properties.find(a=>Ne(a)==="date");if(!n?.value)return;let i=n.value;if(!Di.test(i))return;let o=new Date(i);if(Number.isNaN(o.getTime()))return;let s=JT(e.$container);switch(s.kind){case"invalid":return;case"missing":we(r,"error",{node:n,property:"value"},"NL.E0501",{name:Vr(e)});return;case"valid":o<s.date&&we(r,"error",{node:n,property:"value"},"NL.E0502",{name:Vr(e),date:i,start:s.iso});return}}checkMilestoneRequirement(e,r){let n=e.properties.some(o=>Ne(o)==="date"),i=e.properties.some(o=>Ne(o)==="after");!n&&!i&&we(r,"error",{node:e},"NL.E0503",{name:Vr(e)})}checkMilestoneAgainstStart(e,r){let n=e.properties.find(a=>Ne(a)==="date");if(!n?.value)return;let i=n.value;if(!Di.test(i))return;let o=new Date(i);if(Number.isNaN(o.getTime()))return;let s=JT(e.$container);switch(s.kind){case"invalid":return;case"missing":r("error",`Milestone "${Vr(e)}" has a date but the roadmap is missing "start:". Add start:YYYY-MM-DD to the roadmap.`,{node:n,property:"value"});return;case"valid":o<s.date&&we(r,"error",{node:n,property:"value"},"NL.E0504",{name:Vr(e),date:i,start:s.iso});return}}checkFootnoteOn(e,r){e.properties.some(i=>Ne(i)==="on")||we(r,"error",{node:e},"NL.E0505")}checkNoFootnoteProperty(e,r){for(let n of e.properties)Ne(n)==="footnote"&&r("error",`Property "footnote:" is not valid on ${e_(e)}. Footnotes attach via "on:" on the footnote declaration \u2014 declare \`footnote <id> on:<target-id>\` instead.`,{node:n})}checkItemRequiredDuration(e,r){let n=e.properties.some(o=>Ne(o)==="duration"),i=e.properties.some(o=>Ne(o)==="size");!n&&!i&&we(r,"error",{node:e},"NL.E0600",{name:Vr(e)})}checkNoComputedProperties(e,r){for(let n of e.properties){let i=Ne(n);(i==="size"||i==="duration"||i==="remaining"||i==="capacity")&&r("error",`"${i}" is not valid on ${e.$type==="ParallelBlock"?"parallel":"group"} (computed from children).`,{node:n})}}checkParallelMinChildren(e,r){let n=e.content.filter(i=>!zT(i));n.length===0?r("error","Parallel block must contain at least 2 children.",{node:e}):n.length===1&&r("warning","Parallel block has only 1 child. Use at least 2 for parallel execution.",{node:e})}checkGroupMinChildren(e,r){e.content.filter(i=>!zT(i)).length===0&&r("error","Group must contain at least 1 child.",{node:e})}checkNoRawStyleProperties(e,r){for(let n of e.properties){let i=Ne(n);Vp.has(i)&&r("error",`Raw style property "${i}" is not allowed on ${e_(e)}. Declare a named style in config and reference it via "style:id".`,{node:n})}}checkUnknownEntityProperties(e,r){let n=rB[e.$type];if(!n)return;let i=e.$type==="ParallelBlock"||e.$type==="GroupBlock"?new Set(["size","duration","remaining","capacity"]):null;for(let o of e.properties){let s=Ne(o);if(n.has(s)||Qv.has(s)||Vp.has(s)||s==="footnote"||i?.has(s))continue;let a=[...n,...Qv],c=iB(s,a)??"";we(r,"warning",{node:o,property:"key"},"NL.W0700",{key:s,entity:e_(e),suggested:c})}}checkRoadmapProperties(e,r){}checkStylePropertyEnum(e,r){let n=Ne(e),i=e.value;if(n==="bg"||n==="fg"||n==="text")QT(i)||r("error",`Invalid color "${i}" for "${n}". Use a named color, hex value, or "none".`,{node:e,property:"value"});else if(n in Kp){let o=Kp[n];o.has(i)||r("error",`Invalid value "${i}" for "${n}". Allowed: ${[...o].join(", ")}.`,{node:e,property:"value"})}else Vp.has(n)||r("error",`Unknown style property "${n}".`,{node:e,property:"key"})}checkSizeDeclaration(e,r){e.properties.find(i=>Ne(i)==="effort")||r("error",`Size "${Vr(e)}" requires an "effort:" property.`,{node:e}),e.name&&(du.test(e.name)||cB.test(e.name))&&r("error",`Size id "${e.name}" collides with the raw duration pattern. Choose a different name (e.g. "xs", "small", "quarter").`,{node:e,property:"name"})}checkStatusDeclaration(e,r){e.name&&KT.has(e.name)&&r("error",`Status id "${e.name}" collides with the built-in status value. Built-ins: ${[...KT].join(", ")}.`,{node:e,property:"name"})}checkDuplicateSizeIds(e,r){let n=new Map;for(let i of e.roadmapEntries)if(Ha(i)&&i.name){let o=n.get(i.name);o?r("error",`Duplicate size id "${i.name}". First declared at ${Zp(o)}.`,{node:i,property:"name"}):n.set(i.name,i)}}checkUtilizationOrdering(e,r){if(Oi(e)&&e.entityType!=="swimlane")return;let n=e.properties.find(a=>Ne(a)==="utilization-warn-at"),i=e.properties.find(a=>Ne(a)==="utilization-over-at");if(!n||!i)return;let o=ik(n.value),s=ik(i.value);o===null||s===null||o>s&&r("error",`utilization-warn-at (${n.value}) must be \u2264 utilization-over-at (${i.value}). Warn fires below over; if both fire at the same point, the warn band collapses to zero.`,{node:n,property:"value"})}checkDefaultDeclaration(e,r){if(!Jv.has(e.entityType)){r("error",`"${e.entityType}" is not a supported entity type for default. Allowed: ${[...Jv].join(", ")}.`,{node:e,property:"entityType"});return}let n=e.$container,i=-1;for(let s=0;s<n.configEntries.length;s++){let a=n.configEntries[s];if(Oi(a)&&a.entityType===e.entityType){if(i<0)i=s;else if(a===e){r("error",`Duplicate "default ${e.entityType}" declaration. Only one is allowed per entity type per file.`,{node:e});break}}}let o=tB[e.entityType];if(o)for(let s of e.properties){let a=Ne(s);o.has(a)&&r("error",`"${a}" cannot be set on "default ${e.entityType}". Identity-defining, sizing, sequencing, reference, and prose properties must be explicit on each entity.`,{node:s})}}checkCalendarBlockConsistency(e,r){let n=e.configEntries.filter(Hp),o=e.roadmapDecl?.properties.find(s=>Ne(s)==="calendar")?.value;if(n.length>0&&o!=="custom")for(let s of n)r("error",'A "calendar" config block is only valid when the roadmap declares calendar:custom.',{node:s});if(o==="custom"&&n.length===0&&r("error",'calendar:custom requires a "calendar" config block with days-per-week, days-per-month, days-per-quarter, and days-per-year.',{node:e.roadmapDecl,property:"properties"}),o==="custom"&&n.length>0)for(let s of n){let a=new Set(s.properties.map(c=>Ne(c)));for(let c of ZT)a.has(c)||r("error",`calendar:custom requires "${c}" in the calendar config block.`,{node:s})}}checkCalendarBlock(e,r){let n=new Set;for(let i of e.properties){let o=Ne(i);if(!ZT.has(o)){r("error",`Unknown calendar property "${o}". Allowed: ${[...ZT].join(", ")}.`,{node:i,property:"key"});continue}n.has(o)&&r("error",`Duplicate calendar property "${o}".`,{node:i,property:"key"}),n.add(o),(!ek.test(i.value)||parseInt(i.value,10)<=0)&&r("error",`"${o}" must be a positive integer, got "${i.value}".`,{node:i,property:"value"})}}checkScaleBlock(e,r){let n=new Set;for(let i of e.properties){let o=Ne(i);if(!Zv.has(o)){r("error",`Unknown scale property "${o}". Allowed: ${[...Zv].join(", ")}.`,{node:i,property:"key"});continue}n.has(o)&&r("error",`Duplicate scale property "${o}".`,{node:i,property:"key"}),n.add(o),o==="label-every"&&(!ek.test(i.value)||parseInt(i.value,10)<=0)&&r("error",`"label-every" must be a positive integer, got "${i.value}".`,{node:i,property:"value"})}}checkForwardReferences(e,r){let n=new Map,i=new Map;for(let o=0;o<e.roadmapEntries.length;o++){let s=e.roadmapEntries[o];Ha(s)&&s.name?n.has(s.name)||n.set(s.name,o):lu(s)&&s.name&&(i.has(s.name)||i.set(s.name,o))}for(let o=0;o<e.roadmapEntries.length;o++){let s=e.roadmapEntries[o];ok(s,a=>{let c=Ne(a);if(c==="size"&&a.value){let l=a.value,u=n.get(l);u===void 0?r("error",`Size "${l}" is not declared. Add "size ${l} effort:<literal>" earlier in the roadmap section.`,{node:a,property:"value"}):u>=o&&r("error",`Size "${l}" is referenced before its declaration. Move "size ${l}" above this entity.`,{node:a,property:"value"})}else if(c==="status"&&a.value){let l=a.value;if(KT.has(l))return;let u=i.get(l);u===void 0?r("error",`Status "${l}" is not a built-in and has no declaration. Add "status ${l}" earlier in the roadmap section.`,{node:a,property:"value"}):u>=o&&r("error",`Status "${l}" is referenced before its declaration. Move "status ${l}" above this entity.`,{node:a,property:"value"})}})}}checkReferenceResolution(e,r){let n=yB(e),i=o=>{ok(o,s=>{let a=Ne(s);if(a!=="after"&&a!=="before"&&a!=="on")return;let c=s.value?[s.value]:s.values;for(let l of c)l&&((a==="after"||a==="before")&&Di.test(l)||n.has(l)||r("error",`${a}: reference "${l}" does not resolve to any declared entity in this file.`,{node:s}))})};for(let o of e.roadmapEntries)i(o)}checkInlineDatePins(e,r){let n=JT(e),i=o=>{let s=o.properties??[],a=gr(o)||Wr(o)||jr(o);for(let c of s){let l=Ne(c);if(l!=="after"&&l!=="before")continue;let f=(c.value?[c.value]:c.values).filter(d=>!!d&&Di.test(d));if(f.length!==0){if(!a){we(r,"error",{node:c},"NL.E0411",{key:l,type:pB(o)});continue}f.length>1&&we(r,"error",{node:c},"NL.E0410",{key:l});for(let d of f)switch(n.kind){case"invalid":continue;case"missing":we(r,"error",{node:c},"NL.E0412",{key:l,date:d});continue;case"valid":{let p=new Date(d);if(Number.isNaN(p.getTime()))continue;p<n.date&&we(r,"error",{node:c},"NL.E0413",{key:l,date:d,start:n.iso})}}}}if(qr(o))for(let c of o.content)i(c);else if(Wr(o)||jr(o))for(let c of o.content)i(c)};for(let o of e.roadmapEntries)i(o)}checkCircularDependencies(e,r){let n=new Map,i=(p,m)=>{n.has(p)||n.set(p,new Set),n.get(p).add(m)},o=(p,m,y)=>{if(p)for(let R of m){let T=Ne(R);if(T==="after"){let E=R.value?[R.value]:R.values;for(let _ of E)_&&(Di.test(_)||i(p,_))}else if(T==="before"){let E=R.value?[R.value]:R.values;for(let _ of E)_&&(Di.test(_)||i(_,p))}}},s=p=>{let m=p.name,y=p.properties??[];if(o(m,y,e),qr(p))for(let R of p.content)s(R);else if(Wr(p)||jr(p))for(let R of p.content)s(R)};for(let p of e.roadmapEntries)s(p);let a=0,c=1,l=2,u=new Map;for(let p of n.keys())u.set(p,a);let f=new Set,d=(p,m)=>{u.set(p,c),m.push(p);for(let y of n.get(p)??[]){let R=u.get(y)??a;if(R===c){let T=m.indexOf(y),E=m.slice(T).concat(y),_=[...E].sort().join("\u2192");f.has(_)||(f.add(_),r("error",`Circular dependency detected: ${E.join(" \u2192 ")}.`,{node:e.roadmapDecl??e}))}else R===a&&d(y,m)}m.pop(),u.set(p,l)};for(let p of n.keys())(u.get(p)??a)===a&&d(p,[])}checkPersonDeclarations(e,r){let n=new Map,i=a=>!!a.title||a.properties.length>0||a.description!==void 0,o=a=>{if(!a.name)return;let c=i(a);n.has(a.name)||n.set(a.name,[]),n.get(a.name).push({node:a,isDeclaration:c}),!c&&a.$container.$type==="NowlineFile"&&r("warning",`Bare "person ${a.name}" at roadmap top level has no declaration. Either add properties (title, link, etc.) or remove the line.`,{node:a})},s=a=>{for(let c of a.content)Li(c)?o(c):zr(c)&&s(c)};for(let a of e.roadmapEntries)Li(a)?o(a):zr(a)&&s(a);for(let[a,c]of n){let l=c.filter(u=>u.isDeclaration);if(l.length>1)for(let u=1;u<l.length;u++)r("error",`Person "${a}" is declared more than once. First declaration at ${Zp(l[0].node)}.`,{node:l[u].node})}}checkSymbolDeclaration(e,r){e.name&&Yp.has(e.name)&&r("error",`Symbol id "${e.name}" collides with a built-in icon name. Reserved built-ins: ${[...Yp].sort().join(", ")}.`,{node:e,property:"name"});let n=e.properties.find(o=>Ne(o)==="unicode");n?(!n.value||n.value.length===0)&&r("error",`Symbol "${Vr(e)}" unicode: must be a non-empty value.`,{node:n,property:"value"}):r("error",`Symbol "${Vr(e)}" requires a "unicode:" property (e.g. unicode:"\u{1F4B0}" or unicode:"\\u{1F464}").`,{node:e});let i=e.properties.find(o=>Ne(o)==="ascii");if(i){let o=i.value??"";uB.test(o)||r("error",`Symbol "${Vr(e)}" ascii: must be 1-3 ASCII characters (got ${o.length} character${o.length===1?"":"s"}).`,{node:i,property:"value"})}for(let o of e.properties){let s=Ne(o);s!=="unicode"&&s!=="ascii"&&s!=="link"&&s!=="description"&&r("error",`Unknown symbol property "${s}". Allowed: unicode, ascii, link, description.`,{node:o,property:"key"})}}checkDuplicateSymbolIds(e,r){let n=new Map;for(let i of e.configEntries)if(fu(i)&&i.name){let o=n.get(i.name);o?r("error",`Duplicate symbol id "${i.name}". First declared at ${Zp(o)}.`,{node:i,property:"name"}):n.set(i.name,i)}}checkSymbolReferences(e,r){let n=new Map;for(let o=0;o<e.configEntries.length;o++){let s=e.configEntries[o];fu(s)&&s.name&&(n.has(s.name)||n.set(s.name,o))}let i=(o,s,a,c)=>{if(s!=="icon"&&s!=="capacity-icon"||!a||!nk(a)||s==="capacity-icon"&&t_.has(a)||s==="icon"&&Yp.has(a))return;let l=n.get(a);if(l===void 0){let u=s==="capacity-icon"?[...t_].sort().join(", "):[...Yp].sort().join(", ");r("error",`${s}: "${a}" is neither a built-in (${u}) nor a declared symbol. Add "symbol ${a} unicode:..." earlier in config or use a quoted Unicode literal.`,{node:c,property:"value"})}else l>=o&&r("error",`${s}: symbol "${a}" is referenced before its declaration. Move "symbol ${a}" above this entry.`,{node:c,property:"value"})};for(let o=0;o<e.configEntries.length;o++){let s=e.configEntries[o];if(uu(s))for(let a of s.properties)i(o,Ne(a),a.value,a);else if(Oi(s))for(let a of s.properties)i(o,Ne(a),a.value,a)}}};function QT(t){return QU.has(t)||sB.test(t)}function nk(t){return/^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(t)}function hB(t){return t?qr(t)?"lane":gr(t)?"item":Oi(t)?t.entityType==="swimlane"?"lane":"item":"invalid":"invalid"}function mB(t){return t?!!(qr(t)||Oi(t)&&t.entityType==="swimlane"):!1}function ik(t){if(!t||t===sk)return null;if(r_.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?e/100:null}if(ak.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?e:null}return null}function Zp(t){let e=t.$cstNode;return e?`line ${e.range.start.line+1}`:"unknown location"}function e_(t){let e=t.$type.replace(/Declaration$|Block$/,"").toLowerCase(),r=t.name??t.title;return r?`${e} "${r}"`:e}function gB(t,e){if(qr(t)){e(t.name,t);for(let r of t.content)n_(r,e)}else Li(t)?e(t.name,t):zr(t)?lk(t,e):(Gp(t)||qp(t)||jp(t)||Wp(t)||Ha(t)||lu(t))&&e(t.name,t)}function lk(t,e){e(t.name,t);for(let r of t.content)zr(r)&&lk(r,e)}function n_(t,e){if(gr(t))e(t.name,t);else if(Wr(t)){e(t.name,t);for(let r of t.content)n_(r,e)}else if(jr(t)){e(t.name,t);for(let r of t.content)n_(r,e)}}function ok(t,e){let r=n=>{let i=n.properties;if(Array.isArray(i))for(let o of i)e(o);if(qr(n))for(let o of n.content)r(o);else if(Wr(n)||jr(n))for(let o of n.content)r(o);else if(zr(n))for(let o of n.content)(zr(o)||Li(o))&&r(o)};r(t)}function yB(t){let e=new Set;t.roadmapDecl?.name&&e.add(t.roadmapDecl.name);let r=n=>{let i=n.name;if(i&&e.add(i),qr(n))for(let o of n.content)r(o);else if(Wr(n)||jr(n))for(let o of n.content)r(o);else if(zr(n))for(let o of n.content)zr(o)||Li(o)?r(o):Sv(o)};for(let n of t.roadmapEntries)r(n);return e}var i_=class extends ko{runConverter(e,r,n){return e.name==="PROPERTY_KEY_WITH_COLON"||e.name==="INCLUDE_OPTION_KEY"?r.endsWith(":")?r.slice(0,-1):r:super.runConverter(e,r,n)}},o_=class extends va{isStartOfLine(e,r){if(!super.isStartOfLine(e,r))return!1;let n=r-1;for(;n>=0&&(e[n]===" "||e[n]===" ");)n--;for(;n>=0&&(e[n]==="\r"||e[n]===`
2663
- `);)n--;for(;n>=0&&(e[n]===" "||e[n]===" ");)n--;return n<0||e[n]!=="\\"}},uk={parser:{TokenBuilder:()=>new o_({indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[["[","]"]]}),Lexer:t=>new nu(t),ParserConfig:()=>({maxLookahead:4}),ValueConverter:()=>new i_},validation:{NowlineValidator:()=>new Jp}};function s_(t={}){let e=t.shared??Fo(tu(iu),Pv),r=Fo(eu({shared:e}),Cv,uk);return e.ServiceRegistry.register(r),ck(r),{shared:e,Nowline:r}}var xB=new Set(["none","multiplier","person","people","points","time"]),TB=/^\d+$/,_B=/^\d+\.\d+$/,EB=/^\d+(?:\.\d+)?%$/;function $i(t){if(!t)return null;if(TB.test(t)){let e=parseInt(t,10);return e>0?e:null}if(_B.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?e:null}if(EB.test(t)){let e=parseFloat(t.slice(0,-1))/100;return Number.isFinite(e)&&e>0?e:null}return null}function pu(t){if(Number.isInteger(t))return String(t);let e=t.toFixed(6);return e=e.replace(/0+$/,""),e=e.replace(/\.$/,""),e}function RB(t){return t.key.endsWith(":")?t.key.slice(0,-1):t.key}function bB(t){for(let e of t.properties)if(RB(e)==="unicode"&&e.value)return e.value}function hu(t,e){if(t==="none")return null;if(xB.has(t))return{kind:"builtin",name:t};let r=e.get(t);return r?{kind:"literal",text:bB(r)??t}:{kind:"literal",text:t}}function Xo(t,e,r){return e?e.kind==="builtin"&&e.name==="multiplier"?(t.length+1)*r*.58:t.length*r*.58+(.1+1)*r:t.length*r*.58}function mu(t,e,r,n=0,i=0){let o=t+10,s=o+12,a=e.length*6.5,c=s+a,l=0,u=0;r&&(l=`owner: ${r}`.length*5,u=c+6,c=u+l);let f=0;n>0&&(f=c+6,c=f+n);let d=0;i>0&&(d=c+6+i,c=d);let p=c-o+12,m=Math.max(56,p);return{titleTextWidth:a,ownerTextWidth:l,capacityBadgeWidth:n,footnoteIndicatorWidth:i,titleX:s,ownerX:u,badgeX:f,footnoteRightX:d,tabX:o,tabW:m,rightX:o+m}}function gu(t,e,r){let n=t+24,i=n+10,o=e.length*6,s=Math.max(60,o+10+10),a=n+s+6,c=a+18,l=0,u=0,f=0,d=0,p=c;return r&&(u=c+6,l=r.length*5.5,f=u-3,d=l+6,p=f+d),{labelTextWidth:o,sourceTextWidth:l,tabX:n,tabWidth:s,tabLabelX:i,badgeX:a,badgeSize:18,sourceHaloX:f,sourceHaloWidth:d,sourceTextX:u,chromeRightX:p}}function a_(t,e){if(t.length===0)return{rows:[[]],expanded:!1};let r=[[]],n=0,i=e,o=!1;for(let s of t){let a=r[r.length-1],c=(a.length===0?0:4)+s.width,l=n+c;if(l<=i){a.push(s),n=l;continue}if(a.length===0){a.push(s),n=s.width;continue}let u=l-i,f=s.width*.25;if(!o&&u<=f){a.push(s),n=l,i=l,o=!0;continue}r.push([s]),n=s.width,i=e}return{rows:r,expanded:o}}function fk(t){return t.endsWith(":")?t.slice(0,-1):t}function se(t,e){return t.find(r=>fk(r.key)===e)?.value}function yt(t,e){let r=t.find(n=>fk(n.key)===e);return r?r.value!==void 0?[r.value]:[...r.values]:[]}function Et(t){if(!t)return null;let e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);if(!e)return null;let r=new Date(Date.UTC(parseInt(e[1],10),parseInt(e[2],10)-1,parseInt(e[3],10)));return Number.isNaN(r.getTime())?null:r}var ja={mode:"business",daysPerWeek:5,daysPerMonth:22,daysPerQuarter:65,daysPerYear:260},wB={mode:"full",daysPerWeek:7,daysPerMonth:30,daysPerQuarter:91,daysPerYear:365};function dk(t,e){let n=t.roadmapDecl?.properties.find(i=>c_(i.key)==="calendar")?.value??"business";if(n==="business")return{...ja};if(n==="full")return{...wB};if(e){let i=(o,s)=>{let a=e.properties.find(l=>c_(l.key)===o),c=a?parseInt(a.value,10):NaN;return Number.isFinite(c)&&c>0?c:s};return{mode:"custom",daysPerWeek:i("days-per-week",ja.daysPerWeek),daysPerMonth:i("days-per-month",ja.daysPerMonth),daysPerQuarter:i("days-per-quarter",ja.daysPerQuarter),daysPerYear:i("days-per-year",ja.daysPerYear)}}return{...ja}}var Qp=/^(\d+(?:\.\d+)?)([dwmqy])$/;function eh(t,e){let r=Qp.exec(t);if(!r)return 0;let n=parseFloat(r[1]);switch(r[2]){case"d":return n;case"w":return n*e.daysPerWeek;case"m":return n*e.daysPerMonth;case"q":return n*e.daysPerQuarter;case"y":return n*e.daysPerYear;default:return 0}}function pk(t,e,r){return t?Qp.test(t)?eh(t,r):e.get(t)?.effortDays??0:0}function Mi(t,e,r){let n=se(t,"duration");if(n&&Qp.test(n))return eh(n,r);let i=se(t,"size"),o=i?e.get(i):void 0;if(!o)return 0;let s=$i(se(t,"capacity"))??1;return o.effortDays/s}function hk(t,e,r){let n=se(t,"size"),i=n?e.get(n):void 0;if(i)return i.effortDays;let o=se(t,"duration");if(o&&Qp.test(o)){let s=$i(se(t,"capacity"))??1;return eh(o,r)*s}return 0}function th(t,e){let r=new Map;for(let[n,i]of t){let s=i.properties.find(c=>c_(c.key)==="effort")?.value;if(!s)continue;let a=eh(s,e);a<=0||r.set(n,{name:n,title:i.title||void 0,effortDays:a,effortLiteral:s})}return r}function c_(t){return t.endsWith(":")?t.slice(0,-1):t}function vr(t,e){return Math.round((e.getTime()-t.getTime())/864e5)}function Go(t,e){let r=new Date(t.getTime());return r.setUTCDate(r.getUTCDate()+e),r}var rh=class{constructor(e){le(this,"items");le(this,"brackets");this.items=e.itemBars,this.brackets=e.brackets}hasObstacle(e,r,n){let i=Math.min(r,n),o=Math.max(r,n);for(let s of this.items)if(!(e<=s.x||e>=s.x+s.width)&&!(s.y+s.height<=i||s.y>=o))return!0;return!1}bracketsNear(e,r,n,i){let o=Math.min(r,n),s=Math.max(r,n),a=[];for(let c of this.brackets)Math.abs(c.x-e)>i||c.yBottom<=o||c.yTop>=s||a.push(c);return a}};function mk(t,e){let r=[],n=[],i=s=>{if(s.kind==="item"){r.push(s.box);return}if(s.kind==="parallel"){if(s.style.bracket==="solid"||s.style.bracket==="dashed"){let l=s.box.y-12,u=s.box.y+s.box.height+12,f=s.box.x,d=s.box.x+s.box.width;n.push({x:f,yTop:l,yBottom:u}),n.push({x:d,yTop:l,yBottom:u}),n.push({x:f+4,yTop:l-1,yBottom:l+1}),n.push({x:f+4,yTop:u-1,yBottom:u+1}),n.push({x:d-4,yTop:l-1,yBottom:l+1}),n.push({x:d-4,yTop:u-1,yBottom:u+1})}for(let a of s.children)i(a);return}if(s.kind==="group"){!(s.style.bg!=="none"&&s.style.bg!=="#ffffff")&&s.style.bracket&&s.style.bracket!=="none"&&n.push({x:s.box.x,yTop:s.box.y,yBottom:s.box.y+s.box.height});for(let c of s.children)i(c);return}},o=s=>{for(let a of s.children)i(a);for(let a of s.nested)o(a)};for(let s of t)o(s);for(let s of e)for(let a of s.nestedSwimlanes)o(a);return{itemBars:r,brackets:n}}function AB(t,e){let{from:r,to:n}=t;if(Math.abs(r.y-n.y)<.5)return{x:(r.x+n.x)/2,underBar:!1,range:null};let i=Math.min(r.y,n.y),o=Math.max(r.y,n.y);if(r.x<=n.x){let a=r.x+6,c=n.x-6;if(a>c)return{x:n.x-6,underBar:!0,range:null};let l={minX:a,maxX:c},u=(r.x+n.x)/2,f=Math.max(a,Math.min(c,u));if(!e.hasObstacle(f,i,o))return{x:f,underBar:!1,range:l};let d=c-a;for(let p=1;p<=d;p++){let m=f-p;if(m>=a&&!e.hasObstacle(m,i,o))return{x:m,underBar:!1,range:l};let y=f+p;if(y<=c&&!e.hasObstacle(y,i,o))return{x:y,underBar:!1,range:l}}return{x:f,underBar:!0,range:l}}let s=[r.x+10,n.x-10];for(let a of s)if(a>0&&!e.hasObstacle(a,i,o))return{x:a,underBar:!1,range:null};return{x:r.x+10,underBar:!0,range:null}}function IB(t,e,r,n){let i=Math.min(r.from.y,r.to.y),o=Math.max(r.from.y,r.to.y),s=n.bracketsNear(t,i,o,4);if(s.length===0)return{x:t,forceUnderBar:!1};let a=s[0],c=Math.abs(s[0].x-t);for(let d=1;d<s.length;d++){let p=Math.abs(s[d].x-t);p<c&&(a=s[d],c=p)}let l=[a.x+4,a.x-4],u=4-.01;for(let d of l){if(e&&(d<e.minX||d>e.maxX))continue;let p=e?d:Math.max(Math.min(r.from.x,r.to.x)+1,Math.min(Math.max(r.from.x,r.to.x)-1,d));if(n.bracketsNear(p,i,o,u).length===0)return{x:p,forceUnderBar:!1}}return{x:e?Math.min(Math.max(t,e.minX),e.maxX):t,forceUnderBar:!0}}function SB(t){let e=[...t].sort((i,o)=>Math.abs(i.channelX-o.channelX)>=1?i.channelX-o.channelX:i.orderIndex-o.orderIndex),r=new Map,n=0;for(;n<e.length;){let i=n+1;for(;i<e.length&&Math.abs(e[i].channelX-e[n].channelX)<1;)i++;let s=[...e.slice(n,i)].sort((c,l)=>{let u=Math.min(c.req.from.y,c.req.to.y),f=Math.min(l.req.from.y,l.req.to.y);return Math.abs(u-f)>.5?u-f:c.orderIndex-l.orderIndex}),a=[];for(let c of s){let l=Math.min(c.req.from.y,c.req.to.y),u=Math.max(c.req.from.y,c.req.to.y),f=-1;for(let d=0;d<a.length;d++)if(a[d]<=l){f=d,a[d]=u;break}f===-1&&(f=a.length,a.push(u)),r.set(c.orderIndex,f)}n=i}return r}function vB(t){if(t===0||t>4)return 0;let e=Math.ceil(t/2);return(t%2===1?1:-1)*e*3}function kB(t){let e=t.from.x>=t.to.x?{x:t.to.x-1,y:t.from.y}:t.from;return{fromId:t.fromId,toId:t.toId,waypoints:[e,t.to],underBar:!1}}function gk(t,e){let r=new Array(t.length),n=[];for(let o=0;o<t.length;o++){let s=t[o];if(s.isMarkerSource){r[o]=kB(s);continue}if(Math.abs(s.from.y-s.to.y)<.5&&s.to.x-s.from.x<20){r[o]={fromId:s.fromId,toId:s.toId,waypoints:[s.from,s.to],underBar:!1};continue}let{x:a,underBar:c,range:l}=AB(s,e),{x:u,forceUnderBar:f}=IB(a,l,s,e),d=c||f;n.push({req:s,channelX:u,underBar:d,orderIndex:o})}let i=SB(n);for(let o of n){let s=vB(i.get(o.orderIndex)??0),a=o.channelX+s;r[o.orderIndex]={fromId:o.req.fromId,toId:o.req.toId,waypoints:NB(o.req.from,o.req.to,a),underBar:o.underBar}}return r}function NB(t,e,r){return Math.abs(t.y-e.y)<.5?[t,e]:[t,{x:r,y:t.y},{x:r,y:e.y},e]}var yu="en-US",PB={"en-US":{nowLabel:"now",quarterPrefix:"Q"},fr:{nowLabel:"maint.",quarterPrefix:"T"}};function yk(t,e){return e??t??yu}function nh(t){let e={};for(let r of CB(t)){let n=PB[r];if(n)for(let i of Object.keys(n))e[i]===void 0&&n[i]!==void 0&&(e[i]=n[i])}return e}function CB(t){let e=[],r=OB(t);for(;r.length>0;){e.includes(r)||e.push(r);let n=r.lastIndexOf("-");if(n<=0)break;r=r.slice(0,n)}return e.includes(yu)||e.push(yu),e}function OB(t){return t.split("-").map((r,n)=>n===0?r.toLowerCase():/^[a-zA-Z]{2}$/.test(r)?r.toUpperCase():r).join("-")}function Ek(t){let{box:e,afterDate:r,beforeDate:n,hasLinkIcon:i,footnoteCount:o}=t;if(!r&&!n)return[];let s=[],a=12,c=e.y+5,l=e.width<40;if(r){let u=i?e.x+6+14+4:e.x+6,f=l?{x:e.x-6-a,y:c}:{x:u,y:c};s.push({side:"after",isoDate:r,glyphTopLeft:f,glyphSize:a,spilled:l})}if(n){let u=e.x+e.width,f;o>0?f=u-22-(o-1)*8-4:f=u-12-5-4;let d=f-a,p=l?{x:u+6,y:c}:{x:d,y:c};s.push({side:"before",isoDate:n,glyphTopLeft:p,glyphSize:a,spilled:l})}return s}function oh(t){let{box:e,afterDate:r,beforeDate:n}=t;if(!r&&!n)return[];let i=[],o=12,s=e.y+5;return r&&i.push({side:"after",isoDate:r,glyphTopLeft:{x:e.x+6,y:s},glyphSize:o,spilled:!1}),n&&i.push({side:"before",isoDate:n,glyphTopLeft:{x:e.x+e.width-6-o,y:s},glyphSize:o,spilled:!1}),i}function Hn(t){for(let e of t)if(/^\d{4}-\d{2}-\d{2}$/.test(e))return e}function sh(t,e){return{x:t,y:e,height:0,maxX:t}}var za=class{constructor(e){le(this,"rows");le(this,"opts");this.opts=e,this.rows=[{y:e.originY,height:e.minRowHeight,rightEdge:e.laneLeftX,spillX:e.laneLeftX,placedChildren:[]}]}placeItem(e){for(let n=0;n<this.rows.length;n+=1){let i=this.rows[n];if(!(e.desiredStart<i.rightEdge)&&!(e.desiredStart<i.spillX)&&!this.rowIntersectsCorridor(i,e))return{rowIndex:n,y:i.y}}let r=this.appendRow(Math.max(this.opts.minRowHeight,e.predictedHeight));return{rowIndex:this.rows.length-1,y:r.y}}placeBlock(){let e=this.rows[this.rows.length-1];if(e.rightEdge>this.opts.laneLeftX){let r=this.appendRow(this.opts.minRowHeight);return{rowIndex:this.rows.length-1,y:r.y}}return{rowIndex:this.rows.length-1,y:e.y}}commitItem(e){let r=this.rows[e.rowIndex],n=Math.max(e.placed.box.height,e.rowHeight??0);this.growRowHeight(e.rowIndex,n),r.rightEdge=e.logicalEnd,r.spillX=e.spillReservation??this.opts.laneLeftX,r.placedChildren.push(e.placed)}commitBlock(e){let r=this.rows[e.rowIndex];this.growRowHeight(e.rowIndex,e.blockHeight),r.rightEdge=e.blockEnd,r.spillX=this.opts.laneLeftX,r.placedChildren.push(e.placed)}usedHeight(){let e=this.rows[this.rows.length-1];return e.y+e.height-this.opts.originY}usedRightX(){let e=this.opts.laneLeftX;for(let r of this.rows)r.rightEdge>e&&(e=r.rightEdge),r.spillX>e&&(e=r.spillX);return e}rowIntersectsCorridor(e,r){return this.opts.slackCorridors.some(n=>n.y>=e.y&&n.y<e.y+e.height&&r.desiredStart<n.xEnd&&r.desiredEnd>n.xStart&&n.slackPredId!==r.childId)}appendRow(e){let r=this.rows[this.rows.length-1],n={y:r.y+r.height,height:e,rightEdge:this.opts.laneLeftX,spillX:this.opts.laneLeftX,placedChildren:[]};return this.rows.push(n),n}growRowHeight(e,r){let n=this.rows[e],i=r-n.height;if(!(i<=0)){n.height=r;for(let o=e+1;o<this.rows.length;o+=1){let s=this.rows[o];s.y+=i;for(let a of s.placedChildren)Rk(a,i)}}}};function Rk(t,e){if(t.box.y+=e,t.kind==="item"){for(let r of t.labelChips)r.box.y+=e;t.overflowBox&&(t.overflowBox.y+=e);return}for(let r of t.children)Rk(r,e)}var bk={red:"#f87171",blue:"#60a5fa",yellow:"#facc15",green:"#34d399",orange:"#fb923c",purple:"#a78bfa",gray:"#94a3b8",navy:"#818cf8",white:"#e2e8f0"},jn={bg:"none",fg:"#e2e8f0",text:"#e2e8f0",border:"solid",icon:"none",shadow:"none",font:"sans",weight:"normal",italic:!1,textSize:"md",padding:"sm",spacing:"sm",headerHeight:"sm",cornerRadius:"sm",bracket:"none",capacityIcon:"multiplier"},wk={name:"dark",surface:{page:"#0b1220",chart:"#111827",headerBox:"#1e293b"},entities:{roadmap:{...jn,headerHeight:"md",padding:"md"},swimlane:{...jn,fg:"#e2e8f0",text:"#e2e8f0",padding:"sm",spacing:"none",textSize:"sm"},item:{...jn,bg:"#0f172a",fg:"#94a3b8",text:"#e2e8f0",shadow:"subtle",cornerRadius:"sm"},parallel:{...jn,bracket:"none",padding:"xs"},group:{...jn,bracket:"solid",padding:"xs",fg:"#94a3b8"},anchor:{...jn,bg:"#0b1220",fg:"#cbd5e1",text:"#cbd5e1",cornerRadius:"sm"},milestone:{...jn,bg:"#e2e8f0",fg:"#e2e8f0",text:"#0b1220",border:"solid"},footnote:{...jn,bg:"none",fg:"#94a3b8",text:"#e2e8f0",textSize:"sm"},label:{...jn,bg:"#1e293b",fg:"#94a3b8",text:"#e2e8f0",textSize:"xs",padding:"xs",cornerRadius:"full"}},swimlane:{bandEven:"#111827",bandOdd:"#0f172a",separator:"#1f2937",frameTabText:"#e2e8f0",frameTabMuted:"#94a3b8",border:"#334155",tabFill:"#1e293b",tabStroke:"#475569",tabText:"#e2e8f0",ownerText:"#94a3b8",footnoteIndicator:"#f87171",rowTintEven:"#0f172a",rowTintOdd:"#1e293b",utilizationOk:"#34d399",utilizationWarn:"#fbbf24",utilizationOver:"#f87171"},timeline:{gridLine:"#475569",minorGridLine:"#334155",tickMark:"#334155",labelText:"#cbd5e1",panelFill:"#0f172a",border:"#334155"},header:{cardBorder:"#475569",author:"#94a3b8"},item:{overflowX:"#f87171",linkIconFg:"#94a3b8",overflowTailFill:"#7f1d1d",overflowTailStroke:"#f87171",overflowCaption:"#fecaca"},parallel:{bracketStroke:"#cbd5e1"},anchorDiamond:{fill:"#0f172a",stroke:"#cbd5e1",label:"#cbd5e1",cutLine:"#94a3b8"},milestoneDiamond:{fill:"#e2e8f0",label:"#e2e8f0",cutLineNormal:"#a5b4fc",cutLineOverrun:"#ef4444",slack:"#cbd5e1"},footnotePanel:{fill:"#0f172a",border:"#334155",header:"#e2e8f0",title:"#e2e8f0",description:"#94a3b8",number:"#f87171"},nowline:{stroke:"#f87171",labelText:"#0b1220",labelBg:"#f87171"},milestone:{dashedInk:"#a5b4fc",overrun:"#ef4444"},anchor:{predecessorLine:"#94a3b8"},dependency:{edgeStroke:"#cbd5e1",overflowStroke:"#ef5350"},footnote:{indicatorText:"#f87171",descriptionMuted:"#94a3b8"},includeRegion:{border:"#475569",label:"#cbd5e1",badge:"#94a3b8",fill:"#0b1220",tabFill:"#111827",tabStroke:"#475569",tabText:"#e2e8f0",badgeFill:"#1e293b",badgeStroke:"#475569",badgeText:"#94a3b8"},arrowhead:{neutral:"#94a3b8",light:"#64748b",dark:"#e2e8f0"},status:{done:"#34d399",inProgress:"#60a5fa",atRisk:"#facc15",blocked:"#ef4444",planned:"#94a3b8",neutral:"#94a3b8"},statusDot:{onLight:{done:"#065f46",inProgress:"#1e3a8a",atRisk:"#92400e",blocked:"#991b1b",planned:"#334155",neutral:"#334155"},onDark:{done:"#d1fae5",inProgress:"#dbeafe",atRisk:"#fef3c7",blocked:"#fee2e2",planned:"#e2e8f0",neutral:"#e2e8f0"}},attribution:{mark:"#cbd5e1",link:"#f87171"},diagnostic:{overlayBg:"#7f1d1d",errorText:"#fecaca"}};var Ak={red:"#e53935",blue:"#1e88e5",yellow:"#fdd835",green:"#43a047",orange:"#fb8c00",purple:"#8e24aa",gray:"#9e9e9e",navy:"#0d47a1",white:"#ffffff"},Wn={bg:"none",fg:"#0f172a",text:"#0f172a",border:"solid",icon:"none",shadow:"none",font:"sans",weight:"normal",italic:!1,textSize:"md",padding:"sm",spacing:"sm",headerHeight:"sm",cornerRadius:"sm",bracket:"none",capacityIcon:"multiplier"},Ik={name:"light",surface:{page:"#f8fafc",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...Wn,headerHeight:"md",padding:"md"},swimlane:{...Wn,fg:"#334155",text:"#334155",padding:"sm",spacing:"none",textSize:"sm"},item:{...Wn,bg:"#ffffff",fg:"#94a3b8",text:"#0f172a",shadow:"subtle",cornerRadius:"sm"},parallel:{...Wn,bracket:"none",padding:"xs"},group:{...Wn,bracket:"solid",padding:"xs",fg:"#475569"},anchor:{...Wn,bg:"#0f172a",fg:"#0f172a",text:"#0f172a",cornerRadius:"sm"},milestone:{...Wn,bg:"#312e81",fg:"#312e81",text:"#ffffff",border:"solid"},footnote:{...Wn,bg:"none",fg:"#475569",text:"#475569",textSize:"sm"},label:{...Wn,bg:"#f1f5f9",fg:"#475569",text:"#475569",textSize:"xs",padding:"xs",cornerRadius:"full"}},swimlane:{bandEven:"#ffffff",bandOdd:"#f8fafc",separator:"#e2e8f0",frameTabText:"#334155",frameTabMuted:"#64748b",border:"#e2e8f0",tabFill:"#f1f5f9",tabStroke:"#cbd5e1",tabText:"#334155",ownerText:"#64748b",footnoteIndicator:"#dc2626",rowTintEven:"#ffffff",rowTintOdd:"#f8fafc",utilizationOk:"#10b981",utilizationWarn:"#f59e0b",utilizationOver:"#ef4444"},timeline:{gridLine:"#cbd5e1",minorGridLine:"#e2e8f0",tickMark:"#cbd5e1",labelText:"#64748b",panelFill:"#ffffff",border:"#e2e8f0"},header:{cardBorder:"#e2e8f0",author:"#64748b"},item:{overflowX:"#dc2626",linkIconFg:"#0f172a",overflowTailFill:"#fee2e2",overflowTailStroke:"#ef4444",overflowCaption:"#b91c1c"},parallel:{bracketStroke:"#334155"},anchorDiamond:{fill:"#ffffff",stroke:"#334155",label:"#334155",cutLine:"#64748b"},milestoneDiamond:{fill:"#0f172a",label:"#0f172a",cutLineNormal:"#1e1b4b",cutLineOverrun:"#b91c1c",slack:"#0f172a"},footnotePanel:{fill:"#ffffff",border:"#e2e8f0",header:"#0f172a",title:"#0f172a",description:"#64748b",number:"#dc2626"},nowline:{stroke:"#e53e3e",labelText:"#ffffff",labelBg:"#e53e3e"},milestone:{dashedInk:"#94a3b8",overrun:"#ef4444"},anchor:{predecessorLine:"#94a3b8"},dependency:{edgeStroke:"#475569",overflowStroke:"#d32f2f"},footnote:{indicatorText:"#e53e3e",descriptionMuted:"#64748b"},includeRegion:{border:"#94a3b8",label:"#334155",badge:"#64748b",fill:"#f8fafc",tabFill:"#ffffff",tabStroke:"#cbd5e1",tabText:"#0f172a",badgeFill:"#e2e8f0",badgeStroke:"#cbd5e1",badgeText:"#475569"},arrowhead:{neutral:"#475569",light:"#94a3b8",dark:"#0f172a"},status:{done:"#10b981",inProgress:"#3b82f6",atRisk:"#f59e0b",blocked:"#ef4444",planned:"#94a3b8",neutral:"#94a3b8"},statusDot:{onLight:{done:"#065f46",inProgress:"#1e3a8a",atRisk:"#92400e",blocked:"#991b1b",planned:"#334155",neutral:"#334155"},onDark:{done:"#d1fae5",inProgress:"#dbeafe",atRisk:"#fef3c7",blocked:"#fee2e2",planned:"#e2e8f0",neutral:"#e2e8f0"}},attribution:{mark:"#94a3b8",link:"#e53e3e"},diagnostic:{overlayBg:"#fee2e2",errorText:"#991b1b"}};var Sk={light:Ik,dark:wk};var MB={grey:"gray",violet:"purple"};function Ho(t,e){if(t==="none")return"none";if(t.startsWith("#"))return t;let r=e.name==="dark"?bk:Ak,n=MB[t]??t,i=r[n];return typeof i=="string"?i:t}function Va(t){return t.key.endsWith(":")?t.key.slice(0,-1):t.key}function FB(t,e){return{bg:Ho(t.bg,e),fg:Ho(t.fg,e),text:Ho(t.text,e),border:t.border,icon:t.icon,shadow:t.shadow,font:t.font,weight:t.weight,italic:t.italic,textSize:t.textSize,padding:t.padding,spacing:t.spacing,headerHeight:t.headerHeight,cornerRadius:t.cornerRadius,bracket:t.bracket,headerPosition:"beside",capacityIcon:t.capacityIcon,timelinePosition:"top",minorGrid:!1}}function l_(t,e,r,n){switch(e){case"bg":t.bg=Ho(r,n);break;case"fg":t.fg=Ho(r,n);break;case"text":t.text=Ho(r,n);break;case"border":(r==="solid"||r==="dashed"||r==="dotted")&&(t.border=r);break;case"icon":t.icon=r;break;case"shadow":(r==="none"||r==="subtle"||r==="soft"||r==="hard")&&(t.shadow=r);break;case"font":(r==="sans"||r==="serif"||r==="mono")&&(t.font=r);break;case"weight":(r==="thin"||r==="light"||r==="normal"||r==="bold")&&(t.weight=r);break;case"italic":t.italic=r==="true";break;case"text-size":t.textSize=_u(r,"xl");break;case"padding":t.padding=_u(r,"xl");break;case"spacing":t.spacing=_u(r,"xl");break;case"header-height":t.headerHeight=_u(r,"xl");break;case"corner-radius":t.cornerRadius=_u(r,"full");break;case"bracket":(r==="none"||r==="solid"||r==="dashed")&&(t.bracket=r);break;case"header-position":(r==="beside"||r==="above")&&(t.headerPosition=r);break;case"capacity-icon":t.capacityIcon=r;break;case"timeline-position":(r==="top"||r==="bottom"||r==="both")&&(t.timelinePosition=r);break;case"minor-grid":t.minorGrid=r==="true";break;default:break}}function _u(t,e){let r=["none","xs","sm","md","lg","xl","full"],n=r.indexOf(e),i=r.indexOf(t);return i<0?"md":i>n?r[n]:r[i]}function vk(t,e,r){if(e)for(let n of e.properties)l_(t,Va(n),n.value,r)}function UB(t,e,r){for(let n of e){let i=Va(n);n.value!==void 0&&l_(t,i,n.value,r)}}function BB(t,e,r){let n=e.find(o=>Va(o)==="labels");if(!n)return;let i=n.value?[n.value]:n.values;for(let o of i){let s=r.labels.get(o);if(!s)continue;let a=s.properties.find(c=>Va(c)==="style");a?.value&&vk(t,r.styles.get(a.value),r.theme)}}function XB(t,e,r){let n=e.find(i=>Va(i)==="style");n?.value&&vk(t,r.styles.get(n.value),r.theme)}function xt(t,e,r){let n=r.theme.entities[t],i=FB(n,r.theme),o=r.defaults.get(t);if(o)for(let s of o.properties)s.value!==void 0&&l_(i,Va(s),s.value,r.theme);return BB(i,e,r),XB(i,e,r),UB(i,e,r.theme),i}function kk(t,e){return xt("label",t.properties,e)}var Nk={none:0,xs:2,sm:4,md:8,lg:16,xl:24},Pk={none:0,xs:4,sm:8,md:12,lg:20,xl:32};var Ya={none:0,xs:10,sm:12,md:14,lg:18,xl:24},ah={none:0,xs:2,sm:4,md:8,lg:12,xl:20,full:9999};var kr=8,Tn=4,Eu=24,ch=15,Ru=8,lh=22,uh=15,bu=16,fh=6,u_=4,f_=11,d_=9,p_=5.5,h_=4,Ka=12,dh="6 4",m_=36,Fi=16,g_=Fi/2,wu=10,y_=Fi-4,Za=6,ph=2.25,Yr=6,Kr=2*Yr,Ck=5,Ok=120,x_=240,hh=72,Au=28,Zr=16,T_=22,Iu=18,mh="Powered by",__="https://nowline.io",Su=.22,Ui=40,gh=32,Lk=.58,GB=mh.length*gh*Lk,HB=10,vu=GB+HB,E_=vu+74,R_=5,yh=vu+81,jB=3*Ui*Lk,WB=yh+jB,qB=12+Ui,b_=WB*Su,Dk=qB*Su,w_=4;var He={sans:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',serif:'Georgia, "Times New Roman", serif',mono:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"},$k={days:7,weeks:4,months:3,quarters:4,years:5};var xh=class{constructor(e,r){le(this,"node");le(this,"deps");this.node=e,this.deps=r}get id(){return this.node.name??""}place(e,r){let{node:n}=this,{deps:i}=this,o=xt("group",n.properties,r.styleCtx),s=e.x,a=n.title??n.name,c=r.currentFlowKey;r.currentFlowKey=`${c}/group:${n.name??"g"}`;let l=o.bg!=="none"&&o.bg!=="#ffffff"&&!!a,u=l?bu+u_:0,f=l?h_:0,d=!l&&a?Ka:0,p=e.y+d,m=r.bandScale.step(),y=s,R=new za({laneLeftX:y,originY:p+u,minRowHeight:m,slackCorridors:r.slackCorridors}),T=y,E=[];for(let ie of n.content){if(ie.$type==="DescriptionDirective")continue;if(!gr(ie)){let pe=ie.properties??[],it=i.resolveChildStart(pe,T,y,r),{rowIndex:We,y:Ye}=R.placeBlock(),G=i.newCursor(it,Ye),Z=i.sequenceOne(ie,G,r);E.push(Z);let ee=Z.box.x+Z.box.width,P=Math.max(m,G.height);R.commitBlock({rowIndex:We,placed:Z,blockHeight:P,blockEnd:ee}),T=Math.max(T,ee);continue}let Ae=ie.properties,O=i.resolveChildStart(Ae,T,y,r),w=Mi(Ae,r.sizes,r.cal),L=Math.max(kr,w*r.timeline.pixelsPerDay),M=O+L,A=ie.name??"",I=i.predictItemChipExtraHeight(ie,r),S=m+I,{rowIndex:B,y:H}=R.placeItem({childId:A,desiredStart:O,desiredEnd:M,predictedHeight:S}),$=i.newCursor(O,H),q=i.sequenceItem(ie,$,r);E.push(q);let K=q.box.x+q.box.width+Yr;T=Math.max(T,K);let xe=null;(q.textSpills||q.chipsOutside||q.dotSpills||q.iconSpills||q.footnoteSpills)&&(xe=Math.max(q.decorationsRightX,q.chipsOutside?q.chipsRightX:0)+6),R.commitItem({rowIndex:B,placed:q,logicalEnd:K,spillReservation:xe,rowHeight:S})}let _=Math.max(m,R.usedHeight()),k=Math.max(T,R.usedRightX()),D={x:s,y:p,width:k-s,height:u+_+f};e.x=T+Ru,e.maxX=Math.max(e.maxX,e.x);let C=r.bandScale.step()-r.bandScale.bandwidth();e.height=Math.max(e.height,d+D.height+C);let j=n.name;j&&(r.entityLeftEdges.set(j,D.x),r.entityRightEdges.set(j,D.x+D.width)),r.currentFlowKey=c;let V=oh({box:D,afterDate:Hn(yt(n.properties,"after")),beforeDate:Hn(yt(n.properties,"before"))});return{kind:"group",id:j,title:a,box:D,children:E,style:o,inlineDatePins:V.length>0?V:void 0}}};var A_=12,zB=4,VB=13,YB=11;function Mk(t,e){return t.length*e*.58}var Th=class{constructor(e){le(this,"input");this.input=e}get id(){return this.input.id}measure(e){return{width:Math.max(kr,this.input.logicalRightX-this.input.logicalLeftX),height:e.bands.bandwidth()}}place(e,r){let n=this.measure(r),i=Math.max(kr,n.width-2*Yr),o=e.x+Yr,s={x:o,y:e.y,width:i,height:n.height},a=this.input.hasLinkIcon?20+KB-A_:0,c=A_+Math.max(0,a),l=Math.max(0,i-c-A_),u=this.input.title,f=u?Mk(u,VB):0,d=this.input.metaText?Mk(this.input.metaText,YB):0,p=this.input.metaTrailingWidth??0,m=d+p,y=this.input.metaText!==void 0||p>0,R=u.length>0&&f>l||y&&m>l,T=R?o+i+zB:o+c;return{id:this.input.id,box:s,textX:T,textSpills:R}}},KB=4;var _h=class{constructor(e,r){le(this,"node");le(this,"deps");this.node=e,this.deps=r}get id(){return this.node.name??""}place(e,r){let{node:n}=this,{deps:i}=this,o=xt("parallel",n.properties,r.styleCtx),s=e.x,a=e.y,c=[],l=s,u=0,f=r.currentFlowKey,d=n.name??"p",p=0;for(let T of n.content){if(T.$type==="DescriptionDirective")continue;r.currentFlowKey=`${f}/par:${d}#${p}`;let E=i.newCursor(s,a+u),_=i.sequenceOne(T,E,r);c.push(_),u+=Math.max(r.bandScale.step(),E.height),l=Math.max(l,E.maxX),p++}r.currentFlowKey=f;let m={x:s,y:a,width:l-s,height:u};e.x=l+Ru,e.maxX=Math.max(e.maxX,e.x),e.height=Math.max(e.height,u);let y=n.name;y&&(r.entityLeftEdges.set(y,m.x),r.entityRightEdges.set(y,m.x+m.width));let R=oh({box:m,afterDate:Hn(yt(n.properties,"after")),beforeDate:Hn(yt(n.properties,"before"))});return{kind:"parallel",id:y,title:n.title??n.name,box:m,children:c,style:o,inlineDatePins:R.length>0?R:void 0}}};function jo(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function I_(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Wo(t){let e,r,n;t.length!==2?(e=jo,r=(a,c)=>jo(t(a),c),n=(a,c)=>t(a)-c):(e=t===jo||t===I_?t:ZB,r=t,n=t);function i(a,c,l=0,u=a.length){if(l<u){if(e(c,c)!==0)return u;do{let f=l+u>>>1;r(a[f],c)<0?l=f+1:u=f}while(l<u)}return l}function o(a,c,l=0,u=a.length){if(l<u){if(e(c,c)!==0)return u;do{let f=l+u>>>1;r(a[f],c)<=0?l=f+1:u=f}while(l<u)}return l}function s(a,c,l=0,u=a.length){let f=i(a,c,l,u-1);return f>l&&n(a[f-1],c)>-n(a[f],c)?f-1:f}return{left:i,center:s,right:o}}function ZB(){return 0}function S_(t){return t===null?NaN:+t}var Fk=Wo(jo),Uk=Fk.right,JB=Fk.left,QB=Wo(S_).center,v_=Uk;var Ja=class extends Map{constructor(e,r=r2){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(let[n,i]of e)this.set(n,i)}get(e){return super.get(Bk(this,e))}has(e){return super.has(Bk(this,e))}set(e,r){return super.set(e2(this,e),r)}delete(e){return super.delete(t2(this,e))}};function Bk({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):r}function e2({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function t2({_intern:t,_key:e},r){let n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function r2(t){return t!==null&&typeof t=="object"?t.valueOf():t}var n2=Math.sqrt(50),i2=Math.sqrt(10),o2=Math.sqrt(2);function Xk(t,e,r){let n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),o=n/Math.pow(10,i),s=o>=n2?10:o>=i2?5:o>=o2?2:1,a,c,l;return i<0?(l=Math.pow(10,-i)/s,a=Math.round(t*l),c=Math.round(e*l),a/l<t&&++a,c/l>e&&--c,l=-l):(l=Math.pow(10,i)*s,a=Math.round(t/l),c=Math.round(e/l),a*l<t&&++a,c*l>e&&--c),c<a&&.5<=r&&r<2?Xk(t,e,r*2):[a,c,l]}function k_(t,e,r){return e=+e,t=+t,r=+r,Xk(t,e,r)[2]}function Eh(t,e,r){e=+e,t=+t,r=+r;let n=e<t,i=n?k_(e,t,r):k_(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}function Rh(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,o=new Array(i);++n<i;)o[n]=t+n*r;return o}function Qa(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}var Gk=Symbol("implicit");function bh(){var t=new Ja,e=[],r=[],n=Gk;function i(o){let s=t.get(o);if(s===void 0){if(n!==Gk)return n;t.set(o,s=e.push(o)-1)}return r[s%r.length]}return i.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new Ja;for(let s of o)t.has(s)||t.set(s,e.push(s)-1);return i},i.range=function(o){return arguments.length?(r=Array.from(o),i):r.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return bh(e,r).unknown(n)},Qa.apply(i,arguments),i}function ku(){var t=bh().unknown(void 0),e=t.domain,r=t.range,n=0,i=1,o,s,a=!1,c=0,l=0,u=.5;delete t.unknown;function f(){var d=e().length,p=i<n,m=p?i:n,y=p?n:i;o=(y-m)/Math.max(1,d-c+l*2),a&&(o=Math.floor(o)),m+=(y-m-o*(d-c))*u,s=o*(1-c),a&&(m=Math.round(m),s=Math.round(s));var R=Rh(d).map(function(T){return m+o*T});return r(p?R.reverse():R)}return t.domain=function(d){return arguments.length?(e(d),f()):e()},t.range=function(d){return arguments.length?([n,i]=d,n=+n,i=+i,f()):[n,i]},t.rangeRound=function(d){return[n,i]=d,n=+n,i=+i,a=!0,f()},t.bandwidth=function(){return s},t.step=function(){return o},t.round=function(d){return arguments.length?(a=!!d,f()):a},t.padding=function(d){return arguments.length?(c=Math.min(1,l=+d),f()):c},t.paddingInner=function(d){return arguments.length?(c=Math.min(1,d),f()):c},t.paddingOuter=function(d){return arguments.length?(l=+d,f()):l},t.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),f()):u},t.copy=function(){return ku(e(),[n,i]).round(a).paddingInner(c).paddingOuter(l).align(u)},Qa.apply(f(),arguments)}function wh(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function N_(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Cu(){}var Nu=.7,Sh=1/Nu,ec="\\s*([+-]?\\d+)\\s*",Pu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_n="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",s2=/^#([0-9a-f]{3,8})$/,a2=new RegExp(`^rgb\\(${ec},${ec},${ec}\\)$`),c2=new RegExp(`^rgb\\(${_n},${_n},${_n}\\)$`),l2=new RegExp(`^rgba\\(${ec},${ec},${ec},${Pu}\\)$`),u2=new RegExp(`^rgba\\(${_n},${_n},${_n},${Pu}\\)$`),f2=new RegExp(`^hsl\\(${Pu},${_n},${_n}\\)$`),d2=new RegExp(`^hsla\\(${Pu},${_n},${_n},${Pu}\\)$`),Hk={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};wh(Cu,Bi,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:jk,formatHex:jk,formatHex8:p2,formatHsl:h2,formatRgb:Wk,toString:Wk});function jk(){return this.rgb().formatHex()}function p2(){return this.rgb().formatHex8()}function h2(){return Zk(this).formatHsl()}function Wk(){return this.rgb().formatRgb()}function Bi(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=s2.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?qk(e):r===3?new sr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?Ah(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?Ah(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=a2.exec(t))?new sr(e[1],e[2],e[3],1):(e=c2.exec(t))?new sr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=l2.exec(t))?Ah(e[1],e[2],e[3],e[4]):(e=u2.exec(t))?Ah(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=f2.exec(t))?Yk(e[1],e[2]/100,e[3]/100,1):(e=d2.exec(t))?Yk(e[1],e[2]/100,e[3]/100,e[4]):Hk.hasOwnProperty(t)?qk(Hk[t]):t==="transparent"?new sr(NaN,NaN,NaN,0):null}function qk(t){return new sr(t>>16&255,t>>8&255,t&255,1)}function Ah(t,e,r,n){return n<=0&&(t=e=r=NaN),new sr(t,e,r,n)}function m2(t){return t instanceof Cu||(t=Bi(t)),t?(t=t.rgb(),new sr(t.r,t.g,t.b,t.opacity)):new sr}function tc(t,e,r,n){return arguments.length===1?m2(t):new sr(t,e,r,n??1)}function sr(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}wh(sr,tc,N_(Cu,{brighter(t){return t=t==null?Sh:Math.pow(Sh,t),new sr(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Nu:Math.pow(Nu,t),new sr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new sr(zo(this.r),zo(this.g),zo(this.b),vh(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:zk,formatHex:zk,formatHex8:g2,formatRgb:Vk,toString:Vk}));function zk(){return`#${qo(this.r)}${qo(this.g)}${qo(this.b)}`}function g2(){return`#${qo(this.r)}${qo(this.g)}${qo(this.b)}${qo((isNaN(this.opacity)?1:this.opacity)*255)}`}function Vk(){let t=vh(this.opacity);return`${t===1?"rgb(":"rgba("}${zo(this.r)}, ${zo(this.g)}, ${zo(this.b)}${t===1?")":`, ${t})`}`}function vh(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function zo(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function qo(t){return t=zo(t),(t<16?"0":"")+t.toString(16)}function Yk(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Jr(t,e,r,n)}function Zk(t){if(t instanceof Jr)return new Jr(t.h,t.s,t.l,t.opacity);if(t instanceof Cu||(t=Bi(t)),!t)return new Jr;if(t instanceof Jr)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=NaN,a=o-i,c=(o+i)/2;return a?(e===o?s=(r-n)/a+(r<n)*6:r===o?s=(n-e)/a+2:s=(e-r)/a+4,a/=c<.5?o+i:2-o-i,s*=60):a=c>0&&c<1?0:s,new Jr(s,a,c,t.opacity)}function Jk(t,e,r,n){return arguments.length===1?Zk(t):new Jr(t,e,r,n??1)}function Jr(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}wh(Jr,Jk,N_(Cu,{brighter(t){return t=t==null?Sh:Math.pow(Sh,t),new Jr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Nu:Math.pow(Nu,t),new Jr(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new sr(P_(t>=240?t-240:t+120,i,n),P_(t,i,n),P_(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Jr(Kk(this.h),Ih(this.s),Ih(this.l),vh(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=vh(this.opacity);return`${t===1?"hsl(":"hsla("}${Kk(this.h)}, ${Ih(this.s)*100}%, ${Ih(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Kk(t){return t=(t||0)%360,t<0?t+360:t}function Ih(t){return Math.max(0,Math.min(1,t||0))}function P_(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}function C_(t,e,r,n,i){var o=t*t,s=o*t;return((1-3*t+3*o-s)*e+(4-6*o+3*s)*r+(1+3*t+3*o-3*s)*n+s*i)/6}function Qk(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),i=t[n],o=t[n+1],s=n>0?t[n-1]:2*i-o,a=n<e-1?t[n+2]:2*o-i;return C_((r-n/e)*e,s,i,o,a)}}function eN(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),i=t[(n+e-1)%e],o=t[n%e],s=t[(n+1)%e],a=t[(n+2)%e];return C_((r-n/e)*e,i,o,s,a)}}var Ou=t=>()=>t;function y2(t,e){return function(r){return t+r*e}}function x2(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function tN(t){return(t=+t)==1?kh:function(e,r){return r-e?x2(e,r,t):Ou(isNaN(e)?r:e)}}function kh(t,e){var r=e-t;return r?y2(t,r):Ou(isNaN(t)?e:t)}var O_=(function t(e){var r=tN(e);function n(i,o){var s=r((i=tc(i)).r,(o=tc(o)).r),a=r(i.g,o.g),c=r(i.b,o.b),l=kh(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=c(u),i.opacity=l(u),i+""}}return n.gamma=t,n})(1);function rN(t){return function(e){var r=e.length,n=new Array(r),i=new Array(r),o=new Array(r),s,a;for(s=0;s<r;++s)a=tc(e[s]),n[s]=a.r||0,i[s]=a.g||0,o[s]=a.b||0;return n=t(n),i=t(i),o=t(o),a.opacity=1,function(c){return a.r=n(c),a.g=i(c),a.b=o(c),a+""}}}var Bte=rN(Qk),Xte=rN(eN);function nN(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(o){for(i=0;i<r;++i)n[i]=t[i]*(1-o)+e[i]*o;return n}}function iN(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function oN(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,i=new Array(n),o=new Array(r),s;for(s=0;s<n;++s)i[s]=Vo(t[s],e[s]);for(;s<r;++s)o[s]=e[s];return function(a){for(s=0;s<n;++s)o[s]=i[s](a);return o}}function sN(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function Xi(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function aN(t,e){var r={},n={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?r[i]=Vo(t[i],e[i]):n[i]=e[i];return function(o){for(i in r)n[i]=r[i](o);return n}}var D_=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,L_=new RegExp(D_.source,"g");function T2(t){return function(){return t}}function _2(t){return function(e){return t(e)+""}}function cN(t,e){var r=D_.lastIndex=L_.lastIndex=0,n,i,o,s=-1,a=[],c=[];for(t=t+"",e=e+"";(n=D_.exec(t))&&(i=L_.exec(e));)(o=i.index)>r&&(o=e.slice(r,o),a[s]?a[s]+=o:a[++s]=o),(n=n[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,c.push({i:s,x:Xi(n,i)})),r=L_.lastIndex;return r<e.length&&(o=e.slice(r),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?_2(c[0].x):T2(e):(e=c.length,function(l){for(var u=0,f;u<e;++u)a[(f=c[u]).i]=f.x(l);return a.join("")})}function Vo(t,e){var r=typeof e,n;return e==null||r==="boolean"?Ou(e):(r==="number"?Xi:r==="string"?(n=Bi(e))?(e=n,O_):cN:e instanceof Bi?O_:e instanceof Date?sN:iN(e)?nN:Array.isArray(e)?oN:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?aN:Xi)(t,e)}function $_(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function M_(t){return function(){return t}}function F_(t){return+t}var lN=[0,1];function rc(t){return t}function U_(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:M_(isNaN(e)?NaN:.5)}function E2(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function R2(t,e,r){var n=t[0],i=t[1],o=e[0],s=e[1];return i<n?(n=U_(i,n),o=r(s,o)):(n=U_(n,i),o=r(o,s)),function(a){return o(n(a))}}function b2(t,e,r){var n=Math.min(t.length,e.length)-1,i=new Array(n),o=new Array(n),s=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<n;)i[s]=U_(t[s],t[s+1]),o[s]=r(e[s],e[s+1]);return function(a){var c=v_(t,a,1,n)-1;return o[c](i[c](a))}}function uN(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function w2(){var t=lN,e=lN,r=Vo,n,i,o,s=rc,a,c,l;function u(){var d=Math.min(t.length,e.length);return s!==rc&&(s=E2(t[0],t[d-1])),a=d>2?b2:R2,c=l=null,f}function f(d){return d==null||isNaN(d=+d)?o:(c||(c=a(t.map(n),e,r)))(n(s(d)))}return f.invert=function(d){return s(i((l||(l=a(e,t.map(n),Xi)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,F_),u()):t.slice()},f.range=function(d){return arguments.length?(e=Array.from(d),u()):e.slice()},f.rangeRound=function(d){return e=Array.from(d),r=$_,u()},f.clamp=function(d){return arguments.length?(s=d?!0:rc,u()):s!==rc},f.interpolate=function(d){return arguments.length?(r=d,u()):r},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,p){return n=d,i=p,u()}}function B_(){return w2()(rc,rc)}function X_(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],o=t[n],s;return o<i&&(s=r,r=n,n=s,s=i,i=o,o=s),t[r]=e.floor(i),t[n]=e.ceil(o),t}var G_=new Date,H_=new Date;function Ve(t,e,r,n){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{let s=i(o),a=i.ceil(o);return o-s<a-o?s:a},i.offset=(o,s)=>(e(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{let c=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return c;let l;do c.push(l=new Date(+o)),e(o,a),t(o);while(l<o&&o<s);return c},i.filter=o=>Ve(s=>{if(s>=s)for(;t(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!o(s););else for(;--a>=0;)for(;e(s,1),!o(s););}),r&&(i.count=(o,s)=>(G_.setTime(+o),H_.setTime(+s),t(G_),t(H_),Math.floor(r(G_,H_))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(n?s=>n(s)%o===0:s=>i.count(0,s)%o===0):i)),i}var Lu=Ve(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Lu.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Ve(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):Lu);var bre=Lu.range;var En=Ve(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),fN=En.range;var nc=Ve(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),A2=nc.range,Nh=Ve(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),I2=Nh.range;var ic=Ve(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3-t.getMinutes()*6e4)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getHours()),S2=ic.range,Ph=Ve(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),v2=Ph.range;var qn=Ve(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1),k2=qn.range,$u=Ve(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),N2=$u.range,Ch=Ve(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),P2=Ch.range;function Zo(t){return Ve(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}var zn=Zo(0),oc=Zo(1),pN=Zo(2),hN=Zo(3),Gi=Zo(4),mN=Zo(5),gN=Zo(6),yN=zn.range,C2=oc.range,O2=pN.range,L2=hN.range,D2=Gi.range,$2=mN.range,M2=gN.range;function Jo(t){return Ve(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/6048e5)}var Qo=Jo(0),sc=Jo(1),xN=Jo(2),TN=Jo(3),Hi=Jo(4),_N=Jo(5),EN=Jo(6),RN=Qo.range,F2=sc.range,U2=xN.range,B2=TN.range,X2=Hi.range,G2=_N.range,H2=EN.range;var ac=Ve(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),j2=ac.range,Oh=Ve(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),W2=Oh.range;var yr=Ve(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());yr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ve(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});var q2=yr.range,Qr=Ve(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Qr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ve(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});var z2=Qr.range;function wN(t,e,r,n,i,o){let s=[[En,1,1e3],[En,5,5*1e3],[En,15,15*1e3],[En,30,30*1e3],[o,1,6e4],[o,5,5*6e4],[o,15,15*6e4],[o,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[n,1,864e5],[n,2,2*864e5],[r,1,6048e5],[e,1,2592e6],[e,3,3*2592e6],[t,1,31536e6]];function a(l,u,f){let d=u<l;d&&([l,u]=[u,l]);let p=f&&typeof f.range=="function"?f:c(l,u,f),m=p?p.range(l,+u+1):[];return d?m.reverse():m}function c(l,u,f){let d=Math.abs(u-l)/f,p=Wo(([,,R])=>R).right(s,d);if(p===s.length)return t.every(Eh(l/31536e6,u/31536e6,f));if(p===0)return Lu.every(Math.max(Eh(l,u,f),1));let[m,y]=s[d/s[p-1][2]<s[p][2]/d?p-1:p];return m.every(y)}return[a,c]}var[Y2,K2]=wN(Qr,Oh,Qo,Ch,Ph,Nh),[j_,W_]=wN(yr,ac,zn,qn,ic,nc);function q_(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function z_(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Mu(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function V_(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,o=t.days,s=t.shortDays,a=t.months,c=t.shortMonths,l=Fu(i),u=Uu(i),f=Fu(o),d=Uu(o),p=Fu(s),m=Uu(s),y=Fu(a),R=Uu(a),T=Fu(c),E=Uu(c),_={a:S,A:B,b:H,B:$,c:null,d:NN,e:NN,f:TX,g:kX,G:PX,H:gX,I:yX,j:xX,L:DN,m:_X,M:EX,p:q,q:K,Q:ON,s:LN,S:RX,u:bX,U:wX,V:AX,w:IX,W:SX,x:null,X:null,y:vX,Y:NX,Z:CX,"%":CN},k={a:xe,A:Y,b:pe,B:it,c:null,d:PN,e:PN,f:$X,g:qX,G:VX,H:OX,I:LX,j:DX,L:MN,m:MX,M:FX,p:We,q:Ye,Q:ON,s:LN,S:UX,u:BX,U:XX,V:GX,w:HX,W:jX,x:null,X:null,y:WX,Y:zX,Z:YX,"%":CN},D={a:Ae,A:O,b:w,B:L,c:M,d:vN,e:vN,f:dX,g:SN,G:IN,H:kN,I:kN,j:cX,L:fX,m:aX,M:lX,p:ie,q:sX,Q:hX,s:mX,S:uX,u:tX,U:rX,V:nX,w:eX,W:iX,x:A,X:I,y:SN,Y:IN,Z:oX,"%":pX};_.x=C(r,_),_.X=C(n,_),_.c=C(e,_),k.x=C(r,k),k.X=C(n,k),k.c=C(e,k);function C(G,Z){return function(ee){var P=[],Te=-1,Ee=0,Ue=G.length,ft,U,Nr;for(ee instanceof Date||(ee=new Date(+ee));++Te<Ue;)G.charCodeAt(Te)===37&&(P.push(G.slice(Ee,Te)),(U=AN[ft=G.charAt(++Te)])!=null?ft=G.charAt(++Te):U=ft==="e"?" ":"0",(Nr=Z[ft])&&(ft=Nr(ee,U)),P.push(ft),Ee=Te+1);return P.push(G.slice(Ee,Te)),P.join("")}}function j(G,Z){return function(ee){var P=Mu(1900,void 0,1),Te=V(P,G,ee+="",0),Ee,Ue;if(Te!=ee.length)return null;if("Q"in P)return new Date(P.Q);if("s"in P)return new Date(P.s*1e3+("L"in P?P.L:0));if(Z&&!("Z"in P)&&(P.Z=0),"p"in P&&(P.H=P.H%12+P.p*12),P.m===void 0&&(P.m="q"in P?P.q:0),"V"in P){if(P.V<1||P.V>53)return null;"w"in P||(P.w=1),"Z"in P?(Ee=z_(Mu(P.y,0,1)),Ue=Ee.getUTCDay(),Ee=Ue>4||Ue===0?sc.ceil(Ee):sc(Ee),Ee=$u.offset(Ee,(P.V-1)*7),P.y=Ee.getUTCFullYear(),P.m=Ee.getUTCMonth(),P.d=Ee.getUTCDate()+(P.w+6)%7):(Ee=q_(Mu(P.y,0,1)),Ue=Ee.getDay(),Ee=Ue>4||Ue===0?oc.ceil(Ee):oc(Ee),Ee=qn.offset(Ee,(P.V-1)*7),P.y=Ee.getFullYear(),P.m=Ee.getMonth(),P.d=Ee.getDate()+(P.w+6)%7)}else("W"in P||"U"in P)&&("w"in P||(P.w="u"in P?P.u%7:"W"in P?1:0),Ue="Z"in P?z_(Mu(P.y,0,1)).getUTCDay():q_(Mu(P.y,0,1)).getDay(),P.m=0,P.d="W"in P?(P.w+6)%7+P.W*7-(Ue+5)%7:P.w+P.U*7-(Ue+6)%7);return"Z"in P?(P.H+=P.Z/100|0,P.M+=P.Z%100,z_(P)):q_(P)}}function V(G,Z,ee,P){for(var Te=0,Ee=Z.length,Ue=ee.length,ft,U;Te<Ee;){if(P>=Ue)return-1;if(ft=Z.charCodeAt(Te++),ft===37){if(ft=Z.charAt(Te++),U=D[ft in AN?Z.charAt(Te++):ft],!U||(P=U(G,ee,P))<0)return-1}else if(ft!=ee.charCodeAt(P++))return-1}return P}function ie(G,Z,ee){var P=l.exec(Z.slice(ee));return P?(G.p=u.get(P[0].toLowerCase()),ee+P[0].length):-1}function Ae(G,Z,ee){var P=p.exec(Z.slice(ee));return P?(G.w=m.get(P[0].toLowerCase()),ee+P[0].length):-1}function O(G,Z,ee){var P=f.exec(Z.slice(ee));return P?(G.w=d.get(P[0].toLowerCase()),ee+P[0].length):-1}function w(G,Z,ee){var P=T.exec(Z.slice(ee));return P?(G.m=E.get(P[0].toLowerCase()),ee+P[0].length):-1}function L(G,Z,ee){var P=y.exec(Z.slice(ee));return P?(G.m=R.get(P[0].toLowerCase()),ee+P[0].length):-1}function M(G,Z,ee){return V(G,e,Z,ee)}function A(G,Z,ee){return V(G,r,Z,ee)}function I(G,Z,ee){return V(G,n,Z,ee)}function S(G){return s[G.getDay()]}function B(G){return o[G.getDay()]}function H(G){return c[G.getMonth()]}function $(G){return a[G.getMonth()]}function q(G){return i[+(G.getHours()>=12)]}function K(G){return 1+~~(G.getMonth()/3)}function xe(G){return s[G.getUTCDay()]}function Y(G){return o[G.getUTCDay()]}function pe(G){return c[G.getUTCMonth()]}function it(G){return a[G.getUTCMonth()]}function We(G){return i[+(G.getUTCHours()>=12)]}function Ye(G){return 1+~~(G.getUTCMonth()/3)}return{format:function(G){var Z=C(G+="",_);return Z.toString=function(){return G},Z},parse:function(G){var Z=j(G+="",!1);return Z.toString=function(){return G},Z},utcFormat:function(G){var Z=C(G+="",k);return Z.toString=function(){return G},Z},utcParse:function(G){var Z=j(G+="",!0);return Z.toString=function(){return G},Z}}}var AN={"-":"",_:" ",0:"0"},Pt=/^\s*\d+/,Z2=/^%/,J2=/[\\^$*+?|[\]().{}]/g;function Ce(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",o=i.length;return n+(o<r?new Array(r-o+1).join(e)+i:i)}function Q2(t){return t.replace(J2,"\\$&")}function Fu(t){return new RegExp("^(?:"+t.map(Q2).join("|")+")","i")}function Uu(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function eX(t,e,r){var n=Pt.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function tX(t,e,r){var n=Pt.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function rX(t,e,r){var n=Pt.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function nX(t,e,r){var n=Pt.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function iX(t,e,r){var n=Pt.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function IN(t,e,r){var n=Pt.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function SN(t,e,r){var n=Pt.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function oX(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function sX(t,e,r){var n=Pt.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function aX(t,e,r){var n=Pt.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function vN(t,e,r){var n=Pt.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function cX(t,e,r){var n=Pt.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function kN(t,e,r){var n=Pt.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function lX(t,e,r){var n=Pt.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function uX(t,e,r){var n=Pt.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function fX(t,e,r){var n=Pt.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function dX(t,e,r){var n=Pt.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function pX(t,e,r){var n=Z2.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function hX(t,e,r){var n=Pt.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function mX(t,e,r){var n=Pt.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function NN(t,e){return Ce(t.getDate(),e,2)}function gX(t,e){return Ce(t.getHours(),e,2)}function yX(t,e){return Ce(t.getHours()%12||12,e,2)}function xX(t,e){return Ce(1+qn.count(yr(t),t),e,3)}function DN(t,e){return Ce(t.getMilliseconds(),e,3)}function TX(t,e){return DN(t,e)+"000"}function _X(t,e){return Ce(t.getMonth()+1,e,2)}function EX(t,e){return Ce(t.getMinutes(),e,2)}function RX(t,e){return Ce(t.getSeconds(),e,2)}function bX(t){var e=t.getDay();return e===0?7:e}function wX(t,e){return Ce(zn.count(yr(t)-1,t),e,2)}function $N(t){var e=t.getDay();return e>=4||e===0?Gi(t):Gi.ceil(t)}function AX(t,e){return t=$N(t),Ce(Gi.count(yr(t),t)+(yr(t).getDay()===4),e,2)}function IX(t){return t.getDay()}function SX(t,e){return Ce(oc.count(yr(t)-1,t),e,2)}function vX(t,e){return Ce(t.getFullYear()%100,e,2)}function kX(t,e){return t=$N(t),Ce(t.getFullYear()%100,e,2)}function NX(t,e){return Ce(t.getFullYear()%1e4,e,4)}function PX(t,e){var r=t.getDay();return t=r>=4||r===0?Gi(t):Gi.ceil(t),Ce(t.getFullYear()%1e4,e,4)}function CX(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Ce(e/60|0,"0",2)+Ce(e%60,"0",2)}function PN(t,e){return Ce(t.getUTCDate(),e,2)}function OX(t,e){return Ce(t.getUTCHours(),e,2)}function LX(t,e){return Ce(t.getUTCHours()%12||12,e,2)}function DX(t,e){return Ce(1+$u.count(Qr(t),t),e,3)}function MN(t,e){return Ce(t.getUTCMilliseconds(),e,3)}function $X(t,e){return MN(t,e)+"000"}function MX(t,e){return Ce(t.getUTCMonth()+1,e,2)}function FX(t,e){return Ce(t.getUTCMinutes(),e,2)}function UX(t,e){return Ce(t.getUTCSeconds(),e,2)}function BX(t){var e=t.getUTCDay();return e===0?7:e}function XX(t,e){return Ce(Qo.count(Qr(t)-1,t),e,2)}function FN(t){var e=t.getUTCDay();return e>=4||e===0?Hi(t):Hi.ceil(t)}function GX(t,e){return t=FN(t),Ce(Hi.count(Qr(t),t)+(Qr(t).getUTCDay()===4),e,2)}function HX(t){return t.getUTCDay()}function jX(t,e){return Ce(sc.count(Qr(t)-1,t),e,2)}function WX(t,e){return Ce(t.getUTCFullYear()%100,e,2)}function qX(t,e){return t=FN(t),Ce(t.getUTCFullYear()%100,e,2)}function zX(t,e){return Ce(t.getUTCFullYear()%1e4,e,4)}function VX(t,e){var r=t.getUTCDay();return t=r>=4||r===0?Hi(t):Hi.ceil(t),Ce(t.getUTCFullYear()%1e4,e,4)}function YX(){return"+0000"}function CN(){return"%"}function ON(t){return+t}function LN(t){return Math.floor(+t/1e3)}var cc,Lh,UN,BN,XN;Y_({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Y_(t){return cc=V_(t),Lh=cc.format,UN=cc.parse,BN=cc.utcFormat,XN=cc.utcParse,cc}function KX(t){return new Date(t)}function ZX(t){return t instanceof Date?+t:+new Date(+t)}function GN(t,e,r,n,i,o,s,a,c,l){var u=B_(),f=u.invert,d=u.domain,p=l(".%L"),m=l(":%S"),y=l("%I:%M"),R=l("%I %p"),T=l("%a %d"),E=l("%b %d"),_=l("%B"),k=l("%Y");function D(C){return(c(C)<C?p:a(C)<C?m:s(C)<C?y:o(C)<C?R:n(C)<C?i(C)<C?T:E:r(C)<C?_:k)(C)}return u.invert=function(C){return new Date(f(C))},u.domain=function(C){return arguments.length?d(Array.from(C,ZX)):d().map(KX)},u.ticks=function(C){var j=d();return t(j[0],j[j.length-1],C??10)},u.tickFormat=function(C,j){return j==null?D:l(j)},u.nice=function(C){var j=d();return(!C||typeof C.range!="function")&&(C=e(j[0],j[j.length-1],C??10)),C?d(X_(j,C)):u},u.copy=function(){return uN(u,GN(t,e,r,n,i,o,s,a,c,l))},u}function Dh(){return Qa.apply(GN(j_,W_,yr,ac,zn,qn,ic,nc,En,Lh).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}var K_=class t{constructor(e,r,n){le(this,"bandwidthPx");le(this,"stepPx");le(this,"d3");this.bandwidthPx=e,this.stepPx=r,this.d3=n}static fixedRow(e){return new t(e.bandwidth,e.step)}static forRows(e){let r=Array.from({length:e.count},(i,o)=>String(o)),n=ku().domain(r).range(e.range).paddingInner(e.paddingInner??0).paddingOuter(e.paddingOuter??0);return new t(n.bandwidth(),n.step(),n)}bandwidth(){return this.bandwidthPx}step(){return this.stepPx}forward(e){if(!this.d3)throw new Error("BandScale.forward is only available on closed-domain bands (BandScale.forRows)");let r=this.d3(e);if(r===void 0)throw new Error(`BandScale: unknown band id "${e}"`);return r}},JX={bandwidth:56,step:64};function HN(){return K_.fixedRow(JX)}var $h=class{constructor(e){le(this,"domain");le(this,"range");le(this,"pixelsPerDay");le(this,"calendar");le(this,"d3");this.domain=e.domain,this.range=e.range,this.calendar=e.calendar;let r=Math.max(1,vr(e.domain[0],e.domain[1]));this.pixelsPerDay=(e.range[1]-e.range[0])/r,this.d3=Dh().domain(e.domain).range(e.range)}forward(e){let r=vr(this.domain[0],e);return this.range[0]+r*this.pixelsPerDay}forwardWithinDomain(e){return e<this.domain[0]||e>this.domain[1]?null:this.forward(e)}invert(e){return this.d3.invert(e)}get originX(){return this.range[0]}get widthPx(){return this.range[1]-this.range[0]}};function Mh(t){return t.endsWith(":")?t.slice(0,-1):t}function jN(t,e){let n=t.roadmapDecl?.properties.find(c=>Mh(c.key)==="scale")?.value,i="weeks",o,s;if(n)if(n==="days"||n==="weeks"||n==="months"||n==="quarters"||n==="years")i=n;else{let c=/^(\d+)([dwmqy])$/.exec(n);if(c){let l=Math.max(1,parseInt(c[1],10));switch(c[2]){case"d":i="days";break;case"w":i="weeks";break;case"m":i="months";break;case"q":i="quarters";break;case"y":i="years";break}o=Fh(i)*l,s=1}}let a=s??$k[i]??4;if(e){let l=e.properties.find(m=>Mh(m.key)==="unit")?.value??i,u=e.properties.find(m=>Mh(m.key)==="label-every"),f=e.properties.find(m=>Mh(m.key)==="pixels-per-unit"),d=u?Math.max(1,parseInt(u.value,10)||a):a,p=f?Math.max(1,parseInt(f.value,10)||Fh(l)):o??Fh(l);return{unit:l,labelEvery:d,pixelsPerUnit:p}}return{unit:i,labelEvery:a,pixelsPerUnit:o??Fh(i)}}function Fh(t){switch(t){case"days":return Ck;case"weeks":return 40;case"months":return 80;case"quarters":return 160;case"years":return 320}}function WN(t,e,r,n=yu){let i=r.daysPerUnit(e.unit),o=i*t.pixelsPerDay,s=Math.max(1,Math.round(t.widthPx/t.pixelsPerDay)),a=Math.floor(s/i)+1,c=[];for(let l=0;l<a;l++){let u=l*i,f=t.originX+u*t.pixelsPerDay,d=l%e.labelEvery===0,p=l===a-1;c.push({x:f,labelX:p?void 0:f+o/2,major:d,label:d&&!p?QX(e.unit,Go(t.domain[0],u),l,n):void 0})}return c}function QX(t,e,r,n){switch(t){case"days":return`${e.getUTCMonth()+1}/${e.getUTCDate()}`;case"weeks":{let i=e.toLocaleString(n,{month:"short",timeZone:"UTC"}),o=e.getUTCDate().toString().padStart(2,"0");return`${i} ${o}`}case"months":return e.toLocaleString(n,{month:"short",timeZone:"UTC"});case"quarters":{let i=Math.floor(e.getUTCMonth()/3)+1;return`${nh(n).quarterPrefix}${i} ${e.getUTCFullYear()}`}case"years":return`${e.getUTCFullYear()}`}}function qN(t){return{daysPerUnit:e=>Z_(e,t),addUnits:(e,r,n)=>Go(e,r*Z_(n,t)),isWorkingDay:()=>!0}}function zN(t,e){return Z_(t,e)}function Z_(t,e){switch(t){case"days":return 1;case"weeks":return e.daysPerWeek;case"months":return e.daysPerMonth;case"quarters":return e.daysPerQuarter;case"years":return e.daysPerYear}}var J_=class{constructor(e,r){le(this,"id");le(this,"anchor");this.id=e,this.anchor=r}place(e,r){let n=se(this.anchor.properties,"date"),i=Et(n);if(!i)return null;let o=e.scale.forwardWithinDomain(i);if(o===null)return null;let s=xt("anchor",this.anchor.properties,e.styleCtx),a=e.markerRowPlacements.get(this.id),c=a?.centerY??e.timeline.markerRow.y,l={x:o,y:c},u=a?.labelBox??{x:o+6+6,y:c-4,width:0,height:12},f=a?.labelSide??"right";return e.entityLeftEdges.set(this.id,o),e.entityRightEdges.set(this.id,o),e.entityMidpoints.set(this.id,l),{id:this.id,title:this.anchor.title??this.id,center:l,radius:6,style:s,predecessorPoints:[],cutTopY:e.chartTopY,cutBottomY:e.swimlaneBottomY,bumpedUp:(a?.rowIndex??0)>0,labelBox:u,labelSide:f}}};function YN(t,e,r){let n=[];for(let[i,o]of t){let s=new J_(i,o).place(e,r);s&&n.push(s)}return n}function Q_(t,e,r){let n=[],i=new Map,o=new Map;return[...t.entries()].sort(([c],[l])=>c.localeCompare(l)).forEach(([c,l],u)=>{let f=u+1;i.set(c,f),o.set(c,yt(l.properties,"on")),n.push({number:f,title:l.title??c,description:l.description?.text,style:xt("footnote",l.properties,e.styleCtx)})}),{area:{box:{x:Zr,y:r+Zr,width:e.chartRightX-2*Zr,height:n.length===0?0:Au+n.length*Iu+Zr},entries:n},index:i,hosts:o}}var eG=.8,tG=1;function rG(t){let e=[];return ZN(t,e),e}function ZN(t,e){for(let r of t)if(r.kind==="item"){let n=nG(r);n>0&&r.box.width>0&&e.push({startX:r.box.x,endX:r.box.x+r.box.width,load:n})}else(r.kind==="parallel"||r.kind==="group")&&ZN(r.children,e)}function nG(t){return t.capacity?t.capacity.value:t.size?1:0}function JN(t){if(t.capacityValue<=0||t.warnFraction===null&&t.overFraction===null)return null;let e=rG(t.children);if(e.length===0)return null;let r=new Set;for(let s of e)r.add(s.startX),r.add(s.endX);let n=Array.from(r).sort((s,a)=>s-a);if(n.length<2)return null;let i=[];for(let s=0;s<n.length-1;s++){let a=n[s],c=n[s+1],l=(a+c)/2,u=0;for(let f of e)f.startX<=l&&l<f.endX&&(u+=f.load);i.push({startX:a,endX:c,load:u,classification:iG(u,t.capacityValue,t.warnFraction,t.overFraction)})}let o=[];for(let s of i){let a=o[o.length-1];a&&a.classification===s.classification&&a.endX===s.startX?a.endX=s.endX:o.push({...s})}return{segments:o,capacityValue:t.capacityValue,warnFraction:t.warnFraction,overFraction:t.overFraction}}function iG(t,e,r,n){let i=t/e;return n!==null&&i>=n?"red":r!==null&&i>=r?"yellow":"green"}function QN(t,e){let r=e.get("swimlane"),n=KN(se(t.properties,"utilization-warn-at"),r?se(r.properties,"utilization-warn-at"):void 0,eG),i=KN(se(t.properties,"utilization-over-at"),r?se(r.properties,"utilization-over-at"):void 0,tG);return{warn:n,over:i}}function KN(t,e,r){let i=aG(t??e);return i.kind==="unset"?r:i.kind==="none"?null:i.value}var oG=/^\d+(?:\.\d+)?%$/,sG=/^\d+\.\d+$/;function aG(t){if(t===void 0)return{kind:"unset"};if(t==="none")return{kind:"none"};if(oG.test(t)){let e=parseFloat(t)/100;return Number.isFinite(e)&&e>0?{kind:"number",value:e}:{kind:"unset"}}if(sG.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?{kind:"number",value:e}:{kind:"unset"}}return{kind:"unset"}}var eP=10;function cG(t,e,r){let n=se(t.properties,"capacity"),i=$i(n);if(i===null)return{capacity:null,badgeWidthPx:0};let o=pu(i),s=hu(e.capacityIcon,r),a=Xo(o,s,eP);return{capacity:{value:i,text:o,icon:s},badgeWidthPx:a}}var lG=10,uG=38,fG=8;function dG(t,e,r){let n=t.title??t.name??"";if(!n)return 0;let i=se(t.properties,"owner");return mu(0,n,i??void 0,e,r).rightX}function pG(t,e){if(!t.name)return[];let r=[];for(let[n,i]of e.footnoteHosts.entries())if(i.includes(t.name)){let o=e.footnoteIndex.get(n);o!==void 0&&r.push(o)}return r.sort((n,i)=>n-i),r}function hG(t,e,r,n){for(let i of t.content){if(i.$type==="DescriptionDirective")continue;let o=gr(i)?i.properties:i.properties??[];return n.resolveChildStart(o,e,e,r)}}var lc=class{constructor(e,r){le(this,"input");le(this,"deps");this.input=e,this.deps=r}get id(){return this.input.lane.name??""}place(e,r){let{lane:n,bandIndex:i}=this.input,{deps:o}=this,s=xt("swimlane",n.properties,r.styleCtx),a=e.x,c=r.bandScale.step(),l=r.currentFlowKey;r.currentFlowKey=`lane:${n.name??i}`;let{capacity:u,badgeWidthPx:f}=cG(n,s,r.symbols),d=pG(n,r),p=d.length>0?o.estimateTextWidth(d.join(","),eP):0,m=dG(n,f,p),y=hG(n,a,r,o),R=!n.title||y===void 0||y>=m+fG,T=e.y+(R?lG:uG),E=new za({laneLeftX:a,originY:T,minRowHeight:c,slackCorridors:r.slackCorridors}),_=a,k=[];for(let w of n.content){if(w.$type==="DescriptionDirective")continue;if(!gr(w)){let Ye=w.properties??[],G=o.resolveChildStart(Ye,_,a,r),{rowIndex:Z,y:ee}=E.placeBlock(),P=o.newCursor(G,ee),Te=o.sequenceOne(w,P,r);k.push(Te);let Ee=Te.box.x+Te.box.width,Ue=Math.max(c,P.height);E.commitBlock({rowIndex:Z,placed:Te,blockHeight:Ue,blockEnd:Ee}),_=Math.max(_,Ee);continue}let L=w.properties,M=o.resolveChildStart(L,_,a,r),A=Mi(L,r.sizes,r.cal),I=Math.max(kr,A*r.timeline.pixelsPerDay),S=M+I,B=w.name??"",H=o.predictItemChipExtraHeight(w,r),$=c+H,{rowIndex:q,y:K}=E.placeItem({childId:B,desiredStart:M,desiredEnd:S,predictedHeight:$}),xe=o.newCursor(M,K),Y=o.sequenceItem(w,xe,r);k.push(Y);let pe=Y.box.x+Y.box.width+Yr;_=Math.max(_,pe);let it=null;(Y.textSpills||Y.chipsOutside||Y.dotSpills||Y.iconSpills||Y.footnoteSpills)&&(it=Math.max(Y.decorationsRightX,Y.chipsOutside?Y.chipsRightX:0)+6),E.commitItem({rowIndex:q,placed:Y,logicalEnd:pe,spillReservation:it,rowHeight:$})}let D=T-e.y,C=Math.max(c+32,D+E.usedHeight()+16),j=Math.max(E.usedRightX(),m),V={x:0,y:e.y,width:r.chartRightX,height:C},ie=se(n.properties,"owner"),Ae;if(ie){let w=r.teams.get(ie),L=r.persons.get(ie);Ae=w?.title??L?.title??ie}let O=u?(()=>{let{warn:w,over:L}=QN(n,r.styleCtx.defaults);return JN({children:k,capacityValue:u.value,warnFraction:w,overFraction:L})})():null;return r.currentFlowKey=l,{positioned:{id:n.name,title:n.title??n.name??"",box:V,bandIndex:i,children:k,nested:[],style:s,owner:Ae,footnoteIndicators:d,capacity:u,utilization:O},usedHeight:C,usedRightX:j}}};var mG=18,gG=14,yG=14,xG=16,TG=32;function tP(t,e,r,n){let i=r+mG,o=[],s=!0;for(let a of t){s||(i+=xG),s=!1;let c=a.content.roadmap?.title??a.sourcePath,l=i+gG,u={cal:e.cal,styleCtx:{theme:e.styleCtx.theme,styles:a.config.styles,defaults:a.config.defaults,labels:a.content.labels},sizes:th(a.content.sizes,e.cal),labels:a.content.labels,teams:a.content.teams,persons:a.content.persons,symbols:a.config.symbols,footnoteIndex:new Map,footnoteHosts:new Map,timeline:e.timeline,scale:e.scale,calendar:e.calendar,bandScale:e.bandScale,entityLeftEdges:new Map,entityRightEdges:new Map,entityMidpoints:new Map,entityVisualLeftX:new Map,entityVisualRightX:new Map,itemArrowSource:new Map,itemFlowKey:new Map,currentFlowKey:"",itemSlackAttachY:new Map,slackCorridors:[],markerRowPlacements:new Map,chartTopY:l,chartBottomY:l,swimlaneBottomY:l,chartRightX:e.chartRightX},f=[],d=l,p=0,m=u.timeline.originX;for(let C of a.content.swimlanes.values()){let{positioned:j,usedHeight:V,usedRightX:ie}=new lc({lane:C,bandIndex:p},n).place({x:u.timeline.originX,y:d},u);f.push(j),d+=V,p++,ie>m&&(m=ie)}let y=d,R=Math.max(e.bandScale.bandwidth(),y-i+yG),T=0,{chromeRightX:E}=gu(T,c,a.sourcePath),_=Math.max(E,m)+TG,k=Math.min(e.chartRightX-T,_-T),D={x:T,y:i,width:k,height:R};for(let C of f)C.box.width=k;o.push({sourcePath:a.sourcePath,label:c,box:D,nestedSwimlanes:f,style:xt("swimlane",[],e.styleCtx)}),i+=R}return{regions:o,endY:i}}function Xh(t,e){let r=[];for(let n of t){let o=e.entityVisualRightX.get(n)??e.entityRightEdges.get(n);if(o===void 0)continue;let s=e.itemSlackAttachY.get(n)??e.entityMidpoints.get(n)?.y??0,a=e.itemFlowKey.get(n)??`marker:${n}`;r.push({ref:n,x:o,y:s,flowKey:a})}return r}function Gh(t){let e=new Map;for(let r of t){let n=e.get(r.flowKey);(!n||r.x>n.x)&&e.set(r.flowKey,r)}return Array.from(e.values())}function rP(t,e,r,n,i,o,s,a){let c=n.length*i*.58*(o?1.05:1),l=t+r+6,u=t-r-6-c,f=l+c<=a,d=u>=s,p=f?"right":d?"left":"right";return{box:{x:p==="right"?l:u,y:e-4,width:c,height:12},side:p}}var eE=class{constructor(e,r){le(this,"id");le(this,"milestone");this.id=e,this.milestone=r}place(e){let r=this.milestone,n=xt("milestone",r.properties,e.styleCtx),i=se(r.properties,"date"),o=yt(r.properties,"after"),s=Et(i),a=e.timeline.markerRow.y,c=6,l=r.title??this.id,u=null,f=a,d=null,p="right",m=!1,y,R=!1;if(s){let E=e.scale.forwardWithinDomain(s);if(E===null)return null;u=E,m=!0;let _=e.markerRowPlacements.get(this.id);_&&(f=_.centerY,d=_.labelBox,p=_.labelSide);let k=Xh(o,e),D=Gh(k),C=null;for(let j of D)(!C||j.x>C.x)&&(C=j);C&&C.x>E&&(R=!0,y=[{x:C.x,y:C.y>0?C.y:f}])}else if(o.length>0){let E=Xh(o,e),_=Gh(E);_.sort((j,V)=>V.x-j.x);let k=_[0]?.x??e.timeline.originX;u=k,m=!1;let D=rP(u,a,c,l,10,!0,e.timeline.box.x,e.chartRightX);f=a,d=D.box,p=D.side,e.markerRowPlacements.set(this.id,{rowIndex:0,centerY:f,labelBox:d,labelSide:p});let C=[];for(let j=1;j<_.length;j++){let V=_[j];V.x<k&&V.y>0&&C.push({x:V.x,y:V.y})}C.length>0&&(y=C)}if(u===null)return null;if(!d){let E=rP(u,f,c,l,10,!0,e.timeline.box.x,e.chartRightX);d=E.box,p=E.side}let T={x:u,y:f};return e.entityLeftEdges.set(this.id,T.x),e.entityRightEdges.set(this.id,T.x),e.entityMidpoints.set(this.id,T),{id:this.id,title:l,center:T,radius:c,fixed:m,slackArrows:y,isOverrun:R,style:n,cutTopY:e.chartTopY,cutBottomY:e.swimlaneBottomY,labelBox:d,labelSide:p}}};function nP(t,e){let r=[];for(let[n,i]of t){let o=new eE(n,i).place(e);o&&r.push(o)}return r}var EG=4;function RG(t,e){e>t.chartRightX&&(t.chartRightX=e)}var jh=class{place(e,r,n,i){let o=n.theme??"light",s=Sk[o],a=n.width??1280,c=yk(n.locale,AG(e)),l=dk(e,r.config.calendar),u=jN(e,r.config.scale),f=th(r.content.sizes,l),d={theme:s,styles:r.config.styles,defaults:r.config.defaults,labels:r.content.labels},{startDate:p,endDate:m}=i.computeDateWindow(e,{cal:l,sizes:f},r,n.today,u),y=xt("roadmap",e.roadmapDecl?.properties??[],d),R=y.headerPosition==="beside",T=y.timelinePosition!=="bottom",E=y.timelinePosition==="bottom"||y.timelinePosition==="both",_=e.roadmapDecl?.title??e.roadmapDecl?.name??"",k=se(e.roadmapDecl?.properties??[],"author"),D=i.sizeBesideHeader(_,k),C=R?{x:0,y:0,width:D.boxWidth,height:0}:{x:0,y:0,width:0,height:hh},j=R?D.boxWidth:0,V=R?8:hh+8,ie=qN(l),Ae=u.pixelsPerUnit/ie.daysPerUnit(u.unit),w=Math.max(1,vr(p,m))*Ae,L=j+Kr,M=w,A=j+Kr+M+Kr,I=Math.min(a,A),S=n.today!==void 0&&n.today>=p&&n.today<=m,B=r.content.anchors.size+r.content.milestones.size>0,H=S?Fi:0,$=T?Eu:0,q=new $h({domain:[p,m],range:[L,L+w],calendar:ie}),K=Math.max(I,L+M+Kr),xe=[];for(let[W,ue]of r.content.anchors){let Re=Et(se(ue.properties,"date"));if(!Re)continue;let _r=q.forwardWithinDomain(Re);_r!==null&&xe.push({id:W,centerX:_r,radius:6,title:ue.title??W,fontSize:10,bold:!1,date:Re,isMilestone:!1})}for(let[W,ue]of r.content.milestones){let Re=Et(se(ue.properties,"date"));if(!Re)continue;let _r=q.forwardWithinDomain(Re);_r!==null&&xe.push({id:W,centerX:_r,radius:6,title:ue.title??W,fontSize:10,bold:!0,date:Re,isMilestone:!0})}let Y=oP(xe,j,K,i.estimateTextWidth),pe=B?Math.max(1,Y.rowCount):0,it=pe*26,We=H+$+it,Ye=We+8,G=R?D.cardHeight+EG:0,Z=Math.max(V,G-We),ee=Z+H,P=ee+$,Te=P+it,Ee=WN(q,u,ie,c),Ue={box:{x:L,y:Z,width:w,height:0},ticks:Ee,pixelsPerDay:Ae,originX:L,startDate:p,endDate:m,labelStyle:xt("roadmap",[],d),pillRowHeight:H,tickPanelY:ee,tickPanelHeight:$,markerRow:{y:P+13,height:it,collisionY:P-8},minorGrid:y.minorGrid},ft=new Map;for(let[W,ue]of Y.placements){let Re=P+13+ue.rowIndex*26;ft.set(W,{rowIndex:ue.rowIndex,centerY:Re,labelBox:{...ue.labelBox,y:Re-4},labelSide:ue.labelSide})}let U={cal:l,styleCtx:d,sizes:f,labels:r.content.labels,teams:r.content.teams,persons:r.content.persons,symbols:r.config.symbols,footnoteIndex:new Map,footnoteHosts:new Map,timeline:Ue,scale:q,calendar:ie,bandScale:HN(),entityLeftEdges:new Map,entityRightEdges:new Map,entityMidpoints:new Map,entityVisualLeftX:new Map,entityVisualRightX:new Map,itemArrowSource:new Map,itemFlowKey:new Map,currentFlowKey:"",itemSlackAttachY:new Map,slackCorridors:[],markerRowPlacements:ft,chartTopY:Z+Ye,chartBottomY:0,swimlaneBottomY:0,chartRightX:K};for(let W of xe){let ue=ft.get(W.id);ue&&(U.entityLeftEdges.set(W.id,W.centerX),U.entityRightEdges.set(W.id,W.centerX),U.entityMidpoints.set(W.id,{x:W.centerX,y:ue.centerY}))}let Nr=Q_(r.content.footnotes,U,0);U.footnoteIndex=Nr.index,U.footnoteHosts=Nr.hosts;let Pr=new Map(U.entityLeftEdges),de=new Map(U.entityRightEdges),Wi=new Map(U.entityMidpoints),qi=[...r.content.swimlanes.values()],Cr=xt("swimlane",[],d),es=Nk[Cr.spacing]??0,xr=()=>{let W=[],ue=U.chartTopY,Re=0,_r=U.timeline.originX;for(let EE of qi){Re>0&&(ue+=es);let{positioned:te,usedHeight:Xe,usedRightX:ot}=new lc({lane:EE,bandIndex:Re},i).place({x:U.timeline.originX,y:ue},U);W.push(te),ue+=Xe,ot>_r&&(_r=ot),Re++}return{swimlanes:W,nextY:ue,maxRightX:_r}},Ot=xr(),en=Ot.swimlanes,jt=Ot.nextY,x=bG(r.content.milestones,U);x.length>0&&(U.entityLeftEdges=new Map(Pr),U.entityRightEdges=new Map(de),U.entityMidpoints=new Map(Wi),U.itemSlackAttachY=new Map,U.entityVisualLeftX=new Map,U.entityVisualRightX=new Map,U.itemArrowSource=new Map,U.itemFlowKey=new Map,U.currentFlowKey="",U.slackCorridors=x,Ot=xr(),en=Ot.swimlanes,jt=Ot.nextY),RG(U,Ot.maxRightX+Kr);for(let W of en)W.box.width=U.chartRightX;let N=r.content.isolatedRegions,X=[];if(N.length>0){let W=tP(N,U,jt+8,i);X=W.regions,jt=W.endY}U.chartBottomY=jt,U.swimlaneBottomY=jt,Ue.box.height=U.chartBottomY-Ue.box.y;let z=nP(r.content.milestones,U),Be=xe.map(W=>({id:W.id,centerX:W.centerX,radius:W.radius,title:W.title,fontSize:W.fontSize,bold:W.bold}));for(let W of z)W.fixed||Be.push({id:W.id??"",centerX:W.center.x,radius:W.radius,title:W.title,fontSize:10,bold:!0});let Se=oP(Be,j,U.chartRightX,i.estimateTextWidth);U.markerRowPlacements.clear();for(let[W,ue]of Se.placements){let Re=P+13+ue.rowIndex*26;U.markerRowPlacements.set(W,{rowIndex:ue.rowIndex,centerY:Re,labelBox:{...ue.labelBox,y:Re-4},labelSide:ue.labelSide})}for(let W of z){let ue=U.markerRowPlacements.get(W.id??"");ue&&(W.center={x:W.center.x,y:ue.centerY},W.labelBox=ue.labelBox,W.labelSide=ue.labelSide)}for(let W of xe){let ue=U.markerRowPlacements.get(W.id);ue&&U.entityMidpoints.set(W.id,{x:W.centerX,y:ue.centerY})}for(let W of z)W.fixed||U.entityMidpoints.set(W.id??"",{x:W.center.x,y:W.center.y});let Le=B?Math.max(1,Se.rowCount):0;if(Le>pe){let W=(Le-pe)*26;U.timeline.markerRow.height=Le*26,U.timeline.box.height+=W,U.chartTopY+=W,U.chartBottomY+=W,U.swimlaneBottomY+=W;for(let ue of en)tE(ue,W);for(let ue of X)wG(ue,W);for(let[ue,Re]of U.entityMidpoints)U.markerRowPlacements.has(ue)||U.entityMidpoints.set(ue,{x:Re.x,y:Re.y+W});for(let[ue,Re]of U.itemSlackAttachY)U.itemSlackAttachY.set(ue,Re+W);for(let ue of z)if(ue.cutTopY=U.chartTopY,ue.cutBottomY=U.swimlaneBottomY,ue.slackArrows)for(let Re of ue.slackArrows)Re.y+=W}E&&(U.timeline.bottomTickPanelY=U.chartBottomY+8,U.timeline.bottomTickPanelHeight=Eu,U.chartBottomY+=8+Eu);let je=new Set(z.map(W=>W.center.x)),ye=YN(r.content.anchors,U,je),$e=i.collectItems(qi),ve=i.buildDependencies($e,en,X,U),dt=i.buildNowline(n.today,U,c),et=Q_(r.content.footnotes,U,U.chartBottomY);U.footnoteIndex=et.index,U.footnoteHosts=et.hosts,C.height=C.height||U.chartBottomY,R||(C.width=U.chartRightX);let cr=R?{x:6,y:Te-D.cardHeight,width:D.cardWidth,height:D.cardHeight}:{x:0,y:0,width:U.chartRightX,height:hh},$t=et.area.entries.length>0?et.area.box.y+et.area.box.height:U.chartBottomY,Tr={x:U.chartRightX-Kr-b_,y:$t+Kr,width:b_,height:Dk},pc=Tr.y+Tr.height+Kr,ju={box:C,position:y.headerPosition,title:_,author:k,titleLines:D.titleLines,authorLines:D.authorLines,cardBox:cr,logo:void 0,style:y,attributionBox:Tr};return{width:U.chartRightX,height:pc,theme:o,palette:s,backgroundColor:s.surface.page,header:ju,timeline:Ue,nowline:dt,swimlanes:en,anchors:ye,milestones:z,edges:ve,footnotes:et.area,includes:X,chartBox:{x:j,y:U.chartTopY,width:U.chartRightX-j,height:U.chartBottomY-U.chartTopY}}}};function bG(t,e){let r=[];for(let[n,i]of t){let o=se(i.properties,"date"),s=yt(i.properties,"after"),a=Et(o),c=Xh(s,e),l=Gh(c);if(a){let f=e.scale.forwardWithinDomain(a);if(f===null)continue;let d=null;for(let p of l)(!d||p.x>d.x)&&(d=p);d&&d.x>f&&d.y>0&&r.push({xStart:Math.min(d.x,f),xEnd:Math.max(d.x,f),y:d.y,slackPredId:d.ref,milestoneId:n});continue}if(l.length===0)continue;l.sort((f,d)=>d.x-f.x);let u=l[0].x;for(let f=1;f<l.length;f++){let d=l[f];d.x<u&&d.y>0&&r.push({xStart:d.x,xEnd:u,y:d.y,slackPredId:d.ref,milestoneId:n})}}return r}function tE(t,e){t.box.y+=e;for(let r of t.children)sP(r,e);for(let r of t.nested)tE(r,e)}function sP(t,e){if(t.box.y+=e,t.kind==="item"){t.overflowBox&&(t.overflowBox.y+=e);for(let r of t.labelChips)r.box.y+=e;return}for(let r of t.children)sP(r,e)}function wG(t,e){t.box.y+=e;for(let r of t.nestedSwimlanes)tE(r,e)}function oP(t,e,r,n){let i=[...t].sort((a,c)=>a.centerX-c.centerX),o=new Map,s=[];for(let a of i){let c=n(a.title,a.fontSize)*(a.bold?1.05:1),l=a.centerX+a.radius+6,u=a.centerX-a.radius-6-c,f=l+c<=r,d=u>=e,p=a.centerX-a.radius,m=a.centerX+a.radius,y=j=>j==="right"?l:u,R=j=>j==="right"?f:d,T=(j,V)=>{let ie=Math.min(p,j),Ae=Math.max(m,j+c);return s[V].some(O=>O.left<Ae&&O.right>ie)},E=-1,_="right",k=l;e:for(let j=s.length-1;j>=0;j--)for(let V of["right","left"]){if(!R(V))continue;let ie=y(V);if(!T(ie,j)){E=j,_=V,k=ie;break e}}if(E===-1){for(let[j,V]of o)o.set(j,{...V,rowIndex:V.rowIndex+1});s=[[],...s],E=0,_=f?"right":"left",k=y(_)}let D=Math.min(p,k),C=Math.max(m,k+c);s[E].push({left:D,right:C}),o.set(a.id,{rowIndex:E,labelBox:{x:k,y:0,width:c,height:12},labelSide:_})}return{placements:o,rowCount:s.length}}function AG(t){return t.directive?.properties.find(r=>IG(r.key)==="locale")?.value}function IG(t){return t.endsWith(":")?t.slice(0,-1):t}function NG(t){switch(t){case"done":case"completed":return"done";case"in-progress":case"active":return"in-progress";case"at-risk":case"blocked":case"planned":return t;case void 0:return"planned";default:return"neutral"}}function PG(t){if(!t)return 0;let e=/^(\d{1,3})%$/.exec(t);return e?Math.max(0,Math.min(100,parseInt(e[1],10)))/100:0}function CG(t,e){if(t)return/^\d+(?:\.\d+)?[dwmqy]$/.test(t)||/^\d+%$/.test(t)?t:e.sizes.get(t)?.effortLiteral??t}function OG(t,e){if(t)return e.teams.get(t)?.title??e.persons.get(t)?.title??t}function LG(t){if(!t)return{icon:"none"};let e=t.toLowerCase();return e.includes("linear.app")?{icon:"linear",href:t}:e.includes("github.com")?{icon:"github",href:t}:e.includes("atlassian.net")||e.includes("jira.")?{icon:"jira",href:t}:{icon:"generic",href:t}}function Wh(t,e,r,n,i){let o=kk(t,e),s=t.name??t.title??"",a=o.padding==="none"?"xs":o.padding,c=Pk[a],l=Math.max(20,Math.round(s.length*5.5+c*2));return i!==void 0&&(l=Math.min(l,i)),{text:s,style:o,box:{x:r,y:n,width:l,height:13}}}function aE(t,e,r,n){let i=t.properties,o=xt("item",i,r.styleCtx),s=se(i,"size"),a=s?r.sizes.get(s)??null:null,c=Mi(i,r.sizes,r.cal),l=hk(i,r.sizes,r.cal),u=yt(i,"after"),f=yt(i,"before"),d=se(i,"date"),p=pk(se(i,"remaining"),r.sizes,r.cal),m=e.x,y=Et(d);if(y){let te=r.scale.forwardWithinDomain(y);te!==null&&(m=te)}else if(u.length>0){let te=e.x;for(let Xe of u){let ot=Et(Xe);if(ot){let Yn=r.scale.forwardWithinDomain(ot);Yn!==null&&(te=Math.max(te,Yn));continue}let wn=r.entityRightEdges.get(Xe);wn!==void 0&&(te=Math.max(te,wn))}m=Math.max(e.x,te)}let R=Math.max(kr,c*r.timeline.pixelsPerDay),T=m,E=m+R,_=se(i,"link"),k=LG(_),D=k.icon!=="none",C=Math.max(kr,R-2*Yr),j=yt(i,"labels"),V=[];for(let te of j){let Xe=r.labels.get(te);if(!Xe)continue;let ot=Wh(Xe,r.styleCtx,0,0);V.push({id:Xe,width:ot.box.width})}let ie=0;for(let te=0;te<V.length;te+=1)te>0&&(ie+=4),ie+=V[te].width;let Ae=Math.max(0,C-24),O=V.length>0&&ie>Ae,w=!1,L,M;if(f.length>0){let te,Xe;for(let ot of f){let wn=Et(ot),Yn=wn?r.scale.forwardWithinDomain(wn)??void 0:r.entityLeftEdges.get(ot);Yn!==void 0&&(te===void 0||Yn<te)&&(te=Yn,Xe=ot)}te!==void 0&&E>te&&(w=!0,L={x:te,y:e.y,width:E-te,height:r.bandScale.bandwidth()},M=Xe)}let A=se(i,"status"),I=NG(A),S=PG(A);S===0&&I==="done"&&(S=1);let B=/^(\d{1,3})%$/.exec(se(i,"remaining")??"");S===0&&I==="in-progress"&&B&&(S=1-Math.max(0,Math.min(100,parseInt(B[1],10)))/100),S===0&&I==="in-progress"&&p>0&&l>0&&(S=Math.max(0,Math.min(1,1-p/l)));let H={done:"#ecfdf5","in-progress":"#eff6ff","at-risk":"#fffbeb",blocked:"#fee2e2",planned:"#f8fafc",neutral:"#f8fafc"},$={done:"#052e16","in-progress":"#172554","at-risk":"#422006",blocked:"#7f1d1d",planned:"#1e293b",neutral:"#1e293b"},q={done:r.styleCtx.theme.status.done,"in-progress":r.styleCtx.theme.status.inProgress,"at-risk":r.styleCtx.theme.status.atRisk,blocked:r.styleCtx.theme.status.blocked,planned:r.styleCtx.theme.status.planned,neutral:r.styleCtx.theme.status.neutral},K=r.styleCtx.theme.name==="light",xe=K?"#ffffff":"#0f172a",Y="#94a3b8";o.bg===xe&&(o.bg=K?H[I]:$[I]),o.fg===Y&&(o.fg=q[I]);let pe=se(i,"duration"),it=!!pe&&/^\d+(?:\.\d+)?[dwmqy]$/.test(pe),We=a?a.title??a.name:"",Ye=it?pe:We||void 0,G=se(i,"remaining"),Z=CG(G,r),ee=OG(n??se(i,"owner"),r),P=()=>[Ye,ee].filter(Boolean).join(" "),Te;if(I==="in-progress"&&Z){let te=P();Te=te?`${te} \u2014 ${Z} remaining`:`${Z} remaining`}else if(I==="in-progress"&&S>0&&S<1){let te=Math.round((1-S)*100),Xe=P();Te=Xe?`${Xe} \u2014 ${te}% remaining`:`${te}% remaining`}else(ee||Ye)&&(Te=P()||void 0);let Ee=se(i,"capacity"),Ue=$i(Ee),ft=null,U=0;if(Ue!==null){let te=pu(Ue),Xe=hu(o.capacityIcon,r.symbols);ft={value:Ue,text:te,icon:Xe};let ot=11;U=(Te?bn(" ",ot):0)+Xo(te,Xe,ot)}let Nr=t.title??t.name??"",Pr=new Th({id:t.name??"",title:Nr,logicalLeftX:T,logicalRightX:E,metaText:Te,metaTrailingWidth:U,hasLinkIcon:D}).place({x:T,y:e.y},{time:r.scale,bands:r.bandScale,style:o}),de=Pr.box,Wi=r.bandScale.bandwidth(),qi=de.width<17,Cr=D&&de.width<41,es=de.width<23,xr=Pr.textSpills||Cr,Ot=null;O&&(Ot=a_(V,de.width));let en=Ot?Ot.rows.length:V.length>0?1:0,jt=Te!==void 0||ft!==null,x=fP(O,xr,en,Wi,jt);x>0&&(de.height=Wi+x);let N=[],X=de.y+Wi-Tn-13-3,z=de.y+38+3,Se=O&&xr||!O&&jt&&V.length>0?Math.max(X,z):X,Le=O?de.x+de.width+6:de.x+12,je=Le;if(Ot)for(let te=0;te<Ot.rows.length;te+=1){let Xe=Se+te*17,ot=Le;for(let Yn of Ot.rows[te]){let RE=Wh(Yn.id,r.styleCtx,ot,Xe);N.push(RE),ot+=RE.box.width+4}let wn=ot-4;wn>je&&(je=wn)}else{let te=Le;for(let Xe of V){let ot=Wh(Xe.id,r.styleCtx,te,Se);N.push(ot),te+=ot.box.width+4}je=V.length>0?te-4:Le}let ye=new Set;if(t.name){for(let[te,Xe]of r.footnoteHosts.entries())if(Xe.includes(t.name)){let ot=r.footnoteIndex.get(te);ot!==void 0&&ye.add(ot)}}let $e=[...ye].sort((te,Xe)=>te-Xe),ve=ee??n??se(i,"owner"),dt=t.description?.text,et=$e.length>0&&es,$t=de.x+de.width+6,Tr=!1,pc=null;Cr&&(Tr&&($t+=4),pc=$t,$t=pc+14,Tr=!0);let ju=0;if(xr){Tr&&($t+=4);let te=bn(Nr,13),Xe=(Te?bn(Te,11):0)+U;ju=Math.max(te,Xe),$t+=ju,Tr=!0}let tm=null;et&&(Tr&&($t+=4),tm=$t,$t+=$e.length*8,Tr=!0);let W=null;qi&&(Tr&&($t+=4),W=$t+5,$t=W+5,Tr=!0);let ue=Math.max(de.x+de.width,$t),Re=t.name;if(Re){r.entityLeftEdges.set(Re,T),r.entityRightEdges.set(Re,E),r.entityMidpoints.set(Re,{x:(T+E)/2,y:de.y+de.height/2}),r.entityVisualLeftX.set(Re,de.x),r.entityVisualRightX.set(Re,de.x+de.width);let te=xr?{x:de.x+de.width,y:de.y+de.height-Tn/2}:{x:de.x+de.width,y:de.y+de.height/2};r.itemArrowSource.set(Re,te),r.itemFlowKey.set(Re,r.currentFlowKey);let Xe=xr?de.y+de.height-Tn/2:de.y+de.height/2;r.itemSlackAttachY.set(Re,Xe)}e.x=E,e.maxX=Math.max(e.maxX,e.x),e.height=Math.max(e.height,r.bandScale.step()+x);let _r=Ek({box:de,afterDate:Hn(u),beforeDate:Hn(f),hasLinkIcon:D,footnoteCount:$e.length});return{kind:"item",id:Re,title:Nr,box:de,status:I,progressFraction:S,footnoteIndicators:$e,labelChips:N,chipsOutside:O,chipsRightX:je,linkIcon:k.icon,linkHref:k.href,hasOverflow:w,overflowBox:L,overflowAnchorId:M,owner:ve,description:dt,metaText:Te,textSpills:xr,dotSpills:qi,iconSpills:Cr,footnoteSpills:et,dotSpillCx:W,iconSpillX:pc,footnoteSpillStartX:tm,decorationsRightX:ue,capacity:ft,size:a,style:o,inlineDatePins:_r.length>0?_r:void 0}}function DG(t,e,r){return new _h(t,{sequenceOne:cE,newCursor:sh}).place(e,r)}function $G(t,e,r){return new xh(t,{sequenceItem:aE,sequenceOne:cE,resolveChildStart:pP,newCursor:sh,estimateTextWidth:bn,predictItemChipExtraHeight:dP}).place(e,r)}function cE(t,e,r){if(gr(t))return aE(t,e,r);if(Wr(t))return DG(t,e,r);if(jr(t))return $G(t,e,r);throw new Error(`Unknown swimlane child type: ${t.$type??"unknown"}`)}function bn(t,e){return t.length*e*.58}function fP(t,e,r,n,i){if(r===0)return 0;let o=n-Tn-13-3,s=41,a;t&&e?a=s:!t&&i?a=Math.max(o,s):a=o;let l=a+(r-1)*17+13+3+Tn;return Math.max(0,l-n)}function dP(t,e){let r=t.properties,n=yt(r,"labels");if(n.length===0)return 0;let i=Mi(r,e.sizes,e.cal),o=Math.max(kr,i*e.timeline.pixelsPerDay),s=Math.max(kr,o-2*Yr),a=[];for(let T of n){let E=e.labels.get(T);if(!E)continue;let _=Wh(E,e.styleCtx,0,0);a.push({id:E,width:_.box.width})}if(a.length===0)return 0;let c=0;for(let T=0;T<a.length;T+=1)T>0&&(c+=4),c+=a[T].width;let l=Math.max(0,s-24),u=c>l,f=se(r,"duration")!==void 0||se(r,"size")!==void 0||se(r,"owner")!==void 0||se(r,"remaining")!==void 0||se(r,"capacity")!==void 0,d=t.title??t.name??"",m=(d?bn(d,13):0)>l,y=u?a_(a,s):null,R=y?y.rows.length:a.length>0?1:0;return fP(u,m,R,e.bandScale.bandwidth(),f)}function pP(t,e,r,n){let i=Et(se(t,"date"))??Et(se(t,"start"));if(i){let s=n.scale.forwardWithinDomain(i);if(s!==null)return s}let o=yt(t,"after");if(o.length>0){let s=r;for(let a of o){let c=Et(a);if(c){let u=n.scale.forwardWithinDomain(c);u!==null&&(s=Math.max(s,u));continue}let l=n.entityRightEdges.get(a);l!==void 0&&(s=Math.max(s,l))}return Math.max(r,s)}return e}var rE=6;function aP(t,e,r){if(!t)return[];let n=t.split(/\s+/).filter(s=>s.length>0);if(n.length===0)return[];let i=[],o="";for(let s of n){let a=o?`${o} ${s}`:s;o&&bn(a,r)>e?(i.push(o),o=s):o=a}return o&&i.push(o),i}function MG(t,e){let r=x_-32,n=aP(t,r,16),i=aP(e??"",r,11),o=0;for(let d of n)o=Math.max(o,bn(d,16));for(let d of i)o=Math.max(o,bn(d,11));let s=o+32,a=Math.max(Ok-rE,Math.min(x_-rE,s)),c=n.length>0?(n.length-1)*20:0,l=i.length>0?18+(i.length-1)*14:0,u=26+c+l+14,f=a+rE;return{titleLines:n,authorLines:i,cardWidth:a,cardHeight:u,boxWidth:f}}function FG(t,e,r,n,i){let s=t.roadmapDecl?.properties??[],a=se(s,"start"),c=Et(a)??UG(n),l=se(s,"length");if(l){let p=BG(l,e.cal);if(p>0)return{startDate:c,endDate:Go(c,p)}}let u=hP(r,e,c,n),f=zN(i.unit,e.cal),d=u>0?Math.ceil(u/f)*f:4*e.cal.daysPerWeek;return{startDate:c,endDate:Go(c,Math.max(1,d))}}function UG(t){let e=t??new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))}function BG(t,e){let r=/^(\d+(?:\.\d+)?)([dwmqy])$/.exec(t);if(!r)return 0;let n=parseFloat(r[1]);switch(r[2]){case"d":return n;case"w":return n*e.daysPerWeek;case"m":return n*e.daysPerMonth;case"q":return n*e.daysPerQuarter;case"y":return n*e.daysPerYear;default:return 0}}function hP(t,e,r,n){let i=new Map,o=new Map,s=new Map,a=0,c=f=>{let d=Et(f);return d?vr(r,d):i.has(f)?i.get(f):o.has(f)?o.get(f):s.has(f)?s.get(f):0};for(let f of t.content.anchors.values()){let d=Et(se(f.properties,"date"));if(d&&f.name){let p=vr(r,d);o.set(f.name,p),a=Math.max(a,p)}}let l=(f,d)=>{let p=d;for(let m of f)m.$type!=="DescriptionDirective"&&(p=u(m,p),a=Math.max(a,p));return p},u=(f,d)=>{if(gr(f)){let p=Mi(f.properties,e.sizes,e.cal),m=Et(se(f.properties,"date")),y=Et(se(f.properties,"start")),R=yt(f.properties,"after"),T=d;m?T=vr(r,m):y?T=vr(r,y):R.length>0&&(T=Math.max(d,...R.map(c)));let E=T+p;return f.name&&i.set(f.name,E),E}if(Wr(f)){let p=yt(f.properties,"after"),m=p.length>0?Math.max(d,...p.map(c)):d,y=m;for(let R of f.content){if(R.$type==="DescriptionDirective")continue;let T=u(R,m);y=Math.max(y,T)}return y}if(jr(f)){let p=yt(f.properties,"after"),m=p.length>0?Math.max(d,...p.map(c)):d;return l(f.content,m)}return d};for(let f of t.content.swimlanes.values())l(f.content,0);for(let f of t.content.milestones.values()){let d=Et(se(f.properties,"date"));if(d){let m=vr(r,d);f.name&&s.set(f.name,m),a=Math.max(a,m);continue}let p=yt(f.properties,"after");if(p.length>0){let m=Math.max(0,...p.map(c));f.name&&s.set(f.name,m),a=Math.max(a,m)}}for(let f of t.content.isolatedRegions){let d=hP({config:f.config,content:f.content,diagnostics:[],processedFiles:new Set},e,r,void 0);a=Math.max(a,d)}if(n){let f=vr(r,n);f>0&&(a=Math.max(a,f))}return a}function XG(t,e,r,n){let i=new rh(mk(e,r)),o=[],s=[];for(let[l,u]of t){let f=yt(u.properties,"after"),d=n.entityMidpoints.get(l),p=n.entityVisualLeftX.get(l);if(!d||p===void 0)continue;let m={x:p,y:d.y};for(let y of f){let R=n.itemArrowSource.get(y),T,E=R===void 0;if(R)T=R;else{let _=n.entityMidpoints.get(y);if(!_)continue;T={x:_.x,y:d.y}}!E&&Math.abs(T.y-m.y)<.5&&m.x-T.x<20||(o.push({fromId:y,toId:l,from:T,to:m,isMarkerSource:E}),s.push({fromId:y,toId:l}))}}let a=gk(o,i),c=[];for(let l=0;l<a.length;l++){let u=a[l];c.push({fromId:s[l].fromId,toId:s[l].toId,waypoints:u.waypoints,kind:u.underBar?"underBar":"normal",style:xt("item",[],n.styleCtx)})}return c}function GG(t,e,r){if(!t)return null;let n=e.scale.forwardWithinDomain(t);if(n===null)return null;let i=e.timeline.box.y,o=e.timeline.tickPanelY,s=nh(r).nowLabel,a=bn(s,wu),c=Math.max(m_,Math.ceil(a+2*Za)),l=e.timeline.originX-Kr,u=c/2,f;n-u<l?f="flag-right":n+u>e.chartRightX?f="flag-left":f="center";let d=e.timeline.bottomTickPanelY,p=e.timeline.bottomTickPanelHeight??0,m=d!==void 0&&p>0?d+p:e.swimlaneBottomY;return{x:n,topY:o,bottomY:m,pillTopY:i,pillMode:f,label:s,pillWidth:c,style:xt("item",[],e.styleCtx)}}function HG(t){let e=new Map,r=n=>{if(gr(n)){n.name&&e.set(n.name,n);return}if(Wr(n)){for(let i of n.content)i.$type!=="DescriptionDirective"&&r(i);return}if(jr(n)){for(let i of n.content)i.$type!=="DescriptionDirective"&&r(i);return}};for(let n of t)for(let i of n.content)i.$type!=="DescriptionDirective"&&r(i);return e}function lE(t,e,r={}){return new jh().place(t,e,r,{sequenceItem:aE,sequenceOne:cE,resolveChildStart:pP,newCursor:sh,estimateTextWidth:bn,predictItemChipExtraHeight:dP,computeDateWindow:FG,sizeBesideHeader:MG,collectItems:HG,buildDependencies:XG,buildNowline:GG})}var ji={person:{viewBox:"0 0 24 24",body:'<circle cx="12" cy="8" r="4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M4 21a8 8 0 0 1 16 0" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"p"},people:{viewBox:"0 0 24 24",body:'<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><circle cx="9" cy="7" r="4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M22 21v-2a4 4 0 0 0-3-3.87" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M16 3.13a4 4 0 0 1 0 7.75" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"P"},points:{viewBox:"0 0 24 24",body:'<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" fill="currentColor" stroke="currentColor" stroke-width="1" stroke-linejoin="round"/>',ascii:"*"},time:{viewBox:"0 0 24 24",body:'<line x1="10" x2="14" y1="2" y2="2" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="12" x2="15" y1="14" y2="11" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><circle cx="12" cy="14" r="8" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"t"}},jG={calendar:{viewBox:"0 0 24 24",body:'<rect x="3" y="4" width="18" height="18" rx="2" ry="2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="16" x2="16" y1="2" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="8" x2="8" y1="2" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="3" x2="21" y1="10" y2="10" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"d"}},mP={...ji,...jG};var poe={none:"",multiplier:"x",person:ji.person.ascii,people:ji.people.ascii,points:ji.points.ascii,time:ji.time.ascii};var Kh=class{constructor(e="nl"){le(this,"prefix");le(this,"counter",0);this.prefix=e}next(e){let r=`${this.prefix}-${this.counter++}`;return e?`${r}-${e}`:r}};var WG=new Set(["svg","g","defs","symbol","use","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","linearGradient","radialGradient","stop","clipPath","mask","pattern","filter","feGaussianBlur","feColorMatrix","feOffset","feMerge","feMergeNode","feFlood","feComposite","feBlend","feDropShadow","image"]),qG=new Set(["d","x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","width","height","viewBox","preserveAspectRatio","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-opacity","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-dasharray","stroke-dashoffset","opacity","transform","points","id","class","clip-path","mask","filter","font-family","font-size","font-weight","font-style","text-anchor","dx","dy","rotate","letter-spacing","word-spacing","style","xmlns","href","xlink:href","offset","stop-color","stop-opacity","gradientUnits","gradientTransform","spreadMethod","maskUnits","maskContentUnits","stdDeviation","values","in","in2","mode","type","result","flood-color","flood-opacity","patternUnits","patternContentUnits","role","aria-label"]);function zG(t){let e=[],r=0,n=t.length;for(;r<n;){if(t[r]!=="<"){let u=r;for(;r<n&&t[r]!=="<";)r++;let f=t.slice(u,r);f.trim().length>0?e.push({kind:"text",text:f}):f.length>0&&e.push({kind:"text",text:f});continue}if(t.startsWith("<!--",r)){let u=t.indexOf("-->",r+4);if(u<0)break;e.push({kind:"comment",text:t.slice(r+4,u)}),r=u+3;continue}if(t.startsWith("<![CDATA[",r)){let u=t.indexOf("]]>",r+9);if(u<0)break;e.push({kind:"cdata",text:t.slice(r+9,u)}),r=u+3;continue}if(t.startsWith("<?",r)){let u=t.indexOf("?>",r+2);if(u<0)break;e.push({kind:"decl",text:t.slice(r+2,u)}),r=u+2;continue}if(t.startsWith("<!",r)){let u=t.indexOf(">",r+2);if(u<0)break;e.push({kind:"decl",text:t.slice(r+2,u)}),r=u+1;continue}if(t[r+1]==="/"){let u=t.indexOf(">",r+2);if(u<0)break;let f=t.slice(r+2,u).trim();e.push({kind:"close",name:f}),r=u+1;continue}let i=VG(t,r);if(i<0)break;let o=t.slice(r+1,i).trim(),s=o.endsWith("/"),a=s?o.slice(0,-1).trim():o,{name:c,attrs:l}=YG(a);e.push({kind:s?"self":"open",name:c,attrs:l}),r=i+1}return e}function VG(t,e){let r=e+1,n=null;for(;r<t.length;){let i=t[r];if(n)i===n&&(n=null);else if(i==='"'||i==="'")n=i;else if(i===">")return r;r++}return-1}function YG(t){let e=0;for(;e<t.length&&/\s/.test(t[e]);)e++;let r=e;for(;e<t.length&&!/\s/.test(t[e]);)e++;let n=t.slice(r,e),i={};for(;e<t.length;){for(;e<t.length&&/\s/.test(t[e]);)e++;if(e>=t.length)break;let o=e;for(;e<t.length&&t[e]!=="="&&!/\s/.test(t[e]);)e++;let s=t.slice(o,e);if(e>=t.length||t[e]!=="="){s&&(i[s]="");continue}if(e++,e>=t.length)break;let a=t[e];if(a!=='"'&&a!=="'"){let l=e;for(;e<t.length&&!/\s/.test(t[e]);)e++;i[s]=t.slice(l,e);continue}e++;let c=e;for(;e<t.length&&t[e]!==a;)e++;i[s]=t.slice(c,e),e<t.length&&e++}return{name:n,attrs:i}}function Gu(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function KG(t,e){if(t.startsWith("#")){let r=e.get(t.slice(1));return r?`#${r}`:null}if(/^url\(#[^)]+\)$/.test(t)){let r=t.slice(5,-1),n=e.get(r);return n?`url(#${n})`:null}return null}function gP(t,e={}){let r=e.idPrefix??"nl-logo",n=e.onWarn??(()=>{}),i=zG(t),o=new Map,s=0;for(let l of i)if((l.kind==="open"||l.kind==="self")&&l.attrs&&"id"in l.attrs){let u=l.attrs.id;u&&!o.has(u)&&o.set(u,`${r}-${s++}`)}let a=[],c=[];for(let l of i)if(l.kind!=="comment"&&l.kind!=="decl"){if(l.kind==="cdata"){c[c.length-1]&&a.push(Gu(l.text??""));continue}if(l.kind==="text"){if(c.length===0||c[c.length-1]){let u=(l.text??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");a.push(u)}continue}if(l.kind==="open"||l.kind==="self"){let u=l.name??"";if(u==="script"||u==="foreignObject"||u==="animate"||u==="animateTransform"||u==="animateMotion"||u==="set"){n(`sanitizer: dropping <${u}>`),l.kind==="open"&&c.push(!1);continue}if(!WG.has(u)){n(`sanitizer: dropping unknown element <${u}>`),l.kind==="open"&&c.push(!1);continue}let f=[`<${u}`],d=Object.keys(l.attrs??{}).sort();for(let p of d){let m=l.attrs[p];if(/^on/i.test(p)){n(`sanitizer: dropping event handler ${p}`);continue}if(!qG.has(p)){n(`sanitizer: dropping attribute ${p}`);continue}if(p==="href"||p==="xlink:href"){let y=KG(m,o);if(y===null){n(`sanitizer: dropping external href ${m}`);continue}f.push(` ${p}="${Gu(y)}"`);continue}if(p==="style"){n("sanitizer: dropping inline style");continue}if(p==="id"){let y=o.get(m);y&&f.push(` id="${Gu(y)}"`);continue}if(/\burl\(#/i.test(m)){let y=m.replace(/url\(#([^)]+)\)/gi,(R,T)=>{let E=o.get(T);return E?`url(#${E})`:"none"});f.push(` ${p}="${Gu(y)}"`);continue}if(/data:|javascript:|vbscript:/i.test(m)){n(`sanitizer: dropping suspicious value at ${p}`);continue}f.push(` ${p}="${Gu(m)}"`)}f.push(l.kind==="self"?"/>":">"),a.push(f.join("")),l.kind==="open"&&c.push(!0);continue}l.kind==="close"&&c.pop()&&a.push(`</${l.name}>`)}return a.join("")}var yP=/&/g,xP=/</g,TP=/>/g,ZG=/"/g,JG=/'/g;function ar(t){return t.replace(yP,"&amp;").replace(xP,"&lt;").replace(TP,"&gt;")}function Vn(t){return t.replace(yP,"&amp;").replace(xP,"&lt;").replace(TP,"&gt;").replace(ZG,"&quot;").replace(JG,"&#39;")}function dc(t){let e=Object.keys(t).sort(),r=[];for(let n of e){let i=t[n];i==null||i===!1||(i===!0?r.push(n):r.push(`${n}="${Vn(String(i))}"`))}return r.length?` ${r.join(" ")}`:""}function J(t,e,r){return r===void 0||r===""?`<${t}${dc(e)}/>`:`<${t}${dc(e)}>${r}</${t}>`}function Oe(t,e){return`<text${dc(t)}>${ar(e)}</text>`}function h(t){return Number.isFinite(t)?Number.isInteger(t)?t.toString():(Math.round(t*100)/100).toString():"0"}var QG={none:{dx:0,dy:0,stdDeviation:0,opacity:0},subtle:{dx:0,dy:1,stdDeviation:1.5,opacity:.2},soft:{dx:0,dy:3,stdDeviation:5,opacity:.3},hard:{dx:2,dy:2,stdDeviation:0,opacity:.45}};function eH(t,e){let r=`${t}-shadow-${e}`,n=QG[e],i=`<feGaussianBlur in="SourceAlpha" stdDeviation="${n.stdDeviation}"/><feOffset dx="${n.dx}" dy="${n.dy}" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="${n.opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>`;return J("filter",{id:r,x:"-50%",y:"-50%",width:"200%",height:"200%"},i)}function _P(t,e){return e==="none"?null:`url(#${t}-shadow-${e})`}function EP(t){return["subtle","soft","hard"].map(e=>eH(t,e)).join("")}var oH={thin:100,light:300,normal:400,bold:700};function sH(t){return Ya[t]??14}function fE(t,e){return{"font-family":He[t.font],"font-size":e??sH(t.textSize),"font-weight":oH[t.weight]??400,"font-style":t.italic?"italic":"normal",fill:t.text}}function aH(t){if(t.border==="dashed")return"4 3";if(t.border==="dotted")return"1 3"}function cH(t){if(!t||t==="none"||t==="transparent")return 1;let e=t.startsWith("#")?t.slice(1):t;if(e.length===3&&(e=e.split("").map(s=>s+s).join("")),e.length!==6)return 1;let r=parseInt(e.slice(0,2),16)/255,n=parseInt(e.slice(2,4),16)/255,i=parseInt(e.slice(4,6),16)/255,o=s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4;return .2126*o(r)+.7152*o(n)+.0722*o(i)}function lH(t,e){return cH(t)>=.24?e.statusDot.onLight:e.statusDot.onDark}function uE(t,e){return t.length*e*.58}function AP(t,e,r,n,i,o,s){let a=i*.58,c=e?uE(e,i):0,l=e?a:0,u=r+c+l,{text:f,icon:d}=t,p=uE(f,i),m={"font-family":o,"font-size":i,fill:s};if(!d)return Oe({x:h(u),y:h(n),...m},f);if(d.kind==="builtin"&&d.name==="multiplier")return Oe({x:h(u),y:h(n),...m},`${f}\xD7`);if(d.kind==="builtin"){let R=ji[d.name],T=Oe({x:h(u),y:h(n),...m},f),E=i*.1,_=i,k=u+p+E,D=n-i*.85,C=`<svg x="${h(k)}" y="${h(D)}" width="${h(_)}" height="${h(_)}" viewBox="${R.viewBox}" style="color:${Vn(s)}" aria-hidden="true">${R.body}</svg>`;return T+C}let y=h(i*.1);return`<text x="${h(u)}" y="${h(n)}" font-family="${Vn(o)}" font-size="${i}" fill="${Vn(s)}">${ar(f)}<tspan dx="${y}">${ar(d.text)}</tspan></text>`}var RP=.6,uH=.5;function fH(t){let{metaText:e,capacity:r,x:n,baselineY:i,fontSize:o,fontFamily:s,color:a}=t;if(!e&&!r)return"";let c={"font-family":s,"font-size":o,fill:a};if(!r)return Oe({x:h(n),y:h(i),...c},e);if(!e)return AP(r,void 0,n,i,o,s,a);let l=h(o*RP),u=`<text x="${h(n)}" y="${h(i)}" font-family="${Vn(s)}" font-size="${o}" fill="${Vn(a)}">`,{text:f,icon:d}=r;if(!d)return u+ar(e)+`<tspan dx="${l}">${ar(f)}</tspan></text>`;if(d.kind==="builtin"&&d.name==="multiplier")return u+ar(e)+`<tspan dx="${l}">${ar(f)}\xD7</tspan></text>`;if(d.kind==="literal"){let C=h(o*.1);return u+ar(e)+`<tspan dx="${l}">${ar(f)}</tspan><tspan dx="${C}">${ar(d.text)}</tspan></text>`}let p=ji[d.name],m=C=>C.length*o*uH,y=n+m(e)+o*RP,R=o*.1,T=o,E=y+m(f)+R,_=i-o*.85,k=u+ar(e)+`<tspan dx="${l}">${ar(f)}</tspan></text>`,D=`<svg x="${h(E)}" y="${h(_)}" width="${h(T)}" height="${h(T)}" viewBox="${p.viewBox}" style="color:${Vn(a)}" aria-hidden="true">${p.body}</svg>`;return k+D}function dH(t,e){let r=mP.calendar,n=`<svg x="${h(t.glyphTopLeft.x)}" y="${h(t.glyphTopLeft.y)}" width="${h(t.glyphSize)}" height="${h(t.glyphSize)}" viewBox="${r.viewBox}" style="color:${Vn(e)}" aria-hidden="true">${r.body}</svg>`,i=`<title>${ar(t.isoDate)}</title>`;return J("g",{"data-layer":"inline-date-pin","data-side":t.side,"data-date":t.isoDate,"data-spilled":t.spilled?"true":null},i+n)}function dE(t,e){return!t||t.length===0?"":t.map(r=>dH(r,e)).join("")}function pH(t,e,r,n,i,o={}){let s=Math.min(ah[i.cornerRadius]??4,n/2);return J("rect",{x:h(t),y:h(e),width:h(r),height:h(n),rx:h(s),ry:h(s),fill:i.bg==="none"?"transparent":i.bg,stroke:i.fg,"stroke-width":1,"stroke-dasharray":aH(i)??null,...o})}function hH(t,e,r){let n=t.box.x+t.cardBox.x,i=t.box.y+t.cardBox.y,o=t.cardBox.width,s=t.cardBox.height,a=t.style.bg==="none"?r.surface.headerBox:t.style.bg,c=r.header.cardBorder,l=J("rect",{x:h(n),y:h(i),width:h(o),height:h(s),rx:6,ry:6,fill:a,stroke:c,"stroke-width":1,filter:`url(#${e}-shadow-subtle)`}),u=[];t.titleLines.forEach((R,T)=>{u.push(Oe({x:h(n+16),y:h(i+26+T*20),"font-family":He[t.style.font],"font-size":16,"font-weight":600,fill:t.style.text},R))});let f=u.join(""),d=i+26+Math.max(0,t.titleLines.length-1)*20,p=r.header.author,m=[];t.authorLines.forEach((R,T)=>{m.push(Oe({x:h(n+16),y:h(d+18+T*14),"font-family":He[t.style.font],"font-size":11,fill:p},R))});let y=m.join("");return J("g",{"data-layer":"header","data-id":`${e}-header`},l+f+y)}function mH(t,e,r){let n=r.timeline.gridLine,i=r.timeline.minorGridLine,o=t.bottomTickPanelHeight??0,s=t.bottomTickPanelY!==void 0&&o>0,a=t.tickPanelY,c=s?t.bottomTickPanelY+o:t.box.y+t.box.height,l=e,u=t.box.y+t.box.height,f=[];for(let d of t.ticks)if(d.major)f.push(J("line",{x1:h(d.x),y1:h(a),x2:h(d.x),y2:h(c),stroke:n,"stroke-width":1}));else if(t.minorGrid){if(d.labelX===void 0)continue;f.push(J("line",{x1:h(d.x),y1:h(l),x2:h(d.x),y2:h(u),stroke:i,"stroke-width":1}))}return J("g",{"data-layer":"grid"},f.join(""))}function gH(t,e){let r=e.timeline.panelFill,n=e.timeline.border,i=e.timeline.labelText,o=[],s=t.tickPanelY,a=t.tickPanelHeight,c=a>0,l=t.markerRow.height>0,u=s+a,f=t.markerRow.height,d=t.bottomTickPanelY,p=t.bottomTickPanelHeight??0,m=d!==void 0&&p>0;c&&o.push(J("rect",{x:h(t.box.x),y:h(s),width:h(t.box.width),height:h(a),rx:4,ry:4,fill:r,stroke:n,"stroke-width":1})),l&&o.push(J("rect",{x:h(t.box.x),y:h(u),width:h(t.box.width),height:h(f),rx:4,ry:4,fill:r,stroke:n,"stroke-width":1})),m&&o.push(J("rect",{x:h(t.box.x),y:h(d),width:h(t.box.width),height:h(p),rx:4,ry:4,fill:r,stroke:n,"stroke-width":1}));for(let y of t.ticks)y.major&&(!y.label||y.labelX===void 0||(c&&o.push(Oe({x:h(y.labelX),y:h(s+ch),"font-family":He.sans,"font-size":10,fill:i,"text-anchor":"middle"},y.label)),m&&o.push(Oe({x:h(y.labelX),y:h(d+ch),"font-family":He.sans,"font-size":10,fill:i,"text-anchor":"middle"},y.label))));return J("g",{"data-layer":"timeline"},o.join(""))}function yH(t,e){if(!t)return"";let r=e.nowline.stroke,n=e.nowline.labelText,i=J("line",{x1:h(t.x),y1:h(t.topY),x2:h(t.x),y2:h(t.bottomY),stroke:r,"stroke-width":ph}),o=xH(t,r),s=TH(t,n);return J("g",{"data-layer":"nowline"},i+o+s)}function IP(t){let e=ph/2;return t.pillMode==="flag-right"?t.x-e:t.pillMode==="flag-left"?t.x+e:t.x}function xH(t,e){let r=t.pillTopY,n=t.pillTopY+Fi,i=g_,o=t.pillWidth;if(t.pillMode==="center")return J("rect",{x:h(t.x-o/2),y:h(r),width:h(o),height:h(Fi),rx:i,ry:i,fill:e});let s=IP(t);if(t.pillMode==="flag-right"){let l=s+o,u=[`M ${h(s)} ${h(r)}`,`L ${h(l-i)} ${h(r)}`,`A ${i} ${i} 0 0 1 ${h(l)} ${h(r+i)}`,`L ${h(l)} ${h(n-i)}`,`A ${i} ${i} 0 0 1 ${h(l-i)} ${h(n)}`,`L ${h(s)} ${h(n)}`,"Z"].join(" ");return J("path",{d:u,fill:e})}let a=s-o,c=[`M ${h(s)} ${h(r)}`,`L ${h(a+i)} ${h(r)}`,`A ${i} ${i} 0 0 0 ${h(a)} ${h(r+i)}`,`L ${h(a)} ${h(n-i)}`,`A ${i} ${i} 0 0 0 ${h(a+i)} ${h(n)}`,`L ${h(s)} ${h(n)}`,"Z"].join(" ");return J("path",{d:c,fill:e})}function TH(t,e){let r=t.pillTopY+y_,n=IP(t),i,o;return t.pillMode==="center"?(i=t.x,o="middle"):t.pillMode==="flag-right"?(i=n+Za,o="start"):(i=n-Za,o="end"),Oe({x:h(i),y:h(r),"font-family":He.sans,"font-size":wu,"font-weight":700,fill:e,"text-anchor":o},t.label)}function _H(t,e,r,n){let i=[],o=_P(r,t.style.shadow);i.push(pH(t.box.x,t.box.y,t.box.width,t.box.height,t.style,{filter:o??null}));let s=lH(t.style.bg,n),a={done:s.done,"in-progress":s.inProgress,"at-risk":s.atRisk,blocked:s.blocked,planned:s.planned,neutral:s.neutral},c=a[t.status]??a.neutral;if(t.progressFraction>0){let y=Math.max(0,Math.min(t.box.width,t.box.width*t.progressFraction));i.push(J("rect",{x:h(t.box.x),y:h(t.box.y+t.box.height-Tn),width:h(y),height:Tn,fill:t.style.fg,opacity:.55}))}let l=t.dotSpills&&t.dotSpillCx!==null?t.dotSpillCx:t.box.x+t.box.width-12;i.push(J("circle",{cx:h(l),cy:h(t.box.y+12),r:5,fill:c})),i.push(dE(t.inlineDatePins,t.style.fg));let u;t.textSpills?(u=t.box.x+t.box.width+6,t.iconSpills&&(u+=18)):u=t.box.x+12;let f=t.style.text,d=n.entities.item.text,p=t.textSpills?d:f,m=t.textSpills?d:t.style.fg;if(t.title&&i.push(Oe({x:h(u),y:h(t.box.y+20),"font-family":He[t.style.font],"font-size":13,"font-weight":600,fill:p},t.title)),(t.metaText||t.capacity)&&i.push(fH({metaText:t.metaText,capacity:t.capacity,x:u,baselineY:t.box.y+38,fontSize:11,fontFamily:He[t.style.font],color:m})),t.footnoteIndicators.length>0){let y=t.box.y+14;if(t.footnoteSpills&&t.footnoteSpillStartX!==null){let R=t.footnoteSpillStartX;for(let T=0;T<t.footnoteIndicators.length;T++){let E=t.footnoteIndicators[T];i.push(Oe({x:h(R),y:h(y),"font-family":He.sans,"font-size":10,"font-weight":700,fill:d},String(E))),R+=8}}else{let R=t.box.x+t.box.width-22;for(let T=t.footnoteIndicators.length-1;T>=0;T--){let E=t.footnoteIndicators[T];i.push(Oe({x:h(R),y:h(y),"font-family":He.sans,"font-size":10,"font-weight":700,fill:t.style.text,"text-anchor":"end"},String(E))),R-=8}}}if(!e.noLinks&&t.linkIcon&&t.linkIcon!=="none"){let y={linear:"#5e6ad2",github:"#0f172a",jira:"#0052cc",generic:n.item.linkIconFg},R=y[t.linkIcon]??y.generic,T=14,E=t.iconSpills&&t.iconSpillX!==null?t.iconSpillX:t.box.x+6,_=t.box.y+6,k=J("rect",{x:h(E),y:h(_),width:T,height:T,rx:2,ry:2,fill:R}),D=E,C=_,j=J("path",{d:`M${h(D+4)} ${h(C+10)} L${h(D+10)} ${h(C+4)} M${h(D+6)} ${h(C+4)} H${h(D+10)} V${h(C+8)}`,stroke:"#ffffff",fill:"none","stroke-width":1.1,"stroke-linecap":"round","stroke-linejoin":"round"}),V=k+j,ie=t.linkHref?J("a",{href:t.linkHref,target:"_blank",rel:"noopener"},V):V;i.push(ie)}if(t.hasOverflow&&t.overflowBox){let y=n.item.overflowTailFill,R=n.item.overflowTailStroke,T=n.item.overflowCaption;i.push(J("rect",{x:h(t.overflowBox.x),y:h(t.overflowBox.y),width:h(t.overflowBox.width),height:h(t.overflowBox.height),fill:y,stroke:R,"stroke-width":1})),t.overflowAnchorId&&t.overflowBox.width>60&&i.push(Oe({x:h(t.overflowBox.x+t.overflowBox.width/2),y:h(t.overflowBox.y+t.overflowBox.height/2+3),"font-family":He.sans,"font-size":9,"font-weight":700,fill:T,"text-anchor":"middle"},`past ${t.overflowAnchorId}`))}for(let y of t.labelChips){let R=Math.min(ah[y.style.cornerRadius]??8,y.box.height/2);i.push(J("rect",{x:h(y.box.x),y:h(y.box.y),width:h(y.box.width),height:h(y.box.height),rx:h(R),ry:h(R),fill:y.style.bg==="none"?"transparent":y.style.bg,stroke:y.style.fg,"stroke-width":.5})),i.push(Oe({x:h(y.box.x+y.box.width/2),y:h(y.box.y+y.box.height/2+3),...fE(y.style,Ya.xs),"text-anchor":"middle"},y.text))}return J("g",{"data-layer":"item","data-id":t.id??null},i.join(""))}function EH(t,e,r,n){let i=[];if(t.style.bg!=="none"&&t.style.bg!=="#ffffff"){if(i.push(J("rect",{x:h(t.box.x),y:h(t.box.y),width:h(t.box.width),height:h(t.box.height),rx:6,ry:6,fill:t.style.bg,stroke:t.style.fg,"stroke-width":1,"fill-opacity":.18,filter:`url(#${r}-shadow-subtle)`})),t.title){let s=t.title.length*p_+2*fh,a=t.box.x,c=t.box.y,l=bu,u=6,f=`M${h(a+u)} ${h(c)}H${h(a+s)}V${h(c+l-u)}A${u} ${u} 0 0 1 ${h(a+s-u)} ${h(c+l)}H${h(a)}V${h(c+u)}A${u} ${u} 0 0 1 ${h(a+u)} ${h(c)}Z`;i.push(J("path",{d:f,fill:t.style.fg})),i.push(Oe({x:h(a+fh),y:h(c+f_),"font-family":He[t.style.font],"font-size":d_,"font-weight":600,fill:"#ffffff"},t.title))}}else{let s=t.style.fg;if(t.style.bracket!=="none"){let c=t.box.y+t.box.height,l=t.style.bracket==="dashed"?"3 2":null,u=t.title?`M${h(t.box.x+4)} ${h(t.box.y-Ka)} L${h(t.box.x)} ${h(t.box.y-Ka)} L${h(t.box.x)} ${h(c)} L${h(t.box.x+4)} ${h(c)}`:`M${h(t.box.x)} ${h(t.box.y)} L${h(t.box.x)} ${h(c)} L${h(t.box.x+4)} ${h(c)}`;i.push(J("path",{d:u,fill:"none",stroke:s,"stroke-width":1,"stroke-dasharray":l}))}t.title&&i.push(Oe({x:h(t.box.x+6),y:h(t.box.y-2),...fE(t.style,Ya.xs),"fill-opacity":.7},t.title))}i.push(dE(t.inlineDatePins,t.style.fg));for(let s of t.children)i.push(pE(s,e,r,n));return J("g",{"data-layer":"group","data-id":t.id??null},i.join(""))}function RH(t,e,r,n){let i=[];if(t.style.bracket==="solid"||t.style.bracket==="dashed"){let a=t.box.y-12,c=t.box.y+t.box.height+12,l=t.box.x,u=t.box.x+t.box.width,f=n.parallel.bracketStroke;i.push(J("path",{d:`M${h(l+4)} ${h(a)} H${h(l)} V${h(c)} H${h(l+4)}`,fill:"none",stroke:f,"stroke-width":1.25,"stroke-dasharray":t.style.bracket==="dashed"?"3 3":null,"stroke-linejoin":"round"})),i.push(J("path",{d:`M${h(u-4)} ${h(a)} H${h(u)} V${h(c)} H${h(u-4)}`,fill:"none",stroke:f,"stroke-width":1.25,"stroke-dasharray":t.style.bracket==="dashed"?"3 3":null,"stroke-linejoin":"round"}))}t.title&&i.push(Oe({x:h(t.box.x+4),y:h(t.box.y-2),...fE(t.style,Ya.xs),"fill-opacity":.7},t.title)),i.push(dE(t.inlineDatePins,t.style.fg));for(let o of t.children)i.push(pE(o,e,r,n));return J("g",{"data-layer":"parallel","data-id":t.id??null},i.join(""))}function pE(t,e,r,n){return t.kind==="item"?_H(t,e,r,n):t.kind==="group"?EH(t,e,r,n):RH(t,e,r,n)}var bP=2;function bH(t,e){switch(t){case"green":return e.swimlane.utilizationOk;case"yellow":return e.swimlane.utilizationWarn;case"red":return e.swimlane.utilizationOver}}function wH(t,e){if(!t.utilization||t.utilization.segments.length===0)return"";let r=t.box.y+t.box.height-bP,n=t.utilization.segments.map(i=>{let o=i.endX-i.startX;return o<=0?"":J("rect",{x:h(i.startX),y:h(r),width:h(o),height:bP,fill:bH(i.classification,e),"data-utilization":i.classification,"data-load":h(i.load)})});return J("g",{"data-layer":"lane-utilization","data-id":t.id??null},n.join(""))}function AH(t,e){let r=t.bandIndex%2===0?e.swimlane.rowTintEven:e.swimlane.rowTintOdd,n=e.swimlane.border;return J("g",{"data-layer":"swimlane-bg","data-id":t.id??null},J("rect",{x:h(t.box.x),y:h(t.box.y),width:h(t.box.width),height:h(t.box.height),fill:r,stroke:n,"stroke-width":1}))}function SP(t,e,r,n){let i=n.swimlane.tabFill,o=n.swimlane.tabStroke,s=n.swimlane.tabText,a=n.swimlane.ownerText,c=n.swimlane.footnoteIndicator,l=[];if(t.title){let f=t.capacity?Xo(t.capacity.text,t.capacity.icon,10):0,d=t.footnoteIndicators.length>0?t.footnoteIndicators.join(","):"",p=d?uE(d,10):0,m=mu(t.box.x,t.title,t.owner,f,p),y=lh,R=t.box.y+10,T=R+uh;l.push(J("rect",{x:h(m.tabX),y:h(R),width:h(m.tabW),height:h(y),rx:4,ry:4,fill:i,stroke:o,"stroke-width":1})),l.push(Oe({x:h(m.titleX),y:h(T),"font-family":He[t.style.font],"font-size":12,"font-weight":600,fill:s},t.title)),t.owner&&l.push(Oe({x:h(m.ownerX),y:h(T),"font-family":He[t.style.font],"font-size":10,fill:a},`owner: ${t.owner}`)),t.capacity&&l.push(AP(t.capacity,void 0,m.badgeX,T,10,He[t.style.font],a)),d&&l.push(Oe({x:h(m.footnoteRightX),y:h(R+14),"font-family":He.sans,"font-size":10,"font-weight":700,fill:c,"text-anchor":"end"},d))}for(let u of t.children)l.push(pE(u,e,r,n));return l.push(wH(t,n)),J("g",{"data-layer":"swimlane","data-id":t.id??null},l.join(""))}function IH(t,e){let r=t.radius,n=t.center.x,i=t.center.y,o=e.anchorDiamond.fill,s=e.anchorDiamond.stroke,a=J("path",{d:`M${h(n)} ${h(i-r)} L${h(n+r)} ${h(i)} L${h(n)} ${h(i+r)} L${h(n-r)} ${h(i)} Z`,fill:o,stroke:s,"stroke-width":1.25}),c=e.anchorDiamond.label,l=t.labelSide==="left"?t.labelBox.x+t.labelBox.width:t.labelBox.x,u={x:h(l),y:h(i+4),"font-family":He.sans,"font-size":10,fill:c};t.labelSide==="left"&&(u["text-anchor"]="end");let f=t.title?Oe(u,t.title):"";return J("g",{"data-layer":"anchor","data-id":t.id??null},a+f)}function SH(t,e){let r=e.anchorDiamond.cutLine;return J("line",{x1:h(t.center.x),y1:h(t.center.y+t.radius+1),x2:h(t.center.x),y2:h(t.cutBottomY),stroke:r,"stroke-width":1,"stroke-dasharray":"1 3"})}function vH(t,e){let r=t.center.x,n=t.center.y,i=t.radius,o=e.milestoneDiamond.fill,s=J("path",{d:`M${h(r)} ${h(n-i)} L${h(r+i)} ${h(n)} L${h(r)} ${h(n+i)} L${h(r-i)} ${h(n)} Z`,fill:o,stroke:o,"stroke-width":1}),a=e.milestoneDiamond.label,c=t.labelSide==="left"?t.labelBox.x+t.labelBox.width:t.labelBox.x,l={x:h(c),y:h(n+4),"font-family":He.sans,"font-size":10,"font-weight":600,fill:a};t.labelSide==="left"&&(l["text-anchor"]="end");let u=t.title?Oe(l,t.title):"";return J("g",{"data-layer":"milestone","data-id":t.id??null},s+u)}function kH(t,e){let r=t.isOverrun?e.milestoneDiamond.cutLineOverrun:e.milestoneDiamond.cutLineNormal,n=[];if(n.push(J("line",{x1:h(t.center.x),y1:h(t.center.y+t.radius+1),x2:h(t.center.x),y2:h(t.cutBottomY),stroke:r,"stroke-width":2,"stroke-dasharray":dh,"stroke-linecap":"round"})),t.slackArrows&&t.slackArrows.length>0){let i=e.milestoneDiamond.slack;for(let o of t.slackArrows)n.push(J("path",{d:`M${h(o.x)} ${h(o.y)} H${h(t.center.x-6)}`,fill:"none",stroke:i,"stroke-width":1.1,"stroke-dasharray":"3 3","stroke-linecap":"round","marker-end":"url(#nl-arrow-dark)"}))}return n.join("")}function wP(t,e){let r=t.kind==="overflow"?e.dependency.overflowStroke:e.dependency.edgeStroke,n=t.waypoints;if(n.length<2)return"";let i=t.kind==="underBar"?.8:1.1;return J("path",{d:NH(n,w_),fill:"none",stroke:r,"stroke-width":i,"stroke-dasharray":t.kind==="overflow"?"4 2":null,"stroke-linejoin":"round","marker-end":"url(#nl-arrow)"})}function NH(t,e){if(t.length<2)return"";let r=[`M${h(t[0].x)} ${h(t[0].y)}`];for(let n=1;n<t.length;n++){let i=t[n-1],o=t[n];if(n===t.length-1){r.push(`L${h(o.x)} ${h(o.y)}`);continue}let s=t[n+1],a=Math.sign(o.x-i.x),c=Math.sign(o.y-i.y),l=Math.sign(s.x-o.x),u=Math.sign(s.y-o.y),f=Math.hypot(o.x-i.x,o.y-i.y),d=Math.hypot(s.x-o.x,s.y-o.y),p=Math.min(e,f/2,d/2);if(p<=0||a!==0&&l!==0||c!==0&&u!==0){r.push(`L${h(o.x)} ${h(o.y)}`);continue}let m={x:o.x-a*p,y:o.y-c*p},y={x:o.x+l*p,y:o.y+u*p};r.push(`L${h(m.x)} ${h(m.y)}`),r.push(`Q${h(o.x)} ${h(o.y)} ${h(y.x)} ${h(y.y)}`)}return r.join(" ")}function PH(t,e,r){if(t.entries.length===0)return"";let n=r.footnotePanel.fill,i=r.footnotePanel.border,o=r.footnotePanel.header,s=r.footnotePanel.title,a=r.footnotePanel.description,c=r.footnotePanel.number,l=[];l.push(J("rect",{x:h(t.box.x),y:h(t.box.y),width:h(t.box.width),height:h(t.box.height),rx:6,ry:6,fill:n,stroke:i,"stroke-width":1,filter:`url(#${e}-shadow-subtle)`})),l.push(Oe({x:h(t.box.x+Zr),y:h(t.box.y+T_),"font-family":He.sans,"font-size":12,"font-weight":700,fill:o},"Footnotes"));let u=t.box.y+Au+Zr,f=t.box.x+Zr,d=f+Zr;return t.entries.forEach((p,m)=>{let y=u+m*Iu;l.push(Oe({x:h(f),y:h(y),"font-family":He.sans,"font-size":10,"font-weight":700,fill:c},String(p.number))),l.push(Oe({x:h(d),y:h(y),"font-family":He.sans,"font-size":11,"font-weight":600,fill:s},p.title)),p.description&&l.push(Oe({x:h(d+Math.max(120,p.title.length*6)),y:h(y),"font-family":He.sans,"font-size":11,fill:a},`\u2014 ${p.description}`))}),J("g",{"data-layer":"footnotes"},l.join(""))}function CH(t,e,r,n){let i=n.includeRegion.border,o=n.includeRegion.fill,s=n.includeRegion.tabFill,a=n.includeRegion.tabStroke,c=n.includeRegion.tabText,l=n.includeRegion.badgeFill,u=n.includeRegion.badgeStroke,f=n.includeRegion.badgeText,d=t.box.x+8,p=t.box.y,m=t.box.width-16,y=t.box.height,R=J("rect",{x:h(d),y:h(p),width:h(m),height:h(y),rx:8,ry:8,fill:o,stroke:i,"stroke-width":1,"stroke-dasharray":dh}),T=lh,E=gu(t.box.x,t.label,t.sourcePath),_=p-T/2,k=J("rect",{x:h(E.tabX),y:h(_),width:h(E.tabWidth),height:T,rx:4,ry:4,fill:s,stroke:a,"stroke-width":1}),D=Oe({x:h(E.tabLabelX),y:h(_+uh),"font-family":He.sans,"font-size":11,"font-weight":600,fill:c},t.label),C=E.badgeX,j=E.badgeSize,V=p-j/2,ie=J("rect",{x:h(C),y:h(V),width:j,height:j,rx:4,ry:4,fill:l,stroke:u,"stroke-width":1}),Ae=J("path",{d:`M${h(C+7)} ${h(V+4)} H${h(C+14)} V${h(V+11)} M${h(C+4)} ${h(V+7)} H${h(C+11)} V${h(V+14)} H${h(C+4)} Z`,stroke:f,"stroke-width":1.4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}),O=9,w=p+4,L=J("rect",{x:h(E.sourceHaloX),y:h(w-O),width:h(E.sourceHaloWidth),height:O+6,fill:o}),M=Oe({x:h(E.sourceTextX),y:h(w),"font-family":He.mono,"font-size":O,fill:f},t.sourcePath),A=t.nestedSwimlanes.map(I=>SP(I,e,r,n)).join("");return J("g",{"data-layer":"include"},R+A+k+D+ie+Ae+L+M)}function OH(t){let e=t.palette.attribution.mark,r=t.palette.attribution.link;if(t.swimlanes.length===0)return"";let n=t.header.attributionBox.x,i=t.header.attributionBox.y,o=Ui,s=Oe({x:"0",y:o,"font-family":He.sans,"font-size":gh,"font-weight":400,fill:e},mh)+Oe({x:vu,y:o,"font-family":He.sans,"font-size":Ui,"font-weight":700,fill:e},"now")+J("rect",{x:E_,y:12,width:R_,height:Ui,fill:r})+Oe({x:yh,y:o,"font-family":He.sans,"font-size":Ui,"font-weight":400,fill:e},"ine"),a=J("g",{transform:`translate(${h(n)} ${h(i)}) scale(${h(Su)})`},s);return J("a",{href:__,target:"_blank",rel:"noopener","aria-label":"Powered by nowline"},J("g",{"data-layer":"attribution"},a))}async function LH(t,e,r,n,i,o,s){if(!e)return"";let a;try{a=await e(t)}catch(u){let f=`logo: failed to load ${t}: ${u instanceof Error?u.message:String(u)}`;if(n.strict)throw u;return n.warn?.(f),""}let c=(a.mime??"").toLowerCase();if(c==="image/svg+xml"){let u=new TextDecoder().decode(a.bytes),f=gP(u,{idPrefix:`${r}-logo`,onWarn:n.warn});return J("g",{transform:`translate(${h(i)} ${h(o)})`},f)}if(c==="image/png"||c==="image/jpeg"||c==="image/jpg"||c==="image/webp"){let u=DH(a.bytes);return J("image",{href:`data:${c};base64,${u}`,x:h(i),y:h(o),width:h(s),height:h(s),preserveAspectRatio:"xMidYMid meet"})}let l=`logo: unsupported mime ${c} for ${t}`;if(n.strict)throw new Error(l);return n.warn?.(l),""}function DH(t){if(typeof btoa<"u"){let r="";for(let n=0;n<t.length;n++)r+=String.fromCharCode(t[n]);return btoa(r)}let e=globalThis;if(e.Buffer)return e.Buffer.from(t).toString("base64");throw new Error("renderer: no base64 encoder available")}async function hE(t,e={}){let n=new Kh(e.idPrefix??"nl").next("root"),i=t.palette,o=[],s=i.arrowhead.neutral,a=i.arrowhead.light,c=i.arrowhead.dark,l=(d,p)=>`<marker id="${d}" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" fill="${p}"/></marker>`,u=`<defs>${EP(n)}`+l("nl-arrow",s)+l("nl-arrow-light",a)+l("nl-arrow-dark",c)+"</defs>";o.push(u),o.push(J("rect",{x:0,y:0,width:h(t.width),height:h(t.height),fill:t.backgroundColor})),o.push(gH(t.timeline,i));for(let d of t.swimlanes)o.push(AH(d,i));o.push(mH(t.timeline,t.chartBox.y,i));for(let d of t.edges)d.kind==="underBar"&&o.push(wP(d,i));for(let d of t.swimlanes)o.push(SP(d,e,n,i));for(let d of t.includes)o.push(CH(d,e,n,i));for(let d of t.edges)d.kind!=="underBar"&&o.push(wP(d,i));for(let d of t.anchors)o.push(SH(d,i));for(let d of t.milestones)o.push(kH(d,i));for(let d of t.anchors)o.push(IH(d,i));for(let d of t.milestones)o.push(vH(d,i));if(o.push(yH(t.nowline,i)),o.push(PH(t.footnotes,n,i)),o.push(hH(t.header,n,i)),o.push(OH(t)),t.header.logo&&e.assetResolver){let d=await LH(t.header.logo.assetRef??"",e.assetResolver,n,e,t.header.logo.box.x,t.header.logo.box.y,Math.max(t.header.logo.box.width,t.header.logo.box.height));d&&o.push(d)}return`<svg${dc({xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${h(t.width)} ${h(t.height)}`,width:h(t.width),height:h(t.height),"data-theme":t.theme,"data-generator":"nowline"})}>${o.join("")}</svg>`}var mE="/browser-source.nowline",Zh,vP=0;function kP(){return Zh||(Zh=s_()),Zh}function $H(){return mt.parse(`memory:///nowline-browser-${++vP}.nowline`)}async function Jh(t,e={}){let r=e.filePath??mE,n=kP(),o=n.shared.workspace.LangiumDocumentFactory.fromString(t,$H());await n.shared.workspace.DocumentBuilder.build([o],{validation:!0});let s=[];for(let a of o.parseResult.lexerErrors)s.push(vE(a,r));for(let a of o.parseResult.parserErrors)s.push(SE(a,r));for(let a of o.diagnostics??[])s.push(IE(a,r));return{ast:o.parseResult.value,diagnostics:s}}async function gE(t,e={}){let r=e.filePath??mE,n=await Jh(t,{filePath:r});if(n.diagnostics.some(y=>y.severity==="error"))return{kind:"diagnostics",diagnostics:n.diagnostics};let i=kP(),o=e.readFile??CE,s=await YT(n.ast,r,{services:i.Nowline,readFile:o}),a=[...n.diagnostics];for(let y of s.diagnostics){if(y.severity==="error"&&OE(y.message)){e.onSkippedInclude?.({sourcePath:y.sourcePath,message:y.message});continue}a.push(kE(y))}if(a.some(y=>y.severity==="error"))return{kind:"diagnostics",diagnostics:a};let c=e.today===null?void 0:e.today,l=lE(n.ast,s,{theme:e.theme,today:c,locale:e.locale,width:e.width}),u=e.showLinks!==!1,f=e.strict===!0,d=[],p=await hE(l,{idPrefix:e.idPrefix,assetResolver:e.assetResolver,noLinks:!u,strict:f,warn:y=>d.push(y)}),m=d.map(y=>NE(y,r,f?"error":"warning"));return f&&m.length>0?{kind:"diagnostics",diagnostics:[...a,...m]}:{kind:"svg",svg:p,warnings:m}}function yE(){Zh=void 0,vP=0}var NP="/embed.nowline",xE=!1;async function PP(t){let{ast:e,diagnostics:r}=await Jh(t,{filePath:NP});return{ast:e,errors:r.filter(n=>n.severity==="error").map(n=>n.message)}}async function Qh(t,e={}){let r={filePath:NP,theme:e.theme,today:e.today,locale:e.locale,width:e.width,idPrefix:e.idPrefix,onSkippedInclude:()=>{xE||(xE=!0,console.warn("nowline: `include` directives are skipped in the browser embed (single-file mode). Render multi-file roadmaps with the CLI or the GitHub Action."))}},n=await gE(t,r);if(n.kind==="svg")return n.svg;let i=n.diagnostics.filter(o=>o.severity==="error").map(o=>o.message);throw new Hu(`Failed to render Nowline source: ${i.join("; ")}`,i)}var Hu=class extends Error{constructor(r,n){super(r);le(this,"details",n);this.name="EmbedRenderError"}};function CP(){xE=!1,yE()}var OP=0;async function LP(t){let e=t.document??globalThis.document;if(!e)return{rendered:0,failed:0};let r=e.querySelectorAll(t.selector),n=0,i=0,o=++OP,s=[],a=0;for(let c of Array.from(r)){let l=MH(c);if(!l)continue;let u=FH(c),f=`nl-r${o}-${a++}`,d={theme:t.theme,locale:t.locale,width:t.width,today:t.today,idPrefix:f};s.push(Qh(u,d).then(p=>{UH(l,p),n++},p=>{i++,console.error("nowline: render failed",p)}))}return await Promise.all(s),{rendered:n,failed:i}}function MH(t){let e=t.parentElement;return e&&e.tagName.toUpperCase()==="PRE"?e:t}function FH(t){return t.textContent??""}function UH(t,e){t.outerHTML=e}function DP(){OP=0}function em(){if(typeof globalThis>"u")return"light";let t=globalThis.matchMedia;if(typeof t!="function")return"light";try{return t("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}}function $P(t,e){return t==="light"||t==="dark"?t:e}var BH=wE,XH=AE,GH="pre code.language-nowline, code.language-nowline",MP={theme:"auto",startOnLoad:!0,selector:GH,systemTheme:em()},Ct={...MP},TE=!1;function HH(t={}){Ct={theme:t.theme??Ct.theme,startOnLoad:t.startOnLoad??Ct.startOnLoad,selector:t.selector??Ct.selector,locale:t.locale??Ct.locale,width:t.width??Ct.width,today:t.today??Ct.today,systemTheme:em()}}function FP(){return{theme:$P(Ct.theme,Ct.systemTheme),locale:Ct.locale,width:Ct.width,today:Ct.today}}async function jH(t,e={}){let r={...FP(),...e};return Qh(t,r)}async function WH(t){return PP(t)}async function _E(t){let e={selector:t?.selector??Ct.selector,theme:t?.theme??FP().theme,locale:t?.locale??Ct.locale,width:t?.width??Ct.width,today:t?.today??Ct.today,document:t?.document};return LP(e)}var qH=_E;if(typeof document<"u"&&!TE){TE=!0;let t=()=>{Ct.startOnLoad&&_E()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):queueMicrotask(t)}function zH(){Ct={...MP,systemTheme:em()},TE=!1,CP(),DP()}return qu(VH);})();
2662
+ }`));var gU={languageId:"nowline",fileExtensions:[".nowline"],caseInsensitive:!1,mode:"development"},VI={AstReflection:()=>new hu},YI={Grammar:()=>WI(),LanguageMetaData:()=>gU,parser:{}};var KI={"NL.E0001":()=>"Config section must appear before roadmap.","NL.E0002":()=>"Include declarations must appear before the config section.","NL.E0003":()=>"Include declarations must appear before the roadmap section.","NL.E0004":()=>"At least one swimlane is required.","NL.E0005":t=>`Line ${t.line}: mixed tabs and spaces in indentation. Use either tabs or spaces consistently.`,"NL.E0100":t=>`Invalid version format "${t.version}". Expected format: v1, v2, etc.`,"NL.E0101":t=>`This file requires Nowline ${t.version}, but the parser only supports up to ${t.supported}.`,"NL.E0102":t=>`Unknown directive property "${t.key}". Allowed: ${t.allowed}.`,"NL.E0103":t=>`Duplicate directive property "${t.key}".`,"NL.E0104":t=>`Invalid locale "${t.value}". Use a BCP-47 tag like "en-US", "fr", or "fr-CA".`,"NL.E0200":t=>`Invalid include mode "${t.value}". Must be merge, ignore, or isolate.`,"NL.E0201":t=>`Duplicate "${t.key}" option on include.`,"NL.E0300":t=>`Duplicate identifier "${t.name}". First declared at ${t.location}.`,"NL.E0301":t=>`${t.type} must have an identifier, a title, or both.`,"NL.E0400":t=>`Invalid duration "${t.value}". Use a raw duration literal like 0.5d, 2w, 1m, 2q. Use "size:NAME" to reference a declared size.`,"NL.E0401":t=>`Invalid size "${t.value}". Use the id of a declared size (e.g. xs, m, lg).`,"NL.E0402":t=>`Invalid effort "${t.value}". Use a raw duration literal like 0.5d, 2w, 1m, 2q.`,"NL.E0403":t=>`Invalid remaining value "${t.value}". Use a percentage like 30% or a duration literal like 1w, 0.5d.`,"NL.E0404":t=>`Remaining must be between 0% and 100%, got ${t.value}.`,"NL.E0405":t=>`Invalid ${t.key} "${t.value}". Use ISO 8601 format: YYYY-MM-DD.`,"NL.E0406":t=>`Invalid scale "${t.value}". Use a raw duration literal like 1w, 2w, 1q (no name lookup).`,"NL.E0407":t=>`Invalid calendar "${t.value}". Must be business, full, or custom.`,"NL.E0408":t=>`Property "${t.key}" requires at least one reference.`,"NL.E0410":t=>`"${t.key}:" accepts at most one inline date per direction; collapse the multiple dates to a single binding date or use a declared anchor.`,"NL.E0411":t=>`Inline date in "${t.key}:" is not allowed on ${t.type}. Allowed only on item, parallel, and group; for a milestone use "date:" instead.`,"NL.E0412":t=>`Inline date "${t.date}" in "${t.key}:" requires the roadmap to declare "start:". Add start:YYYY-MM-DD to the roadmap.`,"NL.E0413":t=>`Inline date "${t.date}" in "${t.key}:" is before roadmap start ${t.start}.`,"NL.E0500":t=>`Anchor "${t.name}" requires a "date:" property.`,"NL.E0501":t=>`Anchor "${t.name}" has a date but the roadmap is missing "start:". Add start:YYYY-MM-DD to the roadmap.`,"NL.E0502":t=>`Anchor "${t.name}" date ${t.date} is before roadmap start ${t.start}.`,"NL.E0503":t=>`Milestone "${t.name}" requires at least one of "date:" or "after:".`,"NL.E0504":t=>`Milestone "${t.name}" date ${t.date} is before roadmap start ${t.start}.`,"NL.E0505":()=>'Footnote requires an "on:" property referencing one or more entities.',"NL.E0600":t=>`Item "${t.name}" requires a "size:" or "duration:" property.`,"NL.W0700":t=>`Unknown property "${t.key}" on ${t.entity}. The renderer ignores it.${t.suggested?` Did you mean "${t.suggested}"?`:""}`};var ZI={"NL.E0001":()=>"La section config doit pr\xE9c\xE9der la section roadmap.","NL.E0002":()=>"Les d\xE9clarations include doivent pr\xE9c\xE9der la section config.","NL.E0003":()=>"Les d\xE9clarations include doivent pr\xE9c\xE9der la section roadmap.","NL.E0004":()=>"Au moins une swimlane est requise.","NL.E0005":t=>`Ligne ${t.line}\xA0: tabulations et espaces m\xE9lang\xE9s dans l'indentation. Utilisez l'un ou l'autre, mais pas les deux.`,"NL.E0100":t=>`Format de version invalide \xAB\xA0${t.version}\xA0\xBB. Format attendu\xA0: v1, v2, etc.`,"NL.E0101":t=>`Ce fichier requiert Nowline ${t.version}, mais l'analyseur ne prend en charge que jusqu'\xE0 ${t.supported}.`,"NL.E0102":t=>`Propri\xE9t\xE9 de directive inconnue \xAB\xA0${t.key}\xA0\xBB. Valeurs admises\xA0: ${t.allowed}.`,"NL.E0103":t=>`Propri\xE9t\xE9 de directive \xAB\xA0${t.key}\xA0\xBB en double.`,"NL.E0104":t=>`Locale invalide \xAB\xA0${t.value}\xA0\xBB. Utilisez une \xE9tiquette BCP-47 telle que \xAB\xA0en-US\xA0\xBB, \xAB\xA0fr\xA0\xBB ou \xAB\xA0fr-CA\xA0\xBB.`,"NL.E0200":t=>`Mode d'include invalide \xAB\xA0${t.value}\xA0\xBB. Doit \xEAtre merge, ignore ou isolate.`,"NL.E0201":t=>`Option \xAB\xA0${t.key}\xA0\xBB en double sur include.`,"NL.E0300":t=>`Identifiant en double \xAB\xA0${t.name}\xA0\xBB. Premi\xE8re d\xE9claration \xE0 ${t.location}.`,"NL.E0301":t=>`${t.type} doit comporter un identifiant, un titre, ou les deux.`,"NL.E0400":t=>`Dur\xE9e invalide \xAB\xA0${t.value}\xA0\xBB. Utilisez un litt\xE9ral de dur\xE9e brut comme 0.5d, 2w, 1m, 2q. Utilisez \xAB\xA0size:NOM\xA0\xBB pour r\xE9f\xE9rencer une taille d\xE9clar\xE9e.`,"NL.E0401":t=>`Taille invalide \xAB\xA0${t.value}\xA0\xBB. Utilisez l'identifiant d'une taille d\xE9clar\xE9e (p.\xA0ex. xs, m, lg).`,"NL.E0402":t=>`Effort invalide \xAB\xA0${t.value}\xA0\xBB. Utilisez un litt\xE9ral de dur\xE9e brut comme 0.5d, 2w, 1m, 2q.`,"NL.E0403":t=>`Valeur restante invalide \xAB\xA0${t.value}\xA0\xBB. Utilisez un pourcentage tel que 30% ou un litt\xE9ral de dur\xE9e comme 1w, 0.5d.`,"NL.E0404":t=>`La valeur restante doit \xEAtre comprise entre 0 % et 100 %, re\xE7u ${t.value}.`,"NL.E0405":t=>`${t.key} invalide \xAB\xA0${t.value}\xA0\xBB. Utilisez le format ISO 8601\xA0: AAAA-MM-JJ.`,"NL.E0406":t=>`\xC9chelle invalide \xAB\xA0${t.value}\xA0\xBB. Utilisez un litt\xE9ral de dur\xE9e brut comme 1w, 2w, 1q (pas de recherche par nom).`,"NL.E0407":t=>`Calendrier invalide \xAB\xA0${t.value}\xA0\xBB. Doit \xEAtre business, full ou custom.`,"NL.E0408":t=>`La propri\xE9t\xE9 \xAB\xA0${t.key}\xA0\xBB exige au moins une r\xE9f\xE9rence.`,"NL.E0410":t=>`\xAB\xA0${t.key}:\xA0\xBB n'accepte qu'une seule date inline par direction\xA0; regroupez les dates en une seule date contraignante ou utilisez une ancre d\xE9clar\xE9e.`,"NL.E0411":t=>`Une date inline dans \xAB\xA0${t.key}:\xA0\xBB n'est pas autoris\xE9e sur ${t.type}. Autoris\xE9e seulement sur item, parallel et group\xA0; pour un milestone utilisez \xAB\xA0date:\xA0\xBB \xE0 la place.`,"NL.E0412":t=>`La date inline \xAB\xA0${t.date}\xA0\xBB dans \xAB\xA0${t.key}:\xA0\xBB exige que la roadmap d\xE9clare \xAB\xA0start:\xA0\xBB. Ajoutez start:AAAA-MM-JJ \xE0 la roadmap.`,"NL.E0413":t=>`La date inline \xAB\xA0${t.date}\xA0\xBB dans \xAB\xA0${t.key}:\xA0\xBB pr\xE9c\xE8de le d\xE9but de la roadmap (${t.start}).`,"NL.E0500":t=>`L'ancre \xAB\xA0${t.name}\xA0\xBB exige une propri\xE9t\xE9 \xAB\xA0date:\xA0\xBB.`,"NL.E0501":t=>`L'ancre \xAB\xA0${t.name}\xA0\xBB a une date, mais \xAB\xA0start:\xA0\xBB manque sur la roadmap. Ajoutez start:AAAA-MM-JJ \xE0 la roadmap.`,"NL.E0502":t=>`La date ${t.date} de l'ancre \xAB\xA0${t.name}\xA0\xBB pr\xE9c\xE8de le d\xE9but de la roadmap (${t.start}).`,"NL.E0503":t=>`Le jalon \xAB\xA0${t.name}\xA0\xBB exige au moins l'une des propri\xE9t\xE9s \xAB\xA0date:\xA0\xBB ou \xAB\xA0after:\xA0\xBB.`,"NL.E0504":t=>`La date ${t.date} du jalon \xAB\xA0${t.name}\xA0\xBB pr\xE9c\xE8de le d\xE9but de la roadmap (${t.start}).`,"NL.E0505":()=>"Une note de bas de page exige une propri\xE9t\xE9 \xAB\xA0on:\xA0\xBB r\xE9f\xE9ren\xE7ant au moins une entit\xE9.","NL.E0600":t=>`L'\xE9l\xE9ment \xAB\xA0${t.name}\xA0\xBB exige une propri\xE9t\xE9 \xAB\xA0size:\xA0\xBB ou \xAB\xA0duration:\xA0\xBB.`,"NL.W0700":t=>`Propri\xE9t\xE9 inconnue \xAB\xA0${t.key}\xA0\xBB sur ${t.entity}. Le moteur de rendu l'ignore.${t.suggested?` Vouliez-vous dire \xAB\xA0${t.suggested}\xA0\xBB\xA0?`:""}`};var JI={};var QI={};var yU=new Map([["en-US",KI],["fr",ZI],["fr-CA",JI],["fr-FR",QI]]);function tk(t,e,...r){for(let n of xU(t)){let o=yU.get(n)?.[e];if(o)return o(...r)}return e}var ek="en-US";function xU(t){let e=[],r=TU(t);for(;r.length>0;){e.includes(r)||e.push(r);let n=r.lastIndexOf("-");if(n<=0)break;r=r.slice(0,n)}return e.includes(ek)||e.push(ek),e}function TU(t){return t.split("-").map((r,n)=>n===0?r.toLowerCase():/^[a-zA-Z]{2}$/.test(r)?r.toUpperCase():r).join("-")}var _U=/[\\/]/;function ik(t){for(let e=t.length-1;e>=0;e--){let r=t.charCodeAt(e);if(r===47||r===92)return e}return-1}function rk(...t){for(let e of t)if(e){if(e.includes("\\")&&!e.includes("/"))return"\\";if(e.includes("/"))return"/"}return"/"}function EU(t){return t?t[0]==="/"||t[0]==="\\"?!0:t.length>=3&&/^[A-Za-z]:[\\/]/.test(t):!1}function ok(t){let e=ik(t);return e<0?".":e===0?t[0]:e===2&&/^[A-Za-z]:[\\/]/.test(t)?t.slice(0,3):t.slice(0,e)}function rh(t){let e=ik(t);return e<0?t:t.slice(e+1)}function i_(t,e){if(EU(e))return nk(e,rk(e));let r=rk(t,e);return nk(`${t}${r}${e}`,r)}function nk(t,e){let r="",n=t,i=/^([A-Za-z]:)([\\/])?/.exec(n);i?(r=i[1]+(i[2]?e:""),n=n.slice(i[0].length)):(n[0]==="/"||n[0]==="\\")&&(r=e,n=n.replace(/^[\\/]+/,""));let o=[];for(let s of n.split(_U))if(!(s===""||s===".")){if(s===".."){o.length>0&&o[o.length-1]!==".."?o.pop():r||o.push("..");continue}o.push(s)}return r+o.join(e)}var RU=/^\d{4}-\d{2}-\d{2}$/;function ck(t){let e=t?.properties.find(r=>r.key==="start");if(e?.value&&RU.test(e.value)&&!Number.isNaN(new Date(e.value).getTime()))return e.value}function wU(t,e,r){return e&&r?`Included "${t}" declares start:${r}, which doesn't match this file's start:${e}. Both files must declare the same start date, or neither should.`:e?`Included "${t}" has no start:, but this file declares start:${e}. Both files must declare the same start date, or neither should.`:`Included "${t}" declares start:${r}, but this file has no start:. Both files must declare the same start date, or neither should.`}function lk(){return{styles:new Map,defaults:new Map,symbols:new Map}}function uk(){return{persons:new Map,teams:new Map,anchors:new Map,labels:new Map,sizes:new Map,statuses:new Map,swimlanes:new Map,milestones:new Map,footnotes:new Map,isolatedRegions:[]}}async function o_(t,e,r){let n=r.readFile??(async c=>{let{nodeReadFile:l}=await Promise.resolve().then(()=>(ak(),sk));return l(c)}),i={services:r.services,diagnostics:[],resolving:[],processed:new Map,readFile:n},o=i_("",e),{config:s,content:a}=await dk(t,o,i);return{config:s,content:a,diagnostics:i.diagnostics,processedFiles:new Set(i.processed.keys())}}async function dk(t,e,r){if(r.processed.has(e))return r.processed.get(e);if(r.resolving.includes(e)){r.diagnostics.push({severity:"error",message:`Circular include detected: ${[...r.resolving,e].join(" \u2192 ")}`,sourcePath:e});let a={config:lk(),content:uk()};return r.processed.set(e,a),a}r.resolving.push(e);let n=lk(),i=uk();IU(n,t),NU(i,t);let o=new Set;for(let a of t.includes){let c=a.path,l=i_(ok(e),c);if(o.has(l)){r.diagnostics.push({severity:"error",message:`Duplicate include "${c}" in ${rh(e)}.`,sourcePath:e,line:a.$cstNode?.range.start.line});continue}o.add(l);let u=fk(a,"config")??"merge",f=fk(a,"roadmap")??"merge",d;try{let g=await r.readFile(l);d=await bU(r.services,g,l)}catch(g){r.diagnostics.push({severity:"error",message:`Could not read include "${c}": ${g.message}`,sourcePath:e,line:a.$cstNode?.range.start.line});continue}let{config:p,content:m}=await dk(d,l,r);if(AU(n,p,u,l,r.diagnostics),SU(i,m,p,f,l,c,r.diagnostics),f==="isolate"&&!m.roadmap&&r.diagnostics.push({severity:"error",message:`Cannot isolate "${c}": it has no roadmap declaration.`,sourcePath:e,line:a.$cstNode?.range.start.line}),f!=="ignore"&&d.roadmapDecl){let g=ck(t.roadmapDecl),v=ck(d.roadmapDecl);g!==v&&r.diagnostics.push({severity:"error",message:wU(c,g,v),sourcePath:e,line:a.$cstNode?.range.start.line})}}r.resolving.pop();let s={config:n,content:i};return r.processed.set(e,s),s}function fk(t,e){let r=t.options.find(n=>n.key===e);if(r&&(r.value==="merge"||r.value==="ignore"||r.value==="isolate"))return r.value}async function bU(t,e,r){let n=gt.file(r),o=t.shared.workspace.LangiumDocumentFactory.fromString(e,n);return await t.shared.workspace.DocumentBuilder.build([o],{validation:!1}),o.parseResult.value}function AU(t,e,r,n,i){if(r==="ignore"||r==="isolate")return;let o=(s,a)=>i.push({severity:"warning",message:`${a} "${s}" from ${rh(n)} is shadowed by the parent's definition.`,sourcePath:n});kr(t.styles,e.styles,s=>o(s,"Style")),kr(t.defaults,e.defaults,s=>o(s,"Default")),kr(t.symbols,e.symbols,s=>o(s,"Symbol")),e.scale&&!t.scale&&(t.scale=e.scale),e.calendar&&!t.calendar&&(t.calendar=e.calendar)}function SU(t,e,r,n,i,o,s){if(n==="ignore")return;if(n==="isolate"){e.roadmap&&t.isolatedRegions.push({sourcePath:o,config:r,content:e});return}let a=(c,l)=>s.push({severity:"warning",message:`${l} "${c}" from ${rh(i)} is shadowed by the parent's definition.`,sourcePath:i});kr(t.persons,e.persons,c=>a(c,"Person")),kr(t.teams,e.teams,c=>a(c,"Team")),kr(t.anchors,e.anchors,c=>a(c,"Anchor")),kr(t.labels,e.labels,c=>a(c,"Label")),kr(t.sizes,e.sizes,c=>a(c,"Size")),kr(t.statuses,e.statuses,c=>a(c,"Status")),kr(t.swimlanes,e.swimlanes,c=>a(c,"Swimlane")),kr(t.milestones,e.milestones,c=>a(c,"Milestone")),kr(t.footnotes,e.footnotes,c=>a(c,"Footnote")),e.roadmap&&!t.roadmap&&(t.roadmap=e.roadmap)}function kr(t,e,r){for(let[n,i]of e){if(t.has(n)){r(n);continue}t.set(n,i)}}function IU(t,e){for(let r of e.configEntries)kU(t,r)}function kU(t,e){zI(e)?t.scale||(t.scale=e):Jp(e)?t.calendar||(t.calendar=e):gu(e)?e.name&&!t.styles.has(e.name)&&t.styles.set(e.name,e):yu(e)?e.name&&!t.symbols.has(e.name)&&t.symbols.set(e.name,e):Fi(e)&&(t.defaults.has(e.entityType)||t.defaults.set(e.entityType,e))}function NU(t,e){e.roadmapDecl&&!t.roadmap&&(t.roadmap=e.roadmapDecl);for(let r of e.roadmapEntries)PU(t,r)}function PU(t,e){Vr(e)?e.name&&!t.swimlanes.has(e.name)&&t.swimlanes.set(e.name,e):Ui(e)?e.name&&!t.persons.has(e.name)&&t.persons.set(e.name,e):Yr(e)?e.name&&!t.teams.has(e.name)&&t.teams.set(e.name,e):Zp(e)?e.name&&!t.anchors.has(e.name)&&t.anchors.set(e.name,e):eh(e)?e.name&&!t.labels.has(e.name)&&t.labels.set(e.name,e):Ya(e)?e.name&&!t.sizes.has(e.name)&&t.sizes.set(e.name,e):mu(e)?e.name&&!t.statuses.has(e.name)&&t.statuses.set(e.name,e):th(e)?e.name&&!t.milestones.has(e.name)&&t.milestones.set(e.name,e):Qp(e)&&e.name&&!t.footnotes.has(e.name)&&t.footnotes.set(e.name,e)}var pk="v1",s_=new Set(["planned","in-progress","active","done","completed","at-risk","blocked"]),nh=new Set(["bg","fg","text","border","icon","shadow","font","weight","italic","text-size","padding","spacing","header-height","corner-radius","bracket","header-position","capacity-icon","timeline-position","minor-grid"]),f_=new Set(["none","multiplier","person","people","points","time"]),ih=new Set([...f_,"shield","warning","lock","calendar"]),Rk="none",oh={border:new Set(["solid","dashed","dotted"]),shadow:new Set(["none","subtle","soft","hard"]),font:new Set(["sans","serif","mono"]),weight:new Set(["thin","light","normal","bold"]),italic:new Set(["true","false"]),"text-size":new Set(["none","xs","sm","md","lg","xl"]),padding:new Set(["none","xs","sm","md","lg","xl"]),spacing:new Set(["none","xs","sm","md","lg","xl"]),"header-height":new Set(["none","xs","sm","md","lg","xl"]),"corner-radius":new Set(["none","xs","sm","md","lg","xl","full"]),bracket:new Set(["none","solid","dashed"]),"header-position":new Set(["beside","above"]),"timeline-position":new Set(["top","bottom","both"]),"minor-grid":new Set(["true","false"])},CU=new Set(["red","blue","yellow","green","orange","purple","violet","gray","grey","navy","white","none"]),OU=new Set(["business","full","custom"]),a_=new Set(["days-per-week","days-per-month","days-per-quarter","days-per-year"]),hk=new Set(["name","label-every","label"]),mk=new Set(["item","label","swimlane","roadmap","milestone","footnote","anchor","parallel","group"]),LU={item:new Set(["size","duration","after","before","remaining","link","description","owner"]),milestone:new Set(["date","after","link","description"]),anchor:new Set(["date","link","description"]),footnote:new Set(["on","link","description"]),label:new Set(["link","description"]),swimlane:new Set(["capacity"]),roadmap:new Set,parallel:new Set,group:new Set},gk=new Set(["labels","link","style","description"]),DU={RoadmapDeclaration:new Set(["author","start","length","scale","calendar","logo","logo-size"]),AnchorDeclaration:new Set(["date"]),SwimlaneDeclaration:new Set(["owner","capacity","utilization-warn-at","utilization-over-at","status","after","before"]),ItemDeclaration:new Set(["size","duration","status","owner","after","before","remaining","capacity","date","start"]),ParallelBlock:new Set(["owner","after","before","status"]),GroupBlock:new Set(["owner","after","before","status"]),MilestoneDeclaration:new Set(["date","after"]),FootnoteDeclaration:new Set(["on"]),PersonDeclaration:new Set,TeamDeclaration:new Set,LabelDeclaration:new Set,SizeDeclaration:new Set(["effort"]),StatusDeclaration:new Set};function $U(t,e,r){if(t===e)return 0;let n=t.length,i=e.length;if(Math.abs(n-i)>r)return r+1;if(n===0)return i;if(i===0)return n;let o=new Array(i+1),s=new Array(i+1);for(let a=0;a<=i;a++)o[a]=a;for(let a=1;a<=n;a++){s[0]=a;let c=a;for(let u=1;u<=i;u++){let f=t.charCodeAt(a-1)===e.charCodeAt(u-1)?0:1;s[u]=Math.min(o[u]+1,s[u-1]+1,o[u-1]+f),s[u]<c&&(c=s[u])}if(c>r)return r+1;let l=o;o=s,s=l}return o[i]}function MU(t,e,r=2){let n,i=r+1;for(let o of e){let s=$U(t,o,r);if(s<i&&(n=o,i=s,s===0))break}return n}function Ne(t){return t.key.endsWith(":")?t.key.slice(0,-1):t.key}var xu=/^\d+(?:\.\d+)?[dwmqy]$/,FU=/^\d+%$/,Bi=/^\d{4}-\d{2}-\d{2}$/,UU=/^#[0-9a-fA-F]{3,8}$/,BU=/^v\d+$/,yk=/^\d+$/,GU=/^[dwmqy]$/,xk=/^\d+(\.\d+)?$/,d_=/^\d+(\.\d+)?%$/,wk=/^\d+\.\d+$/,XU=/^\d+$/,HU=/^[\x20-\x7E]{1,3}$/,jU=/^[a-zA-Z]{2,3}(-[a-zA-Z]{2}|-\d{3})?$/,zU=new Set(["merge","ignore","isolate"]),Tk=new Set(["locale"]);function c_(t){let e=t?.roadmapDecl?.properties.find(i=>Ne(i)==="start");if(!e)return{kind:"missing"};let r=e.value;if(!r||!Bi.test(r))return{kind:"invalid"};let n=new Date(r);return Number.isNaN(n.getTime())?{kind:"invalid"}:{kind:"valid",iso:r,date:n}}function Kr(t){return t.name??t.title??"<unnamed>"}function qU(t){return t.$type.replace(/Declaration$|Block$/,"").toLowerCase()}function be(t,e,r,n,...i){t(e,tk("en-US",n,...i),{...r,data:{code:n,args:i}})}function bk(t){let e=t.validation.ValidationRegistry,r=t.validation.NowlineValidator,n={NowlineFile:[r.checkFileStructure,r.checkUniqueIdentifiers,r.checkSwimlaneRequired,r.checkIndentationConsistency,r.checkRoadmapOnlyKeywordsPosition,r.checkForwardReferences,r.checkReferenceResolution,r.checkInlineDatePins,r.checkCircularDependencies,r.checkDuplicateSizeIds,r.checkCalendarBlockConsistency,r.checkPersonDeclarations,r.checkDuplicateSymbolIds,r.checkSymbolReferences],NowlineDirective:[r.checkDirectiveVersion,r.checkDirectiveProperties],IncludeOption:[r.checkIncludeMode],IncludeDeclaration:[r.checkIncludeDuplicateOptions],EntityProperty:[r.checkPropertyValues],RoadmapDeclaration:[r.checkEntityIdOrTitle,r.checkRoadmapProperties,r.checkNoRawStyleProperties,r.checkUnknownEntityProperties],AnchorDeclaration:[r.checkEntityIdOrTitle,r.checkAnchorRequiredDate,r.checkAnchorAgainstStart,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],SwimlaneDeclaration:[r.checkEntityIdOrTitle,r.checkNoRawStyleProperties,r.checkUtilizationOrdering,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],ItemDeclaration:[r.checkEntityIdOrTitle,r.checkItemRequiredDuration,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],ParallelBlock:[r.checkParallelMinChildren,r.checkNoComputedProperties,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],GroupBlock:[r.checkGroupMinChildren,r.checkNoComputedProperties,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],MilestoneDeclaration:[r.checkEntityIdOrTitle,r.checkMilestoneRequirement,r.checkMilestoneAgainstStart,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],FootnoteDeclaration:[r.checkEntityIdOrTitle,r.checkFootnoteOn,r.checkNoRawStyleProperties,r.checkUnknownEntityProperties],PersonDeclaration:[r.checkEntityIdOrTitle,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],TeamDeclaration:[r.checkEntityIdOrTitle,r.checkNoRawStyleProperties,r.checkNoFootnoteProperty,r.checkUnknownEntityProperties],StyleDeclaration:[r.checkEntityIdOrTitle],StyleProperty:[r.checkStylePropertyEnum],SymbolDeclaration:[r.checkEntityIdOrTitle,r.checkSymbolDeclaration],LabelDeclaration:[r.checkEntityIdOrTitle,r.checkNoRawStyleProperties,r.checkUnknownEntityProperties],SizeDeclaration:[r.checkEntityIdOrTitle,r.checkSizeDeclaration,r.checkNoRawStyleProperties,r.checkUnknownEntityProperties],StatusDeclaration:[r.checkEntityIdOrTitle,r.checkStatusDeclaration,r.checkNoRawStyleProperties,r.checkUnknownEntityProperties],DefaultDeclaration:[r.checkDefaultDeclaration,r.checkUtilizationOrdering],CalendarBlock:[r.checkCalendarBlock],ScaleBlock:[r.checkScaleBlock]};e.register(n,r)}var ah=class{checkFileStructure(e,r){let n=e.hasConfig?vs.findNodeForKeyword(e.$cstNode,"config")?.offset:void 0,i=e.roadmapDecl?.$cstNode?.offset;n!==void 0&&i!==void 0&&n>i&&be(r,"error",{node:e,property:"hasConfig"},"NL.E0001");for(let o of e.includes){let s=o.$cstNode?.offset??0;n!==void 0&&s>n&&be(r,"error",{node:o},"NL.E0002"),i!==void 0&&s>i&&be(r,"error",{node:o},"NL.E0003")}}checkRoadmapOnlyKeywordsPosition(e,r){}checkDirectiveVersion(e,r){if(!BU.test(e.version)){be(r,"error",{node:e,property:"version"},"NL.E0100",{version:e.version});return}let n=parseInt(e.version.slice(1),10),i=parseInt(pk.slice(1),10);n>i&&be(r,"error",{node:e,property:"version"},"NL.E0101",{version:e.version,supported:pk})}checkDirectiveProperties(e,r){let n=new Set;for(let i of e.properties){let o=Ne(i);if(!Tk.has(o)){be(r,"error",{node:i,property:"key"},"NL.E0102",{key:o,allowed:[...Tk].join(", ")});continue}if(n.has(o)&&be(r,"error",{node:i,property:"key"},"NL.E0103",{key:o}),n.add(o),o==="locale"){let s=i.value;jU.test(s)||be(r,"error",{node:i,property:"value"},"NL.E0104",{value:s})}}}checkEntityIdOrTitle(e,r){!e.name&&!e.title&&be(r,"error",{node:e},"NL.E0301",{type:e.$type})}checkUniqueIdentifiers(e,r){let n=new Map,i=(o,s)=>{if(!o)return;let a=n.get(o);a?be(r,"error",{node:s},"NL.E0300",{name:o,location:sh(a)}):n.set(o,s)};e.roadmapDecl?.name&&i(e.roadmapDecl.name,e.roadmapDecl);for(let o of e.roadmapEntries)YU(o,i);for(let o of e.configEntries)gu(o)&&o.name&&i(o.name,o)}checkIndentationConsistency(e,r){let n=e.$document?.textDocument.getText()??e.$cstNode?.text;if(!n)return;let i=n.split(/\r?\n/);for(let o=0;o<i.length;o++){let s=i[o];if(s.length===0)continue;let a=s.match(/^([\t ]+)/);if(!a)continue;let c=a[1];if(c.includes(" ")&&c.includes(" ")){be(r,"error",{node:e},"NL.E0005",{line:o+1});return}}}checkSwimlaneRequired(e,r){let n=e.roadmapEntries.some(Vr);e.roadmapDecl&&!n&&be(r,"error",{node:e.roadmapDecl},"NL.E0004")}checkIncludeMode(e,r){zU.has(e.value)||be(r,"error",{node:e,property:"value"},"NL.E0200",{value:e.value})}checkIncludeDuplicateOptions(e,r){let n=new Set;for(let i of e.options){let o=i.key.replace(/:$/,"");n.has(o)&&be(r,"error",{node:i},"NL.E0201",{key:o}),n.add(o)}}checkPropertyValues(e,r){let n=Ne(e),i=e.value,o=e.values,s=i?[i]:o;switch(n){case"status":break;case"duration":i&&!xu.test(i)&&be(r,"error",{node:e,property:"value"},"NL.E0400",{value:i});break;case"size":i&&!_k(i)&&be(r,"error",{node:e,property:"value"},"NL.E0401",{value:i});break;case"effort":i&&!xu.test(i)&&be(r,"error",{node:e,property:"value"},"NL.E0402",{value:i});break;case"remaining":{if(i)if(FU.test(i)){let a=parseFloat(i);(a<0||a>100)&&be(r,"error",{node:e,property:"value"},"NL.E0404",{value:i})}else xu.test(i)||be(r,"error",{node:e,property:"value"},"NL.E0403",{value:i});break}case"date":case"start":i&&(!Bi.test(i)||Number.isNaN(new Date(i).getTime()))&&be(r,"error",{node:e,property:"value"},"NL.E0405",{key:n,value:i});break;case"scale":i&&!xu.test(i)&&be(r,"error",{node:e,property:"value"},"NL.E0406",{value:i});break;case"calendar":i&&!OU.has(i)&&be(r,"error",{node:e,property:"value"},"NL.E0407",{value:i});break;case"on":case"after":case"before":s.length===0&&be(r,"error",{node:e},"NL.E0408",{key:n});break;case"capacity":{if(!i)break;let a=e.$container,c=WU(a);if(c==="invalid")break;c==="lane"?(!xk.test(i)||parseFloat(i)<=0)&&r("error",`Invalid swimlane capacity "${i}". Use a positive integer (e.g. capacity:5) or decimal (e.g. capacity:1.5). Percent literals are not allowed on swimlanes.`,{node:e,property:"value"}):d_.test(i)?parseFloat(i)<=0&&r("error",`Item capacity "${i}" must be positive.`,{node:e,property:"value"}):xk.test(i)?parseFloat(i)<=0&&r("error",`Item capacity "${i}" must be positive.`,{node:e,property:"value"}):r("error",`Invalid item capacity "${i}". Use a positive integer (capacity:2), decimal (capacity:0.5), or percent literal (capacity:50%).`,{node:e,property:"value"});break}case"overcapacity":{r("error",'"overcapacity:" was removed. Use "utilization-over-at:none" (and/or "utilization-warn-at:none") to suppress the lane utilization underline.',{node:e});break}case"utilization-warn-at":case"utilization-over-at":{if(!i)break;if(!VU(e.$container)){r("error",`"${n}:" is only valid on "swimlane" or "default swimlane".`,{node:e});break}if(i===Rk)break;if(d_.test(i)){parseFloat(i)<=0&&r("error",`${n} value "${i}" must be positive.`,{node:e,property:"value"});break}if(wk.test(i)){parseFloat(i)<=0&&r("error",`${n} value "${i}" must be positive.`,{node:e,property:"value"});break}if(XU.test(i)){r("error",`Ambiguous ${n} value "${i}". Use the percent form ("${i}%") or the decimal-fraction form ("0.${i}") to make the intent explicit.`,{node:e,property:"value"});break}r("error",`Invalid ${n} value "${i}". Use a positive percent (e.g. 80%), a positive decimal fraction (e.g. 0.8), or "none" to opt out.`,{node:e,property:"value"});break}case"capacity-icon":break;case"icon":break;default:if(nh.has(n)){if(n==="bg"||n==="fg"||n==="text")i&&!l_(i)&&r("error",`Invalid color "${i}" for "${n}". Use a named color, hex value, or "none".`,{node:e,property:"value"});else if(n in oh){let a=oh[n];i&&!a.has(i)&&!l_(i)&&r("error",`Invalid value "${i}" for "${n}". Allowed: ${[...a].join(", ")}.`,{node:e,property:"value"})}}break}}checkAnchorRequiredDate(e,r){e.properties.find(i=>Ne(i)==="date")||be(r,"error",{node:e},"NL.E0500",{name:Kr(e)})}checkAnchorAgainstStart(e,r){let n=e.properties.find(a=>Ne(a)==="date");if(!n?.value)return;let i=n.value;if(!Bi.test(i))return;let o=new Date(i);if(Number.isNaN(o.getTime()))return;let s=c_(e.$container);switch(s.kind){case"invalid":return;case"missing":be(r,"error",{node:n,property:"value"},"NL.E0501",{name:Kr(e)});return;case"valid":o<s.date&&be(r,"error",{node:n,property:"value"},"NL.E0502",{name:Kr(e),date:i,start:s.iso});return}}checkMilestoneRequirement(e,r){let n=e.properties.some(o=>Ne(o)==="date"),i=e.properties.some(o=>Ne(o)==="after");!n&&!i&&be(r,"error",{node:e},"NL.E0503",{name:Kr(e)})}checkMilestoneAgainstStart(e,r){let n=e.properties.find(a=>Ne(a)==="date");if(!n?.value)return;let i=n.value;if(!Bi.test(i))return;let o=new Date(i);if(Number.isNaN(o.getTime()))return;let s=c_(e.$container);switch(s.kind){case"invalid":return;case"missing":r("error",`Milestone "${Kr(e)}" has a date but the roadmap is missing "start:". Add start:YYYY-MM-DD to the roadmap.`,{node:n,property:"value"});return;case"valid":o<s.date&&be(r,"error",{node:n,property:"value"},"NL.E0504",{name:Kr(e),date:i,start:s.iso});return}}checkFootnoteOn(e,r){e.properties.some(i=>Ne(i)==="on")||be(r,"error",{node:e},"NL.E0505")}checkNoFootnoteProperty(e,r){for(let n of e.properties)Ne(n)==="footnote"&&r("error",`Property "footnote:" is not valid on ${u_(e)}. Footnotes attach via "on:" on the footnote declaration \u2014 declare \`footnote <id> on:<target-id>\` instead.`,{node:n})}checkItemRequiredDuration(e,r){let n=e.properties.some(o=>Ne(o)==="duration"),i=e.properties.some(o=>Ne(o)==="size");!n&&!i&&be(r,"error",{node:e},"NL.E0600",{name:Kr(e)})}checkNoComputedProperties(e,r){for(let n of e.properties){let i=Ne(n);(i==="size"||i==="duration"||i==="remaining"||i==="capacity")&&r("error",`"${i}" is not valid on ${e.$type==="ParallelBlock"?"parallel":"group"} (computed from children).`,{node:n})}}checkParallelMinChildren(e,r){let n=e.content.filter(i=>!n_(i));n.length===0?r("error","Parallel block must contain at least 2 children.",{node:e}):n.length===1&&r("warning","Parallel block has only 1 child. Use at least 2 for parallel execution.",{node:e})}checkGroupMinChildren(e,r){e.content.filter(i=>!n_(i)).length===0&&r("error","Group must contain at least 1 child.",{node:e})}checkNoRawStyleProperties(e,r){for(let n of e.properties){let i=Ne(n);nh.has(i)&&r("error",`Raw style property "${i}" is not allowed on ${u_(e)}. Declare a named style in config and reference it via "style:id".`,{node:n})}}checkUnknownEntityProperties(e,r){let n=DU[e.$type];if(!n)return;let i=e.$type==="ParallelBlock"||e.$type==="GroupBlock"?new Set(["size","duration","remaining","capacity"]):null;for(let o of e.properties){let s=Ne(o);if(n.has(s)||gk.has(s)||nh.has(s)||s==="footnote"||i?.has(s))continue;let a=[...n,...gk],c=MU(s,a)??"";be(r,"warning",{node:o,property:"key"},"NL.W0700",{key:s,entity:u_(e),suggested:c})}}checkRoadmapProperties(e,r){}checkStylePropertyEnum(e,r){let n=Ne(e),i=e.value;if(n==="bg"||n==="fg"||n==="text")l_(i)||r("error",`Invalid color "${i}" for "${n}". Use a named color, hex value, or "none".`,{node:e,property:"value"});else if(n in oh){let o=oh[n];o.has(i)||r("error",`Invalid value "${i}" for "${n}". Allowed: ${[...o].join(", ")}.`,{node:e,property:"value"})}else nh.has(n)||r("error",`Unknown style property "${n}".`,{node:e,property:"key"})}checkSizeDeclaration(e,r){e.properties.find(i=>Ne(i)==="effort")||r("error",`Size "${Kr(e)}" requires an "effort:" property.`,{node:e}),e.name&&(xu.test(e.name)||GU.test(e.name))&&r("error",`Size id "${e.name}" collides with the raw duration pattern. Choose a different name (e.g. "xs", "small", "quarter").`,{node:e,property:"name"})}checkStatusDeclaration(e,r){e.name&&s_.has(e.name)&&r("error",`Status id "${e.name}" collides with the built-in status value. Built-ins: ${[...s_].join(", ")}.`,{node:e,property:"name"})}checkDuplicateSizeIds(e,r){let n=new Map;for(let i of e.roadmapEntries)if(Ya(i)&&i.name){let o=n.get(i.name);o?r("error",`Duplicate size id "${i.name}". First declared at ${sh(o)}.`,{node:i,property:"name"}):n.set(i.name,i)}}checkUtilizationOrdering(e,r){if(Fi(e)&&e.entityType!=="swimlane")return;let n=e.properties.find(a=>Ne(a)==="utilization-warn-at"),i=e.properties.find(a=>Ne(a)==="utilization-over-at");if(!n||!i)return;let o=Ek(n.value),s=Ek(i.value);o===null||s===null||o>s&&r("error",`utilization-warn-at (${n.value}) must be \u2264 utilization-over-at (${i.value}). Warn fires below over; if both fire at the same point, the warn band collapses to zero.`,{node:n,property:"value"})}checkDefaultDeclaration(e,r){if(!mk.has(e.entityType)){r("error",`"${e.entityType}" is not a supported entity type for default. Allowed: ${[...mk].join(", ")}.`,{node:e,property:"entityType"});return}let n=e.$container,i=-1;for(let s=0;s<n.configEntries.length;s++){let a=n.configEntries[s];if(Fi(a)&&a.entityType===e.entityType){if(i<0)i=s;else if(a===e){r("error",`Duplicate "default ${e.entityType}" declaration. Only one is allowed per entity type per file.`,{node:e});break}}}let o=LU[e.entityType];if(o)for(let s of e.properties){let a=Ne(s);o.has(a)&&r("error",`"${a}" cannot be set on "default ${e.entityType}". Identity-defining, sizing, sequencing, reference, and prose properties must be explicit on each entity.`,{node:s})}}checkCalendarBlockConsistency(e,r){let n=e.configEntries.filter(Jp),o=e.roadmapDecl?.properties.find(s=>Ne(s)==="calendar")?.value;if(n.length>0&&o!=="custom")for(let s of n)r("error",'A "calendar" config block is only valid when the roadmap declares calendar:custom.',{node:s});if(o==="custom"&&n.length===0&&r("error",'calendar:custom requires a "calendar" config block with days-per-week, days-per-month, days-per-quarter, and days-per-year.',{node:e.roadmapDecl,property:"properties"}),o==="custom"&&n.length>0)for(let s of n){let a=new Set(s.properties.map(c=>Ne(c)));for(let c of a_)a.has(c)||r("error",`calendar:custom requires "${c}" in the calendar config block.`,{node:s})}}checkCalendarBlock(e,r){let n=new Set;for(let i of e.properties){let o=Ne(i);if(!a_.has(o)){r("error",`Unknown calendar property "${o}". Allowed: ${[...a_].join(", ")}.`,{node:i,property:"key"});continue}n.has(o)&&r("error",`Duplicate calendar property "${o}".`,{node:i,property:"key"}),n.add(o),(!yk.test(i.value)||parseInt(i.value,10)<=0)&&r("error",`"${o}" must be a positive integer, got "${i.value}".`,{node:i,property:"value"})}}checkScaleBlock(e,r){let n=new Set;for(let i of e.properties){let o=Ne(i);if(!hk.has(o)){r("error",`Unknown scale property "${o}". Allowed: ${[...hk].join(", ")}.`,{node:i,property:"key"});continue}n.has(o)&&r("error",`Duplicate scale property "${o}".`,{node:i,property:"key"}),n.add(o),o==="label-every"&&(!yk.test(i.value)||parseInt(i.value,10)<=0)&&r("error",`"label-every" must be a positive integer, got "${i.value}".`,{node:i,property:"value"})}}checkForwardReferences(e,r){let n=new Map,i=new Map;for(let o=0;o<e.roadmapEntries.length;o++){let s=e.roadmapEntries[o];Ya(s)&&s.name?n.has(s.name)||n.set(s.name,o):mu(s)&&s.name&&(i.has(s.name)||i.set(s.name,o))}for(let o=0;o<e.roadmapEntries.length;o++){let s=e.roadmapEntries[o];vk(s,a=>{let c=Ne(a);if(c==="size"&&a.value){let l=a.value,u=n.get(l);u===void 0?r("error",`Size "${l}" is not declared. Add "size ${l} effort:<literal>" earlier in the roadmap section.`,{node:a,property:"value"}):u>=o&&r("error",`Size "${l}" is referenced before its declaration. Move "size ${l}" above this entity.`,{node:a,property:"value"})}else if(c==="status"&&a.value){let l=a.value;if(s_.has(l))return;let u=i.get(l);u===void 0?r("error",`Status "${l}" is not a built-in and has no declaration. Add "status ${l}" earlier in the roadmap section.`,{node:a,property:"value"}):u>=o&&r("error",`Status "${l}" is referenced before its declaration. Move "status ${l}" above this entity.`,{node:a,property:"value"})}})}}checkReferenceResolution(e,r){let n=KU(e),i=o=>{vk(o,s=>{let a=Ne(s);if(a!=="after"&&a!=="before"&&a!=="on")return;let c=s.value?[s.value]:s.values;for(let l of c)l&&((a==="after"||a==="before")&&Bi.test(l)||n.has(l)||r("error",`${a}: reference "${l}" does not resolve to any declared entity in this file.`,{node:s}))})};for(let o of e.roadmapEntries)i(o)}checkInlineDatePins(e,r){let n=c_(e),i=o=>{let s=o.properties??[],a=yr(o)||Wr(o)||qr(o);for(let c of s){let l=Ne(c);if(l!=="after"&&l!=="before")continue;let f=(c.value?[c.value]:c.values).filter(d=>!!d&&Bi.test(d));if(f.length!==0){if(!a){be(r,"error",{node:c},"NL.E0411",{key:l,type:qU(o)});continue}f.length>1&&be(r,"error",{node:c},"NL.E0410",{key:l});for(let d of f)switch(n.kind){case"invalid":continue;case"missing":be(r,"error",{node:c},"NL.E0412",{key:l,date:d});continue;case"valid":{let p=new Date(d);if(Number.isNaN(p.getTime()))continue;p<n.date&&be(r,"error",{node:c},"NL.E0413",{key:l,date:d,start:n.iso})}}}}if(Vr(o))for(let c of o.content)i(c);else if(Wr(o)||qr(o))for(let c of o.content)i(c)};for(let o of e.roadmapEntries)i(o)}checkCircularDependencies(e,r){let n=new Map,i=(p,m)=>{n.has(p)||n.set(p,new Set),n.get(p).add(m)},o=(p,m,g)=>{if(p)for(let v of m){let T=Ne(v);if(T==="after"){let _=v.value?[v.value]:v.values;for(let E of _)E&&(Bi.test(E)||i(p,E))}else if(T==="before"){let _=v.value?[v.value]:v.values;for(let E of _)E&&(Bi.test(E)||i(E,p))}}},s=p=>{let m=p.name,g=p.properties??[];if(o(m,g,e),Vr(p))for(let v of p.content)s(v);else if(Wr(p)||qr(p))for(let v of p.content)s(v)};for(let p of e.roadmapEntries)s(p);let a=0,c=1,l=2,u=new Map;for(let p of n.keys())u.set(p,a);let f=new Set,d=(p,m)=>{u.set(p,c),m.push(p);for(let g of n.get(p)??[]){let v=u.get(g)??a;if(v===c){let T=m.indexOf(g),_=m.slice(T).concat(g),E=[..._].sort().join("\u2192");f.has(E)||(f.add(E),r("error",`Circular dependency detected: ${_.join(" \u2192 ")}.`,{node:e.roadmapDecl??e}))}else v===a&&d(g,m)}m.pop(),u.set(p,l)};for(let p of n.keys())(u.get(p)??a)===a&&d(p,[])}checkPersonDeclarations(e,r){let n=new Map,i=a=>!!a.title||a.properties.length>0||a.description!==void 0,o=a=>{if(!a.name)return;let c=i(a);n.has(a.name)||n.set(a.name,[]),n.get(a.name).push({node:a,isDeclaration:c}),!c&&a.$container.$type==="NowlineFile"&&r("warning",`Bare "person ${a.name}" at roadmap top level has no declaration. Either add properties (title, link, etc.) or remove the line.`,{node:a})},s=a=>{for(let c of a.content)Ui(c)?o(c):Yr(c)&&s(c)};for(let a of e.roadmapEntries)Ui(a)?o(a):Yr(a)&&s(a);for(let[a,c]of n){let l=c.filter(u=>u.isDeclaration);if(l.length>1)for(let u=1;u<l.length;u++)r("error",`Person "${a}" is declared more than once. First declaration at ${sh(l[0].node)}.`,{node:l[u].node})}}checkSymbolDeclaration(e,r){e.name&&ih.has(e.name)&&r("error",`Symbol id "${e.name}" collides with a built-in icon name. Reserved built-ins: ${[...ih].sort().join(", ")}.`,{node:e,property:"name"});let n=e.properties.find(o=>Ne(o)==="unicode");n?(!n.value||n.value.length===0)&&r("error",`Symbol "${Kr(e)}" unicode: must be a non-empty value.`,{node:n,property:"value"}):r("error",`Symbol "${Kr(e)}" requires a "unicode:" property (e.g. unicode:"\u{1F4B0}" or unicode:"\\u{1F464}").`,{node:e});let i=e.properties.find(o=>Ne(o)==="ascii");if(i){let o=i.value??"";HU.test(o)||r("error",`Symbol "${Kr(e)}" ascii: must be 1-3 ASCII characters (got ${o.length} character${o.length===1?"":"s"}).`,{node:i,property:"value"})}for(let o of e.properties){let s=Ne(o);s!=="unicode"&&s!=="ascii"&&s!=="link"&&s!=="description"&&r("error",`Unknown symbol property "${s}". Allowed: unicode, ascii, link, description.`,{node:o,property:"key"})}}checkDuplicateSymbolIds(e,r){let n=new Map;for(let i of e.configEntries)if(yu(i)&&i.name){let o=n.get(i.name);o?r("error",`Duplicate symbol id "${i.name}". First declared at ${sh(o)}.`,{node:i,property:"name"}):n.set(i.name,i)}}checkSymbolReferences(e,r){let n=new Map;for(let o=0;o<e.configEntries.length;o++){let s=e.configEntries[o];yu(s)&&s.name&&(n.has(s.name)||n.set(s.name,o))}let i=(o,s,a,c)=>{if(s!=="icon"&&s!=="capacity-icon"||!a||!_k(a)||s==="capacity-icon"&&f_.has(a)||s==="icon"&&ih.has(a))return;let l=n.get(a);if(l===void 0){let u=s==="capacity-icon"?[...f_].sort().join(", "):[...ih].sort().join(", ");r("error",`${s}: "${a}" is neither a built-in (${u}) nor a declared symbol. Add "symbol ${a} unicode:..." earlier in config or use a quoted Unicode literal.`,{node:c,property:"value"})}else l>=o&&r("error",`${s}: symbol "${a}" is referenced before its declaration. Move "symbol ${a}" above this entry.`,{node:c,property:"value"})};for(let o=0;o<e.configEntries.length;o++){let s=e.configEntries[o];if(gu(s))for(let a of s.properties)i(o,Ne(a),a.value,a);else if(Fi(s))for(let a of s.properties)i(o,Ne(a),a.value,a)}}};function l_(t){return CU.has(t)||UU.test(t)}function _k(t){return/^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(t)}function WU(t){return t?Vr(t)?"lane":yr(t)?"item":Fi(t)?t.entityType==="swimlane"?"lane":"item":"invalid":"invalid"}function VU(t){return t?!!(Vr(t)||Fi(t)&&t.entityType==="swimlane"):!1}function Ek(t){if(!t||t===Rk)return null;if(d_.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?e/100:null}if(wk.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?e:null}return null}function sh(t){let e=t.$cstNode;return e?`line ${e.range.start.line+1}`:"unknown location"}function u_(t){let e=t.$type.replace(/Declaration$|Block$/,"").toLowerCase(),r=t.name??t.title;return r?`${e} "${r}"`:e}function YU(t,e){if(Vr(t)){e(t.name,t);for(let r of t.content)p_(r,e)}else Ui(t)?e(t.name,t):Yr(t)?Ak(t,e):(Zp(t)||th(t)||Qp(t)||eh(t)||Ya(t)||mu(t))&&e(t.name,t)}function Ak(t,e){e(t.name,t);for(let r of t.content)Yr(r)&&Ak(r,e)}function p_(t,e){if(yr(t))e(t.name,t);else if(Wr(t)){e(t.name,t);for(let r of t.content)p_(r,e)}else if(qr(t)){e(t.name,t);for(let r of t.content)p_(r,e)}}function vk(t,e){let r=n=>{let i=n.properties;if(Array.isArray(i))for(let o of i)e(o);if(Vr(n))for(let o of n.content)r(o);else if(Wr(n)||qr(n))for(let o of n.content)r(o);else if(Yr(n))for(let o of n.content)(Yr(o)||Ui(o))&&r(o)};r(t)}function KU(t){let e=new Set;t.roadmapDecl?.name&&e.add(t.roadmapDecl.name);let r=n=>{let i=n.name;if(i&&e.add(i),Vr(n))for(let o of n.content)r(o);else if(Wr(n)||qr(n))for(let o of n.content)r(o);else if(Yr(n))for(let o of n.content)Yr(o)||Ui(o)?r(o):jI(o)};for(let n of t.roadmapEntries)r(n);return e}var h_=class extends Lo{runConverter(e,r,n){return e.name==="PROPERTY_KEY_WITH_COLON"||e.name==="INCLUDE_OPTION_KEY"?r.endsWith(":")?r.slice(0,-1):r:super.runConverter(e,r,n)}},m_=class extends La{isStartOfLine(e,r){if(!super.isStartOfLine(e,r))return!1;let n=r-1;for(;n>=0&&(e[n]===" "||e[n]===" ");)n--;for(;n>=0&&(e[n]==="\r"||e[n]===`
2663
+ `);)n--;for(;n>=0&&(e[n]===" "||e[n]===" ");)n--;return n<0||e[n]!=="\\"}},Sk={parser:{TokenBuilder:()=>new m_({indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[["[","]"]]}),Lexer:t=>new lu(t),ParserConfig:()=>({maxLookahead:4}),ValueConverter:()=>new h_},validation:{NowlineValidator:()=>new ah}};function g_(t={}){let e=t.shared??Ho(au(uu),VI),r=Ho(su({shared:e}),YI,Sk);return e.ServiceRegistry.register(r),bk(r),{shared:e,Nowline:r}}var ZU=new Set(["none","multiplier","person","people","points","time"]),JU=/^\d+$/,QU=/^\d+\.\d+$/,eB=/^\d+(?:\.\d+)?%$/;function Gi(t){if(!t)return null;if(JU.test(t)){let e=parseInt(t,10);return e>0?e:null}if(QU.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?e:null}if(eB.test(t)){let e=parseFloat(t.slice(0,-1))/100;return Number.isFinite(e)&&e>0?e:null}return null}function Tu(t){if(Number.isInteger(t))return String(t);let e=t.toFixed(6);return e=e.replace(/0+$/,""),e=e.replace(/\.$/,""),e}function tB(t){return t.key.endsWith(":")?t.key.slice(0,-1):t.key}function rB(t){for(let e of t.properties)if(tB(e)==="unicode"&&e.value)return e.value}function _u(t,e){if(t==="none")return null;if(ZU.has(t))return{kind:"builtin",name:t};let r=e.get(t);return r?{kind:"literal",text:rB(r)??t}:{kind:"literal",text:t}}function qo(t,e,r){return e?e.kind==="builtin"&&e.name==="multiplier"?(t.length+1)*r*.58:t.length*r*.58+(.1+1)*r:t.length*r*.58}function Eu(t,e,r,n=0,i=0){let o=t+10,s=o+12,a=e.length*6.5,c=s+a,l=0,u=0;r&&(l=`owner: ${r}`.length*5,u=c+6,c=u+l);let f=0;n>0&&(f=c+6,c=f+n);let d=0;i>0&&(d=c+6+i,c=d);let p=c-o+12,m=Math.max(56,p);return{titleTextWidth:a,ownerTextWidth:l,capacityBadgeWidth:n,footnoteIndicatorWidth:i,titleX:s,ownerX:u,badgeX:f,footnoteRightX:d,tabX:o,tabW:m,rightX:o+m}}function vu(t,e,r){let n=t+24,i=n+10,o=e.length*6,s=Math.max(60,o+10+10),a=n+s+6,c=a+18,l=0,u=0,f=0,d=0,p=c;return r&&(u=c+6,l=r.length*5.5,f=u-3,d=l+6,p=f+d),{labelTextWidth:o,sourceTextWidth:l,tabX:n,tabWidth:s,tabLabelX:i,badgeX:a,badgeSize:18,sourceHaloX:f,sourceHaloWidth:d,sourceTextX:u,chromeRightX:p}}function y_(t,e){if(t.length===0)return{rows:[[]],expanded:!1};let r=[[]],n=0,i=e,o=!1;for(let s of t){let a=r[r.length-1],c=(a.length===0?0:4)+s.width,l=n+c;if(l<=i){a.push(s),n=l;continue}if(a.length===0){a.push(s),n=s.width;continue}let u=l-i,f=s.width*.25;if(!o&&u<=f){a.push(s),n=l,i=l,o=!0;continue}r.push([s]),n=s.width,i=e}return{rows:r,expanded:o}}function Ik(t){return t.endsWith(":")?t.slice(0,-1):t}function ae(t,e){return t.find(r=>Ik(r.key)===e)?.value}function xt(t,e){let r=t.find(n=>Ik(n.key)===e);return r?r.value!==void 0?[r.value]:[...r.values]:[]}function Rt(t){if(!t)return null;let e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);if(!e)return null;let r=new Date(Date.UTC(parseInt(e[1],10),parseInt(e[2],10)-1,parseInt(e[3],10)));return Number.isNaN(r.getTime())?null:r}var Ka={mode:"business",daysPerWeek:5,daysPerMonth:22,daysPerQuarter:65,daysPerYear:260},nB={mode:"full",daysPerWeek:7,daysPerMonth:30,daysPerQuarter:91,daysPerYear:365};function kk(t,e){let n=t.roadmapDecl?.properties.find(i=>x_(i.key)==="calendar")?.value??"business";if(n==="business")return{...Ka};if(n==="full")return{...nB};if(e){let i=(o,s)=>{let a=e.properties.find(l=>x_(l.key)===o),c=a?parseInt(a.value,10):NaN;return Number.isFinite(c)&&c>0?c:s};return{mode:"custom",daysPerWeek:i("days-per-week",Ka.daysPerWeek),daysPerMonth:i("days-per-month",Ka.daysPerMonth),daysPerQuarter:i("days-per-quarter",Ka.daysPerQuarter),daysPerYear:i("days-per-year",Ka.daysPerYear)}}return{...Ka}}var ch=/^(\d+(?:\.\d+)?)([dwmqy])$/;function lh(t,e){let r=ch.exec(t);if(!r)return 0;let n=parseFloat(r[1]);switch(r[2]){case"d":return n;case"w":return n*e.daysPerWeek;case"m":return n*e.daysPerMonth;case"q":return n*e.daysPerQuarter;case"y":return n*e.daysPerYear;default:return 0}}function Nk(t,e,r){return t?ch.test(t)?lh(t,r):e.get(t)?.effortDays??0:0}function Xi(t,e,r){let n=ae(t,"duration");if(n&&ch.test(n))return lh(n,r);let i=ae(t,"size"),o=i?e.get(i):void 0;if(!o)return 0;let s=Gi(ae(t,"capacity"))??1;return o.effortDays/s}function Pk(t,e,r){let n=ae(t,"size"),i=n?e.get(n):void 0;if(i)return i.effortDays;let o=ae(t,"duration");if(o&&ch.test(o)){let s=Gi(ae(t,"capacity"))??1;return lh(o,r)*s}return 0}function uh(t,e){let r=new Map;for(let[n,i]of t){let s=i.properties.find(c=>x_(c.key)==="effort")?.value;if(!s)continue;let a=lh(s,e);a<=0||r.set(n,{name:n,title:i.title||void 0,effortDays:a,effortLiteral:s})}return r}function x_(t){return t.endsWith(":")?t.slice(0,-1):t}function Nr(t,e){return Math.round((e.getTime()-t.getTime())/864e5)}function Wo(t,e){let r=new Date(t.getTime());return r.setUTCDate(r.getUTCDate()+e),r}var fh=class{constructor(e){fe(this,"items");fe(this,"brackets");this.items=e.itemBars,this.brackets=e.brackets}hasObstacle(e,r,n){let i=Math.min(r,n),o=Math.max(r,n);for(let s of this.items)if(!(e<=s.x||e>=s.x+s.width)&&!(s.y+s.height<=i||s.y>=o))return!0;return!1}bracketsNear(e,r,n,i){let o=Math.min(r,n),s=Math.max(r,n),a=[];for(let c of this.brackets)Math.abs(c.x-e)>i||c.yBottom<=o||c.yTop>=s||a.push(c);return a}};function Ck(t,e){let r=[],n=[],i=s=>{if(s.kind==="item"){r.push(s.box);return}if(s.kind==="parallel"){if(s.style.bracket==="solid"||s.style.bracket==="dashed"){let l=s.box.y-12,u=s.box.y+s.box.height+12,f=s.box.x,d=s.box.x+s.box.width;n.push({x:f,yTop:l,yBottom:u}),n.push({x:d,yTop:l,yBottom:u}),n.push({x:f+4,yTop:l-1,yBottom:l+1}),n.push({x:f+4,yTop:u-1,yBottom:u+1}),n.push({x:d-4,yTop:l-1,yBottom:l+1}),n.push({x:d-4,yTop:u-1,yBottom:u+1})}for(let a of s.children)i(a);return}if(s.kind==="group"){!(s.style.bg!=="none"&&s.style.bg!=="#ffffff")&&s.style.bracket&&s.style.bracket!=="none"&&n.push({x:s.box.x,yTop:s.box.y,yBottom:s.box.y+s.box.height});for(let c of s.children)i(c);return}},o=s=>{for(let a of s.children)i(a);for(let a of s.nested)o(a)};for(let s of t)o(s);for(let s of e)for(let a of s.nestedSwimlanes)o(a);return{itemBars:r,brackets:n}}function iB(t,e){let{from:r,to:n}=t;if(Math.abs(r.y-n.y)<.5)return{x:(r.x+n.x)/2,underBar:!1,range:null};let i=Math.min(r.y,n.y),o=Math.max(r.y,n.y);if(r.x<=n.x){let a=r.x+6,c=n.x-6;if(a>c)return{x:n.x-6,underBar:!0,range:null};let l={minX:a,maxX:c},u=(r.x+n.x)/2,f=Math.max(a,Math.min(c,u));if(!e.hasObstacle(f,i,o))return{x:f,underBar:!1,range:l};let d=c-a;for(let p=1;p<=d;p++){let m=f-p;if(m>=a&&!e.hasObstacle(m,i,o))return{x:m,underBar:!1,range:l};let g=f+p;if(g<=c&&!e.hasObstacle(g,i,o))return{x:g,underBar:!1,range:l}}return{x:f,underBar:!0,range:l}}let s=[r.x+10,n.x-10];for(let a of s)if(a>0&&!e.hasObstacle(a,i,o))return{x:a,underBar:!1,range:null};return{x:r.x+10,underBar:!0,range:null}}function oB(t,e,r,n){let i=Math.min(r.from.y,r.to.y),o=Math.max(r.from.y,r.to.y),s=n.bracketsNear(t,i,o,4);if(s.length===0)return{x:t,forceUnderBar:!1};let a=s[0],c=Math.abs(s[0].x-t);for(let d=1;d<s.length;d++){let p=Math.abs(s[d].x-t);p<c&&(a=s[d],c=p)}let l=[a.x+4,a.x-4],u=4-.01;for(let d of l){if(e&&(d<e.minX||d>e.maxX))continue;let p=e?d:Math.max(Math.min(r.from.x,r.to.x)+1,Math.min(Math.max(r.from.x,r.to.x)-1,d));if(n.bracketsNear(p,i,o,u).length===0)return{x:p,forceUnderBar:!1}}return{x:e?Math.min(Math.max(t,e.minX),e.maxX):t,forceUnderBar:!0}}function sB(t){let e=[...t].sort((i,o)=>Math.abs(i.channelX-o.channelX)>=1?i.channelX-o.channelX:i.orderIndex-o.orderIndex),r=new Map,n=0;for(;n<e.length;){let i=n+1;for(;i<e.length&&Math.abs(e[i].channelX-e[n].channelX)<1;)i++;let s=[...e.slice(n,i)].sort((c,l)=>{let u=Math.min(c.req.from.y,c.req.to.y),f=Math.min(l.req.from.y,l.req.to.y);return Math.abs(u-f)>.5?u-f:c.orderIndex-l.orderIndex}),a=[];for(let c of s){let l=Math.min(c.req.from.y,c.req.to.y),u=Math.max(c.req.from.y,c.req.to.y),f=-1;for(let d=0;d<a.length;d++)if(a[d]<=l){f=d,a[d]=u;break}f===-1&&(f=a.length,a.push(u)),r.set(c.orderIndex,f)}n=i}return r}function aB(t){if(t===0||t>4)return 0;let e=Math.ceil(t/2);return(t%2===1?1:-1)*e*3}function cB(t){let e=t.from.x>=t.to.x?{x:t.to.x-1,y:t.from.y}:t.from;return{fromId:t.fromId,toId:t.toId,waypoints:[e,t.to],underBar:!1}}function Ok(t,e){let r=new Array(t.length),n=[];for(let o=0;o<t.length;o++){let s=t[o];if(s.isMarkerSource){r[o]=cB(s);continue}if(Math.abs(s.from.y-s.to.y)<.5&&s.to.x-s.from.x<20){r[o]={fromId:s.fromId,toId:s.toId,waypoints:[s.from,s.to],underBar:!1};continue}let{x:a,underBar:c,range:l}=iB(s,e),{x:u,forceUnderBar:f}=oB(a,l,s,e),d=c||f;n.push({req:s,channelX:u,underBar:d,orderIndex:o})}let i=sB(n);for(let o of n){let s=aB(i.get(o.orderIndex)??0),a=o.channelX+s;r[o.orderIndex]={fromId:o.req.fromId,toId:o.req.toId,waypoints:lB(o.req.from,o.req.to,a),underBar:o.underBar}}return r}function lB(t,e,r){return Math.abs(t.y-e.y)<.5?[t,e]:[t,{x:r,y:t.y},{x:r,y:e.y},e]}var Ru="en-US",uB={"en-US":{nowLabel:"now",quarterPrefix:"Q"},fr:{nowLabel:"maint.",quarterPrefix:"T"}};function Lk(t,e){return e??t??Ru}function dh(t){let e={};for(let r of fB(t)){let n=uB[r];if(n)for(let i of Object.keys(n))e[i]===void 0&&n[i]!==void 0&&(e[i]=n[i])}return e}function fB(t){let e=[],r=dB(t);for(;r.length>0;){e.includes(r)||e.push(r);let n=r.lastIndexOf("-");if(n<=0)break;r=r.slice(0,n)}return e.includes(Ru)||e.push(Ru),e}function dB(t){return t.split("-").map((r,n)=>n===0?r.toLowerCase():/^[a-zA-Z]{2}$/.test(r)?r.toUpperCase():r).join("-")}function Fk(t){let{box:e,afterDate:r,beforeDate:n,hasLinkIcon:i,footnoteCount:o}=t;if(!r&&!n)return[];let s=[],a=12,c=e.y+5,l=e.width<40;if(r){let u=i?e.x+6+14+4:e.x+6,f=l?{x:e.x-6-a,y:c}:{x:u,y:c};s.push({side:"after",isoDate:r,glyphTopLeft:f,glyphSize:a,spilled:l})}if(n){let u=e.x+e.width,f;o>0?f=u-22-(o-1)*8-4:f=u-12-5-4;let d=f-a,p=l?{x:u+6,y:c}:{x:d,y:c};s.push({side:"before",isoDate:n,glyphTopLeft:p,glyphSize:a,spilled:l})}return s}function hh(t){let{box:e,afterDate:r,beforeDate:n}=t;if(!r&&!n)return[];let i=[],o=12,s=e.y+5;return r&&i.push({side:"after",isoDate:r,glyphTopLeft:{x:e.x+6,y:s},glyphSize:o,spilled:!1}),n&&i.push({side:"before",isoDate:n,glyphTopLeft:{x:e.x+e.width-6-o,y:s},glyphSize:o,spilled:!1}),i}function qn(t){for(let e of t)if(/^\d{4}-\d{2}-\d{2}$/.test(e))return e}function mh(t,e){return{x:t,y:e,height:0,maxX:t}}var Qa=class{constructor(e){fe(this,"rows");fe(this,"opts");this.opts=e,this.rows=[{y:e.originY,height:e.minRowHeight,rightEdge:e.laneLeftX,spillX:e.laneLeftX,placedChildren:[]}]}placeItem(e){for(let n=0;n<this.rows.length;n+=1){let i=this.rows[n];if(!(e.desiredStart<i.rightEdge)&&!(e.desiredStart<i.spillX)&&!this.rowIntersectsCorridor(i,e))return{rowIndex:n,y:i.y}}let r=this.appendRow(Math.max(this.opts.minRowHeight,e.predictedHeight));return{rowIndex:this.rows.length-1,y:r.y}}placeBlock(){let e=this.rows[this.rows.length-1];if(e.rightEdge>this.opts.laneLeftX){let r=this.appendRow(this.opts.minRowHeight);return{rowIndex:this.rows.length-1,y:r.y}}return{rowIndex:this.rows.length-1,y:e.y}}commitItem(e){let r=this.rows[e.rowIndex],n=Math.max(e.placed.box.height,e.rowHeight??0);this.growRowHeight(e.rowIndex,n),r.rightEdge=e.logicalEnd,r.spillX=e.spillReservation??this.opts.laneLeftX,r.placedChildren.push(e.placed)}commitBlock(e){let r=this.rows[e.rowIndex];this.growRowHeight(e.rowIndex,e.blockHeight),r.rightEdge=e.blockEnd,r.spillX=this.opts.laneLeftX,r.placedChildren.push(e.placed)}usedHeight(){let e=this.rows[this.rows.length-1];return e.y+e.height-this.opts.originY}usedRightX(){let e=this.opts.laneLeftX;for(let r of this.rows)r.rightEdge>e&&(e=r.rightEdge),r.spillX>e&&(e=r.spillX);return e}rowIntersectsCorridor(e,r){return this.opts.slackCorridors.some(n=>n.y>=e.y&&n.y<e.y+e.height&&r.desiredStart<n.xEnd&&r.desiredEnd>n.xStart&&n.slackPredId!==r.childId)}appendRow(e){let r=this.rows[this.rows.length-1],n={y:r.y+r.height,height:e,rightEdge:this.opts.laneLeftX,spillX:this.opts.laneLeftX,placedChildren:[]};return this.rows.push(n),n}growRowHeight(e,r){let n=this.rows[e],i=r-n.height;if(!(i<=0)){n.height=r;for(let o=e+1;o<this.rows.length;o+=1){let s=this.rows[o];s.y+=i;for(let a of s.placedChildren)Uk(a,i)}}}};function Uk(t,e){if(t.box.y+=e,t.kind==="item"){for(let r of t.labelChips)r.box.y+=e;t.overflowBox&&(t.overflowBox.y+=e);return}for(let r of t.children)Uk(r,e)}var Bk={red:"#f87171",blue:"#60a5fa",yellow:"#facc15",green:"#34d399",orange:"#fb923c",purple:"#a78bfa",gray:"#94a3b8",navy:"#818cf8",white:"#e2e8f0"},Wn={bg:"none",fg:"#e2e8f0",text:"#e2e8f0",border:"solid",icon:"none",shadow:"none",font:"sans",weight:"normal",italic:!1,textSize:"md",padding:"sm",spacing:"sm",headerHeight:"sm",cornerRadius:"sm",bracket:"none",capacityIcon:"multiplier"},Gk={name:"dark",surface:{page:"#0b1220",chart:"#111827",headerBox:"#1e293b"},entities:{roadmap:{...Wn,headerHeight:"md",padding:"md"},swimlane:{...Wn,fg:"#e2e8f0",text:"#e2e8f0",padding:"sm",spacing:"none",textSize:"sm"},item:{...Wn,bg:"#0f172a",fg:"#94a3b8",text:"#e2e8f0",shadow:"subtle",cornerRadius:"sm"},parallel:{...Wn,bracket:"none",padding:"xs"},group:{...Wn,bracket:"solid",padding:"xs",fg:"#94a3b8"},anchor:{...Wn,bg:"#0b1220",fg:"#cbd5e1",text:"#cbd5e1",cornerRadius:"sm"},milestone:{...Wn,bg:"#e2e8f0",fg:"#e2e8f0",text:"#0b1220",border:"solid"},footnote:{...Wn,bg:"none",fg:"#94a3b8",text:"#e2e8f0",textSize:"sm"},label:{...Wn,bg:"#1e293b",fg:"#94a3b8",text:"#e2e8f0",textSize:"xs",padding:"xs",cornerRadius:"full"}},swimlane:{bandEven:"#111827",bandOdd:"#0f172a",separator:"#1f2937",frameTabText:"#e2e8f0",frameTabMuted:"#94a3b8",border:"#334155",tabFill:"#1e293b",tabStroke:"#475569",tabText:"#e2e8f0",ownerText:"#94a3b8",footnoteIndicator:"#f87171",rowTintEven:"#0f172a",rowTintOdd:"#1e293b",utilizationOk:"#34d399",utilizationWarn:"#fbbf24",utilizationOver:"#f87171"},timeline:{gridLine:"#475569",minorGridLine:"#334155",tickMark:"#334155",labelText:"#cbd5e1",panelFill:"#0f172a",border:"#334155"},header:{cardBorder:"#475569",author:"#94a3b8"},item:{overflowX:"#f87171",linkIconFg:"#94a3b8",overflowTailFill:"#7f1d1d",overflowTailStroke:"#f87171",overflowCaption:"#fecaca"},parallel:{bracketStroke:"#cbd5e1"},anchorDiamond:{fill:"#0f172a",stroke:"#cbd5e1",label:"#cbd5e1",cutLine:"#94a3b8"},milestoneDiamond:{fill:"#e2e8f0",label:"#e2e8f0",cutLineNormal:"#a5b4fc",cutLineOverrun:"#ef4444",slack:"#cbd5e1"},footnotePanel:{fill:"#0f172a",border:"#334155",header:"#e2e8f0",title:"#e2e8f0",description:"#94a3b8",number:"#f87171"},nowline:{stroke:"#f87171",labelText:"#0b1220",labelBg:"#f87171"},milestone:{dashedInk:"#a5b4fc",overrun:"#ef4444"},anchor:{predecessorLine:"#94a3b8"},dependency:{edgeStroke:"#cbd5e1",overflowStroke:"#ef5350"},footnote:{indicatorText:"#f87171",descriptionMuted:"#94a3b8"},includeRegion:{border:"#475569",label:"#cbd5e1",badge:"#94a3b8",fill:"#0b1220",tabFill:"#111827",tabStroke:"#475569",tabText:"#e2e8f0",badgeFill:"#1e293b",badgeStroke:"#475569",badgeText:"#94a3b8"},arrowhead:{neutral:"#94a3b8",light:"#64748b",dark:"#e2e8f0"},status:{done:"#34d399",inProgress:"#60a5fa",atRisk:"#facc15",blocked:"#ef4444",planned:"#94a3b8",neutral:"#94a3b8"},statusDot:{onLight:{done:"#065f46",inProgress:"#1e3a8a",atRisk:"#92400e",blocked:"#991b1b",planned:"#334155",neutral:"#334155"},onDark:{done:"#d1fae5",inProgress:"#dbeafe",atRisk:"#fef3c7",blocked:"#fee2e2",planned:"#e2e8f0",neutral:"#e2e8f0"}},attribution:{mark:"#cbd5e1",link:"#f87171"},diagnostic:{overlayBg:"#7f1d1d",errorText:"#fecaca"}};var Xk={red:"#e53935",blue:"#1e88e5",yellow:"#fdd835",green:"#43a047",orange:"#fb8c00",purple:"#8e24aa",gray:"#9e9e9e",navy:"#0d47a1",white:"#ffffff"},Vn={bg:"none",fg:"#0f172a",text:"#0f172a",border:"solid",icon:"none",shadow:"none",font:"sans",weight:"normal",italic:!1,textSize:"md",padding:"sm",spacing:"sm",headerHeight:"sm",cornerRadius:"sm",bracket:"none",capacityIcon:"multiplier"},Hk={name:"light",surface:{page:"#f8fafc",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...Vn,headerHeight:"md",padding:"md"},swimlane:{...Vn,fg:"#334155",text:"#334155",padding:"sm",spacing:"none",textSize:"sm"},item:{...Vn,bg:"#ffffff",fg:"#94a3b8",text:"#0f172a",shadow:"subtle",cornerRadius:"sm"},parallel:{...Vn,bracket:"none",padding:"xs"},group:{...Vn,bracket:"solid",padding:"xs",fg:"#475569"},anchor:{...Vn,bg:"#0f172a",fg:"#0f172a",text:"#0f172a",cornerRadius:"sm"},milestone:{...Vn,bg:"#312e81",fg:"#312e81",text:"#ffffff",border:"solid"},footnote:{...Vn,bg:"none",fg:"#475569",text:"#475569",textSize:"sm"},label:{...Vn,bg:"#f1f5f9",fg:"#475569",text:"#475569",textSize:"xs",padding:"xs",cornerRadius:"full"}},swimlane:{bandEven:"#ffffff",bandOdd:"#f8fafc",separator:"#e2e8f0",frameTabText:"#334155",frameTabMuted:"#64748b",border:"#e2e8f0",tabFill:"#f1f5f9",tabStroke:"#cbd5e1",tabText:"#334155",ownerText:"#64748b",footnoteIndicator:"#dc2626",rowTintEven:"#ffffff",rowTintOdd:"#f8fafc",utilizationOk:"#10b981",utilizationWarn:"#f59e0b",utilizationOver:"#ef4444"},timeline:{gridLine:"#cbd5e1",minorGridLine:"#e2e8f0",tickMark:"#cbd5e1",labelText:"#64748b",panelFill:"#ffffff",border:"#e2e8f0"},header:{cardBorder:"#e2e8f0",author:"#64748b"},item:{overflowX:"#dc2626",linkIconFg:"#0f172a",overflowTailFill:"#fee2e2",overflowTailStroke:"#ef4444",overflowCaption:"#b91c1c"},parallel:{bracketStroke:"#334155"},anchorDiamond:{fill:"#ffffff",stroke:"#334155",label:"#334155",cutLine:"#64748b"},milestoneDiamond:{fill:"#0f172a",label:"#0f172a",cutLineNormal:"#1e1b4b",cutLineOverrun:"#b91c1c",slack:"#0f172a"},footnotePanel:{fill:"#ffffff",border:"#e2e8f0",header:"#0f172a",title:"#0f172a",description:"#64748b",number:"#dc2626"},nowline:{stroke:"#e53e3e",labelText:"#ffffff",labelBg:"#e53e3e"},milestone:{dashedInk:"#94a3b8",overrun:"#ef4444"},anchor:{predecessorLine:"#94a3b8"},dependency:{edgeStroke:"#475569",overflowStroke:"#d32f2f"},footnote:{indicatorText:"#e53e3e",descriptionMuted:"#64748b"},includeRegion:{border:"#94a3b8",label:"#334155",badge:"#64748b",fill:"#f8fafc",tabFill:"#ffffff",tabStroke:"#cbd5e1",tabText:"#0f172a",badgeFill:"#e2e8f0",badgeStroke:"#cbd5e1",badgeText:"#475569"},arrowhead:{neutral:"#475569",light:"#94a3b8",dark:"#0f172a"},status:{done:"#10b981",inProgress:"#3b82f6",atRisk:"#f59e0b",blocked:"#ef4444",planned:"#94a3b8",neutral:"#94a3b8"},statusDot:{onLight:{done:"#065f46",inProgress:"#1e3a8a",atRisk:"#92400e",blocked:"#991b1b",planned:"#334155",neutral:"#334155"},onDark:{done:"#d1fae5",inProgress:"#dbeafe",atRisk:"#fef3c7",blocked:"#fee2e2",planned:"#e2e8f0",neutral:"#e2e8f0"}},attribution:{mark:"#94a3b8",link:"#e53e3e"},diagnostic:{overlayBg:"#fee2e2",errorText:"#991b1b"}};var jk={light:Hk,dark:Gk};var gB={grey:"gray",violet:"purple"};function Vo(t,e){if(t==="none")return"none";if(t.startsWith("#"))return t;let r=e.name==="dark"?Bk:Xk,n=gB[t]??t,i=r[n];return typeof i=="string"?i:t}function ec(t){return t.key.endsWith(":")?t.key.slice(0,-1):t.key}function yB(t,e){return{bg:Vo(t.bg,e),fg:Vo(t.fg,e),text:Vo(t.text,e),border:t.border,icon:t.icon,shadow:t.shadow,font:t.font,weight:t.weight,italic:t.italic,textSize:t.textSize,padding:t.padding,spacing:t.spacing,headerHeight:t.headerHeight,cornerRadius:t.cornerRadius,bracket:t.bracket,headerPosition:"beside",capacityIcon:t.capacityIcon,timelinePosition:"top",minorGrid:!1}}function T_(t,e,r,n){switch(e){case"bg":t.bg=Vo(r,n);break;case"fg":t.fg=Vo(r,n);break;case"text":t.text=Vo(r,n);break;case"border":(r==="solid"||r==="dashed"||r==="dotted")&&(t.border=r);break;case"icon":t.icon=r;break;case"shadow":(r==="none"||r==="subtle"||r==="soft"||r==="hard")&&(t.shadow=r);break;case"font":(r==="sans"||r==="serif"||r==="mono")&&(t.font=r);break;case"weight":(r==="thin"||r==="light"||r==="normal"||r==="bold")&&(t.weight=r);break;case"italic":t.italic=r==="true";break;case"text-size":t.textSize=Au(r,"xl");break;case"padding":t.padding=Au(r,"xl");break;case"spacing":t.spacing=Au(r,"xl");break;case"header-height":t.headerHeight=Au(r,"xl");break;case"corner-radius":t.cornerRadius=Au(r,"full");break;case"bracket":(r==="none"||r==="solid"||r==="dashed")&&(t.bracket=r);break;case"header-position":(r==="beside"||r==="above")&&(t.headerPosition=r);break;case"capacity-icon":t.capacityIcon=r;break;case"timeline-position":(r==="top"||r==="bottom"||r==="both")&&(t.timelinePosition=r);break;case"minor-grid":t.minorGrid=r==="true";break;default:break}}function Au(t,e){let r=["none","xs","sm","md","lg","xl","full"],n=r.indexOf(e),i=r.indexOf(t);return i<0?"md":i>n?r[n]:r[i]}function zk(t,e,r){if(e)for(let n of e.properties)T_(t,ec(n),n.value,r)}function xB(t,e,r){for(let n of e){let i=ec(n);n.value!==void 0&&T_(t,i,n.value,r)}}function TB(t,e,r){let n=e.find(o=>ec(o)==="labels");if(!n)return;let i=n.value?[n.value]:n.values;for(let o of i){let s=r.labels.get(o);if(!s)continue;let a=s.properties.find(c=>ec(c)==="style");a?.value&&zk(t,r.styles.get(a.value),r.theme)}}function _B(t,e,r){let n=e.find(i=>ec(i)==="style");n?.value&&zk(t,r.styles.get(n.value),r.theme)}function Tt(t,e,r){let n=r.theme.entities[t],i=yB(n,r.theme),o=r.defaults.get(t);if(o)for(let s of o.properties)s.value!==void 0&&T_(i,ec(s),s.value,r.theme);return TB(i,e,r),_B(i,e,r),xB(i,e,r.theme),i}function qk(t,e){return Tt("label",t.properties,e)}var Wk={none:0,xs:2,sm:4,md:8,lg:16,xl:24},Vk={none:0,xs:4,sm:8,md:12,lg:20,xl:32};var tc={none:0,xs:10,sm:12,md:14,lg:18,xl:24},gh={none:0,xs:2,sm:4,md:8,lg:12,xl:20,full:9999};var Pr=8,vn=4,Su=24,yh=15,Iu=8,xh=22,Th=15,ku=16,_h=6,__=4,E_=11,v_=9,R_=5.5,w_=4,rc=12,Eh="6 4",b_=36,Hi=16,A_=Hi/2,Nu=10,S_=Hi-4,nc=6,vh=2.25,Zr=6,Jr=2*Zr,Yk=5,Kk=120,I_=240,Rh=72,Pu=28,Qr=16,k_=22,Cu=18,wh="Powered by",N_="https://nowline.io",Ou=.22,ji=40,bh=32,Zk=.58,EB=wh.length*bh*Zk,vB=10,Lu=EB+vB,P_=Lu+74,C_=5,Ah=Lu+81,RB=3*ji*Zk,wB=Ah+RB,bB=12+ji,O_=wB*Ou,Jk=bB*Ou,L_=4;var We={sans:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',serif:'Georgia, "Times New Roman", serif',mono:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"},Qk={days:7,weeks:4,months:3,quarters:4,years:5};var Sh=class{constructor(e,r){fe(this,"node");fe(this,"deps");this.node=e,this.deps=r}get id(){return this.node.name??""}place(e,r){let{node:n}=this,{deps:i}=this,o=Tt("group",n.properties,r.styleCtx),s=e.x,a=n.title??n.name,c=r.currentFlowKey;r.currentFlowKey=`${c}/group:${n.name??"g"}`;let l=o.bg!=="none"&&o.bg!=="#ffffff"&&!!a,u=l?ku+__:0,f=l?w_:0,d=!l&&a?rc:0,p=e.y+d,m=r.bandScale.step(),g=s,v=new Qa({laneLeftX:g,originY:p+u,minRowHeight:m,slackCorridors:r.slackCorridors}),T=g,_=[];for(let z of n.content){if(z.$type==="DescriptionDirective")continue;if(!yr(z)){let ee=z.properties??[],Le=i.resolveChildStart(ee,T,g,r),{rowIndex:Fe,y:Ue}=v.placeBlock(),q=i.newCursor(Le,Ue),J=i.sequenceOne(z,q,r);_.push(J);let te=J.box.x+J.box.width,P=Math.max(m,q.height);v.commitBlock({rowIndex:Fe,placed:J,blockHeight:P,blockEnd:te}),T=Math.max(T,te);continue}let le=z.properties,O=i.resolveChildStart(le,T,g,r),R=Xi(le,r.sizes,r.cal),L=Math.max(Pr,R*r.timeline.pixelsPerDay),$=O+L,b=z.name??"",A=i.predictItemChipExtraHeight(z,r),S=m+A,{rowIndex:M,y:X}=v.placeItem({childId:b,desiredStart:O,desiredEnd:$,predictedHeight:S}),F=i.newCursor(O,X),W=i.sequenceItem(z,F,r);_.push(W);let K=W.box.x+W.box.width+Zr;T=Math.max(T,K);let pe=null;(W.textSpills||W.chipsOutside||W.dotSpills||W.iconSpills||W.footnoteSpills)&&(pe=Math.max(W.decorationsRightX,W.chipsOutside?W.chipsRightX:0)+6),v.commitItem({rowIndex:M,placed:W,logicalEnd:K,spillReservation:pe,rowHeight:S})}let E=Math.max(m,v.usedHeight()),I=Math.max(T,v.usedRightX()),D={x:s,y:p,width:I-s,height:u+E+f};e.x=T+Iu,e.maxX=Math.max(e.maxX,e.x);let k=r.bandScale.step()-r.bandScale.bandwidth();e.height=Math.max(e.height,d+D.height+k);let B=n.name;B&&(r.entityLeftEdges.set(B,D.x),r.entityRightEdges.set(B,D.x+D.width)),r.currentFlowKey=c;let U=hh({box:D,afterDate:qn(xt(n.properties,"after")),beforeDate:qn(xt(n.properties,"before"))});return{kind:"group",id:B,title:a,box:D,children:_,style:o,inlineDatePins:U.length>0?U:void 0}}};var D_=12,AB=4,SB=13,IB=11;function eN(t,e){return t.length*e*.58}var Ih=class{constructor(e){fe(this,"input");this.input=e}get id(){return this.input.id}measure(e){return{width:Math.max(Pr,this.input.logicalRightX-this.input.logicalLeftX),height:e.bands.bandwidth()}}place(e,r){let n=this.measure(r),i=Math.max(Pr,n.width-2*Zr),o=e.x+Zr,s={x:o,y:e.y,width:i,height:n.height},a=this.input.hasLinkIcon?20+kB-D_:0,c=D_+Math.max(0,a),l=Math.max(0,i-c-D_),u=this.input.title,f=u?eN(u,SB):0,d=this.input.metaText?eN(this.input.metaText,IB):0,p=this.input.metaTrailingWidth??0,m=d+p,g=this.input.metaText!==void 0||p>0,v=u.length>0&&f>l||g&&m>l,T=v?o+i+AB:o+c;return{id:this.input.id,box:s,textX:T,textSpills:v}}},kB=4;var kh=class{constructor(e,r){fe(this,"node");fe(this,"deps");this.node=e,this.deps=r}get id(){return this.node.name??""}place(e,r){let{node:n}=this,{deps:i}=this,o=Tt("parallel",n.properties,r.styleCtx),s=e.x,a=e.y,c=[],l=s,u=0,f=r.currentFlowKey,d=n.name??"p",p=0;for(let T of n.content){if(T.$type==="DescriptionDirective")continue;r.currentFlowKey=`${f}/par:${d}#${p}`;let _=i.newCursor(s,a+u),E=i.sequenceOne(T,_,r);c.push(E),u+=Math.max(r.bandScale.step(),_.height),l=Math.max(l,_.maxX),p++}r.currentFlowKey=f;let m={x:s,y:a,width:l-s,height:u};e.x=l+Iu,e.maxX=Math.max(e.maxX,e.x),e.height=Math.max(e.height,u);let g=n.name;g&&(r.entityLeftEdges.set(g,m.x),r.entityRightEdges.set(g,m.x+m.width));let v=hh({box:m,afterDate:qn(xt(n.properties,"after")),beforeDate:qn(xt(n.properties,"before"))});return{kind:"parallel",id:g,title:n.title??n.name,box:m,children:c,style:o,inlineDatePins:v.length>0?v:void 0}}};function Yo(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function $_(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Ko(t){let e,r,n;t.length!==2?(e=Yo,r=(a,c)=>Yo(t(a),c),n=(a,c)=>t(a)-c):(e=t===Yo||t===$_?t:NB,r=t,n=t);function i(a,c,l=0,u=a.length){if(l<u){if(e(c,c)!==0)return u;do{let f=l+u>>>1;r(a[f],c)<0?l=f+1:u=f}while(l<u)}return l}function o(a,c,l=0,u=a.length){if(l<u){if(e(c,c)!==0)return u;do{let f=l+u>>>1;r(a[f],c)<=0?l=f+1:u=f}while(l<u)}return l}function s(a,c,l=0,u=a.length){let f=i(a,c,l,u-1);return f>l&&n(a[f-1],c)>-n(a[f],c)?f-1:f}return{left:i,center:s,right:o}}function NB(){return 0}function M_(t){return t===null?NaN:+t}var tN=Ko(Yo),rN=tN.right,PB=tN.left,CB=Ko(M_).center,F_=rN;var ic=class extends Map{constructor(e,r=DB){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(let[n,i]of e)this.set(n,i)}get(e){return super.get(nN(this,e))}has(e){return super.has(nN(this,e))}set(e,r){return super.set(OB(this,e),r)}delete(e){return super.delete(LB(this,e))}};function nN({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):r}function OB({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function LB({_intern:t,_key:e},r){let n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function DB(t){return t!==null&&typeof t=="object"?t.valueOf():t}var $B=Math.sqrt(50),MB=Math.sqrt(10),FB=Math.sqrt(2);function iN(t,e,r){let n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),o=n/Math.pow(10,i),s=o>=$B?10:o>=MB?5:o>=FB?2:1,a,c,l;return i<0?(l=Math.pow(10,-i)/s,a=Math.round(t*l),c=Math.round(e*l),a/l<t&&++a,c/l>e&&--c,l=-l):(l=Math.pow(10,i)*s,a=Math.round(t/l),c=Math.round(e/l),a*l<t&&++a,c*l>e&&--c),c<a&&.5<=r&&r<2?iN(t,e,r*2):[a,c,l]}function U_(t,e,r){return e=+e,t=+t,r=+r,iN(t,e,r)[2]}function Nh(t,e,r){e=+e,t=+t,r=+r;let n=e<t,i=n?U_(e,t,r):U_(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}function Ph(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,o=new Array(i);++n<i;)o[n]=t+n*r;return o}function oc(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}var oN=Symbol("implicit");function Ch(){var t=new ic,e=[],r=[],n=oN;function i(o){let s=t.get(o);if(s===void 0){if(n!==oN)return n;t.set(o,s=e.push(o)-1)}return r[s%r.length]}return i.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new ic;for(let s of o)t.has(s)||t.set(s,e.push(s)-1);return i},i.range=function(o){return arguments.length?(r=Array.from(o),i):r.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return Ch(e,r).unknown(n)},oc.apply(i,arguments),i}function Du(){var t=Ch().unknown(void 0),e=t.domain,r=t.range,n=0,i=1,o,s,a=!1,c=0,l=0,u=.5;delete t.unknown;function f(){var d=e().length,p=i<n,m=p?i:n,g=p?n:i;o=(g-m)/Math.max(1,d-c+l*2),a&&(o=Math.floor(o)),m+=(g-m-o*(d-c))*u,s=o*(1-c),a&&(m=Math.round(m),s=Math.round(s));var v=Ph(d).map(function(T){return m+o*T});return r(p?v.reverse():v)}return t.domain=function(d){return arguments.length?(e(d),f()):e()},t.range=function(d){return arguments.length?([n,i]=d,n=+n,i=+i,f()):[n,i]},t.rangeRound=function(d){return[n,i]=d,n=+n,i=+i,a=!0,f()},t.bandwidth=function(){return s},t.step=function(){return o},t.round=function(d){return arguments.length?(a=!!d,f()):a},t.padding=function(d){return arguments.length?(c=Math.min(1,l=+d),f()):c},t.paddingInner=function(d){return arguments.length?(c=Math.min(1,d),f()):c},t.paddingOuter=function(d){return arguments.length?(l=+d,f()):l},t.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),f()):u},t.copy=function(){return Du(e(),[n,i]).round(a).paddingInner(c).paddingOuter(l).align(u)},oc.apply(f(),arguments)}function Oh(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function B_(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Fu(){}var $u=.7,$h=1/$u,sc="\\s*([+-]?\\d+)\\s*",Mu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Rn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",UB=/^#([0-9a-f]{3,8})$/,BB=new RegExp(`^rgb\\(${sc},${sc},${sc}\\)$`),GB=new RegExp(`^rgb\\(${Rn},${Rn},${Rn}\\)$`),XB=new RegExp(`^rgba\\(${sc},${sc},${sc},${Mu}\\)$`),HB=new RegExp(`^rgba\\(${Rn},${Rn},${Rn},${Mu}\\)$`),jB=new RegExp(`^hsl\\(${Mu},${Rn},${Rn}\\)$`),zB=new RegExp(`^hsla\\(${Mu},${Rn},${Rn},${Mu}\\)$`),sN={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Oh(Fu,zi,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:aN,formatHex:aN,formatHex8:qB,formatHsl:WB,formatRgb:cN,toString:cN});function aN(){return this.rgb().formatHex()}function qB(){return this.rgb().formatHex8()}function WB(){return hN(this).formatHsl()}function cN(){return this.rgb().formatRgb()}function zi(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=UB.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?lN(e):r===3?new ar(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?Lh(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?Lh(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=BB.exec(t))?new ar(e[1],e[2],e[3],1):(e=GB.exec(t))?new ar(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=XB.exec(t))?Lh(e[1],e[2],e[3],e[4]):(e=HB.exec(t))?Lh(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=jB.exec(t))?dN(e[1],e[2]/100,e[3]/100,1):(e=zB.exec(t))?dN(e[1],e[2]/100,e[3]/100,e[4]):sN.hasOwnProperty(t)?lN(sN[t]):t==="transparent"?new ar(NaN,NaN,NaN,0):null}function lN(t){return new ar(t>>16&255,t>>8&255,t&255,1)}function Lh(t,e,r,n){return n<=0&&(t=e=r=NaN),new ar(t,e,r,n)}function VB(t){return t instanceof Fu||(t=zi(t)),t?(t=t.rgb(),new ar(t.r,t.g,t.b,t.opacity)):new ar}function ac(t,e,r,n){return arguments.length===1?VB(t):new ar(t,e,r,n??1)}function ar(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}Oh(ar,ac,B_(Fu,{brighter(t){return t=t==null?$h:Math.pow($h,t),new ar(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?$u:Math.pow($u,t),new ar(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ar(Jo(this.r),Jo(this.g),Jo(this.b),Mh(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:uN,formatHex:uN,formatHex8:YB,formatRgb:fN,toString:fN}));function uN(){return`#${Zo(this.r)}${Zo(this.g)}${Zo(this.b)}`}function YB(){return`#${Zo(this.r)}${Zo(this.g)}${Zo(this.b)}${Zo((isNaN(this.opacity)?1:this.opacity)*255)}`}function fN(){let t=Mh(this.opacity);return`${t===1?"rgb(":"rgba("}${Jo(this.r)}, ${Jo(this.g)}, ${Jo(this.b)}${t===1?")":`, ${t})`}`}function Mh(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Jo(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Zo(t){return t=Jo(t),(t<16?"0":"")+t.toString(16)}function dN(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new en(t,e,r,n)}function hN(t){if(t instanceof en)return new en(t.h,t.s,t.l,t.opacity);if(t instanceof Fu||(t=zi(t)),!t)return new en;if(t instanceof en)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=NaN,a=o-i,c=(o+i)/2;return a?(e===o?s=(r-n)/a+(r<n)*6:r===o?s=(n-e)/a+2:s=(e-r)/a+4,a/=c<.5?o+i:2-o-i,s*=60):a=c>0&&c<1?0:s,new en(s,a,c,t.opacity)}function mN(t,e,r,n){return arguments.length===1?hN(t):new en(t,e,r,n??1)}function en(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}Oh(en,mN,B_(Fu,{brighter(t){return t=t==null?$h:Math.pow($h,t),new en(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?$u:Math.pow($u,t),new en(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new ar(G_(t>=240?t-240:t+120,i,n),G_(t,i,n),G_(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new en(pN(this.h),Dh(this.s),Dh(this.l),Mh(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=Mh(this.opacity);return`${t===1?"hsl(":"hsla("}${pN(this.h)}, ${Dh(this.s)*100}%, ${Dh(this.l)*100}%${t===1?")":`, ${t})`}`}}));function pN(t){return t=(t||0)%360,t<0?t+360:t}function Dh(t){return Math.max(0,Math.min(1,t||0))}function G_(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}function X_(t,e,r,n,i){var o=t*t,s=o*t;return((1-3*t+3*o-s)*e+(4-6*o+3*s)*r+(1+3*t+3*o-3*s)*n+s*i)/6}function gN(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),i=t[n],o=t[n+1],s=n>0?t[n-1]:2*i-o,a=n<e-1?t[n+2]:2*o-i;return X_((r-n/e)*e,s,i,o,a)}}function yN(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),i=t[(n+e-1)%e],o=t[n%e],s=t[(n+1)%e],a=t[(n+2)%e];return X_((r-n/e)*e,i,o,s,a)}}var Uu=t=>()=>t;function KB(t,e){return function(r){return t+r*e}}function ZB(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function xN(t){return(t=+t)==1?Fh:function(e,r){return r-e?ZB(e,r,t):Uu(isNaN(e)?r:e)}}function Fh(t,e){var r=e-t;return r?KB(t,r):Uu(isNaN(t)?e:t)}var H_=(function t(e){var r=xN(e);function n(i,o){var s=r((i=ac(i)).r,(o=ac(o)).r),a=r(i.g,o.g),c=r(i.b,o.b),l=Fh(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=c(u),i.opacity=l(u),i+""}}return n.gamma=t,n})(1);function TN(t){return function(e){var r=e.length,n=new Array(r),i=new Array(r),o=new Array(r),s,a;for(s=0;s<r;++s)a=ac(e[s]),n[s]=a.r||0,i[s]=a.g||0,o[s]=a.b||0;return n=t(n),i=t(i),o=t(o),a.opacity=1,function(c){return a.r=n(c),a.g=i(c),a.b=o(c),a+""}}}var Nre=TN(gN),Pre=TN(yN);function _N(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(o){for(i=0;i<r;++i)n[i]=t[i]*(1-o)+e[i]*o;return n}}function EN(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function vN(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,i=new Array(n),o=new Array(r),s;for(s=0;s<n;++s)i[s]=Qo(t[s],e[s]);for(;s<r;++s)o[s]=e[s];return function(a){for(s=0;s<n;++s)o[s]=i[s](a);return o}}function RN(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function qi(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function wN(t,e){var r={},n={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?r[i]=Qo(t[i],e[i]):n[i]=e[i];return function(o){for(i in r)n[i]=r[i](o);return n}}var z_=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,j_=new RegExp(z_.source,"g");function JB(t){return function(){return t}}function QB(t){return function(e){return t(e)+""}}function bN(t,e){var r=z_.lastIndex=j_.lastIndex=0,n,i,o,s=-1,a=[],c=[];for(t=t+"",e=e+"";(n=z_.exec(t))&&(i=j_.exec(e));)(o=i.index)>r&&(o=e.slice(r,o),a[s]?a[s]+=o:a[++s]=o),(n=n[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,c.push({i:s,x:qi(n,i)})),r=j_.lastIndex;return r<e.length&&(o=e.slice(r),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?QB(c[0].x):JB(e):(e=c.length,function(l){for(var u=0,f;u<e;++u)a[(f=c[u]).i]=f.x(l);return a.join("")})}function Qo(t,e){var r=typeof e,n;return e==null||r==="boolean"?Uu(e):(r==="number"?qi:r==="string"?(n=zi(e))?(e=n,H_):bN:e instanceof zi?H_:e instanceof Date?RN:EN(e)?_N:Array.isArray(e)?vN:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?wN:qi)(t,e)}function q_(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function W_(t){return function(){return t}}function V_(t){return+t}var AN=[0,1];function cc(t){return t}function Y_(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:W_(isNaN(e)?NaN:.5)}function e4(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function t4(t,e,r){var n=t[0],i=t[1],o=e[0],s=e[1];return i<n?(n=Y_(i,n),o=r(s,o)):(n=Y_(n,i),o=r(o,s)),function(a){return o(n(a))}}function r4(t,e,r){var n=Math.min(t.length,e.length)-1,i=new Array(n),o=new Array(n),s=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<n;)i[s]=Y_(t[s],t[s+1]),o[s]=r(e[s],e[s+1]);return function(a){var c=F_(t,a,1,n)-1;return o[c](i[c](a))}}function SN(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function n4(){var t=AN,e=AN,r=Qo,n,i,o,s=cc,a,c,l;function u(){var d=Math.min(t.length,e.length);return s!==cc&&(s=e4(t[0],t[d-1])),a=d>2?r4:t4,c=l=null,f}function f(d){return d==null||isNaN(d=+d)?o:(c||(c=a(t.map(n),e,r)))(n(s(d)))}return f.invert=function(d){return s(i((l||(l=a(e,t.map(n),qi)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,V_),u()):t.slice()},f.range=function(d){return arguments.length?(e=Array.from(d),u()):e.slice()},f.rangeRound=function(d){return e=Array.from(d),r=q_,u()},f.clamp=function(d){return arguments.length?(s=d?!0:cc,u()):s!==cc},f.interpolate=function(d){return arguments.length?(r=d,u()):r},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,p){return n=d,i=p,u()}}function K_(){return n4()(cc,cc)}function Z_(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],o=t[n],s;return o<i&&(s=r,r=n,n=s,s=i,i=o,o=s),t[r]=e.floor(i),t[n]=e.ceil(o),t}var J_=new Date,Q_=new Date;function Ze(t,e,r,n){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{let s=i(o),a=i.ceil(o);return o-s<a-o?s:a},i.offset=(o,s)=>(e(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{let c=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return c;let l;do c.push(l=new Date(+o)),e(o,a),t(o);while(l<o&&o<s);return c},i.filter=o=>Ze(s=>{if(s>=s)for(;t(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!o(s););else for(;--a>=0;)for(;e(s,1),!o(s););}),r&&(i.count=(o,s)=>(J_.setTime(+o),Q_.setTime(+s),t(J_),t(Q_),Math.floor(r(J_,Q_))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(n?s=>n(s)%o===0:s=>i.count(0,s)%o===0):i)),i}var Bu=Ze(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Bu.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Ze(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):Bu);var pne=Bu.range;var wn=Ze(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),IN=wn.range;var lc=Ze(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),i4=lc.range,Uh=Ze(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),o4=Uh.range;var uc=Ze(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3-t.getMinutes()*6e4)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getHours()),s4=uc.range,Bh=Ze(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),a4=Bh.range;var Yn=Ze(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1),c4=Yn.range,Xu=Ze(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),l4=Xu.range,Gh=Ze(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),u4=Gh.range;function rs(t){return Ze(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}var Kn=rs(0),fc=rs(1),NN=rs(2),PN=rs(3),Wi=rs(4),CN=rs(5),ON=rs(6),LN=Kn.range,f4=fc.range,d4=NN.range,p4=PN.range,h4=Wi.range,m4=CN.range,g4=ON.range;function ns(t){return Ze(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/6048e5)}var is=ns(0),dc=ns(1),DN=ns(2),$N=ns(3),Vi=ns(4),MN=ns(5),FN=ns(6),UN=is.range,y4=dc.range,x4=DN.range,T4=$N.range,_4=Vi.range,E4=MN.range,v4=FN.range;var pc=Ze(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),R4=pc.range,Xh=Ze(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),w4=Xh.range;var xr=Ze(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());xr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ze(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});var b4=xr.range,tn=Ze(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());tn.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ze(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});var A4=tn.range;function GN(t,e,r,n,i,o){let s=[[wn,1,1e3],[wn,5,5*1e3],[wn,15,15*1e3],[wn,30,30*1e3],[o,1,6e4],[o,5,5*6e4],[o,15,15*6e4],[o,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[n,1,864e5],[n,2,2*864e5],[r,1,6048e5],[e,1,2592e6],[e,3,3*2592e6],[t,1,31536e6]];function a(l,u,f){let d=u<l;d&&([l,u]=[u,l]);let p=f&&typeof f.range=="function"?f:c(l,u,f),m=p?p.range(l,+u+1):[];return d?m.reverse():m}function c(l,u,f){let d=Math.abs(u-l)/f,p=Ko(([,,v])=>v).right(s,d);if(p===s.length)return t.every(Nh(l/31536e6,u/31536e6,f));if(p===0)return Bu.every(Math.max(Nh(l,u,f),1));let[m,g]=s[d/s[p-1][2]<s[p][2]/d?p-1:p];return m.every(g)}return[a,c]}var[I4,k4]=GN(tn,Xh,is,Gh,Bh,Uh),[eE,tE]=GN(xr,pc,Kn,Yn,uc,lc);function rE(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function nE(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Hu(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function iE(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,o=t.days,s=t.shortDays,a=t.months,c=t.shortMonths,l=ju(i),u=zu(i),f=ju(o),d=zu(o),p=ju(s),m=zu(s),g=ju(a),v=zu(a),T=ju(c),_=zu(c),E={a:S,A:M,b:X,B:F,c:null,d:WN,e:WN,f:J4,g:c3,G:u3,H:Y4,I:K4,j:Z4,L:JN,m:Q4,M:e3,p:W,q:K,Q:KN,s:ZN,S:t3,u:r3,U:n3,V:i3,w:o3,W:s3,x:null,X:null,y:a3,Y:l3,Z:f3,"%":YN},I={a:pe,A:V,b:ee,B:Le,c:null,d:VN,e:VN,f:m3,g:b3,G:S3,H:d3,I:p3,j:h3,L:eP,m:g3,M:y3,p:Fe,q:Ue,Q:KN,s:ZN,S:x3,u:T3,U:_3,V:E3,w:v3,W:R3,x:null,X:null,y:w3,Y:A3,Z:I3,"%":YN},D={a:le,A:O,b:R,B:L,c:$,d:zN,e:zN,f:z4,g:jN,G:HN,H:qN,I:qN,j:G4,L:j4,m:B4,M:X4,p:z,q:U4,Q:W4,s:V4,S:H4,u:L4,U:D4,V:$4,w:O4,W:M4,x:b,X:A,y:jN,Y:HN,Z:F4,"%":q4};E.x=k(r,E),E.X=k(n,E),E.c=k(e,E),I.x=k(r,I),I.X=k(n,I),I.c=k(e,I);function k(q,J){return function(te){var P=[],ge=-1,xe=0,He=q.length,dt,H,Cr;for(te instanceof Date||(te=new Date(+te));++ge<He;)q.charCodeAt(ge)===37&&(P.push(q.slice(xe,ge)),(H=XN[dt=q.charAt(++ge)])!=null?dt=q.charAt(++ge):H=dt==="e"?" ":"0",(Cr=J[dt])&&(dt=Cr(te,H)),P.push(dt),xe=ge+1);return P.push(q.slice(xe,ge)),P.join("")}}function B(q,J){return function(te){var P=Hu(1900,void 0,1),ge=U(P,q,te+="",0),xe,He;if(ge!=te.length)return null;if("Q"in P)return new Date(P.Q);if("s"in P)return new Date(P.s*1e3+("L"in P?P.L:0));if(J&&!("Z"in P)&&(P.Z=0),"p"in P&&(P.H=P.H%12+P.p*12),P.m===void 0&&(P.m="q"in P?P.q:0),"V"in P){if(P.V<1||P.V>53)return null;"w"in P||(P.w=1),"Z"in P?(xe=nE(Hu(P.y,0,1)),He=xe.getUTCDay(),xe=He>4||He===0?dc.ceil(xe):dc(xe),xe=Xu.offset(xe,(P.V-1)*7),P.y=xe.getUTCFullYear(),P.m=xe.getUTCMonth(),P.d=xe.getUTCDate()+(P.w+6)%7):(xe=rE(Hu(P.y,0,1)),He=xe.getDay(),xe=He>4||He===0?fc.ceil(xe):fc(xe),xe=Yn.offset(xe,(P.V-1)*7),P.y=xe.getFullYear(),P.m=xe.getMonth(),P.d=xe.getDate()+(P.w+6)%7)}else("W"in P||"U"in P)&&("w"in P||(P.w="u"in P?P.u%7:"W"in P?1:0),He="Z"in P?nE(Hu(P.y,0,1)).getUTCDay():rE(Hu(P.y,0,1)).getDay(),P.m=0,P.d="W"in P?(P.w+6)%7+P.W*7-(He+5)%7:P.w+P.U*7-(He+6)%7);return"Z"in P?(P.H+=P.Z/100|0,P.M+=P.Z%100,nE(P)):rE(P)}}function U(q,J,te,P){for(var ge=0,xe=J.length,He=te.length,dt,H;ge<xe;){if(P>=He)return-1;if(dt=J.charCodeAt(ge++),dt===37){if(dt=J.charAt(ge++),H=D[dt in XN?J.charAt(ge++):dt],!H||(P=H(q,te,P))<0)return-1}else if(dt!=te.charCodeAt(P++))return-1}return P}function z(q,J,te){var P=l.exec(J.slice(te));return P?(q.p=u.get(P[0].toLowerCase()),te+P[0].length):-1}function le(q,J,te){var P=p.exec(J.slice(te));return P?(q.w=m.get(P[0].toLowerCase()),te+P[0].length):-1}function O(q,J,te){var P=f.exec(J.slice(te));return P?(q.w=d.get(P[0].toLowerCase()),te+P[0].length):-1}function R(q,J,te){var P=T.exec(J.slice(te));return P?(q.m=_.get(P[0].toLowerCase()),te+P[0].length):-1}function L(q,J,te){var P=g.exec(J.slice(te));return P?(q.m=v.get(P[0].toLowerCase()),te+P[0].length):-1}function $(q,J,te){return U(q,e,J,te)}function b(q,J,te){return U(q,r,J,te)}function A(q,J,te){return U(q,n,J,te)}function S(q){return s[q.getDay()]}function M(q){return o[q.getDay()]}function X(q){return c[q.getMonth()]}function F(q){return a[q.getMonth()]}function W(q){return i[+(q.getHours()>=12)]}function K(q){return 1+~~(q.getMonth()/3)}function pe(q){return s[q.getUTCDay()]}function V(q){return o[q.getUTCDay()]}function ee(q){return c[q.getUTCMonth()]}function Le(q){return a[q.getUTCMonth()]}function Fe(q){return i[+(q.getUTCHours()>=12)]}function Ue(q){return 1+~~(q.getUTCMonth()/3)}return{format:function(q){var J=k(q+="",E);return J.toString=function(){return q},J},parse:function(q){var J=B(q+="",!1);return J.toString=function(){return q},J},utcFormat:function(q){var J=k(q+="",I);return J.toString=function(){return q},J},utcParse:function(q){var J=B(q+="",!0);return J.toString=function(){return q},J}}}var XN={"-":"",_:" ",0:"0"},Ot=/^\s*\d+/,N4=/^%/,P4=/[\\^$*+?|[\]().{}]/g;function Ce(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",o=i.length;return n+(o<r?new Array(r-o+1).join(e)+i:i)}function C4(t){return t.replace(P4,"\\$&")}function ju(t){return new RegExp("^(?:"+t.map(C4).join("|")+")","i")}function zu(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function O4(t,e,r){var n=Ot.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function L4(t,e,r){var n=Ot.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function D4(t,e,r){var n=Ot.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function $4(t,e,r){var n=Ot.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function M4(t,e,r){var n=Ot.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function HN(t,e,r){var n=Ot.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function jN(t,e,r){var n=Ot.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function F4(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function U4(t,e,r){var n=Ot.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function B4(t,e,r){var n=Ot.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function zN(t,e,r){var n=Ot.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function G4(t,e,r){var n=Ot.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function qN(t,e,r){var n=Ot.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function X4(t,e,r){var n=Ot.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function H4(t,e,r){var n=Ot.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function j4(t,e,r){var n=Ot.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function z4(t,e,r){var n=Ot.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function q4(t,e,r){var n=N4.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function W4(t,e,r){var n=Ot.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function V4(t,e,r){var n=Ot.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function WN(t,e){return Ce(t.getDate(),e,2)}function Y4(t,e){return Ce(t.getHours(),e,2)}function K4(t,e){return Ce(t.getHours()%12||12,e,2)}function Z4(t,e){return Ce(1+Yn.count(xr(t),t),e,3)}function JN(t,e){return Ce(t.getMilliseconds(),e,3)}function J4(t,e){return JN(t,e)+"000"}function Q4(t,e){return Ce(t.getMonth()+1,e,2)}function e3(t,e){return Ce(t.getMinutes(),e,2)}function t3(t,e){return Ce(t.getSeconds(),e,2)}function r3(t){var e=t.getDay();return e===0?7:e}function n3(t,e){return Ce(Kn.count(xr(t)-1,t),e,2)}function QN(t){var e=t.getDay();return e>=4||e===0?Wi(t):Wi.ceil(t)}function i3(t,e){return t=QN(t),Ce(Wi.count(xr(t),t)+(xr(t).getDay()===4),e,2)}function o3(t){return t.getDay()}function s3(t,e){return Ce(fc.count(xr(t)-1,t),e,2)}function a3(t,e){return Ce(t.getFullYear()%100,e,2)}function c3(t,e){return t=QN(t),Ce(t.getFullYear()%100,e,2)}function l3(t,e){return Ce(t.getFullYear()%1e4,e,4)}function u3(t,e){var r=t.getDay();return t=r>=4||r===0?Wi(t):Wi.ceil(t),Ce(t.getFullYear()%1e4,e,4)}function f3(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Ce(e/60|0,"0",2)+Ce(e%60,"0",2)}function VN(t,e){return Ce(t.getUTCDate(),e,2)}function d3(t,e){return Ce(t.getUTCHours(),e,2)}function p3(t,e){return Ce(t.getUTCHours()%12||12,e,2)}function h3(t,e){return Ce(1+Xu.count(tn(t),t),e,3)}function eP(t,e){return Ce(t.getUTCMilliseconds(),e,3)}function m3(t,e){return eP(t,e)+"000"}function g3(t,e){return Ce(t.getUTCMonth()+1,e,2)}function y3(t,e){return Ce(t.getUTCMinutes(),e,2)}function x3(t,e){return Ce(t.getUTCSeconds(),e,2)}function T3(t){var e=t.getUTCDay();return e===0?7:e}function _3(t,e){return Ce(is.count(tn(t)-1,t),e,2)}function tP(t){var e=t.getUTCDay();return e>=4||e===0?Vi(t):Vi.ceil(t)}function E3(t,e){return t=tP(t),Ce(Vi.count(tn(t),t)+(tn(t).getUTCDay()===4),e,2)}function v3(t){return t.getUTCDay()}function R3(t,e){return Ce(dc.count(tn(t)-1,t),e,2)}function w3(t,e){return Ce(t.getUTCFullYear()%100,e,2)}function b3(t,e){return t=tP(t),Ce(t.getUTCFullYear()%100,e,2)}function A3(t,e){return Ce(t.getUTCFullYear()%1e4,e,4)}function S3(t,e){var r=t.getUTCDay();return t=r>=4||r===0?Vi(t):Vi.ceil(t),Ce(t.getUTCFullYear()%1e4,e,4)}function I3(){return"+0000"}function YN(){return"%"}function KN(t){return+t}function ZN(t){return Math.floor(+t/1e3)}var hc,Hh,rP,nP,iP;oE({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function oE(t){return hc=iE(t),Hh=hc.format,rP=hc.parse,nP=hc.utcFormat,iP=hc.utcParse,hc}function k3(t){return new Date(t)}function N3(t){return t instanceof Date?+t:+new Date(+t)}function oP(t,e,r,n,i,o,s,a,c,l){var u=K_(),f=u.invert,d=u.domain,p=l(".%L"),m=l(":%S"),g=l("%I:%M"),v=l("%I %p"),T=l("%a %d"),_=l("%b %d"),E=l("%B"),I=l("%Y");function D(k){return(c(k)<k?p:a(k)<k?m:s(k)<k?g:o(k)<k?v:n(k)<k?i(k)<k?T:_:r(k)<k?E:I)(k)}return u.invert=function(k){return new Date(f(k))},u.domain=function(k){return arguments.length?d(Array.from(k,N3)):d().map(k3)},u.ticks=function(k){var B=d();return t(B[0],B[B.length-1],k??10)},u.tickFormat=function(k,B){return B==null?D:l(B)},u.nice=function(k){var B=d();return(!k||typeof k.range!="function")&&(k=e(B[0],B[B.length-1],k??10)),k?d(Z_(B,k)):u},u.copy=function(){return SN(u,oP(t,e,r,n,i,o,s,a,c,l))},u}function jh(){return oc.apply(oP(eE,tE,xr,pc,Kn,Yn,uc,lc,wn,Hh).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}var sE=class t{constructor(e,r,n){fe(this,"bandwidthPx");fe(this,"stepPx");fe(this,"d3");this.bandwidthPx=e,this.stepPx=r,this.d3=n}static fixedRow(e){return new t(e.bandwidth,e.step)}static forRows(e){let r=Array.from({length:e.count},(i,o)=>String(o)),n=Du().domain(r).range(e.range).paddingInner(e.paddingInner??0).paddingOuter(e.paddingOuter??0);return new t(n.bandwidth(),n.step(),n)}bandwidth(){return this.bandwidthPx}step(){return this.stepPx}forward(e){if(!this.d3)throw new Error("BandScale.forward is only available on closed-domain bands (BandScale.forRows)");let r=this.d3(e);if(r===void 0)throw new Error(`BandScale: unknown band id "${e}"`);return r}},P3={bandwidth:56,step:64};function sP(){return sE.fixedRow(P3)}var zh=class{constructor(e){fe(this,"domain");fe(this,"range");fe(this,"pixelsPerDay");fe(this,"calendar");fe(this,"d3");this.domain=e.domain,this.range=e.range,this.calendar=e.calendar;let r=Math.max(1,Nr(e.domain[0],e.domain[1]));this.pixelsPerDay=(e.range[1]-e.range[0])/r,this.d3=jh().domain(e.domain).range(e.range)}forward(e){let r=Nr(this.domain[0],e);return this.range[0]+r*this.pixelsPerDay}forwardWithinDomain(e){return e<this.domain[0]||e>this.domain[1]?null:this.forward(e)}invert(e){return this.d3.invert(e)}get originX(){return this.range[0]}get widthPx(){return this.range[1]-this.range[0]}};function qh(t){return t.endsWith(":")?t.slice(0,-1):t}function aP(t,e){let n=t.roadmapDecl?.properties.find(c=>qh(c.key)==="scale")?.value,i="weeks",o,s;if(n)if(n==="days"||n==="weeks"||n==="months"||n==="quarters"||n==="years")i=n;else{let c=/^(\d+)([dwmqy])$/.exec(n);if(c){let l=Math.max(1,parseInt(c[1],10));switch(c[2]){case"d":i="days";break;case"w":i="weeks";break;case"m":i="months";break;case"q":i="quarters";break;case"y":i="years";break}o=Wh(i)*l,s=1}}let a=s??Qk[i]??4;if(e){let l=e.properties.find(m=>qh(m.key)==="unit")?.value??i,u=e.properties.find(m=>qh(m.key)==="label-every"),f=e.properties.find(m=>qh(m.key)==="pixels-per-unit"),d=u?Math.max(1,parseInt(u.value,10)||a):a,p=f?Math.max(1,parseInt(f.value,10)||Wh(l)):o??Wh(l);return{unit:l,labelEvery:d,pixelsPerUnit:p}}return{unit:i,labelEvery:a,pixelsPerUnit:o??Wh(i)}}function Wh(t){switch(t){case"days":return Yk;case"weeks":return 40;case"months":return 80;case"quarters":return 160;case"years":return 320}}function cP(t,e,r,n=Ru){let i=r.daysPerUnit(e.unit),o=i*t.pixelsPerDay,s=Math.max(1,Math.round(t.widthPx/t.pixelsPerDay)),a=Math.floor(s/i)+1,c=[];for(let l=0;l<a;l++){let u=l*i,f=t.originX+u*t.pixelsPerDay,d=l%e.labelEvery===0,p=l===a-1;c.push({x:f,labelX:p?void 0:f+o/2,major:d,label:d&&!p?C3(e.unit,Wo(t.domain[0],u),l,n):void 0})}return c}function C3(t,e,r,n){switch(t){case"days":return`${e.getUTCMonth()+1}/${e.getUTCDate()}`;case"weeks":{let i=e.toLocaleString(n,{month:"short",timeZone:"UTC"}),o=e.getUTCDate().toString().padStart(2,"0");return`${i} ${o}`}case"months":return e.toLocaleString(n,{month:"short",timeZone:"UTC"});case"quarters":{let i=Math.floor(e.getUTCMonth()/3)+1;return`${dh(n).quarterPrefix}${i} ${e.getUTCFullYear()}`}case"years":return`${e.getUTCFullYear()}`}}function lP(t){return{daysPerUnit:e=>aE(e,t),addUnits:(e,r,n)=>Wo(e,r*aE(n,t)),isWorkingDay:()=>!0}}function uP(t,e){return aE(t,e)}function aE(t,e){switch(t){case"days":return 1;case"weeks":return e.daysPerWeek;case"months":return e.daysPerMonth;case"quarters":return e.daysPerQuarter;case"years":return e.daysPerYear}}var cE=class{constructor(e,r){fe(this,"id");fe(this,"anchor");this.id=e,this.anchor=r}place(e,r){let n=ae(this.anchor.properties,"date"),i=Rt(n);if(!i)return null;let o=e.scale.forwardWithinDomain(i);if(o===null)return null;let s=Tt("anchor",this.anchor.properties,e.styleCtx),a=e.markerRowPlacements.get(this.id),c=a?.centerY??e.timeline.markerRow.y,l={x:o,y:c},u=a?.labelBox??{x:o+6+6,y:c-4,width:0,height:12},f=a?.labelSide??"right";return e.entityLeftEdges.set(this.id,o),e.entityRightEdges.set(this.id,o),e.entityMidpoints.set(this.id,l),{id:this.id,title:this.anchor.title??this.id,center:l,radius:6,style:s,predecessorPoints:[],cutTopY:e.chartTopY,cutBottomY:e.swimlaneBottomY,bumpedUp:(a?.rowIndex??0)>0,labelBox:u,labelSide:f}}};function dP(t,e,r){let n=[];for(let[i,o]of t){let s=new cE(i,o).place(e,r);s&&n.push(s)}return n}function lE(t,e,r){let n=[],i=new Map,o=new Map;return[...t.entries()].sort(([c],[l])=>c.localeCompare(l)).forEach(([c,l],u)=>{let f=u+1;i.set(c,f),o.set(c,xt(l.properties,"on")),n.push({number:f,title:l.title??c,description:l.description?.text,style:Tt("footnote",l.properties,e.styleCtx)})}),{area:{box:{x:Qr,y:r+Qr,width:e.chartRightX-2*Qr,height:n.length===0?0:Pu+n.length*Cu+Qr},entries:n},index:i,hosts:o}}var O3=.8,L3=1;function D3(t){let e=[];return hP(t,e),e}function hP(t,e){for(let r of t)if(r.kind==="item"){let n=$3(r);n>0&&r.box.width>0&&e.push({startX:r.box.x,endX:r.box.x+r.box.width,load:n})}else(r.kind==="parallel"||r.kind==="group")&&hP(r.children,e)}function $3(t){return t.capacity?t.capacity.value:t.size?1:0}function mP(t){if(t.capacityValue<=0||t.warnFraction===null&&t.overFraction===null)return null;let e=D3(t.children);if(e.length===0)return null;let r=new Set;for(let s of e)r.add(s.startX),r.add(s.endX);let n=Array.from(r).sort((s,a)=>s-a);if(n.length<2)return null;let i=[];for(let s=0;s<n.length-1;s++){let a=n[s],c=n[s+1],l=(a+c)/2,u=0;for(let f of e)f.startX<=l&&l<f.endX&&(u+=f.load);i.push({startX:a,endX:c,load:u,classification:M3(u,t.capacityValue,t.warnFraction,t.overFraction)})}let o=[];for(let s of i){let a=o[o.length-1];a&&a.classification===s.classification&&a.endX===s.startX?a.endX=s.endX:o.push({...s})}return{segments:o,capacityValue:t.capacityValue,warnFraction:t.warnFraction,overFraction:t.overFraction}}function M3(t,e,r,n){let i=t/e;return n!==null&&i>=n?"red":r!==null&&i>=r?"yellow":"green"}function gP(t,e){let r=e.get("swimlane"),n=pP(ae(t.properties,"utilization-warn-at"),r?ae(r.properties,"utilization-warn-at"):void 0,O3),i=pP(ae(t.properties,"utilization-over-at"),r?ae(r.properties,"utilization-over-at"):void 0,L3);return{warn:n,over:i}}function pP(t,e,r){let i=B3(t??e);return i.kind==="unset"?r:i.kind==="none"?null:i.value}var F3=/^\d+(?:\.\d+)?%$/,U3=/^\d+\.\d+$/;function B3(t){if(t===void 0)return{kind:"unset"};if(t==="none")return{kind:"none"};if(F3.test(t)){let e=parseFloat(t)/100;return Number.isFinite(e)&&e>0?{kind:"number",value:e}:{kind:"unset"}}if(U3.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?{kind:"number",value:e}:{kind:"unset"}}return{kind:"unset"}}var yP=10;function G3(t,e,r){let n=ae(t.properties,"capacity"),i=Gi(n);if(i===null)return{capacity:null,badgeWidthPx:0};let o=Tu(i),s=_u(e.capacityIcon,r),a=qo(o,s,yP);return{capacity:{value:i,text:o,icon:s},badgeWidthPx:a}}var X3=10,H3=38,j3=8;function z3(t,e,r){let n=t.title??t.name??"";if(!n)return 0;let i=ae(t.properties,"owner");return Eu(0,n,i??void 0,e,r).rightX}function q3(t,e){if(!t.name)return[];let r=[];for(let[n,i]of e.footnoteHosts.entries())if(i.includes(t.name)){let o=e.footnoteIndex.get(n);o!==void 0&&r.push(o)}return r.sort((n,i)=>n-i),r}function W3(t,e,r,n){for(let i of t.content){if(i.$type==="DescriptionDirective")continue;let o=yr(i)?i.properties:i.properties??[];return n.resolveChildStart(o,e,e,r)}}var mc=class{constructor(e,r){fe(this,"input");fe(this,"deps");this.input=e,this.deps=r}get id(){return this.input.lane.name??""}place(e,r){let{lane:n,bandIndex:i}=this.input,{deps:o}=this,s=Tt("swimlane",n.properties,r.styleCtx),a=e.x,c=r.bandScale.step(),l=r.currentFlowKey;r.currentFlowKey=`lane:${n.name??i}`;let{capacity:u,badgeWidthPx:f}=G3(n,s,r.symbols),d=q3(n,r),p=d.length>0?o.estimateTextWidth(d.join(","),yP):0,m=z3(n,f,p),g=W3(n,a,r,o),v=!n.title||g===void 0||g>=m+j3,T=e.y+(v?X3:H3),_=new Qa({laneLeftX:a,originY:T,minRowHeight:c,slackCorridors:r.slackCorridors}),E=a,I=[];for(let R of n.content){if(R.$type==="DescriptionDirective")continue;if(!yr(R)){let Ue=R.properties??[],q=o.resolveChildStart(Ue,E,a,r),{rowIndex:J,y:te}=_.placeBlock(),P=o.newCursor(q,te),ge=o.sequenceOne(R,P,r);I.push(ge);let xe=ge.box.x+ge.box.width,He=Math.max(c,P.height);_.commitBlock({rowIndex:J,placed:ge,blockHeight:He,blockEnd:xe}),E=Math.max(E,xe);continue}let L=R.properties,$=o.resolveChildStart(L,E,a,r),b=Xi(L,r.sizes,r.cal),A=Math.max(Pr,b*r.timeline.pixelsPerDay),S=$+A,M=R.name??"",X=o.predictItemChipExtraHeight(R,r),F=c+X,{rowIndex:W,y:K}=_.placeItem({childId:M,desiredStart:$,desiredEnd:S,predictedHeight:F}),pe=o.newCursor($,K),V=o.sequenceItem(R,pe,r);I.push(V);let ee=V.box.x+V.box.width+Zr;E=Math.max(E,ee);let Le=null;(V.textSpills||V.chipsOutside||V.dotSpills||V.iconSpills||V.footnoteSpills)&&(Le=Math.max(V.decorationsRightX,V.chipsOutside?V.chipsRightX:0)+6),_.commitItem({rowIndex:W,placed:V,logicalEnd:ee,spillReservation:Le,rowHeight:F})}let D=T-e.y,k=Math.max(c+32,D+_.usedHeight()+16),B=Math.max(_.usedRightX(),m),U={x:0,y:e.y,width:r.chartRightX,height:k},z=ae(n.properties,"owner"),le;if(z){let R=r.teams.get(z),L=r.persons.get(z);le=R?.title??L?.title??z}let O=u?(()=>{let{warn:R,over:L}=gP(n,r.styleCtx.defaults);return mP({children:I,capacityValue:u.value,warnFraction:R,overFraction:L})})():null;return r.currentFlowKey=l,{positioned:{id:n.name,title:n.title??n.name??"",box:U,bandIndex:i,children:I,nested:[],style:s,owner:le,footnoteIndicators:d,capacity:u,utilization:O},usedHeight:k,usedRightX:B}}};var V3=18,Y3=14,K3=14,Z3=16,J3=32;function xP(t,e,r,n){let i=r+V3,o=[],s=!0;for(let a of t){s||(i+=Z3),s=!1;let c=a.content.roadmap?.title??a.sourcePath,l=i+Y3,u={cal:e.cal,styleCtx:{theme:e.styleCtx.theme,styles:a.config.styles,defaults:a.config.defaults,labels:a.content.labels},sizes:uh(a.content.sizes,e.cal),labels:a.content.labels,teams:a.content.teams,persons:a.content.persons,symbols:a.config.symbols,footnoteIndex:new Map,footnoteHosts:new Map,timeline:e.timeline,scale:e.scale,calendar:e.calendar,bandScale:e.bandScale,entityLeftEdges:new Map,entityRightEdges:new Map,entityMidpoints:new Map,entityVisualLeftX:new Map,entityVisualRightX:new Map,itemArrowSource:new Map,itemFlowKey:new Map,currentFlowKey:"",itemSlackAttachY:new Map,slackCorridors:[],markerRowPlacements:new Map,chartTopY:l,chartBottomY:l,swimlaneBottomY:l,chartRightX:e.chartRightX},f=[],d=l,p=0,m=u.timeline.originX;for(let k of a.content.swimlanes.values()){let{positioned:B,usedHeight:U,usedRightX:z}=new mc({lane:k,bandIndex:p},n).place({x:u.timeline.originX,y:d},u);f.push(B),d+=U,p++,z>m&&(m=z)}let g=d,v=Math.max(e.bandScale.bandwidth(),g-i+K3),T=0,{chromeRightX:_}=vu(T,c,a.sourcePath),E=Math.max(_,m)+J3,I=Math.min(e.chartRightX-T,E-T),D={x:T,y:i,width:I,height:v};for(let k of f)k.box.width=I;o.push({sourcePath:a.sourcePath,label:c,box:D,nestedSwimlanes:f,style:Tt("swimlane",[],e.styleCtx)}),i+=v}return{regions:o,endY:i}}function Kh(t,e){let r=[];for(let n of t){let o=e.entityVisualRightX.get(n)??e.entityRightEdges.get(n);if(o===void 0)continue;let s=e.itemSlackAttachY.get(n)??e.entityMidpoints.get(n)?.y??0,a=e.itemFlowKey.get(n)??`marker:${n}`;r.push({ref:n,x:o,y:s,flowKey:a})}return r}function Zh(t){let e=new Map;for(let r of t){let n=e.get(r.flowKey);(!n||r.x>n.x)&&e.set(r.flowKey,r)}return Array.from(e.values())}function TP(t,e,r,n,i,o,s,a){let c=n.length*i*.58*(o?1.05:1),l=t+r+6,u=t-r-6-c,f=l+c<=a,d=u>=s,p=f?"right":d?"left":"right";return{box:{x:p==="right"?l:u,y:e-4,width:c,height:12},side:p}}var uE=class{constructor(e,r){fe(this,"id");fe(this,"milestone");this.id=e,this.milestone=r}place(e){let r=this.milestone,n=Tt("milestone",r.properties,e.styleCtx),i=ae(r.properties,"date"),o=xt(r.properties,"after"),s=Rt(i),a=e.timeline.markerRow.y,c=6,l=r.title??this.id,u=null,f=a,d=null,p="right",m=!1,g,v=!1;if(s){let _=e.scale.forwardWithinDomain(s);if(_===null)return null;u=_,m=!0;let E=e.markerRowPlacements.get(this.id);E&&(f=E.centerY,d=E.labelBox,p=E.labelSide);let I=Kh(o,e),D=Zh(I),k=null;for(let B of D)(!k||B.x>k.x)&&(k=B);k&&k.x>_&&(v=!0,g=[{x:k.x,y:k.y>0?k.y:f}])}else if(o.length>0){let _=Kh(o,e),E=Zh(_);E.sort((B,U)=>U.x-B.x);let I=E[0]?.x??e.timeline.originX;u=I,m=!1;let D=TP(u,a,c,l,10,!0,e.timeline.box.x,e.chartRightX);f=a,d=D.box,p=D.side,e.markerRowPlacements.set(this.id,{rowIndex:0,centerY:f,labelBox:d,labelSide:p});let k=[];for(let B=1;B<E.length;B++){let U=E[B];U.x<I&&U.y>0&&k.push({x:U.x,y:U.y})}k.length>0&&(g=k)}if(u===null)return null;if(!d){let _=TP(u,f,c,l,10,!0,e.timeline.box.x,e.chartRightX);d=_.box,p=_.side}let T={x:u,y:f};return e.entityLeftEdges.set(this.id,T.x),e.entityRightEdges.set(this.id,T.x),e.entityMidpoints.set(this.id,T),{id:this.id,title:l,center:T,radius:c,fixed:m,slackArrows:g,isOverrun:v,style:n,cutTopY:e.chartTopY,cutBottomY:e.swimlaneBottomY,labelBox:d,labelSide:p}}};function _P(t,e){let r=[];for(let[n,i]of t){let o=new uE(n,i).place(e);o&&r.push(o)}return r}var eG=4;function tG(t,e){e>t.chartRightX&&(t.chartRightX=e)}var Qh=class{place(e,r,n,i){let o=n.theme??"light",s=jk[o],a=n.width??1280,c=Lk(n.locale,iG(e)),l=kk(e,r.config.calendar),u=aP(e,r.config.scale),f=uh(r.content.sizes,l),d={theme:s,styles:r.config.styles,defaults:r.config.defaults,labels:r.content.labels},{startDate:p,endDate:m}=i.computeDateWindow(e,{cal:l,sizes:f},r,n.today,u),g=Tt("roadmap",e.roadmapDecl?.properties??[],d),v=g.headerPosition==="beside",T=g.timelinePosition!=="bottom",_=g.timelinePosition==="bottom"||g.timelinePosition==="both",E=e.roadmapDecl?.title??e.roadmapDecl?.name??"",I=ae(e.roadmapDecl?.properties??[],"author"),D=i.sizeBesideHeader(E,I),k=v?{x:0,y:0,width:D.boxWidth,height:0}:{x:0,y:0,width:0,height:Rh},B=v?D.boxWidth:0,U=v?8:Rh+8,z=lP(l),le=u.pixelsPerUnit/z.daysPerUnit(u.unit),R=Math.max(1,Nr(p,m))*le,L=B+Jr,$=R,b=B+Jr+$+Jr,A=Math.min(a,b),S=n.today!==void 0&&n.today>=p&&n.today<=m,M=r.content.anchors.size+r.content.milestones.size>0,X=S?Hi:0,F=T?Su:0,W=new zh({domain:[p,m],range:[L,L+R],calendar:z}),K=Math.max(A,L+$+Jr),pe=[];for(let[Y,de]of r.content.anchors){let Re=Rt(ae(de.properties,"date"));if(!Re)continue;let vr=W.forwardWithinDomain(Re);vr!==null&&pe.push({id:Y,centerX:vr,radius:6,title:de.title??Y,fontSize:10,bold:!1,date:Re,isMilestone:!1})}for(let[Y,de]of r.content.milestones){let Re=Rt(ae(de.properties,"date"));if(!Re)continue;let vr=W.forwardWithinDomain(Re);vr!==null&&pe.push({id:Y,centerX:vr,radius:6,title:de.title??Y,fontSize:10,bold:!0,date:Re,isMilestone:!0})}let V=vP(pe,B,K,i.estimateTextWidth),ee=M?Math.max(1,V.rowCount):0,Le=ee*26,Fe=X+F+Le,Ue=Fe+8,q=v?D.cardHeight+eG:0,J=Math.max(U,q-Fe),te=J+X,P=te+F,ge=P+Le,xe=cP(W,u,z,c),He={box:{x:L,y:J,width:R,height:0},ticks:xe,pixelsPerDay:le,originX:L,startDate:p,endDate:m,labelStyle:Tt("roadmap",[],d),pillRowHeight:X,tickPanelY:te,tickPanelHeight:F,markerRow:{y:P+13,height:Le,collisionY:P-8},minorGrid:g.minorGrid},dt=new Map;for(let[Y,de]of V.placements){let Re=P+13+de.rowIndex*26;dt.set(Y,{rowIndex:de.rowIndex,centerY:Re,labelBox:{...de.labelBox,y:Re-4},labelSide:de.labelSide})}let H={cal:l,styleCtx:d,sizes:f,labels:r.content.labels,teams:r.content.teams,persons:r.content.persons,symbols:r.config.symbols,footnoteIndex:new Map,footnoteHosts:new Map,timeline:He,scale:W,calendar:z,bandScale:sP(),entityLeftEdges:new Map,entityRightEdges:new Map,entityMidpoints:new Map,entityVisualLeftX:new Map,entityVisualRightX:new Map,itemArrowSource:new Map,itemFlowKey:new Map,currentFlowKey:"",itemSlackAttachY:new Map,slackCorridors:[],markerRowPlacements:dt,chartTopY:J+Ue,chartBottomY:0,swimlaneBottomY:0,chartRightX:K};for(let Y of pe){let de=dt.get(Y.id);de&&(H.entityLeftEdges.set(Y.id,Y.centerX),H.entityRightEdges.set(Y.id,Y.centerX),H.entityMidpoints.set(Y.id,{x:Y.centerX,y:de.centerY}))}let Cr=lE(r.content.footnotes,H,0);H.footnoteIndex=Cr.index,H.footnoteHosts=Cr.hosts;let Or=new Map(H.entityLeftEdges),me=new Map(H.entityRightEdges),Ki=new Map(H.entityMidpoints),Zi=[...r.content.swimlanes.values()],Lr=Tt("swimlane",[],d),ss=Wk[Lr.spacing]??0,_r=()=>{let Y=[],de=H.chartTopY,Re=0,vr=H.timeline.originX;for(let FE of Zi){Re>0&&(de+=ss);let{positioned:ne,usedHeight:ze,usedRightX:st}=new mc({lane:FE,bandIndex:Re},i).place({x:H.timeline.originX,y:de},H);Y.push(ne),de+=ze,st>vr&&(vr=st),Re++}return{swimlanes:Y,nextY:de,maxRightX:vr}},Lt=_r(),nn=Lt.swimlanes,zt=Lt.nextY,x=rG(r.content.milestones,H);x.length>0&&(H.entityLeftEdges=new Map(Or),H.entityRightEdges=new Map(me),H.entityMidpoints=new Map(Ki),H.itemSlackAttachY=new Map,H.entityVisualLeftX=new Map,H.entityVisualRightX=new Map,H.itemArrowSource=new Map,H.itemFlowKey=new Map,H.currentFlowKey="",H.slackCorridors=x,Lt=_r(),nn=Lt.swimlanes,zt=Lt.nextY),tG(H,Lt.maxRightX+Jr);for(let Y of nn)Y.box.width=H.chartRightX;let C=r.content.isolatedRegions,j=[];if(C.length>0){let Y=xP(C,H,zt+8,i);j=Y.regions,zt=Y.endY}H.chartBottomY=zt,H.swimlaneBottomY=zt,He.box.height=H.chartBottomY-He.box.y;let Z=_P(r.content.milestones,H),je=pe.map(Y=>({id:Y.id,centerX:Y.centerX,radius:Y.radius,title:Y.title,fontSize:Y.fontSize,bold:Y.bold}));for(let Y of Z)Y.fixed||je.push({id:Y.id??"",centerX:Y.center.x,radius:Y.radius,title:Y.title,fontSize:10,bold:!0});let Se=vP(je,B,H.chartRightX,i.estimateTextWidth);H.markerRowPlacements.clear();for(let[Y,de]of Se.placements){let Re=P+13+de.rowIndex*26;H.markerRowPlacements.set(Y,{rowIndex:de.rowIndex,centerY:Re,labelBox:{...de.labelBox,y:Re-4},labelSide:de.labelSide})}for(let Y of Z){let de=H.markerRowPlacements.get(Y.id??"");de&&(Y.center={x:Y.center.x,y:de.centerY},Y.labelBox=de.labelBox,Y.labelSide=de.labelSide)}for(let Y of pe){let de=H.markerRowPlacements.get(Y.id);de&&H.entityMidpoints.set(Y.id,{x:Y.centerX,y:de.centerY})}for(let Y of Z)Y.fixed||H.entityMidpoints.set(Y.id??"",{x:Y.center.x,y:Y.center.y});let De=M?Math.max(1,Se.rowCount):0;if(De>ee){let Y=(De-ee)*26;H.timeline.markerRow.height=De*26,H.timeline.box.height+=Y,H.chartTopY+=Y,H.chartBottomY+=Y,H.swimlaneBottomY+=Y;for(let de of nn)fE(de,Y);for(let de of j)nG(de,Y);for(let[de,Re]of H.entityMidpoints)H.markerRowPlacements.has(de)||H.entityMidpoints.set(de,{x:Re.x,y:Re.y+Y});for(let[de,Re]of H.itemSlackAttachY)H.itemSlackAttachY.set(de,Re+Y);for(let de of Z)if(de.cutTopY=H.chartTopY,de.cutBottomY=H.swimlaneBottomY,de.slackArrows)for(let Re of de.slackArrows)Re.y+=Y}_&&(H.timeline.bottomTickPanelY=H.chartBottomY+8,H.timeline.bottomTickPanelHeight=Su,H.chartBottomY+=8+Su);let Ve=new Set(Z.map(Y=>Y.center.x)),Ee=dP(r.content.anchors,H,Ve),Be=i.collectItems(Zi),Ie=i.buildDependencies(Be,nn,j,H),pt=i.buildNowline(n.today,H,c),rt=lE(r.content.footnotes,H,H.chartBottomY);H.footnoteIndex=rt.index,H.footnoteHosts=rt.hosts,k.height=k.height||H.chartBottomY,v||(k.width=H.chartRightX);let lr=v?{x:6,y:ge-D.cardHeight,width:D.cardWidth,height:D.cardHeight}:{x:0,y:0,width:H.chartRightX,height:Rh},Mt=rt.area.entries.length>0?rt.area.box.y+rt.area.box.height:H.chartBottomY,Er={x:H.chartRightX-Jr-O_,y:Mt+Jr,width:O_,height:Jk},Tc=Er.y+Er.height+Jr,Qu={box:k,position:g.headerPosition,title:E,author:I,titleLines:D.titleLines,authorLines:D.authorLines,cardBox:lr,logo:void 0,style:g,attributionBox:Er};return{width:H.chartRightX,height:Tc,theme:o,palette:s,backgroundColor:s.surface.page,header:Qu,timeline:He,nowline:pt,swimlanes:nn,anchors:Ee,milestones:Z,edges:Ie,footnotes:rt.area,includes:j,chartBox:{x:B,y:H.chartTopY,width:H.chartRightX-B,height:H.chartBottomY-H.chartTopY}}}};function rG(t,e){let r=[];for(let[n,i]of t){let o=ae(i.properties,"date"),s=xt(i.properties,"after"),a=Rt(o),c=Kh(s,e),l=Zh(c);if(a){let f=e.scale.forwardWithinDomain(a);if(f===null)continue;let d=null;for(let p of l)(!d||p.x>d.x)&&(d=p);d&&d.x>f&&d.y>0&&r.push({xStart:Math.min(d.x,f),xEnd:Math.max(d.x,f),y:d.y,slackPredId:d.ref,milestoneId:n});continue}if(l.length===0)continue;l.sort((f,d)=>d.x-f.x);let u=l[0].x;for(let f=1;f<l.length;f++){let d=l[f];d.x<u&&d.y>0&&r.push({xStart:d.x,xEnd:u,y:d.y,slackPredId:d.ref,milestoneId:n})}}return r}function fE(t,e){t.box.y+=e;for(let r of t.children)RP(r,e);for(let r of t.nested)fE(r,e)}function RP(t,e){if(t.box.y+=e,t.kind==="item"){t.overflowBox&&(t.overflowBox.y+=e);for(let r of t.labelChips)r.box.y+=e;return}for(let r of t.children)RP(r,e)}function nG(t,e){t.box.y+=e;for(let r of t.nestedSwimlanes)fE(r,e)}function vP(t,e,r,n){let i=[...t].sort((a,c)=>a.centerX-c.centerX),o=new Map,s=[];for(let a of i){let c=n(a.title,a.fontSize)*(a.bold?1.05:1),l=a.centerX+a.radius+6,u=a.centerX-a.radius-6-c,f=l+c<=r,d=u>=e,p=a.centerX-a.radius,m=a.centerX+a.radius,g=B=>B==="right"?l:u,v=B=>B==="right"?f:d,T=(B,U)=>{let z=Math.min(p,B),le=Math.max(m,B+c);return s[U].some(O=>O.left<le&&O.right>z)},_=-1,E="right",I=l;e:for(let B=s.length-1;B>=0;B--)for(let U of["right","left"]){if(!v(U))continue;let z=g(U);if(!T(z,B)){_=B,E=U,I=z;break e}}if(_===-1){for(let[B,U]of o)o.set(B,{...U,rowIndex:U.rowIndex+1});s=[[],...s],_=0,E=f?"right":"left",I=g(E)}let D=Math.min(p,I),k=Math.max(m,I+c);s[_].push({left:D,right:k}),o.set(a.id,{rowIndex:_,labelBox:{x:I,y:0,width:c,height:12},labelSide:E})}return{placements:o,rowCount:s.length}}function iG(t){return t.directive?.properties.find(r=>oG(r.key)==="locale")?.value}function oG(t){return t.endsWith(":")?t.slice(0,-1):t}function lG(t){switch(t){case"done":case"completed":return"done";case"in-progress":case"active":return"in-progress";case"at-risk":case"blocked":case"planned":return t;case void 0:return"planned";default:return"neutral"}}function uG(t){if(!t)return 0;let e=/^(\d{1,3})%$/.exec(t);return e?Math.max(0,Math.min(100,parseInt(e[1],10)))/100:0}function fG(t,e){if(t)return/^\d+(?:\.\d+)?[dwmqy]$/.test(t)||/^\d+%$/.test(t)?t:e.sizes.get(t)?.effortLiteral??t}function dG(t,e){if(t)return e.teams.get(t)?.title??e.persons.get(t)?.title??t}function pG(t){if(!t)return{icon:"none"};let e=t.toLowerCase();return e.includes("linear.app")?{icon:"linear",href:t}:e.includes("github.com")?{icon:"github",href:t}:e.includes("atlassian.net")||e.includes("jira.")?{icon:"jira",href:t}:{icon:"generic",href:t}}function em(t,e,r,n,i){let o=qk(t,e),s=t.name??t.title??"",a=o.padding==="none"?"xs":o.padding,c=Vk[a],l=Math.max(20,Math.round(s.length*5.5+c*2));return i!==void 0&&(l=Math.min(l,i)),{text:s,style:o,box:{x:r,y:n,width:l,height:13}}}function yE(t,e,r,n){let i=t.properties,o=Tt("item",i,r.styleCtx),s=ae(i,"size"),a=s?r.sizes.get(s)??null:null,c=Xi(i,r.sizes,r.cal),l=Pk(i,r.sizes,r.cal),u=xt(i,"after"),f=xt(i,"before"),d=ae(i,"date"),p=Nk(ae(i,"remaining"),r.sizes,r.cal),m=e.x,g=Rt(d);if(g){let ne=r.scale.forwardWithinDomain(g);ne!==null&&(m=ne)}else if(u.length>0){let ne=e.x;for(let ze of u){let st=Rt(ze);if(st){let ei=r.scale.forwardWithinDomain(st);ei!==null&&(ne=Math.max(ne,ei));continue}let Sn=r.entityRightEdges.get(ze);Sn!==void 0&&(ne=Math.max(ne,Sn))}m=Math.max(e.x,ne)}let v=Math.max(Pr,c*r.timeline.pixelsPerDay),T=m,_=m+v,E=ae(i,"link"),I=pG(E),D=I.icon!=="none",k=Math.max(Pr,v-2*Zr),B=xt(i,"labels"),U=[];for(let ne of B){let ze=r.labels.get(ne);if(!ze)continue;let st=em(ze,r.styleCtx,0,0);U.push({id:ze,width:st.box.width})}let z=0;for(let ne=0;ne<U.length;ne+=1)ne>0&&(z+=4),z+=U[ne].width;let le=Math.max(0,k-24),O=U.length>0&&z>le,R=!1,L,$;if(f.length>0){let ne,ze;for(let st of f){let Sn=Rt(st),ei=Sn?r.scale.forwardWithinDomain(Sn)??void 0:r.entityLeftEdges.get(st);ei!==void 0&&(ne===void 0||ei<ne)&&(ne=ei,ze=st)}ne!==void 0&&_>ne&&(R=!0,L={x:ne,y:e.y,width:_-ne,height:r.bandScale.bandwidth()},$=ze)}let b=ae(i,"status"),A=lG(b),S=uG(b);S===0&&A==="done"&&(S=1);let M=/^(\d{1,3})%$/.exec(ae(i,"remaining")??"");S===0&&A==="in-progress"&&M&&(S=1-Math.max(0,Math.min(100,parseInt(M[1],10)))/100),S===0&&A==="in-progress"&&p>0&&l>0&&(S=Math.max(0,Math.min(1,1-p/l)));let X={done:"#ecfdf5","in-progress":"#eff6ff","at-risk":"#fffbeb",blocked:"#fee2e2",planned:"#f8fafc",neutral:"#f8fafc"},F={done:"#052e16","in-progress":"#172554","at-risk":"#422006",blocked:"#7f1d1d",planned:"#1e293b",neutral:"#1e293b"},W={done:r.styleCtx.theme.status.done,"in-progress":r.styleCtx.theme.status.inProgress,"at-risk":r.styleCtx.theme.status.atRisk,blocked:r.styleCtx.theme.status.blocked,planned:r.styleCtx.theme.status.planned,neutral:r.styleCtx.theme.status.neutral},K=r.styleCtx.theme.name==="light",pe=K?"#ffffff":"#0f172a",V="#94a3b8";o.bg===pe&&(o.bg=K?X[A]:F[A]),o.fg===V&&(o.fg=W[A]);let ee=ae(i,"duration"),Le=!!ee&&/^\d+(?:\.\d+)?[dwmqy]$/.test(ee),Fe=a?a.title??a.name:"",Ue=Le?ee:Fe||void 0,q=ae(i,"remaining"),J=fG(q,r),te=dG(n??ae(i,"owner"),r),P=()=>[Ue,te].filter(Boolean).join(" "),ge;if(A==="in-progress"&&J){let ne=P();ge=ne?`${ne} \u2014 ${J} remaining`:`${J} remaining`}else if(A==="in-progress"&&S>0&&S<1){let ne=Math.round((1-S)*100),ze=P();ge=ze?`${ze} \u2014 ${ne}% remaining`:`${ne}% remaining`}else(te||Ue)&&(ge=P()||void 0);let xe=ae(i,"capacity"),He=Gi(xe),dt=null,H=0;if(He!==null){let ne=Tu(He),ze=_u(o.capacityIcon,r.symbols);dt={value:He,text:ne,icon:ze};let st=11;H=(ge?An(" ",st):0)+qo(ne,ze,st)}let Cr=t.title??t.name??"",Or=new Ih({id:t.name??"",title:Cr,logicalLeftX:T,logicalRightX:_,metaText:ge,metaTrailingWidth:H,hasLinkIcon:D}).place({x:T,y:e.y},{time:r.scale,bands:r.bandScale,style:o}),me=Or.box,Ki=r.bandScale.bandwidth(),Zi=me.width<17,Lr=D&&me.width<41,ss=me.width<23,_r=Or.textSpills||Lr,Lt=null;O&&(Lt=y_(U,me.width));let nn=Lt?Lt.rows.length:U.length>0?1:0,zt=ge!==void 0||dt!==null,x=IP(O,_r,nn,Ki,zt);x>0&&(me.height=Ki+x);let C=[],j=me.y+Ki-vn-13-3,Z=me.y+38+3,Se=O&&_r||!O&&zt&&U.length>0?Math.max(j,Z):j,De=O?me.x+me.width+6:me.x+12,Ve=De;if(Lt)for(let ne=0;ne<Lt.rows.length;ne+=1){let ze=Se+ne*17,st=De;for(let ei of Lt.rows[ne]){let UE=em(ei.id,r.styleCtx,st,ze);C.push(UE),st+=UE.box.width+4}let Sn=st-4;Sn>Ve&&(Ve=Sn)}else{let ne=De;for(let ze of U){let st=em(ze.id,r.styleCtx,ne,Se);C.push(st),ne+=st.box.width+4}Ve=U.length>0?ne-4:De}let Ee=new Set;if(t.name){for(let[ne,ze]of r.footnoteHosts.entries())if(ze.includes(t.name)){let st=r.footnoteIndex.get(ne);st!==void 0&&Ee.add(st)}}let Be=[...Ee].sort((ne,ze)=>ne-ze),Ie=te??n??ae(i,"owner"),pt=t.description?.text,rt=Be.length>0&&ss,Mt=me.x+me.width+6,Er=!1,Tc=null;Lr&&(Er&&(Mt+=4),Tc=Mt,Mt=Tc+14,Er=!0);let Qu=0;if(_r){Er&&(Mt+=4);let ne=An(Cr,13),ze=(ge?An(ge,11):0)+H;Qu=Math.max(ne,ze),Mt+=Qu,Er=!0}let fm=null;rt&&(Er&&(Mt+=4),fm=Mt,Mt+=Be.length*8,Er=!0);let Y=null;Zi&&(Er&&(Mt+=4),Y=Mt+5,Mt=Y+5,Er=!0);let de=Math.max(me.x+me.width,Mt),Re=t.name;if(Re){r.entityLeftEdges.set(Re,T),r.entityRightEdges.set(Re,_),r.entityMidpoints.set(Re,{x:(T+_)/2,y:me.y+me.height/2}),r.entityVisualLeftX.set(Re,me.x),r.entityVisualRightX.set(Re,me.x+me.width);let ne=_r?{x:me.x+me.width,y:me.y+me.height-vn/2}:{x:me.x+me.width,y:me.y+me.height/2};r.itemArrowSource.set(Re,ne),r.itemFlowKey.set(Re,r.currentFlowKey);let ze=_r?me.y+me.height-vn/2:me.y+me.height/2;r.itemSlackAttachY.set(Re,ze)}e.x=_,e.maxX=Math.max(e.maxX,e.x),e.height=Math.max(e.height,r.bandScale.step()+x);let vr=Fk({box:me,afterDate:qn(u),beforeDate:qn(f),hasLinkIcon:D,footnoteCount:Be.length});return{kind:"item",id:Re,title:Cr,box:me,status:A,progressFraction:S,footnoteIndicators:Be,labelChips:C,chipsOutside:O,chipsRightX:Ve,linkIcon:I.icon,linkHref:I.href,hasOverflow:R,overflowBox:L,overflowAnchorId:$,owner:Ie,description:pt,metaText:ge,textSpills:_r,dotSpills:Zi,iconSpills:Lr,footnoteSpills:rt,dotSpillCx:Y,iconSpillX:Tc,footnoteSpillStartX:fm,decorationsRightX:de,capacity:dt,size:a,style:o,inlineDatePins:vr.length>0?vr:void 0}}function hG(t,e,r){return new kh(t,{sequenceOne:xE,newCursor:mh}).place(e,r)}function mG(t,e,r){return new Sh(t,{sequenceItem:yE,sequenceOne:xE,resolveChildStart:NP,newCursor:mh,estimateTextWidth:An,predictItemChipExtraHeight:kP}).place(e,r)}function xE(t,e,r){if(yr(t))return yE(t,e,r);if(Wr(t))return hG(t,e,r);if(qr(t))return mG(t,e,r);throw new Error(`Unknown swimlane child type: ${t.$type??"unknown"}`)}function An(t,e){return t.length*e*.58}function IP(t,e,r,n,i){if(r===0)return 0;let o=n-vn-13-3,s=41,a;t&&e?a=s:!t&&i?a=Math.max(o,s):a=o;let l=a+(r-1)*17+13+3+vn;return Math.max(0,l-n)}function kP(t,e){let r=t.properties,n=xt(r,"labels");if(n.length===0)return 0;let i=Xi(r,e.sizes,e.cal),o=Math.max(Pr,i*e.timeline.pixelsPerDay),s=Math.max(Pr,o-2*Zr),a=[];for(let T of n){let _=e.labels.get(T);if(!_)continue;let E=em(_,e.styleCtx,0,0);a.push({id:_,width:E.box.width})}if(a.length===0)return 0;let c=0;for(let T=0;T<a.length;T+=1)T>0&&(c+=4),c+=a[T].width;let l=Math.max(0,s-24),u=c>l,f=ae(r,"duration")!==void 0||ae(r,"size")!==void 0||ae(r,"owner")!==void 0||ae(r,"remaining")!==void 0||ae(r,"capacity")!==void 0,d=t.title??t.name??"",m=(d?An(d,13):0)>l,g=u?y_(a,s):null,v=g?g.rows.length:a.length>0?1:0;return IP(u,m,v,e.bandScale.bandwidth(),f)}function NP(t,e,r,n){let i=Rt(ae(t,"date"))??Rt(ae(t,"start"));if(i){let s=n.scale.forwardWithinDomain(i);if(s!==null)return s}let o=xt(t,"after");if(o.length>0){let s=r;for(let a of o){let c=Rt(a);if(c){let u=n.scale.forwardWithinDomain(c);u!==null&&(s=Math.max(s,u));continue}let l=n.entityRightEdges.get(a);l!==void 0&&(s=Math.max(s,l))}return Math.max(r,s)}return e}var dE=6;function wP(t,e,r){if(!t)return[];let n=t.split(/\s+/).filter(s=>s.length>0);if(n.length===0)return[];let i=[],o="";for(let s of n){let a=o?`${o} ${s}`:s;o&&An(a,r)>e?(i.push(o),o=s):o=a}return o&&i.push(o),i}function gG(t,e){let r=I_-32,n=wP(t,r,16),i=wP(e??"",r,11),o=0;for(let d of n)o=Math.max(o,An(d,16));for(let d of i)o=Math.max(o,An(d,11));let s=o+32,a=Math.max(Kk-dE,Math.min(I_-dE,s)),c=n.length>0?(n.length-1)*20:0,l=i.length>0?18+(i.length-1)*14:0,u=26+c+l+14,f=a+dE;return{titleLines:n,authorLines:i,cardWidth:a,cardHeight:u,boxWidth:f}}function yG(t,e,r,n,i){let s=t.roadmapDecl?.properties??[],a=ae(s,"start"),c=Rt(a)??xG(n),l=ae(s,"length");if(l){let p=TG(l,e.cal);if(p>0)return{startDate:c,endDate:Wo(c,p)}}let u=PP(r,e,c,n),f=uP(i.unit,e.cal),d=u>0?Math.ceil(u/f)*f:4*e.cal.daysPerWeek;return{startDate:c,endDate:Wo(c,Math.max(1,d))}}function xG(t){let e=t??new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))}function TG(t,e){let r=/^(\d+(?:\.\d+)?)([dwmqy])$/.exec(t);if(!r)return 0;let n=parseFloat(r[1]);switch(r[2]){case"d":return n;case"w":return n*e.daysPerWeek;case"m":return n*e.daysPerMonth;case"q":return n*e.daysPerQuarter;case"y":return n*e.daysPerYear;default:return 0}}function PP(t,e,r,n){let i=new Map,o=new Map,s=new Map,a=0,c=f=>{let d=Rt(f);return d?Nr(r,d):i.has(f)?i.get(f):o.has(f)?o.get(f):s.has(f)?s.get(f):0};for(let f of t.content.anchors.values()){let d=Rt(ae(f.properties,"date"));if(d&&f.name){let p=Nr(r,d);o.set(f.name,p),a=Math.max(a,p)}}let l=(f,d)=>{let p=d;for(let m of f)m.$type!=="DescriptionDirective"&&(p=u(m,p),a=Math.max(a,p));return p},u=(f,d)=>{if(yr(f)){let p=Xi(f.properties,e.sizes,e.cal),m=Rt(ae(f.properties,"date")),g=Rt(ae(f.properties,"start")),v=xt(f.properties,"after"),T=d;m?T=Nr(r,m):g?T=Nr(r,g):v.length>0&&(T=Math.max(d,...v.map(c)));let _=T+p;return f.name&&i.set(f.name,_),_}if(Wr(f)){let p=xt(f.properties,"after"),m=p.length>0?Math.max(d,...p.map(c)):d,g=m;for(let v of f.content){if(v.$type==="DescriptionDirective")continue;let T=u(v,m);g=Math.max(g,T)}return g}if(qr(f)){let p=xt(f.properties,"after"),m=p.length>0?Math.max(d,...p.map(c)):d;return l(f.content,m)}return d};for(let f of t.content.swimlanes.values())l(f.content,0);for(let f of t.content.milestones.values()){let d=Rt(ae(f.properties,"date"));if(d){let m=Nr(r,d);f.name&&s.set(f.name,m),a=Math.max(a,m);continue}let p=xt(f.properties,"after");if(p.length>0){let m=Math.max(0,...p.map(c));f.name&&s.set(f.name,m),a=Math.max(a,m)}}for(let f of t.content.isolatedRegions){let d=PP({config:f.config,content:f.content,diagnostics:[],processedFiles:new Set},e,r,void 0);a=Math.max(a,d)}if(n){let f=Nr(r,n);f>0&&(a=Math.max(a,f))}return a}function _G(t,e,r,n){let i=new fh(Ck(e,r)),o=[],s=[];for(let[l,u]of t){let f=xt(u.properties,"after"),d=n.entityMidpoints.get(l),p=n.entityVisualLeftX.get(l);if(!d||p===void 0)continue;let m={x:p,y:d.y};for(let g of f){let v=n.itemArrowSource.get(g),T,_=v===void 0;if(v)T=v;else{let E=n.entityMidpoints.get(g);if(!E)continue;T={x:E.x,y:d.y}}!_&&Math.abs(T.y-m.y)<.5&&m.x-T.x<20||(o.push({fromId:g,toId:l,from:T,to:m,isMarkerSource:_}),s.push({fromId:g,toId:l}))}}let a=Ok(o,i),c=[];for(let l=0;l<a.length;l++){let u=a[l];c.push({fromId:s[l].fromId,toId:s[l].toId,waypoints:u.waypoints,kind:u.underBar?"underBar":"normal",style:Tt("item",[],n.styleCtx)})}return c}function EG(t,e,r){if(!t)return null;let n=e.scale.forwardWithinDomain(t);if(n===null)return null;let i=e.timeline.box.y,o=e.timeline.tickPanelY,s=dh(r).nowLabel,a=An(s,Nu),c=Math.max(b_,Math.ceil(a+2*nc)),l=e.timeline.originX-Jr,u=c/2,f;n-u<l?f="flag-right":n+u>e.chartRightX?f="flag-left":f="center";let d=e.timeline.bottomTickPanelY,p=e.timeline.bottomTickPanelHeight??0,m=d!==void 0&&p>0?d+p:e.swimlaneBottomY;return{x:n,topY:o,bottomY:m,pillTopY:i,pillMode:f,label:s,pillWidth:c,style:Tt("item",[],e.styleCtx)}}function vG(t){let e=new Map,r=n=>{if(yr(n)){n.name&&e.set(n.name,n);return}if(Wr(n)){for(let i of n.content)i.$type!=="DescriptionDirective"&&r(i);return}if(qr(n)){for(let i of n.content)i.$type!=="DescriptionDirective"&&r(i);return}};for(let n of t)for(let i of n.content)i.$type!=="DescriptionDirective"&&r(i);return e}function TE(t,e,r={}){return new Qh().place(t,e,r,{sequenceItem:yE,sequenceOne:xE,resolveChildStart:NP,newCursor:mh,estimateTextWidth:An,predictItemChipExtraHeight:kP,computeDateWindow:yG,sizeBesideHeader:gG,collectItems:vG,buildDependencies:_G,buildNowline:EG})}var Yi={person:{viewBox:"0 0 24 24",body:'<circle cx="12" cy="8" r="4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M4 21a8 8 0 0 1 16 0" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"p"},people:{viewBox:"0 0 24 24",body:'<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><circle cx="9" cy="7" r="4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M22 21v-2a4 4 0 0 0-3-3.87" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M16 3.13a4 4 0 0 1 0 7.75" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"P"},points:{viewBox:"0 0 24 24",body:'<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" fill="currentColor" stroke="currentColor" stroke-width="1" stroke-linejoin="round"/>',ascii:"*"},time:{viewBox:"0 0 24 24",body:'<line x1="10" x2="14" y1="2" y2="2" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="12" x2="15" y1="14" y2="11" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><circle cx="12" cy="14" r="8" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"t"}},RG={calendar:{viewBox:"0 0 24 24",body:'<rect x="3" y="4" width="18" height="18" rx="2" ry="2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="16" x2="16" y1="2" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="8" x2="8" y1="2" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="3" x2="21" y1="10" y2="10" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"d"}},CP={...Yi,...RG};var nse={none:"",multiplier:"x",person:Yi.person.ascii,people:Yi.people.ascii,points:Yi.points.ascii,time:Yi.time.ascii};var om=class{constructor(e="nl"){fe(this,"prefix");fe(this,"counter",0);this.prefix=e}next(e){let r=`${this.prefix}-${this.counter++}`;return e?`${r}-${e}`:r}};var wG=new Set(["svg","g","defs","symbol","use","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","linearGradient","radialGradient","stop","clipPath","mask","pattern","filter","feGaussianBlur","feColorMatrix","feOffset","feMerge","feMergeNode","feFlood","feComposite","feBlend","feDropShadow","image"]),bG=new Set(["d","x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","width","height","viewBox","preserveAspectRatio","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-opacity","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-dasharray","stroke-dashoffset","opacity","transform","points","id","class","clip-path","mask","filter","font-family","font-size","font-weight","font-style","text-anchor","dx","dy","rotate","letter-spacing","word-spacing","style","xmlns","href","xlink:href","offset","stop-color","stop-opacity","gradientUnits","gradientTransform","spreadMethod","maskUnits","maskContentUnits","stdDeviation","values","in","in2","mode","type","result","flood-color","flood-opacity","patternUnits","patternContentUnits","role","aria-label"]);function AG(t){let e=[],r=0,n=t.length;for(;r<n;){if(t[r]!=="<"){let u=r;for(;r<n&&t[r]!=="<";)r++;let f=t.slice(u,r);f.trim().length>0?e.push({kind:"text",text:f}):f.length>0&&e.push({kind:"text",text:f});continue}if(t.startsWith("<!--",r)){let u=t.indexOf("-->",r+4);if(u<0)break;e.push({kind:"comment",text:t.slice(r+4,u)}),r=u+3;continue}if(t.startsWith("<![CDATA[",r)){let u=t.indexOf("]]>",r+9);if(u<0)break;e.push({kind:"cdata",text:t.slice(r+9,u)}),r=u+3;continue}if(t.startsWith("<?",r)){let u=t.indexOf("?>",r+2);if(u<0)break;e.push({kind:"decl",text:t.slice(r+2,u)}),r=u+2;continue}if(t.startsWith("<!",r)){let u=t.indexOf(">",r+2);if(u<0)break;e.push({kind:"decl",text:t.slice(r+2,u)}),r=u+1;continue}if(t[r+1]==="/"){let u=t.indexOf(">",r+2);if(u<0)break;let f=t.slice(r+2,u).trim();e.push({kind:"close",name:f}),r=u+1;continue}let i=SG(t,r);if(i<0)break;let o=t.slice(r+1,i).trim(),s=o.endsWith("/"),a=s?o.slice(0,-1).trim():o,{name:c,attrs:l}=IG(a);e.push({kind:s?"self":"open",name:c,attrs:l}),r=i+1}return e}function SG(t,e){let r=e+1,n=null;for(;r<t.length;){let i=t[r];if(n)i===n&&(n=null);else if(i==='"'||i==="'")n=i;else if(i===">")return r;r++}return-1}function IG(t){let e=0;for(;e<t.length&&/\s/.test(t[e]);)e++;let r=e;for(;e<t.length&&!/\s/.test(t[e]);)e++;let n=t.slice(r,e),i={};for(;e<t.length;){for(;e<t.length&&/\s/.test(t[e]);)e++;if(e>=t.length)break;let o=e;for(;e<t.length&&t[e]!=="="&&!/\s/.test(t[e]);)e++;let s=t.slice(o,e);if(e>=t.length||t[e]!=="="){s&&(i[s]="");continue}if(e++,e>=t.length)break;let a=t[e];if(a!=='"'&&a!=="'"){let l=e;for(;e<t.length&&!/\s/.test(t[e]);)e++;i[s]=t.slice(l,e);continue}e++;let c=e;for(;e<t.length&&t[e]!==a;)e++;i[s]=t.slice(c,e),e<t.length&&e++}return{name:n,attrs:i}}function Vu(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function kG(t,e){if(t.startsWith("#")){let r=e.get(t.slice(1));return r?`#${r}`:null}if(/^url\(#[^)]+\)$/.test(t)){let r=t.slice(5,-1),n=e.get(r);return n?`url(#${n})`:null}return null}function OP(t,e={}){let r=e.idPrefix??"nl-logo",n=e.onWarn??(()=>{}),i=AG(t),o=new Map,s=0;for(let l of i)if((l.kind==="open"||l.kind==="self")&&l.attrs&&"id"in l.attrs){let u=l.attrs.id;u&&!o.has(u)&&o.set(u,`${r}-${s++}`)}let a=[],c=[];for(let l of i)if(l.kind!=="comment"&&l.kind!=="decl"){if(l.kind==="cdata"){c[c.length-1]&&a.push(Vu(l.text??""));continue}if(l.kind==="text"){if(c.length===0||c[c.length-1]){let u=(l.text??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");a.push(u)}continue}if(l.kind==="open"||l.kind==="self"){let u=l.name??"";if(u==="script"||u==="foreignObject"||u==="animate"||u==="animateTransform"||u==="animateMotion"||u==="set"){n(`sanitizer: dropping <${u}>`),l.kind==="open"&&c.push(!1);continue}if(!wG.has(u)){n(`sanitizer: dropping unknown element <${u}>`),l.kind==="open"&&c.push(!1);continue}let f=[`<${u}`],d=Object.keys(l.attrs??{}).sort();for(let p of d){let m=l.attrs[p];if(/^on/i.test(p)){n(`sanitizer: dropping event handler ${p}`);continue}if(!bG.has(p)){n(`sanitizer: dropping attribute ${p}`);continue}if(p==="href"||p==="xlink:href"){let g=kG(m,o);if(g===null){n(`sanitizer: dropping external href ${m}`);continue}f.push(` ${p}="${Vu(g)}"`);continue}if(p==="style"){n("sanitizer: dropping inline style");continue}if(p==="id"){let g=o.get(m);g&&f.push(` id="${Vu(g)}"`);continue}if(/\burl\(#/i.test(m)){let g=m.replace(/url\(#([^)]+)\)/gi,(v,T)=>{let _=o.get(T);return _?`url(#${_})`:"none"});f.push(` ${p}="${Vu(g)}"`);continue}if(/data:|javascript:|vbscript:/i.test(m)){n(`sanitizer: dropping suspicious value at ${p}`);continue}f.push(` ${p}="${Vu(m)}"`)}f.push(l.kind==="self"?"/>":">"),a.push(f.join("")),l.kind==="open"&&c.push(!0);continue}l.kind==="close"&&c.pop()&&a.push(`</${l.name}>`)}return a.join("")}var LP=/&/g,DP=/</g,$P=/>/g,NG=/"/g,PG=/'/g;function cr(t){return t.replace(LP,"&amp;").replace(DP,"&lt;").replace($P,"&gt;")}function Zn(t){return t.replace(LP,"&amp;").replace(DP,"&lt;").replace($P,"&gt;").replace(NG,"&quot;").replace(PG,"&#39;")}function xc(t){let e=Object.keys(t).sort(),r=[];for(let n of e){let i=t[n];i==null||i===!1||(i===!0?r.push(n):r.push(`${n}="${Zn(String(i))}"`))}return r.length?` ${r.join(" ")}`:""}function Q(t,e,r){return r===void 0||r===""?`<${t}${xc(e)}/>`:`<${t}${xc(e)}>${r}</${t}>`}function Oe(t,e){return`<text${xc(t)}>${cr(e)}</text>`}function h(t){return Number.isFinite(t)?Number.isInteger(t)?t.toString():(Math.round(t*100)/100).toString():"0"}var CG={none:{dx:0,dy:0,stdDeviation:0,opacity:0},subtle:{dx:0,dy:1,stdDeviation:1.5,opacity:.2},soft:{dx:0,dy:3,stdDeviation:5,opacity:.3},hard:{dx:2,dy:2,stdDeviation:0,opacity:.45}};function OG(t,e){let r=`${t}-shadow-${e}`,n=CG[e],i=`<feGaussianBlur in="SourceAlpha" stdDeviation="${n.stdDeviation}"/><feOffset dx="${n.dx}" dy="${n.dy}" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="${n.opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>`;return Q("filter",{id:r,x:"-50%",y:"-50%",width:"200%",height:"200%"},i)}function MP(t,e){return e==="none"?null:`url(#${t}-shadow-${e})`}function FP(t){return["subtle","soft","hard"].map(e=>OG(t,e)).join("")}var FG={thin:100,light:300,normal:400,bold:700};function UG(t){return tc[t]??14}function EE(t,e){return{"font-family":We[t.font],"font-size":e??UG(t.textSize),"font-weight":FG[t.weight]??400,"font-style":t.italic?"italic":"normal",fill:t.text}}function BG(t){if(t.border==="dashed")return"4 3";if(t.border==="dotted")return"1 3"}function GG(t){if(!t||t==="none"||t==="transparent")return 1;let e=t.startsWith("#")?t.slice(1):t;if(e.length===3&&(e=e.split("").map(s=>s+s).join("")),e.length!==6)return 1;let r=parseInt(e.slice(0,2),16)/255,n=parseInt(e.slice(2,4),16)/255,i=parseInt(e.slice(4,6),16)/255,o=s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4;return .2126*o(r)+.7152*o(n)+.0722*o(i)}function XG(t,e){return GG(t)>=.24?e.statusDot.onLight:e.statusDot.onDark}function _E(t,e){return t.length*e*.58}function XP(t,e,r,n,i,o,s){let a=i*.58,c=e?_E(e,i):0,l=e?a:0,u=r+c+l,{text:f,icon:d}=t,p=_E(f,i),m={"font-family":o,"font-size":i,fill:s};if(!d)return Oe({x:h(u),y:h(n),...m},f);if(d.kind==="builtin"&&d.name==="multiplier")return Oe({x:h(u),y:h(n),...m},`${f}\xD7`);if(d.kind==="builtin"){let v=Yi[d.name],T=Oe({x:h(u),y:h(n),...m},f),_=i*.1,E=i,I=u+p+_,D=n-i*.85,k=`<svg x="${h(I)}" y="${h(D)}" width="${h(E)}" height="${h(E)}" viewBox="${v.viewBox}" style="color:${Zn(s)}" aria-hidden="true">${v.body}</svg>`;return T+k}let g=h(i*.1);return`<text x="${h(u)}" y="${h(n)}" font-family="${Zn(o)}" font-size="${i}" fill="${Zn(s)}">${cr(f)}<tspan dx="${g}">${cr(d.text)}</tspan></text>`}var UP=.6,HG=.5;function jG(t){let{metaText:e,capacity:r,x:n,baselineY:i,fontSize:o,fontFamily:s,color:a}=t;if(!e&&!r)return"";let c={"font-family":s,"font-size":o,fill:a};if(!r)return Oe({x:h(n),y:h(i),...c},e);if(!e)return XP(r,void 0,n,i,o,s,a);let l=h(o*UP),u=`<text x="${h(n)}" y="${h(i)}" font-family="${Zn(s)}" font-size="${o}" fill="${Zn(a)}">`,{text:f,icon:d}=r;if(!d)return u+cr(e)+`<tspan dx="${l}">${cr(f)}</tspan></text>`;if(d.kind==="builtin"&&d.name==="multiplier")return u+cr(e)+`<tspan dx="${l}">${cr(f)}\xD7</tspan></text>`;if(d.kind==="literal"){let k=h(o*.1);return u+cr(e)+`<tspan dx="${l}">${cr(f)}</tspan><tspan dx="${k}">${cr(d.text)}</tspan></text>`}let p=Yi[d.name],m=k=>k.length*o*HG,g=n+m(e)+o*UP,v=o*.1,T=o,_=g+m(f)+v,E=i-o*.85,I=u+cr(e)+`<tspan dx="${l}">${cr(f)}</tspan></text>`,D=`<svg x="${h(_)}" y="${h(E)}" width="${h(T)}" height="${h(T)}" viewBox="${p.viewBox}" style="color:${Zn(a)}" aria-hidden="true">${p.body}</svg>`;return I+D}function zG(t,e){let r=CP.calendar,n=`<svg x="${h(t.glyphTopLeft.x)}" y="${h(t.glyphTopLeft.y)}" width="${h(t.glyphSize)}" height="${h(t.glyphSize)}" viewBox="${r.viewBox}" style="color:${Zn(e)}" aria-hidden="true">${r.body}</svg>`,i=`<title>${cr(t.isoDate)}</title>`;return Q("g",{"data-layer":"inline-date-pin","data-side":t.side,"data-date":t.isoDate,"data-spilled":t.spilled?"true":null},i+n)}function vE(t,e){return!t||t.length===0?"":t.map(r=>zG(r,e)).join("")}function qG(t,e,r,n,i,o={}){let s=Math.min(gh[i.cornerRadius]??4,n/2);return Q("rect",{x:h(t),y:h(e),width:h(r),height:h(n),rx:h(s),ry:h(s),fill:i.bg==="none"?"transparent":i.bg,stroke:i.fg,"stroke-width":1,"stroke-dasharray":BG(i)??null,...o})}function WG(t,e,r){let n=t.box.x+t.cardBox.x,i=t.box.y+t.cardBox.y,o=t.cardBox.width,s=t.cardBox.height,a=t.style.bg==="none"?r.surface.headerBox:t.style.bg,c=r.header.cardBorder,l=Q("rect",{x:h(n),y:h(i),width:h(o),height:h(s),rx:6,ry:6,fill:a,stroke:c,"stroke-width":1,filter:`url(#${e}-shadow-subtle)`}),u=[];t.titleLines.forEach((v,T)=>{u.push(Oe({x:h(n+16),y:h(i+26+T*20),"font-family":We[t.style.font],"font-size":16,"font-weight":600,fill:t.style.text},v))});let f=u.join(""),d=i+26+Math.max(0,t.titleLines.length-1)*20,p=r.header.author,m=[];t.authorLines.forEach((v,T)=>{m.push(Oe({x:h(n+16),y:h(d+18+T*14),"font-family":We[t.style.font],"font-size":11,fill:p},v))});let g=m.join("");return Q("g",{"data-layer":"header","data-id":`${e}-header`},l+f+g)}function VG(t,e,r){let n=r.timeline.gridLine,i=r.timeline.minorGridLine,o=t.bottomTickPanelHeight??0,s=t.bottomTickPanelY!==void 0&&o>0,a=t.tickPanelY,c=s?t.bottomTickPanelY+o:t.box.y+t.box.height,l=e,u=t.box.y+t.box.height,f=[];for(let d of t.ticks)if(d.major)f.push(Q("line",{x1:h(d.x),y1:h(a),x2:h(d.x),y2:h(c),stroke:n,"stroke-width":1}));else if(t.minorGrid){if(d.labelX===void 0)continue;f.push(Q("line",{x1:h(d.x),y1:h(l),x2:h(d.x),y2:h(u),stroke:i,"stroke-width":1}))}return Q("g",{"data-layer":"grid"},f.join(""))}function YG(t,e){let r=e.timeline.panelFill,n=e.timeline.border,i=e.timeline.labelText,o=[],s=t.tickPanelY,a=t.tickPanelHeight,c=a>0,l=t.markerRow.height>0,u=s+a,f=t.markerRow.height,d=t.bottomTickPanelY,p=t.bottomTickPanelHeight??0,m=d!==void 0&&p>0;c&&o.push(Q("rect",{x:h(t.box.x),y:h(s),width:h(t.box.width),height:h(a),rx:4,ry:4,fill:r,stroke:n,"stroke-width":1})),l&&o.push(Q("rect",{x:h(t.box.x),y:h(u),width:h(t.box.width),height:h(f),rx:4,ry:4,fill:r,stroke:n,"stroke-width":1})),m&&o.push(Q("rect",{x:h(t.box.x),y:h(d),width:h(t.box.width),height:h(p),rx:4,ry:4,fill:r,stroke:n,"stroke-width":1}));for(let g of t.ticks)g.major&&(!g.label||g.labelX===void 0||(c&&o.push(Oe({x:h(g.labelX),y:h(s+yh),"font-family":We.sans,"font-size":10,fill:i,"text-anchor":"middle"},g.label)),m&&o.push(Oe({x:h(g.labelX),y:h(d+yh),"font-family":We.sans,"font-size":10,fill:i,"text-anchor":"middle"},g.label))));return Q("g",{"data-layer":"timeline"},o.join(""))}function KG(t,e){if(!t)return"";let r=e.nowline.stroke,n=e.nowline.labelText,i=Q("line",{x1:h(t.x),y1:h(t.topY),x2:h(t.x),y2:h(t.bottomY),stroke:r,"stroke-width":vh}),o=ZG(t,r),s=JG(t,n);return Q("g",{"data-layer":"nowline"},i+o+s)}function HP(t){let e=vh/2;return t.pillMode==="flag-right"?t.x-e:t.pillMode==="flag-left"?t.x+e:t.x}function ZG(t,e){let r=t.pillTopY,n=t.pillTopY+Hi,i=A_,o=t.pillWidth;if(t.pillMode==="center")return Q("rect",{x:h(t.x-o/2),y:h(r),width:h(o),height:h(Hi),rx:i,ry:i,fill:e});let s=HP(t);if(t.pillMode==="flag-right"){let l=s+o,u=[`M ${h(s)} ${h(r)}`,`L ${h(l-i)} ${h(r)}`,`A ${i} ${i} 0 0 1 ${h(l)} ${h(r+i)}`,`L ${h(l)} ${h(n-i)}`,`A ${i} ${i} 0 0 1 ${h(l-i)} ${h(n)}`,`L ${h(s)} ${h(n)}`,"Z"].join(" ");return Q("path",{d:u,fill:e})}let a=s-o,c=[`M ${h(s)} ${h(r)}`,`L ${h(a+i)} ${h(r)}`,`A ${i} ${i} 0 0 0 ${h(a)} ${h(r+i)}`,`L ${h(a)} ${h(n-i)}`,`A ${i} ${i} 0 0 0 ${h(a+i)} ${h(n)}`,`L ${h(s)} ${h(n)}`,"Z"].join(" ");return Q("path",{d:c,fill:e})}function JG(t,e){let r=t.pillTopY+S_,n=HP(t),i,o;return t.pillMode==="center"?(i=t.x,o="middle"):t.pillMode==="flag-right"?(i=n+nc,o="start"):(i=n-nc,o="end"),Oe({x:h(i),y:h(r),"font-family":We.sans,"font-size":Nu,"font-weight":700,fill:e,"text-anchor":o},t.label)}function QG(t,e,r,n){let i=[],o=MP(r,t.style.shadow);i.push(qG(t.box.x,t.box.y,t.box.width,t.box.height,t.style,{filter:o??null}));let s=XG(t.style.bg,n),a={done:s.done,"in-progress":s.inProgress,"at-risk":s.atRisk,blocked:s.blocked,planned:s.planned,neutral:s.neutral},c=a[t.status]??a.neutral;if(t.progressFraction>0){let g=Math.max(0,Math.min(t.box.width,t.box.width*t.progressFraction));i.push(Q("rect",{x:h(t.box.x),y:h(t.box.y+t.box.height-vn),width:h(g),height:vn,fill:t.style.fg,opacity:.55}))}let l=t.dotSpills&&t.dotSpillCx!==null?t.dotSpillCx:t.box.x+t.box.width-12;i.push(Q("circle",{cx:h(l),cy:h(t.box.y+12),r:5,fill:c})),i.push(vE(t.inlineDatePins,t.style.fg));let u;t.textSpills?(u=t.box.x+t.box.width+6,t.iconSpills&&(u+=18)):u=t.box.x+12;let f=t.style.text,d=n.entities.item.text,p=t.textSpills?d:f,m=t.textSpills?d:t.style.fg;if(t.title&&i.push(Oe({x:h(u),y:h(t.box.y+20),"font-family":We[t.style.font],"font-size":13,"font-weight":600,fill:p},t.title)),(t.metaText||t.capacity)&&i.push(jG({metaText:t.metaText,capacity:t.capacity,x:u,baselineY:t.box.y+38,fontSize:11,fontFamily:We[t.style.font],color:m})),t.footnoteIndicators.length>0){let g=t.box.y+14;if(t.footnoteSpills&&t.footnoteSpillStartX!==null){let v=t.footnoteSpillStartX;for(let T=0;T<t.footnoteIndicators.length;T++){let _=t.footnoteIndicators[T];i.push(Oe({x:h(v),y:h(g),"font-family":We.sans,"font-size":10,"font-weight":700,fill:d},String(_))),v+=8}}else{let v=t.box.x+t.box.width-22;for(let T=t.footnoteIndicators.length-1;T>=0;T--){let _=t.footnoteIndicators[T];i.push(Oe({x:h(v),y:h(g),"font-family":We.sans,"font-size":10,"font-weight":700,fill:t.style.text,"text-anchor":"end"},String(_))),v-=8}}}if(!e.noLinks&&t.linkIcon&&t.linkIcon!=="none"){let g={linear:"#5e6ad2",github:"#0f172a",jira:"#0052cc",generic:n.item.linkIconFg},v=g[t.linkIcon]??g.generic,T=14,_=t.iconSpills&&t.iconSpillX!==null?t.iconSpillX:t.box.x+6,E=t.box.y+6,I=Q("rect",{x:h(_),y:h(E),width:T,height:T,rx:2,ry:2,fill:v}),D=_,k=E,B=Q("path",{d:`M${h(D+4)} ${h(k+10)} L${h(D+10)} ${h(k+4)} M${h(D+6)} ${h(k+4)} H${h(D+10)} V${h(k+8)}`,stroke:"#ffffff",fill:"none","stroke-width":1.1,"stroke-linecap":"round","stroke-linejoin":"round"}),U=I+B,z=t.linkHref?Q("a",{href:t.linkHref,target:"_blank",rel:"noopener"},U):U;i.push(z)}if(t.hasOverflow&&t.overflowBox){let g=n.item.overflowTailFill,v=n.item.overflowTailStroke,T=n.item.overflowCaption;i.push(Q("rect",{x:h(t.overflowBox.x),y:h(t.overflowBox.y),width:h(t.overflowBox.width),height:h(t.overflowBox.height),fill:g,stroke:v,"stroke-width":1})),t.overflowAnchorId&&t.overflowBox.width>60&&i.push(Oe({x:h(t.overflowBox.x+t.overflowBox.width/2),y:h(t.overflowBox.y+t.overflowBox.height/2+3),"font-family":We.sans,"font-size":9,"font-weight":700,fill:T,"text-anchor":"middle"},`past ${t.overflowAnchorId}`))}for(let g of t.labelChips){let v=Math.min(gh[g.style.cornerRadius]??8,g.box.height/2);i.push(Q("rect",{x:h(g.box.x),y:h(g.box.y),width:h(g.box.width),height:h(g.box.height),rx:h(v),ry:h(v),fill:g.style.bg==="none"?"transparent":g.style.bg,stroke:g.style.fg,"stroke-width":.5})),i.push(Oe({x:h(g.box.x+g.box.width/2),y:h(g.box.y+g.box.height/2+3),...EE(g.style,tc.xs),"text-anchor":"middle"},g.text))}return Q("g",{"data-layer":"item","data-id":t.id??null},i.join(""))}function eX(t,e,r,n){let i=[];if(t.style.bg!=="none"&&t.style.bg!=="#ffffff"){if(i.push(Q("rect",{x:h(t.box.x),y:h(t.box.y),width:h(t.box.width),height:h(t.box.height),rx:6,ry:6,fill:t.style.bg,stroke:t.style.fg,"stroke-width":1,"fill-opacity":.18,filter:`url(#${r}-shadow-subtle)`})),t.title){let s=t.title.length*R_+2*_h,a=t.box.x,c=t.box.y,l=ku,u=6,f=`M${h(a+u)} ${h(c)}H${h(a+s)}V${h(c+l-u)}A${u} ${u} 0 0 1 ${h(a+s-u)} ${h(c+l)}H${h(a)}V${h(c+u)}A${u} ${u} 0 0 1 ${h(a+u)} ${h(c)}Z`;i.push(Q("path",{d:f,fill:t.style.fg})),i.push(Oe({x:h(a+_h),y:h(c+E_),"font-family":We[t.style.font],"font-size":v_,"font-weight":600,fill:"#ffffff"},t.title))}}else{let s=t.style.fg;if(t.style.bracket!=="none"){let c=t.box.y+t.box.height,l=t.style.bracket==="dashed"?"3 2":null,u=t.title?`M${h(t.box.x+4)} ${h(t.box.y-rc)} L${h(t.box.x)} ${h(t.box.y-rc)} L${h(t.box.x)} ${h(c)} L${h(t.box.x+4)} ${h(c)}`:`M${h(t.box.x)} ${h(t.box.y)} L${h(t.box.x)} ${h(c)} L${h(t.box.x+4)} ${h(c)}`;i.push(Q("path",{d:u,fill:"none",stroke:s,"stroke-width":1,"stroke-dasharray":l}))}t.title&&i.push(Oe({x:h(t.box.x+6),y:h(t.box.y-2),...EE(t.style,tc.xs),"fill-opacity":.7},t.title))}i.push(vE(t.inlineDatePins,t.style.fg));for(let s of t.children)i.push(RE(s,e,r,n));return Q("g",{"data-layer":"group","data-id":t.id??null},i.join(""))}function tX(t,e,r,n){let i=[];if(t.style.bracket==="solid"||t.style.bracket==="dashed"){let a=t.box.y-12,c=t.box.y+t.box.height+12,l=t.box.x,u=t.box.x+t.box.width,f=n.parallel.bracketStroke;i.push(Q("path",{d:`M${h(l+4)} ${h(a)} H${h(l)} V${h(c)} H${h(l+4)}`,fill:"none",stroke:f,"stroke-width":1.25,"stroke-dasharray":t.style.bracket==="dashed"?"3 3":null,"stroke-linejoin":"round"})),i.push(Q("path",{d:`M${h(u-4)} ${h(a)} H${h(u)} V${h(c)} H${h(u-4)}`,fill:"none",stroke:f,"stroke-width":1.25,"stroke-dasharray":t.style.bracket==="dashed"?"3 3":null,"stroke-linejoin":"round"}))}t.title&&i.push(Oe({x:h(t.box.x+4),y:h(t.box.y-2),...EE(t.style,tc.xs),"fill-opacity":.7},t.title)),i.push(vE(t.inlineDatePins,t.style.fg));for(let o of t.children)i.push(RE(o,e,r,n));return Q("g",{"data-layer":"parallel","data-id":t.id??null},i.join(""))}function RE(t,e,r,n){return t.kind==="item"?QG(t,e,r,n):t.kind==="group"?eX(t,e,r,n):tX(t,e,r,n)}var BP=2;function rX(t,e){switch(t){case"green":return e.swimlane.utilizationOk;case"yellow":return e.swimlane.utilizationWarn;case"red":return e.swimlane.utilizationOver}}function nX(t,e){if(!t.utilization||t.utilization.segments.length===0)return"";let r=t.box.y+t.box.height-BP,n=t.utilization.segments.map(i=>{let o=i.endX-i.startX;return o<=0?"":Q("rect",{x:h(i.startX),y:h(r),width:h(o),height:BP,fill:rX(i.classification,e),"data-utilization":i.classification,"data-load":h(i.load)})});return Q("g",{"data-layer":"lane-utilization","data-id":t.id??null},n.join(""))}function iX(t,e){let r=t.bandIndex%2===0?e.swimlane.rowTintEven:e.swimlane.rowTintOdd,n=e.swimlane.border;return Q("g",{"data-layer":"swimlane-bg","data-id":t.id??null},Q("rect",{x:h(t.box.x),y:h(t.box.y),width:h(t.box.width),height:h(t.box.height),fill:r,stroke:n,"stroke-width":1}))}function jP(t,e,r,n){let i=n.swimlane.tabFill,o=n.swimlane.tabStroke,s=n.swimlane.tabText,a=n.swimlane.ownerText,c=n.swimlane.footnoteIndicator,l=[];if(t.title){let f=t.capacity?qo(t.capacity.text,t.capacity.icon,10):0,d=t.footnoteIndicators.length>0?t.footnoteIndicators.join(","):"",p=d?_E(d,10):0,m=Eu(t.box.x,t.title,t.owner,f,p),g=xh,v=t.box.y+10,T=v+Th;l.push(Q("rect",{x:h(m.tabX),y:h(v),width:h(m.tabW),height:h(g),rx:4,ry:4,fill:i,stroke:o,"stroke-width":1})),l.push(Oe({x:h(m.titleX),y:h(T),"font-family":We[t.style.font],"font-size":12,"font-weight":600,fill:s},t.title)),t.owner&&l.push(Oe({x:h(m.ownerX),y:h(T),"font-family":We[t.style.font],"font-size":10,fill:a},`owner: ${t.owner}`)),t.capacity&&l.push(XP(t.capacity,void 0,m.badgeX,T,10,We[t.style.font],a)),d&&l.push(Oe({x:h(m.footnoteRightX),y:h(v+14),"font-family":We.sans,"font-size":10,"font-weight":700,fill:c,"text-anchor":"end"},d))}for(let u of t.children)l.push(RE(u,e,r,n));return l.push(nX(t,n)),Q("g",{"data-layer":"swimlane","data-id":t.id??null},l.join(""))}function oX(t,e){let r=t.radius,n=t.center.x,i=t.center.y,o=e.anchorDiamond.fill,s=e.anchorDiamond.stroke,a=Q("path",{d:`M${h(n)} ${h(i-r)} L${h(n+r)} ${h(i)} L${h(n)} ${h(i+r)} L${h(n-r)} ${h(i)} Z`,fill:o,stroke:s,"stroke-width":1.25}),c=e.anchorDiamond.label,l=t.labelSide==="left"?t.labelBox.x+t.labelBox.width:t.labelBox.x,u={x:h(l),y:h(i+4),"font-family":We.sans,"font-size":10,fill:c};t.labelSide==="left"&&(u["text-anchor"]="end");let f=t.title?Oe(u,t.title):"";return Q("g",{"data-layer":"anchor","data-id":t.id??null},a+f)}function sX(t,e){let r=e.anchorDiamond.cutLine;return Q("line",{x1:h(t.center.x),y1:h(t.center.y+t.radius+1),x2:h(t.center.x),y2:h(t.cutBottomY),stroke:r,"stroke-width":1,"stroke-dasharray":"1 3"})}function aX(t,e){let r=t.center.x,n=t.center.y,i=t.radius,o=e.milestoneDiamond.fill,s=Q("path",{d:`M${h(r)} ${h(n-i)} L${h(r+i)} ${h(n)} L${h(r)} ${h(n+i)} L${h(r-i)} ${h(n)} Z`,fill:o,stroke:o,"stroke-width":1}),a=e.milestoneDiamond.label,c=t.labelSide==="left"?t.labelBox.x+t.labelBox.width:t.labelBox.x,l={x:h(c),y:h(n+4),"font-family":We.sans,"font-size":10,"font-weight":600,fill:a};t.labelSide==="left"&&(l["text-anchor"]="end");let u=t.title?Oe(l,t.title):"";return Q("g",{"data-layer":"milestone","data-id":t.id??null},s+u)}function cX(t,e){let r=t.isOverrun?e.milestoneDiamond.cutLineOverrun:e.milestoneDiamond.cutLineNormal,n=[];if(n.push(Q("line",{x1:h(t.center.x),y1:h(t.center.y+t.radius+1),x2:h(t.center.x),y2:h(t.cutBottomY),stroke:r,"stroke-width":2,"stroke-dasharray":Eh,"stroke-linecap":"round"})),t.slackArrows&&t.slackArrows.length>0){let i=e.milestoneDiamond.slack;for(let o of t.slackArrows)n.push(Q("path",{d:`M${h(o.x)} ${h(o.y)} H${h(t.center.x-6)}`,fill:"none",stroke:i,"stroke-width":1.1,"stroke-dasharray":"3 3","stroke-linecap":"round","marker-end":"url(#nl-arrow-dark)"}))}return n.join("")}function GP(t,e){let r=t.kind==="overflow"?e.dependency.overflowStroke:e.dependency.edgeStroke,n=t.waypoints;if(n.length<2)return"";let i=t.kind==="underBar"?.8:1.1;return Q("path",{d:lX(n,L_),fill:"none",stroke:r,"stroke-width":i,"stroke-dasharray":t.kind==="overflow"?"4 2":null,"stroke-linejoin":"round","marker-end":"url(#nl-arrow)"})}function lX(t,e){if(t.length<2)return"";let r=[`M${h(t[0].x)} ${h(t[0].y)}`];for(let n=1;n<t.length;n++){let i=t[n-1],o=t[n];if(n===t.length-1){r.push(`L${h(o.x)} ${h(o.y)}`);continue}let s=t[n+1],a=Math.sign(o.x-i.x),c=Math.sign(o.y-i.y),l=Math.sign(s.x-o.x),u=Math.sign(s.y-o.y),f=Math.hypot(o.x-i.x,o.y-i.y),d=Math.hypot(s.x-o.x,s.y-o.y),p=Math.min(e,f/2,d/2);if(p<=0||a!==0&&l!==0||c!==0&&u!==0){r.push(`L${h(o.x)} ${h(o.y)}`);continue}let m={x:o.x-a*p,y:o.y-c*p},g={x:o.x+l*p,y:o.y+u*p};r.push(`L${h(m.x)} ${h(m.y)}`),r.push(`Q${h(o.x)} ${h(o.y)} ${h(g.x)} ${h(g.y)}`)}return r.join(" ")}function uX(t,e,r){if(t.entries.length===0)return"";let n=r.footnotePanel.fill,i=r.footnotePanel.border,o=r.footnotePanel.header,s=r.footnotePanel.title,a=r.footnotePanel.description,c=r.footnotePanel.number,l=[];l.push(Q("rect",{x:h(t.box.x),y:h(t.box.y),width:h(t.box.width),height:h(t.box.height),rx:6,ry:6,fill:n,stroke:i,"stroke-width":1,filter:`url(#${e}-shadow-subtle)`})),l.push(Oe({x:h(t.box.x+Qr),y:h(t.box.y+k_),"font-family":We.sans,"font-size":12,"font-weight":700,fill:o},"Footnotes"));let u=t.box.y+Pu+Qr,f=t.box.x+Qr,d=f+Qr;return t.entries.forEach((p,m)=>{let g=u+m*Cu;l.push(Oe({x:h(f),y:h(g),"font-family":We.sans,"font-size":10,"font-weight":700,fill:c},String(p.number))),l.push(Oe({x:h(d),y:h(g),"font-family":We.sans,"font-size":11,"font-weight":600,fill:s},p.title)),p.description&&l.push(Oe({x:h(d+Math.max(120,p.title.length*6)),y:h(g),"font-family":We.sans,"font-size":11,fill:a},`\u2014 ${p.description}`))}),Q("g",{"data-layer":"footnotes"},l.join(""))}function fX(t,e,r,n){let i=n.includeRegion.border,o=n.includeRegion.fill,s=n.includeRegion.tabFill,a=n.includeRegion.tabStroke,c=n.includeRegion.tabText,l=n.includeRegion.badgeFill,u=n.includeRegion.badgeStroke,f=n.includeRegion.badgeText,d=t.box.x+8,p=t.box.y,m=t.box.width-16,g=t.box.height,v=Q("rect",{x:h(d),y:h(p),width:h(m),height:h(g),rx:8,ry:8,fill:o,stroke:i,"stroke-width":1,"stroke-dasharray":Eh}),T=xh,_=vu(t.box.x,t.label,t.sourcePath),E=p-T/2,I=Q("rect",{x:h(_.tabX),y:h(E),width:h(_.tabWidth),height:T,rx:4,ry:4,fill:s,stroke:a,"stroke-width":1}),D=Oe({x:h(_.tabLabelX),y:h(E+Th),"font-family":We.sans,"font-size":11,"font-weight":600,fill:c},t.label),k=_.badgeX,B=_.badgeSize,U=p-B/2,z=Q("rect",{x:h(k),y:h(U),width:B,height:B,rx:4,ry:4,fill:l,stroke:u,"stroke-width":1}),le=Q("path",{d:`M${h(k+7)} ${h(U+4)} H${h(k+14)} V${h(U+11)} M${h(k+4)} ${h(U+7)} H${h(k+11)} V${h(U+14)} H${h(k+4)} Z`,stroke:f,"stroke-width":1.4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}),O=9,R=p+4,L=Q("rect",{x:h(_.sourceHaloX),y:h(R-O),width:h(_.sourceHaloWidth),height:O+6,fill:o}),$=Oe({x:h(_.sourceTextX),y:h(R),"font-family":We.mono,"font-size":O,fill:f},t.sourcePath),b=t.nestedSwimlanes.map(A=>jP(A,e,r,n)).join("");return Q("g",{"data-layer":"include"},v+b+I+D+z+le+L+$)}function dX(t){let e=t.palette.attribution.mark,r=t.palette.attribution.link;if(t.swimlanes.length===0)return"";let n=t.header.attributionBox.x,i=t.header.attributionBox.y,o=ji,s=Oe({x:"0",y:o,"font-family":We.sans,"font-size":bh,"font-weight":400,fill:e},wh)+Oe({x:Lu,y:o,"font-family":We.sans,"font-size":ji,"font-weight":700,fill:e},"now")+Q("rect",{x:P_,y:12,width:C_,height:ji,fill:r})+Oe({x:Ah,y:o,"font-family":We.sans,"font-size":ji,"font-weight":400,fill:e},"ine"),a=Q("g",{transform:`translate(${h(n)} ${h(i)}) scale(${h(Ou)})`},s);return Q("a",{href:N_,target:"_blank",rel:"noopener","aria-label":"Powered by nowline"},Q("g",{"data-layer":"attribution"},a))}async function pX(t,e,r,n,i,o,s){if(!e)return"";let a;try{a=await e(t)}catch(u){let f=`logo: failed to load ${t}: ${u instanceof Error?u.message:String(u)}`;if(n.strict)throw u;return n.warn?.(f),""}let c=(a.mime??"").toLowerCase();if(c==="image/svg+xml"){let u=new TextDecoder().decode(a.bytes),f=OP(u,{idPrefix:`${r}-logo`,onWarn:n.warn});return Q("g",{transform:`translate(${h(i)} ${h(o)})`},f)}if(c==="image/png"||c==="image/jpeg"||c==="image/jpg"||c==="image/webp"){let u=hX(a.bytes);return Q("image",{href:`data:${c};base64,${u}`,x:h(i),y:h(o),width:h(s),height:h(s),preserveAspectRatio:"xMidYMid meet"})}let l=`logo: unsupported mime ${c} for ${t}`;if(n.strict)throw new Error(l);return n.warn?.(l),""}function hX(t){if(typeof btoa<"u"){let r="";for(let n=0;n<t.length;n++)r+=String.fromCharCode(t[n]);return btoa(r)}let e=globalThis;if(e.Buffer)return e.Buffer.from(t).toString("base64");throw new Error("renderer: no base64 encoder available")}async function wE(t,e={}){let n=new om(e.idPrefix??"nl").next("root"),i=t.palette,o=[],s=i.arrowhead.neutral,a=i.arrowhead.light,c=i.arrowhead.dark,l=(d,p)=>`<marker id="${d}" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" fill="${p}"/></marker>`,u=`<defs>${FP(n)}`+l("nl-arrow",s)+l("nl-arrow-light",a)+l("nl-arrow-dark",c)+"</defs>";o.push(u),o.push(Q("rect",{x:0,y:0,width:h(t.width),height:h(t.height),fill:t.backgroundColor})),o.push(YG(t.timeline,i));for(let d of t.swimlanes)o.push(iX(d,i));o.push(VG(t.timeline,t.chartBox.y,i));for(let d of t.edges)d.kind==="underBar"&&o.push(GP(d,i));for(let d of t.swimlanes)o.push(jP(d,e,n,i));for(let d of t.includes)o.push(fX(d,e,n,i));for(let d of t.edges)d.kind!=="underBar"&&o.push(GP(d,i));for(let d of t.anchors)o.push(sX(d,i));for(let d of t.milestones)o.push(cX(d,i));for(let d of t.anchors)o.push(oX(d,i));for(let d of t.milestones)o.push(aX(d,i));if(o.push(KG(t.nowline,i)),o.push(uX(t.footnotes,n,i)),o.push(WG(t.header,n,i)),o.push(dX(t)),t.header.logo&&e.assetResolver){let d=await pX(t.header.logo.assetRef??"",e.assetResolver,n,e,t.header.logo.box.x,t.header.logo.box.y,Math.max(t.header.logo.box.width,t.header.logo.box.height));d&&o.push(d)}return`<svg${xc({xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${h(t.width)} ${h(t.height)}`,width:h(t.width),height:h(t.height),"data-theme":t.theme,"data-generator":"nowline"})}>${o.join("")}</svg>`}var bE="/browser-source.nowline",sm,zP=0;function qP(){return sm||(sm=g_()),sm}function mX(){return gt.parse(`memory:///nowline-browser-${++zP}.nowline`)}async function am(t,e={}){let r=e.filePath??bE,n=qP(),o=n.shared.workspace.LangiumDocumentFactory.fromString(t,mX());await n.shared.workspace.DocumentBuilder.build([o],{validation:!0});let s=[];for(let a of o.parseResult.lexerErrors)s.push(zE(a,r));for(let a of o.parseResult.parserErrors)s.push(jE(a,r));for(let a of o.diagnostics??[])s.push(HE(a,r));return{ast:o.parseResult.value,diagnostics:s}}async function AE(t,e={}){let r=e.filePath??bE,n=await am(t,{filePath:r});if(n.diagnostics.some(g=>g.severity==="error"))return{kind:"diagnostics",diagnostics:n.diagnostics};let i=qP(),o=e.readFile??YE,s=await o_(n.ast,r,{services:i.Nowline,readFile:o}),a=[...n.diagnostics];for(let g of s.diagnostics){if(g.severity==="error"&&KE(g.message)){e.onSkippedInclude?.({sourcePath:g.sourcePath,message:g.message});continue}a.push(qE(g))}if(a.some(g=>g.severity==="error"))return{kind:"diagnostics",diagnostics:a};let c=e.today===null?void 0:e.today,l=TE(n.ast,s,{theme:e.theme,today:c,locale:e.locale,width:e.width}),u=e.showLinks!==!1,f=e.strict===!0,d=[],p=await wE(l,{idPrefix:e.idPrefix,assetResolver:e.assetResolver,noLinks:!u,strict:f,warn:g=>d.push(g)}),m=d.map(g=>WE(g,r,f?"error":"warning"));return f&&m.length>0?{kind:"diagnostics",diagnostics:[...a,...m]}:{kind:"svg",svg:p,warnings:m}}function SE(){sm=void 0,zP=0}var WP="/embed.nowline",IE=!1;async function VP(t){let{ast:e,diagnostics:r}=await am(t,{filePath:WP});return{ast:e,errors:r.filter(n=>n.severity==="error").map(n=>n.message)}}async function cm(t,e={}){let r={filePath:WP,theme:e.theme,today:e.today,locale:e.locale,width:e.width,idPrefix:e.idPrefix,onSkippedInclude:()=>{IE||(IE=!0,console.warn("nowline: `include` directives are skipped in the browser embed (single-file mode). Render multi-file roadmaps with the CLI or the GitHub Action."))}},n=await AE(t,r);if(n.kind==="svg")return n.svg;let i=n.diagnostics.filter(o=>o.severity==="error").map(o=>o.message);throw new Yu(`Failed to render Nowline source: ${i.join("; ")}`,i)}var Yu=class extends Error{constructor(r,n){super(r);fe(this,"details",n);this.name="EmbedRenderError"}};function YP(){IE=!1,SE()}var rn=Uint8Array,Tr=Uint16Array,OE=Int32Array,LE=new rn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),DE=new rn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),KP=new rn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),eC=function(t,e){for(var r=new Tr(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];for(var i=new OE(r[30]),n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return{b:r,r:i}},tC=eC(LE,2),gX=tC.b,NE=tC.r;gX[28]=258,NE[258]=28;var rC=eC(DE,0),Cse=rC.b,ZP=rC.r,PE=new Tr(32768);for(Me=0;Me<32768;++Me)Jn=(Me&43690)>>1|(Me&21845)<<1,Jn=(Jn&52428)>>2|(Jn&13107)<<2,Jn=(Jn&61680)>>4|(Jn&3855)<<4,PE[Me]=((Jn&65280)>>8|(Jn&255)<<8)>>1;var Jn,Me,Ju=(function(t,e,r){for(var n=t.length,i=0,o=new Tr(e);i<n;++i)t[i]&&++o[t[i]-1];var s=new Tr(e);for(i=1;i<e;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(r){a=new Tr(1<<e);var c=15-e;for(i=0;i<n;++i)if(t[i])for(var l=i<<4|t[i],u=e-t[i],f=s[t[i]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)a[PE[f]>>c]=l}else for(a=new Tr(n),i=0;i<n;++i)t[i]&&(a[i]=PE[s[t[i]-1]++]>>15-t[i]);return a}),os=new rn(288);for(Me=0;Me<144;++Me)os[Me]=8;var Me;for(Me=144;Me<256;++Me)os[Me]=9;var Me;for(Me=256;Me<280;++Me)os[Me]=7;var Me;for(Me=280;Me<288;++Me)os[Me]=8;var Me,lm=new rn(32);for(Me=0;Me<32;++Me)lm[Me]=5;var Me,yX=Ju(os,9,0);var xX=Ju(lm,5,0);var nC=function(t){return(t+7)/8|0},TX=function(t,e,r){return(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length),new rn(t.subarray(e,r))};var Qn=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>8},Ku=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>8,t[n+2]|=r>>16},kE=function(t,e){for(var r=[],n=0;n<t.length;++n)t[n]&&r.push({s:n,f:t[n]});var i=r.length,o=r.slice();if(!i)return{t:oC,l:0};if(i==1){var s=new rn(r[0].s+1);return s[r[0].s]=1,{t:s,l:1}}r.sort(function(D,k){return D.f-k.f}),r.push({s:-1,f:25001});var a=r[0],c=r[1],l=0,u=1,f=2;for(r[0]={s:-1,f:a.f+c.f,l:a,r:c};u!=i-1;)a=r[r[l].f<r[f].f?l++:f++],c=r[l!=u&&r[l].f<r[f].f?l++:f++],r[u++]={s:-1,f:a.f+c.f,l:a,r:c};for(var d=o[0].s,n=1;n<i;++n)o[n].s>d&&(d=o[n].s);var p=new Tr(d+1),m=CE(r[u-1],p,0);if(m>e){var n=0,g=0,v=m-e,T=1<<v;for(o.sort(function(k,B){return p[B.s]-p[k.s]||k.f-B.f});n<i;++n){var _=o[n].s;if(p[_]>e)g+=T-(1<<m-p[_]),p[_]=e;else break}for(g>>=v;g>0;){var E=o[n].s;p[E]<e?g-=1<<e-p[E]++-1:++n}for(;n>=0&&g;--n){var I=o[n].s;p[I]==e&&(--p[I],++g)}m=e}return{t:new rn(p),l:m}},CE=function(t,e,r){return t.s==-1?Math.max(CE(t.l,e,r+1),CE(t.r,e,r+1)):e[t.s]=r},JP=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Tr(++e),n=0,i=t[0],o=1,s=function(c){r[n++]=c},a=1;a<=e;++a)if(t[a]==i&&a!=e)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=t[a]}return{c:r.subarray(0,n),n:e}},Zu=function(t,e){for(var r=0,n=0;n<e.length;++n)r+=t[n]*e[n];return r},iC=function(t,e,r){var n=r.length,i=nC(e+2);t[i]=n&255,t[i+1]=n>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var o=0;o<n;++o)t[i+o+4]=r[o];return(i+4+n)*8},QP=function(t,e,r,n,i,o,s,a,c,l,u){Qn(e,u++,r),++i[256];for(var f=kE(i,15),d=f.t,p=f.l,m=kE(o,15),g=m.t,v=m.l,T=JP(d),_=T.c,E=T.n,I=JP(g),D=I.c,k=I.n,B=new Tr(19),U=0;U<_.length;++U)++B[_[U]&31];for(var U=0;U<D.length;++U)++B[D[U]&31];for(var z=kE(B,7),le=z.t,O=z.l,R=19;R>4&&!le[KP[R-1]];--R);var L=l+5<<3,$=Zu(i,os)+Zu(o,lm)+s,b=Zu(i,d)+Zu(o,g)+s+14+3*R+Zu(B,le)+2*B[16]+3*B[17]+7*B[18];if(c>=0&&L<=$&&L<=b)return iC(e,u,t.subarray(c,c+l));var A,S,M,X;if(Qn(e,u,1+(b<$)),u+=2,b<$){A=Ju(d,p,0),S=d,M=Ju(g,v,0),X=g;var F=Ju(le,O,0);Qn(e,u,E-257),Qn(e,u+5,k-1),Qn(e,u+10,R-4),u+=14;for(var U=0;U<R;++U)Qn(e,u+3*U,le[KP[U]]);u+=3*R;for(var W=[_,D],K=0;K<2;++K)for(var pe=W[K],U=0;U<pe.length;++U){var V=pe[U]&31;Qn(e,u,F[V]),u+=le[V],V>15&&(Qn(e,u,pe[U]>>5&127),u+=pe[U]>>12)}}else A=yX,S=os,M=xX,X=lm;for(var U=0;U<a;++U){var ee=n[U];if(ee>255){var V=ee>>18&31;Ku(e,u,A[V+257]),u+=S[V+257],V>7&&(Qn(e,u,ee>>23&31),u+=LE[V]);var Le=ee&31;Ku(e,u,M[Le]),u+=X[Le],Le>3&&(Ku(e,u,ee>>5&8191),u+=DE[Le])}else Ku(e,u,A[ee]),u+=S[ee]}return Ku(e,u,A[256]),u+S[256]},_X=new OE([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),oC=new rn(0),EX=function(t,e,r,n,i,o){var s=o.z||t.length,a=new rn(n+s+5*(1+Math.ceil(s/7e3))+i),c=a.subarray(n,a.length-i),l=o.l,u=(o.r||0)&7;if(e){u&&(c[0]=o.r>>3);for(var f=_X[e-1],d=f>>13,p=f&8191,m=(1<<r)-1,g=o.p||new Tr(32768),v=o.h||new Tr(m+1),T=Math.ceil(r/3),_=2*T,E=function(xe){return(t[xe]^t[xe+1]<<T^t[xe+2]<<_)&m},I=new OE(25e3),D=new Tr(288),k=new Tr(32),B=0,U=0,z=o.i||0,le=0,O=o.w||0,R=0;z+2<s;++z){var L=E(z),$=z&32767,b=v[L];if(g[$]=b,v[L]=$,O<=z){var A=s-z;if((B>7e3||le>24576)&&(A>423||!l)){u=QP(t,c,0,I,D,k,U,le,R,z-R,u),le=B=U=0,R=z;for(var S=0;S<286;++S)D[S]=0;for(var S=0;S<30;++S)k[S]=0}var M=2,X=0,F=p,W=$-b&32767;if(A>2&&L==E(z-W))for(var K=Math.min(d,A)-1,pe=Math.min(32767,z),V=Math.min(258,A);W<=pe&&--F&&$!=b;){if(t[z+M]==t[z+M-W]){for(var ee=0;ee<V&&t[z+ee]==t[z+ee-W];++ee);if(ee>M){if(M=ee,X=W,ee>K)break;for(var Le=Math.min(W,ee-2),Fe=0,S=0;S<Le;++S){var Ue=z-W+S&32767,q=g[Ue],J=Ue-q&32767;J>Fe&&(Fe=J,b=Ue)}}}$=b,b=g[$],W+=$-b&32767}if(X){I[le++]=268435456|NE[M]<<18|ZP[X];var te=NE[M]&31,P=ZP[X]&31;U+=LE[te]+DE[P],++D[257+te],++k[P],O=z+M,++B}else I[le++]=t[z],++D[t[z]]}}for(z=Math.max(z,O);z<s;++z)I[le++]=t[z],++D[t[z]];u=QP(t,c,l,I,D,k,U,le,R,z-R,u),l||(o.r=u&7|c[u/8|0]<<3,u-=7,o.h=v,o.p=g,o.i=z,o.w=O)}else{for(var z=o.w||0;z<s+l;z+=65535){var ge=z+65535;ge>=s&&(c[u/8|0]=l,ge=s),u=iC(c,u+1,t.subarray(z,ge))}o.i=s}return TX(a,0,n+nC(u)+i)};var sC=function(){var t=1,e=0;return{p:function(r){for(var n=t,i=e,o=r.length|0,s=0;s!=o;){for(var a=Math.min(s+2655,o);s<a;++s)i+=n+=r[s];n=(n&65535)+15*(n>>16),i=(i&65535)+15*(i>>16)}t=n,e=i},d:function(){return t%=65521,e%=65521,(t&255)<<24|(t&65280)<<8|(e&255)<<8|e>>8}}},vX=function(t,e,r,n,i){if(!i&&(i={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),s=new rn(o.length+t.length);s.set(o),s.set(t,o.length),t=s,i.w=o.length}return EX(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,r,n,i)};var aC=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};var RX=function(t,e){var r=e.level,n=r==0?0:r<6?1:r==9?3:2;if(t[0]=120,t[1]=n<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var i=sC();i.p(e.dictionary),aC(t,2,i.d())}};function cC(t,e){e||(e={});var r=sC();r.p(t);var n=vX(t,e,e.dictionary?6:2,4);return RX(n,e),aC(n,n.length-4,r.d()),n}var wX=typeof TextDecoder<"u"&&new TextDecoder,bX=0;try{wX.decode(oC,{stream:!0}),bX=1}catch{}var AX="https://free.nowline.io/open";function lC(t){let e=new TextEncoder().encode(t),r=cC(e),n=32768,i="";for(let o=0;o<r.length;o+=n)i+=String.fromCharCode(...r.subarray(o,o+n));return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function fC({source:t,sourceUrl:e,share:r}){if(r===!1||r==="none")return null;if(typeof r=="object")return e!==void 0&&uC(e)?r.remoteUrl.replace("{url}",encodeURIComponent(e)):r.textUrl.replace("{text}",lC(t));let n=r===!0?AX:r,i=new URL(n);return e!==void 0&&uC(e)?i.hash=`url=${encodeURIComponent(e)}`:i.hash=`text=${lC(t)}`,i.toString()}function uC(t){try{return new URL(t).protocol==="https:"}catch{return!1}}var dC=0;async function pC(t){let e=t.document??globalThis.document;if(!e)return{rendered:0,failed:0};let r=e.querySelectorAll(t.selector),n=0,i=0,o=++dC,s=t.share??!0,a=[],c=0;for(let l of Array.from(r)){let u=SX(l);if(!u)continue;let f=IX(l),d=`nl-r${o}-${c++}`,p={theme:t.theme,locale:t.locale,width:t.width,today:t.today,idPrefix:d},m=u.parentElement,g=u.nextSibling,T=l.getAttribute("data-nowline-source-url")??void 0??t.sourceUrl;a.push(cm(f,p).then(_=>{if(kX(u,_),n++,m!==null){let E=fC({source:f,sourceUrl:T,share:s});if(E!==null){let I=e.createElement("a");I.className="nowline-share",I.href=E,I.target="_blank",I.rel="noopener noreferrer",I.textContent="Share on Nowline",m.insertBefore(I,g)}}},_=>{i++,console.error("nowline: render failed",_)}))}return await Promise.all(a),{rendered:n,failed:i}}function SX(t){let e=t.parentElement;return e&&e.tagName.toUpperCase()==="PRE"?e:t}function IX(t){return t.textContent??""}function kX(t,e){t.outerHTML=e}function hC(){dC=0}function um(){if(typeof globalThis>"u")return"light";let t=globalThis.matchMedia;if(typeof t!="function")return"light";try{return t("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}}function mC(t,e){return t==="light"||t==="dark"?t:e}var NX=GE,PX=XE,CX="pre code.language-nowline, code.language-nowline",gC={theme:"auto",startOnLoad:!0,selector:CX,systemTheme:um(),share:!0},Et={...gC},$E=!1;function OX(t={}){Et={theme:t.theme??Et.theme,startOnLoad:t.startOnLoad??Et.startOnLoad,selector:t.selector??Et.selector,locale:t.locale??Et.locale,width:t.width??Et.width,today:t.today??Et.today,share:t.share??Et.share,sourceUrl:t.sourceUrl??Et.sourceUrl,systemTheme:um()}}function yC(){return{theme:mC(Et.theme,Et.systemTheme),locale:Et.locale,width:Et.width,today:Et.today}}async function LX(t,e={}){let r={...yC(),...e};return cm(t,r)}async function DX(t){return VP(t)}async function ME(t){let e={selector:t?.selector??Et.selector,theme:t?.theme??yC().theme,locale:t?.locale??Et.locale,width:t?.width??Et.width,today:t?.today??Et.today,share:t?.share??Et.share,sourceUrl:t?.sourceUrl??Et.sourceUrl,document:t?.document};return pC(e)}var $X=ME;if(typeof document<"u"&&!$E){$E=!0;let t=()=>{Et.startOnLoad&&ME()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):queueMicrotask(t)}function MX(){Et={...gC,systemTheme:um()},$E=!1,YP(),hC()}return tf(FX);})();
2664
2664
  //# sourceMappingURL=nowline.min.js.map