@dayinxisheng/zreadbrow 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/zreadbrow.js +72 -0
- package/dist/public/assets/_baseUniq-OYZggmI7.js +1 -0
- package/dist/public/assets/arc-Do70yPZY.js +1 -0
- package/dist/public/assets/architectureDiagram-Q4EWVU46-DtjK6LfO.js +36 -0
- package/dist/public/assets/blockDiagram-DXYQGD6D-D-J4AWOc.js +132 -0
- package/dist/public/assets/c4Diagram-AHTNJAMY-C2svHtHd.js +10 -0
- package/dist/public/assets/channel-hPiJ7w5T.js +1 -0
- package/dist/public/assets/chunk-4BX2VUAB-BxQLfhjk.js +1 -0
- package/dist/public/assets/chunk-4TB4RGXK-D1IJMxxZ.js +206 -0
- package/dist/public/assets/chunk-55IACEB6-CbeuowJC.js +1 -0
- package/dist/public/assets/chunk-EDXVE4YY-gq6Rm2e9.js +1 -0
- package/dist/public/assets/chunk-FMBD7UC4-Dskli35B.js +15 -0
- package/dist/public/assets/chunk-OYMX7WX6-CtMIqPYA.js +231 -0
- package/dist/public/assets/chunk-QZHKN3VN-BZvIyYlc.js +1 -0
- package/dist/public/assets/chunk-YZCP3GAM-Bq3cYA_3.js +1 -0
- package/dist/public/assets/classDiagram-6PBFFD2Q-3O1DCKVl.js +1 -0
- package/dist/public/assets/classDiagram-v2-HSJHXN6E-3O1DCKVl.js +1 -0
- package/dist/public/assets/clone-UzahnEK0.js +1 -0
- package/dist/public/assets/cose-bilkent-S5V4N54A-DyKcM_Ft.js +1 -0
- package/dist/public/assets/cytoscape.esm-DxGcaOPV.js +331 -0
- package/dist/public/assets/dagre-KV5264BT-CqqZAnfi.js +4 -0
- package/dist/public/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/public/assets/diagram-5BDNPKRD-Cy3V7bcG.js +10 -0
- package/dist/public/assets/diagram-G4DWMVQ6-DUtdWbLg.js +24 -0
- package/dist/public/assets/diagram-MMDJMWI5-jNH5iO6v.js +43 -0
- package/dist/public/assets/diagram-TYMM5635-BEQMXYiS.js +24 -0
- package/dist/public/assets/erDiagram-SMLLAGMA-BOu00pgZ.js +85 -0
- package/dist/public/assets/flowDiagram-DWJPFMVM-BAxygbW_.js +162 -0
- package/dist/public/assets/ganttDiagram-T4ZO3ILL-BDIRknaP.js +292 -0
- package/dist/public/assets/gitGraphDiagram-UUTBAWPF-DpCrvb-c.js +106 -0
- package/dist/public/assets/graph-CRle1L2w.js +1 -0
- package/dist/public/assets/index-BlXRYVPH.js +377 -0
- package/dist/public/assets/index-DytBrat0.css +1 -0
- package/dist/public/assets/infoDiagram-42DDH7IO-DSZsO32C.js +2 -0
- package/dist/public/assets/init-Gi6I4Gst.js +1 -0
- package/dist/public/assets/ishikawaDiagram-UXIWVN3A-wLXQ-0kc.js +70 -0
- package/dist/public/assets/journeyDiagram-VCZTEJTY-D6ybPNfZ.js +139 -0
- package/dist/public/assets/kanban-definition-6JOO6SKY-B47ibwqw.js +89 -0
- package/dist/public/assets/katex-DkKDou_j.js +257 -0
- package/dist/public/assets/layout-BfPAQzhB.js +1 -0
- package/dist/public/assets/linear-BYSRnc6z.js +1 -0
- package/dist/public/assets/min-DUZc6_qu.js +1 -0
- package/dist/public/assets/mindmap-definition-QFDTVHPH-Byg9EDEf.js +96 -0
- package/dist/public/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/public/assets/pieDiagram-DEJITSTG-BaO4djdd.js +30 -0
- package/dist/public/assets/quadrantDiagram-34T5L4WZ-DjOVuL9Z.js +7 -0
- package/dist/public/assets/requirementDiagram-MS252O5E-qy4lP90H.js +84 -0
- package/dist/public/assets/sankeyDiagram-XADWPNL6-OpfFStE8.js +10 -0
- package/dist/public/assets/sequenceDiagram-FGHM5R23-BfLktgJr.js +157 -0
- package/dist/public/assets/stateDiagram-FHFEXIEX-CEA-RrVC.js +1 -0
- package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-QjCaGLFg.js +1 -0
- package/dist/public/assets/timeline-definition-GMOUNBTQ-DiPD59I4.js +120 -0
- package/dist/public/assets/vennDiagram-DHZGUBPP-DSCxAvb_.js +34 -0
- package/dist/public/assets/wardley-RL74JXVD-CFZO0XVm.js +162 -0
- package/dist/public/assets/wardleyDiagram-NUSXRM2D-BWa8t8o-.js +20 -0
- package/dist/public/assets/xychartDiagram-5P7HB3ND-ZplCit9D.js +7 -0
- package/dist/public/index.html +13 -0
- package/dist/server/index.js +1 -0
- package/dist/server/middleware/errorHandler.js +1 -0
- package/dist/server/routes/config.js +1 -0
- package/dist/server/routes/files.js +1 -0
- package/dist/server/routes/projects.js +1 -0
- package/dist/server/routes/scan.js +1 -0
- package/dist/server/routes/search.js +1 -0
- package/dist/server/routes/wiki.js +1 -0
- package/dist/server/services/config.js +1 -0
- package/dist/server/services/scanner.js +1 -0
- package/dist/server/services/search.js +1 -0
- package/dist/server/services/wiki-loader.js +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
var Ah=Object.defineProperty;var $h=(t,e,r)=>e in t?Ah(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Jt=(t,e,r)=>$h(t,typeof e!="symbol"?e+"":e,r);import{bb as Ch,bE as Sh,bF as St}from"./index-BlXRYVPH.js";import{m as Gt,f as wh,d as kh}from"./min-DUZc6_qu.js";import{b as bh,l as _h,c as Nh,m as Ih,r as vc,n as xs}from"./_baseUniq-OYZggmI7.js";function Ph(t,e){return bh(Gt(t,e))}function Oh(t,e){return t&&t.length?_h(t,Nh(e)):[]}function Fe(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function ut(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}function Qt(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}function Lh(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function Jn(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}class Af{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){var i;const r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const n=(i=r.properties[e.property])==null?void 0:i.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){const r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return Fe(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,r)):!1;return n[r]=s,s}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const a of n)this.isSubtype(a,e)&&i.push(a);return this.allSubtypes[e]=i,i}}}function Ii(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function $f(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function Cf(t){return Ii(t)&&typeof t.fullText=="string"}class xe{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const 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(){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){const e=[],r=this.iterator();let 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){const n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new xe(()=>({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 Ze})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=xh(i.value)),a=!0;while(!i.done);return n}indexOf(e,r=0){const n=this.iterator();let i=0,a=n.next();for(;!a.done;){if(i>=r&&a.value===e)return i;a=n.next(),i++}return-1}every(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new xe(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?Ze:{done:!1,value:e(i)}})}filter(e){return new xe(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return Ze})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let i=r,a=n.next();for(;!a.done;)i===void 0?i=a.value:i=e(i,a.value),a=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){const i=e.next();if(i.done)return n;const a=this.recursiveReduce(e,r,n);return a===void 0?i.value:r(a,i.value)}find(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new xe(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:n,value:i}=this.nextFn(r.this);if(!n){const a=e(i);if(Za(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return Ze})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new xe(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:i,value:a}=r.nextFn(n.this);if(!i)if(Za(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return Ze})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new xe(()=>{const 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 xe(()=>({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?Ze:this.nextFn(r.state)))}distinct(e){return new xe(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return Ze})}exclude(e,r){const n=new Set;for(const i of e){const a=r?r(i):i;n.add(a)}return this.filter(i=>{const a=r?r(i):i;return!n.has(a)})}}function xh(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Za(t){return!!t&&typeof t[Symbol.iterator]=="function"}const Sf=new xe(()=>{},()=>Ze),Ze=Object.freeze({done:!0,value:void 0});function de(...t){if(t.length===1){const e=t[0];if(e instanceof xe)return e;if(Za(e))return new xe(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new xe(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:Ze)}return t.length>1?new xe(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const 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){const r=t[e.collIndex++];Za(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return Ze}):Sf}class Jl extends xe{constructor(e,r,n){super(()=>({iterators:n!=null&&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;){const 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 Ze})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var fo;(function(t){function e(a){return a.reduce((s,o)=>s+o,0)}t.sum=e;function r(a){return a.reduce((s,o)=>s*o,0)}t.product=r;function n(a){return a.reduce((s,o)=>Math.min(s,o))}t.min=n;function i(a){return a.reduce((s,o)=>Math.max(s,o))}t.max=i})(fo||(fo={}));function ho(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Fe(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&ho(i,e))}):Fe(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&ho(n,e)))}function vs(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function jt(t){const r=Ma(t).$document;if(!r)throw new Error("AST node has no document.");return r}function Ma(t){for(;t.$container;)t=t.$container;return t}function Ec(t){return ut(t)?t.ref?[t.ref]:[]:Qt(t)?t.items.map(e=>e.ref):[]}function Zl(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new xe(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex<n.keys.length;){const i=n.keys[n.keyIndex];if(!i.startsWith("$")){const a=t[i];if(Fe(a)){if(n.keyIndex++,Ac(a,r))return{done:!1,value:a}}else if(Array.isArray(a)){for(;n.arrayIndex<a.length;){const s=n.arrayIndex++,o=a[s];if(Fe(o)&&Ac(o,r))return{done:!1,value:o}}n.arrayIndex=0}}n.keyIndex++}return Ze})}function qi(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Jl(t,r=>Zl(r,e))}function zt(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Jl(t,r=>Zl(r,e),{includeRoot:!0})}function Ac(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?ip(r,e):!1}function Qa(t){return new xe(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){const r=e.keys[e.keyIndex];if(!r.startsWith("$")){const n=t[r];if(ut(n)||Qt(n))return e.keyIndex++,{done:!1,value:{reference:n,container:t,property:r}};if(Array.isArray(n)){for(;e.arrayIndex<n.length;){const i=e.arrayIndex++,a=n[i];if(ut(a)||Qt(n))return{done:!1,value:{reference:a,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Ze})}function Dh(t,e){const r=t.getTypeMetaData(e.$type),n=e;for(const i of Object.values(r.properties))i.defaultValue!==void 0&&n[i.name]===void 0&&(n[i.name]=wf(i.defaultValue))}function wf(t){return Array.isArray(t)?[...t.map(wf)]:t}const Je={$type:"AbstractElement",cardinality:"cardinality"};function Mh(t){return J.isInstance(t,Je.$type)}const Fa={$type:"AbstractParserRule"};function Bi(t){return J.isInstance(t,Fa.$type)}const ga={$type:"AbstractRule"},ot={$type:"AbstractType"},vr={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Es(t){return J.isInstance(t,vr.$type)}const Ga={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function kf(t){return J.isInstance(t,Ga.$type)}const $c={$type:"ArrayLiteral",elements:"elements"},Cc={$type:"ArrayType",elementType:"elementType"},Er={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function br(t){return J.isInstance(t,Er.$type)}const po={$type:"BooleanLiteral",true:"true"};function Fh(t){return J.isInstance(t,po.$type)}const Ar={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function Gh(t){return J.isInstance(t,Ar.$type)}const Fr={$type:"Condition"},ja={$type:"Conjunction",left:"left",right:"right"};function jh(t){return J.isInstance(t,ja.$type)}const $r={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function As(t){return J.isInstance(t,$r.$type)}const za={$type:"Disjunction",left:"left",right:"right"};function zh(t){return J.isInstance(t,za.$type)}const mo={$type:"EndOfFile",cardinality:"cardinality"};function Uh(t){return J.isInstance(t,mo.$type)}const sr={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"},Sc={$type:"GrammarImport",path:"path"},Br={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Ql(t){return J.isInstance(t,Br.$type)}const go={$type:"InferredType",name:"name"};function bf(t){return J.isInstance(t,go.$type)}const Lt={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function es(t){return J.isInstance(t,Lt.$type)}const Ds={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"},wc={$type:"InfixRuleOperators",precedences:"precedences"},Ei={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function qh(t){return J.isInstance(t,Ei.$type)}const Ai={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function _r(t){return J.isInstance(t,Ai.$type)}const ya={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"},Wr={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Bh(t){return J.isInstance(t,Wr.$type)}const yo={$type:"Negation",value:"value"};function Wh(t){return J.isInstance(t,yo.$type)}const kc={$type:"NumberLiteral",value:"value"},Ta={$type:"Parameter",name:"name"},To={$type:"ParameterReference",parameter:"parameter"};function Vh(t){return J.isInstance(t,To.$type)}const pt={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function Bt(t){return J.isInstance(t,pt.$type)}const Ms={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"},Vr={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function Kh(t){return J.isInstance(t,Vr.$type)}const Ro={$type:"ReturnType",name:"name"};function Hh(t){return J.isInstance(t,Ro.$type)}const Kr={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Nr(t){return J.isInstance(t,Kr.$type)}const $i={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function Xh(t){return J.isInstance(t,$i.$type)}const bc={$type:"StringLiteral",value:"value"},Hr={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Yh(t){return J.isInstance(t,Hr.$type)}const rt={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"},Xr={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Jh(t){return J.isInstance(t,Xr.$type)}const Zt={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function Wt(t){return J.isInstance(t,Zt.$type)}const Yr={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function Zh(t){return J.isInstance(t,Yr.$type)}const Ua={$type:"Type",name:"name",type:"type"};function Qh(t){return J.isInstance(t,Ua.$type)}const Zn={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"},Qn={$type:"TypeDefinition"},_c={$type:"UnionType",types:"types"},qa={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function _f(t){return J.isInstance(t,qa.$type)}const Jr={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function ep(t){return J.isInstance(t,Jr.$type)}const ei={$type:"ValueLiteral"},Ci={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function tp(t){return J.isInstance(t,Ci.$type)}class Nf extends Af{constructor(){super(...arguments),this.types={AbstractElement:{name:Je.$type,properties:{cardinality:{name:Je.cardinality}},superTypes:[]},AbstractParserRule:{name:Fa.$type,properties:{},superTypes:[ga.$type,ot.$type]},AbstractRule:{name:ga.$type,properties:{},superTypes:[]},AbstractType:{name:ot.$type,properties:{},superTypes:[]},Action:{name:vr.$type,properties:{cardinality:{name:vr.cardinality},feature:{name:vr.feature},inferredType:{name:vr.inferredType},operator:{name:vr.operator},type:{name:vr.type,referenceType:ot.$type}},superTypes:[Je.$type]},Alternatives:{name:Ga.$type,properties:{cardinality:{name:Ga.cardinality},elements:{name:Ga.elements,defaultValue:[]}},superTypes:[Je.$type]},ArrayLiteral:{name:$c.$type,properties:{elements:{name:$c.elements,defaultValue:[]}},superTypes:[ei.$type]},ArrayType:{name:Cc.$type,properties:{elementType:{name:Cc.elementType}},superTypes:[Qn.$type]},Assignment:{name:Er.$type,properties:{cardinality:{name:Er.cardinality},feature:{name:Er.feature},operator:{name:Er.operator},predicate:{name:Er.predicate},terminal:{name:Er.terminal}},superTypes:[Je.$type]},BooleanLiteral:{name:po.$type,properties:{true:{name:po.true,defaultValue:!1}},superTypes:[Fr.$type,ei.$type]},CharacterRange:{name:Ar.$type,properties:{cardinality:{name:Ar.cardinality},left:{name:Ar.left},lookahead:{name:Ar.lookahead},parenthesized:{name:Ar.parenthesized,defaultValue:!1},right:{name:Ar.right}},superTypes:[rt.$type]},Condition:{name:Fr.$type,properties:{},superTypes:[]},Conjunction:{name:ja.$type,properties:{left:{name:ja.left},right:{name:ja.right}},superTypes:[Fr.$type]},CrossReference:{name:$r.$type,properties:{cardinality:{name:$r.cardinality},deprecatedSyntax:{name:$r.deprecatedSyntax,defaultValue:!1},isMulti:{name:$r.isMulti,defaultValue:!1},terminal:{name:$r.terminal},type:{name:$r.type,referenceType:ot.$type}},superTypes:[Je.$type]},Disjunction:{name:za.$type,properties:{left:{name:za.left},right:{name:za.right}},superTypes:[Fr.$type]},EndOfFile:{name:mo.$type,properties:{cardinality:{name:mo.cardinality}},superTypes:[Je.$type]},Grammar:{name:sr.$type,properties:{imports:{name:sr.imports,defaultValue:[]},interfaces:{name:sr.interfaces,defaultValue:[]},isDeclared:{name:sr.isDeclared,defaultValue:!1},name:{name:sr.name},rules:{name:sr.rules,defaultValue:[]},types:{name:sr.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:Sc.$type,properties:{path:{name:Sc.path}},superTypes:[]},Group:{name:Br.$type,properties:{cardinality:{name:Br.cardinality},elements:{name:Br.elements,defaultValue:[]},guardCondition:{name:Br.guardCondition},predicate:{name:Br.predicate}},superTypes:[Je.$type]},InferredType:{name:go.$type,properties:{name:{name:go.name}},superTypes:[ot.$type]},InfixRule:{name:Lt.$type,properties:{call:{name:Lt.call},dataType:{name:Lt.dataType},inferredType:{name:Lt.inferredType},name:{name:Lt.name},operators:{name:Lt.operators},parameters:{name:Lt.parameters,defaultValue:[]},returnType:{name:Lt.returnType,referenceType:ot.$type}},superTypes:[Fa.$type]},InfixRuleOperatorList:{name:Ds.$type,properties:{associativity:{name:Ds.associativity},operators:{name:Ds.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:wc.$type,properties:{precedences:{name:wc.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:Ei.$type,properties:{attributes:{name:Ei.attributes,defaultValue:[]},name:{name:Ei.name},superTypes:{name:Ei.superTypes,defaultValue:[],referenceType:ot.$type}},superTypes:[ot.$type]},Keyword:{name:Ai.$type,properties:{cardinality:{name:Ai.cardinality},predicate:{name:Ai.predicate},value:{name:Ai.value}},superTypes:[Je.$type]},NamedArgument:{name:ya.$type,properties:{calledByName:{name:ya.calledByName,defaultValue:!1},parameter:{name:ya.parameter,referenceType:Ta.$type},value:{name:ya.value}},superTypes:[]},NegatedToken:{name:Wr.$type,properties:{cardinality:{name:Wr.cardinality},lookahead:{name:Wr.lookahead},parenthesized:{name:Wr.parenthesized,defaultValue:!1},terminal:{name:Wr.terminal}},superTypes:[rt.$type]},Negation:{name:yo.$type,properties:{value:{name:yo.value}},superTypes:[Fr.$type]},NumberLiteral:{name:kc.$type,properties:{value:{name:kc.value}},superTypes:[ei.$type]},Parameter:{name:Ta.$type,properties:{name:{name:Ta.name}},superTypes:[]},ParameterReference:{name:To.$type,properties:{parameter:{name:To.parameter,referenceType:Ta.$type}},superTypes:[Fr.$type]},ParserRule:{name:pt.$type,properties:{dataType:{name:pt.dataType},definition:{name:pt.definition},entry:{name:pt.entry,defaultValue:!1},fragment:{name:pt.fragment,defaultValue:!1},inferredType:{name:pt.inferredType},name:{name:pt.name},parameters:{name:pt.parameters,defaultValue:[]},returnType:{name:pt.returnType,referenceType:ot.$type}},superTypes:[Fa.$type]},ReferenceType:{name:Ms.$type,properties:{isMulti:{name:Ms.isMulti,defaultValue:!1},referenceType:{name:Ms.referenceType}},superTypes:[Qn.$type]},RegexToken:{name:Vr.$type,properties:{cardinality:{name:Vr.cardinality},lookahead:{name:Vr.lookahead},parenthesized:{name:Vr.parenthesized,defaultValue:!1},regex:{name:Vr.regex}},superTypes:[rt.$type]},ReturnType:{name:Ro.$type,properties:{name:{name:Ro.name}},superTypes:[]},RuleCall:{name:Kr.$type,properties:{arguments:{name:Kr.arguments,defaultValue:[]},cardinality:{name:Kr.cardinality},predicate:{name:Kr.predicate},rule:{name:Kr.rule,referenceType:ga.$type}},superTypes:[Je.$type]},SimpleType:{name:$i.$type,properties:{primitiveType:{name:$i.primitiveType},stringType:{name:$i.stringType},typeRef:{name:$i.typeRef,referenceType:ot.$type}},superTypes:[Qn.$type]},StringLiteral:{name:bc.$type,properties:{value:{name:bc.value}},superTypes:[ei.$type]},TerminalAlternatives:{name:Hr.$type,properties:{cardinality:{name:Hr.cardinality},elements:{name:Hr.elements,defaultValue:[]},lookahead:{name:Hr.lookahead},parenthesized:{name:Hr.parenthesized,defaultValue:!1}},superTypes:[rt.$type]},TerminalElement:{name:rt.$type,properties:{cardinality:{name:rt.cardinality},lookahead:{name:rt.lookahead},parenthesized:{name:rt.parenthesized,defaultValue:!1}},superTypes:[Je.$type]},TerminalGroup:{name:Xr.$type,properties:{cardinality:{name:Xr.cardinality},elements:{name:Xr.elements,defaultValue:[]},lookahead:{name:Xr.lookahead},parenthesized:{name:Xr.parenthesized,defaultValue:!1}},superTypes:[rt.$type]},TerminalRule:{name:Zt.$type,properties:{definition:{name:Zt.definition},fragment:{name:Zt.fragment,defaultValue:!1},hidden:{name:Zt.hidden,defaultValue:!1},name:{name:Zt.name},type:{name:Zt.type}},superTypes:[ga.$type]},TerminalRuleCall:{name:Yr.$type,properties:{cardinality:{name:Yr.cardinality},lookahead:{name:Yr.lookahead},parenthesized:{name:Yr.parenthesized,defaultValue:!1},rule:{name:Yr.rule,referenceType:Zt.$type}},superTypes:[rt.$type]},Type:{name:Ua.$type,properties:{name:{name:Ua.name},type:{name:Ua.type}},superTypes:[ot.$type]},TypeAttribute:{name:Zn.$type,properties:{defaultValue:{name:Zn.defaultValue},isOptional:{name:Zn.isOptional,defaultValue:!1},name:{name:Zn.name},type:{name:Zn.type}},superTypes:[]},TypeDefinition:{name:Qn.$type,properties:{},superTypes:[]},UnionType:{name:_c.$type,properties:{types:{name:_c.types,defaultValue:[]}},superTypes:[Qn.$type]},UnorderedGroup:{name:qa.$type,properties:{cardinality:{name:qa.cardinality},elements:{name:qa.elements,defaultValue:[]}},superTypes:[Je.$type]},UntilToken:{name:Jr.$type,properties:{cardinality:{name:Jr.cardinality},lookahead:{name:Jr.lookahead},parenthesized:{name:Jr.parenthesized,defaultValue:!1},terminal:{name:Jr.terminal}},superTypes:[rt.$type]},ValueLiteral:{name:ei.$type,properties:{},superTypes:[]},Wildcard:{name:Ci.$type,properties:{cardinality:{name:Ci.cardinality},lookahead:{name:Ci.lookahead},parenthesized:{name:Ci.parenthesized,defaultValue:!1}},superTypes:[rt.$type]}}}}const J=new Nf;function vo(t){return new Jl(t,e=>Ii(e)?e.content:[],{includeRoot:!0})}function rp(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function Eo(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function ts(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}var Mt;(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"})(Mt||(Mt={}));function np(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return Mt.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return Mt.After;const 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?Mt.Inside:r?Mt.OverlapBack:n?Mt.OverlapFront:Mt.Outside}function ip(t,e){return np(t,e)>Mt.After}const ap=/^[\w\p{L}]$/u;function sp(t,e){if(t){const r=op(t,!0);if(r&&Nc(r,e))return r;if(Cf(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(Nc(a,e))return a}}}}function Nc(t,e){return $f(t)&&e.includes(t.tokenType.name)}function op(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const i=r.content[n];if(e||!i.hidden)return i}t=r}}class If extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}}function Wi(t,e="Error: Got unexpected value."){throw new Error(e)}function U(t){return t.charCodeAt(0)}function Fs(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function ti(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function Gr(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function lp(){throw Error("Internal Error - Should never get here!")}function Ic(t){return t.type==="Character"}const rs=[];for(let t=U("0");t<=U("9");t++)rs.push(t);const ns=[U("_")].concat(rs);for(let t=U("a");t<=U("z");t++)ns.push(t);for(let t=U("A");t<=U("Z");t++)ns.push(t);const Pc=[U(" "),U("\f"),U(`
|
|
2
|
+
`),U("\r"),U(" "),U("\v"),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U("\u2028"),U("\u2029"),U(" "),U(" "),U(" "),U("\uFEFF")],cp=/[0-9a-fA-F]/,Ra=/[0-9]/,up=/[1-9]/;class Pf{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("/");const r=this.disjunction();this.consumeChar("/");const 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":ti(n,"global");break;case"i":ti(n,"ignoreCase");break;case"m":ti(n,"multiLine");break;case"u":ti(n,"unicode");break;case"y":ti(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(){const 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(){const 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(){const 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}}Gr(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return lp()}quantifier(e=!1){let r;const 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"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),r={atLeast:i,atMost:a}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;Gr(r);break}if(!(e===!0&&r===void 0)&&Gr(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;const 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}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Gr(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[U(`
|
|
3
|
+
`),U("\r"),U("\u2028"),U("\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=rs;break;case"D":e=rs,r=!0;break;case"s":e=Pc;break;case"S":e=Pc,r=!0;break;case"w":e=ns;break;case"W":e=ns,r=!0;break}if(Gr(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=U("\f");break;case"n":e=U(`
|
|
4
|
+
`);break;case"r":e=U("\r");break;case"t":e=U(" ");break;case"v":e=U("\v");break}if(Gr(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const 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:U("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:U(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
5
|
+
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:U(e)}}}characterClass(){const e=[];let r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){const n=this.classAtom();if(n.type,Ic(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,Ic(i)){if(i.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:i.value})}else Fs(n.value,e),e.push(U("-")),Fs(i.value,e)}else Fs(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
|
|
6
|
+
`: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:U("\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;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}const r=this.disjunction();this.consumeChar(")");const n={type:"Group",capturing:e,value:r};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(up.test(e)===!1)throw Error("Expecting a positive integer");for(;Ra.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Ra.test(e)===!1)throw Error("Expecting an integer");for(;Ra.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case`
|
|
7
|
+
`: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:U(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 Ra.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
|
|
8
|
+
`: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(){const 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`
|
|
9
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i<e;i++){const a=this.popChar();if(cp.test(a)===!1)throw Error("Expecting a HexDecimal digits");r+=a}return{type:"Character",value:parseInt(r,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){const 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}}}class $s{visitChildren(e){for(const r in e){const 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){}}const fp=/\r?\n/gm,dp=new Pf;class hp extends $s{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){const r=String.fromCharCode(e.value);if(!this.multiline&&r===`
|
|
10
|
+
`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=Cs(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){const r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!`
|
|
11
|
+
`.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const 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)}}const Gs=new hp;function pp(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),Gs.reset(t),Gs.visit(dp.pattern(t)),Gs.multiline}catch{return!1}}const mp=`\f
|
|
12
|
+
\r \v \u2028\u2029 \uFEFF`.split("");function Of(t){const e=typeof t=="string"?new RegExp(t):t;return mp.some(r=>e.test(r))}function Cs(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gp(t,e){const r=yp(t),n=e.match(r);return!!n&&n[0].length>0}function yp(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let a="",s;function o(c){a+=r.substr(n,c),n+=c}function l(c){a+="(?:"+r.substr(n,c)+"|$)",n+=c}for(;n<r.length;)switch(r[n]){case"\\":switch(r[n+1]){case"c":l(3);break;case"x":l(4);break;case"u":e.unicode?r[n+2]==="{"?l(r.indexOf("}",n)-n+1):l(6):l(2);break;case"p":case"P":e.unicode?l(r.indexOf("}",n)-n+1):l(2);break;case"k":l(r.indexOf(">",n)-n+1);break;default:l(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],l(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?o(s[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":s=n,n+=3,i(),a+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),a+=r.substr(s,n-s);break;default:o(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else o(1),a+=i()+"|$)";break;case")":return++n,a;default:l(1);break}return a}return new RegExp(i(),t.flags)}function Tp(t){return t.rules.find(e=>Bt(e)&&e.entry)}function Rp(t){return t.rules.filter(e=>Wt(e)&&e.hidden)}function Lf(t,e){const r=new Set,n=Tp(t);if(!n)return new Set(t.rules);const i=[n].concat(Rp(t));for(const s of i)xf(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||Wt(s)&&s.hidden)&&a.add(s);return a}function xf(t,e,r){e.add(t.name),qi(t).forEach(n=>{if(Nr(n)||r){const i=n.rule.ref;i&&!e.has(i.name)&&xf(i,e,r)}})}function vp(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=Mf(t.type.ref);return e==null?void 0:e.terminal}}function Ep(t){return t.hidden&&!Of(tc(t))}function Ap(t,e){return!t||!e?[]:ec(t,e,t.astNode,!0)}function Df(t,e,r){if(!t||!e)return;const n=ec(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 ec(t,e,r,n){if(!n){const i=vs(t.grammarSource,br);if(i&&i.feature===e)return[t]}return Ii(t)&&t.astNode===r?t.content.flatMap(i=>ec(i,e,r,!1)):[]}function $p(t,e,r){if(!t)return;const n=Cp(t,e,t==null?void 0: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 Cp(t,e,r){if(t.astNode!==r)return[];if(_r(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=vo(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?_r(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}function Sp(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=vs(t.grammarSource,br);if(n)return n;t=t.container}}function Mf(t){let e=t;return bf(e)&&(Es(e.$container)?e=e.$container.$container:Bi(e.$container)?e=e.$container:Wi(e.$container)),Ff(t,e,new Map)}function Ff(t,e,r){var i;function n(a,s){let o;return vs(a,br)||(o=Ff(s,s,r)),r.set(t,o),o}if(r.has(t))return r.get(t);r.set(t,void 0);for(const a of qi(e)){if(br(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(Nr(a)&&Bt(a.rule.ref))return n(a,a.rule.ref);if(Xh(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}function Gf(t){return jf(t,new Set)}function jf(t,e){if(e.has(t))return!0;e.add(t);for(const r of qi(t))if(Nr(r)){if(!r.rule.ref||Bt(r.rule.ref)&&!jf(r.rule.ref,e)||es(r.rule.ref))return!1}else{if(br(r))return!1;if(Es(r))return!1}return!!t.definition}function zf(t){if(!Wt(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e)return e.name}}}function Pi(t){if(Bi(t))return Bt(t)&&Gf(t)?t.name:zf(t)??t.name;if(qh(t)||Qh(t)||Hh(t))return t.name;if(Es(t)){const e=wp(t);if(e)return e}else if(bf(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function wp(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return Pi(t.type.ref)}function kp(t){var e;return Wt(t)?((e=t.type)==null?void 0:e.name)??"string":zf(t)??t.name}function tc(t){const e={s:!1,i:!1,u:!1},r=On(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}const rc=/[\s\S]/.source;function On(t,e){var r;if(Yh(t))return bp(t);if(Jh(t))return _p(t);if(Gh(t))return Pp(t);if(Zh(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Ut(On(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(Bh(t))return Ip(t);if(ep(t))return Np(t);if(Kh(t)){const n=t.regex.lastIndexOf("/"),i=t.regex.substring(1,n),a=t.regex.substring(n+1);return e&&(e.i=a.includes("i"),e.s=a.includes("s"),e.u=a.includes("u")),Ut(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(tp(t))return Ut(rc,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}, ${(r=t==null?void 0:t.$cstNode)==null?void 0:r.text}`)}}}function bp(t){return Ut(t.elements.map(e=>On(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function _p(t){return Ut(t.elements.map(e=>On(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function Np(t){return Ut(`${rc}*?${On(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function Ip(t){return Ut(`(?!${On(t.terminal)})${rc}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function Pp(t){return t.right?Ut(`[${js(t.left)}-${js(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):Ut(js(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function js(t){return Cs(t.value)}function Ut(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function Op(t){const e=[],r=t.Grammar;for(const n of r.rules)Wt(n)&&Ep(n)&&pp(tc(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:ap}}function Ao(t){console&&console.error&&console.error(`Error: ${t}`)}function Uf(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function qf(t){const e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function Bf(t){function e(){}e.prototype=t;const r=new e;function n(){return typeof r.bar}return n(),n(),t}function Lp(t){return xp(t)?t.LABEL:t.name}function xp(t){return typeof t.LABEL=="string"&&t.LABEL!==""}class Tt{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)})}}class qe extends Tt{constructor(e){super([]),this.idx=1,Object.assign(this,Rt(e))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class Ln extends Tt{constructor(e){super(e.definition),this.orgText="",Object.assign(this,Rt(e))}}class Ve extends Tt{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,Rt(e))}}let Me=class extends Tt{constructor(e){super(e.definition),this.idx=1,Object.assign(this,Rt(e))}};class et extends Tt{constructor(e){super(e.definition),this.idx=1,Object.assign(this,Rt(e))}}class tt extends Tt{constructor(e){super(e.definition),this.idx=1,Object.assign(this,Rt(e))}}class Te extends Tt{constructor(e){super(e.definition),this.idx=1,Object.assign(this,Rt(e))}}class Ke extends Tt{constructor(e){super(e.definition),this.idx=1,Object.assign(this,Rt(e))}}class He extends Tt{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,Rt(e))}}class se{constructor(e){this.idx=1,Object.assign(this,Rt(e))}accept(e){e.visit(this)}}function Dp(t){return t.map(Ba)}function Ba(t){function e(r){return r.map(Ba)}if(t instanceof qe){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return typeof t.label=="string"&&(r.label=t.label),r}else{if(t instanceof Ve)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Me)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof et)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof tt)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Ba(new se({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Ke)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Ba(new se({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Te)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof He)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof se){const r={type:"Terminal",name:t.terminalType.name,label:Lp(t.terminalType),idx:t.idx};typeof t.label=="string"&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=n instanceof RegExp?n.source:n),r}else{if(t instanceof Ln)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}function Rt(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0))}class xn{visit(e){const r=e;switch(r.constructor){case qe:return this.visitNonTerminal(r);case Ve:return this.visitAlternative(r);case Me:return this.visitOption(r);case et:return this.visitRepetitionMandatory(r);case tt:return this.visitRepetitionMandatoryWithSeparator(r);case Ke:return this.visitRepetitionWithSeparator(r);case Te:return this.visitRepetition(r);case He:return this.visitAlternation(r);case se:return this.visitTerminal(r);case Ln: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 Mp(t){return t instanceof Ve||t instanceof Me||t instanceof Te||t instanceof et||t instanceof tt||t instanceof Ke||t instanceof se||t instanceof Ln}function is(t,e=[]){return t instanceof Me||t instanceof Te||t instanceof Ke?!0:t instanceof He?t.definition.some(n=>is(n,e)):t instanceof qe&&e.includes(t)?!1:t instanceof Tt?(t instanceof qe&&e.push(t),t.definition.every(n=>is(n,e))):!1}function Fp(t){return t instanceof He}function mt(t){if(t instanceof qe)return"SUBRULE";if(t instanceof Me)return"OPTION";if(t instanceof He)return"OR";if(t instanceof et)return"AT_LEAST_ONE";if(t instanceof tt)return"AT_LEAST_ONE_SEP";if(t instanceof Ke)return"MANY_SEP";if(t instanceof Te)return"MANY";if(t instanceof se)return"CONSUME";throw Error("non exhaustive match")}class Ss{walk(e,r=[]){e.definition.forEach((n,i)=>{const a=e.definition.slice(i+1);if(n instanceof qe)this.walkProdRef(n,a,r);else if(n instanceof se)this.walkTerminal(n,a,r);else if(n instanceof Ve)this.walkFlat(n,a,r);else if(n instanceof Me)this.walkOption(n,a,r);else if(n instanceof et)this.walkAtLeastOne(n,a,r);else if(n instanceof tt)this.walkAtLeastOneSep(n,a,r);else if(n instanceof Ke)this.walkManySep(n,a,r);else if(n instanceof Te)this.walkMany(n,a,r);else if(n instanceof He)this.walkOr(n,a,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){const i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){const i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){const i=[new Me({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=Oc(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new Me({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=Oc(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);e.definition.forEach(a=>{const s=new Ve({definition:[a]});this.walk(s,i)})}}function Oc(t,e,r){return[new Me({definition:[new se({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function Vi(t){if(t instanceof qe)return Vi(t.referencedRule);if(t instanceof se)return zp(t);if(Mp(t))return Gp(t);if(Fp(t))return jp(t);throw Error("non exhaustive match")}function Gp(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=is(a),e=e.concat(Vi(a)),n=n+1,i=r.length>n;return[...new Set(e)]}function jp(t){const e=t.definition.map(r=>Vi(r));return[...new Set(e.flat())]}function zp(t){return[t.terminalType]}const Wf="_~IN~_";class Up extends Ss{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){const i=Bp(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new Ve({definition:a}),o=Vi(s);this.follows[i]=o}}function qp(t){const e={};return t.forEach(r=>{const n=new Up(r).startWalking();Object.assign(e,n)}),e}function Bp(t,e){return t.name+e+Wf}let Wa={};const Wp=new Pf;function ws(t){const e=t.toString();if(Wa.hasOwnProperty(e))return Wa[e];{const r=Wp.pattern(e);return Wa[e]=r,r}}function Vp(){Wa={}}const Vf="Complement Sets are not supported for first char optimization",as=`Unable to use "first char" lexer optimizations:
|
|
13
|
+
`;function Kp(t,e=!1){try{const r=ws(t);return $o(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===Vf)e&&Uf(`${as} Unable to optimize: < ${t.toString()} >
|
|
14
|
+
Complement Sets cannot be automatically optimized.
|
|
15
|
+
This will disable the lexer's first char optimizations.
|
|
16
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=`
|
|
17
|
+
This will disable the lexer's first char optimizations.
|
|
18
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Ao(`${as}
|
|
19
|
+
Failed parsing: < ${t.toString()} >
|
|
20
|
+
Using the @chevrotain/regexp-to-ast library
|
|
21
|
+
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function $o(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)$o(t.value[i],e,r);break;case"Alternative":const n=t.value;for(let i=0;i<n.length;i++){const a=n[i];switch(a.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"Lookbehind":case"NegativeLookbehind":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const s=a;switch(s.type){case"Character":va(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error(Vf);s.value.forEach(l=>{if(typeof l=="number")va(l,e,r);else{const c=l;if(r===!0)for(let u=c.from;u<=c.to;u++)va(u,e,r);else{for(let u=c.from;u<=c.to&&u<wi;u++)va(u,e,r);if(c.to>=wi){const u=c.from>=wi?c.from:wi,d=c.to,m=er(u),h=er(d);for(let E=m;E<=h;E++)e[E]=E}}}});break;case"Group":$o(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}const o=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&Co(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return Object.values(e)}function va(t,e,r){const n=er(t);e[n]=n,r===!0&&Hp(t,e)}function Hp(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=er(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=er(i.charCodeAt(0));e[a]=a}}}function Lc(t,e){return t.value.find(r=>{if(typeof r=="number")return e.includes(r);{const n=r;return e.find(i=>n.from<=i&&i<=n.to)!==void 0}})}function Co(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Array.isArray(t.value)?t.value.every(Co):Co(t.value):!1}class Xp extends $s{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?Lc(e,this.targetCharCodes)===void 0&&(this.found=!0):Lc(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function nc(t,e){if(e instanceof RegExp){const r=ws(e),n=new Xp(t);return n.visit(r),n.found}else{for(const r of e){const n=r.charCodeAt(0);if(t.includes(n))return!0}return!1}}const Ir="PATTERN",Si="defaultMode",Ea="modes";function Yp(t,e){e=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
22
|
+
`],tracer:(w,S)=>S()},e);const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{vm()});let n;r("Reject Lexer.NA",()=>{n=t.filter(w=>w[Ir]!==We.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=n.map(w=>{const S=w[Ir];if(S instanceof RegExp){const P=S.source;return P.length===1&&P!=="^"&&P!=="$"&&P!=="."&&!S.ignoreCase?P:P.length===2&&P[0]==="\\"&&!["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(P[1])?P[1]:xc(S)}else{if(typeof S=="function")return i=!0,{exec:S};if(typeof S=="object")return i=!0,S;if(typeof S=="string"){if(S.length===1)return S;{const P=S.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),W=new RegExp(P);return xc(W)}}else throw Error("non exhaustive match")}})});let s,o,l,c,u;r("misc mapping",()=>{s=n.map(w=>w.tokenTypeIdx),o=n.map(w=>{const S=w.GROUP;if(S!==We.SKIPPED){if(typeof S=="string")return S;if(S===void 0)return!1;throw Error("non exhaustive match")}}),l=n.map(w=>{const S=w.LONGER_ALT;if(S)return Array.isArray(S)?S.map(W=>n.indexOf(W)):[n.indexOf(S)]}),c=n.map(w=>w.PUSH_MODE),u=n.map(w=>Object.hasOwn(w,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const w=Xf(e.lineTerminatorCharacters);d=n.map(S=>!1),e.positionTracking!=="onlyOffset"&&(d=n.map(S=>Object.hasOwn(S,"LINE_BREAKS")?!!S.LINE_BREAKS:Hf(S,w)===!1&&nc(w,S.PATTERN)))});let m,h,E,b;r("Misc Mapping #2",()=>{m=n.map(Kf),h=a.map(ym),E=n.reduce((w,S)=>{const P=S.GROUP;return typeof P=="string"&&P!==We.SKIPPED&&(w[P]=[]),w},{}),b=a.map((w,S)=>({pattern:a[S],longerAlt:l[S],canLineTerminator:d[S],isCustom:m[S],short:h[S],group:o[S],push:c[S],pop:u[S],tokenTypeIdx:s[S],tokenType:n[S]}))});let I=!0,C=[];return e.safeMode||r("First Char Optimization",()=>{C=n.reduce((w,S,P)=>{if(typeof S.PATTERN=="string"){const W=S.PATTERN.charCodeAt(0),B=er(W);zs(w,B,b[P])}else if(Array.isArray(S.START_CHARS_HINT)){let W;S.START_CHARS_HINT.forEach(B=>{const H=typeof B=="string"?B.charCodeAt(0):B,ne=er(H);W!==ne&&(W=ne,zs(w,ne,b[P]))})}else if(S.PATTERN instanceof RegExp)if(S.PATTERN.unicode)I=!1,e.ensureOptimizations&&Ao(`${as} Unable to analyze < ${S.PATTERN.toString()} > pattern.
|
|
23
|
+
The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
|
24
|
+
This will disable the lexer's first char optimizations.
|
|
25
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const W=Kp(S.PATTERN,e.ensureOptimizations);W.length===0&&(I=!1),W.forEach(B=>{zs(w,B,b[P])})}else e.ensureOptimizations&&Ao(`${as} TokenType: <${S.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
|
|
26
|
+
This will disable the lexer's first char optimizations.
|
|
27
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),I=!1;return w},[])}),{emptyGroups:E,patternIdxToConfig:b,charCodeToPatternIdxToConfig:C,hasCustom:i,canBeOptimized:I}}function Jp(t,e){let r=[];const n=Qp(t);r=r.concat(n.errors);const i=em(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(Zp(a)),r=r.concat(lm(a)),r=r.concat(cm(a,e)),r=r.concat(um(a)),r}function Zp(t){let e=[];const r=t.filter(n=>n[Ir]instanceof RegExp);return e=e.concat(rm(r)),e=e.concat(am(r)),e=e.concat(sm(r)),e=e.concat(om(r)),e=e.concat(nm(r)),e}function Qp(t){const e=t.filter(i=>!Object.hasOwn(i,Ir)),r=e.map(i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Re.MISSING_PATTERN,tokenTypes:[i]})),n=t.filter(i=>!e.includes(i));return{errors:r,valid:n}}function em(t){const e=t.filter(i=>{const a=i[Ir];return!(a instanceof RegExp)&&typeof a!="function"&&!Object.hasOwn(a,"exec")&&typeof a!="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:Re.INVALID_PATTERN,tokenTypes:[i]})),n=t.filter(i=>!e.includes(i));return{errors:r,valid:n}}const tm=/[^\\][$]/;function rm(t){class e extends $s{constructor(){super(...arguments),this.found=!1}visitEndAnchor(a){this.found=!0}}return t.filter(i=>{const a=i.PATTERN;try{const s=ws(a),o=new e;return o.visit(s),o.found}catch{return tm.test(a.source)}}).map(i=>({message:`Unexpected RegExp Anchor Error:
|
|
28
|
+
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
29
|
+
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Re.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function nm(t){return t.filter(n=>n.PATTERN.test("")).map(n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Re.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}const im=/[^\\[][\^]|^\^/;function am(t){class e extends $s{constructor(){super(...arguments),this.found=!1}visitStartAnchor(a){this.found=!0}}return t.filter(i=>{const a=i.PATTERN;try{const s=ws(a),o=new e;return o.visit(s),o.found}catch{return im.test(a.source)}}).map(i=>({message:`Unexpected RegExp Anchor Error:
|
|
30
|
+
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
31
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Re.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function sm(t){return t.filter(n=>{const i=n[Ir];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:Re.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function om(t){const e=[];let r=t.map(a=>t.reduce((s,o)=>(a.PATTERN.source===o.PATTERN.source&&!e.includes(o)&&o.PATTERN!==We.NA&&(e.push(o),s.push(o)),s),[]));return r=r.filter(Boolean),r.filter(a=>a.length>1).map(a=>{const s=a.map(l=>l.name);return{message:`The same RegExp pattern ->${a[0].PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:Re.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}function lm(t){return t.filter(n=>{if(!Object.hasOwn(n,"GROUP"))return!1;const i=n.GROUP;return i!==We.SKIPPED&&i!==We.NA&&typeof i!="string"}).map(n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Re.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function cm(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:Re.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function um(t){const e=[],r=t.reduce((n,i,a)=>{const s=i.PATTERN;return s===We.NA||(typeof s=="string"?n.push({str:s,idx:a,tokenType:i}):s instanceof RegExp&&dm(s)&&n.push({str:s.source,idx:a,tokenType:i})),n},[]);return t.forEach((n,i)=>{r.forEach(({str:a,idx:s,tokenType:o})=>{if(i<s&&fm(a,n.PATTERN)){const l=`Token: ->${o.name}<- can never be matched.
|
|
32
|
+
Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition.
|
|
33
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:Re.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}function fm(t,e){if(e instanceof RegExp){if(hm(e))return!1;const 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 dm(t){return[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(r=>t.source.indexOf(r)!==-1)===void 0}function hm(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(t.source)}function xc(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function pm(t,e,r){const n=[];return Object.hasOwn(t,Si)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Si+`> property in its definition
|
|
34
|
+
`,type:Re.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(t,Ea)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ea+`> property in its definition
|
|
35
|
+
`,type:Re.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(t,Ea)&&Object.hasOwn(t,Si)&&!Object.hasOwn(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${Si}: <${t.defaultMode}>which does not exist
|
|
36
|
+
`,type:Re.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(t,Ea)&&Object.keys(t.modes).forEach(i=>{const a=t.modes[i];a.forEach((s,o)=>{s===void 0?n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${i}> at index: <${o}>
|
|
37
|
+
`,type:Re.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Object.hasOwn(s,"LONGER_ALT")&&(Array.isArray(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT]).forEach(c=>{c!==void 0&&!a.includes(c)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${c.name}> on token <${s.name}> outside of mode <${i}>
|
|
38
|
+
`,type:Re.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),n}function mm(t,e,r){const n=[];let i=!1;const s=Object.values(t.modes||{}).flat().filter(Boolean).filter(l=>l[Ir]!==We.NA),o=Xf(r);return e&&s.forEach(l=>{const c=Hf(l,o);if(c!==!1){const d={message:Rm(l,c),type:c.issue,tokenType:l};n.push(d)}else Object.hasOwn(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):nc(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
|
|
39
|
+
This Lexer has been defined to track line and column information,
|
|
40
|
+
But none of the Token Types can be identified as matching a line terminator.
|
|
41
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
42
|
+
for details.`,type:Re.NO_LINE_BREAKS_FLAGS}),n}function gm(t){const e={};return Object.keys(t).forEach(n=>{const i=t[n];if(Array.isArray(i))e[n]=[];else throw Error("non exhaustive match")}),e}function Kf(t){const 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 ym(t){return typeof t=="string"&&t.length===1?t.charCodeAt(0):!1}const Tm={test:function(t){const e=t.length;for(let r=this.lastIndex;r<e;r++){const 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 Hf(t,e){if(Object.hasOwn(t,"LINE_BREAKS"))return!1;if(t.PATTERN instanceof RegExp){try{nc(e,t.PATTERN)}catch(r){return{issue:Re.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(typeof t.PATTERN=="string")return!1;if(Kf(t))return{issue:Re.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function Rm(t,e){if(e.issue===Re.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|
43
|
+
The problem is in the <${t.name}> Token Type
|
|
44
|
+
Root cause: ${e.errMsg}.
|
|
45
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===Re.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
46
|
+
The problem is in the <${t.name}> Token Type
|
|
47
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function Xf(t){return t.map(r=>typeof r=="string"?r.charCodeAt(0):r)}function zs(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}const wi=256;let Va=[];function er(t){return t<wi?t:Va[t]}function vm(){if(Va.length===0){Va=new Array(65536);for(let t=0;t<65536;t++)Va[t]=t>255?255+~~(t/255):t}}function Ki(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function ss(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let Dc=1;const Yf={};function Hi(t){const e=Em(t);Am(e),Cm(e),$m(e),e.forEach(r=>{r.isParent=r.categoryMatches.length>0})}function Em(t){let e=[...t],r=t,n=!0;for(;n;){r=r.map(a=>a.CATEGORIES).flat().filter(Boolean);const i=r.filter(a=>!e.includes(a));e=e.concat(i),i.length===0?n=!1:r=i}return e}function Am(t){t.forEach(e=>{Zf(e)||(Yf[Dc]=e,e.tokenTypeIdx=Dc++),Mc(e)&&!Array.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Mc(e)||(e.CATEGORIES=[]),Sm(e)||(e.categoryMatches=[]),wm(e)||(e.categoryMatchesMap={})})}function $m(t){t.forEach(e=>{e.categoryMatches=[],Object.keys(e.categoryMatchesMap).forEach(r=>{e.categoryMatches.push(Yf[r].tokenTypeIdx)})})}function Cm(t){t.forEach(e=>{Jf([],e)})}function Jf(t,e){t.forEach(r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),e.CATEGORIES.forEach(r=>{const n=t.concat(e);n.includes(r)||Jf(n,r)})}function Zf(t){return Object.hasOwn(t??{},"tokenTypeIdx")}function Mc(t){return Object.hasOwn(t??{},"CATEGORIES")}function Sm(t){return Object.hasOwn(t??{},"categoryMatches")}function wm(t){return Object.hasOwn(t??{},"categoryMatchesMap")}function km(t){return Object.hasOwn(t??{},"tokenTypeIdx")}const So={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,a){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}};var Re;(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"})(Re||(Re={}));const ki={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
48
|
+
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:So,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(ki);class We{constructor(e,r=ki){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,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${s}--> <${i}>`);const{time:o,value:l}=qf(a),c=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&c(`${s}<-- <${i}> time: ${o}ms`),this.traceInitIndent--,l}else return a()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
49
|
+
a boolean 2nd argument is no longer supported`);this.config=Object.assign({},ki,r);const 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,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===ki.lineTerminatorsPattern)this.config.lineTerminatorsPattern=Tm;else if(this.config.lineTerminatorCharacters===ki.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
50
|
+
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:Si}:(a=!1,i=Object.assign({},e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(pm(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(mm(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},Object.entries(i.modes).forEach(([o,l])=>{i.modes[o]=l.filter(c=>c!==void 0)});const s=Object.keys(i.modes);if(Object.entries(i.modes).forEach(([o,l])=>{this.TRACE_INIT(`Mode: <${o}> processing`,()=>{if(this.modes.push(o),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Jp(l,s))}),this.lexerDefinitionErrors.length===0){Hi(l);let c;this.TRACE_INIT("analyzeTokenTypes",()=>{c=Yp(l,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[o]=c.patternIdxToConfig,this.charCodeToPatternIdxToConfig[o]=c.charCodeToPatternIdxToConfig,this.emptyGroups=Object.assign({},this.emptyGroups,c.emptyGroups),this.hasCustom=c.hasCustom||this.hasCustom,this.canModeBeOptimized[o]=c.canBeOptimized}})}),this.defaultMode=i.defaultMode,this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){const l=this.lexerDefinitionErrors.map(c=>c.message).join(`-----------------------
|
|
51
|
+
`);throw new Error(`Errors detected in definition of Lexer:
|
|
52
|
+
`+l)}this.lexerDefinitionWarning.forEach(o=>{Uf(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=()=>{}),this.trackStartLines===!1&&(this.computeNewColumn=o=>o),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",()=>{const o=Object.entries(this.canModeBeOptimized).reduce((l,[c,u])=>(u===!1&&l.push(c),l),[]);if(r.ensureOptimizations&&o.length>0)throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized.
|
|
53
|
+
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
54
|
+
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Vp()}),this.TRACE_INIT("toFastProperties",()=>{Bf(this)})})}tokenize(e,r=this.defaultMode){if(this.lexerDefinitionErrors.length>0){const i=this.lexerDefinitionErrors.map(a=>a.message).join(`-----------------------
|
|
55
|
+
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
56
|
+
`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,a,s,o,l,c,u,d,m,h,E,b,I,C;const w=e,S=w.length;let P=0,W=0;const B=this.hasCustom?0:Math.floor(e.length/10),H=new Array(B),ne=[];let oe=this.trackStartLines?1:void 0,le=this.trackStartLines?1:void 0;const _=gm(this.emptyGroups),R=this.trackStartLines,g=this.config.lineTerminatorsPattern;let $=0,y=[],T=[];const A=[],L=[];Object.freeze(L);let D=!1;const x=z=>{if(A.length===1&&z.tokenType.PUSH_MODE===void 0){const Q=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(z);ne.push({offset:z.startOffset,line:z.startLine,column:z.startColumn,length:z.image.length,message:Q})}else{A.pop();const Q=A.at(-1);y=this.patternIdxToConfig[Q],T=this.charCodeToPatternIdxToConfig[Q],$=y.length;const Ne=this.canModeBeOptimized[Q]&&this.config.safeMode===!1;T&&Ne?D=!0:D=!1}};function j(z){A.push(z),T=this.charCodeToPatternIdxToConfig[z],y=this.patternIdxToConfig[z],$=y.length,$=y.length;const Q=this.canModeBeOptimized[z]&&this.config.safeMode===!1;T&&Q?D=!0:D=!1}j.call(this,r);let F;const te=this.config.recoveryEnabled;for(;P<S;){l=null,d=-1;const z=w.charCodeAt(P);let Q;if(D){const ge=er(z),ce=T[ge];Q=ce!==void 0?ce:L}else Q=y;const Ne=Q.length;for(n=0;n<Ne;n++){F=Q[n];const ge=F.pattern;c=null;const ce=F.short;if(ce!==!1?z===ce&&(d=1,l=ge):F.isCustom===!0?(C=ge.exec(w,P,H,_),C!==null?(l=C[0],d=l.length,C.payload!==void 0&&(c=C.payload)):l=null):(ge.lastIndex=P,d=this.matchLength(ge,e,P)),d!==-1){if(o=F.longerAlt,o!==void 0){l=e.substring(P,P+d);const ke=o.length;for(a=0;a<ke;a++){const Ie=y[o[a]],Ce=Ie.pattern;if(u=null,Ie.isCustom===!0?(C=Ce.exec(w,P,H,_),C!==null?(s=C[0],C.payload!==void 0&&(u=C.payload)):s=null):(Ce.lastIndex=P,s=this.match(Ce,e,P)),s&&s.length>l.length){l=s,d=s.length,c=u,F=Ie;break}}}break}}if(d!==-1){if(m=F.group,m!==void 0&&(l=l!==null?l:e.substring(P,P+d),h=F.tokenTypeIdx,E=this.createTokenInstance(l,P,h,F.tokenType,oe,le,d),this.handlePayload(E,c),m===!1?W=this.addToken(H,W,E):_[m].push(E)),R===!0&&F.canLineTerminator===!0){let ge=0,ce,ke;g.lastIndex=0;do l=l!==null?l:e.substring(P,P+d),ce=g.test(l),ce===!0&&(ke=g.lastIndex-1,ge++);while(ce===!0);ge!==0?(oe=oe+ge,le=d-ke,this.updateTokenEndLineColumnLocation(E,m,ke,ge,oe,le,d)):le=this.computeNewColumn(le,d)}else le=this.computeNewColumn(le,d);P=P+d,this.handleModes(F,x,j,E)}else{const ge=P,ce=oe,ke=le;let Ie=te===!1;for(;Ie===!1&&P<S;)for(P++,i=0;i<$;i++){const Ce=y[i],Y=Ce.pattern,Xe=Ce.short;if(Xe!==!1?w.charCodeAt(P)===Xe&&(Ie=!0):Ce.isCustom===!0?Ie=Y.exec(w,P,H,_)!==null:(Y.lastIndex=P,Ie=Y.exec(e)!==null),Ie===!0)break}if(b=P-ge,le=this.computeNewColumn(le,b),I=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(w,ge,b,ce,ke,A.at(-1)),ne.push({offset:ge,line:ce,column:ke,length:b,message:I}),te===!1)break}}return this.hasCustom||(H.length=W),{tokens:H,groups:_,errors:ne}}handleModes(e,r,n,i){if(e.pop===!0){const a=e.push;r(i),a!==void 0&&n.call(this,a)}else e.push!==void 0&&n.call(this,e.push)}updateTokenEndLineColumnLocation(e,r,n,i,a,s,o){let l,c;r!==void 0&&(l=n===o-1,c=l?-1:0,i===1&&l===!0||(e.endLine=a+c,e.endColumn=s-1+-c))}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,a,s){return{image:e,startOffset:r,startLine:a,startColumn:s,tokenTypeIdx:n,tokenType:i}}createFullToken(e,r,n,i,a,s,o){return{image:e,startOffset:r,endOffset:r+o-1,startLine:a,endLine:a,startColumn:s,endColumn:s+o-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}}We.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.";We.NA=/NOT_APPLICABLE/;function sn(t){return Qf(t)?t.LABEL:t.name}function Qf(t){return typeof t.LABEL=="string"&&t.LABEL!==""}const bm="parent",Fc="categories",Gc="label",jc="group",zc="push_mode",Uc="pop_mode",qc="longer_alt",Bc="line_breaks",Wc="start_chars_hint";function ed(t){return _m(t)}function _m(t){const e=t.pattern,r={};if(r.name=t.name,e!==void 0&&(r.PATTERN=e),Object.hasOwn(t,bm))throw`The parent property is no longer supported.
|
|
57
|
+
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Object.hasOwn(t,Fc)&&(r.CATEGORIES=t[Fc]),Hi([r]),Object.hasOwn(t,Gc)&&(r.LABEL=t[Gc]),Object.hasOwn(t,jc)&&(r.GROUP=t[jc]),Object.hasOwn(t,Uc)&&(r.POP_MODE=t[Uc]),Object.hasOwn(t,zc)&&(r.PUSH_MODE=t[zc]),Object.hasOwn(t,qc)&&(r.LONGER_ALT=t[qc]),Object.hasOwn(t,Bc)&&(r.LINE_BREAKS=t[Bc]),Object.hasOwn(t,Wc)&&(r.START_CHARS_HINT=t[Wc]),r}const tr=ed({name:"EOF",pattern:We.NA});Hi([tr]);function ic(t,e,r,n,i,a,s,o){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:a,startColumn:s,endColumn:o,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function td(t,e){return Ki(t,e)}const nn={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${Qf(t)?`--> ${sn(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}){const a="Expecting: ",o=`
|
|
58
|
+
but found: '`+e[0].image+"'";if(n)return a+n+o;{const d=`one of these possible Token sequences:
|
|
59
|
+
${t.reduce((m,h)=>m.concat(h),[]).map(m=>`[${m.map(h=>sn(h)).join(", ")}]`).map((m,h)=>` ${h+1}. ${m}`).join(`
|
|
60
|
+
`)}`;return a+d+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){const i="Expecting: ",s=`
|
|
61
|
+
but found: '`+e[0].image+"'";if(r)return i+r+s;{const l=`expecting at least one iteration which starts with one of these possible Token sequences::
|
|
62
|
+
<${t.map(c=>`[${c.map(u=>sn(u)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(nn);const Nm={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
|
|
63
|
+
inside top level rule: ->`+t.name+"<-"}},wr={buildDuplicateFoundError(t,e){function r(u){return u instanceof se?u.terminalType.name:u instanceof qe?u.nonTerminalName:""}const n=t.name,i=e[0],a=i.idx,s=mt(i),o=r(i),l=a>0;let c=`->${s}${l?a:""}<- ${o?`with argument: ->${o}<-`:""}
|
|
64
|
+
appears more than once (${e.length} times) in the top level rule: ->${n}<-.
|
|
65
|
+
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
66
|
+
`;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,`
|
|
67
|
+
`),c},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.
|
|
68
|
+
The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
|
|
69
|
+
To resolve this make sure each Terminal and Non-Terminal names are unique
|
|
70
|
+
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
|
|
71
|
+
and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=t.prefixPath.map(i=>sn(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
|
|
72
|
+
in <OR${r}> inside <${t.topLevelRule.name}> Rule,
|
|
73
|
+
<${e}> may appears as a prefix path in all these alternatives.
|
|
74
|
+
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
|
|
75
|
+
For Further details.`},buildAlternationAmbiguityError(t){const e=t.alternation.idx===0?"":t.alternation.idx,r=t.prefixPath.length===0;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${e}> inside <${t.topLevelRule.name}> Rule,
|
|
76
|
+
`;if(r)n+=`These alternatives are all empty (match no tokens), making them indistinguishable.
|
|
77
|
+
Only the last alternative may be empty.
|
|
78
|
+
`;else{const i=t.prefixPath.map(a=>sn(a)).join(", ");n+=`<${i}> may appears as a prefix path in all these alternatives.
|
|
79
|
+
`}return n+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
80
|
+
For Further details.`,n},buildEmptyRepetitionError(t){let e=mt(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
|
|
81
|
+
This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
|
|
82
|
+
Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
|
|
83
|
+
<OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
|
|
84
|
+
has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,r=t.leftRecursionPath.map(a=>a.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
|
|
85
|
+
rule: <${e}> can be invoked from itself (directly or indirectly)
|
|
86
|
+
without consuming any Tokens. The grammar path that causes this is:
|
|
87
|
+
${n}
|
|
88
|
+
To fix this refactor your grammar to remove the left recursion.
|
|
89
|
+
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Ln?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function Im(t,e){const r=new Pm(t,e);return r.resolveRefs(),r.errors}class Pm extends xn{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){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:Be.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class Om extends Ss{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){const 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())}}class Lm extends Om{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){const i=r.concat(n),a=new Ve({definition:i});this.possibleTokTypes=Vi(a),this.found=!0}}}class ks extends Ss{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}}class xm extends ks{walkMany(e,r,n){if(e.idx===this.occurrence){const i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof se&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}}class Vc extends ks{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof se&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}}class Dm extends ks{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof se&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}}class Kc extends ks{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=r.concat(n)[0];this.result.isEndOfRule=i===void 0,i instanceof se&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}}function wo(t,e,r=[]){r=[...r];let n=[],i=0;function a(o){return o.concat(t.slice(i+1))}function s(o){const l=wo(a(o),e,r);return n.concat(l)}for(;r.length<e&&i<t.length;){const o=t[i];if(o instanceof Ve)return s(o.definition);if(o instanceof qe)return s(o.definition);if(o instanceof Me)n=s(o.definition);else if(o instanceof et){const l=o.definition.concat([new Te({definition:o.definition})]);return s(l)}else if(o instanceof tt){const l=[new Ve({definition:o.definition}),new Te({definition:[new se({terminalType:o.separator})].concat(o.definition)})];return s(l)}else if(o instanceof Ke){const l=o.definition.concat([new Te({definition:[new se({terminalType:o.separator})].concat(o.definition)})]);n=s(l)}else if(o instanceof Te){const l=o.definition.concat([new Te({definition:o.definition})]);n=s(l)}else{if(o instanceof He)return o.definition.forEach(l=>{l.definition.length!==0&&(n=s(l.definition))}),n;if(o instanceof se)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:t.slice(i)}),n}function Mm(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const l=e.length,c=l-n-1,u=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});d.length!==0;){const m=d.pop();if(m===s){o&&d.at(-1).idx<=c&&d.pop();continue}const h=m.def,E=m.idx,b=m.ruleStack,I=m.occurrenceStack;if(h.length===0)continue;const C=h[0];if(C===i){const w={idx:E,def:h.slice(1),ruleStack:b.slice(0,-1),occurrenceStack:I.slice(0,-1)};d.push(w)}else if(C instanceof se)if(E<l-1){const w=E+1,S=e[w];if(r(S,C.terminalType)){const P={idx:w,def:h.slice(1),ruleStack:b,occurrenceStack:I};d.push(P)}}else if(E===l-1)u.push({nextTokenType:C.terminalType,nextTokenOccurrence:C.idx,ruleStack:b,occurrenceStack:I}),o=!0;else throw Error("non exhaustive match");else if(C instanceof qe){const w=[...b];w.push(C.nonTerminalName);const S=[...I];S.push(C.idx);const P={idx:E,def:C.definition.concat(a,h.slice(1)),ruleStack:w,occurrenceStack:S};d.push(P)}else if(C instanceof Me){const w={idx:E,def:h.slice(1),ruleStack:b,occurrenceStack:I};d.push(w),d.push(s);const S={idx:E,def:C.definition.concat(h.slice(1)),ruleStack:b,occurrenceStack:I};d.push(S)}else if(C instanceof et){const w=new Te({definition:C.definition,idx:C.idx}),S=C.definition.concat([w],h.slice(1)),P={idx:E,def:S,ruleStack:b,occurrenceStack:I};d.push(P)}else if(C instanceof tt){const w=new se({terminalType:C.separator}),S=new Te({definition:[w].concat(C.definition),idx:C.idx}),P=C.definition.concat([S],h.slice(1)),W={idx:E,def:P,ruleStack:b,occurrenceStack:I};d.push(W)}else if(C instanceof Ke){const w={idx:E,def:h.slice(1),ruleStack:b,occurrenceStack:I};d.push(w),d.push(s);const S=new se({terminalType:C.separator}),P=new Te({definition:[S].concat(C.definition),idx:C.idx}),W=C.definition.concat([P],h.slice(1)),B={idx:E,def:W,ruleStack:b,occurrenceStack:I};d.push(B)}else if(C instanceof Te){const w={idx:E,def:h.slice(1),ruleStack:b,occurrenceStack:I};d.push(w),d.push(s);const S=new Te({definition:C.definition,idx:C.idx}),P=C.definition.concat([S],h.slice(1)),W={idx:E,def:P,ruleStack:b,occurrenceStack:I};d.push(W)}else if(C instanceof He)for(let w=C.definition.length-1;w>=0;w--){const S=C.definition[w],P={idx:E,def:S.definition.concat(h.slice(1)),ruleStack:b,occurrenceStack:I};d.push(P),d.push(s)}else if(C instanceof Ve)d.push({idx:E,def:C.definition.concat(h.slice(1)),ruleStack:b,occurrenceStack:I});else if(C instanceof Ln)d.push(Fm(C,E,b,I));else throw Error("non exhaustive match")}return u}function Fm(t,e,r,n){const i=[...r];i.push(t.name);const a=[...n];return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}var he;(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"})(he||(he={}));function ac(t){if(t instanceof Me||t==="Option")return he.OPTION;if(t instanceof Te||t==="Repetition")return he.REPETITION;if(t instanceof et||t==="RepetitionMandatory")return he.REPETITION_MANDATORY;if(t instanceof tt||t==="RepetitionMandatoryWithSeparator")return he.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof Ke||t==="RepetitionWithSeparator")return he.REPETITION_WITH_SEPARATOR;if(t instanceof He||t==="Alternation")return he.ALTERNATION;throw Error("non exhaustive match")}function Hc(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=ac(n);return a===he.ALTERNATION?bs(e,r,i):_s(e,r,a,i)}function Gm(t,e,r,n,i,a){const s=bs(t,e,r),o=id(s)?ss:Ki;return a(s,n,o,i)}function jm(t,e,r,n,i,a){const s=_s(t,e,i,r),o=id(s)?ss:Ki;return a(s[0],o,n)}function zm(t,e,r,n){const i=t.length,a=t.every(s=>s.every(o=>o.length===1));if(e)return function(s){const o=s.map(l=>l.GATE);for(let l=0;l<i;l++){const c=t[l],u=c.length,d=o[l];if(!(d!==void 0&&d.call(this)===!1))e:for(let m=0;m<u;m++){const h=c[m],E=h.length;for(let b=0;b<E;b++){const I=this.LA_FAST(b+1);if(r(I,h[b])===!1)continue e}return l}}};if(a&&!n){const o=t.map(l=>l.flat()).reduce((l,c,u)=>(c.forEach(d=>{d.tokenTypeIdx in l||(l[d.tokenTypeIdx]=u),d.categoryMatches.forEach(m=>{Object.hasOwn(l,m)||(l[m]=u)})}),l),{});return function(){const l=this.LA_FAST(1);return o[l.tokenTypeIdx]}}else return function(){for(let s=0;s<i;s++){const o=t[s],l=o.length;e:for(let c=0;c<l;c++){const u=o[c],d=u.length;for(let m=0;m<d;m++){const h=this.LA_FAST(m+1);if(r(h,u[m])===!1)continue e}return s}}}}function Um(t,e,r){const n=t.every(a=>a.length===1),i=t.length;if(n&&!r){const a=t.flat();if(a.length===1&&a[0].categoryMatches.length===0){const o=a[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===o}}else{const s=a.reduce((o,l,c)=>(o[l.tokenTypeIdx]=!0,l.categoryMatches.forEach(u=>{o[u]=!0}),o),[]);return function(){const o=this.LA_FAST(1);return s[o.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;a<i;a++){const s=t[a],o=s.length;for(let l=0;l<o;l++){const c=this.LA_FAST(l+1);if(e(c,s[l])===!1)continue e}return!0}return!1}}class qm extends Ss{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,he.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,he.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,he.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,he.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,he.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}}class rd extends xn{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,he.OPTION)}visitRepetition(e){this.checkIsTarget(e,he.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,he.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,he.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,he.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,he.ALTERNATION)}}function Xc(t){const e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function Us(t){let e=[""];for(let r=0;r<t.length;r++){const n=t[r],i=[];for(let a=0;a<e.length;a++){const s=e[a];i.push(s+"_"+n.tokenTypeIdx);for(let o=0;o<n.categoryMatches.length;o++){const l="_"+n.categoryMatches[o];i.push(s+l)}}e=i}return e}function Bm(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;const i=t[n];for(let a=0;a<e.length;a++){const s=e[a];if(i[s]===!0)return!1}}return!0}function nd(t,e){const r=t.map(s=>wo([s],1)),n=Xc(r.length),i=r.map(s=>{const o={};return s.forEach(l=>{Us(l.partialPath).forEach(u=>{o[u]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=Xc(o.length);for(let l=0;l<o.length;l++){const c=o[l];for(let u=0;u<c.length;u++){const d=c[u].partialPath,m=c[u].suffixDef,h=Us(d);if(Bm(i,h,l)||m.length===0||d.length===e){const b=n[l];if(ko(b,d)===!1){b.push(d);for(let I=0;I<h.length;I++){const C=h[I];i[l][C]=!0}}}else{const b=wo(m,s+1,d);a[l]=a[l].concat(b),b.forEach(I=>{Us(I.partialPath).forEach(w=>{i[l][w]=!0})})}}}}return n}function bs(t,e,r,n){const i=new rd(t,he.ALTERNATION,n);return e.accept(i),nd(i.result,r)}function _s(t,e,r,n){const i=new rd(t,r);e.accept(i);const a=i.result,o=new qm(e,t,r).startWalking(),l=new Ve({definition:a}),c=new Ve({definition:o});return nd([l,c],n)}function ko(t,e){e:for(let r=0;r<t.length;r++){const n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){const a=e[i],s=n[i];if((a===s||s.categoryMatchesMap[a.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function Wm(t,e){return t.length<e.length&&t.every((r,n)=>{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function id(t){return t.every(e=>e.every(r=>r.every(n=>n.categoryMatches.length===0)))}function Vm(t){return t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName}).map(r=>Object.assign({type:Be.CUSTOM_LOOKAHEAD_VALIDATION},r))}function Km(t,e,r,n){const i=t.flatMap(l=>Hm(l,r)),a=sg(t,e,r),s=t.flatMap(l=>rg(l,r)),o=t.flatMap(l=>Jm(l,t,n,r));return i.concat(a,s,o)}function Hm(t,e){const r=new Ym;t.accept(r);const n=r.allProductions,i=Object.groupBy(n,Xm),a=Object.fromEntries(Object.entries(i).filter(([o,l])=>l.length>1));return Object.values(a).map(o=>{const l=o[0],c=e.buildDuplicateFoundError(t,o),u=mt(l),d={message:c,type:Be.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:u,occurrence:l.idx},m=ad(l);return m&&(d.parameter=m),d})}function Xm(t){return`${mt(t)}_#_${t.idx}_#_${ad(t)}`}function ad(t){return t instanceof se?t.terminalType.name:t instanceof qe?t.nonTerminalName:""}class Ym extends xn{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 Jm(t,e,r,n){const i=[];if(e.reduce((s,o)=>o.name===t.name?s+1:s,0)>1){const s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:Be.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function Zm(t,e,r){const n=[];let 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:Be.INVALID_RULE_OVERRIDE,ruleName:t})),n}function sd(t,e,r,n=[]){const i=[],a=Ka(e.definition);if(a.length===0)return[];{const s=t.name;a.includes(t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:Be.LEFT_RECURSION,ruleName:s});const l=n.concat([t]),u=a.filter(d=>!l.includes(d)).flatMap(d=>{const m=[...n];return m.push(d),sd(t,d,r,m)});return i.concat(u)}}function Ka(t){let e=[];if(t.length===0)return e;const r=t[0];if(r instanceof qe)e.push(r.referencedRule);else if(r instanceof Ve||r instanceof Me||r instanceof et||r instanceof tt||r instanceof Ke||r instanceof Te)e=e.concat(Ka(r.definition));else if(r instanceof He)e=r.definition.map(a=>Ka(a.definition)).flat();else if(!(r instanceof se))throw Error("non exhaustive match");const n=is(r),i=t.length>1;if(n&&i){const a=t.slice(1);return e.concat(Ka(a))}else return e}class sc extends xn{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function Qm(t,e){const r=new sc;return t.accept(r),r.alternations.flatMap(a=>a.definition.slice(0,-1).flatMap((o,l)=>Mm([o],[],Ki,1).length===0?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:Be.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]))}function eg(t,e,r){const n=new sc;t.accept(n);let i=n.alternations;return i=i.filter(s=>s.ignoreAmbiguities!==!0),i.flatMap(s=>{const o=s.idx,l=s.maxLookahead||e,c=bs(o,t,l,s),u=ig(c,s,t,r),d=ag(c,s,t,r);return u.concat(d)})}class tg extends xn{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 rg(t,e){const r=new sc;return t.accept(r),r.alternations.flatMap(a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:Be.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}function ng(t,e,r){const n=[];return t.forEach(i=>{const a=new tg;i.accept(a),a.allProductions.forEach(o=>{const l=ac(o),c=o.maxLookahead||e,u=o.idx;if(_s(u,i,l,c)[0].flat().length===0){const h=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:h,type:Be.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function ig(t,e,r,n){const i=[];return t.reduce((o,l,c)=>(e.definition[c].ignoreAmbiguities===!0||l.forEach(u=>{const d=[c];t.forEach((m,h)=>{c!==h&&ko(m,u)&&e.definition[h].ignoreAmbiguities!==!0&&d.push(h)}),d.length>1&&!ko(i,u)&&(i.push(u),o.push({alts:d,path:u}))}),o),[]).map(o=>{const l=o.alts.map(u=>u+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:Be.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}function ag(t,e,r,n){const i=t.reduce((s,o,l)=>{const c=o.map(u=>({idx:l,path:u}));return s.concat(c)},[]);return i.flatMap(s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];const l=s.idx,c=s.path;return i.filter(m=>e.definition[m.idx].ignoreAmbiguities!==!0&&m.idx<l&&Wm(m.path,c)).map(m=>{const h=[m.idx+1,l+1],E=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:h,prefixPath:m.path}),type:Be.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:E,alternatives:h}})})}function sg(t,e,r){const n=[],i=e.map(a=>a.name);return t.forEach(a=>{const s=a.name;if(i.includes(s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:Be.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function og(t){const e=Object.assign({errMsgProvider:Nm},t),r={};return t.rules.forEach(n=>{r[n.name]=n}),Im(r,e.errMsgProvider)}function lg(t){var e;const r=(e=t.errMsgProvider)!==null&&e!==void 0?e:wr;return Km(t.rules,t.tokenTypes,r,t.grammarName)}const od="MismatchedTokenException",ld="NoViableAltException",cd="EarlyExitException",ud="NotAllInputParsedException",fd=[od,ld,cd,ud];Object.freeze(fd);function os(t){return fd.includes(t.name)}class Ns 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)}}class dd extends Ns{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=od}}class cg extends Ns{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=ld}}class ug extends Ns{constructor(e,r){super(e,r),this.name=ud}}class fg extends Ns{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=cd}}const qs={},hd="InRuleRecoveryException";class dg extends Error{constructor(e){super(e),this.name=hd}}class hg{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:qt.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=pg)}getTokenToInsert(e){const r=ic(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){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let l=!1;const c=this.LA_FAST(1);let u=this.LA_FAST(1);const d=()=>{const m=this.LA(0),h=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:c,previous:m,ruleName:this.getCurrRuleFullName()}),E=new dd(h,c,this.LA(0));E.resyncedTokens=o.slice(0,-1),this.SAVE_ERROR(E)};for(;!l;)if(this.tokenMatcher(u,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(u,a)?l=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o));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){const r=e.ruleStack[0],i=this.getGAstProductions()[r];return new Lm(i,e).startWalking()}getFollowsForInRuleRecovery(e,r){const 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)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new dg("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;const n=this.LA_FAST(1);return r.find(a=>this.tokenMatcher(n,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey();return this.getFollowSetFromFollowKey(r).includes(e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA_FAST(1),n=2;for(;;){const i=e.find(a=>td(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK_IDX===0)return qs;const e=this.currRuleShortName,r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK,n=this.RULE_STACK_IDX+1,i=new Array(n);for(let a=0;a<n;a++)a===0?i[a]=qs:i[a]={ruleName:this.shortRuleNameToFullName(e[a]),idxInCallingRule:r[a],inRule:this.shortRuleNameToFullName(e[a-1])};return i}flattenFollowSet(){return this.buildFullFollowKeyStack().map(r=>this.getFollowSetFromFollowKey(r)).flat()}getFollowSetFromFollowKey(e){if(e===qs)return[tr];const r=e.ruleName+e.idxInCallingRule+Wf+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,tr)||r.push(e),r}reSyncTo(e){const r=[];let 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,a,s,o){}getCurrentGrammarPath(e,r){const 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(){const 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 pg(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const m=this.getCurrRuleFullName(),h=this.getGAstProductions()[m];l=new a(h,i).startWalking(),this.firstAfterRepMap[o]=l}let c=l.token,u=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK_IDX===0&&d&&c===void 0&&(c=tr,u=1),!(c===void 0||u===void 0)&&this.shouldInRepetitionRecoveryBeTried(c,u,s)&&this.tryInRepetitionRecovery(t,e,r,c)}const mg=4,nr=8,pd=1<<nr,md=2<<nr,bo=3<<nr,_o=4<<nr,No=5<<nr,Ha=6<<nr;function Bs(t,e,r){return r|e|t}class oc{constructor(e){var r;this.maxLookahead=(r=e==null?void 0:e.maxLookahead)!==null&&r!==void 0?r:qt.maxLookahead}validate(e){const r=this.validateNoLeftRecursion(e.rules);if(r.length===0){const n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),a=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...a]}return r}validateNoLeftRecursion(e){return e.flatMap(r=>sd(r,r,wr))}validateEmptyOrAlternatives(e){return e.flatMap(r=>Qm(r,wr))}validateAmbiguousAlternationAlternatives(e,r){return e.flatMap(n=>eg(n,r,wr))}validateSomeNonEmptyLookaheadPath(e,r){return ng(e,r,wr)}buildLookaheadForAlternation(e){return Gm(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,zm)}buildLookaheadForOptional(e){return jm(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,ac(e.prodType),Um)}}class gg{initLooksAhead(e){this.dynamicTokensEnabled=Object.hasOwn(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:qt.dynamicTokensEnabled,this.maxLookahead=Object.hasOwn(e,"maxLookahead")?e.maxLookahead:qt.maxLookahead,this.lookaheadStrategy=Object.hasOwn(e,"lookaheadStrategy")?e.lookaheadStrategy:new oc({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){e.forEach(r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=Tg(r);n.forEach(c=>{const u=c.idx===0?"":c.idx;this.TRACE_INIT(`${mt(c)}${u}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:c.idx,rule:r,maxLookahead:c.maxLookahead||this.maxLookahead,hasPredicates:c.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),m=Bs(this.fullRuleNameToShort[r.name],pd,c.idx);this.setLaFuncCache(m,d)})}),i.forEach(c=>{this.computeLookaheadFunc(r,c.idx,bo,"Repetition",c.maxLookahead,mt(c))}),a.forEach(c=>{this.computeLookaheadFunc(r,c.idx,md,"Option",c.maxLookahead,mt(c))}),s.forEach(c=>{this.computeLookaheadFunc(r,c.idx,_o,"RepetitionMandatory",c.maxLookahead,mt(c))}),o.forEach(c=>{this.computeLookaheadFunc(r,c.idx,Ha,"RepetitionMandatoryWithSeparator",c.maxLookahead,mt(c))}),l.forEach(c=>{this.computeLookaheadFunc(r,c.idx,No,"RepetitionWithSeparator",c.maxLookahead,mt(c))})})})}computeLookaheadFunc(e,r,n,i,a,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=Bs(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){return Bs(this.currRuleShortName,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}}class yg extends xn{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)}}const Aa=new yg;function Tg(t){Aa.reset(),t.accept(Aa);const e=Aa.dslMethods;return Aa.reset(),e}function Yc(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function Jc(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 Rg(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function vg(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}const Eg="name";function gd(t,e){Object.defineProperty(t,Eg,{enumerable:!1,configurable:!0,writable:!1,value:e})}function Ag(t,e){const r=Object.keys(t),n=r.length;for(let i=0;i<n;i++){const a=r[i],s=t[a],o=s.length;for(let l=0;l<o;l++){const c=s[l];c.tokenTypeIdx===void 0&&this[c.name](c.children,e)}}}function $g(t,e){const r=function(){};gd(r,t+"BaseSemantics");const n={visit:function(i,a){if(Array.isArray(i)&&(i=i[0]),i!==void 0)return this[i.name](i.children,a)},validateVisitor:function(){const i=Sg(this,e);if(i.length!==0){const a=i.map(s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
|
90
|
+
${a.join(`
|
|
91
|
+
|
|
92
|
+
`).replace(/\n/g,`
|
|
93
|
+
`)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function Cg(t,e,r){const n=function(){};gd(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return e.forEach(a=>{i[a]=Ag}),n.prototype=i,n.prototype.constructor=n,n}var Io;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Io||(Io={}));function Sg(t,e){return wg(t,e)}function wg(t,e){return e.filter(i=>typeof t[i]!="function").map(i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:Io.MISSING_METHOD,methodName:i})).filter(Boolean)}class kg{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,"nodeLocationTracking")?e.nodeLocationTracking:qt.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{};else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Jc,this.setNodeLocationFromNode=Jc,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=Yc,this.setNodeLocationFromNode=Yc,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){const r=this.LA_FAST(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const 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){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];Rg(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];vg(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(this.baseCstVisitorConstructor===void 0){const e=$g(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(this.baseCstVisitorWithDefaultsConstructor===void 0){const e=Cg(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]}}class bg{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)):kn}LA_FAST(e){const r=this.currIdx+e;return this.tokVector[r]}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?kn: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()}}class _g{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)){const s={message:wr.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Be.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=cs){const i=Zm(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const a=this.defineRule(e,r,n);return this[e]=a,a}BACKTRACK(e,r){var n;const i=(n=e.coreRule)!==null&&n!==void 0?n:e;return function(){this.isBackTrackingStack.push(1);const a=this.saveRecogState();try{return i.apply(this,r),!0}catch(s){if(os(s))return!1;throw s}finally{this.reloadRecogState(a),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Dp(Object.values(this.gastProductionsCache))}}class Ng{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=ss,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.
|
|
94
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
95
|
+
For Further details.`);if(Array.isArray(e)){if(e.length===0)throw Error(`A Token Vocabulary cannot be empty.
|
|
96
|
+
Note that the first argument for the parser constructor
|
|
97
|
+
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.
|
|
98
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
99
|
+
For Further details.`)}if(Array.isArray(e))this.tokensMap=e.reduce((a,s)=>(a[s.name]=s,a),{});else if(Object.hasOwn(e,"modes")&&Object.values(e.modes).flat().every(km)){const a=Object.values(e.modes).flat(),s=[...new Set(a)];this.tokensMap=s.reduce((o,l)=>(o[l.name]=l,o),{})}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=tr;const i=(Object.hasOwn(e,"modes")?Object.values(e.modes).flat():Object.values(e)).every(a=>{var s;return((s=a.categoryMatches)===null||s===void 0?void 0:s.length)==0});this.tokenMatcher=i?ss:Ki,Hi(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'
|
|
100
|
+
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=Object.hasOwn(n,"resyncEnabled")?n.resyncEnabled:cs.resyncEnabled,a=Object.hasOwn(n,"recoveryValueFunc")?n.recoveryValueFunc:cs.recoveryValueFunc,s=this.ruleShortNameIdx<<mg+nr;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let o;return this.outputCst===!0?o=function(...d){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,d);const m=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(m),m}catch(m){return this.invokeRuleCatch(m,i,a)}finally{this.ruleFinallyStateUpdate()}}:o=function(...d){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,d)}catch(m){return this.invokeRuleCatch(m,i,a)}finally{this.ruleFinallyStateUpdate()}},Object.assign(function(...d){this.onBeforeParse(e);try{return o.apply(this,d)}finally{this.onAfterParse(e)}},{ruleName:e,originalGrammarAction:r,coreRule:o})}invokeRuleCatch(e,r,n){const i=this.RULE_STACK_IDX===0,a=r&&!this.isBackTracking()&&this.recoveryEnabled;if(os(e)){const s=e;if(a){const o=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(o))if(s.resyncedTokens=this.reSyncTo(o),this.outputCst){const l=this.CST_STACK[this.CST_STACK.length-1];return l.recoveredNode=!0,l}else return n(e);else{if(this.outputCst){const l=this.CST_STACK[this.CST_STACK.length-1];l.recoveredNode=!0,s.partialCstResult=l}throw s}}else{if(i)return this.moveToTerminatedState(),n(e);throw s}}else throw e}optionInternal(e,r){const n=this.getKeyForAutomaticLookahead(md,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof e!="function"){a=e.DEF;const s=e.GATE;if(s!==void 0){const o=i;i=()=>s.call(this)&&o.call(this)}}else a=e;if(i.call(this)===!0)return a.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(_o,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const s=r.GATE;if(s!==void 0){const o=i;i=()=>s.call(this)&&o.call(this)}}else a=r;if(i.call(this)===!0){let s=this.doSingleRepetition(a);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,he.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,_o,e,Dm)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(Ha,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA_FAST(1),a);for(;this.tokenMatcher(this.LA_FAST(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,Kc],o,Ha,e,Kc)}else throw this.raiseEarlyExitException(e,he.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(bo,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const o=r.GATE;if(o!==void 0){const l=i;i=()=>o.call(this)&&l.call(this)}}else a=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,bo,e,xm,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(No,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA_FAST(1),a);for(;this.tokenMatcher(this.LA_FAST(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,Vc],o,No,e,Vc)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,Ha,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(pd,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{const a=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.coreRule.apply(this,a),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(a){throw this.subruleInternalError(a,n,e.ruleName)}}subruleInternalError(e,r,n){throw os(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{const a=this.LA_FAST(1);this.tokenMatcher(a,e)===!0?(this.consumeToken(),i=a):this.consumeInternalError(e,a,n)}catch(a){i=this.consumeInternalRecovery(e,r,a)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i;const a=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new dd(i,r,a))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(a){throw a.name===hd?n:a}}else throw n}saveRecogState(){const 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);const 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(){const e=this.currRuleShortName;return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),tr)}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(kn)}onAfterParse(e){if(this.isAtEndOfInput()===!1){const r=this.LA(1),n=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:r,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new ug(n,r))}for(;this.tokVector.at(-1)===kn;)this.tokVector.pop()}}class Ig{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:qt.errorMessageProvider}SAVE_ERROR(e){if(os(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){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=_s(e,a,r,this.maxLookahead)[0],l=[];for(let u=1;u<=this.maxLookahead;u++)l.push(this.LA(u));const c=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new fg(c,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=bs(e,i,this.maxLookahead),s=[];for(let c=1;c<=this.maxLookahead;c++)s.push(this.LA(c));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:o,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new cg(l,this.LA(1),o))}}const Is={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Is);const Zc=!0,Qc=Math.pow(2,nr)-1,yd=ed({name:"RECORDING_PHASE_TOKEN",pattern:We.NA});Hi([yd]);const Td=ic(yd,`This IToken indicates the Parser is in Recording Phase
|
|
101
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(Td);const Pg={name:`This CSTNode indicates the Parser is in Recording Phase
|
|
102
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};class Og{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++){const 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",()=>{const e=this;for(let r=0;r<10;r++){const 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 kn}topLevelRuleRecord(e,r){try{const n=new Ln({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+`
|
|
103
|
+
This error was thrown during the "grammar recording phase" For more info see:
|
|
104
|
+
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return ri.call(this,Me,e,r)}atLeastOneInternalRecord(e,r){ri.call(this,et,r,e)}atLeastOneSepFirstInternalRecord(e,r){ri.call(this,tt,r,e,Zc)}manyInternalRecord(e,r){ri.call(this,Te,r,e)}manySepFirstInternalRecord(e,r){ri.call(this,Ke,r,e,Zc)}orInternalRecord(e,r){return Lg.call(this,e,r)}subruleInternalRecord(e,r,n){if(ls(r),!e||!Object.hasOwn(e,"ruleName")){const o=new Error(`<SUBRULE${eu(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
|
|
105
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=this.recordingProdStack.at(-1),a=e.ruleName,s=new qe({idx:r,nonTerminalName:a,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?Pg:Is}consumeInternalRecord(e,r,n){if(ls(r),!Zf(e)){const s=new Error(`<CONSUME${eu(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
|
|
106
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const i=this.recordingProdStack.at(-1),a=new se({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(a),Td}}function ri(t,e,r,n=!1){ls(r);const i=this.recordingProdStack.at(-1),a=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),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),Is}function Lg(t,e){ls(e);const r=this.recordingProdStack.at(-1),n=Array.isArray(t)===!1,i=n===!1?t:t.DEF,a=new He({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});Object.hasOwn(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=i.some(o=>typeof o.GATE=="function");return a.hasPredicates=s,r.definition.push(a),i.forEach(o=>{const l=new Ve({definition:[]});a.definition.push(l),Object.hasOwn(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:Object.hasOwn(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),Is}function eu(t){return t===0?"":`${t}`}function ls(t){if(t<0||t>Qc){const e=new Error(`Invalid DSL Method idx value: <${t}>
|
|
107
|
+
Idx value must be a none negative value smaller than ${Qc+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class xg{initPerformanceTracer(e){if(Object.hasOwn(e,"traceInitPerf")){const 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=qt.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);const{time:i,value:a}=qf(r),s=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${n}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,a}else return r()}}function Dg(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(t.prototype,i,a):t.prototype[i]=r.prototype[i]})})}const kn=ic(tr,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(kn);const qt=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:nn,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),cs=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var Be;(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"})(Be||(Be={}));function tu(t=void 0){return function(){return t}}class Xi{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;const r=this.className;this.TRACE_INIT("toFastProps",()=>{Bf(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),this.definedRulesNames.forEach(i=>{const s=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=og({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(n.length===0&&this.skipValidations===!1){const i=lg({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:wr,grammarName:r}),a=Vm({lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),this.definitionErrors.length===0&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=qp(Object.values(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,a;(a=(i=this.lookaheadStrategy).initialize)===null||a===void 0||a.call(i,{rules:Object.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache))})),!Xi.DEFER_DEFINITION_ERRORS_HANDLING&&this.definitionErrors.length!==0)throw e=this.definitionErrors.map(i=>i.message),new Error(`Parser Definition Errors detected:
|
|
108
|
+
${e.join(`
|
|
109
|
+
-------------------------------
|
|
110
|
+
`)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const 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.
|
|
111
|
+
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
112
|
+
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
113
|
+
For further details.`);this.skipValidations=Object.hasOwn(r,"skipValidations")?r.skipValidations:qt.skipValidations}}Xi.DEFER_DEFINITION_ERRORS_HANDLING=!1;Dg(Xi,[hg,gg,kg,bg,Ng,_g,Ig,Og,xg]);class Mg extends Xi{constructor(e,r=qt){const n=Object.assign({},r);n.outputCst=!1,super(e,n)}}function bn(t,e,r){return`${t.name}_${e}_${r}`}const rr=1,Fg=2,Rd=4,vd=5,Yi=7,Gg=8,jg=9,zg=10,Ug=11,Ed=12;class lc{constructor(e){this.target=e}isEpsilon(){return!1}}class cc extends lc{constructor(e,r){super(e),this.tokenType=r}}class Ad extends lc{constructor(e){super(e)}isEpsilon(){return!0}}class uc extends lc{constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}}function qg(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};Bg(e,t);const r=t.length;for(let n=0;n<r;n++){const i=t[n],a=Lr(e,i,i);a!==void 0&&ty(e,i,a)}return e}function Bg(t,e){const r=e.length;for(let n=0;n<r;n++){const i=e[n],a=_e(t,i,void 0,{type:Fg}),s=_e(t,i,void 0,{type:Yi});a.stop=s,t.ruleToStartState.set(i,a),t.ruleToStopState.set(i,s)}}function $d(t,e,r){return r instanceof se?fc(t,e,r.terminalType,r):r instanceof qe?ey(t,e,r):r instanceof He?Xg(t,e,r):r instanceof Me?Yg(t,e,r):r instanceof Te?Wg(t,e,r):r instanceof Ke?Vg(t,e,r):r instanceof et?Kg(t,e,r):r instanceof tt?Hg(t,e,r):Lr(t,e,r)}function Wg(t,e,r){const n=_e(t,e,r,{type:vd});ir(t,n);const i=Dn(t,e,n,r,Lr(t,e,r));return Sd(t,e,r,i)}function Vg(t,e,r){const n=_e(t,e,r,{type:vd});ir(t,n);const i=Dn(t,e,n,r,Lr(t,e,r)),a=fc(t,e,r.separator,r);return Sd(t,e,r,i,a)}function Kg(t,e,r){const n=_e(t,e,r,{type:Rd});ir(t,n);const i=Dn(t,e,n,r,Lr(t,e,r));return Cd(t,e,r,i)}function Hg(t,e,r){const n=_e(t,e,r,{type:Rd});ir(t,n);const i=Dn(t,e,n,r,Lr(t,e,r)),a=fc(t,e,r.separator,r);return Cd(t,e,r,i,a)}function Xg(t,e,r){const n=_e(t,e,r,{type:rr});ir(t,n);const i=Gt(r.definition,s=>$d(t,e,s));return Dn(t,e,n,r,...i)}function Yg(t,e,r){const n=_e(t,e,r,{type:rr});ir(t,n);const i=Dn(t,e,n,r,Lr(t,e,r));return Jg(t,e,r,i)}function Lr(t,e,r){const n=Ih(Gt(r.definition,i=>$d(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:Qg(t,n)}function Cd(t,e,r,n,i){const a=n.left,s=n.right,o=_e(t,e,r,{type:Ug});ir(t,o);const l=_e(t,e,r,{type:Ed});return a.loopback=o,l.loopback=o,t.decisionMap[bn(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,Se(s,o),i===void 0?(Se(o,a),Se(o,l)):(Se(o,l),Se(o,i.left),Se(i.right,a)),{left:a,right:l}}function Sd(t,e,r,n,i){const a=n.left,s=n.right,o=_e(t,e,r,{type:zg});ir(t,o);const l=_e(t,e,r,{type:Ed}),c=_e(t,e,r,{type:jg});return o.loopback=c,l.loopback=c,Se(o,a),Se(o,l),Se(s,c),i!==void 0?(Se(c,l),Se(c,i.left),Se(i.right,a)):Se(c,o),t.decisionMap[bn(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}function Jg(t,e,r,n){const i=n.left,a=n.right;return Se(i,a),t.decisionMap[bn(e,"Option",r.idx)]=i,n}function ir(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function Dn(t,e,r,n,...i){const a=_e(t,e,n,{type:Gg,start:r});r.end=a;for(const o of i)o!==void 0?(Se(r,o.left),Se(o.right,a)):Se(r,a);const s={left:r,right:a};return t.decisionMap[bn(e,Zg(n),n.idx)]=r,s}function Zg(t){if(t instanceof He)return"Alternation";if(t instanceof Me)return"Option";if(t instanceof Te)return"Repetition";if(t instanceof Ke)return"RepetitionWithSeparator";if(t instanceof et)return"RepetitionMandatory";if(t instanceof tt)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function Qg(t,e){const r=e.length;for(let a=0;a<r-1;a++){const s=e[a];let o;s.left.transitions.length===1&&(o=s.left.transitions[0]);const l=o instanceof uc,c=o,u=e[a+1].left;s.left.type===rr&&s.right.type===rr&&o!==void 0&&(l&&c.followState===s.right||o.target===s.right)?(l?c.followState=u:o.target=u,ry(t,s.right)):Se(s.right,u)}const n=e[0],i=e[r-1];return{left:n.left,right:i.right}}function fc(t,e,r,n){const i=_e(t,e,n,{type:rr}),a=_e(t,e,n,{type:rr});return dc(i,new cc(a,r)),{left:i,right:a}}function ey(t,e,r){const n=r.referencedRule,i=t.ruleToStartState.get(n),a=_e(t,e,r,{type:rr}),s=_e(t,e,r,{type:rr}),o=new uc(i,n,s);return dc(a,o),{left:a,right:s}}function ty(t,e,r){const n=t.ruleToStartState.get(e);Se(n,r.left);const i=t.ruleToStopState.get(e);return Se(r.right,i),{left:n,right:i}}function Se(t,e){const r=new Ad(e);dc(t,r)}function _e(t,e,r,n){const 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 dc(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function ry(t,e){t.states.splice(t.states.indexOf(e),1)}const us={};class Po{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const r=wd(e);r in this.map||(this.map[r]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return Gt(this.configs,e=>e.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}}function wd(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}function ny(t,e){const r={};return n=>{const i=n.toString();let a=r[i];return a!==void 0||(a={atnStartState:t,decision:e,states:{}},r[i]=a),a}}class kd{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="";const r=this.predicates.length;for(let n=0;n<r;n++)e+=this.predicates[n]===!0?"1":"0";return e}}const ru=new kd;class iy extends oc{constructor(e){var r;super(),this.logging=(r=e==null?void 0:e.logging)!==null&&r!==void 0?r:(n=>console.log(n))}initialize(e){this.atn=qg(e.rules),this.dfas=ay(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=bn(n,"Alternation",r),u=this.atn.decisionMap[l].decision,d=Gt(Hc({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),m=>Gt(m,h=>h[0]));if(nu(d,!1)&&!a){const m=vc(d,(h,E,b)=>(xs(E,I=>{I&&(h[I.tokenTypeIdx]=b,xs(I.categoryMatches,C=>{h[C]=b}))}),h),{});return i?function(h){var E;const b=this.LA_FAST(1),I=m[b.tokenTypeIdx];if(h!==void 0&&I!==void 0){const C=(E=h[I])===null||E===void 0?void 0:E.GATE;if(C!==void 0&&C.call(this)===!1)return}return I}:function(){const h=this.LA_FAST(1);return m[h.tokenTypeIdx]}}else return i?function(m){const h=new kd,E=m===void 0?0:m.length;for(let I=0;I<E;I++){const C=m==null?void 0:m[I].GATE;h.set(I,C===void 0||C.call(this))}const b=Ws.call(this,s,u,h,o);return typeof b=="number"?b:void 0}:function(){const m=Ws.call(this,s,u,ru,o);return typeof m=="number"?m:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:r,rule:n,prodType:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=bn(n,i,r),u=this.atn.decisionMap[l].decision,d=Gt(Hc({maxLookahead:1,occurrence:r,prodType:i,rule:n}),m=>Gt(m,h=>h[0]));if(nu(d)&&d[0][0]&&!a){const m=d[0],h=wh(m);if(h.length===1&&Ch(h[0].categoryMatches)){const b=h[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===b}}else{const E=vc(h,(b,I)=>(I!==void 0&&(b[I.tokenTypeIdx]=!0,xs(I.categoryMatches,C=>{b[C]=!0})),b),{});return function(){const b=this.LA_FAST(1);return E[b.tokenTypeIdx]===!0}}}return function(){const m=Ws.call(this,s,u,ru,o);return typeof m=="object"?!1:m===0}}}function nu(t,e=!0){const r=new Set;for(const n of t){const i=new Set;for(const a of n){if(a===void 0){if(e)break;return!1}const s=[a.tokenTypeIdx].concat(a.categoryMatches);for(const o of s)if(r.has(o)){if(!i.has(o))return!1}else r.add(o),i.add(o)}}return!0}function ay(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=ny(t.decisionStates[n],n);return r}function Ws(t,e,r,n){const i=t[e](r);let a=i.start;if(a===void 0){const o=gy(i.atnStartState);a=_d(i,bd(o)),i.start=a}return sy.apply(this,[i,a,r,n])}function sy(t,e,r,n){let i=e,a=1;const s=[];let o=this.LA_FAST(a++);for(;;){let l=dy(i,o);if(l===void 0&&(l=oy.apply(this,[t,i,o,a,r,n])),l===us)return fy(s,i,o);if(l.isAcceptState===!0)return l.prediction;i=l,s.push(o),o=this.LA(a++)}}function oy(t,e,r,n,i,a){const s=hy(e.configs,r,i);if(s.size===0)return iu(t,e,r,us),us;let o=bd(s);const l=my(s,i);if(l!==void 0)o.isAcceptState=!0,o.prediction=l,o.configs.uniqueAlt=l;else if(vy(s)){const c=kh(s.alts);o.isAcceptState=!0,o.prediction=c,o.configs.uniqueAlt=c,ly.apply(this,[t,n,s.alts,a])}return o=iu(t,e,r,o),o}function ly(t,e,r,n){const i=[];for(let c=1;c<=e;c++)i.push(this.LA(c).tokenType);const a=t.atnStartState,s=a.rule,o=a.production,l=cy({topLevelRule:s,ambiguityIndices:r,production:o,prefixPath:i});n(l)}function cy(t){const e=Gt(t.prefixPath,i=>sn(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${uy(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,
|
|
114
|
+
<${e}> may appears as a prefix path in all these alternatives.
|
|
115
|
+
`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
116
|
+
For Further details.`,n}function uy(t){if(t instanceof qe)return"SUBRULE";if(t instanceof Me)return"OPTION";if(t instanceof He)return"OR";if(t instanceof et)return"AT_LEAST_ONE";if(t instanceof tt)return"AT_LEAST_ONE_SEP";if(t instanceof Ke)return"MANY_SEP";if(t instanceof Te)return"MANY";if(t instanceof se)return"CONSUME";throw Error("non exhaustive match")}function fy(t,e,r){const n=Ph(e.configs.elements,a=>a.state.transitions),i=Oh(n.filter(a=>a instanceof cc).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function dy(t,e){return t.edges[e.tokenTypeIdx]}function hy(t,e,r){const n=new Po,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===Yi){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l<o;l++){const c=s.state.transitions[l],u=py(c,e);u!==void 0&&n.add({state:u,alt:s.alt,stack:s.stack})}}let a;if(i.length===0&&n.size===1&&(a=n),a===void 0){a=new Po;for(const s of n.elements)fs(s,a)}if(i.length>0&&!Ty(a))for(const s of i)a.add(s);return a}function py(t,e){if(t instanceof cc&&td(e,t.tokenType))return t.target}function my(t,e){let r;for(const 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 bd(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function iu(t,e,r,n){return n=_d(t,n),e.edges[r.tokenTypeIdx]=n,n}function _d(t,e){if(e===us)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}function gy(t){const e=new Po,r=t.transitions.length;for(let n=0;n<r;n++){const a={state:t.transitions[n].target,alt:n,stack:[]};fs(a,e)}return e}function fs(t,e){const r=t.state;if(r.type===Yi){if(t.stack.length>0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};fs(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i<n;i++){const a=r.transitions[i],s=yy(t,a);s!==void 0&&fs(s,e)}}function yy(t,e){if(e instanceof Ad)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof uc){const r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}function Ty(t){for(const e of t.elements)if(e.state.type===Yi)return!0;return!1}function Ry(t){for(const e of t.elements)if(e.state.type!==Yi)return!1;return!0}function vy(t){if(Ry(t))return!0;const e=Ey(t.elements);return Ay(e)&&!$y(e)}function Ey(t){const e=new Map;for(const r of t){const n=wd(r,!1);let i=e.get(n);i===void 0&&(i={},e.set(n,i)),i[r.alt]=!0}return e}function Ay(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function $y(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var Oo;(function(t){function e(r){return typeof r=="string"}t.is=e})(Oo||(Oo={}));var ds;(function(t){function e(r){return typeof r=="string"}t.is=e})(ds||(ds={}));var Lo;(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})(Lo||(Lo={}));var Oi;(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})(Oi||(Oi={}));var Z;(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=Oi.MAX_VALUE),i===Number.MAX_VALUE&&(i=Oi.MAX_VALUE),{line:n,character:i}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&v.uinteger(i.line)&&v.uinteger(i.character)}t.is=r})(Z||(Z={}));var K;(function(t){function e(n,i,a,s){if(v.uinteger(n)&&v.uinteger(i)&&v.uinteger(a)&&v.uinteger(s))return{start:Z.create(n,i),end:Z.create(a,s)};if(Z.is(n)&&Z.is(i))return{start:n,end:i};throw new Error(`Range#create called with invalid arguments[${n}, ${i}, ${a}, ${s}]`)}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&Z.is(i.start)&&Z.is(i.end)}t.is=r})(K||(K={}));var Li;(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&K.is(i.range)&&(v.string(i.uri)||v.undefined(i.uri))}t.is=r})(Li||(Li={}));var xo;(function(t){function e(n,i,a,s){return{targetUri:n,targetRange:i,targetSelectionRange:a,originSelectionRange:s}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&K.is(i.targetRange)&&v.string(i.targetUri)&&K.is(i.targetSelectionRange)&&(K.is(i.originSelectionRange)||v.undefined(i.originSelectionRange))}t.is=r})(xo||(xo={}));var hs;(function(t){function e(n,i,a,s){return{red:n,green:i,blue:a,alpha:s}}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&v.numberRange(i.red,0,1)&&v.numberRange(i.green,0,1)&&v.numberRange(i.blue,0,1)&&v.numberRange(i.alpha,0,1)}t.is=r})(hs||(hs={}));var Do;(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&K.is(i.range)&&hs.is(i.color)}t.is=r})(Do||(Do={}));var Mo;(function(t){function e(n,i,a){return{label:n,textEdit:i,additionalTextEdits:a}}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&v.string(i.label)&&(v.undefined(i.textEdit)||yt.is(i))&&(v.undefined(i.additionalTextEdits)||v.typedArray(i.additionalTextEdits,yt.is))}t.is=r})(Mo||(Mo={}));var Fo;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Fo||(Fo={}));var Go;(function(t){function e(n,i,a,s,o,l){const c={startLine:n,endLine:i};return v.defined(a)&&(c.startCharacter=a),v.defined(s)&&(c.endCharacter=s),v.defined(o)&&(c.kind=o),v.defined(l)&&(c.collapsedText=l),c}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&v.uinteger(i.startLine)&&v.uinteger(i.startLine)&&(v.undefined(i.startCharacter)||v.uinteger(i.startCharacter))&&(v.undefined(i.endCharacter)||v.uinteger(i.endCharacter))&&(v.undefined(i.kind)||v.string(i.kind))}t.is=r})(Go||(Go={}));var ps;(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&Li.is(i.location)&&v.string(i.message)}t.is=r})(ps||(ps={}));var jo;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(jo||(jo={}));var zo;(function(t){t.Unnecessary=1,t.Deprecated=2})(zo||(zo={}));var Uo;(function(t){function e(r){const n=r;return v.objectLiteral(n)&&v.string(n.href)}t.is=e})(Uo||(Uo={}));var xi;(function(t){function e(n,i,a,s,o,l){let c={range:n,message:i};return v.defined(a)&&(c.severity=a),v.defined(s)&&(c.code=s),v.defined(o)&&(c.source=o),v.defined(l)&&(c.relatedInformation=l),c}t.create=e;function r(n){var i;let a=n;return v.defined(a)&&K.is(a.range)&&v.string(a.message)&&(v.number(a.severity)||v.undefined(a.severity))&&(v.integer(a.code)||v.string(a.code)||v.undefined(a.code))&&(v.undefined(a.codeDescription)||v.string((i=a.codeDescription)===null||i===void 0?void 0:i.href))&&(v.string(a.source)||v.undefined(a.source))&&(v.undefined(a.relatedInformation)||v.typedArray(a.relatedInformation,ps.is))}t.is=r})(xi||(xi={}));var Pr;(function(t){function e(n,i,...a){let s={title:n,command:i};return v.defined(a)&&a.length>0&&(s.arguments=a),s}t.create=e;function r(n){let i=n;return v.defined(i)&&v.string(i.title)&&v.string(i.command)}t.is=r})(Pr||(Pr={}));var yt;(function(t){function e(a,s){return{range:a,newText:s}}t.replace=e;function r(a,s){return{range:{start:a,end:a},newText:s}}t.insert=r;function n(a){return{range:a,newText:""}}t.del=n;function i(a){const s=a;return v.objectLiteral(s)&&v.string(s.newText)&&K.is(s.range)}t.is=i})(yt||(yt={}));var kr;(function(t){function e(n,i,a){const s={label:n};return i!==void 0&&(s.needsConfirmation=i),a!==void 0&&(s.description=a),s}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&v.string(i.label)&&(v.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(v.string(i.description)||i.description===void 0)}t.is=r})(kr||(kr={}));var De;(function(t){function e(r){const n=r;return v.string(n)}t.is=e})(De||(De={}));var Ft;(function(t){function e(a,s,o){return{range:a,newText:s,annotationId:o}}t.replace=e;function r(a,s,o){return{range:{start:a,end:a},newText:s,annotationId:o}}t.insert=r;function n(a,s){return{range:a,newText:"",annotationId:s}}t.del=n;function i(a){const s=a;return yt.is(s)&&(kr.is(s.annotationId)||De.is(s.annotationId))}t.is=i})(Ft||(Ft={}));var Di;(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&Mi.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(Di||(Di={}));var _n;(function(t){function e(n,i,a){let s={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(s.options=i),a!==void 0&&(s.annotationId=a),s}t.create=e;function r(n){let i=n;return i&&i.kind==="create"&&v.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||v.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||v.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||De.is(i.annotationId))}t.is=r})(_n||(_n={}));var Nn;(function(t){function e(n,i,a,s){let o={kind:"rename",oldUri:n,newUri:i};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}t.create=e;function r(n){let i=n;return i&&i.kind==="rename"&&v.string(i.oldUri)&&v.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||v.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||v.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||De.is(i.annotationId))}t.is=r})(Nn||(Nn={}));var In;(function(t){function e(n,i,a){let s={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(s.options=i),a!==void 0&&(s.annotationId=a),s}t.create=e;function r(n){let i=n;return i&&i.kind==="delete"&&v.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||v.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||v.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||De.is(i.annotationId))}t.is=r})(In||(In={}));var ms;(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=>v.string(i.kind)?_n.is(i)||Nn.is(i)||In.is(i):Di.is(i)))}t.is=e})(ms||(ms={}));class $a{constructor(e,r){this.edits=e,this.changeAnnotations=r}insert(e,r,n){let i,a;if(n===void 0?i=yt.insert(e,r):De.is(n)?(a=n,i=Ft.insert(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(n),i=Ft.insert(e,r,a)),this.edits.push(i),a!==void 0)return a}replace(e,r,n){let i,a;if(n===void 0?i=yt.replace(e,r):De.is(n)?(a=n,i=Ft.replace(e,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(n),i=Ft.replace(e,r,a)),this.edits.push(i),a!==void 0)return a}delete(e,r){let n,i;if(r===void 0?n=yt.del(e):De.is(r)?(i=r,n=Ft.del(e,r)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(r),n=Ft.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.")}}class au{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(De.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()}}class Cy{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new au(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(r=>{if(Di.is(r)){const n=new $a(r.edits,this._changeAnnotations);this._textEditChanges[r.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(r=>{const n=new $a(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(Mi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const r={uri:e.uri,version:e.version};let n=this._textEditChanges[r.uri];if(!n){const i=[],a={textDocument:r,edits:i};this._workspaceEdit.documentChanges.push(a),n=new $a(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 $a(n),this._textEditChanges[e]=r}return r}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new au,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;kr.is(r)||De.is(r)?i=r:n=r;let a,s;if(i===void 0?a=_n.create(e,n):(s=De.is(i)?i:this._changeAnnotations.manage(i),a=_n.create(e,n,s)),this._workspaceEdit.documentChanges.push(a),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 a;kr.is(n)||De.is(n)?a=n:i=n;let s,o;if(a===void 0?s=Nn.create(e,r,i):(o=De.is(a)?a:this._changeAnnotations.manage(a),s=Nn.create(e,r,i,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}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;kr.is(r)||De.is(r)?i=r:n=r;let a,s;if(i===void 0?a=In.create(e,n):(s=De.is(i)?i:this._changeAnnotations.manage(i),a=In.create(e,n,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}}var qo;(function(t){function e(n){return{uri:n}}t.create=e;function r(n){let i=n;return v.defined(i)&&v.string(i.uri)}t.is=r})(qo||(qo={}));var Bo;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&v.string(i.uri)&&v.integer(i.version)}t.is=r})(Bo||(Bo={}));var Mi;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&v.string(i.uri)&&(i.version===null||v.integer(i.version))}t.is=r})(Mi||(Mi={}));var Wo;(function(t){function e(n,i,a,s){return{uri:n,languageId:i,version:a,text:s}}t.create=e;function r(n){let i=n;return v.defined(i)&&v.string(i.uri)&&v.string(i.languageId)&&v.integer(i.version)&&v.string(i.text)}t.is=r})(Wo||(Wo={}));var gs;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){const n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(gs||(gs={}));var Pn;(function(t){function e(r){const n=r;return v.objectLiteral(r)&&gs.is(n.kind)&&v.string(n.value)}t.is=e})(Pn||(Pn={}));var Vo;(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})(Vo||(Vo={}));var Ko;(function(t){t.PlainText=1,t.Snippet=2})(Ko||(Ko={}));var Ho;(function(t){t.Deprecated=1})(Ho||(Ho={}));var Xo;(function(t){function e(n,i,a){return{newText:n,insert:i,replace:a}}t.create=e;function r(n){const i=n;return i&&v.string(i.newText)&&K.is(i.insert)&&K.is(i.replace)}t.is=r})(Xo||(Xo={}));var Yo;(function(t){t.asIs=1,t.adjustIndentation=2})(Yo||(Yo={}));var Jo;(function(t){function e(r){const n=r;return n&&(v.string(n.detail)||n.detail===void 0)&&(v.string(n.description)||n.description===void 0)}t.is=e})(Jo||(Jo={}));var Zo;(function(t){function e(r){return{label:r}}t.create=e})(Zo||(Zo={}));var Qo;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(Qo||(Qo={}));var Fi;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function r(n){const i=n;return v.string(i)||v.objectLiteral(i)&&v.string(i.language)&&v.string(i.value)}t.is=r})(Fi||(Fi={}));var el;(function(t){function e(r){let n=r;return!!n&&v.objectLiteral(n)&&(Pn.is(n.contents)||Fi.is(n.contents)||v.typedArray(n.contents,Fi.is))&&(r.range===void 0||K.is(r.range))}t.is=e})(el||(el={}));var tl;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(tl||(tl={}));var rl;(function(t){function e(r,n,...i){let a={label:r};return v.defined(n)&&(a.documentation=n),v.defined(i)?a.parameters=i:a.parameters=[],a}t.create=e})(rl||(rl={}));var nl;(function(t){t.Text=1,t.Read=2,t.Write=3})(nl||(nl={}));var il;(function(t){function e(r,n){let i={range:r};return v.number(n)&&(i.kind=n),i}t.create=e})(il||(il={}));var al;(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})(al||(al={}));var sl;(function(t){t.Deprecated=1})(sl||(sl={}));var ol;(function(t){function e(r,n,i,a,s){let o={name:r,kind:n,location:{uri:a,range:i}};return s&&(o.containerName=s),o}t.create=e})(ol||(ol={}));var ll;(function(t){function e(r,n,i,a){return a!==void 0?{name:r,kind:n,location:{uri:i,range:a}}:{name:r,kind:n,location:{uri:i}}}t.create=e})(ll||(ll={}));var cl;(function(t){function e(n,i,a,s,o,l){let c={name:n,detail:i,kind:a,range:s,selectionRange:o};return l!==void 0&&(c.children=l),c}t.create=e;function r(n){let i=n;return i&&v.string(i.name)&&v.number(i.kind)&&K.is(i.range)&&K.is(i.selectionRange)&&(i.detail===void 0||v.string(i.detail))&&(i.deprecated===void 0||v.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=r})(cl||(cl={}));var ul;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(ul||(ul={}));var Gi;(function(t){t.Invoked=1,t.Automatic=2})(Gi||(Gi={}));var fl;(function(t){function e(n,i,a){let s={diagnostics:n};return i!=null&&(s.only=i),a!=null&&(s.triggerKind=a),s}t.create=e;function r(n){let i=n;return v.defined(i)&&v.typedArray(i.diagnostics,xi.is)&&(i.only===void 0||v.typedArray(i.only,v.string))&&(i.triggerKind===void 0||i.triggerKind===Gi.Invoked||i.triggerKind===Gi.Automatic)}t.is=r})(fl||(fl={}));var dl;(function(t){function e(n,i,a){let s={title:n},o=!0;return typeof i=="string"?(o=!1,s.kind=i):Pr.is(i)?s.command=i:s.edit=i,o&&a!==void 0&&(s.kind=a),s}t.create=e;function r(n){let i=n;return i&&v.string(i.title)&&(i.diagnostics===void 0||v.typedArray(i.diagnostics,xi.is))&&(i.kind===void 0||v.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Pr.is(i.command))&&(i.isPreferred===void 0||v.boolean(i.isPreferred))&&(i.edit===void 0||ms.is(i.edit))}t.is=r})(dl||(dl={}));var hl;(function(t){function e(n,i){let a={range:n};return v.defined(i)&&(a.data=i),a}t.create=e;function r(n){let i=n;return v.defined(i)&&K.is(i.range)&&(v.undefined(i.command)||Pr.is(i.command))}t.is=r})(hl||(hl={}));var pl;(function(t){function e(n,i){return{tabSize:n,insertSpaces:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&v.uinteger(i.tabSize)&&v.boolean(i.insertSpaces)}t.is=r})(pl||(pl={}));var ml;(function(t){function e(n,i,a){return{range:n,target:i,data:a}}t.create=e;function r(n){let i=n;return v.defined(i)&&K.is(i.range)&&(v.undefined(i.target)||v.string(i.target))}t.is=r})(ml||(ml={}));var gl;(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&K.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(gl||(gl={}));var yl;(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"})(yl||(yl={}));var Tl;(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"})(Tl||(Tl={}));var Rl;(function(t){function e(r){const n=r;return v.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})(Rl||(Rl={}));var vl;(function(t){function e(n,i){return{range:n,text:i}}t.create=e;function r(n){const i=n;return i!=null&&K.is(i.range)&&v.string(i.text)}t.is=r})(vl||(vl={}));var El;(function(t){function e(n,i,a){return{range:n,variableName:i,caseSensitiveLookup:a}}t.create=e;function r(n){const i=n;return i!=null&&K.is(i.range)&&v.boolean(i.caseSensitiveLookup)&&(v.string(i.variableName)||i.variableName===void 0)}t.is=r})(El||(El={}));var Al;(function(t){function e(n,i){return{range:n,expression:i}}t.create=e;function r(n){const i=n;return i!=null&&K.is(i.range)&&(v.string(i.expression)||i.expression===void 0)}t.is=r})(Al||(Al={}));var $l;(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){const i=n;return v.defined(i)&&K.is(n.stoppedLocation)}t.is=r})($l||($l={}));var ys;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(ys||(ys={}));var Ts;(function(t){function e(n){return{value:n}}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&(i.tooltip===void 0||v.string(i.tooltip)||Pn.is(i.tooltip))&&(i.location===void 0||Li.is(i.location))&&(i.command===void 0||Pr.is(i.command))}t.is=r})(Ts||(Ts={}));var Cl;(function(t){function e(n,i,a){const s={position:n,label:i};return a!==void 0&&(s.kind=a),s}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&Z.is(i.position)&&(v.string(i.label)||v.typedArray(i.label,Ts.is))&&(i.kind===void 0||ys.is(i.kind))&&i.textEdits===void 0||v.typedArray(i.textEdits,yt.is)&&(i.tooltip===void 0||v.string(i.tooltip)||Pn.is(i.tooltip))&&(i.paddingLeft===void 0||v.boolean(i.paddingLeft))&&(i.paddingRight===void 0||v.boolean(i.paddingRight))}t.is=r})(Cl||(Cl={}));var Sl;(function(t){function e(r){return{kind:"snippet",value:r}}t.createSnippet=e})(Sl||(Sl={}));var wl;(function(t){function e(r,n,i,a){return{insertText:r,filterText:n,range:i,command:a}}t.create=e})(wl||(wl={}));var kl;(function(t){function e(r){return{items:r}}t.create=e})(kl||(kl={}));var bl;(function(t){t.Invoked=0,t.Automatic=1})(bl||(bl={}));var _l;(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(_l||(_l={}));var Nl;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(Nl||(Nl={}));var Il;(function(t){function e(r){const n=r;return v.objectLiteral(n)&&ds.is(n.uri)&&v.string(n.name)}t.is=e})(Il||(Il={}));const Sy=[`
|
|
117
|
+
`,`\r
|
|
118
|
+
`,"\r"];var Pl;(function(t){function e(a,s,o,l){return new wy(a,s,o,l)}t.create=e;function r(a){let s=a;return!!(v.defined(s)&&v.string(s.uri)&&(v.undefined(s.languageId)||v.string(s.languageId))&&v.uinteger(s.lineCount)&&v.func(s.getText)&&v.func(s.positionAt)&&v.func(s.offsetAt))}t.is=r;function n(a,s){let o=a.getText(),l=i(s,(u,d)=>{let m=u.range.start.line-d.range.start.line;return m===0?u.range.start.character-d.range.start.character:m}),c=o.length;for(let u=l.length-1;u>=0;u--){let d=l[u],m=a.offsetAt(d.range.start),h=a.offsetAt(d.range.end);if(h<=c)o=o.substring(0,m)+d.newText+o.substring(h,o.length);else throw new Error("Overlapping edit");c=m}return o}t.applyEdits=n;function i(a,s){if(a.length<=1)return a;const o=a.length/2|0,l=a.slice(0,o),c=a.slice(o);i(l,s),i(c,s);let u=0,d=0,m=0;for(;u<l.length&&d<c.length;)s(l[u],c[d])<=0?a[m++]=l[u++]:a[m++]=c[d++];for(;u<l.length;)a[m++]=l[u++];for(;d<c.length;)a[m++]=c[d++];return a}})(Pl||(Pl={}));let wy=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 a=r.charAt(i);n=a==="\r"||a===`
|
|
119
|
+
`,a==="\r"&&i+1<r.length&&r.charAt(i+1)===`
|
|
120
|
+
`&&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 Z.create(0,e);for(;n<i;){let s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}let a=n-1;return Z.create(a,e-r[a])}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}};var v;(function(t){const e=Object.prototype.toString;function r(h){return typeof h<"u"}t.defined=r;function n(h){return typeof h>"u"}t.undefined=n;function i(h){return h===!0||h===!1}t.boolean=i;function a(h){return e.call(h)==="[object String]"}t.string=a;function s(h){return e.call(h)==="[object Number]"}t.number=s;function o(h,E,b){return e.call(h)==="[object Number]"&&E<=h&&h<=b}t.numberRange=o;function l(h){return e.call(h)==="[object Number]"&&-2147483648<=h&&h<=2147483647}t.integer=l;function c(h){return e.call(h)==="[object Number]"&&0<=h&&h<=2147483647}t.uinteger=c;function u(h){return e.call(h)==="[object Function]"}t.func=u;function d(h){return h!==null&&typeof h=="object"}t.objectLiteral=d;function m(h,E){return Array.isArray(h)&&h.every(E)}t.typedArray=m})(v||(v={}));const ky=Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return Ft},get ChangeAnnotation(){return kr},get ChangeAnnotationIdentifier(){return De},get CodeAction(){return dl},get CodeActionContext(){return fl},get CodeActionKind(){return ul},get CodeActionTriggerKind(){return Gi},get CodeDescription(){return Uo},get CodeLens(){return hl},get Color(){return hs},get ColorInformation(){return Do},get ColorPresentation(){return Mo},get Command(){return Pr},get CompletionItem(){return Zo},get CompletionItemKind(){return Vo},get CompletionItemLabelDetails(){return Jo},get CompletionItemTag(){return Ho},get CompletionList(){return Qo},get CreateFile(){return _n},get DeleteFile(){return In},get Diagnostic(){return xi},get DiagnosticRelatedInformation(){return ps},get DiagnosticSeverity(){return jo},get DiagnosticTag(){return zo},get DocumentHighlight(){return il},get DocumentHighlightKind(){return nl},get DocumentLink(){return ml},get DocumentSymbol(){return cl},get DocumentUri(){return Oo},EOL:Sy,get FoldingRange(){return Go},get FoldingRangeKind(){return Fo},get FormattingOptions(){return pl},get Hover(){return el},get InlayHint(){return Cl},get InlayHintKind(){return ys},get InlayHintLabelPart(){return Ts},get InlineCompletionContext(){return Nl},get InlineCompletionItem(){return wl},get InlineCompletionList(){return kl},get InlineCompletionTriggerKind(){return bl},get InlineValueContext(){return $l},get InlineValueEvaluatableExpression(){return Al},get InlineValueText(){return vl},get InlineValueVariableLookup(){return El},get InsertReplaceEdit(){return Xo},get InsertTextFormat(){return Ko},get InsertTextMode(){return Yo},get Location(){return Li},get LocationLink(){return xo},get MarkedString(){return Fi},get MarkupContent(){return Pn},get MarkupKind(){return gs},get OptionalVersionedTextDocumentIdentifier(){return Mi},get ParameterInformation(){return tl},get Position(){return Z},get Range(){return K},get RenameFile(){return Nn},get SelectedCompletionInfo(){return _l},get SelectionRange(){return gl},get SemanticTokenModifiers(){return Tl},get SemanticTokenTypes(){return yl},get SemanticTokens(){return Rl},get SignatureInformation(){return rl},get StringValue(){return Sl},get SymbolInformation(){return ol},get SymbolKind(){return al},get SymbolTag(){return sl},get TextDocument(){return Pl},get TextDocumentEdit(){return Di},get TextDocumentIdentifier(){return qo},get TextDocumentItem(){return Wo},get TextEdit(){return yt},get URI(){return ds},get VersionedTextDocumentIdentifier(){return Bo},WorkspaceChange:Cy,get WorkspaceEdit(){return ms},get WorkspaceFolder(){return Il},get WorkspaceSymbol(){return ll},get integer(){return Lo},get uinteger(){return Oi}},Symbol.toStringTag,{value:"Module"}));class by{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Id(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new hc;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new Ol(e.startOffset,e.image.length,Eo(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){const r=e.container;if(r){const n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){const r=[];for(const a of e){const s=new Ol(a.startOffset,a.image.length,Eo(a),a.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;){const a=n.container.content.indexOf(n);if(a>0){n.container.content.splice(a,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}}class Nd{get hidden(){return!1}get astNode(){var r,n;const e=typeof((r=this._astNode)==null?void 0:r.$type)=="string"?this._astNode:(n=this.container)==null?void 0:n.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)}}class Ol extends Nd{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,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=i,this._length=r,this._range=n}}class hc extends Nd{constructor(){super(...arguments),this.content=new pc(this)}get offset(){var e;return((e=this.firstNonHiddenNode)==null?void 0:e.offset)??0}get length(){return this.end-this.offset}get end(){var e;return((e=this.lastNonHiddenNode)==null?void 0:e.end)??0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{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:Z.create(0,0),end:Z.create(0,0)}}get firstNonHiddenNode(){for(const 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--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}}class pc extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,pc.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(const r of e)r.container=this.parent}}class Id extends hc{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const Ll=Symbol("Datatype");function Vs(t){return t.$type===Ll}const su="",Pd=t=>t.endsWith(su)?t:t+su;class Od{constructor(e){var i;this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";(i=e.shared.profilers.LangiumProfiler)!=null&&i.isActive("parsing")?this.wrapper=new Oy(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new xd(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider})}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()}}class _y extends Od{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new by,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){const n=this.computeRuleType(e);let i;es(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(Pd(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),Bt(e)&&e.entry&&(this.mainRule=a),a}registerPrecedenceMap(e){const r=e.name,n=new Map;for(let i=0;i<e.operators.precedences.length;i++){const a=e.operators.precedences[i];for(const s of a.operators)n.set(s.value,{precedence:i,rightAssoc:a.associativity==="right"})}this.operatorPrecedence.set(r,n)}computeRuleType(e){return es(e)?Pi(e):e.fragment?void 0:Gf(e)?Ll:Pi(e)}parse(e,r={}){this.nodeBuilder.buildRootNode(e);const n=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=n.tokens;const 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.");const a=this.doParse(i);return this.nodeBuilder.addHiddenNodes(n.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,ho(a,{deep:!0}),{value:a,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=>{const a=!this.isRecording()&&e!==void 0;if(a){const s={$type:e};this.stack.push(s),e===Ll?s.value="":r!==void 0&&(s.$infixName=r)}return n(i),a?this.construct():void 0}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const 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){const i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){const a=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,crossRef:l}=this.getAssignment(n),c=this.current;if(o){const u=_r(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,u,s,l)}else if(Vs(c)){let u=i.image;_r(n)||(u=this.converter.convert(u,s).toString()),c.value+=u}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,a){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,r,a)}finally{this.isRecording()||(o===void 0&&!n&&(o=this.construct()),o!==void 0&&s&&s.length>0&&this.performSubruleAssignment(o,i,s))}}performSubruleAssignment(e,r,n){const{assignment:i,crossRef:a}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,a);else if(!i){const s=this.current;if(Vs(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}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);const a={$type:e};this.stack.push(a),this.assign(r.operator,r.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):Vs(e)?this.converter.convert(e.value,e.$cstNode):(Dh(this.astReflection,e),e)}constructInfix(e,r){const n=e.parts;if(!Array.isArray(n)||n.length===0)return;const i=e.operators;if(!Array.isArray(i)||n.length<2)return n[0];let a=0,s=-1;for(let b=0;b<i.length;b++){const I=i[b],C=r.get(I)??{precedence:1/0,rightAssoc:!1};C.precedence>s?(s=C.precedence,a=b):C.precedence===s&&(C.rightAssoc||(a=b))}const o=i.slice(0,a),l=i.slice(a+1),c=n.slice(0,a+1),u=n.slice(a+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:c,operators:o},m={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:l},h=this.constructInfix(d,r),E=this.constructInfix(m,r);return{$type:e.$type,$cstNode:e.$cstNode,left:h,operator:i[a],right:E}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=vs(e,br);this.assignmentMap.set(e,{assignment:r,crossRef:r&&As(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){const s=this.current;let o;switch(a==="single"&&typeof n=="string"?o=this.linker.buildReference(s,r,i,n):a==="multi"&&typeof n=="string"?o=this.linker.buildMultiReference(s,r,i,n):o=n,e){case"=":{s[r]=o;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(o)}}assignWithoutOverride(e,r){for(const[i,a]of Object.entries(r)){const s=e[i];s===void 0?e[i]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[i]=a)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}}class Ny{buildMismatchTokenMessage(e){return nn.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return nn.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return nn.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return nn.buildEarlyExitMessage(e)}}class Ld extends Ny{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}\`.`}}class Iy extends Od{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const 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){const n=this.wrapper.DEFINE_RULE(Pd(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=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const 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,a){this.before(i),this.wrapper.wrapSubrule(e,r,a),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}}const Py={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Ld};class xd extends Mg{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...Py,lookaheadStrategy:n?new oc({maxLookahead:r.maxLookahead}):new iy({logging:r.skipValidations?()=>{}:void 0}),...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,{})}}class Oy extends xd{constructor(e,r,n){super(e,r),this.task=n}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 Dd(t,e,r){return Ly({parser:e,tokens:r,ruleNames:new Map},t),e}function Ly(t,e){const r=Lf(e,!1),n=de(e.rules).filter(Bt).filter(a=>r.has(a));for(const a of n){const s={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(a,Or(s,a.definition))}const i=de(e.rules).filter(es).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,xy(t,a))}function xy(t,e){const r=e.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(Wt(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(h=>h.operators),i={$type:"Group",elements:[]},a={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},s={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(a,s);const l={$container:s,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},c={...a,$container:s};s.elements.push(l,c);const d=n.map(h=>t.tokens[h.value]).map((h,E)=>({ALT:()=>t.parser.consume(E,h,l)}));let m;return h=>{m??(m=mc(t,r)),t.parser.subrule(0,m,!1,a,h),t.parser.many(0,{DEF:()=>{t.parser.alternatives(0,d),t.parser.subrule(1,m,!1,c,h)}})}}function Or(t,e,r=!1){let n;if(_r(e))n=Uy(t,e);else if(Es(e))n=Dy(t,e);else if(br(e))n=Or(t,e.terminal);else if(As(e))n=Md(t,e);else if(Nr(e))n=My(t,e);else if(kf(e))n=Gy(t,e);else if(_f(e))n=jy(t,e);else if(Ql(e))n=zy(t,e);else if(Uh(e)){const i=t.consume++;n=()=>t.parser.consume(i,tr,e)}else throw new If(e.$cstNode,`Unexpected element type: ${e.$type}`);return Fd(t,r?void 0:Rs(e),n,e.cardinality)}function Dy(t,e){const r=Pi(e);return()=>t.parser.action(r,e)}function My(t,e){const r=e.rule.ref;if(Bi(r)){const n=t.subrule++,i=Bt(r)&&r.fragment,a=e.arguments.length>0?Fy(r,e.arguments):()=>({});let s;return o=>{s??(s=mc(t,r)),t.parser.subrule(n,s,i,e,a(o))}}else if(Wt(r)){const n=t.consume++,i=xl(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)Wi();else throw new If(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function Fy(t,e){if(e.some(n=>n.calledByName)){const n=e.map(i=>{var a,s;return{parameterName:(s=(a=i.parameter)==null?void 0:a.ref)==null?void 0:s.name,predicate:gt(i.value)}});return i=>{const a={};for(const{parameterName:s,predicate:o}of n)s&&(a[s]=o(i));return a}}else{const n=e.map(i=>gt(i.value));return i=>{const a={};for(let s=0;s<n.length;s++)if(s<t.parameters.length){const o=t.parameters[s].name,l=n[s];a[o]=l(i)}return a}}}function gt(t){if(zh(t)){const e=gt(t.left),r=gt(t.right);return n=>e(n)||r(n)}else if(jh(t)){const e=gt(t.left),r=gt(t.right);return n=>e(n)&&r(n)}else if(Wh(t)){const e=gt(t.value);return r=>!e(r)}else if(Vh(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(Fh(t)){const e=!!t.true;return()=>e}Wi()}function Gy(t,e){if(e.elements.length===1)return Or(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:Or(t,i,!0)},s=Rs(i);s&&(a.GATE=gt(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:()=>a.ALT(i)},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}function jy(t,e){if(e.elements.length===1)return Or(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:Or(t,o,!0)},c=Rs(o);c&&(l.GATE=gt(c)),r.push(l)}const n=t.or++,i=(o,l)=>{const c=l.getRuleStack().join("-");return`uGroup_${o}_${c}`},a=o=>t.parser.alternatives(n,r.map((l,c)=>{const u={ALT:()=>!0},d=t.parser;u.ALT=()=>{if(l.ALT(o),!d.isRecording()){const h=i(n,d);d.unorderedGroups.get(h)||d.unorderedGroups.set(h,[]);const E=d.unorderedGroups.get(h);typeof(E==null?void 0:E[c])>"u"&&(E[c]=!0)}};const m=l.GATE;return m?u.GATE=()=>m(o):u.GATE=()=>{const h=d.unorderedGroups.get(i(n,d));return!(h!=null&&h[c])},u})),s=Fd(t,Rs(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function zy(t,e){const r=e.elements.map(n=>Or(t,n));return n=>r.forEach(i=>i(n))}function Rs(t){if(Ql(t))return t.guardCondition}function Md(t,e,r=e.terminal){if(r)if(Nr(r)&&Bt(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return s=>{a??(a=mc(t,n)),t.parser.subrule(i,a,!1,e,s)}}else if(Nr(r)&&Wt(r.rule.ref)){const n=t.consume++,i=xl(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(_r(r)){const n=t.consume++,i=xl(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);const n=Mf(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+Pi(e.type.ref));return Md(t,e,i)}}function Uy(t,e){const 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 Fd(t,e,r,n){const i=e&>(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:()=>r(s),GATE:()=>i(s)},{ALT:tu(),GATE:()=>!i(s)}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else if(n==="+"){const a=t.many++;if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:()=>t.parser.atLeastOne(a,{DEF:()=>r(o)}),GATE:()=>i(o)},{ALT:tu(),GATE:()=>!i(o)}])}else return s=>t.parser.atLeastOne(a,{DEF:()=>r(s)})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else Wi()}function mc(t,e){const r=qy(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function qy(t,e){if(Bi(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Bt(n);)(Ql(n)||kf(n)||_f(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 xl(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}function By(t){const e=t.Grammar,r=t.parser.Lexer,n=new Iy(t);return Dd(e,n,r.definition),n.finalize(),n}function Wy(t){const e=Vy(t);return e.finalize(),e}function Vy(t){const e=t.Grammar,r=t.parser.Lexer,n=new _y(t);return Dd(e,n,r.definition)}class Gd{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=de(Lf(e,!1)),i=this.buildTerminalTokens(n),a=this.buildKeywordTokens(n,i,r);return a.push(...i),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Wt).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=tc(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=Of(r)?We.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(Bi).flatMap(i=>qi(i).filter(_r)).distinct(i=>i.value).toArray().sort((i,a)=>a.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!(n!=null&&n.caseInsensitive)))}buildKeywordToken(e,r,n){const i=this.buildKeywordPattern(e,n),a={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,r){return r?new RegExp(Cs(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const a=i==null?void 0:i.PATTERN;return a!=null&&a.source&&gp("^"+a.source+"$",e.value)&&n.push(i),n},[])}}class jd{convert(e,r){let n=r.grammarSource;if(As(n)&&(n=vp(n)),Nr(n)){const 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){var i;switch(e.name.toUpperCase()){case"INT":return Dt.convertInt(r);case"STRING":return Dt.convertString(r);case"ID":return Dt.convertID(r)}switch((i=kp(e))==null?void 0:i.toLowerCase()){case"number":return Dt.convertNumber(r);case"boolean":return Dt.convertBoolean(r);case"bigint":return Dt.convertBigint(r);case"date":return Dt.convertDate(r);default:return r}}}var Dt;(function(t){function e(c){let u="";for(let d=1;d<c.length-1;d++){const m=c.charAt(d);if(m==="\\"){const h=c.charAt(++d);u+=r(h)}else u+=m}return u}t.convertString=e;function r(c){switch(c){case"b":return"\b";case"f":return"\f";case"n":return`
|
|
121
|
+
`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return c}}function n(c){return c.charAt(0)==="^"?c.substring(1):c}t.convertID=n;function i(c){return parseInt(c)}t.convertInt=i;function a(c){return BigInt(c)}t.convertBigint=a;function s(c){return new Date(c)}t.convertDate=s;function o(c){return Number(c)}t.convertNumber=o;function l(c){return c.toLowerCase()==="true"}t.convertBoolean=l})(Dt||(Dt={}));var or={},Ca={},ou;function xr(){if(ou)return Ca;ou=1,Object.defineProperty(Ca,"__esModule",{value:!0});let t;function e(){if(t===void 0)throw new Error("No runtime abstraction layer installed");return t}return(function(r){function n(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");t=i}r.install=n})(e||(e={})),Ca.default=e,Ca}var Pe={},lu;function Ji(){if(lu)return Pe;lu=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.stringArray=Pe.array=Pe.func=Pe.error=Pe.number=Pe.string=Pe.boolean=void 0;function t(o){return o===!0||o===!1}Pe.boolean=t;function e(o){return typeof o=="string"||o instanceof String}Pe.string=e;function r(o){return typeof o=="number"||o instanceof Number}Pe.number=r;function n(o){return o instanceof Error}Pe.error=n;function i(o){return typeof o=="function"}Pe.func=i;function a(o){return Array.isArray(o)}Pe.array=a;function s(o){return a(o)&&o.every(l=>e(l))}return Pe.stringArray=s,Pe}var lr={},cu;function Mn(){if(cu)return lr;cu=1,Object.defineProperty(lr,"__esModule",{value:!0}),lr.Emitter=lr.Event=void 0;const t=xr();var e;(function(i){const a={dispose(){}};i.None=function(){return a}})(e||(lr.Event=e={}));class r{add(a,s=null,o){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(a),this._contexts.push(s),Array.isArray(o)&&o.push({dispose:()=>this.remove(a,s)})}remove(a,s=null){if(!this._callbacks)return;let o=!1;for(let l=0,c=this._callbacks.length;l<c;l++)if(this._callbacks[l]===a)if(this._contexts[l]===s){this._callbacks.splice(l,1),this._contexts.splice(l,1);return}else o=!0;if(o)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...a){if(!this._callbacks)return[];const s=[],o=this._callbacks.slice(0),l=this._contexts.slice(0);for(let c=0,u=o.length;c<u;c++)try{s.push(o[c].apply(l[c],a))}catch(d){(0,t.default)().console.error(d)}return s}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class n{constructor(a){this._options=a}get event(){return this._event||(this._event=(a,s,o)=>{this._callbacks||(this._callbacks=new r),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(a,s);const l={dispose:()=>{this._callbacks&&(this._callbacks.remove(a,s),l.dispose=n._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(o)&&o.push(l),l}),this._event}fire(a){this._callbacks&&this._callbacks.invoke.call(this._callbacks,a)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return lr.Emitter=n,n._noop=function(){},lr}var uu;function Ps(){if(uu)return or;uu=1,Object.defineProperty(or,"__esModule",{value:!0}),or.CancellationTokenSource=or.CancellationToken=void 0;const t=xr(),e=Ji(),r=Mn();var n;(function(o){o.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:r.Event.None}),o.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:r.Event.None});function l(c){const u=c;return u&&(u===o.None||u===o.Cancelled||e.boolean(u.isCancellationRequested)&&!!u.onCancellationRequested)}o.is=l})(n||(or.CancellationToken=n={}));const i=Object.freeze(function(o,l){const c=(0,t.default)().timer.setTimeout(o.bind(l),0);return{dispose(){c.dispose()}}});class a{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?i:(this._emitter||(this._emitter=new r.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class s{get token(){return this._token||(this._token=new a),this._token}cancel(){this._token?this._token.cancel():this._token=n.Cancelled}dispose(){this._token?this._token instanceof a&&this._token.dispose():this._token=n.None}}return or.CancellationTokenSource=s,or}var pe=Ps();function Ky(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let Xa=0,Hy=10;function Xy(){return Xa=performance.now(),new pe.CancellationTokenSource}const an=Symbol("OperationCancelled");function Os(t){return t===an}async function Ue(t){if(t===pe.CancellationToken.None)return;const e=performance.now();if(e-Xa>=Hy&&(Xa=e,await Ky(),Xa=performance.now()),t.isCancellationRequested)throw an}class gc{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}}class ji{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){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(ji.isIncremental(n)){const i=Ud(n.range),a=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(s,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let c=this._lineOffsets;const u=fu(n.text,!1,a);if(l-o===u.length)for(let m=0,h=u.length;m<h;m++)c[m+o+1]=u[m];else u.length<1e4?c.splice(o+1,l-o,...u):this._lineOffsets=c=c.slice(0,o+1).concat(u,c.slice(l+1));const d=n.text.length-(s-a);if(d!==0)for(let m=o+1+u.length,h=c.length;m<h;m++)c[m]=c[m]+d}else if(ji.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=fu(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);const r=this.getLineOffsets();let n=0,i=r.length;if(i===0)return{line:0,character:e};for(;n<i;){const s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}const a=n-1;return e=this.ensureBeforeEOL(e,r[a]),{line:a,character:e-r[a]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1<r.length?r[e.line+1]:this._content.length,a=Math.min(n+e.character,i);return this.ensureBeforeEOL(a,n)}ensureBeforeEOL(e,r){for(;e>r&&zd(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}}var Dl;(function(t){function e(i,a,s,o){return new ji(i,a,s,o)}t.create=e;function r(i,a,s){if(i instanceof ji)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=r;function n(i,a){const s=i.getText(),o=Ml(a.map(Yy),(u,d)=>{const m=u.range.start.line-d.range.start.line;return m===0?u.range.start.character-d.range.start.character:m});let l=0;const c=[];for(const u of o){const d=i.offsetAt(u.range.start);if(d<l)throw new Error("Overlapping edit");d>l&&c.push(s.substring(l,d)),u.newText.length&&c.push(u.newText),l=i.offsetAt(u.range.end)}return c.push(s.substr(l)),c.join("")}t.applyEdits=n})(Dl||(Dl={}));function Ml(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);Ml(n,e),Ml(i,e);let a=0,s=0,o=0;for(;a<n.length&&s<i.length;)e(n[a],i[s])<=0?t[o++]=n[a++]:t[o++]=i[s++];for(;a<n.length;)t[o++]=n[a++];for(;s<i.length;)t[o++]=i[s++];return t}function fu(t,e,r=0){const n=e?[r]:[];for(let i=0;i<t.length;i++){const a=t.charCodeAt(i);zd(a)&&(a===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function zd(t){return t===13||t===10}function Ud(t){const 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 Yy(t){const e=Ud(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var qd;(()=>{var t={975:_=>{function R(y){if(typeof y!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(y))}function g(y,T){for(var A,L="",D=0,x=-1,j=0,F=0;F<=y.length;++F){if(F<y.length)A=y.charCodeAt(F);else{if(A===47)break;A=47}if(A===47){if(!(x===F-1||j===1))if(x!==F-1&&j===2){if(L.length<2||D!==2||L.charCodeAt(L.length-1)!==46||L.charCodeAt(L.length-2)!==46){if(L.length>2){var te=L.lastIndexOf("/");if(te!==L.length-1){te===-1?(L="",D=0):D=(L=L.slice(0,te)).length-1-L.lastIndexOf("/"),x=F,j=0;continue}}else if(L.length===2||L.length===1){L="",D=0,x=F,j=0;continue}}T&&(L.length>0?L+="/..":L="..",D=2)}else L.length>0?L+="/"+y.slice(x+1,F):L=y.slice(x+1,F),D=F-x-1;x=F,j=0}else A===46&&j!==-1?++j:j=-1}return L}var $={resolve:function(){for(var y,T="",A=!1,L=arguments.length-1;L>=-1&&!A;L--){var D;L>=0?D=arguments[L]:(y===void 0&&(y=process.cwd()),D=y),R(D),D.length!==0&&(T=D+"/"+T,A=D.charCodeAt(0)===47)}return T=g(T,!A),A?T.length>0?"/"+T:"/":T.length>0?T:"."},normalize:function(y){if(R(y),y.length===0)return".";var T=y.charCodeAt(0)===47,A=y.charCodeAt(y.length-1)===47;return(y=g(y,!T)).length!==0||T||(y="."),y.length>0&&A&&(y+="/"),T?"/"+y:y},isAbsolute:function(y){return R(y),y.length>0&&y.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var y,T=0;T<arguments.length;++T){var A=arguments[T];R(A),A.length>0&&(y===void 0?y=A:y+="/"+A)}return y===void 0?".":$.normalize(y)},relative:function(y,T){if(R(y),R(T),y===T||(y=$.resolve(y))===(T=$.resolve(T)))return"";for(var A=1;A<y.length&&y.charCodeAt(A)===47;++A);for(var L=y.length,D=L-A,x=1;x<T.length&&T.charCodeAt(x)===47;++x);for(var j=T.length-x,F=D<j?D:j,te=-1,z=0;z<=F;++z){if(z===F){if(j>F){if(T.charCodeAt(x+z)===47)return T.slice(x+z+1);if(z===0)return T.slice(x+z)}else D>F&&(y.charCodeAt(A+z)===47?te=z:z===0&&(te=0));break}var Q=y.charCodeAt(A+z);if(Q!==T.charCodeAt(x+z))break;Q===47&&(te=z)}var Ne="";for(z=A+te+1;z<=L;++z)z!==L&&y.charCodeAt(z)!==47||(Ne.length===0?Ne+="..":Ne+="/..");return Ne.length>0?Ne+T.slice(x+te):(x+=te,T.charCodeAt(x)===47&&++x,T.slice(x))},_makeLong:function(y){return y},dirname:function(y){if(R(y),y.length===0)return".";for(var T=y.charCodeAt(0),A=T===47,L=-1,D=!0,x=y.length-1;x>=1;--x)if((T=y.charCodeAt(x))===47){if(!D){L=x;break}}else D=!1;return L===-1?A?"/":".":A&&L===1?"//":y.slice(0,L)},basename:function(y,T){if(T!==void 0&&typeof T!="string")throw new TypeError('"ext" argument must be a string');R(y);var A,L=0,D=-1,x=!0;if(T!==void 0&&T.length>0&&T.length<=y.length){if(T.length===y.length&&T===y)return"";var j=T.length-1,F=-1;for(A=y.length-1;A>=0;--A){var te=y.charCodeAt(A);if(te===47){if(!x){L=A+1;break}}else F===-1&&(x=!1,F=A+1),j>=0&&(te===T.charCodeAt(j)?--j==-1&&(D=A):(j=-1,D=F))}return L===D?D=F:D===-1&&(D=y.length),y.slice(L,D)}for(A=y.length-1;A>=0;--A)if(y.charCodeAt(A)===47){if(!x){L=A+1;break}}else D===-1&&(x=!1,D=A+1);return D===-1?"":y.slice(L,D)},extname:function(y){R(y);for(var T=-1,A=0,L=-1,D=!0,x=0,j=y.length-1;j>=0;--j){var F=y.charCodeAt(j);if(F!==47)L===-1&&(D=!1,L=j+1),F===46?T===-1?T=j:x!==1&&(x=1):T!==-1&&(x=-1);else if(!D){A=j+1;break}}return T===-1||L===-1||x===0||x===1&&T===L-1&&T===A+1?"":y.slice(T,L)},format:function(y){if(y===null||typeof y!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof y);return(function(T,A){var L=A.dir||A.root,D=A.base||(A.name||"")+(A.ext||"");return L?L===A.root?L+D:L+"/"+D:D})(0,y)},parse:function(y){R(y);var T={root:"",dir:"",base:"",ext:"",name:""};if(y.length===0)return T;var A,L=y.charCodeAt(0),D=L===47;D?(T.root="/",A=1):A=0;for(var x=-1,j=0,F=-1,te=!0,z=y.length-1,Q=0;z>=A;--z)if((L=y.charCodeAt(z))!==47)F===-1&&(te=!1,F=z+1),L===46?x===-1?x=z:Q!==1&&(Q=1):x!==-1&&(Q=-1);else if(!te){j=z+1;break}return x===-1||F===-1||Q===0||Q===1&&x===F-1&&x===j+1?F!==-1&&(T.base=T.name=j===0&&D?y.slice(1,F):y.slice(j,F)):(j===0&&D?(T.name=y.slice(1,x),T.base=y.slice(1,F)):(T.name=y.slice(j,x),T.base=y.slice(j,F)),T.ext=y.slice(x,F)),j>0?T.dir=y.slice(0,j-1):D&&(T.dir="/"),T},sep:"/",delimiter:":",win32:null,posix:null};$.posix=$,_.exports=$}},e={};function r(_){var R=e[_];if(R!==void 0)return R.exports;var g=e[_]={exports:{}};return t[_](g,g.exports,r),g.exports}r.d=(_,R)=>{for(var g in R)r.o(R,g)&&!r.o(_,g)&&Object.defineProperty(_,g,{enumerable:!0,get:R[g]})},r.o=(_,R)=>Object.prototype.hasOwnProperty.call(_,R),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:()=>m,Utils:()=>le}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const a=/^\w[\w\d+.-]*$/,s=/^\//,o=/^\/\//;function l(_,R){if(!_.scheme&&R)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${_.authority}", path: "${_.path}", query: "${_.query}", fragment: "${_.fragment}"}`);if(_.scheme&&!a.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(o.test(_.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const c="",u="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class m{constructor(R,g,$,y,T,A=!1){Jt(this,"scheme");Jt(this,"authority");Jt(this,"path");Jt(this,"query");Jt(this,"fragment");typeof R=="object"?(this.scheme=R.scheme||c,this.authority=R.authority||c,this.path=R.path||c,this.query=R.query||c,this.fragment=R.fragment||c):(this.scheme=(function(L,D){return L||D?L:"file"})(R,A),this.authority=g||c,this.path=(function(L,D){switch(L){case"https":case"http":case"file":D?D[0]!==u&&(D=u+D):D=u}return D})(this.scheme,$||c),this.query=y||c,this.fragment=T||c,l(this,A))}static isUri(R){return R instanceof m||!!R&&typeof R.authority=="string"&&typeof R.fragment=="string"&&typeof R.path=="string"&&typeof R.query=="string"&&typeof R.scheme=="string"&&typeof R.fsPath=="string"&&typeof R.with=="function"&&typeof R.toString=="function"}get fsPath(){return w(this)}with(R){if(!R)return this;let{scheme:g,authority:$,path:y,query:T,fragment:A}=R;return g===void 0?g=this.scheme:g===null&&(g=c),$===void 0?$=this.authority:$===null&&($=c),y===void 0?y=this.path:y===null&&(y=c),T===void 0?T=this.query:T===null&&(T=c),A===void 0?A=this.fragment:A===null&&(A=c),g===this.scheme&&$===this.authority&&y===this.path&&T===this.query&&A===this.fragment?this:new E(g,$,y,T,A)}static parse(R,g=!1){const $=d.exec(R);return $?new E($[2]||c,B($[4]||c),B($[5]||c),B($[7]||c),B($[9]||c),g):new E(c,c,c,c,c)}static file(R){let g=c;if(i&&(R=R.replace(/\\/g,u)),R[0]===u&&R[1]===u){const $=R.indexOf(u,2);$===-1?(g=R.substring(2),R=u):(g=R.substring(2,$),R=R.substring($)||u)}return new E("file",g,R,c,c)}static from(R){const g=new E(R.scheme,R.authority,R.path,R.query,R.fragment);return l(g,!0),g}toString(R=!1){return S(this,R)}toJSON(){return this}static revive(R){if(R){if(R instanceof m)return R;{const g=new E(R);return g._formatted=R.external,g._fsPath=R._sep===h?R.fsPath:null,g}}return R}}const h=i?1:void 0;class E extends m{constructor(){super(...arguments);Jt(this,"_formatted",null);Jt(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=w(this)),this._fsPath}toString(g=!1){return g?S(this,!0):(this._formatted||(this._formatted=S(this,!1)),this._formatted)}toJSON(){const g={$mid:1};return this._fsPath&&(g.fsPath=this._fsPath,g._sep=h),this._formatted&&(g.external=this._formatted),this.path&&(g.path=this.path),this.scheme&&(g.scheme=this.scheme),this.authority&&(g.authority=this.authority),this.query&&(g.query=this.query),this.fragment&&(g.fragment=this.fragment),g}}const b={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 I(_,R,g){let $,y=-1;for(let T=0;T<_.length;T++){const A=_.charCodeAt(T);if(A>=97&&A<=122||A>=65&&A<=90||A>=48&&A<=57||A===45||A===46||A===95||A===126||R&&A===47||g&&A===91||g&&A===93||g&&A===58)y!==-1&&($+=encodeURIComponent(_.substring(y,T)),y=-1),$!==void 0&&($+=_.charAt(T));else{$===void 0&&($=_.substr(0,T));const L=b[A];L!==void 0?(y!==-1&&($+=encodeURIComponent(_.substring(y,T)),y=-1),$+=L):y===-1&&(y=T)}}return y!==-1&&($+=encodeURIComponent(_.substring(y))),$!==void 0?$:_}function C(_){let R;for(let g=0;g<_.length;g++){const $=_.charCodeAt(g);$===35||$===63?(R===void 0&&(R=_.substr(0,g)),R+=b[$]):R!==void 0&&(R+=_[g])}return R!==void 0?R:_}function w(_,R){let g;return g=_.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?_.path[1].toLowerCase()+_.path.substr(2):_.path,i&&(g=g.replace(/\//g,"\\")),g}function S(_,R){const g=R?C:I;let $="",{scheme:y,authority:T,path:A,query:L,fragment:D}=_;if(y&&($+=y,$+=":"),(T||y==="file")&&($+=u,$+=u),T){let x=T.indexOf("@");if(x!==-1){const j=T.substr(0,x);T=T.substr(x+1),x=j.lastIndexOf(":"),x===-1?$+=g(j,!1,!1):($+=g(j.substr(0,x),!1,!1),$+=":",$+=g(j.substr(x+1),!1,!0)),$+="@"}T=T.toLowerCase(),x=T.lastIndexOf(":"),x===-1?$+=g(T,!1,!0):($+=g(T.substr(0,x),!1,!0),$+=T.substr(x))}if(A){if(A.length>=3&&A.charCodeAt(0)===47&&A.charCodeAt(2)===58){const x=A.charCodeAt(1);x>=65&&x<=90&&(A=`/${String.fromCharCode(x+32)}:${A.substr(3)}`)}else if(A.length>=2&&A.charCodeAt(1)===58){const x=A.charCodeAt(0);x>=65&&x<=90&&(A=`${String.fromCharCode(x+32)}:${A.substr(2)}`)}$+=g(A,!0,!1)}return L&&($+="?",$+=g(L,!1,!1)),D&&($+="#",$+=R?D:I(D,!1,!1)),$}function P(_){try{return decodeURIComponent(_)}catch{return _.length>3?_.substr(0,3)+P(_.substr(3)):_}}const W=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function B(_){return _.match(W)?_.replace(W,(R=>P(R))):_}var H=r(975);const ne=H.posix||H,oe="/";var le;(function(_){_.joinPath=function(R,...g){return R.with({path:ne.join(R.path,...g)})},_.resolvePath=function(R,...g){let $=R.path,y=!1;$[0]!==oe&&($=oe+$,y=!0);let T=ne.resolve($,...g);return y&&T[0]===oe&&!R.authority&&(T=T.substring(1)),R.with({path:T})},_.dirname=function(R){if(R.path.length===0||R.path===oe)return R;let g=ne.dirname(R.path);return g.length===1&&g.charCodeAt(0)===46&&(g=""),R.with({path:g})},_.basename=function(R){return ne.basename(R.path)},_.extname=function(R){return ne.extname(R.path)}})(le||(le={})),qd=n})();const{URI:ft,Utils:ni}=qd;var Qe;(function(t){t.basename=ni.basename,t.dirname=ni.dirname,t.extname=ni.extname,t.joinPath=ni.joinPath,t.resolvePath=ni.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function r(s,o){return(s==null?void 0:s.toString())===(o==null?void 0:o.toString())}t.equals=r;function n(s,o){const l=typeof s=="string"?ft.parse(s).path:s.path,c=typeof o=="string"?ft.parse(o).path:o.path,u=l.split("/").filter(b=>b.length>0),d=c.split("/").filter(b=>b.length>0);if(e){const b=/^[A-Z]:$/;if(u[0]&&b.test(u[0])&&(u[0]=u[0].toLowerCase()),d[0]&&b.test(d[0])&&(d[0]=d[0].toLowerCase()),u[0]!==d[0])return c.substring(1)}let m=0;for(;m<u.length&&u[m]===d[m];m++);const h="../".repeat(u.length-m),E=d.slice(m).join("/");return h+E}t.relative=n;function i(s){return ft.parse(s.toString()).toString()}t.normalize=i;function a(s,o){let l=typeof s=="string"?s:s.path,c=typeof o=="string"?o:o.path;return c.charAt(c.length-1)==="/"&&(c=c.slice(0,-1)),l.charAt(l.length-1)==="/"&&(l=l.slice(0,-1)),c===l?!0:c.length<l.length||c.charAt(l.length)!=="/"?!1:c.startsWith(l)}t.contains=a})(Qe||(Qe={}));class Jy{constructor(){this.root={name:"",children:new Map}}normalizeUri(e){return Qe.normalize(e)}clear(){this.root.children.clear()}insert(e,r){const n=this.getNode(this.normalizeUri(e),!0);n.element=r}delete(e){const r=this.getNode(this.normalizeUri(e),!1);r!=null&&r.parent&&r.parent.children.delete(r.name)}has(e){var r;return((r=this.getNode(this.normalizeUri(e),!1))==null?void 0:r.element)!==void 0}hasNode(e){return this.getNode(this.normalizeUri(e),!1)!==void 0}find(e){var r;return(r=this.getNode(this.normalizeUri(e),!1))==null?void 0:r.element}findNode(e){const r=this.normalizeUri(e),n=this.getNode(r,!1);if(n)return{name:n.name,uri:Qe.joinPath(ft.parse(r),n.name).toString(),element:n.element}}findChildren(e){const r=this.normalizeUri(e),n=this.getNode(r,!1);return n?Array.from(n.children.values()).map(i=>({name:i.name,uri:Qe.joinPath(ft.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(Qe.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){const n=e.split("/");e.charAt(e.length-1)==="/"&&n.pop();let i=this.root;for(const a of n){let s=i.children.get(a);if(!s)if(r)s={name:a,children:new Map,parent:i},i.children.set(a,s);else return;i=s}return i}collectValues(e){const r=[];e.element&&r.push(e.element);for(const n of e.children.values())r.push(...this.collectValues(n));return r}}var V;(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"})(V||(V={}));class Zy{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=pe.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??ft.parse(e.uri),pe.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return pe.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"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let a;if(n)a={parseResult:e,uri:r,state:V.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:V.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){var s,o;const n=(s=e.parseResult.value.$cstNode)==null?void 0:s.root.fullText,i=(o=this.textDocuments)==null?void 0:o.get(e.uri.toString()),a=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const l=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:l})}return n!==a&&(e.parseResult=await this.parseAsync(e.uri,a,r),e.parseResult.value.$document=e),e.state=V.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){const n=this.serviceRegistry;let i;return()=>i??(i=Dl.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}}class Qy{constructor(e){this.documentTrie=new Jy,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return de(this.documentTrie.all())}addDocument(e){const 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){const r=e.toString();return this.documentTrie.find(r)}getDocuments(e){const 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));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,V.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=V.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=V.Changed;return this.documentTrie.delete(r),n}}const jr=Symbol("RefResolving");class eT{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,r=pe.CancellationToken.None){var n;if((n=this.profiler)!=null&&n.isActive("linking")){const i=this.profiler.createTask("linking",this.languageId);i.start();try{for(const a of zt(e.parseResult.value))await Ue(r),Qa(a).forEach(s=>{const o=`${a.$type}:${s.property}`;i.startSubTask(o);try{this.doLink(s,e)}finally{i.stopSubTask(o)}})}finally{i.stop()}}else for(const i of zt(e.parseResult.value))await Ue(r),Qa(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=jr;try{const i=this.getCandidate(e);if(Jn(i))n._ref=i;else{n._nodeDescription=i;const a=this.loadAstNode(i);n._ref=a??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);const a=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${a}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=jr;try{const i=this.getCandidates(e),a=[];if(Jn(i))n._linkingError=i;else for(const s of i){const o=this.loadAstNode(s);o&&a.push({ref:o,$nodeDescription:s})}n._items=a}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(const 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){const 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){const a=this,s={$refNode:n,$refText:i,_ref:void 0,get ref(){if(Fe(this._ref))return this._ref;if(Lh(this._nodeDescription)){const o=a.loadAstNode(this._nodeDescription);this._ref=o??a.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=jr;const o=Ma(e).$document,l=a.getLinkedNode({reference:s,container:e,property:r});if(l.error&&o&&o.state<V.ComputedScopes)return this._ref=void 0;this._ref=l.node??l.error,this._nodeDescription=l.descr,o==null||o.references.push(this)}else this._ref===jr&&a.throwCyclicReferenceError(e,r,i);return Fe(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return Jn(this._ref)?this._ref:void 0}};return s}buildMultiReference(e,r,n,i){const a=this,s={$refNode:n,$refText:i,_items:void 0,get items(){if(Array.isArray(this._items))return this._items;if(this._items===void 0){this._items=jr;const o=Ma(e).$document,l=a.getCandidates({reference:s,container:e,property:r}),c=[];if(Jn(l))this._linkingError=l;else for(const u of l){const d=a.loadAstNode(u);d&&c.push({ref:d,$nodeDescription:u})}this._items=c,o==null||o.references.push(this)}else this._items===jr&&a.throwCyclicReferenceError(e,r,i);return Array.isArray(this._items)?this._items:[]},get error(){if(this._linkingError)return this._linkingError;if(!(this.items.length>0))return this._linkingError=a.createLinkingError({reference:s,container:e,property:r})}};return s}throwCyclicReferenceError(e,r,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${n}')`)}getLinkedNode(e){try{const r=this.getCandidate(e);if(Jn(r))return{error:r};const 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);const 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;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=Ma(e.container).$document;n&&n.state<V.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`);const i=this.reflection.getReferenceType(e);return{info:e,message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:r}}}function tT(t){return typeof t.name=="string"}class rT{getName(e){if(tT(e))return e.name}getNameNode(e){return Df(e.$cstNode,"name")}}class nT{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=zt(e.Grammar).some(r=>As(r)&&r.isMulti)}findDeclarations(e){if(e){const r=Sp(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(ut(i)||Qt(i))return Ec(i);if(Array.isArray(i)){for(const a of i)if((ut(a)||Qt(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return Ec(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||rp(e,i)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(const i of Qa(n))if(Qt(i.reference)&&i.reference.items.some(a=>a.ref===e))return i.reference.items.map(a=>a.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const r=this.findDeclarations(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i)??i.$cstNode;a&&n.push(a)}return n}findReferences(e,r){const n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(a=>Qe.equals(a.sourceUri,r.documentUri))),n.push(...i),de(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const s=jt(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:ts(a),local:!0})}}return n}}class zi{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return fo.sum(de(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const 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){const r=this.map.get(e);return r?de(r):Sf}has(e,r){if(r===void 0)return this.map.has(e);{const 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 de(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return de(this.map.keys())}values(){return de(this.map.values()).flat()}entriesGroupedByKey(){return de(this.map.entries())}}class du{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[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){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}}class iT{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=pe.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=Zl,i=pe.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const s of n(e))await Ue(i),this.addExportedSymbol(s,a,r);return a}addExportedSymbol(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=pe.CancellationToken.None){const n=e.parseResult.value,i=new zi;for(const a of qi(n))await Ue(r),this.addLocalSymbol(a,e,i);return i}addLocalSymbol(e,r,n){const i=e.$container;if(i){const a=this.nameProvider.getName(e);a&&n.add(i,this.descriptions.createDescription(e,a,r))}}}class hu{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const 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){const 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}}class aT{constructor(e,r,n){this.elements=new zi,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(a,i)}this.outerScope=r}getElement(e){const 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){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?de(n).concat(this.outerScope.getElements(e)):de(n)}getAllElements(){let e=de(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class Bd{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")}}class sT extends Bd{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){const 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()}}class oT extends Bd{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();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const a=n();return i.set(r,a),a}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}}class lT extends sT{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()}))}}class cT{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 lT(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=jt(e.container).localSymbols;if(i){let s=e.container;do i.has(s)&&r.push(i.getStream(s).filter(o=>this.reflection.isSubtype(o.type,n))),s=s.$container;while(s)}let a=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)a=this.createScope(r[s],a);return a}createScope(e,r,n){return new hu(de(e),r,n)}createScopeForNodes(e,r,n){const i=de(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new hu(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new aT(this.indexManager.allElements(e)))}}function uT(t){return typeof t.$comment=="string"}function pu(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class fT{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){const n=r??{},i=r==null?void 0:r.replacer,a=(o,l)=>this.replacer(o,l,n),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=jt(e),JSON.stringify(e,s,r==null?void 0:r.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:a,comments:s,uriConverter:o}){var l,c,u;if(!this.ignoreProperties.has(e))if(ut(r)){const d=r.ref,m=n?r.$refText:void 0;if(d){const h=jt(d);let E="";this.currentDocument&&this.currentDocument!==h&&(o?E=o(h.uri,d):E=h.uri.toString());const b=this.astNodeLocator.getAstNodePath(d);return{$ref:`${E}#${b}`,$refText:m}}else return{$error:((l=r.error)==null?void 0:l.message)??"Could not resolve reference",$refText:m}}else if(Qt(r)){const d=n?r.$refText:void 0,m=[];for(const h of r.items){const E=h.ref,b=jt(h.ref);let I="";this.currentDocument&&this.currentDocument!==b&&(o?I=o(b.uri,E):I=b.uri.toString());const C=this.astNodeLocator.getAstNodePath(E);m.push(`${I}#${C}`)}return{$refs:m,$refText:d}}else if(Fe(r)){let d;if(a&&(d=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&(d!=null&&d.$textRegion)&&(d.$textRegion.documentURI=(c=this.currentDocument)==null?void 0:c.uri.toString())),i&&!e&&(d??(d={...r}),d.$sourceText=(u=r.$cstNode)==null?void 0:u.text),s){d??(d={...r});const m=this.commentProvider.getComment(r);m&&(d.$comment=m.replace(/\r/g,""))}return d??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=n=>({offset:n.offset,end:n.end,length:n.length,range:n.range});if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=Ap(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(const[l,c]of Object.entries(e))if(Array.isArray(c))for(let u=0;u<c.length;u++){const d=c[u];pu(d)?c[u]=this.reviveReference(e,l,r,d,n):Fe(d)&&this.linkNode(d,r,n,e,l,u)}else pu(c)?e[l]=this.reviveReference(e,l,r,c,n):Fe(c)&&this.linkNode(c,r,n,e,l);const o=e;o.$container=i,o.$containerProperty=a,o.$containerIndex=s}reviveReference(e,r,n,i,a){let s=i.$refText,o=i.$error,l;if(i.$ref){const c=this.getRefNode(n,i.$ref,a.uriConverter);if(Fe(c))return s||(s=this.nameProvider.getName(c)),{$refText:s??"",ref:c};o=c}else if(i.$refs){const c=[];for(const u of i.$refs){const d=this.getRefNode(n,u,a.uriConverter);Fe(d)&&c.push({ref:d})}if(c.length===0)l={$refText:s??"",items:c},o??(o="Could not resolve multi-reference");else return{$refText:s??"",items:c}}if(o)return l??(l={$refText:s??"",ref:void 0}),l.error={info:{container:e,property:r,reference:l},message:o},l}getRefNode(e,r,n){try{const i=r.indexOf("#");if(i===0){const l=this.astNodeLocator.getAstNode(e,r.substring(1));return l||"Could not resolve path: "+r}if(i<0){const l=n?n(r):ft.parse(r),c=this.langiumDocuments.getDocument(l);return c?c.parseResult.value:"Could not find document for URI: "+r}const a=n?n(r.substring(0,i)):ft.parse(r.substring(0,i)),s=this.langiumDocuments.getDocument(a);if(!s)return"Could not find document for URI: "+r;if(i===r.length-1)return s.parseResult.value;const o=this.astNodeLocator.getAstNode(s.parseResult.value,r.substring(i+1));return o||"Could not resolve URI: "+r}catch(i){return String(i)}}}class dT{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.fileNameMap=new Map,this.textDocuments=e==null?void 0:e.workspace.TextDocuments}register(e){const r=e.LanguageMetaData;for(const 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(const 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){var s,o;if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const r=(o=(s=this.textDocuments)==null?void 0:s.get(e))==null?void 0:o.languageId;if(r!==void 0){const l=this.languageIdMap.get(r);if(l)return l}const n=Qe.extname(e),i=Qe.basename(e),a=this.fileNameMap.get(i)??this.fileExtensionMap.get(n);if(!a)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 a}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function bi(t){return{code:t}}var Fl;(function(t){t.defaults=["fast","slow","built-in"],t.all=t.defaults})(Fl||(Fl={}));class hT{constructor(e){this.entries=new zi,this.knownCategories=new Set(Fl.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(const[i,a]of Object.entries(e)){const s=a;if(Array.isArray(s))for(const o of s){const l={check:this.wrapValidationException(o,r),category:n};this.addEntry(i,l)}else if(typeof s=="function"){const o={check:this.wrapValidationException(s,r),category:n};this.addEntry(i,o)}else Wi()}}wrapValidationException(e,r){return async(n,i,a)=>{await this.handleException(()=>e.call(r,n,i,a),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(a){if(Os(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=de(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,a,s,o)=>{await this.handleException(()=>e.call(n,i,a,s,o),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}}const pT=Object.freeze({validateNode:!0,validateChildren:!0});class mT{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=pe.CancellationToken.None){const i=e.parseResult,a=[];if(await Ue(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ct.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ct.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ct.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(Os(s))throw s;console.error("An error occurred during validation:",s)}return await Ue(n),a}processLexingErrors(e,r,n){var a;const i=[...e.lexerErrors,...((a=e.lexerReport)==null?void 0:a.diagnostics)??[]];for(const s of i){const o=s.severity??"error",l={severity:Ks(o),range:{start:{line:s.line-1,character:s.column-1},end:{line:s.line-1,character:s.column+s.length-1}},message:s.message,data:yT(o),source:this.getSource()};r.push(l)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let a;if(isNaN(i.token.startOffset)){if("previousToken"in i){const s=i.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=Eo(i.token);if(a){const s={severity:Ks("error"),range:a,message:i.message,data:bi(ct.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){var i;for(const a of e.references){const s=a.error;if(s){const o={node:s.info.container,range:(i=a.$refNode)==null?void 0:i.range,property:s.info.property,index:s.info.index,data:{code:ct.LinkingError,containerType:s.info.container.$type,property:s.info.property,refText:s.info.reference.$refText}};r.push(this.toDiagnostic("error",s.message,o))}}}async validateAst(e,r,n=pe.CancellationToken.None){const i=[],a=(s,o,l)=>{i.push(this.toDiagnostic(s,o,l))};return await this.validateAstBefore(e,r,a,n),await this.validateAstNodes(e,r,a,n),await this.validateAstAfter(e,r,a,n),i}async validateAstBefore(e,r,n,i=pe.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await Ue(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=pe.CancellationToken.None){var a;if((a=this.profiler)!=null&&a.isActive("validating")){const s=this.profiler.createTask("validating",this.languageId);s.start();try{const o=zt(e).iterator();for(const l of o){s.startSubTask(l.$type);const c=this.validateSingleNodeOptions(l,r);if(c.validateNode)try{const u=this.validationRegistry.getChecks(l.$type,r.categories);for(const d of u)await d(l,n,i)}finally{s.stopSubTask(l.$type)}c.validateChildren||o.prune()}}finally{s.stop()}}else{const s=zt(e).iterator();for(const o of s){await Ue(i);const l=this.validateSingleNodeOptions(o,r);if(l.validateNode){const c=this.validationRegistry.getChecks(o.$type,r.categories);for(const u of c)await u(o,n,i)}l.validateChildren||s.prune()}}}validateSingleNodeOptions(e,r){return pT}async validateAstAfter(e,r,n,i=pe.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await Ue(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:gT(n),severity:Ks(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 gT(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=Df(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=$p(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 Ks(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 yT(t){switch(t){case"error":return bi(ct.LexingError);case"warning":return bi(ct.LexingWarning);case"info":return bi(ct.LexingInfo);case"hint":return bi(ct.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var ct;(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"})(ct||(ct={}));class TT{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??jt(e);r??(r=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${a} has no name.`);let s;const o=()=>s??(s=ts(this.nameProvider.getNameNode(e)??e.$cstNode));return{node:e,name:r,get nameSegment(){return o()},selectionSegment:ts(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}}class RT{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=pe.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of zt(i))await Ue(r),Qa(a).forEach(s=>{s.reference.error||n.push(...this.createInfoDescriptions(s))});return n}createInfoDescriptions(e){const r=e.reference;if(r.error||!r.$refNode)return[];let n=[];ut(r)&&r.$nodeDescription?n=[r.$nodeDescription]:Qt(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=jt(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=ts(r.$refNode);for(const l of n)s.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:Qe.equals(l.documentUri,i)});return s}}class vT{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const 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,a)=>{if(!i||a.length===0)return i;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1)),c=i[o];return c==null?void 0:c[l]}return i[a]},e)}}var ET=Mn();class AT{constructor(e){this._ready=new gc,this.onConfigurationSectionUpdateEmitter=new ET.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r;this.workspaceConfig=((r=e.capabilities.workspace)==null?void 0:r.configuration)??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,a)=>{this.updateSectionConfiguration(i.section,n[a])})}}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;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}var cr={},ur={},Sa={},Hs={},G={},mu;function Wd(){if(mu)return G;mu=1,Object.defineProperty(G,"__esModule",{value:!0}),G.Message=G.NotificationType9=G.NotificationType8=G.NotificationType7=G.NotificationType6=G.NotificationType5=G.NotificationType4=G.NotificationType3=G.NotificationType2=G.NotificationType1=G.NotificationType0=G.NotificationType=G.RequestType9=G.RequestType8=G.RequestType7=G.RequestType6=G.RequestType5=G.RequestType4=G.RequestType3=G.RequestType2=G.RequestType1=G.RequestType=G.RequestType0=G.AbstractMessageSignature=G.ParameterStructures=G.ResponseError=G.ErrorCodes=void 0;const t=Ji();var e;(function(R){R.ParseError=-32700,R.InvalidRequest=-32600,R.MethodNotFound=-32601,R.InvalidParams=-32602,R.InternalError=-32603,R.jsonrpcReservedErrorRangeStart=-32099,R.serverErrorStart=-32099,R.MessageWriteError=-32099,R.MessageReadError=-32098,R.PendingResponseRejected=-32097,R.ConnectionInactive=-32096,R.ServerNotInitialized=-32002,R.UnknownErrorCode=-32001,R.jsonrpcReservedErrorRangeEnd=-32e3,R.serverErrorEnd=-32e3})(e||(G.ErrorCodes=e={}));class r extends Error{constructor(g,$,y){super($),this.code=t.number(g)?g:e.UnknownErrorCode,this.data=y,Object.setPrototypeOf(this,r.prototype)}toJson(){const g={code:this.code,message:this.message};return this.data!==void 0&&(g.data=this.data),g}}G.ResponseError=r;class n{constructor(g){this.kind=g}static is(g){return g===n.auto||g===n.byName||g===n.byPosition}toString(){return this.kind}}G.ParameterStructures=n,n.auto=new n("auto"),n.byPosition=new n("byPosition"),n.byName=new n("byName");class i{constructor(g,$){this.method=g,this.numberOfParams=$}get parameterStructures(){return n.auto}}G.AbstractMessageSignature=i;class a extends i{constructor(g){super(g,0)}}G.RequestType0=a;class s extends i{constructor(g,$=n.auto){super(g,1),this._parameterStructures=$}get parameterStructures(){return this._parameterStructures}}G.RequestType=s;class o extends i{constructor(g,$=n.auto){super(g,1),this._parameterStructures=$}get parameterStructures(){return this._parameterStructures}}G.RequestType1=o;class l extends i{constructor(g){super(g,2)}}G.RequestType2=l;class c extends i{constructor(g){super(g,3)}}G.RequestType3=c;class u extends i{constructor(g){super(g,4)}}G.RequestType4=u;class d extends i{constructor(g){super(g,5)}}G.RequestType5=d;class m extends i{constructor(g){super(g,6)}}G.RequestType6=m;class h extends i{constructor(g){super(g,7)}}G.RequestType7=h;class E extends i{constructor(g){super(g,8)}}G.RequestType8=E;class b extends i{constructor(g){super(g,9)}}G.RequestType9=b;class I extends i{constructor(g,$=n.auto){super(g,1),this._parameterStructures=$}get parameterStructures(){return this._parameterStructures}}G.NotificationType=I;class C extends i{constructor(g){super(g,0)}}G.NotificationType0=C;class w extends i{constructor(g,$=n.auto){super(g,1),this._parameterStructures=$}get parameterStructures(){return this._parameterStructures}}G.NotificationType1=w;class S extends i{constructor(g){super(g,2)}}G.NotificationType2=S;class P extends i{constructor(g){super(g,3)}}G.NotificationType3=P;class W extends i{constructor(g){super(g,4)}}G.NotificationType4=W;class B extends i{constructor(g){super(g,5)}}G.NotificationType5=B;class H extends i{constructor(g){super(g,6)}}G.NotificationType6=H;class ne extends i{constructor(g){super(g,7)}}G.NotificationType7=ne;class oe extends i{constructor(g){super(g,8)}}G.NotificationType8=oe;class le extends i{constructor(g){super(g,9)}}G.NotificationType9=le;var _;return(function(R){function g(T){const A=T;return A&&t.string(A.method)&&(t.string(A.id)||t.number(A.id))}R.isRequest=g;function $(T){const A=T;return A&&t.string(A.method)&&T.id===void 0}R.isNotification=$;function y(T){const A=T;return A&&(A.result!==void 0||!!A.error)&&(t.string(A.id)||t.number(A.id)||A.id===null)}R.isResponse=y})(_||(G.Message=_={})),G}var wt={},gu;function Vd(){if(gu)return wt;gu=1;var t;Object.defineProperty(wt,"__esModule",{value:!0}),wt.LRUCache=wt.LinkedMap=wt.Touch=void 0;var e;(function(i){i.None=0,i.First=1,i.AsOld=i.First,i.Last=2,i.AsNew=i.Last})(e||(wt.Touch=e={}));class r{constructor(){this[t]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var a;return(a=this._head)==null?void 0:a.value}get last(){var a;return(a=this._tail)==null?void 0:a.value}has(a){return this._map.has(a)}get(a,s=e.None){const o=this._map.get(a);if(o)return s!==e.None&&this.touch(o,s),o.value}set(a,s,o=e.None){let l=this._map.get(a);if(l)l.value=s,o!==e.None&&this.touch(l,o);else{switch(l={key:a,value:s,next:void 0,previous:void 0},o){case e.None:this.addItemLast(l);break;case e.First:this.addItemFirst(l);break;case e.Last:this.addItemLast(l);break;default:this.addItemLast(l);break}this._map.set(a,l),this._size++}return this}delete(a){return!!this.remove(a)}remove(a){const s=this._map.get(a);if(s)return this._map.delete(a),this.removeItem(s),this._size--,s.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const a=this._head;return this._map.delete(a.key),this.removeItem(a),this._size--,a.value}forEach(a,s){const o=this._state;let l=this._head;for(;l;){if(s?a.bind(s)(l.value,l.key,this):a(l.value,l.key,this),this._state!==o)throw new Error("LinkedMap got modified during iteration.");l=l.next}}keys(){const a=this._state;let s=this._head;const o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==a)throw new Error("LinkedMap got modified during iteration.");if(s){const l={value:s.key,done:!1};return s=s.next,l}else return{value:void 0,done:!0}}};return o}values(){const a=this._state;let s=this._head;const o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==a)throw new Error("LinkedMap got modified during iteration.");if(s){const l={value:s.value,done:!1};return s=s.next,l}else return{value:void 0,done:!0}}};return o}entries(){const a=this._state;let s=this._head;const o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==a)throw new Error("LinkedMap got modified during iteration.");if(s){const l={value:[s.key,s.value],done:!1};return s=s.next,l}else return{value:void 0,done:!0}}};return o}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(a){if(a>=this.size)return;if(a===0){this.clear();return}let s=this._head,o=this.size;for(;s&&o>a;)this._map.delete(s.key),s=s.next,o--;this._head=s,this._size=o,s&&(s.previous=void 0),this._state++}addItemFirst(a){if(!this._head&&!this._tail)this._tail=a;else if(this._head)a.next=this._head,this._head.previous=a;else throw new Error("Invalid list");this._head=a,this._state++}addItemLast(a){if(!this._head&&!this._tail)this._head=a;else if(this._tail)a.previous=this._tail,this._tail.next=a;else throw new Error("Invalid list");this._tail=a,this._state++}removeItem(a){if(a===this._head&&a===this._tail)this._head=void 0,this._tail=void 0;else if(a===this._head){if(!a.next)throw new Error("Invalid list");a.next.previous=void 0,this._head=a.next}else if(a===this._tail){if(!a.previous)throw new Error("Invalid list");a.previous.next=void 0,this._tail=a.previous}else{const s=a.next,o=a.previous;if(!s||!o)throw new Error("Invalid list");s.previous=o,o.next=s}a.next=void 0,a.previous=void 0,this._state++}touch(a,s){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(s!==e.First&&s!==e.Last)){if(s===e.First){if(a===this._head)return;const o=a.next,l=a.previous;a===this._tail?(l.next=void 0,this._tail=l):(o.previous=l,l.next=o),a.previous=void 0,a.next=this._head,this._head.previous=a,this._head=a,this._state++}else if(s===e.Last){if(a===this._tail)return;const o=a.next,l=a.previous;a===this._head?(o.previous=void 0,this._head=o):(o.previous=l,l.next=o),a.next=void 0,a.previous=this._tail,this._tail.next=a,this._tail=a,this._state++}}}toJSON(){const a=[];return this.forEach((s,o)=>{a.push([o,s])}),a}fromJSON(a){this.clear();for(const[s,o]of a)this.set(s,o)}}wt.LinkedMap=r;class n extends r{constructor(a,s=1){super(),this._limit=a,this._ratio=Math.min(Math.max(0,s),1)}get limit(){return this._limit}set limit(a){this._limit=a,this.checkTrim()}get ratio(){return this._ratio}set ratio(a){this._ratio=Math.min(Math.max(0,a),1),this.checkTrim()}get(a,s=e.AsNew){return super.get(a,s)}peek(a){return super.get(a,e.None)}set(a,s){return super.set(a,s,e.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}return wt.LRUCache=n,wt}var ii={},yu;function $T(){if(yu)return ii;yu=1,Object.defineProperty(ii,"__esModule",{value:!0}),ii.Disposable=void 0;var t;return(function(e){function r(n){return{dispose:n}}e.create=r})(t||(ii.Disposable=t={})),ii}var fr={},Tu;function CT(){if(Tu)return fr;Tu=1,Object.defineProperty(fr,"__esModule",{value:!0}),fr.SharedArrayReceiverStrategy=fr.SharedArraySenderStrategy=void 0;const t=Ps();var e;(function(s){s.Continue=0,s.Cancelled=1})(e||(e={}));class r{constructor(){this.buffers=new Map}enableCancellation(o){if(o.id===null)return;const l=new SharedArrayBuffer(4),c=new Int32Array(l,0,1);c[0]=e.Continue,this.buffers.set(o.id,l),o.$cancellationData=l}async sendCancellation(o,l){const c=this.buffers.get(l);if(c===void 0)return;const u=new Int32Array(c,0,1);Atomics.store(u,0,e.Cancelled)}cleanup(o){this.buffers.delete(o)}dispose(){this.buffers.clear()}}fr.SharedArraySenderStrategy=r;class n{constructor(o){this.data=new Int32Array(o,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===e.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class i{constructor(o){this.token=new n(o)}cancel(){}dispose(){}}class a{constructor(){this.kind="request"}createCancellationTokenSource(o){const l=o.$cancellationData;return l===void 0?new t.CancellationTokenSource:new i(l)}}return fr.SharedArrayReceiverStrategy=a,fr}var kt={},ai={},Ru;function Kd(){if(Ru)return ai;Ru=1,Object.defineProperty(ai,"__esModule",{value:!0}),ai.Semaphore=void 0;const t=xr();class e{constructor(n=1){if(n<=0)throw new Error("Capacity must be greater than 0");this._capacity=n,this._active=0,this._waiting=[]}lock(n){return new Promise((i,a)=>{this._waiting.push({thunk:n,resolve:i,reject:a}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const n=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const i=n.thunk();i instanceof Promise?i.then(a=>{this._active--,n.resolve(a),this.runNext()},a=>{this._active--,n.reject(a),this.runNext()}):(this._active--,n.resolve(i),this.runNext())}catch(i){this._active--,n.reject(i),this.runNext()}}}return ai.Semaphore=e,ai}var vu;function ST(){if(vu)return kt;vu=1,Object.defineProperty(kt,"__esModule",{value:!0}),kt.ReadableStreamMessageReader=kt.AbstractMessageReader=kt.MessageReader=void 0;const t=xr(),e=Ji(),r=Mn(),n=Kd();var i;(function(l){function c(u){let d=u;return d&&e.func(d.listen)&&e.func(d.dispose)&&e.func(d.onError)&&e.func(d.onClose)&&e.func(d.onPartialMessage)}l.is=c})(i||(kt.MessageReader=i={}));class a{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter,this.partialMessageEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(c){this.errorEmitter.fire(this.asError(c))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(c){this.partialMessageEmitter.fire(c)}asError(c){return c instanceof Error?c:new Error(`Reader received error. Reason: ${e.string(c.message)?c.message:"unknown"}`)}}kt.AbstractMessageReader=a;var s;(function(l){function c(u){let d,m;const h=new Map;let E;const b=new Map;if(u===void 0||typeof u=="string")d=u??"utf-8";else{if(d=u.charset??"utf-8",u.contentDecoder!==void 0&&(m=u.contentDecoder,h.set(m.name,m)),u.contentDecoders!==void 0)for(const I of u.contentDecoders)h.set(I.name,I);if(u.contentTypeDecoder!==void 0&&(E=u.contentTypeDecoder,b.set(E.name,E)),u.contentTypeDecoders!==void 0)for(const I of u.contentTypeDecoders)b.set(I.name,I)}return E===void 0&&(E=(0,t.default)().applicationJson.decoder,b.set(E.name,E)),{charset:d,contentDecoder:m,contentDecoders:h,contentTypeDecoder:E,contentTypeDecoders:b}}l.fromOptions=c})(s||(s={}));class o extends a{constructor(c,u){super(),this.readable=c,this.options=s.fromOptions(u),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new n.Semaphore(1)}set partialMessageTimeout(c){this._partialMessageTimeout=c}get partialMessageTimeout(){return this._partialMessageTimeout}listen(c){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=c;const u=this.readable.onData(d=>{this.onData(d)});return this.readable.onError(d=>this.fireError(d)),this.readable.onClose(()=>this.fireClose()),u}onData(c){try{for(this.buffer.append(c);;){if(this.nextMessageLength===-1){const d=this.buffer.tryReadHeaders(!0);if(!d)return;const m=d.get("content-length");if(!m){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
122
|
+
${JSON.stringify(Object.fromEntries(d))}`));return}const h=parseInt(m);if(isNaN(h)){this.fireError(new Error(`Content-Length value must be a number. Got ${m}`));return}this.nextMessageLength=h}const u=this.buffer.tryReadBody(this.nextMessageLength);if(u===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const d=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(u):u,m=await this.options.contentTypeDecoder.decode(d,this.options);this.callback(m)}).catch(d=>{this.fireError(d)})}}catch(u){this.fireError(u)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((c,u)=>{this.partialMessageTimer=void 0,c===this.messageToken&&(this.firePartialMessage({messageToken:c,waitingTime:u}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}return kt.ReadableStreamMessageReader=o,kt}var bt={},Eu;function wT(){if(Eu)return bt;Eu=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.WriteableStreamMessageWriter=bt.AbstractMessageWriter=bt.MessageWriter=void 0;const t=xr(),e=Ji(),r=Kd(),n=Mn(),i="Content-Length: ",a=`\r
|
|
123
|
+
`;var s;(function(u){function d(m){let h=m;return h&&e.func(h.dispose)&&e.func(h.onClose)&&e.func(h.onError)&&e.func(h.write)}u.is=d})(s||(bt.MessageWriter=s={}));class o{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(d,m,h){this.errorEmitter.fire([this.asError(d),m,h])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(d){return d instanceof Error?d:new Error(`Writer received error. Reason: ${e.string(d.message)?d.message:"unknown"}`)}}bt.AbstractMessageWriter=o;var l;(function(u){function d(m){return m===void 0||typeof m=="string"?{charset:m??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:m.charset??"utf-8",contentEncoder:m.contentEncoder,contentTypeEncoder:m.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}u.fromOptions=d})(l||(l={}));class c extends o{constructor(d,m){super(),this.writable=d,this.options=l.fromOptions(m),this.errorCount=0,this.writeSemaphore=new r.Semaphore(1),this.writable.onError(h=>this.fireError(h)),this.writable.onClose(()=>this.fireClose())}async write(d){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(d,this.options).then(h=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(h):h).then(h=>{const E=[];return E.push(i,h.byteLength.toString(),a),E.push(a),this.doWrite(d,E,h)},h=>{throw this.fireError(h),h}))}async doWrite(d,m,h){try{return await this.writable.write(m.join(""),"ascii"),this.writable.write(h)}catch(E){return this.handleError(E,d),Promise.reject(E)}}handleError(d,m){this.errorCount++,this.fireError(d,m,this.errorCount)}end(){this.writable.end()}}return bt.WriteableStreamMessageWriter=c,bt}var si={},Au;function kT(){if(Au)return si;Au=1,Object.defineProperty(si,"__esModule",{value:!0}),si.AbstractMessageBuffer=void 0;const t=13,e=10,r=`\r
|
|
124
|
+
`;class n{constructor(a="utf-8"){this._encoding=a,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(a){const s=typeof a=="string"?this.fromString(a,this._encoding):a;this._chunks.push(s),this._totalLength+=s.byteLength}tryReadHeaders(a=!1){if(this._chunks.length===0)return;let s=0,o=0,l=0,c=0;e:for(;o<this._chunks.length;){const h=this._chunks[o];for(l=0;l<h.length;){switch(h[l]){case t:switch(s){case 0:s=1;break;case 2:s=3;break;default:s=0}break;case e:switch(s){case 1:s=2;break;case 3:s=4,l++;break e;default:s=0}break;default:s=0}l++}c+=h.byteLength,o++}if(s!==4)return;const u=this._read(c+l),d=new Map,m=this.toString(u,"ascii").split(r);if(m.length<2)return d;for(let h=0;h<m.length-2;h++){const E=m[h],b=E.indexOf(":");if(b===-1)throw new Error(`Message header must separate key and value using ':'
|
|
125
|
+
${E}`);const I=E.substr(0,b),C=E.substr(b+1).trim();d.set(a?I.toLowerCase():I,C)}return d}tryReadBody(a){if(!(this._totalLength<a))return this._read(a)}get numberOfBytes(){return this._totalLength}_read(a){if(a===0)return this.emptyBuffer();if(a>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===a){const c=this._chunks[0];return this._chunks.shift(),this._totalLength-=a,this.asNative(c)}if(this._chunks[0].byteLength>a){const c=this._chunks[0],u=this.asNative(c,a);return this._chunks[0]=c.slice(a),this._totalLength-=a,u}const s=this.allocNative(a);let o=0,l=0;for(;a>0;){const c=this._chunks[l];if(c.byteLength>a){const u=c.slice(0,a);s.set(u,o),o+=a,this._chunks[l]=c.slice(a),this._totalLength-=a,a-=a}else s.set(c,o),o+=c.byteLength,this._chunks.shift(),this._totalLength-=c.byteLength,a-=c.byteLength}return s}}return si.AbstractMessageBuffer=n,si}var Xs={},$u;function bT(){return $u||($u=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;const e=xr(),r=Ji(),n=Wd(),i=Vd(),a=Mn(),s=Ps();var o;(function(g){g.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(g){function $(y){return typeof y=="string"||typeof y=="number"}g.is=$})(l||(t.ProgressToken=l={}));var c;(function(g){g.type=new n.NotificationType("$/progress")})(c||(c={}));class u{constructor(){}}t.ProgressType=u;var d;(function(g){function $(y){return r.func(y)}g.is=$})(d||(d={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var m;(function(g){g[g.Off=0]="Off",g[g.Messages=1]="Messages",g[g.Compact=2]="Compact",g[g.Verbose=3]="Verbose"})(m||(t.Trace=m={}));var h;(function(g){g.Off="off",g.Messages="messages",g.Compact="compact",g.Verbose="verbose"})(h||(t.TraceValues=h={})),(function(g){function $(T){if(!r.string(T))return g.Off;switch(T=T.toLowerCase(),T){case"off":return g.Off;case"messages":return g.Messages;case"compact":return g.Compact;case"verbose":return g.Verbose;default:return g.Off}}g.fromString=$;function y(T){switch(T){case g.Off:return"off";case g.Messages:return"messages";case g.Compact:return"compact";case g.Verbose:return"verbose";default:return"off"}}g.toString=y})(m||(t.Trace=m={}));var E;(function(g){g.Text="text",g.JSON="json"})(E||(t.TraceFormat=E={})),(function(g){function $(y){return r.string(y)?(y=y.toLowerCase(),y==="json"?g.JSON:g.Text):g.Text}g.fromString=$})(E||(t.TraceFormat=E={}));var b;(function(g){g.type=new n.NotificationType("$/setTrace")})(b||(t.SetTraceNotification=b={}));var I;(function(g){g.type=new n.NotificationType("$/logTrace")})(I||(t.LogTraceNotification=I={}));var C;(function(g){g[g.Closed=1]="Closed",g[g.Disposed=2]="Disposed",g[g.AlreadyListening=3]="AlreadyListening"})(C||(t.ConnectionErrors=C={}));class w extends Error{constructor($,y){super(y),this.code=$,Object.setPrototypeOf(this,w.prototype)}}t.ConnectionError=w;var S;(function(g){function $(y){const T=y;return T&&r.func(T.cancelUndispatched)}g.is=$})(S||(t.ConnectionStrategy=S={}));var P;(function(g){function $(y){const T=y;return T&&(T.kind===void 0||T.kind==="id")&&r.func(T.createCancellationTokenSource)&&(T.dispose===void 0||r.func(T.dispose))}g.is=$})(P||(t.IdCancellationReceiverStrategy=P={}));var W;(function(g){function $(y){const T=y;return T&&T.kind==="request"&&r.func(T.createCancellationTokenSource)&&(T.dispose===void 0||r.func(T.dispose))}g.is=$})(W||(t.RequestCancellationReceiverStrategy=W={}));var B;(function(g){g.Message=Object.freeze({createCancellationTokenSource(y){return new s.CancellationTokenSource}});function $(y){return P.is(y)||W.is(y)}g.is=$})(B||(t.CancellationReceiverStrategy=B={}));var H;(function(g){g.Message=Object.freeze({sendCancellation(y,T){return y.sendNotification(o.type,{id:T})},cleanup(y){}});function $(y){const T=y;return T&&r.func(T.sendCancellation)&&r.func(T.cleanup)}g.is=$})(H||(t.CancellationSenderStrategy=H={}));var ne;(function(g){g.Message=Object.freeze({receiver:B.Message,sender:H.Message});function $(y){const T=y;return T&&B.is(T.receiver)&&H.is(T.sender)}g.is=$})(ne||(t.CancellationStrategy=ne={}));var oe;(function(g){function $(y){const T=y;return T&&r.func(T.handleMessage)}g.is=$})(oe||(t.MessageStrategy=oe={}));var le;(function(g){function $(y){const T=y;return T&&(ne.is(T.cancellationStrategy)||S.is(T.connectionStrategy)||oe.is(T.messageStrategy))}g.is=$})(le||(t.ConnectionOptions=le={}));var _;(function(g){g[g.New=1]="New",g[g.Listening=2]="Listening",g[g.Closed=3]="Closed",g[g.Disposed=4]="Disposed"})(_||(_={}));function R(g,$,y,T){const A=y!==void 0?y:t.NullLogger;let L=0,D=0,x=0;const j="2.0";let F;const te=new Map;let z;const Q=new Map,Ne=new Map;let ge,ce=new i.LinkedMap,ke=new Map,Ie=new Set,Ce=new Map,Y=m.Off,Xe=E.Text,ye,it=_.New;const Dr=new a.Emitter,jn=new a.Emitter,zn=new a.Emitter,Un=new a.Emitter,qn=new a.Emitter,at=T&&T.cancellationStrategy?T.cancellationStrategy:ne.Message;function Bn(p){if(p===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+p.toString()}function Zi(p){return p===null?"res-unknown-"+(++x).toString():"res-"+p.toString()}function Qi(){return"not-"+(++D).toString()}function ea(p,k){n.Message.isRequest(k)?p.set(Bn(k.id),k):n.Message.isResponse(k)?p.set(Zi(k.id),k):p.set(Qi(),k)}function ta(p){}function Wn(){return it===_.Listening}function Vn(){return it===_.Closed}function $t(){return it===_.Disposed}function Kn(){(it===_.New||it===_.Listening)&&(it=_.Closed,jn.fire(void 0))}function ra(p){Dr.fire([p,void 0,void 0])}function na(p){Dr.fire(p)}g.onClose(Kn),g.onError(ra),$.onClose(Kn),$.onError(na);function Hn(){ge||ce.size===0||(ge=(0,e.default)().timer.setImmediate(()=>{ge=void 0,ia()}))}function Xn(p){n.Message.isRequest(p)?sa(p):n.Message.isNotification(p)?la(p):n.Message.isResponse(p)?oa(p):ca(p)}function ia(){if(ce.size===0)return;const p=ce.shift();try{const k=T==null?void 0:T.messageStrategy;oe.is(k)?k.handleMessage(p,Xn):Xn(p)}finally{Hn()}}const aa=p=>{try{if(n.Message.isNotification(p)&&p.method===o.type.method){const k=p.params.id,O=Bn(k),M=ce.get(O);if(n.Message.isRequest(M)){const re=T==null?void 0:T.connectionStrategy,ie=re&&re.cancelUndispatched?re.cancelUndispatched(M,ta):void 0;if(ie&&(ie.error!==void 0||ie.result!==void 0)){ce.delete(O),Ce.delete(k),ie.id=M.id,ar(ie,p.method,Date.now()),$.write(ie).catch(()=>A.error("Sending response for canceled message failed."));return}}const ae=Ce.get(k);if(ae!==void 0){ae.cancel(),Mr(p);return}else Ie.add(k)}ea(ce,p)}finally{Hn()}};function sa(p){if($t())return;function k(X,ue,ee){const be={jsonrpc:j,id:p.id};X instanceof n.ResponseError?be.error=X.toJson():be.result=X===void 0?null:X,ar(be,ue,ee),$.write(be).catch(()=>A.error("Sending response failed."))}function O(X,ue,ee){const be={jsonrpc:j,id:p.id,error:X.toJson()};ar(be,ue,ee),$.write(be).catch(()=>A.error("Sending response failed."))}function M(X,ue,ee){X===void 0&&(X=null);const be={jsonrpc:j,id:p.id,result:X};ar(be,ue,ee),$.write(be).catch(()=>A.error("Sending response failed."))}da(p);const ae=te.get(p.method);let re,ie;ae&&(re=ae.type,ie=ae.handler);const Ae=Date.now();if(ie||F){const X=p.id??String(Date.now()),ue=P.is(at.receiver)?at.receiver.createCancellationTokenSource(X):at.receiver.createCancellationTokenSource(p);p.id!==null&&Ie.has(p.id)&&ue.cancel(),p.id!==null&&Ce.set(X,ue);try{let ee;if(ie)if(p.params===void 0){if(re!==void 0&&re.numberOfParams!==0){O(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${p.method} defines ${re.numberOfParams} params but received none.`),p.method,Ae);return}ee=ie(ue.token)}else if(Array.isArray(p.params)){if(re!==void 0&&re.parameterStructures===n.ParameterStructures.byName){O(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${p.method} defines parameters by name but received parameters by position`),p.method,Ae);return}ee=ie(...p.params,ue.token)}else{if(re!==void 0&&re.parameterStructures===n.ParameterStructures.byPosition){O(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${p.method} defines parameters by position but received parameters by name`),p.method,Ae);return}ee=ie(p.params,ue.token)}else F&&(ee=F(p.method,p.params,ue.token));const be=ee;ee?be.then?be.then(Ge=>{Ce.delete(X),k(Ge,p.method,Ae)},Ge=>{Ce.delete(X),Ge instanceof n.ResponseError?O(Ge,p.method,Ae):Ge&&r.string(Ge.message)?O(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${p.method} failed with message: ${Ge.message}`),p.method,Ae):O(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${p.method} failed unexpectedly without providing any details.`),p.method,Ae)}):(Ce.delete(X),k(ee,p.method,Ae)):(Ce.delete(X),M(ee,p.method,Ae))}catch(ee){Ce.delete(X),ee instanceof n.ResponseError?k(ee,p.method,Ae):ee&&r.string(ee.message)?O(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${p.method} failed with message: ${ee.message}`),p.method,Ae):O(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${p.method} failed unexpectedly without providing any details.`),p.method,Ae)}}else O(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${p.method}`),p.method,Ae)}function oa(p){if(!$t())if(p.id===null)p.error?A.error(`Received response message without id: Error is:
|
|
126
|
+
${JSON.stringify(p.error,void 0,4)}`):A.error("Received response message without id. No further error information provided.");else{const k=p.id,O=ke.get(k);if(ha(p,O),O!==void 0){ke.delete(k);try{if(p.error){const M=p.error;O.reject(new n.ResponseError(M.code,M.message,M.data))}else if(p.result!==void 0)O.resolve(p.result);else throw new Error("Should never happen.")}catch(M){M.message?A.error(`Response handler '${O.method}' failed with message: ${M.message}`):A.error(`Response handler '${O.method}' failed unexpectedly.`)}}}}function la(p){if($t())return;let k,O;if(p.method===o.type.method){const M=p.params.id;Ie.delete(M),Mr(p);return}else{const M=Q.get(p.method);M&&(O=M.handler,k=M.type)}if(O||z)try{if(Mr(p),O)if(p.params===void 0)k!==void 0&&k.numberOfParams!==0&&k.parameterStructures!==n.ParameterStructures.byName&&A.error(`Notification ${p.method} defines ${k.numberOfParams} params but received none.`),O();else if(Array.isArray(p.params)){const M=p.params;p.method===c.type.method&&M.length===2&&l.is(M[0])?O({token:M[0],value:M[1]}):(k!==void 0&&(k.parameterStructures===n.ParameterStructures.byName&&A.error(`Notification ${p.method} defines parameters by name but received parameters by position`),k.numberOfParams!==p.params.length&&A.error(`Notification ${p.method} defines ${k.numberOfParams} params but received ${M.length} arguments`)),O(...M))}else k!==void 0&&k.parameterStructures===n.ParameterStructures.byPosition&&A.error(`Notification ${p.method} defines parameters by position but received parameters by name`),O(p.params);else z&&z(p.method,p.params)}catch(M){M.message?A.error(`Notification handler '${p.method}' failed with message: ${M.message}`):A.error(`Notification handler '${p.method}' failed unexpectedly.`)}else zn.fire(p)}function ca(p){if(!p){A.error("Received empty message.");return}A.error(`Received message which is neither a response nor a notification message:
|
|
127
|
+
${JSON.stringify(p,null,4)}`);const k=p;if(r.string(k.id)||r.number(k.id)){const O=k.id,M=ke.get(O);M&&M.reject(new Error("The received response has neither a result nor an error property."))}}function st(p){if(p!=null)switch(Y){case m.Verbose:return JSON.stringify(p,null,4);case m.Compact:return JSON.stringify(p);default:return}}function ua(p){if(!(Y===m.Off||!ye))if(Xe===E.Text){let k;(Y===m.Verbose||Y===m.Compact)&&p.params&&(k=`Params: ${st(p.params)}
|
|
128
|
+
|
|
129
|
+
`),ye.log(`Sending request '${p.method} - (${p.id})'.`,k)}else Ct("send-request",p)}function fa(p){if(!(Y===m.Off||!ye))if(Xe===E.Text){let k;(Y===m.Verbose||Y===m.Compact)&&(p.params?k=`Params: ${st(p.params)}
|
|
130
|
+
|
|
131
|
+
`:k=`No parameters provided.
|
|
132
|
+
|
|
133
|
+
`),ye.log(`Sending notification '${p.method}'.`,k)}else Ct("send-notification",p)}function ar(p,k,O){if(!(Y===m.Off||!ye))if(Xe===E.Text){let M;(Y===m.Verbose||Y===m.Compact)&&(p.error&&p.error.data?M=`Error data: ${st(p.error.data)}
|
|
134
|
+
|
|
135
|
+
`:p.result?M=`Result: ${st(p.result)}
|
|
136
|
+
|
|
137
|
+
`:p.error===void 0&&(M=`No result returned.
|
|
138
|
+
|
|
139
|
+
`)),ye.log(`Sending response '${k} - (${p.id})'. Processing request took ${Date.now()-O}ms`,M)}else Ct("send-response",p)}function da(p){if(!(Y===m.Off||!ye))if(Xe===E.Text){let k;(Y===m.Verbose||Y===m.Compact)&&p.params&&(k=`Params: ${st(p.params)}
|
|
140
|
+
|
|
141
|
+
`),ye.log(`Received request '${p.method} - (${p.id})'.`,k)}else Ct("receive-request",p)}function Mr(p){if(!(Y===m.Off||!ye||p.method===I.type.method))if(Xe===E.Text){let k;(Y===m.Verbose||Y===m.Compact)&&(p.params?k=`Params: ${st(p.params)}
|
|
142
|
+
|
|
143
|
+
`:k=`No parameters provided.
|
|
144
|
+
|
|
145
|
+
`),ye.log(`Received notification '${p.method}'.`,k)}else Ct("receive-notification",p)}function ha(p,k){if(!(Y===m.Off||!ye))if(Xe===E.Text){let O;if((Y===m.Verbose||Y===m.Compact)&&(p.error&&p.error.data?O=`Error data: ${st(p.error.data)}
|
|
146
|
+
|
|
147
|
+
`:p.result?O=`Result: ${st(p.result)}
|
|
148
|
+
|
|
149
|
+
`:p.error===void 0&&(O=`No result returned.
|
|
150
|
+
|
|
151
|
+
`)),k){const M=p.error?` Request failed: ${p.error.message} (${p.error.code}).`:"";ye.log(`Received response '${k.method} - (${p.id})' in ${Date.now()-k.timerStart}ms.${M}`,O)}else ye.log(`Received response ${p.id} without active response promise.`,O)}else Ct("receive-response",p)}function Ct(p,k){if(!ye||Y===m.Off)return;const O={isLSPMessage:!0,type:p,message:k,timestamp:Date.now()};ye.log(O)}function Xt(){if(Vn())throw new w(C.Closed,"Connection is closed.");if($t())throw new w(C.Disposed,"Connection is disposed.")}function pa(){if(Wn())throw new w(C.AlreadyListening,"Connection is already listening")}function ma(){if(!Wn())throw new Error("Call listen() first.")}function Yt(p){return p===void 0?null:p}function Yn(p){if(p!==null)return p}function f(p){return p!=null&&!Array.isArray(p)&&typeof p=="object"}function ve(p,k){switch(p){case n.ParameterStructures.auto:return f(k)?Yn(k):[Yt(k)];case n.ParameterStructures.byName:if(!f(k))throw new Error("Received parameters by name but param is not an object literal.");return Yn(k);case n.ParameterStructures.byPosition:return[Yt(k)];default:throw new Error(`Unknown parameter structure ${p.toString()}`)}}function Ee(p,k){let O;const M=p.numberOfParams;switch(M){case 0:O=void 0;break;case 1:O=ve(p.parameterStructures,k[0]);break;default:O=[];for(let ae=0;ae<k.length&&ae<M;ae++)O.push(Yt(k[ae]));if(k.length<M)for(let ae=k.length;ae<M;ae++)O.push(null);break}return O}const q={sendNotification:(p,...k)=>{Xt();let O,M;if(r.string(p)){O=p;const re=k[0];let ie=0,Ae=n.ParameterStructures.auto;n.ParameterStructures.is(re)&&(ie=1,Ae=re);let X=k.length;const ue=X-ie;switch(ue){case 0:M=void 0;break;case 1:M=ve(Ae,k[ie]);break;default:if(Ae===n.ParameterStructures.byName)throw new Error(`Received ${ue} parameters for 'by Name' notification parameter structure.`);M=k.slice(ie,X).map(ee=>Yt(ee));break}}else{const re=k;O=p.method,M=Ee(p,re)}const ae={jsonrpc:j,method:O,params:M};return fa(ae),$.write(ae).catch(re=>{throw A.error("Sending notification failed."),re})},onNotification:(p,k)=>{Xt();let O;return r.func(p)?z=p:k&&(r.string(p)?(O=p,Q.set(p,{type:void 0,handler:k})):(O=p.method,Q.set(p.method,{type:p,handler:k}))),{dispose:()=>{O!==void 0?Q.delete(O):z=void 0}}},onProgress:(p,k,O)=>{if(Ne.has(k))throw new Error(`Progress handler for token ${k} already registered`);return Ne.set(k,O),{dispose:()=>{Ne.delete(k)}}},sendProgress:(p,k,O)=>q.sendNotification(c.type,{token:k,value:O}),onUnhandledProgress:Un.event,sendRequest:(p,...k)=>{Xt(),ma();let O,M,ae;if(r.string(p)){O=p;const X=k[0],ue=k[k.length-1];let ee=0,be=n.ParameterStructures.auto;n.ParameterStructures.is(X)&&(ee=1,be=X);let Ge=k.length;s.CancellationToken.is(ue)&&(Ge=Ge-1,ae=ue);const dt=Ge-ee;switch(dt){case 0:M=void 0;break;case 1:M=ve(be,k[ee]);break;default:if(be===n.ParameterStructures.byName)throw new Error(`Received ${dt} parameters for 'by Name' request parameter structure.`);M=k.slice(ee,Ge).map(Eh=>Yt(Eh));break}}else{const X=k;O=p.method,M=Ee(p,X);const ue=p.numberOfParams;ae=s.CancellationToken.is(X[ue])?X[ue]:void 0}const re=L++;let ie;ae&&(ie=ae.onCancellationRequested(()=>{const X=at.sender.sendCancellation(q,re);return X===void 0?(A.log(`Received no promise from cancellation strategy when cancelling id ${re}`),Promise.resolve()):X.catch(()=>{A.log(`Sending cancellation messages for id ${re} failed`)})}));const Ae={jsonrpc:j,id:re,method:O,params:M};return ua(Ae),typeof at.sender.enableCancellation=="function"&&at.sender.enableCancellation(Ae),new Promise(async(X,ue)=>{const ee=dt=>{X(dt),at.sender.cleanup(re),ie==null||ie.dispose()},be=dt=>{ue(dt),at.sender.cleanup(re),ie==null||ie.dispose()},Ge={method:O,timerStart:Date.now(),resolve:ee,reject:be};try{await $.write(Ae),ke.set(re,Ge)}catch(dt){throw A.error("Sending request failed."),Ge.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,dt.message?dt.message:"Unknown reason")),dt}})},onRequest:(p,k)=>{Xt();let O=null;return d.is(p)?(O=void 0,F=p):r.string(p)?(O=null,k!==void 0&&(O=p,te.set(p,{handler:k,type:void 0}))):k!==void 0&&(O=p.method,te.set(p.method,{type:p,handler:k})),{dispose:()=>{O!==null&&(O!==void 0?te.delete(O):F=void 0)}}},hasPendingResponse:()=>ke.size>0,trace:async(p,k,O)=>{let M=!1,ae=E.Text;O!==void 0&&(r.boolean(O)?M=O:(M=O.sendNotification||!1,ae=O.traceFormat||E.Text)),Y=p,Xe=ae,Y===m.Off?ye=void 0:ye=k,M&&!Vn()&&!$t()&&await q.sendNotification(b.type,{value:m.toString(p)})},onError:Dr.event,onClose:jn.event,onUnhandledNotification:zn.event,onDispose:qn.event,end:()=>{$.end()},dispose:()=>{if($t())return;it=_.Disposed,qn.fire(void 0);const p=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const k of ke.values())k.reject(p);ke=new Map,Ce=new Map,Ie=new Set,ce=new i.LinkedMap,r.func($.dispose)&&$.dispose(),r.func(g.dispose)&&g.dispose()},listen:()=>{Xt(),pa(),it=_.Listening,g.listen(aa)},inspect:()=>{(0,e.default)().console.log("inspect")}};return q.onNotification(I.type,p=>{if(Y===m.Off||!ye)return;const k=Y===m.Verbose||Y===m.Compact;ye.log(p.message,k?p.verbose:void 0)}),q.onNotification(c.type,p=>{const k=Ne.get(p.token);k?k(p.value):Un.fire(p)}),q}t.createMessageConnection=R})(Xs)),Xs}var Cu;function Gl(){return Cu||(Cu=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;const e=Wd();Object.defineProperty(t,"Message",{enumerable:!0,get:function(){return e.Message}}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:function(){return e.RequestType}}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:function(){return e.RequestType0}}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:function(){return e.RequestType1}}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:function(){return e.RequestType2}}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:function(){return e.RequestType3}}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:function(){return e.RequestType4}}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:function(){return e.RequestType5}}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:function(){return e.RequestType6}}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:function(){return e.RequestType7}}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:function(){return e.RequestType8}}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:function(){return e.RequestType9}}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:function(){return e.ResponseError}}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:function(){return e.ErrorCodes}}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:function(){return e.NotificationType}}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:function(){return e.NotificationType0}}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:function(){return e.NotificationType1}}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:function(){return e.NotificationType2}}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:function(){return e.NotificationType3}}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:function(){return e.NotificationType4}}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:function(){return e.NotificationType5}}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:function(){return e.NotificationType6}}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:function(){return e.NotificationType7}}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:function(){return e.NotificationType8}}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:function(){return e.NotificationType9}}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:function(){return e.ParameterStructures}});const r=Vd();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:function(){return r.LinkedMap}}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:function(){return r.LRUCache}}),Object.defineProperty(t,"Touch",{enumerable:!0,get:function(){return r.Touch}});const n=$T();Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return n.Disposable}});const i=Mn();Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const a=Ps();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return a.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return a.CancellationToken}});const s=CT();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return s.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return s.SharedArrayReceiverStrategy}});const o=ST();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return o.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return o.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return o.ReadableStreamMessageReader}});const l=wT();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return l.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return l.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return l.WriteableStreamMessageWriter}});const c=kT();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return c.AbstractMessageBuffer}});const u=bT();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return u.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return u.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return u.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return u.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return u.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return u.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return u.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return u.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return u.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return u.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return u.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return u.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return u.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return u.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return u.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return u.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:function(){return u.MessageStrategy}});const d=xr();t.RAL=d.default})(Hs)),Hs}var Su;function _T(){if(Su)return Sa;Su=1,Object.defineProperty(Sa,"__esModule",{value:!0});const t=Gl();class e extends t.AbstractMessageBuffer{constructor(l="utf-8"){super(l),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return e.emptyBuffer}fromString(l,c){return new TextEncoder().encode(l)}toString(l,c){return c==="ascii"?this.asciiDecoder.decode(l):new TextDecoder(c).decode(l)}asNative(l,c){return c===void 0?l:l.slice(0,c)}allocNative(l){return new Uint8Array(l)}}e.emptyBuffer=new Uint8Array(0);class r{constructor(l){this.socket=l,this._onData=new t.Emitter,this._messageListener=c=>{c.data.arrayBuffer().then(d=>{this._onData.fire(new Uint8Array(d))},()=>{(0,t.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(l){return this.socket.addEventListener("close",l),t.Disposable.create(()=>this.socket.removeEventListener("close",l))}onError(l){return this.socket.addEventListener("error",l),t.Disposable.create(()=>this.socket.removeEventListener("error",l))}onEnd(l){return this.socket.addEventListener("end",l),t.Disposable.create(()=>this.socket.removeEventListener("end",l))}onData(l){return this._onData.event(l)}}class n{constructor(l){this.socket=l}onClose(l){return this.socket.addEventListener("close",l),t.Disposable.create(()=>this.socket.removeEventListener("close",l))}onError(l){return this.socket.addEventListener("error",l),t.Disposable.create(()=>this.socket.removeEventListener("error",l))}onEnd(l){return this.socket.addEventListener("end",l),t.Disposable.create(()=>this.socket.removeEventListener("end",l))}write(l,c){if(typeof l=="string"){if(c!==void 0&&c!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${c}`);this.socket.send(l)}else this.socket.send(l);return Promise.resolve()}end(){this.socket.close()}}const i=new TextEncoder,a=Object.freeze({messageBuffer:Object.freeze({create:o=>new e(o)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(o,l)=>{if(l.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${l.charset}`);return Promise.resolve(i.encode(JSON.stringify(o,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(o,l)=>{if(!(o instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(l.charset).decode(o)))}})}),stream:Object.freeze({asReadableStream:o=>new r(o),asWritableStream:o=>new n(o)}),console,timer:Object.freeze({setTimeout(o,l,...c){const u=setTimeout(o,l,...c);return{dispose:()=>clearTimeout(u)}},setImmediate(o,...l){const c=setTimeout(o,0,...l);return{dispose:()=>clearTimeout(c)}},setInterval(o,l,...c){const u=setInterval(o,l,...c);return{dispose:()=>clearInterval(u)}}})});function s(){return a}return(function(o){function l(){t.RAL.install(a)}o.install=l})(s||(s={})),Sa.default=s,Sa}var wu;function Fn(){return wu||(wu=1,(function(t){var e=ur&&ur.__createBinding||(Object.create?(function(l,c,u,d){d===void 0&&(d=u);var m=Object.getOwnPropertyDescriptor(c,u);(!m||("get"in m?!c.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return c[u]}}),Object.defineProperty(l,d,m)}):(function(l,c,u,d){d===void 0&&(d=u),l[d]=c[u]})),r=ur&&ur.__exportStar||function(l,c){for(var u in l)u!=="default"&&!Object.prototype.hasOwnProperty.call(c,u)&&e(c,l,u)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0,_T().default.install();const i=Gl();r(Gl(),t);class a extends i.AbstractMessageReader{constructor(c){super(),this._onData=new i.Emitter,this._messageListener=u=>{this._onData.fire(u.data)},c.addEventListener("error",u=>this.fireError(u)),c.onmessage=this._messageListener}listen(c){return this._onData.event(c)}}t.BrowserMessageReader=a;class s extends i.AbstractMessageWriter{constructor(c){super(),this.port=c,this.errorCount=0,c.addEventListener("error",u=>this.fireError(u))}write(c){try{return this.port.postMessage(c),Promise.resolve()}catch(u){return this.handleError(u,c),Promise.reject(u)}}handleError(c,u){this.errorCount++,this.fireError(c,u,this.errorCount)}end(){}}t.BrowserMessageWriter=s;function o(l,c,u,d){return u===void 0&&(u=i.NullLogger),i.ConnectionStrategy.is(d)&&(d={connectionStrategy:d}),(0,i.createMessageConnection)(l,c,u,d)}t.createMessageConnection=o})(ur)),ur}var Ys,ku;function bu(){return ku||(ku=1,Ys=Fn()),Ys}var dr={};const yc=Sh(ky);var je={},_u;function me(){if(_u)return je;_u=1,Object.defineProperty(je,"__esModule",{value:!0}),je.ProtocolNotificationType=je.ProtocolNotificationType0=je.ProtocolRequestType=je.ProtocolRequestType0=je.RegistrationType=je.MessageDirection=void 0;const t=Fn();var e;(function(o){o.clientToServer="clientToServer",o.serverToClient="serverToClient",o.both="both"})(e||(je.MessageDirection=e={}));class r{constructor(l){this.method=l}}je.RegistrationType=r;class n extends t.RequestType0{constructor(l){super(l)}}je.ProtocolRequestType0=n;class i extends t.RequestType{constructor(l){super(l,t.ParameterStructures.byName)}}je.ProtocolRequestType=i;class a extends t.NotificationType0{constructor(l){super(l)}}je.ProtocolNotificationType0=a;class s extends t.NotificationType{constructor(l){super(l,t.ParameterStructures.byName)}}return je.ProtocolNotificationType=s,je}var Js={},$e={},Nu;function Tc(){if(Nu)return $e;Nu=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.objectLiteral=$e.typedArray=$e.stringArray=$e.array=$e.func=$e.error=$e.number=$e.string=$e.boolean=void 0;function t(c){return c===!0||c===!1}$e.boolean=t;function e(c){return typeof c=="string"||c instanceof String}$e.string=e;function r(c){return typeof c=="number"||c instanceof Number}$e.number=r;function n(c){return c instanceof Error}$e.error=n;function i(c){return typeof c=="function"}$e.func=i;function a(c){return Array.isArray(c)}$e.array=a;function s(c){return a(c)&&c.every(u=>e(u))}$e.stringArray=s;function o(c,u){return Array.isArray(c)&&c.every(u)}$e.typedArray=o;function l(c){return c!==null&&typeof c=="object"}return $e.objectLiteral=l,$e}var oi={},Iu;function NT(){if(Iu)return oi;Iu=1,Object.defineProperty(oi,"__esModule",{value:!0}),oi.ImplementationRequest=void 0;const t=me();var e;return(function(r){r.method="textDocument/implementation",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(oi.ImplementationRequest=e={})),oi}var li={},Pu;function IT(){if(Pu)return li;Pu=1,Object.defineProperty(li,"__esModule",{value:!0}),li.TypeDefinitionRequest=void 0;const t=me();var e;return(function(r){r.method="textDocument/typeDefinition",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(li.TypeDefinitionRequest=e={})),li}var hr={},Ou;function PT(){if(Ou)return hr;Ou=1,Object.defineProperty(hr,"__esModule",{value:!0}),hr.DidChangeWorkspaceFoldersNotification=hr.WorkspaceFoldersRequest=void 0;const t=me();var e;(function(n){n.method="workspace/workspaceFolders",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType0(n.method)})(e||(hr.WorkspaceFoldersRequest=e={}));var r;return(function(n){n.method="workspace/didChangeWorkspaceFolders",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolNotificationType(n.method)})(r||(hr.DidChangeWorkspaceFoldersNotification=r={})),hr}var ci={},Lu;function OT(){if(Lu)return ci;Lu=1,Object.defineProperty(ci,"__esModule",{value:!0}),ci.ConfigurationRequest=void 0;const t=me();var e;return(function(r){r.method="workspace/configuration",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType(r.method)})(e||(ci.ConfigurationRequest=e={})),ci}var pr={},xu;function LT(){if(xu)return pr;xu=1,Object.defineProperty(pr,"__esModule",{value:!0}),pr.ColorPresentationRequest=pr.DocumentColorRequest=void 0;const t=me();var e;(function(n){n.method="textDocument/documentColor",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(e||(pr.DocumentColorRequest=e={}));var r;return(function(n){n.method="textDocument/colorPresentation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(pr.ColorPresentationRequest=r={})),pr}var mr={},Du;function xT(){if(Du)return mr;Du=1,Object.defineProperty(mr,"__esModule",{value:!0}),mr.FoldingRangeRefreshRequest=mr.FoldingRangeRequest=void 0;const t=me();var e;(function(n){n.method="textDocument/foldingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(e||(mr.FoldingRangeRequest=e={}));var r;return(function(n){n.method="workspace/foldingRange/refresh",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType0(n.method)})(r||(mr.FoldingRangeRefreshRequest=r={})),mr}var ui={},Mu;function DT(){if(Mu)return ui;Mu=1,Object.defineProperty(ui,"__esModule",{value:!0}),ui.DeclarationRequest=void 0;const t=me();var e;return(function(r){r.method="textDocument/declaration",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(ui.DeclarationRequest=e={})),ui}var fi={},Fu;function MT(){if(Fu)return fi;Fu=1,Object.defineProperty(fi,"__esModule",{value:!0}),fi.SelectionRangeRequest=void 0;const t=me();var e;return(function(r){r.method="textDocument/selectionRange",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(fi.SelectionRangeRequest=e={})),fi}var _t={},Gu;function FT(){if(Gu)return _t;Gu=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.WorkDoneProgressCancelNotification=_t.WorkDoneProgressCreateRequest=_t.WorkDoneProgress=void 0;const t=Fn(),e=me();var r;(function(a){a.type=new t.ProgressType;function s(o){return o===a.type}a.is=s})(r||(_t.WorkDoneProgress=r={}));var n;(function(a){a.method="window/workDoneProgress/create",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType(a.method)})(n||(_t.WorkDoneProgressCreateRequest=n={}));var i;return(function(a){a.method="window/workDoneProgress/cancel",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(i||(_t.WorkDoneProgressCancelNotification=i={})),_t}var Nt={},ju;function GT(){if(ju)return Nt;ju=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.CallHierarchyOutgoingCallsRequest=Nt.CallHierarchyIncomingCallsRequest=Nt.CallHierarchyPrepareRequest=void 0;const t=me();var e;(function(i){i.method="textDocument/prepareCallHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(Nt.CallHierarchyPrepareRequest=e={}));var r;(function(i){i.method="callHierarchy/incomingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(r||(Nt.CallHierarchyIncomingCallsRequest=r={}));var n;return(function(i){i.method="callHierarchy/outgoingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(Nt.CallHierarchyOutgoingCallsRequest=n={})),Nt}var ze={},zu;function jT(){if(zu)return ze;zu=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.SemanticTokensRefreshRequest=ze.SemanticTokensRangeRequest=ze.SemanticTokensDeltaRequest=ze.SemanticTokensRequest=ze.SemanticTokensRegistrationType=ze.TokenFormat=void 0;const t=me();var e;(function(o){o.Relative="relative"})(e||(ze.TokenFormat=e={}));var r;(function(o){o.method="textDocument/semanticTokens",o.type=new t.RegistrationType(o.method)})(r||(ze.SemanticTokensRegistrationType=r={}));var n;(function(o){o.method="textDocument/semanticTokens/full",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),o.registrationMethod=r.method})(n||(ze.SemanticTokensRequest=n={}));var i;(function(o){o.method="textDocument/semanticTokens/full/delta",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),o.registrationMethod=r.method})(i||(ze.SemanticTokensDeltaRequest=i={}));var a;(function(o){o.method="textDocument/semanticTokens/range",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),o.registrationMethod=r.method})(a||(ze.SemanticTokensRangeRequest=a={}));var s;return(function(o){o.method="workspace/semanticTokens/refresh",o.messageDirection=t.MessageDirection.serverToClient,o.type=new t.ProtocolRequestType0(o.method)})(s||(ze.SemanticTokensRefreshRequest=s={})),ze}var di={},Uu;function zT(){if(Uu)return di;Uu=1,Object.defineProperty(di,"__esModule",{value:!0}),di.ShowDocumentRequest=void 0;const t=me();var e;return(function(r){r.method="window/showDocument",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType(r.method)})(e||(di.ShowDocumentRequest=e={})),di}var hi={},qu;function UT(){if(qu)return hi;qu=1,Object.defineProperty(hi,"__esModule",{value:!0}),hi.LinkedEditingRangeRequest=void 0;const t=me();var e;return(function(r){r.method="textDocument/linkedEditingRange",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(hi.LinkedEditingRangeRequest=e={})),hi}var Oe={},Bu;function qT(){if(Bu)return Oe;Bu=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.WillDeleteFilesRequest=Oe.DidDeleteFilesNotification=Oe.DidRenameFilesNotification=Oe.WillRenameFilesRequest=Oe.DidCreateFilesNotification=Oe.WillCreateFilesRequest=Oe.FileOperationPatternKind=void 0;const t=me();var e;(function(l){l.file="file",l.folder="folder"})(e||(Oe.FileOperationPatternKind=e={}));var r;(function(l){l.method="workspace/willCreateFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(r||(Oe.WillCreateFilesRequest=r={}));var n;(function(l){l.method="workspace/didCreateFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolNotificationType(l.method)})(n||(Oe.DidCreateFilesNotification=n={}));var i;(function(l){l.method="workspace/willRenameFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(i||(Oe.WillRenameFilesRequest=i={}));var a;(function(l){l.method="workspace/didRenameFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolNotificationType(l.method)})(a||(Oe.DidRenameFilesNotification=a={}));var s;(function(l){l.method="workspace/didDeleteFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolNotificationType(l.method)})(s||(Oe.DidDeleteFilesNotification=s={}));var o;return(function(l){l.method="workspace/willDeleteFiles",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(o||(Oe.WillDeleteFilesRequest=o={})),Oe}var It={},Wu;function BT(){if(Wu)return It;Wu=1,Object.defineProperty(It,"__esModule",{value:!0}),It.MonikerRequest=It.MonikerKind=It.UniquenessLevel=void 0;const t=me();var e;(function(i){i.document="document",i.project="project",i.group="group",i.scheme="scheme",i.global="global"})(e||(It.UniquenessLevel=e={}));var r;(function(i){i.$import="import",i.$export="export",i.local="local"})(r||(It.MonikerKind=r={}));var n;return(function(i){i.method="textDocument/moniker",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(It.MonikerRequest=n={})),It}var Pt={},Vu;function WT(){if(Vu)return Pt;Vu=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.TypeHierarchySubtypesRequest=Pt.TypeHierarchySupertypesRequest=Pt.TypeHierarchyPrepareRequest=void 0;const t=me();var e;(function(i){i.method="textDocument/prepareTypeHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(Pt.TypeHierarchyPrepareRequest=e={}));var r;(function(i){i.method="typeHierarchy/supertypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(r||(Pt.TypeHierarchySupertypesRequest=r={}));var n;return(function(i){i.method="typeHierarchy/subtypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(Pt.TypeHierarchySubtypesRequest=n={})),Pt}var gr={},Ku;function VT(){if(Ku)return gr;Ku=1,Object.defineProperty(gr,"__esModule",{value:!0}),gr.InlineValueRefreshRequest=gr.InlineValueRequest=void 0;const t=me();var e;(function(n){n.method="textDocument/inlineValue",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(e||(gr.InlineValueRequest=e={}));var r;return(function(n){n.method="workspace/inlineValue/refresh",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType0(n.method)})(r||(gr.InlineValueRefreshRequest=r={})),gr}var Ot={},Hu;function KT(){if(Hu)return Ot;Hu=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.InlayHintRefreshRequest=Ot.InlayHintResolveRequest=Ot.InlayHintRequest=void 0;const t=me();var e;(function(i){i.method="textDocument/inlayHint",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(Ot.InlayHintRequest=e={}));var r;(function(i){i.method="inlayHint/resolve",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(r||(Ot.InlayHintResolveRequest=r={}));var n;return(function(i){i.method="workspace/inlayHint/refresh",i.messageDirection=t.MessageDirection.serverToClient,i.type=new t.ProtocolRequestType0(i.method)})(n||(Ot.InlayHintRefreshRequest=n={})),Ot}var Ye={},Xu;function HT(){if(Xu)return Ye;Xu=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.DiagnosticRefreshRequest=Ye.WorkspaceDiagnosticRequest=Ye.DocumentDiagnosticRequest=Ye.DocumentDiagnosticReportKind=Ye.DiagnosticServerCancellationData=void 0;const t=Fn(),e=Tc(),r=me();var n;(function(l){function c(u){const d=u;return d&&e.boolean(d.retriggerRequest)}l.is=c})(n||(Ye.DiagnosticServerCancellationData=n={}));var i;(function(l){l.Full="full",l.Unchanged="unchanged"})(i||(Ye.DocumentDiagnosticReportKind=i={}));var a;(function(l){l.method="textDocument/diagnostic",l.messageDirection=r.MessageDirection.clientToServer,l.type=new r.ProtocolRequestType(l.method),l.partialResult=new t.ProgressType})(a||(Ye.DocumentDiagnosticRequest=a={}));var s;(function(l){l.method="workspace/diagnostic",l.messageDirection=r.MessageDirection.clientToServer,l.type=new r.ProtocolRequestType(l.method),l.partialResult=new t.ProgressType})(s||(Ye.WorkspaceDiagnosticRequest=s={}));var o;return(function(l){l.method="workspace/diagnostic/refresh",l.messageDirection=r.MessageDirection.serverToClient,l.type=new r.ProtocolRequestType0(l.method)})(o||(Ye.DiagnosticRefreshRequest=o={})),Ye}var fe={},Yu;function XT(){if(Yu)return fe;Yu=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.DidCloseNotebookDocumentNotification=fe.DidSaveNotebookDocumentNotification=fe.DidChangeNotebookDocumentNotification=fe.NotebookCellArrayChange=fe.DidOpenNotebookDocumentNotification=fe.NotebookDocumentSyncRegistrationType=fe.NotebookDocument=fe.NotebookCell=fe.ExecutionSummary=fe.NotebookCellKind=void 0;const t=yc,e=Tc(),r=me();var n;(function(h){h.Markup=1,h.Code=2;function E(b){return b===1||b===2}h.is=E})(n||(fe.NotebookCellKind=n={}));var i;(function(h){function E(C,w){const S={executionOrder:C};return(w===!0||w===!1)&&(S.success=w),S}h.create=E;function b(C){const w=C;return e.objectLiteral(w)&&t.uinteger.is(w.executionOrder)&&(w.success===void 0||e.boolean(w.success))}h.is=b;function I(C,w){return C===w?!0:C==null||w===null||w===void 0?!1:C.executionOrder===w.executionOrder&&C.success===w.success}h.equals=I})(i||(fe.ExecutionSummary=i={}));var a;(function(h){function E(w,S){return{kind:w,document:S}}h.create=E;function b(w){const S=w;return e.objectLiteral(S)&&n.is(S.kind)&&t.DocumentUri.is(S.document)&&(S.metadata===void 0||e.objectLiteral(S.metadata))}h.is=b;function I(w,S){const P=new Set;return w.document!==S.document&&P.add("document"),w.kind!==S.kind&&P.add("kind"),w.executionSummary!==S.executionSummary&&P.add("executionSummary"),(w.metadata!==void 0||S.metadata!==void 0)&&!C(w.metadata,S.metadata)&&P.add("metadata"),(w.executionSummary!==void 0||S.executionSummary!==void 0)&&!i.equals(w.executionSummary,S.executionSummary)&&P.add("executionSummary"),P}h.diff=I;function C(w,S){if(w===S)return!0;if(w==null||S===null||S===void 0||typeof w!=typeof S||typeof w!="object")return!1;const P=Array.isArray(w),W=Array.isArray(S);if(P!==W)return!1;if(P&&W){if(w.length!==S.length)return!1;for(let B=0;B<w.length;B++)if(!C(w[B],S[B]))return!1}if(e.objectLiteral(w)&&e.objectLiteral(S)){const B=Object.keys(w),H=Object.keys(S);if(B.length!==H.length||(B.sort(),H.sort(),!C(B,H)))return!1;for(let ne=0;ne<B.length;ne++){const oe=B[ne];if(!C(w[oe],S[oe]))return!1}}return!0}})(a||(fe.NotebookCell=a={}));var s;(function(h){function E(I,C,w,S){return{uri:I,notebookType:C,version:w,cells:S}}h.create=E;function b(I){const C=I;return e.objectLiteral(C)&&e.string(C.uri)&&t.integer.is(C.version)&&e.typedArray(C.cells,a.is)}h.is=b})(s||(fe.NotebookDocument=s={}));var o;(function(h){h.method="notebookDocument/sync",h.messageDirection=r.MessageDirection.clientToServer,h.type=new r.RegistrationType(h.method)})(o||(fe.NotebookDocumentSyncRegistrationType=o={}));var l;(function(h){h.method="notebookDocument/didOpen",h.messageDirection=r.MessageDirection.clientToServer,h.type=new r.ProtocolNotificationType(h.method),h.registrationMethod=o.method})(l||(fe.DidOpenNotebookDocumentNotification=l={}));var c;(function(h){function E(I){const C=I;return e.objectLiteral(C)&&t.uinteger.is(C.start)&&t.uinteger.is(C.deleteCount)&&(C.cells===void 0||e.typedArray(C.cells,a.is))}h.is=E;function b(I,C,w){const S={start:I,deleteCount:C};return w!==void 0&&(S.cells=w),S}h.create=b})(c||(fe.NotebookCellArrayChange=c={}));var u;(function(h){h.method="notebookDocument/didChange",h.messageDirection=r.MessageDirection.clientToServer,h.type=new r.ProtocolNotificationType(h.method),h.registrationMethod=o.method})(u||(fe.DidChangeNotebookDocumentNotification=u={}));var d;(function(h){h.method="notebookDocument/didSave",h.messageDirection=r.MessageDirection.clientToServer,h.type=new r.ProtocolNotificationType(h.method),h.registrationMethod=o.method})(d||(fe.DidSaveNotebookDocumentNotification=d={}));var m;return(function(h){h.method="notebookDocument/didClose",h.messageDirection=r.MessageDirection.clientToServer,h.type=new r.ProtocolNotificationType(h.method),h.registrationMethod=o.method})(m||(fe.DidCloseNotebookDocumentNotification=m={})),fe}var pi={},Ju;function YT(){if(Ju)return pi;Ju=1,Object.defineProperty(pi,"__esModule",{value:!0}),pi.InlineCompletionRequest=void 0;const t=me();var e;return(function(r){r.method="textDocument/inlineCompletion",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(pi.InlineCompletionRequest=e={})),pi}var Zu;function JT(){return Zu||(Zu=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceSymbolRequest=t.CodeActionResolveRequest=t.CodeActionRequest=t.DocumentSymbolRequest=t.DocumentHighlightRequest=t.ReferencesRequest=t.DefinitionRequest=t.SignatureHelpRequest=t.SignatureHelpTriggerKind=t.HoverRequest=t.CompletionResolveRequest=t.CompletionRequest=t.CompletionTriggerKind=t.PublishDiagnosticsNotification=t.WatchKind=t.RelativePattern=t.FileChangeType=t.DidChangeWatchedFilesNotification=t.WillSaveTextDocumentWaitUntilRequest=t.WillSaveTextDocumentNotification=t.TextDocumentSaveReason=t.DidSaveTextDocumentNotification=t.DidCloseTextDocumentNotification=t.DidChangeTextDocumentNotification=t.TextDocumentContentChangeEvent=t.DidOpenTextDocumentNotification=t.TextDocumentSyncKind=t.TelemetryEventNotification=t.LogMessageNotification=t.ShowMessageRequest=t.ShowMessageNotification=t.MessageType=t.DidChangeConfigurationNotification=t.ExitNotification=t.ShutdownRequest=t.InitializedNotification=t.InitializeErrorCodes=t.InitializeRequest=t.WorkDoneProgressOptions=t.TextDocumentRegistrationOptions=t.StaticRegistrationOptions=t.PositionEncodingKind=t.FailureHandlingKind=t.ResourceOperationKind=t.UnregistrationRequest=t.RegistrationRequest=t.DocumentSelector=t.NotebookCellTextDocumentFilter=t.NotebookDocumentFilter=t.TextDocumentFilter=void 0,t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.WillRenameFilesRequest=t.DidRenameFilesNotification=t.WillCreateFilesRequest=t.DidCreateFilesNotification=t.FileOperationPatternKind=t.LinkedEditingRangeRequest=t.ShowDocumentRequest=t.SemanticTokensRegistrationType=t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.TokenFormat=t.CallHierarchyPrepareRequest=t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=t.SelectionRangeRequest=t.DeclarationRequest=t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=t.ColorPresentationRequest=t.DocumentColorRequest=t.ConfigurationRequest=t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=t.TypeDefinitionRequest=t.ImplementationRequest=t.ApplyWorkspaceEditRequest=t.ExecuteCommandRequest=t.PrepareRenameRequest=t.RenameRequest=t.PrepareSupportDefaultBehavior=t.DocumentOnTypeFormattingRequest=t.DocumentRangesFormattingRequest=t.DocumentRangeFormattingRequest=t.DocumentFormattingRequest=t.DocumentLinkResolveRequest=t.DocumentLinkRequest=t.CodeLensRefreshRequest=t.CodeLensResolveRequest=t.CodeLensRequest=t.WorkspaceSymbolResolveRequest=void 0,t.InlineCompletionRequest=t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=t.InlineValueRefreshRequest=t.InlineValueRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchySubtypesRequest=t.TypeHierarchyPrepareRequest=void 0;const e=me(),r=yc,n=Tc(),i=NT();Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const a=IT();Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return a.TypeDefinitionRequest}});const s=PT();Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return s.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return s.DidChangeWorkspaceFoldersNotification}});const o=OT();Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return o.ConfigurationRequest}});const l=LT();Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return l.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return l.ColorPresentationRequest}});const c=xT();Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return c.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return c.FoldingRangeRefreshRequest}});const u=DT();Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return u.DeclarationRequest}});const d=MT();Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return d.SelectionRangeRequest}});const m=FT();Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return m.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return m.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return m.WorkDoneProgressCancelNotification}});const h=GT();Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return h.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return h.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return h.CallHierarchyPrepareRequest}});const E=jT();Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return E.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return E.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return E.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return E.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return E.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return E.SemanticTokensRegistrationType}});const b=zT();Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return b.ShowDocumentRequest}});const I=UT();Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return I.LinkedEditingRangeRequest}});const C=qT();Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return C.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return C.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return C.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return C.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return C.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return C.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return C.WillDeleteFilesRequest}});const w=BT();Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return w.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return w.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return w.MonikerRequest}});const S=WT();Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return S.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return S.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return S.TypeHierarchySupertypesRequest}});const P=VT();Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return P.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return P.InlineValueRefreshRequest}});const W=KT();Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return W.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return W.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return W.InlayHintRefreshRequest}});const B=HT();Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return B.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return B.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return B.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return B.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return B.DiagnosticRefreshRequest}});const H=XT();Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return H.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return H.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return H.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return H.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return H.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return H.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return H.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return H.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return H.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return H.DidCloseNotebookDocumentNotification}});const ne=YT();Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return ne.InlineCompletionRequest}});var oe;(function(f){function ve(Ee){const q=Ee;return n.string(q)||n.string(q.language)||n.string(q.scheme)||n.string(q.pattern)}f.is=ve})(oe||(t.TextDocumentFilter=oe={}));var le;(function(f){function ve(Ee){const q=Ee;return n.objectLiteral(q)&&(n.string(q.notebookType)||n.string(q.scheme)||n.string(q.pattern))}f.is=ve})(le||(t.NotebookDocumentFilter=le={}));var _;(function(f){function ve(Ee){const q=Ee;return n.objectLiteral(q)&&(n.string(q.notebook)||le.is(q.notebook))&&(q.language===void 0||n.string(q.language))}f.is=ve})(_||(t.NotebookCellTextDocumentFilter=_={}));var R;(function(f){function ve(Ee){if(!Array.isArray(Ee))return!1;for(let q of Ee)if(!n.string(q)&&!oe.is(q)&&!_.is(q))return!1;return!0}f.is=ve})(R||(t.DocumentSelector=R={}));var g;(function(f){f.method="client/registerCapability",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType(f.method)})(g||(t.RegistrationRequest=g={}));var $;(function(f){f.method="client/unregisterCapability",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType(f.method)})($||(t.UnregistrationRequest=$={}));var y;(function(f){f.Create="create",f.Rename="rename",f.Delete="delete"})(y||(t.ResourceOperationKind=y={}));var T;(function(f){f.Abort="abort",f.Transactional="transactional",f.TextOnlyTransactional="textOnlyTransactional",f.Undo="undo"})(T||(t.FailureHandlingKind=T={}));var A;(function(f){f.UTF8="utf-8",f.UTF16="utf-16",f.UTF32="utf-32"})(A||(t.PositionEncodingKind=A={}));var L;(function(f){function ve(Ee){const q=Ee;return q&&n.string(q.id)&&q.id.length>0}f.hasId=ve})(L||(t.StaticRegistrationOptions=L={}));var D;(function(f){function ve(Ee){const q=Ee;return q&&(q.documentSelector===null||R.is(q.documentSelector))}f.is=ve})(D||(t.TextDocumentRegistrationOptions=D={}));var x;(function(f){function ve(q){const p=q;return n.objectLiteral(p)&&(p.workDoneProgress===void 0||n.boolean(p.workDoneProgress))}f.is=ve;function Ee(q){const p=q;return p&&n.boolean(p.workDoneProgress)}f.hasWorkDoneProgress=Ee})(x||(t.WorkDoneProgressOptions=x={}));var j;(function(f){f.method="initialize",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(j||(t.InitializeRequest=j={}));var F;(function(f){f.unknownProtocolVersion=1})(F||(t.InitializeErrorCodes=F={}));var te;(function(f){f.method="initialized",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(te||(t.InitializedNotification=te={}));var z;(function(f){f.method="shutdown",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType0(f.method)})(z||(t.ShutdownRequest=z={}));var Q;(function(f){f.method="exit",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType0(f.method)})(Q||(t.ExitNotification=Q={}));var Ne;(function(f){f.method="workspace/didChangeConfiguration",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(Ne||(t.DidChangeConfigurationNotification=Ne={}));var ge;(function(f){f.Error=1,f.Warning=2,f.Info=3,f.Log=4,f.Debug=5})(ge||(t.MessageType=ge={}));var ce;(function(f){f.method="window/showMessage",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolNotificationType(f.method)})(ce||(t.ShowMessageNotification=ce={}));var ke;(function(f){f.method="window/showMessageRequest",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType(f.method)})(ke||(t.ShowMessageRequest=ke={}));var Ie;(function(f){f.method="window/logMessage",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolNotificationType(f.method)})(Ie||(t.LogMessageNotification=Ie={}));var Ce;(function(f){f.method="telemetry/event",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolNotificationType(f.method)})(Ce||(t.TelemetryEventNotification=Ce={}));var Y;(function(f){f.None=0,f.Full=1,f.Incremental=2})(Y||(t.TextDocumentSyncKind=Y={}));var Xe;(function(f){f.method="textDocument/didOpen",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(Xe||(t.DidOpenTextDocumentNotification=Xe={}));var ye;(function(f){function ve(q){let p=q;return p!=null&&typeof p.text=="string"&&p.range!==void 0&&(p.rangeLength===void 0||typeof p.rangeLength=="number")}f.isIncremental=ve;function Ee(q){let p=q;return p!=null&&typeof p.text=="string"&&p.range===void 0&&p.rangeLength===void 0}f.isFull=Ee})(ye||(t.TextDocumentContentChangeEvent=ye={}));var it;(function(f){f.method="textDocument/didChange",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(it||(t.DidChangeTextDocumentNotification=it={}));var Dr;(function(f){f.method="textDocument/didClose",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(Dr||(t.DidCloseTextDocumentNotification=Dr={}));var jn;(function(f){f.method="textDocument/didSave",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(jn||(t.DidSaveTextDocumentNotification=jn={}));var zn;(function(f){f.Manual=1,f.AfterDelay=2,f.FocusOut=3})(zn||(t.TextDocumentSaveReason=zn={}));var Un;(function(f){f.method="textDocument/willSave",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(Un||(t.WillSaveTextDocumentNotification=Un={}));var qn;(function(f){f.method="textDocument/willSaveWaitUntil",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(qn||(t.WillSaveTextDocumentWaitUntilRequest=qn={}));var at;(function(f){f.method="workspace/didChangeWatchedFiles",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(at||(t.DidChangeWatchedFilesNotification=at={}));var Bn;(function(f){f.Created=1,f.Changed=2,f.Deleted=3})(Bn||(t.FileChangeType=Bn={}));var Zi;(function(f){function ve(Ee){const q=Ee;return n.objectLiteral(q)&&(r.URI.is(q.baseUri)||r.WorkspaceFolder.is(q.baseUri))&&n.string(q.pattern)}f.is=ve})(Zi||(t.RelativePattern=Zi={}));var Qi;(function(f){f.Create=1,f.Change=2,f.Delete=4})(Qi||(t.WatchKind=Qi={}));var ea;(function(f){f.method="textDocument/publishDiagnostics",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolNotificationType(f.method)})(ea||(t.PublishDiagnosticsNotification=ea={}));var ta;(function(f){f.Invoked=1,f.TriggerCharacter=2,f.TriggerForIncompleteCompletions=3})(ta||(t.CompletionTriggerKind=ta={}));var Wn;(function(f){f.method="textDocument/completion",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Wn||(t.CompletionRequest=Wn={}));var Vn;(function(f){f.method="completionItem/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Vn||(t.CompletionResolveRequest=Vn={}));var $t;(function(f){f.method="textDocument/hover",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})($t||(t.HoverRequest=$t={}));var Kn;(function(f){f.Invoked=1,f.TriggerCharacter=2,f.ContentChange=3})(Kn||(t.SignatureHelpTriggerKind=Kn={}));var ra;(function(f){f.method="textDocument/signatureHelp",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ra||(t.SignatureHelpRequest=ra={}));var na;(function(f){f.method="textDocument/definition",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(na||(t.DefinitionRequest=na={}));var Hn;(function(f){f.method="textDocument/references",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Hn||(t.ReferencesRequest=Hn={}));var Xn;(function(f){f.method="textDocument/documentHighlight",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Xn||(t.DocumentHighlightRequest=Xn={}));var ia;(function(f){f.method="textDocument/documentSymbol",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ia||(t.DocumentSymbolRequest=ia={}));var aa;(function(f){f.method="textDocument/codeAction",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(aa||(t.CodeActionRequest=aa={}));var sa;(function(f){f.method="codeAction/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(sa||(t.CodeActionResolveRequest=sa={}));var oa;(function(f){f.method="workspace/symbol",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(oa||(t.WorkspaceSymbolRequest=oa={}));var la;(function(f){f.method="workspaceSymbol/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(la||(t.WorkspaceSymbolResolveRequest=la={}));var ca;(function(f){f.method="textDocument/codeLens",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ca||(t.CodeLensRequest=ca={}));var st;(function(f){f.method="codeLens/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(st||(t.CodeLensResolveRequest=st={}));var ua;(function(f){f.method="workspace/codeLens/refresh",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType0(f.method)})(ua||(t.CodeLensRefreshRequest=ua={}));var fa;(function(f){f.method="textDocument/documentLink",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(fa||(t.DocumentLinkRequest=fa={}));var ar;(function(f){f.method="documentLink/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ar||(t.DocumentLinkResolveRequest=ar={}));var da;(function(f){f.method="textDocument/formatting",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(da||(t.DocumentFormattingRequest=da={}));var Mr;(function(f){f.method="textDocument/rangeFormatting",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Mr||(t.DocumentRangeFormattingRequest=Mr={}));var ha;(function(f){f.method="textDocument/rangesFormatting",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ha||(t.DocumentRangesFormattingRequest=ha={}));var Ct;(function(f){f.method="textDocument/onTypeFormatting",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Ct||(t.DocumentOnTypeFormattingRequest=Ct={}));var Xt;(function(f){f.Identifier=1})(Xt||(t.PrepareSupportDefaultBehavior=Xt={}));var pa;(function(f){f.method="textDocument/rename",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(pa||(t.RenameRequest=pa={}));var ma;(function(f){f.method="textDocument/prepareRename",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ma||(t.PrepareRenameRequest=ma={}));var Yt;(function(f){f.method="workspace/executeCommand",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Yt||(t.ExecuteCommandRequest=Yt={}));var Yn;(function(f){f.method="workspace/applyEdit",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType("workspace/applyEdit")})(Yn||(t.ApplyWorkspaceEditRequest=Yn={}))})(Js)),Js}var mi={},Qu;function ZT(){if(Qu)return mi;Qu=1,Object.defineProperty(mi,"__esModule",{value:!0}),mi.createProtocolConnection=void 0;const t=Fn();function e(r,n,i,a){return t.ConnectionStrategy.is(a)&&(a={connectionStrategy:a}),(0,t.createMessageConnection)(r,n,i,a)}return mi.createProtocolConnection=e,mi}var ef;function QT(){return ef||(ef=1,(function(t){var e=dr&&dr.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var c=Object.getOwnPropertyDescriptor(s,o);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(a,l,c)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=dr&&dr.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,r(Fn(),t),r(yc,t),r(me(),t),r(JT(),t);var n=ZT();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:function(){return n.createProtocolConnection}});var i;(function(a){a.lspReservedErrorRangeStart=-32899,a.RequestFailed=-32803,a.ServerCancelled=-32802,a.ContentModified=-32801,a.RequestCancelled=-32800,a.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))})(dr)),dr}var tf;function eR(){return tf||(tf=1,(function(t){var e=cr&&cr.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var c=Object.getOwnPropertyDescriptor(s,o);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(a,l,c)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=cr&&cr.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const n=bu();r(bu(),t),r(QT(),t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}t.createProtocolConnection=i})(cr)),cr}var wa=eR(),Ni;(function(t){function e(r){return{dispose:async()=>await r()}}t.create=e})(Ni||(Ni={}));class tR{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new zi,this.documentPhaseListeners=new zi,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=V.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=pe.CancellationToken.None){var i;for(const a of e){const s=a.uri.toString();if(a.state===V.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,V.IndexedReferences);else if(typeof r.validation=="object"){const o=this.findMissingValidationCategories(a,r);o.length>0&&(this.buildState.set(s,{completed:!1,options:{validation:{categories:o}},result:(i=this.buildState.get(s))==null?void 0:i.result}),a.state=V.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=V.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=pe.CancellationToken.None){this.currentState=V.Changed;const i=[];for(const l of r){const c=this.langiumDocuments.deleteDocuments(l);for(const u of c)i.push(u.uri),this.cleanUpDeleted(u)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let c=this.langiumDocuments.getDocument(l);c===void 0&&(c=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),c.state=V.Changed,this.langiumDocuments.addDocument(c)),this.resetToState(c,V.Changed)}const s=de(a).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,V.ComputedScopes)),await this.emitUpdate(a,i),await Ue(n);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>{var c;return l.state<V.Validated||!((c=this.buildState.get(l.uri.toString()))!=null&&c.completed)||this.resultsAreIncomplete(l,this.updateBuildOptions)}).toArray());await this.buildDocuments(o,this.updateBuildOptions,n)}resultsAreIncomplete(e,r){return this.findMissingValidationCategories(e,r).length>=1}findMissingValidationCategories(e,r){var o,l;const n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=(o=n==null?void 0:n.result)!=null&&o.validationChecks?new Set((l=n==null?void 0:n.result)==null?void 0:l.validationChecks):n!=null&&n.completed?i:new Set,s=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return de(s).filter(c=>!a.has(c)).toArray()}async findChangedUris(e){var n;if(this.langiumDocuments.getDocument(e)??((n=this.textDocuments)==null?void 0:n.get(e)))return[e];try{const i=await this.fileSystemProvider.stat(e);if(i.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(i))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){var r;return!!((r=this.textDocuments)!=null&&r.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),Ni.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case V.Changed:case V.Parsed:this.indexManager.removeContent(e.uri);case V.IndexedContent:e.localSymbols=void 0;case V.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case V.Linked:this.indexManager.removeReferences(e.uri);case V.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case V.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=V.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,V.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,V.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,V.ComputedScopes,n,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await o.collectLocalSymbols(s,n)});const i=e.filter(s=>this.shouldLink(s));await this.runCancelable(i,V.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,V.IndexedReferences,n,s=>this.indexManager.updateReferences(s,n));const a=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(a,V.Validated,n,async s=>{await this.validate(s,n),this.markAsCompleted(s)})}markAsCompleted(e){const r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),a=this.buildState.get(i);(!a||a.completed)&&this.buildState.set(i,{completed:!1,options:r,result:a==null?void 0:a.result})}}async runCancelable(e,r,n,i){for(const s of e)s.state<r&&(await Ue(n),await i(s),s.state=r,await this.notifyDocumentPhase(s,r,n));const a=e.filter(s=>s.state===r);await this.notifyBuildPhase(a,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),Ni.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),Ni.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=pe.CancellationToken.None),i?this.awaitDocumentState(e,i,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){const i=this.langiumDocuments.getDocument(r);if(i){if(i.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(an);if(this.currentState>=e&&e>i.state)return Promise.reject(new wa.ResponseError(wa.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${V[i.state]}, requiring ${V[e]}, but workspace state is already ${V[this.currentState]}. Returning undefined.`))}else return Promise.reject(new wa.ResponseError(wa.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,c=>{Qe.equals(c.uri,r)&&(o.dispose(),l.dispose(),a(c.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(an)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(an):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(an)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await Ue(n),await s(e,n)}catch(o){if(!Os(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const a=this.buildPhaseListeners.get(r).slice();for(const s of a)await Ue(n),await s(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){const n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),a=typeof i.validation=="object"?{...i.validation}:{};a.categories=this.findMissingValidationCategories(e,i);const s=await n.validateDocument(e,a,r);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=de(o.result.validationChecks).concat(a.categories).distinct().toArray():o.result.validationChecks=[...a.categories])}getBuildOptions(e){var r;return((r=this.buildState.get(e.uri.toString()))==null?void 0:r.options)??{}}}class rR{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new oT,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=jt(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{Qe.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),de(i)}allElements(e,r){let n=de(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(a=>this.astReflection.isSubtype(a.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){const r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=pe.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),a=e.uri.toString();this.symbolIndex.set(a,i),this.symbolByTypeIndex.clear(a)}async updateReferences(e,r=pe.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}}class nR{constructor(e){this.initialBuildOptions={},this._ready=new gc,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=pe.CancellationToken.None){const n=await this.performStartup(e);await Ue(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)};await this.loadAdditionalDocuments(e,n);const i=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,i)));const a=de(i).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(a,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{const i=await this.langiumDocuments.getOrCreateDocument(n);r(i)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return ft.parse(e.uri)}async traverseFolder(e,r){try{const 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){const r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){const r=Qe.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}}class iR{buildUnexpectedCharactersMessage(e,r,n,i,a){return So.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return So.buildUnableToPopLexerModeMessage(e)}}const aR={mode:"full"};class sR{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=rf(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new We(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=aR){var i,a;const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:(a=(i=this.tokenBuilder).flushLexingReport)==null?void 0:a.call(i,e)}}toTokenTypeDictionary(e){if(rf(e))return e;const r=Hd(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}}function oR(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function Hd(t){return t&&"modes"in t&&"defaultMode"in t}function rf(t){return!oR(t)&&!Hd(t)}function lR(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=Z.create(0,0));const a=Xd(t),s=Rc(n),o=fR({lines:a,position:i,options:s});return gR({index:0,tokens:o,position:i})}function cR(t,e){const r=Rc(e),n=Xd(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return!!(s!=null&&s.exec(i))&&!!(o!=null&&o.exec(a))}function Xd(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(fp)}const nf=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,uR=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function fR(t){var i,a,s;const e=[];let r=t.position.line,n=t.position.character;for(let o=0;o<t.lines.length;o++){const l=o===0,c=o===t.lines.length-1;let u=t.lines[o],d=0;if(l&&t.options.start){const h=(i=t.options.start)==null?void 0:i.exec(u);h&&(d=h.index+h[0].length)}else{const h=(a=t.options.line)==null?void 0:a.exec(u);h&&(d=h.index+h[0].length)}if(c){const h=(s=t.options.end)==null?void 0:s.exec(u);h&&(u=u.substring(0,h.index))}if(u=u.substring(0,mR(u)),jl(u,d)>=u.length){if(e.length>0){const h=Z.create(r,n);e.push({type:"break",content:"",range:K.create(h,h)})}}else{nf.lastIndex=d;const h=nf.exec(u);if(h){const E=h[0],b=h[1],I=Z.create(r,n+d),C=Z.create(r,n+d+E.length);e.push({type:"tag",content:b,range:K.create(I,C)}),d+=E.length,d=jl(u,d)}if(d<u.length){const E=u.substring(d),b=Array.from(E.matchAll(uR));e.push(...dR(b,E,r,n+d))}}r++,n=0}return e.length>0&&e[e.length-1].type==="break"?e.slice(0,-1):e}function dR(t,e,r,n){const i=[];if(t.length===0){const a=Z.create(r,n),s=Z.create(r,n+e.length);i.push({type:"text",content:e,range:K.create(a,s)})}else{let a=0;for(const o of t){const l=o.index,c=e.substring(a,l);c.length>0&&i.push({type:"text",content:e.substring(a,l),range:K.create(Z.create(r,a+n),Z.create(r,l+n))});let u=c.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:K.create(Z.create(r,a+u+n),Z.create(r,a+u+d.length+n))}),u+=d.length,o.length===4){u+=o[2].length;const m=o[3];i.push({type:"text",content:m,range:K.create(Z.create(r,a+u+n),Z.create(r,a+u+m.length+n))})}else i.push({type:"text",content:"",range:K.create(Z.create(r,a+u+n),Z.create(r,a+u+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:K.create(Z.create(r,a+n),Z.create(r,a+n+s.length))})}return i}const hR=/\S/,pR=/\s*$/;function jl(t,e){const r=t.substring(e).match(hR);return r?e+r.index:t.length}function mR(t){const e=t.match(pR);if(e&&typeof e.index=="number")return e.index}function gR(t){var a,s;const e=Z.create(t.position.line,t.position.character);if(t.tokens.length===0)return new af([],K.create(e,e));const r=[];for(;t.index<t.tokens.length;){const o=yR(t,r[r.length-1]);o&&r.push(o)}const n=((a=r[0])==null?void 0:a.range.start)??e,i=((s=r[r.length-1])==null?void 0:s.range.end)??e;return new af(r,K.create(n,i))}function yR(t,e){const r=t.tokens[t.index];if(r.type==="tag")return Jd(t,!1);if(r.type==="text"||r.type==="inline-tag")return Yd(t);TR(r,e),t.index++}function TR(t,e){if(e){const r=new Qd("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function Yd(t){let e=t.tokens[t.index];const r=e;let n=e;const i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(RR(t)),n=e,e=t.tokens[t.index];return new zl(i,K.create(r.range.start,n.range.end))}function RR(t){return t.tokens[t.index].type==="inline-tag"?Jd(t,!0):Zd(t)}function Jd(t,e){const r=t.tokens[t.index++],n=r.content.substring(1),i=t.tokens[t.index];if((i==null?void 0:i.type)==="text")if(e){const a=Zd(t);return new Qs(n,new zl([a],a.range),e,K.create(r.range.start,a.range.end))}else{const a=Yd(t);return new Qs(n,a,e,K.create(r.range.start,a.range.end))}else{const a=r.range;return new Qs(n,new zl([],a),e,a)}}function Zd(t){const e=t.tokens[t.index++];return new Qd(e.content,e.range)}function Rc(t){if(!t)return Rc({start:"/**",end:"*/",line:"*"});const{start:e,end:r,line:n}=t;return{start:Zs(e,!0),end:Zs(r,!1),line:Zs(n,!0)}}function Zs(t,e){if(typeof t=="string"||typeof t=="object"){const r=typeof t=="string"?Cs(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}class af{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(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=sf(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=sf(r)+i}return r.trim()}}class Qs{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e}
|
|
152
|
+
${r}`),this.inline?`{${e}}`:e}toMarkdown(e){var r;return((r=e==null?void 0:e.renderTag)==null?void 0:r.call(e,this))??this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const a=vR(this.name,r,e??{});if(typeof a=="string")return a}let n="";(e==null?void 0:e.tag)==="italic"||(e==null?void 0:e.tag)===void 0?n="*":(e==null?void 0:e.tag)==="bold"?n="**":(e==null?void 0:e.tag)==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} — ${r}`:this.content.inlines.length>1&&(i=`${i}
|
|
153
|
+
${r}`),this.inline?`{${i}}`:i}}function vR(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const o=jl(e,i);a=e.substring(o),e=e.substring(0,i)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(a=`\`${a}\``),((n=r.renderLink)==null?void 0:n.call(r,e,a))??ER(e,a)}}function ER(t,e){try{return ft.parse(t,!0),`[${e}](${t})`}catch{return t}}class zl{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;r<this.inlines.length;r++){const n=this.inlines[r],i=this.inlines[r+1];e+=n.toString(),i&&i.range.start.line>n.range.start.line&&(e+=`
|
|
154
|
+
`)}return e}toMarkdown(e){let r="";for(let n=0;n<this.inlines.length;n++){const i=this.inlines[n],a=this.inlines[n+1];r+=i.toMarkdown(e),a&&a.range.start.line>i.range.start.line&&(r+=`
|
|
155
|
+
`)}return r}}class Qd{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}}function sf(t){return t.endsWith(`
|
|
156
|
+
`)?`
|
|
157
|
+
`:`
|
|
158
|
+
|
|
159
|
+
`}class AR{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&cR(r))return lR(r).toMarkdown({renderLink:(i,a)=>this.documentationLinkRenderer(e,i,a),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,r,n){const i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){const a=i.nameSegment.range.start.line+1,s=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${a},${s}`});return`[${n}](${o.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const i=jt(e).localSymbols;if(!i)return;let a=e;do{const o=i.getStream(a).find(l=>l.name===r);if(o)return o;a=a.$container}while(a)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}}class $R{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return uT(e)?e.$comment:(r=sp(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}}class CR{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}}class SR{constructor(){this.previousTokenSource=new pe.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=Xy();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=pe.CancellationToken.None){const i=new gc,a={action:r,deferred:i,cancellationToken:n};return e.push(a),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const 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{const a=await Promise.resolve().then(()=>r(i));n.resolve(a)}catch(a){Os(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class wR{constructor(e){this.grammarElementIdMap=new du,this.tokenTypeIdMap=new du,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){const r=new Map,n=new Map;for(const i of zt(e))r.set(i,{});if(e.$cstNode)for(const i of vo(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const 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(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Fe(o)?s.push(this.dehydrateAstNode(o,r)):ut(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else Fe(a)?n[i]=this.dehydrateAstNode(a,r):ut(a)?n[i]=this.dehydrateReference(a,r):a!==void 0&&(n[i]=a);return n}dehydrateReference(e,r){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){const n=r.cstNodes.get(e);return Cf(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Ii(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):$f(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){const 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){const r=new Map,n=new Map;for(const a of zt(e))r.set(a,{});let i;if(e.$cstNode)for(const a of vo(e.$cstNode)){let s;"fullText"in a?(s=new Id(a.fullText),i=s):"content"in a?s=new hc:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(n.set(a,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){const 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(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Fe(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):ut(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else Fe(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):ut(a)?n[i]=this.hydrateReference(a,n,i,r):a!==void 0&&(n[i]=a);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){const i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),Ii(i))for(const a of e.content){const s=this.hydrateCstNode(a,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,l=e.endColumn,c=e.hidden;return new Ol(n,i,{start:{line:a,character:s},end:{line:o,character:l}},r,c)}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(const r of zt(this.grammar))Mh(r)&&this.grammarElementIdMap.set(r,e++)}}function vt(t){return{documentation:{CommentProvider:e=>new $R(e),DocumentationProvider:e=>new AR(e)},parser:{AsyncParser:e=>new CR(e),GrammarConfig:e=>Op(e),LangiumParser:e=>Wy(e),CompletionParser:e=>By(e),ValueConverter:()=>new jd,TokenBuilder:()=>new Gd,Lexer:e=>new sR(e),ParserErrorMessageProvider:()=>new Ld,LexerErrorMessageProvider:()=>new iR},workspace:{AstNodeLocator:()=>new vT,AstNodeDescriptionProvider:e=>new TT(e),ReferenceDescriptionProvider:e=>new RT(e)},references:{Linker:e=>new eT(e),NameProvider:()=>new rT,ScopeProvider:e=>new cT(e),ScopeComputation:e=>new iT(e),References:e=>new nT(e)},serializer:{Hydrator:e=>new wR(e),JsonSerializer:e=>new fT(e)},validation:{DocumentValidator:e=>new mT(e),ValidationRegistry:e=>new hT(e)},shared:()=>t.shared}}function Et(t){return{ServiceRegistry:e=>new dT(e),workspace:{LangiumDocuments:e=>new Qy(e),LangiumDocumentFactory:e=>new Zy(e),DocumentBuilder:e=>new tR(e),IndexManager:e=>new rR(e),WorkspaceManager:e=>new nR(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new SR,ConfigurationProvider:e=>new AT(e)},profilers:{}}}var of;(function(t){t.merge=(e,r)=>Ui(Ui({},e),r)})(of||(of={}));function we(t,e,r,n,i,a,s,o,l){const c=[t,e,r,n,i,a,s,o,l].reduce(Ui,{});return eh(c)}const kR=Symbol("isProxy");function eh(t,e){const r=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(n,i)=>i===kR?!0:cf(n,i,t,e||r),getOwnPropertyDescriptor:(n,i)=>(cf(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),has:(n,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return r}const lf=Symbol();function cf(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]===lf)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){const i=r[e];t[e]=lf;try{t[e]=typeof i=="function"?i(n):eh(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}function Ui(t,e){if(e){for(const[r,n]of Object.entries(e))if(n!=null)if(typeof n=="object"){const i=t[r];typeof i=="object"&&i!==null?t[r]=Ui(i,n):t[r]=Ui({},n)}else t[r]=n}return t}class bR{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[]}}const At={fileSystemProvider:()=>new bR},_R={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},NR={AstReflection:()=>new Nf};function IR(){const t=we(Et(At),NR),e=we(vt({shared:t}),_R);return t.ServiceRegistry.register(e),e}function Vt(t){const e=IR(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,ft.parse(`memory:/${r.name??"grammar"}.langium`)),r}var PR=Object.defineProperty,N=(t,e)=>PR(t,"name",{value:e,configurable:!0}),Ul;(t=>{t.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[\w ]+)\]/}})(Ul||(Ul={}));var ql;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(ql||(ql={}));var Bl;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Bl||(Bl={}));var Wl;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Wl||(Wl={}));var Vl;(t=>{t.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Vl||(Vl={}));var Kl;(t=>{t.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Kl||(Kl={}));var Hl;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(Hl||(Hl={}));var Xl;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,STRING2:/"[^"]*"|'[^']*'/}})(Xl||(Xl={}));var Yl;(t=>{t.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+</,LINK_ARROW:/-->|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z][A-Za-z0-9_()&]*(?:[ \t]+[A-Za-z(][A-Za-z0-9_()&]*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Yl||(Yl={}));({...Ul.Terminals,...ql.Terminals,...Bl.Terminals,...Wl.Terminals,...Vl.Terminals,...Kl.Terminals,...Xl.Terminals,...Hl.Terminals,...Yl.Terminals});var ka={$type:"Accelerator",name:"name",x:"x",y:"y"},ba={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},gi={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},eo={$type:"Annotations",x:"x",y:"y"},xt={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function OR(t){return nt.isInstance(t,xt.$type)}N(OR,"isArchitecture");var _a={$type:"Axis",label:"label",name:"name"},Ya={$type:"Branch",name:"name",order:"order"};function LR(t){return nt.isInstance(t,Ya.$type)}N(LR,"isBranch");var uf={$type:"Checkout",branch:"branch"},Na={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},to={$type:"ClassDefStatement",className:"className",styleText:"styleText"},Zr={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function xR(t){return nt.isInstance(t,Zr.$type)}N(xR,"isCommit");var yr={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},Ia={$type:"Curve",entries:"entries",label:"label",name:"name"},Pa={$type:"Deaccelerator",name:"name",x:"x",y:"y"},ff={$type:"Decorator",strategy:"strategy"},zr={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},ht={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},ro={$type:"Entry",axis:"axis",value:"value"},df={$type:"Evolution",stages:"stages"},Oa={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},no={$type:"Evolve",component:"component",target:"target"},Cr={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function DR(t){return nt.isInstance(t,Cr.$type)}N(DR,"isGitGraph");var yi={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},_i={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function MR(t){return nt.isInstance(t,_i.$type)}N(MR,"isInfo");var Ti={$type:"Item",classSelector:"classSelector",name:"name"},io={$type:"Junction",id:"id",in:"in"},Ri={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},La={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},Tr={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},Qr={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function FR(t){return nt.isInstance(t,Qr.$type)}N(FR,"isMerge");var xa={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},ao={$type:"Option",name:"name",value:"value"},en={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function GR(t){return nt.isInstance(t,en.$type)}N(GR,"isPacket");var tn={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function jR(t){return nt.isInstance(t,tn.$type)}N(jR,"isPacketBlock");var Sr={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function zR(t){return nt.isInstance(t,Sr.$type)}N(zR,"isPie");var Ja={$type:"PieSection",label:"label",value:"value"};function UR(t){return nt.isInstance(t,Ja.$type)}N(UR,"isPieSection");var so={$type:"Pipeline",components:"components",parent:"parent"},Da={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},Rr={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},oo={$type:"Section",classSelector:"classSelector",name:"name"},Ur={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},lo={$type:"Size",height:"height",width:"width"},qr={$type:"Statement"},rn={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function qR(t){return nt.isInstance(t,rn.$type)}N(qR,"isTreemap");var co={$type:"TreemapRow",indent:"indent",item:"item"},uo={$type:"TreeNode",indent:"indent",name:"name"},vi={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},Le={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function BR(t){return nt.isInstance(t,Le.$type)}N(BR,"isWardley");var on,th=(on=class extends Af{constructor(){super(...arguments),this.types={Accelerator:{name:ka.$type,properties:{name:{name:ka.name},x:{name:ka.x},y:{name:ka.y}},superTypes:[]},Anchor:{name:ba.$type,properties:{evolution:{name:ba.evolution},name:{name:ba.name},visibility:{name:ba.visibility}},superTypes:[]},Annotation:{name:gi.$type,properties:{number:{name:gi.number},text:{name:gi.text},x:{name:gi.x},y:{name:gi.y}},superTypes:[]},Annotations:{name:eo.$type,properties:{x:{name:eo.x},y:{name:eo.y}},superTypes:[]},Architecture:{name:xt.$type,properties:{accDescr:{name:xt.accDescr},accTitle:{name:xt.accTitle},edges:{name:xt.edges,defaultValue:[]},groups:{name:xt.groups,defaultValue:[]},junctions:{name:xt.junctions,defaultValue:[]},services:{name:xt.services,defaultValue:[]},title:{name:xt.title}},superTypes:[]},Axis:{name:_a.$type,properties:{label:{name:_a.label},name:{name:_a.name}},superTypes:[]},Branch:{name:Ya.$type,properties:{name:{name:Ya.name},order:{name:Ya.order}},superTypes:[qr.$type]},Checkout:{name:uf.$type,properties:{branch:{name:uf.branch}},superTypes:[qr.$type]},CherryPicking:{name:Na.$type,properties:{id:{name:Na.id},parent:{name:Na.parent},tags:{name:Na.tags,defaultValue:[]}},superTypes:[qr.$type]},ClassDefStatement:{name:to.$type,properties:{className:{name:to.className},styleText:{name:to.styleText}},superTypes:[]},Commit:{name:Zr.$type,properties:{id:{name:Zr.id},message:{name:Zr.message},tags:{name:Zr.tags,defaultValue:[]},type:{name:Zr.type}},superTypes:[qr.$type]},Component:{name:yr.$type,properties:{decorator:{name:yr.decorator},evolution:{name:yr.evolution},inertia:{name:yr.inertia,defaultValue:!1},label:{name:yr.label},name:{name:yr.name},visibility:{name:yr.visibility}},superTypes:[]},Curve:{name:Ia.$type,properties:{entries:{name:Ia.entries,defaultValue:[]},label:{name:Ia.label},name:{name:Ia.name}},superTypes:[]},Deaccelerator:{name:Pa.$type,properties:{name:{name:Pa.name},x:{name:Pa.x},y:{name:Pa.y}},superTypes:[]},Decorator:{name:ff.$type,properties:{strategy:{name:ff.strategy}},superTypes:[]},Direction:{name:zr.$type,properties:{accDescr:{name:zr.accDescr},accTitle:{name:zr.accTitle},dir:{name:zr.dir},statements:{name:zr.statements,defaultValue:[]},title:{name:zr.title}},superTypes:[Cr.$type]},Edge:{name:ht.$type,properties:{lhsDir:{name:ht.lhsDir},lhsGroup:{name:ht.lhsGroup,defaultValue:!1},lhsId:{name:ht.lhsId},lhsInto:{name:ht.lhsInto,defaultValue:!1},rhsDir:{name:ht.rhsDir},rhsGroup:{name:ht.rhsGroup,defaultValue:!1},rhsId:{name:ht.rhsId},rhsInto:{name:ht.rhsInto,defaultValue:!1},title:{name:ht.title}},superTypes:[]},Entry:{name:ro.$type,properties:{axis:{name:ro.axis,referenceType:_a.$type},value:{name:ro.value}},superTypes:[]},Evolution:{name:df.$type,properties:{stages:{name:df.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:Oa.$type,properties:{boundary:{name:Oa.boundary},name:{name:Oa.name},secondName:{name:Oa.secondName}},superTypes:[]},Evolve:{name:no.$type,properties:{component:{name:no.component},target:{name:no.target}},superTypes:[]},GitGraph:{name:Cr.$type,properties:{accDescr:{name:Cr.accDescr},accTitle:{name:Cr.accTitle},statements:{name:Cr.statements,defaultValue:[]},title:{name:Cr.title}},superTypes:[]},Group:{name:yi.$type,properties:{icon:{name:yi.icon},id:{name:yi.id},in:{name:yi.in},title:{name:yi.title}},superTypes:[]},Info:{name:_i.$type,properties:{accDescr:{name:_i.accDescr},accTitle:{name:_i.accTitle},title:{name:_i.title}},superTypes:[]},Item:{name:Ti.$type,properties:{classSelector:{name:Ti.classSelector},name:{name:Ti.name}},superTypes:[]},Junction:{name:io.$type,properties:{id:{name:io.id},in:{name:io.in}},superTypes:[]},Label:{name:Ri.$type,properties:{negX:{name:Ri.negX,defaultValue:!1},negY:{name:Ri.negY,defaultValue:!1},offsetX:{name:Ri.offsetX},offsetY:{name:Ri.offsetY}},superTypes:[]},Leaf:{name:La.$type,properties:{classSelector:{name:La.classSelector},name:{name:La.name},value:{name:La.value}},superTypes:[Ti.$type]},Link:{name:Tr.$type,properties:{arrow:{name:Tr.arrow},from:{name:Tr.from},fromPort:{name:Tr.fromPort},linkLabel:{name:Tr.linkLabel},to:{name:Tr.to},toPort:{name:Tr.toPort}},superTypes:[]},Merge:{name:Qr.$type,properties:{branch:{name:Qr.branch},id:{name:Qr.id},tags:{name:Qr.tags,defaultValue:[]},type:{name:Qr.type}},superTypes:[qr.$type]},Note:{name:xa.$type,properties:{evolution:{name:xa.evolution},text:{name:xa.text},visibility:{name:xa.visibility}},superTypes:[]},Option:{name:ao.$type,properties:{name:{name:ao.name},value:{name:ao.value,defaultValue:!1}},superTypes:[]},Packet:{name:en.$type,properties:{accDescr:{name:en.accDescr},accTitle:{name:en.accTitle},blocks:{name:en.blocks,defaultValue:[]},title:{name:en.title}},superTypes:[]},PacketBlock:{name:tn.$type,properties:{bits:{name:tn.bits},end:{name:tn.end},label:{name:tn.label},start:{name:tn.start}},superTypes:[]},Pie:{name:Sr.$type,properties:{accDescr:{name:Sr.accDescr},accTitle:{name:Sr.accTitle},sections:{name:Sr.sections,defaultValue:[]},showData:{name:Sr.showData,defaultValue:!1},title:{name:Sr.title}},superTypes:[]},PieSection:{name:Ja.$type,properties:{label:{name:Ja.label},value:{name:Ja.value}},superTypes:[]},Pipeline:{name:so.$type,properties:{components:{name:so.components,defaultValue:[]},parent:{name:so.parent}},superTypes:[]},PipelineComponent:{name:Da.$type,properties:{evolution:{name:Da.evolution},label:{name:Da.label},name:{name:Da.name}},superTypes:[]},Radar:{name:Rr.$type,properties:{accDescr:{name:Rr.accDescr},accTitle:{name:Rr.accTitle},axes:{name:Rr.axes,defaultValue:[]},curves:{name:Rr.curves,defaultValue:[]},options:{name:Rr.options,defaultValue:[]},title:{name:Rr.title}},superTypes:[]},Section:{name:oo.$type,properties:{classSelector:{name:oo.classSelector},name:{name:oo.name}},superTypes:[Ti.$type]},Service:{name:Ur.$type,properties:{icon:{name:Ur.icon},iconText:{name:Ur.iconText},id:{name:Ur.id},in:{name:Ur.in},title:{name:Ur.title}},superTypes:[]},Size:{name:lo.$type,properties:{height:{name:lo.height},width:{name:lo.width}},superTypes:[]},Statement:{name:qr.$type,properties:{},superTypes:[]},TreeNode:{name:uo.$type,properties:{indent:{name:uo.indent},name:{name:uo.name}},superTypes:[]},TreeView:{name:vi.$type,properties:{accDescr:{name:vi.accDescr},accTitle:{name:vi.accTitle},nodes:{name:vi.nodes,defaultValue:[]},title:{name:vi.title}},superTypes:[]},Treemap:{name:rn.$type,properties:{accDescr:{name:rn.accDescr},accTitle:{name:rn.accTitle},title:{name:rn.title},TreemapRows:{name:rn.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:co.$type,properties:{indent:{name:co.indent},item:{name:co.item}},superTypes:[]},Wardley:{name:Le.$type,properties:{accDescr:{name:Le.accDescr},accelerators:{name:Le.accelerators,defaultValue:[]},accTitle:{name:Le.accTitle},anchors:{name:Le.anchors,defaultValue:[]},annotation:{name:Le.annotation,defaultValue:[]},annotations:{name:Le.annotations,defaultValue:[]},components:{name:Le.components,defaultValue:[]},deaccelerators:{name:Le.deaccelerators,defaultValue:[]},evolution:{name:Le.evolution},evolves:{name:Le.evolves,defaultValue:[]},links:{name:Le.links,defaultValue:[]},notes:{name:Le.notes,defaultValue:[]},pipelines:{name:Le.pipelines,defaultValue:[]},size:{name:Le.size},title:{name:Le.title}},superTypes:[]}}}},N(on,"MermaidAstReflection"),on),nt=new th,hf,WR=N(()=>hf??(hf=Vt(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@18"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[\\\\w ]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),pf,VR=N(()=>pf??(pf=Vt(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),mf,KR=N(()=>mf??(mf=Vt(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),gf,HR=N(()=>gf??(gf=Vt(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),yf,XR=N(()=>yf??(yf=Vt(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),Tf,YR=N(()=>Tf??(Tf=Vt(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),Rf,JR=N(()=>Rf??(Rf=Vt(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),vf,ZR=N(()=>vf??(vf=Vt(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@9"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n * Converted from treemap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),Ef,QR=N(()=>Ef??(Ef=Vt(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'</","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'>/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z][A-Za-z0-9_()&]*(?:[ \\\\t]+[A-Za-z(][A-Za-z0-9_()&]*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),ev={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},tv={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},rv={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},nv={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},iv={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},av={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},sv={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ov={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},lv={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Kt={AstReflection:N(()=>new th,"AstReflection")},cv={Grammar:N(()=>WR(),"Grammar"),LanguageMetaData:N(()=>ev,"LanguageMetaData"),parser:{}},uv={Grammar:N(()=>VR(),"Grammar"),LanguageMetaData:N(()=>tv,"LanguageMetaData"),parser:{}},fv={Grammar:N(()=>KR(),"Grammar"),LanguageMetaData:N(()=>rv,"LanguageMetaData"),parser:{}},dv={Grammar:N(()=>HR(),"Grammar"),LanguageMetaData:N(()=>nv,"LanguageMetaData"),parser:{}},hv={Grammar:N(()=>XR(),"Grammar"),LanguageMetaData:N(()=>iv,"LanguageMetaData"),parser:{}},pv={Grammar:N(()=>YR(),"Grammar"),LanguageMetaData:N(()=>av,"LanguageMetaData"),parser:{}},mv={Grammar:N(()=>JR(),"Grammar"),LanguageMetaData:N(()=>sv,"LanguageMetaData"),parser:{}},gv={Grammar:N(()=>ZR(),"Grammar"),LanguageMetaData:N(()=>ov,"LanguageMetaData"),parser:{}},yv={Grammar:N(()=>QR(),"Grammar"),LanguageMetaData:N(()=>lv,"LanguageMetaData"),parser:{}},Tv=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,Rv=/accTitle[\t ]*:([^\n\r]*)/,vv=/title([\t ][^\n\r]*|)/,Ev={ACC_DESCR:Tv,ACC_TITLE:Rv,TITLE:vv},ln,Gn=(ln=class extends jd{runConverter(e,r,n){let i=this.runCommonConverter(e,r,n);return i===void 0&&(i=this.runCustomConverter(e,r,n)),i===void 0?super.runConverter(e,r,n):i}runCommonConverter(e,r,n){const i=Ev[e.name];if(i===void 0)return;const a=i.exec(r);if(a!==null){if(a[1]!==void 0)return a[1].trim().replace(/[\t ]{2,}/gm," ");if(a[2]!==void 0)return a[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,`
|
|
160
|
+
`)}}},N(ln,"AbstractMermaidValueConverter"),ln),cn,Ls=(cn=class extends Gn{runCustomConverter(e,r,n){}},N(cn,"CommonValueConverter"),cn),un,Ht=(un=class extends Gd{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,r,n){const i=super.buildKeywordTokens(e,r,n);return i.forEach(a=>{this.keywords.has(a.name)&&a.PATTERN!==void 0&&(a.PATTERN=new RegExp(a.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),i}},N(un,"AbstractMermaidTokenBuilder"),un),fn;fn=class extends Ht{},N(fn,"CommonTokenBuilder");var dn,Av=(dn=class extends Ht{constructor(){super(["treemap"])}},N(dn,"TreemapTokenBuilder"),dn),$v=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,hn,Cv=(hn=class extends Gn{runCustomConverter(e,r,n){if(e.name==="NUMBER2")return parseFloat(r.replace(/,/g,""));if(e.name==="SEPARATOR")return r.substring(1,r.length-1);if(e.name==="STRING2")return r.substring(1,r.length-1);if(e.name==="INDENTATION")return r.length;if(e.name==="ClassDef"){if(typeof r!="string")return r;const i=$v.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},N(hn,"TreemapValueConverter"),hn);function rh(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}N(rh,"registerValidationChecks");var pn,Sv=(pn=class{checkSingleRoot(e,r){let n;for(const i of e.TreemapRows)i.item&&(n===void 0&&i.indent===void 0?n=0:i.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}):n!==void 0&&n>=parseInt(i.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}))}},N(pn,"TreemapValidator"),pn),nh={parser:{TokenBuilder:N(()=>new Av,"TokenBuilder"),ValueConverter:N(()=>new Cv,"ValueConverter")},validation:{TreemapValidator:N(()=>new Sv,"TreemapValidator")}};function ih(t=At){const e=we(Et(t),Kt),r=we(vt({shared:e}),mv,nh);return e.ServiceRegistry.register(r),rh(r),{shared:e,Treemap:r}}N(ih,"createTreemapServices");var mn,wv=(mn=class extends Gn{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},N(mn,"WardleyValueConverter"),mn),ah={parser:{ValueConverter:N(()=>new wv,"ValueConverter")}};function sh(t=At){const e=we(Et(t),Kt),r=we(vt({shared:e}),yv,ah);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}N(sh,"createWardleyServices");var gn,kv=(gn=class extends Ht{constructor(){super(["gitGraph"])}},N(gn,"GitGraphTokenBuilder"),gn),oh={parser:{TokenBuilder:N(()=>new kv,"TokenBuilder"),ValueConverter:N(()=>new Ls,"ValueConverter")}};function lh(t=At){const e=we(Et(t),Kt),r=we(vt({shared:e}),uv,oh);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}N(lh,"createGitGraphServices");var yn,bv=(yn=class extends Ht{constructor(){super(["info","showInfo"])}},N(yn,"InfoTokenBuilder"),yn),ch={parser:{TokenBuilder:N(()=>new bv,"TokenBuilder"),ValueConverter:N(()=>new Ls,"ValueConverter")}};function uh(t=At){const e=we(Et(t),Kt),r=we(vt({shared:e}),fv,ch);return e.ServiceRegistry.register(r),{shared:e,Info:r}}N(uh,"createInfoServices");var Tn,_v=(Tn=class extends Ht{constructor(){super(["packet"])}},N(Tn,"PacketTokenBuilder"),Tn),fh={parser:{TokenBuilder:N(()=>new _v,"TokenBuilder"),ValueConverter:N(()=>new Ls,"ValueConverter")}};function dh(t=At){const e=we(Et(t),Kt),r=we(vt({shared:e}),dv,fh);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}N(dh,"createPacketServices");var Rn,Nv=(Rn=class extends Ht{constructor(){super(["pie","showData"])}},N(Rn,"PieTokenBuilder"),Rn),vn,Iv=(vn=class extends Gn{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},N(vn,"PieValueConverter"),vn),hh={parser:{TokenBuilder:N(()=>new Nv,"TokenBuilder"),ValueConverter:N(()=>new Iv,"ValueConverter")}};function ph(t=At){const e=we(Et(t),Kt),r=we(vt({shared:e}),hv,hh);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}N(ph,"createPieServices");var En,Pv=(En=class extends Gn{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return(r==null?void 0:r.length)||0;if(e.name==="STRING2")return r.substring(1,r.length-1)}},N(En,"TreeViewValueConverter"),En),An,Ov=(An=class extends Ht{constructor(){super(["treeView-beta"])}},N(An,"TreeViewTokenBuilder"),An),mh={parser:{TokenBuilder:N(()=>new Ov,"TokenBuilder"),ValueConverter:N(()=>new Pv,"ValueConverter")}};function gh(t=At){const e=we(Et(t),Kt),r=we(vt({shared:e}),gv,mh);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}N(gh,"createTreeViewServices");var $n,Lv=($n=class extends Ht{constructor(){super(["architecture"])}},N($n,"ArchitectureTokenBuilder"),$n),Cn,xv=(Cn=class extends Gn{runCustomConverter(e,r,n){if(e.name==="ARCH_ICON")return r.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return r.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let i=r.replace(/^\[|]$/g,"").trim();return(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1),i=i.replace(/\\"/g,'"').replace(/\\'/g,"'")),i.trim()}}},N(Cn,"ArchitectureValueConverter"),Cn),yh={parser:{TokenBuilder:N(()=>new Lv,"TokenBuilder"),ValueConverter:N(()=>new xv,"ValueConverter")}};function Th(t=At){const e=we(Et(t),Kt),r=we(vt({shared:e}),cv,yh);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}N(Th,"createArchitectureServices");var Sn,Dv=(Sn=class extends Ht{constructor(){super(["radar-beta"])}},N(Sn,"RadarTokenBuilder"),Sn),Rh={parser:{TokenBuilder:N(()=>new Dv,"TokenBuilder"),ValueConverter:N(()=>new Ls,"ValueConverter")}};function vh(t=At){const e=we(Et(t),Kt),r=we(vt({shared:e}),pv,Rh);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}N(vh,"createRadarServices");var lt={},Mv={info:N(async()=>{const{createInfoServices:t}=await St(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>jv);return{createInfoServices:r}},void 0),e=t().Info.parser.LangiumParser;lt.info=e},"info"),packet:N(async()=>{const{createPacketServices:t}=await St(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>zv);return{createPacketServices:r}},void 0),e=t().Packet.parser.LangiumParser;lt.packet=e},"packet"),pie:N(async()=>{const{createPieServices:t}=await St(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>Uv);return{createPieServices:r}},void 0),e=t().Pie.parser.LangiumParser;lt.pie=e},"pie"),treeView:N(async()=>{const{createTreeViewServices:t}=await St(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>qv);return{createTreeViewServices:r}},void 0),e=t().TreeView.parser.LangiumParser;lt.treeView=e},"treeView"),architecture:N(async()=>{const{createArchitectureServices:t}=await St(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>Bv);return{createArchitectureServices:r}},void 0),e=t().Architecture.parser.LangiumParser;lt.architecture=e},"architecture"),gitGraph:N(async()=>{const{createGitGraphServices:t}=await St(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>Wv);return{createGitGraphServices:r}},void 0),e=t().GitGraph.parser.LangiumParser;lt.gitGraph=e},"gitGraph"),radar:N(async()=>{const{createRadarServices:t}=await St(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>Vv);return{createRadarServices:r}},void 0),e=t().Radar.parser.LangiumParser;lt.radar=e},"radar"),treemap:N(async()=>{const{createTreemapServices:t}=await St(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>Kv);return{createTreemapServices:r}},void 0),e=t().Treemap.parser.LangiumParser;lt.treemap=e},"treemap"),wardley:N(async()=>{const{createWardleyServices:t}=await St(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>Hv);return{createWardleyServices:r}},void 0),e=t().Wardley.parser.LangiumParser;lt.wardley=e},"wardley")};async function Fv(t,e){const r=Mv[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);lt[t]||await r();const i=lt[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new Gv(i);return i.value}N(Fv,"parse");var wn,Gv=(wn=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const a=i.line!==void 0&&!isNaN(i.line)?i.line:"?",s=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${a}, column ${s}: ${i.message}`}).join(`
|
|
161
|
+
`),n=e.parserErrors.map(i=>{const a=i.token.startLine!==void 0&&!isNaN(i.token.startLine)?i.token.startLine:"?",s=i.token.startColumn!==void 0&&!isNaN(i.token.startColumn)?i.token.startColumn:"?";return`Parse error on line ${a}, column ${s}: ${i.message}`}).join(`
|
|
162
|
+
`);super(`Parsing failed: ${r} ${n}`),this.result=e}},N(wn,"MermaidParseError"),wn);const jv=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:ch,createInfoServices:uh},Symbol.toStringTag,{value:"Module"})),zv=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:fh,createPacketServices:dh},Symbol.toStringTag,{value:"Module"})),Uv=Object.freeze(Object.defineProperty({__proto__:null,PieModule:hh,createPieServices:ph},Symbol.toStringTag,{value:"Module"})),qv=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:mh,createTreeViewServices:gh},Symbol.toStringTag,{value:"Module"})),Bv=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:yh,createArchitectureServices:Th},Symbol.toStringTag,{value:"Module"})),Wv=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:oh,createGitGraphServices:lh},Symbol.toStringTag,{value:"Module"})),Vv=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:Rh,createRadarServices:vh},Symbol.toStringTag,{value:"Module"})),Kv=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:nh,createTreemapServices:ih},Symbol.toStringTag,{value:"Module"})),Hv=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:ah,createWardleyServices:sh},Symbol.toStringTag,{value:"Module"}));export{Fv as p};
|