@nowline/embed 0.8.5 → 0.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,77 +1,77 @@
1
- /*! @nowline/embed 0.8.5 sha=64645c3 built=2026-06-20T15:29:49Z */
2
- "use strict";var nowline=(()=>{var ZP=Object.create;var za=Object.defineProperty;var JP=Object.getOwnPropertyDescriptor;var QP=Object.getOwnPropertyNames;var eC=Object.getPrototypeOf,tC=Object.prototype.hasOwnProperty;var rC=(t,e,r)=>e in t?za(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var J_=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var he=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},eu=(t,e)=>{for(var r in e)za(t,r,{get:e[r],enumerable:!0})},Q_=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of QP(e))!tC.call(t,i)&&i!==r&&za(t,i,{get:()=>e[i],enumerable:!(n=JP(e,i))||n.enumerable});return t};var Rh=(t,e,r)=>(r=t!=null?ZP(eC(t)):{},Q_(e||!t||!t.__esModule?za(r,"default",{value:t,enumerable:!0}):r,t)),tu=t=>Q_(za({},"__esModule",{value:!0}),t);var R=(t,e,r)=>rC(t,typeof e!="symbol"?e+"":e,r);var Hf={};eu(Hf,{AnnotatedTextEdit:()=>An,ApplyKind:()=>hg,ChangeAnnotation:()=>gi,ChangeAnnotationIdentifier:()=>Rt,CodeAction:()=>Ng,CodeActionContext:()=>kg,CodeActionKind:()=>Ig,CodeActionTag:()=>Uf,CodeActionTriggerKind:()=>Hc,CodeDescription:()=>rg,CodeLens:()=>Pg,Color:()=>Lf,ColorInformation:()=>Km,ColorPresentation:()=>Zm,Command:()=>uo,CompletionItem:()=>gg,CompletionItemKind:()=>lg,CompletionItemLabelDetails:()=>mg,CompletionItemTag:()=>fg,CompletionList:()=>yg,CreateFile:()=>Ss,DeleteFile:()=>Is,Diagnostic:()=>Uc,DiagnosticRelatedInformation:()=>Df,DiagnosticSeverity:()=>eg,DiagnosticTag:()=>tg,DocumentHighlight:()=>vg,DocumentHighlightKind:()=>Eg,DocumentLink:()=>Og,DocumentSymbol:()=>Ag,DocumentUri:()=>qm,EOL:()=>J$,FoldingRange:()=>Qm,FoldingRangeKind:()=>Jm,FormattingOptions:()=>Cg,Hover:()=>xg,InlayHint:()=>Xg,InlayHintKind:()=>Bf,InlayHintLabelPart:()=>Gf,InlineCompletionContext:()=>qg,InlineCompletionItem:()=>Hg,InlineCompletionList:()=>jg,InlineCompletionTriggerKind:()=>zg,InlineValueContext:()=>Gg,InlineValueEvaluatableExpression:()=>Bg,InlineValueText:()=>Fg,InlineValueVariableLookup:()=>Ug,InsertReplaceEdit:()=>dg,InsertTextFormat:()=>ug,InsertTextMode:()=>pg,LanguageKind:()=>ag,Location:()=>Fc,LocationLink:()=>Ym,MarkedString:()=>Xc,MarkupContent:()=>yi,MarkupKind:()=>Ff,OptionalVersionedTextDocumentIdentifier:()=>Gc,ParameterInformation:()=>Tg,Position:()=>Ie,Range:()=>xe,RenameFile:()=>As,SelectedCompletionInfo:()=>Wg,SelectionRange:()=>Lg,SemanticTokenModifiers:()=>Mg,SemanticTokenTypes:()=>Dg,SemanticTokens:()=>$g,SignatureInformation:()=>_g,SnippetTextEdit:()=>ng,StringValue:()=>Xf,SymbolInformation:()=>Rg,SymbolKind:()=>bg,SymbolTag:()=>wg,TextDocument:()=>Yg,TextDocumentEdit:()=>Bc,TextDocumentIdentifier:()=>og,TextDocumentItem:()=>cg,TextEdit:()=>tn,URI:()=>Of,VersionedTextDocumentIdentifier:()=>sg,WorkspaceChange:()=>ig,WorkspaceEdit:()=>Mf,WorkspaceFolder:()=>Vg,WorkspaceSymbol:()=>Sg,integer:()=>Vm,uinteger:()=>$c});var qm,Of,Vm,$c,Ie,xe,Fc,Ym,Lf,Km,Zm,Jm,Qm,Df,eg,tg,rg,Uc,uo,tn,gi,Rt,An,Bc,Ss,As,Is,Mf,Rs,ng,$f,ig,og,sg,Gc,ag,cg,Ff,yi,lg,ug,fg,dg,pg,hg,mg,gg,yg,Xc,xg,Tg,_g,Eg,vg,bg,wg,Rg,Sg,Ag,Ig,Hc,kg,Uf,Ng,Pg,Cg,Og,Lg,Dg,Mg,$g,Fg,Ug,Bg,Gg,Bf,Gf,Xg,Xf,Hg,jg,zg,Wg,qg,Vg,J$,Yg,Kg,b,ks=J_(()=>{"use strict";(function(t){function e(r){return typeof r=="string"}t.is=e})(qm||(qm={}));(function(t){function e(r){return typeof r=="string"}t.is=e})(Of||(Of={}));(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})(Vm||(Vm={}));(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})($c||($c={}));(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=$c.MAX_VALUE),i===Number.MAX_VALUE&&(i=$c.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})(Ie||(Ie={}));(function(t){function e(n,i,o,s){if(b.uinteger(n)&&b.uinteger(i)&&b.uinteger(o)&&b.uinteger(s))return{start:Ie.create(n,i),end:Ie.create(o,s)};if(Ie.is(n)&&Ie.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)&&Ie.is(i.start)&&Ie.is(i.end)}t.is=r})(xe||(xe={}));(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return b.objectLiteral(i)&&xe.is(i.range)&&(b.string(i.uri)||b.undefined(i.uri))}t.is=r})(Fc||(Fc={}));(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)&&xe.is(i.targetRange)&&b.string(i.targetUri)&&xe.is(i.targetSelectionRange)&&(xe.is(i.originSelectionRange)||b.undefined(i.originSelectionRange))}t.is=r})(Ym||(Ym={}));(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})(Lf||(Lf={}));(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){let i=n;return b.objectLiteral(i)&&xe.is(i.range)&&Lf.is(i.color)}t.is=r})(Km||(Km={}));(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)||tn.is(i))&&(b.undefined(i.additionalTextEdits)||b.typedArray(i.additionalTextEdits,tn.is))}t.is=r})(Zm||(Zm={}));(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Jm||(Jm={}));(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})(Qm||(Qm={}));(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return b.defined(i)&&Fc.is(i.location)&&b.string(i.message)}t.is=r})(Df||(Df={}));(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(eg||(eg={}));(function(t){t.Unnecessary=1,t.Deprecated=2})(tg||(tg={}));(function(t){function e(r){let n=r;return b.objectLiteral(n)&&b.string(n.href)}t.is=e})(rg||(rg={}));(function(t){function e(o,s,a,c,l,u){let f={range:o,message:s};return b.defined(a)&&(f.severity=a),b.defined(c)&&(f.code=c),b.defined(l)&&(f.source=l),b.defined(u)&&(f.relatedInformation=u),f}t.create=e;function r(o){var s;let a=o;return b.defined(a)&&xe.is(a.range)&&(b.string(a.message)||yi.is(a.message))&&(b.number(a.severity)||b.undefined(a.severity))&&(b.integer(a.code)||b.string(a.code)||b.undefined(a.code))&&(b.undefined(a.codeDescription)||b.string((s=a.codeDescription)===null||s===void 0?void 0:s.href))&&(b.string(a.source)||b.undefined(a.source))&&(b.undefined(a.relatedInformation)||b.typedArray(a.relatedInformation,Df.is))}t.is=r;function n(o){return b.string(o.message)}t.is3_17=n;function i(o){if(b.string(o.message))return o.message;if(yi.is(o.message))return o.message.value;throw new Error(`Unknown message type ${typeof o.message}`)}t.getMessageString=i})(Uc||(Uc={}));(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)&&(i.tooltip===void 0||b.string(i.tooltip))&&b.string(i.command)}t.is=r})(uo||(uo={}));(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)&&xe.is(s.range)}t.is=i})(tn||(tn={}));(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})(gi||(gi={}));(function(t){function e(r){let n=r;return b.string(n)}t.is=e})(Rt||(Rt={}));(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 tn.is(s)&&(gi.is(s.annotationId)||Rt.is(s.annotationId))}t.is=i})(An||(An={}));(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return b.defined(i)&&Gc.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(Bc||(Bc={}));(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||Rt.is(i.annotationId))}t.is=r})(Ss||(Ss={}));(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||Rt.is(i.annotationId))}t.is=r})(As||(As={}));(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||Rt.is(i.annotationId))}t.is=r})(Is||(Is={}));(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)?Ss.is(i)||As.is(i)||Is.is(i):Bc.is(i)))}t.is=e})(Mf||(Mf={}));Rs=class{constructor(e,r){this.edits=e,this.changeAnnotations=r}insert(e,r,n){let i,o;if(n===void 0?i=tn.insert(e,r):Rt.is(n)?(o=n,i=An.insert(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),i=An.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=tn.replace(e,r):Rt.is(n)?(o=n,i=An.replace(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),i=An.replace(e,r,o)),this.edits.push(i),o!==void 0)return o}delete(e,r){let n,i;if(r===void 0?n=tn.del(e):Rt.is(r)?(i=r,n=An.del(e,r)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(r),n=An.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.")}};(function(t){function e(r){let n=r;return b.objectLiteral(n)&&xe.is(n.range)&&Xf.isSnippet(n.snippet)&&(n.annotationId===void 0||gi.is(n.annotationId)||Rt.is(n.annotationId))}t.is=e})(ng||(ng={}));$f=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(Rt.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()}},ig=class{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new $f(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(r=>{if(Bc.is(r)){let n=new Rs(r.edits,this._changeAnnotations);this._textEditChanges[r.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(r=>{let n=new Rs(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(Gc.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 Rs(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 Rs(n),this._textEditChanges[e]=r}return r}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new $f,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;gi.is(r)||Rt.is(r)?i=r:n=r;let o,s;if(i===void 0?o=Ss.create(e,n):(s=Rt.is(i)?i:this._changeAnnotations.manage(i),o=Ss.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;gi.is(n)||Rt.is(n)?o=n:i=n;let s,a;if(o===void 0?s=As.create(e,r,i):(a=Rt.is(o)?o:this._changeAnnotations.manage(o),s=As.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;gi.is(r)||Rt.is(r)?i=r:n=r;let o,s;if(i===void 0?o=Is.create(e,n):(s=Rt.is(i)?i:this._changeAnnotations.manage(i),o=Is.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})(og||(og={}));(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})(sg||(sg={}));(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})(Gc||(Gc={}));(function(t){t.ABAP="abap",t.WindowsBat="bat",t.BibTeX="bibtex",t.Clojure="clojure",t.Coffeescript="coffeescript",t.C="c",t.CPP="cpp",t.CSharp="csharp",t.CSS="css",t.D="d",t.Delphi="pascal",t.Diff="diff",t.Dart="dart",t.Dockerfile="dockerfile",t.Elixir="elixir",t.Erlang="erlang",t.FSharp="fsharp",t.GitCommit="git-commit",t.GitRebase="git-rebase",t.Go="go",t.Groovy="groovy",t.Handlebars="handlebars",t.Haskell="haskell",t.HTML="html",t.Ini="ini",t.Java="java",t.JavaScript="javascript",t.JavaScriptReact="javascriptreact",t.JSON="json",t.LaTeX="latex",t.Less="less",t.Lua="lua",t.Makefile="makefile",t.Markdown="markdown",t.ObjectiveC="objective-c",t.ObjectiveCPP="objective-cpp",t.Pascal="pascal",t.Perl="perl",t.Perl6="perl6",t.PHP="php",t.Plaintext="plaintext",t.Powershell="powershell",t.Pug="jade",t.Python="python",t.R="r",t.Razor="razor",t.Ruby="ruby",t.Rust="rust",t.SCSS="scss",t.SASS="sass",t.Scala="scala",t.ShaderLab="shaderlab",t.ShellScript="shellscript",t.SQL="sql",t.Swift="swift",t.TypeScript="typescript",t.TypeScriptReact="typescriptreact",t.TeX="tex",t.VisualBasic="vb",t.XML="xml",t.XSL="xsl",t.YAML="yaml"})(ag||(ag={}));(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})(cg||(cg={}));(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){let n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(Ff||(Ff={}));(function(t){function e(r){let n=r;return b.objectLiteral(r)&&Ff.is(n.kind)&&b.string(n.value)}t.is=e})(yi||(yi={}));(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})(lg||(lg={}));(function(t){t.PlainText=1,t.Snippet=2})(ug||(ug={}));(function(t){t.Deprecated=1})(fg||(fg={}));(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)&&xe.is(i.insert)&&xe.is(i.replace)}t.is=r})(dg||(dg={}));(function(t){t.asIs=1,t.adjustIndentation=2})(pg||(pg={}));(function(t){t.Replace=1,t.Merge=2})(hg||(hg={}));(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})(mg||(mg={}));(function(t){function e(r){return{label:r}}t.create=e})(gg||(gg={}));(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(yg||(yg={}));(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})(Xc||(Xc={}));(function(t){function e(r){let n=r;return!!n&&b.objectLiteral(n)&&(yi.is(n.contents)||Xc.is(n.contents)||b.typedArray(n.contents,Xc.is))&&(r.range===void 0||xe.is(r.range))}t.is=e})(xg||(xg={}));(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(Tg||(Tg={}));(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})(_g||(_g={}));(function(t){t.Text=1,t.Read=2,t.Write=3})(Eg||(Eg={}));(function(t){function e(r,n){let i={range:r};return b.number(n)&&(i.kind=n),i}t.create=e})(vg||(vg={}));(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})(bg||(bg={}));(function(t){t.Deprecated=1})(wg||(wg={}));(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})(Rg||(Rg={}));(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})(Sg||(Sg={}));(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)&&xe.is(i.range)&&xe.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})(Ag||(Ag={}));(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorMove="refactor.move",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll",t.Notebook="notebook"})(Ig||(Ig={}));(function(t){t.Invoked=1,t.Automatic=2})(Hc||(Hc={}));(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,Uc.is)&&(i.only===void 0||b.typedArray(i.only,b.string))&&(i.triggerKind===void 0||i.triggerKind===Hc.Invoked||i.triggerKind===Hc.Automatic)}t.is=r})(kg||(kg={}));(function(t){t.LLMGenerated=1;function e(r){return b.defined(r)&&r===t.LLMGenerated}t.is=e})(Uf||(Uf={}));(function(t){function e(n,i,o){let s={title:n},a=!0;return typeof i=="string"?(a=!1,s.kind=i):uo.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,Uc.is))&&(i.kind===void 0||b.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||uo.is(i.command))&&(i.isPreferred===void 0||b.boolean(i.isPreferred))&&(i.edit===void 0||Mf.is(i.edit))&&(i.tags===void 0||b.typedArray(i.tags,Uf.is))}t.is=r})(Ng||(Ng={}));(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)&&xe.is(i.range)&&(b.undefined(i.command)||uo.is(i.command))}t.is=r})(Pg||(Pg={}));(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})(Cg||(Cg={}));(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)&&xe.is(i.range)&&(b.undefined(i.target)||b.string(i.target))}t.is=r})(Og||(Og={}));(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return b.objectLiteral(i)&&xe.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(Lg||(Lg={}));(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",t.label="label"})(Dg||(Dg={}));(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"})(Mg||(Mg={}));(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})($g||($g={}));(function(t){function e(n,i){return{range:n,text:i}}t.create=e;function r(n){let i=n;return i!=null&&xe.is(i.range)&&b.string(i.text)}t.is=r})(Fg||(Fg={}));(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&&xe.is(i.range)&&b.boolean(i.caseSensitiveLookup)&&(b.string(i.variableName)||i.variableName===void 0)}t.is=r})(Ug||(Ug={}));(function(t){function e(n,i){return{range:n,expression:i}}t.create=e;function r(n){let i=n;return i!=null&&xe.is(i.range)&&(b.string(i.expression)||i.expression===void 0)}t.is=r})(Bg||(Bg={}));(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){let i=n;return b.defined(i)&&xe.is(n.stoppedLocation)}t.is=r})(Gg||(Gg={}));(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(Bf||(Bf={}));(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)||yi.is(i.tooltip))&&(i.location===void 0||Fc.is(i.location))&&(i.command===void 0||uo.is(i.command))}t.is=r})(Gf||(Gf={}));(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)&&Ie.is(i.position)&&(b.string(i.label)||b.typedArray(i.label,Gf.is))&&(i.kind===void 0||Bf.is(i.kind))&&i.textEdits===void 0||b.typedArray(i.textEdits,tn.is)&&(i.tooltip===void 0||b.string(i.tooltip)||yi.is(i.tooltip))&&(i.paddingLeft===void 0||b.boolean(i.paddingLeft))&&(i.paddingRight===void 0||b.boolean(i.paddingRight))}t.is=r})(Xg||(Xg={}));(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e;function r(n){let i=n;return b.objectLiteral(i)&&i.kind==="snippet"&&b.string(i.value)}t.isSnippet=r})(Xf||(Xf={}));(function(t){function e(r,n,i,o){return{insertText:r,filterText:n,range:i,command:o}}t.create=e})(Hg||(Hg={}));(function(t){function e(r){return{items:r}}t.create=e})(jg||(jg={}));(function(t){t.Invoked=1,t.Automatic=2})(zg||(zg={}));(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(Wg||(Wg={}));(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(qg||(qg={}));(function(t){function e(r){let n=r;return b.objectLiteral(n)&&Of.is(n.uri)&&b.string(n.name)}t.is=e})(Vg||(Vg={}));J$=[`
1
+ /*! @nowline/embed 0.8.6 sha=29a8950 built=2026-10-01T06:23:45Z */
2
+ "use strict";var nowline=(()=>{var tC=Object.create;var za=Object.defineProperty;var rC=Object.getOwnPropertyDescriptor;var nC=Object.getOwnPropertyNames;var iC=Object.getPrototypeOf,oC=Object.prototype.hasOwnProperty;var sC=(t,e,r)=>e in t?za(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var tE=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var pe=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},nu=(t,e)=>{for(var r in e)za(t,r,{get:e[r],enumerable:!0})},rE=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of nC(e))!oC.call(t,i)&&i!==r&&za(t,i,{get:()=>e[i],enumerable:!(n=rC(e,i))||n.enumerable});return t};var Nh=(t,e,r)=>(r=t!=null?tC(iC(t)):{},rE(e||!t||!t.__esModule?za(r,"default",{value:t,enumerable:!0}):r,t)),iu=t=>rE(za({},"__esModule",{value:!0}),t);var R=(t,e,r)=>sC(t,typeof e!="symbol"?e+"":e,r);var Ns=pe(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.boolean=gF;In.string=Nw;In.number=yF;In.error=xF;In.func=TF;In.array=Pw;In.stringArray=_F;function gF(t){return t===!0||t===!1}function Nw(t){return typeof t=="string"||t instanceof String}function yF(t){return typeof t=="number"||t instanceof Number}function xF(t){return t instanceof Error}function TF(t){return typeof t=="function"}function Pw(t){return Array.isArray(t)}function _F(t){return Pw(t)&&t.every(e=>Nw(e))}});var Ag=pe(te=>{"use strict";var EF=te&&te.__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]})),vF=te&&te.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bF=te&&te.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&EF(r,e,n[i]);return vF(r,e),r}})();Object.defineProperty(te,"__esModule",{value:!0});te.Message=te.NotificationType9=te.NotificationType8=te.NotificationType7=te.NotificationType6=te.NotificationType5=te.NotificationType4=te.NotificationType3=te.NotificationType2=te.NotificationType1=te.NotificationType0=te.NotificationType=te.RequestType9=te.RequestType8=te.RequestType7=te.RequestType6=te.RequestType5=te.RequestType4=te.RequestType3=te.RequestType2=te.RequestType1=te.RequestType=te.RequestType0=te.AbstractMessageSignature=te.ParameterStructures=te.ResponseError=te.ErrorCodes=void 0;var mo=bF(Ns()),ng;(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})(ng||(te.ErrorCodes=ng={}));var ig=class t extends Error{constructor(r,n,i){super(n);R(this,"code");R(this,"data");this.code=mo.number(r)?r:ng.UnknownErrorCode,this.data=i,Object.setPrototypeOf(this,t.prototype)}toJson(){let r={code:this.code,message:this.message};return this.data!==void 0&&(r.data=this.data),r}};te.ResponseError=ig;var kr=class kr{constructor(e){R(this,"kind");this.kind=e}static is(e){return e===kr.auto||e===kr.byName||e===kr.byPosition}toString(){return this.kind}};R(kr,"auto",new kr("auto")),R(kr,"byPosition",new kr("byPosition")),R(kr,"byName",new kr("byName"));var yi=kr;te.ParameterStructures=yi;var et=class{constructor(e,r){R(this,"method");R(this,"numberOfParams");this.method=e,this.numberOfParams=r}get parameterStructures(){return yi.auto}};te.AbstractMessageSignature=et;var og=class extends et{constructor(r){super(r,0);R(this,"_")}};te.RequestType0=og;var sg=class extends et{constructor(r,n=yi.auto){super(r,1);R(this,"_parameterStructures");R(this,"_");this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};te.RequestType=sg;var ag=class extends et{constructor(r,n=yi.auto){super(r,1);R(this,"_parameterStructures");R(this,"_");this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};te.RequestType1=ag;var cg=class extends et{constructor(r){super(r,2);R(this,"_")}};te.RequestType2=cg;var lg=class extends et{constructor(r){super(r,3);R(this,"_")}};te.RequestType3=lg;var ug=class extends et{constructor(r){super(r,4);R(this,"_")}};te.RequestType4=ug;var fg=class extends et{constructor(r){super(r,5);R(this,"_")}};te.RequestType5=fg;var dg=class extends et{constructor(r){super(r,6);R(this,"_")}};te.RequestType6=dg;var pg=class extends et{constructor(r){super(r,7);R(this,"_")}};te.RequestType7=pg;var hg=class extends et{constructor(r){super(r,8);R(this,"_")}};te.RequestType8=hg;var mg=class extends et{constructor(r){super(r,9);R(this,"_")}};te.RequestType9=mg;var gg=class extends et{constructor(r,n=yi.auto){super(r,1);R(this,"_parameterStructures");R(this,"_");this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};te.NotificationType=gg;var yg=class extends et{constructor(r){super(r,0);R(this,"_")}};te.NotificationType0=yg;var xg=class extends et{constructor(r,n=yi.auto){super(r,1);R(this,"_parameterStructures");R(this,"_");this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};te.NotificationType1=xg;var Tg=class extends et{constructor(r){super(r,2);R(this,"_")}};te.NotificationType2=Tg;var _g=class extends et{constructor(r){super(r,3);R(this,"_")}};te.NotificationType3=_g;var Eg=class extends et{constructor(r){super(r,4);R(this,"_")}};te.NotificationType4=Eg;var vg=class extends et{constructor(r){super(r,5);R(this,"_")}};te.NotificationType5=vg;var bg=class extends et{constructor(r){super(r,6);R(this,"_")}};te.NotificationType6=bg;var wg=class extends et{constructor(r){super(r,7);R(this,"_")}};te.NotificationType7=wg;var Rg=class extends et{constructor(r){super(r,8);R(this,"_")}};te.NotificationType8=Rg;var Sg=class extends et{constructor(r){super(r,9);R(this,"_")}};te.NotificationType9=Sg;var Cw;(function(t){function e(i){let o=i;return o&&mo.string(o.method)&&(mo.string(o.id)||mo.number(o.id))}t.isRequest=e;function r(i){let o=i;return o&&mo.string(o.method)&&i.id===void 0}t.isNotification=r;function n(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(mo.string(o.id)||mo.number(o.id)||o.id===null)}t.isResponse=n})(Cw||(te.Message=Cw={}))});var kg=pe(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.LRUCache=xi.LinkedMap=xi.Touch=void 0;var Ct;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Ct||(xi.Touch=Ct={}));var Ow,zf=class{constructor(){R(this,Ow,"LinkedMap");R(this,"_map");R(this,"_head");R(this,"_tail");R(this,"_size");R(this,"_state");this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}before(e){let r=this._map.get(e);return r?r.previous?.value:void 0}after(e){let r=this._map.get(e);return r?r.next?.value:void 0}has(e){return this._map.has(e)}get(e,r=Ct.None){let n=this._map.get(e);if(n)return r!==Ct.None&&this.touch(n,r),n.value}set(e,r,n=Ct.None){let i=this._map.get(e);if(i)i.value=r,n!==Ct.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case Ct.None:this.addItemLast(i);break;case Ct.First:this.addItemFirst(i);break;case Ct.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}[(Ow=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!==Ct.First&&r!==Ct.Last)){if(r===Ct.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===Ct.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)}};xi.LinkedMap=zf;var Ig=class extends zf{constructor(r,n=1){super();R(this,"_limit");R(this,"_ratio");this._limit=r,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(r){this._limit=r,this.checkTrim()}get ratio(){return this._ratio}set ratio(r){this._ratio=Math.min(Math.max(0,r),1),this.checkTrim()}get(r,n=Ct.AsNew){return super.get(r,n)}peek(r){return super.get(r,Ct.None)}set(r,n){return super.set(r,n,Ct.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};xi.LRUCache=Ig});var Dw=pe(Wf=>{"use strict";Object.defineProperty(Wf,"__esModule",{value:!0});Wf.Disposable=void 0;var Lw;(function(t){function e(r){return{dispose:r}}t.create=e})(Lw||(Wf.Disposable=Lw={}))});var Ti=pe(Cg=>{"use strict";Object.defineProperty(Cg,"__esModule",{value:!0});var Ng;function Pg(){if(Ng===void 0)throw new Error("No runtime abstraction layer installed");return Ng}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");Ng=r}t.install=e})(Pg||(Pg={}));Cg.default=Pg});var Ps=pe(_i=>{"use strict";var wF=_i&&_i.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_i,"__esModule",{value:!0});_i.Emitter=_i.Event=void 0;var RF=wF(Ti()),Mw;(function(t){let e={dispose(){}};t.None=function(){return e}})(Mw||(_i.Event=Mw={}));var Og=class{constructor(){R(this,"_callbacks");R(this,"_contexts")}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,RF.default)().console.error(a)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},qf=class qf{constructor(e){R(this,"_options");R(this,"_event");R(this,"_callbacks");this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new Og),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=qf._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)}};R(qf,"_noop",function(){});var Lg=qf;_i.Emitter=Lg});var Kf=pe(Yt=>{"use strict";var SF=Yt&&Yt.__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]})),AF=Yt&&Yt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),IF=Yt&&Yt.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&SF(r,e,n[i]);return AF(r,e),r}})(),kF=Yt&&Yt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.CancellationTokenSource=Yt.CancellationToken=void 0;var NF=kF(Ti()),PF=IF(Ns()),Dg=Ps(),Vf;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Dg.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Dg.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||PF.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(Vf||(Yt.CancellationToken=Vf={}));var CF=Object.freeze(function(t,e){let r=(0,NF.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),Yf=class{constructor(){R(this,"_isCancelled",!1);R(this,"_emitter")}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?CF:(this._emitter||(this._emitter=new Dg.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Mg=class{constructor(){R(this,"_token")}get token(){return this._token||(this._token=new Yf),this._token}cancel(){this._token?this._token.cancel():this._token=Vf.Cancelled}dispose(){this._token?this._token instanceof Yf&&this._token.dispose():this._token=Vf.None}};Yt.CancellationTokenSource=Mg});var $w=pe(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.SharedArrayReceiverStrategy=Cs.SharedArraySenderStrategy=void 0;var OF=Kf(),Gc;(function(t){t.Continue=0,t.Cancelled=1})(Gc||(Gc={}));var $g=class{constructor(){R(this,"buffers");this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=Gc.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,Gc.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Cs.SharedArraySenderStrategy=$g;var Fg=class{constructor(e){R(this,"data");this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Gc.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Ug=class{constructor(e){R(this,"token");this.token=new Fg(e)}cancel(){}dispose(){}},Bg=class{constructor(){R(this,"kind","request")}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new OF.CancellationTokenSource:new Ug(r)}};Cs.SharedArrayReceiverStrategy=Bg});var Hg=pe(Os=>{"use strict";var LF=Os&&Os.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Os,"__esModule",{value:!0});Os.Semaphore=void 0;var DF=LF(Ti()),Gg=class{constructor(e=1){R(this,"_capacity");R(this,"_active");R(this,"_waiting");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,DF.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("Too 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()}}};Os.Semaphore=Gg});var Uw=pe(Ot=>{"use strict";var MF=Ot&&Ot.__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]})),$F=Ot&&Ot.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),FF=Ot&&Ot.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&MF(r,e,n[i]);return $F(r,e),r}})(),UF=Ot&&Ot.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.ReadableStreamMessageReader=Ot.AbstractMessageReader=Ot.MessageReader=void 0;var jg=UF(Ti()),Ls=FF(Ns()),Xg=Ps(),BF=Hg(),Fw;(function(t){function e(r){let n=r;return n&&Ls.func(n.listen)&&Ls.func(n.dispose)&&Ls.func(n.onError)&&Ls.func(n.onClose)&&Ls.func(n.onPartialMessage)}t.is=e})(Fw||(Ot.MessageReader=Fw={}));var Zf=class{constructor(){R(this,"errorEmitter");R(this,"closeEmitter");R(this,"partialMessageEmitter");this.errorEmitter=new Xg.Emitter,this.closeEmitter=new Xg.Emitter,this.partialMessageEmitter=new Xg.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose(),this.partialMessageEmitter.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: ${Ls.string(e.message)?e.message:"unknown"}`)}};Ot.AbstractMessageReader=Zf;var zg;(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,jg.default)().applicationJson.decoder,c.set(a.name,a)),{charset:n,contentDecoder:o,contentDecoders:s,contentTypeDecoder:a,contentTypeDecoders:c}}t.fromOptions=e})(zg||(zg={}));var Wg=class extends Zf{constructor(r,n){super();R(this,"readable");R(this,"options");R(this,"callback");R(this,"nextMessageLength");R(this,"messageToken");R(this,"buffer");R(this,"partialMessageTimer");R(this,"_partialMessageTimeout");R(this,"readSemaphore");this.readable=r,this.options=zg.fromOptions(n),this.buffer=(0,jg.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new BF.Semaphore(1)}set partialMessageTimeout(r){this._partialMessageTimeout=r}get partialMessageTimeout(){return this._partialMessageTimeout}listen(r){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=r;let n=this.readable.onData(i=>{this.onData(i)});return this.readable.onError(i=>this.fireError(i)),this.readable.onClose(()=>this.fireClose()),n}onData(r){try{for(this.buffer.append(r);;){if(this.nextMessageLength===-1){let i=this.buffer.tryReadHeaders(!0);if(!i)return;let o=i.get("content-length");if(!o){this.fireError(new Error(`Header must provide a Content-Length property.
3
+ ${JSON.stringify(Object.fromEntries(i))}`));return}let s=parseInt(o);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${o}`));return}this.nextMessageLength=s}let n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let i=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(n):n,o=await this.options.contentTypeDecoder.decode(i,this.options);this.callback(o)}).catch(i=>{this.fireError(i)})}}catch(n){this.fireError(n)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,jg.default)().timer.setTimeout((r,n)=>{this.partialMessageTimer=void 0,r===this.messageToken&&(this.firePartialMessage({messageToken:r,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Ot.ReadableStreamMessageReader=Wg});var jw=pe(Lt=>{"use strict";var GF=Lt&&Lt.__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]})),HF=Lt&&Lt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),XF=Lt&&Lt.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&GF(r,e,n[i]);return HF(r,e),r}})(),jF=Lt&&Lt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.WriteableStreamMessageWriter=Lt.AbstractMessageWriter=Lt.MessageWriter=void 0;var Bw=jF(Ti()),Hc=XF(Ns()),zF=Hg(),Gw=Ps(),WF="Content-Length: ",Hw=`\r
4
+ `,Xw;(function(t){function e(r){let n=r;return n&&Hc.func(n.dispose)&&Hc.func(n.onClose)&&Hc.func(n.onError)&&Hc.func(n.write)}t.is=e})(Xw||(Lt.MessageWriter=Xw={}));var Jf=class{constructor(){R(this,"errorEmitter");R(this,"closeEmitter");this.errorEmitter=new Gw.Emitter,this.closeEmitter=new Gw.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: ${Hc.string(e.message)?e.message:"unknown"}`)}};Lt.AbstractMessageWriter=Jf;var qg;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,Bw.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,Bw.default)().applicationJson.encoder}}t.fromOptions=e})(qg||(qg={}));var Vg=class extends Jf{constructor(r,n){super();R(this,"writable");R(this,"options");R(this,"errorCount");R(this,"writeSemaphore");this.writable=r,this.options=qg.fromOptions(n),this.errorCount=0,this.writeSemaphore=new zF.Semaphore(1),this.writable.onError(i=>this.fireError(i)),this.writable.onClose(()=>this.fireClose())}async write(r){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(r,this.options).then(i=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(i):i).then(i=>{let o=[];return o.push(WF,i.byteLength.toString(),Hw),o.push(Hw),this.doWrite(r,o,i)},i=>{throw this.fireError(i),i}))}async doWrite(r,n,i){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(i)}catch(o){return this.handleError(o,r),Promise.reject(o)}}handleError(r,n){this.errorCount++,this.fireError(r,n,this.errorCount)}end(){this.writable.end()}};Lt.WriteableStreamMessageWriter=Vg});var zw=pe(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});Qf.AbstractMessageBuffer=void 0;var qF=13,VF=10,YF=`\r
5
+ `,Yg=class{constructor(e="utf-8"){R(this,"_encoding");R(this,"_chunks");R(this,"_totalLength");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 qF:switch(r){case 0:r=1;break;case 2:r=3;break;default:r=0}break;case VF: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(YF);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 ':'
6
+ ${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}};Qf.AbstractMessageBuffer=Yg});var Yw=pe(ne=>{"use strict";var KF=ne&&ne.__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]})),ZF=ne&&ne.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),JF=ne&&ne.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&KF(r,e,n[i]);return ZF(r,e),r}})(),QF=ne&&ne.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ne,"__esModule",{value:!0});ne.ConnectionOptions=ne.MessageStrategy=ne.CancellationStrategy=ne.CancellationSenderStrategy=ne.CancellationReceiverStrategy=ne.RequestCancellationReceiverStrategy=ne.IdCancellationReceiverStrategy=ne.ConnectionStrategy=ne.ConnectionError=ne.ConnectionErrors=ne.LogTraceNotification=ne.SetTraceNotification=ne.TraceFormat=ne.TraceValues=ne.TraceValue=ne.Trace=ne.NullLogger=ne.ProgressType=ne.ProgressToken=void 0;ne.createMessageConnection=e2;var Ww=QF(Ti()),lt=JF(Ns()),fe=Ag(),qw=kg(),Xc=Ps(),Kg=Kf(),Wc;(function(t){t.type=new fe.NotificationType("$/cancelRequest")})(Wc||(Wc={}));var Zg;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(Zg||(ne.ProgressToken=Zg={}));var jc;(function(t){t.type=new fe.NotificationType("$/progress")})(jc||(jc={}));var Jg=class{constructor(){R(this,"__");R(this,"_pr")}};ne.ProgressType=Jg;var Qg;(function(t){function e(r){return lt.func(r)}t.is=e})(Qg||(Qg={}));ne.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Oe;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Oe||(ne.Trace=Oe={}));var ey;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(ey||(ne.TraceValue=ey={}));ne.TraceValues=ey;(function(t){function e(n){if(!lt.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})(Oe||(ne.Trace=Oe={}));var or;(function(t){t.Text="text",t.JSON="json"})(or||(ne.TraceFormat=or={}));(function(t){function e(r){return lt.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(or||(ne.TraceFormat=or={}));var ty;(function(t){t.type=new fe.NotificationType("$/setTrace")})(ty||(ne.SetTraceNotification=ty={}));var ed;(function(t){t.type=new fe.NotificationType("$/logTrace")})(ed||(ne.LogTraceNotification=ed={}));var zc;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(zc||(ne.ConnectionErrors=zc={}));var Ds=class t extends Error{constructor(r,n){super(n);R(this,"code");this.code=r,Object.setPrototypeOf(this,t.prototype)}};ne.ConnectionError=Ds;var ry;(function(t){function e(r){let n=r;return n&&lt.func(n.cancelUndispatched)}t.is=e})(ry||(ne.ConnectionStrategy=ry={}));var td;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&lt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||lt.func(n.dispose))}t.is=e})(td||(ne.IdCancellationReceiverStrategy=td={}));var ny;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&lt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||lt.func(n.dispose))}t.is=e})(ny||(ne.RequestCancellationReceiverStrategy=ny={}));var rd;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new Kg.CancellationTokenSource}});function e(r){return td.is(r)||ny.is(r)}t.is=e})(rd||(ne.CancellationReceiverStrategy=rd={}));var nd;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(Wc.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&lt.func(n.sendCancellation)&&lt.func(n.cleanup)}t.is=e})(nd||(ne.CancellationSenderStrategy=nd={}));var id;(function(t){t.Message=Object.freeze({receiver:rd.Message,sender:nd.Message});function e(r){let n=r;return n&&rd.is(n.receiver)&&nd.is(n.sender)}t.is=e})(id||(ne.CancellationStrategy=id={}));var od;(function(t){function e(r){let n=r;return n&&lt.func(n.handleMessage)}t.is=e})(od||(ne.MessageStrategy=od={}));var Vw;(function(t){function e(r){let n=r;return n&&(id.is(n.cancellationStrategy)||ry.is(n.connectionStrategy)||od.is(n.messageStrategy)||lt.number(n.maxParallelism))}t.is=e})(Vw||(ne.ConnectionOptions=Vw={}));var Nr;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(Nr||(Nr={}));function e2(t,e,r,n){let i=r!==void 0?r:ne.NullLogger,o=0,s=0,a=0,c="2.0",l=n?.maxParallelism??-1,u=0,f,d=new Map,p,m=new Map,y=new Map,E,_=new qw.LinkedMap,x=new Map,v=new Set,A=new Map,F=Oe.Off,O=or.Text,L,G=Nr.New,X=new Xc.Emitter,oe=new Xc.Emitter,D=new Xc.Emitter,w=new Xc.Emitter,M=new Xc.Emitter,U=n&&n.cancellationStrategy?n.cancellationStrategy:id.Message;function S(T){}function I(){return G===Nr.Listening}function k(){return G===Nr.Closed}function B(){return G===Nr.Disposed}function W(){(G===Nr.New||G===Nr.Listening)&&(G=Nr.Closed,oe.fire(void 0))}function z(T){X.fire([T,void 0,void 0])}function Y(T){X.fire(T)}t.onClose(W),t.onError(z),e.onClose(W),e.onError(Y);function K(T){if(T===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+T.toString()}function ue(T){return T===null?"res-unknown-"+(++a).toString():"res-"+T.toString()}function V(){return"not-"+(++s).toString()}function re(T,P){fe.Message.isRequest(P)?T.set(K(P.id),P):fe.Message.isResponse(P)?l===-1?T.set(ue(P.id),P):Q(P):T.set(V(),P)}function Se(){E||_.size===0||l!==-1&&u>=l||(E=(0,Ww.default)().timer.setImmediate(async()=>{if(E=void 0,_.size===0||l!==-1&&u>=l)return;let T=_.shift(),P;try{u++;let H=n?.messageStrategy;od.is(H)?P=H.handleMessage(T,Ee):P=Ee(T)}catch(H){i.error(`Processing message queue failed: ${H.toString()}`)}finally{P instanceof Promise?P.then(()=>{u--,Se()}).catch(H=>{i.error(`Processing message queue failed: ${H.toString()}`)}):u--,Se()}}))}async function Ee(T){return fe.Message.isRequest(T)?j(T):fe.Message.isNotification(T)?ie(T):fe.Message.isResponse(T)?Q(T):$(T)}let Ce=T=>{try{if(fe.Message.isNotification(T)&&T.method===Wc.type.method){let P=T.params.id,H=K(P),J=_.get(H);if(fe.Message.isRequest(J)){let Be=n?.connectionStrategy,Ae=Be&&Be.cancelUndispatched?Be.cancelUndispatched(J,S):void 0;if(Ae&&(Ae.error!==void 0||Ae.result!==void 0)){_.delete(H),A.delete(P),Ae.id=J.id,at(Ae,T.method,Date.now()),e.write(Ae).catch(()=>i.error("Sending response for canceled message failed."));return}}let xe=A.get(P);if(xe!==void 0){xe.cancel(),er(T);return}else v.add(P)}re(_,T)}finally{Se()}};async function j(T){if(B())return Promise.resolve();function P(Ze,ct,Xe){let Fe={jsonrpc:c,id:T.id};return Ze instanceof fe.ResponseError?Fe.error=Ze.toJson():Fe.result=Ze===void 0?null:Ze,at(Fe,ct,Xe),e.write(Fe)}function H(Ze,ct,Xe){let Fe={jsonrpc:c,id:T.id,error:Ze.toJson()};return at(Fe,ct,Xe),e.write(Fe)}q(T);let J=d.get(T.method),xe,Be;J&&(xe=J.type,Be=J.handler);let Ae=Date.now();if(Be||f){let Ze=T.id??String(Date.now()),ct=td.is(U.receiver)?U.receiver.createCancellationTokenSource(Ze):U.receiver.createCancellationTokenSource(T);T.id!==null&&v.has(T.id)&&ct.cancel(),T.id!==null&&A.set(Ze,ct);try{let Xe;if(Be)if(T.params===void 0){if(xe!==void 0&&xe.numberOfParams!==0)return H(new fe.ResponseError(fe.ErrorCodes.InvalidParams,`Request ${T.method} defines ${xe.numberOfParams} params but received none.`),T.method,Ae);Xe=Be(ct.token)}else if(Array.isArray(T.params)){if(xe!==void 0&&xe.parameterStructures===fe.ParameterStructures.byName)return H(new fe.ResponseError(fe.ErrorCodes.InvalidParams,`Request ${T.method} defines parameters by name but received parameters by position`),T.method,Ae);Xe=Be(...T.params,ct.token)}else{if(xe!==void 0&&xe.parameterStructures===fe.ParameterStructures.byPosition)return H(new fe.ResponseError(fe.ErrorCodes.InvalidParams,`Request ${T.method} defines parameters by position but received parameters by name`),T.method,Ae);Xe=Be(T.params,ct.token)}else f&&(Xe=f(T.method,T.params,ct.token));let Fe=await Xe;await P(Fe,T.method,Ae)}catch(Xe){Xe instanceof fe.ResponseError?await P(Xe,T.method,Ae):Xe&&lt.string(Xe.message)?await H(new fe.ResponseError(fe.ErrorCodes.InternalError,`Request ${T.method} failed with message: ${Xe.message}`),T.method,Ae):await H(new fe.ResponseError(fe.ErrorCodes.InternalError,`Request ${T.method} failed unexpectedly without providing any details.`),T.method,Ae)}finally{A.delete(Ze)}}else await H(new fe.ResponseError(fe.ErrorCodes.MethodNotFound,`Unhandled method ${T.method}`),T.method,Ae)}function Q(T){if(!B())if(T.id===null)T.error?i.error(`Received response message without id: Error is:
7
+ ${JSON.stringify(T.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let P=T.id,H=x.get(P);if(Bi(T,H),H!==void 0){x.delete(P);try{if(T.error){let J=T.error;H.reject(new fe.ResponseError(J.code,J.message,J.data))}else if(T.result!==void 0)H.resolve(T.result);else throw new Error("Should never happen.")}catch(J){J.message?i.error(`Response handler '${H.method}' failed with message: ${J.message}`):i.error(`Response handler '${H.method}' failed unexpectedly.`)}}}}async function ie(T){if(B())return;let P,H;if(T.method===Wc.type.method){let J=T.params.id;v.delete(J),er(T);return}else{let J=m.get(T.method);J&&(H=J.handler,P=J.type)}if(H||p)try{if(er(T),H)if(T.params===void 0)P!==void 0&&P.numberOfParams!==0&&P.parameterStructures!==fe.ParameterStructures.byName&&i.error(`Notification ${T.method} defines ${P.numberOfParams} params but received none.`),await H();else if(Array.isArray(T.params)){let J=T.params;T.method===jc.type.method&&J.length===2&&Zg.is(J[0])?await H({token:J[0],value:J[1]}):(P!==void 0&&(P.parameterStructures===fe.ParameterStructures.byName&&i.error(`Notification ${T.method} defines parameters by name but received parameters by position`),P.numberOfParams!==T.params.length&&i.error(`Notification ${T.method} defines ${P.numberOfParams} params but received ${J.length} arguments`)),await H(...J))}else P!==void 0&&P.parameterStructures===fe.ParameterStructures.byPosition&&i.error(`Notification ${T.method} defines parameters by position but received parameters by name`),await H(T.params);else p&&await p(T.method,T.params)}catch(J){J.message?i.error(`Notification handler '${T.method}' failed with message: ${J.message}`):i.error(`Notification handler '${T.method}' failed unexpectedly.`)}else D.fire(T)}function $(T){if(!T){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
8
+ ${JSON.stringify(T,null,4)}`);let P=T;if(lt.string(P.id)||lt.number(P.id)){let H=P.id,J=x.get(H);J&&J.reject(new Error("The received response has neither a result nor an error property."))}}function ge(T){if(T!=null)switch(F){case Oe.Verbose:return JSON.stringify(T,null,4);case Oe.Compact:return JSON.stringify(T);default:return}}function de(T){if(!(F===Oe.Off||!L))if(O===or.Text){let P;(F===Oe.Verbose||F===Oe.Compact)&&T.params&&(P=`Params: ${ge(T.params)}`),L.log(`Sending request '${T.method} - (${T.id})'.`,P)}else ur("send-request",T)}function ke(T){if(!(F===Oe.Off||!L))if(O===or.Text){let P;(F===Oe.Verbose||F===Oe.Compact)&&(T.params?P=`Params: ${ge(T.params)}`:P="No parameters provided."),L.log(`Sending notification '${T.method}'.`,P)}else ur("send-notification",T)}function at(T,P,H){if(!(F===Oe.Off||!L))if(O===or.Text){let J;(F===Oe.Verbose||F===Oe.Compact)&&(T.error&&T.error.data?J=`Error data: ${ge(T.error.data)}`:T.result?J=`Result: ${ge(T.result)}`:T.error===void 0&&(J="No result returned."));let xe=T.error?` Request failed: ${T.error.message} (${T.error.code}).`:"";L.log(`Sending response '${P} - (${T.id})'. Processing request took ${Date.now()-H}ms.${xe}`,J)}else ur("send-response",T)}function q(T){if(!(F===Oe.Off||!L))if(O===or.Text){let P;(F===Oe.Verbose||F===Oe.Compact)&&T.params&&(P=`Params: ${ge(T.params)}`),L.log(`Received request '${T.method} - (${T.id})'.`,P)}else ur("receive-request",T)}function er(T){if(!(F===Oe.Off||!L||T.method===ed.type.method))if(O===or.Text){let P;(F===Oe.Verbose||F===Oe.Compact)&&(T.params?P=`Params: ${ge(T.params)}`:P="No parameters provided."),L.log(`Received notification '${T.method}'.`,P)}else ur("receive-notification",T)}function Bi(T,P){if(!(F===Oe.Off||!L))if(O===or.Text){let H;if((F===Oe.Verbose||F===Oe.Compact)&&(T.error&&T.error.data?H=`Error data: ${ge(T.error.data)}`:T.result?H=`Result: ${ge(T.result)}`:T.error===void 0&&(H="No result returned.")),P){let J=T.error?` Request failed: ${T.error.message} (${T.error.code}).`:"";L.log(`Received response '${P.method} - (${T.id})' in ${Date.now()-P.timerStart}ms.${J}`,H)}else L.log(`Received response ${T.id} without active response promise.`,H)}else ur("receive-response",T)}function ur(T,P){if(!L||F===Oe.Off)return;let H={isLSPMessage:!0,type:T,message:P,timestamp:Date.now()};L.log(H)}function jr(){if(k())throw new Ds(zc.Closed,"Connection is closed.");if(B())throw new Ds(zc.Disposed,"Connection is disposed.")}function ye(){if(I())throw new Ds(zc.AlreadyListening,"Connection is already listening")}function Gi(){if(!I())throw new Error("Call listen() first.")}function zr(T){return T===void 0?null:T}function dn(T){if(T!==null)return T}function Er(T){return T!=null&&!Array.isArray(T)&&typeof T=="object"}function Nt(T,P){switch(T){case fe.ParameterStructures.auto:return Er(P)?dn(P):[zr(P)];case fe.ParameterStructures.byName:if(!Er(P))throw new Error("Received parameters by name but param is not an object literal.");return dn(P);case fe.ParameterStructures.byPosition:return[zr(P)];default:throw new Error(`Unknown parameter structure ${T.toString()}`)}}function $t(T,P){let H,J=T.numberOfParams;switch(J){case 0:H=void 0;break;case 1:H=Nt(T.parameterStructures,P[0]);break;default:H=[];for(let xe=0;xe<P.length&&xe<J;xe++)H.push(zr(P[xe]));if(P.length<J)for(let xe=P.length;xe<J;xe++)H.push(null);break}return H}let fr={sendNotification:(T,...P)=>{jr();let H,J;if(lt.string(T)){H=T;let Be=P[0],Ae=0,Ze=fe.ParameterStructures.auto;fe.ParameterStructures.is(Be)&&(Ae=1,Ze=Be);let ct=P.length,Xe=ct-Ae;switch(Xe){case 0:J=void 0;break;case 1:J=Nt(Ze,P[Ae]);break;default:if(Ze===fe.ParameterStructures.byName)throw new Error(`Received ${Xe} parameters for 'by Name' notification parameter structure.`);J=P.slice(Ae,ct).map(Fe=>zr(Fe));break}}else{let Be=P;H=T.method,J=$t(T,Be)}let xe={jsonrpc:c,method:H,params:J};return ke(xe),e.write(xe).catch(Be=>{throw i.error("Sending notification failed."),Be})},onNotification:(T,P)=>{jr();let H;return lt.func(T)?p=T:P&&(lt.string(T)?(H=T,m.set(T,{type:void 0,handler:P})):(H=T.method,m.set(T.method,{type:T,handler:P}))),{dispose:()=>{H!==void 0?m.get(H)?.handler===P&&m.delete(H):p===T&&(p=void 0)}}},onProgress:(T,P,H)=>{if(y.has(P))throw new Error(`Progress handler for token ${P} already registered`);return y.set(P,H),{dispose:()=>{y.get(P)===H&&y.delete(P)}}},sendProgress:(T,P,H)=>fr.sendNotification(jc.type,{token:P,value:H}),onUnhandledProgress:w.event,sendRequest:(T,...P)=>{jr(),Gi();function H(Fe,yt){let tr=U.sender.sendCancellation(Fe,yt);tr===void 0?i.log(`Received no promise from cancellation strategy when cancelling id ${yt}`):tr.catch(()=>{i.log(`Sending cancellation messages for id ${yt} failed.`)})}let J,xe,Be;if(lt.string(T)){J=T;let Fe=P[0],yt=P[P.length-1],tr=0,Wr=fe.ParameterStructures.auto;fe.ParameterStructures.is(Fe)&&(tr=1,Wr=Fe);let dr=P.length;Kg.CancellationToken.is(yt)&&(dr=dr-1,Be=yt);let nt=dr-tr;switch(nt){case 0:xe=void 0;break;case 1:xe=Nt(Wr,P[tr]);break;default:if(Wr===fe.ParameterStructures.byName)throw new Error(`Received ${nt} parameters for 'by Name' request parameter structure.`);xe=P.slice(tr,dr).map(pr=>zr(pr));break}}else{let Fe=P;J=T.method,xe=$t(T,Fe);let yt=T.numberOfParams;Be=Kg.CancellationToken.is(Fe[yt])?Fe[yt]:void 0}let Ae=o++,Ze,ct=!1;Be!==void 0&&(Be.isCancellationRequested?ct=!0:Ze=Be.onCancellationRequested(()=>{H(fr,Ae)}));let Xe={jsonrpc:c,id:Ae,method:J,params:xe};return de(Xe),typeof U.sender.enableCancellation=="function"&&U.sender.enableCancellation(Xe),new Promise(async(Fe,yt)=>{let tr=nt=>{Fe(nt),U.sender.cleanup(Ae),Ze?.dispose()},Wr=nt=>{yt(nt),U.sender.cleanup(Ae),Ze?.dispose()},dr={method:J,timerStart:Date.now(),resolve:tr,reject:Wr};try{x.set(Ae,dr),await e.write(Xe),ct&&H(fr,Ae)}catch(nt){x.delete(Ae),dr.reject(new fe.ResponseError(fe.ErrorCodes.MessageWriteError,nt.message?nt.message:"Unknown reason")),i.error("Sending request failed.")}})},onRequest:(T,P)=>{jr();let H=null;return Qg.is(T)?(H=void 0,f=T):lt.string(T)?(H=null,P!==void 0&&(H=T,d.set(T,{handler:P,type:void 0}))):P!==void 0&&(H=T.method,d.set(T.method,{type:T,handler:P})),{dispose:()=>{H!==null&&(H!==void 0?d.get(H)?.handler===P&&d.delete(H):f===T&&(f=void 0))}}},hasPendingResponse:()=>x.size>0,trace:async(T,P,H)=>{let J=!1,xe=or.Text;H!==void 0&&(lt.boolean(H)?J=H:(J=H.sendNotification||!1,xe=H.traceFormat||or.Text)),F=T,O=xe,F===Oe.Off?L=void 0:L=P,J&&!k()&&!B()&&await fr.sendNotification(ty.type,{value:Oe.toString(T)})},onError:X.event,onClose:oe.event,onUnhandledNotification:D.event,onDispose:M.event,end:()=>{e.end()},dispose:()=>{if(B())return;G=Nr.Disposed,M.fire(void 0);let T=new fe.ResponseError(fe.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let P of x.values())P.reject(T);x=new Map,A=new Map,v=new Set,_=new qw.LinkedMap,lt.func(e.dispose)&&e.dispose(),lt.func(t.dispose)&&t.dispose()},listen:()=>{jr(),ye(),G=Nr.Listening,t.listen(Ce)},inspect:()=>{(0,Ww.default)().console.log("inspect")}};return fr.onNotification(ed.type,T=>{if(F===Oe.Off||!L)return;let P=F===Oe.Verbose||F===Oe.Compact;L.log(T.message,P?T.verbose:void 0)}),fr.onNotification(jc.type,async T=>{let P=y.get(T.token);P?await P(T.value):w.fire(T)}),fr}});var Ms=pe(N=>{"use strict";var t2=N&&N.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};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.RequestCancellationReceiverStrategy=N.IdCancellationReceiverStrategy=N.CancellationReceiverStrategy=N.ConnectionError=N.ConnectionErrors=N.LogTraceNotification=N.SetTraceNotification=N.TraceFormat=N.TraceValues=N.TraceValue=N.Trace=void 0;var Ke=Ag();Object.defineProperty(N,"Message",{enumerable:!0,get:function(){return Ke.Message}});Object.defineProperty(N,"RequestType",{enumerable:!0,get:function(){return Ke.RequestType}});Object.defineProperty(N,"RequestType0",{enumerable:!0,get:function(){return Ke.RequestType0}});Object.defineProperty(N,"RequestType1",{enumerable:!0,get:function(){return Ke.RequestType1}});Object.defineProperty(N,"RequestType2",{enumerable:!0,get:function(){return Ke.RequestType2}});Object.defineProperty(N,"RequestType3",{enumerable:!0,get:function(){return Ke.RequestType3}});Object.defineProperty(N,"RequestType4",{enumerable:!0,get:function(){return Ke.RequestType4}});Object.defineProperty(N,"RequestType5",{enumerable:!0,get:function(){return Ke.RequestType5}});Object.defineProperty(N,"RequestType6",{enumerable:!0,get:function(){return Ke.RequestType6}});Object.defineProperty(N,"RequestType7",{enumerable:!0,get:function(){return Ke.RequestType7}});Object.defineProperty(N,"RequestType8",{enumerable:!0,get:function(){return Ke.RequestType8}});Object.defineProperty(N,"RequestType9",{enumerable:!0,get:function(){return Ke.RequestType9}});Object.defineProperty(N,"ResponseError",{enumerable:!0,get:function(){return Ke.ResponseError}});Object.defineProperty(N,"ErrorCodes",{enumerable:!0,get:function(){return Ke.ErrorCodes}});Object.defineProperty(N,"NotificationType",{enumerable:!0,get:function(){return Ke.NotificationType}});Object.defineProperty(N,"NotificationType0",{enumerable:!0,get:function(){return Ke.NotificationType0}});Object.defineProperty(N,"NotificationType1",{enumerable:!0,get:function(){return Ke.NotificationType1}});Object.defineProperty(N,"NotificationType2",{enumerable:!0,get:function(){return Ke.NotificationType2}});Object.defineProperty(N,"NotificationType3",{enumerable:!0,get:function(){return Ke.NotificationType3}});Object.defineProperty(N,"NotificationType4",{enumerable:!0,get:function(){return Ke.NotificationType4}});Object.defineProperty(N,"NotificationType5",{enumerable:!0,get:function(){return Ke.NotificationType5}});Object.defineProperty(N,"NotificationType6",{enumerable:!0,get:function(){return Ke.NotificationType6}});Object.defineProperty(N,"NotificationType7",{enumerable:!0,get:function(){return Ke.NotificationType7}});Object.defineProperty(N,"NotificationType8",{enumerable:!0,get:function(){return Ke.NotificationType8}});Object.defineProperty(N,"NotificationType9",{enumerable:!0,get:function(){return Ke.NotificationType9}});Object.defineProperty(N,"ParameterStructures",{enumerable:!0,get:function(){return Ke.ParameterStructures}});var iy=kg();Object.defineProperty(N,"LinkedMap",{enumerable:!0,get:function(){return iy.LinkedMap}});Object.defineProperty(N,"LRUCache",{enumerable:!0,get:function(){return iy.LRUCache}});Object.defineProperty(N,"Touch",{enumerable:!0,get:function(){return iy.Touch}});var r2=Dw();Object.defineProperty(N,"Disposable",{enumerable:!0,get:function(){return r2.Disposable}});var Kw=Ps();Object.defineProperty(N,"Event",{enumerable:!0,get:function(){return Kw.Event}});Object.defineProperty(N,"Emitter",{enumerable:!0,get:function(){return Kw.Emitter}});var Zw=Kf();Object.defineProperty(N,"CancellationTokenSource",{enumerable:!0,get:function(){return Zw.CancellationTokenSource}});Object.defineProperty(N,"CancellationToken",{enumerable:!0,get:function(){return Zw.CancellationToken}});var Jw=$w();Object.defineProperty(N,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return Jw.SharedArraySenderStrategy}});Object.defineProperty(N,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return Jw.SharedArrayReceiverStrategy}});var oy=Uw();Object.defineProperty(N,"MessageReader",{enumerable:!0,get:function(){return oy.MessageReader}});Object.defineProperty(N,"AbstractMessageReader",{enumerable:!0,get:function(){return oy.AbstractMessageReader}});Object.defineProperty(N,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return oy.ReadableStreamMessageReader}});var sy=jw();Object.defineProperty(N,"MessageWriter",{enumerable:!0,get:function(){return sy.MessageWriter}});Object.defineProperty(N,"AbstractMessageWriter",{enumerable:!0,get:function(){return sy.AbstractMessageWriter}});Object.defineProperty(N,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return sy.WriteableStreamMessageWriter}});var n2=zw();Object.defineProperty(N,"AbstractMessageBuffer",{enumerable:!0,get:function(){return n2.AbstractMessageBuffer}});var Tt=Yw();Object.defineProperty(N,"ConnectionStrategy",{enumerable:!0,get:function(){return Tt.ConnectionStrategy}});Object.defineProperty(N,"ConnectionOptions",{enumerable:!0,get:function(){return Tt.ConnectionOptions}});Object.defineProperty(N,"NullLogger",{enumerable:!0,get:function(){return Tt.NullLogger}});Object.defineProperty(N,"createMessageConnection",{enumerable:!0,get:function(){return Tt.createMessageConnection}});Object.defineProperty(N,"ProgressToken",{enumerable:!0,get:function(){return Tt.ProgressToken}});Object.defineProperty(N,"ProgressType",{enumerable:!0,get:function(){return Tt.ProgressType}});Object.defineProperty(N,"Trace",{enumerable:!0,get:function(){return Tt.Trace}});Object.defineProperty(N,"TraceValue",{enumerable:!0,get:function(){return Tt.TraceValue}});Object.defineProperty(N,"TraceFormat",{enumerable:!0,get:function(){return Tt.TraceFormat}});Object.defineProperty(N,"SetTraceNotification",{enumerable:!0,get:function(){return Tt.SetTraceNotification}});Object.defineProperty(N,"LogTraceNotification",{enumerable:!0,get:function(){return Tt.LogTraceNotification}});Object.defineProperty(N,"ConnectionErrors",{enumerable:!0,get:function(){return Tt.ConnectionErrors}});Object.defineProperty(N,"ConnectionError",{enumerable:!0,get:function(){return Tt.ConnectionError}});Object.defineProperty(N,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Tt.CancellationReceiverStrategy}});Object.defineProperty(N,"IdCancellationReceiverStrategy",{enumerable:!0,get:function(){return Tt.IdCancellationReceiverStrategy}});Object.defineProperty(N,"RequestCancellationReceiverStrategy",{enumerable:!0,get:function(){return Tt.RequestCancellationReceiverStrategy}});Object.defineProperty(N,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Tt.CancellationSenderStrategy}});Object.defineProperty(N,"CancellationStrategy",{enumerable:!0,get:function(){return Tt.CancellationStrategy}});Object.defineProperty(N,"MessageStrategy",{enumerable:!0,get:function(){return Tt.MessageStrategy}});Object.defineProperty(N,"TraceValues",{enumerable:!0,get:function(){return Tt.TraceValues}});var i2=t2(Ti());N.RAL=i2.default});var gd={};nu(gd,{AnnotatedTextEdit:()=>kn,ApplyKind:()=>Iy,ChangeAnnotation:()=>Ei,ChangeAnnotationIdentifier:()=>wt,CodeAction:()=>jy,CodeActionContext:()=>Xy,CodeActionKind:()=>Hy,CodeActionTag:()=>dd,CodeActionTriggerKind:()=>Qc,CodeDescription:()=>gy,CodeLens:()=>zy,Color:()=>ad,ColorInformation:()=>uy,ColorPresentation:()=>fy,Command:()=>go,CompletionItem:()=>Ny,CompletionItemKind:()=>by,CompletionItemLabelDetails:()=>ky,CompletionItemTag:()=>Ry,CompletionList:()=>Py,CreateFile:()=>Fs,DeleteFile:()=>Bs,Diagnostic:()=>Yc,DiagnosticRelatedInformation:()=>cd,DiagnosticSeverity:()=>hy,DiagnosticTag:()=>my,DocumentHighlight:()=>My,DocumentHighlightKind:()=>Dy,DocumentLink:()=>qy,DocumentSymbol:()=>Gy,DocumentUri:()=>ay,EOL:()=>o2,FoldingRange:()=>py,FoldingRangeKind:()=>dy,FormattingOptions:()=>Wy,Hover:()=>Cy,InlayHint:()=>rx,InlayHintKind:()=>pd,InlayHintLabelPart:()=>hd,InlineCompletionContext:()=>ax,InlineCompletionItem:()=>nx,InlineCompletionList:()=>ix,InlineCompletionTriggerKind:()=>ox,InlineValueContext:()=>tx,InlineValueEvaluatableExpression:()=>ex,InlineValueText:()=>Jy,InlineValueVariableLookup:()=>Qy,InsertReplaceEdit:()=>Sy,InsertTextFormat:()=>wy,InsertTextMode:()=>Ay,LanguageKind:()=>Ey,Location:()=>Vc,LocationLink:()=>ly,MarkedString:()=>Jc,MarkupContent:()=>vi,MarkupKind:()=>fd,OptionalVersionedTextDocumentIdentifier:()=>Zc,ParameterInformation:()=>Oy,Position:()=>$e,Range:()=>Te,RenameFile:()=>Us,SelectedCompletionInfo:()=>sx,SelectionRange:()=>Vy,SemanticTokenModifiers:()=>Ky,SemanticTokenTypes:()=>Yy,SemanticTokens:()=>Zy,SignatureInformation:()=>Ly,SnippetTextEdit:()=>yy,StringValue:()=>md,SymbolInformation:()=>Uy,SymbolKind:()=>$y,SymbolTag:()=>Fy,TextDocument:()=>lx,TextDocumentEdit:()=>Kc,TextDocumentIdentifier:()=>Ty,TextDocumentItem:()=>vy,TextEdit:()=>rn,URI:()=>sd,VersionedTextDocumentIdentifier:()=>_y,WorkspaceChange:()=>xy,WorkspaceEdit:()=>ld,WorkspaceFolder:()=>cx,WorkspaceSymbol:()=>By,integer:()=>cy,uinteger:()=>qc});var ay,sd,cy,qc,$e,Te,Vc,ly,ad,uy,fy,dy,py,cd,hy,my,gy,Yc,go,rn,Ei,wt,kn,Kc,Fs,Us,Bs,ld,$s,yy,ud,xy,Ty,_y,Zc,Ey,vy,fd,vi,by,wy,Ry,Sy,Ay,Iy,ky,Ny,Py,Jc,Cy,Oy,Ly,Dy,My,$y,Fy,Uy,By,Gy,Hy,Qc,Xy,dd,jy,zy,Wy,qy,Vy,Yy,Ky,Zy,Jy,Qy,ex,tx,pd,hd,rx,md,nx,ix,ox,sx,ax,cx,o2,lx,ux,b,el=tE(()=>{"use strict";(function(t){function e(r){return typeof r=="string"}t.is=e})(ay||(ay={}));(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})(cy||(cy={}));(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})(qc||(qc={}));(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=qc.MAX_VALUE),i===Number.MAX_VALUE&&(i=qc.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})($e||($e={}));(function(t){function e(n,i,o,s){if(b.uinteger(n)&&b.uinteger(i)&&b.uinteger(o)&&b.uinteger(s))return{start:$e.create(n,i),end:$e.create(o,s)};if($e.is(n)&&$e.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)&&$e.is(i.start)&&$e.is(i.end)}t.is=r})(Te||(Te={}));(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return b.objectLiteral(i)&&Te.is(i.range)&&(b.string(i.uri)||b.undefined(i.uri))}t.is=r})(Vc||(Vc={}));(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)&&Te.is(i.targetRange)&&b.string(i.targetUri)&&Te.is(i.targetSelectionRange)&&(Te.is(i.originSelectionRange)||b.undefined(i.originSelectionRange))}t.is=r})(ly||(ly={}));(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})(ad||(ad={}));(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){let i=n;return b.objectLiteral(i)&&Te.is(i.range)&&ad.is(i.color)}t.is=r})(uy||(uy={}));(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)||rn.is(i))&&(b.undefined(i.additionalTextEdits)||b.typedArray(i.additionalTextEdits,rn.is))}t.is=r})(fy||(fy={}));(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(dy||(dy={}));(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})(py||(py={}));(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return b.defined(i)&&Vc.is(i.location)&&b.string(i.message)}t.is=r})(cd||(cd={}));(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(hy||(hy={}));(function(t){t.Unnecessary=1,t.Deprecated=2})(my||(my={}));(function(t){function e(r){let n=r;return b.objectLiteral(n)&&b.string(n.href)}t.is=e})(gy||(gy={}));(function(t){function e(o,s,a,c,l,u){let f={range:o,message:s};return b.defined(a)&&(f.severity=a),b.defined(c)&&(f.code=c),b.defined(l)&&(f.source=l),b.defined(u)&&(f.relatedInformation=u),f}t.create=e;function r(o){var s;let a=o;return b.defined(a)&&Te.is(a.range)&&(b.string(a.message)||vi.is(a.message))&&(b.number(a.severity)||b.undefined(a.severity))&&(b.integer(a.code)||b.string(a.code)||b.undefined(a.code))&&(b.undefined(a.codeDescription)||b.string((s=a.codeDescription)===null||s===void 0?void 0:s.href))&&(b.string(a.source)||b.undefined(a.source))&&(b.undefined(a.relatedInformation)||b.typedArray(a.relatedInformation,cd.is))}t.is=r;function n(o){return b.string(o.message)}t.is3_17=n;function i(o){if(b.string(o.message))return o.message;if(vi.is(o.message))return o.message.value;throw new Error(`Unknown message type ${typeof o.message}`)}t.getMessageString=i})(Yc||(Yc={}));(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)&&(i.tooltip===void 0||b.string(i.tooltip))&&b.string(i.command)}t.is=r})(go||(go={}));(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)&&Te.is(s.range)}t.is=i})(rn||(rn={}));(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})(Ei||(Ei={}));(function(t){function e(r){let n=r;return b.string(n)}t.is=e})(wt||(wt={}));(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 rn.is(s)&&(Ei.is(s.annotationId)||wt.is(s.annotationId))}t.is=i})(kn||(kn={}));(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return b.defined(i)&&Zc.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(Kc||(Kc={}));(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||wt.is(i.annotationId))}t.is=r})(Fs||(Fs={}));(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||wt.is(i.annotationId))}t.is=r})(Us||(Us={}));(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||wt.is(i.annotationId))}t.is=r})(Bs||(Bs={}));(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)?Fs.is(i)||Us.is(i)||Bs.is(i):Kc.is(i)))}t.is=e})(ld||(ld={}));$s=class{constructor(e,r){this.edits=e,this.changeAnnotations=r}insert(e,r,n){let i,o;if(n===void 0?i=rn.insert(e,r):wt.is(n)?(o=n,i=kn.insert(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),i=kn.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=rn.replace(e,r):wt.is(n)?(o=n,i=kn.replace(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),i=kn.replace(e,r,o)),this.edits.push(i),o!==void 0)return o}delete(e,r){let n,i;if(r===void 0?n=rn.del(e):wt.is(r)?(i=r,n=kn.del(e,r)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(r),n=kn.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.")}};(function(t){function e(r){let n=r;return b.objectLiteral(n)&&Te.is(n.range)&&md.isSnippet(n.snippet)&&(n.annotationId===void 0||Ei.is(n.annotationId)||wt.is(n.annotationId))}t.is=e})(yy||(yy={}));ud=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(wt.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()}},xy=class{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new ud(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(r=>{if(Kc.is(r)){let n=new $s(r.edits,this._changeAnnotations);this._textEditChanges[r.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(r=>{let n=new $s(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(Zc.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 $s(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 $s(n),this._textEditChanges[e]=r}return r}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new ud,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;Ei.is(r)||wt.is(r)?i=r:n=r;let o,s;if(i===void 0?o=Fs.create(e,n):(s=wt.is(i)?i:this._changeAnnotations.manage(i),o=Fs.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;Ei.is(n)||wt.is(n)?o=n:i=n;let s,a;if(o===void 0?s=Us.create(e,r,i):(a=wt.is(o)?o:this._changeAnnotations.manage(o),s=Us.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;Ei.is(r)||wt.is(r)?i=r:n=r;let o,s;if(i===void 0?o=Bs.create(e,n):(s=wt.is(i)?i:this._changeAnnotations.manage(i),o=Bs.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})(Ty||(Ty={}));(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})(_y||(_y={}));(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})(Zc||(Zc={}));(function(t){t.ABAP="abap",t.WindowsBat="bat",t.BibTeX="bibtex",t.Clojure="clojure",t.Coffeescript="coffeescript",t.C="c",t.CPP="cpp",t.CSharp="csharp",t.CSS="css",t.D="d",t.Delphi="pascal",t.Diff="diff",t.Dart="dart",t.Dockerfile="dockerfile",t.Elixir="elixir",t.Erlang="erlang",t.FSharp="fsharp",t.GitCommit="git-commit",t.GitRebase="git-rebase",t.Go="go",t.Groovy="groovy",t.Handlebars="handlebars",t.Haskell="haskell",t.HTML="html",t.Ini="ini",t.Java="java",t.JavaScript="javascript",t.JavaScriptReact="javascriptreact",t.JSON="json",t.LaTeX="latex",t.Less="less",t.Lua="lua",t.Makefile="makefile",t.Markdown="markdown",t.ObjectiveC="objective-c",t.ObjectiveCPP="objective-cpp",t.Pascal="pascal",t.Perl="perl",t.Perl6="perl6",t.PHP="php",t.Plaintext="plaintext",t.Powershell="powershell",t.Pug="jade",t.Python="python",t.R="r",t.Razor="razor",t.Ruby="ruby",t.Rust="rust",t.SCSS="scss",t.SASS="sass",t.Scala="scala",t.ShaderLab="shaderlab",t.ShellScript="shellscript",t.SQL="sql",t.Swift="swift",t.TypeScript="typescript",t.TypeScriptReact="typescriptreact",t.TeX="tex",t.VisualBasic="vb",t.XML="xml",t.XSL="xsl",t.YAML="yaml"})(Ey||(Ey={}));(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})(vy||(vy={}));(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){let n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(fd||(fd={}));(function(t){function e(r){let n=r;return b.objectLiteral(r)&&fd.is(n.kind)&&b.string(n.value)}t.is=e})(vi||(vi={}));(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})(by||(by={}));(function(t){t.PlainText=1,t.Snippet=2})(wy||(wy={}));(function(t){t.Deprecated=1})(Ry||(Ry={}));(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)&&Te.is(i.insert)&&Te.is(i.replace)}t.is=r})(Sy||(Sy={}));(function(t){t.asIs=1,t.adjustIndentation=2})(Ay||(Ay={}));(function(t){t.Replace=1,t.Merge=2})(Iy||(Iy={}));(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})(ky||(ky={}));(function(t){function e(r){return{label:r}}t.create=e})(Ny||(Ny={}));(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(Py||(Py={}));(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})(Jc||(Jc={}));(function(t){function e(r){let n=r;return!!n&&b.objectLiteral(n)&&(vi.is(n.contents)||Jc.is(n.contents)||b.typedArray(n.contents,Jc.is))&&(r.range===void 0||Te.is(r.range))}t.is=e})(Cy||(Cy={}));(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(Oy||(Oy={}));(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})(Ly||(Ly={}));(function(t){t.Text=1,t.Read=2,t.Write=3})(Dy||(Dy={}));(function(t){function e(r,n){let i={range:r};return b.number(n)&&(i.kind=n),i}t.create=e})(My||(My={}));(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})($y||($y={}));(function(t){t.Deprecated=1})(Fy||(Fy={}));(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})(Uy||(Uy={}));(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})(By||(By={}));(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)&&Te.is(i.range)&&Te.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})(Gy||(Gy={}));(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorMove="refactor.move",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll",t.Notebook="notebook"})(Hy||(Hy={}));(function(t){t.Invoked=1,t.Automatic=2})(Qc||(Qc={}));(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,Yc.is)&&(i.only===void 0||b.typedArray(i.only,b.string))&&(i.triggerKind===void 0||i.triggerKind===Qc.Invoked||i.triggerKind===Qc.Automatic)}t.is=r})(Xy||(Xy={}));(function(t){t.LLMGenerated=1;function e(r){return b.defined(r)&&r===t.LLMGenerated}t.is=e})(dd||(dd={}));(function(t){function e(n,i,o){let s={title:n},a=!0;return typeof i=="string"?(a=!1,s.kind=i):go.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,Yc.is))&&(i.kind===void 0||b.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||go.is(i.command))&&(i.isPreferred===void 0||b.boolean(i.isPreferred))&&(i.edit===void 0||ld.is(i.edit))&&(i.tags===void 0||b.typedArray(i.tags,dd.is))}t.is=r})(jy||(jy={}));(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)&&Te.is(i.range)&&(b.undefined(i.command)||go.is(i.command))}t.is=r})(zy||(zy={}));(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})(Wy||(Wy={}));(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)&&Te.is(i.range)&&(b.undefined(i.target)||b.string(i.target))}t.is=r})(qy||(qy={}));(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return b.objectLiteral(i)&&Te.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(Vy||(Vy={}));(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",t.label="label"})(Yy||(Yy={}));(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"})(Ky||(Ky={}));(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})(Zy||(Zy={}));(function(t){function e(n,i){return{range:n,text:i}}t.create=e;function r(n){let i=n;return i!=null&&Te.is(i.range)&&b.string(i.text)}t.is=r})(Jy||(Jy={}));(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&&Te.is(i.range)&&b.boolean(i.caseSensitiveLookup)&&(b.string(i.variableName)||i.variableName===void 0)}t.is=r})(Qy||(Qy={}));(function(t){function e(n,i){return{range:n,expression:i}}t.create=e;function r(n){let i=n;return i!=null&&Te.is(i.range)&&(b.string(i.expression)||i.expression===void 0)}t.is=r})(ex||(ex={}));(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){let i=n;return b.defined(i)&&Te.is(n.stoppedLocation)}t.is=r})(tx||(tx={}));(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(pd||(pd={}));(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)||vi.is(i.tooltip))&&(i.location===void 0||Vc.is(i.location))&&(i.command===void 0||go.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 b.objectLiteral(i)&&$e.is(i.position)&&(b.string(i.label)||b.typedArray(i.label,hd.is))&&(i.kind===void 0||pd.is(i.kind))&&i.textEdits===void 0||b.typedArray(i.textEdits,rn.is)&&(i.tooltip===void 0||b.string(i.tooltip)||vi.is(i.tooltip))&&(i.paddingLeft===void 0||b.boolean(i.paddingLeft))&&(i.paddingRight===void 0||b.boolean(i.paddingRight))}t.is=r})(rx||(rx={}));(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e;function r(n){let i=n;return b.objectLiteral(i)&&i.kind==="snippet"&&b.string(i.value)}t.isSnippet=r})(md||(md={}));(function(t){function e(r,n,i,o){return{insertText:r,filterText:n,range:i,command:o}}t.create=e})(nx||(nx={}));(function(t){function e(r){return{items:r}}t.create=e})(ix||(ix={}));(function(t){t.Invoked=1,t.Automatic=2})(ox||(ox={}));(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(sx||(sx={}));(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(ax||(ax={}));(function(t){function e(r){let n=r;return b.objectLiteral(n)&&sd.is(n.uri)&&b.string(n.name)}t.is=e})(cx||(cx={}));o2=[`
3
9
  `,`\r
4
- `,"\r"];(function(t){function e(o,s,a,c){return new Kg(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}})(Yg||(Yg={}));Kg=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===`
10
+ `,"\r"];(function(t){function e(o,s,a,c){return new ux(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}})(lx||(lx={}));ux=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
11
  `,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 Ie.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 Ie.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 Ls=he(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.boolean=fF;kn.string=Sw;kn.number=dF;kn.error=pF;kn.func=hF;kn.array=Aw;kn.stringArray=mF;function fF(t){return t===!0||t===!1}function Sw(t){return typeof t=="string"||t instanceof String}function dF(t){return typeof t=="number"||t instanceof Number}function pF(t){return t instanceof Error}function hF(t){return typeof t=="function"}function Aw(t){return Array.isArray(t)}function mF(t){return Aw(t)&&t.every(e=>Sw(e))}});var Iy=he(te=>{"use strict";var gF=te&&te.__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]})),yF=te&&te.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),xF=te&&te.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&gF(r,e,n[i]);return yF(r,e),r}})();Object.defineProperty(te,"__esModule",{value:!0});te.Message=te.NotificationType9=te.NotificationType8=te.NotificationType7=te.NotificationType6=te.NotificationType5=te.NotificationType4=te.NotificationType3=te.NotificationType2=te.NotificationType1=te.NotificationType0=te.NotificationType=te.RequestType9=te.RequestType8=te.RequestType7=te.RequestType6=te.RequestType5=te.RequestType4=te.RequestType3=te.RequestType2=te.RequestType1=te.RequestType=te.RequestType0=te.AbstractMessageSignature=te.ParameterStructures=te.ResponseError=te.ErrorCodes=void 0;var po=xF(Ls()),iy;(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})(iy||(te.ErrorCodes=iy={}));var oy=class t extends Error{constructor(r,n,i){super(n);R(this,"code");R(this,"data");this.code=po.number(r)?r:iy.UnknownErrorCode,this.data=i,Object.setPrototypeOf(this,t.prototype)}toJson(){let r={code:this.code,message:this.message};return this.data!==void 0&&(r.data=this.data),r}};te.ResponseError=oy;var kr=class kr{constructor(e){R(this,"kind");this.kind=e}static is(e){return e===kr.auto||e===kr.byName||e===kr.byPosition}toString(){return this.kind}};R(kr,"auto",new kr("auto")),R(kr,"byPosition",new kr("byPosition")),R(kr,"byName",new kr("byName"));var xi=kr;te.ParameterStructures=xi;var tt=class{constructor(e,r){R(this,"method");R(this,"numberOfParams");this.method=e,this.numberOfParams=r}get parameterStructures(){return xi.auto}};te.AbstractMessageSignature=tt;var sy=class extends tt{constructor(r){super(r,0);R(this,"_")}};te.RequestType0=sy;var ay=class extends tt{constructor(r,n=xi.auto){super(r,1);R(this,"_parameterStructures");R(this,"_");this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};te.RequestType=ay;var cy=class extends tt{constructor(r,n=xi.auto){super(r,1);R(this,"_parameterStructures");R(this,"_");this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};te.RequestType1=cy;var ly=class extends tt{constructor(r){super(r,2);R(this,"_")}};te.RequestType2=ly;var uy=class extends tt{constructor(r){super(r,3);R(this,"_")}};te.RequestType3=uy;var fy=class extends tt{constructor(r){super(r,4);R(this,"_")}};te.RequestType4=fy;var dy=class extends tt{constructor(r){super(r,5);R(this,"_")}};te.RequestType5=dy;var py=class extends tt{constructor(r){super(r,6);R(this,"_")}};te.RequestType6=py;var hy=class extends tt{constructor(r){super(r,7);R(this,"_")}};te.RequestType7=hy;var my=class extends tt{constructor(r){super(r,8);R(this,"_")}};te.RequestType8=my;var gy=class extends tt{constructor(r){super(r,9);R(this,"_")}};te.RequestType9=gy;var yy=class extends tt{constructor(r,n=xi.auto){super(r,1);R(this,"_parameterStructures");R(this,"_");this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};te.NotificationType=yy;var xy=class extends tt{constructor(r){super(r,0);R(this,"_")}};te.NotificationType0=xy;var Ty=class extends tt{constructor(r,n=xi.auto){super(r,1);R(this,"_parameterStructures");R(this,"_");this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};te.NotificationType1=Ty;var _y=class extends tt{constructor(r){super(r,2);R(this,"_")}};te.NotificationType2=_y;var Ey=class extends tt{constructor(r){super(r,3);R(this,"_")}};te.NotificationType3=Ey;var vy=class extends tt{constructor(r){super(r,4);R(this,"_")}};te.NotificationType4=vy;var by=class extends tt{constructor(r){super(r,5);R(this,"_")}};te.NotificationType5=by;var wy=class extends tt{constructor(r){super(r,6);R(this,"_")}};te.NotificationType6=wy;var Ry=class extends tt{constructor(r){super(r,7);R(this,"_")}};te.NotificationType7=Ry;var Sy=class extends tt{constructor(r){super(r,8);R(this,"_")}};te.NotificationType8=Sy;var Ay=class extends tt{constructor(r){super(r,9);R(this,"_")}};te.NotificationType9=Ay;var Iw;(function(t){function e(i){let o=i;return o&&po.string(o.method)&&(po.string(o.id)||po.number(o.id))}t.isRequest=e;function r(i){let o=i;return o&&po.string(o.method)&&i.id===void 0}t.isNotification=r;function n(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(po.string(o.id)||po.number(o.id)||o.id===null)}t.isResponse=n})(Iw||(te.Message=Iw={}))});var Ny=he(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.LRUCache=Ti.LinkedMap=Ti.Touch=void 0;var Ct;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Ct||(Ti.Touch=Ct={}));var kw,Jf=class{constructor(){R(this,kw,"LinkedMap");R(this,"_map");R(this,"_head");R(this,"_tail");R(this,"_size");R(this,"_state");this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}before(e){let r=this._map.get(e);return r?r.previous?.value:void 0}after(e){let r=this._map.get(e);return r?r.next?.value:void 0}has(e){return this._map.has(e)}get(e,r=Ct.None){let n=this._map.get(e);if(n)return r!==Ct.None&&this.touch(n,r),n.value}set(e,r,n=Ct.None){let i=this._map.get(e);if(i)i.value=r,n!==Ct.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case Ct.None:this.addItemLast(i);break;case Ct.First:this.addItemFirst(i);break;case Ct.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}[(kw=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!==Ct.First&&r!==Ct.Last)){if(r===Ct.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===Ct.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)}};Ti.LinkedMap=Jf;var ky=class extends Jf{constructor(r,n=1){super();R(this,"_limit");R(this,"_ratio");this._limit=r,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(r){this._limit=r,this.checkTrim()}get ratio(){return this._ratio}set ratio(r){this._ratio=Math.min(Math.max(0,r),1),this.checkTrim()}get(r,n=Ct.AsNew){return super.get(r,n)}peek(r){return super.get(r,Ct.None)}set(r,n){return super.set(r,n,Ct.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Ti.LRUCache=ky});var Pw=he(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});Qf.Disposable=void 0;var Nw;(function(t){function e(r){return{dispose:r}}t.create=e})(Nw||(Qf.Disposable=Nw={}))});var _i=he(Oy=>{"use strict";Object.defineProperty(Oy,"__esModule",{value:!0});var Py;function Cy(){if(Py===void 0)throw new Error("No runtime abstraction layer installed");return Py}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");Py=r}t.install=e})(Cy||(Cy={}));Oy.default=Cy});var Ds=he(Ei=>{"use strict";var TF=Ei&&Ei.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.Emitter=Ei.Event=void 0;var _F=TF(_i()),Cw;(function(t){let e={dispose(){}};t.None=function(){return e}})(Cw||(Ei.Event=Cw={}));var Ly=class{constructor(){R(this,"_callbacks");R(this,"_contexts")}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,_F.default)().console.error(a)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},ed=class ed{constructor(e){R(this,"_options");R(this,"_event");R(this,"_callbacks");this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new Ly),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=ed._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)}};R(ed,"_noop",function(){});var Dy=ed;Ei.Emitter=Dy});var nd=he(Yt=>{"use strict";var EF=Yt&&Yt.__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]})),vF=Yt&&Yt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bF=Yt&&Yt.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&EF(r,e,n[i]);return vF(r,e),r}})(),wF=Yt&&Yt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.CancellationTokenSource=Yt.CancellationToken=void 0;var RF=wF(_i()),SF=bF(Ls()),My=Ds(),td;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:My.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:My.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||SF.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(td||(Yt.CancellationToken=td={}));var AF=Object.freeze(function(t,e){let r=(0,RF.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),rd=class{constructor(){R(this,"_isCancelled",!1);R(this,"_emitter")}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?AF:(this._emitter||(this._emitter=new My.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},$y=class{constructor(){R(this,"_token")}get token(){return this._token||(this._token=new rd),this._token}cancel(){this._token?this._token.cancel():this._token=td.Cancelled}dispose(){this._token?this._token instanceof rd&&this._token.dispose():this._token=td.None}};Yt.CancellationTokenSource=$y});var Ow=he(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.SharedArrayReceiverStrategy=Ms.SharedArraySenderStrategy=void 0;var IF=nd(),Wc;(function(t){t.Continue=0,t.Cancelled=1})(Wc||(Wc={}));var Fy=class{constructor(){R(this,"buffers");this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=Wc.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,Wc.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Ms.SharedArraySenderStrategy=Fy;var Uy=class{constructor(e){R(this,"data");this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Wc.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},By=class{constructor(e){R(this,"token");this.token=new Uy(e)}cancel(){}dispose(){}},Gy=class{constructor(){R(this,"kind","request")}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new IF.CancellationTokenSource:new By(r)}};Ms.SharedArrayReceiverStrategy=Gy});var Hy=he($s=>{"use strict";var kF=$s&&$s.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($s,"__esModule",{value:!0});$s.Semaphore=void 0;var NF=kF(_i()),Xy=class{constructor(e=1){R(this,"_capacity");R(this,"_active");R(this,"_waiting");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,NF.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("Too 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()}}};$s.Semaphore=Xy});var Dw=he(Ot=>{"use strict";var PF=Ot&&Ot.__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]})),CF=Ot&&Ot.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),OF=Ot&&Ot.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&PF(r,e,n[i]);return CF(r,e),r}})(),LF=Ot&&Ot.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.ReadableStreamMessageReader=Ot.AbstractMessageReader=Ot.MessageReader=void 0;var zy=LF(_i()),Fs=OF(Ls()),jy=Ds(),DF=Hy(),Lw;(function(t){function e(r){let n=r;return n&&Fs.func(n.listen)&&Fs.func(n.dispose)&&Fs.func(n.onError)&&Fs.func(n.onClose)&&Fs.func(n.onPartialMessage)}t.is=e})(Lw||(Ot.MessageReader=Lw={}));var id=class{constructor(){R(this,"errorEmitter");R(this,"closeEmitter");R(this,"partialMessageEmitter");this.errorEmitter=new jy.Emitter,this.closeEmitter=new jy.Emitter,this.partialMessageEmitter=new jy.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose(),this.partialMessageEmitter.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: ${Fs.string(e.message)?e.message:"unknown"}`)}};Ot.AbstractMessageReader=id;var Wy;(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,zy.default)().applicationJson.decoder,c.set(a.name,a)),{charset:n,contentDecoder:o,contentDecoders:s,contentTypeDecoder:a,contentTypeDecoders:c}}t.fromOptions=e})(Wy||(Wy={}));var qy=class extends id{constructor(r,n){super();R(this,"readable");R(this,"options");R(this,"callback");R(this,"nextMessageLength");R(this,"messageToken");R(this,"buffer");R(this,"partialMessageTimer");R(this,"_partialMessageTimeout");R(this,"readSemaphore");this.readable=r,this.options=Wy.fromOptions(n),this.buffer=(0,zy.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new DF.Semaphore(1)}set partialMessageTimeout(r){this._partialMessageTimeout=r}get partialMessageTimeout(){return this._partialMessageTimeout}listen(r){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=r;let n=this.readable.onData(i=>{this.onData(i)});return this.readable.onError(i=>this.fireError(i)),this.readable.onClose(()=>this.fireClose()),n}onData(r){try{for(this.buffer.append(r);;){if(this.nextMessageLength===-1){let i=this.buffer.tryReadHeaders(!0);if(!i)return;let o=i.get("content-length");if(!o){this.fireError(new Error(`Header must provide a Content-Length property.
7
- ${JSON.stringify(Object.fromEntries(i))}`));return}let s=parseInt(o);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${o}`));return}this.nextMessageLength=s}let n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let i=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(n):n,o=await this.options.contentTypeDecoder.decode(i,this.options);this.callback(o)}).catch(i=>{this.fireError(i)})}}catch(n){this.fireError(n)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,zy.default)().timer.setTimeout((r,n)=>{this.partialMessageTimer=void 0,r===this.messageToken&&(this.firePartialMessage({messageToken:r,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Ot.ReadableStreamMessageReader=qy});var Bw=he(Lt=>{"use strict";var MF=Lt&&Lt.__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]})),$F=Lt&&Lt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),FF=Lt&&Lt.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&MF(r,e,n[i]);return $F(r,e),r}})(),UF=Lt&&Lt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.WriteableStreamMessageWriter=Lt.AbstractMessageWriter=Lt.MessageWriter=void 0;var Mw=UF(_i()),qc=FF(Ls()),BF=Hy(),$w=Ds(),GF="Content-Length: ",Fw=`\r
8
- `,Uw;(function(t){function e(r){let n=r;return n&&qc.func(n.dispose)&&qc.func(n.onClose)&&qc.func(n.onError)&&qc.func(n.write)}t.is=e})(Uw||(Lt.MessageWriter=Uw={}));var od=class{constructor(){R(this,"errorEmitter");R(this,"closeEmitter");this.errorEmitter=new $w.Emitter,this.closeEmitter=new $w.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: ${qc.string(e.message)?e.message:"unknown"}`)}};Lt.AbstractMessageWriter=od;var Vy;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,Mw.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,Mw.default)().applicationJson.encoder}}t.fromOptions=e})(Vy||(Vy={}));var Yy=class extends od{constructor(r,n){super();R(this,"writable");R(this,"options");R(this,"errorCount");R(this,"writeSemaphore");this.writable=r,this.options=Vy.fromOptions(n),this.errorCount=0,this.writeSemaphore=new BF.Semaphore(1),this.writable.onError(i=>this.fireError(i)),this.writable.onClose(()=>this.fireClose())}async write(r){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(r,this.options).then(i=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(i):i).then(i=>{let o=[];return o.push(GF,i.byteLength.toString(),Fw),o.push(Fw),this.doWrite(r,o,i)},i=>{throw this.fireError(i),i}))}async doWrite(r,n,i){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(i)}catch(o){return this.handleError(o,r),Promise.reject(o)}}handleError(r,n){this.errorCount++,this.fireError(r,n,this.errorCount)}end(){this.writable.end()}};Lt.WriteableStreamMessageWriter=Yy});var Gw=he(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.AbstractMessageBuffer=void 0;var XF=13,HF=10,jF=`\r
9
- `,Ky=class{constructor(e="utf-8"){R(this,"_encoding");R(this,"_chunks");R(this,"_totalLength");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 HF: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(jF);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}};sd.AbstractMessageBuffer=Ky});var zw=he(ie=>{"use strict";var zF=ie&&ie.__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]})),WF=ie&&ie.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),qF=ie&&ie.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&zF(r,e,n[i]);return WF(r,e),r}})(),VF=ie&&ie.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ie,"__esModule",{value:!0});ie.ConnectionOptions=ie.MessageStrategy=ie.CancellationStrategy=ie.CancellationSenderStrategy=ie.CancellationReceiverStrategy=ie.RequestCancellationReceiverStrategy=ie.IdCancellationReceiverStrategy=ie.ConnectionStrategy=ie.ConnectionError=ie.ConnectionErrors=ie.LogTraceNotification=ie.SetTraceNotification=ie.TraceFormat=ie.TraceValues=ie.TraceValue=ie.Trace=ie.NullLogger=ie.ProgressType=ie.ProgressToken=void 0;ie.createMessageConnection=YF;var Xw=VF(_i()),lt=qF(Ls()),fe=Iy(),Hw=Ny(),Vc=Ds(),Zy=nd(),Zc;(function(t){t.type=new fe.NotificationType("$/cancelRequest")})(Zc||(Zc={}));var Jy;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(Jy||(ie.ProgressToken=Jy={}));var Yc;(function(t){t.type=new fe.NotificationType("$/progress")})(Yc||(Yc={}));var Qy=class{constructor(){R(this,"__");R(this,"_pr")}};ie.ProgressType=Qy;var ex;(function(t){function e(r){return lt.func(r)}t.is=e})(ex||(ex={}));ie.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Oe;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Oe||(ie.Trace=Oe={}));var tx;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(tx||(ie.TraceValue=tx={}));ie.TraceValues=tx;(function(t){function e(n){if(!lt.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})(Oe||(ie.Trace=Oe={}));var or;(function(t){t.Text="text",t.JSON="json"})(or||(ie.TraceFormat=or={}));(function(t){function e(r){return lt.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(or||(ie.TraceFormat=or={}));var rx;(function(t){t.type=new fe.NotificationType("$/setTrace")})(rx||(ie.SetTraceNotification=rx={}));var ad;(function(t){t.type=new fe.NotificationType("$/logTrace")})(ad||(ie.LogTraceNotification=ad={}));var Kc;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Kc||(ie.ConnectionErrors=Kc={}));var Us=class t extends Error{constructor(r,n){super(n);R(this,"code");this.code=r,Object.setPrototypeOf(this,t.prototype)}};ie.ConnectionError=Us;var nx;(function(t){function e(r){let n=r;return n&&lt.func(n.cancelUndispatched)}t.is=e})(nx||(ie.ConnectionStrategy=nx={}));var cd;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&lt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||lt.func(n.dispose))}t.is=e})(cd||(ie.IdCancellationReceiverStrategy=cd={}));var ix;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&lt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||lt.func(n.dispose))}t.is=e})(ix||(ie.RequestCancellationReceiverStrategy=ix={}));var ld;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new Zy.CancellationTokenSource}});function e(r){return cd.is(r)||ix.is(r)}t.is=e})(ld||(ie.CancellationReceiverStrategy=ld={}));var ud;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(Zc.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&lt.func(n.sendCancellation)&&lt.func(n.cleanup)}t.is=e})(ud||(ie.CancellationSenderStrategy=ud={}));var fd;(function(t){t.Message=Object.freeze({receiver:ld.Message,sender:ud.Message});function e(r){let n=r;return n&&ld.is(n.receiver)&&ud.is(n.sender)}t.is=e})(fd||(ie.CancellationStrategy=fd={}));var dd;(function(t){function e(r){let n=r;return n&&lt.func(n.handleMessage)}t.is=e})(dd||(ie.MessageStrategy=dd={}));var jw;(function(t){function e(r){let n=r;return n&&(fd.is(n.cancellationStrategy)||nx.is(n.connectionStrategy)||dd.is(n.messageStrategy)||lt.number(n.maxParallelism))}t.is=e})(jw||(ie.ConnectionOptions=jw={}));var Nr;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(Nr||(Nr={}));function YF(t,e,r,n){let i=r!==void 0?r:ie.NullLogger,o=0,s=0,a=0,c="2.0",l=n?.maxParallelism??-1,u=0,f,d=new Map,p,m=new Map,y=new Map,E,_=new Hw.LinkedMap,x=new Map,v=new Set,k=new Map,F=Oe.Off,O=or.Text,L,G=Nr.New,H=new Vc.Emitter,oe=new Vc.Emitter,$=new Vc.Emitter,w=new Vc.Emitter,D=new Vc.Emitter,U=n&&n.cancellationStrategy?n.cancellationStrategy:fd.Message;function S(T){}function A(){return G===Nr.Listening}function I(){return G===Nr.Closed}function B(){return G===Nr.Disposed}function z(){(G===Nr.New||G===Nr.Listening)&&(G=Nr.Closed,oe.fire(void 0))}function j(T){H.fire([T,void 0,void 0])}function V(T){H.fire(T)}t.onClose(z),t.onError(j),e.onClose(z),e.onError(V);function K(T){if(T===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+T.toString()}function ue(T){return T===null?"res-unknown-"+(++a).toString():"res-"+T.toString()}function Y(){return"not-"+(++s).toString()}function ne(T,P){fe.Message.isRequest(P)?T.set(K(P.id),P):fe.Message.isResponse(P)?l===-1?T.set(ue(P.id),P):Q(P):T.set(Y(),P)}function Re(){E||_.size===0||l!==-1&&u>=l||(E=(0,Xw.default)().timer.setImmediate(async()=>{if(E=void 0,_.size===0||l!==-1&&u>=l)return;let T=_.shift(),P;try{u++;let X=n?.messageStrategy;dd.is(X)?P=X.handleMessage(T,Se):P=Se(T)}catch(X){i.error(`Processing message queue failed: ${X.toString()}`)}finally{P instanceof Promise?P.then(()=>{u--,Re()}).catch(X=>{i.error(`Processing message queue failed: ${X.toString()}`)}):u--,Re()}}))}async function Se(T){return fe.Message.isRequest(T)?q(T):fe.Message.isNotification(T)?re(T):fe.Message.isResponse(T)?Q(T):M(T)}let $e=T=>{try{if(fe.Message.isNotification(T)&&T.method===Zc.type.method){let P=T.params.id,X=K(P),J=_.get(X);if(fe.Message.isRequest(J)){let Be=n?.connectionStrategy,Ae=Be&&Be.cancelUndispatched?Be.cancelUndispatched(J,S):void 0;if(Ae&&(Ae.error!==void 0||Ae.result!==void 0)){_.delete(X),k.delete(P),Ae.id=J.id,at(Ae,T.method,Date.now()),e.write(Ae).catch(()=>i.error("Sending response for canceled message failed."));return}}let _e=k.get(P);if(_e!==void 0){_e.cancel(),er(T);return}else v.add(P)}ne(_,T)}finally{Re()}};async function q(T){if(B())return Promise.resolve();function P(Ze,ct,He){let Fe={jsonrpc:c,id:T.id};return Ze instanceof fe.ResponseError?Fe.error=Ze.toJson():Fe.result=Ze===void 0?null:Ze,at(Fe,ct,He),e.write(Fe)}function X(Ze,ct,He){let Fe={jsonrpc:c,id:T.id,error:Ze.toJson()};return at(Fe,ct,He),e.write(Fe)}W(T);let J=d.get(T.method),_e,Be;J&&(_e=J.type,Be=J.handler);let Ae=Date.now();if(Be||f){let Ze=T.id??String(Date.now()),ct=cd.is(U.receiver)?U.receiver.createCancellationTokenSource(Ze):U.receiver.createCancellationTokenSource(T);T.id!==null&&v.has(T.id)&&ct.cancel(),T.id!==null&&k.set(Ze,ct);try{let He;if(Be)if(T.params===void 0){if(_e!==void 0&&_e.numberOfParams!==0)return X(new fe.ResponseError(fe.ErrorCodes.InvalidParams,`Request ${T.method} defines ${_e.numberOfParams} params but received none.`),T.method,Ae);He=Be(ct.token)}else if(Array.isArray(T.params)){if(_e!==void 0&&_e.parameterStructures===fe.ParameterStructures.byName)return X(new fe.ResponseError(fe.ErrorCodes.InvalidParams,`Request ${T.method} defines parameters by name but received parameters by position`),T.method,Ae);He=Be(...T.params,ct.token)}else{if(_e!==void 0&&_e.parameterStructures===fe.ParameterStructures.byPosition)return X(new fe.ResponseError(fe.ErrorCodes.InvalidParams,`Request ${T.method} defines parameters by position but received parameters by name`),T.method,Ae);He=Be(T.params,ct.token)}else f&&(He=f(T.method,T.params,ct.token));let Fe=await He;await P(Fe,T.method,Ae)}catch(He){He instanceof fe.ResponseError?await P(He,T.method,Ae):He&&lt.string(He.message)?await X(new fe.ResponseError(fe.ErrorCodes.InternalError,`Request ${T.method} failed with message: ${He.message}`),T.method,Ae):await X(new fe.ResponseError(fe.ErrorCodes.InternalError,`Request ${T.method} failed unexpectedly without providing any details.`),T.method,Ae)}finally{k.delete(Ze)}}else await X(new fe.ResponseError(fe.ErrorCodes.MethodNotFound,`Unhandled method ${T.method}`),T.method,Ae)}function Q(T){if(!B())if(T.id===null)T.error?i.error(`Received response message without id: Error is:
11
- ${JSON.stringify(T.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let P=T.id,X=x.get(P);if(Ui(T,X),X!==void 0){x.delete(P);try{if(T.error){let J=T.error;X.reject(new fe.ResponseError(J.code,J.message,J.data))}else if(T.result!==void 0)X.resolve(T.result);else throw new Error("Should never happen.")}catch(J){J.message?i.error(`Response handler '${X.method}' failed with message: ${J.message}`):i.error(`Response handler '${X.method}' failed unexpectedly.`)}}}}async function re(T){if(B())return;let P,X;if(T.method===Zc.type.method){let J=T.params.id;v.delete(J),er(T);return}else{let J=m.get(T.method);J&&(X=J.handler,P=J.type)}if(X||p)try{if(er(T),X)if(T.params===void 0)P!==void 0&&P.numberOfParams!==0&&P.parameterStructures!==fe.ParameterStructures.byName&&i.error(`Notification ${T.method} defines ${P.numberOfParams} params but received none.`),await X();else if(Array.isArray(T.params)){let J=T.params;T.method===Yc.type.method&&J.length===2&&Jy.is(J[0])?await X({token:J[0],value:J[1]}):(P!==void 0&&(P.parameterStructures===fe.ParameterStructures.byName&&i.error(`Notification ${T.method} defines parameters by name but received parameters by position`),P.numberOfParams!==T.params.length&&i.error(`Notification ${T.method} defines ${P.numberOfParams} params but received ${J.length} arguments`)),await X(...J))}else P!==void 0&&P.parameterStructures===fe.ParameterStructures.byPosition&&i.error(`Notification ${T.method} defines parameters by position but received parameters by name`),await X(T.params);else p&&await p(T.method,T.params)}catch(J){J.message?i.error(`Notification handler '${T.method}' failed with message: ${J.message}`):i.error(`Notification handler '${T.method}' failed unexpectedly.`)}else $.fire(T)}function M(T){if(!T){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
12
- ${JSON.stringify(T,null,4)}`);let P=T;if(lt.string(P.id)||lt.number(P.id)){let X=P.id,J=x.get(X);J&&J.reject(new Error("The received response has neither a result nor an error property."))}}function de(T){if(T!=null)switch(F){case Oe.Verbose:return JSON.stringify(T,null,4);case Oe.Compact:return JSON.stringify(T);default:return}}function pe(T){if(!(F===Oe.Off||!L))if(O===or.Text){let P;(F===Oe.Verbose||F===Oe.Compact)&&T.params&&(P=`Params: ${de(T.params)}`),L.log(`Sending request '${T.method} - (${T.id})'.`,P)}else ur("send-request",T)}function Ne(T){if(!(F===Oe.Off||!L))if(O===or.Text){let P;(F===Oe.Verbose||F===Oe.Compact)&&(T.params?P=`Params: ${de(T.params)}`:P="No parameters provided."),L.log(`Sending notification '${T.method}'.`,P)}else ur("send-notification",T)}function at(T,P,X){if(!(F===Oe.Off||!L))if(O===or.Text){let J;(F===Oe.Verbose||F===Oe.Compact)&&(T.error&&T.error.data?J=`Error data: ${de(T.error.data)}`:T.result?J=`Result: ${de(T.result)}`:T.error===void 0&&(J="No result returned.")),L.log(`Sending response '${P} - (${T.id})'. Processing request took ${Date.now()-X}ms`,J)}else ur("send-response",T)}function W(T){if(!(F===Oe.Off||!L))if(O===or.Text){let P;(F===Oe.Verbose||F===Oe.Compact)&&T.params&&(P=`Params: ${de(T.params)}`),L.log(`Received request '${T.method} - (${T.id})'.`,P)}else ur("receive-request",T)}function er(T){if(!(F===Oe.Off||!L||T.method===ad.type.method))if(O===or.Text){let P;(F===Oe.Verbose||F===Oe.Compact)&&(T.params?P=`Params: ${de(T.params)}`:P="No parameters provided."),L.log(`Received notification '${T.method}'.`,P)}else ur("receive-notification",T)}function Ui(T,P){if(!(F===Oe.Off||!L))if(O===or.Text){let X;if((F===Oe.Verbose||F===Oe.Compact)&&(T.error&&T.error.data?X=`Error data: ${de(T.error.data)}`:T.result?X=`Result: ${de(T.result)}`:T.error===void 0&&(X="No result returned.")),P){let J=T.error?` Request failed: ${T.error.message} (${T.error.code}).`:"";L.log(`Received response '${P.method} - (${T.id})' in ${Date.now()-P.timerStart}ms.${J}`,X)}else L.log(`Received response ${T.id} without active response promise.`,X)}else ur("receive-response",T)}function ur(T,P){if(!L||F===Oe.Off)return;let X={isLSPMessage:!0,type:T,message:P,timestamp:Date.now()};L.log(X)}function jr(){if(I())throw new Us(Kc.Closed,"Connection is closed.");if(B())throw new Us(Kc.Disposed,"Connection is disposed.")}function ye(){if(A())throw new Us(Kc.AlreadyListening,"Connection is already listening")}function Bi(){if(!A())throw new Error("Call listen() first.")}function zr(T){return T===void 0?null:T}function dn(T){if(T!==null)return T}function Er(T){return T!=null&&!Array.isArray(T)&&typeof T=="object"}function Nt(T,P){switch(T){case fe.ParameterStructures.auto:return Er(P)?dn(P):[zr(P)];case fe.ParameterStructures.byName:if(!Er(P))throw new Error("Received parameters by name but param is not an object literal.");return dn(P);case fe.ParameterStructures.byPosition:return[zr(P)];default:throw new Error(`Unknown parameter structure ${T.toString()}`)}}function $t(T,P){let X,J=T.numberOfParams;switch(J){case 0:X=void 0;break;case 1:X=Nt(T.parameterStructures,P[0]);break;default:X=[];for(let _e=0;_e<P.length&&_e<J;_e++)X.push(zr(P[_e]));if(P.length<J)for(let _e=P.length;_e<J;_e++)X.push(null);break}return X}let fr={sendNotification:(T,...P)=>{jr();let X,J;if(lt.string(T)){X=T;let Be=P[0],Ae=0,Ze=fe.ParameterStructures.auto;fe.ParameterStructures.is(Be)&&(Ae=1,Ze=Be);let ct=P.length,He=ct-Ae;switch(He){case 0:J=void 0;break;case 1:J=Nt(Ze,P[Ae]);break;default:if(Ze===fe.ParameterStructures.byName)throw new Error(`Received ${He} parameters for 'by Name' notification parameter structure.`);J=P.slice(Ae,ct).map(Fe=>zr(Fe));break}}else{let Be=P;X=T.method,J=$t(T,Be)}let _e={jsonrpc:c,method:X,params:J};return Ne(_e),e.write(_e).catch(Be=>{throw i.error("Sending notification failed."),Be})},onNotification:(T,P)=>{jr();let X;return lt.func(T)?p=T:P&&(lt.string(T)?(X=T,m.set(T,{type:void 0,handler:P})):(X=T.method,m.set(T.method,{type:T,handler:P}))),{dispose:()=>{X!==void 0?m.get(X)?.handler===P&&m.delete(X):p===T&&(p=void 0)}}},onProgress:(T,P,X)=>{if(y.has(P))throw new Error(`Progress handler for token ${P} already registered`);return y.set(P,X),{dispose:()=>{y.get(P)===X&&y.delete(P)}}},sendProgress:(T,P,X)=>fr.sendNotification(Yc.type,{token:P,value:X}),onUnhandledProgress:w.event,sendRequest:(T,...P)=>{jr(),Bi();function X(Fe,gt){let tr=U.sender.sendCancellation(Fe,gt);tr===void 0?i.log(`Received no promise from cancellation strategy when cancelling id ${gt}`):tr.catch(()=>{i.log(`Sending cancellation messages for id ${gt} failed.`)})}let J,_e,Be;if(lt.string(T)){J=T;let Fe=P[0],gt=P[P.length-1],tr=0,Wr=fe.ParameterStructures.auto;fe.ParameterStructures.is(Fe)&&(tr=1,Wr=Fe);let dr=P.length;Zy.CancellationToken.is(gt)&&(dr=dr-1,Be=gt);let Je=dr-tr;switch(Je){case 0:_e=void 0;break;case 1:_e=Nt(Wr,P[tr]);break;default:if(Wr===fe.ParameterStructures.byName)throw new Error(`Received ${Je} parameters for 'by Name' request parameter structure.`);_e=P.slice(tr,dr).map(pr=>zr(pr));break}}else{let Fe=P;J=T.method,_e=$t(T,Fe);let gt=T.numberOfParams;Be=Zy.CancellationToken.is(Fe[gt])?Fe[gt]:void 0}let Ae=o++,Ze,ct=!1;Be!==void 0&&(Be.isCancellationRequested?ct=!0:Ze=Be.onCancellationRequested(()=>{X(fr,Ae)}));let He={jsonrpc:c,id:Ae,method:J,params:_e};return pe(He),typeof U.sender.enableCancellation=="function"&&U.sender.enableCancellation(He),new Promise(async(Fe,gt)=>{let tr=Je=>{Fe(Je),U.sender.cleanup(Ae),Ze?.dispose()},Wr=Je=>{gt(Je),U.sender.cleanup(Ae),Ze?.dispose()},dr={method:J,timerStart:Date.now(),resolve:tr,reject:Wr};try{x.set(Ae,dr),await e.write(He),ct&&X(fr,Ae)}catch(Je){throw x.delete(Ae),dr.reject(new fe.ResponseError(fe.ErrorCodes.MessageWriteError,Je.message?Je.message:"Unknown reason")),i.error("Sending request failed."),Je}})},onRequest:(T,P)=>{jr();let X=null;return ex.is(T)?(X=void 0,f=T):lt.string(T)?(X=null,P!==void 0&&(X=T,d.set(T,{handler:P,type:void 0}))):P!==void 0&&(X=T.method,d.set(T.method,{type:T,handler:P})),{dispose:()=>{X!==null&&(X!==void 0?d.get(X)?.handler===P&&d.delete(X):f===T&&(f=void 0))}}},hasPendingResponse:()=>x.size>0,trace:async(T,P,X)=>{let J=!1,_e=or.Text;X!==void 0&&(lt.boolean(X)?J=X:(J=X.sendNotification||!1,_e=X.traceFormat||or.Text)),F=T,O=_e,F===Oe.Off?L=void 0:L=P,J&&!I()&&!B()&&await fr.sendNotification(rx.type,{value:Oe.toString(T)})},onError:H.event,onClose:oe.event,onUnhandledNotification:$.event,onDispose:D.event,end:()=>{e.end()},dispose:()=>{if(B())return;G=Nr.Disposed,D.fire(void 0);let T=new fe.ResponseError(fe.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let P of x.values())P.reject(T);x=new Map,k=new Map,v=new Set,_=new Hw.LinkedMap,lt.func(e.dispose)&&e.dispose(),lt.func(t.dispose)&&t.dispose()},listen:()=>{jr(),ye(),G=Nr.Listening,t.listen($e)},inspect:()=>{(0,Xw.default)().console.log("inspect")}};return fr.onNotification(ad.type,T=>{if(F===Oe.Off||!L)return;let P=F===Oe.Verbose||F===Oe.Compact;L.log(T.message,P?T.verbose:void 0)}),fr.onNotification(Yc.type,async T=>{let P=y.get(T.token);P?await P(T.value):w.fire(T)}),fr}});var Bs=he(N=>{"use strict";var KF=N&&N.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};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.RequestCancellationReceiverStrategy=N.IdCancellationReceiverStrategy=N.CancellationReceiverStrategy=N.ConnectionError=N.ConnectionErrors=N.LogTraceNotification=N.SetTraceNotification=N.TraceFormat=N.TraceValues=N.TraceValue=N.Trace=void 0;var Ke=Iy();Object.defineProperty(N,"Message",{enumerable:!0,get:function(){return Ke.Message}});Object.defineProperty(N,"RequestType",{enumerable:!0,get:function(){return Ke.RequestType}});Object.defineProperty(N,"RequestType0",{enumerable:!0,get:function(){return Ke.RequestType0}});Object.defineProperty(N,"RequestType1",{enumerable:!0,get:function(){return Ke.RequestType1}});Object.defineProperty(N,"RequestType2",{enumerable:!0,get:function(){return Ke.RequestType2}});Object.defineProperty(N,"RequestType3",{enumerable:!0,get:function(){return Ke.RequestType3}});Object.defineProperty(N,"RequestType4",{enumerable:!0,get:function(){return Ke.RequestType4}});Object.defineProperty(N,"RequestType5",{enumerable:!0,get:function(){return Ke.RequestType5}});Object.defineProperty(N,"RequestType6",{enumerable:!0,get:function(){return Ke.RequestType6}});Object.defineProperty(N,"RequestType7",{enumerable:!0,get:function(){return Ke.RequestType7}});Object.defineProperty(N,"RequestType8",{enumerable:!0,get:function(){return Ke.RequestType8}});Object.defineProperty(N,"RequestType9",{enumerable:!0,get:function(){return Ke.RequestType9}});Object.defineProperty(N,"ResponseError",{enumerable:!0,get:function(){return Ke.ResponseError}});Object.defineProperty(N,"ErrorCodes",{enumerable:!0,get:function(){return Ke.ErrorCodes}});Object.defineProperty(N,"NotificationType",{enumerable:!0,get:function(){return Ke.NotificationType}});Object.defineProperty(N,"NotificationType0",{enumerable:!0,get:function(){return Ke.NotificationType0}});Object.defineProperty(N,"NotificationType1",{enumerable:!0,get:function(){return Ke.NotificationType1}});Object.defineProperty(N,"NotificationType2",{enumerable:!0,get:function(){return Ke.NotificationType2}});Object.defineProperty(N,"NotificationType3",{enumerable:!0,get:function(){return Ke.NotificationType3}});Object.defineProperty(N,"NotificationType4",{enumerable:!0,get:function(){return Ke.NotificationType4}});Object.defineProperty(N,"NotificationType5",{enumerable:!0,get:function(){return Ke.NotificationType5}});Object.defineProperty(N,"NotificationType6",{enumerable:!0,get:function(){return Ke.NotificationType6}});Object.defineProperty(N,"NotificationType7",{enumerable:!0,get:function(){return Ke.NotificationType7}});Object.defineProperty(N,"NotificationType8",{enumerable:!0,get:function(){return Ke.NotificationType8}});Object.defineProperty(N,"NotificationType9",{enumerable:!0,get:function(){return Ke.NotificationType9}});Object.defineProperty(N,"ParameterStructures",{enumerable:!0,get:function(){return Ke.ParameterStructures}});var ox=Ny();Object.defineProperty(N,"LinkedMap",{enumerable:!0,get:function(){return ox.LinkedMap}});Object.defineProperty(N,"LRUCache",{enumerable:!0,get:function(){return ox.LRUCache}});Object.defineProperty(N,"Touch",{enumerable:!0,get:function(){return ox.Touch}});var ZF=Pw();Object.defineProperty(N,"Disposable",{enumerable:!0,get:function(){return ZF.Disposable}});var Ww=Ds();Object.defineProperty(N,"Event",{enumerable:!0,get:function(){return Ww.Event}});Object.defineProperty(N,"Emitter",{enumerable:!0,get:function(){return Ww.Emitter}});var qw=nd();Object.defineProperty(N,"CancellationTokenSource",{enumerable:!0,get:function(){return qw.CancellationTokenSource}});Object.defineProperty(N,"CancellationToken",{enumerable:!0,get:function(){return qw.CancellationToken}});var Vw=Ow();Object.defineProperty(N,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return Vw.SharedArraySenderStrategy}});Object.defineProperty(N,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return Vw.SharedArrayReceiverStrategy}});var sx=Dw();Object.defineProperty(N,"MessageReader",{enumerable:!0,get:function(){return sx.MessageReader}});Object.defineProperty(N,"AbstractMessageReader",{enumerable:!0,get:function(){return sx.AbstractMessageReader}});Object.defineProperty(N,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return sx.ReadableStreamMessageReader}});var ax=Bw();Object.defineProperty(N,"MessageWriter",{enumerable:!0,get:function(){return ax.MessageWriter}});Object.defineProperty(N,"AbstractMessageWriter",{enumerable:!0,get:function(){return ax.AbstractMessageWriter}});Object.defineProperty(N,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return ax.WriteableStreamMessageWriter}});var JF=Gw();Object.defineProperty(N,"AbstractMessageBuffer",{enumerable:!0,get:function(){return JF.AbstractMessageBuffer}});var Tt=zw();Object.defineProperty(N,"ConnectionStrategy",{enumerable:!0,get:function(){return Tt.ConnectionStrategy}});Object.defineProperty(N,"ConnectionOptions",{enumerable:!0,get:function(){return Tt.ConnectionOptions}});Object.defineProperty(N,"NullLogger",{enumerable:!0,get:function(){return Tt.NullLogger}});Object.defineProperty(N,"createMessageConnection",{enumerable:!0,get:function(){return Tt.createMessageConnection}});Object.defineProperty(N,"ProgressToken",{enumerable:!0,get:function(){return Tt.ProgressToken}});Object.defineProperty(N,"ProgressType",{enumerable:!0,get:function(){return Tt.ProgressType}});Object.defineProperty(N,"Trace",{enumerable:!0,get:function(){return Tt.Trace}});Object.defineProperty(N,"TraceValue",{enumerable:!0,get:function(){return Tt.TraceValue}});Object.defineProperty(N,"TraceFormat",{enumerable:!0,get:function(){return Tt.TraceFormat}});Object.defineProperty(N,"SetTraceNotification",{enumerable:!0,get:function(){return Tt.SetTraceNotification}});Object.defineProperty(N,"LogTraceNotification",{enumerable:!0,get:function(){return Tt.LogTraceNotification}});Object.defineProperty(N,"ConnectionErrors",{enumerable:!0,get:function(){return Tt.ConnectionErrors}});Object.defineProperty(N,"ConnectionError",{enumerable:!0,get:function(){return Tt.ConnectionError}});Object.defineProperty(N,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Tt.CancellationReceiverStrategy}});Object.defineProperty(N,"IdCancellationReceiverStrategy",{enumerable:!0,get:function(){return Tt.IdCancellationReceiverStrategy}});Object.defineProperty(N,"RequestCancellationReceiverStrategy",{enumerable:!0,get:function(){return Tt.RequestCancellationReceiverStrategy}});Object.defineProperty(N,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Tt.CancellationSenderStrategy}});Object.defineProperty(N,"CancellationStrategy",{enumerable:!0,get:function(){return Tt.CancellationStrategy}});Object.defineProperty(N,"MessageStrategy",{enumerable:!0,get:function(){return Tt.MessageStrategy}});Object.defineProperty(N,"TraceValues",{enumerable:!0,get:function(){return Tt.TraceValues}});var QF=KF(_i());N.RAL=QF.default});var rt=he(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.CM=Dt.ProtocolNotificationType=Dt.ProtocolNotificationType0=Dt.ProtocolRequestType=Dt.ProtocolRequestType0=Dt.RegistrationType=Dt.MessageDirection=void 0;var Gs=Bs(),Yw;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(Yw||(Dt.MessageDirection=Yw={}));var cx=class{constructor(e){R(this,"____");R(this,"method");this.method=e}};Dt.RegistrationType=cx;var lx=class extends Gs.RequestType0{constructor(r){super(r);R(this,"__");R(this,"___");R(this,"____");R(this,"_pr")}};Dt.ProtocolRequestType0=lx;var ux=class extends Gs.RequestType{constructor(r){super(r,Gs.ParameterStructures.byName);R(this,"__");R(this,"___");R(this,"____");R(this,"_pr")}};Dt.ProtocolRequestType=ux;var fx=class extends Gs.NotificationType0{constructor(r){super(r);R(this,"___");R(this,"____")}};Dt.ProtocolNotificationType0=fx;var dx=class extends Gs.NotificationType{constructor(r){super(r,Gs.ParameterStructures.byName);R(this,"___");R(this,"____")}};Dt.ProtocolNotificationType=dx;var Kw;(function(t){function e(r,n){return{client:r,server:n}}t.create=e})(Kw||(Dt.CM=Kw={}))});var pd=he(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.boolean=e2;Pr.string=Zw;Pr.number=t2;Pr.error=r2;Pr.func=n2;Pr.array=Jw;Pr.stringArray=i2;Pr.typedArray=o2;Pr.objectLiteral=s2;function e2(t){return t===!0||t===!1}function Zw(t){return typeof t=="string"||t instanceof String}function t2(t){return typeof t=="number"||t instanceof Number}function r2(t){return t instanceof Error}function n2(t){return typeof t=="function"}function Jw(t){return Array.isArray(t)}function i2(t){return Jw(t)&&t.every(e=>Zw(e))}function o2(t,e){return Array.isArray(t)&&t.every(e)}function s2(t){return t!==null&&typeof t=="object"}});var eR=he(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});hd.ImplementationRequest=void 0;var px=rt(),Qw;(function(t){t.method="textDocument/implementation",t.messageDirection=px.MessageDirection.clientToServer,t.type=new px.ProtocolRequestType(t.method),t.capabilities=px.CM.create("textDocument.implementation","implementationProvider")})(Qw||(hd.ImplementationRequest=Qw={}))});var rR=he(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});md.TypeDefinitionRequest=void 0;var hx=rt(),tR;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=hx.MessageDirection.clientToServer,t.type=new hx.ProtocolRequestType(t.method),t.capabilities=hx.CM.create("textDocument.typeDefinition","typeDefinitionProvider")})(tR||(md.TypeDefinitionRequest=tR={}))});var oR=he(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.DidChangeWorkspaceFoldersNotification=Hs.WorkspaceFoldersRequest=void 0;var Xs=rt(),nR;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Xs.MessageDirection.serverToClient,t.type=new Xs.ProtocolRequestType0(t.method),t.capabilities=Xs.CM.create("workspace.workspaceFolders","workspace.workspaceFolders")})(nR||(Hs.WorkspaceFoldersRequest=nR={}));var iR;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Xs.MessageDirection.clientToServer,t.type=new Xs.ProtocolNotificationType(t.method),t.capabilities=Xs.CM.create(void 0,"workspace.workspaceFolders.changeNotifications")})(iR||(Hs.DidChangeWorkspaceFoldersNotification=iR={}))});var aR=he(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.ConfigurationRequest=void 0;var mx=rt(),sR;(function(t){t.method="workspace/configuration",t.messageDirection=mx.MessageDirection.serverToClient,t.type=new mx.ProtocolRequestType(t.method),t.capabilities=mx.CM.create("workspace.configuration",void 0)})(sR||(gd.ConfigurationRequest=sR={}))});var uR=he(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.ColorPresentationRequest=zs.DocumentColorRequest=void 0;var js=rt(),cR;(function(t){t.method="textDocument/documentColor",t.messageDirection=js.MessageDirection.clientToServer,t.type=new js.ProtocolRequestType(t.method),t.capabilities=js.CM.create("textDocument.colorProvider","colorProvider")})(cR||(zs.DocumentColorRequest=cR={}));var lR;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=js.MessageDirection.clientToServer,t.type=new js.ProtocolRequestType(t.method),t.capabilities=js.CM.create("textDocument.colorProvider","colorProvider")})(lR||(zs.ColorPresentationRequest=lR={}))});var pR=he(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.FoldingRangeRefreshRequest=qs.FoldingRangeRequest=void 0;var Ws=rt(),fR;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Ws.MessageDirection.clientToServer,t.type=new Ws.ProtocolRequestType(t.method),t.capabilities=Ws.CM.create("textDocument.foldingRange","foldingRangeProvider")})(fR||(qs.FoldingRangeRequest=fR={}));var dR;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Ws.MessageDirection.serverToClient,t.type=new Ws.ProtocolRequestType0(t.method),t.capabilities=Ws.CM.create("workspace.foldingRange.refreshSupport",void 0)})(dR||(qs.FoldingRangeRefreshRequest=dR={}))});var mR=he(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});yd.DeclarationRequest=void 0;var gx=rt(),hR;(function(t){t.method="textDocument/declaration",t.messageDirection=gx.MessageDirection.clientToServer,t.type=new gx.ProtocolRequestType(t.method),t.capabilities=gx.CM.create("textDocument.declaration","declarationProvider")})(hR||(yd.DeclarationRequest=hR={}))});var yR=he(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.SelectionRangeRequest=void 0;var yx=rt(),gR;(function(t){t.method="textDocument/selectionRange",t.messageDirection=yx.MessageDirection.clientToServer,t.type=new yx.ProtocolRequestType(t.method),t.capabilities=yx.CM.create("textDocument.selectionRange","selectionRangeProvider")})(gR||(xd.SelectionRangeRequest=gR={}))});var ER=he(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.WorkDoneProgressCancelNotification=vi.WorkDoneProgressCreateRequest=vi.WorkDoneProgress=void 0;var a2=Bs(),Jc=rt(),xR;(function(t){t.type=new a2.ProgressType;function e(r){return r===t.type}t.is=e})(xR||(vi.WorkDoneProgress=xR={}));var TR;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Jc.MessageDirection.serverToClient,t.type=new Jc.ProtocolRequestType(t.method),t.capabilities=Jc.CM.create("window.workDoneProgress",void 0)})(TR||(vi.WorkDoneProgressCreateRequest=TR={}));var _R;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Jc.MessageDirection.clientToServer,t.type=new Jc.ProtocolNotificationType(t.method)})(_R||(vi.WorkDoneProgressCancelNotification=_R={}))});var RR=he(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.CallHierarchyOutgoingCallsRequest=bi.CallHierarchyIncomingCallsRequest=bi.CallHierarchyPrepareRequest=void 0;var Nn=rt(),vR;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Nn.MessageDirection.clientToServer,t.type=new Nn.ProtocolRequestType(t.method),t.capabilities=Nn.CM.create("textDocument.callHierarchy","callHierarchyProvider")})(vR||(bi.CallHierarchyPrepareRequest=vR={}));var bR;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Nn.MessageDirection.clientToServer,t.type=new Nn.ProtocolRequestType(t.method),t.capabilities=Nn.CM.create("textDocument.callHierarchy","callHierarchyProvider")})(bR||(bi.CallHierarchyIncomingCallsRequest=bR={}));var wR;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Nn.MessageDirection.clientToServer,t.type=new Nn.ProtocolRequestType(t.method),t.capabilities=Nn.CM.create("textDocument.callHierarchy","callHierarchyProvider")})(wR||(bi.CallHierarchyOutgoingCallsRequest=wR={}))});var PR=he(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.SemanticTokensRefreshRequest=Kt.SemanticTokensRangeRequest=Kt.SemanticTokensDeltaRequest=Kt.SemanticTokensRequest=Kt.SemanticTokensRegistrationType=Kt.TokenFormat=void 0;var sr=rt(),SR;(function(t){t.Relative="relative"})(SR||(Kt.TokenFormat=SR={}));var Qc;(function(t){t.method="textDocument/semanticTokens",t.type=new sr.RegistrationType(t.method)})(Qc||(Kt.SemanticTokensRegistrationType=Qc={}));var AR;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=sr.MessageDirection.clientToServer,t.type=new sr.ProtocolRequestType(t.method),t.registrationMethod=Qc.method,t.capabilities=sr.CM.create("textDocument.semanticTokens","semanticTokensProvider")})(AR||(Kt.SemanticTokensRequest=AR={}));var IR;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=sr.MessageDirection.clientToServer,t.type=new sr.ProtocolRequestType(t.method),t.registrationMethod=Qc.method,t.capabilities=sr.CM.create("textDocument.semanticTokens.requests.full.delta","semanticTokensProvider.full.delta")})(IR||(Kt.SemanticTokensDeltaRequest=IR={}));var kR;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=sr.MessageDirection.clientToServer,t.type=new sr.ProtocolRequestType(t.method),t.registrationMethod=Qc.method,t.capabilities=sr.CM.create("textDocument.semanticTokens.requests.range","semanticTokensProvider.range")})(kR||(Kt.SemanticTokensRangeRequest=kR={}));var NR;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=sr.MessageDirection.serverToClient,t.type=new sr.ProtocolRequestType0(t.method),t.capabilities=sr.CM.create("workspace.semanticTokens.refreshSupport",void 0)})(NR||(Kt.SemanticTokensRefreshRequest=NR={}))});var OR=he(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.ShowDocumentRequest=void 0;var xx=rt(),CR;(function(t){t.method="window/showDocument",t.messageDirection=xx.MessageDirection.serverToClient,t.type=new xx.ProtocolRequestType(t.method),t.capabilities=xx.CM.create("window.showDocument.support",void 0)})(CR||(Td.ShowDocumentRequest=CR={}))});var DR=he(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});_d.LinkedEditingRangeRequest=void 0;var Tx=rt(),LR;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=Tx.MessageDirection.clientToServer,t.type=new Tx.ProtocolRequestType(t.method),t.capabilities=Tx.CM.create("textDocument.linkedEditingRange","linkedEditingRangeProvider")})(LR||(_d.LinkedEditingRangeRequest=LR={}))});var HR=he(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.WillDeleteFilesRequest=Mt.DidDeleteFilesNotification=Mt.DidRenameFilesNotification=Mt.WillRenameFilesRequest=Mt.DidCreateFilesNotification=Mt.WillCreateFilesRequest=Mt.FileOperationPatternKind=void 0;var St=rt(),MR;(function(t){t.file="file",t.folder="folder"})(MR||(Mt.FileOperationPatternKind=MR={}));var $R;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=St.MessageDirection.clientToServer,t.type=new St.ProtocolRequestType(t.method),t.capabilities=St.CM.create("workspace.fileOperations.willCreate","workspace.fileOperations.willCreate")})($R||(Mt.WillCreateFilesRequest=$R={}));var FR;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=St.MessageDirection.clientToServer,t.type=new St.ProtocolNotificationType(t.method),t.capabilities=St.CM.create("workspace.fileOperations.didCreate","workspace.fileOperations.didCreate")})(FR||(Mt.DidCreateFilesNotification=FR={}));var UR;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=St.MessageDirection.clientToServer,t.type=new St.ProtocolRequestType(t.method),t.capabilities=St.CM.create("workspace.fileOperations.willRename","workspace.fileOperations.willRename")})(UR||(Mt.WillRenameFilesRequest=UR={}));var BR;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=St.MessageDirection.clientToServer,t.type=new St.ProtocolNotificationType(t.method),t.capabilities=St.CM.create("workspace.fileOperations.didRename","workspace.fileOperations.didRename")})(BR||(Mt.DidRenameFilesNotification=BR={}));var GR;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=St.MessageDirection.clientToServer,t.type=new St.ProtocolNotificationType(t.method),t.capabilities=St.CM.create("workspace.fileOperations.didDelete","workspace.fileOperations.didDelete")})(GR||(Mt.DidDeleteFilesNotification=GR={}));var XR;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=St.MessageDirection.clientToServer,t.type=new St.ProtocolRequestType(t.method),t.capabilities=St.CM.create("workspace.fileOperations.willDelete","workspace.fileOperations.willDelete")})(XR||(Mt.WillDeleteFilesRequest=XR={}))});var qR=he(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.MonikerRequest=wi.MonikerKind=wi.UniquenessLevel=void 0;var _x=rt(),jR;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(jR||(wi.UniquenessLevel=jR={}));var zR;(function(t){t.$import="import",t.$export="export",t.local="local"})(zR||(wi.MonikerKind=zR={}));var WR;(function(t){t.method="textDocument/moniker",t.messageDirection=_x.MessageDirection.clientToServer,t.type=new _x.ProtocolRequestType(t.method),t.capabilities=_x.CM.create("textDocument.moniker","monikerProvider")})(WR||(wi.MonikerRequest=WR={}))});var ZR=he(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.TypeHierarchySubtypesRequest=Ri.TypeHierarchySupertypesRequest=Ri.TypeHierarchyPrepareRequest=void 0;var ho=rt(),VR;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=ho.MessageDirection.clientToServer,t.type=new ho.ProtocolRequestType(t.method),t.capabilities=ho.CM.create("textDocument.typeHierarchy","typeHierarchyProvider")})(VR||(Ri.TypeHierarchyPrepareRequest=VR={}));var YR;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=ho.MessageDirection.clientToServer,t.type=new ho.ProtocolRequestType(t.method)})(YR||(Ri.TypeHierarchySupertypesRequest=YR={}));var KR;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=ho.MessageDirection.clientToServer,t.type=new ho.ProtocolRequestType(t.method)})(KR||(Ri.TypeHierarchySubtypesRequest=KR={}))});var eS=he(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.InlineValueRefreshRequest=Ys.InlineValueRequest=void 0;var Vs=rt(),JR;(function(t){t.method="textDocument/inlineValue",t.messageDirection=Vs.MessageDirection.clientToServer,t.type=new Vs.ProtocolRequestType(t.method),t.capabilities=Vs.CM.create("textDocument.inlineValue","inlineValueProvider")})(JR||(Ys.InlineValueRequest=JR={}));var QR;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=Vs.MessageDirection.serverToClient,t.type=new Vs.ProtocolRequestType0(t.method),t.capabilities=Vs.CM.create("workspace.inlineValue.refreshSupport",void 0)})(QR||(Ys.InlineValueRefreshRequest=QR={}))});var iS=he(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.InlayHintRefreshRequest=Si.InlayHintResolveRequest=Si.InlayHintRequest=void 0;var Pn=rt(),tS;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Pn.MessageDirection.clientToServer,t.type=new Pn.ProtocolRequestType(t.method),t.capabilities=Pn.CM.create("textDocument.inlayHint","inlayHintProvider")})(tS||(Si.InlayHintRequest=tS={}));var rS;(function(t){t.method="inlayHint/resolve",t.messageDirection=Pn.MessageDirection.clientToServer,t.type=new Pn.ProtocolRequestType(t.method),t.capabilities=Pn.CM.create("textDocument.inlayHint.resolveSupport","inlayHintProvider.resolveProvider")})(rS||(Si.InlayHintResolveRequest=rS={}));var nS;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Pn.MessageDirection.serverToClient,t.type=new Pn.ProtocolRequestType0(t.method),t.capabilities=Pn.CM.create("workspace.inlayHint.refreshSupport",void 0)})(nS||(Si.InlayHintRefreshRequest=nS={}))});var fS=he(At=>{"use strict";var c2=At&&At.__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]})),l2=At&&At.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),u2=At&&At.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&c2(r,e,n[i]);return l2(r,e),r}})();Object.defineProperty(At,"__esModule",{value:!0});At.DiagnosticRefreshRequest=At.WorkspaceDiagnosticRequest=At.DocumentDiagnosticRequest=At.DocumentDiagnosticReportKind=At.DiagnosticServerCancellationData=void 0;var uS=Bs(),f2=u2(pd()),Cn=rt(),oS;(function(t){function e(r){let n=r;return n&&f2.boolean(n.retriggerRequest)}t.is=e})(oS||(At.DiagnosticServerCancellationData=oS={}));var sS;(function(t){t.Full="full",t.Unchanged="unchanged"})(sS||(At.DocumentDiagnosticReportKind=sS={}));var aS;(function(t){t.method="textDocument/diagnostic",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolRequestType(t.method),t.partialResult=new uS.ProgressType,t.capabilities=Cn.CM.create("textDocument.diagnostic","diagnosticProvider")})(aS||(At.DocumentDiagnosticRequest=aS={}));var cS;(function(t){t.method="workspace/diagnostic",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolRequestType(t.method),t.partialResult=new uS.ProgressType,t.capabilities=Cn.CM.create("workspace.diagnostics","diagnosticProvider.workspaceDiagnostics")})(cS||(At.WorkspaceDiagnosticRequest=cS={}));var lS;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=Cn.MessageDirection.serverToClient,t.type=new Cn.ProtocolRequestType0(t.method),t.capabilities=Cn.CM.create("workspace.diagnostics.refreshSupport",void 0)})(lS||(At.DiagnosticRefreshRequest=lS={}))});var xS=he(Xe=>{"use strict";var d2=Xe&&Xe.__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]})),p2=Xe&&Xe.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),h2=Xe&&Xe.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&d2(r,e,n[i]);return p2(r,e),r}})();Object.defineProperty(Xe,"__esModule",{value:!0});Xe.DidCloseNotebookDocumentNotification=Xe.DidSaveNotebookDocumentNotification=Xe.DidChangeNotebookDocumentNotification=Xe.NotebookCellArrayChange=Xe.DidOpenNotebookDocumentNotification=Xe.NotebookDocumentSyncRegistrationType=Xe.NotebookDocument=Xe.NotebookCell=Xe.ExecutionSummary=Xe.NotebookCellKind=void 0;var el=(ks(),tu(Hf)),Cr=h2(pd()),nn=rt(),Ex;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(Ex||(Xe.NotebookCellKind=Ex={}));var vx;(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 Cr.objectLiteral(o)&&el.uinteger.is(o.executionOrder)&&(o.success===void 0||Cr.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})(vx||(Xe.ExecutionSummary=vx={}));var Ed;(function(t){function e(o,s){return{kind:o,document:s}}t.create=e;function r(o){let s=o;return Cr.objectLiteral(s)&&Ex.is(s.kind)&&el.DocumentUri.is(s.document)&&(s.metadata===void 0||Cr.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)&&!vx.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(Cr.objectLiteral(o)&&Cr.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}})(Ed||(Xe.NotebookCell=Ed={}));var dS;(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 Cr.objectLiteral(i)&&Cr.string(i.uri)&&el.integer.is(i.version)&&Cr.typedArray(i.cells,Ed.is)}t.is=r})(dS||(Xe.NotebookDocument=dS={}));var Ks;(function(t){t.method="notebookDocument/sync",t.messageDirection=nn.MessageDirection.clientToServer,t.type=new nn.RegistrationType(t.method)})(Ks||(Xe.NotebookDocumentSyncRegistrationType=Ks={}));var pS;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=nn.MessageDirection.clientToServer,t.type=new nn.ProtocolNotificationType(t.method),t.registrationMethod=Ks.method})(pS||(Xe.DidOpenNotebookDocumentNotification=pS={}));var hS;(function(t){function e(n){let i=n;return Cr.objectLiteral(i)&&el.uinteger.is(i.start)&&el.uinteger.is(i.deleteCount)&&(i.cells===void 0||Cr.typedArray(i.cells,Ed.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})(hS||(Xe.NotebookCellArrayChange=hS={}));var mS;(function(t){t.method="notebookDocument/didChange",t.messageDirection=nn.MessageDirection.clientToServer,t.type=new nn.ProtocolNotificationType(t.method),t.registrationMethod=Ks.method})(mS||(Xe.DidChangeNotebookDocumentNotification=mS={}));var gS;(function(t){t.method="notebookDocument/didSave",t.messageDirection=nn.MessageDirection.clientToServer,t.type=new nn.ProtocolNotificationType(t.method),t.registrationMethod=Ks.method})(gS||(Xe.DidSaveNotebookDocumentNotification=gS={}));var yS;(function(t){t.method="notebookDocument/didClose",t.messageDirection=nn.MessageDirection.clientToServer,t.type=new nn.ProtocolNotificationType(t.method),t.registrationMethod=Ks.method})(yS||(Xe.DidCloseNotebookDocumentNotification=yS={}))});var _S=he(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.InlineCompletionRequest=void 0;var bx=rt(),TS;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=bx.MessageDirection.clientToServer,t.type=new bx.ProtocolRequestType(t.method),t.capabilities=bx.CM.create("textDocument.inlineCompletion","inlineCompletionProvider")})(TS||(vd.InlineCompletionRequest=TS={}))});var bS=he(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.TextDocumentContentRefreshRequest=Zs.TextDocumentContentRequest=void 0;var tl=rt(),ES;(function(t){t.method="workspace/textDocumentContent",t.messageDirection=tl.MessageDirection.clientToServer,t.type=new tl.ProtocolRequestType(t.method),t.capabilities=tl.CM.create("workspace.textDocumentContent","workspace.textDocumentContent")})(ES||(Zs.TextDocumentContentRequest=ES={}));var vS;(function(t){t.method="workspace/textDocumentContent/refresh",t.messageDirection=tl.MessageDirection.serverToClient,t.type=new tl.ProtocolRequestType(t.method)})(vS||(Zs.TextDocumentContentRefreshRequest=vS={}))});var $A=he(g=>{"use strict";var m2=g&&g.__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]})),g2=g&&g.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),y2=g&&g.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&m2(r,e,n[i]);return g2(r,e),r}})();Object.defineProperty(g,"__esModule",{value:!0});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.GlobPattern=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.RegularExpressionEngineKind=g.FailureHandlingKind=g.ResourceOperationKind=g.UnregistrationRequest=g.RegistrationRequest=g.DocumentSelector=g.NotebookCellTextDocumentFilter=g.NotebookDocumentFilter=g.TextDocumentFilter=void 0;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=g.WorkspaceSymbolRequest=g.CodeActionResolveRequest=void 0;g.TextDocumentContentRefreshRequest=g.TextDocumentContentRequest=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=g.MonikerRequest=g.MonikerKind=void 0;var C=rt(),wS=(ks(),tu(Hf)),It=y2(pd()),x2=eR();Object.defineProperty(g,"ImplementationRequest",{enumerable:!0,get:function(){return x2.ImplementationRequest}});var T2=rR();Object.defineProperty(g,"TypeDefinitionRequest",{enumerable:!0,get:function(){return T2.TypeDefinitionRequest}});var CA=oR();Object.defineProperty(g,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return CA.WorkspaceFoldersRequest}});Object.defineProperty(g,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return CA.DidChangeWorkspaceFoldersNotification}});var _2=aR();Object.defineProperty(g,"ConfigurationRequest",{enumerable:!0,get:function(){return _2.ConfigurationRequest}});var OA=uR();Object.defineProperty(g,"DocumentColorRequest",{enumerable:!0,get:function(){return OA.DocumentColorRequest}});Object.defineProperty(g,"ColorPresentationRequest",{enumerable:!0,get:function(){return OA.ColorPresentationRequest}});var LA=pR();Object.defineProperty(g,"FoldingRangeRequest",{enumerable:!0,get:function(){return LA.FoldingRangeRequest}});Object.defineProperty(g,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return LA.FoldingRangeRefreshRequest}});var E2=mR();Object.defineProperty(g,"DeclarationRequest",{enumerable:!0,get:function(){return E2.DeclarationRequest}});var v2=yR();Object.defineProperty(g,"SelectionRangeRequest",{enumerable:!0,get:function(){return v2.SelectionRangeRequest}});var Nx=ER();Object.defineProperty(g,"WorkDoneProgress",{enumerable:!0,get:function(){return Nx.WorkDoneProgress}});Object.defineProperty(g,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Nx.WorkDoneProgressCreateRequest}});Object.defineProperty(g,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Nx.WorkDoneProgressCancelNotification}});var Px=RR();Object.defineProperty(g,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Px.CallHierarchyIncomingCallsRequest}});Object.defineProperty(g,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Px.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(g,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Px.CallHierarchyPrepareRequest}});var Js=PR();Object.defineProperty(g,"TokenFormat",{enumerable:!0,get:function(){return Js.TokenFormat}});Object.defineProperty(g,"SemanticTokensRequest",{enumerable:!0,get:function(){return Js.SemanticTokensRequest}});Object.defineProperty(g,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Js.SemanticTokensDeltaRequest}});Object.defineProperty(g,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Js.SemanticTokensRangeRequest}});Object.defineProperty(g,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Js.SemanticTokensRefreshRequest}});Object.defineProperty(g,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Js.SemanticTokensRegistrationType}});var b2=OR();Object.defineProperty(g,"ShowDocumentRequest",{enumerable:!0,get:function(){return b2.ShowDocumentRequest}});var w2=DR();Object.defineProperty(g,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return w2.LinkedEditingRangeRequest}});var mo=HR();Object.defineProperty(g,"FileOperationPatternKind",{enumerable:!0,get:function(){return mo.FileOperationPatternKind}});Object.defineProperty(g,"DidCreateFilesNotification",{enumerable:!0,get:function(){return mo.DidCreateFilesNotification}});Object.defineProperty(g,"WillCreateFilesRequest",{enumerable:!0,get:function(){return mo.WillCreateFilesRequest}});Object.defineProperty(g,"DidRenameFilesNotification",{enumerable:!0,get:function(){return mo.DidRenameFilesNotification}});Object.defineProperty(g,"WillRenameFilesRequest",{enumerable:!0,get:function(){return mo.WillRenameFilesRequest}});Object.defineProperty(g,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return mo.DidDeleteFilesNotification}});Object.defineProperty(g,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return mo.WillDeleteFilesRequest}});var Cx=qR();Object.defineProperty(g,"UniquenessLevel",{enumerable:!0,get:function(){return Cx.UniquenessLevel}});Object.defineProperty(g,"MonikerKind",{enumerable:!0,get:function(){return Cx.MonikerKind}});Object.defineProperty(g,"MonikerRequest",{enumerable:!0,get:function(){return Cx.MonikerRequest}});var Ox=ZR();Object.defineProperty(g,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Ox.TypeHierarchyPrepareRequest}});Object.defineProperty(g,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Ox.TypeHierarchySubtypesRequest}});Object.defineProperty(g,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Ox.TypeHierarchySupertypesRequest}});var DA=eS();Object.defineProperty(g,"InlineValueRequest",{enumerable:!0,get:function(){return DA.InlineValueRequest}});Object.defineProperty(g,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return DA.InlineValueRefreshRequest}});var Lx=iS();Object.defineProperty(g,"InlayHintRequest",{enumerable:!0,get:function(){return Lx.InlayHintRequest}});Object.defineProperty(g,"InlayHintResolveRequest",{enumerable:!0,get:function(){return Lx.InlayHintResolveRequest}});Object.defineProperty(g,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return Lx.InlayHintRefreshRequest}});var rl=fS();Object.defineProperty(g,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return rl.DiagnosticServerCancellationData}});Object.defineProperty(g,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return rl.DocumentDiagnosticReportKind}});Object.defineProperty(g,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return rl.DocumentDiagnosticRequest}});Object.defineProperty(g,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return rl.WorkspaceDiagnosticRequest}});Object.defineProperty(g,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return rl.DiagnosticRefreshRequest}});var on=xS();Object.defineProperty(g,"NotebookCellKind",{enumerable:!0,get:function(){return on.NotebookCellKind}});Object.defineProperty(g,"ExecutionSummary",{enumerable:!0,get:function(){return on.ExecutionSummary}});Object.defineProperty(g,"NotebookCell",{enumerable:!0,get:function(){return on.NotebookCell}});Object.defineProperty(g,"NotebookDocument",{enumerable:!0,get:function(){return on.NotebookDocument}});Object.defineProperty(g,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return on.NotebookDocumentSyncRegistrationType}});Object.defineProperty(g,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return on.DidOpenNotebookDocumentNotification}});Object.defineProperty(g,"NotebookCellArrayChange",{enumerable:!0,get:function(){return on.NotebookCellArrayChange}});Object.defineProperty(g,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return on.DidChangeNotebookDocumentNotification}});Object.defineProperty(g,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return on.DidSaveNotebookDocumentNotification}});Object.defineProperty(g,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return on.DidCloseNotebookDocumentNotification}});var R2=_S();Object.defineProperty(g,"InlineCompletionRequest",{enumerable:!0,get:function(){return R2.InlineCompletionRequest}});var MA=bS();Object.defineProperty(g,"TextDocumentContentRequest",{enumerable:!0,get:function(){return MA.TextDocumentContentRequest}});Object.defineProperty(g,"TextDocumentContentRefreshRequest",{enumerable:!0,get:function(){return MA.TextDocumentContentRefreshRequest}});var wx;(function(t){function e(r){let n=r;return It.string(n)||It.string(n.language)||It.string(n.scheme)||kx.is(n.pattern)}t.is=e})(wx||(g.TextDocumentFilter=wx={}));var Rx;(function(t){function e(r){let n=r;return It.objectLiteral(n)&&(It.string(n.notebookType)||It.string(n.scheme)||It.string(n.pattern))}t.is=e})(Rx||(g.NotebookDocumentFilter=Rx={}));var Sx;(function(t){function e(r){let n=r;return It.objectLiteral(n)&&(It.string(n.notebook)||Rx.is(n.notebook))&&(n.language===void 0||It.string(n.language))}t.is=e})(Sx||(g.NotebookCellTextDocumentFilter=Sx={}));var Ax;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!It.string(n)&&!wx.is(n)&&!Sx.is(n))return!1;return!0}t.is=e})(Ax||(g.DocumentSelector=Ax={}));var RS;(function(t){t.method="client/registerCapability",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType(t.method)})(RS||(g.RegistrationRequest=RS={}));var SS;(function(t){t.method="client/unregisterCapability",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType(t.method)})(SS||(g.UnregistrationRequest=SS={}));var AS;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(AS||(g.ResourceOperationKind=AS={}));var IS;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(IS||(g.FailureHandlingKind=IS={}));var kS;(function(t){t.ES2020="ES2020"})(kS||(g.RegularExpressionEngineKind=kS={}));var NS;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(NS||(g.PositionEncodingKind=NS={}));var PS;(function(t){function e(r){let n=r;return n&&It.string(n.id)&&n.id.length>0}t.hasId=e})(PS||(g.StaticRegistrationOptions=PS={}));var CS;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||Ax.is(n.documentSelector))}t.is=e})(CS||(g.TextDocumentRegistrationOptions=CS={}));var OS;(function(t){function e(n){let i=n;return It.objectLiteral(i)&&(i.workDoneProgress===void 0||It.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&It.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})(OS||(g.WorkDoneProgressOptions=OS={}));var LS;(function(t){t.method="initialize",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(LS||(g.InitializeRequest=LS={}));var DS;(function(t){t.unknownProtocolVersion=1})(DS||(g.InitializeErrorCodes=DS={}));var MS;(function(t){t.method="initialized",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(MS||(g.InitializedNotification=MS={}));var $S;(function(t){t.method="shutdown",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType0(t.method)})($S||(g.ShutdownRequest=$S={}));var FS;(function(t){t.method="exit",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType0(t.method)})(FS||(g.ExitNotification=FS={}));var US;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method),t.capabilities=C.CM.create("workspace.didChangeConfiguration",void 0)})(US||(g.DidChangeConfigurationNotification=US={}));var BS;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(BS||(g.MessageType=BS={}));var GS;(function(t){t.method="window/showMessage",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method),t.capabilities=C.CM.create("window.showMessage",void 0)})(GS||(g.ShowMessageNotification=GS={}));var XS;(function(t){t.method="window/showMessageRequest",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("window.showMessage",void 0)})(XS||(g.ShowMessageRequest=XS={}));var HS;(function(t){t.method="window/logMessage",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method)})(HS||(g.LogMessageNotification=HS={}));var jS;(function(t){t.method="telemetry/event",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method)})(jS||(g.TelemetryEventNotification=jS={}));var zS;(function(t){t.None=0,t.Full=1,t.Incremental=2})(zS||(g.TextDocumentSyncKind=zS={}));var WS;(function(t){t.method="textDocument/didOpen",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method),t.capabilities=C.CM.create("textDocument.synchronization","textDocumentSync.openClose")})(WS||(g.DidOpenTextDocumentNotification=WS={}));var qS;(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})(qS||(g.TextDocumentContentChangeEvent=qS={}));var VS;(function(t){t.method="textDocument/didChange",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method),t.capabilities=C.CM.create("textDocument.synchronization","textDocumentSync")})(VS||(g.DidChangeTextDocumentNotification=VS={}));var YS;(function(t){t.method="textDocument/didClose",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method),t.capabilities=C.CM.create("textDocument.synchronization","textDocumentSync.openClose")})(YS||(g.DidCloseTextDocumentNotification=YS={}));var KS;(function(t){t.method="textDocument/didSave",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method),t.capabilities=C.CM.create("textDocument.synchronization.didSave","textDocumentSync.save")})(KS||(g.DidSaveTextDocumentNotification=KS={}));var ZS;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(ZS||(g.TextDocumentSaveReason=ZS={}));var JS;(function(t){t.method="textDocument/willSave",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method),t.capabilities=C.CM.create("textDocument.synchronization.willSave","textDocumentSync.willSave")})(JS||(g.WillSaveTextDocumentNotification=JS={}));var QS;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.synchronization.willSaveWaitUntil","textDocumentSync.willSaveWaitUntil")})(QS||(g.WillSaveTextDocumentWaitUntilRequest=QS={}));var eA;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method),t.capabilities=C.CM.create("workspace.didChangeWatchedFiles",void 0)})(eA||(g.DidChangeWatchedFilesNotification=eA={}));var tA;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(tA||(g.FileChangeType=tA={}));var Ix;(function(t){function e(r){let n=r;return It.objectLiteral(n)&&(wS.URI.is(n.baseUri)||wS.WorkspaceFolder.is(n.baseUri))&&It.string(n.pattern)}t.is=e})(Ix||(g.RelativePattern=Ix={}));var kx;(function(t){function e(r){let n=r;return It.string(n)||Ix.is(n)}t.is=e})(kx||(g.GlobPattern=kx={}));var rA;(function(t){t.Create=1,t.Change=2,t.Delete=4})(rA||(g.WatchKind=rA={}));var nA;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method),t.capabilities=C.CM.create("textDocument.publishDiagnostics",void 0)})(nA||(g.PublishDiagnosticsNotification=nA={}));var iA;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(iA||(g.CompletionTriggerKind=iA={}));var oA;(function(t){t.method="textDocument/completion",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.completion","completionProvider")})(oA||(g.CompletionRequest=oA={}));var sA;(function(t){t.method="completionItem/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.completion.completionItem.resolveSupport","completionProvider.resolveProvider")})(sA||(g.CompletionResolveRequest=sA={}));var aA;(function(t){t.method="textDocument/hover",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.hover","hoverProvider")})(aA||(g.HoverRequest=aA={}));var cA;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(cA||(g.SignatureHelpTriggerKind=cA={}));var lA;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.signatureHelp","signatureHelpProvider")})(lA||(g.SignatureHelpRequest=lA={}));var uA;(function(t){t.method="textDocument/definition",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.definition","definitionProvider")})(uA||(g.DefinitionRequest=uA={}));var fA;(function(t){t.method="textDocument/references",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.references","referencesProvider")})(fA||(g.ReferencesRequest=fA={}));var dA;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.documentHighlight","documentHighlightProvider")})(dA||(g.DocumentHighlightRequest=dA={}));var pA;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.documentSymbol","documentSymbolProvider")})(pA||(g.DocumentSymbolRequest=pA={}));var hA;(function(t){t.method="textDocument/codeAction",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.codeAction","codeActionProvider")})(hA||(g.CodeActionRequest=hA={}));var mA;(function(t){t.method="codeAction/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.codeAction.resolveSupport","codeActionProvider.resolveProvider")})(mA||(g.CodeActionResolveRequest=mA={}));var gA;(function(t){t.method="workspace/symbol",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("workspace.symbol","workspaceSymbolProvider")})(gA||(g.WorkspaceSymbolRequest=gA={}));var yA;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("workspace.symbol.resolveSupport","workspaceSymbolProvider.resolveProvider")})(yA||(g.WorkspaceSymbolResolveRequest=yA={}));var xA;(function(t){t.method="textDocument/codeLens",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.codeLens","codeLensProvider")})(xA||(g.CodeLensRequest=xA={}));var TA;(function(t){t.method="codeLens/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.codeLens.resolveSupport","codeLensProvider.resolveProvider")})(TA||(g.CodeLensResolveRequest=TA={}));var _A;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType0(t.method),t.capabilities=C.CM.create("workspace.codeLens",void 0)})(_A||(g.CodeLensRefreshRequest=_A={}));var EA;(function(t){t.method="textDocument/documentLink",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.documentLink","documentLinkProvider")})(EA||(g.DocumentLinkRequest=EA={}));var vA;(function(t){t.method="documentLink/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.documentLink","documentLinkProvider.resolveProvider")})(vA||(g.DocumentLinkResolveRequest=vA={}));var bA;(function(t){t.method="textDocument/formatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.formatting","documentFormattingProvider")})(bA||(g.DocumentFormattingRequest=bA={}));var wA;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.rangeFormatting","documentRangeFormattingProvider")})(wA||(g.DocumentRangeFormattingRequest=wA={}));var RA;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.rangeFormatting.rangesSupport","documentRangeFormattingProvider.rangesSupport")})(RA||(g.DocumentRangesFormattingRequest=RA={}));var SA;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.onTypeFormatting","documentOnTypeFormattingProvider")})(SA||(g.DocumentOnTypeFormattingRequest=SA={}));var AA;(function(t){t.Identifier=1})(AA||(g.PrepareSupportDefaultBehavior=AA={}));var IA;(function(t){t.method="textDocument/rename",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.rename","renameProvider")})(IA||(g.RenameRequest=IA={}));var kA;(function(t){t.method="textDocument/prepareRename",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.rename.prepareSupport","renameProvider.prepareProvider")})(kA||(g.PrepareRenameRequest=kA={}));var NA;(function(t){t.method="workspace/executeCommand",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("workspace.executeCommand","executeCommandProvider")})(NA||(g.ExecuteCommandRequest=NA={}));var PA;(function(t){t.method="workspace/applyEdit",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType("workspace/applyEdit"),t.capabilities=C.CM.create("workspace.applyEdit",void 0)})(PA||(g.ApplyWorkspaceEditRequest=PA={}))});var UA=he(Dx=>{"use strict";Object.defineProperty(Dx,"__esModule",{value:!0});Dx.createProtocolConnection=S2;var FA=Bs();function S2(t,e,r,n){return FA.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,FA.createMessageConnection)(t,e,r,n)}});var wd=he(Zt=>{"use strict";var A2=Zt&&Zt.__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]})),bd=Zt&&Zt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&A2(e,t,r)};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.LSPErrorCodes=Zt.createProtocolConnection=void 0;bd(Bs(),Zt);bd((ks(),tu(Hf)),Zt);bd(rt(),Zt);bd($A(),Zt);var I2=UA();Object.defineProperty(Zt,"createProtocolConnection",{enumerable:!0,get:function(){return I2.createProtocolConnection}});var BA;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(BA||(Zt.LSPErrorCodes=BA={}))});var RI={};eu(RI,{nodeReadFile:()=>iU});async function iU(){throw new Error("nowline: filesystem readers are unavailable in the browser embed")}var SI=J_(()=>{});var wX={};eu(wX,{EmbedRenderError:()=>Vl,__resetForTests:()=>bX,init:()=>Y_,initialize:()=>TX,parse:()=>EX,render:()=>_X,run:()=>vX,sha:()=>yX,version:()=>gX});var nC=new Set(["none","multiplier","person","people","points","time"]),iC=/^\d+$/,oC=/^\d+\.\d+$/,sC=/^\d+(?:\.\d+)?%$/;function qn(t){if(!t)return null;if(iC.test(t)){let e=parseInt(t,10);return e>0?e:null}if(oC.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?e:null}if(sC.test(t)){let e=parseFloat(t.slice(0,-1))/100;return Number.isFinite(e)&&e>0?e:null}return null}function Wa(t){if(Number.isInteger(t))return String(t);let e=t.toFixed(6);return e=e.replace(/0+$/,""),e=e.replace(/\.$/,""),e}function aC(t){return t.key.endsWith(":")?t.key.slice(0,-1):t.key}function cC(t){for(let e of t.properties)if(aC(e)==="unicode"&&e.value)return e.value}function qa(t,e){if(t==="none")return null;if(nC.has(t))return{kind:"builtin",name:t};let r=e.get(t);return r?{kind:"literal",text:cC(r)??t}:{kind:"literal",text:t}}function Xi(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 Va(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 Ya(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 Sh(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}}var eE="lexing-error",tE="parsing-error";function rE(t){if(!t||typeof t!="object")return!1;let e=t.code;return e===eE||e===tE}function Ah(t){let e=[];for(let r of t.parseResult.lexerErrors)e.push({origin:"lexer",error:r});for(let r of t.parseResult.parserErrors)e.push({origin:"parser",error:r});for(let r of t.diagnostics??[]){let n=r;rE(n.data)||e.push({origin:"validation",diagnostic:n})}return e}var lC=/did you mean ['"]?([^'"?]+)['"]?\??/i;function Ih(t){let e=t.match(lC);return e?e[1].trim():void 0}function nE(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 iE(t){if(!t||typeof t!="object")return;let e=t;if(typeof e.code=="string"&&Array.isArray(e.args))return e.code}function kh(t){let e=iE(t.data);return e||(typeof t.code=="string"&&t.code!==""?t.code:typeof t.code=="number"?String(t.code):nE(t.message))}function yt(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function Pt(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}function hr(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}function oE(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function Do(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}var Lo=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 yt(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}}isComplete(e){let r=this.getTypeMetaData(e.$type);for(let n of Object.keys(r.properties)){let i=r.properties[n];if(i.optional)continue;let o=e[i.name];if(o==null)return!1}return!0}};function Vn(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function ru(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function nu(t){return Vn(t)&&typeof t.fullText=="string"}var br=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 zt})}join(e=","){let r=this.iterator(),n="",i,o=!1;do i=r.next(),i.done||(o&&(n+=e),n+=fC(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?zt:{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 zt})}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(iu(o))r.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}}while(r.iterator);return zt})}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(iu(o))n.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}while(n.iterator);return zt})}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?zt: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 zt})}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 fC(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function iu(t){return!!t&&typeof t[Symbol.iterator]=="function"}var su=new br(()=>{},()=>zt),zt=Object.freeze({done:!0,value:void 0});function we(...t){if(t.length===1){let e=t[0];if(e instanceof br)return e;if(iu(e))return new br(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new br(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:zt)}return t.length>1?new br(()=>({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++];iu(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return zt}):su}var Yn=class extends br{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 zt})}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}},ou;(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})(ou||(ou={}));function au(t,e={}){for(let[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,o)=>{yt(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=o,e.deep&&au(i,e))}):yt(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&au(n,e)))}function Mo(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function Ft(t){let r=Ka(t).$document;if(!r)throw new Error("AST node has no document.");return r}function Ka(t){for(;t.$container;)t=t.$container;return t}function Ph(t){return Pt(t)?t.ref?[t.ref]:[]:hr(t)?t.items.map(e=>e.ref):[]}function cu(t,e){if(!t)throw new Error("Node must be an AstNode.");let r=e?.range;return new br(()=>({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(yt(o)){if(n.keyIndex++,Nh(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(yt(a)&&Nh(a,r))return{done:!1,value:a}}n.arrayIndex=0}}n.keyIndex++}return zt})}function qr(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Yn(t,r=>cu(r,e))}function Wt(t,e){if(t){if(e?.range&&!Nh(t,e.range))return new Yn(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new Yn(t,r=>cu(r,e),{includeRoot:!0})}function Nh(t,e){if(!e)return!0;let r=t.$cstNode?.range;return r?cE(r,e):!1}function Hi(t){return new br(()=>({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(Pt(n)||hr(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(Pt(o)||hr(n))return{done:!1,value:{reference:o,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return zt})}function sE(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]=aE(i.defaultValue))}function aE(t){return Array.isArray(t)?[...t.map(aE)]:t}var rr={$type:"AbstractElement",cardinality:"cardinality"};function Tu(t){return Ee.isInstance(t,rr.$type)}var du={$type:"AbstractParserRule"};function Zn(t){return Ee.isInstance(t,du.$type)}var lu={$type:"AbstractRule"};var wr={$type:"AbstractType"};var zi={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Jn(t){return Ee.isInstance(t,zi.$type)}var pu={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Gh(t){return Ee.isInstance(t,pu.$type)}var lE={$type:"ArrayLiteral",elements:"elements"};var Oh={$type:"ArrayType",elementType:"elementType"};function hE(t){return Ee.isInstance(t,Oh.$type)}var Wi={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function Yr(t){return Ee.isInstance(t,Wi.$type)}var Lh={$type:"BooleanLiteral",true:"true"};function mE(t){return Ee.isInstance(t,Lh.$type)}var qi={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function gE(t){return Ee.isInstance(t,qi.$type)}var $o={$type:"Condition"};var hu={$type:"Conjunction",left:"left",right:"right"};function yE(t){return Ee.isInstance(t,hu.$type)}var Vi={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Kr(t){return Ee.isInstance(t,Vi.$type)}var mu={$type:"Disjunction",left:"left",right:"right"};function xE(t){return Ee.isInstance(t,mu.$type)}var Dh={$type:"EndOfFile",cardinality:"cardinality"};function TE(t){return Ee.isInstance(t,Dh.$type)}var ji={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};var uE={$type:"GrammarImport",path:"path"};var Fo={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Yi(t){return Ee.isInstance(t,Fo.$type)}var Mh={$type:"InferredType",name:"name"};function _u(t){return Ee.isInstance(t,Mh.$type)}var hn={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function Ki(t){return Ee.isInstance(t,hn.$type)}var Ch={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};var fE={$type:"InfixRuleOperators",precedences:"precedences"};var ec={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function _E(t){return Ee.isInstance(t,ec.$type)}var tc={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Rr(t){return Ee.isInstance(t,tc.$type)}var uu={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};var Uo={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function EE(t){return Ee.isInstance(t,Uo.$type)}var $h={$type:"Negation",value:"value"};function vE(t){return Ee.isInstance(t,$h.$type)}var dE={$type:"NumberLiteral",value:"value"};var fu={$type:"Parameter",name:"name"};var Fh={$type:"ParameterReference",parameter:"parameter"};function bE(t){return Ee.isInstance(t,Fh.$type)}var Vr={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function Ut(t){return Ee.isInstance(t,Vr.$type)}var gu={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function wE(t){return Ee.isInstance(t,gu.$type)}var Bo={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function RE(t){return Ee.isInstance(t,Bo.$type)}var Uh={$type:"ReturnType",name:"name"};function SE(t){return Ee.isInstance(t,Uh.$type)}var Go={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Zr(t){return Ee.isInstance(t,Go.$type)}var rc={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function Xh(t){return Ee.isInstance(t,rc.$type)}var pE={$type:"StringLiteral",value:"value"};var Xo={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function AE(t){return Ee.isInstance(t,Xo.$type)}var mr={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};var Ho={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function IE(t){return Ee.isInstance(t,Ho.$type)}var Kn={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function qt(t){return Ee.isInstance(t,Kn.$type)}var jo={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function Hh(t){return Ee.isInstance(t,jo.$type)}var yu={$type:"Type",name:"name",type:"type"};function jh(t){return Ee.isInstance(t,yu.$type)}var Za={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};var Ja={$type:"TypeDefinition"};var Bh={$type:"UnionType",types:"types"};function kE(t){return Ee.isInstance(t,Bh.$type)}var xu={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function zh(t){return Ee.isInstance(t,xu.$type)}var zo={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function NE(t){return Ee.isInstance(t,zo.$type)}var Qa={$type:"ValueLiteral"};var nc={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function PE(t){return Ee.isInstance(t,nc.$type)}var ic=class extends Lo{constructor(){super(...arguments),this.types={AbstractElement:{name:rr.$type,properties:{cardinality:{name:rr.cardinality,optional:!0}},superTypes:[]},AbstractParserRule:{name:du.$type,properties:{},superTypes:[lu.$type,wr.$type]},AbstractRule:{name:lu.$type,properties:{},superTypes:[]},AbstractType:{name:wr.$type,properties:{},superTypes:[]},Action:{name:zi.$type,properties:{cardinality:{name:zi.cardinality,optional:!0},feature:{name:zi.feature,optional:!0},inferredType:{name:zi.inferredType,optional:!0},operator:{name:zi.operator,optional:!0},type:{name:zi.type,referenceType:wr.$type,optional:!0}},superTypes:[rr.$type]},Alternatives:{name:pu.$type,properties:{cardinality:{name:pu.cardinality,optional:!0},elements:{name:pu.elements,defaultValue:[]}},superTypes:[rr.$type]},ArrayLiteral:{name:lE.$type,properties:{elements:{name:lE.elements,defaultValue:[]}},superTypes:[Qa.$type]},ArrayType:{name:Oh.$type,properties:{elementType:{name:Oh.elementType}},superTypes:[Ja.$type]},Assignment:{name:Wi.$type,properties:{cardinality:{name:Wi.cardinality,optional:!0},feature:{name:Wi.feature},operator:{name:Wi.operator},predicate:{name:Wi.predicate,optional:!0},terminal:{name:Wi.terminal}},superTypes:[rr.$type]},BooleanLiteral:{name:Lh.$type,properties:{true:{name:Lh.true,defaultValue:!1}},superTypes:[$o.$type,Qa.$type]},CharacterRange:{name:qi.$type,properties:{cardinality:{name:qi.cardinality,optional:!0},left:{name:qi.left},lookahead:{name:qi.lookahead,optional:!0},parenthesized:{name:qi.parenthesized,defaultValue:!1,optional:!0},right:{name:qi.right,optional:!0}},superTypes:[mr.$type]},Condition:{name:$o.$type,properties:{},superTypes:[]},Conjunction:{name:hu.$type,properties:{left:{name:hu.left},right:{name:hu.right}},superTypes:[$o.$type]},CrossReference:{name:Vi.$type,properties:{cardinality:{name:Vi.cardinality,optional:!0},deprecatedSyntax:{name:Vi.deprecatedSyntax,defaultValue:!1},isMulti:{name:Vi.isMulti,defaultValue:!1},terminal:{name:Vi.terminal,optional:!0},type:{name:Vi.type,referenceType:wr.$type}},superTypes:[rr.$type]},Disjunction:{name:mu.$type,properties:{left:{name:mu.left},right:{name:mu.right}},superTypes:[$o.$type]},EndOfFile:{name:Dh.$type,properties:{cardinality:{name:Dh.cardinality,optional:!0}},superTypes:[rr.$type]},Grammar:{name:ji.$type,properties:{imports:{name:ji.imports,defaultValue:[]},interfaces:{name:ji.interfaces,defaultValue:[]},isDeclared:{name:ji.isDeclared,defaultValue:!1},name:{name:ji.name,optional:!0},rules:{name:ji.rules,defaultValue:[]},types:{name:ji.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:uE.$type,properties:{path:{name:uE.path}},superTypes:[]},Group:{name:Fo.$type,properties:{cardinality:{name:Fo.cardinality,optional:!0},elements:{name:Fo.elements,defaultValue:[]},guardCondition:{name:Fo.guardCondition,optional:!0},predicate:{name:Fo.predicate,optional:!0}},superTypes:[rr.$type]},InferredType:{name:Mh.$type,properties:{name:{name:Mh.name}},superTypes:[wr.$type]},InfixRule:{name:hn.$type,properties:{call:{name:hn.call},dataType:{name:hn.dataType,optional:!0},inferredType:{name:hn.inferredType,optional:!0},name:{name:hn.name},operators:{name:hn.operators},parameters:{name:hn.parameters,defaultValue:[]},returnType:{name:hn.returnType,referenceType:wr.$type,optional:!0}},superTypes:[du.$type]},InfixRuleOperatorList:{name:Ch.$type,properties:{associativity:{name:Ch.associativity,optional:!0},operators:{name:Ch.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:fE.$type,properties:{precedences:{name:fE.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:ec.$type,properties:{attributes:{name:ec.attributes,defaultValue:[]},name:{name:ec.name},superTypes:{name:ec.superTypes,defaultValue:[],referenceType:wr.$type}},superTypes:[wr.$type]},Keyword:{name:tc.$type,properties:{cardinality:{name:tc.cardinality,optional:!0},predicate:{name:tc.predicate,optional:!0},value:{name:tc.value}},superTypes:[rr.$type]},NamedArgument:{name:uu.$type,properties:{calledByName:{name:uu.calledByName,defaultValue:!1},parameter:{name:uu.parameter,referenceType:fu.$type,optional:!0},value:{name:uu.value}},superTypes:[]},NegatedToken:{name:Uo.$type,properties:{cardinality:{name:Uo.cardinality,optional:!0},lookahead:{name:Uo.lookahead,optional:!0},parenthesized:{name:Uo.parenthesized,defaultValue:!1,optional:!0},terminal:{name:Uo.terminal}},superTypes:[mr.$type]},Negation:{name:$h.$type,properties:{value:{name:$h.value}},superTypes:[$o.$type]},NumberLiteral:{name:dE.$type,properties:{value:{name:dE.value}},superTypes:[Qa.$type]},Parameter:{name:fu.$type,properties:{name:{name:fu.name}},superTypes:[]},ParameterReference:{name:Fh.$type,properties:{parameter:{name:Fh.parameter,referenceType:fu.$type}},superTypes:[$o.$type]},ParserRule:{name:Vr.$type,properties:{dataType:{name:Vr.dataType,optional:!0},definition:{name:Vr.definition},entry:{name:Vr.entry,defaultValue:!1},fragment:{name:Vr.fragment,defaultValue:!1},inferredType:{name:Vr.inferredType,optional:!0},name:{name:Vr.name},parameters:{name:Vr.parameters,defaultValue:[]},returnType:{name:Vr.returnType,referenceType:wr.$type,optional:!0}},superTypes:[du.$type]},ReferenceType:{name:gu.$type,properties:{isMulti:{name:gu.isMulti,defaultValue:!1},referenceType:{name:gu.referenceType}},superTypes:[Ja.$type]},RegexToken:{name:Bo.$type,properties:{cardinality:{name:Bo.cardinality,optional:!0},lookahead:{name:Bo.lookahead,optional:!0},parenthesized:{name:Bo.parenthesized,defaultValue:!1,optional:!0},regex:{name:Bo.regex}},superTypes:[mr.$type]},ReturnType:{name:Uh.$type,properties:{name:{name:Uh.name}},superTypes:[]},RuleCall:{name:Go.$type,properties:{arguments:{name:Go.arguments,defaultValue:[]},cardinality:{name:Go.cardinality,optional:!0},predicate:{name:Go.predicate,optional:!0},rule:{name:Go.rule,referenceType:lu.$type}},superTypes:[rr.$type]},SimpleType:{name:rc.$type,properties:{primitiveType:{name:rc.primitiveType,optional:!0},stringType:{name:rc.stringType,optional:!0},typeRef:{name:rc.typeRef,referenceType:wr.$type,optional:!0}},superTypes:[Ja.$type]},StringLiteral:{name:pE.$type,properties:{value:{name:pE.value}},superTypes:[Qa.$type]},TerminalAlternatives:{name:Xo.$type,properties:{cardinality:{name:Xo.cardinality,optional:!0},elements:{name:Xo.elements,defaultValue:[]},lookahead:{name:Xo.lookahead,optional:!0},parenthesized:{name:Xo.parenthesized,defaultValue:!1,optional:!0}},superTypes:[mr.$type]},TerminalElement:{name:mr.$type,properties:{cardinality:{name:mr.cardinality,optional:!0},lookahead:{name:mr.lookahead,optional:!0},parenthesized:{name:mr.parenthesized,defaultValue:!1,optional:!0}},superTypes:[rr.$type]},TerminalGroup:{name:Ho.$type,properties:{cardinality:{name:Ho.cardinality,optional:!0},elements:{name:Ho.elements,defaultValue:[]},lookahead:{name:Ho.lookahead,optional:!0},parenthesized:{name:Ho.parenthesized,defaultValue:!1,optional:!0}},superTypes:[mr.$type]},TerminalRule:{name:Kn.$type,properties:{definition:{name:Kn.definition},fragment:{name:Kn.fragment,defaultValue:!1},hidden:{name:Kn.hidden,defaultValue:!1},name:{name:Kn.name},type:{name:Kn.type,optional:!0}},superTypes:[lu.$type]},TerminalRuleCall:{name:jo.$type,properties:{cardinality:{name:jo.cardinality,optional:!0},lookahead:{name:jo.lookahead,optional:!0},parenthesized:{name:jo.parenthesized,defaultValue:!1,optional:!0},rule:{name:jo.rule,referenceType:Kn.$type}},superTypes:[mr.$type]},Type:{name:yu.$type,properties:{name:{name:yu.name},type:{name:yu.type}},superTypes:[wr.$type]},TypeAttribute:{name:Za.$type,properties:{defaultValue:{name:Za.defaultValue,optional:!0},isOptional:{name:Za.isOptional,defaultValue:!1},name:{name:Za.name},type:{name:Za.type}},superTypes:[]},TypeDefinition:{name:Ja.$type,properties:{},superTypes:[]},UnionType:{name:Bh.$type,properties:{types:{name:Bh.types,defaultValue:[]}},superTypes:[Ja.$type]},UnorderedGroup:{name:xu.$type,properties:{cardinality:{name:xu.cardinality,optional:!0},elements:{name:xu.elements,defaultValue:[]}},superTypes:[rr.$type]},UntilToken:{name:zo.$type,properties:{cardinality:{name:zo.cardinality,optional:!0},lookahead:{name:zo.lookahead,optional:!0},parenthesized:{name:zo.parenthesized,defaultValue:!1,optional:!0},terminal:{name:zo.terminal}},superTypes:[mr.$type]},ValueLiteral:{name:Qa.$type,properties:{},superTypes:[]},Wildcard:{name:nc.$type,properties:{cardinality:{name:nc.cardinality,optional:!0},lookahead:{name:nc.lookahead,optional:!0},parenthesized:{name:nc.parenthesized,defaultValue:!1,optional:!0}},superTypes:[mr.$type]}}}},Ee=new ic;function oc(t){return new Yn(t,e=>Vn(e)?e.content:[],{includeRoot:!0})}function LE(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function sc(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function Wo(t){if(!t)return;let{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}var mn;(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"})(mn||(mn={}));function dC(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return mn.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return mn.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?mn.Inside:r?mn.OverlapBack:n?mn.OverlapFront:mn.Outside}function cE(t,e){return dC(t,e)>mn.After}var DE=/^[\w\p{L}]$/u;function ME(t,e){if(t){let r=pC(t,!0);if(r&&OE(r,e))return r;if(nu(t)){let n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){let o=t.content[i];if(OE(o,e))return o}}}}function OE(t,e){return ru(t)&&e.includes(t.tokenType.name)}function pC(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}}var Su={};eu(Su,{findAssignment:()=>im,findNameAssignment:()=>wu,findNodeForKeyword:()=>rm,findNodeForProperty:()=>dc,findNodesForKeyword:()=>_C,findNodesForKeywordInternal:()=>nm,findNodesForProperty:()=>em,getActionAtElement:()=>jE,getActionType:()=>WE,getAllReachableRules:()=>fc,getAllRulesUsedForCrossReferences:()=>TC,getCrossReferenceTerminal:()=>Jh,getEntryRule:()=>BE,getExplicitRuleType:()=>Ru,getHiddenRules:()=>GE,getRuleType:()=>om,getRuleTypeName:()=>RC,getTypeName:()=>ei,isArrayCardinality:()=>vC,isArrayOperator:()=>bC,isCommentTerminal:()=>Qh,isDataType:()=>wC,isDataTypeRule:()=>pc,isOptionalCardinality:()=>EC,terminalRegex:()=>Vo});var ac=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}};function Qn(t,e="Error: Got unexpected value."){throw new Error(e)}function se(t){return t.charCodeAt(0)}function Eu(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function qo(t,e){if(t[e]===!0)throw"duplicate flag "+e;let r=t[e];t[e]=!0}function Zi(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function cc(){throw Error("Internal Error - Should never get here!")}function Wh(t){return t.type==="Character"}var lc=[];for(let t=se("0");t<=se("9");t++)lc.push(t);var uc=[se("_")].concat(lc);for(let t=se("a");t<=se("z");t++)uc.push(t);for(let t=se("A");t<=se("Z");t++)uc.push(t);var qh=[se(" "),se("\f"),se(`
13
- `),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 hC=/[0-9a-fA-F]/,vu=/[0-9]/,mC=/[1-9]/,Ji=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":qo(n,"global");break;case"i":qo(n,"ignoreCase");break;case"m":qo(n,"multiLine");break;case"u":qo(n,"unicode");break;case"y":qo(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}}Zi(r);let n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return cc()}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;Zi(r);break}if(!(e===!0&&r===void 0)&&Zi(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()),Zi(e)?(e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):cc()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[se(`
14
- `),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=lc;break;case"D":e=lc,r=!0;break;case"s":e=qh;break;case"S":e=qh,r=!0;break;case"w":e=uc;break;case"W":e=uc,r=!0;break}return Zi(e)?{type:"Set",value:e,complement:r}:cc()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=se("\f");break;case"n":e=se(`
15
- `);break;case"r":e=se("\r");break;case"t":e=se(" ");break;case"v":e=se("\v");break}return Zi(e)?{type:"Character",value:e}:cc()}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`
16
- `: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(Wh(n)&&this.isRangeDash()){this.consumeChar("-");let o=this.classAtom(),s=o.type==="Character";if(Wh(o)){if(o.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:o.value})}else Eu(n.value,e),e.push(se("-")),Eu(o.value,e)}else Eu(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
17
- `: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(mC.test(e)===!1)throw Error("Expecting a positive integer");for(;vu.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(vu.test(e)===!1)throw Error("Expecting an integer");for(;vu.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`
18
- `: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 vu.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
12
+ `&&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 $e.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 $e.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 tt=pe(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.CM=Dt.ProtocolNotificationType=Dt.ProtocolNotificationType0=Dt.ProtocolRequestType=Dt.ProtocolRequestType0=Dt.RegistrationType=Dt.MessageDirection=void 0;var Gs=Ms(),Qw;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(Qw||(Dt.MessageDirection=Qw={}));var fx=class{constructor(e){R(this,"____");R(this,"method");this.method=e}};Dt.RegistrationType=fx;var dx=class extends Gs.RequestType0{constructor(r){super(r);R(this,"__");R(this,"___");R(this,"____");R(this,"_pr")}};Dt.ProtocolRequestType0=dx;var px=class extends Gs.RequestType{constructor(r){super(r,Gs.ParameterStructures.byName);R(this,"__");R(this,"___");R(this,"____");R(this,"_pr")}};Dt.ProtocolRequestType=px;var hx=class extends Gs.NotificationType0{constructor(r){super(r);R(this,"___");R(this,"____")}};Dt.ProtocolNotificationType0=hx;var mx=class extends Gs.NotificationType{constructor(r){super(r,Gs.ParameterStructures.byName);R(this,"___");R(this,"____")}};Dt.ProtocolNotificationType=mx;var eR;(function(t){function e(r,n){return{client:r,server:n}}t.create=e})(eR||(Dt.CM=eR={}))});var yd=pe(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.boolean=s2;Pr.string=tR;Pr.number=a2;Pr.error=c2;Pr.func=l2;Pr.array=rR;Pr.stringArray=u2;Pr.typedArray=f2;Pr.objectLiteral=d2;function s2(t){return t===!0||t===!1}function tR(t){return typeof t=="string"||t instanceof String}function a2(t){return typeof t=="number"||t instanceof Number}function c2(t){return t instanceof Error}function l2(t){return typeof t=="function"}function rR(t){return Array.isArray(t)}function u2(t){return rR(t)&&t.every(e=>tR(e))}function f2(t,e){return Array.isArray(t)&&t.every(e)}function d2(t){return t!==null&&typeof t=="object"}});var iR=pe(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.ImplementationRequest=void 0;var gx=tt(),nR;(function(t){t.method="textDocument/implementation",t.messageDirection=gx.MessageDirection.clientToServer,t.type=new gx.ProtocolRequestType(t.method),t.capabilities=gx.CM.create("textDocument.implementation","implementationProvider")})(nR||(xd.ImplementationRequest=nR={}))});var sR=pe(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.TypeDefinitionRequest=void 0;var yx=tt(),oR;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=yx.MessageDirection.clientToServer,t.type=new yx.ProtocolRequestType(t.method),t.capabilities=yx.CM.create("textDocument.typeDefinition","typeDefinitionProvider")})(oR||(Td.TypeDefinitionRequest=oR={}))});var lR=pe(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.DidChangeWorkspaceFoldersNotification=Xs.WorkspaceFoldersRequest=void 0;var Hs=tt(),aR;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Hs.MessageDirection.serverToClient,t.type=new Hs.ProtocolRequestType0(t.method),t.capabilities=Hs.CM.create("workspace.workspaceFolders","workspace.workspaceFolders")})(aR||(Xs.WorkspaceFoldersRequest=aR={}));var cR;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Hs.MessageDirection.clientToServer,t.type=new Hs.ProtocolNotificationType(t.method),t.capabilities=Hs.CM.create(void 0,"workspace.workspaceFolders.changeNotifications")})(cR||(Xs.DidChangeWorkspaceFoldersNotification=cR={}))});var fR=pe(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});_d.ConfigurationRequest=void 0;var xx=tt(),uR;(function(t){t.method="workspace/configuration",t.messageDirection=xx.MessageDirection.serverToClient,t.type=new xx.ProtocolRequestType(t.method),t.capabilities=xx.CM.create("workspace.configuration",void 0)})(uR||(_d.ConfigurationRequest=uR={}))});var hR=pe(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.ColorPresentationRequest=zs.DocumentColorRequest=void 0;var js=tt(),dR;(function(t){t.method="textDocument/documentColor",t.messageDirection=js.MessageDirection.clientToServer,t.type=new js.ProtocolRequestType(t.method),t.capabilities=js.CM.create("textDocument.colorProvider","colorProvider")})(dR||(zs.DocumentColorRequest=dR={}));var pR;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=js.MessageDirection.clientToServer,t.type=new js.ProtocolRequestType(t.method),t.capabilities=js.CM.create("textDocument.colorProvider","colorProvider")})(pR||(zs.ColorPresentationRequest=pR={}))});var yR=pe(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.FoldingRangeRefreshRequest=qs.FoldingRangeRequest=void 0;var Ws=tt(),mR;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Ws.MessageDirection.clientToServer,t.type=new Ws.ProtocolRequestType(t.method),t.capabilities=Ws.CM.create("textDocument.foldingRange","foldingRangeProvider")})(mR||(qs.FoldingRangeRequest=mR={}));var gR;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Ws.MessageDirection.serverToClient,t.type=new Ws.ProtocolRequestType0(t.method),t.capabilities=Ws.CM.create("workspace.foldingRange.refreshSupport",void 0)})(gR||(qs.FoldingRangeRefreshRequest=gR={}))});var TR=pe(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.DeclarationRequest=void 0;var Tx=tt(),xR;(function(t){t.method="textDocument/declaration",t.messageDirection=Tx.MessageDirection.clientToServer,t.type=new Tx.ProtocolRequestType(t.method),t.capabilities=Tx.CM.create("textDocument.declaration","declarationProvider")})(xR||(Ed.DeclarationRequest=xR={}))});var ER=pe(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.SelectionRangeRequest=void 0;var _x=tt(),_R;(function(t){t.method="textDocument/selectionRange",t.messageDirection=_x.MessageDirection.clientToServer,t.type=new _x.ProtocolRequestType(t.method),t.capabilities=_x.CM.create("textDocument.selectionRange","selectionRangeProvider")})(_R||(vd.SelectionRangeRequest=_R={}))});var RR=pe(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.WorkDoneProgressCancelNotification=bi.WorkDoneProgressCreateRequest=bi.WorkDoneProgress=void 0;var p2=Ms(),tl=tt(),vR;(function(t){t.type=new p2.ProgressType;function e(r){return r===t.type}t.is=e})(vR||(bi.WorkDoneProgress=vR={}));var bR;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=tl.MessageDirection.serverToClient,t.type=new tl.ProtocolRequestType(t.method),t.capabilities=tl.CM.create("window.workDoneProgress",void 0)})(bR||(bi.WorkDoneProgressCreateRequest=bR={}));var wR;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=tl.MessageDirection.clientToServer,t.type=new tl.ProtocolNotificationType(t.method)})(wR||(bi.WorkDoneProgressCancelNotification=wR={}))});var kR=pe(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.CallHierarchyOutgoingCallsRequest=wi.CallHierarchyIncomingCallsRequest=wi.CallHierarchyPrepareRequest=void 0;var Nn=tt(),SR;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Nn.MessageDirection.clientToServer,t.type=new Nn.ProtocolRequestType(t.method),t.capabilities=Nn.CM.create("textDocument.callHierarchy","callHierarchyProvider")})(SR||(wi.CallHierarchyPrepareRequest=SR={}));var AR;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Nn.MessageDirection.clientToServer,t.type=new Nn.ProtocolRequestType(t.method),t.capabilities=Nn.CM.create("textDocument.callHierarchy","callHierarchyProvider")})(AR||(wi.CallHierarchyIncomingCallsRequest=AR={}));var IR;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Nn.MessageDirection.clientToServer,t.type=new Nn.ProtocolRequestType(t.method),t.capabilities=Nn.CM.create("textDocument.callHierarchy","callHierarchyProvider")})(IR||(wi.CallHierarchyOutgoingCallsRequest=IR={}))});var DR=pe(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.SemanticTokensRefreshRequest=Kt.SemanticTokensRangeRequest=Kt.SemanticTokensDeltaRequest=Kt.SemanticTokensRequest=Kt.SemanticTokensRegistrationType=Kt.TokenFormat=void 0;var sr=tt(),NR;(function(t){t.Relative="relative"})(NR||(Kt.TokenFormat=NR={}));var rl;(function(t){t.method="textDocument/semanticTokens",t.type=new sr.RegistrationType(t.method)})(rl||(Kt.SemanticTokensRegistrationType=rl={}));var PR;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=sr.MessageDirection.clientToServer,t.type=new sr.ProtocolRequestType(t.method),t.registrationMethod=rl.method,t.capabilities=sr.CM.create("textDocument.semanticTokens","semanticTokensProvider")})(PR||(Kt.SemanticTokensRequest=PR={}));var CR;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=sr.MessageDirection.clientToServer,t.type=new sr.ProtocolRequestType(t.method),t.registrationMethod=rl.method,t.capabilities=sr.CM.create("textDocument.semanticTokens.requests.full.delta","semanticTokensProvider.full.delta")})(CR||(Kt.SemanticTokensDeltaRequest=CR={}));var OR;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=sr.MessageDirection.clientToServer,t.type=new sr.ProtocolRequestType(t.method),t.registrationMethod=rl.method,t.capabilities=sr.CM.create("textDocument.semanticTokens.requests.range","semanticTokensProvider.range")})(OR||(Kt.SemanticTokensRangeRequest=OR={}));var LR;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=sr.MessageDirection.serverToClient,t.type=new sr.ProtocolRequestType0(t.method),t.capabilities=sr.CM.create("workspace.semanticTokens.refreshSupport",void 0)})(LR||(Kt.SemanticTokensRefreshRequest=LR={}))});var $R=pe(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.ShowDocumentRequest=void 0;var Ex=tt(),MR;(function(t){t.method="window/showDocument",t.messageDirection=Ex.MessageDirection.serverToClient,t.type=new Ex.ProtocolRequestType(t.method),t.capabilities=Ex.CM.create("window.showDocument.support",void 0)})(MR||(bd.ShowDocumentRequest=MR={}))});var UR=pe(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});wd.LinkedEditingRangeRequest=void 0;var vx=tt(),FR;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=vx.MessageDirection.clientToServer,t.type=new vx.ProtocolRequestType(t.method),t.capabilities=vx.CM.create("textDocument.linkedEditingRange","linkedEditingRangeProvider")})(FR||(wd.LinkedEditingRangeRequest=FR={}))});var qR=pe(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.WillDeleteFilesRequest=Mt.DidDeleteFilesNotification=Mt.DidRenameFilesNotification=Mt.WillRenameFilesRequest=Mt.DidCreateFilesNotification=Mt.WillCreateFilesRequest=Mt.FileOperationPatternKind=void 0;var Rt=tt(),BR;(function(t){t.file="file",t.folder="folder"})(BR||(Mt.FileOperationPatternKind=BR={}));var GR;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolRequestType(t.method),t.capabilities=Rt.CM.create("workspace.fileOperations.willCreate","workspace.fileOperations.willCreate")})(GR||(Mt.WillCreateFilesRequest=GR={}));var HR;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolNotificationType(t.method),t.capabilities=Rt.CM.create("workspace.fileOperations.didCreate","workspace.fileOperations.didCreate")})(HR||(Mt.DidCreateFilesNotification=HR={}));var XR;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolRequestType(t.method),t.capabilities=Rt.CM.create("workspace.fileOperations.willRename","workspace.fileOperations.willRename")})(XR||(Mt.WillRenameFilesRequest=XR={}));var jR;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolNotificationType(t.method),t.capabilities=Rt.CM.create("workspace.fileOperations.didRename","workspace.fileOperations.didRename")})(jR||(Mt.DidRenameFilesNotification=jR={}));var zR;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolNotificationType(t.method),t.capabilities=Rt.CM.create("workspace.fileOperations.didDelete","workspace.fileOperations.didDelete")})(zR||(Mt.DidDeleteFilesNotification=zR={}));var WR;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolRequestType(t.method),t.capabilities=Rt.CM.create("workspace.fileOperations.willDelete","workspace.fileOperations.willDelete")})(WR||(Mt.WillDeleteFilesRequest=WR={}))});var ZR=pe(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.MonikerRequest=Ri.MonikerKind=Ri.UniquenessLevel=void 0;var bx=tt(),VR;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(VR||(Ri.UniquenessLevel=VR={}));var YR;(function(t){t.$import="import",t.$export="export",t.local="local"})(YR||(Ri.MonikerKind=YR={}));var KR;(function(t){t.method="textDocument/moniker",t.messageDirection=bx.MessageDirection.clientToServer,t.type=new bx.ProtocolRequestType(t.method),t.capabilities=bx.CM.create("textDocument.moniker","monikerProvider")})(KR||(Ri.MonikerRequest=KR={}))});var tS=pe(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.TypeHierarchySubtypesRequest=Si.TypeHierarchySupertypesRequest=Si.TypeHierarchyPrepareRequest=void 0;var yo=tt(),JR;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=yo.MessageDirection.clientToServer,t.type=new yo.ProtocolRequestType(t.method),t.capabilities=yo.CM.create("textDocument.typeHierarchy","typeHierarchyProvider")})(JR||(Si.TypeHierarchyPrepareRequest=JR={}));var QR;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=yo.MessageDirection.clientToServer,t.type=new yo.ProtocolRequestType(t.method)})(QR||(Si.TypeHierarchySupertypesRequest=QR={}));var eS;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=yo.MessageDirection.clientToServer,t.type=new yo.ProtocolRequestType(t.method)})(eS||(Si.TypeHierarchySubtypesRequest=eS={}))});var iS=pe(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.InlineValueRefreshRequest=Ys.InlineValueRequest=void 0;var Vs=tt(),rS;(function(t){t.method="textDocument/inlineValue",t.messageDirection=Vs.MessageDirection.clientToServer,t.type=new Vs.ProtocolRequestType(t.method),t.capabilities=Vs.CM.create("textDocument.inlineValue","inlineValueProvider")})(rS||(Ys.InlineValueRequest=rS={}));var nS;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=Vs.MessageDirection.serverToClient,t.type=new Vs.ProtocolRequestType0(t.method),t.capabilities=Vs.CM.create("workspace.inlineValue.refreshSupport",void 0)})(nS||(Ys.InlineValueRefreshRequest=nS={}))});var cS=pe(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.InlayHintRefreshRequest=Ai.InlayHintResolveRequest=Ai.InlayHintRequest=void 0;var Pn=tt(),oS;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Pn.MessageDirection.clientToServer,t.type=new Pn.ProtocolRequestType(t.method),t.capabilities=Pn.CM.create("textDocument.inlayHint","inlayHintProvider")})(oS||(Ai.InlayHintRequest=oS={}));var sS;(function(t){t.method="inlayHint/resolve",t.messageDirection=Pn.MessageDirection.clientToServer,t.type=new Pn.ProtocolRequestType(t.method),t.capabilities=Pn.CM.create("textDocument.inlayHint.resolveSupport","inlayHintProvider.resolveProvider")})(sS||(Ai.InlayHintResolveRequest=sS={}));var aS;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Pn.MessageDirection.serverToClient,t.type=new Pn.ProtocolRequestType0(t.method),t.capabilities=Pn.CM.create("workspace.inlayHint.refreshSupport",void 0)})(aS||(Ai.InlayHintRefreshRequest=aS={}))});var mS=pe(St=>{"use strict";var h2=St&&St.__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]})),m2=St&&St.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),g2=St&&St.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&h2(r,e,n[i]);return m2(r,e),r}})();Object.defineProperty(St,"__esModule",{value:!0});St.DiagnosticRefreshRequest=St.WorkspaceDiagnosticRequest=St.DocumentDiagnosticRequest=St.DocumentDiagnosticReportKind=St.DiagnosticServerCancellationData=void 0;var hS=Ms(),y2=g2(yd()),Cn=tt(),lS;(function(t){function e(r){let n=r;return n&&y2.boolean(n.retriggerRequest)}t.is=e})(lS||(St.DiagnosticServerCancellationData=lS={}));var uS;(function(t){t.Full="full",t.Unchanged="unchanged"})(uS||(St.DocumentDiagnosticReportKind=uS={}));var fS;(function(t){t.method="textDocument/diagnostic",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolRequestType(t.method),t.partialResult=new hS.ProgressType,t.capabilities=Cn.CM.create("textDocument.diagnostic","diagnosticProvider")})(fS||(St.DocumentDiagnosticRequest=fS={}));var dS;(function(t){t.method="workspace/diagnostic",t.messageDirection=Cn.MessageDirection.clientToServer,t.type=new Cn.ProtocolRequestType(t.method),t.partialResult=new hS.ProgressType,t.capabilities=Cn.CM.create("workspace.diagnostics","diagnosticProvider.workspaceDiagnostics")})(dS||(St.WorkspaceDiagnosticRequest=dS={}));var pS;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=Cn.MessageDirection.serverToClient,t.type=new Cn.ProtocolRequestType0(t.method),t.capabilities=Cn.CM.create("workspace.diagnostics.refreshSupport",void 0)})(pS||(St.DiagnosticRefreshRequest=pS={}))});var vS=pe(He=>{"use strict";var x2=He&&He.__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]})),T2=He&&He.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),_2=He&&He.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&x2(r,e,n[i]);return T2(r,e),r}})();Object.defineProperty(He,"__esModule",{value:!0});He.DidCloseNotebookDocumentNotification=He.DidSaveNotebookDocumentNotification=He.DidChangeNotebookDocumentNotification=He.NotebookCellArrayChange=He.DidOpenNotebookDocumentNotification=He.NotebookDocumentSyncRegistrationType=He.NotebookDocument=He.NotebookCell=He.ExecutionSummary=He.NotebookCellKind=void 0;var nl=(el(),iu(gd)),Cr=_2(yd()),nn=tt(),wx;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(wx||(He.NotebookCellKind=wx={}));var Rx;(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 Cr.objectLiteral(o)&&nl.uinteger.is(o.executionOrder)&&(o.success===void 0||Cr.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})(Rx||(He.ExecutionSummary=Rx={}));var Rd;(function(t){function e(o,s){return{kind:o,document:s}}t.create=e;function r(o){let s=o;return Cr.objectLiteral(s)&&wx.is(s.kind)&&nl.DocumentUri.is(s.document)&&(s.metadata===void 0||Cr.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)&&!Rx.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(Cr.objectLiteral(o)&&Cr.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}})(Rd||(He.NotebookCell=Rd={}));var gS;(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 Cr.objectLiteral(i)&&Cr.string(i.uri)&&nl.integer.is(i.version)&&Cr.typedArray(i.cells,Rd.is)}t.is=r})(gS||(He.NotebookDocument=gS={}));var Ks;(function(t){t.method="notebookDocument/sync",t.messageDirection=nn.MessageDirection.clientToServer,t.type=new nn.RegistrationType(t.method)})(Ks||(He.NotebookDocumentSyncRegistrationType=Ks={}));var yS;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=nn.MessageDirection.clientToServer,t.type=new nn.ProtocolNotificationType(t.method),t.registrationMethod=Ks.method})(yS||(He.DidOpenNotebookDocumentNotification=yS={}));var xS;(function(t){function e(n){let i=n;return Cr.objectLiteral(i)&&nl.uinteger.is(i.start)&&nl.uinteger.is(i.deleteCount)&&(i.cells===void 0||Cr.typedArray(i.cells,Rd.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})(xS||(He.NotebookCellArrayChange=xS={}));var TS;(function(t){t.method="notebookDocument/didChange",t.messageDirection=nn.MessageDirection.clientToServer,t.type=new nn.ProtocolNotificationType(t.method),t.registrationMethod=Ks.method})(TS||(He.DidChangeNotebookDocumentNotification=TS={}));var _S;(function(t){t.method="notebookDocument/didSave",t.messageDirection=nn.MessageDirection.clientToServer,t.type=new nn.ProtocolNotificationType(t.method),t.registrationMethod=Ks.method})(_S||(He.DidSaveNotebookDocumentNotification=_S={}));var ES;(function(t){t.method="notebookDocument/didClose",t.messageDirection=nn.MessageDirection.clientToServer,t.type=new nn.ProtocolNotificationType(t.method),t.registrationMethod=Ks.method})(ES||(He.DidCloseNotebookDocumentNotification=ES={}))});var wS=pe(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.InlineCompletionRequest=void 0;var Sx=tt(),bS;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=Sx.MessageDirection.clientToServer,t.type=new Sx.ProtocolRequestType(t.method),t.capabilities=Sx.CM.create("textDocument.inlineCompletion","inlineCompletionProvider")})(bS||(Sd.InlineCompletionRequest=bS={}))});var AS=pe(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.TextDocumentContentRefreshRequest=Zs.TextDocumentContentRequest=void 0;var il=tt(),RS;(function(t){t.method="workspace/textDocumentContent",t.messageDirection=il.MessageDirection.clientToServer,t.type=new il.ProtocolRequestType(t.method),t.capabilities=il.CM.create("workspace.textDocumentContent","workspace.textDocumentContent")})(RS||(Zs.TextDocumentContentRequest=RS={}));var SS;(function(t){t.method="workspace/textDocumentContent/refresh",t.messageDirection=il.MessageDirection.serverToClient,t.type=new il.ProtocolRequestType(t.method)})(SS||(Zs.TextDocumentContentRefreshRequest=SS={}))});var GA=pe(g=>{"use strict";var E2=g&&g.__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]})),v2=g&&g.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),b2=g&&g.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&E2(r,e,n[i]);return v2(r,e),r}})();Object.defineProperty(g,"__esModule",{value:!0});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.GlobPattern=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.RegularExpressionEngineKind=g.FailureHandlingKind=g.ResourceOperationKind=g.UnregistrationRequest=g.RegistrationRequest=g.DocumentSelector=g.NotebookCellTextDocumentFilter=g.NotebookDocumentFilter=g.TextDocumentFilter=void 0;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=g.WorkspaceSymbolRequest=g.CodeActionResolveRequest=void 0;g.TextDocumentContentRefreshRequest=g.TextDocumentContentRequest=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=g.MonikerRequest=g.MonikerKind=void 0;var C=tt(),IS=(el(),iu(gd)),At=b2(yd()),w2=iR();Object.defineProperty(g,"ImplementationRequest",{enumerable:!0,get:function(){return w2.ImplementationRequest}});var R2=sR();Object.defineProperty(g,"TypeDefinitionRequest",{enumerable:!0,get:function(){return R2.TypeDefinitionRequest}});var MA=lR();Object.defineProperty(g,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return MA.WorkspaceFoldersRequest}});Object.defineProperty(g,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return MA.DidChangeWorkspaceFoldersNotification}});var S2=fR();Object.defineProperty(g,"ConfigurationRequest",{enumerable:!0,get:function(){return S2.ConfigurationRequest}});var $A=hR();Object.defineProperty(g,"DocumentColorRequest",{enumerable:!0,get:function(){return $A.DocumentColorRequest}});Object.defineProperty(g,"ColorPresentationRequest",{enumerable:!0,get:function(){return $A.ColorPresentationRequest}});var FA=yR();Object.defineProperty(g,"FoldingRangeRequest",{enumerable:!0,get:function(){return FA.FoldingRangeRequest}});Object.defineProperty(g,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return FA.FoldingRangeRefreshRequest}});var A2=TR();Object.defineProperty(g,"DeclarationRequest",{enumerable:!0,get:function(){return A2.DeclarationRequest}});var I2=ER();Object.defineProperty(g,"SelectionRangeRequest",{enumerable:!0,get:function(){return I2.SelectionRangeRequest}});var Ox=RR();Object.defineProperty(g,"WorkDoneProgress",{enumerable:!0,get:function(){return Ox.WorkDoneProgress}});Object.defineProperty(g,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Ox.WorkDoneProgressCreateRequest}});Object.defineProperty(g,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Ox.WorkDoneProgressCancelNotification}});var Lx=kR();Object.defineProperty(g,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Lx.CallHierarchyIncomingCallsRequest}});Object.defineProperty(g,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Lx.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(g,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Lx.CallHierarchyPrepareRequest}});var Js=DR();Object.defineProperty(g,"TokenFormat",{enumerable:!0,get:function(){return Js.TokenFormat}});Object.defineProperty(g,"SemanticTokensRequest",{enumerable:!0,get:function(){return Js.SemanticTokensRequest}});Object.defineProperty(g,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Js.SemanticTokensDeltaRequest}});Object.defineProperty(g,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Js.SemanticTokensRangeRequest}});Object.defineProperty(g,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Js.SemanticTokensRefreshRequest}});Object.defineProperty(g,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Js.SemanticTokensRegistrationType}});var k2=$R();Object.defineProperty(g,"ShowDocumentRequest",{enumerable:!0,get:function(){return k2.ShowDocumentRequest}});var N2=UR();Object.defineProperty(g,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return N2.LinkedEditingRangeRequest}});var xo=qR();Object.defineProperty(g,"FileOperationPatternKind",{enumerable:!0,get:function(){return xo.FileOperationPatternKind}});Object.defineProperty(g,"DidCreateFilesNotification",{enumerable:!0,get:function(){return xo.DidCreateFilesNotification}});Object.defineProperty(g,"WillCreateFilesRequest",{enumerable:!0,get:function(){return xo.WillCreateFilesRequest}});Object.defineProperty(g,"DidRenameFilesNotification",{enumerable:!0,get:function(){return xo.DidRenameFilesNotification}});Object.defineProperty(g,"WillRenameFilesRequest",{enumerable:!0,get:function(){return xo.WillRenameFilesRequest}});Object.defineProperty(g,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return xo.DidDeleteFilesNotification}});Object.defineProperty(g,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return xo.WillDeleteFilesRequest}});var Dx=ZR();Object.defineProperty(g,"UniquenessLevel",{enumerable:!0,get:function(){return Dx.UniquenessLevel}});Object.defineProperty(g,"MonikerKind",{enumerable:!0,get:function(){return Dx.MonikerKind}});Object.defineProperty(g,"MonikerRequest",{enumerable:!0,get:function(){return Dx.MonikerRequest}});var Mx=tS();Object.defineProperty(g,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Mx.TypeHierarchyPrepareRequest}});Object.defineProperty(g,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Mx.TypeHierarchySubtypesRequest}});Object.defineProperty(g,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Mx.TypeHierarchySupertypesRequest}});var UA=iS();Object.defineProperty(g,"InlineValueRequest",{enumerable:!0,get:function(){return UA.InlineValueRequest}});Object.defineProperty(g,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return UA.InlineValueRefreshRequest}});var $x=cS();Object.defineProperty(g,"InlayHintRequest",{enumerable:!0,get:function(){return $x.InlayHintRequest}});Object.defineProperty(g,"InlayHintResolveRequest",{enumerable:!0,get:function(){return $x.InlayHintResolveRequest}});Object.defineProperty(g,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return $x.InlayHintRefreshRequest}});var ol=mS();Object.defineProperty(g,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return ol.DiagnosticServerCancellationData}});Object.defineProperty(g,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return ol.DocumentDiagnosticReportKind}});Object.defineProperty(g,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return ol.DocumentDiagnosticRequest}});Object.defineProperty(g,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return ol.WorkspaceDiagnosticRequest}});Object.defineProperty(g,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return ol.DiagnosticRefreshRequest}});var on=vS();Object.defineProperty(g,"NotebookCellKind",{enumerable:!0,get:function(){return on.NotebookCellKind}});Object.defineProperty(g,"ExecutionSummary",{enumerable:!0,get:function(){return on.ExecutionSummary}});Object.defineProperty(g,"NotebookCell",{enumerable:!0,get:function(){return on.NotebookCell}});Object.defineProperty(g,"NotebookDocument",{enumerable:!0,get:function(){return on.NotebookDocument}});Object.defineProperty(g,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return on.NotebookDocumentSyncRegistrationType}});Object.defineProperty(g,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return on.DidOpenNotebookDocumentNotification}});Object.defineProperty(g,"NotebookCellArrayChange",{enumerable:!0,get:function(){return on.NotebookCellArrayChange}});Object.defineProperty(g,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return on.DidChangeNotebookDocumentNotification}});Object.defineProperty(g,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return on.DidSaveNotebookDocumentNotification}});Object.defineProperty(g,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return on.DidCloseNotebookDocumentNotification}});var P2=wS();Object.defineProperty(g,"InlineCompletionRequest",{enumerable:!0,get:function(){return P2.InlineCompletionRequest}});var BA=AS();Object.defineProperty(g,"TextDocumentContentRequest",{enumerable:!0,get:function(){return BA.TextDocumentContentRequest}});Object.defineProperty(g,"TextDocumentContentRefreshRequest",{enumerable:!0,get:function(){return BA.TextDocumentContentRefreshRequest}});var Ax;(function(t){function e(r){let n=r;return At.string(n)||At.string(n.language)||At.string(n.scheme)||Cx.is(n.pattern)}t.is=e})(Ax||(g.TextDocumentFilter=Ax={}));var Ix;(function(t){function e(r){let n=r;return At.objectLiteral(n)&&(At.string(n.notebookType)||At.string(n.scheme)||At.string(n.pattern))}t.is=e})(Ix||(g.NotebookDocumentFilter=Ix={}));var kx;(function(t){function e(r){let n=r;return At.objectLiteral(n)&&(At.string(n.notebook)||Ix.is(n.notebook))&&(n.language===void 0||At.string(n.language))}t.is=e})(kx||(g.NotebookCellTextDocumentFilter=kx={}));var Nx;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!At.string(n)&&!Ax.is(n)&&!kx.is(n))return!1;return!0}t.is=e})(Nx||(g.DocumentSelector=Nx={}));var kS;(function(t){t.method="client/registerCapability",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType(t.method)})(kS||(g.RegistrationRequest=kS={}));var NS;(function(t){t.method="client/unregisterCapability",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType(t.method)})(NS||(g.UnregistrationRequest=NS={}));var PS;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(PS||(g.ResourceOperationKind=PS={}));var CS;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(CS||(g.FailureHandlingKind=CS={}));var OS;(function(t){t.ES2020="ES2020"})(OS||(g.RegularExpressionEngineKind=OS={}));var LS;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(LS||(g.PositionEncodingKind=LS={}));var DS;(function(t){function e(r){let n=r;return n&&At.string(n.id)&&n.id.length>0}t.hasId=e})(DS||(g.StaticRegistrationOptions=DS={}));var MS;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||Nx.is(n.documentSelector))}t.is=e})(MS||(g.TextDocumentRegistrationOptions=MS={}));var $S;(function(t){function e(n){let i=n;return At.objectLiteral(i)&&(i.workDoneProgress===void 0||At.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&At.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})($S||(g.WorkDoneProgressOptions=$S={}));var FS;(function(t){t.method="initialize",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(FS||(g.InitializeRequest=FS={}));var US;(function(t){t.unknownProtocolVersion=1})(US||(g.InitializeErrorCodes=US={}));var BS;(function(t){t.method="initialized",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(BS||(g.InitializedNotification=BS={}));var GS;(function(t){t.method="shutdown",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType0(t.method)})(GS||(g.ShutdownRequest=GS={}));var HS;(function(t){t.method="exit",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType0(t.method)})(HS||(g.ExitNotification=HS={}));var XS;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method),t.capabilities=C.CM.create("workspace.didChangeConfiguration",void 0)})(XS||(g.DidChangeConfigurationNotification=XS={}));var jS;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(jS||(g.MessageType=jS={}));var zS;(function(t){t.method="window/showMessage",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method),t.capabilities=C.CM.create("window.showMessage",void 0)})(zS||(g.ShowMessageNotification=zS={}));var WS;(function(t){t.method="window/showMessageRequest",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("window.showMessage",void 0)})(WS||(g.ShowMessageRequest=WS={}));var qS;(function(t){t.method="window/logMessage",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method)})(qS||(g.LogMessageNotification=qS={}));var VS;(function(t){t.method="telemetry/event",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method)})(VS||(g.TelemetryEventNotification=VS={}));var YS;(function(t){t.None=0,t.Full=1,t.Incremental=2})(YS||(g.TextDocumentSyncKind=YS={}));var KS;(function(t){t.method="textDocument/didOpen",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method),t.capabilities=C.CM.create("textDocument.synchronization","textDocumentSync.openClose")})(KS||(g.DidOpenTextDocumentNotification=KS={}));var ZS;(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})(ZS||(g.TextDocumentContentChangeEvent=ZS={}));var JS;(function(t){t.method="textDocument/didChange",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method),t.capabilities=C.CM.create("textDocument.synchronization","textDocumentSync")})(JS||(g.DidChangeTextDocumentNotification=JS={}));var QS;(function(t){t.method="textDocument/didClose",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method),t.capabilities=C.CM.create("textDocument.synchronization","textDocumentSync.openClose")})(QS||(g.DidCloseTextDocumentNotification=QS={}));var eA;(function(t){t.method="textDocument/didSave",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method),t.capabilities=C.CM.create("textDocument.synchronization.didSave","textDocumentSync.save")})(eA||(g.DidSaveTextDocumentNotification=eA={}));var tA;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(tA||(g.TextDocumentSaveReason=tA={}));var rA;(function(t){t.method="textDocument/willSave",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method),t.capabilities=C.CM.create("textDocument.synchronization.willSave","textDocumentSync.willSave")})(rA||(g.WillSaveTextDocumentNotification=rA={}));var nA;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.synchronization.willSaveWaitUntil","textDocumentSync.willSaveWaitUntil")})(nA||(g.WillSaveTextDocumentWaitUntilRequest=nA={}));var iA;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method),t.capabilities=C.CM.create("workspace.didChangeWatchedFiles",void 0)})(iA||(g.DidChangeWatchedFilesNotification=iA={}));var oA;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(oA||(g.FileChangeType=oA={}));var Px;(function(t){function e(r){let n=r;return At.objectLiteral(n)&&(IS.URI.is(n.baseUri)||IS.WorkspaceFolder.is(n.baseUri))&&At.string(n.pattern)}t.is=e})(Px||(g.RelativePattern=Px={}));var Cx;(function(t){function e(r){let n=r;return At.string(n)||Px.is(n)}t.is=e})(Cx||(g.GlobPattern=Cx={}));var sA;(function(t){t.Create=1,t.Change=2,t.Delete=4})(sA||(g.WatchKind=sA={}));var aA;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method),t.capabilities=C.CM.create("textDocument.publishDiagnostics",void 0)})(aA||(g.PublishDiagnosticsNotification=aA={}));var cA;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(cA||(g.CompletionTriggerKind=cA={}));var lA;(function(t){t.method="textDocument/completion",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.completion","completionProvider")})(lA||(g.CompletionRequest=lA={}));var uA;(function(t){t.method="completionItem/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.completion.completionItem.resolveSupport","completionProvider.resolveProvider")})(uA||(g.CompletionResolveRequest=uA={}));var fA;(function(t){t.method="textDocument/hover",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.hover","hoverProvider")})(fA||(g.HoverRequest=fA={}));var dA;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(dA||(g.SignatureHelpTriggerKind=dA={}));var pA;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.signatureHelp","signatureHelpProvider")})(pA||(g.SignatureHelpRequest=pA={}));var hA;(function(t){t.method="textDocument/definition",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.definition","definitionProvider")})(hA||(g.DefinitionRequest=hA={}));var mA;(function(t){t.method="textDocument/references",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.references","referencesProvider")})(mA||(g.ReferencesRequest=mA={}));var gA;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.documentHighlight","documentHighlightProvider")})(gA||(g.DocumentHighlightRequest=gA={}));var yA;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.documentSymbol","documentSymbolProvider")})(yA||(g.DocumentSymbolRequest=yA={}));var xA;(function(t){t.method="textDocument/codeAction",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.codeAction","codeActionProvider")})(xA||(g.CodeActionRequest=xA={}));var TA;(function(t){t.method="codeAction/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.codeAction.resolveSupport","codeActionProvider.resolveProvider")})(TA||(g.CodeActionResolveRequest=TA={}));var _A;(function(t){t.method="workspace/symbol",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("workspace.symbol","workspaceSymbolProvider")})(_A||(g.WorkspaceSymbolRequest=_A={}));var EA;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("workspace.symbol.resolveSupport","workspaceSymbolProvider.resolveProvider")})(EA||(g.WorkspaceSymbolResolveRequest=EA={}));var vA;(function(t){t.method="textDocument/codeLens",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.codeLens","codeLensProvider")})(vA||(g.CodeLensRequest=vA={}));var bA;(function(t){t.method="codeLens/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.codeLens.resolveSupport","codeLensProvider.resolveProvider")})(bA||(g.CodeLensResolveRequest=bA={}));var wA;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType0(t.method),t.capabilities=C.CM.create("workspace.codeLens",void 0)})(wA||(g.CodeLensRefreshRequest=wA={}));var RA;(function(t){t.method="textDocument/documentLink",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.documentLink","documentLinkProvider")})(RA||(g.DocumentLinkRequest=RA={}));var SA;(function(t){t.method="documentLink/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.documentLink","documentLinkProvider.resolveProvider")})(SA||(g.DocumentLinkResolveRequest=SA={}));var AA;(function(t){t.method="textDocument/formatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.formatting","documentFormattingProvider")})(AA||(g.DocumentFormattingRequest=AA={}));var IA;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.rangeFormatting","documentRangeFormattingProvider")})(IA||(g.DocumentRangeFormattingRequest=IA={}));var kA;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.rangeFormatting.rangesSupport","documentRangeFormattingProvider.rangesSupport")})(kA||(g.DocumentRangesFormattingRequest=kA={}));var NA;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.onTypeFormatting","documentOnTypeFormattingProvider")})(NA||(g.DocumentOnTypeFormattingRequest=NA={}));var PA;(function(t){t.Identifier=1})(PA||(g.PrepareSupportDefaultBehavior=PA={}));var CA;(function(t){t.method="textDocument/rename",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.rename","renameProvider")})(CA||(g.RenameRequest=CA={}));var OA;(function(t){t.method="textDocument/prepareRename",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("textDocument.rename.prepareSupport","renameProvider.prepareProvider")})(OA||(g.PrepareRenameRequest=OA={}));var LA;(function(t){t.method="workspace/executeCommand",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method),t.capabilities=C.CM.create("workspace.executeCommand","executeCommandProvider")})(LA||(g.ExecuteCommandRequest=LA={}));var DA;(function(t){t.method="workspace/applyEdit",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType("workspace/applyEdit"),t.capabilities=C.CM.create("workspace.applyEdit",void 0)})(DA||(g.ApplyWorkspaceEditRequest=DA={}))});var XA=pe(Fx=>{"use strict";Object.defineProperty(Fx,"__esModule",{value:!0});Fx.createProtocolConnection=C2;var HA=Ms();function C2(t,e,r,n){return HA.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,HA.createMessageConnection)(t,e,r,n)}});var Id=pe(Zt=>{"use strict";var O2=Zt&&Zt.__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]})),Ad=Zt&&Zt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&O2(e,t,r)};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.LSPErrorCodes=Zt.createProtocolConnection=void 0;Ad(Ms(),Zt);Ad((el(),iu(gd)),Zt);Ad(tt(),Zt);Ad(GA(),Zt);var L2=XA();Object.defineProperty(Zt,"createProtocolConnection",{enumerable:!0,get:function(){return L2.createProtocolConnection}});var jA;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(jA||(Zt.LSPErrorCodes=jA={}))});var kI={};nu(kI,{nodeReadFile:()=>uU});async function uU(){throw new Error("nowline: filesystem readers are unavailable in the browser embed")}var NI=tE(()=>{});var NH={};nu(NH,{EmbedRenderError:()=>Zl,__resetForTests:()=>kH,init:()=>J_,initialize:()=>RH,parse:()=>AH,render:()=>SH,run:()=>IH,sha:()=>bH,version:()=>vH});var aC=new Set(["none","multiplier","person","people","points","time"]),cC=/^\d+$/,lC=/^\d+\.\d+$/,uC=/^\d+(?:\.\d+)?%$/;function qn(t){if(!t)return null;if(cC.test(t)){let e=parseInt(t,10);return e>0?e:null}if(lC.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?e:null}if(uC.test(t)){let e=parseFloat(t.slice(0,-1))/100;return Number.isFinite(e)&&e>0?e:null}return null}function Wa(t){if(Number.isInteger(t))return String(t);let e=t.toFixed(6);return e=e.replace(/0+$/,""),e=e.replace(/\.$/,""),e}function fC(t){return t.key.endsWith(":")?t.key.slice(0,-1):t.key}function dC(t){for(let e of t.properties)if(fC(e)==="unicode"&&e.value)return e.value}function qa(t,e){if(t==="none")return null;if(aC.has(t))return{kind:"builtin",name:t};let r=e.get(t);return r?{kind:"literal",text:dC(r)??t}:{kind:"literal",text:t}}function Xi(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 Va(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 Ya(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 Ph(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}}var nE="lexing-error",iE="parsing-error";function oE(t){if(!t||typeof t!="object")return!1;let e=t.code;return e===nE||e===iE}function Ch(t){let e=[];for(let r of t.parseResult.lexerErrors)e.push({origin:"lexer",error:r});for(let r of t.parseResult.parserErrors)e.push({origin:"parser",error:r});for(let r of t.diagnostics??[]){let n=r;oE(n.data)||e.push({origin:"validation",diagnostic:n})}return e}var pC=/did you mean ['"]?([^'"?]+)['"]?\??/i;function Oh(t){let e=t.match(pC);return e?e[1].trim():void 0}function sE(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 aE(t){if(!t||typeof t!="object")return;let e=t;if(typeof e.code=="string"&&Array.isArray(e.args))return e.code}function Lh(t){let e=aE(t.data);return e||(typeof t.code=="string"&&t.code!==""?t.code:typeof t.code=="number"?String(t.code):sE(t.message))}function pt(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function Pt(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}function hr(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}function cE(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function Fo(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}var $o=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}}isComplete(e){let r=this.getTypeMetaData(e.$type);for(let n of Object.keys(r.properties)){let i=r.properties[n];if(i.optional)continue;let o=e[i.name];if(o==null)return!1}return!0}};function Vn(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function ou(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function su(t){return Vn(t)&&typeof t.fullText=="string"}var br=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 zt})}join(e=","){let r=this.iterator(),n="",i,o=!1;do i=r.next(),i.done||(o&&(n+=e),n+=mC(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?zt:{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 zt})}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(au(o))r.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}}while(r.iterator);return zt})}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(au(o))n.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}while(n.iterator);return zt})}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?zt: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 zt})}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 mC(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function au(t){return!!t&&typeof t[Symbol.iterator]=="function"}var lu=new br(()=>{},()=>zt),zt=Object.freeze({done:!0,value:void 0});function Re(...t){if(t.length===1){let e=t[0];if(e instanceof br)return e;if(au(e))return new br(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new br(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:zt)}return t.length>1?new br(()=>({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++];au(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return zt}):lu}var Yn=class extends br{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 zt})}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}},cu;(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})(cu||(cu={}));function uu(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&&uu(i,e))}):pt(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&uu(n,e)))}function Uo(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function Ft(t){let r=Ka(t).$document;if(!r)throw new Error("AST node has no document.");return r}function Ka(t){for(;t.$container;)t=t.$container;return t}function Mh(t){return Pt(t)?t.ref?[t.ref]:[]:hr(t)?t.items.map(e=>e.ref):[]}function fu(t,e){if(!t)throw new Error("Node must be an AstNode.");let r=e?.range;return new br(()=>({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++,Dh(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)&&Dh(a,r))return{done:!1,value:a}}n.arrayIndex=0}}n.keyIndex++}return zt})}function qr(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Yn(t,r=>fu(r,e))}function Wt(t,e){if(t){if(e?.range&&!Dh(t,e.range))return new Yn(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new Yn(t,r=>fu(r,e),{includeRoot:!0})}function Dh(t,e){if(!e)return!0;let r=t.$cstNode?.range;return r?fE(r,e):!1}function ji(t){return new br(()=>({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(Pt(n)||hr(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(Pt(o)||hr(o))return{done:!1,value:{reference:o,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return zt})}function lE(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]=uE(i.defaultValue))}function uE(t){return Array.isArray(t)?[...t.map(uE)]:t}var rr={$type:"AbstractElement",cardinality:"cardinality"};function vu(t){return ve.isInstance(t,rr.$type)}var mu={$type:"AbstractParserRule"};function Zn(t){return ve.isInstance(t,mu.$type)}var du={$type:"AbstractRule"};var wr={$type:"AbstractType"};var Wi={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Jn(t){return ve.isInstance(t,Wi.$type)}var gu={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Wh(t){return ve.isInstance(t,gu.$type)}var dE={$type:"ArrayLiteral",elements:"elements"};var Fh={$type:"ArrayType",elementType:"elementType"};function yE(t){return ve.isInstance(t,Fh.$type)}var qi={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function Yr(t){return ve.isInstance(t,qi.$type)}var Uh={$type:"BooleanLiteral",true:"true"};function xE(t){return ve.isInstance(t,Uh.$type)}var Vi={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function TE(t){return ve.isInstance(t,Vi.$type)}var Bo={$type:"Condition"};var yu={$type:"Conjunction",left:"left",right:"right"};function _E(t){return ve.isInstance(t,yu.$type)}var Yi={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Kr(t){return ve.isInstance(t,Yi.$type)}var xu={$type:"Disjunction",left:"left",right:"right"};function EE(t){return ve.isInstance(t,xu.$type)}var Bh={$type:"EndOfFile",cardinality:"cardinality"};function vE(t){return ve.isInstance(t,Bh.$type)}var zi={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};var pE={$type:"GrammarImport",path:"path"};var Go={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Ki(t){return ve.isInstance(t,Go.$type)}var Gh={$type:"InferredType",name:"name"};function bu(t){return ve.isInstance(t,Gh.$type)}var hn={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function Zi(t){return ve.isInstance(t,hn.$type)}var $h={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};var hE={$type:"InfixRuleOperators",precedences:"precedences"};var ec={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function bE(t){return ve.isInstance(t,ec.$type)}var tc={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Rr(t){return ve.isInstance(t,tc.$type)}var pu={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};var Ho={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function wE(t){return ve.isInstance(t,Ho.$type)}var Hh={$type:"Negation",value:"value"};function RE(t){return ve.isInstance(t,Hh.$type)}var mE={$type:"NumberLiteral",value:"value"};var hu={$type:"Parameter",name:"name"};var Xh={$type:"ParameterReference",parameter:"parameter"};function SE(t){return ve.isInstance(t,Xh.$type)}var Vr={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function Ut(t){return ve.isInstance(t,Vr.$type)}var Tu={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function AE(t){return ve.isInstance(t,Tu.$type)}var Xo={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function IE(t){return ve.isInstance(t,Xo.$type)}var jh={$type:"ReturnType",name:"name"};function kE(t){return ve.isInstance(t,jh.$type)}var jo={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Zr(t){return ve.isInstance(t,jo.$type)}var rc={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function qh(t){return ve.isInstance(t,rc.$type)}var gE={$type:"StringLiteral",value:"value"};var zo={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function NE(t){return ve.isInstance(t,zo.$type)}var mr={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};var Wo={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function PE(t){return ve.isInstance(t,Wo.$type)}var Kn={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function qt(t){return ve.isInstance(t,Kn.$type)}var qo={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function Vh(t){return ve.isInstance(t,qo.$type)}var _u={$type:"Type",name:"name",type:"type"};function Yh(t){return ve.isInstance(t,_u.$type)}var Za={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};var Ja={$type:"TypeDefinition"};var zh={$type:"UnionType",types:"types"};function CE(t){return ve.isInstance(t,zh.$type)}var Eu={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function Kh(t){return ve.isInstance(t,Eu.$type)}var Vo={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function OE(t){return ve.isInstance(t,Vo.$type)}var Qa={$type:"ValueLiteral"};var nc={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function LE(t){return ve.isInstance(t,nc.$type)}var ic=class extends $o{constructor(){super(...arguments),this.types={AbstractElement:{name:rr.$type,properties:{cardinality:{name:rr.cardinality,optional:!0}},superTypes:[]},AbstractParserRule:{name:mu.$type,properties:{},superTypes:[du.$type,wr.$type]},AbstractRule:{name:du.$type,properties:{},superTypes:[]},AbstractType:{name:wr.$type,properties:{},superTypes:[]},Action:{name:Wi.$type,properties:{cardinality:{name:Wi.cardinality,optional:!0},feature:{name:Wi.feature,optional:!0},inferredType:{name:Wi.inferredType,optional:!0},operator:{name:Wi.operator,optional:!0},type:{name:Wi.type,referenceType:wr.$type,optional:!0}},superTypes:[rr.$type]},Alternatives:{name:gu.$type,properties:{cardinality:{name:gu.cardinality,optional:!0},elements:{name:gu.elements,defaultValue:[]}},superTypes:[rr.$type]},ArrayLiteral:{name:dE.$type,properties:{elements:{name:dE.elements,defaultValue:[]}},superTypes:[Qa.$type]},ArrayType:{name:Fh.$type,properties:{elementType:{name:Fh.elementType}},superTypes:[Ja.$type]},Assignment:{name:qi.$type,properties:{cardinality:{name:qi.cardinality,optional:!0},feature:{name:qi.feature},operator:{name:qi.operator},predicate:{name:qi.predicate,optional:!0},terminal:{name:qi.terminal}},superTypes:[rr.$type]},BooleanLiteral:{name:Uh.$type,properties:{true:{name:Uh.true,defaultValue:!1}},superTypes:[Bo.$type,Qa.$type]},CharacterRange:{name:Vi.$type,properties:{cardinality:{name:Vi.cardinality,optional:!0},left:{name:Vi.left},lookahead:{name:Vi.lookahead,optional:!0},parenthesized:{name:Vi.parenthesized,defaultValue:!1,optional:!0},right:{name:Vi.right,optional:!0}},superTypes:[mr.$type]},Condition:{name:Bo.$type,properties:{},superTypes:[]},Conjunction:{name:yu.$type,properties:{left:{name:yu.left},right:{name:yu.right}},superTypes:[Bo.$type]},CrossReference:{name:Yi.$type,properties:{cardinality:{name:Yi.cardinality,optional:!0},deprecatedSyntax:{name:Yi.deprecatedSyntax,defaultValue:!1},isMulti:{name:Yi.isMulti,defaultValue:!1},terminal:{name:Yi.terminal,optional:!0},type:{name:Yi.type,referenceType:wr.$type}},superTypes:[rr.$type]},Disjunction:{name:xu.$type,properties:{left:{name:xu.left},right:{name:xu.right}},superTypes:[Bo.$type]},EndOfFile:{name:Bh.$type,properties:{cardinality:{name:Bh.cardinality,optional:!0}},superTypes:[rr.$type]},Grammar:{name:zi.$type,properties:{imports:{name:zi.imports,defaultValue:[]},interfaces:{name:zi.interfaces,defaultValue:[]},isDeclared:{name:zi.isDeclared,defaultValue:!1},name:{name:zi.name,optional:!0},rules:{name:zi.rules,defaultValue:[]},types:{name:zi.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:pE.$type,properties:{path:{name:pE.path}},superTypes:[]},Group:{name:Go.$type,properties:{cardinality:{name:Go.cardinality,optional:!0},elements:{name:Go.elements,defaultValue:[]},guardCondition:{name:Go.guardCondition,optional:!0},predicate:{name:Go.predicate,optional:!0}},superTypes:[rr.$type]},InferredType:{name:Gh.$type,properties:{name:{name:Gh.name}},superTypes:[wr.$type]},InfixRule:{name:hn.$type,properties:{call:{name:hn.call},dataType:{name:hn.dataType,optional:!0},inferredType:{name:hn.inferredType,optional:!0},name:{name:hn.name},operators:{name:hn.operators},parameters:{name:hn.parameters,defaultValue:[]},returnType:{name:hn.returnType,referenceType:wr.$type,optional:!0}},superTypes:[mu.$type]},InfixRuleOperatorList:{name:$h.$type,properties:{associativity:{name:$h.associativity,optional:!0},operators:{name:$h.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:hE.$type,properties:{precedences:{name:hE.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:ec.$type,properties:{attributes:{name:ec.attributes,defaultValue:[]},name:{name:ec.name},superTypes:{name:ec.superTypes,defaultValue:[],referenceType:wr.$type}},superTypes:[wr.$type]},Keyword:{name:tc.$type,properties:{cardinality:{name:tc.cardinality,optional:!0},predicate:{name:tc.predicate,optional:!0},value:{name:tc.value}},superTypes:[rr.$type]},NamedArgument:{name:pu.$type,properties:{calledByName:{name:pu.calledByName,defaultValue:!1},parameter:{name:pu.parameter,referenceType:hu.$type,optional:!0},value:{name:pu.value}},superTypes:[]},NegatedToken:{name:Ho.$type,properties:{cardinality:{name:Ho.cardinality,optional:!0},lookahead:{name:Ho.lookahead,optional:!0},parenthesized:{name:Ho.parenthesized,defaultValue:!1,optional:!0},terminal:{name:Ho.terminal}},superTypes:[mr.$type]},Negation:{name:Hh.$type,properties:{value:{name:Hh.value}},superTypes:[Bo.$type]},NumberLiteral:{name:mE.$type,properties:{value:{name:mE.value}},superTypes:[Qa.$type]},Parameter:{name:hu.$type,properties:{name:{name:hu.name}},superTypes:[]},ParameterReference:{name:Xh.$type,properties:{parameter:{name:Xh.parameter,referenceType:hu.$type}},superTypes:[Bo.$type]},ParserRule:{name:Vr.$type,properties:{dataType:{name:Vr.dataType,optional:!0},definition:{name:Vr.definition},entry:{name:Vr.entry,defaultValue:!1},fragment:{name:Vr.fragment,defaultValue:!1},inferredType:{name:Vr.inferredType,optional:!0},name:{name:Vr.name},parameters:{name:Vr.parameters,defaultValue:[]},returnType:{name:Vr.returnType,referenceType:wr.$type,optional:!0}},superTypes:[mu.$type]},ReferenceType:{name:Tu.$type,properties:{isMulti:{name:Tu.isMulti,defaultValue:!1},referenceType:{name:Tu.referenceType}},superTypes:[Ja.$type]},RegexToken:{name:Xo.$type,properties:{cardinality:{name:Xo.cardinality,optional:!0},lookahead:{name:Xo.lookahead,optional:!0},parenthesized:{name:Xo.parenthesized,defaultValue:!1,optional:!0},regex:{name:Xo.regex}},superTypes:[mr.$type]},ReturnType:{name:jh.$type,properties:{name:{name:jh.name}},superTypes:[]},RuleCall:{name:jo.$type,properties:{arguments:{name:jo.arguments,defaultValue:[]},cardinality:{name:jo.cardinality,optional:!0},predicate:{name:jo.predicate,optional:!0},rule:{name:jo.rule,referenceType:du.$type}},superTypes:[rr.$type]},SimpleType:{name:rc.$type,properties:{primitiveType:{name:rc.primitiveType,optional:!0},stringType:{name:rc.stringType,optional:!0},typeRef:{name:rc.typeRef,referenceType:wr.$type,optional:!0}},superTypes:[Ja.$type]},StringLiteral:{name:gE.$type,properties:{value:{name:gE.value}},superTypes:[Qa.$type]},TerminalAlternatives:{name:zo.$type,properties:{cardinality:{name:zo.cardinality,optional:!0},elements:{name:zo.elements,defaultValue:[]},lookahead:{name:zo.lookahead,optional:!0},parenthesized:{name:zo.parenthesized,defaultValue:!1,optional:!0}},superTypes:[mr.$type]},TerminalElement:{name:mr.$type,properties:{cardinality:{name:mr.cardinality,optional:!0},lookahead:{name:mr.lookahead,optional:!0},parenthesized:{name:mr.parenthesized,defaultValue:!1,optional:!0}},superTypes:[rr.$type]},TerminalGroup:{name:Wo.$type,properties:{cardinality:{name:Wo.cardinality,optional:!0},elements:{name:Wo.elements,defaultValue:[]},lookahead:{name:Wo.lookahead,optional:!0},parenthesized:{name:Wo.parenthesized,defaultValue:!1,optional:!0}},superTypes:[mr.$type]},TerminalRule:{name:Kn.$type,properties:{definition:{name:Kn.definition},fragment:{name:Kn.fragment,defaultValue:!1},hidden:{name:Kn.hidden,defaultValue:!1},name:{name:Kn.name},type:{name:Kn.type,optional:!0}},superTypes:[du.$type]},TerminalRuleCall:{name:qo.$type,properties:{cardinality:{name:qo.cardinality,optional:!0},lookahead:{name:qo.lookahead,optional:!0},parenthesized:{name:qo.parenthesized,defaultValue:!1,optional:!0},rule:{name:qo.rule,referenceType:Kn.$type}},superTypes:[mr.$type]},Type:{name:_u.$type,properties:{name:{name:_u.name},type:{name:_u.type}},superTypes:[wr.$type]},TypeAttribute:{name:Za.$type,properties:{defaultValue:{name:Za.defaultValue,optional:!0},isOptional:{name:Za.isOptional,defaultValue:!1},name:{name:Za.name},type:{name:Za.type}},superTypes:[]},TypeDefinition:{name:Ja.$type,properties:{},superTypes:[]},UnionType:{name:zh.$type,properties:{types:{name:zh.types,defaultValue:[]}},superTypes:[Ja.$type]},UnorderedGroup:{name:Eu.$type,properties:{cardinality:{name:Eu.cardinality,optional:!0},elements:{name:Eu.elements,defaultValue:[]}},superTypes:[rr.$type]},UntilToken:{name:Vo.$type,properties:{cardinality:{name:Vo.cardinality,optional:!0},lookahead:{name:Vo.lookahead,optional:!0},parenthesized:{name:Vo.parenthesized,defaultValue:!1,optional:!0},terminal:{name:Vo.terminal}},superTypes:[mr.$type]},ValueLiteral:{name:Qa.$type,properties:{},superTypes:[]},Wildcard:{name:nc.$type,properties:{cardinality:{name:nc.cardinality,optional:!0},lookahead:{name:nc.lookahead,optional:!0},parenthesized:{name:nc.parenthesized,defaultValue:!1,optional:!0}},superTypes:[mr.$type]}}}},ve=new ic;function oc(t){return new Yn(t,e=>Vn(e)?e.content:[],{includeRoot:!0})}function $E(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function FE(t){return{start:{line:t.startLine-1,character:t.startColumn-1},end:{line:t.endLine-1,character:t.endColumn}}}function sc(t){let{startOffset:e,endOffset:r}=t;return typeof e=="number"&&Number.isFinite(e)&&e>=0&&typeof r=="number"&&Number.isFinite(r)&&r>=e}function Yo(t){if(!t)return;let{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}var mn;(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"})(mn||(mn={}));function gC(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return mn.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return mn.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?mn.Inside:r?mn.OverlapBack:n?mn.OverlapFront:mn.Outside}function fE(t,e){return gC(t,e)>mn.After}var UE=/^[\w\p{L}]$/u;function BE(t,e){if(t){let r=yC(t,!0);if(r&&ME(r,e))return r;if(su(t)){let n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){let o=t.content[i];if(ME(o,e))return o}}}}function ME(t,e){return ou(t)&&e.includes(t.tokenType.name)}function yC(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}}var ku={};nu(ku,{findAssignment:()=>lm,findNameAssignment:()=>Au,findNodeForKeyword:()=>am,findNodeForProperty:()=>dc,findNodesForKeyword:()=>wC,findNodesForKeywordInternal:()=>cm,findNodesForProperty:()=>om,getActionAtElement:()=>VE,getActionType:()=>KE,getAllReachableRules:()=>fc,getAllRulesUsedForCrossReferences:()=>bC,getCrossReferenceTerminal:()=>nm,getEntryRule:()=>jE,getExplicitRuleType:()=>Iu,getHiddenRules:()=>zE,getRuleType:()=>um,getRuleTypeName:()=>kC,getTypeName:()=>ei,isArrayCardinality:()=>SC,isArrayOperator:()=>AC,isCommentTerminal:()=>im,isDataType:()=>IC,isDataTypeRule:()=>pc,isOptionalCardinality:()=>RC,terminalRegex:()=>Zo});var ac=class extends Error{constructor(e,r){let n=typeof r=="string"?r:r();super(e?`${n} at ${e.range.start.line}:${e.range.start.character}`:n)}};function Qn(t,e="Error: Got unexpected value."){throw new Error(typeof e=="string"?e:e())}function se(t){return t.charCodeAt(0)}function wu(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function Ko(t,e){if(t[e]===!0)throw"duplicate flag "+e;let r=t[e];t[e]=!0}function Ji(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function cc(){throw Error("Internal Error - Should never get here!")}function Zh(t){return t.type==="Character"}var lc=[];for(let t=se("0");t<=se("9");t++)lc.push(t);var uc=[se("_")].concat(lc);for(let t=se("a");t<=se("z");t++)uc.push(t);for(let t=se("A");t<=se("Z");t++)uc.push(t);var Jh=[se(" "),se("\f"),se(`
13
+ `),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 xC=/[0-9a-fA-F]/,Ru=/[0-9]/,TC=/[1-9]/,Qi=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":Ko(n,"global");break;case"i":Ko(n,"ignoreCase");break;case"m":Ko(n,"multiLine");break;case"u":Ko(n,"unicode");break;case"y":Ko(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}}Ji(r);let n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return cc()}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;Ji(r);break}if(!(e===!0&&r===void 0)&&Ji(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()),Ji(e)?(e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):cc()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[se(`
14
+ `),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=lc;break;case"D":e=lc,r=!0;break;case"s":e=Jh;break;case"S":e=Jh,r=!0;break;case"w":e=uc;break;case"W":e=uc,r=!0;break}return Ji(e)?{type:"Set",value:e,complement:r}:cc()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=se("\f");break;case"n":e=se(`
15
+ `);break;case"r":e=se("\r");break;case"t":e=se(" ");break;case"v":e=se("\v");break}return Ji(e)?{type:"Character",value:e}:cc()}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`
16
+ `: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(Zh(n)&&this.isRangeDash()){this.consumeChar("-");let o=this.classAtom(),s=o.type==="Character";if(Zh(o)){if(o.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:o.value})}else wu(n.value,e),e.push(se("-")),wu(o.value,e)}else wu(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
17
+ `: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(TC.test(e)===!1)throw Error("Expecting a positive integer");for(;Ru.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Ru.test(e)===!1)throw Error("Expecting an integer");for(;Ru.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`
18
+ `: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 Ru.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
19
19
  `: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`
20
- `: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(hC.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 Jr=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 $E=/\r?\n/gm,gC=new Ji,Yh=class extends Jr{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===`
21
- `&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let n=Qi(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=!!`
22
- `.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)}},Vh=new Yh;function FE(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),Vh.reset(t),Vh.visit(gC.pattern(t)),Vh.multiline}catch{return!1}}var yC=`\f
23
- \r \v \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`.split("");function bu(t){let e=typeof t=="string"?new RegExp(t):t;return yC.some(r=>e.test(r))}function Qi(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function UE(t,e){let r=xC(t),n=e.match(r);return!!n&&n[0].length>0}function xC(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 BE(t){return t.rules.find(e=>Ut(e)&&e.entry)}function GE(t){return t.rules.filter(e=>qt(e)&&e.hidden)}function fc(t,e){let r=new Set,n=BE(t);if(!n)return new Set(t.rules);let i=[n].concat(GE(t));for(let s of i)XE(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 XE(t,e,r){e.add(t.name),qr(t).forEach(n=>{if(Zr(n)||r&&Hh(n)){let i=n.rule.ref;i&&!e.has(i.name)&&XE(i,e,r)}})}function TC(t){let e=new Set;return qr(t).forEach(r=>{Kr(r)&&(Ut(r.type.ref)&&e.add(r.type.ref),_u(r.type.ref)&&Ut(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}function Jh(t){if(t.terminal)return t.terminal;if(t.type.ref)return wu(t.type.ref)?.terminal}function Qh(t){return t.hidden&&!bu(Vo(t))}function em(t,e){return!t||!e?[]:tm(t,e,t.astNode,!0)}function dc(t,e,r){if(!t||!e)return;let n=tm(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 tm(t,e,r,n){if(!n){let i=Mo(t.grammarSource,Yr);if(i&&i.feature===e)return[t]}return Vn(t)&&t.astNode===r?t.content.flatMap(i=>tm(i,e,r,!1)):[]}function _C(t,e){return t?nm(t,e,t?.astNode):[]}function rm(t,e,r){if(!t)return;let n=nm(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 nm(t,e,r){if(t.astNode!==r)return[];if(Rr(t.grammarSource)&&t.grammarSource.value===e)return[t];let n=oc(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 im(t){let e=t.astNode;for(;e===t.container?.astNode;){let r=Mo(t.grammarSource,Yr);if(r)return r;t=t.container}}function wu(t){let e=t;return _u(e)&&(Jn(e.$container)?e=e.$container.$container:Zn(e.$container)?e=e.$container:Qn(e.$container)),HE(t,e,new Map)}function HE(t,e,r){function n(i,o){let s;return Mo(i,Yr)||(s=HE(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 qr(e)){if(Yr(i)&&i.feature.toLowerCase()==="name")return r.set(t,i),i;if(Zr(i)&&Ut(i.rule.ref))return n(i,i.rule.ref);if(Xh(i)&&i.typeRef?.ref)return n(i,i.typeRef.ref)}}function jE(t){let e=t.$container;if(Yi(e)){let r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){let o=r[i];if(Jn(o))return o;{let s=qr(r[i]).find(Jn);if(s)return s}}}if(Tu(e))return jE(e)}function EC(t,e){return t==="?"||t==="*"||Yi(e)&&!!e.guardCondition}function vC(t){return t==="*"||t==="+"}function bC(t){return t==="+="}function pc(t){return zE(t,new Set)}function zE(t,e){if(e.has(t))return!0;e.add(t);for(let r of qr(t))if(Zr(r)){if(!r.rule.ref||Ut(r.rule.ref)&&!zE(r.rule.ref,e)||Ki(r.rule.ref))return!1}else{if(Yr(r))return!1;if(Jn(r))return!1}return!!t.definition}function wC(t){return Zh(t.type,new Set)}function Zh(t,e){if(e.has(t))return!0;if(e.add(t),hE(t))return!1;if(wE(t))return!1;if(kE(t))return t.types.every(r=>Zh(r,e));if(Xh(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 jh(r)?Zh(r.type,e):!1}else return!1}else return!1}function Ru(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 ei(t){if(Zn(t))return Ut(t)&&pc(t)?t.name:Ru(t)??t.name;if(_E(t)||jh(t)||SE(t))return t.name;if(Jn(t)){let e=WE(t);if(e)return e}else if(_u(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function WE(t){if(t.inferredType)return t.inferredType.name;if(t.type?.ref)return ei(t.type.ref)}function RC(t){return qt(t)?t.type?.name??"string":Ut(t)&&pc(t)?t.name:Ru(t)??t.name}function om(t){return qt(t)?t.type?.name??"string":Ru(t)??t.name}function Vo(t){let e={s:!1,i:!1,u:!1},r=Yo(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}var sm=/[\s\S]/.source;function Yo(t,e){if(AE(t))return SC(t);if(IE(t))return AC(t);if(gE(t))return NC(t);if(Hh(t)){let r=t.rule.ref;if(!r)throw new Error("Missing rule reference.");return gn(Yo(r.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(EE(t))return kC(t);if(NE(t))return IC(t);if(RE(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")),gn(n,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(PE(t))return gn(sm,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t?.$type}, ${t?.$cstNode?.text}`)}}}function SC(t){return gn(t.elements.map(e=>Yo(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function AC(t){return gn(t.elements.map(e=>Yo(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function IC(t){return gn(`${sm}*?${Yo(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function kC(t){return gn(`(?!${Yo(t.terminal)})${sm}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function NC(t){return t.right?gn(`[${Kh(t.left)}-${Kh(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):gn(Kh(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function Kh(t){return Qi(t.value)}function gn(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function qE(t){let e=[],r=t.Grammar;for(let n of r.rules)qt(n)&&Qh(n)&&FE(Vo(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:DE}}function Ko(t){console&&console.error&&console.error(`Error: ${t}`)}function hc(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function mc(t){let e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function gc(t){function e(){}e.prototype=t;let r=new e;function n(){return typeof r.bar}return n(),n(),t;(0,eval)(t)}function PC(t){return CC(t)?t.LABEL:t.name}function CC(t){return typeof t.LABEL=="string"&&t.LABEL!==""}var nr=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)})}},De=class extends nr{constructor(e){super([]),this.idx=1,Object.assign(this,Qr(e))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},Bt=class extends nr{constructor(e){super(e.definition),this.orgText="",Object.assign(this,Qr(e))}},qe=class extends nr{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,Qr(e))}},Me=class extends nr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,Qr(e))}},Ve=class extends nr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,Qr(e))}},Ye=class extends nr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,Qr(e))}},ve=class extends nr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,Qr(e))}},je=class extends nr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,Qr(e))}},ze=class extends nr{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,Qr(e))}},me=class{constructor(e){this.idx=1,Object.assign(this,Qr(e))}accept(e){e.visit(this)}};function Au(t){return t.map(Zo)}function Zo(t){function e(r){return r.map(Zo)}if(t instanceof De){let r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return typeof t.label=="string"&&(r.label=t.label),r}else{if(t instanceof qe)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Me)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Ve)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Ye)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Zo(new me({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof je)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Zo(new me({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ve)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 me){let r={type:"Terminal",name:t.terminalType.name,label:PC(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 Bt)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}function Qr(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0))}var Gt=class{visit(e){let r=e;switch(r.constructor){case De:return this.visitNonTerminal(r);case qe:return this.visitAlternative(r);case Me:return this.visitOption(r);case Ve:return this.visitRepetitionMandatory(r);case Ye:return this.visitRepetitionMandatoryWithSeparator(r);case je:return this.visitRepetitionWithSeparator(r);case ve:return this.visitRepetition(r);case ze:return this.visitAlternation(r);case me:return this.visitTerminal(r);case Bt: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 am(t){return t instanceof qe||t instanceof Me||t instanceof ve||t instanceof Ve||t instanceof Ye||t instanceof je||t instanceof me||t instanceof Bt}function eo(t,e=[]){return t instanceof Me||t instanceof ve||t instanceof je?!0:t instanceof ze?t.definition.some(n=>eo(n,e)):t instanceof De&&e.includes(t)?!1:t instanceof nr?(t instanceof De&&e.push(t),t.definition.every(n=>eo(n,e))):!1}function cm(t){return t instanceof ze}function Vt(t){if(t instanceof De)return"SUBRULE";if(t instanceof Me)return"OPTION";if(t instanceof ze)return"OR";if(t instanceof Ve)return"AT_LEAST_ONE";if(t instanceof Ye)return"AT_LEAST_ONE_SEP";if(t instanceof je)return"MANY_SEP";if(t instanceof ve)return"MANY";if(t instanceof me)return"CONSUME";throw Error("non exhaustive match")}var yn=class{walk(e,r=[]){e.definition.forEach((n,i)=>{let o=e.definition.slice(i+1);if(n instanceof De)this.walkProdRef(n,o,r);else if(n instanceof me)this.walkTerminal(n,o,r);else if(n instanceof qe)this.walkFlat(n,o,r);else if(n instanceof Me)this.walkOption(n,o,r);else if(n instanceof Ve)this.walkAtLeastOne(n,o,r);else if(n instanceof Ye)this.walkAtLeastOneSep(n,o,r);else if(n instanceof je)this.walkManySep(n,o,r);else if(n instanceof ve)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 Me({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){let i=VE(e,r,n);this.walk(e,i)}walkMany(e,r,n){let i=[new Me({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){let i=VE(e,r,n);this.walk(e,i)}walkOr(e,r,n){let i=r.concat(n);e.definition.forEach(o=>{let s=new qe({definition:[o]});this.walk(s,i)})}};function VE(t,e,r){return[new Me({definition:[new me({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function to(t){if(t instanceof De)return to(t.referencedRule);if(t instanceof me)return DC(t);if(am(t))return OC(t);if(cm(t))return LC(t);throw Error("non exhaustive match")}function OC(t){let e=[],r=t.definition,n=0,i=r.length>n,o,s=!0;for(;i&&s;)o=r[n],s=eo(o),e=e.concat(to(o)),n=n+1,i=r.length>n;return[...new Set(e)]}function LC(t){let e=t.definition.map(r=>to(r));return[...new Set(e.flat())]}function DC(t){return[t.terminalType]}var Iu="_~IN~_";var lm=class extends yn{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=MC(e.referencedRule,e.idx)+this.topProd.name,o=r.concat(n),s=new qe({definition:o}),a=to(s);this.follows[i]=a}};function YE(t){let e={};return t.forEach(r=>{let n=new lm(r).startWalking();Object.assign(e,n)}),e}function MC(t,e){return t.name+e+Iu}var ku={},$C=new Ji;function Jo(t){let e=t.toString();if(ku.hasOwnProperty(e))return ku[e];{let r=$C.pattern(e);return ku[e]=r,r}}function KE(){ku={}}var JE="Complement Sets are not supported for first char optimization",yc=`Unable to use "first char" lexer optimizations:
24
- `;function QE(t,e=!1){try{let r=Jo(t);return um(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===JE)e&&hc(`${yc} Unable to optimize: < ${t.toString()} >
20
+ `: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(xC.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 Jr=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 GE=/\r?\n/gm,_C=new Qi,em=class extends Jr{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===`
21
+ `&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let n=eo(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=!!`
22
+ `.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)}},Qh=new em;function HE(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),Qh.reset(t),Qh.visit(_C.pattern(t)),Qh.multiline}catch{return!1}}var EC=`\f
23
+ \r \v \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`.split("");function Su(t){let e=typeof t=="string"?new RegExp(t):t;return EC.some(r=>e.test(r))}function eo(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function XE(t,e){let r=vC(t),n=e.match(r);return!!n&&n[0].length>0}function vC(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=>Ut(e)&&e.entry)}function zE(t){return t.rules.filter(e=>qt(e)&&e.hidden)}function fc(t,e){let r=new Set,n=jE(t);if(!n)return new Set(t.rules);let i=[n].concat(zE(t));for(let s of i)WE(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 WE(t,e,r){e.add(t.name),qr(t).forEach(n=>{if(Zr(n)||r&&Vh(n)){let i=n.rule.ref;i&&!e.has(i.name)&&WE(i,e,r)}})}function bC(t){let e=new Set;return qr(t).forEach(r=>{Kr(r)&&(Ut(r.type.ref)&&e.add(r.type.ref),bu(r.type.ref)&&Ut(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}function nm(t){if(t.terminal)return t.terminal;if(t.type.ref)return Au(t.type.ref)?.terminal}function im(t){return t.hidden&&!Su(Zo(t))}function om(t,e){return!t||!e?[]:sm(t,e,t.astNode,!0)}function dc(t,e,r){if(!t||!e)return;let n=sm(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 sm(t,e,r,n){if(!n){let i=Uo(t.grammarSource,Yr);if(i&&i.feature===e)return[t]}return Vn(t)&&t.astNode===r?t.content.flatMap(i=>sm(i,e,r,!1)):[]}function wC(t,e){return t?cm(t,e,t?.astNode):[]}function am(t,e,r){if(!t)return;let n=cm(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 cm(t,e,r){if(t.astNode!==r)return[];if(Rr(t.grammarSource)&&t.grammarSource.value===e)return[t];let n=oc(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 lm(t){let e=t.astNode;for(;e===t.container?.astNode;){let r=Uo(t.grammarSource,Yr);if(r)return r;t=t.container}}function Au(t){let e=t;return bu(e)&&(Jn(e.$container)?e=e.$container.$container:Zn(e.$container)?e=e.$container:Qn(e.$container)),qE(t,e,new Map)}function qE(t,e,r){function n(i,o){let s;return Uo(i,Yr)||(s=qE(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 qr(e)){if(Yr(i)&&i.feature.toLowerCase()==="name")return r.set(t,i),i;if(Zr(i)&&Ut(i.rule.ref))return n(i,i.rule.ref);if(qh(i)&&i.typeRef?.ref)return n(i,i.typeRef.ref)}}function VE(t){let e=t.$container;if(Ki(e)){let r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){let o=r[i];if(Jn(o))return o;{let s=qr(r[i]).find(Jn);if(s)return s}}}if(vu(e))return VE(e)}function RC(t,e){return t==="?"||t==="*"||Ki(e)&&!!e.guardCondition}function SC(t){return t==="*"||t==="+"}function AC(t){return t==="+="}function pc(t){return YE(t,new Set)}function YE(t,e){if(e.has(t))return!0;e.add(t);for(let r of qr(t))if(Zr(r)){if(!r.rule.ref||Ut(r.rule.ref)&&!YE(r.rule.ref,e)||Zi(r.rule.ref))return!1}else{if(Yr(r))return!1;if(Jn(r))return!1}return!!t.definition}function IC(t){return rm(t.type,new Set)}function rm(t,e){if(e.has(t))return!0;if(e.add(t),yE(t))return!1;if(AE(t))return!1;if(CE(t))return t.types.every(r=>rm(r,e));if(qh(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 Yh(r)?rm(r.type,e):!1}else return!1}else return!1}function Iu(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 ei(t){if(Zn(t))return Ut(t)&&pc(t)?t.name:Iu(t)??t.name;if(bE(t)||Yh(t)||kE(t))return t.name;if(Jn(t)){let e=KE(t);if(e)return e}else if(bu(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 ei(t.type.ref)}function kC(t){return qt(t)?t.type?.name??"string":Ut(t)&&pc(t)?t.name:Iu(t)??t.name}function um(t){return qt(t)?t.type?.name??"string":Iu(t)??t.name}function Zo(t){let e={s:!1,i:!1,u:!1},r=Jo(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}var fm=/[\s\S]/.source;function Jo(t,e){if(NE(t))return NC(t);if(PE(t))return PC(t);if(TE(t))return LC(t);if(Vh(t)){let r=t.rule.ref;if(!r)throw new Error("Missing rule reference.");return gn(Jo(r.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(wE(t))return OC(t);if(OE(t))return CC(t);if(IE(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")),gn(n,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(LE(t))return gn(fm,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t?.$type}, ${t?.$cstNode?.text}`)}}}function NC(t){return gn(t.elements.map(e=>Jo(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function PC(t){return gn(t.elements.map(e=>Jo(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function CC(t){return gn(`${fm}*?${Jo(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function OC(t){return gn(`(?!${Jo(t.terminal)})${fm}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function LC(t){return t.right?gn(`[${tm(t.left)}-${tm(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):gn(tm(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function tm(t){return eo(t.value)}function gn(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function ZE(t){let e=[],r=t.Grammar;for(let n of r.rules)qt(n)&&im(n)&&HE(Zo(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:UE}}function Qo(t){console&&console.error&&console.error(`Error: ${t}`)}function hc(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function mc(t){let e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function gc(t){function e(){}e.prototype=t;let r=new e;function n(){return typeof r.bar}return n(),n(),t;(0,eval)(t)}function DC(t){return MC(t)?t.LABEL:t.name}function MC(t){return typeof t.LABEL=="string"&&t.LABEL!==""}var nr=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)})}},De=class extends nr{constructor(e){super([]),this.idx=1,Object.assign(this,Qr(e))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},Bt=class extends nr{constructor(e){super(e.definition),this.orgText="",Object.assign(this,Qr(e))}},qe=class extends nr{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,Qr(e))}},Me=class extends nr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,Qr(e))}},Ve=class extends nr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,Qr(e))}},Ye=class extends nr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,Qr(e))}},be=class extends nr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,Qr(e))}},je=class extends nr{constructor(e){super(e.definition),this.idx=1,Object.assign(this,Qr(e))}},ze=class extends nr{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,Qr(e))}},he=class{constructor(e){this.idx=1,Object.assign(this,Qr(e))}accept(e){e.visit(this)}};function Nu(t){return t.map(es)}function es(t){function e(r){return r.map(es)}if(t instanceof De){let r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return typeof t.label=="string"&&(r.label=t.label),r}else{if(t instanceof qe)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Me)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Ve)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Ye)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:es(new he({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof je)return{type:"RepetitionWithSeparator",idx:t.idx,separator:es(new he({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 he){let r={type:"Terminal",name:t.terminalType.name,label:DC(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 Bt)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}function Qr(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0))}var Gt=class{visit(e){let r=e;switch(r.constructor){case De:return this.visitNonTerminal(r);case qe:return this.visitAlternative(r);case Me:return this.visitOption(r);case Ve:return this.visitRepetitionMandatory(r);case Ye:return this.visitRepetitionMandatoryWithSeparator(r);case je:return this.visitRepetitionWithSeparator(r);case be:return this.visitRepetition(r);case ze:return this.visitAlternation(r);case he:return this.visitTerminal(r);case Bt: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 dm(t){return t instanceof qe||t instanceof Me||t instanceof be||t instanceof Ve||t instanceof Ye||t instanceof je||t instanceof he||t instanceof Bt}function to(t,e=[]){return t instanceof Me||t instanceof be||t instanceof je?!0:t instanceof ze?t.definition.some(n=>to(n,e)):t instanceof De&&e.includes(t)?!1:t instanceof nr?(t instanceof De&&e.push(t),t.definition.every(n=>to(n,e))):!1}function pm(t){return t instanceof ze}function Vt(t){if(t instanceof De)return"SUBRULE";if(t instanceof Me)return"OPTION";if(t instanceof ze)return"OR";if(t instanceof Ve)return"AT_LEAST_ONE";if(t instanceof Ye)return"AT_LEAST_ONE_SEP";if(t instanceof je)return"MANY_SEP";if(t instanceof be)return"MANY";if(t instanceof he)return"CONSUME";throw Error("non exhaustive match")}var yn=class{walk(e,r=[]){e.definition.forEach((n,i)=>{let o=e.definition.slice(i+1);if(n instanceof De)this.walkProdRef(n,o,r);else if(n instanceof he)this.walkTerminal(n,o,r);else if(n instanceof qe)this.walkFlat(n,o,r);else if(n instanceof Me)this.walkOption(n,o,r);else if(n instanceof Ve)this.walkAtLeastOne(n,o,r);else if(n instanceof Ye)this.walkAtLeastOneSep(n,o,r);else if(n instanceof je)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 Me({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){let i=JE(e,r,n);this.walk(e,i)}walkMany(e,r,n){let i=[new Me({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){let i=JE(e,r,n);this.walk(e,i)}walkOr(e,r,n){let i=r.concat(n);e.definition.forEach(o=>{let s=new qe({definition:[o]});this.walk(s,i)})}};function JE(t,e,r){return[new Me({definition:[new he({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function ro(t){if(t instanceof De)return ro(t.referencedRule);if(t instanceof he)return UC(t);if(dm(t))return $C(t);if(pm(t))return FC(t);throw Error("non exhaustive match")}function $C(t){let e=[],r=t.definition,n=0,i=r.length>n,o,s=!0;for(;i&&s;)o=r[n],s=to(o),e=e.concat(ro(o)),n=n+1,i=r.length>n;return[...new Set(e)]}function FC(t){let e=t.definition.map(r=>ro(r));return[...new Set(e.flat())]}function UC(t){return[t.terminalType]}var Pu="_~IN~_";var hm=class extends yn{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=BC(e.referencedRule,e.idx)+this.topProd.name,o=r.concat(n),s=new qe({definition:o}),a=ro(s);this.follows[i]=a}};function QE(t){let e={};return t.forEach(r=>{let n=new hm(r).startWalking();Object.assign(e,n)}),e}function BC(t,e){return t.name+e+Pu}var Cu={},GC=new Qi;function no(t){let e=t.toString();if(Cu.hasOwnProperty(e))return Cu[e];{let r=GC.pattern(e);return Cu[e]=r,r}}function e0(){Cu={}}var r0="Complement Sets are not supported for first char optimization",yc=`Unable to use "first char" lexer optimizations:
24
+ `;function n0(t,e=!1){try{let r=no(t);return mm(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===r0)e&&hc(`${yc} Unable to optimize: < ${t.toString()} >
25
25
  Complement Sets cannot be automatically optimized.
26
26
  This will disable the lexer's first char optimizations.
27
27
  See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=`
28
28
  This will disable the lexer's first char optimizations.
29
- See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Ko(`${yc}
29
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Qo(`${yc}
30
30
  Failed parsing: < ${t.toString()} >
31
31
  Using the @chevrotain/regexp-to-ast library
32
- Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function um(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)um(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":Nu(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error(JE);s.value.forEach(c=>{if(typeof c=="number")Nu(c,e,r);else{let l=c;if(r===!0)for(let u=l.from;u<=l.to;u++)Nu(u,e,r);else{for(let u=l.from;u<=l.to&&u<Qo;u++)Nu(u,e,r);if(l.to>=Qo){let u=l.from>=Qo?l.from:Qo,f=l.to,d=en(u),p=en(f);for(let m=d;m<=p;m++)e[m]=m}}}});break;case"Group":um(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"&&fm(s)===!1||s.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return Object.values(e)}function Nu(t,e,r){let n=en(t);e[n]=n,r===!0&&FC(t,e)}function FC(t,e){let r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){let i=en(n.charCodeAt(0));e[i]=i}else{let i=r.toLowerCase();if(i!==r){let o=en(i.charCodeAt(0));e[o]=o}}}function ZE(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 fm(t){let e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Array.isArray(t.value)?t.value.every(fm):fm(t.value):!1}var dm=class extends Jr{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?ZE(e,this.targetCharCodes)===void 0&&(this.found=!0):ZE(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function Pu(t,e){if(e instanceof RegExp){let r=Jo(e),n=new dm(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 ro="PATTERN",es="defaultMode",Cu="modes";function t0(t,e){e=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
33
- `],tracer:(x,v)=>v()},e);let r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{nO()});let n;r("Reject Lexer.NA",()=>{n=t.filter(x=>x[ro]!==ot.NA)});let i=!1,o;r("Transform Patterns",()=>{i=!1,o=n.map(x=>{let v=x[ro];if(v instanceof RegExp){let k=v.source;return k.length===1&&k!=="^"&&k!=="$"&&k!=="."&&!v.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]:e0(v)}else{if(typeof v=="function")return i=!0,{exec:v};if(typeof v=="object")return i=!0,v;if(typeof v=="string"){if(v.length===1)return v;{let k=v.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),F=new RegExp(k);return e0(F)}}else throw Error("non exhaustive match")}})});let s,a,c,l,u;r("misc mapping",()=>{s=n.map(x=>x.tokenTypeIdx),a=n.map(x=>{let v=x.GROUP;if(v!==ot.SKIPPED){if(typeof v=="string")return v;if(v===void 0)return!1;throw Error("non exhaustive match")}}),c=n.map(x=>{let v=x.LONGER_ALT;if(v)return Array.isArray(v)?v.map(F=>n.indexOf(F)):[n.indexOf(v)]}),l=n.map(x=>x.PUSH_MODE),u=n.map(x=>Object.hasOwn(x,"POP_MODE"))});let f;r("Line Terminator Handling",()=>{let x=l0(e.lineTerminatorCharacters);f=n.map(v=>!1),e.positionTracking!=="onlyOffset"&&(f=n.map(v=>Object.hasOwn(v,"LINE_BREAKS")?!!v.LINE_BREAKS:c0(v,x)===!1&&Pu(x,v.PATTERN)))});let d,p,m,y;r("Misc Mapping #2",()=>{d=n.map(s0),p=o.map(tO),m=n.reduce((x,v)=>{let k=v.GROUP;return typeof k=="string"&&k!==ot.SKIPPED&&(x[k]=[]),x},{}),y=o.map((x,v)=>({pattern:o[v],longerAlt:c[v],canLineTerminator:f[v],isCustom:d[v],short:p[v],group:a[v],push:l[v],pop:u[v],tokenTypeIdx:s[v],tokenType:n[v]}))});let E=!0,_=[];return e.safeMode||r("First Char Optimization",()=>{_=n.reduce((x,v,k)=>{if(typeof v.PATTERN=="string"){let F=v.PATTERN.charCodeAt(0),O=en(F);pm(x,O,y[k])}else if(Array.isArray(v.START_CHARS_HINT)){let F;v.START_CHARS_HINT.forEach(O=>{let L=typeof O=="string"?O.charCodeAt(0):O,G=en(L);F!==G&&(F=G,pm(x,G,y[k]))})}else if(v.PATTERN instanceof RegExp)if(v.PATTERN.unicode)E=!1,e.ensureOptimizations&&Ko(`${yc} Unable to analyze < ${v.PATTERN.toString()} > pattern.
32
+ Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function mm(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)mm(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":Ou(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error(r0);s.value.forEach(c=>{if(typeof c=="number")Ou(c,e,r);else{let l=c;if(r===!0)for(let u=l.from;u<=l.to;u++)Ou(u,e,r);else{for(let u=l.from;u<=l.to&&u<ts;u++)Ou(u,e,r);if(l.to>=ts){let u=l.from>=ts?l.from:ts,f=l.to,d=en(u),p=en(f);for(let m=d;m<=p;m++)e[m]=m}}}});break;case"Group":mm(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"&&gm(s)===!1||s.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return Object.values(e)}function Ou(t,e,r){let n=en(t);e[n]=n,r===!0&&HC(t,e)}function HC(t,e){let r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){let i=en(n.charCodeAt(0));e[i]=i}else{let i=r.toLowerCase();if(i!==r){let o=en(i.charCodeAt(0));e[o]=o}}}function t0(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 gm(t){let e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Array.isArray(t.value)?t.value.every(gm):gm(t.value):!1}var ym=class extends Jr{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?t0(e,this.targetCharCodes)===void 0&&(this.found=!0):t0(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function Lu(t,e){if(e instanceof RegExp){let r=no(e),n=new ym(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 io="PATTERN",rs="defaultMode",Du="modes",$u=0,xc=1,Fu=2,Uu=3;function o0(t,e){e=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
33
+ `],tracer:(x,v)=>v()},e);let r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{cO()});let n;r("Reject Lexer.NA",()=>{n=t.filter(x=>x[io]!==ot.NA)});let i=!1,o;r("Transform Patterns",()=>{i=!1,o=n.map(x=>{let v=x[io];if(v instanceof RegExp){let A=v.source;return A.length===1&&A!=="^"&&A!=="$"&&A!=="."&&!v.ignoreCase?A:A.length===2&&A[0]==="\\"&&!["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(A[1])?A[1]:i0(v)}else{if(typeof v=="function")return i=!0,{exec:v};if(typeof v=="object")return i=!0,v;if(typeof v=="string"){if(v.length===1)return v;{let A=v.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),F=new RegExp(A);return i0(F)}}else throw Error("non exhaustive match")}})});let s,a,c,l,u;r("misc mapping",()=>{s=n.map(x=>x.tokenTypeIdx),a=n.map(x=>{let v=x.GROUP;if(v!==ot.SKIPPED){if(typeof v=="string")return v;if(v===void 0)return!1;throw Error("non exhaustive match")}}),c=n.map(x=>{let v=x.LONGER_ALT;if(v)return Array.isArray(v)?v.map(F=>n.indexOf(F)):[n.indexOf(v)]}),l=n.map(x=>x.PUSH_MODE),u=n.map(x=>Object.hasOwn(x,"POP_MODE"))});let f;r("Line Terminator Handling",()=>{let x=d0(e.lineTerminatorCharacters);f=n.map(v=>!1),e.positionTracking!=="onlyOffset"&&(f=n.map(v=>Object.hasOwn(v,"LINE_BREAKS")?!!v.LINE_BREAKS:f0(v,x)===!1&&Lu(x,v.PATTERN)))});let d,p,m,y;r("Misc Mapping #2",()=>{d=n.map(l0),p=o.map(sO),m=n.reduce((x,v)=>{let A=v.GROUP;return typeof A=="string"&&A!==ot.SKIPPED&&(x[A]=[]),x},{}),y=o.map((x,v)=>{let A=a[v]===void 0&&c[v]===void 0?XC(n[v].PATTERN):void 0;return{pattern:o[v],asciiClass:A,longerAlt:c[v],canLineTerminator:f[v],matchType:A!==void 0?Uu:p[v]!==!1?$u:d[v]?xc:Fu,short:p[v],group:a[v],push:l[v],pop:u[v],tokenTypeIdx:s[v],tokenType:n[v]}})});let E=!0,_=[];return e.safeMode||r("First Char Optimization",()=>{_=n.reduce((x,v,A)=>{if(typeof v.PATTERN=="string"){let F=v.PATTERN.charCodeAt(0),O=en(F);xm(x,O,y[A])}else if(Array.isArray(v.START_CHARS_HINT)){let F;v.START_CHARS_HINT.forEach(O=>{let L=typeof O=="string"?O.charCodeAt(0):O,G=en(L);F!==G&&(F=G,xm(x,G,y[A]))})}else if(v.PATTERN instanceof RegExp)if(v.PATTERN.unicode)E=!1,e.ensureOptimizations&&Qo(`${yc} Unable to analyze < ${v.PATTERN.toString()} > pattern.
34
34
  The regexp unicode flag is not currently supported by the regexp-to-ast library.
35
35
  This will disable the lexer's first char optimizations.
36
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let F=QE(v.PATTERN,e.ensureOptimizations);F.length===0&&(E=!1),F.forEach(O=>{pm(x,O,y[k])})}else e.ensureOptimizations&&Ko(`${yc} TokenType: <${v.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
36
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let F=n0(v.PATTERN,e.ensureOptimizations);F.length===0&&(E=!1),F.forEach(O=>{xm(x,O,y[A])})}else e.ensureOptimizations&&Qo(`${yc} TokenType: <${v.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
37
37
  This will disable the lexer's first char optimizations.
38
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),E=!1;return x},[])}),{emptyGroups:m,patternIdxToConfig:y,charCodeToPatternIdxToConfig:_,hasCustom:i,canBeOptimized:E}}function r0(t,e){let r=[],n=BC(t);r=r.concat(n.errors);let i=GC(n.valid),o=i.valid;return r=r.concat(i.errors),r=r.concat(UC(o)),r=r.concat(YC(o)),r=r.concat(KC(o,e)),r=r.concat(ZC(o)),r}function UC(t){let e=[],r=t.filter(n=>n[ro]instanceof RegExp);return e=e.concat(HC(r)),e=e.concat(WC(r)),e=e.concat(qC(r)),e=e.concat(VC(r)),e=e.concat(jC(r)),e}function BC(t){let e=t.filter(i=>!Object.hasOwn(i,ro)),r=e.map(i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:it.MISSING_PATTERN,tokenTypes:[i]})),n=t.filter(i=>!e.includes(i));return{errors:r,valid:n}}function GC(t){let e=t.filter(i=>{let o=i[ro];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:it.INVALID_PATTERN,tokenTypes:[i]})),n=t.filter(i=>!e.includes(i));return{errors:r,valid:n}}var XC=/[^\\][$]/;function HC(t){class e extends Jr{constructor(){super(...arguments),this.found=!1}visitEndAnchor(o){this.found=!0}}return t.filter(i=>{let o=i.PATTERN;try{let s=Jo(o),a=new e;return a.visit(s),a.found}catch{return XC.test(o.source)}}).map(i=>({message:`Unexpected RegExp Anchor Error:
38
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),E=!1;return x},[])}),{emptyGroups:m,patternIdxToConfig:y,charCodeToPatternIdxToConfig:_,hasCustom:i,canBeOptimized:E}}function XC(t){var e,r;if(!(t instanceof RegExp)||t.flags!=="")return;let n;try{n=no(t)}catch{return}if(n.value.value.length!==1||n.value.value[0].value.length!==1)return;let i=n.value.value[0].value[0],o;for(;i.type==="Group";){if(i.capturing||i.quantifier!==void 0&&o!==void 0||i.value.value.length!==1||i.value.value[0].value.length!==1)return;o=(e=i.quantifier)!==null&&e!==void 0?e:o,i=i.value.value[0].value[0]}if(i.type!=="Set"||i.complement||i.quantifier!==void 0&&o!==void 0||(o=(r=i.quantifier)!==null&&r!==void 0?r:o,o?.atLeast!==1||o.atMost!==1/0||!o.greedy))return;let s=new Uint8Array(128);for(let a of i.value){let c=typeof a=="number"?a:a.from,l=typeof a=="number"?a:a.to;if(c<0||l>=s.length)return;s.fill(1,c,l+1)}return s}function s0(t,e){let r=[],n=zC(t);r=r.concat(n.errors);let i=WC(n.valid),o=i.valid;return r=r.concat(i.errors),r=r.concat(jC(o)),r=r.concat(eO(o)),r=r.concat(tO(o,e)),r=r.concat(rO(o)),r}function jC(t){let e=[],r=t.filter(n=>n[io]instanceof RegExp);return e=e.concat(VC(r)),e=e.concat(ZC(r)),e=e.concat(JC(r)),e=e.concat(QC(r)),e=e.concat(YC(r)),e}function zC(t){let e=t.filter(i=>!Object.hasOwn(i,io)),r=e.map(i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:it.MISSING_PATTERN,tokenTypes:[i]})),n=t.filter(i=>!e.includes(i));return{errors:r,valid:n}}function WC(t){let e=t.filter(i=>{let o=i[io];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:it.INVALID_PATTERN,tokenTypes:[i]})),n=t.filter(i=>!e.includes(i));return{errors:r,valid:n}}var qC=/[^\\][$]/;function VC(t){class e extends Jr{constructor(){super(...arguments),this.found=!1}visitEndAnchor(o){this.found=!0}}return t.filter(i=>{let o=i.PATTERN;try{let s=no(o),a=new e;return a.visit(s),a.found}catch{return qC.test(o.source)}}).map(i=>({message:`Unexpected RegExp Anchor Error:
39
39
  Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
40
- See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:it.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function jC(t){return t.filter(n=>n.PATTERN.test("")).map(n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:it.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}var zC=/[^\\[][\^]|^\^/;function WC(t){class e extends Jr{constructor(){super(...arguments),this.found=!1}visitStartAnchor(o){this.found=!0}}return t.filter(i=>{let o=i.PATTERN;try{let s=Jo(o),a=new e;return a.visit(s),a.found}catch{return zC.test(o.source)}}).map(i=>({message:`Unexpected RegExp Anchor Error:
40
+ See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:it.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function YC(t){return t.filter(n=>n.PATTERN.test("")).map(n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:it.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}var KC=/[^\\[][\^]|^\^/;function ZC(t){class e extends Jr{constructor(){super(...arguments),this.found=!1}visitStartAnchor(o){this.found=!0}}return t.filter(i=>{let o=i.PATTERN;try{let s=no(o),a=new e;return a.visit(s),a.found}catch{return KC.test(o.source)}}).map(i=>({message:`Unexpected RegExp Anchor Error:
41
41
  Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
42
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:it.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function qC(t){return t.filter(n=>{let i=n[ro];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:it.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function VC(t){let e=[],r=t.map(o=>t.reduce((s,a)=>(o.PATTERN.source===a.PATTERN.source&&!e.includes(a)&&a.PATTERN!==ot.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:it.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}})}function YC(t){return t.filter(n=>{if(!Object.hasOwn(n,"GROUP"))return!1;let i=n.GROUP;return i!==ot.SKIPPED&&i!==ot.NA&&typeof i!="string"}).map(n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:it.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function KC(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:it.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function ZC(t){let e=[],r=t.reduce((n,i,o)=>{let s=i.PATTERN;return s===ot.NA||(typeof s=="string"?n.push({str:s,idx:o,tokenType:i}):s instanceof RegExp&&QC(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&&JC(o,n.PATTERN)){let c=`Token: ->${a.name}<- can never be matched.
42
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:it.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function JC(t){return t.filter(n=>{let i=n[io];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:it.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function QC(t){let e=[],r=t.map(o=>t.reduce((s,a)=>(o.PATTERN.source===a.PATTERN.source&&!e.includes(a)&&a.PATTERN!==ot.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:it.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}})}function eO(t){return t.filter(n=>{if(!Object.hasOwn(n,"GROUP"))return!1;let i=n.GROUP;return i!==ot.SKIPPED&&i!==ot.NA&&typeof i!="string"}).map(n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:it.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function tO(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:it.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function rO(t){let e=[],r=t.reduce((n,i,o)=>{let s=i.PATTERN;return s===ot.NA||(typeof s=="string"?n.push({str:s,idx:o,tokenType:i}):s instanceof RegExp&&iO(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&&nO(o,n.PATTERN)){let c=`Token: ->${a.name}<- can never be matched.
43
43
  Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition.
44
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:it.UNREACHABLE_PATTERN,tokenTypes:[n,a]})}})}),e}function JC(t,e){if(e instanceof RegExp){if(eO(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 QC(t){return[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(r=>t.source.indexOf(r)!==-1)===void 0}function eO(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(t.source)}function e0(t){let e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function n0(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
45
- `,type:it.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(t,Cu)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Cu+`> property in its definition
46
- `,type:it.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(t,Cu)&&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
47
- `,type:it.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(t,Cu)&&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}>
44
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:it.UNREACHABLE_PATTERN,tokenTypes:[n,a]})}})}),e}function nO(t,e){if(e instanceof RegExp){if(oO(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 iO(t){return[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(r=>t.source.indexOf(r)!==-1)===void 0}function oO(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(t.source)}function i0(t){let e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function a0(t,e,r){let n=[];return Object.hasOwn(t,rs)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+rs+`> property in its definition
45
+ `,type:it.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(t,Du)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Du+`> property in its definition
46
+ `,type:it.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(t,Du)&&Object.hasOwn(t,rs)&&!Object.hasOwn(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${rs}: <${t.defaultMode}>which does not exist
47
+ `,type:it.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(t,Du)&&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}>
48
48
  `,type:it.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}>
49
- `,type:it.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),n}function i0(t,e,r){let n=[],i=!1,s=Object.values(t.modes||{}).flat().filter(Boolean).filter(c=>c[ro]!==ot.NA),a=l0(r);return e&&s.forEach(c=>{let l=c0(c,a);if(l!==!1){let f={message:rO(c,l),type:l.issue,tokenType:c};n.push(f)}else Object.hasOwn(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(i=!0):Pu(a,c.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
49
+ `,type:it.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),n}function c0(t,e,r){let n=[],i=!1,s=Object.values(t.modes||{}).flat().filter(Boolean).filter(c=>c[io]!==ot.NA),a=d0(r);return e&&s.forEach(c=>{let l=f0(c,a);if(l!==!1){let f={message:aO(c,l),type:l.issue,tokenType:c};n.push(f)}else Object.hasOwn(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(i=!0):Lu(a,c.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
50
50
  This Lexer has been defined to track line and column information,
51
51
  But none of the Token Types can be identified as matching a line terminator.
52
52
  See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
53
- for details.`,type:it.NO_LINE_BREAKS_FLAGS}),n}function o0(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 s0(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 tO(t){return typeof t=="string"&&t.length===1?t.charCodeAt(0):!1}var a0={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 c0(t,e){if(Object.hasOwn(t,"LINE_BREAKS"))return!1;if(t.PATTERN instanceof RegExp){try{Pu(e,t.PATTERN)}catch(r){return{issue:it.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(typeof t.PATTERN=="string")return!1;if(s0(t))return{issue:it.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function rO(t,e){if(e.issue===it.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
53
+ for details.`,type:it.NO_LINE_BREAKS_FLAGS}),n}function l0(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 sO(t){return typeof t=="string"&&t.length===1?t.charCodeAt(0):!1}var u0={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 f0(t,e){if(Object.hasOwn(t,"LINE_BREAKS"))return!1;if(t.PATTERN instanceof RegExp){try{Lu(e,t.PATTERN)}catch(r){return{issue:it.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(typeof t.PATTERN=="string")return!1;if(l0(t))return{issue:it.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function aO(t,e){if(e.issue===it.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
54
54
  The problem is in the <${t.name}> Token Type
55
55
  Root cause: ${e.errMsg}.
56
56
  For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===it.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
57
57
  The problem is in the <${t.name}> Token Type
58
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function l0(t){return t.map(r=>typeof r=="string"?r.charCodeAt(0):r)}function pm(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}var Qo=256,Ou=[];function en(t){return t<Qo?t:Ou[t]}function nO(){if(Ou.length===0){Ou=new Array(65536);for(let t=0;t<65536;t++)Ou[t]=t>255?255+~~(t/255):t}}function xn(t,e){let r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function ts(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}var u0=1,d0={};function Tn(t){let e=iO(t);oO(e),aO(e),sO(e),e.forEach(r=>{r.isParent=r.categoryMatches.length>0})}function iO(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 oO(t){t.forEach(e=>{hm(e)||(d0[u0]=e,e.tokenTypeIdx=u0++),f0(e)&&!Array.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),f0(e)||(e.CATEGORIES=[]),cO(e)||(e.categoryMatches=[]),lO(e)||(e.categoryMatchesMap={})})}function sO(t){t.forEach(e=>{e.categoryMatches=[],Object.keys(e.categoryMatchesMap).forEach(r=>{e.categoryMatches.push(d0[r].tokenTypeIdx)})})}function aO(t){t.forEach(e=>{p0([],e)})}function p0(t,e){t.forEach(r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),e.CATEGORIES.forEach(r=>{let n=t.concat(e);n.includes(r)||p0(n,r)})}function hm(t){return Object.hasOwn(t??{},"tokenTypeIdx")}function f0(t){return Object.hasOwn(t??{},"CATEGORIES")}function cO(t){return Object.hasOwn(t??{},"categoryMatches")}function lO(t){return Object.hasOwn(t??{},"categoryMatchesMap")}function h0(t){return Object.hasOwn(t??{},"tokenTypeIdx")}var rs={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 it;(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"})(it||(it={}));var xc={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
59
- `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:rs,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(xc);var ot=class{constructor(e,r=xc){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}=mc(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.
60
- a boolean 2nd argument is no longer supported`);this.config=Object.assign({},xc,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===xc.lineTerminatorsPattern)this.config.lineTerminatorsPattern=a0;else if(this.config.lineTerminatorCharacters===xc.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
61
- 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(n0(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(i0(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(r0(c,s))}),this.lexerDefinitionErrors.length===0){Tn(c);let l;this.TRACE_INIT("analyzeTokenTypes",()=>{l=t0(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(`-----------------------
58
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function d0(t){return t.map(r=>typeof r=="string"?r.charCodeAt(0):r)}function xm(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}var ts=256,Mu=[];function en(t){return t<ts?t:Mu[t]}function cO(){if(Mu.length===0){Mu=new Array(65536);for(let t=0;t<65536;t++)Mu[t]=t>255?255+~~(t/255):t}}function xn(t,e){let r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function ns(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}var p0=1,m0={};function Tn(t){let e=lO(t);uO(e),dO(e),fO(e),e.forEach(r=>{r.isParent=r.categoryMatches.length>0})}function lO(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 uO(t){t.forEach(e=>{Tm(e)||(m0[p0]=e,e.tokenTypeIdx=p0++),h0(e)&&!Array.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),h0(e)||(e.CATEGORIES=[]),pO(e)||(e.categoryMatches=[]),hO(e)||(e.categoryMatchesMap={})})}function fO(t){t.forEach(e=>{e.categoryMatches=[],Object.keys(e.categoryMatchesMap).forEach(r=>{e.categoryMatches.push(m0[r].tokenTypeIdx)})})}function dO(t){t.forEach(e=>{g0([],e)})}function g0(t,e){t.forEach(r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),e.CATEGORIES.forEach(r=>{let n=t.concat(e);n.includes(r)||g0(n,r)})}function Tm(t){return Object.hasOwn(t??{},"tokenTypeIdx")}function h0(t){return Object.hasOwn(t??{},"CATEGORIES")}function pO(t){return Object.hasOwn(t??{},"categoryMatches")}function hO(t){return Object.hasOwn(t??{},"categoryMatchesMap")}function y0(t){return Object.hasOwn(t??{},"tokenTypeIdx")}var is={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 it;(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"})(it||(it={}));var Tc={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
59
+ `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:is,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Tc);var ot=class{constructor(e,r=Tc){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.cachedGroupKeys=[],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}=mc(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.
60
+ a boolean 2nd argument is no longer supported`);this.config=Object.assign({},Tc,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===Tc.lineTerminatorsPattern)this.config.lineTerminatorsPattern=u0;else if(this.config.lineTerminatorCharacters===Tc.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
61
+ 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:rs}:(o=!1,i=Object.assign({},e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(a0(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(c0(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(s0(c,s))}),this.lexerDefinitionErrors.length===0){Tn(c);let l;this.TRACE_INIT("analyzeTokenTypes",()=>{l=o0(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.cachedGroupKeys=Object.keys(this.emptyGroups),this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){let c=this.lexerDefinitionErrors.map(l=>l.message).join(`-----------------------
62
62
  `);throw new Error(`Errors detected in definition of Lexer:
63
63
  `+c)}this.lexerDefinitionWarning.forEach(a=>{hc(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.
64
64
  Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
65
- Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{KE()}),this.TRACE_INIT("toFastProperties",()=>{gc(this)})})}tokenize(e,r=this.defaultMode){if(this.lexerDefinitionErrors.length>0){let i=this.lexerDefinitionErrors.map(o=>o.message).join(`-----------------------
65
+ Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{e0()}),this.TRACE_INIT("toFastProperties",()=>{gc(this)})})}tokenize(e,r=this.defaultMode){if(this.lexerDefinitionErrors.length>0){let i=this.lexerDefinitionErrors.map(o=>o.message).join(`-----------------------
66
66
  `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
67
- `+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,o,s,a,c,l,u,f,d,p,m,y,E,_,x=e,v=x.length,k=0,F=0,O=this.hasCustom?0:Math.floor(e.length/10),L=new Array(O),G=[],H=this.trackStartLines?1:void 0,oe=this.trackStartLines?1:void 0,$=o0(this.emptyGroups),w=this.trackStartLines,D=this.config.lineTerminatorsPattern,U=0,S=[],A=[],I=[],B=[];Object.freeze(B);let z=!1,j=Y=>{if(I.length===1&&Y.tokenType.PUSH_MODE===void 0){let ne=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Y);G.push({offset:Y.startOffset,line:Y.startLine,column:Y.startColumn,length:Y.image.length,message:ne})}else{I.pop();let ne=I.at(-1);S=this.patternIdxToConfig[ne],A=this.charCodeToPatternIdxToConfig[ne],U=S.length;let Re=this.canModeBeOptimized[ne]&&this.config.safeMode===!1;A&&Re?z=!0:z=!1}};function V(Y){I.push(Y),A=this.charCodeToPatternIdxToConfig[Y],S=this.patternIdxToConfig[Y],U=S.length,U=S.length;let ne=this.canModeBeOptimized[Y]&&this.config.safeMode===!1;A&&ne?z=!0:z=!1}V.call(this,r);let K,ue=this.config.recoveryEnabled;for(;k<v;){c=null,f=-1;let Y=x.charCodeAt(k),ne;if(z){let Se=en(Y),$e=A[Se];ne=$e!==void 0?$e:B}else ne=S;let Re=ne.length;for(n=0;n<Re;n++){K=ne[n];let Se=K.pattern;l=null;let $e=K.short;if($e!==!1?Y===$e&&(f=1,c=Se):K.isCustom===!0?(_=Se.exec(x,k,L,$),_!==null?(c=_[0],f=c.length,_.payload!==void 0&&(l=_.payload)):c=null):(Se.lastIndex=k,f=this.matchLength(Se,e,k)),f!==-1){if(a=K.longerAlt,a!==void 0){c=e.substring(k,k+f);let q=a.length;for(o=0;o<q;o++){let Q=S[a[o]],re=Q.pattern;if(u=null,Q.isCustom===!0?(_=re.exec(x,k,L,$),_!==null?(s=_[0],_.payload!==void 0&&(u=_.payload)):s=null):(re.lastIndex=k,s=this.match(re,e,k)),s&&s.length>c.length){c=s,f=s.length,l=u,K=Q;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,H,oe,f),this.handlePayload(m,l),d===!1?F=this.addToken(L,F,m):$[d].push(m)),w===!0&&K.canLineTerminator===!0){let Se=0,$e,q;D.lastIndex=0;do c=c!==null?c:e.substring(k,k+f),$e=D.test(c),$e===!0&&(q=D.lastIndex-1,Se++);while($e===!0);Se!==0?(H=H+Se,oe=f-q,this.updateTokenEndLineColumnLocation(m,d,q,Se,H,oe,f)):oe=this.computeNewColumn(oe,f)}else oe=this.computeNewColumn(oe,f);k=k+f,this.handleModes(K,j,V,m)}else{let Se=k,$e=H,q=oe,Q=ue===!1;for(;Q===!1&&k<v;)for(k++,i=0;i<U;i++){let re=S[i],M=re.pattern,de=re.short;if(de!==!1?x.charCodeAt(k)===de&&(Q=!0):re.isCustom===!0?Q=M.exec(x,k,L,$)!==null:(M.lastIndex=k,Q=M.exec(e)!==null),Q===!0)break}if(y=k-Se,oe=this.computeNewColumn(oe,y),E=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(x,Se,y,$e,q,I.at(-1)),G.push({offset:Se,line:$e,column:q,length:y,message:E}),ue===!1)break}}return this.hasCustom||(L.length=F),{tokens:L,groups:$,errors:G}}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}};ot.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.";ot.NA=/NOT_APPLICABLE/;function _n(t){return mm(t)?t.LABEL:t.name}function mm(t){return typeof t.LABEL=="string"&&t.LABEL!==""}var uO="parent",m0="categories",g0="label",y0="group",x0="push_mode",T0="pop_mode",_0="longer_alt",E0="line_breaks",v0="start_chars_hint";function ti(t){return fO(t)}function fO(t){let e=t.pattern,r={};if(r.name=t.name,e!==void 0&&(r.PATTERN=e),Object.hasOwn(t,uO))throw`The parent property is no longer supported.
68
- See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Object.hasOwn(t,m0)&&(r.CATEGORIES=t[m0]),Tn([r]),Object.hasOwn(t,g0)&&(r.LABEL=t[g0]),Object.hasOwn(t,y0)&&(r.GROUP=t[y0]),Object.hasOwn(t,T0)&&(r.POP_MODE=t[T0]),Object.hasOwn(t,x0)&&(r.PUSH_MODE=t[x0]),Object.hasOwn(t,_0)&&(r.LONGER_ALT=t[_0]),Object.hasOwn(t,E0)&&(r.LINE_BREAKS=t[E0]),Object.hasOwn(t,v0)&&(r.START_CHARS_HINT=t[v0]),r}var Xt=ti({name:"EOF",pattern:ot.NA});Tn([Xt]);function En(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 xn(t,e)}var vn={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${mm(t)?`--> ${_n(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=`
67
+ `+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,o,s,a,c,l,u,f,d,p,m,y,E,_,x=e,v=x.length,A=0,F=0,O=this.hasCustom?0:Math.floor(e.length/10),L=new Array(O),G=[],X=this.trackStartLines?1:void 0,oe=this.trackStartLines?1:void 0,D={};for(let V=0;V<this.cachedGroupKeys.length;V++)D[this.cachedGroupKeys[V]]=[];let w=this.trackStartLines,M=this.config.lineTerminatorsPattern,U=0,S=[],I=[],k=[],B=[];Object.freeze(B);let W=!1,z=V=>{if(k.length===1&&V.tokenType.PUSH_MODE===void 0){let re=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(V);G.push({offset:V.startOffset,line:V.startLine,column:V.startColumn,length:V.image.length,message:re})}else{k.pop();let re=k.at(-1);S=this.patternIdxToConfig[re],I=this.charCodeToPatternIdxToConfig[re],U=S.length;let Se=this.canModeBeOptimized[re]&&this.config.safeMode===!1;I&&Se?W=!0:W=!1}};function Y(V){k.push(V),I=this.charCodeToPatternIdxToConfig[V],S=this.patternIdxToConfig[V],U=S.length;let re=this.canModeBeOptimized[V]&&this.config.safeMode===!1;I&&re?W=!0:W=!1}Y.call(this,r);let K,ue=this.config.recoveryEnabled;for(;A<v;){c=null,f=-1;let V=x.charCodeAt(A),re;if(W){let Ee=en(V),Ce=I[Ee];re=Ce!==void 0?Ce:B}else re=S;let Se=re.length;for(n=0;n<Se;n++){K=re[n];let Ee=K.pattern;switch(l=null,K.matchType){case $u:V===K.short&&(f=1,c=Ee);break;case xc:_=Ee.exec(x,A,L,D),_!==null?(c=_[0],f=c.length,_.payload!==void 0&&(l=_.payload)):c=null;break;case Uu:{let Ce=K.asciiClass;if(Ce[V]!==1){Ee.lastIndex=0;break}let j=A+1;for(;Ce[x.charCodeAt(j)]===1;)j++;f=j-A,Ee.lastIndex=j;break}case Fu:Ee.lastIndex=A,f=this.matchLength(Ee,e,A);break}if(f!==-1){if(a=K.longerAlt,a!==void 0){c=e.substring(A,A+f);let Ce=a.length;for(o=0;o<Ce;o++){let j=S[a[o]],Q=j.pattern;if(u=null,j.matchType===xc?(_=Q.exec(x,A,L,D),_!==null?(s=_[0],_.payload!==void 0&&(u=_.payload)):s=null):(Q.lastIndex=A,s=this.match(Q,e,A)),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(A,A+f),p=K.tokenTypeIdx,m=this.createTokenInstance(c,A,p,K.tokenType,X,oe,f),this.handlePayload(m,l),d===!1?F=this.addToken(L,F,m):D[d].push(m)),w===!0&&K.canLineTerminator===!0){let Ee=0,Ce,j;M.lastIndex=0;do c=c!==null?c:e.substring(A,A+f),Ce=M.test(c),Ce===!0&&(j=M.lastIndex-1,Ee++);while(Ce===!0);Ee!==0?(X=X+Ee,oe=f-j,this.updateTokenEndLineColumnLocation(m,d,j,Ee,X,oe,f)):oe=this.computeNewColumn(oe,f)}else oe=this.computeNewColumn(oe,f);A=A+f,this.handleModes(K,z,Y,m)}else{let Ee=A,Ce=X,j=oe,Q=ue===!1;for(;Q===!1&&A<v;)for(A++,i=0;i<U;i++){let ie=S[i],$=ie.pattern;switch(ie.matchType){case $u:x.charCodeAt(A)===ie.short&&(Q=!0);break;case xc:Q=$.exec(x,A,L,D)!==null;break;case Uu:case Fu:$.lastIndex=A,Q=$.exec(e)!==null;break}if(Q===!0)break}if(y=A-Ee,oe=this.computeNewColumn(oe,y),E=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(x,Ee,y,Ce,j,k.at(-1)),G.push({offset:Ee,line:Ce,column:j,length:y,message:E}),ue===!1)break}}return this.hasCustom||(L.length=F),{tokens:L,groups:D,errors:G}}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}};ot.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.";ot.NA=/NOT_APPLICABLE/;function _n(t){return _m(t)?t.LABEL:t.name}function _m(t){return typeof t.LABEL=="string"&&t.LABEL!==""}var mO="parent",x0="categories",T0="label",_0="group",E0="push_mode",v0="pop_mode",b0="longer_alt",w0="line_breaks",R0="start_chars_hint";function ti(t){return gO(t)}function gO(t){let e=t.pattern,r={};if(r.name=t.name,e!==void 0&&(r.PATTERN=e),Object.hasOwn(t,mO))throw`The parent property is no longer supported.
68
+ See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Object.hasOwn(t,x0)&&(r.CATEGORIES=t[x0]),Tn([r]),Object.hasOwn(t,T0)&&(r.LABEL=t[T0]),Object.hasOwn(t,_0)&&(r.GROUP=t[_0]),Object.hasOwn(t,v0)&&(r.POP_MODE=t[v0]),Object.hasOwn(t,E0)&&(r.PUSH_MODE=t[E0]),Object.hasOwn(t,b0)&&(r.LONGER_ALT=t[b0]),Object.hasOwn(t,w0)&&(r.LINE_BREAKS=t[w0]),Object.hasOwn(t,R0)&&(r.START_CHARS_HINT=t[R0]),r}var Ht=ti({name:"EOF",pattern:ot.NA});Tn([Ht]);function En(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 os(t,e){return xn(t,e)}var vn={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${_m(t)?`--> ${_n(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=`
69
69
  but found: '`+e[0].image+"'";if(n)return o+n+a;{let f=`one of these possible Token sequences:
70
70
  ${t.reduce((d,p)=>d.concat(p),[]).map(d=>`[${d.map(p=>_n(p)).join(", ")}]`).map((d,p)=>` ${p+1}. ${d}`).join(`
71
71
  `)}`;return o+f+a}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){let i="Expecting: ",s=`
72
72
  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::
73
- <${t.map(l=>`[${l.map(u=>_n(u)).join(",")}]`).join(" ,")}>`;return i+c+s}}};Object.freeze(vn);var b0={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
74
- inside top level rule: ->`+t.name+"<-"}},Sr={buildDuplicateFoundError(t,e){function r(u){return u instanceof me?u.terminalType.name:u instanceof De?u.nonTerminalName:""}let n=t.name,i=e[0],o=i.idx,s=Vt(i),a=r(i),c=o>0,l=`->${s}${c?o:""}<- ${a?`with argument: ->${a}<-`:""}
73
+ <${t.map(l=>`[${l.map(u=>_n(u)).join(",")}]`).join(" ,")}>`;return i+c+s}}};Object.freeze(vn);var S0={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
74
+ inside top level rule: ->`+t.name+"<-"}},Sr={buildDuplicateFoundError(t,e){function r(u){return u instanceof he?u.terminalType.name:u instanceof De?u.nonTerminalName:""}let n=t.name,i=e[0],o=i.idx,s=Vt(i),a=r(i),c=o>0,l=`->${s}${c?o:""}<- ${a?`with argument: ->${a}<-`:""}
75
75
  appears more than once (${e.length} times) in the top level rule: ->${n}<-.
76
76
  For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
77
77
  `;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,`
@@ -97,44 +97,44 @@ rule: <${e}> can be invoked from itself (directly or indirectly)
97
97
  without consuming any Tokens. The grammar path that causes this is:
98
98
  ${n}
99
99
  To fix this refactor your grammar to remove the left recursion.
100
- see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Bt?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function w0(t,e){let r=new gm(t,e);return r.resolveRefs(),r.errors}var gm=class extends Gt{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:_t.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}};var ym=class extends yn{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())}},Lu=class extends ym{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 qe({definition:i});this.possibleTokTypes=to(o),this.found=!0}}},is=class extends yn{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}},Du=class extends is{walkMany(e,r,n){if(e.idx===this.occurrence){let i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof me&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},Tc=class extends is{walkManySep(e,r,n){if(e.idx===this.occurrence){let i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof me&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},Mu=class extends is{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){let i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof me&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},_c=class extends is{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){let i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof me&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}};function $u(t,e,r=[]){r=[...r];let n=[],i=0;function o(a){return a.concat(t.slice(i+1))}function s(a){let c=$u(o(a),e,r);return n.concat(c)}for(;r.length<e&&i<t.length;){let a=t[i];if(a instanceof qe)return s(a.definition);if(a instanceof De)return s(a.definition);if(a instanceof Me)n=s(a.definition);else if(a instanceof Ve){let c=a.definition.concat([new ve({definition:a.definition})]);return s(c)}else if(a instanceof Ye){let c=[new qe({definition:a.definition}),new ve({definition:[new me({terminalType:a.separator})].concat(a.definition)})];return s(c)}else if(a instanceof je){let c=a.definition.concat([new ve({definition:[new me({terminalType:a.separator})].concat(a.definition)})]);n=s(c)}else if(a instanceof ve){let c=a.definition.concat([new ve({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 me)r.push(a.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:t.slice(i)}),n}function R0(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,E=d.occurrenceStack;if(p.length===0)continue;let _=p[0];if(_===i){let x={idx:m,def:p.slice(1),ruleStack:y.slice(0,-1),occurrenceStack:E.slice(0,-1)};f.push(x)}else if(_ instanceof me)if(m<c-1){let x=m+1,v=e[x];if(r(v,_.terminalType)){let k={idx:x,def:p.slice(1),ruleStack:y,occurrenceStack:E};f.push(k)}}else if(m===c-1)u.push({nextTokenType:_.terminalType,nextTokenOccurrence:_.idx,ruleStack:y,occurrenceStack:E}),a=!0;else throw Error("non exhaustive match");else if(_ instanceof De){let x=[...y];x.push(_.nonTerminalName);let v=[...E];v.push(_.idx);let k={idx:m,def:_.definition.concat(o,p.slice(1)),ruleStack:x,occurrenceStack:v};f.push(k)}else if(_ instanceof Me){let x={idx:m,def:p.slice(1),ruleStack:y,occurrenceStack:E};f.push(x),f.push(s);let v={idx:m,def:_.definition.concat(p.slice(1)),ruleStack:y,occurrenceStack:E};f.push(v)}else if(_ instanceof Ve){let x=new ve({definition:_.definition,idx:_.idx}),v=_.definition.concat([x],p.slice(1)),k={idx:m,def:v,ruleStack:y,occurrenceStack:E};f.push(k)}else if(_ instanceof Ye){let x=new me({terminalType:_.separator}),v=new ve({definition:[x].concat(_.definition),idx:_.idx}),k=_.definition.concat([v],p.slice(1)),F={idx:m,def:k,ruleStack:y,occurrenceStack:E};f.push(F)}else if(_ instanceof je){let x={idx:m,def:p.slice(1),ruleStack:y,occurrenceStack:E};f.push(x),f.push(s);let v=new me({terminalType:_.separator}),k=new ve({definition:[v].concat(_.definition),idx:_.idx}),F=_.definition.concat([k],p.slice(1)),O={idx:m,def:F,ruleStack:y,occurrenceStack:E};f.push(O)}else if(_ instanceof ve){let x={idx:m,def:p.slice(1),ruleStack:y,occurrenceStack:E};f.push(x),f.push(s);let v=new ve({definition:_.definition,idx:_.idx}),k=_.definition.concat([v],p.slice(1)),F={idx:m,def:k,ruleStack:y,occurrenceStack:E};f.push(F)}else if(_ instanceof ze)for(let x=_.definition.length-1;x>=0;x--){let v=_.definition[x],k={idx:m,def:v.definition.concat(p.slice(1)),ruleStack:y,occurrenceStack:E};f.push(k),f.push(s)}else if(_ instanceof qe)f.push({idx:m,def:_.definition.concat(p.slice(1)),ruleStack:y,occurrenceStack:E});else if(_ instanceof Bt)f.push(dO(_,m,y,E));else throw Error("non exhaustive match")}return u}function dO(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 st;(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"})(st||(st={}));function Ec(t){if(t instanceof Me||t==="Option")return st.OPTION;if(t instanceof ve||t==="Repetition")return st.REPETITION;if(t instanceof Ve||t==="RepetitionMandatory")return st.REPETITION_MANDATORY;if(t instanceof Ye||t==="RepetitionMandatoryWithSeparator")return st.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof je||t==="RepetitionWithSeparator")return st.REPETITION_WITH_SEPARATOR;if(t instanceof ze||t==="Alternation")return st.ALTERNATION;throw Error("non exhaustive match")}function Uu(t){let{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,o=Ec(n);return o===st.ALTERNATION?os(e,r,i):ss(e,r,o,i)}function A0(t,e,r,n,i,o){let s=os(t,e,r),a=O0(s)?ts:xn;return o(s,n,a,i)}function I0(t,e,r,n,i,o){let s=ss(t,e,i,r),a=O0(s)?ts:xn;return o(s[0],a,n)}function k0(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 E=this.LA_FAST(y+1);if(r(E,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 N0(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 Tm=class extends yn{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,st.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,st.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,st.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,st.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,st.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}},Fu=class extends Gt{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,st.OPTION)}visitRepetition(e){this.checkIsTarget(e,st.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,st.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,st.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,st.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,st.ALTERNATION)}};function S0(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function xm(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 pO(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 P0(t,e){let r=t.map(s=>$u([s],1)),n=S0(r.length),i=r.map(s=>{let a={};return s.forEach(c=>{xm(c.partialPath).forEach(u=>{a[u]=!0})}),a}),o=r;for(let s=1;s<=e;s++){let a=o;o=S0(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=xm(f);if(pO(i,p,c)||d.length===0||f.length===e){let y=n[c];if(Bu(y,f)===!1){y.push(f);for(let E=0;E<p.length;E++){let _=p[E];i[c][_]=!0}}}else{let y=$u(d,s+1,f);o[c]=o[c].concat(y),y.forEach(E=>{xm(E.partialPath).forEach(x=>{i[c][x]=!0})})}}}}return n}function os(t,e,r,n){let i=new Fu(t,st.ALTERNATION,n);return e.accept(i),P0(i.result,r)}function ss(t,e,r,n){let i=new Fu(t,r);e.accept(i);let o=i.result,a=new Tm(e,t,r).startWalking(),c=new qe({definition:o}),l=new qe({definition:a});return P0([c,l],n)}function Bu(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 C0(t,e){return t.length<e.length&&t.every((r,n)=>{let i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function O0(t){return t.every(e=>e.every(r=>r.every(n=>n.categoryMatches.length===0)))}function L0(t){return t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName}).map(r=>Object.assign({type:_t.CUSTOM_LOOKAHEAD_VALIDATION},r))}function D0(t,e,r,n){let i=t.flatMap(c=>hO(c,r)),o=_O(t,e,r),s=t.flatMap(c=>yO(c,r)),a=t.flatMap(c=>gO(c,t,n,r));return i.concat(o,s,a)}function hO(t,e){let r=new _m;t.accept(r);let n=r.allProductions,i=Object.groupBy(n,mO),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=Vt(c),f={message:l,type:_t.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:u,occurrence:c.idx},d=M0(c);return d&&(f.parameter=d),f})}function mO(t){return`${Vt(t)}_#_${t.idx}_#_${M0(t)}`}function M0(t){return t instanceof me?t.terminalType.name:t instanceof De?t.nonTerminalName:""}var _m=class extends Gt{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 gO(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:_t.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function $0(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:_t.INVALID_RULE_OVERRIDE,ruleName:t})),n}function vm(t,e,r,n=[]){let i=[],o=Gu(e.definition);if(o.length===0)return[];{let s=t.name;o.includes(t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:_t.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),vm(t,f,r,d)});return i.concat(u)}}function Gu(t){let e=[];if(t.length===0)return e;let r=t[0];if(r instanceof De)e.push(r.referencedRule);else if(r instanceof qe||r instanceof Me||r instanceof Ve||r instanceof Ye||r instanceof je||r instanceof ve)e=e.concat(Gu(r.definition));else if(r instanceof ze)e=r.definition.map(o=>Gu(o.definition)).flat();else if(!(r instanceof me))throw Error("non exhaustive match");let n=eo(r),i=t.length>1;if(n&&i){let o=t.slice(1);return e.concat(Gu(o))}else return e}var vc=class extends Gt{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function F0(t,e){let r=new vc;return t.accept(r),r.alternations.flatMap(o=>o.definition.slice(0,-1).flatMap((a,c)=>R0([a],[],xn,1).length===0?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:o,emptyChoiceIdx:c}),type:_t.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:o.idx,alternative:c+1}]:[]))}function U0(t,e,r){let n=new vc;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=os(a,t,c,s),u=xO(l,s,t,r),f=TO(l,s,t,r);return u.concat(f)})}var Em=class extends Gt{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 yO(t,e){let r=new vc;return t.accept(r),r.alternations.flatMap(o=>o.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:o}),type:_t.TOO_MANY_ALTS,ruleName:t.name,occurrence:o.idx}]:[])}function B0(t,e,r){let n=[];return t.forEach(i=>{let o=new Em;i.accept(o),o.allProductions.forEach(a=>{let c=Ec(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:_t.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function xO(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&&Bu(d,u)&&e.definition[p].ignoreAmbiguities!==!0&&f.push(p)}),f.length>1&&!Bu(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:_t.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:a.alts}})}function TO(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&&C0(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:_t.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:m,alternatives:p}})})}function _O(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:_t.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function G0(t){let e=Object.assign({errMsgProvider:b0},t),r={};return t.rules.forEach(n=>{r[n.name]=n}),w0(r,e.errMsgProvider)}function X0(t){var e;let r=(e=t.errMsgProvider)!==null&&e!==void 0?e:Sr;return D0(t.rules,t.tokenTypes,r,t.grammarName)}var H0="MismatchedTokenException",j0="NoViableAltException",z0="EarlyExitException",W0="NotAllInputParsedException",q0=[H0,j0,z0,W0];Object.freeze(q0);function ri(t){return q0.includes(t.name)}var as=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)}},no=class extends as{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=H0}},bc=class extends as{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=j0}},wc=class extends as{constructor(e,r){super(e,r),this.name=W0}},Rc=class extends as{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=z0}};var bm={},Rm="InRuleRecoveryException",wm=class extends Error{constructor(e){super(e),this.name=Rm}},Xu=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:Ht.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=EO)}getTokenToInsert(e){let r=En(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 no(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 Lu(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 wm("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 bm;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]=bm: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===bm)return[Xt];let r=e.ruleName+e.idxInCallingRule+Iu+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,Xt)||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 EO(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=Xt,u=1),!(l===void 0||u===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,u,s)&&this.tryInRepetitionRecovery(t,e,r,l)}function Hu(t,e,r){return r|e|t}var bn=class{constructor(e){var r;this.maxLookahead=(r=e?.maxLookahead)!==null&&r!==void 0?r:Ht.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=>vm(r,r,Sr))}validateEmptyOrAlternatives(e){return e.flatMap(r=>F0(r,Sr))}validateAmbiguousAlternationAlternatives(e,r){return e.flatMap(n=>U0(n,r,Sr))}validateSomeNonEmptyLookaheadPath(e,r){return B0(e,r,Sr)}buildLookaheadForAlternation(e){return A0(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,k0)}buildLookaheadForOptional(e){return I0(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Ec(e.prodType),N0)}};var zu=class{initLooksAhead(e){this.dynamicTokensEnabled=Object.hasOwn(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Ht.dynamicTokensEnabled,this.maxLookahead=Object.hasOwn(e,"maxLookahead")?e.maxLookahead:Ht.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}=vO(r);n.forEach(l=>{let u=l.idx===0?"":l.idx;this.TRACE_INIT(`${Vt(l)}${u}`,()=>{let f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:r,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),d=Hu(this.fullRuleNameToShort[r.name],256,l.idx);this.setLaFuncCache(d,f)})}),i.forEach(l=>{this.computeLookaheadFunc(r,l.idx,768,"Repetition",l.maxLookahead,Vt(l))}),o.forEach(l=>{this.computeLookaheadFunc(r,l.idx,512,"Option",l.maxLookahead,Vt(l))}),s.forEach(l=>{this.computeLookaheadFunc(r,l.idx,1024,"RepetitionMandatory",l.maxLookahead,Vt(l))}),a.forEach(l=>{this.computeLookaheadFunc(r,l.idx,1536,"RepetitionMandatoryWithSeparator",l.maxLookahead,Vt(l))}),c.forEach(l=>{this.computeLookaheadFunc(r,l.idx,1280,"RepetitionWithSeparator",l.maxLookahead,Vt(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=Hu(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(c,a)})}getKeyForAutomaticLookahead(e,r){return Hu(this.currRuleShortName,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},Sm=class extends Gt{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)}},ju=new Sm;function vO(t){ju.reset(),t.accept(ju);let e=ju.dslMethods;return ju.reset(),e}function km(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function Nm(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 V0(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function Y0(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}var bO="name";function Pm(t,e){Object.defineProperty(t,bO,{enumerable:!1,configurable:!0,writable:!1,value:e})}function wO(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 K0(t,e){let r=function(){};Pm(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=RO(this,e);if(i.length!==0){let o=i.map(s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
100
+ see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Bt?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function A0(t,e){let r=new Em(t,e);return r.resolveRefs(),r.errors}var Em=class extends Gt{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:_t.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}};var vm=class extends yn{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())}},Bu=class extends vm{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 qe({definition:i});this.possibleTokTypes=ro(o),this.found=!0}}},ss=class extends yn{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}},Gu=class extends ss{walkMany(e,r,n){if(e.idx===this.occurrence){let i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof he&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},_c=class extends ss{walkManySep(e,r,n){if(e.idx===this.occurrence){let i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof he&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},Hu=class extends ss{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){let i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof he&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},Ec=class extends ss{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){let i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof he&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}};function Xu(t,e,r=[]){r=[...r];let n=[],i=0;function o(a){return a.concat(t.slice(i+1))}function s(a){let c=Xu(o(a),e,r);return n.concat(c)}for(;r.length<e&&i<t.length;){let a=t[i];if(a instanceof qe)return s(a.definition);if(a instanceof De)return s(a.definition);if(a instanceof Me)n=s(a.definition);else if(a instanceof Ve){let c=a.definition.concat([new be({definition:a.definition})]);return s(c)}else if(a instanceof Ye){let c=[new qe({definition:a.definition}),new be({definition:[new he({terminalType:a.separator})].concat(a.definition)})];return s(c)}else if(a instanceof je){let c=a.definition.concat([new be({definition:[new he({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 he)r.push(a.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:t.slice(i)}),n}function I0(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,E=d.occurrenceStack;if(p.length===0)continue;let _=p[0];if(_===i){let x={idx:m,def:p.slice(1),ruleStack:y.slice(0,-1),occurrenceStack:E.slice(0,-1)};f.push(x)}else if(_ instanceof he)if(m<c-1){let x=m+1,v=e[x];if(r(v,_.terminalType)){let A={idx:x,def:p.slice(1),ruleStack:y,occurrenceStack:E};f.push(A)}}else if(m===c-1)u.push({nextTokenType:_.terminalType,nextTokenOccurrence:_.idx,ruleStack:y,occurrenceStack:E}),a=!0;else throw Error("non exhaustive match");else if(_ instanceof De){let x=[...y];x.push(_.nonTerminalName);let v=[...E];v.push(_.idx);let A={idx:m,def:_.definition.concat(o,p.slice(1)),ruleStack:x,occurrenceStack:v};f.push(A)}else if(_ instanceof Me){let x={idx:m,def:p.slice(1),ruleStack:y,occurrenceStack:E};f.push(x),f.push(s);let v={idx:m,def:_.definition.concat(p.slice(1)),ruleStack:y,occurrenceStack:E};f.push(v)}else if(_ instanceof Ve){let x=new be({definition:_.definition,idx:_.idx}),v=_.definition.concat([x],p.slice(1)),A={idx:m,def:v,ruleStack:y,occurrenceStack:E};f.push(A)}else if(_ instanceof Ye){let x=new he({terminalType:_.separator}),v=new be({definition:[x].concat(_.definition),idx:_.idx}),A=_.definition.concat([v],p.slice(1)),F={idx:m,def:A,ruleStack:y,occurrenceStack:E};f.push(F)}else if(_ instanceof je){let x={idx:m,def:p.slice(1),ruleStack:y,occurrenceStack:E};f.push(x),f.push(s);let v=new he({terminalType:_.separator}),A=new be({definition:[v].concat(_.definition),idx:_.idx}),F=_.definition.concat([A],p.slice(1)),O={idx:m,def:F,ruleStack:y,occurrenceStack:E};f.push(O)}else if(_ instanceof be){let x={idx:m,def:p.slice(1),ruleStack:y,occurrenceStack:E};f.push(x),f.push(s);let v=new be({definition:_.definition,idx:_.idx}),A=_.definition.concat([v],p.slice(1)),F={idx:m,def:A,ruleStack:y,occurrenceStack:E};f.push(F)}else if(_ instanceof ze)for(let x=_.definition.length-1;x>=0;x--){let v=_.definition[x],A={idx:m,def:v.definition.concat(p.slice(1)),ruleStack:y,occurrenceStack:E};f.push(A),f.push(s)}else if(_ instanceof qe)f.push({idx:m,def:_.definition.concat(p.slice(1)),ruleStack:y,occurrenceStack:E});else if(_ instanceof Bt)f.push(yO(_,m,y,E));else throw Error("non exhaustive match")}return u}function yO(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 st;(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"})(st||(st={}));function vc(t){if(t instanceof Me||t==="Option")return st.OPTION;if(t instanceof be||t==="Repetition")return st.REPETITION;if(t instanceof Ve||t==="RepetitionMandatory")return st.REPETITION_MANDATORY;if(t instanceof Ye||t==="RepetitionMandatoryWithSeparator")return st.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof je||t==="RepetitionWithSeparator")return st.REPETITION_WITH_SEPARATOR;if(t instanceof ze||t==="Alternation")return st.ALTERNATION;throw Error("non exhaustive match")}function zu(t){let{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,o=vc(n);return o===st.ALTERNATION?as(e,r,i):cs(e,r,o,i)}function N0(t,e,r,n,i,o){let s=as(t,e,r),a=M0(s)?ns:xn;return o(s,n,a,i)}function P0(t,e,r,n,i,o){let s=cs(t,e,i,r),a=M0(s)?ns:xn;return o(s[0],a,n)}function C0(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 E=this.LA_FAST(y+1);if(r(E,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 O0(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 wm=class extends yn{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,st.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,st.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,st.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,st.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,st.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}},ju=class extends Gt{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,st.OPTION)}visitRepetition(e){this.checkIsTarget(e,st.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,st.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,st.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,st.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,st.ALTERNATION)}};function k0(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function bm(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 xO(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 L0(t,e){let r=t.map(s=>Xu([s],1)),n=k0(r.length),i=r.map(s=>{let a={};return s.forEach(c=>{bm(c.partialPath).forEach(u=>{a[u]=!0})}),a}),o=r;for(let s=1;s<=e;s++){let a=o;o=k0(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=bm(f);if(xO(i,p,c)||d.length===0||f.length===e){let y=n[c];if(Wu(y,f)===!1){y.push(f);for(let E=0;E<p.length;E++){let _=p[E];i[c][_]=!0}}}else{let y=Xu(d,s+1,f);o[c]=o[c].concat(y),y.forEach(E=>{bm(E.partialPath).forEach(x=>{i[c][x]=!0})})}}}}return n}function as(t,e,r,n){let i=new ju(t,st.ALTERNATION,n);return e.accept(i),L0(i.result,r)}function cs(t,e,r,n){let i=new ju(t,r);e.accept(i);let o=i.result,a=new wm(e,t,r).startWalking(),c=new qe({definition:o}),l=new qe({definition:a});return L0([c,l],n)}function Wu(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 D0(t,e){return t.length<e.length&&t.every((r,n)=>{let i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function M0(t){return t.every(e=>e.every(r=>r.every(n=>n.categoryMatches.length===0)))}function $0(t){return t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName}).map(r=>Object.assign({type:_t.CUSTOM_LOOKAHEAD_VALIDATION},r))}function F0(t,e,r,n){let i=t.flatMap(c=>TO(c,r)),o=RO(t,e,r),s=t.flatMap(c=>vO(c,r)),a=t.flatMap(c=>EO(c,t,n,r));return i.concat(o,s,a)}function TO(t,e){let r=new Rm;t.accept(r);let n=r.allProductions,i=Object.groupBy(n,_O),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=Vt(c),f={message:l,type:_t.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:u,occurrence:c.idx},d=U0(c);return d&&(f.parameter=d),f})}function _O(t){return`${Vt(t)}_#_${t.idx}_#_${U0(t)}`}function U0(t){return t instanceof he?t.terminalType.name:t instanceof De?t.nonTerminalName:""}var Rm=class extends Gt{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 EO(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:_t.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function B0(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:_t.INVALID_RULE_OVERRIDE,ruleName:t})),n}function Am(t,e,r,n=[]){let i=[],o=qu(e.definition);if(o.length===0)return[];{let s=t.name;o.includes(t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:_t.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),Am(t,f,r,d)});return i.concat(u)}}function qu(t){let e=[];if(t.length===0)return e;let r=t[0];if(r instanceof De)e.push(r.referencedRule);else if(r instanceof qe||r instanceof Me||r instanceof Ve||r instanceof Ye||r instanceof je||r instanceof be)e=e.concat(qu(r.definition));else if(r instanceof ze)e=r.definition.map(o=>qu(o.definition)).flat();else if(!(r instanceof he))throw Error("non exhaustive match");let n=to(r),i=t.length>1;if(n&&i){let o=t.slice(1);return e.concat(qu(o))}else return e}var bc=class extends Gt{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function G0(t,e){let r=new bc;return t.accept(r),r.alternations.flatMap(o=>o.definition.slice(0,-1).flatMap((a,c)=>I0([a],[],xn,1).length===0?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:o,emptyChoiceIdx:c}),type:_t.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:o.idx,alternative:c+1}]:[]))}function H0(t,e,r){let n=new bc;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=as(a,t,c,s),u=bO(l,s,t,r),f=wO(l,s,t,r);return u.concat(f)})}var Sm=class extends Gt{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 vO(t,e){let r=new bc;return t.accept(r),r.alternations.flatMap(o=>o.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:o}),type:_t.TOO_MANY_ALTS,ruleName:t.name,occurrence:o.idx}]:[])}function X0(t,e,r){let n=[];return t.forEach(i=>{let o=new Sm;i.accept(o),o.allProductions.forEach(a=>{let c=vc(a),l=a.maxLookahead||e,u=a.idx;if(cs(u,i,c,l)[0].flat().length===0){let p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:a});n.push({message:p,type:_t.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function bO(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&&Wu(d,u)&&e.definition[p].ignoreAmbiguities!==!0&&f.push(p)}),f.length>1&&!Wu(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:_t.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:a.alts}})}function wO(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&&D0(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:_t.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:m,alternatives:p}})})}function RO(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:_t.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function j0(t){let e=Object.assign({errMsgProvider:S0},t),r={};return t.rules.forEach(n=>{r[n.name]=n}),A0(r,e.errMsgProvider)}function z0(t){var e;let r=(e=t.errMsgProvider)!==null&&e!==void 0?e:Sr;return F0(t.rules,t.tokenTypes,r,t.grammarName)}var W0="MismatchedTokenException",q0="NoViableAltException",V0="EarlyExitException",Y0="NotAllInputParsedException",K0=[W0,q0,V0,Y0];Object.freeze(K0);function ri(t){return K0.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)}},oo=class extends ls{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=W0}},wc=class extends ls{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=q0}},Rc=class extends ls{constructor(e,r){super(e,r),this.name=Y0}},Sc=class extends ls{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=V0}};var Im={},Nm="InRuleRecoveryException",km=class extends Error{constructor(e){super(e),this.name=Nm}},Vu=class{initRecoverable(e){this.firstAfterRepMap=[],this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:Xt.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=SO)}getTokenToInsert(e){let r=En(e,"",-1,-1,-1,-1,-1,-1);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 oo(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 Bu(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 km("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=>os(r,o));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK_IDX===0)return Im;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]=Im: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===Im)return[Ht];let r=e.ruleName+e.idxInCallingRule+Pu+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,Ht)||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){var a,c,l;let u=n|i,f=(a=(c=this.firstAfterRepMap)[l=this.currRuleShortName])!==null&&a!==void 0?a:c[l]=[],d=f[u];if(d===void 0){let E=this.getCurrRuleFullName(),_=this.getGAstProductions()[E];d=new o(_,i).startWalking(),f[u]=d}let p=d.token,m=d.occurrence,y=d.isEndOfRule;this.RULE_STACK_IDX===0&&y&&p===void 0&&(p=Ht,m=1),!(p===void 0||m===void 0)&&this.shouldInRepetitionRecoveryBeTried(p,m,s)&&this.tryInRepetitionRecovery(t,e,r,p)}var bn=class{constructor(e){var r;this.maxLookahead=(r=e?.maxLookahead)!==null&&r!==void 0?r:Xt.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=>Am(r,r,Sr))}validateEmptyOrAlternatives(e){return e.flatMap(r=>G0(r,Sr))}validateAmbiguousAlternationAlternatives(e,r){return e.flatMap(n=>H0(n,r,Sr))}validateSomeNonEmptyLookaheadPath(e,r){return X0(e,r,Sr)}buildLookaheadForAlternation(e){return N0(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,C0)}buildLookaheadForOptional(e){return P0(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,vc(e.prodType),O0)}};var Ku=class{initLooksAhead(e){this.dynamicTokensEnabled=Object.hasOwn(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Xt.dynamicTokensEnabled,this.maxLookahead=Object.hasOwn(e,"maxLookahead")?e.maxLookahead:Xt.maxLookahead,this.lookaheadStrategy=Object.hasOwn(e,"lookaheadStrategy")?e.lookaheadStrategy:new bn({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=[],this.currRuleLookaheadFuncs=[]}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}=AO(r);n.forEach(l=>{let u=l.idx===0?"":l.idx;this.TRACE_INIT(`${Vt(l)}${u}`,()=>{let f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:r,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled});this.setLaFuncCache(this.fullRuleNameToShort[r.name],256|l.idx,f)})}),i.forEach(l=>{this.computeLookaheadFunc(r,l.idx,768,"Repetition",l.maxLookahead,Vt(l))}),o.forEach(l=>{this.computeLookaheadFunc(r,l.idx,512,"Option",l.maxLookahead,Vt(l))}),s.forEach(l=>{this.computeLookaheadFunc(r,l.idx,1024,"RepetitionMandatory",l.maxLookahead,Vt(l))}),a.forEach(l=>{this.computeLookaheadFunc(r,l.idx,1536,"RepetitionMandatoryWithSeparator",l.maxLookahead,Vt(l))}),c.forEach(l=>{this.computeLookaheadFunc(r,l.idx,1280,"RepetitionWithSeparator",l.maxLookahead,Vt(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});this.setLaFuncCache(this.fullRuleNameToShort[e.name],n|r,a)})}setLaFuncCache(e,r,n){let i=this.lookAheadFuncsCache[e];i===void 0&&(i=[],this.lookAheadFuncsCache[e]=i),i[r]=n}},Pm=class extends Gt{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)}},Yu=new Pm;function AO(t){Yu.reset(),t.accept(Yu);let e=Yu.dslMethods;return Yu.reset(),e}function Lm(t,e){t.startOffset===-1?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function Dm(t,e){t.startOffset===-1?(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 Z0(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function J0(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}var IO="name";function Mm(t,e){Object.defineProperty(t,IO,{enumerable:!1,configurable:!0,writable:!1,value:e})}function kO(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 Q0(t,e){let r=function(){};Mm(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=NO(this,e);if(i.length!==0){let o=i.map(s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
101
101
  ${o.join(`
102
102
 
103
103
  `).replace(/\n/g,`
104
- `)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function Z0(t,e,r){let n=function(){};Pm(n,t+"BaseSemanticsWithDefaults");let i=Object.create(r.prototype);return e.forEach(o=>{i[o]=wO}),n.prototype=i,n.prototype.constructor=n,n}var Cm;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Cm||(Cm={}));function RO(t,e){return SO(t,e)}function SO(t,e){return e.filter(i=>typeof t[i]!="function").map(i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:Cm.MISSING_METHOD,methodName:i})).filter(Boolean)}var Yu=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,"nodeLocationTracking")?e.nodeLocationTracking:Ht.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{};else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Nm,this.setNodeLocationFromNode=Nm,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=km,this.setNodeLocationFromNode=km,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];V0(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];Y0(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(this.baseCstVisitorConstructor===void 0){let e=K0(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(this.baseCstVisitorWithDefaultsConstructor===void 0){let e=Z0(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 Ku=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)):wn}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?wn: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 Zu=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=cs){if(this.definedRulesNames.includes(e)){let s={message:Sr.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:_t.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=cs){let i=$0(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(ri(s))return!1;throw s}finally{this.reloadRecogState(o),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Au(Object.values(this.gastProductionsCache))}};var Ju=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=ts,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.
104
+ `)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function ev(t,e,r){let n=function(){};Mm(n,t+"BaseSemanticsWithDefaults");let i=Object.create(r.prototype);return e.forEach(o=>{i[o]=kO}),n.prototype=i,n.prototype.constructor=n,n}var $m;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})($m||($m={}));function NO(t,e){return PO(t,e)}function PO(t,e){return e.filter(i=>typeof t[i]!="function").map(i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:$m.MISSING_METHOD,methodName:i})).filter(Boolean)}var ef=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,"nodeLocationTracking")?e.nodeLocationTracking:Xt.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{};else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Dm,this.setNodeLocationFromNode=Dm,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=Lm,this.setNodeLocationFromNode=Lm,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:-1,endOffset:-1}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA_FAST(1).startOffset,endOffset:-1}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:-1,startLine:-1,startColumn:-1,endOffset:-1,endLine:-1,endColumn:-1}}setInitialNodeLocationFullRegular(e){let r=this.LA_FAST(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:-1,endLine:-1,endColumn:-1}}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!==-1&&n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=-1,n.startLine=-1,n.startColumn=-1)}cstPostRuleOnlyOffset(e){let r=this.LA(0),n=e.location;n.startOffset!==-1&&n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=-1}cstPostTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];Z0(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];J0(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}get currCSTNode(){let e=this;return e.CST_STACK[e.CST_STACK.length-1]}getBaseCstVisitorConstructor(){if(this.baseCstVisitorConstructor===void 0){let e=Q0(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(this.baseCstVisitorWithDefaultsConstructor===void 0){let e=ev(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 tf=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)):wn}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?wn: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 rf=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=us){if(this.definedRulesNames.includes(e)){let s={message:Sr.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:_t.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=us){let i=B0(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(ri(s))return!1;throw s}finally{this.reloadRecogState(o),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Nu(Object.values(this.gastProductionsCache))}};var nf=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull=[],this.fullRuleNameToShort={},this.ruleShortNameIdx=0,this.tokenMatcher=ns,this.subruleIdx=0,this.currRuleShortName=-1,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.
105
105
  See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
106
106
  For Further details.`);if(Array.isArray(e)){if(e.length===0)throw Error(`A Token Vocabulary cannot be empty.
107
107
  Note that the first argument for the parser constructor
108
108
  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.
109
109
  See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
110
- 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(h0)){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=Xt;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?ts:xn,Tn(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'
111
- Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=Object.hasOwn(n,"resyncEnabled")?n.resyncEnabled:cs.resyncEnabled,o=Object.hasOwn(n,"recoveryValueFunc")?n.recoveryValueFunc:cs.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(ri(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,st.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,1024,e,Mu)}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,_c],a,1536,e,_c)}else throw this.raiseEarlyExitException(e,st.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,Du,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,Tc],a,1280,e,Tc)}}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 ri(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 no(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===Rm?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),Xt)}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(wn)}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)===wn;)this.tokVector.pop()}};var Qu=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:Ht.errorMessageProvider}SAVE_ERROR(e){if(ri(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 Rc(l,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],o=os(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 bc(c,this.LA(1),a))}};var rf={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(rf);var J0=!0,Q0=Math.pow(2,8)-1,tv=ti({name:"RECORDING_PHASE_TOKEN",pattern:ot.NA});Tn([tv]);var rv=En(tv,`This IToken indicates the Parser is in Recording Phase
112
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(rv);var IO={name:`This CSTNode indicates the Parser is in Recording Phase
113
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},ef=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 wn}topLevelRuleRecord(e,r){try{let n=new Bt({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+`
110
+ 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(y0)){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=Ht;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?ns:xn,Tn(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'
111
+ Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=Object.hasOwn(n,"resyncEnabled")?n.resyncEnabled:us.resyncEnabled,o=Object.hasOwn(n,"recoveryValueFunc")?n.recoveryValueFunc:us.recoveryValueFunc,s=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(ri(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=512|r;return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.currRuleLookaheadFuncs[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=1024|e;return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.currRuleLookaheadFuncs[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,st.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,1024,e,Hu)}atLeastOneSepFirstInternal(e,r){let n=1536|e;this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.currRuleLookaheadFuncs[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,Ec],a,1536,e,Ec)}else throw this.raiseEarlyExitException(e,st.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){let n=768|e;return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.currRuleLookaheadFuncs[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,Gu,s)}manySepFirstInternal(e,r){let n=1280|e;this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.currRuleLookaheadFuncs[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,_c],a,1280,e,_c)}}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=256|r,i=Array.isArray(e)?e:e.DEF,s=this.currRuleLookaheadFuncs[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.currRuleLookaheadFuncs=this.lookAheadFuncsCache[this.currRuleShortName]),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 ri(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 oo(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===Nm?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],this.currRuleLookaheadFuncs=this.lookAheadFuncsCache[this.currRuleShortName])}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.currRuleLookaheadFuncs=this.lookAheadFuncsCache[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),Ht)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=-1,this.currRuleLookaheadFuncs=[],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(wn)}onAfterParse(e){if(this.isAtEndOfInput()===!1){let r=this.LA(1),n=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:r,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Rc(n,r))}for(;this.tokVector.at(-1)===wn;)this.tokVector.pop()}};var of=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:Xt.errorMessageProvider}SAVE_ERROR(e){if(ri(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=cs(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 Sc(l,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],o=as(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 wc(c,this.LA(1),a))}};var cf={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(cf);var tv=!0,rv=255,iv=ti({name:"RECORDING_PHASE_TOKEN",pattern:ot.NA});Tn([iv]);var ov=En(iv,`This IToken indicates the Parser is in Recording Phase
112
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(ov);var CO={name:`This CSTNode indicates the Parser is in Recording Phase
113
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},sf=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 wn}topLevelRuleRecord(e,r){try{let n=new Bt({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+`
114
114
  This error was thrown during the "grammar recording phase" For more info see:
115
- https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return Ac.call(this,Me,e,r)}atLeastOneInternalRecord(e,r){Ac.call(this,Ve,r,e)}atLeastOneSepFirstInternalRecord(e,r){Ac.call(this,Ye,r,e,J0)}manyInternalRecord(e,r){Ac.call(this,ve,r,e)}manySepFirstInternalRecord(e,r){Ac.call(this,je,r,e,J0)}orInternalRecord(e,r){return kO.call(this,e,r)}subruleInternalRecord(e,r,n){if(tf(r),!e||!Object.hasOwn(e,"ruleName")){let a=new Error(`<SUBRULE${ev(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
116
- 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 De({idx:r,nonTerminalName:o,label:n?.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?IO:rf}consumeInternalRecord(e,r,n){if(tf(r),!hm(e)){let s=new Error(`<CONSUME${ev(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
117
- inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}let i=this.recordingProdStack.at(-1),o=new me({idx:r,terminalType:e,label:n?.LABEL});return i.definition.push(o),rv}};function Ac(t,e,r,n=!1){tf(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(),rf}function kO(t,e){tf(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 qe({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()}),rf}function ev(t){return t===0?"":`${t}`}function tf(t){if(t<0||t>Q0){let e=new Error(`Invalid DSL Method idx value: <${t}>
118
- Idx value must be a none negative value smaller than ${Q0+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}var nf=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=Ht.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}=mc(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 nv(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 wn=En(Xt,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(wn);var Ht=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:vn,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),cs=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0}),_t;(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"})(_t||(_t={}));function of(t=void 0){return function(){return t}}var Ic=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",()=>{gc(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=G0({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=X0({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:Sr,grammarName:r}),o=L0({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=YE(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:
115
+ https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return Ic.call(this,Me,e,r)}atLeastOneInternalRecord(e,r){Ic.call(this,Ve,r,e)}atLeastOneSepFirstInternalRecord(e,r){Ic.call(this,Ye,r,e,tv)}manyInternalRecord(e,r){Ic.call(this,be,r,e)}manySepFirstInternalRecord(e,r){Ic.call(this,je,r,e,tv)}orInternalRecord(e,r){return OO.call(this,e,r)}subruleInternalRecord(e,r,n){if(af(r),!e||!Object.hasOwn(e,"ruleName")){let a=new Error(`<SUBRULE${nv(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
116
+ 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 De({idx:r,nonTerminalName:o,label:n?.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?CO:cf}consumeInternalRecord(e,r,n){if(af(r),!Tm(e)){let s=new Error(`<CONSUME${nv(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
117
+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}let i=this.recordingProdStack.at(-1),o=new he({idx:r,terminalType:e,label:n?.LABEL});return i.definition.push(o),ov}};function Ic(t,e,r,n=!1){af(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(),cf}function OO(t,e){af(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 qe({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()}),cf}function nv(t){return t===0?"":`${t}`}function af(t){if(t<0||t>rv){let e=new Error(`Invalid DSL Method idx value: <${t}>
118
+ Idx value must be a none negative value smaller than ${rv+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}var lf=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=Xt.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}=mc(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 sv(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 wn=En(Ht,"",-1,-1,-1,-1,-1,-1);Object.freeze(wn);var Xt=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:vn,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),us=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0}),_t;(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"})(_t||(_t={}));function uf(t=void 0){return function(){return t}}var kc=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",()=>{gc(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=j0({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=z0({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:Sr,grammarName:r}),o=$0({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=QE(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:
119
119
  ${e.join(`
120
120
  -------------------------------
121
121
  `)}`)})}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.
122
122
  Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
123
123
  See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
124
- For further details.`);this.skipValidations=Object.hasOwn(r,"skipValidations")?r.skipValidations:Ht.skipValidations}};Ic.DEFER_DEFINITION_ERRORS_HANDLING=!1;nv(Ic,[Xu,zu,Yu,Ku,Ju,Zu,Qu,ef,nf]);var kc=class extends Ic{constructor(e,r=Ht){let n=Object.assign({},r);n.outputCst=!1,super(e,n)}};function PO(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 sf=PO;function CO(){this.__data__=[],this.size=0}var iv=CO;function OO(t,e){return t===e||t!==t&&e!==e}var af=OO;function LO(t,e){for(var r=t.length;r--;)if(af(t[r][0],e))return r;return-1}var ni=LO;var DO=Array.prototype,MO=DO.splice;function $O(t){var e=this.__data__,r=ni(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():MO.call(e,r,1),--this.size,!0}var ov=$O;function FO(t){var e=this.__data__,r=ni(e,t);return r<0?void 0:e[r][1]}var sv=FO;function UO(t){return ni(this.__data__,t)>-1}var av=UO;function BO(t,e){var r=this.__data__,n=ni(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var cv=BO;function ls(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])}}ls.prototype.clear=iv;ls.prototype.delete=ov;ls.prototype.get=sv;ls.prototype.has=av;ls.prototype.set=cv;var ii=ls;function GO(){this.__data__=new ii,this.size=0}var lv=GO;function XO(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var uv=XO;function HO(t){return this.__data__.get(t)}var fv=HO;function jO(t){return this.__data__.has(t)}var dv=jO;var zO=typeof global=="object"&&global&&global.Object===Object&&global,cf=zO;var WO=typeof self=="object"&&self&&self.Object===Object&&self,qO=cf||WO||Function("return this")(),bt=qO;var VO=bt.Symbol,jt=VO;var pv=Object.prototype,YO=pv.hasOwnProperty,KO=pv.toString,Nc=jt?jt.toStringTag:void 0;function ZO(t){var e=YO.call(t,Nc),r=t[Nc];try{t[Nc]=void 0;var n=!0}catch{}var i=KO.call(t);return n&&(e?t[Nc]=r:delete t[Nc]),i}var hv=ZO;var JO=Object.prototype,QO=JO.toString;function eL(t){return QO.call(t)}var mv=eL;var tL="[object Null]",rL="[object Undefined]",gv=jt?jt.toStringTag:void 0;function nL(t){return t==null?t===void 0?rL:tL:gv&&gv in Object(t)?hv(t):mv(t)}var Ar=nL;function iL(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var us=iL;var oL="[object AsyncFunction]",sL="[object Function]",aL="[object GeneratorFunction]",cL="[object Proxy]";function lL(t){if(!us(t))return!1;var e=Ar(t);return e==sL||e==aL||e==oL||e==cL}var lf=lL;var uL=bt["__core-js_shared__"],uf=uL;var yv=(function(){var t=/[^.]+$/.exec(uf&&uf.keys&&uf.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function fL(t){return!!yv&&yv in t}var xv=fL;var dL=Function.prototype,pL=dL.toString;function hL(t){if(t!=null){try{return pL.call(t)}catch{}try{return t+""}catch{}}return""}var Rn=hL;var mL=/[\\^$.*+?()[\]{}|]/g,gL=/^\[object .+?Constructor\]$/,yL=Function.prototype,xL=Object.prototype,TL=yL.toString,_L=xL.hasOwnProperty,EL=RegExp("^"+TL.call(_L).replace(mL,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function vL(t){if(!us(t)||xv(t))return!1;var e=lf(t)?EL:gL;return e.test(Rn(t))}var Tv=vL;function bL(t,e){return t?.[e]}var _v=bL;function wL(t,e){var r=_v(t,e);return Tv(r)?r:void 0}var gr=wL;var RL=gr(bt,"Map"),oi=RL;var SL=gr(Object,"create"),Sn=SL;function AL(){this.__data__=Sn?Sn(null):{},this.size=0}var Ev=AL;function IL(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var vv=IL;var kL="__lodash_hash_undefined__",NL=Object.prototype,PL=NL.hasOwnProperty;function CL(t){var e=this.__data__;if(Sn){var r=e[t];return r===kL?void 0:r}return PL.call(e,t)?e[t]:void 0}var bv=CL;var OL=Object.prototype,LL=OL.hasOwnProperty;function DL(t){var e=this.__data__;return Sn?e[t]!==void 0:LL.call(e,t)}var wv=DL;var ML="__lodash_hash_undefined__";function $L(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Sn&&e===void 0?ML:e,this}var Rv=$L;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=Ev;fs.prototype.delete=vv;fs.prototype.get=bv;fs.prototype.has=wv;fs.prototype.set=Rv;var Lm=fs;function FL(){this.size=0,this.__data__={hash:new Lm,map:new(oi||ii),string:new Lm}}var Sv=FL;function UL(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Av=UL;function BL(t,e){var r=t.__data__;return Av(e)?r[typeof e=="string"?"string":"hash"]:r.map}var si=BL;function GL(t){var e=si(this,t).delete(t);return this.size-=e?1:0,e}var Iv=GL;function XL(t){return si(this,t).get(t)}var kv=XL;function HL(t){return si(this,t).has(t)}var Nv=HL;function jL(t,e){var r=si(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var Pv=jL;function ds(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])}}ds.prototype.clear=Sv;ds.prototype.delete=Iv;ds.prototype.get=kv;ds.prototype.has=Nv;ds.prototype.set=Pv;var io=ds;var zL=200;function WL(t,e){var r=this.__data__;if(r instanceof ii){var n=r.__data__;if(!oi||n.length<zL-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new io(n)}return r.set(t,e),this.size=r.size,this}var Cv=WL;function ps(t){var e=this.__data__=new ii(t);this.size=e.size}ps.prototype.clear=lv;ps.prototype.delete=uv;ps.prototype.get=fv;ps.prototype.has=dv;ps.prototype.set=Cv;var hs=ps;var qL="__lodash_hash_undefined__";function VL(t){return this.__data__.set(t,qL),this}var Ov=VL;function YL(t){return this.__data__.has(t)}var Lv=YL;function ff(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new io;++e<r;)this.add(t[e])}ff.prototype.add=ff.prototype.push=Ov;ff.prototype.has=Lv;var df=ff;function KL(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 Dv=KL;function ZL(t,e){return t.has(e)}var pf=ZL;var JL=1,QL=2;function e1(t,e,r,n,i,o){var s=r&JL,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&QL?new df:void 0;for(o.set(t,e),o.set(e,t);++f<a;){var m=t[f],y=e[f];if(n)var E=s?n(y,m,f,e,t,o):n(m,y,f,t,e,o);if(E!==void 0){if(E)continue;d=!1;break}if(p){if(!Dv(e,function(_,x){if(!pf(p,x)&&(m===_||i(m,_,r,n,o)))return p.push(x)})){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 hf=e1;var t1=bt.Uint8Array,Dm=t1;function r1(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}var Mv=r1;function n1(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var ms=n1;var i1=1,o1=2,s1="[object Boolean]",a1="[object Date]",c1="[object Error]",l1="[object Map]",u1="[object Number]",f1="[object RegExp]",d1="[object Set]",p1="[object String]",h1="[object Symbol]",m1="[object ArrayBuffer]",g1="[object DataView]",$v=jt?jt.prototype:void 0,Mm=$v?$v.valueOf:void 0;function y1(t,e,r,n,i,o,s){switch(r){case g1:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case m1:return!(t.byteLength!=e.byteLength||!o(new Dm(t),new Dm(e)));case s1:case a1:case u1:return af(+t,+e);case c1:return t.name==e.name&&t.message==e.message;case f1:case p1:return t==e+"";case l1:var a=Mv;case d1:var c=n&i1;if(a||(a=ms),t.size!=e.size&&!c)return!1;var l=s.get(t);if(l)return l==e;n|=o1,s.set(t,e);var u=hf(a(t),a(e),n,i,o,s);return s.delete(t),u;case h1:if(Mm)return Mm.call(t)==Mm.call(e)}return!1}var Fv=y1;function x1(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var mf=x1;var T1=Array.isArray,Ue=T1;function _1(t,e,r){var n=e(t);return Ue(t)?n:mf(n,r(t))}var Uv=_1;function E1(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 gf=E1;function v1(){return[]}var Bv=v1;var b1=Object.prototype,w1=b1.propertyIsEnumerable,Gv=Object.getOwnPropertySymbols,R1=Gv?function(t){return t==null?[]:(t=Object(t),gf(Gv(t),function(e){return w1.call(t,e)}))}:Bv,Xv=R1;function S1(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Hv=S1;function A1(t){return t!=null&&typeof t=="object"}var Ir=A1;var I1="[object Arguments]";function k1(t){return Ir(t)&&Ar(t)==I1}var $m=k1;var jv=Object.prototype,N1=jv.hasOwnProperty,P1=jv.propertyIsEnumerable,C1=$m((function(){return arguments})())?$m:function(t){return Ir(t)&&N1.call(t,"callee")&&!P1.call(t,"callee")},ai=C1;function O1(){return!1}var zv=O1;var Vv=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Wv=Vv&&typeof module=="object"&&module&&!module.nodeType&&module,L1=Wv&&Wv.exports===Vv,qv=L1?bt.Buffer:void 0,D1=qv?qv.isBuffer:void 0,M1=D1||zv,oo=M1;var $1=9007199254740991,F1=/^(?:0|[1-9]\d*)$/;function U1(t,e){var r=typeof t;return e=e??$1,!!e&&(r=="number"||r!="symbol"&&F1.test(t))&&t>-1&&t%1==0&&t<e}var yf=U1;var B1=9007199254740991;function G1(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=B1}var gs=G1;var X1="[object Arguments]",H1="[object Array]",j1="[object Boolean]",z1="[object Date]",W1="[object Error]",q1="[object Function]",V1="[object Map]",Y1="[object Number]",K1="[object Object]",Z1="[object RegExp]",J1="[object Set]",Q1="[object String]",eD="[object WeakMap]",tD="[object ArrayBuffer]",rD="[object DataView]",nD="[object Float32Array]",iD="[object Float64Array]",oD="[object Int8Array]",sD="[object Int16Array]",aD="[object Int32Array]",cD="[object Uint8Array]",lD="[object Uint8ClampedArray]",uD="[object Uint16Array]",fD="[object Uint32Array]",et={};et[nD]=et[iD]=et[oD]=et[sD]=et[aD]=et[cD]=et[lD]=et[uD]=et[fD]=!0;et[X1]=et[H1]=et[tD]=et[j1]=et[rD]=et[z1]=et[W1]=et[q1]=et[V1]=et[Y1]=et[K1]=et[Z1]=et[J1]=et[Q1]=et[eD]=!1;function dD(t){return Ir(t)&&gs(t.length)&&!!et[Ar(t)]}var Yv=dD;function pD(t){return function(e){return t(e)}}var Kv=pD;var Zv=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Pc=Zv&&typeof module=="object"&&module&&!module.nodeType&&module,hD=Pc&&Pc.exports===Zv,Fm=hD&&cf.process,mD=(function(){try{var t=Pc&&Pc.require&&Pc.require("util").types;return t||Fm&&Fm.binding&&Fm.binding("util")}catch{}})(),Um=mD;var Jv=Um&&Um.isTypedArray,gD=Jv?Kv(Jv):Yv,ys=gD;var yD=Object.prototype,xD=yD.hasOwnProperty;function TD(t,e){var r=Ue(t),n=!r&&ai(t),i=!r&&!n&&oo(t),o=!r&&!n&&!i&&ys(t),s=r||n||i||o,a=s?Hv(t.length,String):[],c=a.length;for(var l in t)(e||xD.call(t,l))&&!(s&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||yf(l,c)))&&a.push(l);return a}var Qv=TD;var _D=Object.prototype;function ED(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||_D;return t===r}var xf=ED;function vD(t,e){return function(r){return t(e(r))}}var eb=vD;var bD=eb(Object.keys,Object),tb=bD;var wD=Object.prototype,RD=wD.hasOwnProperty;function SD(t){if(!xf(t))return tb(t);var e=[];for(var r in Object(t))RD.call(t,r)&&r!="constructor"&&e.push(r);return e}var Tf=SD;function AD(t){return t!=null&&gs(t.length)&&!lf(t)}var ci=AD;function ID(t){return ci(t)?Qv(t):Tf(t)}var xs=ID;function kD(t){return Uv(t,xs,Xv)}var Bm=kD;var ND=1,PD=Object.prototype,CD=PD.hasOwnProperty;function OD(t,e,r,n,i,o){var s=r&ND,a=Bm(t),c=a.length,l=Bm(e),u=l.length;if(c!=u&&!s)return!1;for(var f=c;f--;){var d=a[f];if(!(s?d in e:CD.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 E=s;++f<c;){d=a[f];var _=t[d],x=e[d];if(n)var v=s?n(x,_,d,e,t,o):n(_,x,d,t,e,o);if(!(v===void 0?_===x||i(_,x,r,n,o):v)){y=!1;break}E||(E=d=="constructor")}if(y&&!E){var k=t.constructor,F=e.constructor;k!=F&&"constructor"in t&&"constructor"in e&&!(typeof k=="function"&&k instanceof k&&typeof F=="function"&&F instanceof F)&&(y=!1)}return o.delete(t),o.delete(e),y}var rb=OD;var LD=gr(bt,"DataView"),_f=LD;var DD=gr(bt,"Promise"),Ef=DD;var MD=gr(bt,"Set"),li=MD;var $D=gr(bt,"WeakMap"),vf=$D;var nb="[object Map]",FD="[object Object]",ib="[object Promise]",ob="[object Set]",sb="[object WeakMap]",ab="[object DataView]",UD=Rn(_f),BD=Rn(oi),GD=Rn(Ef),XD=Rn(li),HD=Rn(vf),so=Ar;(_f&&so(new _f(new ArrayBuffer(1)))!=ab||oi&&so(new oi)!=nb||Ef&&so(Ef.resolve())!=ib||li&&so(new li)!=ob||vf&&so(new vf)!=sb)&&(so=function(t){var e=Ar(t),r=e==FD?t.constructor:void 0,n=r?Rn(r):"";if(n)switch(n){case UD:return ab;case BD:return nb;case GD:return ib;case XD:return ob;case HD:return sb}return e});var Cc=so;var jD=1,cb="[object Arguments]",lb="[object Array]",bf="[object Object]",zD=Object.prototype,ub=zD.hasOwnProperty;function WD(t,e,r,n,i,o){var s=Ue(t),a=Ue(e),c=s?lb:Cc(t),l=a?lb:Cc(e);c=c==cb?bf:c,l=l==cb?bf:l;var u=c==bf,f=l==bf,d=c==l;if(d&&oo(t)){if(!oo(e))return!1;s=!0,u=!1}if(d&&!u)return o||(o=new hs),s||ys(t)?hf(t,e,r,n,i,o):Fv(t,e,c,r,n,i,o);if(!(r&jD)){var p=u&&ub.call(t,"__wrapped__"),m=f&&ub.call(e,"__wrapped__");if(p||m){var y=p?t.value():t,E=m?e.value():e;return o||(o=new hs),i(y,E,r,n,o)}}return d?(o||(o=new hs),rb(t,e,r,n,i,o)):!1}var fb=WD;function db(t,e,r,n,i){return t===e?!0:t==null||e==null||!Ir(t)&&!Ir(e)?t!==t&&e!==e:fb(t,e,r,n,db,i)}var wf=db;var qD=1,VD=2;function YD(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 hs;if(n)var d=n(l,u,c,t,e,f);if(!(d===void 0?wf(u,l,qD|VD,n,f):d))return!1}}return!0}var pb=YD;function KD(t){return t===t&&!us(t)}var Rf=KD;function ZD(t){for(var e=xs(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,Rf(i)]}return e}var hb=ZD;function JD(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var Sf=JD;function QD(t){var e=hb(t);return e.length==1&&e[0][2]?Sf(e[0][0],e[0][1]):function(r){return r===t||pb(r,t,e)}}var mb=QD;var eM="[object Symbol]";function tM(t){return typeof t=="symbol"||Ir(t)&&Ar(t)==eM}var ui=tM;var rM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nM=/^\w*$/;function iM(t,e){if(Ue(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||ui(t)?!0:nM.test(t)||!rM.test(t)||e!=null&&t in Object(e)}var Ts=iM;var oM="Expected a function";function Gm(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(oM);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(Gm.Cache||io),r}Gm.Cache=io;var gb=Gm;var sM=500;function aM(t){var e=gb(t,function(n){return r.size===sM&&r.clear(),n}),r=e.cache;return e}var yb=aM;var cM=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,lM=/\\(\\)?/g,uM=yb(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(cM,function(r,n,i,o){e.push(i?o.replace(lM,"$1"):n||r)}),e}),xb=uM;var fM=1/0,Tb=jt?jt.prototype:void 0,_b=Tb?Tb.toString:void 0;function Eb(t){if(typeof t=="string")return t;if(Ue(t))return sf(t,Eb)+"";if(ui(t))return _b?_b.call(t):"";var e=t+"";return e=="0"&&1/t==-fM?"-0":e}var vb=Eb;function dM(t){return t==null?"":vb(t)}var bb=dM;function pM(t,e){return Ue(t)?t:Ts(t,e)?[t]:xb(bb(t))}var Af=pM;var hM=1/0;function mM(t){if(typeof t=="string"||ui(t))return t;var e=t+"";return e=="0"&&1/t==-hM?"-0":e}var fi=mM;function gM(t,e){e=Af(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[fi(e[r++])];return r&&r==n?t:void 0}var If=gM;function yM(t,e,r){var n=t==null?void 0:If(t,e);return n===void 0?r:n}var wb=yM;function xM(t,e){return t!=null&&e in Object(t)}var Rb=xM;function TM(t,e,r){e=Af(e,t);for(var n=-1,i=e.length,o=!1;++n<i;){var s=fi(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&&gs(i)&&yf(s,i)&&(Ue(t)||ai(t)))}var Sb=TM;function _M(t,e){return t!=null&&Sb(t,e,Rb)}var Ab=_M;var EM=1,vM=2;function bM(t,e){return Ts(t)&&Rf(e)?Sf(fi(t),e):function(r){var n=wb(r,t);return n===void 0&&n===e?Ab(r,t):wf(e,n,EM|vM)}}var Ib=bM;function wM(t){return t}var _s=wM;function RM(t){return function(e){return e?.[t]}}var kb=RM;function SM(t){return function(e){return If(e,t)}}var Nb=SM;function AM(t){return Ts(t)?kb(fi(t)):Nb(t)}var Pb=AM;function IM(t){return typeof t=="function"?t:t==null?_s:typeof t=="object"?Ue(t)?Ib(t[0],t[1]):mb(t):Pb(t)}var di=IM;function kM(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 Cb=kM;var NM=Cb(),Ob=NM;function PM(t,e){return t&&Ob(t,e,xs)}var Lb=PM;function CM(t,e){return function(r,n){if(r==null)return r;if(!ci(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 Db=CM;var OM=Db(Lb),pi=OM;function LM(t,e){var r=-1,n=ci(t)?Array(t.length):[];return pi(t,function(i,o,s){n[++r]=e(i,o,s)}),n}var Mb=LM;function DM(t,e){var r=Ue(t)?sf:Mb;return r(t,di(e,3))}var ir=DM;function MM(t,e){var r=[];return pi(t,function(n,i,o){e(n,i,o)&&r.push(n)}),r}var $b=MM;function $M(t,e){var r=Ue(t)?gf:$b;return r(t,di(e,3))}var Fb=$M;function ao(t,e,r){return`${t.name}_${e}_${r}`}var hi=1,FM=2,Ub=4,Bb=5;var co=7,UM=8,BM=9,GM=10,XM=11,Gb=12,Oc=class{constructor(e){this.target=e}isEpsilon(){return!1}},Es=class extends Oc{constructor(e,r){super(e),this.tokenType=r}},Lc=class extends Oc{constructor(e){super(e)}isEpsilon(){return!0}},vs=class extends Oc{constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}};function Xb(t){let e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};HM(e,t);let r=t.length;for(let n=0;n<r;n++){let i=t[n],o=lo(e,i,i);o!==void 0&&e$(e,i,o)}return e}function HM(t,e){let r=e.length;for(let n=0;n<r;n++){let i=e[n],o=wt(t,i,void 0,{type:FM}),s=wt(t,i,void 0,{type:co});o.stop=s,t.ruleToStartState.set(i,o),t.ruleToStopState.set(i,s)}}function Hb(t,e,r){return r instanceof me?Xm(t,e,r.terminalType,r):r instanceof De?QM(t,e,r):r instanceof ze?VM(t,e,r):r instanceof Me?YM(t,e,r):r instanceof ve?jM(t,e,r):r instanceof je?zM(t,e,r):r instanceof Ve?WM(t,e,r):r instanceof Ye?qM(t,e,r):lo(t,e,r)}function jM(t,e,r){let n=wt(t,e,r,{type:Bb});mi(t,n);let i=bs(t,e,n,r,lo(t,e,r));return zb(t,e,r,i)}function zM(t,e,r){let n=wt(t,e,r,{type:Bb});mi(t,n);let i=bs(t,e,n,r,lo(t,e,r)),o=Xm(t,e,r.separator,r);return zb(t,e,r,i,o)}function WM(t,e,r){let n=wt(t,e,r,{type:Ub});mi(t,n);let i=bs(t,e,n,r,lo(t,e,r));return jb(t,e,r,i)}function qM(t,e,r){let n=wt(t,e,r,{type:Ub});mi(t,n);let i=bs(t,e,n,r,lo(t,e,r)),o=Xm(t,e,r.separator,r);return jb(t,e,r,i,o)}function VM(t,e,r){let n=wt(t,e,r,{type:hi});mi(t,n);let i=ir(r.definition,s=>Hb(t,e,s));return bs(t,e,n,r,...i)}function YM(t,e,r){let n=wt(t,e,r,{type:hi});mi(t,n);let i=bs(t,e,n,r,lo(t,e,r));return KM(t,e,r,i)}function lo(t,e,r){let n=Fb(ir(r.definition,i=>Hb(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:JM(t,n)}function jb(t,e,r,n,i){let o=n.left,s=n.right,a=wt(t,e,r,{type:XM});mi(t,a);let c=wt(t,e,r,{type:Gb});return o.loopback=a,c.loopback=a,t.decisionMap[ao(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=a,xt(s,a),i===void 0?(xt(a,o),xt(a,c)):(xt(a,c),xt(a,i.left),xt(i.right,o)),{left:o,right:c}}function zb(t,e,r,n,i){let o=n.left,s=n.right,a=wt(t,e,r,{type:GM});mi(t,a);let c=wt(t,e,r,{type:Gb}),l=wt(t,e,r,{type:BM});return a.loopback=l,c.loopback=l,xt(a,o),xt(a,c),xt(s,l),i!==void 0?(xt(l,c),xt(l,i.left),xt(i.right,o)):xt(l,a),t.decisionMap[ao(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=a,{left:a,right:c}}function KM(t,e,r,n){let i=n.left,o=n.right;return xt(i,o),t.decisionMap[ao(e,"Option",r.idx)]=i,n}function mi(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function bs(t,e,r,n,...i){let o=wt(t,e,n,{type:UM,start:r});r.end=o;for(let a of i)a!==void 0?(xt(r,a.left),xt(a.right,o)):xt(r,o);let s={left:r,right:o};return t.decisionMap[ao(e,ZM(n),n.idx)]=r,s}function ZM(t){if(t instanceof ze)return"Alternation";if(t instanceof Me)return"Option";if(t instanceof ve)return"Repetition";if(t instanceof je)return"RepetitionWithSeparator";if(t instanceof Ve)return"RepetitionMandatory";if(t instanceof Ye)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function JM(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 vs,l=a,u=e[o+1].left;s.left.type===hi&&s.right.type===hi&&a!==void 0&&(c&&l.followState===s.right||a.target===s.right)?(c?l.followState=u:a.target=u,t$(t,s.right)):xt(s.right,u)}let n=e[0],i=e[r-1];return{left:n.left,right:i.right}}function Xm(t,e,r,n){let i=wt(t,e,n,{type:hi}),o=wt(t,e,n,{type:hi});return Hm(i,new Es(o,r)),{left:i,right:o}}function QM(t,e,r){let n=r.referencedRule,i=t.ruleToStartState.get(n),o=wt(t,e,r,{type:hi}),s=wt(t,e,r,{type:hi}),a=new vs(i,n,s);return Hm(o,a),{left:o,right:s}}function e$(t,e,r){let n=t.ruleToStartState.get(e);xt(n,r.left);let i=t.ruleToStopState.get(e);return xt(r.right,i),{left:n,right:i}}function xt(t,e){let r=new Lc(e);Hm(t,r)}function wt(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 Hm(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function t$(t,e){t.states.splice(t.states.indexOf(e),1)}var Dc={},ws=class{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){let r=jm(e);r in this.map||(this.map[r]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return ir(this.configs,e=>e.alt)}get key(){let e="";for(let r in this.map)e+=r+":";return e}};function jm(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}function r$(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&&!ui(s):r(s,a)))var a=s,c=o}return c}var Wb=r$;function n$(t,e){return t<e}var qb=n$;function i$(t){return t&&t.length?Wb(t,_s,qb):void 0}var Vb=i$;var Yb=jt?jt.isConcatSpreadable:void 0;function o$(t){return Ue(t)||ai(t)||!!(Yb&&t&&t[Yb])}var Kb=o$;function Zb(t,e,r,n,i){var o=-1,s=t.length;for(r||(r=Kb),i||(i=[]);++o<s;){var a=t[o];e>0&&r(a)?e>1?Zb(a,e-1,r,n,i):mf(i,a):n||(i[i.length]=a)}return i}var kf=Zb;function s$(t,e){return kf(ir(t,e),1)}var Jb=s$;function a$(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 Qb=a$;function c$(t){return t!==t}var ew=c$;function l$(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}var tw=l$;function u$(t,e,r){return e===e?tw(t,e,r):Qb(t,ew,r)}var rw=u$;function f$(t,e){var r=t==null?0:t.length;return!!r&&rw(t,e,0)>-1}var nw=f$;function d$(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 iw=d$;function p$(){}var ow=p$;var h$=1/0,m$=li&&1/ms(new li([,-0]))[1]==h$?function(t){return new li(t)}:ow,sw=m$;var g$=200;function y$(t,e,r){var n=-1,i=nw,o=t.length,s=!0,a=[],c=a;if(r)s=!1,i=iw;else if(o>=g$){var l=e?null:sw(t);if(l)return ms(l);s=!1,i=pf,c=new df}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 aw=y$;function x$(t,e){return t&&t.length?aw(t,di(e,2)):[]}var cw=x$;function T$(t){var e=t==null?0:t.length;return e?kf(t,1):[]}var lw=T$;function _$(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var uw=_$;function E$(t){return typeof t=="function"?t:_s}var fw=E$;function v$(t,e){var r=Ue(t)?uw:pi;return r(t,fw(e))}var Nf=v$;var b$="[object Map]",w$="[object Set]",R$=Object.prototype,S$=R$.hasOwnProperty;function A$(t){if(t==null)return!0;if(ci(t)&&(Ue(t)||typeof t=="string"||typeof t.splice=="function"||oo(t)||ys(t)||ai(t)))return!t.length;var e=Cc(t);if(e==b$||e==w$)return!t.size;if(xf(t))return!Tf(t).length;for(var r in t)if(S$.call(t,r))return!1;return!0}var dw=A$;function I$(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 pw=I$;function k$(t,e,r,n,i){return i(t,function(o,s,a){r=n?(n=!1,o):e(r,o,s,a)}),r}var hw=k$;function N$(t,e,r){var n=Ue(t)?pw:hw,i=arguments.length<3;return n(t,di(e,4),r,i,pi)}var zm=N$;function P$(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 Pf=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}},mw=new Pf,Mc=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=Xb(e.rules),this.dfas=C$(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=ao(n,"Alternation",r),f=this.atn.decisionMap[l].decision,d=ir(Uu({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),p=>ir(p,m=>m[0]));if(gw(d,!1)&&!o){let p=zm(d,(m,y,E)=>(Nf(y,_=>{_&&(m[_.tokenTypeIdx]=E,Nf(_.categoryMatches,x=>{m[x]=E}))}),m),{});return i?function(m){var y;let E=this.LA_FAST(1),_=p[E.tokenTypeIdx];if(m!==void 0&&_!==void 0){let x=(y=m[_])===null||y===void 0?void 0:y.GATE;if(x!==void 0&&x.call(this)===!1)return}return _}:function(){let m=this.LA_FAST(1);return p[m.tokenTypeIdx]}}else return i?function(p){let m=new Pf,y=p===void 0?0:p.length;for(let _=0;_<y;_++){let x=p?.[_].GATE;m.set(_,x===void 0||x.call(this))}let E=Wm.call(this,s,f,m,a,c);return typeof E=="number"?E:void 0}:function(){let p=Wm.call(this,s,f,mw,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=ao(n,i,r),f=this.atn.decisionMap[l].decision,d=ir(Uu({maxLookahead:1,occurrence:r,prodType:i,rule:n}),p=>ir(p,m=>m[0]));if(gw(d)&&d[0][0]&&!o){let p=d[0],m=lw(p);if(m.length===1&&dw(m[0].categoryMatches)){let E=m[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===E}}else{let y=zm(m,(E,_)=>(_!==void 0&&(E[_.tokenTypeIdx]=!0,Nf(_.categoryMatches,x=>{E[x]=!0})),E),{});return function(){let E=this.LA_FAST(1);return y[E.tokenTypeIdx]===!0}}}return function(){let p=Wm.call(this,s,f,mw,a,c);return typeof p=="object"?!1:p===0}}};function gw(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 C$(t){let e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=P$(t.decisionStates[n],n);return r}function Wm(t,e,r,n,i){let o=t[e](r),s=o.start;if(s===void 0){let c=H$(o.atnStartState);s=Tw(o,xw(c)),o.start=s}return O$.apply(this,[o,s,r,n,i])}function O$(t,e,r,n,i){let o=e,s=1,a=[],c=this.LA_FAST(s++);for(;;){let l=U$(o,c);if(l===void 0&&(l=L$.apply(this,[t,o,c,s,r,n])),l===Dc)return F$(a,o,c);if(l.isAcceptState===!0){if(i===!0&&ns(c,Xt)){let u=Z$(o,r);if(u!==void 0)return u}return l.prediction}o=l,a.push(c),c=this.LA(s++)}}function L$(t,e,r,n,i,o){let s=B$(e.configs,r,i);if(s.size===0)return yw(t,e,r,Dc),Dc;let a=xw(s),c=X$(s,i);if(c!==void 0)a.isAcceptState=!0,a.prediction=c,a.configs.uniqueAlt=c;else if(q$(s)){let l=Vb(s.alts);a.isAcceptState=!0,a.prediction=l,a.configs.uniqueAlt=l,D$.apply(this,[t,n,s.alts,o])}return a=yw(t,e,r,a),a}function D$(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=M$({topLevelRule:s,ambiguityIndices:r,production:a,prefixPath:i});n(c)}function M$(t){let e=ir(t.prefixPath,i=>_n(i)).join(", "),r=t.production.idx===0?"":t.production.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${$$(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,
124
+ For further details.`);this.skipValidations=Object.hasOwn(r,"skipValidations")?r.skipValidations:Xt.skipValidations}};kc.DEFER_DEFINITION_ERRORS_HANDLING=!1;sv(kc,[Vu,Ku,ef,tf,nf,rf,of,sf,lf]);var Nc=class extends kc{constructor(e,r=Xt){let n=Object.assign({},r);n.outputCst=!1,super(e,n)}};function DO(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 ff=DO;function MO(){this.__data__=[],this.size=0}var av=MO;function $O(t,e){return t===e||t!==t&&e!==e}var df=$O;function FO(t,e){for(var r=t.length;r--;)if(df(t[r][0],e))return r;return-1}var ni=FO;var UO=Array.prototype,BO=UO.splice;function GO(t){var e=this.__data__,r=ni(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():BO.call(e,r,1),--this.size,!0}var cv=GO;function HO(t){var e=this.__data__,r=ni(e,t);return r<0?void 0:e[r][1]}var lv=HO;function XO(t){return ni(this.__data__,t)>-1}var uv=XO;function jO(t,e){var r=this.__data__,n=ni(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var fv=jO;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=av;fs.prototype.delete=cv;fs.prototype.get=lv;fs.prototype.has=uv;fs.prototype.set=fv;var ii=fs;function zO(){this.__data__=new ii,this.size=0}var dv=zO;function WO(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var pv=WO;function qO(t){return this.__data__.get(t)}var hv=qO;function VO(t){return this.__data__.has(t)}var mv=VO;var YO=typeof global=="object"&&global&&global.Object===Object&&global,pf=YO;var KO=typeof self=="object"&&self&&self.Object===Object&&self,ZO=pf||KO||Function("return this")(),vt=ZO;var JO=vt.Symbol,jt=JO;var gv=Object.prototype,QO=gv.hasOwnProperty,e1=gv.toString,Pc=jt?jt.toStringTag:void 0;function t1(t){var e=QO.call(t,Pc),r=t[Pc];try{t[Pc]=void 0;var n=!0}catch{}var i=e1.call(t);return n&&(e?t[Pc]=r:delete t[Pc]),i}var yv=t1;var r1=Object.prototype,n1=r1.toString;function i1(t){return n1.call(t)}var xv=i1;var o1="[object Null]",s1="[object Undefined]",Tv=jt?jt.toStringTag:void 0;function a1(t){return t==null?t===void 0?s1:o1:Tv&&Tv in Object(t)?yv(t):xv(t)}var Ar=a1;function c1(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var ds=c1;var l1="[object AsyncFunction]",u1="[object Function]",f1="[object GeneratorFunction]",d1="[object Proxy]";function p1(t){if(!ds(t))return!1;var e=Ar(t);return e==u1||e==f1||e==l1||e==d1}var hf=p1;var h1=vt["__core-js_shared__"],mf=h1;var _v=(function(){var t=/[^.]+$/.exec(mf&&mf.keys&&mf.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function m1(t){return!!_v&&_v in t}var Ev=m1;var g1=Function.prototype,y1=g1.toString;function x1(t){if(t!=null){try{return y1.call(t)}catch{}try{return t+""}catch{}}return""}var Rn=x1;var T1=/[\\^$.*+?()[\]{}|]/g,_1=/^\[object .+?Constructor\]$/,E1=Function.prototype,v1=Object.prototype,b1=E1.toString,w1=v1.hasOwnProperty,R1=RegExp("^"+b1.call(w1).replace(T1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function S1(t){if(!ds(t)||Ev(t))return!1;var e=hf(t)?R1:_1;return e.test(Rn(t))}var vv=S1;function A1(t,e){return t?.[e]}var bv=A1;function I1(t,e){var r=bv(t,e);return vv(r)?r:void 0}var gr=I1;var k1=gr(vt,"Map"),oi=k1;var N1=gr(Object,"create"),Sn=N1;function P1(){this.__data__=Sn?Sn(null):{},this.size=0}var wv=P1;function C1(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Rv=C1;var O1="__lodash_hash_undefined__",L1=Object.prototype,D1=L1.hasOwnProperty;function M1(t){var e=this.__data__;if(Sn){var r=e[t];return r===O1?void 0:r}return D1.call(e,t)?e[t]:void 0}var Sv=M1;var $1=Object.prototype,F1=$1.hasOwnProperty;function U1(t){var e=this.__data__;return Sn?e[t]!==void 0:F1.call(e,t)}var Av=U1;var B1="__lodash_hash_undefined__";function G1(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Sn&&e===void 0?B1:e,this}var Iv=G1;function ps(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])}}ps.prototype.clear=wv;ps.prototype.delete=Rv;ps.prototype.get=Sv;ps.prototype.has=Av;ps.prototype.set=Iv;var Fm=ps;function H1(){this.size=0,this.__data__={hash:new Fm,map:new(oi||ii),string:new Fm}}var kv=H1;function X1(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Nv=X1;function j1(t,e){var r=t.__data__;return Nv(e)?r[typeof e=="string"?"string":"hash"]:r.map}var si=j1;function z1(t){var e=si(this,t).delete(t);return this.size-=e?1:0,e}var Pv=z1;function W1(t){return si(this,t).get(t)}var Cv=W1;function q1(t){return si(this,t).has(t)}var Ov=q1;function V1(t,e){var r=si(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var Lv=V1;function hs(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])}}hs.prototype.clear=kv;hs.prototype.delete=Pv;hs.prototype.get=Cv;hs.prototype.has=Ov;hs.prototype.set=Lv;var so=hs;var Y1=200;function K1(t,e){var r=this.__data__;if(r instanceof ii){var n=r.__data__;if(!oi||n.length<Y1-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new so(n)}return r.set(t,e),this.size=r.size,this}var Dv=K1;function ms(t){var e=this.__data__=new ii(t);this.size=e.size}ms.prototype.clear=dv;ms.prototype.delete=pv;ms.prototype.get=hv;ms.prototype.has=mv;ms.prototype.set=Dv;var gs=ms;var Z1="__lodash_hash_undefined__";function J1(t){return this.__data__.set(t,Z1),this}var Mv=J1;function Q1(t){return this.__data__.has(t)}var $v=Q1;function gf(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new so;++e<r;)this.add(t[e])}gf.prototype.add=gf.prototype.push=Mv;gf.prototype.has=$v;var yf=gf;function eL(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 Fv=eL;function tL(t,e){return t.has(e)}var xf=tL;var rL=1,nL=2;function iL(t,e,r,n,i,o){var s=r&rL,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&nL?new yf:void 0;for(o.set(t,e),o.set(e,t);++f<a;){var m=t[f],y=e[f];if(n)var E=s?n(y,m,f,e,t,o):n(m,y,f,t,e,o);if(E!==void 0){if(E)continue;d=!1;break}if(p){if(!Fv(e,function(_,x){if(!xf(p,x)&&(m===_||i(m,_,r,n,o)))return p.push(x)})){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 Tf=iL;var oL=vt.Uint8Array,Um=oL;function sL(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}var Uv=sL;function aL(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var ys=aL;var cL=1,lL=2,uL="[object Boolean]",fL="[object Date]",dL="[object Error]",pL="[object Map]",hL="[object Number]",mL="[object RegExp]",gL="[object Set]",yL="[object String]",xL="[object Symbol]",TL="[object ArrayBuffer]",_L="[object DataView]",Bv=jt?jt.prototype:void 0,Bm=Bv?Bv.valueOf:void 0;function EL(t,e,r,n,i,o,s){switch(r){case _L:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case TL:return!(t.byteLength!=e.byteLength||!o(new Um(t),new Um(e)));case uL:case fL:case hL:return df(+t,+e);case dL:return t.name==e.name&&t.message==e.message;case mL:case yL:return t==e+"";case pL:var a=Uv;case gL:var c=n&cL;if(a||(a=ys),t.size!=e.size&&!c)return!1;var l=s.get(t);if(l)return l==e;n|=lL,s.set(t,e);var u=Tf(a(t),a(e),n,i,o,s);return s.delete(t),u;case xL:if(Bm)return Bm.call(t)==Bm.call(e)}return!1}var Gv=EL;function vL(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var _f=vL;var bL=Array.isArray,Ue=bL;function wL(t,e,r){var n=e(t);return Ue(t)?n:_f(n,r(t))}var Hv=wL;function RL(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 Ef=RL;function SL(){return[]}var Xv=SL;var AL=Object.prototype,IL=AL.propertyIsEnumerable,jv=Object.getOwnPropertySymbols,kL=jv?function(t){return t==null?[]:(t=Object(t),Ef(jv(t),function(e){return IL.call(t,e)}))}:Xv,zv=kL;function NL(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Wv=NL;function PL(t){return t!=null&&typeof t=="object"}var Ir=PL;var CL="[object Arguments]";function OL(t){return Ir(t)&&Ar(t)==CL}var Gm=OL;var qv=Object.prototype,LL=qv.hasOwnProperty,DL=qv.propertyIsEnumerable,ML=Gm((function(){return arguments})())?Gm:function(t){return Ir(t)&&LL.call(t,"callee")&&!DL.call(t,"callee")},ai=ML;function $L(){return!1}var Vv=$L;var Zv=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Yv=Zv&&typeof module=="object"&&module&&!module.nodeType&&module,FL=Yv&&Yv.exports===Zv,Kv=FL?vt.Buffer:void 0,UL=Kv?Kv.isBuffer:void 0,BL=UL||Vv,ao=BL;var GL=9007199254740991,HL=/^(?:0|[1-9]\d*)$/;function XL(t,e){var r=typeof t;return e=e??GL,!!e&&(r=="number"||r!="symbol"&&HL.test(t))&&t>-1&&t%1==0&&t<e}var vf=XL;var jL=9007199254740991;function zL(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=jL}var xs=zL;var WL="[object Arguments]",qL="[object Array]",VL="[object Boolean]",YL="[object Date]",KL="[object Error]",ZL="[object Function]",JL="[object Map]",QL="[object Number]",eD="[object Object]",tD="[object RegExp]",rD="[object Set]",nD="[object String]",iD="[object WeakMap]",oD="[object ArrayBuffer]",sD="[object DataView]",aD="[object Float32Array]",cD="[object Float64Array]",lD="[object Int8Array]",uD="[object Int16Array]",fD="[object Int32Array]",dD="[object Uint8Array]",pD="[object Uint8ClampedArray]",hD="[object Uint16Array]",mD="[object Uint32Array]",Qe={};Qe[aD]=Qe[cD]=Qe[lD]=Qe[uD]=Qe[fD]=Qe[dD]=Qe[pD]=Qe[hD]=Qe[mD]=!0;Qe[WL]=Qe[qL]=Qe[oD]=Qe[VL]=Qe[sD]=Qe[YL]=Qe[KL]=Qe[ZL]=Qe[JL]=Qe[QL]=Qe[eD]=Qe[tD]=Qe[rD]=Qe[nD]=Qe[iD]=!1;function gD(t){return Ir(t)&&xs(t.length)&&!!Qe[Ar(t)]}var Jv=gD;function yD(t){return function(e){return t(e)}}var Qv=yD;var eb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Cc=eb&&typeof module=="object"&&module&&!module.nodeType&&module,xD=Cc&&Cc.exports===eb,Hm=xD&&pf.process,TD=(function(){try{var t=Cc&&Cc.require&&Cc.require("util").types;return t||Hm&&Hm.binding&&Hm.binding("util")}catch{}})(),Xm=TD;var tb=Xm&&Xm.isTypedArray,_D=tb?Qv(tb):Jv,Ts=_D;var ED=Object.prototype,vD=ED.hasOwnProperty;function bD(t,e){var r=Ue(t),n=!r&&ai(t),i=!r&&!n&&ao(t),o=!r&&!n&&!i&&Ts(t),s=r||n||i||o,a=s?Wv(t.length,String):[],c=a.length;for(var l in t)(e||vD.call(t,l))&&!(s&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||vf(l,c)))&&a.push(l);return a}var rb=bD;var wD=Object.prototype;function RD(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||wD;return t===r}var bf=RD;function SD(t,e){return function(r){return t(e(r))}}var nb=SD;var AD=nb(Object.keys,Object),ib=AD;var ID=Object.prototype,kD=ID.hasOwnProperty;function ND(t){if(!bf(t))return ib(t);var e=[];for(var r in Object(t))kD.call(t,r)&&r!="constructor"&&e.push(r);return e}var wf=ND;function PD(t){return t!=null&&xs(t.length)&&!hf(t)}var ci=PD;function CD(t){return ci(t)?rb(t):wf(t)}var _s=CD;function OD(t){return Hv(t,_s,zv)}var jm=OD;var LD=1,DD=Object.prototype,MD=DD.hasOwnProperty;function $D(t,e,r,n,i,o){var s=r&LD,a=jm(t),c=a.length,l=jm(e),u=l.length;if(c!=u&&!s)return!1;for(var f=c;f--;){var d=a[f];if(!(s?d in e:MD.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 E=s;++f<c;){d=a[f];var _=t[d],x=e[d];if(n)var v=s?n(x,_,d,e,t,o):n(_,x,d,t,e,o);if(!(v===void 0?_===x||i(_,x,r,n,o):v)){y=!1;break}E||(E=d=="constructor")}if(y&&!E){var A=t.constructor,F=e.constructor;A!=F&&"constructor"in t&&"constructor"in e&&!(typeof A=="function"&&A instanceof A&&typeof F=="function"&&F instanceof F)&&(y=!1)}return o.delete(t),o.delete(e),y}var ob=$D;var FD=gr(vt,"DataView"),Rf=FD;var UD=gr(vt,"Promise"),Sf=UD;var BD=gr(vt,"Set"),li=BD;var GD=gr(vt,"WeakMap"),Af=GD;var sb="[object Map]",HD="[object Object]",ab="[object Promise]",cb="[object Set]",lb="[object WeakMap]",ub="[object DataView]",XD=Rn(Rf),jD=Rn(oi),zD=Rn(Sf),WD=Rn(li),qD=Rn(Af),co=Ar;(Rf&&co(new Rf(new ArrayBuffer(1)))!=ub||oi&&co(new oi)!=sb||Sf&&co(Sf.resolve())!=ab||li&&co(new li)!=cb||Af&&co(new Af)!=lb)&&(co=function(t){var e=Ar(t),r=e==HD?t.constructor:void 0,n=r?Rn(r):"";if(n)switch(n){case XD:return ub;case jD:return sb;case zD:return ab;case WD:return cb;case qD:return lb}return e});var Oc=co;var VD=1,fb="[object Arguments]",db="[object Array]",If="[object Object]",YD=Object.prototype,pb=YD.hasOwnProperty;function KD(t,e,r,n,i,o){var s=Ue(t),a=Ue(e),c=s?db:Oc(t),l=a?db:Oc(e);c=c==fb?If:c,l=l==fb?If:l;var u=c==If,f=l==If,d=c==l;if(d&&ao(t)){if(!ao(e))return!1;s=!0,u=!1}if(d&&!u)return o||(o=new gs),s||Ts(t)?Tf(t,e,r,n,i,o):Gv(t,e,c,r,n,i,o);if(!(r&VD)){var p=u&&pb.call(t,"__wrapped__"),m=f&&pb.call(e,"__wrapped__");if(p||m){var y=p?t.value():t,E=m?e.value():e;return o||(o=new gs),i(y,E,r,n,o)}}return d?(o||(o=new gs),ob(t,e,r,n,i,o)):!1}var hb=KD;function mb(t,e,r,n,i){return t===e?!0:t==null||e==null||!Ir(t)&&!Ir(e)?t!==t&&e!==e:hb(t,e,r,n,mb,i)}var kf=mb;var ZD=1,JD=2;function QD(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?kf(u,l,ZD|JD,n,f):d))return!1}}return!0}var gb=QD;function eM(t){return t===t&&!ds(t)}var Nf=eM;function tM(t){for(var e=_s(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,Nf(i)]}return e}var yb=tM;function rM(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var Pf=rM;function nM(t){var e=yb(t);return e.length==1&&e[0][2]?Pf(e[0][0],e[0][1]):function(r){return r===t||gb(r,t,e)}}var xb=nM;var iM="[object Symbol]";function oM(t){return typeof t=="symbol"||Ir(t)&&Ar(t)==iM}var ui=oM;var sM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,aM=/^\w*$/;function cM(t,e){if(Ue(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||ui(t)?!0:aM.test(t)||!sM.test(t)||e!=null&&t in Object(e)}var Es=cM;var lM="Expected a function";function zm(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(lM);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(zm.Cache||so),r}zm.Cache=so;var Tb=zm;var uM=500;function fM(t){var e=Tb(t,function(n){return r.size===uM&&r.clear(),n}),r=e.cache;return e}var _b=fM;var dM=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pM=/\\(\\)?/g,hM=_b(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(dM,function(r,n,i,o){e.push(i?o.replace(pM,"$1"):n||r)}),e}),Eb=hM;var mM=1/0,vb=jt?jt.prototype:void 0,bb=vb?vb.toString:void 0;function wb(t){if(typeof t=="string")return t;if(Ue(t))return ff(t,wb)+"";if(ui(t))return bb?bb.call(t):"";var e=t+"";return e=="0"&&1/t==-mM?"-0":e}var Rb=wb;function gM(t){return t==null?"":Rb(t)}var Sb=gM;function yM(t,e){return Ue(t)?t:Es(t,e)?[t]:Eb(Sb(t))}var Cf=yM;var xM=1/0;function TM(t){if(typeof t=="string"||ui(t))return t;var e=t+"";return e=="0"&&1/t==-xM?"-0":e}var fi=TM;function _M(t,e){e=Cf(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[fi(e[r++])];return r&&r==n?t:void 0}var Of=_M;function EM(t,e,r){var n=t==null?void 0:Of(t,e);return n===void 0?r:n}var Ab=EM;function vM(t,e){return t!=null&&e in Object(t)}var Ib=vM;function bM(t,e,r){e=Cf(e,t);for(var n=-1,i=e.length,o=!1;++n<i;){var s=fi(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&&xs(i)&&vf(s,i)&&(Ue(t)||ai(t)))}var kb=bM;function wM(t,e){return t!=null&&kb(t,e,Ib)}var Nb=wM;var RM=1,SM=2;function AM(t,e){return Es(t)&&Nf(e)?Pf(fi(t),e):function(r){var n=Ab(r,t);return n===void 0&&n===e?Nb(r,t):kf(e,n,RM|SM)}}var Pb=AM;function IM(t){return t}var vs=IM;function kM(t){return function(e){return e?.[t]}}var Cb=kM;function NM(t){return function(e){return Of(e,t)}}var Ob=NM;function PM(t){return Es(t)?Cb(fi(t)):Ob(t)}var Lb=PM;function CM(t){return typeof t=="function"?t:t==null?vs:typeof t=="object"?Ue(t)?Pb(t[0],t[1]):xb(t):Lb(t)}var di=CM;function OM(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 Db=OM;var LM=Db(),Mb=LM;function DM(t,e){return t&&Mb(t,e,_s)}var $b=DM;function MM(t,e){return function(r,n){if(r==null)return r;if(!ci(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 Fb=MM;var $M=Fb($b),pi=$M;function FM(t,e){var r=-1,n=ci(t)?Array(t.length):[];return pi(t,function(i,o,s){n[++r]=e(i,o,s)}),n}var Ub=FM;function UM(t,e){var r=Ue(t)?ff:Ub;return r(t,di(e,3))}var ir=UM;function BM(t,e){var r=[];return pi(t,function(n,i,o){e(n,i,o)&&r.push(n)}),r}var Bb=BM;function GM(t,e){var r=Ue(t)?Ef:Bb;return r(t,di(e,3))}var Gb=GM;function fo(t,e,r){return`${t.name}_${e}_${r}`}var hi=1,HM=2,Hb=4,Xb=5;var mi=7,XM=8,jM=9,zM=10,WM=11,jb=12,Lc=class{constructor(e){this.target=e}isEpsilon(){return!1}},lo=class extends Lc{constructor(e,r){super(e),this.tokenType=r}},Dc=class extends Lc{constructor(e){super(e)}isEpsilon(){return!0}},uo=class extends Lc{constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}};function zb(t){let e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};qM(e,t);let r=t.length;for(let n=0;n<r;n++){let i=t[n],o=po(e,i,i);o!==void 0&&i$(e,i,o)}return e}function qM(t,e){let r=e.length;for(let n=0;n<r;n++){let i=e[n],o=bt(t,i,void 0,{type:HM}),s=bt(t,i,void 0,{type:mi});o.stop=s,t.ruleToStartState.set(i,o),t.ruleToStopState.set(i,s)}}function Wb(t,e,r){return r instanceof he?Wm(t,e,r.terminalType,r):r instanceof De?n$(t,e,r):r instanceof ze?JM(t,e,r):r instanceof Me?QM(t,e,r):r instanceof be?VM(t,e,r):r instanceof je?YM(t,e,r):r instanceof Ve?KM(t,e,r):r instanceof Ye?ZM(t,e,r):po(t,e,r)}function VM(t,e,r){let n=bt(t,e,r,{type:Xb});gi(t,n);let i=bs(t,e,n,r,po(t,e,r));return Vb(t,e,r,i)}function YM(t,e,r){let n=bt(t,e,r,{type:Xb});gi(t,n);let i=bs(t,e,n,r,po(t,e,r)),o=Wm(t,e,r.separator,r);return Vb(t,e,r,i,o)}function KM(t,e,r){let n=bt(t,e,r,{type:Hb});gi(t,n);let i=bs(t,e,n,r,po(t,e,r));return qb(t,e,r,i)}function ZM(t,e,r){let n=bt(t,e,r,{type:Hb});gi(t,n);let i=bs(t,e,n,r,po(t,e,r)),o=Wm(t,e,r.separator,r);return qb(t,e,r,i,o)}function JM(t,e,r){let n=bt(t,e,r,{type:hi});gi(t,n);let i=ir(r.definition,s=>Wb(t,e,s));return bs(t,e,n,r,...i)}function QM(t,e,r){let n=bt(t,e,r,{type:hi});gi(t,n);let i=bs(t,e,n,r,po(t,e,r));return e$(t,e,r,i)}function po(t,e,r){let n=Gb(ir(r.definition,i=>Wb(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:r$(t,n)}function qb(t,e,r,n,i){let o=n.left,s=n.right,a=bt(t,e,r,{type:WM});gi(t,a);let c=bt(t,e,r,{type:jb});return o.loopback=a,c.loopback=a,t.decisionMap[fo(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=a,xt(s,a),i===void 0?(xt(a,o),xt(a,c)):(xt(a,c),xt(a,i.left),xt(i.right,o)),{left:o,right:c}}function Vb(t,e,r,n,i){let o=n.left,s=n.right,a=bt(t,e,r,{type:zM});gi(t,a);let c=bt(t,e,r,{type:jb}),l=bt(t,e,r,{type:jM});return a.loopback=l,c.loopback=l,xt(a,o),xt(a,c),xt(s,l),i!==void 0?(xt(l,c),xt(l,i.left),xt(i.right,o)):xt(l,a),t.decisionMap[fo(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=a,{left:a,right:c}}function e$(t,e,r,n){let i=n.left,o=n.right;return xt(i,o),t.decisionMap[fo(e,"Option",r.idx)]=i,n}function gi(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function bs(t,e,r,n,...i){let o=bt(t,e,n,{type:XM,start:r});r.end=o;for(let a of i)a!==void 0?(xt(r,a.left),xt(a.right,o)):xt(r,o);let s={left:r,right:o};return t.decisionMap[fo(e,t$(n),n.idx)]=r,s}function t$(t){if(t instanceof ze)return"Alternation";if(t instanceof Me)return"Option";if(t instanceof be)return"Repetition";if(t instanceof je)return"RepetitionWithSeparator";if(t instanceof Ve)return"RepetitionMandatory";if(t instanceof Ye)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function r$(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 uo,l=a,u=e[o+1].left;s.left.type===hi&&s.right.type===hi&&a!==void 0&&(c&&l.followState===s.right||a.target===s.right)?(c?l.followState=u:a.target=u,o$(t,s.right)):xt(s.right,u)}let n=e[0],i=e[r-1];return{left:n.left,right:i.right}}function Wm(t,e,r,n){let i=bt(t,e,n,{type:hi}),o=bt(t,e,n,{type:hi});return qm(i,new lo(o,r)),{left:i,right:o}}function n$(t,e,r){let n=r.referencedRule,i=t.ruleToStartState.get(n),o=bt(t,e,r,{type:hi}),s=bt(t,e,r,{type:hi}),a=new uo(i,n,s);return qm(o,a),{left:o,right:s}}function i$(t,e,r){let n=t.ruleToStartState.get(e);xt(n,r.left);let i=t.ruleToStopState.get(e);return xt(r.right,i),{left:n,right:i}}function xt(t,e){let r=new Dc(e);qm(t,r)}function bt(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 qm(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function o$(t,e){t.states.splice(t.states.indexOf(e),1)}var Mc={},ws=class{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){let r=Vm(e);r in this.map||(this.map[r]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return ir(this.configs,e=>e.alt)}get key(){let e="";for(let r in this.map)e+=r+":";return e}};function Vm(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}function s$(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&&!ui(s):r(s,a)))var a=s,c=o}return c}var Yb=s$;function a$(t,e){return t<e}var Kb=a$;function c$(t){return t&&t.length?Yb(t,vs,Kb):void 0}var Zb=c$;var Jb=jt?jt.isConcatSpreadable:void 0;function l$(t){return Ue(t)||ai(t)||!!(Jb&&t&&t[Jb])}var Qb=l$;function ew(t,e,r,n,i){var o=-1,s=t.length;for(r||(r=Qb),i||(i=[]);++o<s;){var a=t[o];e>0&&r(a)?e>1?ew(a,e-1,r,n,i):_f(i,a):n||(i[i.length]=a)}return i}var Lf=ew;function u$(t,e){return Lf(ir(t,e),1)}var tw=u$;function f$(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 rw=f$;function d$(t){return t!==t}var nw=d$;function p$(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}var iw=p$;function h$(t,e,r){return e===e?iw(t,e,r):rw(t,nw,r)}var ow=h$;function m$(t,e){var r=t==null?0:t.length;return!!r&&ow(t,e,0)>-1}var sw=m$;function g$(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 aw=g$;function y$(){}var cw=y$;var x$=1/0,T$=li&&1/ys(new li([,-0]))[1]==x$?function(t){return new li(t)}:cw,lw=T$;var _$=200;function E$(t,e,r){var n=-1,i=sw,o=t.length,s=!0,a=[],c=a;if(r)s=!1,i=aw;else if(o>=_$){var l=e?null:lw(t);if(l)return ys(l);s=!1,i=xf,c=new yf}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 uw=E$;function v$(t,e){return t&&t.length?uw(t,di(e,2)):[]}var fw=v$;function b$(t){var e=t==null?0:t.length;return e?Lf(t,1):[]}var dw=b$;function w$(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var pw=w$;function R$(t){return typeof t=="function"?t:vs}var hw=R$;function S$(t,e){var r=Ue(t)?pw:pi;return r(t,hw(e))}var Df=S$;var A$="[object Map]",I$="[object Set]",k$=Object.prototype,N$=k$.hasOwnProperty;function P$(t){if(t==null)return!0;if(ci(t)&&(Ue(t)||typeof t=="string"||typeof t.splice=="function"||ao(t)||Ts(t)||ai(t)))return!t.length;var e=Oc(t);if(e==A$||e==I$)return!t.size;if(bf(t))return!wf(t).length;for(var r in t)if(N$.call(t,r))return!1;return!0}var mw=P$;function C$(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 gw=C$;function O$(t,e,r,n,i){return i(t,function(o,s,a){r=n?(n=!1,o):e(r,o,s,a)}),r}var yw=O$;function L$(t,e,r){var n=Ue(t)?gw:yw,i=arguments.length<3;return n(t,di(e,4),r,i,pi)}var Ym=L$;function D$(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 Mf=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}},xw=new Mf,$c=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=zb(e.rules),this.dfas=F$(this.atn),this.callers=M$(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=fo(n,"Alternation",r),f=this.atn.decisionMap[l].decision,d=ir(zu({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),p=>ir(p,m=>m[0]));if(Tw(d,!1)&&!o){let p=Ym(d,(m,y,E)=>(Df(y,_=>{_&&(m[_.tokenTypeIdx]=E,Df(_.categoryMatches,x=>{m[x]=E}))}),m),{});return i?function(m){var y;let E=this.LA_FAST(1),_=p[E.tokenTypeIdx];if(m!==void 0&&_!==void 0){let x=(y=m[_])===null||y===void 0?void 0:y.GATE;if(x!==void 0&&x.call(this)===!1)return}return _}:function(){let m=this.LA_FAST(1);return p[m.tokenTypeIdx]}}else return i?function(p){let m=new Mf,y=p===void 0?0:p.length;for(let _=0;_<y;_++){let x=p?.[_].GATE;m.set(_,x===void 0||x.call(this))}let E=Km.call(this,s,f,m,a,c);return typeof E=="number"?E:void 0}:function(){let p=Km.call(this,s,f,xw,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=this.callers,u=fo(n,i,r),f=this.atn.decisionMap[u],d=f.decision,p=ir(zu({maxLookahead:1,occurrence:r,prodType:i,rule:n}),m=>ir(m,y=>y[0]));if(Tw(p)&&p[0][0]&&!o&&!$$(f,i,l)){let m=p[0],y=dw(m);if(y.length===1&&mw(y[0].categoryMatches)){let _=y[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===_}}else{let E=Ym(y,(_,x)=>(x!==void 0&&(_[x.tokenTypeIdx]=!0,Df(x.categoryMatches,v=>{_[v]=!0})),_),{});return function(){let _=this.LA_FAST(1);return E[_.tokenTypeIdx]===!0}}}return function(){let m=Km.call(this,s,d,xw,a,c);return typeof m=="object"?!1:m===0}}};function Tw(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 M$(t){let e=new Map;for(let r of t.states)for(let n of r.transitions)if(n instanceof uo){let i=e.get(n.rule);i===void 0&&(i=[],e.set(n.rule,i)),i.push(n.followState)}return e}function _w(t,e){let r=new Set,n=new Set,i=[t];for(;i.length>0;){let o=i.shift();if(!n.has(o)){if(n.add(o),o.type===mi){if(e!==void 0){let s=e.get(o.rule);s!==void 0&&i.push(...s)}continue}for(let s of o.transitions)if(s instanceof lo){r.add(s.tokenType.tokenTypeIdx);for(let a of s.tokenType.categoryMatches)r.add(a)}else i.push(s.target)}}return r}function $$(t,e,r){let n=e==="RepetitionMandatoryWithSeparator",i=t.transitions[n?1:0],o=t.transitions[n?0:1];if(i===void 0||o===void 0)return!1;let s=_w(i.target),a=_w(o.target,r);for(let c of s)if(a.has(c))return!0;return!1}function F$(t){let e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=D$(t.decisionStates[n],n);return r}function Km(t,e,r,n,i){let o=t[e](r),s=o.start;if(s===void 0){let c=Y$(o.atnStartState);s=bw(o,vw(c)),o.start=s}return U$.apply(this,[o,s,r,n,i])}function U$(t,e,r,n,i){let o=e,s=1,a=[],c=this.LA_FAST(s++);for(;;){let l=z$(o,c);if(l===void 0&&(l=B$.apply(this,[t,o,c,s,r,n])),l===Mc)return j$(a,o,c);if(l.isAcceptState===!0){if(i===!0&&os(c,Ht)){let u=nF(o,r);if(u!==void 0)return u}return l.prediction}o=l,a.push(c),c=this.LA(s++)}}function B$(t,e,r,n,i,o){let s=W$(e.configs,r,i);if(s.size===0)return Ew(t,e,r,Mc),Mc;let a=vw(s),c=V$(s,i);if(c!==void 0)a.isAcceptState=!0,a.prediction=c,a.configs.uniqueAlt=c;else if(Q$(s)){let l=Zb(s.alts);a.isAcceptState=!0,a.prediction=l,a.configs.uniqueAlt=l,G$.apply(this,[t,n,s.alts,o])}return a=Ew(t,e,r,a),a}function G$(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=H$({topLevelRule:s,ambiguityIndices:r,production:a,prefixPath:i});n(c)}function H$(t){let e=ir(t.prefixPath,i=>_n(i)).join(", "),r=t.production.idx===0?"":t.production.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${X$(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,
125
125
  <${e}> may appears as a prefix path in all these alternatives.
126
126
  `;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
127
- For Further details.`,n}function $$(t){if(t instanceof De)return"SUBRULE";if(t instanceof Me)return"OPTION";if(t instanceof ze)return"OR";if(t instanceof Ve)return"AT_LEAST_ONE";if(t instanceof Ye)return"AT_LEAST_ONE_SEP";if(t instanceof je)return"MANY_SEP";if(t instanceof ve)return"MANY";if(t instanceof me)return"CONSUME";throw Error("non exhaustive match")}function F$(t,e,r){let n=Jb(e.configs.elements,o=>o.state.transitions),i=cw(n.filter(o=>o instanceof Es).map(o=>o.tokenType),o=>o.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function U$(t,e){return t.edges[e.tokenTypeIdx]}function B$(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===co){i.push(s);continue}let a=s.state.transitions.length;for(let c=0;c<a;c++){let l=s.state.transitions[c],u=G$(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)Cf(s,o)}if(i.length>0&&!z$(o))for(let s of i)o.add(s);return o}function G$(t,e){if(t instanceof Es&&ns(e,t.tokenType))return t.target}function X$(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 xw(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function yw(t,e,r,n){return n=Tw(t,n),e.edges[r.tokenTypeIdx]=n,n}function Tw(t,e){if(e===Dc)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 H$(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:[]};Cf(o,e)}return e}function Cf(t,e){let r=t.state;if(r.type===co){if(t.stack.length>0){let i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};Cf(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=j$(t,o);s!==void 0&&Cf(s,e)}}function j$(t,e){if(e instanceof Lc)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof vs){let r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}function z$(t){for(let e of t.elements)if(e.state.type===co)return!0;return!1}function W$(t){for(let e of t.elements)if(e.state.type!==co)return!1;return!0}function q$(t){if(W$(t))return!0;let e=V$(t.elements);return Y$(e)&&!K$(e)}function V$(t){let e=new Map;for(let r of t){let n=jm(r,!1),i=e.get(n);i===void 0&&(i={},e.set(n,i)),i[r.alt]=!0}return e}function Y$(t){for(let e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function K$(t){for(let e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}function Z$(t,e){let r;for(let n of t.configs.elements)if(!(e.is(n.alt)===!1||n.state.type===co)){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}ks();var jf=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new jc(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){let r=new Ps;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){let n=new Ns(e.startOffset,e.image.length,sc(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 Ns(o.startOffset,o.image.length,sc(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)}},zf=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)}},Ns=class extends zf{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}},Ps=class extends zf{constructor(){super(...arguments),this.content=new Zg(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:Ie.create(0,0),end:Ie.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]}},Zg=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}},jc=class extends Ps{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}};var Qg=Symbol("Datatype");function Jg(t){return t.$type===Qg}var _w="\u200B",Ew=t=>t.endsWith(_w)?t:t+_w,Wf=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 ty(n,{...e.parser.ParserConfig,skipValidations:i,errorMessageProvider:e.parser.ParserErrorMessageProvider},r,e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new Yf(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()}},qf=class extends Wf{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e,!1),this.nodeBuilder=new jf,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;Ki(e)&&(i=e.name,this.registerPrecedenceMap(e));let o=this.wrapper.DEFINE_RULE(Ew(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,o),Ut(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 Ki(e)?ei(e):e.fragment?void 0:pc(e)?Qg:ei(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,au(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===Qg?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(Jg(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(Jg(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)):Jg(e)?this.converter.convert(e.value,e.$cstNode):(sE(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 E=i[y],_=r.get(E)??{precedence:1/0,rightAssoc:!1};_.precedence>s?(s=_.precedence,o=y):_.precedence===s&&(_.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=Mo(e,Yr);this.assignmentMap.set(e,{assignment:r,crossRef:r&&Kr(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}},ey=class{buildMismatchTokenMessage(e){return vn.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return vn.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return vn.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return vn.buildEarlyExitMessage(e)}},zc=class extends ey{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}\`.`}},Vf=class extends Wf{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(Ew(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}},Q$={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new zc},Yf=class extends kc{constructor(e,r,n){let i=r&&"maxLookahead"in r;super(e,{...Q$,lookaheadStrategy:i?new bn({maxLookahead:r.maxLookahead}):new Mc({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,{})}},ty=class extends Yf{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 Zf(t,e,r){return eF({parser:e,tokens:r,ruleNames:new Map},t),e}function eF(t,e){let r=fc(e,!1),n=we(e.rules).filter(Ut).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,fo(s,o.definition))}let i=we(e.rules).filter(Ki).filter(o=>r.has(o));for(let o of i)t.parser.rule(o,tF(t,o))}function tF(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=ny(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 fo(t,e,r=!1){let n;if(Rr(e))n=cF(t,e);else if(Jn(e))n=rF(t,e);else if(Yr(e))n=fo(t,e.terminal);else if(Kr(e))n=vw(t,e);else if(Zr(e))n=nF(t,e);else if(Gh(e))n=oF(t,e);else if(zh(e))n=sF(t,e);else if(Yi(e))n=aF(t,e);else if(TE(e)){let i=t.consume++;n=()=>t.parser.consume(i,Xt,e)}else throw new ac(e.$cstNode,`Unexpected element type: ${e.$type}`);return bw(t,r?void 0:Kf(e),n,e.cardinality)}function rF(t,e){let r=ei(e);return()=>t.parser.action(r,e)}function nF(t,e){let r=e.rule.ref;if(Zn(r)){let n=t.subrule++,i=Ut(r)&&r.fragment,o=e.arguments.length>0?iF(r,e.arguments):()=>({}),s;return a=>{s??(s=ny(t,r)),t.parser.subrule(n,s,i,e,o(a))}}else if(qt(r)){let n=t.consume++,i=ry(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)Qn(r);else throw new ac(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function iF(t,e){if(e.some(n=>n.calledByName)){let n=e.map(i=>({parameterName:i.parameter?.ref?.name,predicate:rn(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=>rn(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 rn(t){if(xE(t)){let e=rn(t.left),r=rn(t.right);return n=>e(n)||r(n)}else if(yE(t)){let e=rn(t.left),r=rn(t.right);return n=>e(n)&&r(n)}else if(vE(t)){let e=rn(t.value);return r=>!e(r)}else if(bE(t)){let e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(mE(t)){let e=!!t.true;return()=>e}Qn(t)}function oF(t,e){if(e.elements.length===1)return fo(t,e.elements[0]);{let r=[];for(let i of e.elements){let o={ALT:fo(t,i,!0)},s=Kf(i);s&&(o.GATE=rn(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 sF(t,e){if(e.elements.length===1)return fo(t,e.elements[0]);let r=[];for(let a of e.elements){let c={ALT:fo(t,a,!0)},l=Kf(a);l&&(c.GATE=rn(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=bw(t,Kf(e),o,"*");return a=>{s(a),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function aF(t,e){let r=e.elements.map(n=>fo(t,n));return n=>r.forEach(i=>i(n))}function Kf(t){if(Yi(t))return t.guardCondition}function vw(t,e,r=e.terminal){if(r)if(Zr(r)&&Ut(r.rule.ref)){let n=r.rule.ref,i=t.subrule++,o;return s=>{o??(o=ny(t,n)),t.parser.subrule(i,o,!1,e,s)}}else if(Zr(r)&&qt(r.rule.ref)){let n=t.consume++,i=ry(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Rr(r)){let n=t.consume++,i=ry(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=wu(e.type.ref)?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+ei(e.type.ref));return vw(t,e,i)}}function cF(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 bw(t,e,r,n){let i=e&&rn(e);if(!n)if(i){let o=t.or++;return s=>t.parser.alternatives(o,[{ALT:()=>r(s),GATE:()=>i(s)},{ALT:of(),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:of(),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 Qn(n)}function ny(t,e){let r=lF(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function lF(t,e){if(Zn(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Ut(n);)(Yi(n)||Gh(n)||zh(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 ry(t,e){let r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}function ww(t){let e=t.Grammar,r=t.parser.Lexer,n=new Vf(t);return Zf(e,n,r.definition),n.finalize(),n}function Rw(t){let e=uF(t);return e.finalize(),e}function uF(t){let e=t.Grammar,r=t.parser.Lexer,n=new qf(t);return Zf(e,n,r.definition)}var Cs=class{constructor(){this.diagnostics=[]}buildTokens(e,r){let n=we(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(qt).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){let r=Vo(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=bu(r)?ot.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(Zn).flatMap(i=>qr(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(Qi(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{let o=i?.PATTERN;return o?.source&&UE("^"+o.source+"$",e.value)&&n.push(i),n},[])}};var Os=class{convert(e,r){let n=r.grammarSource;if(Kr(n)&&(n=Jh(n)),Zr(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 In.convertInt(r);case"STRING":return In.convertString(r);case"ID":return In.convertID(r)}switch(om(e)?.toLowerCase()){case"number":return In.convertNumber(r);case"boolean":return In.convertBoolean(r);case"bigint":return In.convertBigint(r);case"date":return In.convertDate(r);default:return r}}},In;(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`
128
- `;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})(In||(In={}));var Te=Rh(wd(),1);function k2(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}var Rd=0,N2=10;function GA(){return Rd=performance.now(),new Te.CancellationTokenSource}var go=Symbol("OperationCancelled");function Ii(t){return t===go}async function pt(t){if(t===Te.CancellationToken.None)return;let e=performance.now();if(e-Rd>=N2&&(Rd=e,await k2(),Rd=performance.now()),t.isCancellationRequested)throw go}var Ai=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}};var Sd=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=jA(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=XA(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=XA(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)}getLineRange(e){let r=this.getLineOffsets();if(e>=r.length){let s=r.length-1;return{start:{line:s,character:0},end:{line:s,character:this._content.length-r[s]}}}else if(e<0)return{start:{line:0,character:0},end:{line:0,character:0}};let n=r[e],i=e+1<r.length?r[e+1]:this._content.length,o=this.ensureBeforeEOL(i,n);return{start:{line:e,character:0},end:{line:e,character:o-n}}}getEOLCharacters(e){let r=this.getLineOffsets();if(e>=r.length)return"";if(e<0)return"";let n=e+1<r.length?r[e+1]:this._content.length,i=this.ensureBeforeEOL(n,r[e]);return this._content.substring(i,n)}ensureBeforeEOL(e,r){for(;e>r&&HA(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}},nl;(function(t){function e(i,o,s,a){return new Sd(i,o,s,a)}t.create=e;function r(i,o,s){if(i instanceof Sd)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=Mx(o.map(P2),(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})(nl||(nl={}));function Mx(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);Mx(n,e),Mx(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 XA(t,e,r=0){let n=e?[r]:[];for(let i=0;i<t.length;i++){let o=t.charCodeAt(i);HA(o)&&(o===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function HA(t){return t===13||t===10}function jA(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 P2(t){let e=jA(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var zA;(()=>{"use strict";var t={975:$=>{function w(S){if(typeof S!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(S))}function D(S,A){for(var I,B="",z=0,j=-1,V=0,K=0;K<=S.length;++K){if(K<S.length)I=S.charCodeAt(K);else{if(I===47)break;I=47}if(I===47){if(!(j===K-1||V===1))if(j!==K-1&&V===2){if(B.length<2||z!==2||B.charCodeAt(B.length-1)!==46||B.charCodeAt(B.length-2)!==46){if(B.length>2){var ue=B.lastIndexOf("/");if(ue!==B.length-1){ue===-1?(B="",z=0):z=(B=B.slice(0,ue)).length-1-B.lastIndexOf("/"),j=K,V=0;continue}}else if(B.length===2||B.length===1){B="",z=0,j=K,V=0;continue}}A&&(B.length>0?B+="/..":B="..",z=2)}else B.length>0?B+="/"+S.slice(j+1,K):B=S.slice(j+1,K),z=K-j-1;j=K,V=0}else I===46&&V!==-1?++V:V=-1}return B}var U={resolve:function(){for(var S,A="",I=!1,B=arguments.length-1;B>=-1&&!I;B--){var z;B>=0?z=arguments[B]:(S===void 0&&(S=process.cwd()),z=S),w(z),z.length!==0&&(A=z+"/"+A,I=z.charCodeAt(0)===47)}return A=D(A,!I),I?A.length>0?"/"+A:"/":A.length>0?A:"."},normalize:function(S){if(w(S),S.length===0)return".";var A=S.charCodeAt(0)===47,I=S.charCodeAt(S.length-1)===47;return(S=D(S,!A)).length!==0||A||(S="."),S.length>0&&I&&(S+="/"),A?"/"+S:S},isAbsolute:function(S){return w(S),S.length>0&&S.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var S,A=0;A<arguments.length;++A){var I=arguments[A];w(I),I.length>0&&(S===void 0?S=I:S+="/"+I)}return S===void 0?".":U.normalize(S)},relative:function(S,A){if(w(S),w(A),S===A||(S=U.resolve(S))===(A=U.resolve(A)))return"";for(var I=1;I<S.length&&S.charCodeAt(I)===47;++I);for(var B=S.length,z=B-I,j=1;j<A.length&&A.charCodeAt(j)===47;++j);for(var V=A.length-j,K=z<V?z:V,ue=-1,Y=0;Y<=K;++Y){if(Y===K){if(V>K){if(A.charCodeAt(j+Y)===47)return A.slice(j+Y+1);if(Y===0)return A.slice(j+Y)}else z>K&&(S.charCodeAt(I+Y)===47?ue=Y:Y===0&&(ue=0));break}var ne=S.charCodeAt(I+Y);if(ne!==A.charCodeAt(j+Y))break;ne===47&&(ue=Y)}var Re="";for(Y=I+ue+1;Y<=B;++Y)Y!==B&&S.charCodeAt(Y)!==47||(Re.length===0?Re+="..":Re+="/..");return Re.length>0?Re+A.slice(j+ue):(j+=ue,A.charCodeAt(j)===47&&++j,A.slice(j))},_makeLong:function(S){return S},dirname:function(S){if(w(S),S.length===0)return".";for(var A=S.charCodeAt(0),I=A===47,B=-1,z=!0,j=S.length-1;j>=1;--j)if((A=S.charCodeAt(j))===47){if(!z){B=j;break}}else z=!1;return B===-1?I?"/":".":I&&B===1?"//":S.slice(0,B)},basename:function(S,A){if(A!==void 0&&typeof A!="string")throw new TypeError('"ext" argument must be a string');w(S);var I,B=0,z=-1,j=!0;if(A!==void 0&&A.length>0&&A.length<=S.length){if(A.length===S.length&&A===S)return"";var V=A.length-1,K=-1;for(I=S.length-1;I>=0;--I){var ue=S.charCodeAt(I);if(ue===47){if(!j){B=I+1;break}}else K===-1&&(j=!1,K=I+1),V>=0&&(ue===A.charCodeAt(V)?--V==-1&&(z=I):(V=-1,z=K))}return B===z?z=K:z===-1&&(z=S.length),S.slice(B,z)}for(I=S.length-1;I>=0;--I)if(S.charCodeAt(I)===47){if(!j){B=I+1;break}}else z===-1&&(j=!1,z=I+1);return z===-1?"":S.slice(B,z)},extname:function(S){w(S);for(var A=-1,I=0,B=-1,z=!0,j=0,V=S.length-1;V>=0;--V){var K=S.charCodeAt(V);if(K!==47)B===-1&&(z=!1,B=V+1),K===46?A===-1?A=V:j!==1&&(j=1):A!==-1&&(j=-1);else if(!z){I=V+1;break}}return A===-1||B===-1||j===0||j===1&&A===B-1&&A===I+1?"":S.slice(A,B)},format:function(S){if(S===null||typeof S!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof S);return(function(A,I){var B=I.dir||I.root,z=I.base||(I.name||"")+(I.ext||"");return B?B===I.root?B+z:B+"/"+z:z})(0,S)},parse:function(S){w(S);var A={root:"",dir:"",base:"",ext:"",name:""};if(S.length===0)return A;var I,B=S.charCodeAt(0),z=B===47;z?(A.root="/",I=1):I=0;for(var j=-1,V=0,K=-1,ue=!0,Y=S.length-1,ne=0;Y>=I;--Y)if((B=S.charCodeAt(Y))!==47)K===-1&&(ue=!1,K=Y+1),B===46?j===-1?j=Y:ne!==1&&(ne=1):j!==-1&&(ne=-1);else if(!ue){V=Y+1;break}return j===-1||K===-1||ne===0||ne===1&&j===K-1&&j===V+1?K!==-1&&(A.base=A.name=V===0&&z?S.slice(1,K):S.slice(V,K)):(V===0&&z?(A.name=S.slice(1,j),A.base=S.slice(1,K)):(A.name=S.slice(V,j),A.base=S.slice(V,K)),A.ext=S.slice(j,K)),V>0?A.dir=S.slice(0,V-1):z&&(A.dir="/"),A},sep:"/",delimiter:":",win32:null,posix:null};U.posix=U,$.exports=U}},e={};function r($){var w=e[$];if(w!==void 0)return w.exports;var D=e[$]={exports:{}};return t[$](D,D.exports,r),D.exports}r.d=($,w)=>{for(var D in w)r.o(w,D)&&!r.o($,D)&&Object.defineProperty($,D,{enumerable:!0,get:w[D]})},r.o=($,w)=>Object.prototype.hasOwnProperty.call($,w),r.r=$=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty($,Symbol.toStringTag,{value:"Module"}),Object.defineProperty($,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:()=>d,Utils:()=>oe}),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($,w){if(!$.scheme&&w)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${$.authority}", path: "${$.path}", query: "${$.query}", fragment: "${$.fragment}"}`);if($.scheme&&!o.test($.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if($.path){if($.authority){if(!s.test($.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($.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,D,U,S,A,I=!1){R(this,"scheme");R(this,"authority");R(this,"path");R(this,"query");R(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,z){return B||z?B:"file"})(w,I),this.authority=D||l,this.path=(function(B,z){switch(B){case"https":case"http":case"file":z?z[0]!==u&&(z=u+z):z=u}return z})(this.scheme,U||l),this.query=S||l,this.fragment=A||l,c(this,I))}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 x(this,!1)}with(w){if(!w)return this;let{scheme:D,authority:U,path:S,query:A,fragment:I}=w;return D===void 0?D=this.scheme:D===null&&(D=l),U===void 0?U=this.authority:U===null&&(U=l),S===void 0?S=this.path:S===null&&(S=l),A===void 0?A=this.query:A===null&&(A=l),I===void 0?I=this.fragment:I===null&&(I=l),D===this.scheme&&U===this.authority&&S===this.path&&A===this.query&&I===this.fragment?this:new m(D,U,S,A,I)}static parse(w,D=!1){let U=f.exec(w);return U?new m(U[2]||l,O(U[4]||l),O(U[5]||l),O(U[7]||l),O(U[9]||l),D):new m(l,l,l,l,l)}static file(w){let D=l;if(i&&(w=w.replace(/\\/g,u)),w[0]===u&&w[1]===u){let U=w.indexOf(u,2);U===-1?(D=w.substring(2),w=u):(D=w.substring(2,U),w=w.substring(U)||u)}return new m("file",D,w,l,l)}static from(w){let D=new m(w.scheme,w.authority,w.path,w.query,w.fragment);return c(D,!0),D}toString(w=!1){return v(this,w)}toJSON(){return this}static revive(w){if(w){if(w instanceof d)return w;{let D=new m(w);return D._formatted=w.external,D._fsPath=w._sep===p?w.fsPath:null,D}}return w}}let p=i?1:void 0;class m extends d{constructor(){super(...arguments);R(this,"_formatted",null);R(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=x(this,!1)),this._fsPath}toString(D=!1){return D?v(this,!0):(this._formatted||(this._formatted=v(this,!1)),this._formatted)}toJSON(){let D={$mid:1};return this._fsPath&&(D.fsPath=this._fsPath,D._sep=p),this._formatted&&(D.external=this._formatted),this.path&&(D.path=this.path),this.scheme&&(D.scheme=this.scheme),this.authority&&(D.authority=this.authority),this.query&&(D.query=this.query),this.fragment&&(D.fragment=this.fragment),D}}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 E($,w,D){let U,S=-1;for(let A=0;A<$.length;A++){let I=$.charCodeAt(A);if(I>=97&&I<=122||I>=65&&I<=90||I>=48&&I<=57||I===45||I===46||I===95||I===126||w&&I===47||D&&I===91||D&&I===93||D&&I===58)S!==-1&&(U+=encodeURIComponent($.substring(S,A)),S=-1),U!==void 0&&(U+=$.charAt(A));else{U===void 0&&(U=$.substr(0,A));let B=y[I];B!==void 0?(S!==-1&&(U+=encodeURIComponent($.substring(S,A)),S=-1),U+=B):S===-1&&(S=A)}}return S!==-1&&(U+=encodeURIComponent($.substring(S))),U!==void 0?U:$}function _($){let w;for(let D=0;D<$.length;D++){let U=$.charCodeAt(D);U===35||U===63?(w===void 0&&(w=$.substr(0,D)),w+=y[U]):w!==void 0&&(w+=$[D])}return w!==void 0?w:$}function x($,w){let D;return D=$.authority&&$.path.length>1&&$.scheme==="file"?`//${$.authority}${$.path}`:$.path.charCodeAt(0)===47&&($.path.charCodeAt(1)>=65&&$.path.charCodeAt(1)<=90||$.path.charCodeAt(1)>=97&&$.path.charCodeAt(1)<=122)&&$.path.charCodeAt(2)===58?w?$.path.substr(1):$.path[1].toLowerCase()+$.path.substr(2):$.path,i&&(D=D.replace(/\//g,"\\")),D}function v($,w){let D=w?_:E,U="",{scheme:S,authority:A,path:I,query:B,fragment:z}=$;if(S&&(U+=S,U+=":"),(A||S==="file")&&(U+=u,U+=u),A){let j=A.indexOf("@");if(j!==-1){let V=A.substr(0,j);A=A.substr(j+1),j=V.lastIndexOf(":"),j===-1?U+=D(V,!1,!1):(U+=D(V.substr(0,j),!1,!1),U+=":",U+=D(V.substr(j+1),!1,!0)),U+="@"}A=A.toLowerCase(),j=A.lastIndexOf(":"),j===-1?U+=D(A,!1,!0):(U+=D(A.substr(0,j),!1,!0),U+=A.substr(j))}if(I){if(I.length>=3&&I.charCodeAt(0)===47&&I.charCodeAt(2)===58){let j=I.charCodeAt(1);j>=65&&j<=90&&(I=`/${String.fromCharCode(j+32)}:${I.substr(3)}`)}else if(I.length>=2&&I.charCodeAt(1)===58){let j=I.charCodeAt(0);j>=65&&j<=90&&(I=`${String.fromCharCode(j+32)}:${I.substr(2)}`)}U+=D(I,!0,!1)}return B&&(U+="?",U+=D(B,!1,!1)),z&&(U+="#",U+=w?z:E(z,!1,!1)),U}function k($){try{return decodeURIComponent($)}catch{return $.length>3?$.substr(0,3)+k($.substr(3)):$}}let F=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function O($){return $.match(F)?$.replace(F,(w=>k(w))):$}var L=r(975);let G=L.posix||L,H="/";var oe;(function($){$.joinPath=function(w,...D){return w.with({path:G.join(w.path,...D)})},$.resolvePath=function(w,...D){let U=w.path,S=!1;U[0]!==H&&(U=H+U,S=!0);let A=G.resolve(U,...D);return S&&A[0]===H&&!w.authority&&(A=A.substring(1)),w.with({path:A})},$.dirname=function(w){if(w.path.length===0||w.path===H)return w;let D=G.dirname(w.path);return D.length===1&&D.charCodeAt(0)===46&&(D=""),w.with({path:D})},$.basename=function(w){return G.basename(w.path)},$.extname=function(w){return G.extname(w.path)}})(oe||(oe={})),zA=n})();var{URI:ht,Utils:Qs}=zA;var Et;(function(t){t.basename=Qs.basename,t.dirname=Qs.dirname,t.extname=Qs.extname,t.joinPath=Qs.joinPath,t.resolvePath=Qs.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"?ht.parse(s).path:s.path,l=typeof a=="string"?ht.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 ht.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})(Et||(Et={}));var Ad=class{constructor(){this.root={name:"",children:new Map}}normalizeUri(e){return Et.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:Et.joinPath(ht.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:Et.joinPath(ht.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){let r=this.getNode(Et.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 ge;(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"})(ge||(ge={}));var Id=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=Te.CancellationToken.None){let n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??ht.parse(e.uri),Te.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return Te.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:ge.Parsed,references:[],textDocument:n};else{let s=this.createTextDocumentGetter(r,i);o={parseResult:e,uri:r,state:ge.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=ge.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=nl.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},kd=class{constructor(e){this.documentTrie=new Ad,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return we(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,ge.Changed),n}deleteDocument(e){let r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=ge.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){let r=e.toString(),n=this.documentTrie.findAll(r);for(let i of n)i.state=ge.Changed;return this.documentTrie.delete(r),n}};var ea=Symbol("RefResolving"),$x=class{constructor(e,r,n,i,o){this.resolver=e,this.node=r,this.property=n,this._ref=void 0,this.$refNode=i,this.$refText=o}get ref(){return this.resolver.resolveReference(this,this.node,this.property)}get $nodeDescription(){return this._nodeDescription}get error(){return Do(this._ref)?this._ref:void 0}},Fx=class{constructor(e,r,n,i,o){this.resolver=e,this.node=r,this.property=n,this._items=void 0,this.$refNode=i,this.$refText=o}get items(){return this.resolver.resolveMultiReference(this,this.node,this.property)}get error(){return this._linkingError}},Nd=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,this.referenceResolver={resolveReference:this.resolveReference.bind(this),resolveMultiReference:this.resolveMultiReference.bind(this)}}async link(e,r=Te.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 pt(r),Hi(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 pt(r),Hi(n).forEach(i=>this.doLink(i,e))}doLink(e,r){let n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=ea;try{let i=this.getCandidate(e);if(Do(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=ea;try{let i=this.getCandidates(e),o=[];if(Do(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){return new $x(this.referenceResolver,e,r,n,i)}buildMultiReference(e,r,n,i){return new Fx(this.referenceResolver,e,r,n,i)}resolveReference(e,r,n){if(yt(e._ref))return e._ref;if(oE(e._nodeDescription)){let i=this.loadAstNode(e._nodeDescription);e._ref=i??this.createLinkingError({reference:e,container:r,property:n},e._nodeDescription)}else if(e._ref===void 0){e._ref=ea;let i=Ka(r).$document,o=this.getLinkedNode({reference:e,container:r,property:n});if(o.error&&i&&i.state<ge.ComputedScopes)return e._ref=void 0;e._ref=o.node??o.error,e._nodeDescription=o.descr,i?.references.push(e)}else e._ref===ea&&this.throwCyclicReferenceError(r,n,e.$refText);return yt(e._ref)?e._ref:void 0}resolveMultiReference(e,r,n){if(Array.isArray(e._items))return e._items;if(e._items===void 0){e._items=ea;let i=Ka(r).$document,o=this.getCandidates({reference:e,container:r,property:n}),s=[];if(Do(o))e._linkingError=o;else{for(let a of o){let c=this.loadAstNode(a);c&&s.push({ref:c,$nodeDescription:a})}s.length===0&&(e._linkingError=this.createLinkingError({reference:e,container:r,property:n}))}e._items=s,i?.references.push(e)}else e._items===ea&&this.throwCyclicReferenceError(r,n,e.$refText);return Array.isArray(e._items)?e._items:[]}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(Do(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=Ka(e.container).$document;n&&n.state<ge.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 C2(t){return typeof t.name=="string"}var Pd=class{getName(e){if(C2(e))return e.name}getNameNode(e){return dc(e.$cstNode,"name")}};var Cd=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=>Kr(r)&&r.isMulti)}findDeclarations(e){if(e){let r=im(e),n=e.astNode;if(r&&n){let i=n[r.feature];if(Pt(i)||hr(i))return Ph(i);if(Array.isArray(i)){for(let o of i)if((Pt(o)||hr(o))&&o.$refNode&&o.$refNode.offset<=e.offset&&o.$refNode.end>=e.end)return Ph(o)}}if(n){let i=this.nameProvider.getNameNode(n);if(i&&(i===e||LE(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 Hi(n))if(hr(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=>Et.equals(o.sourceUri,r.documentUri))),n.push(...i),we(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:Wo(o),local:!0})}}return n}};var Or=class{constructor(e){if(this.map=new Map,e)for(let[r,n]of e)this.add(r,n)}get size(){return ou.sum(we(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?we(r):su}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 we(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return we(this.map.keys())}values(){return we(this.map.values()).flat()}entriesGroupedByKey(){return we(this.map.entries())}},il=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 Od=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=Te.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=cu,i=Te.CancellationToken.None){let o=[];this.addExportedSymbol(e,o,r);for(let s of n(e))await pt(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=Te.CancellationToken.None){let n=e.parseResult.value,i=new Or;for(let o of qr(n))await pt(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 ol=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}};var Ld=class{constructor(e,r,n){this.elements=new Or,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?we(n).concat(this.outerScope.getElements(e)):we(n)}getAllElements(){let e=we(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}};var Dd=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")}},Ux=class extends Dd{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()}},Md=class extends Dd{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}};var $d=class extends Ux{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 Fd=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 $d(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 ol(we(e),r,n)}createScopeForNodes(e,r,n){let i=we(e).map(o=>{let s=this.nameProvider.getName(o);if(s)return this.descriptions.createDescription(o,s)}).nonNullable();return new ol(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new Ld(this.indexManager.allElements(e)))}};function qA(t){return typeof t.$comment=="string"}function WA(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}var Ud=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(Pt(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(hr(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(yt(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=em(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];WA(f)?l[u]=this.reviveReference(e,c,r,f,n):yt(f)&&this.linkNode(f,r,n,e,c,u)}else WA(l)?e[c]=this.reviveReference(e,c,r,l,n):yt(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(yt(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);yt(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):ht.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)):ht.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 Bd=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=Et.extname(e),i=Et.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 ta(t){return{code:t}}var Bx;(function(t){t.defaults=["fast","slow","built-in"],t.all=t.defaults})(Bx||(Bx={}));var Gd=class{constructor(e){this.entries=new Or,this.knownCategories=new Set(Bx.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 Qn(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(Ii(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=we(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 O2=Object.freeze({validateNode:!0,validateChildren:!0}),Xd=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=Te.CancellationToken.None){let i=e.parseResult,o=[];if(await pt(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,o,r),r.stopAfterLexingErrors&&o.some(s=>s.data?.code===Lr.LexingError)||(this.processParsingErrors(i,o,r),r.stopAfterParsingErrors&&o.some(s=>s.data?.code===Lr.ParsingError))||(this.processLinkingErrors(e,o,r),r.stopAfterLinkingErrors&&o.some(s=>s.data?.code===Lr.LinkingError))))return o;try{o.push(...await this.validateAst(i.value,r,n))}catch(s){if(Ii(s))throw s;console.error("An error occurred during validation:",s)}return await pt(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:Gx(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:D2(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=sc(i.token);if(o){let s={severity:Gx("error"),range:o,message:i.message,data:ta(Lr.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:Lr.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=Te.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=Te.CancellationToken.None){let o=this.validationRegistry.checksBefore;for(let s of o)await pt(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=Te.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 pt(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 O2}async validateAstAfter(e,r,n,i=Te.CancellationToken.None){let o=this.validationRegistry.checksAfter;for(let s of o)await pt(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:L2(n),severity:Gx(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 L2(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=dc(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=rm(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 Gx(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 D2(t){switch(t){case"error":return ta(Lr.LexingError);case"warning":return ta(Lr.LexingWarning);case"info":return ta(Lr.LexingInfo);case"hint":return ta(Lr.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var Lr;(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"})(Lr||(Lr={}));var Hd=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=Wo(this.nameProvider.getNameNode(e)??e.$cstNode));return{node:e,name:r,get nameSegment(){return a()},selectionSegment:Wo(e.$cstNode),type:e.$type,documentUri:i.uri,path:o}}},jd=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=Te.CancellationToken.None){let n=[],i=e.parseResult.value;for(let o of Wt(i))await pt(r),Hi(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=[];Pt(r)&&r.$nodeDescription?n=[r.$nodeDescription]:hr(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=Wo(r.$refNode);for(let c of n)s.push({sourceUri:i,sourcePath:o,targetUri:c.documentUri,targetPath:c.path,segment:a,local:Et.equals(c.documentUri,i)});return s}};var zd=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 Xx=Rh(wd(),1);var Wd=class{constructor(e){this._ready=new Ai,this.onConfigurationSectionUpdateEmitter=new Xx.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 na=Rh(wd(),1);var ra;(function(t){function e(r){return{dispose:async()=>await r()}}t.create=e})(ra||(ra={}));var qd=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Or,this.documentPhaseListeners=new Or,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=ge.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=Te.CancellationToken.None){for(let i of e){let o=i.uri.toString();if(i.state===ge.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(i,ge.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=ge.IndexedReferences)}}else this.buildState.delete(o)}this.currentState=ge.Changed,await this.emitUpdate(e.map(i=>i.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=Te.CancellationToken.None){this.currentState=ge.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=ge.Changed,this.langiumDocuments.addDocument(l)),this.resetToState(l,ge.Changed)}let s=we(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,ge.ComputedScopes)),await this.emitUpdate(o,i),await pt(n);let a=this.sortDocuments(this.langiumDocuments.all.filter(c=>c.state<ge.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 we(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),ra.create(()=>{let r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case ge.Changed:case ge.Parsed:this.indexManager.removeContent(e.uri);case ge.IndexedContent:e.localSymbols=void 0;case ge.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case ge.Linked:this.indexManager.removeReferences(e.uri);case ge.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case ge.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=ge.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,ge.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,ge.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,ge.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,ge.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,ge.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,ge.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 pt(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),ra.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),ra.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=Te.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(go);if(this.currentState>=e&&e>i.state)return Promise.reject(new na.ResponseError(na.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${ge[i.state]}, requiring ${ge[e]}, but workspace state is already ${ge[this.currentState]}. Returning undefined.`))}else return Promise.reject(new na.ResponseError(na.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((o,s)=>{let a=this.onDocumentPhase(e,l=>{Et.equals(l.uri,r)&&(a.dispose(),c.dispose(),o(l.uri))}),c=n.onCancellationRequested(()=>{a.dispose(),c.dispose(),s(go)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(go):new Promise((n,i)=>{let o=this.onBuildPhase(e,()=>{o.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{o.dispose(),s.dispose(),i(go)})})}async notifyDocumentPhase(e,r,n){let o=this.documentPhaseListeners.get(r).slice();for(let s of o)try{await pt(n),await s(e,n)}catch(a){if(!Ii(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 pt(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=we(a.result.validationChecks).concat(o.categories).distinct().toArray():a.result.validationChecks=[...o.categories])}getBuildOptions(e){return this.buildState.get(e.uri.toString())?.options??{}}};var Vd=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Md,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=>{Et.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),we(i)}allElements(e,r){let n=we(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=Te.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=Te.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 Yd=class{constructor(e){this.initialBuildOptions={},this._ready=new Ai,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=Te.CancellationToken.None){let n=await this.performStartup(e);await pt(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=we(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 ht.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=Et.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}};var Kd=class{buildUnexpectedCharactersMessage(e,r,n,i,o){return rs.buildUnexpectedCharactersMessage(e,r,n,i,o)}buildUnableToPopLexerModeMessage(e){return rs.buildUnableToPopLexerModeMessage(e)}},Hx={mode:"full"},ia=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=VA(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new ot(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=Hx){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(VA(e))return e;let r=YA(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}};function jx(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function YA(t){return t&&"modes"in t&&"defaultMode"in t}function VA(t){return!jx(t)&&!YA(t)}ks();function JA(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=Ie.create(0,0));let o=eI(t),s=qx(n),a=$2({lines:o,position:i,options:s});return X2({index:0,tokens:a,position:i})}function QA(t,e){let r=qx(e),n=eI(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 eI(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split($E)}var KA=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,M2=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function $2(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,G2(a)),Wx(a,c)>=a.length){if(e.length>0){let u=Ie.create(r,n);e.push({type:"break",content:"",range:xe.create(u,u)})}}else{KA.lastIndex=c;let u=KA.exec(a);if(u){let f=u[0],d=u[1],p=Ie.create(r,n+c),m=Ie.create(r,n+c+f.length);e.push({type:"tag",content:d,range:xe.create(p,m)}),c+=f.length,c=Wx(a,c)}if(c<a.length){let f=a.substring(c),d=Array.from(f.matchAll(M2));e.push(...F2(d,f,r,n+c))}}r++,n=0}return e.length>0&&e[e.length-1].type==="break"?e.slice(0,-1):e}function F2(t,e,r,n){let i=[];if(t.length===0){let o=Ie.create(r,n),s=Ie.create(r,n+e.length);i.push({type:"text",content:e,range:xe.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:xe.create(Ie.create(r,o+n),Ie.create(r,c+n))});let u=l.length+1,f=a[1];if(i.push({type:"inline-tag",content:f,range:xe.create(Ie.create(r,o+u+n),Ie.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:xe.create(Ie.create(r,o+u+n),Ie.create(r,o+u+d.length+n))})}else i.push({type:"text",content:"",range:xe.create(Ie.create(r,o+u+n),Ie.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:xe.create(Ie.create(r,o+n),Ie.create(r,o+n+s.length))})}return i}var U2=/\S/,B2=/\s*$/;function Wx(t,e){let r=t.substring(e).match(U2);return r?e+r.index:t.length}function G2(t){let e=t.match(B2);if(e&&typeof e.index=="number")return e.index}function X2(t){let e=Ie.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Zd([],xe.create(e,e));let r=[];for(;t.index<t.tokens.length;){let o=H2(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 Zd(r,xe.create(n,i))}function H2(t,e){let r=t.tokens[t.index];if(r.type==="tag")return rI(t,!1);if(r.type==="text"||r.type==="inline-tag")return tI(t);j2(r,e),t.index++}function j2(t,e){if(e){let r=new Jd("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function tI(t){let e=t.tokens[t.index],r=e,n=e,i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(z2(t)),n=e,e=t.tokens[t.index];return new al(i,xe.create(r.range.start,n.range.end))}function z2(t){return t.tokens[t.index].type==="inline-tag"?rI(t,!0):nI(t)}function rI(t,e){let r=t.tokens[t.index++],n=r.content.substring(1);if(t.tokens[t.index]?.type==="text")if(e){let o=nI(t);return new sl(n,new al([o],o.range),e,xe.create(r.range.start,o.range.end))}else{let o=tI(t);return new sl(n,o,e,xe.create(r.range.start,o.range.end))}else{let o=r.range;return new sl(n,new al([],o),e,o)}}function nI(t){let e=t.tokens[t.index++];return new Jd(e.content,e.range)}function qx(t){if(!t)return qx({start:"/**",end:"*/",line:"*"});let{start:e,end:r,line:n}=t;return{start:zx(e,!0),end:zx(r,!1),line:zx(n,!0)}}function zx(t,e){if(typeof t=="string"||typeof t=="object"){let r=typeof t=="string"?Qi(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}var Zd=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+=ZA(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+=ZA(r)+i}return r.trim()}},sl=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}
129
- ${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=W2(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}
130
- ${r}`),this.inline?`{${i}}`:i}};function W2(t,e,r){if(t==="linkplain"||t==="linkcode"||t==="link"){let n=e.indexOf(" "),i=e;if(n>0){let s=Wx(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)??q2(e,i)}}function q2(t,e){try{return ht.parse(t,!0),`[${e}](${t})`}catch{return t}}var al=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+=`
127
+ For Further details.`,n}function X$(t){if(t instanceof De)return"SUBRULE";if(t instanceof Me)return"OPTION";if(t instanceof ze)return"OR";if(t instanceof Ve)return"AT_LEAST_ONE";if(t instanceof Ye)return"AT_LEAST_ONE_SEP";if(t instanceof je)return"MANY_SEP";if(t instanceof be)return"MANY";if(t instanceof he)return"CONSUME";throw Error("non exhaustive match")}function j$(t,e,r){let n=tw(e.configs.elements,o=>o.state.transitions),i=fw(n.filter(o=>o instanceof lo).map(o=>o.tokenType),o=>o.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function z$(t,e){return t.edges[e.tokenTypeIdx]}function W$(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===mi){i.push(s);continue}let a=s.state.transitions.length;for(let c=0;c<a;c++){let l=s.state.transitions[c],u=q$(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)$f(s,o)}if(i.length>0&&!Z$(o))for(let s of i)o.add(s);return o}function q$(t,e){if(t instanceof lo&&os(e,t.tokenType))return t.target}function V$(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 vw(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function Ew(t,e,r,n){return n=bw(t,n),e.edges[r.tokenTypeIdx]=n,n}function bw(t,e){if(e===Mc)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 Y$(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:[]};$f(o,e)}return e}function $f(t,e){let r=t.state;if(r.type===mi){if(t.stack.length>0){let i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};$f(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=K$(t,o);s!==void 0&&$f(s,e)}}function K$(t,e){if(e instanceof Dc)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof uo){let r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}function Z$(t){for(let e of t.elements)if(e.state.type===mi)return!0;return!1}function J$(t){for(let e of t.elements)if(e.state.type!==mi)return!1;return!0}function Q$(t){if(J$(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=Vm(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===mi)){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}var Ss=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Uc(e),this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){let r=new As;return r.grammarSource=e,this.appendChild(this.current,r),this.nodeStack.push(r),r}buildLeafNode(e,r){let n=this.createLeafNode(e,!r);return r&&(n.grammarSource=r),this.appendChild(this.current,n),n}createLeafNode(e,r){return new Fc(e.startOffset,e.image.length,e.startLine-1,e.startColumn-1,e.endLine-1,e.endColumn,e.tokenType,r)}appendChild(e,r){r.container=e,e.content.push(r)}appendChildren(e,r){for(let n of r)n.container=e;e.content.length===0?e.content=r.slice():e.content.push(...r)}insertChildren(e,r,n){for(let i of n)i.container=e;e.content.splice(r,0,...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)r.push(this.createLeafNode(o,!0));let n=this.current,i=!1;if(n.content.length>0){this.appendChildren(n,r);return}for(;n.container;){let o=n.container.content.indexOf(n);if(o>0){this.insertChildren(n.container,o,r),i=!0;break}n=n.container}i||this.insertChildren(this.rootNode,0,r)}construct(e){let r=this.current;e.$cstNode=r;let n=this.nodeStack.pop();n&&(n.content.length===0?this.removeNode(n):n.content=n.content.slice())}},Ff=class{constructor(){this.container=void 0,this.grammarSource=void 0}get root(){let e=this;for(;e.container;)e=e.container;return e}get text(){return this.root.fullText.substring(this.offset,this.end)}},Fc=class extends Ff{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 astNode(){let e=this.container;if(!e)throw new Error("This node has no associated AST element");return e.astNode}get range(){return{start:{line:this._startLine,character:this._startColumn},end:{line:this._endLine,character:this._endColumn}}}constructor(e,r,n,i,o,s,a,c=!1){super(),this._hidden=c,this._offset=Rs(e),this._length=Rs(r),this._startLine=Rs(n),this._startColumn=Rs(i),this._endLine=Rs(o),this._endColumn=Rs(s),this._tokenType=a}};function Rs(t){return t|0}var As=class extends Ff{constructor(){super(...arguments),this.content=[],this._astNode=void 0,this._rangeCache=void 0}get astNode(){let e=this;for(;e;){if(e._astNode)return e._astNode;e=e.container}throw new Error("This node has no associated AST element")}set astNode(e){this._astNode=e}get hidden(){return!1}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._rangeCache;if(e===void 0){let r=this.firstNonHiddenNode,n=this.lastNonHiddenNode;if(r&&n){let{range:i}=r,{range:o}=n;this._rangeCache=e={start:i.start,end:o.end.line<i.start.line?i.start:o.end}}else return{start:{line:0,character:0},end:{line:0,character:0}}}return e}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]}},Uc=class extends As{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}};var Jm=Symbol("Datatype");function Zm(t){return t.$type===Jm}var ww="\u200B",Rw=t=>t.endsWith(ww)?t:t+ww,Uf=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 eg(n,{...e.parser.ParserConfig,skipValidations:i,errorMessageProvider:e.parser.ParserErrorMessageProvider},r,e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new Hf(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()}},Bf=class extends Uf{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e,!1),this.nodeBuilder=new Ss,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;Zi(e)&&(i=e.name,this.registerPrecedenceMap(e));let o=this.wrapper.DEFINE_RULE(Rw(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,o),Ut(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 Zi(e)?ei(e):e.fragment?void 0:pc(e)?Jm:ei(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,uu(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 this.linkCstNode(r),r}linkCstNode(e){pt(e)&&e.$cstNode&&(e.$cstNode.astNode=e)}startImplementation(e,r,n){return i=>{let o=!this.isRecording()&&e!==void 0;if(o){let s={$type:e};this.stack.push(s),e===Jm?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(Zm(l)){let u=i.image;Rr(n)||(u=this.converter.convert(u,s).toString()),l.value+=u}}}isValidToken(e){return!e.isInsertedInRecovery&&sc(e)}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(Zm(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);let i=this.nodeBuilder.buildCompositeNode(r);this.nodeBuilder.appendChild(i,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)):Zm(e)?this.converter.convert(e.value,e.$cstNode):(lE(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 E=i[y],_=r.get(E)??{precedence:1/0,rightAssoc:!1};_.precedence>s?(s=_.precedence,o=y):_.precedence===s&&(_.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=Uo(e,Yr);this.assignmentMap.set(e,{assignment:r,crossRef:r&&Kr(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,this.linkCstNode(a),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[n,i]of Object.entries(r)){let o=e[n];o===void 0?e[n]=i:Array.isArray(o)&&Array.isArray(i)&&(i.push(...o),e[n]=i)}return e.$cstNode=void 0,e}get definitionErrors(){return this.wrapper.definitionErrors}},Qm=class{buildMismatchTokenMessage(e){return vn.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return vn.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return vn.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return vn.buildEarlyExitMessage(e)}},Bc=class extends Qm{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}\`.`}},Gf=class extends Uf{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(Rw(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}},iF={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Bc},Hf=class extends Nc{constructor(e,r,n){let i=r&&"maxLookahead"in r;super(e,{...iF,lookaheadStrategy:i?new bn({maxLookahead:r.maxLookahead}):new $c({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,{})}},eg=class extends Hf{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 jf(t,e,r){return oF({parser:e,tokens:r,ruleNames:new Map},t),e}function oF(t,e){let r=fc(e,!1),n=Re(e.rules).filter(Ut).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,ho(s,o.definition))}let i=Re(e.rules).filter(Zi).filter(o=>r.has(o));for(let o of i)t.parser.rule(o,sF(t,o))}function sF(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=rg(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 ho(t,e,r=!1){let n;if(Rr(e))n=pF(t,e);else if(Jn(e))n=aF(t,e);else if(Yr(e))n=ho(t,e.terminal);else if(Kr(e))n=Sw(t,e);else if(Zr(e))n=cF(t,e);else if(Wh(e))n=uF(t,e);else if(Kh(e))n=fF(t,e);else if(Ki(e))n=dF(t,e);else if(vE(e)){let i=t.consume++;n=()=>t.parser.consume(i,Ht,e)}else throw new ac(e.$cstNode,`Unexpected element type: ${e.$type}`);return Aw(t,r?void 0:Xf(e),n,e.cardinality)}function aF(t,e){let r=ei(e);return()=>t.parser.action(r,e)}function cF(t,e){let r=e.rule.ref;if(Zn(r)){let n=t.subrule++,i=Ut(r)&&r.fragment,o=e.arguments.length>0?lF(r,e.arguments):()=>({}),s;return a=>{s??(s=rg(t,r)),t.parser.subrule(n,s,i,e,o(a))}}else if(qt(r)){let n=t.consume++,i=tg(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)Qn(r);else throw new ac(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function lF(t,e){if(e.some(n=>n.calledByName)){let n=e.map(i=>({parameterName:i.parameter?.ref?.name,predicate:tn(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=>tn(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 tn(t){if(EE(t)){let e=tn(t.left),r=tn(t.right);return n=>e(n)||r(n)}else if(_E(t)){let e=tn(t.left),r=tn(t.right);return n=>e(n)&&r(n)}else if(RE(t)){let e=tn(t.value);return r=>!e(r)}else if(SE(t)){let e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(xE(t)){let e=!!t.true;return()=>e}Qn(t)}function uF(t,e){if(e.elements.length===1)return ho(t,e.elements[0]);{let r=[];for(let i of e.elements){let o={ALT:ho(t,i,!0)},s=Xf(i);s&&(o.GATE=tn(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 fF(t,e){if(e.elements.length===1)return ho(t,e.elements[0]);let r=[];for(let a of e.elements){let c={ALT:ho(t,a,!0)},l=Xf(a);l&&(c.GATE=tn(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=Aw(t,Xf(e),o,"*");return a=>{s(a),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function dF(t,e){let r=e.elements.map(n=>ho(t,n));return n=>r.forEach(i=>i(n))}function Xf(t){if(Ki(t))return t.guardCondition}function Sw(t,e,r=e.terminal){if(r)if(Zr(r)&&Ut(r.rule.ref)){let n=r.rule.ref,i=t.subrule++,o;return s=>{o??(o=rg(t,n)),t.parser.subrule(i,o,!1,e,s)}}else if(Zr(r)&&qt(r.rule.ref)){let n=t.consume++,i=tg(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Rr(r)){let n=t.consume++,i=tg(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=Au(e.type.ref)?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+ei(e.type.ref));return Sw(t,e,i)}}function pF(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 Aw(t,e,r,n){let i=e&&tn(e);if(!n)if(i){let o=t.or++;return s=>t.parser.alternatives(o,[{ALT:()=>r(s),GATE:()=>i(s)},{ALT:uf(),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:uf(),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 Qn(n)}function rg(t,e){let r=hF(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function hF(t,e){if(Zn(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Ut(n);)(Ki(n)||Wh(n)||Kh(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 tg(t,e){let r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}function Iw(t){let e=t.Grammar,r=t.parser.Lexer,n=new Gf(t);return jf(e,n,r.definition),n.finalize(),n}function kw(t){let e=mF(t);return e.finalize(),e}function mF(t){let e=t.Grammar,r=t.parser.Lexer,n=new Bf(t);return jf(e,n,r.definition)}var Is=class{constructor(){this.diagnostics=[]}buildTokens(e,r){let n=Re(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(qt).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){let r=Zo(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=Su(r)?ot.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(Zn).flatMap(i=>qr(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(eo(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{let o=i?.PATTERN;return o?.source&&XE("^"+o.source+"$",e.value)&&n.push(i),n},[])}};var ks=class{convert(e,r){let n=r.grammarSource;if(Kr(n)&&(n=nm(n)),Zr(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 An.convertInt(r);case"STRING":return An.convertString(r);case"ID":return An.convertID(r)}switch(um(e)?.toLowerCase()){case"number":return An.convertNumber(r);case"boolean":return An.convertBoolean(r);case"bigint":return An.convertBigint(r);case"date":return An.convertDate(r);default:return r}}},An;(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`
128
+ `;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})(An||(An={}));var _e=Nh(Id(),1);function D2(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}var kd=0,M2=10;function zA(){return kd=performance.now(),new _e.CancellationTokenSource}var To=Symbol("OperationCancelled");function ki(t){return t===To}async function mt(t){if(t===_e.CancellationToken.None)return;let e=performance.now();if(e-kd>=M2&&(kd=e,await D2(),kd=performance.now()),t.isCancellationRequested)throw To}var Ii=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}};var Nd=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=VA(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=WA(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=WA(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)}getLineRange(e){let r=this.getLineOffsets();if(e>=r.length){let s=r.length-1;return{start:{line:s,character:0},end:{line:s,character:this._content.length-r[s]}}}else if(e<0)return{start:{line:0,character:0},end:{line:0,character:0}};let n=r[e],i=e+1<r.length?r[e+1]:this._content.length,o=this.ensureBeforeEOL(i,n);return{start:{line:e,character:0},end:{line:e,character:o-n}}}getEOLCharacters(e){let r=this.getLineOffsets();if(e>=r.length)return"";if(e<0)return"";let n=e+1<r.length?r[e+1]:this._content.length,i=this.ensureBeforeEOL(n,r[e]);return this._content.substring(i,n)}ensureBeforeEOL(e,r){for(;e>r&&qA(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}},sl;(function(t){function e(i,o,s,a){return new Nd(i,o,s,a)}t.create=e;function r(i,o,s){if(i instanceof Nd)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=Ux(o.map($2),(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})(sl||(sl={}));function Ux(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);Ux(n,e),Ux(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 WA(t,e,r=0){let n=e?[r]:[];for(let i=0;i<t.length;i++){let o=t.charCodeAt(i);qA(o)&&(o===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function qA(t){return t===13||t===10}function VA(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 $2(t){let e=VA(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var YA;(()=>{"use strict";var t={975:D=>{function w(S){if(typeof S!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(S))}function M(S,I){for(var k,B="",W=0,z=-1,Y=0,K=0;K<=S.length;++K){if(K<S.length)k=S.charCodeAt(K);else{if(k===47)break;k=47}if(k===47){if(!(z===K-1||Y===1))if(z!==K-1&&Y===2){if(B.length<2||W!==2||B.charCodeAt(B.length-1)!==46||B.charCodeAt(B.length-2)!==46){if(B.length>2){var ue=B.lastIndexOf("/");if(ue!==B.length-1){ue===-1?(B="",W=0):W=(B=B.slice(0,ue)).length-1-B.lastIndexOf("/"),z=K,Y=0;continue}}else if(B.length===2||B.length===1){B="",W=0,z=K,Y=0;continue}}I&&(B.length>0?B+="/..":B="..",W=2)}else B.length>0?B+="/"+S.slice(z+1,K):B=S.slice(z+1,K),W=K-z-1;z=K,Y=0}else k===46&&Y!==-1?++Y:Y=-1}return B}var U={resolve:function(){for(var S,I="",k=!1,B=arguments.length-1;B>=-1&&!k;B--){var W;B>=0?W=arguments[B]:(S===void 0&&(S=process.cwd()),W=S),w(W),W.length!==0&&(I=W+"/"+I,k=W.charCodeAt(0)===47)}return I=M(I,!k),k?I.length>0?"/"+I:"/":I.length>0?I:"."},normalize:function(S){if(w(S),S.length===0)return".";var I=S.charCodeAt(0)===47,k=S.charCodeAt(S.length-1)===47;return(S=M(S,!I)).length!==0||I||(S="."),S.length>0&&k&&(S+="/"),I?"/"+S:S},isAbsolute:function(S){return w(S),S.length>0&&S.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var S,I=0;I<arguments.length;++I){var k=arguments[I];w(k),k.length>0&&(S===void 0?S=k:S+="/"+k)}return S===void 0?".":U.normalize(S)},relative:function(S,I){if(w(S),w(I),S===I||(S=U.resolve(S))===(I=U.resolve(I)))return"";for(var k=1;k<S.length&&S.charCodeAt(k)===47;++k);for(var B=S.length,W=B-k,z=1;z<I.length&&I.charCodeAt(z)===47;++z);for(var Y=I.length-z,K=W<Y?W:Y,ue=-1,V=0;V<=K;++V){if(V===K){if(Y>K){if(I.charCodeAt(z+V)===47)return I.slice(z+V+1);if(V===0)return I.slice(z+V)}else W>K&&(S.charCodeAt(k+V)===47?ue=V:V===0&&(ue=0));break}var re=S.charCodeAt(k+V);if(re!==I.charCodeAt(z+V))break;re===47&&(ue=V)}var Se="";for(V=k+ue+1;V<=B;++V)V!==B&&S.charCodeAt(V)!==47||(Se.length===0?Se+="..":Se+="/..");return Se.length>0?Se+I.slice(z+ue):(z+=ue,I.charCodeAt(z)===47&&++z,I.slice(z))},_makeLong:function(S){return S},dirname:function(S){if(w(S),S.length===0)return".";for(var I=S.charCodeAt(0),k=I===47,B=-1,W=!0,z=S.length-1;z>=1;--z)if((I=S.charCodeAt(z))===47){if(!W){B=z;break}}else W=!1;return B===-1?k?"/":".":k&&B===1?"//":S.slice(0,B)},basename:function(S,I){if(I!==void 0&&typeof I!="string")throw new TypeError('"ext" argument must be a string');w(S);var k,B=0,W=-1,z=!0;if(I!==void 0&&I.length>0&&I.length<=S.length){if(I.length===S.length&&I===S)return"";var Y=I.length-1,K=-1;for(k=S.length-1;k>=0;--k){var ue=S.charCodeAt(k);if(ue===47){if(!z){B=k+1;break}}else K===-1&&(z=!1,K=k+1),Y>=0&&(ue===I.charCodeAt(Y)?--Y==-1&&(W=k):(Y=-1,W=K))}return B===W?W=K:W===-1&&(W=S.length),S.slice(B,W)}for(k=S.length-1;k>=0;--k)if(S.charCodeAt(k)===47){if(!z){B=k+1;break}}else W===-1&&(z=!1,W=k+1);return W===-1?"":S.slice(B,W)},extname:function(S){w(S);for(var I=-1,k=0,B=-1,W=!0,z=0,Y=S.length-1;Y>=0;--Y){var K=S.charCodeAt(Y);if(K!==47)B===-1&&(W=!1,B=Y+1),K===46?I===-1?I=Y:z!==1&&(z=1):I!==-1&&(z=-1);else if(!W){k=Y+1;break}}return I===-1||B===-1||z===0||z===1&&I===B-1&&I===k+1?"":S.slice(I,B)},format:function(S){if(S===null||typeof S!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof S);return(function(I,k){var B=k.dir||k.root,W=k.base||(k.name||"")+(k.ext||"");return B?B===k.root?B+W:B+"/"+W:W})(0,S)},parse:function(S){w(S);var I={root:"",dir:"",base:"",ext:"",name:""};if(S.length===0)return I;var k,B=S.charCodeAt(0),W=B===47;W?(I.root="/",k=1):k=0;for(var z=-1,Y=0,K=-1,ue=!0,V=S.length-1,re=0;V>=k;--V)if((B=S.charCodeAt(V))!==47)K===-1&&(ue=!1,K=V+1),B===46?z===-1?z=V:re!==1&&(re=1):z!==-1&&(re=-1);else if(!ue){Y=V+1;break}return z===-1||K===-1||re===0||re===1&&z===K-1&&z===Y+1?K!==-1&&(I.base=I.name=Y===0&&W?S.slice(1,K):S.slice(Y,K)):(Y===0&&W?(I.name=S.slice(1,z),I.base=S.slice(1,K)):(I.name=S.slice(Y,z),I.base=S.slice(Y,K)),I.ext=S.slice(z,K)),Y>0?I.dir=S.slice(0,Y-1):W&&(I.dir="/"),I},sep:"/",delimiter:":",win32:null,posix:null};U.posix=U,D.exports=U}},e={};function r(D){var w=e[D];if(w!==void 0)return w.exports;var M=e[D]={exports:{}};return t[D](M,M.exports,r),M.exports}r.d=(D,w)=>{for(var M in w)r.o(w,M)&&!r.o(D,M)&&Object.defineProperty(D,M,{enumerable:!0,get:w[M]})},r.o=(D,w)=>Object.prototype.hasOwnProperty.call(D,w),r.r=D=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(D,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(D,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:()=>d,Utils:()=>oe}),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(D,w){if(!D.scheme&&w)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${D.authority}", path: "${D.path}", query: "${D.query}", fragment: "${D.fragment}"}`);if(D.scheme&&!o.test(D.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(D.path){if(D.authority){if(!s.test(D.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(D.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,M,U,S,I,k=!1){R(this,"scheme");R(this,"authority");R(this,"path");R(this,"query");R(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,W){return B||W?B:"file"})(w,k),this.authority=M||l,this.path=(function(B,W){switch(B){case"https":case"http":case"file":W?W[0]!==u&&(W=u+W):W=u}return W})(this.scheme,U||l),this.query=S||l,this.fragment=I||l,c(this,k))}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 x(this,!1)}with(w){if(!w)return this;let{scheme:M,authority:U,path:S,query:I,fragment:k}=w;return M===void 0?M=this.scheme:M===null&&(M=l),U===void 0?U=this.authority:U===null&&(U=l),S===void 0?S=this.path:S===null&&(S=l),I===void 0?I=this.query:I===null&&(I=l),k===void 0?k=this.fragment:k===null&&(k=l),M===this.scheme&&U===this.authority&&S===this.path&&I===this.query&&k===this.fragment?this:new m(M,U,S,I,k)}static parse(w,M=!1){let U=f.exec(w);return U?new m(U[2]||l,O(U[4]||l),O(U[5]||l),O(U[7]||l),O(U[9]||l),M):new m(l,l,l,l,l)}static file(w){let M=l;if(i&&(w=w.replace(/\\/g,u)),w[0]===u&&w[1]===u){let U=w.indexOf(u,2);U===-1?(M=w.substring(2),w=u):(M=w.substring(2,U),w=w.substring(U)||u)}return new m("file",M,w,l,l)}static from(w){let M=new m(w.scheme,w.authority,w.path,w.query,w.fragment);return c(M,!0),M}toString(w=!1){return v(this,w)}toJSON(){return this}static revive(w){if(w){if(w instanceof d)return w;{let M=new m(w);return M._formatted=w.external,M._fsPath=w._sep===p?w.fsPath:null,M}}return w}}let p=i?1:void 0;class m extends d{constructor(){super(...arguments);R(this,"_formatted",null);R(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=x(this,!1)),this._fsPath}toString(M=!1){return M?v(this,!0):(this._formatted||(this._formatted=v(this,!1)),this._formatted)}toJSON(){let M={$mid:1};return this._fsPath&&(M.fsPath=this._fsPath,M._sep=p),this._formatted&&(M.external=this._formatted),this.path&&(M.path=this.path),this.scheme&&(M.scheme=this.scheme),this.authority&&(M.authority=this.authority),this.query&&(M.query=this.query),this.fragment&&(M.fragment=this.fragment),M}}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 E(D,w,M){let U,S=-1;for(let I=0;I<D.length;I++){let k=D.charCodeAt(I);if(k>=97&&k<=122||k>=65&&k<=90||k>=48&&k<=57||k===45||k===46||k===95||k===126||w&&k===47||M&&k===91||M&&k===93||M&&k===58)S!==-1&&(U+=encodeURIComponent(D.substring(S,I)),S=-1),U!==void 0&&(U+=D.charAt(I));else{U===void 0&&(U=D.substr(0,I));let B=y[k];B!==void 0?(S!==-1&&(U+=encodeURIComponent(D.substring(S,I)),S=-1),U+=B):S===-1&&(S=I)}}return S!==-1&&(U+=encodeURIComponent(D.substring(S))),U!==void 0?U:D}function _(D){let w;for(let M=0;M<D.length;M++){let U=D.charCodeAt(M);U===35||U===63?(w===void 0&&(w=D.substr(0,M)),w+=y[U]):w!==void 0&&(w+=D[M])}return w!==void 0?w:D}function x(D,w){let M;return M=D.authority&&D.path.length>1&&D.scheme==="file"?`//${D.authority}${D.path}`:D.path.charCodeAt(0)===47&&(D.path.charCodeAt(1)>=65&&D.path.charCodeAt(1)<=90||D.path.charCodeAt(1)>=97&&D.path.charCodeAt(1)<=122)&&D.path.charCodeAt(2)===58?w?D.path.substr(1):D.path[1].toLowerCase()+D.path.substr(2):D.path,i&&(M=M.replace(/\//g,"\\")),M}function v(D,w){let M=w?_:E,U="",{scheme:S,authority:I,path:k,query:B,fragment:W}=D;if(S&&(U+=S,U+=":"),(I||S==="file")&&(U+=u,U+=u),I){let z=I.indexOf("@");if(z!==-1){let Y=I.substr(0,z);I=I.substr(z+1),z=Y.lastIndexOf(":"),z===-1?U+=M(Y,!1,!1):(U+=M(Y.substr(0,z),!1,!1),U+=":",U+=M(Y.substr(z+1),!1,!0)),U+="@"}I=I.toLowerCase(),z=I.lastIndexOf(":"),z===-1?U+=M(I,!1,!0):(U+=M(I.substr(0,z),!1,!0),U+=I.substr(z))}if(k){if(k.length>=3&&k.charCodeAt(0)===47&&k.charCodeAt(2)===58){let z=k.charCodeAt(1);z>=65&&z<=90&&(k=`/${String.fromCharCode(z+32)}:${k.substr(3)}`)}else if(k.length>=2&&k.charCodeAt(1)===58){let z=k.charCodeAt(0);z>=65&&z<=90&&(k=`${String.fromCharCode(z+32)}:${k.substr(2)}`)}U+=M(k,!0,!1)}return B&&(U+="?",U+=M(B,!1,!1)),W&&(U+="#",U+=w?W:E(W,!1,!1)),U}function A(D){try{return decodeURIComponent(D)}catch{return D.length>3?D.substr(0,3)+A(D.substr(3)):D}}let F=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function O(D){return D.match(F)?D.replace(F,(w=>A(w))):D}var L=r(975);let G=L.posix||L,X="/";var oe;(function(D){D.joinPath=function(w,...M){return w.with({path:G.join(w.path,...M)})},D.resolvePath=function(w,...M){let U=w.path,S=!1;U[0]!==X&&(U=X+U,S=!0);let I=G.resolve(U,...M);return S&&I[0]===X&&!w.authority&&(I=I.substring(1)),w.with({path:I})},D.dirname=function(w){if(w.path.length===0||w.path===X)return w;let M=G.dirname(w.path);return M.length===1&&M.charCodeAt(0)===46&&(M=""),w.with({path:M})},D.basename=function(w){return G.basename(w.path)},D.extname=function(w){return G.extname(w.path)}})(oe||(oe={})),YA=n})();var{URI:ut,Utils:Qs}=YA;var It;(function(t){t.basename=Qs.basename,t.dirname=Qs.dirname,t.extname=Qs.extname,t.joinPath=Qs.joinPath,t.resolvePath=Qs.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"?ut.parse(s).path:s.path,l=typeof a=="string"?ut.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 ut.parse(s.toString()).toString()}t.normalize=i;function o(s,a){let c=typeof s=="string"?ut.parse(s):s,l=typeof a=="string"?ut.parse(a):a;if(c.scheme!==l.scheme)return!1;let u=c.path,f=l.path;return f.charAt(f.length-1)==="/"&&(f=f.slice(0,-1)),u.charAt(u.length-1)==="/"&&(u=u.slice(0,-1)),f===u?!0:f.length<u.length||f.charAt(u.length)!=="/"?!1:f.startsWith(u)}t.contains=o})(It||(It={}));var Pd=class{constructor(){this.root={name:"",children:new Map}}normalizeUri(e){return It.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:It.joinPath(ut.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:It.joinPath(ut.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){let r=this.getNode(this.normalizeUri(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 me;(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"})(me||(me={}));var Cd=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=_e.CancellationToken.None){let n=await this.getInitialText(e,r);return this.createAsync(e,n,r)}async getInitialText(e,r){return this.fileSystemProvider.readFile(e)}fromTextDocument(e,r,n){return r=r??ut.parse(e.uri),_e.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return _e.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:me.Parsed,references:[],textDocument:n};else{let s=this.createTextDocumentGetter(r,i);o={parseResult:e,uri:r,state:me.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=await this.getUpdatedText(e,i,r);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=me.Parsed,e}async getUpdatedText(e,r,n){return r?r.getText():await this.fileSystemProvider.readFile(e.uri)}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=sl.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},Od=class{constructor(e){this.documentTrie=new Pd,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return Re(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,me.Changed),n}deleteDocument(e){let r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=me.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){let r=e.toString(),n=this.documentTrie.findAll(r);for(let i of n)i.state=me.Changed;return this.documentTrie.delete(r),n}};var ea=Symbol("RefResolving"),Bx=class{constructor(e,r,n,i,o){this.resolver=e,this.node=r,this.property=n,this._ref=void 0,this.$refNode=i,this.$refText=o}get ref(){return this.resolver.resolveReference(this,this.node,this.property)}get $nodeDescription(){return this._nodeDescription}get error(){return Fo(this._ref)?this._ref:void 0}},Gx=class{constructor(e,r,n,i,o){this.resolver=e,this.node=r,this.property=n,this._items=void 0,this.$refNode=i,this.$refText=o}get items(){return this.resolver.resolveMultiReference(this,this.node,this.property)}get error(){return this._linkingError}},Ld=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,this.referenceResolver={resolveReference:this.resolveReference.bind(this),resolveMultiReference:this.resolveMultiReference.bind(this)}}async link(e,r=_e.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 mt(r),ji(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 mt(r),ji(n).forEach(i=>this.doLink(i,e))}doLink(e,r){let n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=ea;try{let i=this.getCandidate(e);if(Fo(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=ea;try{let i=this.getCandidates(e),o=[];if(Fo(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){return new Bx(this.referenceResolver,e,r,n,i)}buildMultiReference(e,r,n,i){return new Gx(this.referenceResolver,e,r,n,i)}resolveReference(e,r,n){if(pt(e._ref))return e._ref;if(cE(e._nodeDescription)){let i=this.loadAstNode(e._nodeDescription);e._ref=i??this.createLinkingError({reference:e,container:r,property:n},e._nodeDescription)}else if(e._ref===void 0){e._ref=ea;let i=Ka(r).$document,o=this.getLinkedNode({reference:e,container:r,property:n});if(o.error&&i&&i.state<me.ComputedScopes)return e._ref=void 0;e._ref=o.node??o.error,e._nodeDescription=o.descr,i?.references.push(e)}else e._ref===ea&&this.throwCyclicReferenceError(r,n,e.$refText);return pt(e._ref)?e._ref:void 0}resolveMultiReference(e,r,n){if(Array.isArray(e._items))return e._items;if(e._items===void 0){e._items=ea;let i=Ka(r).$document,o=this.getCandidates({reference:e,container:r,property:n}),s=[];if(Fo(o))e._linkingError=o;else{for(let a of o){let c=this.loadAstNode(a);c&&s.push({ref:c,$nodeDescription:a})}s.length===0&&(e._linkingError=this.createLinkingError({reference:e,container:r,property:n}))}e._items=s,i?.references.push(e)}else e._items===ea&&this.throwCyclicReferenceError(r,n,e.$refText);return Array.isArray(e._items)?e._items:[]}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(Fo(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=Ka(e.container).$document;n&&n.state<me.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 F2(t){return typeof t.name=="string"}var Dd=class{getName(e){if(F2(e))return e.name}getNameNode(e){return dc(e.$cstNode,"name")}};var Md=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=>Kr(r)&&r.isMulti)}findDeclarations(e){if(e){let r=lm(e),n=e.astNode;if(r&&n){let i=n[r.feature];if(Pt(i)||hr(i))return Mh(i);if(Array.isArray(i)){for(let o of i)if((Pt(o)||hr(o))&&o.$refNode&&o.$refNode.offset<=e.offset&&o.$refNode.end>=e.end)return Mh(o)}}if(n){let i=this.nameProvider.getNameNode(n);if(i&&(i===e||$E(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 ji(n))if(hr(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=>It.equals(o.sourceUri,r.documentUri))),n.push(...i),Re(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:Yo(o),local:!0})}}return n}};var Or=class{constructor(e){if(this.map=new Map,e)for(let[r,n]of e)this.add(r,n)}get size(){return cu.sum(Re(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?Re(r):lu}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 Re(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return Re(this.map.keys())}values(){return Re(this.map.values()).flat()}entriesGroupedByKey(){return Re(this.map.entries())}},al=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 $d=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=_e.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=fu,i=_e.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=_e.CancellationToken.None){let n=e.parseResult.value,i=new Or;for(let o of qr(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 cl=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}};var Fd=class{constructor(e,r,n){this.elements=new Or,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?Re(n).concat(this.outerScope.getElements(e)):Re(n)}getAllElements(){let e=Re(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}};var Ud=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")}},Hx=class extends Ud{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()}},Bd=class extends Ud{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}};var Gd=class extends Hx{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 Hd=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 Gd(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 cl(Re(e),r,n)}createScopeForNodes(e,r,n){let i=Re(e).map(o=>{let s=this.nameProvider.getName(o);if(s)return this.descriptions.createDescription(o,s)}).nonNullable();return new cl(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new Fd(this.indexManager.allElements(e)))}};function ZA(t){return typeof t.$comment=="string"}function KA(t){return typeof t=="object"&&!!t&&("$ref"in t||"$refs"in t||"$error"in t)}var Xd=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(Pt(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(hr(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=om(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];KA(f)?l[u]=this.reviveReference(e,c,r,f,n):pt(f)&&this.linkNode(f,r,n,e,c,u)}else KA(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):ut.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)):ut.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 jd=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=It.extname(e),i=It.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 ta(t){return{code:t}}var Xx;(function(t){t.defaults=["fast","slow","built-in"],t.all=t.defaults})(Xx||(Xx={}));var zd=class{constructor(e){this.entries=new Or,this.knownCategories=new Set(Xx.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 Qn(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(ki(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=Re(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 U2=Object.freeze({validateNode:!0,validateChildren:!0}),Wd=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=_e.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===Lr.LexingError)||(this.processParsingErrors(i,o,r),r.stopAfterParsingErrors&&o.some(s=>s.data?.code===Lr.ParsingError))||(this.processLinkingErrors(e,o,r),r.stopAfterLinkingErrors&&o.some(s=>s.data?.code===Lr.LinkingError))))return o;try{o.push(...await this.validateAst(i.value,r,n))}catch(s){if(ki(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:jx(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:G2(s),source:this.getSource()};r.push(a)}}processParsingErrors(e,r,n){for(let i of e.parserErrors){let o;if(sc(i.token))o=FE(i.token);else if("previousToken"in i){let s=i.previousToken;if(sc(s)){let a={line:s.endLine-1,character:s.endColumn};o={start:a,end:a}}else{let a={line:0,character:0};o={start:a,end:a}}}if(o){let s={severity:jx("error"),range:o,message:i.message,data:ta(Lr.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:Lr.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=_e.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=_e.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=_e.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 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 U2}async validateAstAfter(e,r,n,i=_e.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:B2(n),severity:jx(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 B2(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=dc(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=am(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 jx(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 G2(t){switch(t){case"error":return ta(Lr.LexingError);case"warning":return ta(Lr.LexingWarning);case"info":return ta(Lr.LexingInfo);case"hint":return ta(Lr.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var Lr;(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"})(Lr||(Lr={}));var qd=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=Yo(this.nameProvider.getNameNode(e)??e.$cstNode));return{node:e,name:r,get nameSegment(){return a()},selectionSegment:Yo(e.$cstNode),type:e.$type,documentUri:i.uri,path:o}}},Vd=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=_e.CancellationToken.None){let n=[],i=e.parseResult.value;for(let o of Wt(i))await mt(r),ji(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=[];Pt(r)&&r.$nodeDescription?n=[r.$nodeDescription]:hr(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=Yo(r.$refNode);for(let c of n)s.push({sourceUri:i,sourcePath:o,targetUri:c.documentUri,targetPath:c.path,segment:a,local:It.equals(c.documentUri,i)});return s}};var Yd=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 zx=Nh(Id(),1);var Kd=class{constructor(e){this._ready=new Ii,this.onConfigurationSectionUpdateEmitter=new zx.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 na=Nh(Id(),1);var ra;(function(t){function e(r){return{dispose:async()=>await r()}}t.create=e})(ra||(ra={}));var Zd=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Or,this.documentPhaseListeners=new Or,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=me.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=_e.CancellationToken.None){for(let i of e){let o=i.uri.toString();if(i.state===me.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(i,me.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=me.IndexedReferences)}}else this.buildState.delete(o)}this.currentState=me.Changed,await this.emitUpdate(e.map(i=>i.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=_e.CancellationToken.None){this.currentState=me.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=me.Changed,this.langiumDocuments.addDocument(l)),this.resetToState(l,me.Changed)}let s=Re(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,me.ComputedScopes)),await this.emitUpdate(o,i),await mt(n);let a=this.sortDocuments(this.langiumDocuments.all.filter(c=>c.state<me.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 Re(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),ra.create(()=>{let r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case me.Changed:case me.Parsed:this.indexManager.removeContent(e.uri);case me.IndexedContent:e.localSymbols=void 0;case me.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case me.Linked:this.indexManager.removeReferences(e.uri);case me.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case me.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=me.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,me.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,me.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,me.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,me.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,me.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,me.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),ra.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),ra.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=_e.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(To);if(this.currentState>=e&&e>i.state)return Promise.reject(new na.ResponseError(na.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${me[i.state]}, requiring ${me[e]}, but workspace state is already ${me[this.currentState]}. Returning undefined.`))}else return Promise.reject(new na.ResponseError(na.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((o,s)=>{let a=this.onDocumentPhase(e,l=>{It.equals(l.uri,r)&&(a.dispose(),c.dispose(),o(l.uri))}),c=n.onCancellationRequested(()=>{a.dispose(),c.dispose(),s(To)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(To):new Promise((n,i)=>{let o=this.onBuildPhase(e,()=>{o.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{o.dispose(),s.dispose(),i(To)})})}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(!ki(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=Re(a.result.validationChecks).concat(o.categories).distinct().toArray():a.result.validationChecks=[...o.categories])}getBuildOptions(e){return this.buildState.get(e.uri.toString())?.options??{}}};var Jd=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Bd,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=>{It.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),Re(i)}allElements(e,r){let n=Re(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=_e.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=_e.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 Qd=class{constructor(e){this.initialBuildOptions={},this._ready=new Ii,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=_e.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=Re(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 ut.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=It.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}};var ep=class{buildUnexpectedCharactersMessage(e,r,n,i,o){return is.buildUnexpectedCharactersMessage(e,r,n,i,o)}buildUnableToPopLexerModeMessage(e){return is.buildUnableToPopLexerModeMessage(e)}},Wx={mode:"full"},ia=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=JA(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new ot(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=Wx){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(JA(e))return e;let r=QA(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}};function qx(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function QA(t){return t&&"modes"in t&&"defaultMode"in t}function JA(t){return!qx(t)&&!QA(t)}el();function rI(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=$e.create(0,0));let o=iI(t),s=Kx(n),a=X2({lines:o,position:i,options:s});return V2({index:0,tokens:a,position:i})}function nI(t,e){let r=Kx(e),n=iI(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 iI(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(GE)}var eI=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,H2=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function X2(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,q2(a)),Yx(a,c)>=a.length){if(e.length>0){let u=$e.create(r,n);e.push({type:"break",content:"",range:Te.create(u,u)})}}else{eI.lastIndex=c;let u=eI.exec(a);if(u){let f=u[0],d=u[1],p=$e.create(r,n+c),m=$e.create(r,n+c+f.length);e.push({type:"tag",content:d,range:Te.create(p,m)}),c+=f.length,c=Yx(a,c)}if(c<a.length){let f=a.substring(c),d=Array.from(f.matchAll(H2));e.push(...j2(d,f,r,n+c))}}r++,n=0}return e.length>0&&e[e.length-1].type==="break"?e.slice(0,-1):e}function j2(t,e,r,n){let i=[];if(t.length===0){let o=$e.create(r,n),s=$e.create(r,n+e.length);i.push({type:"text",content:e,range:Te.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:Te.create($e.create(r,o+n),$e.create(r,c+n))});let u=l.length+1,f=a[1];if(i.push({type:"inline-tag",content:f,range:Te.create($e.create(r,o+u+n),$e.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:Te.create($e.create(r,o+u+n),$e.create(r,o+u+d.length+n))})}else i.push({type:"text",content:"",range:Te.create($e.create(r,o+u+n),$e.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:Te.create($e.create(r,o+n),$e.create(r,o+n+s.length))})}return i}var z2=/\S/,W2=/\s*$/;function Yx(t,e){let r=t.substring(e).match(z2);return r?e+r.index:t.length}function q2(t){let e=t.match(W2);if(e&&typeof e.index=="number")return e.index}function V2(t){let e=$e.create(t.position.line,t.position.character);if(t.tokens.length===0)return new tp([],Te.create(e,e));let r=[];for(;t.index<t.tokens.length;){let o=Y2(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 tp(r,Te.create(n,i))}function Y2(t,e){let r=t.tokens[t.index];if(r.type==="tag")return sI(t,!1);if(r.type==="text"||r.type==="inline-tag")return oI(t);K2(r,e),t.index++}function K2(t,e){if(e){let r=new rp("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function oI(t){let e=t.tokens[t.index],r=e,n=e,i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(Z2(t)),n=e,e=t.tokens[t.index];return new ul(i,Te.create(r.range.start,n.range.end))}function Z2(t){return t.tokens[t.index].type==="inline-tag"?sI(t,!0):aI(t)}function sI(t,e){let r=t.tokens[t.index++],n=r.content.substring(1);if(t.tokens[t.index]?.type==="text")if(e){let o=aI(t);return new ll(n,new ul([o],o.range),e,Te.create(r.range.start,o.range.end))}else{let o=oI(t);return new ll(n,o,e,Te.create(r.range.start,o.range.end))}else{let o=r.range;return new ll(n,new ul([],o),e,o)}}function aI(t){let e=t.tokens[t.index++];return new rp(e.content,e.range)}function Kx(t){if(!t)return Kx({start:"/**",end:"*/",line:"*"});let{start:e,end:r,line:n}=t;return{start:Vx(e,!0),end:Vx(r,!1),line:Vx(n,!0)}}function Vx(t,e){if(typeof t=="string"||typeof t=="object"){let r=typeof t=="string"?eo(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}var tp=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+=tI(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+=tI(r)+i}return r.trim()}},ll=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}
129
+ ${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=J2(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}
130
+ ${r}`),this.inline?`{${i}}`:i}};function J2(t,e,r){if(t==="linkplain"||t==="linkcode"||t==="link"){let n=e.indexOf(" "),i=e;if(n>0){let s=Yx(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)??Q2(e,i)}}function Q2(t,e){try{return ut.parse(t,!0),`[${e}](${t})`}catch{return t}}var ul=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+=`
131
131
  `)}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+=`
132
- `)}return r}},Jd=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}};function ZA(t){return t.endsWith(`
132
+ `)}return r}},rp=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}};function tI(t){return t.endsWith(`
133
133
  `)?`
134
134
  `:`
135
135
 
136
- `}var Qd=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){let r=this.commentProvider.getComment(e);if(r&&QA(r))return JA(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 ep=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){return qA(e)?e.$comment:ME(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}};var tp=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}};var rp=class{constructor(){this.previousTokenSource=new Te.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();let r=GA();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=Te.CancellationToken.None){let i=new Ai,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){Ii(o)?n.resolve(void 0):n.reject(o)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}};var np=class{constructor(e){this.grammarElementIdMap=new il,this.tokenTypeIdMap=new il,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 oc(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)yt(a)?s.push(this.dehydrateAstNode(a,r)):Pt(a)?s.push(this.dehydrateReference(a,r)):s.push(a)}else yt(o)?n[i]=this.dehydrateAstNode(o,r):Pt(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 nu(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Vn(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):ru(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 oc(e.$cstNode)){let s;"fullText"in o?(s=new jc(o.fullText),i=s):"content"in o?s=new Ps:"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)yt(a)?s.push(this.setParent(this.hydrateAstNode(a,r),n)):Pt(a)?s.push(this.hydrateReference(a,n,i,r)):s.push(a)}else yt(o)?n[i]=this.setParent(this.hydrateAstNode(o,r),n):Pt(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),Vn(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 Ns(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))Tu(r)&&this.grammarElementIdMap.set(r,e++)}};function ip(t){return{documentation:{CommentProvider:e=>new ep(e),DocumentationProvider:e=>new Qd(e)},parser:{AsyncParser:e=>new tp(e),GrammarConfig:e=>qE(e),LangiumParser:e=>Rw(e),CompletionParser:e=>ww(e),ValueConverter:()=>new Os,TokenBuilder:()=>new Cs,Lexer:e=>new ia(e),ParserErrorMessageProvider:()=>new zc,LexerErrorMessageProvider:()=>new Kd},workspace:{AstNodeLocator:()=>new zd,AstNodeDescriptionProvider:e=>new Hd(e),ReferenceDescriptionProvider:e=>new jd(e)},references:{Linker:e=>new Nd(e),NameProvider:()=>new Pd,ScopeProvider:e=>new Fd(e),ScopeComputation:e=>new Od(e),References:e=>new Cd(e)},serializer:{Hydrator:e=>new np(e),JsonSerializer:e=>new Ud(e)},validation:{DocumentValidator:e=>new Xd(e),ValidationRegistry:e=>new Gd(e)},shared:()=>t.shared}}function op(t){return{ServiceRegistry:e=>new Bd(e),workspace:{LangiumDocuments:e=>new kd(e),LangiumDocumentFactory:e=>new Id(e),DocumentBuilder:e=>new qd(e),IndexManager:e=>new Vd(e),WorkspaceManager:e=>new Yd(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new rp,ConfigurationProvider:e=>new Wd(e)},profilers:{}}}var iI;(function(t){t.merge=(e,r)=>cl(cl({},e),r)})(iI||(iI={}));function oa(t,e,r,n,i,o,s,a,c){let l=[t,e,r,n,i,o,s,a,c].reduce(cl,{});return aI(l)}var V2=Symbol("isProxy");function aI(t,e){let r=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(n,i)=>i===V2?!0:sI(n,i,t,e||r),getOwnPropertyDescriptor:(n,i)=>(sI(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),has:(n,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return r}var oI=Symbol();function sI(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]===oI)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]=oI;try{t[e]=typeof i=="function"?i(n):aI(i,n)}catch(o){throw t[e]=o instanceof Error?o:void 0,o}return t[e]}else return}function cl(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]=cl(i,n):t[r]=cl({},n)}else t[r]=n}return t}var cI={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},sa;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(sa||(sa={}));var ll=class extends Cs{constructor(e=cI){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...cI,...e},this.indentTokenType=ti({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=ti({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){let n=super.buildTokens(e,r);if(!jx(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=sa.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:{[sa.REGULAR]:[c,l,...f,u],[sa.IGNORE_INDENTATION]:[...f,u]},defaultMode:sa.REGULAR}:[c,l,u,...f]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,r){return r===0||`\r
137
- `.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 En(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?ti({name:o,pattern:this.whitespaceRegExp,group:ot.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}},sp=class extends ia{constructor(e){if(super(e),e.parser.TokenBuilder instanceof ll)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=Hx){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 Vx=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[]}},ap={fileSystemProvider:()=>new Vx};var Y2={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},K2={AstReflection:()=>new ic};function Z2(){let t=oa(op(ap),K2),e=oa(ip({shared:t}),Y2);return t.ServiceRegistry.register(e),e}function lI(t){let e=Z2(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,ht.parse(`memory:/${r.name??"grammar"}.langium`)),r}var ca={$type:"AnchorDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function hl(t){return vt.isInstance(t,ca.$type)}var Yx={$type:"BlockProperty",key:"key",value:"value"};var eT={$type:"CalendarBlock",properties:"properties"};function pp(t){return vt.isInstance(t,eT.$type)}var aa={$type:"ConfigEntry"};var dp={$type:"DefaultDeclaration",entityType:"entityType",properties:"properties"};function ki(t){return vt.isInstance(t,dp.$type)}var tT={$type:"DescriptionDirective",text:"text"};function iT(t){return vt.isInstance(t,tT.$type)}var cp={$type:"EntityProperty",key:"key",value:"value",values:"values"};var la={$type:"FootnoteDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function ml(t){return vt.isInstance(t,la.$type)}var ua={$type:"GroupBlock",content:"content",name:"name",properties:"properties",title:"title"};function Dr(t){return vt.isInstance(t,ua.$type)}var ul={$type:"GroupContent"};var Kx={$type:"IncludeDeclaration",options:"options",path:"path"};var Zx={$type:"IncludeOption",key:"key",value:"value"};var fa={$type:"ItemDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function ar(t){return vt.isInstance(t,fa.$type)}var da={$type:"LabelDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function gl(t){return vt.isInstance(t,da.$type)}var pa={$type:"MilestoneDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function yl(t){return vt.isInstance(t,pa.$type)}var Jx={$type:"NowlineDirective",properties:"properties",version:"version"};var yo={$type:"NowlineFile",configEntries:"configEntries",directive:"directive",hasConfig:"hasConfig",includes:"includes",roadmapDecl:"roadmapDecl",roadmapEntries:"roadmapEntries"};var ha={$type:"ParallelBlock",content:"content",name:"name",properties:"properties",title:"title"};function Mr(t){return vt.isInstance(t,ha.$type)}var lp={$type:"ParallelContent"};var ma={$type:"PersonDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function On(t){return vt.isInstance(t,ma.$type)}var rT={$type:"PersonMemberRef",ref:"ref"};function uI(t){return vt.isInstance(t,rT.$type)}var up={$type:"RoadmapDeclaration",name:"name",properties:"properties",title:"title"};var sn={$type:"RoadmapEntry"};var nT={$type:"ScaleBlock",properties:"properties"};function fI(t){return vt.isInstance(t,nT.$type)}var ga={$type:"SizeDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function xo(t){return vt.isInstance(t,ga.$type)}var ya={$type:"StatusDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Ea(t){return vt.isInstance(t,ya.$type)}var dl={$type:"StyleDeclaration",name:"name",properties:"properties",title:"title"};function xl(t){return vt.isInstance(t,dl.$type)}var Qx={$type:"StyleProperty",key:"key",value:"value"};var fl={$type:"SwimlaneContent"};var xa={$type:"SwimlaneDeclaration",content:"content",name:"name",properties:"properties",title:"title"};function yr(t){return vt.isInstance(t,xa.$type)}var Ta={$type:"SymbolDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Tl(t){return vt.isInstance(t,Ta.$type)}var fp={$type:"TeamContent"};var _a={$type:"TeamDeclaration",content:"content",name:"name",properties:"properties",title:"title"};function xr(t){return vt.isInstance(t,_a.$type)}var pl=class extends Lo{constructor(){super(...arguments);R(this,"types",{AnchorDeclaration:{name:ca.$type,properties:{description:{name:ca.description,optional:!0},name:{name:ca.name,optional:!0},properties:{name:ca.properties,defaultValue:[],optional:!0},title:{name:ca.title,optional:!0}},superTypes:[sn.$type]},BlockProperty:{name:Yx.$type,properties:{key:{name:Yx.key},value:{name:Yx.value}},superTypes:[]},CalendarBlock:{name:eT.$type,properties:{properties:{name:eT.properties,defaultValue:[],optional:!0}},superTypes:[aa.$type]},ConfigEntry:{name:aa.$type,properties:{},superTypes:[]},DefaultDeclaration:{name:dp.$type,properties:{entityType:{name:dp.entityType},properties:{name:dp.properties,defaultValue:[],optional:!0}},superTypes:[aa.$type]},DescriptionDirective:{name:tT.$type,properties:{text:{name:tT.text}},superTypes:[ul.$type,lp.$type,fl.$type,fp.$type]},EntityProperty:{name:cp.$type,properties:{key:{name:cp.key},value:{name:cp.value,optional:!0},values:{name:cp.values,defaultValue:[],optional:!0}},superTypes:[]},FootnoteDeclaration:{name:la.$type,properties:{description:{name:la.description,optional:!0},name:{name:la.name,optional:!0},properties:{name:la.properties,defaultValue:[],optional:!0},title:{name:la.title,optional:!0}},superTypes:[sn.$type]},GroupBlock:{name:ua.$type,properties:{content:{name:ua.content,defaultValue:[]},name:{name:ua.name,optional:!0},properties:{name:ua.properties,defaultValue:[],optional:!0},title:{name:ua.title,optional:!0}},superTypes:[ul.$type,lp.$type,fl.$type]},GroupContent:{name:ul.$type,properties:{},superTypes:[]},IncludeDeclaration:{name:Kx.$type,properties:{options:{name:Kx.options,defaultValue:[],optional:!0},path:{name:Kx.path}},superTypes:[]},IncludeOption:{name:Zx.$type,properties:{key:{name:Zx.key},value:{name:Zx.value}},superTypes:[]},ItemDeclaration:{name:fa.$type,properties:{description:{name:fa.description,optional:!0},name:{name:fa.name,optional:!0},properties:{name:fa.properties,defaultValue:[],optional:!0},title:{name:fa.title,optional:!0}},superTypes:[ul.$type,lp.$type,fl.$type]},LabelDeclaration:{name:da.$type,properties:{description:{name:da.description,optional:!0},name:{name:da.name,optional:!0},properties:{name:da.properties,defaultValue:[],optional:!0},title:{name:da.title,optional:!0}},superTypes:[sn.$type]},MilestoneDeclaration:{name:pa.$type,properties:{description:{name:pa.description,optional:!0},name:{name:pa.name,optional:!0},properties:{name:pa.properties,defaultValue:[],optional:!0},title:{name:pa.title,optional:!0}},superTypes:[sn.$type]},NowlineDirective:{name:Jx.$type,properties:{properties:{name:Jx.properties,defaultValue:[],optional:!0},version:{name:Jx.version}},superTypes:[]},NowlineFile:{name:yo.$type,properties:{configEntries:{name:yo.configEntries,defaultValue:[],optional:!0},directive:{name:yo.directive,optional:!0},hasConfig:{name:yo.hasConfig,defaultValue:!1,optional:!0},includes:{name:yo.includes,defaultValue:[],optional:!0},roadmapDecl:{name:yo.roadmapDecl,optional:!0},roadmapEntries:{name:yo.roadmapEntries,defaultValue:[],optional:!0}},superTypes:[]},ParallelBlock:{name:ha.$type,properties:{content:{name:ha.content,defaultValue:[]},name:{name:ha.name,optional:!0},properties:{name:ha.properties,defaultValue:[],optional:!0},title:{name:ha.title,optional:!0}},superTypes:[ul.$type,fl.$type]},ParallelContent:{name:lp.$type,properties:{},superTypes:[]},PersonDeclaration:{name:ma.$type,properties:{description:{name:ma.description,optional:!0},name:{name:ma.name,optional:!0},properties:{name:ma.properties,defaultValue:[],optional:!0},title:{name:ma.title,optional:!0}},superTypes:[sn.$type]},PersonMemberRef:{name:rT.$type,properties:{ref:{name:rT.ref}},superTypes:[fp.$type]},RoadmapDeclaration:{name:up.$type,properties:{name:{name:up.name,optional:!0},properties:{name:up.properties,defaultValue:[],optional:!0},title:{name:up.title,optional:!0}},superTypes:[]},RoadmapEntry:{name:sn.$type,properties:{},superTypes:[]},ScaleBlock:{name:nT.$type,properties:{properties:{name:nT.properties,defaultValue:[],optional:!0}},superTypes:[aa.$type]},SizeDeclaration:{name:ga.$type,properties:{description:{name:ga.description,optional:!0},name:{name:ga.name,optional:!0},properties:{name:ga.properties,defaultValue:[],optional:!0},title:{name:ga.title,optional:!0}},superTypes:[sn.$type]},StatusDeclaration:{name:ya.$type,properties:{description:{name:ya.description,optional:!0},name:{name:ya.name,optional:!0},properties:{name:ya.properties,defaultValue:[],optional:!0},title:{name:ya.title,optional:!0}},superTypes:[sn.$type]},StyleDeclaration:{name:dl.$type,properties:{name:{name:dl.name,optional:!0},properties:{name:dl.properties,defaultValue:[],optional:!0},title:{name:dl.title,optional:!0}},superTypes:[aa.$type]},StyleProperty:{name:Qx.$type,properties:{key:{name:Qx.key},value:{name:Qx.value}},superTypes:[]},SwimlaneContent:{name:fl.$type,properties:{},superTypes:[]},SwimlaneDeclaration:{name:xa.$type,properties:{content:{name:xa.content,defaultValue:[],optional:!0},name:{name:xa.name,optional:!0},properties:{name:xa.properties,defaultValue:[],optional:!0},title:{name:xa.title,optional:!0}},superTypes:[sn.$type]},SymbolDeclaration:{name:Ta.$type,properties:{description:{name:Ta.description,optional:!0},name:{name:Ta.name,optional:!0},properties:{name:Ta.properties,defaultValue:[],optional:!0},title:{name:Ta.title,optional:!0}},superTypes:[aa.$type]},TeamContent:{name:fp.$type,properties:{},superTypes:[]},TeamDeclaration:{name:_a.$type,properties:{content:{name:_a.content,defaultValue:[],optional:!0},name:{name:_a.name,optional:!0},properties:{name:_a.properties,defaultValue:[],optional:!0},title:{name:_a.title,optional:!0}},superTypes:[sn.$type,fp.$type]}})}},vt=new pl;var dI,pI=()=>dI??(dI=lI(`{
136
+ `}var np=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){let r=this.commentProvider.getComment(e);if(r&&nI(r))return rI(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 ip=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){return ZA(e)?e.$comment:BE(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}};var op=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}};var sp;(function(t){t[t.Normal=0]="Normal",t[t.Immediate=1]="Immediate"})(sp||(sp={}));var ap=class{constructor(){this.previousTokenSource=new _e.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.immediateReads=[],this.done=!0}write(e){this.cancelWrite();let r=zA();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e,r=sp.Normal){if(r===sp.Immediate){let n=Promise.resolve().then(()=>e());this.immediateReads.push(n);let i=()=>{this.immediateReads.splice(this.immediateReads.indexOf(n),1)};return n.then(i,i),n}return this.enqueue(this.readQueue,e)}enqueue(e,r,n=_e.CancellationToken.None){let i=new Ii,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)for(e.push(this.writeQueue.shift()),this.done=!1;this.immediateReads.length>0;)await Promise.allSettled(this.immediateReads.slice());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length)),this.done=!1;else return;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){ki(o)?n.resolve(void 0):n.reject(o)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}};var cp=class{constructor(e){this.grammarElementIdMap=new al,this.tokenTypeIdMap=new al,this.cstNodeBuilder=new Ss,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 oc(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)):Pt(a)?s.push(this.dehydrateReference(a,r)):s.push(a)}else pt(o)?n[i]=this.dehydrateAstNode(o,r):Pt(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);if(su(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,Vn(e))n.content=e.content.map(i=>this.dehydrateCstNode(i,r));else if(ou(e)){n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length;let{start:i,end:o}=e.range;n.startLine=i.line,n.startColumn=i.character,n.endLine=o.line,n.endColumn=o.character}return 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 i of Wt(e))r.set(i,{});if(e.$cstNode)for(let i of oc(e.$cstNode)){let o;"fullText"in i?o=new Uc(i.fullText):"content"in i?o=new As:"tokenType"in i&&(o=this.hydrateCstLeafNode(i)),o&&n.set(i,o)}return{astNodes:r,cstNodes:n,linkedCstNodes:new Set}}hydrateAstNode(e,r){let n=r.astNodes.get(e);if(n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode){let i=r.cstNodes.get(e.$cstNode);n.$cstNode=i,i&&!r.linkedCstNodes.has(i)&&(r.linkedCstNodes.add(i),i.astNode=n)}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)):Pt(a)?s.push(this.hydrateReference(a,n,i,r)):s.push(a)}else pt(o)?n[i]=this.setParent(this.hydrateAstNode(o,r),n):Pt(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)),Vn(i)){let o=[];for(let s of e.content)o.push(this.hydrateCstNode(s,r,n++));this.cstNodeBuilder.appendChildren(i,o)}return i}hydrateCstLeafNode(e){let r=this.getTokenType(e.tokenType);return new Fc(e.offset,e.length,e.startLine,e.startColumn,e.endLine,e.endColumn,r,e.hidden)}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))vu(r)&&this.grammarElementIdMap.set(r,e++)}};function lp(t){return{documentation:{CommentProvider:e=>new ip(e),DocumentationProvider:e=>new np(e)},parser:{AsyncParser:e=>new op(e),GrammarConfig:e=>ZE(e),LangiumParser:e=>kw(e),CompletionParser:e=>Iw(e),ValueConverter:()=>new ks,TokenBuilder:()=>new Is,Lexer:e=>new ia(e),ParserErrorMessageProvider:()=>new Bc,LexerErrorMessageProvider:()=>new ep},workspace:{AstNodeLocator:()=>new Yd,AstNodeDescriptionProvider:e=>new qd(e),ReferenceDescriptionProvider:e=>new Vd(e)},references:{Linker:e=>new Ld(e),NameProvider:()=>new Dd,ScopeProvider:e=>new Hd(e),ScopeComputation:e=>new $d(e),References:e=>new Md(e)},serializer:{Hydrator:e=>new cp(e),JsonSerializer:e=>new Xd(e)},validation:{DocumentValidator:e=>new Wd(e),ValidationRegistry:e=>new zd(e)},shared:()=>t.shared}}function up(t){return{ServiceRegistry:e=>new jd(e),workspace:{LangiumDocuments:e=>new Od(e),LangiumDocumentFactory:e=>new Cd(e),DocumentBuilder:e=>new Zd(e),IndexManager:e=>new Jd(e),WorkspaceManager:e=>new Qd(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new ap,ConfigurationProvider:e=>new Kd(e)},profilers:{}}}var cI;(function(t){t.merge=(e,r)=>fl(fl({},e),r)})(cI||(cI={}));function oa(t,e,r,n,i,o,s,a,c){let l=[t,e,r,n,i,o,s,a,c].reduce(fl,{});return fI(l)}var eU=Symbol("isProxy");function fI(t,e){let r=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(n,i)=>i===eU?!0:uI(n,i,t,e||r),getOwnPropertyDescriptor:(n,i)=>(uI(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),has:(n,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return r}var lI=Symbol();function uI(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]===lI)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]=lI;try{t[e]=typeof i=="function"?i(n):fI(i,n)}catch(o){throw t[e]=o instanceof Error?o:void 0,o}return t[e]}else return}function fl(t,e){if(e){for(let[r,n]of Object.entries(e))if(!(r==="__proto__"||r==="constructor"||r==="prototype")&&n!=null)if(typeof n=="object"){let i=t[r];typeof i=="object"&&i!==null?t[r]=fl(i,n):t[r]=fl({},n)}else t[r]=n}return t}var dI={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},sa;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(sa||(sa={}));var dl=class extends Is{constructor(e=dI){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...dI,...e},this.indentTokenType=ti({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=ti({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){let n=super.buildTokens(e,r);if(!qx(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=sa.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:{[sa.REGULAR]:[c,l,...f,u],[sa.IGNORE_INDENTATION]:[...f,u]},defaultMode:sa.REGULAR}:[c,l,u,...f]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,r){return r===0||`\r
137
+ `.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 En(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?ti({name:o,pattern:this.whitespaceRegExp,group:ot.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}},fp=class extends ia{constructor(e){if(super(e),e.parser.TokenBuilder instanceof dl)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=Wx){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 Zx=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[]}},dp={fileSystemProvider:()=>new Zx};var tU={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},rU={AstReflection:()=>new ic};function nU(){let t=oa(up(dp),rU),e=oa(lp({shared:t}),tU);return t.ServiceRegistry.register(e),e}function pI(t){let e=nU(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,ut.parse(`memory:/${r.name??"grammar"}.langium`)),r}var ca={$type:"AnchorDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function yl(t){return Et.isInstance(t,ca.$type)}var Jx={$type:"BlockProperty",key:"key",value:"value"};var nT={$type:"CalendarBlock",properties:"properties"};function xp(t){return Et.isInstance(t,nT.$type)}var aa={$type:"ConfigEntry"};var yp={$type:"DefaultDeclaration",entityType:"entityType",properties:"properties"};function Ni(t){return Et.isInstance(t,yp.$type)}var iT={$type:"DescriptionDirective",text:"text"};function aT(t){return Et.isInstance(t,iT.$type)}var pp={$type:"EntityProperty",key:"key",value:"value",values:"values"};var la={$type:"FootnoteDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function xl(t){return Et.isInstance(t,la.$type)}var ua={$type:"GroupBlock",content:"content",name:"name",properties:"properties",title:"title"};function Dr(t){return Et.isInstance(t,ua.$type)}var pl={$type:"GroupContent"};var Qx={$type:"IncludeDeclaration",options:"options",path:"path"};var eT={$type:"IncludeOption",key:"key",value:"value"};var fa={$type:"ItemDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function ar(t){return Et.isInstance(t,fa.$type)}var da={$type:"LabelDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Tl(t){return Et.isInstance(t,da.$type)}var pa={$type:"MilestoneDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function _l(t){return Et.isInstance(t,pa.$type)}var tT={$type:"NowlineDirective",properties:"properties",version:"version"};var _o={$type:"NowlineFile",configEntries:"configEntries",directive:"directive",hasConfig:"hasConfig",includes:"includes",roadmapDecl:"roadmapDecl",roadmapEntries:"roadmapEntries"};var ha={$type:"ParallelBlock",content:"content",name:"name",properties:"properties",title:"title"};function Mr(t){return Et.isInstance(t,ha.$type)}var hp={$type:"ParallelContent"};var ma={$type:"PersonDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function On(t){return Et.isInstance(t,ma.$type)}var oT={$type:"PersonMemberRef",ref:"ref"};function hI(t){return Et.isInstance(t,oT.$type)}var mp={$type:"RoadmapDeclaration",name:"name",properties:"properties",title:"title"};var sn={$type:"RoadmapEntry"};var sT={$type:"ScaleBlock",properties:"properties"};function mI(t){return Et.isInstance(t,sT.$type)}var ga={$type:"SizeDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Eo(t){return Et.isInstance(t,ga.$type)}var ya={$type:"StatusDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Ea(t){return Et.isInstance(t,ya.$type)}var ml={$type:"StyleDeclaration",name:"name",properties:"properties",title:"title"};function El(t){return Et.isInstance(t,ml.$type)}var rT={$type:"StyleProperty",key:"key",value:"value"};var hl={$type:"SwimlaneContent"};var xa={$type:"SwimlaneDeclaration",content:"content",name:"name",properties:"properties",title:"title"};function yr(t){return Et.isInstance(t,xa.$type)}var Ta={$type:"SymbolDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function vl(t){return Et.isInstance(t,Ta.$type)}var gp={$type:"TeamContent"};var _a={$type:"TeamDeclaration",content:"content",name:"name",properties:"properties",title:"title"};function xr(t){return Et.isInstance(t,_a.$type)}var gl=class extends $o{constructor(){super(...arguments);R(this,"types",{AnchorDeclaration:{name:ca.$type,properties:{description:{name:ca.description,optional:!0},name:{name:ca.name,optional:!0},properties:{name:ca.properties,defaultValue:[],optional:!0},title:{name:ca.title,optional:!0}},superTypes:[sn.$type]},BlockProperty:{name:Jx.$type,properties:{key:{name:Jx.key},value:{name:Jx.value}},superTypes:[]},CalendarBlock:{name:nT.$type,properties:{properties:{name:nT.properties,defaultValue:[],optional:!0}},superTypes:[aa.$type]},ConfigEntry:{name:aa.$type,properties:{},superTypes:[]},DefaultDeclaration:{name:yp.$type,properties:{entityType:{name:yp.entityType},properties:{name:yp.properties,defaultValue:[],optional:!0}},superTypes:[aa.$type]},DescriptionDirective:{name:iT.$type,properties:{text:{name:iT.text}},superTypes:[pl.$type,hp.$type,hl.$type,gp.$type]},EntityProperty:{name:pp.$type,properties:{key:{name:pp.key},value:{name:pp.value,optional:!0},values:{name:pp.values,defaultValue:[],optional:!0}},superTypes:[]},FootnoteDeclaration:{name:la.$type,properties:{description:{name:la.description,optional:!0},name:{name:la.name,optional:!0},properties:{name:la.properties,defaultValue:[],optional:!0},title:{name:la.title,optional:!0}},superTypes:[sn.$type]},GroupBlock:{name:ua.$type,properties:{content:{name:ua.content,defaultValue:[]},name:{name:ua.name,optional:!0},properties:{name:ua.properties,defaultValue:[],optional:!0},title:{name:ua.title,optional:!0}},superTypes:[pl.$type,hp.$type,hl.$type]},GroupContent:{name:pl.$type,properties:{},superTypes:[]},IncludeDeclaration:{name:Qx.$type,properties:{options:{name:Qx.options,defaultValue:[],optional:!0},path:{name:Qx.path}},superTypes:[]},IncludeOption:{name:eT.$type,properties:{key:{name:eT.key},value:{name:eT.value}},superTypes:[]},ItemDeclaration:{name:fa.$type,properties:{description:{name:fa.description,optional:!0},name:{name:fa.name,optional:!0},properties:{name:fa.properties,defaultValue:[],optional:!0},title:{name:fa.title,optional:!0}},superTypes:[pl.$type,hp.$type,hl.$type]},LabelDeclaration:{name:da.$type,properties:{description:{name:da.description,optional:!0},name:{name:da.name,optional:!0},properties:{name:da.properties,defaultValue:[],optional:!0},title:{name:da.title,optional:!0}},superTypes:[sn.$type]},MilestoneDeclaration:{name:pa.$type,properties:{description:{name:pa.description,optional:!0},name:{name:pa.name,optional:!0},properties:{name:pa.properties,defaultValue:[],optional:!0},title:{name:pa.title,optional:!0}},superTypes:[sn.$type]},NowlineDirective:{name:tT.$type,properties:{properties:{name:tT.properties,defaultValue:[],optional:!0},version:{name:tT.version}},superTypes:[]},NowlineFile:{name:_o.$type,properties:{configEntries:{name:_o.configEntries,defaultValue:[],optional:!0},directive:{name:_o.directive,optional:!0},hasConfig:{name:_o.hasConfig,defaultValue:!1,optional:!0},includes:{name:_o.includes,defaultValue:[],optional:!0},roadmapDecl:{name:_o.roadmapDecl,optional:!0},roadmapEntries:{name:_o.roadmapEntries,defaultValue:[],optional:!0}},superTypes:[]},ParallelBlock:{name:ha.$type,properties:{content:{name:ha.content,defaultValue:[]},name:{name:ha.name,optional:!0},properties:{name:ha.properties,defaultValue:[],optional:!0},title:{name:ha.title,optional:!0}},superTypes:[pl.$type,hl.$type]},ParallelContent:{name:hp.$type,properties:{},superTypes:[]},PersonDeclaration:{name:ma.$type,properties:{description:{name:ma.description,optional:!0},name:{name:ma.name,optional:!0},properties:{name:ma.properties,defaultValue:[],optional:!0},title:{name:ma.title,optional:!0}},superTypes:[sn.$type]},PersonMemberRef:{name:oT.$type,properties:{ref:{name:oT.ref}},superTypes:[gp.$type]},RoadmapDeclaration:{name:mp.$type,properties:{name:{name:mp.name,optional:!0},properties:{name:mp.properties,defaultValue:[],optional:!0},title:{name:mp.title,optional:!0}},superTypes:[]},RoadmapEntry:{name:sn.$type,properties:{},superTypes:[]},ScaleBlock:{name:sT.$type,properties:{properties:{name:sT.properties,defaultValue:[],optional:!0}},superTypes:[aa.$type]},SizeDeclaration:{name:ga.$type,properties:{description:{name:ga.description,optional:!0},name:{name:ga.name,optional:!0},properties:{name:ga.properties,defaultValue:[],optional:!0},title:{name:ga.title,optional:!0}},superTypes:[sn.$type]},StatusDeclaration:{name:ya.$type,properties:{description:{name:ya.description,optional:!0},name:{name:ya.name,optional:!0},properties:{name:ya.properties,defaultValue:[],optional:!0},title:{name:ya.title,optional:!0}},superTypes:[sn.$type]},StyleDeclaration:{name:ml.$type,properties:{name:{name:ml.name,optional:!0},properties:{name:ml.properties,defaultValue:[],optional:!0},title:{name:ml.title,optional:!0}},superTypes:[aa.$type]},StyleProperty:{name:rT.$type,properties:{key:{name:rT.key},value:{name:rT.value}},superTypes:[]},SwimlaneContent:{name:hl.$type,properties:{},superTypes:[]},SwimlaneDeclaration:{name:xa.$type,properties:{content:{name:xa.content,defaultValue:[],optional:!0},name:{name:xa.name,optional:!0},properties:{name:xa.properties,defaultValue:[],optional:!0},title:{name:xa.title,optional:!0}},superTypes:[sn.$type]},SymbolDeclaration:{name:Ta.$type,properties:{description:{name:Ta.description,optional:!0},name:{name:Ta.name,optional:!0},properties:{name:Ta.properties,defaultValue:[],optional:!0},title:{name:Ta.title,optional:!0}},superTypes:[aa.$type]},TeamContent:{name:gp.$type,properties:{},superTypes:[]},TeamDeclaration:{name:_a.$type,properties:{content:{name:_a.content,defaultValue:[],optional:!0},name:{name:_a.name,optional:!0},properties:{name:_a.properties,defaultValue:[],optional:!0},title:{name:_a.title,optional:!0}},superTypes:[sn.$type,gp.$type]}})}},Et=new gl;var gI,yI=()=>gI??(gI=pI(`{
138
138
  "$type": "Grammar",
139
139
  "isDeclared": true,
140
140
  "name": "Nowline",
@@ -2635,6 +2635,6 @@ ${r}`),this.inline?`{${i}}`:i}};function W2(t,e,r){if(t==="linkplain"||t==="link
2635
2635
  "imports": [],
2636
2636
  "interfaces": [],
2637
2637
  "types": []
2638
- }`));var J2={languageId:"nowline",fileExtensions:[".nowline"],caseInsensitive:!1,mode:"development"},hI={AstReflection:()=>new pl},mI={Grammar:()=>pI(),LanguageMetaData:()=>J2,parser:{}};var gI={"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}"?`:""}`,"NL.W1000":t=>`Now-line date ${t.date} is outside the roadmap window (${t.start} \u2013 ${t.end}); it will not be drawn.`,"NL.I1000":t=>`Title on item "${t.name}" is wider than its bar at this scale; it rendered to the right of the bar.`,"NL.I1001":t=>`Label chips on item "${t.name}" did not fit inside the bar; they rendered in a spill column to the right.`,"NL.I1002":t=>`Item "${t.name}" is too narrow to show its marker at this scale; decorations spilled beside the bar.`,"NL.I1003":t=>t.anchor?`Item "${t.name}" extends past its "before:" anchor "${t.anchor}".`:`Item "${t.name}" extends past its "before:" anchor.`,"NL.I1004":t=>`Swimlane "${t.lane}" packed into ${t.rows} rows to avoid overlap.`,"NL.I1005":t=>`Swimlane "${t.lane}" is over capacity in one or more periods (red utilization band).`};var yI={"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 xI={};var TI={};var Q2=new Map([["en-US",gI],["fr",yI],["fr-CA",xI],["fr-FR",TI]]);function _l(t,e,...r){for(let n of eU(t)){let o=Q2.get(n)?.[e];if(o)return o(...r)}return e}var _I="en-US";function eU(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(_I)||e.push(_I),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 rU=/[\\/]/;function bI(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 EI(...t){for(let e of t)if(e){if(e.includes("\\")&&!e.includes("/"))return"\\";if(e.includes("/"))return"/"}return"/"}function nU(t){return t?t[0]==="/"||t[0]==="\\"?!0:t.length>=3&&/^[A-Za-z]:[\\/]/.test(t):!1}function wI(t){let e=bI(t);return e<0?".":e===0?t[0]:e===2&&/^[A-Za-z]:[\\/]/.test(t)?t.slice(0,3):t.slice(0,e)}function hp(t){let e=bI(t);return e<0?t:t.slice(e+1)}function oT(t,e){if(nU(e))return vI(e,EI(e));let r=EI(t,e);return vI(`${t}${r}${e}`,r)}function vI(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(rU))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 oU=/^\d{4}-\d{2}-\d{2}$/;function AI(t){let e=t?.properties.find(r=>r.key==="start");if(e?.value&&oU.test(e.value)&&!Number.isNaN(new Date(e.value).getTime()))return e.value}function sU(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 II(){return{styles:new Map,defaults:new Map,symbols:new Map}}function kI(){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 aT(t,e,r){let n=r.readFile??(async c=>{let{nodeReadFile:l}=await Promise.resolve().then(()=>(SI(),RI));return l(c)}),i={services:r.services,diagnostics:[],resolving:[],processed:new Map,readFile:n},o=oT("",e),{config:s,content:a}=await PI(t,o,i);return{config:s,content:a,diagnostics:i.diagnostics,processedFiles:new Set(i.processed.keys())}}async function PI(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:II(),content:kI()};return r.processed.set(e,a),a}r.resolving.push(e);let n=II(),i=kI();uU(n,t),pU(i,t);let o=new Set;for(let a of t.includes){let c=a.path,l=oT(wI(e),c);if(o.has(l)){r.diagnostics.push({severity:"error",message:`Duplicate include "${c}" in ${hp(e)}.`,sourcePath:e,line:a.$cstNode?.range.start.line});continue}o.add(l);let u=NI(a,"config")??"merge",f=NI(a,"roadmap")??"merge",d;try{let y=await r.readFile(l);d=await aU(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 PI(d,l,r);if(cU(n,p,u,l,r.diagnostics),lU(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=AI(t.roadmapDecl),E=AI(d.roadmapDecl);y!==E&&r.diagnostics.push({severity:"error",message:sU(c,y,E),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 NI(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 aU(t,e,r){let n=ht.file(r),o=t.shared.workspace.LangiumDocumentFactory.fromString(e,n);return await t.shared.workspace.DocumentBuilder.build([o],{validation:!1}),o.parseResult.value}function cU(t,e,r,n,i){if(r==="ignore"||r==="isolate")return;let o=(s,a)=>i.push({severity:"warning",message:`${a} "${s}" from ${hp(n)} is shadowed by the parent's definition.`,sourcePath:n});sT(t.styles,e.styles,s=>o(s,"Style")),sT(t.defaults,e.defaults,s=>o(s,"Default")),sT(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 lU(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 ${hp(i)} is shadowed by the parent's definition.`,sourcePath:i});Ln(t.persons,e.persons,c=>a(c,"Person")),Ln(t.teams,e.teams,c=>a(c,"Team")),Ln(t.anchors,e.anchors,c=>a(c,"Anchor")),Ln(t.labels,e.labels,c=>a(c,"Label")),Ln(t.sizes,e.sizes,c=>a(c,"Size")),Ln(t.statuses,e.statuses,c=>a(c,"Status")),Ln(t.swimlanes,e.swimlanes,c=>a(c,"Swimlane")),Ln(t.milestones,e.milestones,c=>a(c,"Milestone")),Ln(t.footnotes,e.footnotes,c=>a(c,"Footnote")),e.roadmap&&!t.roadmap&&(t.roadmap=e.roadmap)}function sT(t,e,r){for(let[n,i]of e){if(t.has(n)){r(n);continue}t.set(n,i)}}function Ln(t,e,r){for(let[n,i]of e){if(!i.name&&i.title){t.set(OI(t,CI(i.title)),i);continue}if(t.has(n)){r(n);continue}t.set(n,i)}}function uU(t,e){for(let r of e.configEntries)fU(t,r)}function fU(t,e){fI(e)?t.scale||(t.scale=e):pp(e)?t.calendar||(t.calendar=e):xl(e)?e.name&&!t.styles.has(e.name)&&t.styles.set(e.name,e):Tl(e)?e.name&&!t.symbols.has(e.name)&&t.symbols.set(e.name,e):ki(e)&&(t.defaults.has(e.entityType)||t.defaults.set(e.entityType,e))}function dU(t){let e={swimlanes:new Set,persons:new Set,teams:new Set,anchors:new Set,labels:new Set,sizes:new Set,statuses:new Set,milestones:new Set,footnotes:new Set};for(let r of t){let n=r.name;n&&(yr(r)?e.swimlanes.add(n):On(r)?e.persons.add(n):xr(r)?e.teams.add(n):hl(r)?e.anchors.add(n):gl(r)?e.labels.add(n):xo(r)?e.sizes.add(n):Ea(r)?e.statuses.add(n):yl(r)?e.milestones.add(n):ml(r)&&e.footnotes.add(n))}return e}function pU(t,e){e.roadmapDecl&&!t.roadmap&&(t.roadmap=e.roadmapDecl);let r=dU(e.roadmapEntries);for(let n of e.roadmapEntries)hU(t,n,r)}function CI(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"entity"}function OI(t,e,r){let n=o=>t.has(o)||(r?.has(o)??!1);if(!n(e))return e;let i=2;for(;n(`${e}-${i}`);)i++;return`${e}-${i}`}function Dn(t,e,r){e.name?t.has(e.name)||t.set(e.name,e):e.title&&t.set(OI(t,CI(e.title),r),e)}function hU(t,e,r){yr(e)?Dn(t.swimlanes,e,r.swimlanes):On(e)?Dn(t.persons,e,r.persons):xr(e)?Dn(t.teams,e,r.teams):hl(e)?Dn(t.anchors,e,r.anchors):gl(e)?Dn(t.labels,e,r.labels):xo(e)?Dn(t.sizes,e,r.sizes):Ea(e)?Dn(t.statuses,e,r.statuses):yl(e)?Dn(t.milestones,e,r.milestones):ml(e)&&Dn(t.footnotes,e,r.footnotes)}var LI="v1",cT=new Set(["planned","in-progress","active","done","completed","at-risk","blocked"]),mp=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"]),pT=new Set(["none","multiplier","person","people","points","time"]),gp=new Set([...pT,"shield","warning","lock","calendar"]),jI="none",yp={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"])},mU=new Set(["red","blue","yellow","green","orange","purple","violet","gray","grey","navy","white","none"]),gU=new Set(["business","full","custom"]),lT=new Set(["days-per-week","days-per-month","days-per-quarter","days-per-year"]),DI=new Set(["name","label-every","label"]),MI=new Set(["item","label","swimlane","roadmap","milestone","footnote","anchor","parallel","group"]),yU={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},$I=new Set(["labels","link","style","description"]),xU={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 TU(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 _U(t,e,r=2){let n,i=r+1;for(let o of e){let s=TU(t,o,r);if(s<i&&(n=o,i=s,s===0))break}return n}var EU=[{keys:new Set(["progress","percent","percentage","pct","complete","completion"]),requires:"remaining",suggest:"status: + remaining:"}];function vU(t,e){let r=t.toLowerCase();for(let n of EU)if(n.keys.has(r)&&e.has(n.requires))return n.suggest}function ke(t){return t.key.endsWith(":")?t.key.slice(0,-1):t.key}var El=/^\d+(?:\.\d+)?[dwmqy]$/,bU=/^\d+%$/,Ni=/^\d{4}-\d{2}-\d{2}$/,wU=/^#[0-9a-fA-F]{3,8}$/,RU=/^v\d+$/,FI=/^\d+$/,SU=/^[dwmqy]$/,UI=/^\d+(\.\d+)?$/,hT=/^\d+(\.\d+)?%$/,zI=/^\d+\.\d+$/,AU=/^\d+$/,IU=/^[\x20-\x7E]{1,3}$/,kU=/^[a-zA-Z]{2,3}(-[a-zA-Z]{2}|-\d{3})?$/,NU=new Set(["merge","ignore","isolate"]),BI=new Set(["locale"]);function uT(t){let e=t?.roadmapDecl?.properties.find(i=>ke(i)==="start");if(!e)return{kind:"missing"};let r=e.value;if(!r||!Ni.test(r))return{kind:"invalid"};let n=new Date(r);return Number.isNaN(n.getTime())?{kind:"invalid"}:{kind:"valid",iso:r,date:n}}function $r(t){return t.name??t.title??"<unnamed>"}function PU(t){return t.$type.replace(/Declaration$|Block$/,"").toLowerCase()}function be(t,e,r,n,...i){t(e,_l("en-US",n,...i),{...r,data:{code:n,args:i}})}function WI(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 Tp=class{checkFileStructure(e,r){let n=e.hasConfig?Su.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(!RU.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(LI.slice(1),10);n>i&&be(r,"error",{node:e,property:"version"},"NL.E0101",{version:e.version,supported:LI})}checkDirectiveProperties(e,r){let n=new Set;for(let i of e.properties){let o=ke(i);if(!BI.has(o)){be(r,"error",{node:i,property:"key"},"NL.E0102",{key:o,allowed:[...BI].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;kU.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:xp(a)}):n.set(o,s)};e.roadmapDecl?.name&&i(e.roadmapDecl.name,e.roadmapDecl);for(let o of e.roadmapEntries)LU(o,i);for(let o of e.configEntries)xl(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(yr);e.roadmapDecl&&!n&&be(r,"error",{node:e.roadmapDecl},"NL.E0004")}checkIncludeMode(e,r){NU.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=ke(e),i=e.value,o=e.values,s=i?[i]:o;switch(n){case"status":break;case"duration":i&&!El.test(i)&&be(r,"error",{node:e,property:"value"},"NL.E0400",{value:i});break;case"size":i&&!GI(i)&&be(r,"error",{node:e,property:"value"},"NL.E0401",{value:i});break;case"effort":i&&!El.test(i)&&be(r,"error",{node:e,property:"value"},"NL.E0402",{value:i});break;case"remaining":{if(i)if(bU.test(i)){let a=parseFloat(i);(a<0||a>100)&&be(r,"error",{node:e,property:"value"},"NL.E0404",{value:i})}else El.test(i)||be(r,"error",{node:e,property:"value"},"NL.E0403",{value:i});break}case"date":case"start":i&&(!Ni.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&&!El.test(i)&&be(r,"error",{node:e,property:"value"},"NL.E0406",{value:i});break;case"calendar":i&&!gU.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=CU(a);if(c==="invalid")break;c==="lane"?(!UI.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"}):hT.test(i)?parseFloat(i)<=0&&r("error",`Item capacity "${i}" must be positive.`,{node:e,property:"value"}):UI.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(!OU(e.$container)){r("error",`"${n}:" is only valid on "swimlane" or "default swimlane".`,{node:e});break}if(i===jI)break;if(hT.test(i)){parseFloat(i)<=0&&r("error",`${n} value "${i}" must be positive.`,{node:e,property:"value"});break}if(zI.test(i)){parseFloat(i)<=0&&r("error",`${n} value "${i}" must be positive.`,{node:e,property:"value"});break}if(AU.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(mp.has(n)){if(n==="bg"||n==="fg"||n==="text")i&&!fT(i)&&r("error",`Invalid color "${i}" for "${n}". Use a named color, hex value, or "none".`,{node:e,property:"value"});else if(n in yp){let a=yp[n];i&&!a.has(i)&&!fT(i)&&r("error",`Invalid value "${i}" for "${n}". Allowed: ${[...a].join(", ")}.`,{node:e,property:"value"})}}break}}checkAnchorRequiredDate(e,r){e.properties.find(i=>ke(i)==="date")||be(r,"error",{node:e},"NL.E0500",{name:$r(e)})}checkAnchorAgainstStart(e,r){let n=e.properties.find(a=>ke(a)==="date");if(!n?.value)return;let i=n.value;if(!Ni.test(i))return;let o=new Date(i);if(Number.isNaN(o.getTime()))return;let s=uT(e.$container);switch(s.kind){case"invalid":return;case"missing":be(r,"error",{node:n,property:"value"},"NL.E0501",{name:$r(e)});return;case"valid":o<s.date&&be(r,"error",{node:n,property:"value"},"NL.E0502",{name:$r(e),date:i,start:s.iso});return}}checkMilestoneRequirement(e,r){let n=e.properties.some(o=>ke(o)==="date"),i=e.properties.some(o=>ke(o)==="after");!n&&!i&&be(r,"error",{node:e},"NL.E0503",{name:$r(e)})}checkMilestoneAgainstStart(e,r){let n=e.properties.find(a=>ke(a)==="date");if(!n?.value)return;let i=n.value;if(!Ni.test(i))return;let o=new Date(i);if(Number.isNaN(o.getTime()))return;let s=uT(e.$container);switch(s.kind){case"invalid":return;case"missing":r("error",`Milestone "${$r(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:$r(e),date:i,start:s.iso});return}}checkFootnoteOn(e,r){e.properties.some(i=>ke(i)==="on")||be(r,"error",{node:e},"NL.E0505")}checkNoFootnoteProperty(e,r){for(let n of e.properties)ke(n)==="footnote"&&r("error",`Property "footnote:" is not valid on ${dT(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=>ke(o)==="duration"),i=e.properties.some(o=>ke(o)==="size");!n&&!i&&be(r,"error",{node:e},"NL.E0600",{name:$r(e)})}checkNoComputedProperties(e,r){for(let n of e.properties){let i=ke(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=>!iT(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=>!iT(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=ke(n);mp.has(i)&&r("error",`Raw style property "${i}" is not allowed on ${dT(e)}. Declare a named style in config and reference it via "style:id".`,{node:n})}}checkUnknownEntityProperties(e,r){let n=xU[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=ke(o);if(n.has(s)||$I.has(s)||mp.has(s)||s==="footnote"||i?.has(s))continue;let a=[...n,...$I],c=vU(s,n)??_U(s,a)??"";be(r,"warning",{node:o,property:"key"},"NL.W0700",{key:s,entity:dT(e),suggested:c})}}checkRoadmapProperties(e,r){}checkStylePropertyEnum(e,r){let n=ke(e),i=e.value;if(n==="bg"||n==="fg"||n==="text")fT(i)||r("error",`Invalid color "${i}" for "${n}". Use a named color, hex value, or "none".`,{node:e,property:"value"});else if(n in yp){let o=yp[n];o.has(i)||r("error",`Invalid value "${i}" for "${n}". Allowed: ${[...o].join(", ")}.`,{node:e,property:"value"})}else mp.has(n)||r("error",`Unknown style property "${n}".`,{node:e,property:"key"})}checkSizeDeclaration(e,r){e.properties.find(i=>ke(i)==="effort")||r("error",`Size "${$r(e)}" requires an "effort:" property.`,{node:e}),e.name&&(El.test(e.name)||SU.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&&cT.has(e.name)&&r("error",`Status id "${e.name}" collides with the built-in status value. Built-ins: ${[...cT].join(", ")}.`,{node:e,property:"name"})}checkDuplicateSizeIds(e,r){let n=new Map;for(let i of e.roadmapEntries)if(xo(i)&&i.name){let o=n.get(i.name);o?r("error",`Duplicate size id "${i.name}". First declared at ${xp(o)}.`,{node:i,property:"name"}):n.set(i.name,i)}}checkUtilizationOrdering(e,r){if(ki(e)&&e.entityType!=="swimlane")return;let n=e.properties.find(a=>ke(a)==="utilization-warn-at"),i=e.properties.find(a=>ke(a)==="utilization-over-at");if(!n||!i)return;let o=XI(n.value),s=XI(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(!MI.has(e.entityType)){r("error",`"${e.entityType}" is not a supported entity type for default. Allowed: ${[...MI].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(ki(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=yU[e.entityType];if(o)for(let s of e.properties){let a=ke(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(pp),o=e.roadmapDecl?.properties.find(s=>ke(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=>ke(c)));for(let c of lT)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=ke(i);if(!lT.has(o)){r("error",`Unknown calendar property "${o}". Allowed: ${[...lT].join(", ")}.`,{node:i,property:"key"});continue}n.has(o)&&r("error",`Duplicate calendar property "${o}".`,{node:i,property:"key"}),n.add(o),(!FI.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=ke(i);if(!DI.has(o)){r("error",`Unknown scale property "${o}". Allowed: ${[...DI].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"&&(!FI.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];xo(s)&&s.name?n.has(s.name)||n.set(s.name,o):Ea(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];HI(s,a=>{let c=ke(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(cT.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=DU(e),i=o=>{HI(o,s=>{let a=ke(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")&&Ni.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=uT(e),i=o=>{let s=o.properties??[],a=ar(o)||Mr(o)||Dr(o);for(let c of s){let l=ke(c);if(l!=="after"&&l!=="before")continue;let f=(c.value?[c.value]:c.values).filter(d=>!!d&&Ni.test(d));if(f.length!==0){if(!a){be(r,"error",{node:c},"NL.E0411",{key:l,type:PU(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(yr(o))for(let c of o.content)i(c);else if(Mr(o)||Dr(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 E of m){let _=ke(E);if(_==="after"){let x=E.value?[E.value]:E.values;for(let v of x)v&&(Ni.test(v)||i(p,v))}else if(_==="before"){let x=E.value?[E.value]:E.values;for(let v of x)v&&(Ni.test(v)||i(v,p))}}},s=p=>{let m=p.name,y=p.properties??[];if(o(m,y,e),yr(p))for(let E of p.content)s(E);else if(Mr(p)||Dr(p))for(let E of p.content)s(E)};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 E=u.get(y)??a;if(E===c){let _=m.indexOf(y),x=m.slice(_).concat(y),v=[...x].sort().join("\u2192");f.has(v)||(f.add(v),r("error",`Circular dependency detected: ${x.join(" \u2192 ")}.`,{node:e.roadmapDecl??e}))}else E===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)On(c)?o(c):xr(c)&&s(c)};for(let a of e.roadmapEntries)On(a)?o(a):xr(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 ${xp(l[0].node)}.`,{node:l[u].node})}}checkSymbolDeclaration(e,r){e.name&&gp.has(e.name)&&r("error",`Symbol id "${e.name}" collides with a built-in icon name. Reserved built-ins: ${[...gp].sort().join(", ")}.`,{node:e,property:"name"});let n=e.properties.find(o=>ke(o)==="unicode");n?(!n.value||n.value.length===0)&&r("error",`Symbol "${$r(e)}" unicode: must be a non-empty value.`,{node:n,property:"value"}):r("error",`Symbol "${$r(e)}" requires a "unicode:" property (e.g. unicode:"\u{1F4B0}" or unicode:"\\u{1F464}").`,{node:e});let i=e.properties.find(o=>ke(o)==="ascii");if(i){let o=i.value??"";IU.test(o)||r("error",`Symbol "${$r(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=ke(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(Tl(i)&&i.name){let o=n.get(i.name);o?r("error",`Duplicate symbol id "${i.name}". First declared at ${xp(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];Tl(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||!GI(a)||s==="capacity-icon"&&pT.has(a)||s==="icon"&&gp.has(a))return;let l=n.get(a);if(l===void 0){let u=s==="capacity-icon"?[...pT].sort().join(", "):[...gp].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(xl(s))for(let a of s.properties)i(o,ke(a),a.value,a);else if(ki(s))for(let a of s.properties)i(o,ke(a),a.value,a)}}};function fT(t){return mU.has(t)||wU.test(t)}function GI(t){return/^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(t)}function CU(t){return t?yr(t)?"lane":ar(t)?"item":ki(t)?t.entityType==="swimlane"?"lane":"item":"invalid":"invalid"}function OU(t){return t?!!(yr(t)||ki(t)&&t.entityType==="swimlane"):!1}function XI(t){if(!t||t===jI)return null;if(hT.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?e/100:null}if(zI.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?e:null}return null}function xp(t){let e=t.$cstNode;return e?`line ${e.range.start.line+1}`:"unknown location"}function dT(t){let e=t.$type.replace(/Declaration$|Block$/,"").toLowerCase(),r=t.name??t.title;return r?`${e} "${r}"`:e}function LU(t,e){if(yr(t)){e(t.name,t);for(let r of t.content)mT(r,e)}else On(t)?e(t.name,t):xr(t)?qI(t,e):(hl(t)||yl(t)||ml(t)||gl(t)||xo(t)||Ea(t))&&e(t.name,t)}function qI(t,e){e(t.name,t);for(let r of t.content)xr(r)&&qI(r,e)}function mT(t,e){if(ar(t))e(t.name,t);else if(Mr(t)){e(t.name,t);for(let r of t.content)mT(r,e)}else if(Dr(t)){e(t.name,t);for(let r of t.content)mT(r,e)}}function HI(t,e){let r=n=>{let i=n.properties;if(Array.isArray(i))for(let o of i)e(o);if(yr(n))for(let o of n.content)r(o);else if(Mr(n)||Dr(n))for(let o of n.content)r(o);else if(xr(n))for(let o of n.content)(xr(o)||On(o))&&r(o)};r(t)}function DU(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),yr(n))for(let o of n.content)r(o);else if(Mr(n)||Dr(n))for(let o of n.content)r(o);else if(xr(n))for(let o of n.content)xr(o)||On(o)?r(o):uI(o)};for(let n of t.roadmapEntries)r(n);return e}var gT=class extends Os{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)}},yT=class extends ll{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]===`
2639
- `);)n--;for(;n>=0&&(e[n]===" "||e[n]===" ");)n--;return n<0||e[n]!=="\\"}},VI={parser:{TokenBuilder:()=>new yT({indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[["[","]"]]}),Lexer:t=>new sp(t),ParserConfig:()=>({maxLookahead:4}),ValueConverter:()=>new gT},validation:{NowlineValidator:()=>new Tp}};function xT(t={}){let e=t.shared??oa(op(ap),hI),r=oa(ip({shared:e}),mI,VI);return e.ServiceRegistry.register(r),WI(r),{shared:e,Nowline:r}}function YI(t){return t.endsWith(":")?t.slice(0,-1):t}function ae(t,e){return t.find(r=>YI(r.key)===e)?.value}function ut(t,e){let r=t.find(n=>YI(n.key)===e);return r?r.value!==void 0?[r.value]:[...r.values]:[]}function mt(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 va={mode:"business",daysPerWeek:5,daysPerMonth:22,daysPerQuarter:65,daysPerYear:260},MU={mode:"full",daysPerWeek:7,daysPerMonth:30,daysPerQuarter:91,daysPerYear:365};function KI(t,e){let n=t.roadmapDecl?.properties.find(i=>TT(i.key)==="calendar")?.value??"business";if(n==="business")return{...va};if(n==="full")return{...MU};if(e){let i=(o,s)=>{let a=e.properties.find(l=>TT(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",va.daysPerWeek),daysPerMonth:i("days-per-month",va.daysPerMonth),daysPerQuarter:i("days-per-quarter",va.daysPerQuarter),daysPerYear:i("days-per-year",va.daysPerYear)}}return{...va}}var _p=/^(\d+(?:\.\d+)?)([dwmqy])$/;function Ep(t,e){let r=_p.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 ZI(t,e,r){return t?_p.test(t)?Ep(t,r):e.get(t)?.effortDays??0:0}function Pi(t,e,r){let n=ae(t,"duration");if(n&&_p.test(n))return Ep(n,r);let i=ae(t,"size"),o=i?e.get(i):void 0;if(!o)return 0;let s=qn(ae(t,"capacity"))??1;return o.effortDays/s}function JI(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&&_p.test(o)){let s=qn(ae(t,"capacity"))??1;return Ep(o,r)*s}return 0}function vp(t,e){let r=new Map;for(let[n,i]of t){let s=i.properties.find(c=>TT(c.key)==="effort")?.value;if(!s)continue;let a=Ep(s,e);a<=0||r.set(n,{name:n,title:i.title||void 0,effortDays:a,effortLiteral:s})}return r}function TT(t){return t.endsWith(":")?t.slice(0,-1):t}function Tr(t,e){return Math.round((e.getTime()-t.getTime())/864e5)}function To(t,e){let r=new Date(t.getTime());return r.setUTCDate(r.getUTCDate()+e),r}var bp=class{constructor(e){R(this,"items");R(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 QI(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 $U(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 FU(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 UU(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 BU(t){if(t===0||t>4)return 0;let e=Math.ceil(t/2);return(t%2===1?1:-1)*e*3}function GU(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 ek(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]=GU(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}=$U(s,e),{x:u,forceUnderBar:f}=FU(a,l,s,e),d=c||f;n.push({req:s,channelX:u,underBar:d,orderIndex:o})}let i=UU(n);for(let o of n){let s=BU(i.get(o.orderIndex)??0),a=o.channelX+s;r[o.orderIndex]={fromId:o.req.fromId,toId:o.req.toId,waypoints:XU(o.req.from,o.req.to,a),underBar:o.underBar}}return r}function XU(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 vl="en-US",HU={"en-US":{nowLabel:"now",quarterPrefix:"Q"},fr:{nowLabel:"maint.",quarterPrefix:"T"}};function tk(t,e){return e??t??vl}function wp(t){let e={};for(let r of jU(t)){let n=HU[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 jU(t){let e=[],r=zU(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(vl)||e.push(vl),e}function zU(t){return t.split("-").map((r,n)=>n===0?r.toLowerCase():/^[a-zA-Z]{2}$/.test(r)?r.toUpperCase():r).join("-")}function ok(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 Sp(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 Mn(t){for(let e of t)if(/^\d{4}-\d{2}-\d{2}$/.test(e))return e}function Ap(t,e){return{x:t,y:e,height:0,maxX:t}}var Ra=class{constructor(e){R(this,"rows");R(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)sk(a,i)}}}};function sk(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)sk(r,e)}var ak={red:"#f87171",blue:"#60a5fa",yellow:"#facc15",green:"#34d399",orange:"#fb923c",purple:"#a78bfa",gray:"#94a3b8",navy:"#818cf8",white:"#e2e8f0"},$n={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"},_T={name:"dark",surface:{page:"#0b1220",chart:"#111827",headerBox:"#1e293b"},entities:{roadmap:{...$n,headerHeight:"md",padding:"md"},swimlane:{...$n,fg:"#e2e8f0",text:"#e2e8f0",padding:"sm",spacing:"none",textSize:"sm"},item:{...$n,bg:"#0f172a",fg:"#94a3b8",text:"#e2e8f0",shadow:"subtle",cornerRadius:"sm"},parallel:{...$n,bracket:"none",padding:"xs"},group:{...$n,bracket:"solid",padding:"xs",fg:"#94a3b8"},anchor:{...$n,bg:"#0b1220",fg:"#cbd5e1",text:"#cbd5e1",cornerRadius:"sm"},milestone:{...$n,bg:"#e2e8f0",fg:"#e2e8f0",text:"#0b1220",border:"solid"},footnote:{...$n,bg:"none",fg:"#94a3b8",text:"#e2e8f0",textSize:"sm"},label:{...$n,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 ck={red:"#4a4a4a",blue:"#6b6b6b",green:"#8a8a8a",yellow:"#c8c8c8",orange:"#5c5c5c",purple:"#3a3a3a",gray:"#9e9e9e",navy:"#2a2a2a",white:"#ffffff"},Fn={bg:"none",fg:"#1a1a1a",text:"#1a1a1a",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"},ET={name:"grayscale",surface:{page:"#f5f5f5",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...Fn,headerHeight:"md",padding:"md"},swimlane:{...Fn,fg:"#3a3a3a",text:"#3a3a3a",padding:"sm",spacing:"none",textSize:"sm"},item:{...Fn,bg:"#ffffff",fg:"#9e9e9e",text:"#1a1a1a",shadow:"subtle",cornerRadius:"sm"},parallel:{...Fn,bracket:"none",padding:"xs"},group:{...Fn,bracket:"solid",padding:"xs",fg:"#595959"},anchor:{...Fn,bg:"#1a1a1a",fg:"#1a1a1a",text:"#1a1a1a",cornerRadius:"sm"},milestone:{...Fn,bg:"#2a2a2a",fg:"#2a2a2a",text:"#ffffff",border:"solid"},footnote:{...Fn,bg:"none",fg:"#595959",text:"#595959",textSize:"sm"},label:{...Fn,bg:"#e8e8e8",fg:"#595959",text:"#595959",textSize:"xs",padding:"xs",cornerRadius:"full"}},swimlane:{bandEven:"#ffffff",bandOdd:"#f5f5f5",separator:"#d4d4d4",frameTabText:"#3a3a3a",frameTabMuted:"#737373",border:"#d4d4d4",tabFill:"#e8e8e8",tabStroke:"#bdbdbd",tabText:"#3a3a3a",ownerText:"#737373",footnoteIndicator:"#4a4a4a",rowTintEven:"#ffffff",rowTintOdd:"#f5f5f5",utilizationOk:"#8a8a8a",utilizationWarn:"#595959",utilizationOver:"#1a1a1a"},timeline:{gridLine:"#bdbdbd",minorGridLine:"#d4d4d4",tickMark:"#bdbdbd",labelText:"#737373",panelFill:"#ffffff",border:"#d4d4d4"},header:{cardBorder:"#d4d4d4",author:"#737373"},item:{overflowX:"#1a1a1a",linkIconFg:"#1a1a1a",overflowTailFill:"#e8e8e8",overflowTailStroke:"#4a4a4a",overflowCaption:"#3a3a3a"},parallel:{bracketStroke:"#3a3a3a"},anchorDiamond:{fill:"#ffffff",stroke:"#3a3a3a",label:"#3a3a3a",cutLine:"#737373"},milestoneDiamond:{fill:"#1a1a1a",label:"#1a1a1a",cutLineNormal:"#2a2a2a",cutLineOverrun:"#4a4a4a",slack:"#1a1a1a"},footnotePanel:{fill:"#ffffff",border:"#d4d4d4",header:"#1a1a1a",title:"#1a1a1a",description:"#737373",number:"#4a4a4a"},nowline:{stroke:"#1a1a1a",labelText:"#ffffff",labelBg:"#1a1a1a"},milestone:{dashedInk:"#9e9e9e",overrun:"#4a4a4a"},anchor:{predecessorLine:"#9e9e9e"},dependency:{edgeStroke:"#595959",overflowStroke:"#1a1a1a"},footnote:{indicatorText:"#4a4a4a",descriptionMuted:"#737373"},includeRegion:{border:"#9e9e9e",label:"#3a3a3a",badge:"#737373",fill:"#f5f5f5",tabFill:"#ffffff",tabStroke:"#bdbdbd",tabText:"#1a1a1a",badgeFill:"#e8e8e8",badgeStroke:"#bdbdbd",badgeText:"#595959"},arrowhead:{neutral:"#595959",light:"#9e9e9e",dark:"#1a1a1a"},status:{done:"#8a8a8a",inProgress:"#595959",atRisk:"#737373",blocked:"#3a3a3a",planned:"#bdbdbd",neutral:"#bdbdbd"},statusDot:{onLight:{done:"#3a3a3a",inProgress:"#2a2a2a",atRisk:"#4a4a4a",blocked:"#1a1a1a",planned:"#595959",neutral:"#595959"},onDark:{done:"#d4d4d4",inProgress:"#e8e8e8",atRisk:"#c8c8c8",blocked:"#f0f0f0",planned:"#d4d4d4",neutral:"#d4d4d4"}},attribution:{mark:"#9e9e9e",link:"#1a1a1a"},diagnostic:{overlayBg:"#e8e8e8",errorText:"#1a1a1a"}};var lk={red:"#e53935",blue:"#1e88e5",yellow:"#fdd835",green:"#43a047",orange:"#fb8c00",purple:"#8e24aa",gray:"#9e9e9e",navy:"#0d47a1",white:"#ffffff"},Un={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"},vT={name:"light",surface:{page:"#f8fafc",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...Un,headerHeight:"md",padding:"md"},swimlane:{...Un,fg:"#334155",text:"#334155",padding:"sm",spacing:"none",textSize:"sm"},item:{...Un,bg:"#ffffff",fg:"#94a3b8",text:"#0f172a",shadow:"subtle",cornerRadius:"sm"},parallel:{...Un,bracket:"none",padding:"xs"},group:{...Un,bracket:"solid",padding:"xs",fg:"#475569"},anchor:{...Un,bg:"#0f172a",fg:"#0f172a",text:"#0f172a",cornerRadius:"sm"},milestone:{...Un,bg:"#312e81",fg:"#312e81",text:"#ffffff",border:"solid"},footnote:{...Un,bg:"none",fg:"#475569",text:"#475569",textSize:"sm"},label:{...Un,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 bT={light:vT,dark:_T,grayscale:ET};var YU={greyscale:"grayscale"};function wT(t){let e=t.toLowerCase(),r=YU[e]??e;if(r==="light"||r==="dark"||r==="grayscale")return r}var KU={grey:"gray",violet:"purple"};function _o(t,e){if(t==="none")return"none";if(t.startsWith("#"))return t;let r=e.name==="dark"?ak:e.name==="grayscale"?ck:lk,n=KU[t]??t,i=r[n];return typeof i=="string"?i:t}function Sa(t){return t.key.endsWith(":")?t.key.slice(0,-1):t.key}function ZU(t,e){return{bg:_o(t.bg,e),fg:_o(t.fg,e),text:_o(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 RT(t,e,r,n){switch(e){case"bg":t.bg=_o(r,n);break;case"fg":t.fg=_o(r,n);break;case"text":t.text=_o(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=Rl(r,"xl");break;case"padding":t.padding=Rl(r,"xl");break;case"spacing":t.spacing=Rl(r,"xl");break;case"header-height":t.headerHeight=Rl(r,"xl");break;case"corner-radius":t.cornerRadius=Rl(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 Rl(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 uk(t,e,r){if(e)for(let n of e.properties)RT(t,Sa(n),n.value,r)}function JU(t,e,r){for(let n of e){let i=Sa(n);n.value!==void 0&&RT(t,i,n.value,r)}}function QU(t,e,r){let n=e.find(o=>Sa(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=>Sa(c)==="style");a?.value&&uk(t,r.styles.get(a.value),r.theme)}}function eB(t,e,r){let n=e.find(i=>Sa(i)==="style");n?.value&&uk(t,r.styles.get(n.value),r.theme)}function ft(t,e,r){let n=r.theme.entities[t],i=ZU(n,r.theme),o=r.defaults.get(t);if(o)for(let s of o.properties)s.value!==void 0&&RT(i,Sa(s),s.value,r.theme);return QU(i,e,r),eB(i,e,r),JU(i,e,r.theme),i}function fk(t,e){return ft("label",t.properties,e)}var dk={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 Aa={none:0,xs:10,sm:12,md:14,lg:18,xl:24},Ip={none:0,xs:2,sm:4,md:8,lg:12,xl:20,full:9999};var _r=8,an=4,Sl=24,kp=15,Al=8,Np=22,Pp=15,Il=16,Cp=6,ST=4,AT=11,IT=9,kT=5.5,NT=4,Ia=12,Op="6 4",PT=36,Ci=16,CT=Ci/2,kl=10,OT=Ci-4,ka=6,Lp=2.25,Fr=6,Ur=2*Fr,hk=5,mk=120,LT=240,Dp=72,Nl=28,Br=16,DT=22,Pl=18,Mp="Powered by",MT="https://nowline.io",Cl=.22,Oi=40,$p=32,gk=.58,tB=Mp.length*$p*gk,rB=10,Ol=tB+rB,$T=Ol+74,FT=5,Fp=Ol+81,nB=3*Oi*gk,iB=Fp+nB,oB=12+Oi,UT=iB*Cl,yk=oB*Cl,BT=4;var GT={sans:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',serif:'Georgia, "Times New Roman", serif',mono:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"},xk={days:7,weeks:4,months:3,quarters:4,years:5};var Up=class{constructor(e,r){R(this,"node");R(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=ft("group",n.properties,r.styleCtx),s=e.x,a=n.title??n.name,c=r.currentFlowKey;r.nextGroupId+=1,r.currentFlowKey=`${c}/group:${n.name??`group-${r.nextGroupId}`}`;let l=o.bg!=="none"&&o.bg!=="#ffffff"&&!!a,u=l?Il+ST:0,f=l?NT:0,d=!l&&a?Ia:0,p=e.y+d,m=r.bandScale.step(),y=s,E=new Ra({laneLeftX:y,originY:p+u,minRowHeight:m,slackCorridors:r.slackCorridors}),_=y,x=[];for(let H of n.content){if(H.$type==="DescriptionDirective")continue;if(!ar(H)){let ne=H.properties??[],Re=i.resolveChildStart(ne,_,y,r),{rowIndex:Se,y:$e}=E.placeBlock(),q=i.newCursor(Re,$e),Q=i.sequenceOne(H,q,r);x.push(Q);let re=Q.box.x+Q.box.width,M=Math.max(m,q.height);E.commitBlock({rowIndex:Se,placed:Q,blockHeight:M,blockEnd:re}),_=Math.max(_,re);continue}let oe=H.properties,$=i.resolveChildStart(oe,_,y,r),w=Pi(oe,r.sizes,r.cal),D=Math.max(_r,w*r.timeline.pixelsPerDay),U=$+D,S=H.name??"",A=i.predictItemChipExtraHeight(H,r),I=m+A,{rowIndex:B,y:z}=E.placeItem({childId:S,desiredStart:$,desiredEnd:U,predictedHeight:I}),j=i.newCursor($,z),V=i.sequenceItem(H,j,r);x.push(V);let K=V.box.x+V.box.width+Fr;_=Math.max(_,K);let ue=null;(V.textSpills||V.chipsOutside||V.dotSpills||V.iconSpills||V.footnoteSpills)&&(ue=Math.max(V.decorationsRightX,V.chipsOutside?V.chipsRightX:0)+6),E.commitItem({rowIndex:B,placed:V,logicalEnd:K,spillReservation:ue,rowHeight:I})}let v=Math.max(m,E.usedHeight()),k=Math.max(_,E.usedRightX()),F={x:s,y:p,width:k-s,height:u+v+f};e.x=_+Al,e.maxX=Math.max(e.maxX,e.x);let O=r.bandScale.step()-r.bandScale.bandwidth();e.height=Math.max(e.height,d+F.height+O);let L=n.name;L&&(r.entityLeftEdges.set(L,F.x),r.entityRightEdges.set(L,F.x+F.width)),r.currentFlowKey=c;let G=Sp({box:F,afterDate:Mn(ut(n.properties,"after")),beforeDate:Mn(ut(n.properties,"before"))});return{kind:"group",id:L,title:a,box:F,children:x,style:o,inlineDatePins:G.length>0?G:void 0}}};var XT=12,sB=4,aB=13,cB=11;function Tk(t,e){return t.length*e*.58}var Bp=class{constructor(e){R(this,"input");this.input=e}get id(){return this.input.id}measure(e){return{width:Math.max(_r,this.input.logicalRightX-this.input.logicalLeftX),height:e.bands.bandwidth()}}place(e,r){let n=this.measure(r),i=Math.max(_r,n.width-2*Fr),o=e.x+Fr,s={x:o,y:e.y,width:i,height:n.height},a=this.input.hasLinkIcon?20+lB-XT:0,c=XT+Math.max(0,a),l=Math.max(0,i-c-XT),u=this.input.title,f=u?Tk(u,aB):0,d=this.input.metaText?Tk(this.input.metaText,cB):0,p=this.input.metaTrailingWidth??0,m=d+p,y=this.input.metaText!==void 0||p>0,E=u.length>0&&f>l||y&&m>l,_=E?o+i+sB:o+c;return{id:this.input.id,box:s,textX:_,textSpills:E}}},lB=4;var Gp=class{constructor(e,r){R(this,"node");R(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=ft("parallel",n.properties,r.styleCtx),s=e.x,a=e.y,c=[],l=s,u=0,f=r.currentFlowKey;r.nextParallelId+=1;let d=n.name??`parallel-${r.nextParallelId}`,p=0;for(let _ of n.content){if(_.$type==="DescriptionDirective")continue;r.currentFlowKey=`${f}/par:${d}#${p}`;let x=i.newCursor(s,a+u),v=i.sequenceOne(_,x,r);c.push(v),u+=Math.max(r.bandScale.step(),x.height),l=Math.max(l,x.maxX),p++}r.currentFlowKey=f;let m={x:s,y:a,width:l-s,height:u};e.x=l+Al,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 E=Sp({box:m,afterDate:Mn(ut(n.properties,"after")),beforeDate:Mn(ut(n.properties,"before"))});return{kind:"parallel",id:y,title:n.title??n.name,box:m,children:c,style:o,inlineDatePins:E.length>0?E:void 0}}};function Eo(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function HT(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function vo(t){let e,r,n;t.length!==2?(e=Eo,r=(a,c)=>Eo(t(a),c),n=(a,c)=>t(a)-c):(e=t===Eo||t===HT?t:uB,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 uB(){return 0}function jT(t){return t===null?NaN:+t}var _k=vo(Eo),Ek=_k.right,fB=_k.left,dB=vo(jT).center,zT=Ek;var Na=class extends Map{constructor(e,r=mB){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(vk(this,e))}has(e){return super.has(vk(this,e))}set(e,r){return super.set(pB(this,e),r)}delete(e){return super.delete(hB(this,e))}};function vk({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):r}function pB({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function hB({_intern:t,_key:e},r){let n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function mB(t){return t!==null&&typeof t=="object"?t.valueOf():t}var gB=Math.sqrt(50),yB=Math.sqrt(10),xB=Math.sqrt(2);function bk(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>=gB?10:o>=yB?5:o>=xB?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?bk(t,e,r*2):[a,c,l]}function WT(t,e,r){return e=+e,t=+t,r=+r,bk(t,e,r)[2]}function Xp(t,e,r){e=+e,t=+t,r=+r;let n=e<t,i=n?WT(e,t,r):WT(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}function Hp(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 Pa(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}var wk=Symbol("implicit");function jp(){var t=new Na,e=[],r=[],n=wk;function i(o){let s=t.get(o);if(s===void 0){if(n!==wk)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 Na;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 jp(e,r).unknown(n)},Pa.apply(i,arguments),i}function Ll(){var t=jp().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 E=Hp(d).map(function(_){return m+o*_});return r(p?E.reverse():E)}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 Ll(e(),[n,i]).round(a).paddingInner(c).paddingOuter(l).align(u)},Pa.apply(f(),arguments)}function zp(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function qT(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function $l(){}var Dl=.7,Vp=1/Dl,Ca="\\s*([+-]?\\d+)\\s*",Ml="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",cn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",TB=/^#([0-9a-f]{3,8})$/,_B=new RegExp(`^rgb\\(${Ca},${Ca},${Ca}\\)$`),EB=new RegExp(`^rgb\\(${cn},${cn},${cn}\\)$`),vB=new RegExp(`^rgba\\(${Ca},${Ca},${Ca},${Ml}\\)$`),bB=new RegExp(`^rgba\\(${cn},${cn},${cn},${Ml}\\)$`),wB=new RegExp(`^hsl\\(${Ml},${cn},${cn}\\)$`),RB=new RegExp(`^hsla\\(${Ml},${cn},${cn},${Ml}\\)$`),Rk={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};zp($l,Li,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Sk,formatHex:Sk,formatHex8:SB,formatHsl:AB,formatRgb:Ak,toString:Ak});function Sk(){return this.rgb().formatHex()}function SB(){return this.rgb().formatHex8()}function AB(){return Ok(this).formatHsl()}function Ak(){return this.rgb().formatRgb()}function Li(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=TB.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?Ik(e):r===3?new Jt(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?Wp(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?Wp(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=_B.exec(t))?new Jt(e[1],e[2],e[3],1):(e=EB.exec(t))?new Jt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=vB.exec(t))?Wp(e[1],e[2],e[3],e[4]):(e=bB.exec(t))?Wp(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=wB.exec(t))?Pk(e[1],e[2]/100,e[3]/100,1):(e=RB.exec(t))?Pk(e[1],e[2]/100,e[3]/100,e[4]):Rk.hasOwnProperty(t)?Ik(Rk[t]):t==="transparent"?new Jt(NaN,NaN,NaN,0):null}function Ik(t){return new Jt(t>>16&255,t>>8&255,t&255,1)}function Wp(t,e,r,n){return n<=0&&(t=e=r=NaN),new Jt(t,e,r,n)}function IB(t){return t instanceof $l||(t=Li(t)),t?(t=t.rgb(),new Jt(t.r,t.g,t.b,t.opacity)):new Jt}function Oa(t,e,r,n){return arguments.length===1?IB(t):new Jt(t,e,r,n??1)}function Jt(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}zp(Jt,Oa,qT($l,{brighter(t){return t=t==null?Vp:Math.pow(Vp,t),new Jt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Dl:Math.pow(Dl,t),new Jt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Jt(wo(this.r),wo(this.g),wo(this.b),Yp(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:kk,formatHex:kk,formatHex8:kB,formatRgb:Nk,toString:Nk}));function kk(){return`#${bo(this.r)}${bo(this.g)}${bo(this.b)}`}function kB(){return`#${bo(this.r)}${bo(this.g)}${bo(this.b)}${bo((isNaN(this.opacity)?1:this.opacity)*255)}`}function Nk(){let t=Yp(this.opacity);return`${t===1?"rgb(":"rgba("}${wo(this.r)}, ${wo(this.g)}, ${wo(this.b)}${t===1?")":`, ${t})`}`}function Yp(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function wo(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function bo(t){return t=wo(t),(t<16?"0":"")+t.toString(16)}function Pk(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Gr(t,e,r,n)}function Ok(t){if(t instanceof Gr)return new Gr(t.h,t.s,t.l,t.opacity);if(t instanceof $l||(t=Li(t)),!t)return new Gr;if(t instanceof Gr)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 Gr(s,a,c,t.opacity)}function Lk(t,e,r,n){return arguments.length===1?Ok(t):new Gr(t,e,r,n??1)}function Gr(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}zp(Gr,Lk,qT($l,{brighter(t){return t=t==null?Vp:Math.pow(Vp,t),new Gr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Dl:Math.pow(Dl,t),new Gr(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 Jt(VT(t>=240?t-240:t+120,i,n),VT(t,i,n),VT(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Gr(Ck(this.h),qp(this.s),qp(this.l),Yp(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=Yp(this.opacity);return`${t===1?"hsl(":"hsla("}${Ck(this.h)}, ${qp(this.s)*100}%, ${qp(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Ck(t){return t=(t||0)%360,t<0?t+360:t}function qp(t){return Math.max(0,Math.min(1,t||0))}function VT(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 YT(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 Dk(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 YT((r-n/e)*e,s,i,o,a)}}function Mk(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 YT((r-n/e)*e,i,o,s,a)}}var Fl=t=>()=>t;function NB(t,e){return function(r){return t+r*e}}function PB(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 $k(t){return(t=+t)==1?Kp:function(e,r){return r-e?PB(e,r,t):Fl(isNaN(e)?r:e)}}function Kp(t,e){var r=e-t;return r?NB(t,r):Fl(isNaN(t)?e:t)}var KT=(function t(e){var r=$k(e);function n(i,o){var s=r((i=Oa(i)).r,(o=Oa(o)).r),a=r(i.g,o.g),c=r(i.b,o.b),l=Kp(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 Fk(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=Oa(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 ure=Fk(Dk),fre=Fk(Mk);function Uk(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 Bk(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Gk(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]=Ro(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 Xk(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function Di(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Hk(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]=Ro(t[i],e[i]):n[i]=e[i];return function(o){for(i in r)n[i]=r[i](o);return n}}var JT=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ZT=new RegExp(JT.source,"g");function CB(t){return function(){return t}}function OB(t){return function(e){return t(e)+""}}function jk(t,e){var r=JT.lastIndex=ZT.lastIndex=0,n,i,o,s=-1,a=[],c=[];for(t=t+"",e=e+"";(n=JT.exec(t))&&(i=ZT.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:Di(n,i)})),r=ZT.lastIndex;return r<e.length&&(o=e.slice(r),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?OB(c[0].x):CB(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 Ro(t,e){var r=typeof e,n;return e==null||r==="boolean"?Fl(e):(r==="number"?Di:r==="string"?(n=Li(e))?(e=n,KT):jk:e instanceof Li?KT:e instanceof Date?Xk:Bk(e)?Uk:Array.isArray(e)?Gk:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Hk:Di)(t,e)}function QT(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function e_(t){return function(){return t}}function t_(t){return+t}var zk=[0,1];function La(t){return t}function r_(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:e_(isNaN(e)?NaN:.5)}function LB(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function DB(t,e,r){var n=t[0],i=t[1],o=e[0],s=e[1];return i<n?(n=r_(i,n),o=r(s,o)):(n=r_(n,i),o=r(o,s)),function(a){return o(n(a))}}function MB(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]=r_(t[s],t[s+1]),o[s]=r(e[s],e[s+1]);return function(a){var c=zT(t,a,1,n)-1;return o[c](i[c](a))}}function Wk(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function $B(){var t=zk,e=zk,r=Ro,n,i,o,s=La,a,c,l;function u(){var d=Math.min(t.length,e.length);return s!==La&&(s=LB(t[0],t[d-1])),a=d>2?MB:DB,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),Di)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,t_),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=QT,u()},f.clamp=function(d){return arguments.length?(s=d?!0:La,u()):s!==La},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 n_(){return $B()(La,La)}function i_(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 o_=new Date,s_=new Date;function We(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=>We(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)=>(o_.setTime(+o),s_.setTime(+s),t(o_),t(s_),Math.floor(r(o_,s_))),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 Ul=We(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Ul.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?We(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):Ul);var qre=Ul.range;var ln=We(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),qk=ln.range;var Da=We(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),FB=Da.range,Zp=We(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),UB=Zp.range;var Ma=We(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()),BB=Ma.range,Jp=We(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),GB=Jp.range;var Bn=We(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),XB=Bn.range,Gl=We(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),HB=Gl.range,Qp=We(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),jB=Qp.range;function Io(t){return We(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 Gn=Io(0),$a=Io(1),Yk=Io(2),Kk=Io(3),Mi=Io(4),Zk=Io(5),Jk=Io(6),Qk=Gn.range,zB=$a.range,WB=Yk.range,qB=Kk.range,VB=Mi.range,YB=Zk.range,KB=Jk.range;function ko(t){return We(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 No=ko(0),Fa=ko(1),eN=ko(2),tN=ko(3),$i=ko(4),rN=ko(5),nN=ko(6),iN=No.range,ZB=Fa.range,JB=eN.range,QB=tN.range,e4=$i.range,t4=rN.range,r4=nN.range;var Ua=We(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()),n4=Ua.range,eh=We(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()),i4=eh.range;var cr=We(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());cr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:We(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 o4=cr.range,Xr=We(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());Xr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:We(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 s4=Xr.range;function sN(t,e,r,n,i,o){let s=[[ln,1,1e3],[ln,5,5*1e3],[ln,15,15*1e3],[ln,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=vo(([,,E])=>E).right(s,d);if(p===s.length)return t.every(Xp(l/31536e6,u/31536e6,f));if(p===0)return Ul.every(Math.max(Xp(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[c4,l4]=sN(Xr,eh,No,Qp,Jp,Zp),[a_,c_]=sN(cr,Ua,Gn,Bn,Ma,Da);function l_(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 u_(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 Xl(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function f_(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=Hl(i),u=jl(i),f=Hl(o),d=jl(o),p=Hl(s),m=jl(s),y=Hl(a),E=jl(a),_=Hl(c),x=jl(c),v={a:I,A:B,b:z,B:j,c:null,d:dN,e:dN,f:C4,g:X4,G:j4,H:k4,I:N4,j:P4,L:yN,m:O4,M:L4,p:V,q:K,Q:mN,s:gN,S:D4,u:M4,U:$4,V:F4,w:U4,W:B4,x:null,X:null,y:G4,Y:H4,Z:z4,"%":hN},k={a:ue,A:Y,b:ne,B:Re,c:null,d:pN,e:pN,f:Y4,g:o3,G:a3,H:W4,I:q4,j:V4,L:TN,m:K4,M:Z4,p:Se,q:$e,Q:mN,s:gN,S:J4,u:Q4,U:e3,V:t3,w:r3,W:n3,x:null,X:null,y:i3,Y:s3,Z:c3,"%":hN},F={a:oe,A:$,b:w,B:D,c:U,d:uN,e:uN,f:R4,g:lN,G:cN,H:fN,I:fN,j:E4,L:w4,m:_4,M:v4,p:H,q:T4,Q:A4,s:I4,S:b4,u:h4,U:m4,V:g4,w:p4,W:y4,x:S,X:A,y:lN,Y:cN,Z:x4,"%":S4};v.x=O(r,v),v.X=O(n,v),v.c=O(e,v),k.x=O(r,k),k.X=O(n,k),k.c=O(e,k);function O(q,Q){return function(re){var M=[],de=-1,pe=0,Ne=q.length,at,W,er;for(re instanceof Date||(re=new Date(+re));++de<Ne;)q.charCodeAt(de)===37&&(M.push(q.slice(pe,de)),(W=aN[at=q.charAt(++de)])!=null?at=q.charAt(++de):W=at==="e"?" ":"0",(er=Q[at])&&(at=er(re,W)),M.push(at),pe=de+1);return M.push(q.slice(pe,de)),M.join("")}}function L(q,Q){return function(re){var M=Xl(1900,void 0,1),de=G(M,q,re+="",0),pe,Ne;if(de!=re.length)return null;if("Q"in M)return new Date(M.Q);if("s"in M)return new Date(M.s*1e3+("L"in M?M.L:0));if(Q&&!("Z"in M)&&(M.Z=0),"p"in M&&(M.H=M.H%12+M.p*12),M.m===void 0&&(M.m="q"in M?M.q:0),"V"in M){if(M.V<1||M.V>53)return null;"w"in M||(M.w=1),"Z"in M?(pe=u_(Xl(M.y,0,1)),Ne=pe.getUTCDay(),pe=Ne>4||Ne===0?Fa.ceil(pe):Fa(pe),pe=Gl.offset(pe,(M.V-1)*7),M.y=pe.getUTCFullYear(),M.m=pe.getUTCMonth(),M.d=pe.getUTCDate()+(M.w+6)%7):(pe=l_(Xl(M.y,0,1)),Ne=pe.getDay(),pe=Ne>4||Ne===0?$a.ceil(pe):$a(pe),pe=Bn.offset(pe,(M.V-1)*7),M.y=pe.getFullYear(),M.m=pe.getMonth(),M.d=pe.getDate()+(M.w+6)%7)}else("W"in M||"U"in M)&&("w"in M||(M.w="u"in M?M.u%7:"W"in M?1:0),Ne="Z"in M?u_(Xl(M.y,0,1)).getUTCDay():l_(Xl(M.y,0,1)).getDay(),M.m=0,M.d="W"in M?(M.w+6)%7+M.W*7-(Ne+5)%7:M.w+M.U*7-(Ne+6)%7);return"Z"in M?(M.H+=M.Z/100|0,M.M+=M.Z%100,u_(M)):l_(M)}}function G(q,Q,re,M){for(var de=0,pe=Q.length,Ne=re.length,at,W;de<pe;){if(M>=Ne)return-1;if(at=Q.charCodeAt(de++),at===37){if(at=Q.charAt(de++),W=F[at in aN?Q.charAt(de++):at],!W||(M=W(q,re,M))<0)return-1}else if(at!=re.charCodeAt(M++))return-1}return M}function H(q,Q,re){var M=l.exec(Q.slice(re));return M?(q.p=u.get(M[0].toLowerCase()),re+M[0].length):-1}function oe(q,Q,re){var M=p.exec(Q.slice(re));return M?(q.w=m.get(M[0].toLowerCase()),re+M[0].length):-1}function $(q,Q,re){var M=f.exec(Q.slice(re));return M?(q.w=d.get(M[0].toLowerCase()),re+M[0].length):-1}function w(q,Q,re){var M=_.exec(Q.slice(re));return M?(q.m=x.get(M[0].toLowerCase()),re+M[0].length):-1}function D(q,Q,re){var M=y.exec(Q.slice(re));return M?(q.m=E.get(M[0].toLowerCase()),re+M[0].length):-1}function U(q,Q,re){return G(q,e,Q,re)}function S(q,Q,re){return G(q,r,Q,re)}function A(q,Q,re){return G(q,n,Q,re)}function I(q){return s[q.getDay()]}function B(q){return o[q.getDay()]}function z(q){return c[q.getMonth()]}function j(q){return a[q.getMonth()]}function V(q){return i[+(q.getHours()>=12)]}function K(q){return 1+~~(q.getMonth()/3)}function ue(q){return s[q.getUTCDay()]}function Y(q){return o[q.getUTCDay()]}function ne(q){return c[q.getUTCMonth()]}function Re(q){return a[q.getUTCMonth()]}function Se(q){return i[+(q.getUTCHours()>=12)]}function $e(q){return 1+~~(q.getUTCMonth()/3)}return{format:function(q){var Q=O(q+="",v);return Q.toString=function(){return q},Q},parse:function(q){var Q=L(q+="",!1);return Q.toString=function(){return q},Q},utcFormat:function(q){var Q=O(q+="",k);return Q.toString=function(){return q},Q},utcParse:function(q){var Q=L(q+="",!0);return Q.toString=function(){return q},Q}}}var aN={"-":"",_:" ",0:"0"},kt=/^\s*\d+/,u4=/^%/,f4=/[\\^$*+?|[\]().{}]/g;function Pe(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 d4(t){return t.replace(f4,"\\$&")}function Hl(t){return new RegExp("^(?:"+t.map(d4).join("|")+")","i")}function jl(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function p4(t,e,r){var n=kt.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function h4(t,e,r){var n=kt.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function m4(t,e,r){var n=kt.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function g4(t,e,r){var n=kt.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function y4(t,e,r){var n=kt.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function cN(t,e,r){var n=kt.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function lN(t,e,r){var n=kt.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function x4(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 T4(t,e,r){var n=kt.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function _4(t,e,r){var n=kt.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function uN(t,e,r){var n=kt.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function E4(t,e,r){var n=kt.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function fN(t,e,r){var n=kt.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function v4(t,e,r){var n=kt.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function b4(t,e,r){var n=kt.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function w4(t,e,r){var n=kt.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function R4(t,e,r){var n=kt.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function S4(t,e,r){var n=u4.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function A4(t,e,r){var n=kt.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function I4(t,e,r){var n=kt.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function dN(t,e){return Pe(t.getDate(),e,2)}function k4(t,e){return Pe(t.getHours(),e,2)}function N4(t,e){return Pe(t.getHours()%12||12,e,2)}function P4(t,e){return Pe(1+Bn.count(cr(t),t),e,3)}function yN(t,e){return Pe(t.getMilliseconds(),e,3)}function C4(t,e){return yN(t,e)+"000"}function O4(t,e){return Pe(t.getMonth()+1,e,2)}function L4(t,e){return Pe(t.getMinutes(),e,2)}function D4(t,e){return Pe(t.getSeconds(),e,2)}function M4(t){var e=t.getDay();return e===0?7:e}function $4(t,e){return Pe(Gn.count(cr(t)-1,t),e,2)}function xN(t){var e=t.getDay();return e>=4||e===0?Mi(t):Mi.ceil(t)}function F4(t,e){return t=xN(t),Pe(Mi.count(cr(t),t)+(cr(t).getDay()===4),e,2)}function U4(t){return t.getDay()}function B4(t,e){return Pe($a.count(cr(t)-1,t),e,2)}function G4(t,e){return Pe(t.getFullYear()%100,e,2)}function X4(t,e){return t=xN(t),Pe(t.getFullYear()%100,e,2)}function H4(t,e){return Pe(t.getFullYear()%1e4,e,4)}function j4(t,e){var r=t.getDay();return t=r>=4||r===0?Mi(t):Mi.ceil(t),Pe(t.getFullYear()%1e4,e,4)}function z4(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Pe(e/60|0,"0",2)+Pe(e%60,"0",2)}function pN(t,e){return Pe(t.getUTCDate(),e,2)}function W4(t,e){return Pe(t.getUTCHours(),e,2)}function q4(t,e){return Pe(t.getUTCHours()%12||12,e,2)}function V4(t,e){return Pe(1+Gl.count(Xr(t),t),e,3)}function TN(t,e){return Pe(t.getUTCMilliseconds(),e,3)}function Y4(t,e){return TN(t,e)+"000"}function K4(t,e){return Pe(t.getUTCMonth()+1,e,2)}function Z4(t,e){return Pe(t.getUTCMinutes(),e,2)}function J4(t,e){return Pe(t.getUTCSeconds(),e,2)}function Q4(t){var e=t.getUTCDay();return e===0?7:e}function e3(t,e){return Pe(No.count(Xr(t)-1,t),e,2)}function _N(t){var e=t.getUTCDay();return e>=4||e===0?$i(t):$i.ceil(t)}function t3(t,e){return t=_N(t),Pe($i.count(Xr(t),t)+(Xr(t).getUTCDay()===4),e,2)}function r3(t){return t.getUTCDay()}function n3(t,e){return Pe(Fa.count(Xr(t)-1,t),e,2)}function i3(t,e){return Pe(t.getUTCFullYear()%100,e,2)}function o3(t,e){return t=_N(t),Pe(t.getUTCFullYear()%100,e,2)}function s3(t,e){return Pe(t.getUTCFullYear()%1e4,e,4)}function a3(t,e){var r=t.getUTCDay();return t=r>=4||r===0?$i(t):$i.ceil(t),Pe(t.getUTCFullYear()%1e4,e,4)}function c3(){return"+0000"}function hN(){return"%"}function mN(t){return+t}function gN(t){return Math.floor(+t/1e3)}var Ba,th,EN,vN,bN;d_({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 d_(t){return Ba=f_(t),th=Ba.format,EN=Ba.parse,vN=Ba.utcFormat,bN=Ba.utcParse,Ba}function l3(t){return new Date(t)}function u3(t){return t instanceof Date?+t:+new Date(+t)}function wN(t,e,r,n,i,o,s,a,c,l){var u=n_(),f=u.invert,d=u.domain,p=l(".%L"),m=l(":%S"),y=l("%I:%M"),E=l("%I %p"),_=l("%a %d"),x=l("%b %d"),v=l("%B"),k=l("%Y");function F(O){return(c(O)<O?p:a(O)<O?m:s(O)<O?y:o(O)<O?E:n(O)<O?i(O)<O?_:x:r(O)<O?v:k)(O)}return u.invert=function(O){return new Date(f(O))},u.domain=function(O){return arguments.length?d(Array.from(O,u3)):d().map(l3)},u.ticks=function(O){var L=d();return t(L[0],L[L.length-1],O??10)},u.tickFormat=function(O,L){return L==null?F:l(L)},u.nice=function(O){var L=d();return(!O||typeof O.range!="function")&&(O=e(L[0],L[L.length-1],O??10)),O?d(i_(L,O)):u},u.copy=function(){return Wk(u,wN(t,e,r,n,i,o,s,a,c,l))},u}function rh(){return Pa.apply(wN(a_,c_,cr,Ua,Gn,Bn,Ma,Da,ln,th).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}var p_=class t{constructor(e,r,n){R(this,"bandwidthPx");R(this,"stepPx");R(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=Ll().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}},f3={bandwidth:56,step:64};function RN(){return p_.fixedRow(f3)}var nh=class{constructor(e){R(this,"domain");R(this,"range");R(this,"pixelsPerDay");R(this,"calendar");R(this,"d3");this.domain=e.domain,this.range=e.range,this.calendar=e.calendar;let r=Math.max(1,Tr(e.domain[0],e.domain[1]));this.pixelsPerDay=(e.range[1]-e.range[0])/r,this.d3=rh().domain(e.domain).range(e.range)}forward(e){let r=Tr(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 ih(t){return t.endsWith(":")?t.slice(0,-1):t}function SN(t,e){let n=t.roadmapDecl?.properties.find(c=>ih(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=oh(i)*l,s=1}}let a=s??xk[i]??4;if(e){let l=e.properties.find(m=>ih(m.key)==="unit")?.value??i,u=e.properties.find(m=>ih(m.key)==="label-every"),f=e.properties.find(m=>ih(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)||oh(l)):o??oh(l);return{unit:l,labelEvery:d,pixelsPerUnit:p}}return{unit:i,labelEvery:a,pixelsPerUnit:o??oh(i)}}function oh(t){switch(t){case"days":return hk;case"weeks":return 40;case"months":return 80;case"quarters":return 160;case"years":return 320}}function AN(t,e,r,n=vl){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?d3(e.unit,To(t.domain[0],u),l,n):void 0})}return c}function d3(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`${wp(n).quarterPrefix}${i} ${e.getUTCFullYear()}`}case"years":return`${e.getUTCFullYear()}`}}function IN(t){return{daysPerUnit:e=>h_(e,t),addUnits:(e,r,n)=>To(e,r*h_(n,t)),isWorkingDay:()=>!0}}function kN(t,e){return h_(t,e)}function h_(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 m_=class{constructor(e,r){R(this,"id");R(this,"anchor");this.id=e,this.anchor=r}place(e,r){let n=ae(this.anchor.properties,"date"),i=mt(n);if(!i)return null;let o=e.scale.forwardWithinDomain(i);if(o===null)return null;let s=ft("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 PN(t,e,r){let n=[];for(let[i,o]of t){let s=new m_(i,o).place(e,r);s&&n.push(s)}return n}function g_(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,ut(l.properties,"on")),n.push({number:f,title:l.title??c,description:l.description?.text,style:ft("footnote",l.properties,e.styleCtx)})}),{area:{box:{x:Br,y:r+Br,width:e.chartRightX-2*Br,height:n.length===0?0:Nl+n.length*Pl+Br},entries:n},index:i,hosts:o}}var p3=.8,h3=1;function m3(t){let e=[];return ON(t,e),e}function ON(t,e){for(let r of t)if(r.kind==="item"){let n=g3(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")&&ON(r.children,e)}function g3(t){return t.capacity?t.capacity.value:t.size?1:0}function LN(t){if(t.capacityValue<=0||t.warnFraction===null&&t.overFraction===null)return null;let e=m3(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:y3(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 y3(t,e,r,n){let i=t/e;return n!==null&&i>=n?"red":r!==null&&i>=r?"yellow":"green"}function DN(t,e){let r=e.get("swimlane"),n=CN(ae(t.properties,"utilization-warn-at"),r?ae(r.properties,"utilization-warn-at"):void 0,p3),i=CN(ae(t.properties,"utilization-over-at"),r?ae(r.properties,"utilization-over-at"):void 0,h3);return{warn:n,over:i}}function CN(t,e,r){let i=_3(t??e);return i.kind==="unset"?r:i.kind==="none"?null:i.value}var x3=/^\d+(?:\.\d+)?%$/,T3=/^\d+\.\d+$/;function _3(t){if(t===void 0)return{kind:"unset"};if(t==="none")return{kind:"none"};if(x3.test(t)){let e=parseFloat(t)/100;return Number.isFinite(e)&&e>0?{kind:"number",value:e}:{kind:"unset"}}if(T3.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?{kind:"number",value:e}:{kind:"unset"}}return{kind:"unset"}}var MN=10;function E3(t,e,r){let n=ae(t.properties,"capacity"),i=qn(n);if(i===null)return{capacity:null,badgeWidthPx:0};let o=Wa(i),s=qa(e.capacityIcon,r),a=Xi(o,s,MN);return{capacity:{value:i,text:o,icon:s},badgeWidthPx:a}}var v3=10,b3=38,w3=8;function R3(t,e,r){let n=t.title??t.name??"";if(!n)return 0;let i=ae(t.properties,"owner");return Va(0,n,i??void 0,e,r).rightX}function S3(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 A3(t,e,r,n){for(let i of t.content){if(i.$type==="DescriptionDirective")continue;let o=ar(i)?i.properties:i.properties??[];return n.resolveChildStart(o,e,e,r)}}var Ga=class{constructor(e,r){R(this,"input");R(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=ft("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}=E3(n,s,r.symbols),d=S3(n,r),p=d.length>0?o.estimateTextWidth(d.join(","),MN):0,m=R3(n,f,p),y=A3(n,a,r,o),E=!n.title||y===void 0||y>=m+w3,_=e.y+(E?v3:b3),x=new Ra({laneLeftX:a,originY:_,minRowHeight:c,slackCorridors:r.slackCorridors}),v=a,k=[];for(let w of n.content){if(w.$type==="DescriptionDirective")continue;if(!ar(w)){let $e=w.properties??[],q=o.resolveChildStart($e,v,a,r),{rowIndex:Q,y:re}=x.placeBlock(),M=o.newCursor(q,re),de=o.sequenceOne(w,M,r);k.push(de);let pe=de.box.x+de.box.width,Ne=Math.max(c,M.height);x.commitBlock({rowIndex:Q,placed:de,blockHeight:Ne,blockEnd:pe}),v=Math.max(v,pe);continue}let D=w.properties,U=o.resolveChildStart(D,v,a,r),S=Pi(D,r.sizes,r.cal),A=Math.max(_r,S*r.timeline.pixelsPerDay),I=U+A,B=w.name??"",z=o.predictItemChipExtraHeight(w,r),j=c+z,{rowIndex:V,y:K}=x.placeItem({childId:B,desiredStart:U,desiredEnd:I,predictedHeight:j}),ue=o.newCursor(U,K),Y=o.sequenceItem(w,ue,r);k.push(Y);let ne=Y.box.x+Y.box.width+Fr;v=Math.max(v,ne);let Re=null;(Y.textSpills||Y.chipsOutside||Y.dotSpills||Y.iconSpills||Y.footnoteSpills)&&(Re=Math.max(Y.decorationsRightX,Y.chipsOutside?Y.chipsRightX:0)+6),x.commitItem({rowIndex:V,placed:Y,logicalEnd:ne,spillReservation:Re,rowHeight:j})}let F=_-e.y,O=Math.max(c+32,F+x.usedHeight()+16),L=Math.max(x.usedRightX(),m),G={x:0,y:e.y,width:r.chartRightX,height:O},H=ae(n.properties,"owner"),oe;if(H){let w=r.teams.get(H),D=r.persons.get(H);oe=w?.title??D?.title??H}let $=u?(()=>{let{warn:w,over:D}=DN(n,r.styleCtx.defaults);return LN({children:k,capacityValue:u.value,warnFraction:w,overFraction:D})})():null;return r.currentFlowKey=l,{positioned:{id:n.name,title:n.title??n.name??"",box:G,bandIndex:i,children:k,nested:[],style:s,owner:oe,footnoteIndicators:d,capacity:u,utilization:$},usedHeight:O,usedRightX:L}}};var I3=18,k3=14,N3=14,P3=16,C3=32;function $N(t,e,r,n){let i=r+I3,o=[],s=!0;for(let a of t){s||(i+=P3),s=!1;let c=a.content.roadmap?.title??a.sourcePath,l=i+k3,u={cal:e.cal,styleCtx:{theme:e.styleCtx.theme,styles:a.config.styles,defaults:a.config.defaults,labels:a.content.labels},sizes:vp(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,nextParallelId:0,nextGroupId:0},f=[],d=l,p=0,m=u.timeline.originX;for(let O of a.content.swimlanes.values()){u.nextParallelId=0,u.nextGroupId=0;let{positioned:L,usedHeight:G,usedRightX:H}=new Ga({lane:O,bandIndex:p},n).place({x:u.timeline.originX,y:d},u);f.push(L),d+=G,p++,H>m&&(m=H)}let y=d,E=Math.max(e.bandScale.bandwidth(),y-i+N3),_=0,{chromeRightX:x}=Ya(_,c,a.sourcePath),v=Math.max(x,m)+C3,k=Math.min(e.chartRightX-_,v-_),F={x:_,y:i,width:k,height:E};for(let O of f)O.box.width=k;o.push({sourcePath:a.sourcePath,label:c,box:F,nestedSwimlanes:f,style:ft("swimlane",[],e.styleCtx)}),i+=E}return{regions:o,endY:i}}function ch(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 lh(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 FN(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 y_=class{constructor(e,r){R(this,"id");R(this,"milestone");this.id=e,this.milestone=r}place(e){let r=this.milestone,n=ft("milestone",r.properties,e.styleCtx),i=ae(r.properties,"date"),o=ut(r.properties,"after"),s=mt(i),a=e.timeline.markerRow.y,c=6,l=r.title??this.id,u=null,f=a,d=null,p="right",m=!1,y,E=!1;if(s){let x=e.scale.forwardWithinDomain(s);if(x===null)return null;u=x,m=!0;let v=e.markerRowPlacements.get(this.id);v&&(f=v.centerY,d=v.labelBox,p=v.labelSide);let k=ch(o,e),F=lh(k),O=null;for(let L of F)(!O||L.x>O.x)&&(O=L);O&&O.x>x&&(E=!0,y=[{x:O.x,y:O.y>0?O.y:f}])}else if(o.length>0){let x=ch(o,e),v=lh(x);v.sort((L,G)=>G.x-L.x);let k=v[0]?.x??e.timeline.originX;u=k,m=!1;let F=FN(u,a,c,l,10,!0,e.timeline.box.x,e.chartRightX);f=a,d=F.box,p=F.side,e.markerRowPlacements.set(this.id,{rowIndex:0,centerY:f,labelBox:d,labelSide:p});let O=[];for(let L=1;L<v.length;L++){let G=v[L];G.x<k&&G.y>0&&O.push({x:G.x,y:G.y})}O.length>0&&(y=O)}if(u===null)return null;if(!d){let x=FN(u,f,c,l,10,!0,e.timeline.box.x,e.chartRightX);d=x.box,p=x.side}let _={x:u,y:f};return e.entityLeftEdges.set(this.id,_.x),e.entityRightEdges.set(this.id,_.x),e.entityMidpoints.set(this.id,_),{id:this.id,title:l,center:_,radius:c,fixed:m,slackArrows:y,isOverrun:E,style:n,cutTopY:e.chartTopY,cutBottomY:e.swimlaneBottomY,labelBox:d,labelSide:p}}};function UN(t,e){let r=[];for(let[n,i]of t){let o=new y_(n,i).place(e);o&&r.push(o)}return r}var L3=4;function D3(t,e){e>t.chartRightX&&(t.chartRightX=e)}var fh=class{place(e,r,n,i){let o=n.theme??"light",s=bT[o],a=n.width??1280,c=tk(n.locale,F3(e)),l=KI(e,r.config.calendar),u=SN(e,r.config.scale),f=vp(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=ft("roadmap",e.roadmapDecl?.properties??[],d),E=y.headerPosition==="beside",_=y.timelinePosition!=="bottom",x=y.timelinePosition==="bottom"||y.timelinePosition==="both",v=e.roadmapDecl?.title??e.roadmapDecl?.name??"",k=ae(e.roadmapDecl?.properties??[],"author"),F=i.sizeBesideHeader(v,k),O=E?{x:0,y:0,width:F.boxWidth,height:0}:{x:0,y:0,width:0,height:Dp},L=E?F.boxWidth:0,G=E?8:Dp+8,H=IN(l),oe=u.pixelsPerUnit/H.daysPerUnit(u.unit),w=Math.max(1,Tr(p,m))*oe,D=L+Ur,U=w,S=L+Ur+U+Ur,A=Math.min(a,S),I=n.today!==void 0&&n.today>=p&&n.today<=m,B=r.content.anchors.size+r.content.milestones.size>0,z=I?Ci:0,j=_?Sl:0,V=new nh({domain:[p,m],range:[D,D+w],calendar:H}),K=Math.max(A,D+U+Ur),ue=[];for(let[Z,ce]of r.content.anchors){let Ge=mt(ae(ce.properties,"date"));if(!Ge)continue;let vr=V.forwardWithinDomain(Ge);vr!==null&&ue.push({id:Z,centerX:vr,radius:6,title:ce.title??Z,fontSize:10,bold:!1,date:Ge,isMilestone:!1})}for(let[Z,ce]of r.content.milestones){let Ge=mt(ae(ce.properties,"date"));if(!Ge)continue;let vr=V.forwardWithinDomain(Ge);vr!==null&&ue.push({id:Z,centerX:vr,radius:6,title:ce.title??Z,fontSize:10,bold:!0,date:Ge,isMilestone:!0})}let Y=GN(ue,L,K,i.estimateTextWidth),ne=B?Math.max(1,Y.rowCount):0,Re=ne*26,Se=z+j+Re,$e=Se+8,q=E?F.cardHeight+L3:0,Q=Math.max(G,q-Se),re=Q+z,M=re+j,de=M+Re,pe=AN(V,u,H,c),Ne={box:{x:D,y:Q,width:w,height:0},ticks:pe,pixelsPerDay:oe,originX:D,startDate:p,endDate:m,labelStyle:ft("roadmap",[],d),pillRowHeight:z,tickPanelY:re,tickPanelHeight:j,markerRow:{y:M+13,height:Re,collisionY:M-8},minorGrid:y.minorGrid},at=new Map;for(let[Z,ce]of Y.placements){let Ge=M+13+ce.rowIndex*26;at.set(Z,{rowIndex:ce.rowIndex,centerY:Ge,labelBox:{...ce.labelBox,y:Ge-4},labelSide:ce.labelSide})}let W={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:Ne,scale:V,calendar:H,bandScale:RN(),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:at,chartTopY:Q+$e,chartBottomY:0,swimlaneBottomY:0,chartRightX:K,nextParallelId:0,nextGroupId:0};for(let Z of ue){let ce=at.get(Z.id);ce&&(W.entityLeftEdges.set(Z.id,Z.centerX),W.entityRightEdges.set(Z.id,Z.centerX),W.entityMidpoints.set(Z.id,{x:Z.centerX,y:ce.centerY}))}let er=g_(r.content.footnotes,W,0);W.footnoteIndex=er.index,W.footnoteHosts=er.hosts;let Ui=new Map(W.entityLeftEdges),ur=new Map(W.entityRightEdges),jr=new Map(W.entityMidpoints),ye=[...r.content.swimlanes.values()],Bi=ft("swimlane",[],d),zr=dk[Bi.spacing]??0,dn=()=>{W.nextParallelId=0,W.nextGroupId=0;let Z=[],ce=W.chartTopY,Ge=0,vr=W.timeline.originX;for(let Gi of ye){Ge>0&&(ce+=zr);let{positioned:zn,usedHeight:wh,usedRightX:Ql}=new Ga({lane:Gi,bandIndex:Ge},i).place({x:W.timeline.originX,y:ce},W);Z.push(zn),ce+=wh,Ql>vr&&(vr=Ql),Ge++}return{swimlanes:Z,nextY:ce,maxRightX:vr}},Er=dn(),Nt=Er.swimlanes,$t=Er.nextY,fr=M3(r.content.milestones,W);fr.length>0&&(W.entityLeftEdges=new Map(Ui),W.entityRightEdges=new Map(ur),W.entityMidpoints=new Map(jr),W.itemSlackAttachY=new Map,W.entityVisualLeftX=new Map,W.entityVisualRightX=new Map,W.itemArrowSource=new Map,W.itemFlowKey=new Map,W.currentFlowKey="",W.slackCorridors=fr,Er=dn(),Nt=Er.swimlanes,$t=Er.nextY),D3(W,Er.maxRightX+Ur);for(let Z of Nt)Z.box.width=W.chartRightX;let T=r.content.isolatedRegions,P=[];if(T.length>0){let Z=$N(T,W,$t+8,i);P=Z.regions,$t=Z.endY}W.chartBottomY=$t,W.swimlaneBottomY=$t,Ne.box.height=W.chartBottomY-Ne.box.y;let X=UN(r.content.milestones,W),J=ue.map(Z=>({id:Z.id,centerX:Z.centerX,radius:Z.radius,title:Z.title,fontSize:Z.fontSize,bold:Z.bold}));for(let Z of X)Z.fixed||J.push({id:Z.id??"",centerX:Z.center.x,radius:Z.radius,title:Z.title,fontSize:10,bold:!0});let _e=GN(J,L,W.chartRightX,i.estimateTextWidth);W.markerRowPlacements.clear();for(let[Z,ce]of _e.placements){let Ge=M+13+ce.rowIndex*26;W.markerRowPlacements.set(Z,{rowIndex:ce.rowIndex,centerY:Ge,labelBox:{...ce.labelBox,y:Ge-4},labelSide:ce.labelSide})}for(let Z of X){let ce=W.markerRowPlacements.get(Z.id??"");ce&&(Z.center={x:Z.center.x,y:ce.centerY},Z.labelBox=ce.labelBox,Z.labelSide=ce.labelSide)}for(let Z of ue){let ce=W.markerRowPlacements.get(Z.id);ce&&W.entityMidpoints.set(Z.id,{x:Z.centerX,y:ce.centerY})}for(let Z of X)Z.fixed||W.entityMidpoints.set(Z.id??"",{x:Z.center.x,y:Z.center.y});let Be=B?Math.max(1,_e.rowCount):0;if(Be>ne){let Z=(Be-ne)*26;W.timeline.markerRow.height=Be*26,W.timeline.box.height+=Z,W.chartTopY+=Z,W.chartBottomY+=Z,W.swimlaneBottomY+=Z;for(let ce of Nt)x_(ce,Z);for(let ce of P)$3(ce,Z);for(let[ce,Ge]of W.entityMidpoints)W.markerRowPlacements.has(ce)||W.entityMidpoints.set(ce,{x:Ge.x,y:Ge.y+Z});for(let[ce,Ge]of W.itemSlackAttachY)W.itemSlackAttachY.set(ce,Ge+Z);for(let ce of X)if(ce.cutTopY=W.chartTopY,ce.cutBottomY=W.swimlaneBottomY,ce.slackArrows)for(let Ge of ce.slackArrows)Ge.y+=Z}x&&(W.timeline.bottomTickPanelY=W.chartBottomY+8,W.timeline.bottomTickPanelHeight=Sl,W.chartBottomY+=8+Sl);let Ae=new Set(X.map(Z=>Z.center.x)),Ze=PN(r.content.anchors,W,Ae),ct=i.collectItems(ye),He=i.buildDependencies(ct,Nt,P,W),Fe=i.buildNowline(n.today,W,c),gt=g_(r.content.footnotes,W,W.chartBottomY);W.footnoteIndex=gt.index,W.footnoteHosts=gt.hosts,O.height=O.height||W.chartBottomY,E||(O.width=W.chartRightX);let tr=E?{x:6,y:de-F.cardHeight,width:F.cardWidth,height:F.cardHeight}:{x:0,y:0,width:W.chartRightX,height:Dp},Wr=gt.area.entries.length>0?gt.area.box.y+gt.area.box.height:W.chartBottomY,dr={x:W.chartRightX-Ur-UT,y:Wr+Ur,width:UT,height:yk},Je=dr.y+dr.height+Ur,pr={box:O,position:y.headerPosition,title:v,author:k,titleLines:F.titleLines,authorLines:F.authorLines,cardBox:tr,logo:void 0,style:y,attributionBox:dr};return{width:W.chartRightX,height:Je,theme:o,palette:s,backgroundColor:s.surface.page,header:pr,timeline:Ne,nowline:Fe,swimlanes:Nt,anchors:Ze,milestones:X,edges:He,footnotes:gt.area,includes:P,chartBox:{x:L,y:W.chartTopY,width:W.chartRightX-L,height:W.chartBottomY-W.chartTopY}}}};function M3(t,e){let r=[];for(let[n,i]of t){let o=ae(i.properties,"date"),s=ut(i.properties,"after"),a=mt(o),c=ch(s,e),l=lh(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 x_(t,e){t.box.y+=e;for(let r of t.children)XN(r,e);for(let r of t.nested)x_(r,e)}function XN(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)XN(r,e)}function $3(t,e){t.box.y+=e;for(let r of t.nestedSwimlanes)x_(r,e)}function GN(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=L=>L==="right"?l:u,E=L=>L==="right"?f:d,_=(L,G)=>{let H=Math.min(p,L),oe=Math.max(m,L+c);return s[G].some($=>$.left<oe&&$.right>H)},x=-1,v="right",k=l;e:for(let L=s.length-1;L>=0;L--)for(let G of["right","left"]){if(!E(G))continue;let H=y(G);if(!_(H,L)){x=L,v=G,k=H;break e}}if(x===-1){for(let[L,G]of o)o.set(L,{...G,rowIndex:G.rowIndex+1});s=[[],...s],x=0,v=f?"right":"left",k=y(v)}let F=Math.min(p,k),O=Math.max(m,k+c);s[x].push({left:F,right:O}),o.set(a.id,{rowIndex:x,labelBox:{x:k,y:0,width:c,height:12},labelSide:v})}return{placements:o,rowCount:s.length}}function F3(t){return t.directive?.properties.find(r=>U3(r.key)==="locale")?.value}function U3(t){return t.endsWith(":")?t.slice(0,-1):t}function X3(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 H3(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 j3(t,e){if(t)return/^\d+(?:\.\d+)?[dwmqy]$/.test(t)||/^\d+%$/.test(t)?t:e.sizes.get(t)?.effortLiteral??t}function z3(t,e){if(t)return e.teams.get(t)?.title??e.persons.get(t)?.title??t}function W3(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 dh(t,e,r,n,i){let o=fk(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 w_(t,e,r,n){let i=t.properties,o=ft("item",i,r.styleCtx),s=ae(i,"size"),a=s?r.sizes.get(s)??null:null,c=Pi(i,r.sizes,r.cal),l=JI(i,r.sizes,r.cal),u=ut(i,"after"),f=ut(i,"before"),d=ae(i,"date"),p=ZI(ae(i,"remaining"),r.sizes,r.cal),m=e.x,y=mt(d);if(y){let le=r.scale.forwardWithinDomain(y);le!==null&&(m=le)}else if(u.length>0){let le=e.x;for(let Qe of u){let dt=mt(Qe);if(dt){let Wn=r.scale.forwardWithinDomain(dt);Wn!==null&&(le=Math.max(le,Wn));continue}let pn=r.entityRightEdges.get(Qe);pn!==void 0&&(le=Math.max(le,pn))}m=Math.max(e.x,le)}let E=Math.max(_r,c*r.timeline.pixelsPerDay),_=m,x=m+E,v=ae(i,"link"),k=W3(v),F=k.icon!=="none",O=Math.max(_r,E-2*Fr),L=ut(i,"labels"),G=[];for(let le of L){let Qe=r.labels.get(le);if(!Qe)continue;let dt=dh(Qe,r.styleCtx,0,0);G.push({id:Qe,width:dt.box.width})}let H=0;for(let le=0;le<G.length;le+=1)le>0&&(H+=4),H+=G[le].width;let oe=Math.max(0,O-24),$=G.length>0&&H>oe,w=!1,D,U;if(f.length>0){let le,Qe;for(let dt of f){let pn=mt(dt),Wn=pn?r.scale.forwardWithinDomain(pn)??void 0:r.entityLeftEdges.get(dt);Wn!==void 0&&(le===void 0||Wn<le)&&(le=Wn,Qe=dt)}le!==void 0&&x>le&&(w=!0,D={x:le,y:e.y,width:x-le,height:r.bandScale.bandwidth()},U=Qe)}let S=ae(i,"status"),A=X3(S),I=H3(S);I===0&&A==="done"&&(I=1);let B=/^(\d{1,3})%$/.exec(ae(i,"remaining")??"");I===0&&A==="in-progress"&&B&&(I=1-Math.max(0,Math.min(100,parseInt(B[1],10)))/100),I===0&&A==="in-progress"&&p>0&&l>0&&(I=Math.max(0,Math.min(1,1-p/l)));let z={done:"#ecfdf5","in-progress":"#eff6ff","at-risk":"#fffbeb",blocked:"#fee2e2",planned:"#f8fafc",neutral:"#f8fafc"},j={done:"#052e16","in-progress":"#172554","at-risk":"#422006",blocked:"#7f1d1d",planned:"#1e293b",neutral:"#1e293b"},V={done:"#ebebeb","in-progress":"#e4e4e4","at-risk":"#eeeeee",blocked:"#dcdcdc",planned:"#f5f5f5",neutral:"#f5f5f5"},K={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},ue=r.styleCtx.theme.name,Y=ue==="dark",ne=Y?"#0f172a":"#ffffff",Re=ue==="grayscale"?"#9e9e9e":"#94a3b8";o.bg===ne&&(o.bg=ue==="grayscale"?V[A]:Y?j[A]:z[A]),o.fg===Re&&(o.fg=K[A]);let Se=ae(i,"duration"),$e=!!Se&&/^\d+(?:\.\d+)?[dwmqy]$/.test(Se),q=a?a.title??a.name:"",Q=$e?Se:q||void 0,re=ae(i,"remaining"),M=j3(re,r),de=z3(n??ae(i,"owner"),r),pe=()=>[Q,de].filter(Boolean).join(" "),Ne;if(A==="in-progress"&&M){let le=pe();Ne=le?`${le} \u2014 ${M} remaining`:`${M} remaining`}else if(A==="in-progress"&&I>0&&I<1){let le=Math.round((1-I)*100),Qe=pe();Ne=Qe?`${Qe} \u2014 ${le}% remaining`:`${le}% remaining`}else(de||Q)&&(Ne=pe()||void 0);let at=ae(i,"capacity"),W=qn(at),er=null,Ui=0;if(W!==null){let le=Wa(W),Qe=qa(o.capacityIcon,r.symbols);er={value:W,text:le,icon:Qe};let dt=11;Ui=(Ne?fn(" ",dt):0)+Xi(le,Qe,dt)}let ur=t.title??t.name??"",jr=new Bp({id:t.name??"",title:ur,logicalLeftX:_,logicalRightX:x,metaText:Ne,metaTrailingWidth:Ui,hasLinkIcon:F}).place({x:_,y:e.y},{time:r.scale,bands:r.bandScale,style:o}),ye=jr.box,Bi=r.bandScale.bandwidth(),zr=ye.width<17,dn=F&&ye.width<41,Er=ye.width<23,Nt=jr.textSpills||dn,$t=null;$&&($t=Sh(G,ye.width));let fr=$t?$t.rows.length:G.length>0?1:0,T=Ne!==void 0||er!==null,P=YN($,Nt,fr,Bi,T);P>0&&(ye.height=Bi+P);let X=[],J=ye.y+Bi-an-13-3,_e=ye.y+38+3,Ae=$&&Nt||!$&&T&&G.length>0?Math.max(J,_e):J,Ze=$?ye.x+ye.width+6:ye.x+12,ct=Ze;if($t)for(let le=0;le<$t.rows.length;le+=1){let Qe=Ae+le*17,dt=Ze;for(let Wn of $t.rows[le]){let Z_=dh(Wn.id,r.styleCtx,dt,Qe);X.push(Z_),dt+=Z_.box.width+4}let pn=dt-4;pn>ct&&(ct=pn)}else{let le=Ze;for(let Qe of G){let dt=dh(Qe.id,r.styleCtx,le,Ae);X.push(dt),le+=dt.box.width+4}ct=G.length>0?le-4:Ze}let He=new Set;if(t.name){for(let[le,Qe]of r.footnoteHosts.entries())if(Qe.includes(t.name)){let dt=r.footnoteIndex.get(le);dt!==void 0&&He.add(dt)}}let Fe=[...He].sort((le,Qe)=>le-Qe),gt=de??n??ae(i,"owner"),tr=t.description?.text,Wr=Fe.length>0&&Er,Je=ye.x+ye.width+6,pr=!1,Jl=null;dn&&(pr&&(Je+=4),Jl=Je,Je=Jl+14,pr=!0);let Z=0;if(Nt){pr&&(Je+=4);let le=fn(ur,13),Qe=(Ne?fn(Ne,11):0)+Ui;Z=Math.max(le,Qe),Je+=Z,pr=!0}let ce=null;Wr&&(pr&&(Je+=4),ce=Je,Je+=Fe.length*8,pr=!0);let Ge=null;zr&&(pr&&(Je+=4),Ge=Je+5,Je=Ge+5,pr=!0);let vr=Math.max(ye.x+ye.width,Je),Gi=t.name;Gi&&(r.entityLeftEdges.set(Gi,_),r.entityRightEdges.set(Gi,x));let zn=Gi??VN(t);r.entityMidpoints.set(zn,{x:(_+x)/2,y:ye.y+ye.height/2}),r.entityVisualLeftX.set(zn,ye.x),r.entityVisualRightX.set(zn,ye.x+ye.width);let wh=Nt?{x:ye.x+ye.width,y:ye.y+ye.height-an/2}:{x:ye.x+ye.width,y:ye.y+ye.height/2};r.itemArrowSource.set(zn,wh),r.itemFlowKey.set(zn,r.currentFlowKey);let Ql=Nt?ye.y+ye.height-an/2:ye.y+ye.height/2;r.itemSlackAttachY.set(zn,Ql),e.x=x,e.maxX=Math.max(e.maxX,e.x),e.height=Math.max(e.height,r.bandScale.step()+P);let K_=ok({box:ye,afterDate:Mn(u),beforeDate:Mn(f),hasLinkIcon:F,footnoteCount:Fe.length});return{kind:"item",id:Gi,title:ur,box:ye,status:A,progressFraction:I,footnoteIndicators:Fe,labelChips:X,chipsOutside:$,chipsRightX:ct,linkIcon:k.icon,linkHref:k.href,hasOverflow:w,overflowBox:D,overflowAnchorId:U,owner:gt,description:tr,metaText:Ne,textSpills:Nt,dotSpills:zr,iconSpills:dn,footnoteSpills:Wr,dotSpillCx:Ge,iconSpillX:Jl,footnoteSpillStartX:ce,decorationsRightX:vr,capacity:er,size:a,style:o,inlineDatePins:K_.length>0?K_:void 0}}function q3(t,e,r){return new Gp(t,{sequenceOne:R_,newCursor:Ap}).place(e,r)}function V3(t,e,r){return new Up(t,{sequenceItem:w_,sequenceOne:R_,resolveChildStart:ZN,newCursor:Ap,estimateTextWidth:fn,predictItemChipExtraHeight:KN}).place(e,r)}function R_(t,e,r){if(ar(t))return w_(t,e,r);if(Mr(t))return q3(t,e,r);if(Dr(t))return V3(t,e,r);throw new Error(`Unknown swimlane child type: ${t.$type??"unknown"}`)}function fn(t,e){return t.length*e*.58}function VN(t){let e=t.$cstNode?.range.start;return`#item@${e?e.line+1:0}:${e?e.character+1:0}`}function YN(t,e,r,n,i){if(r===0)return 0;let o=n-an-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+an;return Math.max(0,l-n)}function KN(t,e){let r=t.properties,n=ut(r,"labels");if(n.length===0)return 0;let i=Pi(r,e.sizes,e.cal),o=Math.max(_r,i*e.timeline.pixelsPerDay),s=Math.max(_r,o-2*Fr),a=[];for(let _ of n){let x=e.labels.get(_);if(!x)continue;let v=dh(x,e.styleCtx,0,0);a.push({id:x,width:v.box.width})}if(a.length===0)return 0;let c=0;for(let _=0;_<a.length;_+=1)_>0&&(c+=4),c+=a[_].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?fn(d,13):0)>l,y=u?Sh(a,s):null,E=y?y.rows.length:a.length>0?1:0;return YN(u,m,E,e.bandScale.bandwidth(),f)}function ZN(t,e,r,n){let i=mt(ae(t,"date"))??mt(ae(t,"start"));if(i){let s=n.scale.forwardWithinDomain(i);if(s!==null)return s}let o=ut(t,"after");if(o.length>0){let s=r;for(let a of o){let c=mt(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 T_=6;function HN(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&&fn(a,r)>e?(i.push(o),o=s):o=a}return o&&i.push(o),i}function Y3(t,e){let r=LT-32,n=HN(t,r,16),i=HN(e??"",r,11),o=0;for(let d of n)o=Math.max(o,fn(d,16));for(let d of i)o=Math.max(o,fn(d,11));let s=o+32,a=Math.max(mk-T_,Math.min(LT-T_,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+T_;return{titleLines:n,authorLines:i,cardWidth:a,cardHeight:u,boxWidth:f}}function K3(t,e,r,n,i){let s=t.roadmapDecl?.properties??[],a=ae(s,"start"),c=mt(a)??Z3(n),l=ae(s,"length");if(l){let p=J3(l,e.cal);if(p>0)return{startDate:c,endDate:To(c,p)}}let u=JN(r,e,c,n),f=kN(i.unit,e.cal),d=u>0?Math.ceil(u/f)*f:4*e.cal.daysPerWeek;return{startDate:c,endDate:To(c,Math.max(1,d))}}function Z3(t){let e=t??new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))}function J3(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 JN(t,e,r,n){let i=new Map,o=new Map,s=new Map,a=0,c=f=>{let d=mt(f);return d?Tr(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=mt(ae(f.properties,"date"));if(d&&f.name){let p=Tr(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(ar(f)){let p=Pi(f.properties,e.sizes,e.cal),m=mt(ae(f.properties,"date")),y=mt(ae(f.properties,"start")),E=ut(f.properties,"after"),_=d;m?_=Tr(r,m):y?_=Tr(r,y):E.length>0&&(_=Math.max(d,...E.map(c)));let x=_+p;return f.name&&i.set(f.name,x),x}if(Mr(f)){let p=ut(f.properties,"after"),m=p.length>0?Math.max(d,...p.map(c)):d,y=m;for(let E of f.content){if(E.$type==="DescriptionDirective")continue;let _=u(E,m);y=Math.max(y,_)}return y}if(Dr(f)){let p=ut(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=mt(ae(f.properties,"date"));if(d){let m=Tr(r,d);f.name&&s.set(f.name,m),a=Math.max(a,m);continue}let p=ut(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=JN({config:f.config,content:f.content,diagnostics:[],processedFiles:new Set},e,r,void 0);a=Math.max(a,d)}if(n){let f=Tr(r,n);f>0&&(a=Math.max(a,f))}return a}function Q3(t,e,r,n){let i=new bp(QI(e,r)),o=[],s=[];for(let[l,u]of t){let f=ut(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 E=n.itemArrowSource.get(y),_,x=E===void 0;if(E)_=E;else{let v=n.entityMidpoints.get(y);if(!v)continue;_={x:v.x,y:d.y}}!x&&Math.abs(_.y-m.y)<.5&&m.x-_.x<20||(o.push({fromId:y,toId:l,from:_,to:m,isMarkerSource:x}),s.push({fromId:y,toId:l}))}}let a=ek(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:ft("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=wp(r).nowLabel,a=fn(s,kl),c=Math.max(PT,Math.ceil(a+2*ka)),l=e.timeline.originX-Ur,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:ft("item",[],e.styleCtx)}}function tG(t){let e=new Map,r=n=>{if(ar(n)){e.set(n.name??VN(n),n);return}if(Mr(n)){for(let i of n.content)i.$type!=="DescriptionDirective"&&r(i);return}if(Dr(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 S_(t,e,r={}){return new fh().place(t,e,r,{sequenceItem:w_,sequenceOne:R_,resolveChildStart:ZN,newCursor:Ap,estimateTextWidth:fn,predictItemChipExtraHeight:KN,computeDateWindow:K3,sizeBesideHeader:Y3,collectItems:tG,buildDependencies:Q3,buildNowline:eG})}function A_(t){return t.toISOString().slice(0,10)}function rG(t){return t.id??t.title}function QN(t,e){for(let r of t)r.kind==="item"?e(r):QN(r.children,e)}function nG(t,e,r){let n=rG(t);t.textSpills&&r.push(Po(e,"NL.I1000","info",{name:n},n)),t.chipsOutside&&r.push(Po(e,"NL.I1001","info",{name:n},n)),(t.box.width<17||t.dotSpills||t.iconSpills||t.footnoteSpills)&&r.push(Po(e,"NL.I1002","info",{name:n},n)),t.hasOverflow&&r.push(Po(e,"NL.I1003","info",{name:n,anchor:t.overflowAnchorId},n))}function Po(t,e,r,n,i){return{message:_l(t,e,n),severity:r,code:e,entityId:i,lspSeverity:r==="warning"?2:3,data:{code:e,args:n}}}function eP(t,e,r){let n=t.id??t.title,i=[];QN(t.children,a=>i.push(a));for(let a of i)nG(a,e,r);let o=new Set(i.map(a=>a.box.y));o.size>1&&r.push(Po(e,"NL.I1004","info",{lane:n,rows:o.size},n)),(t.utilization?.segments.some(a=>a.classification==="red")??!1)&&r.push(Po(e,"NL.I1005","info",{lane:n},n));for(let a of t.nested)eP(a,e,r)}function I_(t,e={}){let r=e.locale??"en-US",n=[];for(let i of t.swimlanes)eP(i,r,n);if(e.today){let i=e.today,o=t.timeline.startDate,s=t.timeline.endDate;(i<o||i>s)&&n.push(Po(r,"NL.W1000","warning",{date:A_(i),start:A_(o),end:A_(s)}))}return n}var Co=class extends Error{constructor(e){super(e),this.name="TimezoneError"}};function k_(t){if(!t||t.toLowerCase()==="local")return{kind:"local"};if(t.toUpperCase()==="UTC")return{kind:"utc"};if(t==="Z")return{kind:"offset",ms:0};let e=/^([+-])(\d{2})(?::?(\d{2}))?$/.exec(t);if(e){let r=e[1]==="+"?1:-1,n=parseInt(e[2],10),i=e[3]!==void 0?parseInt(e[3],10):0;if(n>23||i>59)throw new Co(`nowline: invalid timezone offset "${t}". Hours must be 0\u201323 and minutes 0\u201359.`);return{kind:"offset",ms:r*(n*60+i)*6e4}}try{return{kind:"iana",name:Intl.DateTimeFormat(void 0,{timeZone:t}).resolvedOptions().timeZone}}catch{throw new Co(`nowline: unrecognised timezone "${t}". Use "local", "UTC", an ISO 8601 offset (e.g. "+05:30", "-07:00", "Z"), or an IANA timezone name (e.g. "America/Los_Angeles", "Asia/Kolkata").`)}}function yh(t,e){switch(e.kind){case"local":return new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));case"utc":return new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()));case"offset":{let r=new Date(t.getTime()+e.ms);return new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()))}case"iana":{let r=new Intl.DateTimeFormat("en-CA",{timeZone:e.name,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(t),n=0,i=0,o=0;for(let s of r)s.type==="year"?n=parseInt(s.value,10):s.type==="month"?i=parseInt(s.value,10)-1:s.type==="day"&&(o=parseInt(s.value,10));return new Date(Date.UTC(n,i,o))}}}var iG=/^(\d{4})-(\d{2})-(\d{2})$/,oG=/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?)(Z|([+-])(\d{2})(?::?(\d{2}))?)$/,sG=/^(\d{4})-(\d{2})-(\d{2})T\d{2}:\d{2}:\d{2}(?:\.\d+)?$/;function N_(t={}){let e=t.zone??{kind:"local"},r=t.clock??(()=>new Date),n=t.now;if(!(n==="-"||n===null)){if(n instanceof Date)return n;if(n!==void 0){let i=iG.exec(n);if(i)return new Date(Date.UTC(parseInt(i[1],10),parseInt(i[2],10)-1,parseInt(i[3],10)));let o=oG.exec(n);if(o){let a=new Date(n);if(!Number.isNaN(a.getTime())){if(o[2]==="Z")return yh(a,{kind:"utc"});let l=o[3]==="+"?1:-1,u=parseInt(o[4],10),f=o[5]!==void 0?parseInt(o[5],10):0,d=l*(u*60+f)*6e4;return yh(a,{kind:"offset",ms:d})}}let s=sG.exec(n);return s?new Date(Date.UTC(parseInt(s[1],10),parseInt(s[2],10)-1,parseInt(s[3],10))):void 0}return yh(r(),e)}}function aG(t){return t===2?"warning":t===3?"info":"error"}function tP(t,e){return{severity:aG(t.severity),code:kh(t),message:t.message,suggestion:Ih(t.message),file:e,line:(t.range?.start.line??0)+1,column:(t.range?.start.character??0)+1}}function rP(t,e){return{severity:"error",code:"parse-error",message:t.message,file:e,line:t.token?.startLine??1,column:t.token?.startColumn??1}}function nP(t,e){return{severity:"error",code:"lex-error",message:t.message,file:e,line:t.line??1,column:t.column??1}}function iP(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 oP(t,e,r="warning"){return{severity:r,code:"render.warning",message:t,file:e,line:1,column:1}}function sP(t,e){return{severity:t.severity,code:t.code,message:t.message,file:e,line:1,column:1}}var aP="__nowline_browser_noop_include__";async function cP(t){throw new Error(`${aP}: include "${t}" was skipped \u2014 running in single-file mode.`)}function lP(t){return t.includes(aP)}var Fi={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"}},cG={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"}},uP={...Fi,...cG};var Woe={none:"",multiplier:"x",person:Fi.person.ascii,people:Fi.people.ascii,points:Fi.points.ascii,time:Fi.time.ascii};var xh=class{constructor(e="nl"){R(this,"prefix");R(this,"counter",0);this.prefix=e}next(e){let r=`${this.prefix}-${this.counter++}`;return e?`${r}-${e}`:r}};var lG=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"]),uG=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 fG(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=dG(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}=pG(a);e.push({kind:s?"self":"open",name:c,attrs:l}),r=i+1}return e}function dG(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 pG(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 ql(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function hG(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 fP(t,e={}){let r=e.idPrefix??"nl-logo",n=e.onWarn??(()=>{}),i=fG(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(ql(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(!lG.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(!uG.has(p)){n(`sanitizer: dropping attribute ${p}`);continue}if(p==="href"||p==="xlink:href"){let y=hG(m,o);if(y===null){n(`sanitizer: dropping external href ${m}`);continue}f.push(` ${p}="${ql(y)}"`);continue}if(p==="style"){n("sanitizer: dropping inline style");continue}if(p==="id"){let y=o.get(m);y&&f.push(` id="${ql(y)}"`);continue}if(/\burl\(#/i.test(m)){let y=m.replace(/url\(#([^)]+)\)/gi,(E,_)=>{let x=o.get(_);return x?`url(#${x})`:"none"});f.push(` ${p}="${ql(y)}"`);continue}if(/data:|javascript:|vbscript:/i.test(m)){n(`sanitizer: dropping suspicious value at ${p}`);continue}f.push(` ${p}="${ql(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 dP=/&/g,pP=/</g,hP=/>/g,mG=/"/g,gG=/'/g;function Qt(t){return t.replace(dP,"&amp;").replace(pP,"&lt;").replace(hP,"&gt;")}function Xn(t){return t.replace(dP,"&amp;").replace(pP,"&lt;").replace(hP,"&gt;").replace(mG,"&quot;").replace(gG,"&#39;")}function ja(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}="${Xn(String(i))}"`))}return r.length?` ${r.join(" ")}`:""}function ee(t,e,r){return r===void 0||r===""?`<${t}${ja(e)}/>`:`<${t}${ja(e)}>${r}</${t}>`}function Ce(t,e){return`<text${ja(t)}>${Qt(e)}</text>`}function h(t){return Number.isFinite(t)?Number.isInteger(t)?t.toString():(Math.round(t*100)/100).toString():"0"}var yG={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 xG(t,e){let r=`${t}-shadow-${e}`,n=yG[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 ee("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 gP(t){return["subtle","soft","hard"].map(e=>xG(t,e)).join("")}var bG={thin:100,light:300,normal:400,bold:700};function wG(t){return Aa[t]??14}function C_(t,e,r){return{"font-family":e[t.font],"font-size":r??wG(t.textSize),"font-weight":bG[t.weight]??400,"font-style":t.italic?"italic":"normal",fill:t.text}}function RG(t){if(t.border==="dashed")return"4 3";if(t.border==="dotted")return"1 3"}function SG(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 AG(t,e){return SG(t)>=.24?e.statusDot.onLight:e.statusDot.onDark}function P_(t,e){return t.length*e*.58}function _P(t,e,r,n,i,o,s){let a=i*.58,c=e?P_(e,i):0,l=e?a:0,u=r+c+l,{text:f,icon:d}=t,p=P_(f,i),m={"font-family":o,"font-size":i,fill:s};if(!d)return Ce({x:h(u),y:h(n),...m},f);if(d.kind==="builtin"&&d.name==="multiplier")return Ce({x:h(u),y:h(n),...m},`${f}\xD7`);if(d.kind==="builtin"){let E=Fi[d.name],_=Ce({x:h(u),y:h(n),...m},f),x=i*.1,v=i,k=u+p+x,F=n-i*.85,O=`<svg x="${h(k)}" y="${h(F)}" width="${h(v)}" height="${h(v)}" viewBox="${E.viewBox}" style="color:${Xn(s)}" aria-hidden="true">${E.body}</svg>`;return _+O}let y=h(i*.1);return`<text x="${h(u)}" y="${h(n)}" font-family="${Xn(o)}" font-size="${i}" fill="${Xn(s)}">${Qt(f)}<tspan dx="${y}">${Qt(d.text)}</tspan></text>`}var yP=.6,IG=.5;function kG(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 Ce({x:h(n),y:h(i),...c},e);if(!e)return _P(r,void 0,n,i,o,s,a);let l=h(o*yP),u=`<text x="${h(n)}" y="${h(i)}" font-family="${Xn(s)}" font-size="${o}" fill="${Xn(a)}">`,{text:f,icon:d}=r;if(!d)return u+Qt(e)+`<tspan dx="${l}">${Qt(f)}</tspan></text>`;if(d.kind==="builtin"&&d.name==="multiplier")return u+Qt(e)+`<tspan dx="${l}">${Qt(f)}\xD7</tspan></text>`;if(d.kind==="literal"){let O=h(o*.1);return u+Qt(e)+`<tspan dx="${l}">${Qt(f)}</tspan><tspan dx="${O}">${Qt(d.text)}</tspan></text>`}let p=Fi[d.name],m=O=>O.length*o*IG,y=n+m(e)+o*yP,E=o*.1,_=o,x=y+m(f)+E,v=i-o*.85,k=u+Qt(e)+`<tspan dx="${l}">${Qt(f)}</tspan></text>`,F=`<svg x="${h(x)}" y="${h(v)}" width="${h(_)}" height="${h(_)}" viewBox="${p.viewBox}" style="color:${Xn(a)}" aria-hidden="true">${p.body}</svg>`;return k+F}function NG(t,e){let r=uP.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:${Xn(e)}" aria-hidden="true">${r.body}</svg>`,i=`<title>${Qt(t.isoDate)}</title>`;return ee("g",{"data-layer":"inline-date-pin","data-side":t.side,"data-date":t.isoDate,"data-spilled":t.spilled?"true":null},i+n)}function O_(t,e){return!t||t.length===0?"":t.map(r=>NG(r,e)).join("")}function PG(t,e,r,n,i,o={}){let s=Math.min(Ip[i.cornerRadius]??4,n/2);return ee("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":RG(i)??null,...o})}function CG(t,e,r,n){let i=t.box.x+t.cardBox.x,o=t.box.y+t.cardBox.y,s=t.cardBox.width,a=t.cardBox.height,c=t.style.bg==="none"?r.surface.headerBox:t.style.bg,l=r.header.cardBorder,u=ee("rect",{x:h(i),y:h(o),width:h(s),height:h(a),rx:6,ry:6,fill:c,stroke:l,"stroke-width":1,filter:`url(#${e}-shadow-subtle)`}),f=[];t.titleLines.forEach((_,x)=>{f.push(Ce({x:h(i+16),y:h(o+26+x*20),"font-family":n[t.style.font],"font-size":16,"font-weight":600,fill:t.style.text},_))});let d=f.join(""),p=o+26+Math.max(0,t.titleLines.length-1)*20,m=r.header.author,y=[];t.authorLines.forEach((_,x)=>{y.push(Ce({x:h(i+16),y:h(p+18+x*14),"font-family":n[t.style.font],"font-size":11,fill:m},_))});let E=y.join("");return ee("g",{"data-layer":"header","data-id":`${e}-header`},u+d+E)}function OG(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(ee("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(ee("line",{x1:h(d.x),y1:h(l),x2:h(d.x),y2:h(u),stroke:i,"stroke-width":1}))}return ee("g",{"data-layer":"grid"},f.join(""))}function LG(t,e,r){let n=e.timeline.panelFill,i=e.timeline.border,o=e.timeline.labelText,s=[],a=t.tickPanelY,c=t.tickPanelHeight,l=c>0,u=t.markerRow.height>0,f=a+c,d=t.markerRow.height,p=t.bottomTickPanelY,m=t.bottomTickPanelHeight??0,y=p!==void 0&&m>0;l&&s.push(ee("rect",{x:h(t.box.x),y:h(a),width:h(t.box.width),height:h(c),rx:4,ry:4,fill:n,stroke:i,"stroke-width":1})),u&&s.push(ee("rect",{x:h(t.box.x),y:h(f),width:h(t.box.width),height:h(d),rx:4,ry:4,fill:n,stroke:i,"stroke-width":1})),y&&s.push(ee("rect",{x:h(t.box.x),y:h(p),width:h(t.box.width),height:h(m),rx:4,ry:4,fill:n,stroke:i,"stroke-width":1}));for(let E of t.ticks)E.major&&(!E.label||E.labelX===void 0||(l&&s.push(Ce({x:h(E.labelX),y:h(a+kp),"font-family":r.sans,"font-size":10,fill:o,"text-anchor":"middle"},E.label)),y&&s.push(Ce({x:h(E.labelX),y:h(p+kp),"font-family":r.sans,"font-size":10,fill:o,"text-anchor":"middle"},E.label))));return ee("g",{"data-layer":"timeline"},s.join(""))}function DG(t,e,r){if(!t)return"";let n=e.nowline.stroke,i=e.nowline.labelText,o=ee("line",{x1:h(t.x),y1:h(t.topY),x2:h(t.x),y2:h(t.bottomY),stroke:n,"stroke-width":Lp}),s=MG(t,n),a=$G(t,i,r);return ee("g",{"data-layer":"nowline"},o+s+a)}function EP(t){let e=Lp/2;return t.pillMode==="flag-right"?t.x-e:t.pillMode==="flag-left"?t.x+e:t.x}function MG(t,e){let r=t.pillTopY,n=t.pillTopY+Ci,i=CT,o=t.pillWidth;if(t.pillMode==="center")return ee("rect",{x:h(t.x-o/2),y:h(r),width:h(o),height:h(Ci),rx:i,ry:i,fill:e});let s=EP(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 ee("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 ee("path",{d:c,fill:e})}function $G(t,e,r){let n=t.pillTopY+OT,i=EP(t),o,s;return t.pillMode==="center"?(o=t.x,s="middle"):t.pillMode==="flag-right"?(o=i+ka,s="start"):(o=i-ka,s="end"),Ce({x:h(o),y:h(n),"font-family":r.sans,"font-size":kl,"font-weight":700,fill:e,"text-anchor":s},t.label)}function FG(t,e,r,n,i){let o=[],s=mP(r,t.style.shadow);o.push(PG(t.box.x,t.box.y,t.box.width,t.box.height,t.style,{filter:s??null}));let a=AG(t.style.bg,n),c={done:a.done,"in-progress":a.inProgress,"at-risk":a.atRisk,blocked:a.blocked,planned:a.planned,neutral:a.neutral},l=c[t.status]??c.neutral;if(t.progressFraction>0){let E=Math.max(0,Math.min(t.box.width,t.box.width*t.progressFraction));o.push(ee("rect",{x:h(t.box.x),y:h(t.box.y+t.box.height-an),width:h(E),height:an,fill:t.style.fg,opacity:.55}))}let u=t.dotSpills&&t.dotSpillCx!==null?t.dotSpillCx:t.box.x+t.box.width-12;o.push(ee("circle",{cx:h(u),cy:h(t.box.y+12),r:5,fill:l})),o.push(O_(t.inlineDatePins,t.style.fg));let f;t.textSpills?(f=t.box.x+t.box.width+6,t.iconSpills&&(f+=18)):f=t.box.x+12;let d=t.style.text,p=n.entities.item.text,m=t.textSpills?p:d,y=t.textSpills?p:t.style.fg;if(t.title&&o.push(Ce({x:h(f),y:h(t.box.y+20),"font-family":i[t.style.font],"font-size":13,"font-weight":600,fill:m},t.title)),(t.metaText||t.capacity)&&o.push(kG({metaText:t.metaText,capacity:t.capacity,x:f,baselineY:t.box.y+38,fontSize:11,fontFamily:i[t.style.font],color:y})),t.footnoteIndicators.length>0){let E=t.box.y+14;if(t.footnoteSpills&&t.footnoteSpillStartX!==null){let _=t.footnoteSpillStartX;for(let x=0;x<t.footnoteIndicators.length;x++){let v=t.footnoteIndicators[x];o.push(Ce({x:h(_),y:h(E),"font-family":i.sans,"font-size":10,"font-weight":700,fill:p},String(v))),_+=8}}else{let _=t.box.x+t.box.width-22;for(let x=t.footnoteIndicators.length-1;x>=0;x--){let v=t.footnoteIndicators[x];o.push(Ce({x:h(_),y:h(E),"font-family":i.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 E={linear:"#5e6ad2",github:"#0f172a",jira:"#0052cc",generic:n.item.linkIconFg},_=E[t.linkIcon]??E.generic,x=14,v=t.iconSpills&&t.iconSpillX!==null?t.iconSpillX:t.box.x+6,k=t.box.y+6,F=ee("rect",{x:h(v),y:h(k),width:x,height:x,rx:2,ry:2,fill:_}),O=v,L=k,G=ee("path",{d:`M${h(O+4)} ${h(L+10)} L${h(O+10)} ${h(L+4)} M${h(O+6)} ${h(L+4)} H${h(O+10)} V${h(L+8)}`,stroke:"#ffffff",fill:"none","stroke-width":1.1,"stroke-linecap":"round","stroke-linejoin":"round"}),H=F+G,oe=t.linkHref?ee("a",{href:t.linkHref,target:"_blank",rel:"noopener"},H):H;o.push(oe)}if(t.hasOverflow&&t.overflowBox){let E=n.item.overflowTailFill,_=n.item.overflowTailStroke,x=n.item.overflowCaption;o.push(ee("rect",{x:h(t.overflowBox.x),y:h(t.overflowBox.y),width:h(t.overflowBox.width),height:h(t.overflowBox.height),fill:E,stroke:_,"stroke-width":1})),t.overflowAnchorId&&t.overflowBox.width>60&&o.push(Ce({x:h(t.overflowBox.x+t.overflowBox.width/2),y:h(t.overflowBox.y+t.overflowBox.height/2+3),"font-family":i.sans,"font-size":9,"font-weight":700,fill:x,"text-anchor":"middle"},`past ${t.overflowAnchorId}`))}for(let E of t.labelChips){let _=Math.min(Ip[E.style.cornerRadius]??8,E.box.height/2);o.push(ee("rect",{x:h(E.box.x),y:h(E.box.y),width:h(E.box.width),height:h(E.box.height),rx:h(_),ry:h(_),fill:E.style.bg==="none"?"transparent":E.style.bg,stroke:E.style.fg,"stroke-width":.5})),o.push(Ce({x:h(E.box.x+E.box.width/2),y:h(E.box.y+E.box.height/2+3),...C_(E.style,i,Aa.xs),"text-anchor":"middle"},E.text))}return ee("g",{"data-layer":"item","data-id":t.id??null},o.join(""))}function UG(t,e,r,n,i){let o=[];if(t.style.bg!=="none"&&t.style.bg!=="#ffffff"){if(o.push(ee("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 a=t.title.length*kT+2*Cp,c=t.box.x,l=t.box.y,u=Il,f=6,d=`M${h(c+f)} ${h(l)}H${h(c+a)}V${h(l+u-f)}A${f} ${f} 0 0 1 ${h(c+a-f)} ${h(l+u)}H${h(c)}V${h(l+f)}A${f} ${f} 0 0 1 ${h(c+f)} ${h(l)}Z`;o.push(ee("path",{d,fill:t.style.fg})),o.push(Ce({x:h(c+Cp),y:h(l+AT),"font-family":i[t.style.font],"font-size":IT,"font-weight":600,fill:"#ffffff"},t.title))}}else{let a=t.style.fg;if(t.style.bracket!=="none"){let l=t.box.y+t.box.height,u=t.style.bracket==="dashed"?"3 2":null,f=t.title?`M${h(t.box.x+4)} ${h(t.box.y-Ia)} L${h(t.box.x)} ${h(t.box.y-Ia)} L${h(t.box.x)} ${h(l)} L${h(t.box.x+4)} ${h(l)}`:`M${h(t.box.x)} ${h(t.box.y)} L${h(t.box.x)} ${h(l)} L${h(t.box.x+4)} ${h(l)}`;o.push(ee("path",{d:f,fill:"none",stroke:a,"stroke-width":1,"stroke-dasharray":u}))}t.title&&o.push(Ce({x:h(t.box.x+6),y:h(t.box.y-2),...C_(t.style,i,Aa.xs),"fill-opacity":.7},t.title))}o.push(O_(t.inlineDatePins,t.style.fg));for(let a of t.children)o.push(L_(a,e,r,n,i));return ee("g",{"data-layer":"group","data-id":t.id??null},o.join(""))}function BG(t,e,r,n,i){let o=[];if(t.style.bracket==="solid"||t.style.bracket==="dashed"){let c=t.box.y-12,l=t.box.y+t.box.height+12,u=t.box.x,f=t.box.x+t.box.width,d=n.parallel.bracketStroke;o.push(ee("path",{d:`M${h(u+4)} ${h(c)} H${h(u)} V${h(l)} H${h(u+4)}`,fill:"none",stroke:d,"stroke-width":1.25,"stroke-dasharray":t.style.bracket==="dashed"?"3 3":null,"stroke-linejoin":"round"})),o.push(ee("path",{d:`M${h(f-4)} ${h(c)} H${h(f)} V${h(l)} H${h(f-4)}`,fill:"none",stroke:d,"stroke-width":1.25,"stroke-dasharray":t.style.bracket==="dashed"?"3 3":null,"stroke-linejoin":"round"}))}t.title&&o.push(Ce({x:h(t.box.x+4),y:h(t.box.y-2),...C_(t.style,i,Aa.xs),"fill-opacity":.7},t.title)),o.push(O_(t.inlineDatePins,t.style.fg));for(let s of t.children)o.push(L_(s,e,r,n,i));return ee("g",{"data-layer":"parallel","data-id":t.id??null},o.join(""))}function L_(t,e,r,n,i){return t.kind==="item"?FG(t,e,r,n,i):t.kind==="group"?UG(t,e,r,n,i):BG(t,e,r,n,i)}var xP=2;function GG(t,e){switch(t){case"green":return e.swimlane.utilizationOk;case"yellow":return e.swimlane.utilizationWarn;case"red":return e.swimlane.utilizationOver}}function XG(t,e){if(!t.utilization||t.utilization.segments.length===0)return"";let r=t.box.y+t.box.height-xP,n=t.utilization.segments.map(i=>{let o=i.endX-i.startX;return o<=0?"":ee("rect",{x:h(i.startX),y:h(r),width:h(o),height:xP,fill:GG(i.classification,e),"data-utilization":i.classification,"data-load":h(i.load)})});return ee("g",{"data-layer":"lane-utilization","data-id":t.id??null},n.join(""))}function HG(t,e){let r=t.bandIndex%2===0?e.swimlane.rowTintEven:e.swimlane.rowTintOdd,n=e.swimlane.border;return ee("g",{"data-layer":"swimlane-bg","data-id":t.id??null},ee("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 vP(t,e,r,n,i){let o=n.swimlane.tabFill,s=n.swimlane.tabStroke,a=n.swimlane.tabText,c=n.swimlane.ownerText,l=n.swimlane.footnoteIndicator,u=[];if(t.title){let d=t.capacity?Xi(t.capacity.text,t.capacity.icon,10):0,p=t.footnoteIndicators.length>0?t.footnoteIndicators.join(","):"",m=p?P_(p,10):0,y=Va(t.box.x,t.title,t.owner,d,m),E=Np,_=t.box.y+10,x=_+Pp;u.push(ee("rect",{x:h(y.tabX),y:h(_),width:h(y.tabW),height:h(E),rx:4,ry:4,fill:o,stroke:s,"stroke-width":1})),u.push(Ce({x:h(y.titleX),y:h(x),"font-family":i[t.style.font],"font-size":12,"font-weight":600,fill:a},t.title)),t.owner&&u.push(Ce({x:h(y.ownerX),y:h(x),"font-family":i[t.style.font],"font-size":10,fill:c},`owner: ${t.owner}`)),t.capacity&&u.push(_P(t.capacity,void 0,y.badgeX,x,10,i[t.style.font],c)),p&&u.push(Ce({x:h(y.footnoteRightX),y:h(_+14),"font-family":i.sans,"font-size":10,"font-weight":700,fill:l,"text-anchor":"end"},p))}for(let f of t.children)u.push(L_(f,e,r,n,i));return u.push(XG(t,n)),ee("g",{"data-layer":"swimlane","data-id":t.id??null},u.join(""))}function jG(t,e,r){let n=t.radius,i=t.center.x,o=t.center.y,s=e.anchorDiamond.fill,a=e.anchorDiamond.stroke,c=ee("path",{d:`M${h(i)} ${h(o-n)} L${h(i+n)} ${h(o)} L${h(i)} ${h(o+n)} L${h(i-n)} ${h(o)} Z`,fill:s,stroke:a,"stroke-width":1.25}),l=e.anchorDiamond.label,u=t.labelSide==="left"?t.labelBox.x+t.labelBox.width:t.labelBox.x,f={x:h(u),y:h(o+4),"font-family":r.sans,"font-size":10,fill:l};t.labelSide==="left"&&(f["text-anchor"]="end");let d=t.title?Ce(f,t.title):"";return ee("g",{"data-layer":"anchor","data-id":t.id??null},c+d)}function zG(t,e){let r=e.anchorDiamond.cutLine;return ee("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 WG(t,e,r){let n=t.center.x,i=t.center.y,o=t.radius,s=e.milestoneDiamond.fill,a=ee("path",{d:`M${h(n)} ${h(i-o)} L${h(n+o)} ${h(i)} L${h(n)} ${h(i+o)} L${h(n-o)} ${h(i)} Z`,fill:s,stroke:s,"stroke-width":1}),c=e.milestoneDiamond.label,l=t.labelSide==="left"?t.labelBox.x+t.labelBox.width:t.labelBox.x,u={x:h(l),y:h(i+4),"font-family":r.sans,"font-size":10,"font-weight":600,fill:c};t.labelSide==="left"&&(u["text-anchor"]="end");let f=t.title?Ce(u,t.title):"";return ee("g",{"data-layer":"milestone","data-id":t.id??null},a+f)}function qG(t,e){let r=t.isOverrun?e.milestoneDiamond.cutLineOverrun:e.milestoneDiamond.cutLineNormal,n=[];if(n.push(ee("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":Op,"stroke-linecap":"round"})),t.slackArrows&&t.slackArrows.length>0){let i=e.milestoneDiamond.slack;for(let o of t.slackArrows)n.push(ee("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 TP(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 ee("path",{d:VG(n,BT),fill:"none",stroke:r,"stroke-width":i,"stroke-dasharray":t.kind==="overflow"?"4 2":null,"stroke-linejoin":"round","marker-end":"url(#nl-arrow)"})}function VG(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 YG(t,e,r,n){if(t.entries.length===0)return"";let i=r.footnotePanel.fill,o=r.footnotePanel.border,s=r.footnotePanel.header,a=r.footnotePanel.title,c=r.footnotePanel.description,l=r.footnotePanel.number,u=[];u.push(ee("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:i,stroke:o,"stroke-width":1,filter:`url(#${e}-shadow-subtle)`})),u.push(Ce({x:h(t.box.x+Br),y:h(t.box.y+DT),"font-family":n.sans,"font-size":12,"font-weight":700,fill:s},"Footnotes"));let f=t.box.y+Nl+Br,d=t.box.x+Br,p=d+Br;return t.entries.forEach((m,y)=>{let E=f+y*Pl;u.push(Ce({x:h(d),y:h(E),"font-family":n.sans,"font-size":10,"font-weight":700,fill:l},String(m.number))),u.push(Ce({x:h(p),y:h(E),"font-family":n.sans,"font-size":11,"font-weight":600,fill:a},m.title)),m.description&&u.push(Ce({x:h(p+Math.max(120,m.title.length*6)),y:h(E),"font-family":n.sans,"font-size":11,fill:c},`\u2014 ${m.description}`))}),ee("g",{"data-layer":"footnotes"},u.join(""))}function KG(t,e,r,n,i){let o=n.includeRegion.border,s=n.includeRegion.fill,a=n.includeRegion.tabFill,c=n.includeRegion.tabStroke,l=n.includeRegion.tabText,u=n.includeRegion.badgeFill,f=n.includeRegion.badgeStroke,d=n.includeRegion.badgeText,p=t.box.x+8,m=t.box.y,y=t.box.width-16,E=t.box.height,_=ee("rect",{x:h(p),y:h(m),width:h(y),height:h(E),rx:8,ry:8,fill:s,stroke:o,"stroke-width":1,"stroke-dasharray":Op}),x=Np,v=Ya(t.box.x,t.label,t.sourcePath),k=m-x/2,F=ee("rect",{x:h(v.tabX),y:h(k),width:h(v.tabWidth),height:x,rx:4,ry:4,fill:a,stroke:c,"stroke-width":1}),O=Ce({x:h(v.tabLabelX),y:h(k+Pp),"font-family":i.sans,"font-size":11,"font-weight":600,fill:l},t.label),L=v.badgeX,G=v.badgeSize,H=m-G/2,oe=ee("rect",{x:h(L),y:h(H),width:G,height:G,rx:4,ry:4,fill:u,stroke:f,"stroke-width":1}),$=ee("path",{d:`M${h(L+7)} ${h(H+4)} H${h(L+14)} V${h(H+11)} M${h(L+4)} ${h(H+7)} H${h(L+11)} V${h(H+14)} H${h(L+4)} Z`,stroke:d,"stroke-width":1.4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}),w=9,D=m+4,U=ee("rect",{x:h(v.sourceHaloX),y:h(D-w),width:h(v.sourceHaloWidth),height:w+6,fill:s}),S=Ce({x:h(v.sourceTextX),y:h(D),"font-family":i.mono,"font-size":w,fill:d},t.sourcePath),A=t.nestedSwimlanes.map(I=>vP(I,e,r,n,i)).join("");return ee("g",{"data-layer":"include"},_+A+F+O+oe+$+U+S)}function ZG(t,e){let r=t.palette.attribution.mark,n=t.palette.attribution.link;if(t.swimlanes.length===0)return"";let i=t.header.attributionBox.x,o=t.header.attributionBox.y,s=Oi,a=Ce({x:"0",y:s,"font-family":e.sans,"font-size":$p,"font-weight":400,fill:r},Mp)+Ce({x:Ol,y:s,"font-family":e.sans,"font-size":Oi,"font-weight":700,fill:r},"now")+ee("rect",{x:$T,y:12,width:FT,height:Oi,fill:n})+Ce({x:Fp,y:s,"font-family":e.sans,"font-size":Oi,"font-weight":400,fill:r},"ine"),c=ee("g",{transform:`translate(${h(i)} ${h(o)}) scale(${h(Cl)})`},a);return ee("a",{href:MT,target:"_blank",rel:"noopener","aria-label":"Powered by nowline"},ee("g",{"data-layer":"attribution"},c))}async function JG(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=fP(u,{idPrefix:`${r}-logo`,onWarn:n.warn});return ee("g",{transform:`translate(${h(i)} ${h(o)})`},f)}if(c==="image/png"||c==="image/jpeg"||c==="image/jpg"||c==="image/webp"){let u=QG(a.bytes);return ee("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 QG(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 D_(t,e={}){let n=new xh(e.idPrefix??"nl").next("root"),i=t.palette,o=e.fontFamilies??GT,s=[],a=i.arrowhead.neutral,c=i.arrowhead.light,l=i.arrowhead.dark,u=(p,m)=>`<marker id="${p}" 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="${m}"/></marker>`,f=`<defs>${gP(n)}`+u("nl-arrow",a)+u("nl-arrow-light",c)+u("nl-arrow-dark",l)+"</defs>";s.push(f),s.push(ee("rect",{x:0,y:0,width:h(t.width),height:h(t.height),fill:t.backgroundColor})),s.push(LG(t.timeline,i,o));for(let p of t.swimlanes)s.push(HG(p,i));s.push(OG(t.timeline,t.chartBox.y,i));for(let p of t.edges)p.kind==="underBar"&&s.push(TP(p,i));for(let p of t.swimlanes)s.push(vP(p,e,n,i,o));for(let p of t.includes)s.push(KG(p,e,n,i,o));for(let p of t.edges)p.kind!=="underBar"&&s.push(TP(p,i));for(let p of t.anchors)s.push(zG(p,i));for(let p of t.milestones)s.push(qG(p,i));for(let p of t.anchors)s.push(jG(p,i,o));for(let p of t.milestones)s.push(WG(p,i,o));if(s.push(DG(t.nowline,i,o)),s.push(YG(t.footnotes,n,i,o)),s.push(CG(t.header,n,i,o)),s.push(ZG(t,o)),t.header.logo&&e.assetResolver){let p=await JG(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));p&&s.push(p)}return`<svg${ja({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"})}>${s.join("")}</svg>`}var M_="/browser-source.nowline",eX={error:3,warning:2,info:1},tX={error:3,warning:2,info:1};function bP(t,e){return eX[t]>=tX[e]}var Th,wP=0;function RP(){return Th||(Th=xT()),Th}function rX(){return ht.parse(`memory:///nowline-browser-${++wP}.nowline`)}async function _h(t,e={}){let r=e.filePath??M_,n=RP(),o=n.shared.workspace.LangiumDocumentFactory.fromString(t,rX());await n.shared.workspace.DocumentBuilder.build([o],{validation:!0});let s=[];for(let a of Ah(o))a.origin==="lexer"?s.push(nP(a.error,r)):a.origin==="parser"?s.push(rP(a.error,r)):s.push(tP(a.diagnostic,r));return{ast:o.parseResult.value,diagnostics:s}}async function $_(t,e={}){let r=e.filePath??M_,n=await _h(t,{filePath:r});if(n.diagnostics.some(x=>x.severity==="error"))return{kind:"diagnostics",diagnostics:n.diagnostics};let i=RP(),o=e.readFile??cP,s=await aT(n.ast,r,{services:i.Nowline,readFile:o}),a=[...n.diagnostics];for(let x of s.diagnostics){if(x.severity==="error"&&lP(x.message)){e.onSkippedInclude?.({sourcePath:x.sourcePath,message:x.message});continue}a.push(iP(x))}if(a.some(x=>x.severity==="error"))return{kind:"diagnostics",diagnostics:a};let c;if(e.timezone)try{c=k_(e.timezone)}catch(x){if(x instanceof Co)return{kind:"diagnostics",diagnostics:[{severity:"error",code:"invalid-timezone",message:x.message,file:r,line:1,column:1}]};throw x}let l=N_({now:e.today,zone:c}),u=S_(n.ast,s,{theme:e.theme,today:l,locale:e.locale,width:e.width}),f=e.diagnosticLevel??"error",d=I_(u,{today:l??void 0,locale:e.locale??"en-US"}).map(x=>sP(x,r)),p=e.showLinks!==!1,m=e.strict===!0,y=[],E=await D_(u,{idPrefix:e.idPrefix,assetResolver:e.assetResolver,noLinks:!p,strict:m,warn:x=>y.push(x),fontFamilies:e.fontFamilies}),_=[...d,...y.map(x=>oP(x,r,m?"error":"warning"))].filter(x=>bP(x.severity,f));return m&&_.length>0?{kind:"diagnostics",diagnostics:[...a,..._]}:{kind:"svg",svg:E,warnings:_}}function F_(){Th=void 0,wP=0}var SP="/embed.nowline",U_=!1;async function AP(t){let{ast:e,diagnostics:r}=await _h(t,{filePath:SP});return{ast:e,errors:r.filter(n=>n.severity==="error").map(n=>n.message)}}async function Eh(t,e={}){let r={filePath:SP,theme:e.theme,today:e.today,timezone:e.timezone,locale:e.locale,width:e.width,idPrefix:e.idPrefix,onSkippedInclude:()=>{U_||(U_=!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 $_(t,r);if(n.kind==="svg")return n.svg;let i=n.diagnostics.filter(o=>o.severity==="error").map(o=>o.message);throw new Vl(`Failed to render Nowline source: ${i.join("; ")}`,i)}var Vl=class extends Error{constructor(r,n){super(r);R(this,"details",n);this.name="EmbedRenderError"}};function IP(){U_=!1,F_()}var Hr=Uint8Array,lr=Uint16Array,j_=Int32Array,z_=new Hr([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]),W_=new Hr([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 Hr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),OP=function(t,e){for(var r=new lr(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];for(var i=new j_(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}},LP=OP(z_,2),nX=LP.b,G_=LP.r;nX[28]=258,G_[258]=28;var DP=OP(W_,0),Ese=DP.b,NP=DP.r,X_=new lr(32768);for(Le=0;Le<32768;++Le)Hn=(Le&43690)>>1|(Le&21845)<<1,Hn=(Hn&52428)>>2|(Hn&13107)<<2,Hn=(Hn&61680)>>4|(Hn&3855)<<4,X_[Le]=((Hn&65280)>>8|(Hn&255)<<8)>>1;var Hn,Le,Zl=(function(t,e,r){for(var n=t.length,i=0,o=new lr(e);i<n;++i)t[i]&&++o[t[i]-1];var s=new lr(e);for(i=1;i<e;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(r){a=new lr(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[X_[f]>>c]=l}else for(a=new lr(n),i=0;i<n;++i)t[i]&&(a[i]=X_[s[t[i]-1]++]>>15-t[i]);return a}),Oo=new Hr(288);for(Le=0;Le<144;++Le)Oo[Le]=8;var Le;for(Le=144;Le<256;++Le)Oo[Le]=9;var Le;for(Le=256;Le<280;++Le)Oo[Le]=7;var Le;for(Le=280;Le<288;++Le)Oo[Le]=8;var Le,vh=new Hr(32);for(Le=0;Le<32;++Le)vh[Le]=5;var Le,iX=Zl(Oo,9,0);var oX=Zl(vh,5,0);var MP=function(t){return(t+7)/8|0},sX=function(t,e,r){return(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length),new Hr(t.subarray(e,r))};var jn=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>8},Yl=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},B_=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:FP,l:0};if(i==1){var s=new Hr(r[0].s+1);return s[r[0].s]=1,{t:s,l:1}}r.sort(function(F,O){return F.f-O.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 lr(d+1),m=H_(r[u-1],p,0);if(m>e){var n=0,y=0,E=m-e,_=1<<E;for(o.sort(function(O,L){return p[L.s]-p[O.s]||O.f-L.f});n<i;++n){var x=o[n].s;if(p[x]>e)y+=_-(1<<m-p[x]),p[x]=e;else break}for(y>>=E;y>0;){var v=o[n].s;p[v]<e?y-=1<<e-p[v]++-1:++n}for(;n>=0&&y;--n){var k=o[n].s;p[k]==e&&(--p[k],++y)}m=e}return{t:new Hr(p),l:m}},H_=function(t,e,r){return t.s==-1?Math.max(H_(t.l,e,r+1),H_(t.r,e,r+1)):e[t.s]=r},PP=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new lr(++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}},Kl=function(t,e){for(var r=0,n=0;n<e.length;++n)r+=t[n]*e[n];return r},$P=function(t,e,r){var n=r.length,i=MP(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},CP=function(t,e,r,n,i,o,s,a,c,l,u){jn(e,u++,r),++i[256];for(var f=B_(i,15),d=f.t,p=f.l,m=B_(o,15),y=m.t,E=m.l,_=PP(d),x=_.c,v=_.n,k=PP(y),F=k.c,O=k.n,L=new lr(19),G=0;G<x.length;++G)++L[x[G]&31];for(var G=0;G<F.length;++G)++L[F[G]&31];for(var H=B_(L,7),oe=H.t,$=H.l,w=19;w>4&&!oe[kP[w-1]];--w);var D=l+5<<3,U=Kl(i,Oo)+Kl(o,vh)+s,S=Kl(i,d)+Kl(o,y)+s+14+3*w+Kl(L,oe)+2*L[16]+3*L[17]+7*L[18];if(c>=0&&D<=U&&D<=S)return $P(e,u,t.subarray(c,c+l));var A,I,B,z;if(jn(e,u,1+(S<U)),u+=2,S<U){A=Zl(d,p,0),I=d,B=Zl(y,E,0),z=y;var j=Zl(oe,$,0);jn(e,u,v-257),jn(e,u+5,O-1),jn(e,u+10,w-4),u+=14;for(var G=0;G<w;++G)jn(e,u+3*G,oe[kP[G]]);u+=3*w;for(var V=[x,F],K=0;K<2;++K)for(var ue=V[K],G=0;G<ue.length;++G){var Y=ue[G]&31;jn(e,u,j[Y]),u+=oe[Y],Y>15&&(jn(e,u,ue[G]>>5&127),u+=ue[G]>>12)}}else A=iX,I=Oo,B=oX,z=vh;for(var G=0;G<a;++G){var ne=n[G];if(ne>255){var Y=ne>>18&31;Yl(e,u,A[Y+257]),u+=I[Y+257],Y>7&&(jn(e,u,ne>>23&31),u+=z_[Y]);var Re=ne&31;Yl(e,u,B[Re]),u+=z[Re],Re>3&&(Yl(e,u,ne>>5&8191),u+=W_[Re])}else Yl(e,u,A[ne]),u+=I[ne]}return Yl(e,u,A[256]),u+I[256]},aX=new j_([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),FP=new Hr(0),cX=function(t,e,r,n,i,o){var s=o.z||t.length,a=new Hr(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=aX[e-1],d=f>>13,p=f&8191,m=(1<<r)-1,y=o.p||new lr(32768),E=o.h||new lr(m+1),_=Math.ceil(r/3),x=2*_,v=function(pe){return(t[pe]^t[pe+1]<<_^t[pe+2]<<x)&m},k=new j_(25e3),F=new lr(288),O=new lr(32),L=0,G=0,H=o.i||0,oe=0,$=o.w||0,w=0;H+2<s;++H){var D=v(H),U=H&32767,S=E[D];if(y[U]=S,E[D]=U,$<=H){var A=s-H;if((L>7e3||oe>24576)&&(A>423||!l)){u=CP(t,c,0,k,F,O,G,oe,w,H-w,u),oe=L=G=0,w=H;for(var I=0;I<286;++I)F[I]=0;for(var I=0;I<30;++I)O[I]=0}var B=2,z=0,j=p,V=U-S&32767;if(A>2&&D==v(H-V))for(var K=Math.min(d,A)-1,ue=Math.min(32767,H),Y=Math.min(258,A);V<=ue&&--j&&U!=S;){if(t[H+B]==t[H+B-V]){for(var ne=0;ne<Y&&t[H+ne]==t[H+ne-V];++ne);if(ne>B){if(B=ne,z=V,ne>K)break;for(var Re=Math.min(V,ne-2),Se=0,I=0;I<Re;++I){var $e=H-V+I&32767,q=y[$e],Q=$e-q&32767;Q>Se&&(Se=Q,S=$e)}}}U=S,S=y[U],V+=U-S&32767}if(z){k[oe++]=268435456|G_[B]<<18|NP[z];var re=G_[B]&31,M=NP[z]&31;G+=z_[re]+W_[M],++F[257+re],++O[M],$=H+B,++L}else k[oe++]=t[H],++F[t[H]]}}for(H=Math.max(H,$);H<s;++H)k[oe++]=t[H],++F[t[H]];u=CP(t,c,l,k,F,O,G,oe,w,H-w,u),l||(o.r=u&7|c[u/8|0]<<3,u-=7,o.h=E,o.p=y,o.i=H,o.w=$)}else{for(var H=o.w||0;H<s+l;H+=65535){var de=H+65535;de>=s&&(c[u/8|0]=l,de=s),u=$P(c,u+1,t.subarray(H,de))}o.i=s}return sX(a,0,n+MP(u)+i)};var UP=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}}},lX=function(t,e,r,n,i){if(!i&&(i={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),s=new Hr(o.length+t.length);s.set(o),s.set(t,o.length),t=s,i.w=o.length}return cX(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 BP=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};var uX=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=UP();i.p(e.dictionary),BP(t,2,i.d())}};function GP(t,e){e||(e={});var r=UP();r.p(t);var n=lX(t,e,e.dictionary?6:2,4);return uX(n,e),BP(n,n.length-4,r.d()),n}var fX=typeof TextDecoder<"u"&&new TextDecoder,dX=0;try{fX.decode(FP,{stream:!0}),dX=1}catch{}var jP="https://free.nowline.io/open";function XP(t){let e=new TextEncoder().encode(t),r=GP(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 q_({source:t,sourceUrl:e,share:r}){if(r===!1||r==="none")return null;if(typeof r=="object")return e!==void 0&&HP(e)?r.remoteUrl.replace("{url}",encodeURIComponent(e)):r.textUrl.replace("{text}",XP(t));let n=r===!0?jP:r,i=new URL(n);return e!==void 0&&HP(e)?i.hash=`url=${encodeURIComponent(e)}`:i.hash=`text=${XP(t)}`,i.toString()}function HP(t){try{return new URL(t).protocol==="https:"}catch{return!1}}var zP=0;async function WP(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=++zP,s=t.share??!0,a=[],c=0;for(let l of Array.from(r)){let u=pX(l);if(!u)continue;let f=hX(l),d=`nl-r${o}-${c++}`,p={theme:t.theme,locale:t.locale,width:t.width,today:t.today,timezone:t.timezone,idPrefix:d},m=u.parentElement,y=u.nextSibling,_=l.getAttribute("data-nowline-source-url")??void 0??t.sourceUrl;a.push(Eh(f,p).then(x=>{if(mX(u,x),n++,m!==null){let v=q_({source:f,sourceUrl:_,share:s});if(v!==null){let k=e.createElement("a");k.className="nowline-share",k.href=v,k.target="_blank",k.rel="noopener noreferrer",k.textContent="Share on Nowline",m.insertBefore(k,y)}}},x=>{i++,console.error("nowline: render failed",x)}))}return await Promise.all(a),{rendered:n,failed:i}}function pX(t){let e=t.parentElement;return e&&e.tagName.toUpperCase()==="PRE"?e:t}function hX(t){return t.textContent??""}function mX(t,e){t.outerHTML=e}function qP(){zP=0}function bh(){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 VP(t,e){return t&&t!=="auto"?wT(t)??e:e}var gX="0.8.5",yX="64645c3",xX="pre code.language-nowline, code.language-nowline",YP={theme:"auto",startOnLoad:!0,selector:xX,systemTheme:bh(),share:!0},nt={...YP},V_=!1;function TX(t={}){nt={theme:t.theme??nt.theme,startOnLoad:t.startOnLoad??nt.startOnLoad,selector:t.selector??nt.selector,locale:t.locale??nt.locale,width:t.width??nt.width,today:t.today!==void 0?t.today:nt.today,timezone:t.timezone??nt.timezone,share:t.share??nt.share,sourceUrl:t.sourceUrl??nt.sourceUrl,systemTheme:bh()}}function KP(){return{theme:VP(nt.theme,nt.systemTheme),locale:nt.locale,width:nt.width,today:nt.today,timezone:nt.timezone}}async function _X(t,e={}){let r={...KP(),...e};return Eh(t,r)}async function EX(t){return AP(t)}async function Y_(t){let e={selector:t?.selector??nt.selector,theme:t?.theme??KP().theme,locale:t?.locale??nt.locale,width:t?.width??nt.width,today:t?.today!==void 0?t.today:nt.today,timezone:t?.timezone??nt.timezone,share:t?.share??nt.share,sourceUrl:t?.sourceUrl??nt.sourceUrl,document:t?.document};return WP(e)}var vX=Y_;if(typeof document<"u"&&!V_){V_=!0;let t=()=>{nt.startOnLoad&&Y_()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):queueMicrotask(t)}function bX(){nt={...YP,systemTheme:bh()},V_=!1,IP(),qP()}return tu(wX);})();
2638
+ }`));var iU={languageId:"nowline",fileExtensions:[".nowline"],caseInsensitive:!1,mode:"development"},xI={AstReflection:()=>new gl},TI={Grammar:()=>yI(),LanguageMetaData:()=>iU,parser:{}};var _I={"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}"?`:""}`,"NL.W1000":t=>`Now-line date ${t.date} is outside the roadmap window (${t.start} \u2013 ${t.end}); it will not be drawn.`,"NL.I1000":t=>`Title on item "${t.name}" is wider than its bar at this scale; it rendered to the right of the bar.`,"NL.I1001":t=>`Label chips on item "${t.name}" did not fit inside the bar; they rendered in a spill column to the right.`,"NL.I1002":t=>`Item "${t.name}" is too narrow to show its marker at this scale; decorations spilled beside the bar.`,"NL.I1003":t=>t.anchor?`Item "${t.name}" extends past its "before:" anchor "${t.anchor}".`:`Item "${t.name}" extends past its "before:" anchor.`,"NL.I1004":t=>`Swimlane "${t.lane}" packed into ${t.rows} rows to avoid overlap.`,"NL.I1005":t=>`Swimlane "${t.lane}" is over capacity in one or more periods (red utilization band).`};var EI={"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 vI={};var bI={};var oU=new Map([["en-US",_I],["fr",EI],["fr-CA",vI],["fr-FR",bI]]);function bl(t,e,...r){for(let n of sU(t)){let o=oU.get(n)?.[e];if(o)return o(...r)}return e}var wI="en-US";function sU(t){let e=[],r=aU(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(wI)||e.push(wI),e}function aU(t){return t.split("-").map((r,n)=>n===0?r.toLowerCase():/^[a-zA-Z]{2}$/.test(r)?r.toUpperCase():r).join("-")}var cU=/[\\/]/;function AI(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 RI(...t){for(let e of t)if(e){if(e.includes("\\")&&!e.includes("/"))return"\\";if(e.includes("/"))return"/"}return"/"}function lU(t){return t?t[0]==="/"||t[0]==="\\"?!0:t.length>=3&&/^[A-Za-z]:[\\/]/.test(t):!1}function II(t){let e=AI(t);return e<0?".":e===0?t[0]:e===2&&/^[A-Za-z]:[\\/]/.test(t)?t.slice(0,3):t.slice(0,e)}function Tp(t){let e=AI(t);return e<0?t:t.slice(e+1)}function cT(t,e){if(lU(e))return SI(e,RI(e));let r=RI(t,e);return SI(`${t}${r}${e}`,r)}function SI(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(cU))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 fU=/^\d{4}-\d{2}-\d{2}$/;function PI(t){let e=t?.properties.find(r=>r.key==="start");if(e?.value&&fU.test(e.value)&&!Number.isNaN(new Date(e.value).getTime()))return e.value}function dU(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 CI(){return{styles:new Map,defaults:new Map,symbols:new Map}}function OI(){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 uT(t,e,r){let n=r.readFile??(async c=>{let{nodeReadFile:l}=await Promise.resolve().then(()=>(NI(),kI));return l(c)}),i={services:r.services,diagnostics:[],resolving:[],processed:new Map,readFile:n},o=cT("",e),{config:s,content:a}=await DI(t,o,i);return{config:s,content:a,diagnostics:i.diagnostics,processedFiles:new Set(i.processed.keys())}}async function DI(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:CI(),content:OI()};return r.processed.set(e,a),a}r.resolving.push(e);let n=CI(),i=OI();gU(n,t),TU(i,t);let o=new Set;for(let a of t.includes){let c=a.path,l=cT(II(e),c);if(o.has(l)){r.diagnostics.push({severity:"error",message:`Duplicate include "${c}" in ${Tp(e)}.`,sourcePath:e,line:a.$cstNode?.range.start.line});continue}o.add(l);let u=LI(a,"config")??"merge",f=LI(a,"roadmap")??"merge",d;try{let y=await r.readFile(l);d=await pU(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 DI(d,l,r);if(hU(n,p,u,l,r.diagnostics),mU(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=PI(t.roadmapDecl),E=PI(d.roadmapDecl);y!==E&&r.diagnostics.push({severity:"error",message:dU(c,y,E),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 LI(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 pU(t,e,r){let n=ut.file(r),o=t.shared.workspace.LangiumDocumentFactory.fromString(e,n);return await t.shared.workspace.DocumentBuilder.build([o],{validation:!1}),o.parseResult.value}function hU(t,e,r,n,i){if(r==="ignore"||r==="isolate")return;let o=(s,a)=>i.push({severity:"warning",message:`${a} "${s}" from ${Tp(n)} is shadowed by the parent's definition.`,sourcePath:n});lT(t.styles,e.styles,s=>o(s,"Style")),lT(t.defaults,e.defaults,s=>o(s,"Default")),lT(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 mU(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 ${Tp(i)} is shadowed by the parent's definition.`,sourcePath:i});Ln(t.persons,e.persons,c=>a(c,"Person")),Ln(t.teams,e.teams,c=>a(c,"Team")),Ln(t.anchors,e.anchors,c=>a(c,"Anchor")),Ln(t.labels,e.labels,c=>a(c,"Label")),Ln(t.sizes,e.sizes,c=>a(c,"Size")),Ln(t.statuses,e.statuses,c=>a(c,"Status")),Ln(t.swimlanes,e.swimlanes,c=>a(c,"Swimlane")),Ln(t.milestones,e.milestones,c=>a(c,"Milestone")),Ln(t.footnotes,e.footnotes,c=>a(c,"Footnote")),e.roadmap&&!t.roadmap&&(t.roadmap=e.roadmap)}function lT(t,e,r){for(let[n,i]of e){if(t.has(n)){r(n);continue}t.set(n,i)}}function Ln(t,e,r){for(let[n,i]of e){if(!i.name&&i.title){t.set($I(t,MI(i.title)),i);continue}if(t.has(n)){r(n);continue}t.set(n,i)}}function gU(t,e){for(let r of e.configEntries)yU(t,r)}function yU(t,e){mI(e)?t.scale||(t.scale=e):xp(e)?t.calendar||(t.calendar=e):El(e)?e.name&&!t.styles.has(e.name)&&t.styles.set(e.name,e):vl(e)?e.name&&!t.symbols.has(e.name)&&t.symbols.set(e.name,e):Ni(e)&&(t.defaults.has(e.entityType)||t.defaults.set(e.entityType,e))}function xU(t){let e={swimlanes:new Set,persons:new Set,teams:new Set,anchors:new Set,labels:new Set,sizes:new Set,statuses:new Set,milestones:new Set,footnotes:new Set};for(let r of t){let n=r.name;n&&(yr(r)?e.swimlanes.add(n):On(r)?e.persons.add(n):xr(r)?e.teams.add(n):yl(r)?e.anchors.add(n):Tl(r)?e.labels.add(n):Eo(r)?e.sizes.add(n):Ea(r)?e.statuses.add(n):_l(r)?e.milestones.add(n):xl(r)&&e.footnotes.add(n))}return e}function TU(t,e){e.roadmapDecl&&!t.roadmap&&(t.roadmap=e.roadmapDecl);let r=xU(e.roadmapEntries);for(let n of e.roadmapEntries)_U(t,n,r)}function MI(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"entity"}function $I(t,e,r){let n=o=>t.has(o)||(r?.has(o)??!1);if(!n(e))return e;let i=2;for(;n(`${e}-${i}`);)i++;return`${e}-${i}`}function Dn(t,e,r){e.name?t.has(e.name)||t.set(e.name,e):e.title&&t.set($I(t,MI(e.title),r),e)}function _U(t,e,r){yr(e)?Dn(t.swimlanes,e,r.swimlanes):On(e)?Dn(t.persons,e,r.persons):xr(e)?Dn(t.teams,e,r.teams):yl(e)?Dn(t.anchors,e,r.anchors):Tl(e)?Dn(t.labels,e,r.labels):Eo(e)?Dn(t.sizes,e,r.sizes):Ea(e)?Dn(t.statuses,e,r.statuses):_l(e)?Dn(t.milestones,e,r.milestones):xl(e)&&Dn(t.footnotes,e,r.footnotes)}var FI="v1",fT=new Set(["planned","in-progress","active","done","completed","at-risk","blocked"]),_p=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"]),gT=new Set(["none","multiplier","person","people","points","time"]),Ep=new Set([...gT,"shield","warning","lock","calendar"]),VI="none",vp={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"])},EU=new Set(["red","blue","yellow","green","orange","purple","violet","gray","grey","navy","white","none"]),vU=new Set(["business","full","custom"]),dT=new Set(["days-per-week","days-per-month","days-per-quarter","days-per-year"]),UI=new Set(["name","label-every","label"]),BI=new Set(["item","label","swimlane","roadmap","milestone","footnote","anchor","parallel","group"]),bU={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},GI=new Set(["labels","link","style","description"]),wU={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 RU(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 SU(t,e,r=2){let n,i=r+1;for(let o of e){let s=RU(t,o,r);if(s<i&&(n=o,i=s,s===0))break}return n}var AU=[{keys:new Set(["progress","percent","percentage","pct","complete","completion"]),requires:"remaining",suggest:"status: + remaining:"}];function IU(t,e){let r=t.toLowerCase();for(let n of AU)if(n.keys.has(r)&&e.has(n.requires))return n.suggest}function Ie(t){return t.key.endsWith(":")?t.key.slice(0,-1):t.key}var wl=/^\d+(?:\.\d+)?[dwmqy]$/,kU=/^\d+%$/,Pi=/^\d{4}-\d{2}-\d{2}$/,NU=/^#[0-9a-fA-F]{3,8}$/,PU=/^v\d+$/,HI=/^\d+$/,CU=/^[dwmqy]$/,XI=/^\d+(\.\d+)?$/,yT=/^\d+(\.\d+)?%$/,YI=/^\d+\.\d+$/,OU=/^\d+$/,LU=/^[\x20-\x7E]{1,3}$/,DU=/^[a-zA-Z]{2,3}(-[a-zA-Z]{2}|-\d{3})?$/,MU=new Set(["merge","ignore","isolate"]),jI=new Set(["locale"]);function pT(t){let e=t?.roadmapDecl?.properties.find(i=>Ie(i)==="start");if(!e)return{kind:"missing"};let r=e.value;if(!r||!Pi.test(r))return{kind:"invalid"};let n=new Date(r);return Number.isNaN(n.getTime())?{kind:"invalid"}:{kind:"valid",iso:r,date:n}}function $r(t){return t.name??t.title??"<unnamed>"}function $U(t){return t.$type.replace(/Declaration$|Block$/,"").toLowerCase()}function we(t,e,r,n,...i){t(e,bl("en-US",n,...i),{...r,data:{code:n,args:i}})}function KI(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 wp=class{checkFileStructure(e,r){let n=e.hasConfig?ku.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(!PU.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(FI.slice(1),10);n>i&&we(r,"error",{node:e,property:"version"},"NL.E0101",{version:e.version,supported:FI})}checkDirectiveProperties(e,r){let n=new Set;for(let i of e.properties){let o=Ie(i);if(!jI.has(o)){we(r,"error",{node:i,property:"key"},"NL.E0102",{key:o,allowed:[...jI].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;DU.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:bp(a)}):n.set(o,s)};e.roadmapDecl?.name&&i(e.roadmapDecl.name,e.roadmapDecl);for(let o of e.roadmapEntries)BU(o,i);for(let o of e.configEntries)El(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(yr);e.roadmapDecl&&!n&&we(r,"error",{node:e.roadmapDecl},"NL.E0004")}checkIncludeMode(e,r){MU.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=Ie(e),i=e.value,o=e.values,s=i?[i]:o;switch(n){case"status":break;case"duration":i&&!wl.test(i)&&we(r,"error",{node:e,property:"value"},"NL.E0400",{value:i});break;case"size":i&&!zI(i)&&we(r,"error",{node:e,property:"value"},"NL.E0401",{value:i});break;case"effort":i&&!wl.test(i)&&we(r,"error",{node:e,property:"value"},"NL.E0402",{value:i});break;case"remaining":{if(i)if(kU.test(i)){let a=parseFloat(i);(a<0||a>100)&&we(r,"error",{node:e,property:"value"},"NL.E0404",{value:i})}else wl.test(i)||we(r,"error",{node:e,property:"value"},"NL.E0403",{value:i});break}case"date":case"start":i&&(!Pi.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&&!wl.test(i)&&we(r,"error",{node:e,property:"value"},"NL.E0406",{value:i});break;case"calendar":i&&!vU.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=FU(a);if(c==="invalid")break;c==="lane"?(!XI.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"}):yT.test(i)?parseFloat(i)<=0&&r("error",`Item capacity "${i}" must be positive.`,{node:e,property:"value"}):XI.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(!UU(e.$container)){r("error",`"${n}:" is only valid on "swimlane" or "default swimlane".`,{node:e});break}if(i===VI)break;if(yT.test(i)){parseFloat(i)<=0&&r("error",`${n} value "${i}" must be positive.`,{node:e,property:"value"});break}if(YI.test(i)){parseFloat(i)<=0&&r("error",`${n} value "${i}" must be positive.`,{node:e,property:"value"});break}if(OU.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(_p.has(n)){if(n==="bg"||n==="fg"||n==="text")i&&!hT(i)&&r("error",`Invalid color "${i}" for "${n}". Use a named color, hex value, or "none".`,{node:e,property:"value"});else if(n in vp){let a=vp[n];i&&!a.has(i)&&!hT(i)&&r("error",`Invalid value "${i}" for "${n}". Allowed: ${[...a].join(", ")}.`,{node:e,property:"value"})}}break}}checkAnchorRequiredDate(e,r){e.properties.find(i=>Ie(i)==="date")||we(r,"error",{node:e},"NL.E0500",{name:$r(e)})}checkAnchorAgainstStart(e,r){let n=e.properties.find(a=>Ie(a)==="date");if(!n?.value)return;let i=n.value;if(!Pi.test(i))return;let o=new Date(i);if(Number.isNaN(o.getTime()))return;let s=pT(e.$container);switch(s.kind){case"invalid":return;case"missing":we(r,"error",{node:n,property:"value"},"NL.E0501",{name:$r(e)});return;case"valid":o<s.date&&we(r,"error",{node:n,property:"value"},"NL.E0502",{name:$r(e),date:i,start:s.iso});return}}checkMilestoneRequirement(e,r){let n=e.properties.some(o=>Ie(o)==="date"),i=e.properties.some(o=>Ie(o)==="after");!n&&!i&&we(r,"error",{node:e},"NL.E0503",{name:$r(e)})}checkMilestoneAgainstStart(e,r){let n=e.properties.find(a=>Ie(a)==="date");if(!n?.value)return;let i=n.value;if(!Pi.test(i))return;let o=new Date(i);if(Number.isNaN(o.getTime()))return;let s=pT(e.$container);switch(s.kind){case"invalid":return;case"missing":r("error",`Milestone "${$r(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:$r(e),date:i,start:s.iso});return}}checkFootnoteOn(e,r){e.properties.some(i=>Ie(i)==="on")||we(r,"error",{node:e},"NL.E0505")}checkNoFootnoteProperty(e,r){for(let n of e.properties)Ie(n)==="footnote"&&r("error",`Property "footnote:" is not valid on ${mT(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=>Ie(o)==="duration"),i=e.properties.some(o=>Ie(o)==="size");!n&&!i&&we(r,"error",{node:e},"NL.E0600",{name:$r(e)})}checkNoComputedProperties(e,r){for(let n of e.properties){let i=Ie(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=>!aT(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=>!aT(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=Ie(n);_p.has(i)&&r("error",`Raw style property "${i}" is not allowed on ${mT(e)}. Declare a named style in config and reference it via "style:id".`,{node:n})}}checkUnknownEntityProperties(e,r){let n=wU[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=Ie(o);if(n.has(s)||GI.has(s)||_p.has(s)||s==="footnote"||i?.has(s))continue;let a=[...n,...GI],c=IU(s,n)??SU(s,a)??"";we(r,"warning",{node:o,property:"key"},"NL.W0700",{key:s,entity:mT(e),suggested:c})}}checkRoadmapProperties(e,r){}checkStylePropertyEnum(e,r){let n=Ie(e),i=e.value;if(n==="bg"||n==="fg"||n==="text")hT(i)||r("error",`Invalid color "${i}" for "${n}". Use a named color, hex value, or "none".`,{node:e,property:"value"});else if(n in vp){let o=vp[n];o.has(i)||r("error",`Invalid value "${i}" for "${n}". Allowed: ${[...o].join(", ")}.`,{node:e,property:"value"})}else _p.has(n)||r("error",`Unknown style property "${n}".`,{node:e,property:"key"})}checkSizeDeclaration(e,r){e.properties.find(i=>Ie(i)==="effort")||r("error",`Size "${$r(e)}" requires an "effort:" property.`,{node:e}),e.name&&(wl.test(e.name)||CU.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&&fT.has(e.name)&&r("error",`Status id "${e.name}" collides with the built-in status value. Built-ins: ${[...fT].join(", ")}.`,{node:e,property:"name"})}checkDuplicateSizeIds(e,r){let n=new Map;for(let i of e.roadmapEntries)if(Eo(i)&&i.name){let o=n.get(i.name);o?r("error",`Duplicate size id "${i.name}". First declared at ${bp(o)}.`,{node:i,property:"name"}):n.set(i.name,i)}}checkUtilizationOrdering(e,r){if(Ni(e)&&e.entityType!=="swimlane")return;let n=e.properties.find(a=>Ie(a)==="utilization-warn-at"),i=e.properties.find(a=>Ie(a)==="utilization-over-at");if(!n||!i)return;let o=WI(n.value),s=WI(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(!BI.has(e.entityType)){r("error",`"${e.entityType}" is not a supported entity type for default. Allowed: ${[...BI].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(Ni(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=bU[e.entityType];if(o)for(let s of e.properties){let a=Ie(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(xp),o=e.roadmapDecl?.properties.find(s=>Ie(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=>Ie(c)));for(let c of dT)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=Ie(i);if(!dT.has(o)){r("error",`Unknown calendar property "${o}". Allowed: ${[...dT].join(", ")}.`,{node:i,property:"key"});continue}n.has(o)&&r("error",`Duplicate calendar property "${o}".`,{node:i,property:"key"}),n.add(o),(!HI.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=Ie(i);if(!UI.has(o)){r("error",`Unknown scale property "${o}". Allowed: ${[...UI].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"&&(!HI.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];Eo(s)&&s.name?n.has(s.name)||n.set(s.name,o):Ea(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];qI(s,a=>{let c=Ie(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(fT.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=GU(e),i=o=>{qI(o,s=>{let a=Ie(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")&&Pi.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=pT(e),i=o=>{let s=o.properties??[],a=ar(o)||Mr(o)||Dr(o);for(let c of s){let l=Ie(c);if(l!=="after"&&l!=="before")continue;let f=(c.value?[c.value]:c.values).filter(d=>!!d&&Pi.test(d));if(f.length!==0){if(!a){we(r,"error",{node:c},"NL.E0411",{key:l,type:$U(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(yr(o))for(let c of o.content)i(c);else if(Mr(o)||Dr(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 E of m){let _=Ie(E);if(_==="after"){let x=E.value?[E.value]:E.values;for(let v of x)v&&(Pi.test(v)||i(p,v))}else if(_==="before"){let x=E.value?[E.value]:E.values;for(let v of x)v&&(Pi.test(v)||i(v,p))}}},s=p=>{let m=p.name,y=p.properties??[];if(o(m,y,e),yr(p))for(let E of p.content)s(E);else if(Mr(p)||Dr(p))for(let E of p.content)s(E)};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 E=u.get(y)??a;if(E===c){let _=m.indexOf(y),x=m.slice(_).concat(y),v=[...x].sort().join("\u2192");f.has(v)||(f.add(v),r("error",`Circular dependency detected: ${x.join(" \u2192 ")}.`,{node:e.roadmapDecl??e}))}else E===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)On(c)?o(c):xr(c)&&s(c)};for(let a of e.roadmapEntries)On(a)?o(a):xr(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 ${bp(l[0].node)}.`,{node:l[u].node})}}checkSymbolDeclaration(e,r){e.name&&Ep.has(e.name)&&r("error",`Symbol id "${e.name}" collides with a built-in icon name. Reserved built-ins: ${[...Ep].sort().join(", ")}.`,{node:e,property:"name"});let n=e.properties.find(o=>Ie(o)==="unicode");n?(!n.value||n.value.length===0)&&r("error",`Symbol "${$r(e)}" unicode: must be a non-empty value.`,{node:n,property:"value"}):r("error",`Symbol "${$r(e)}" requires a "unicode:" property (e.g. unicode:"\u{1F4B0}" or unicode:"\\u{1F464}").`,{node:e});let i=e.properties.find(o=>Ie(o)==="ascii");if(i){let o=i.value??"";LU.test(o)||r("error",`Symbol "${$r(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=Ie(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(vl(i)&&i.name){let o=n.get(i.name);o?r("error",`Duplicate symbol id "${i.name}". First declared at ${bp(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];vl(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||!zI(a)||s==="capacity-icon"&&gT.has(a)||s==="icon"&&Ep.has(a))return;let l=n.get(a);if(l===void 0){let u=s==="capacity-icon"?[...gT].sort().join(", "):[...Ep].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(El(s))for(let a of s.properties)i(o,Ie(a),a.value,a);else if(Ni(s))for(let a of s.properties)i(o,Ie(a),a.value,a)}}};function hT(t){return EU.has(t)||NU.test(t)}function zI(t){return/^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(t)}function FU(t){return t?yr(t)?"lane":ar(t)?"item":Ni(t)?t.entityType==="swimlane"?"lane":"item":"invalid":"invalid"}function UU(t){return t?!!(yr(t)||Ni(t)&&t.entityType==="swimlane"):!1}function WI(t){if(!t||t===VI)return null;if(yT.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?e/100:null}if(YI.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?e:null}return null}function bp(t){let e=t.$cstNode;return e?`line ${e.range.start.line+1}`:"unknown location"}function mT(t){let e=t.$type.replace(/Declaration$|Block$/,"").toLowerCase(),r=t.name??t.title;return r?`${e} "${r}"`:e}function BU(t,e){if(yr(t)){e(t.name,t);for(let r of t.content)xT(r,e)}else On(t)?e(t.name,t):xr(t)?ZI(t,e):(yl(t)||_l(t)||xl(t)||Tl(t)||Eo(t)||Ea(t))&&e(t.name,t)}function ZI(t,e){e(t.name,t);for(let r of t.content)xr(r)&&ZI(r,e)}function xT(t,e){if(ar(t))e(t.name,t);else if(Mr(t)){e(t.name,t);for(let r of t.content)xT(r,e)}else if(Dr(t)){e(t.name,t);for(let r of t.content)xT(r,e)}}function qI(t,e){let r=n=>{let i=n.properties;if(Array.isArray(i))for(let o of i)e(o);if(yr(n))for(let o of n.content)r(o);else if(Mr(n)||Dr(n))for(let o of n.content)r(o);else if(xr(n))for(let o of n.content)(xr(o)||On(o))&&r(o)};r(t)}function GU(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),yr(n))for(let o of n.content)r(o);else if(Mr(n)||Dr(n))for(let o of n.content)r(o);else if(xr(n))for(let o of n.content)xr(o)||On(o)?r(o):hI(o)};for(let n of t.roadmapEntries)r(n);return e}var TT=class extends ks{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)}},_T=class extends dl{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]===`
2639
+ `);)n--;for(;n>=0&&(e[n]===" "||e[n]===" ");)n--;return n<0||e[n]!=="\\"}},JI={parser:{TokenBuilder:()=>new _T({indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[["[","]"]]}),Lexer:t=>new fp(t),ParserConfig:()=>({maxLookahead:4}),ValueConverter:()=>new TT},validation:{NowlineValidator:()=>new wp}};function ET(t={}){let e=t.shared??oa(up(dp),xI),r=oa(lp({shared:e}),TI,JI);return e.ServiceRegistry.register(r),KI(r),{shared:e,Nowline:r}}function QI(t){return t.endsWith(":")?t.slice(0,-1):t}function ae(t,e){return t.find(r=>QI(r.key)===e)?.value}function ft(t,e){let r=t.find(n=>QI(n.key)===e);return r?r.value!==void 0?[r.value]:[...r.values]:[]}function gt(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 va={mode:"business",daysPerWeek:5,daysPerMonth:22,daysPerQuarter:65,daysPerYear:260},HU={mode:"full",daysPerWeek:7,daysPerMonth:30,daysPerQuarter:91,daysPerYear:365};function ek(t,e){let n=t.roadmapDecl?.properties.find(i=>vT(i.key)==="calendar")?.value??"business";if(n==="business")return{...va};if(n==="full")return{...HU};if(e){let i=(o,s)=>{let a=e.properties.find(l=>vT(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",va.daysPerWeek),daysPerMonth:i("days-per-month",va.daysPerMonth),daysPerQuarter:i("days-per-quarter",va.daysPerQuarter),daysPerYear:i("days-per-year",va.daysPerYear)}}return{...va}}var Rp=/^(\d+(?:\.\d+)?)([dwmqy])$/;function Sp(t,e){let r=Rp.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 tk(t,e,r){return t?Rp.test(t)?Sp(t,r):e.get(t)?.effortDays??0:0}function Ci(t,e,r){let n=ae(t,"duration");if(n&&Rp.test(n))return Sp(n,r);let i=ae(t,"size"),o=i?e.get(i):void 0;if(!o)return 0;let s=qn(ae(t,"capacity"))??1;return o.effortDays/s}function rk(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&&Rp.test(o)){let s=qn(ae(t,"capacity"))??1;return Sp(o,r)*s}return 0}function Ap(t,e){let r=new Map;for(let[n,i]of t){let s=i.properties.find(c=>vT(c.key)==="effort")?.value;if(!s)continue;let a=Sp(s,e);a<=0||r.set(n,{name:n,title:i.title||void 0,effortDays:a,effortLiteral:s})}return r}function vT(t){return t.endsWith(":")?t.slice(0,-1):t}function Tr(t,e){return Math.round((e.getTime()-t.getTime())/864e5)}function vo(t,e){let r=new Date(t.getTime());return r.setUTCDate(r.getUTCDate()+e),r}var Ip=class{constructor(e){R(this,"items");R(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 nk(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 XU(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 jU(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 zU(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 WU(t){if(t===0||t>4)return 0;let e=Math.ceil(t/2);return(t%2===1?1:-1)*e*3}function qU(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 ik(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]=qU(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}=XU(s,e),{x:u,forceUnderBar:f}=jU(a,l,s,e),d=c||f;n.push({req:s,channelX:u,underBar:d,orderIndex:o})}let i=zU(n);for(let o of n){let s=WU(i.get(o.orderIndex)??0),a=o.channelX+s;r[o.orderIndex]={fromId:o.req.fromId,toId:o.req.toId,waypoints:VU(o.req.from,o.req.to,a),underBar:o.underBar}}return r}function VU(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 Rl="en-US",YU={"en-US":{nowLabel:"now",quarterPrefix:"Q"},fr:{nowLabel:"maint.",quarterPrefix:"T"}};function ok(t,e){return e??t??Rl}function kp(t){let e={};for(let r of KU(t)){let n=YU[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 KU(t){let e=[],r=ZU(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(Rl)||e.push(Rl),e}function ZU(t){return t.split("-").map((r,n)=>n===0?r.toLowerCase():/^[a-zA-Z]{2}$/.test(r)?r.toUpperCase():r).join("-")}function lk(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 Pp(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 Mn(t){for(let e of t)if(/^\d{4}-\d{2}-\d{2}$/.test(e))return e}function Cp(t,e){return{x:t,y:e,height:0,maxX:t}}var Ra=class{constructor(e){R(this,"rows");R(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 fk={red:"#f87171",blue:"#60a5fa",yellow:"#facc15",green:"#34d399",orange:"#fb923c",purple:"#a78bfa",gray:"#94a3b8",navy:"#818cf8",white:"#e2e8f0"},$n={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"},bT={name:"dark",surface:{page:"#0b1220",chart:"#111827",headerBox:"#1e293b"},entities:{roadmap:{...$n,headerHeight:"md",padding:"md"},swimlane:{...$n,fg:"#e2e8f0",text:"#e2e8f0",padding:"sm",spacing:"none",textSize:"sm"},item:{...$n,bg:"#0f172a",fg:"#94a3b8",text:"#e2e8f0",shadow:"subtle",cornerRadius:"sm"},parallel:{...$n,bracket:"none",padding:"xs"},group:{...$n,bracket:"solid",padding:"xs",fg:"#94a3b8"},anchor:{...$n,bg:"#0b1220",fg:"#cbd5e1",text:"#cbd5e1",cornerRadius:"sm"},milestone:{...$n,bg:"#e2e8f0",fg:"#e2e8f0",text:"#0b1220",border:"solid"},footnote:{...$n,bg:"none",fg:"#94a3b8",text:"#e2e8f0",textSize:"sm"},label:{...$n,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 dk={red:"#4a4a4a",blue:"#6b6b6b",green:"#8a8a8a",yellow:"#c8c8c8",orange:"#5c5c5c",purple:"#3a3a3a",gray:"#9e9e9e",navy:"#2a2a2a",white:"#ffffff"},Fn={bg:"none",fg:"#1a1a1a",text:"#1a1a1a",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"},wT={name:"grayscale",surface:{page:"#f5f5f5",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...Fn,headerHeight:"md",padding:"md"},swimlane:{...Fn,fg:"#3a3a3a",text:"#3a3a3a",padding:"sm",spacing:"none",textSize:"sm"},item:{...Fn,bg:"#ffffff",fg:"#9e9e9e",text:"#1a1a1a",shadow:"subtle",cornerRadius:"sm"},parallel:{...Fn,bracket:"none",padding:"xs"},group:{...Fn,bracket:"solid",padding:"xs",fg:"#595959"},anchor:{...Fn,bg:"#1a1a1a",fg:"#1a1a1a",text:"#1a1a1a",cornerRadius:"sm"},milestone:{...Fn,bg:"#2a2a2a",fg:"#2a2a2a",text:"#ffffff",border:"solid"},footnote:{...Fn,bg:"none",fg:"#595959",text:"#595959",textSize:"sm"},label:{...Fn,bg:"#e8e8e8",fg:"#595959",text:"#595959",textSize:"xs",padding:"xs",cornerRadius:"full"}},swimlane:{bandEven:"#ffffff",bandOdd:"#f5f5f5",separator:"#d4d4d4",frameTabText:"#3a3a3a",frameTabMuted:"#737373",border:"#d4d4d4",tabFill:"#e8e8e8",tabStroke:"#bdbdbd",tabText:"#3a3a3a",ownerText:"#737373",footnoteIndicator:"#4a4a4a",rowTintEven:"#ffffff",rowTintOdd:"#f5f5f5",utilizationOk:"#8a8a8a",utilizationWarn:"#595959",utilizationOver:"#1a1a1a"},timeline:{gridLine:"#bdbdbd",minorGridLine:"#d4d4d4",tickMark:"#bdbdbd",labelText:"#737373",panelFill:"#ffffff",border:"#d4d4d4"},header:{cardBorder:"#d4d4d4",author:"#737373"},item:{overflowX:"#1a1a1a",linkIconFg:"#1a1a1a",overflowTailFill:"#e8e8e8",overflowTailStroke:"#4a4a4a",overflowCaption:"#3a3a3a"},parallel:{bracketStroke:"#3a3a3a"},anchorDiamond:{fill:"#ffffff",stroke:"#3a3a3a",label:"#3a3a3a",cutLine:"#737373"},milestoneDiamond:{fill:"#1a1a1a",label:"#1a1a1a",cutLineNormal:"#2a2a2a",cutLineOverrun:"#4a4a4a",slack:"#1a1a1a"},footnotePanel:{fill:"#ffffff",border:"#d4d4d4",header:"#1a1a1a",title:"#1a1a1a",description:"#737373",number:"#4a4a4a"},nowline:{stroke:"#1a1a1a",labelText:"#ffffff",labelBg:"#1a1a1a"},milestone:{dashedInk:"#9e9e9e",overrun:"#4a4a4a"},anchor:{predecessorLine:"#9e9e9e"},dependency:{edgeStroke:"#595959",overflowStroke:"#1a1a1a"},footnote:{indicatorText:"#4a4a4a",descriptionMuted:"#737373"},includeRegion:{border:"#9e9e9e",label:"#3a3a3a",badge:"#737373",fill:"#f5f5f5",tabFill:"#ffffff",tabStroke:"#bdbdbd",tabText:"#1a1a1a",badgeFill:"#e8e8e8",badgeStroke:"#bdbdbd",badgeText:"#595959"},arrowhead:{neutral:"#595959",light:"#9e9e9e",dark:"#1a1a1a"},status:{done:"#8a8a8a",inProgress:"#595959",atRisk:"#737373",blocked:"#3a3a3a",planned:"#bdbdbd",neutral:"#bdbdbd"},statusDot:{onLight:{done:"#3a3a3a",inProgress:"#2a2a2a",atRisk:"#4a4a4a",blocked:"#1a1a1a",planned:"#595959",neutral:"#595959"},onDark:{done:"#d4d4d4",inProgress:"#e8e8e8",atRisk:"#c8c8c8",blocked:"#f0f0f0",planned:"#d4d4d4",neutral:"#d4d4d4"}},attribution:{mark:"#9e9e9e",link:"#1a1a1a"},diagnostic:{overlayBg:"#e8e8e8",errorText:"#1a1a1a"}};var pk={red:"#e53935",blue:"#1e88e5",yellow:"#fdd835",green:"#43a047",orange:"#fb8c00",purple:"#8e24aa",gray:"#9e9e9e",navy:"#0d47a1",white:"#ffffff"},Un={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"},RT={name:"light",surface:{page:"#f8fafc",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...Un,headerHeight:"md",padding:"md"},swimlane:{...Un,fg:"#334155",text:"#334155",padding:"sm",spacing:"none",textSize:"sm"},item:{...Un,bg:"#ffffff",fg:"#94a3b8",text:"#0f172a",shadow:"subtle",cornerRadius:"sm"},parallel:{...Un,bracket:"none",padding:"xs"},group:{...Un,bracket:"solid",padding:"xs",fg:"#475569"},anchor:{...Un,bg:"#0f172a",fg:"#0f172a",text:"#0f172a",cornerRadius:"sm"},milestone:{...Un,bg:"#312e81",fg:"#312e81",text:"#ffffff",border:"solid"},footnote:{...Un,bg:"none",fg:"#475569",text:"#475569",textSize:"sm"},label:{...Un,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 ST={light:RT,dark:bT,grayscale:wT};var tB={greyscale:"grayscale"};function AT(t){let e=t.toLowerCase(),r=tB[e]??e;if(r==="light"||r==="dark"||r==="grayscale")return r}var rB={grey:"gray",violet:"purple"};function bo(t,e){if(t==="none")return"none";if(t.startsWith("#"))return t;let r=e.name==="dark"?fk:e.name==="grayscale"?dk:pk,n=rB[t]??t,i=r[n];return typeof i=="string"?i:t}function Sa(t){return t.key.endsWith(":")?t.key.slice(0,-1):t.key}function nB(t,e){return{bg:bo(t.bg,e),fg:bo(t.fg,e),text:bo(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 IT(t,e,r,n){switch(e){case"bg":t.bg=bo(r,n);break;case"fg":t.fg=bo(r,n);break;case"text":t.text=bo(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=Il(r,"xl");break;case"padding":t.padding=Il(r,"xl");break;case"spacing":t.spacing=Il(r,"xl");break;case"header-height":t.headerHeight=Il(r,"xl");break;case"corner-radius":t.cornerRadius=Il(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 Il(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 hk(t,e,r){if(e)for(let n of e.properties)IT(t,Sa(n),n.value,r)}function iB(t,e,r){for(let n of e){let i=Sa(n);n.value!==void 0&&IT(t,i,n.value,r)}}function oB(t,e,r){let n=e.find(o=>Sa(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=>Sa(c)==="style");a?.value&&hk(t,r.styles.get(a.value),r.theme)}}function sB(t,e,r){let n=e.find(i=>Sa(i)==="style");n?.value&&hk(t,r.styles.get(n.value),r.theme)}function dt(t,e,r){let n=r.theme.entities[t],i=nB(n,r.theme),o=r.defaults.get(t);if(o)for(let s of o.properties)s.value!==void 0&&IT(i,Sa(s),s.value,r.theme);return oB(i,e,r),sB(i,e,r),iB(i,e,r.theme),i}function mk(t,e){return dt("label",t.properties,e)}var gk={none:0,xs:2,sm:4,md:8,lg:16,xl:24},yk={none:0,xs:4,sm:8,md:12,lg:20,xl:32};var Aa={none:0,xs:10,sm:12,md:14,lg:18,xl:24},Op={none:0,xs:2,sm:4,md:8,lg:12,xl:20,full:9999};var _r=8,an=4,kl=24,Lp=15,Nl=8,Dp=22,Mp=15,Pl=16,$p=6,kT=4,NT=11,PT=9,CT=5.5,OT=4,Ia=12,Fp="6 4",LT=36,Oi=16,DT=Oi/2,Cl=10,MT=Oi-4,ka=6,Up=2.25,Fr=6,Ur=2*Fr,xk=5,Tk=120,$T=240,Bp=72,Ol=28,Br=16,FT=22,Ll=18,Gp="Powered by",UT="https://nowline.io",Dl=.22,Li=40,Hp=32,_k=.58,aB=Gp.length*Hp*_k,cB=10,Ml=aB+cB,BT=Ml+74,GT=5,Xp=Ml+81,lB=3*Li*_k,uB=Xp+lB,fB=12+Li,HT=uB*Dl,Ek=fB*Dl,XT=4;var jT={sans:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',serif:'Georgia, "Times New Roman", serif',mono:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"},vk={days:7,weeks:4,months:3,quarters:4,years:5};var jp=class{constructor(e,r){R(this,"node");R(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=dt("group",n.properties,r.styleCtx),s=e.x,a=n.title??n.name,c=r.currentFlowKey;r.nextGroupId+=1,r.currentFlowKey=`${c}/group:${n.name??`group-${r.nextGroupId}`}`;let l=o.bg!=="none"&&o.bg!=="#ffffff"&&!!a,u=l?Pl+kT:0,f=l?OT:0,d=!l&&a?Ia:0,p=e.y+d,m=r.bandScale.step(),y=s,E=new Ra({laneLeftX:y,originY:p+u,minRowHeight:m,slackCorridors:r.slackCorridors}),_=y,x=[];for(let X of n.content){if(X.$type==="DescriptionDirective")continue;if(!ar(X)){let re=X.properties??[],Se=i.resolveChildStart(re,_,y,r),{rowIndex:Ee,y:Ce}=E.placeBlock(),j=i.newCursor(Se,Ce),Q=i.sequenceOne(X,j,r);x.push(Q);let ie=Q.box.x+Q.box.width,$=Math.max(m,j.height);E.commitBlock({rowIndex:Ee,placed:Q,blockHeight:$,blockEnd:ie}),_=Math.max(_,ie);continue}let oe=X.properties,D=i.resolveChildStart(oe,_,y,r),w=Ci(oe,r.sizes,r.cal),M=Math.max(_r,w*r.timeline.pixelsPerDay),U=D+M,S=X.name??"",I=i.predictItemChipExtraHeight(X,r),k=m+I,{rowIndex:B,y:W}=E.placeItem({childId:S,desiredStart:D,desiredEnd:U,predictedHeight:k}),z=i.newCursor(D,W),Y=i.sequenceItem(X,z,r);x.push(Y);let K=Y.box.x+Y.box.width+Fr;_=Math.max(_,K);let ue=null;(Y.textSpills||Y.chipsOutside||Y.dotSpills||Y.iconSpills||Y.footnoteSpills)&&(ue=Math.max(Y.decorationsRightX,Y.chipsOutside?Y.chipsRightX:0)+6),E.commitItem({rowIndex:B,placed:Y,logicalEnd:K,spillReservation:ue,rowHeight:k})}let v=Math.max(m,E.usedHeight()),A=Math.max(_,E.usedRightX()),F={x:s,y:p,width:A-s,height:u+v+f};e.x=_+Nl,e.maxX=Math.max(e.maxX,e.x);let O=r.bandScale.step()-r.bandScale.bandwidth();e.height=Math.max(e.height,d+F.height+O);let L=n.name;L&&(r.entityLeftEdges.set(L,F.x),r.entityRightEdges.set(L,F.x+F.width)),r.currentFlowKey=c;let G=Pp({box:F,afterDate:Mn(ft(n.properties,"after")),beforeDate:Mn(ft(n.properties,"before"))});return{kind:"group",id:L,title:a,box:F,children:x,style:o,inlineDatePins:G.length>0?G:void 0}}};var zT=12,dB=4,pB=13,hB=11;function bk(t,e){return t.length*e*.58}var zp=class{constructor(e){R(this,"input");this.input=e}get id(){return this.input.id}measure(e){return{width:Math.max(_r,this.input.logicalRightX-this.input.logicalLeftX),height:e.bands.bandwidth()}}place(e,r){let n=this.measure(r),i=Math.max(_r,n.width-2*Fr),o=e.x+Fr,s={x:o,y:e.y,width:i,height:n.height},a=this.input.hasLinkIcon?20+mB-zT:0,c=zT+Math.max(0,a),l=Math.max(0,i-c-zT),u=this.input.title,f=u?bk(u,pB):0,d=this.input.metaText?bk(this.input.metaText,hB):0,p=this.input.metaTrailingWidth??0,m=d+p,y=this.input.metaText!==void 0||p>0,E=u.length>0&&f>l||y&&m>l,_=E?o+i+dB:o+c;return{id:this.input.id,box:s,textX:_,textSpills:E}}},mB=4;var Wp=class{constructor(e,r){R(this,"node");R(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=dt("parallel",n.properties,r.styleCtx),s=e.x,a=e.y,c=[],l=s,u=0,f=r.currentFlowKey;r.nextParallelId+=1;let d=n.name??`parallel-${r.nextParallelId}`,p=0;for(let _ of n.content){if(_.$type==="DescriptionDirective")continue;r.currentFlowKey=`${f}/par:${d}#${p}`;let x=i.newCursor(s,a+u),v=i.sequenceOne(_,x,r);c.push(v),u+=Math.max(r.bandScale.step(),x.height),l=Math.max(l,x.maxX),p++}r.currentFlowKey=f;let m={x:s,y:a,width:l-s,height:u};e.x=l+Nl,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 E=Pp({box:m,afterDate:Mn(ft(n.properties,"after")),beforeDate:Mn(ft(n.properties,"before"))});return{kind:"parallel",id:y,title:n.title??n.name,box:m,children:c,style:o,inlineDatePins:E.length>0?E:void 0}}};function wo(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function WT(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Ro(t){let e,r,n;t.length!==2?(e=wo,r=(a,c)=>wo(t(a),c),n=(a,c)=>t(a)-c):(e=t===wo||t===WT?t:gB,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 gB(){return 0}function qT(t){return t===null?NaN:+t}var wk=Ro(wo),Rk=wk.right,yB=wk.left,xB=Ro(qT).center,VT=Rk;var Na=class extends Map{constructor(e,r=EB){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(Sk(this,e))}has(e){return super.has(Sk(this,e))}set(e,r){return super.set(TB(this,e),r)}delete(e){return super.delete(_B(this,e))}};function Sk({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):r}function TB({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function _B({_intern:t,_key:e},r){let n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function EB(t){return t!==null&&typeof t=="object"?t.valueOf():t}var vB=Math.sqrt(50),bB=Math.sqrt(10),wB=Math.sqrt(2);function Ak(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>=vB?10:o>=bB?5:o>=wB?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?Ak(t,e,r*2):[a,c,l]}function YT(t,e,r){return e=+e,t=+t,r=+r,Ak(t,e,r)[2]}function qp(t,e,r){e=+e,t=+t,r=+r;let n=e<t,i=n?YT(e,t,r):YT(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}function Vp(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 Pa(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}var Ik=Symbol("implicit");function Yp(){var t=new Na,e=[],r=[],n=Ik;function i(o){let s=t.get(o);if(s===void 0){if(n!==Ik)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 Na;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 Yp(e,r).unknown(n)},Pa.apply(i,arguments),i}function $l(){var t=Yp().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 E=Vp(d).map(function(_){return m+o*_});return r(p?E.reverse():E)}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 $l(e(),[n,i]).round(a).paddingInner(c).paddingOuter(l).align(u)},Pa.apply(f(),arguments)}function Kp(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function KT(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Bl(){}var Fl=.7,Qp=1/Fl,Ca="\\s*([+-]?\\d+)\\s*",Ul="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",cn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",RB=/^#([0-9a-f]{3,8})$/,SB=new RegExp(`^rgb\\(${Ca},${Ca},${Ca}\\)$`),AB=new RegExp(`^rgb\\(${cn},${cn},${cn}\\)$`),IB=new RegExp(`^rgba\\(${Ca},${Ca},${Ca},${Ul}\\)$`),kB=new RegExp(`^rgba\\(${cn},${cn},${cn},${Ul}\\)$`),NB=new RegExp(`^hsl\\(${Ul},${cn},${cn}\\)$`),PB=new RegExp(`^hsla\\(${Ul},${cn},${cn},${Ul}\\)$`),kk={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};Kp(Bl,Di,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Nk,formatHex:Nk,formatHex8:CB,formatHsl:OB,formatRgb:Pk,toString:Pk});function Nk(){return this.rgb().formatHex()}function CB(){return this.rgb().formatHex8()}function OB(){return $k(this).formatHsl()}function Pk(){return this.rgb().formatRgb()}function Di(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=RB.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?Ck(e):r===3?new Jt(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?Zp(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?Zp(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=SB.exec(t))?new Jt(e[1],e[2],e[3],1):(e=AB.exec(t))?new Jt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=IB.exec(t))?Zp(e[1],e[2],e[3],e[4]):(e=kB.exec(t))?Zp(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=NB.exec(t))?Dk(e[1],e[2]/100,e[3]/100,1):(e=PB.exec(t))?Dk(e[1],e[2]/100,e[3]/100,e[4]):kk.hasOwnProperty(t)?Ck(kk[t]):t==="transparent"?new Jt(NaN,NaN,NaN,0):null}function Ck(t){return new Jt(t>>16&255,t>>8&255,t&255,1)}function Zp(t,e,r,n){return n<=0&&(t=e=r=NaN),new Jt(t,e,r,n)}function LB(t){return t instanceof Bl||(t=Di(t)),t?(t=t.rgb(),new Jt(t.r,t.g,t.b,t.opacity)):new Jt}function Oa(t,e,r,n){return arguments.length===1?LB(t):new Jt(t,e,r,n??1)}function Jt(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}Kp(Jt,Oa,KT(Bl,{brighter(t){return t=t==null?Qp:Math.pow(Qp,t),new Jt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Fl:Math.pow(Fl,t),new Jt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Jt(Ao(this.r),Ao(this.g),Ao(this.b),eh(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:Ok,formatHex:Ok,formatHex8:DB,formatRgb:Lk,toString:Lk}));function Ok(){return`#${So(this.r)}${So(this.g)}${So(this.b)}`}function DB(){return`#${So(this.r)}${So(this.g)}${So(this.b)}${So((isNaN(this.opacity)?1:this.opacity)*255)}`}function Lk(){let t=eh(this.opacity);return`${t===1?"rgb(":"rgba("}${Ao(this.r)}, ${Ao(this.g)}, ${Ao(this.b)}${t===1?")":`, ${t})`}`}function eh(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ao(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function So(t){return t=Ao(t),(t<16?"0":"")+t.toString(16)}function Dk(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Gr(t,e,r,n)}function $k(t){if(t instanceof Gr)return new Gr(t.h,t.s,t.l,t.opacity);if(t instanceof Bl||(t=Di(t)),!t)return new Gr;if(t instanceof Gr)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 Gr(s,a,c,t.opacity)}function Fk(t,e,r,n){return arguments.length===1?$k(t):new Gr(t,e,r,n??1)}function Gr(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}Kp(Gr,Fk,KT(Bl,{brighter(t){return t=t==null?Qp:Math.pow(Qp,t),new Gr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Fl:Math.pow(Fl,t),new Gr(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 Jt(ZT(t>=240?t-240:t+120,i,n),ZT(t,i,n),ZT(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Gr(Mk(this.h),Jp(this.s),Jp(this.l),eh(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=eh(this.opacity);return`${t===1?"hsl(":"hsla("}${Mk(this.h)}, ${Jp(this.s)*100}%, ${Jp(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Mk(t){return t=(t||0)%360,t<0?t+360:t}function Jp(t){return Math.max(0,Math.min(1,t||0))}function ZT(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 JT(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 Uk(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 JT((r-n/e)*e,s,i,o,a)}}function Bk(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 JT((r-n/e)*e,i,o,s,a)}}var Gl=t=>()=>t;function MB(t,e){return function(r){return t+r*e}}function $B(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 Gk(t){return(t=+t)==1?th:function(e,r){return r-e?$B(e,r,t):Gl(isNaN(e)?r:e)}}function th(t,e){var r=e-t;return r?MB(t,r):Gl(isNaN(t)?e:t)}var QT=(function t(e){var r=Gk(e);function n(i,o){var s=r((i=Oa(i)).r,(o=Oa(o)).r),a=r(i.g,o.g),c=r(i.b,o.b),l=th(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 Hk(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=Oa(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 mre=Hk(Uk),gre=Hk(Bk);function Xk(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 jk(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function zk(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]=Io(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 Wk(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function Mi(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function qk(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]=Io(t[i],e[i]):n[i]=e[i];return function(o){for(i in r)n[i]=r[i](o);return n}}var t_=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,e_=new RegExp(t_.source,"g");function FB(t){return function(){return t}}function UB(t){return function(e){return t(e)+""}}function Vk(t,e){var r=t_.lastIndex=e_.lastIndex=0,n,i,o,s=-1,a=[],c=[];for(t=t+"",e=e+"";(n=t_.exec(t))&&(i=e_.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:Mi(n,i)})),r=e_.lastIndex;return r<e.length&&(o=e.slice(r),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?UB(c[0].x):FB(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 Io(t,e){var r=typeof e,n;return e==null||r==="boolean"?Gl(e):(r==="number"?Mi:r==="string"?(n=Di(e))?(e=n,QT):Vk:e instanceof Di?QT:e instanceof Date?Wk:jk(e)?Xk:Array.isArray(e)?zk:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?qk:Mi)(t,e)}function r_(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function n_(t){return function(){return t}}function i_(t){return+t}var Yk=[0,1];function La(t){return t}function o_(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:n_(isNaN(e)?NaN:.5)}function BB(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function GB(t,e,r){var n=t[0],i=t[1],o=e[0],s=e[1];return i<n?(n=o_(i,n),o=r(s,o)):(n=o_(n,i),o=r(o,s)),function(a){return o(n(a))}}function HB(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]=o_(t[s],t[s+1]),o[s]=r(e[s],e[s+1]);return function(a){var c=VT(t,a,1,n)-1;return o[c](i[c](a))}}function Kk(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function XB(){var t=Yk,e=Yk,r=Io,n,i,o,s=La,a,c,l;function u(){var d=Math.min(t.length,e.length);return s!==La&&(s=BB(t[0],t[d-1])),a=d>2?HB:GB,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),Mi)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,i_),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=r_,u()},f.clamp=function(d){return arguments.length?(s=d?!0:La,u()):s!==La},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 s_(){return XB()(La,La)}function a_(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 c_=new Date,l_=new Date;function We(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=>We(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)=>(c_.setTime(+o),l_.setTime(+s),t(c_),t(l_),Math.floor(r(c_,l_))),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 Hl=We(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Hl.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?We(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):Hl);var Jre=Hl.range;var ln=We(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),Zk=ln.range;var Da=We(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),jB=Da.range,rh=We(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),zB=rh.range;var Ma=We(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()),WB=Ma.range,nh=We(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),qB=nh.range;var Bn=We(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),VB=Bn.range,jl=We(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),YB=jl.range,ih=We(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),KB=ih.range;function Po(t){return We(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 Gn=Po(0),$a=Po(1),Qk=Po(2),eN=Po(3),$i=Po(4),tN=Po(5),rN=Po(6),nN=Gn.range,ZB=$a.range,JB=Qk.range,QB=eN.range,e3=$i.range,t3=tN.range,r3=rN.range;function Co(t){return We(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 Oo=Co(0),Fa=Co(1),iN=Co(2),oN=Co(3),Fi=Co(4),sN=Co(5),aN=Co(6),cN=Oo.range,n3=Fa.range,i3=iN.range,o3=oN.range,s3=Fi.range,a3=sN.range,c3=aN.range;var Ua=We(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()),l3=Ua.range,oh=We(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()),u3=oh.range;var cr=We(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());cr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:We(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 f3=cr.range,Hr=We(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());Hr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:We(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 d3=Hr.range;function uN(t,e,r,n,i,o){let s=[[ln,1,1e3],[ln,5,5*1e3],[ln,15,15*1e3],[ln,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=Ro(([,,E])=>E).right(s,d);if(p===s.length)return t.every(qp(l/31536e6,u/31536e6,f));if(p===0)return Hl.every(Math.max(qp(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[h3,m3]=uN(Hr,oh,Oo,ih,nh,rh),[u_,f_]=uN(cr,Ua,Gn,Bn,Ma,Da);function d_(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 p_(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 zl(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function h_(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=Wl(i),u=ql(i),f=Wl(o),d=ql(o),p=Wl(s),m=ql(s),y=Wl(a),E=ql(a),_=Wl(c),x=ql(c),v={a:k,A:B,b:W,B:z,c:null,d:gN,e:gN,f:F3,g:V3,G:K3,H:D3,I:M3,j:$3,L:EN,m:U3,M:B3,p:Y,q:K,Q:TN,s:_N,S:G3,u:H3,U:X3,V:j3,w:z3,W:W3,x:null,X:null,y:q3,Y:Y3,Z:Z3,"%":xN},A={a:ue,A:V,b:re,B:Se,c:null,d:yN,e:yN,f:t4,g:f4,G:p4,H:J3,I:Q3,j:e4,L:bN,m:r4,M:n4,p:Ee,q:Ce,Q:TN,s:_N,S:i4,u:o4,U:s4,V:a4,w:c4,W:l4,x:null,X:null,y:u4,Y:d4,Z:h4,"%":xN},F={a:oe,A:D,b:w,B:M,c:U,d:hN,e:hN,f:P3,g:pN,G:dN,H:mN,I:mN,j:A3,L:N3,m:S3,M:I3,p:X,q:R3,Q:O3,s:L3,S:k3,u:_3,U:E3,V:v3,w:T3,W:b3,x:S,X:I,y:pN,Y:dN,Z:w3,"%":C3};v.x=O(r,v),v.X=O(n,v),v.c=O(e,v),A.x=O(r,A),A.X=O(n,A),A.c=O(e,A);function O(j,Q){return function(ie){var $=[],ge=-1,de=0,ke=j.length,at,q,er;for(ie instanceof Date||(ie=new Date(+ie));++ge<ke;)j.charCodeAt(ge)===37&&($.push(j.slice(de,ge)),(q=fN[at=j.charAt(++ge)])!=null?at=j.charAt(++ge):q=at==="e"?" ":"0",(er=Q[at])&&(at=er(ie,q)),$.push(at),de=ge+1);return $.push(j.slice(de,ge)),$.join("")}}function L(j,Q){return function(ie){var $=zl(1900,void 0,1),ge=G($,j,ie+="",0),de,ke;if(ge!=ie.length)return null;if("Q"in $)return new Date($.Q);if("s"in $)return new Date($.s*1e3+("L"in $?$.L:0));if(Q&&!("Z"in $)&&($.Z=0),"p"in $&&($.H=$.H%12+$.p*12),$.m===void 0&&($.m="q"in $?$.q:0),"V"in $){if($.V<1||$.V>53)return null;"w"in $||($.w=1),"Z"in $?(de=p_(zl($.y,0,1)),ke=de.getUTCDay(),de=ke>4||ke===0?Fa.ceil(de):Fa(de),de=jl.offset(de,($.V-1)*7),$.y=de.getUTCFullYear(),$.m=de.getUTCMonth(),$.d=de.getUTCDate()+($.w+6)%7):(de=d_(zl($.y,0,1)),ke=de.getDay(),de=ke>4||ke===0?$a.ceil(de):$a(de),de=Bn.offset(de,($.V-1)*7),$.y=de.getFullYear(),$.m=de.getMonth(),$.d=de.getDate()+($.w+6)%7)}else("W"in $||"U"in $)&&("w"in $||($.w="u"in $?$.u%7:"W"in $?1:0),ke="Z"in $?p_(zl($.y,0,1)).getUTCDay():d_(zl($.y,0,1)).getDay(),$.m=0,$.d="W"in $?($.w+6)%7+$.W*7-(ke+5)%7:$.w+$.U*7-(ke+6)%7);return"Z"in $?($.H+=$.Z/100|0,$.M+=$.Z%100,p_($)):d_($)}}function G(j,Q,ie,$){for(var ge=0,de=Q.length,ke=ie.length,at,q;ge<de;){if($>=ke)return-1;if(at=Q.charCodeAt(ge++),at===37){if(at=Q.charAt(ge++),q=F[at in fN?Q.charAt(ge++):at],!q||($=q(j,ie,$))<0)return-1}else if(at!=ie.charCodeAt($++))return-1}return $}function X(j,Q,ie){var $=l.exec(Q.slice(ie));return $?(j.p=u.get($[0].toLowerCase()),ie+$[0].length):-1}function oe(j,Q,ie){var $=p.exec(Q.slice(ie));return $?(j.w=m.get($[0].toLowerCase()),ie+$[0].length):-1}function D(j,Q,ie){var $=f.exec(Q.slice(ie));return $?(j.w=d.get($[0].toLowerCase()),ie+$[0].length):-1}function w(j,Q,ie){var $=_.exec(Q.slice(ie));return $?(j.m=x.get($[0].toLowerCase()),ie+$[0].length):-1}function M(j,Q,ie){var $=y.exec(Q.slice(ie));return $?(j.m=E.get($[0].toLowerCase()),ie+$[0].length):-1}function U(j,Q,ie){return G(j,e,Q,ie)}function S(j,Q,ie){return G(j,r,Q,ie)}function I(j,Q,ie){return G(j,n,Q,ie)}function k(j){return s[j.getDay()]}function B(j){return o[j.getDay()]}function W(j){return c[j.getMonth()]}function z(j){return a[j.getMonth()]}function Y(j){return i[+(j.getHours()>=12)]}function K(j){return 1+~~(j.getMonth()/3)}function ue(j){return s[j.getUTCDay()]}function V(j){return o[j.getUTCDay()]}function re(j){return c[j.getUTCMonth()]}function Se(j){return a[j.getUTCMonth()]}function Ee(j){return i[+(j.getUTCHours()>=12)]}function Ce(j){return 1+~~(j.getUTCMonth()/3)}return{format:function(j){var Q=O(j+="",v);return Q.toString=function(){return j},Q},parse:function(j){var Q=L(j+="",!1);return Q.toString=function(){return j},Q},utcFormat:function(j){var Q=O(j+="",A);return Q.toString=function(){return j},Q},utcParse:function(j){var Q=L(j+="",!0);return Q.toString=function(){return j},Q}}}var fN={"-":"",_:" ",0:"0"},kt=/^\s*\d+/,g3=/^%/,y3=/[\\^$*+?|[\]().{}]/g;function Ne(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 x3(t){return t.replace(y3,"\\$&")}function Wl(t){return new RegExp("^(?:"+t.map(x3).join("|")+")","i")}function ql(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function T3(t,e,r){var n=kt.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function _3(t,e,r){var n=kt.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function E3(t,e,r){var n=kt.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function v3(t,e,r){var n=kt.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function b3(t,e,r){var n=kt.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function dN(t,e,r){var n=kt.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function pN(t,e,r){var n=kt.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function w3(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 R3(t,e,r){var n=kt.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function S3(t,e,r){var n=kt.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function hN(t,e,r){var n=kt.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function A3(t,e,r){var n=kt.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function mN(t,e,r){var n=kt.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function I3(t,e,r){var n=kt.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function k3(t,e,r){var n=kt.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function N3(t,e,r){var n=kt.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function P3(t,e,r){var n=kt.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function C3(t,e,r){var n=g3.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function O3(t,e,r){var n=kt.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function L3(t,e,r){var n=kt.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function gN(t,e){return Ne(t.getDate(),e,2)}function D3(t,e){return Ne(t.getHours(),e,2)}function M3(t,e){return Ne(t.getHours()%12||12,e,2)}function $3(t,e){return Ne(1+Bn.count(cr(t),t),e,3)}function EN(t,e){return Ne(t.getMilliseconds(),e,3)}function F3(t,e){return EN(t,e)+"000"}function U3(t,e){return Ne(t.getMonth()+1,e,2)}function B3(t,e){return Ne(t.getMinutes(),e,2)}function G3(t,e){return Ne(t.getSeconds(),e,2)}function H3(t){var e=t.getDay();return e===0?7:e}function X3(t,e){return Ne(Gn.count(cr(t)-1,t),e,2)}function vN(t){var e=t.getDay();return e>=4||e===0?$i(t):$i.ceil(t)}function j3(t,e){return t=vN(t),Ne($i.count(cr(t),t)+(cr(t).getDay()===4),e,2)}function z3(t){return t.getDay()}function W3(t,e){return Ne($a.count(cr(t)-1,t),e,2)}function q3(t,e){return Ne(t.getFullYear()%100,e,2)}function V3(t,e){return t=vN(t),Ne(t.getFullYear()%100,e,2)}function Y3(t,e){return Ne(t.getFullYear()%1e4,e,4)}function K3(t,e){var r=t.getDay();return t=r>=4||r===0?$i(t):$i.ceil(t),Ne(t.getFullYear()%1e4,e,4)}function Z3(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Ne(e/60|0,"0",2)+Ne(e%60,"0",2)}function yN(t,e){return Ne(t.getUTCDate(),e,2)}function J3(t,e){return Ne(t.getUTCHours(),e,2)}function Q3(t,e){return Ne(t.getUTCHours()%12||12,e,2)}function e4(t,e){return Ne(1+jl.count(Hr(t),t),e,3)}function bN(t,e){return Ne(t.getUTCMilliseconds(),e,3)}function t4(t,e){return bN(t,e)+"000"}function r4(t,e){return Ne(t.getUTCMonth()+1,e,2)}function n4(t,e){return Ne(t.getUTCMinutes(),e,2)}function i4(t,e){return Ne(t.getUTCSeconds(),e,2)}function o4(t){var e=t.getUTCDay();return e===0?7:e}function s4(t,e){return Ne(Oo.count(Hr(t)-1,t),e,2)}function wN(t){var e=t.getUTCDay();return e>=4||e===0?Fi(t):Fi.ceil(t)}function a4(t,e){return t=wN(t),Ne(Fi.count(Hr(t),t)+(Hr(t).getUTCDay()===4),e,2)}function c4(t){return t.getUTCDay()}function l4(t,e){return Ne(Fa.count(Hr(t)-1,t),e,2)}function u4(t,e){return Ne(t.getUTCFullYear()%100,e,2)}function f4(t,e){return t=wN(t),Ne(t.getUTCFullYear()%100,e,2)}function d4(t,e){return Ne(t.getUTCFullYear()%1e4,e,4)}function p4(t,e){var r=t.getUTCDay();return t=r>=4||r===0?Fi(t):Fi.ceil(t),Ne(t.getUTCFullYear()%1e4,e,4)}function h4(){return"+0000"}function xN(){return"%"}function TN(t){return+t}function _N(t){return Math.floor(+t/1e3)}var Ba,sh,RN,SN,AN;m_({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 m_(t){return Ba=h_(t),sh=Ba.format,RN=Ba.parse,SN=Ba.utcFormat,AN=Ba.utcParse,Ba}function m4(t){return new Date(t)}function g4(t){return t instanceof Date?+t:+new Date(+t)}function IN(t,e,r,n,i,o,s,a,c,l){var u=s_(),f=u.invert,d=u.domain,p=l(".%L"),m=l(":%S"),y=l("%I:%M"),E=l("%I %p"),_=l("%a %d"),x=l("%b %d"),v=l("%B"),A=l("%Y");function F(O){return(c(O)<O?p:a(O)<O?m:s(O)<O?y:o(O)<O?E:n(O)<O?i(O)<O?_:x:r(O)<O?v:A)(O)}return u.invert=function(O){return new Date(f(O))},u.domain=function(O){return arguments.length?d(Array.from(O,g4)):d().map(m4)},u.ticks=function(O){var L=d();return t(L[0],L[L.length-1],O??10)},u.tickFormat=function(O,L){return L==null?F:l(L)},u.nice=function(O){var L=d();return(!O||typeof O.range!="function")&&(O=e(L[0],L[L.length-1],O??10)),O?d(a_(L,O)):u},u.copy=function(){return Kk(u,IN(t,e,r,n,i,o,s,a,c,l))},u}function ah(){return Pa.apply(IN(u_,f_,cr,Ua,Gn,Bn,Ma,Da,ln,sh).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}var g_=class t{constructor(e,r,n){R(this,"bandwidthPx");R(this,"stepPx");R(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=$l().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}},y4={bandwidth:56,step:64};function kN(){return g_.fixedRow(y4)}var ch=class{constructor(e){R(this,"domain");R(this,"range");R(this,"pixelsPerDay");R(this,"calendar");R(this,"d3");this.domain=e.domain,this.range=e.range,this.calendar=e.calendar;let r=Math.max(1,Tr(e.domain[0],e.domain[1]));this.pixelsPerDay=(e.range[1]-e.range[0])/r,this.d3=ah().domain(e.domain).range(e.range)}forward(e){let r=Tr(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 lh(t){return t.endsWith(":")?t.slice(0,-1):t}function NN(t,e){let n=t.roadmapDecl?.properties.find(c=>lh(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=uh(i)*l,s=1}}let a=s??vk[i]??4;if(e){let l=e.properties.find(m=>lh(m.key)==="unit")?.value??i,u=e.properties.find(m=>lh(m.key)==="label-every"),f=e.properties.find(m=>lh(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)||uh(l)):o??uh(l);return{unit:l,labelEvery:d,pixelsPerUnit:p}}return{unit:i,labelEvery:a,pixelsPerUnit:o??uh(i)}}function uh(t){switch(t){case"days":return xk;case"weeks":return 40;case"months":return 80;case"quarters":return 160;case"years":return 320}}function PN(t,e,r,n=Rl){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?x4(e.unit,vo(t.domain[0],u),l,n):void 0})}return c}function x4(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`${kp(n).quarterPrefix}${i} ${e.getUTCFullYear()}`}case"years":return`${e.getUTCFullYear()}`}}function CN(t){return{daysPerUnit:e=>y_(e,t),addUnits:(e,r,n)=>vo(e,r*y_(n,t)),isWorkingDay:()=>!0}}function ON(t,e){return y_(t,e)}function y_(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 x_=class{constructor(e,r){R(this,"id");R(this,"anchor");this.id=e,this.anchor=r}place(e,r){let n=ae(this.anchor.properties,"date"),i=gt(n);if(!i)return null;let o=e.scale.forwardWithinDomain(i);if(o===null)return null;let s=dt("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 DN(t,e,r){let n=[];for(let[i,o]of t){let s=new x_(i,o).place(e,r);s&&n.push(s)}return n}function T_(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,ft(l.properties,"on")),n.push({number:f,title:l.title??c,description:l.description?.text,style:dt("footnote",l.properties,e.styleCtx)})}),{area:{box:{x:Br,y:r+Br,width:e.chartRightX-2*Br,height:n.length===0?0:Ol+n.length*Ll+Br},entries:n},index:i,hosts:o}}var T4=.8,_4=1;function E4(t){let e=[];return $N(t,e),e}function $N(t,e){for(let r of t)if(r.kind==="item"){let n=v4(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")&&$N(r.children,e)}function v4(t){return t.capacity?t.capacity.value:t.size?1:0}function FN(t){if(t.capacityValue<=0||t.warnFraction===null&&t.overFraction===null)return null;let e=E4(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:b4(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 b4(t,e,r,n){let i=t/e;return n!==null&&i>=n?"red":r!==null&&i>=r?"yellow":"green"}function UN(t,e){let r=e.get("swimlane"),n=MN(ae(t.properties,"utilization-warn-at"),r?ae(r.properties,"utilization-warn-at"):void 0,T4),i=MN(ae(t.properties,"utilization-over-at"),r?ae(r.properties,"utilization-over-at"):void 0,_4);return{warn:n,over:i}}function MN(t,e,r){let i=S4(t??e);return i.kind==="unset"?r:i.kind==="none"?null:i.value}var w4=/^\d+(?:\.\d+)?%$/,R4=/^\d+\.\d+$/;function S4(t){if(t===void 0)return{kind:"unset"};if(t==="none")return{kind:"none"};if(w4.test(t)){let e=parseFloat(t)/100;return Number.isFinite(e)&&e>0?{kind:"number",value:e}:{kind:"unset"}}if(R4.test(t)){let e=parseFloat(t);return Number.isFinite(e)&&e>0?{kind:"number",value:e}:{kind:"unset"}}return{kind:"unset"}}var BN=10;function A4(t,e,r){let n=ae(t.properties,"capacity"),i=qn(n);if(i===null)return{capacity:null,badgeWidthPx:0};let o=Wa(i),s=qa(e.capacityIcon,r),a=Xi(o,s,BN);return{capacity:{value:i,text:o,icon:s},badgeWidthPx:a}}var I4=10,k4=38,N4=8;function P4(t,e,r){let n=t.title??t.name??"";if(!n)return 0;let i=ae(t.properties,"owner");return Va(0,n,i??void 0,e,r).rightX}function C4(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 O4(t,e,r,n){for(let i of t.content){if(i.$type==="DescriptionDirective")continue;let o=ar(i)?i.properties:i.properties??[];return n.resolveChildStart(o,e,e,r)}}var Ga=class{constructor(e,r){R(this,"input");R(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=dt("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}=A4(n,s,r.symbols),d=C4(n,r),p=d.length>0?o.estimateTextWidth(d.join(","),BN):0,m=P4(n,f,p),y=O4(n,a,r,o),E=!n.title||y===void 0||y>=m+N4,_=e.y+(E?I4:k4),x=new Ra({laneLeftX:a,originY:_,minRowHeight:c,slackCorridors:r.slackCorridors}),v=a,A=[];for(let w of n.content){if(w.$type==="DescriptionDirective")continue;if(!ar(w)){let Ce=w.properties??[],j=o.resolveChildStart(Ce,v,a,r),{rowIndex:Q,y:ie}=x.placeBlock(),$=o.newCursor(j,ie),ge=o.sequenceOne(w,$,r);A.push(ge);let de=ge.box.x+ge.box.width,ke=Math.max(c,$.height);x.commitBlock({rowIndex:Q,placed:ge,blockHeight:ke,blockEnd:de}),v=Math.max(v,de);continue}let M=w.properties,U=o.resolveChildStart(M,v,a,r),S=Ci(M,r.sizes,r.cal),I=Math.max(_r,S*r.timeline.pixelsPerDay),k=U+I,B=w.name??"",W=o.predictItemChipExtraHeight(w,r),z=c+W,{rowIndex:Y,y:K}=x.placeItem({childId:B,desiredStart:U,desiredEnd:k,predictedHeight:z}),ue=o.newCursor(U,K),V=o.sequenceItem(w,ue,r);A.push(V);let re=V.box.x+V.box.width+Fr;v=Math.max(v,re);let Se=null;(V.textSpills||V.chipsOutside||V.dotSpills||V.iconSpills||V.footnoteSpills)&&(Se=Math.max(V.decorationsRightX,V.chipsOutside?V.chipsRightX:0)+6),x.commitItem({rowIndex:Y,placed:V,logicalEnd:re,spillReservation:Se,rowHeight:z})}let F=_-e.y,O=Math.max(c+32,F+x.usedHeight()+16),L=Math.max(x.usedRightX(),m),G={x:0,y:e.y,width:r.chartRightX,height:O},X=ae(n.properties,"owner"),oe;if(X){let w=r.teams.get(X),M=r.persons.get(X);oe=w?.title??M?.title??X}let D=u?(()=>{let{warn:w,over:M}=UN(n,r.styleCtx.defaults);return FN({children:A,capacityValue:u.value,warnFraction:w,overFraction:M})})():null;return r.currentFlowKey=l,{positioned:{id:n.name,title:n.title??n.name??"",box:G,bandIndex:i,children:A,nested:[],style:s,owner:oe,footnoteIndicators:d,capacity:u,utilization:D},usedHeight:O,usedRightX:L}}};var L4=18,D4=14,M4=14,$4=16,F4=32;function GN(t,e,r,n){let i=r+L4,o=[],s=!0;for(let a of t){s||(i+=$4),s=!1;let c=a.content.roadmap?.title??a.sourcePath,l=i+D4,u={cal:e.cal,styleCtx:{theme:e.styleCtx.theme,styles:a.config.styles,defaults:a.config.defaults,labels:a.content.labels},sizes:Ap(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,nextParallelId:0,nextGroupId:0},f=[],d=l,p=0,m=u.timeline.originX;for(let O of a.content.swimlanes.values()){u.nextParallelId=0,u.nextGroupId=0;let{positioned:L,usedHeight:G,usedRightX:X}=new Ga({lane:O,bandIndex:p},n).place({x:u.timeline.originX,y:d},u);f.push(L),d+=G,p++,X>m&&(m=X)}let y=d,E=Math.max(e.bandScale.bandwidth(),y-i+M4),_=0,{chromeRightX:x}=Ya(_,c,a.sourcePath),v=Math.max(x,m)+F4,A=Math.min(e.chartRightX-_,v-_),F={x:_,y:i,width:A,height:E};for(let O of f)O.box.width=A;o.push({sourcePath:a.sourcePath,label:c,box:F,nestedSwimlanes:f,style:dt("swimlane",[],e.styleCtx)}),i+=E}return{regions:o,endY:i}}function ph(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 hh(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 HN(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 __=class{constructor(e,r){R(this,"id");R(this,"milestone");this.id=e,this.milestone=r}place(e){let r=this.milestone,n=dt("milestone",r.properties,e.styleCtx),i=ae(r.properties,"date"),o=ft(r.properties,"after"),s=gt(i),a=e.timeline.markerRow.y,c=6,l=r.title??this.id,u=null,f=a,d=null,p="right",m=!1,y,E=!1;if(s){let x=e.scale.forwardWithinDomain(s);if(x===null)return null;u=x,m=!0;let v=e.markerRowPlacements.get(this.id);v&&(f=v.centerY,d=v.labelBox,p=v.labelSide);let A=ph(o,e),F=hh(A),O=null;for(let L of F)(!O||L.x>O.x)&&(O=L);O&&O.x>x&&(E=!0,y=[{x:O.x,y:O.y>0?O.y:f}])}else if(o.length>0){let x=ph(o,e),v=hh(x);v.sort((L,G)=>G.x-L.x);let A=v[0]?.x??e.timeline.originX;u=A,m=!1;let F=HN(u,a,c,l,10,!0,e.timeline.box.x,e.chartRightX);f=a,d=F.box,p=F.side,e.markerRowPlacements.set(this.id,{rowIndex:0,centerY:f,labelBox:d,labelSide:p});let O=[];for(let L=1;L<v.length;L++){let G=v[L];G.x<A&&G.y>0&&O.push({x:G.x,y:G.y})}O.length>0&&(y=O)}if(u===null)return null;if(!d){let x=HN(u,f,c,l,10,!0,e.timeline.box.x,e.chartRightX);d=x.box,p=x.side}let _={x:u,y:f};return e.entityLeftEdges.set(this.id,_.x),e.entityRightEdges.set(this.id,_.x),e.entityMidpoints.set(this.id,_),{id:this.id,title:l,center:_,radius:c,fixed:m,slackArrows:y,isOverrun:E,style:n,cutTopY:e.chartTopY,cutBottomY:e.swimlaneBottomY,labelBox:d,labelSide:p}}};function XN(t,e){let r=[];for(let[n,i]of t){let o=new __(n,i).place(e);o&&r.push(o)}return r}var B4=4;function G4(t,e){e>t.chartRightX&&(t.chartRightX=e)}var gh=class{place(e,r,n,i){let o=n.theme??"light",s=ST[o],a=n.width??1280,c=ok(n.locale,j4(e)),l=ek(e,r.config.calendar),u=NN(e,r.config.scale),f=Ap(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=dt("roadmap",e.roadmapDecl?.properties??[],d),E=y.headerPosition==="beside",_=y.timelinePosition!=="bottom",x=y.timelinePosition==="bottom"||y.timelinePosition==="both",v=e.roadmapDecl?.title??e.roadmapDecl?.name??"",A=ae(e.roadmapDecl?.properties??[],"author"),F=i.sizeBesideHeader(v,A),O=E?{x:0,y:0,width:F.boxWidth,height:0}:{x:0,y:0,width:0,height:Bp},L=E?F.boxWidth:0,G=E?8:Bp+8,X=CN(l),oe=u.pixelsPerUnit/X.daysPerUnit(u.unit),w=Math.max(1,Tr(p,m))*oe,M=L+Ur,U=w,S=L+Ur+U+Ur,I=Math.min(a,S),k=n.today!==void 0&&n.today>=p&&n.today<=m,B=r.content.anchors.size+r.content.milestones.size>0,W=k?Oi:0,z=_?kl:0,Y=new ch({domain:[p,m],range:[M,M+w],calendar:X}),K=Math.max(I,M+U+Ur),ue=[];for(let[Z,ce]of r.content.anchors){let Ge=gt(ae(ce.properties,"date"));if(!Ge)continue;let vr=Y.forwardWithinDomain(Ge);vr!==null&&ue.push({id:Z,centerX:vr,radius:6,title:ce.title??Z,fontSize:10,bold:!1,date:Ge,isMilestone:!1})}for(let[Z,ce]of r.content.milestones){let Ge=gt(ae(ce.properties,"date"));if(!Ge)continue;let vr=Y.forwardWithinDomain(Ge);vr!==null&&ue.push({id:Z,centerX:vr,radius:6,title:ce.title??Z,fontSize:10,bold:!0,date:Ge,isMilestone:!0})}let V=zN(ue,L,K,i.estimateTextWidth),re=B?Math.max(1,V.rowCount):0,Se=re*26,Ee=W+z+Se,Ce=Ee+8,j=E?F.cardHeight+B4:0,Q=Math.max(G,j-Ee),ie=Q+W,$=ie+z,ge=$+Se,de=PN(Y,u,X,c),ke={box:{x:M,y:Q,width:w,height:0},ticks:de,pixelsPerDay:oe,originX:M,startDate:p,endDate:m,labelStyle:dt("roadmap",[],d),pillRowHeight:W,tickPanelY:ie,tickPanelHeight:z,markerRow:{y:$+13,height:Se,collisionY:$-8},minorGrid:y.minorGrid},at=new Map;for(let[Z,ce]of V.placements){let Ge=$+13+ce.rowIndex*26;at.set(Z,{rowIndex:ce.rowIndex,centerY:Ge,labelBox:{...ce.labelBox,y:Ge-4},labelSide:ce.labelSide})}let q={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:ke,scale:Y,calendar:X,bandScale:kN(),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:at,chartTopY:Q+Ce,chartBottomY:0,swimlaneBottomY:0,chartRightX:K,nextParallelId:0,nextGroupId:0};for(let Z of ue){let ce=at.get(Z.id);ce&&(q.entityLeftEdges.set(Z.id,Z.centerX),q.entityRightEdges.set(Z.id,Z.centerX),q.entityMidpoints.set(Z.id,{x:Z.centerX,y:ce.centerY}))}let er=T_(r.content.footnotes,q,0);q.footnoteIndex=er.index,q.footnoteHosts=er.hosts;let Bi=new Map(q.entityLeftEdges),ur=new Map(q.entityRightEdges),jr=new Map(q.entityMidpoints),ye=[...r.content.swimlanes.values()],Gi=dt("swimlane",[],d),zr=gk[Gi.spacing]??0,dn=()=>{q.nextParallelId=0,q.nextGroupId=0;let Z=[],ce=q.chartTopY,Ge=0,vr=q.timeline.originX;for(let Hi of ye){Ge>0&&(ce+=zr);let{positioned:zn,usedHeight:kh,usedRightX:ru}=new Ga({lane:Hi,bandIndex:Ge},i).place({x:q.timeline.originX,y:ce},q);Z.push(zn),ce+=kh,ru>vr&&(vr=ru),Ge++}return{swimlanes:Z,nextY:ce,maxRightX:vr}},Er=dn(),Nt=Er.swimlanes,$t=Er.nextY,fr=H4(r.content.milestones,q);fr.length>0&&(q.entityLeftEdges=new Map(Bi),q.entityRightEdges=new Map(ur),q.entityMidpoints=new Map(jr),q.itemSlackAttachY=new Map,q.entityVisualLeftX=new Map,q.entityVisualRightX=new Map,q.itemArrowSource=new Map,q.itemFlowKey=new Map,q.currentFlowKey="",q.slackCorridors=fr,Er=dn(),Nt=Er.swimlanes,$t=Er.nextY),G4(q,Er.maxRightX+Ur);for(let Z of Nt)Z.box.width=q.chartRightX;let T=r.content.isolatedRegions,P=[];if(T.length>0){let Z=GN(T,q,$t+8,i);P=Z.regions,$t=Z.endY}q.chartBottomY=$t,q.swimlaneBottomY=$t,ke.box.height=q.chartBottomY-ke.box.y;let H=XN(r.content.milestones,q),J=ue.map(Z=>({id:Z.id,centerX:Z.centerX,radius:Z.radius,title:Z.title,fontSize:Z.fontSize,bold:Z.bold}));for(let Z of H)Z.fixed||J.push({id:Z.id??"",centerX:Z.center.x,radius:Z.radius,title:Z.title,fontSize:10,bold:!0});let xe=zN(J,L,q.chartRightX,i.estimateTextWidth);q.markerRowPlacements.clear();for(let[Z,ce]of xe.placements){let Ge=$+13+ce.rowIndex*26;q.markerRowPlacements.set(Z,{rowIndex:ce.rowIndex,centerY:Ge,labelBox:{...ce.labelBox,y:Ge-4},labelSide:ce.labelSide})}for(let Z of H){let ce=q.markerRowPlacements.get(Z.id??"");ce&&(Z.center={x:Z.center.x,y:ce.centerY},Z.labelBox=ce.labelBox,Z.labelSide=ce.labelSide)}for(let Z of ue){let ce=q.markerRowPlacements.get(Z.id);ce&&q.entityMidpoints.set(Z.id,{x:Z.centerX,y:ce.centerY})}for(let Z of H)Z.fixed||q.entityMidpoints.set(Z.id??"",{x:Z.center.x,y:Z.center.y});let Be=B?Math.max(1,xe.rowCount):0;if(Be>re){let Z=(Be-re)*26;q.timeline.markerRow.height=Be*26,q.timeline.box.height+=Z,q.chartTopY+=Z,q.chartBottomY+=Z,q.swimlaneBottomY+=Z;for(let ce of Nt)E_(ce,Z);for(let ce of P)X4(ce,Z);for(let[ce,Ge]of q.entityMidpoints)q.markerRowPlacements.has(ce)||q.entityMidpoints.set(ce,{x:Ge.x,y:Ge.y+Z});for(let[ce,Ge]of q.itemSlackAttachY)q.itemSlackAttachY.set(ce,Ge+Z);for(let ce of H)if(ce.cutTopY=q.chartTopY,ce.cutBottomY=q.swimlaneBottomY,ce.slackArrows)for(let Ge of ce.slackArrows)Ge.y+=Z}x&&(q.timeline.bottomTickPanelY=q.chartBottomY+8,q.timeline.bottomTickPanelHeight=kl,q.chartBottomY+=8+kl);let Ae=new Set(H.map(Z=>Z.center.x)),Ze=DN(r.content.anchors,q,Ae),ct=i.collectItems(ye),Xe=i.buildDependencies(ct,Nt,P,q),Fe=i.buildNowline(n.today,q,c),yt=T_(r.content.footnotes,q,q.chartBottomY);q.footnoteIndex=yt.index,q.footnoteHosts=yt.hosts,O.height=O.height||q.chartBottomY,E||(O.width=q.chartRightX);let tr=E?{x:6,y:ge-F.cardHeight,width:F.cardWidth,height:F.cardHeight}:{x:0,y:0,width:q.chartRightX,height:Bp},Wr=yt.area.entries.length>0?yt.area.box.y+yt.area.box.height:q.chartBottomY,dr={x:q.chartRightX-Ur-HT,y:Wr+Ur,width:HT,height:Ek},nt=dr.y+dr.height+Ur,pr={box:O,position:y.headerPosition,title:v,author:A,titleLines:F.titleLines,authorLines:F.authorLines,cardBox:tr,logo:void 0,style:y,attributionBox:dr};return{width:q.chartRightX,height:nt,theme:o,palette:s,backgroundColor:s.surface.page,header:pr,timeline:ke,nowline:Fe,swimlanes:Nt,anchors:Ze,milestones:H,edges:Xe,footnotes:yt.area,includes:P,chartBox:{x:L,y:q.chartTopY,width:q.chartRightX-L,height:q.chartBottomY-q.chartTopY}}}};function H4(t,e){let r=[];for(let[n,i]of t){let o=ae(i.properties,"date"),s=ft(i.properties,"after"),a=gt(o),c=ph(s,e),l=hh(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 E_(t,e){t.box.y+=e;for(let r of t.children)WN(r,e);for(let r of t.nested)E_(r,e)}function WN(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)WN(r,e)}function X4(t,e){t.box.y+=e;for(let r of t.nestedSwimlanes)E_(r,e)}function zN(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=L=>L==="right"?l:u,E=L=>L==="right"?f:d,_=(L,G)=>{let X=Math.min(p,L),oe=Math.max(m,L+c);return s[G].some(D=>D.left<oe&&D.right>X)},x=-1,v="right",A=l;e:for(let L=s.length-1;L>=0;L--)for(let G of["right","left"]){if(!E(G))continue;let X=y(G);if(!_(X,L)){x=L,v=G,A=X;break e}}if(x===-1){for(let[L,G]of o)o.set(L,{...G,rowIndex:G.rowIndex+1});s=[[],...s],x=0,v=f?"right":"left",A=y(v)}let F=Math.min(p,A),O=Math.max(m,A+c);s[x].push({left:F,right:O}),o.set(a.id,{rowIndex:x,labelBox:{x:A,y:0,width:c,height:12},labelSide:v})}return{placements:o,rowCount:s.length}}function j4(t){return t.directive?.properties.find(r=>z4(r.key)==="locale")?.value}function z4(t){return t.endsWith(":")?t.slice(0,-1):t}function V4(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 Y4(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 K4(t,e){if(t)return/^\d+(?:\.\d+)?[dwmqy]$/.test(t)||/^\d+%$/.test(t)?t:e.sizes.get(t)?.effortLiteral??t}function Z4(t,e){if(t)return e.teams.get(t)?.title??e.persons.get(t)?.title??t}function J4(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 yh(t,e,r,n,i){let o=mk(t,e),s=t.name??t.title??"",a=o.padding==="none"?"xs":o.padding,c=yk[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 A_(t,e,r,n){let i=t.properties,o=dt("item",i,r.styleCtx),s=ae(i,"size"),a=s?r.sizes.get(s)??null:null,c=Ci(i,r.sizes,r.cal),l=rk(i,r.sizes,r.cal),u=ft(i,"after"),f=ft(i,"before"),d=ae(i,"date"),p=tk(ae(i,"remaining"),r.sizes,r.cal),m=e.x,y=gt(d);if(y){let le=r.scale.forwardWithinDomain(y);le!==null&&(m=le)}else if(u.length>0){let le=e.x;for(let Je of u){let ht=gt(Je);if(ht){let Wn=r.scale.forwardWithinDomain(ht);Wn!==null&&(le=Math.max(le,Wn));continue}let pn=r.entityRightEdges.get(Je);pn!==void 0&&(le=Math.max(le,pn))}m=Math.max(e.x,le)}let E=Math.max(_r,c*r.timeline.pixelsPerDay),_=m,x=m+E,v=ae(i,"link"),A=J4(v),F=A.icon!=="none",O=Math.max(_r,E-2*Fr),L=ft(i,"labels"),G=[];for(let le of L){let Je=r.labels.get(le);if(!Je)continue;let ht=yh(Je,r.styleCtx,0,0);G.push({id:Je,width:ht.box.width})}let X=0;for(let le=0;le<G.length;le+=1)le>0&&(X+=4),X+=G[le].width;let oe=Math.max(0,O-24),D=G.length>0&&X>oe,w=!1,M,U;if(f.length>0){let le,Je;for(let ht of f){let pn=gt(ht),Wn=pn?r.scale.forwardWithinDomain(pn)??void 0:r.entityLeftEdges.get(ht);Wn!==void 0&&(le===void 0||Wn<le)&&(le=Wn,Je=ht)}le!==void 0&&x>le&&(w=!0,M={x:le,y:e.y,width:x-le,height:r.bandScale.bandwidth()},U=Je)}let S=ae(i,"status"),I=V4(S),k=Y4(S);k===0&&I==="done"&&(k=1);let B=/^(\d{1,3})%$/.exec(ae(i,"remaining")??"");k===0&&I==="in-progress"&&B&&(k=1-Math.max(0,Math.min(100,parseInt(B[1],10)))/100),k===0&&I==="in-progress"&&p>0&&l>0&&(k=Math.max(0,Math.min(1,1-p/l)));let W={done:"#ecfdf5","in-progress":"#eff6ff","at-risk":"#fffbeb",blocked:"#fee2e2",planned:"#f8fafc",neutral:"#f8fafc"},z={done:"#052e16","in-progress":"#172554","at-risk":"#422006",blocked:"#7f1d1d",planned:"#1e293b",neutral:"#1e293b"},Y={done:"#ebebeb","in-progress":"#e4e4e4","at-risk":"#eeeeee",blocked:"#dcdcdc",planned:"#f5f5f5",neutral:"#f5f5f5"},K={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},ue=r.styleCtx.theme.name,V=ue==="dark",re=V?"#0f172a":"#ffffff",Se=ue==="grayscale"?"#9e9e9e":"#94a3b8";o.bg===re&&(o.bg=ue==="grayscale"?Y[I]:V?z[I]:W[I]),o.fg===Se&&(o.fg=K[I]);let Ee=ae(i,"duration"),Ce=!!Ee&&/^\d+(?:\.\d+)?[dwmqy]$/.test(Ee),j=a?a.title??a.name:"",Q=Ce?Ee:j||void 0,ie=ae(i,"remaining"),$=K4(ie,r),ge=Z4(n??ae(i,"owner"),r),de=()=>[Q,ge].filter(Boolean).join(" "),ke;if(I==="in-progress"&&$){let le=de();ke=le?`${le} \u2014 ${$} remaining`:`${$} remaining`}else if(I==="in-progress"&&k>0&&k<1){let le=Math.round((1-k)*100),Je=de();ke=Je?`${Je} \u2014 ${le}% remaining`:`${le}% remaining`}else(ge||Q)&&(ke=de()||void 0);let at=ae(i,"capacity"),q=qn(at),er=null,Bi=0;if(q!==null){let le=Wa(q),Je=qa(o.capacityIcon,r.symbols);er={value:q,text:le,icon:Je};let ht=11;Bi=(ke?fn(" ",ht):0)+Xi(le,Je,ht)}let ur=t.title??t.name??"",jr=new zp({id:t.name??"",title:ur,logicalLeftX:_,logicalRightX:x,metaText:ke,metaTrailingWidth:Bi,hasLinkIcon:F}).place({x:_,y:e.y},{time:r.scale,bands:r.bandScale,style:o}),ye=jr.box,Gi=r.bandScale.bandwidth(),zr=ye.width<17,dn=F&&ye.width<41,Er=ye.width<23,Nt=jr.textSpills||dn,$t=null;D&&($t=Ph(G,ye.width));let fr=$t?$t.rows.length:G.length>0?1:0,T=ke!==void 0||er!==null,P=QN(D,Nt,fr,Gi,T);P>0&&(ye.height=Gi+P);let H=[],J=ye.y+Gi-an-13-3,xe=ye.y+38+3,Ae=D&&Nt||!D&&T&&G.length>0?Math.max(J,xe):J,Ze=D?ye.x+ye.width+6:ye.x+12,ct=Ze;if($t)for(let le=0;le<$t.rows.length;le+=1){let Je=Ae+le*17,ht=Ze;for(let Wn of $t.rows[le]){let eE=yh(Wn.id,r.styleCtx,ht,Je);H.push(eE),ht+=eE.box.width+4}let pn=ht-4;pn>ct&&(ct=pn)}else{let le=Ze;for(let Je of G){let ht=yh(Je.id,r.styleCtx,le,Ae);H.push(ht),le+=ht.box.width+4}ct=G.length>0?le-4:Ze}let Xe=new Set;if(t.name){for(let[le,Je]of r.footnoteHosts.entries())if(Je.includes(t.name)){let ht=r.footnoteIndex.get(le);ht!==void 0&&Xe.add(ht)}}let Fe=[...Xe].sort((le,Je)=>le-Je),yt=ge??n??ae(i,"owner"),tr=t.description?.text,Wr=Fe.length>0&&Er,nt=ye.x+ye.width+6,pr=!1,tu=null;dn&&(pr&&(nt+=4),tu=nt,nt=tu+14,pr=!0);let Z=0;if(Nt){pr&&(nt+=4);let le=fn(ur,13),Je=(ke?fn(ke,11):0)+Bi;Z=Math.max(le,Je),nt+=Z,pr=!0}let ce=null;Wr&&(pr&&(nt+=4),ce=nt,nt+=Fe.length*8,pr=!0);let Ge=null;zr&&(pr&&(nt+=4),Ge=nt+5,nt=Ge+5,pr=!0);let vr=Math.max(ye.x+ye.width,nt),Hi=t.name;Hi&&(r.entityLeftEdges.set(Hi,_),r.entityRightEdges.set(Hi,x));let zn=Hi??JN(t);r.entityMidpoints.set(zn,{x:(_+x)/2,y:ye.y+ye.height/2}),r.entityVisualLeftX.set(zn,ye.x),r.entityVisualRightX.set(zn,ye.x+ye.width);let kh=Nt?{x:ye.x+ye.width,y:ye.y+ye.height-an/2}:{x:ye.x+ye.width,y:ye.y+ye.height/2};r.itemArrowSource.set(zn,kh),r.itemFlowKey.set(zn,r.currentFlowKey);let ru=Nt?ye.y+ye.height-an/2:ye.y+ye.height/2;r.itemSlackAttachY.set(zn,ru),e.x=x,e.maxX=Math.max(e.maxX,e.x),e.height=Math.max(e.height,r.bandScale.step()+P);let Q_=lk({box:ye,afterDate:Mn(u),beforeDate:Mn(f),hasLinkIcon:F,footnoteCount:Fe.length});return{kind:"item",id:Hi,title:ur,box:ye,status:I,progressFraction:k,footnoteIndicators:Fe,labelChips:H,chipsOutside:D,chipsRightX:ct,linkIcon:A.icon,linkHref:A.href,hasOverflow:w,overflowBox:M,overflowAnchorId:U,owner:yt,description:tr,metaText:ke,textSpills:Nt,dotSpills:zr,iconSpills:dn,footnoteSpills:Wr,dotSpillCx:Ge,iconSpillX:tu,footnoteSpillStartX:ce,decorationsRightX:vr,capacity:er,size:a,style:o,inlineDatePins:Q_.length>0?Q_:void 0}}function Q4(t,e,r){return new Wp(t,{sequenceOne:I_,newCursor:Cp}).place(e,r)}function eG(t,e,r){return new jp(t,{sequenceItem:A_,sequenceOne:I_,resolveChildStart:tP,newCursor:Cp,estimateTextWidth:fn,predictItemChipExtraHeight:eP}).place(e,r)}function I_(t,e,r){if(ar(t))return A_(t,e,r);if(Mr(t))return Q4(t,e,r);if(Dr(t))return eG(t,e,r);throw new Error(`Unknown swimlane child type: ${t.$type??"unknown"}`)}function fn(t,e){return t.length*e*.58}function JN(t){let e=t.$cstNode?.range.start;return`#item@${e?e.line+1:0}:${e?e.character+1:0}`}function QN(t,e,r,n,i){if(r===0)return 0;let o=n-an-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+an;return Math.max(0,l-n)}function eP(t,e){let r=t.properties,n=ft(r,"labels");if(n.length===0)return 0;let i=Ci(r,e.sizes,e.cal),o=Math.max(_r,i*e.timeline.pixelsPerDay),s=Math.max(_r,o-2*Fr),a=[];for(let _ of n){let x=e.labels.get(_);if(!x)continue;let v=yh(x,e.styleCtx,0,0);a.push({id:x,width:v.box.width})}if(a.length===0)return 0;let c=0;for(let _=0;_<a.length;_+=1)_>0&&(c+=4),c+=a[_].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?fn(d,13):0)>l,y=u?Ph(a,s):null,E=y?y.rows.length:a.length>0?1:0;return QN(u,m,E,e.bandScale.bandwidth(),f)}function tP(t,e,r,n){let i=gt(ae(t,"date"))??gt(ae(t,"start"));if(i){let s=n.scale.forwardWithinDomain(i);if(s!==null)return s}let o=ft(t,"after");if(o.length>0){let s=r;for(let a of o){let c=gt(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 v_=6;function qN(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&&fn(a,r)>e?(i.push(o),o=s):o=a}return o&&i.push(o),i}function tG(t,e){let r=$T-32,n=qN(t,r,16),i=qN(e??"",r,11),o=0;for(let d of n)o=Math.max(o,fn(d,16));for(let d of i)o=Math.max(o,fn(d,11));let s=o+32,a=Math.max(Tk-v_,Math.min($T-v_,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+v_;return{titleLines:n,authorLines:i,cardWidth:a,cardHeight:u,boxWidth:f}}function rG(t,e,r,n,i){let s=t.roadmapDecl?.properties??[],a=ae(s,"start"),c=gt(a)??nG(n),l=ae(s,"length");if(l){let p=iG(l,e.cal);if(p>0)return{startDate:c,endDate:vo(c,p)}}let u=rP(r,e,c,n),f=ON(i.unit,e.cal),d=u>0?Math.ceil(u/f)*f:4*e.cal.daysPerWeek;return{startDate:c,endDate:vo(c,Math.max(1,d))}}function nG(t){let e=t??new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))}function iG(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 rP(t,e,r,n){let i=new Map,o=new Map,s=new Map,a=0,c=f=>{let d=gt(f);return d?Tr(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=gt(ae(f.properties,"date"));if(d&&f.name){let p=Tr(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(ar(f)){let p=Ci(f.properties,e.sizes,e.cal),m=gt(ae(f.properties,"date")),y=gt(ae(f.properties,"start")),E=ft(f.properties,"after"),_=d;m?_=Tr(r,m):y?_=Tr(r,y):E.length>0&&(_=Math.max(d,...E.map(c)));let x=_+p;return f.name&&i.set(f.name,x),x}if(Mr(f)){let p=ft(f.properties,"after"),m=p.length>0?Math.max(d,...p.map(c)):d,y=m;for(let E of f.content){if(E.$type==="DescriptionDirective")continue;let _=u(E,m);y=Math.max(y,_)}return y}if(Dr(f)){let p=ft(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=gt(ae(f.properties,"date"));if(d){let m=Tr(r,d);f.name&&s.set(f.name,m),a=Math.max(a,m);continue}let p=ft(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=rP({config:f.config,content:f.content,diagnostics:[],processedFiles:new Set},e,r,void 0);a=Math.max(a,d)}if(n){let f=Tr(r,n);f>0&&(a=Math.max(a,f))}return a}function oG(t,e,r,n){let i=new Ip(nk(e,r)),o=[],s=[];for(let[l,u]of t){let f=ft(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 E=n.itemArrowSource.get(y),_,x=E===void 0;if(E)_=E;else{let v=n.entityMidpoints.get(y);if(!v)continue;_={x:v.x,y:d.y}}!x&&Math.abs(_.y-m.y)<.5&&m.x-_.x<20||(o.push({fromId:y,toId:l,from:_,to:m,isMarkerSource:x}),s.push({fromId:y,toId:l}))}}let a=ik(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:dt("item",[],n.styleCtx)})}return c}function sG(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=kp(r).nowLabel,a=fn(s,Cl),c=Math.max(LT,Math.ceil(a+2*ka)),l=e.timeline.originX-Ur,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:dt("item",[],e.styleCtx)}}function aG(t){let e=new Map,r=n=>{if(ar(n)){e.set(n.name??JN(n),n);return}if(Mr(n)){for(let i of n.content)i.$type!=="DescriptionDirective"&&r(i);return}if(Dr(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 k_(t,e,r={}){return new gh().place(t,e,r,{sequenceItem:A_,sequenceOne:I_,resolveChildStart:tP,newCursor:Cp,estimateTextWidth:fn,predictItemChipExtraHeight:eP,computeDateWindow:rG,sizeBesideHeader:tG,collectItems:aG,buildDependencies:oG,buildNowline:sG})}function N_(t){return t.toISOString().slice(0,10)}function cG(t){return t.id??t.title}function nP(t,e){for(let r of t)r.kind==="item"?e(r):nP(r.children,e)}function lG(t,e,r){let n=cG(t);t.textSpills&&r.push(Lo(e,"NL.I1000","info",{name:n},n)),t.chipsOutside&&r.push(Lo(e,"NL.I1001","info",{name:n},n)),(t.box.width<17||t.dotSpills||t.iconSpills||t.footnoteSpills)&&r.push(Lo(e,"NL.I1002","info",{name:n},n)),t.hasOverflow&&r.push(Lo(e,"NL.I1003","info",{name:n,anchor:t.overflowAnchorId},n))}function Lo(t,e,r,n,i){return{message:bl(t,e,n),severity:r,code:e,entityId:i,lspSeverity:r==="warning"?2:3,data:{code:e,args:n}}}function iP(t,e,r){let n=t.id??t.title,i=[];nP(t.children,a=>i.push(a));for(let a of i)lG(a,e,r);let o=new Set(i.map(a=>a.box.y));o.size>1&&r.push(Lo(e,"NL.I1004","info",{lane:n,rows:o.size},n)),(t.utilization?.segments.some(a=>a.classification==="red")??!1)&&r.push(Lo(e,"NL.I1005","info",{lane:n},n));for(let a of t.nested)iP(a,e,r)}function P_(t,e={}){let r=e.locale??"en-US",n=[];for(let i of t.swimlanes)iP(i,r,n);if(e.today){let i=e.today,o=t.timeline.startDate,s=t.timeline.endDate;(i<o||i>s)&&n.push(Lo(r,"NL.W1000","warning",{date:N_(i),start:N_(o),end:N_(s)}))}return n}var Do=class extends Error{constructor(e){super(e),this.name="TimezoneError"}};function C_(t){if(!t||t.toLowerCase()==="local")return{kind:"local"};if(t.toUpperCase()==="UTC")return{kind:"utc"};if(t==="Z")return{kind:"offset",ms:0};let e=/^([+-])(\d{2})(?::?(\d{2}))?$/.exec(t);if(e){let r=e[1]==="+"?1:-1,n=parseInt(e[2],10),i=e[3]!==void 0?parseInt(e[3],10):0;if(n>23||i>59)throw new Do(`nowline: invalid timezone offset "${t}". Hours must be 0\u201323 and minutes 0\u201359.`);return{kind:"offset",ms:r*(n*60+i)*6e4}}try{return{kind:"iana",name:Intl.DateTimeFormat(void 0,{timeZone:t}).resolvedOptions().timeZone}}catch{throw new Do(`nowline: unrecognised timezone "${t}". Use "local", "UTC", an ISO 8601 offset (e.g. "+05:30", "-07:00", "Z"), or an IANA timezone name (e.g. "America/Los_Angeles", "Asia/Kolkata").`)}}function vh(t,e){switch(e.kind){case"local":return new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));case"utc":return new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()));case"offset":{let r=new Date(t.getTime()+e.ms);return new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()))}case"iana":{let r=new Intl.DateTimeFormat("en-CA",{timeZone:e.name,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(t),n=0,i=0,o=0;for(let s of r)s.type==="year"?n=parseInt(s.value,10):s.type==="month"?i=parseInt(s.value,10)-1:s.type==="day"&&(o=parseInt(s.value,10));return new Date(Date.UTC(n,i,o))}}}var uG=/^(\d{4})-(\d{2})-(\d{2})$/,fG=/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?)(Z|([+-])(\d{2})(?::?(\d{2}))?)$/,dG=/^(\d{4})-(\d{2})-(\d{2})T\d{2}:\d{2}:\d{2}(?:\.\d+)?$/;function O_(t={}){let e=t.zone??{kind:"local"},r=t.clock??(()=>new Date),n=t.now;if(!(n==="-"||n===null)){if(n instanceof Date)return n;if(n!==void 0){let i=uG.exec(n);if(i)return new Date(Date.UTC(parseInt(i[1],10),parseInt(i[2],10)-1,parseInt(i[3],10)));let o=fG.exec(n);if(o){let a=new Date(n);if(!Number.isNaN(a.getTime())){if(o[2]==="Z")return vh(a,{kind:"utc"});let l=o[3]==="+"?1:-1,u=parseInt(o[4],10),f=o[5]!==void 0?parseInt(o[5],10):0,d=l*(u*60+f)*6e4;return vh(a,{kind:"offset",ms:d})}}let s=dG.exec(n);return s?new Date(Date.UTC(parseInt(s[1],10),parseInt(s[2],10)-1,parseInt(s[3],10))):void 0}return vh(r(),e)}}function pG(t){return t===2?"warning":t===3?"info":"error"}function oP(t,e){return{severity:pG(t.severity),code:Lh(t),message:t.message,suggestion:Oh(t.message),file:e,line:(t.range?.start.line??0)+1,column:(t.range?.start.character??0)+1}}function sP(t,e){return{severity:"error",code:"parse-error",message:t.message,file:e,line:t.token?.startLine??1,column:t.token?.startColumn??1}}function aP(t,e){return{severity:"error",code:"lex-error",message:t.message,file:e,line:t.line??1,column:t.column??1}}function cP(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 lP(t,e,r="warning"){return{severity:r,code:"render.warning",message:t,file:e,line:1,column:1}}function uP(t,e){return{severity:t.severity,code:t.code,message:t.message,file:e,line:1,column:1}}var fP="__nowline_browser_noop_include__";async function dP(t){throw new Error(`${fP}: include "${t}" was skipped \u2014 running in single-file mode.`)}function pP(t){return t.includes(fP)}var Ui={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"}},hG={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"}},hP={...Ui,...hG};var Zoe={none:"",multiplier:"x",person:Ui.person.ascii,people:Ui.people.ascii,points:Ui.points.ascii,time:Ui.time.ascii};var bh=class{constructor(e="nl"){R(this,"prefix");R(this,"counter",0);this.prefix=e}next(e){let r=`${this.prefix}-${this.counter++}`;return e?`${r}-${e}`:r}};var mG=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"]),gG=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 yG(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=xG(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}=TG(a);e.push({kind:s?"self":"open",name:c,attrs:l}),r=i+1}return e}function xG(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 TG(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 Kl(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function _G(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 mP(t,e={}){let r=e.idPrefix??"nl-logo",n=e.onWarn??(()=>{}),i=yG(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(Kl(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(!mG.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(!gG.has(p)){n(`sanitizer: dropping attribute ${p}`);continue}if(p==="href"||p==="xlink:href"){let y=_G(m,o);if(y===null){n(`sanitizer: dropping external href ${m}`);continue}f.push(` ${p}="${Kl(y)}"`);continue}if(p==="style"){n("sanitizer: dropping inline style");continue}if(p==="id"){let y=o.get(m);y&&f.push(` id="${Kl(y)}"`);continue}if(/\burl\(#/i.test(m)){let y=m.replace(/url\(#([^)]+)\)/gi,(E,_)=>{let x=o.get(_);return x?`url(#${x})`:"none"});f.push(` ${p}="${Kl(y)}"`);continue}if(/data:|javascript:|vbscript:/i.test(m)){n(`sanitizer: dropping suspicious value at ${p}`);continue}f.push(` ${p}="${Kl(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 gP=/&/g,yP=/</g,xP=/>/g,EG=/"/g,vG=/'/g;function Qt(t){return t.replace(gP,"&amp;").replace(yP,"&lt;").replace(xP,"&gt;")}function Hn(t){return t.replace(gP,"&amp;").replace(yP,"&lt;").replace(xP,"&gt;").replace(EG,"&quot;").replace(vG,"&#39;")}function ja(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}="${Hn(String(i))}"`))}return r.length?` ${r.join(" ")}`:""}function ee(t,e,r){return r===void 0||r===""?`<${t}${ja(e)}/>`:`<${t}${ja(e)}>${r}</${t}>`}function Pe(t,e){return`<text${ja(t)}>${Qt(e)}</text>`}function h(t){return Number.isFinite(t)?Number.isInteger(t)?t.toString():(Math.round(t*100)/100).toString():"0"}var bG={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 wG(t,e){let r=`${t}-shadow-${e}`,n=bG[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 ee("filter",{id:r,x:"-50%",y:"-50%",width:"200%",height:"200%"},i)}function TP(t,e){return e==="none"?null:`url(#${t}-shadow-${e})`}function _P(t){return["subtle","soft","hard"].map(e=>wG(t,e)).join("")}var kG={thin:100,light:300,normal:400,bold:700};function NG(t){return Aa[t]??14}function D_(t,e,r){return{"font-family":e[t.font],"font-size":r??NG(t.textSize),"font-weight":kG[t.weight]??400,"font-style":t.italic?"italic":"normal",fill:t.text}}function PG(t){if(t.border==="dashed")return"4 3";if(t.border==="dotted")return"1 3"}function CG(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 OG(t,e){return CG(t)>=.24?e.statusDot.onLight:e.statusDot.onDark}function L_(t,e){return t.length*e*.58}function wP(t,e,r,n,i,o,s){let a=i*.58,c=e?L_(e,i):0,l=e?a:0,u=r+c+l,{text:f,icon:d}=t,p=L_(f,i),m={"font-family":o,"font-size":i,fill:s};if(!d)return Pe({x:h(u),y:h(n),...m},f);if(d.kind==="builtin"&&d.name==="multiplier")return Pe({x:h(u),y:h(n),...m},`${f}\xD7`);if(d.kind==="builtin"){let E=Ui[d.name],_=Pe({x:h(u),y:h(n),...m},f),x=i*.1,v=i,A=u+p+x,F=n-i*.85,O=`<svg x="${h(A)}" y="${h(F)}" width="${h(v)}" height="${h(v)}" viewBox="${E.viewBox}" style="color:${Hn(s)}" aria-hidden="true">${E.body}</svg>`;return _+O}let y=h(i*.1);return`<text x="${h(u)}" y="${h(n)}" font-family="${Hn(o)}" font-size="${i}" fill="${Hn(s)}">${Qt(f)}<tspan dx="${y}">${Qt(d.text)}</tspan></text>`}var EP=.6,LG=.5;function DG(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 Pe({x:h(n),y:h(i),...c},e);if(!e)return wP(r,void 0,n,i,o,s,a);let l=h(o*EP),u=`<text x="${h(n)}" y="${h(i)}" font-family="${Hn(s)}" font-size="${o}" fill="${Hn(a)}">`,{text:f,icon:d}=r;if(!d)return u+Qt(e)+`<tspan dx="${l}">${Qt(f)}</tspan></text>`;if(d.kind==="builtin"&&d.name==="multiplier")return u+Qt(e)+`<tspan dx="${l}">${Qt(f)}\xD7</tspan></text>`;if(d.kind==="literal"){let O=h(o*.1);return u+Qt(e)+`<tspan dx="${l}">${Qt(f)}</tspan><tspan dx="${O}">${Qt(d.text)}</tspan></text>`}let p=Ui[d.name],m=O=>O.length*o*LG,y=n+m(e)+o*EP,E=o*.1,_=o,x=y+m(f)+E,v=i-o*.85,A=u+Qt(e)+`<tspan dx="${l}">${Qt(f)}</tspan></text>`,F=`<svg x="${h(x)}" y="${h(v)}" width="${h(_)}" height="${h(_)}" viewBox="${p.viewBox}" style="color:${Hn(a)}" aria-hidden="true">${p.body}</svg>`;return A+F}function MG(t,e){let r=hP.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:${Hn(e)}" aria-hidden="true">${r.body}</svg>`,i=`<title>${Qt(t.isoDate)}</title>`;return ee("g",{"data-layer":"inline-date-pin","data-side":t.side,"data-date":t.isoDate,"data-spilled":t.spilled?"true":null},i+n)}function M_(t,e){return!t||t.length===0?"":t.map(r=>MG(r,e)).join("")}function $G(t,e,r,n,i,o={}){let s=Math.min(Op[i.cornerRadius]??4,n/2);return ee("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":PG(i)??null,...o})}function FG(t,e,r,n){let i=t.box.x+t.cardBox.x,o=t.box.y+t.cardBox.y,s=t.cardBox.width,a=t.cardBox.height,c=t.style.bg==="none"?r.surface.headerBox:t.style.bg,l=r.header.cardBorder,u=ee("rect",{x:h(i),y:h(o),width:h(s),height:h(a),rx:6,ry:6,fill:c,stroke:l,"stroke-width":1,filter:`url(#${e}-shadow-subtle)`}),f=[];t.titleLines.forEach((_,x)=>{f.push(Pe({x:h(i+16),y:h(o+26+x*20),"font-family":n[t.style.font],"font-size":16,"font-weight":600,fill:t.style.text},_))});let d=f.join(""),p=o+26+Math.max(0,t.titleLines.length-1)*20,m=r.header.author,y=[];t.authorLines.forEach((_,x)=>{y.push(Pe({x:h(i+16),y:h(p+18+x*14),"font-family":n[t.style.font],"font-size":11,fill:m},_))});let E=y.join("");return ee("g",{"data-layer":"header","data-id":`${e}-header`},u+d+E)}function UG(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(ee("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(ee("line",{x1:h(d.x),y1:h(l),x2:h(d.x),y2:h(u),stroke:i,"stroke-width":1}))}return ee("g",{"data-layer":"grid"},f.join(""))}function BG(t,e,r){let n=e.timeline.panelFill,i=e.timeline.border,o=e.timeline.labelText,s=[],a=t.tickPanelY,c=t.tickPanelHeight,l=c>0,u=t.markerRow.height>0,f=a+c,d=t.markerRow.height,p=t.bottomTickPanelY,m=t.bottomTickPanelHeight??0,y=p!==void 0&&m>0;l&&s.push(ee("rect",{x:h(t.box.x),y:h(a),width:h(t.box.width),height:h(c),rx:4,ry:4,fill:n,stroke:i,"stroke-width":1})),u&&s.push(ee("rect",{x:h(t.box.x),y:h(f),width:h(t.box.width),height:h(d),rx:4,ry:4,fill:n,stroke:i,"stroke-width":1})),y&&s.push(ee("rect",{x:h(t.box.x),y:h(p),width:h(t.box.width),height:h(m),rx:4,ry:4,fill:n,stroke:i,"stroke-width":1}));for(let E of t.ticks)E.major&&(!E.label||E.labelX===void 0||(l&&s.push(Pe({x:h(E.labelX),y:h(a+Lp),"font-family":r.sans,"font-size":10,fill:o,"text-anchor":"middle"},E.label)),y&&s.push(Pe({x:h(E.labelX),y:h(p+Lp),"font-family":r.sans,"font-size":10,fill:o,"text-anchor":"middle"},E.label))));return ee("g",{"data-layer":"timeline"},s.join(""))}function GG(t,e,r){if(!t)return"";let n=e.nowline.stroke,i=e.nowline.labelText,o=ee("line",{x1:h(t.x),y1:h(t.topY),x2:h(t.x),y2:h(t.bottomY),stroke:n,"stroke-width":Up}),s=HG(t,n),a=XG(t,i,r);return ee("g",{"data-layer":"nowline"},o+s+a)}function RP(t){let e=Up/2;return t.pillMode==="flag-right"?t.x-e:t.pillMode==="flag-left"?t.x+e:t.x}function HG(t,e){let r=t.pillTopY,n=t.pillTopY+Oi,i=DT,o=t.pillWidth;if(t.pillMode==="center")return ee("rect",{x:h(t.x-o/2),y:h(r),width:h(o),height:h(Oi),rx:i,ry:i,fill:e});let s=RP(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 ee("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 ee("path",{d:c,fill:e})}function XG(t,e,r){let n=t.pillTopY+MT,i=RP(t),o,s;return t.pillMode==="center"?(o=t.x,s="middle"):t.pillMode==="flag-right"?(o=i+ka,s="start"):(o=i-ka,s="end"),Pe({x:h(o),y:h(n),"font-family":r.sans,"font-size":Cl,"font-weight":700,fill:e,"text-anchor":s},t.label)}function jG(t,e,r,n,i){let o=[],s=TP(r,t.style.shadow);o.push($G(t.box.x,t.box.y,t.box.width,t.box.height,t.style,{filter:s??null}));let a=OG(t.style.bg,n),c={done:a.done,"in-progress":a.inProgress,"at-risk":a.atRisk,blocked:a.blocked,planned:a.planned,neutral:a.neutral},l=c[t.status]??c.neutral;if(t.progressFraction>0){let E=Math.max(0,Math.min(t.box.width,t.box.width*t.progressFraction));o.push(ee("rect",{x:h(t.box.x),y:h(t.box.y+t.box.height-an),width:h(E),height:an,fill:t.style.fg,opacity:.55}))}let u=t.dotSpills&&t.dotSpillCx!==null?t.dotSpillCx:t.box.x+t.box.width-12;o.push(ee("circle",{cx:h(u),cy:h(t.box.y+12),r:5,fill:l})),o.push(M_(t.inlineDatePins,t.style.fg));let f;t.textSpills?(f=t.box.x+t.box.width+6,t.iconSpills&&(f+=18)):f=t.box.x+12;let d=t.style.text,p=n.entities.item.text,m=t.textSpills?p:d,y=t.textSpills?p:t.style.fg;if(t.title&&o.push(Pe({x:h(f),y:h(t.box.y+20),"font-family":i[t.style.font],"font-size":13,"font-weight":600,fill:m},t.title)),(t.metaText||t.capacity)&&o.push(DG({metaText:t.metaText,capacity:t.capacity,x:f,baselineY:t.box.y+38,fontSize:11,fontFamily:i[t.style.font],color:y})),t.footnoteIndicators.length>0){let E=t.box.y+14;if(t.footnoteSpills&&t.footnoteSpillStartX!==null){let _=t.footnoteSpillStartX;for(let x=0;x<t.footnoteIndicators.length;x++){let v=t.footnoteIndicators[x];o.push(Pe({x:h(_),y:h(E),"font-family":i.sans,"font-size":10,"font-weight":700,fill:p},String(v))),_+=8}}else{let _=t.box.x+t.box.width-22;for(let x=t.footnoteIndicators.length-1;x>=0;x--){let v=t.footnoteIndicators[x];o.push(Pe({x:h(_),y:h(E),"font-family":i.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 E={linear:"#5e6ad2",github:"#0f172a",jira:"#0052cc",generic:n.item.linkIconFg},_=E[t.linkIcon]??E.generic,x=14,v=t.iconSpills&&t.iconSpillX!==null?t.iconSpillX:t.box.x+6,A=t.box.y+6,F=ee("rect",{x:h(v),y:h(A),width:x,height:x,rx:2,ry:2,fill:_}),O=v,L=A,G=ee("path",{d:`M${h(O+4)} ${h(L+10)} L${h(O+10)} ${h(L+4)} M${h(O+6)} ${h(L+4)} H${h(O+10)} V${h(L+8)}`,stroke:"#ffffff",fill:"none","stroke-width":1.1,"stroke-linecap":"round","stroke-linejoin":"round"}),X=F+G,oe=t.linkHref?ee("a",{href:t.linkHref,target:"_blank",rel:"noopener"},X):X;o.push(oe)}if(t.hasOverflow&&t.overflowBox){let E=n.item.overflowTailFill,_=n.item.overflowTailStroke,x=n.item.overflowCaption;o.push(ee("rect",{x:h(t.overflowBox.x),y:h(t.overflowBox.y),width:h(t.overflowBox.width),height:h(t.overflowBox.height),fill:E,stroke:_,"stroke-width":1})),t.overflowAnchorId&&t.overflowBox.width>60&&o.push(Pe({x:h(t.overflowBox.x+t.overflowBox.width/2),y:h(t.overflowBox.y+t.overflowBox.height/2+3),"font-family":i.sans,"font-size":9,"font-weight":700,fill:x,"text-anchor":"middle"},`past ${t.overflowAnchorId}`))}for(let E of t.labelChips){let _=Math.min(Op[E.style.cornerRadius]??8,E.box.height/2);o.push(ee("rect",{x:h(E.box.x),y:h(E.box.y),width:h(E.box.width),height:h(E.box.height),rx:h(_),ry:h(_),fill:E.style.bg==="none"?"transparent":E.style.bg,stroke:E.style.fg,"stroke-width":.5})),o.push(Pe({x:h(E.box.x+E.box.width/2),y:h(E.box.y+E.box.height/2+3),...D_(E.style,i,Aa.xs),"text-anchor":"middle"},E.text))}return ee("g",{"data-layer":"item","data-id":t.id??null},o.join(""))}function zG(t,e,r,n,i){let o=[];if(t.style.bg!=="none"&&t.style.bg!=="#ffffff"){if(o.push(ee("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 a=t.title.length*CT+2*$p,c=t.box.x,l=t.box.y,u=Pl,f=6,d=`M${h(c+f)} ${h(l)}H${h(c+a)}V${h(l+u-f)}A${f} ${f} 0 0 1 ${h(c+a-f)} ${h(l+u)}H${h(c)}V${h(l+f)}A${f} ${f} 0 0 1 ${h(c+f)} ${h(l)}Z`;o.push(ee("path",{d,fill:t.style.fg})),o.push(Pe({x:h(c+$p),y:h(l+NT),"font-family":i[t.style.font],"font-size":PT,"font-weight":600,fill:"#ffffff"},t.title))}}else{let a=t.style.fg;if(t.style.bracket!=="none"){let l=t.box.y+t.box.height,u=t.style.bracket==="dashed"?"3 2":null,f=t.title?`M${h(t.box.x+4)} ${h(t.box.y-Ia)} L${h(t.box.x)} ${h(t.box.y-Ia)} L${h(t.box.x)} ${h(l)} L${h(t.box.x+4)} ${h(l)}`:`M${h(t.box.x)} ${h(t.box.y)} L${h(t.box.x)} ${h(l)} L${h(t.box.x+4)} ${h(l)}`;o.push(ee("path",{d:f,fill:"none",stroke:a,"stroke-width":1,"stroke-dasharray":u}))}t.title&&o.push(Pe({x:h(t.box.x+6),y:h(t.box.y-2),...D_(t.style,i,Aa.xs),"fill-opacity":.7},t.title))}o.push(M_(t.inlineDatePins,t.style.fg));for(let a of t.children)o.push($_(a,e,r,n,i));return ee("g",{"data-layer":"group","data-id":t.id??null},o.join(""))}function WG(t,e,r,n,i){let o=[];if(t.style.bracket==="solid"||t.style.bracket==="dashed"){let c=t.box.y-12,l=t.box.y+t.box.height+12,u=t.box.x,f=t.box.x+t.box.width,d=n.parallel.bracketStroke;o.push(ee("path",{d:`M${h(u+4)} ${h(c)} H${h(u)} V${h(l)} H${h(u+4)}`,fill:"none",stroke:d,"stroke-width":1.25,"stroke-dasharray":t.style.bracket==="dashed"?"3 3":null,"stroke-linejoin":"round"})),o.push(ee("path",{d:`M${h(f-4)} ${h(c)} H${h(f)} V${h(l)} H${h(f-4)}`,fill:"none",stroke:d,"stroke-width":1.25,"stroke-dasharray":t.style.bracket==="dashed"?"3 3":null,"stroke-linejoin":"round"}))}t.title&&o.push(Pe({x:h(t.box.x+4),y:h(t.box.y-2),...D_(t.style,i,Aa.xs),"fill-opacity":.7},t.title)),o.push(M_(t.inlineDatePins,t.style.fg));for(let s of t.children)o.push($_(s,e,r,n,i));return ee("g",{"data-layer":"parallel","data-id":t.id??null},o.join(""))}function $_(t,e,r,n,i){return t.kind==="item"?jG(t,e,r,n,i):t.kind==="group"?zG(t,e,r,n,i):WG(t,e,r,n,i)}var vP=2;function qG(t,e){switch(t){case"green":return e.swimlane.utilizationOk;case"yellow":return e.swimlane.utilizationWarn;case"red":return e.swimlane.utilizationOver}}function VG(t,e){if(!t.utilization||t.utilization.segments.length===0)return"";let r=t.box.y+t.box.height-vP,n=t.utilization.segments.map(i=>{let o=i.endX-i.startX;return o<=0?"":ee("rect",{x:h(i.startX),y:h(r),width:h(o),height:vP,fill:qG(i.classification,e),"data-utilization":i.classification,"data-load":h(i.load)})});return ee("g",{"data-layer":"lane-utilization","data-id":t.id??null},n.join(""))}function YG(t,e){let r=t.bandIndex%2===0?e.swimlane.rowTintEven:e.swimlane.rowTintOdd,n=e.swimlane.border;return ee("g",{"data-layer":"swimlane-bg","data-id":t.id??null},ee("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,i){let o=n.swimlane.tabFill,s=n.swimlane.tabStroke,a=n.swimlane.tabText,c=n.swimlane.ownerText,l=n.swimlane.footnoteIndicator,u=[];if(t.title){let d=t.capacity?Xi(t.capacity.text,t.capacity.icon,10):0,p=t.footnoteIndicators.length>0?t.footnoteIndicators.join(","):"",m=p?L_(p,10):0,y=Va(t.box.x,t.title,t.owner,d,m),E=Dp,_=t.box.y+10,x=_+Mp;u.push(ee("rect",{x:h(y.tabX),y:h(_),width:h(y.tabW),height:h(E),rx:4,ry:4,fill:o,stroke:s,"stroke-width":1})),u.push(Pe({x:h(y.titleX),y:h(x),"font-family":i[t.style.font],"font-size":12,"font-weight":600,fill:a},t.title)),t.owner&&u.push(Pe({x:h(y.ownerX),y:h(x),"font-family":i[t.style.font],"font-size":10,fill:c},`owner: ${t.owner}`)),t.capacity&&u.push(wP(t.capacity,void 0,y.badgeX,x,10,i[t.style.font],c)),p&&u.push(Pe({x:h(y.footnoteRightX),y:h(_+14),"font-family":i.sans,"font-size":10,"font-weight":700,fill:l,"text-anchor":"end"},p))}for(let f of t.children)u.push($_(f,e,r,n,i));return u.push(VG(t,n)),ee("g",{"data-layer":"swimlane","data-id":t.id??null},u.join(""))}function KG(t,e,r){let n=t.radius,i=t.center.x,o=t.center.y,s=e.anchorDiamond.fill,a=e.anchorDiamond.stroke,c=ee("path",{d:`M${h(i)} ${h(o-n)} L${h(i+n)} ${h(o)} L${h(i)} ${h(o+n)} L${h(i-n)} ${h(o)} Z`,fill:s,stroke:a,"stroke-width":1.25}),l=e.anchorDiamond.label,u=t.labelSide==="left"?t.labelBox.x+t.labelBox.width:t.labelBox.x,f={x:h(u),y:h(o+4),"font-family":r.sans,"font-size":10,fill:l};t.labelSide==="left"&&(f["text-anchor"]="end");let d=t.title?Pe(f,t.title):"";return ee("g",{"data-layer":"anchor","data-id":t.id??null},c+d)}function ZG(t,e){let r=e.anchorDiamond.cutLine;return ee("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 JG(t,e,r){let n=t.center.x,i=t.center.y,o=t.radius,s=e.milestoneDiamond.fill,a=ee("path",{d:`M${h(n)} ${h(i-o)} L${h(n+o)} ${h(i)} L${h(n)} ${h(i+o)} L${h(n-o)} ${h(i)} Z`,fill:s,stroke:s,"stroke-width":1}),c=e.milestoneDiamond.label,l=t.labelSide==="left"?t.labelBox.x+t.labelBox.width:t.labelBox.x,u={x:h(l),y:h(i+4),"font-family":r.sans,"font-size":10,"font-weight":600,fill:c};t.labelSide==="left"&&(u["text-anchor"]="end");let f=t.title?Pe(u,t.title):"";return ee("g",{"data-layer":"milestone","data-id":t.id??null},a+f)}function QG(t,e){let r=t.isOverrun?e.milestoneDiamond.cutLineOverrun:e.milestoneDiamond.cutLineNormal,n=[];if(n.push(ee("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":Fp,"stroke-linecap":"round"})),t.slackArrows&&t.slackArrows.length>0){let i=e.milestoneDiamond.slack;for(let o of t.slackArrows)n.push(ee("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 bP(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 ee("path",{d:eH(n,XT),fill:"none",stroke:r,"stroke-width":i,"stroke-dasharray":t.kind==="overflow"?"4 2":null,"stroke-linejoin":"round","marker-end":"url(#nl-arrow)"})}function eH(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 tH(t,e,r,n){if(t.entries.length===0)return"";let i=r.footnotePanel.fill,o=r.footnotePanel.border,s=r.footnotePanel.header,a=r.footnotePanel.title,c=r.footnotePanel.description,l=r.footnotePanel.number,u=[];u.push(ee("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:i,stroke:o,"stroke-width":1,filter:`url(#${e}-shadow-subtle)`})),u.push(Pe({x:h(t.box.x+Br),y:h(t.box.y+FT),"font-family":n.sans,"font-size":12,"font-weight":700,fill:s},"Footnotes"));let f=t.box.y+Ol+Br,d=t.box.x+Br,p=d+Br;return t.entries.forEach((m,y)=>{let E=f+y*Ll;u.push(Pe({x:h(d),y:h(E),"font-family":n.sans,"font-size":10,"font-weight":700,fill:l},String(m.number))),u.push(Pe({x:h(p),y:h(E),"font-family":n.sans,"font-size":11,"font-weight":600,fill:a},m.title)),m.description&&u.push(Pe({x:h(p+Math.max(120,m.title.length*6)),y:h(E),"font-family":n.sans,"font-size":11,fill:c},`\u2014 ${m.description}`))}),ee("g",{"data-layer":"footnotes"},u.join(""))}function rH(t,e,r,n,i){let o=n.includeRegion.border,s=n.includeRegion.fill,a=n.includeRegion.tabFill,c=n.includeRegion.tabStroke,l=n.includeRegion.tabText,u=n.includeRegion.badgeFill,f=n.includeRegion.badgeStroke,d=n.includeRegion.badgeText,p=t.box.x+8,m=t.box.y,y=t.box.width-16,E=t.box.height,_=ee("rect",{x:h(p),y:h(m),width:h(y),height:h(E),rx:8,ry:8,fill:s,stroke:o,"stroke-width":1,"stroke-dasharray":Fp}),x=Dp,v=Ya(t.box.x,t.label,t.sourcePath),A=m-x/2,F=ee("rect",{x:h(v.tabX),y:h(A),width:h(v.tabWidth),height:x,rx:4,ry:4,fill:a,stroke:c,"stroke-width":1}),O=Pe({x:h(v.tabLabelX),y:h(A+Mp),"font-family":i.sans,"font-size":11,"font-weight":600,fill:l},t.label),L=v.badgeX,G=v.badgeSize,X=m-G/2,oe=ee("rect",{x:h(L),y:h(X),width:G,height:G,rx:4,ry:4,fill:u,stroke:f,"stroke-width":1}),D=ee("path",{d:`M${h(L+7)} ${h(X+4)} H${h(L+14)} V${h(X+11)} M${h(L+4)} ${h(X+7)} H${h(L+11)} V${h(X+14)} H${h(L+4)} Z`,stroke:d,"stroke-width":1.4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}),w=9,M=m+4,U=ee("rect",{x:h(v.sourceHaloX),y:h(M-w),width:h(v.sourceHaloWidth),height:w+6,fill:s}),S=Pe({x:h(v.sourceTextX),y:h(M),"font-family":i.mono,"font-size":w,fill:d},t.sourcePath),I=t.nestedSwimlanes.map(k=>SP(k,e,r,n,i)).join("");return ee("g",{"data-layer":"include"},_+I+F+O+oe+D+U+S)}function nH(t,e){let r=t.palette.attribution.mark,n=t.palette.attribution.link;if(t.swimlanes.length===0)return"";let i=t.header.attributionBox.x,o=t.header.attributionBox.y,s=Li,a=Pe({x:"0",y:s,"font-family":e.sans,"font-size":Hp,"font-weight":400,fill:r},Gp)+Pe({x:Ml,y:s,"font-family":e.sans,"font-size":Li,"font-weight":700,fill:r},"now")+ee("rect",{x:BT,y:12,width:GT,height:Li,fill:n})+Pe({x:Xp,y:s,"font-family":e.sans,"font-size":Li,"font-weight":400,fill:r},"ine"),c=ee("g",{transform:`translate(${h(i)} ${h(o)}) scale(${h(Dl)})`},a);return ee("a",{href:UT,target:"_blank",rel:"noopener","aria-label":"Powered by nowline"},ee("g",{"data-layer":"attribution"},c))}async function iH(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=mP(u,{idPrefix:`${r}-logo`,onWarn:n.warn});return ee("g",{transform:`translate(${h(i)} ${h(o)})`},f)}if(c==="image/png"||c==="image/jpeg"||c==="image/jpg"||c==="image/webp"){let u=oH(a.bytes);return ee("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 oH(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 F_(t,e={}){let n=new bh(e.idPrefix??"nl").next("root"),i=t.palette,o=e.fontFamilies??jT,s=[],a=i.arrowhead.neutral,c=i.arrowhead.light,l=i.arrowhead.dark,u=(p,m)=>`<marker id="${p}" 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="${m}"/></marker>`,f=`<defs>${_P(n)}`+u("nl-arrow",a)+u("nl-arrow-light",c)+u("nl-arrow-dark",l)+"</defs>";s.push(f),s.push(ee("rect",{x:0,y:0,width:h(t.width),height:h(t.height),fill:t.backgroundColor})),s.push(BG(t.timeline,i,o));for(let p of t.swimlanes)s.push(YG(p,i));s.push(UG(t.timeline,t.chartBox.y,i));for(let p of t.edges)p.kind==="underBar"&&s.push(bP(p,i));for(let p of t.swimlanes)s.push(SP(p,e,n,i,o));for(let p of t.includes)s.push(rH(p,e,n,i,o));for(let p of t.edges)p.kind!=="underBar"&&s.push(bP(p,i));for(let p of t.anchors)s.push(ZG(p,i));for(let p of t.milestones)s.push(QG(p,i));for(let p of t.anchors)s.push(KG(p,i,o));for(let p of t.milestones)s.push(JG(p,i,o));if(s.push(GG(t.nowline,i,o)),s.push(tH(t.footnotes,n,i,o)),s.push(FG(t.header,n,i,o)),s.push(nH(t,o)),t.header.logo&&e.assetResolver){let p=await iH(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));p&&s.push(p)}return`<svg${ja({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"})}>${s.join("")}</svg>`}var U_="/browser-source.nowline",sH={error:3,warning:2,info:1},aH={error:3,warning:2,info:1};function AP(t,e){return sH[t]>=aH[e]}var wh,IP=0;function kP(){return wh||(wh=ET()),wh}function cH(){return ut.parse(`memory:///nowline-browser-${++IP}.nowline`)}async function Rh(t,e={}){let r=e.filePath??U_,n=kP(),o=n.shared.workspace.LangiumDocumentFactory.fromString(t,cH());await n.shared.workspace.DocumentBuilder.build([o],{validation:!0});let s=[];for(let a of Ch(o))a.origin==="lexer"?s.push(aP(a.error,r)):a.origin==="parser"?s.push(sP(a.error,r)):s.push(oP(a.diagnostic,r));return{ast:o.parseResult.value,diagnostics:s}}async function B_(t,e={}){let r=e.filePath??U_,n=await Rh(t,{filePath:r});if(n.diagnostics.some(x=>x.severity==="error"))return{kind:"diagnostics",diagnostics:n.diagnostics};let i=kP(),o=e.readFile??dP,s=await uT(n.ast,r,{services:i.Nowline,readFile:o}),a=[...n.diagnostics];for(let x of s.diagnostics){if(x.severity==="error"&&pP(x.message)){e.onSkippedInclude?.({sourcePath:x.sourcePath,message:x.message});continue}a.push(cP(x))}if(a.some(x=>x.severity==="error"))return{kind:"diagnostics",diagnostics:a};let c;if(e.timezone)try{c=C_(e.timezone)}catch(x){if(x instanceof Do)return{kind:"diagnostics",diagnostics:[{severity:"error",code:"invalid-timezone",message:x.message,file:r,line:1,column:1}]};throw x}let l=O_({now:e.today,zone:c}),u=k_(n.ast,s,{theme:e.theme,today:l,locale:e.locale,width:e.width}),f=e.diagnosticLevel??"error",d=P_(u,{today:l??void 0,locale:e.locale??"en-US"}).map(x=>uP(x,r)),p=e.showLinks!==!1,m=e.strict===!0,y=[],E=await F_(u,{idPrefix:e.idPrefix,assetResolver:e.assetResolver,noLinks:!p,strict:m,warn:x=>y.push(x),fontFamilies:e.fontFamilies}),_=[...d,...y.map(x=>lP(x,r,m?"error":"warning"))].filter(x=>AP(x.severity,f));return m&&_.length>0?{kind:"diagnostics",diagnostics:[...a,..._]}:{kind:"svg",svg:E,warnings:_}}function G_(){wh=void 0,IP=0}var NP="/embed.nowline",H_=!1;async function PP(t){let{ast:e,diagnostics:r}=await Rh(t,{filePath:NP});return{ast:e,errors:r.filter(n=>n.severity==="error").map(n=>n.message)}}async function Sh(t,e={}){let r={filePath:NP,theme:e.theme,today:e.today,timezone:e.timezone,locale:e.locale,width:e.width,idPrefix:e.idPrefix,onSkippedInclude:()=>{H_||(H_=!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 B_(t,r);if(n.kind==="svg")return n.svg;let i=n.diagnostics.filter(o=>o.severity==="error").map(o=>o.message);throw new Zl(`Failed to render Nowline source: ${i.join("; ")}`,i)}var Zl=class extends Error{constructor(r,n){super(r);R(this,"details",n);this.name="EmbedRenderError"}};function CP(){H_=!1,G_()}var Xr=Uint8Array,lr=Uint16Array,q_=Int32Array,V_=new Xr([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]),Y_=new Xr([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]),OP=new Xr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$P=function(t,e){for(var r=new lr(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];for(var i=new q_(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}},FP=$P(V_,2),lH=FP.b,j_=FP.r;lH[28]=258,j_[258]=28;var UP=$P(Y_,0),Sse=UP.b,LP=UP.r,z_=new lr(32768);for(Le=0;Le<32768;++Le)Xn=(Le&43690)>>1|(Le&21845)<<1,Xn=(Xn&52428)>>2|(Xn&13107)<<2,Xn=(Xn&61680)>>4|(Xn&3855)<<4,z_[Le]=((Xn&65280)>>8|(Xn&255)<<8)>>1;var Xn,Le,eu=(function(t,e,r){for(var n=t.length,i=0,o=new lr(e);i<n;++i)t[i]&&++o[t[i]-1];var s=new lr(e);for(i=1;i<e;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(r){a=new lr(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[z_[f]>>c]=l}else for(a=new lr(n),i=0;i<n;++i)t[i]&&(a[i]=z_[s[t[i]-1]++]>>15-t[i]);return a}),Mo=new Xr(288);for(Le=0;Le<144;++Le)Mo[Le]=8;var Le;for(Le=144;Le<256;++Le)Mo[Le]=9;var Le;for(Le=256;Le<280;++Le)Mo[Le]=7;var Le;for(Le=280;Le<288;++Le)Mo[Le]=8;var Le,Ah=new Xr(32);for(Le=0;Le<32;++Le)Ah[Le]=5;var Le,uH=eu(Mo,9,0);var fH=eu(Ah,5,0);var BP=function(t){return(t+7)/8|0},dH=function(t,e,r){return(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length),new Xr(t.subarray(e,r))};var jn=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>8},Jl=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},X_=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:HP,l:0};if(i==1){var s=new Xr(r[0].s+1);return s[r[0].s]=1,{t:s,l:1}}r.sort(function(F,O){return F.f-O.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 lr(d+1),m=W_(r[u-1],p,0);if(m>e){var n=0,y=0,E=m-e,_=1<<E;for(o.sort(function(O,L){return p[L.s]-p[O.s]||O.f-L.f});n<i;++n){var x=o[n].s;if(p[x]>e)y+=_-(1<<m-p[x]),p[x]=e;else break}for(y>>=E;y>0;){var v=o[n].s;p[v]<e?y-=1<<e-p[v]++-1:++n}for(;n>=0&&y;--n){var A=o[n].s;p[A]==e&&(--p[A],++y)}m=e}return{t:new Xr(p),l:m}},W_=function(t,e,r){return t.s==-1?Math.max(W_(t.l,e,r+1),W_(t.r,e,r+1)):e[t.s]=r},DP=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new lr(++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}},Ql=function(t,e){for(var r=0,n=0;n<e.length;++n)r+=t[n]*e[n];return r},GP=function(t,e,r){var n=r.length,i=BP(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},MP=function(t,e,r,n,i,o,s,a,c,l,u){jn(e,u++,r),++i[256];for(var f=X_(i,15),d=f.t,p=f.l,m=X_(o,15),y=m.t,E=m.l,_=DP(d),x=_.c,v=_.n,A=DP(y),F=A.c,O=A.n,L=new lr(19),G=0;G<x.length;++G)++L[x[G]&31];for(var G=0;G<F.length;++G)++L[F[G]&31];for(var X=X_(L,7),oe=X.t,D=X.l,w=19;w>4&&!oe[OP[w-1]];--w);var M=l+5<<3,U=Ql(i,Mo)+Ql(o,Ah)+s,S=Ql(i,d)+Ql(o,y)+s+14+3*w+Ql(L,oe)+2*L[16]+3*L[17]+7*L[18];if(c>=0&&M<=U&&M<=S)return GP(e,u,t.subarray(c,c+l));var I,k,B,W;if(jn(e,u,1+(S<U)),u+=2,S<U){I=eu(d,p,0),k=d,B=eu(y,E,0),W=y;var z=eu(oe,D,0);jn(e,u,v-257),jn(e,u+5,O-1),jn(e,u+10,w-4),u+=14;for(var G=0;G<w;++G)jn(e,u+3*G,oe[OP[G]]);u+=3*w;for(var Y=[x,F],K=0;K<2;++K)for(var ue=Y[K],G=0;G<ue.length;++G){var V=ue[G]&31;jn(e,u,z[V]),u+=oe[V],V>15&&(jn(e,u,ue[G]>>5&127),u+=ue[G]>>12)}}else I=uH,k=Mo,B=fH,W=Ah;for(var G=0;G<a;++G){var re=n[G];if(re>255){var V=re>>18&31;Jl(e,u,I[V+257]),u+=k[V+257],V>7&&(jn(e,u,re>>23&31),u+=V_[V]);var Se=re&31;Jl(e,u,B[Se]),u+=W[Se],Se>3&&(Jl(e,u,re>>5&8191),u+=Y_[Se])}else Jl(e,u,I[re]),u+=k[re]}return Jl(e,u,I[256]),u+k[256]},pH=new q_([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),HP=new Xr(0),hH=function(t,e,r,n,i,o){var s=o.z||t.length,a=new Xr(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=pH[e-1],d=f>>13,p=f&8191,m=(1<<r)-1,y=o.p||new lr(32768),E=o.h||new lr(m+1),_=Math.ceil(r/3),x=2*_,v=function(de){return(t[de]^t[de+1]<<_^t[de+2]<<x)&m},A=new q_(25e3),F=new lr(288),O=new lr(32),L=0,G=0,X=o.i||0,oe=0,D=o.w||0,w=0;X+2<s;++X){var M=v(X),U=X&32767,S=E[M];if(y[U]=S,E[M]=U,D<=X){var I=s-X;if((L>7e3||oe>24576)&&(I>423||!l)){u=MP(t,c,0,A,F,O,G,oe,w,X-w,u),oe=L=G=0,w=X;for(var k=0;k<286;++k)F[k]=0;for(var k=0;k<30;++k)O[k]=0}var B=2,W=0,z=p,Y=U-S&32767;if(I>2&&M==v(X-Y))for(var K=Math.min(d,I)-1,ue=Math.min(32767,X),V=Math.min(258,I);Y<=ue&&--z&&U!=S;){if(t[X+B]==t[X+B-Y]){for(var re=0;re<V&&t[X+re]==t[X+re-Y];++re);if(re>B){if(B=re,W=Y,re>K)break;for(var Se=Math.min(Y,re-2),Ee=0,k=0;k<Se;++k){var Ce=X-Y+k&32767,j=y[Ce],Q=Ce-j&32767;Q>Ee&&(Ee=Q,S=Ce)}}}U=S,S=y[U],Y+=U-S&32767}if(W){A[oe++]=268435456|j_[B]<<18|LP[W];var ie=j_[B]&31,$=LP[W]&31;G+=V_[ie]+Y_[$],++F[257+ie],++O[$],D=X+B,++L}else A[oe++]=t[X],++F[t[X]]}}for(X=Math.max(X,D);X<s;++X)A[oe++]=t[X],++F[t[X]];u=MP(t,c,l,A,F,O,G,oe,w,X-w,u),l||(o.r=u&7|c[u/8|0]<<3,u-=7,o.h=E,o.p=y,o.i=X,o.w=D)}else{for(var X=o.w||0;X<s+l;X+=65535){var ge=X+65535;ge>=s&&(c[u/8|0]=l,ge=s),u=GP(c,u+1,t.subarray(X,ge))}o.i=s}return dH(a,0,n+BP(u)+i)};var XP=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}}},mH=function(t,e,r,n,i){if(!i&&(i={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),s=new Xr(o.length+t.length);s.set(o),s.set(t,o.length),t=s,i.w=o.length}return hH(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 jP=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};var gH=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=XP();i.p(e.dictionary),jP(t,2,i.d())}};function zP(t,e){e||(e={});var r=XP();r.p(t);var n=mH(t,e,e.dictionary?6:2,4);return gH(n,e),jP(n,n.length-4,r.d()),n}var yH=typeof TextDecoder<"u"&&new TextDecoder,xH=0;try{yH.decode(HP,{stream:!0}),xH=1}catch{}var VP="https://free.nowline.io/open";function WP(t){let e=new TextEncoder().encode(t),r=zP(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 K_({source:t,sourceUrl:e,share:r}){if(r===!1||r==="none")return null;if(typeof r=="object")return e!==void 0&&qP(e)?r.remoteUrl.replace("{url}",encodeURIComponent(e)):r.textUrl.replace("{text}",WP(t));let n=r===!0?VP:r,i=new URL(n);return e!==void 0&&qP(e)?i.hash=`url=${encodeURIComponent(e)}`:i.hash=`text=${WP(t)}`,i.toString()}function qP(t){try{return new URL(t).protocol==="https:"}catch{return!1}}var YP=0;async function KP(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=++YP,s=t.share??!0,a=[],c=0;for(let l of Array.from(r)){let u=TH(l);if(!u)continue;let f=_H(l),d=`nl-r${o}-${c++}`,p={theme:t.theme,locale:t.locale,width:t.width,today:t.today,timezone:t.timezone,idPrefix:d},m=u.parentElement,y=u.nextSibling,_=l.getAttribute("data-nowline-source-url")??void 0??t.sourceUrl;a.push(Sh(f,p).then(x=>{if(EH(u,x),n++,m!==null){let v=K_({source:f,sourceUrl:_,share:s});if(v!==null){let A=e.createElement("a");A.className="nowline-share",A.href=v,A.target="_blank",A.rel="noopener noreferrer",A.textContent="Share on Nowline",m.insertBefore(A,y)}}},x=>{i++,console.error("nowline: render failed",x)}))}return await Promise.all(a),{rendered:n,failed:i}}function TH(t){let e=t.parentElement;return e&&e.tagName.toUpperCase()==="PRE"?e:t}function _H(t){return t.textContent??""}function EH(t,e){t.outerHTML=e}function ZP(){YP=0}function Ih(){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 JP(t,e){return t&&t!=="auto"?AT(t)??e:e}var vH="0.8.6",bH="29a8950",wH="pre code.language-nowline, code.language-nowline",QP={theme:"auto",startOnLoad:!0,selector:wH,systemTheme:Ih(),share:!0},rt={...QP},Z_=!1;function RH(t={}){rt={theme:t.theme??rt.theme,startOnLoad:t.startOnLoad??rt.startOnLoad,selector:t.selector??rt.selector,locale:t.locale??rt.locale,width:t.width??rt.width,today:t.today!==void 0?t.today:rt.today,timezone:t.timezone??rt.timezone,share:t.share??rt.share,sourceUrl:t.sourceUrl??rt.sourceUrl,systemTheme:Ih()}}function eC(){return{theme:JP(rt.theme,rt.systemTheme),locale:rt.locale,width:rt.width,today:rt.today,timezone:rt.timezone}}async function SH(t,e={}){let r={...eC(),...e};return Sh(t,r)}async function AH(t){return PP(t)}async function J_(t){let e={selector:t?.selector??rt.selector,theme:t?.theme??eC().theme,locale:t?.locale??rt.locale,width:t?.width??rt.width,today:t?.today!==void 0?t.today:rt.today,timezone:t?.timezone??rt.timezone,share:t?.share??rt.share,sourceUrl:t?.sourceUrl??rt.sourceUrl,document:t?.document};return KP(e)}var IH=J_;if(typeof document<"u"&&!Z_){Z_=!0;let t=()=>{rt.startOnLoad&&J_()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):queueMicrotask(t)}function kH(){rt={...QP,systemTheme:Ih()},Z_=!1,CP(),ZP()}return iu(NH);})();
2640
2640
  //# sourceMappingURL=nowline.min.js.map