orbitchat 3.7.2 → 3.8.0

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.
Files changed (64) hide show
  1. package/dist/assets/{ChartRenderer-D0AWpQRu.js → ChartRenderer-BtP6M888.js} +17 -17
  2. package/dist/assets/{MermaidRenderer-BbPt4jtD.js → MermaidRenderer-COe0fSY4.js} +5 -5
  3. package/dist/assets/{MusicRenderer-Brav4mm2.js → MusicRenderer-3SlVL3Cp.js} +2 -2
  4. package/dist/assets/{SVGRenderer-Ct8XMIcE.js → SVGRenderer-DmGNRIG9.js} +1 -1
  5. package/dist/assets/{_baseUniq-mJPwzBOI.js → _baseUniq-VCPfrKF9.js} +1 -1
  6. package/dist/assets/{architectureDiagram-Q4EWVU46-CZuqFwTR.js → architectureDiagram-Q4EWVU46-CAb7SpHy.js} +1 -1
  7. package/dist/assets/{blockDiagram-DXYQGD6D-DaC_VKzI.js → blockDiagram-DXYQGD6D-zF0XhzrV.js} +1 -1
  8. package/dist/assets/{c4Diagram-AHTNJAMY-CJePgNba.js → c4Diagram-AHTNJAMY-CtXcWimM.js} +1 -1
  9. package/dist/assets/channel-mf4dnkHE.js +1 -0
  10. package/dist/assets/{chunk-4BX2VUAB-LD_Hd6_z.js → chunk-4BX2VUAB-CLoswc9M.js} +1 -1
  11. package/dist/assets/{chunk-4TB4RGXK-BGO2PowE.js → chunk-4TB4RGXK-DYggF6Hx.js} +1 -1
  12. package/dist/assets/{chunk-55IACEB6-0YS5Dbzd.js → chunk-55IACEB6-DUwnnktj.js} +1 -1
  13. package/dist/assets/{chunk-EDXVE4YY-BaUXHlqA.js → chunk-EDXVE4YY-CCUnR99_.js} +1 -1
  14. package/dist/assets/{chunk-FMBD7UC4-CXSeyusx.js → chunk-FMBD7UC4-D__vucyu.js} +1 -1
  15. package/dist/assets/{chunk-OYMX7WX6-BJqKAaXp.js → chunk-OYMX7WX6-BSP0bfYC.js} +1 -1
  16. package/dist/assets/{chunk-QZHKN3VN-3-SvIa7S.js → chunk-QZHKN3VN-DoM7nTge.js} +1 -1
  17. package/dist/assets/{chunk-YZCP3GAM-Cm0anOcW.js → chunk-YZCP3GAM-97a1xbVl.js} +1 -1
  18. package/dist/assets/classDiagram-6PBFFD2Q-DZbkhyES.js +1 -0
  19. package/dist/assets/classDiagram-v2-HSJHXN6E-DZbkhyES.js +1 -0
  20. package/dist/assets/clone-3PY4S2rf.js +1 -0
  21. package/dist/assets/{cose-bilkent-S5V4N54A-4fUnkROm.js → cose-bilkent-S5V4N54A-D9pIdP63.js} +1 -1
  22. package/dist/assets/{dagre-KV5264BT-DUWGBIgm.js → dagre-KV5264BT-R4kA6TEm.js} +1 -1
  23. package/dist/assets/{diagram-5BDNPKRD-C9_Rqs6o.js → diagram-5BDNPKRD-Ck9sbNIl.js} +1 -1
  24. package/dist/assets/{diagram-G4DWMVQ6-DJgL3XtB.js → diagram-G4DWMVQ6-By6yL4TG.js} +1 -1
  25. package/dist/assets/{diagram-MMDJMWI5-DJyz-Y76.js → diagram-MMDJMWI5-76UpTtZI.js} +1 -1
  26. package/dist/assets/{diagram-TYMM5635-DRXfDOY1.js → diagram-TYMM5635-DUXBFLDY.js} +1 -1
  27. package/dist/assets/{erDiagram-SMLLAGMA-ltzBzX-J.js → erDiagram-SMLLAGMA-dvTwP73Z.js} +1 -1
  28. package/dist/assets/{flowDiagram-DWJPFMVM-CuSvL41f.js → flowDiagram-DWJPFMVM-nUn8ioKQ.js} +1 -1
  29. package/dist/assets/{ganttDiagram-T4ZO3ILL-D695mEJV.js → ganttDiagram-T4ZO3ILL-CdmMf_Xs.js} +1 -1
  30. package/dist/assets/{gitGraphDiagram-UUTBAWPF-BaBzMGpC.js → gitGraphDiagram-UUTBAWPF-Bq_AcfFW.js} +1 -1
  31. package/dist/assets/{graph-CXZA4XaC.js → graph-Bnw4Q1d0.js} +1 -1
  32. package/dist/assets/{index-B8QgKg2_.js → index-CoDZInz3.js} +1 -1
  33. package/dist/assets/index-CtoiZ6Pv.js +643 -0
  34. package/dist/assets/index-DoqRNkTy.css +1 -0
  35. package/dist/assets/{infoDiagram-42DDH7IO-C554WkLo.js → infoDiagram-42DDH7IO-BLmflRAX.js} +1 -1
  36. package/dist/assets/{ishikawaDiagram-UXIWVN3A-D1ixBTTi.js → ishikawaDiagram-UXIWVN3A-CrE4ugEq.js} +1 -1
  37. package/dist/assets/{journeyDiagram-VCZTEJTY-Rk6UiBUm.js → journeyDiagram-VCZTEJTY-fU5W-l6c.js} +1 -1
  38. package/dist/assets/{kanban-definition-6JOO6SKY-BLc8Saxe.js → kanban-definition-6JOO6SKY-fm7YcdsI.js} +1 -1
  39. package/dist/assets/{layout-a0Clawsj.js → layout-DpP4BBzL.js} +1 -1
  40. package/dist/assets/{min-B5vChzpW.js → min-CqAOoSgE.js} +1 -1
  41. package/dist/assets/{mindmap-definition-QFDTVHPH-CGYrptTT.js → mindmap-definition-QFDTVHPH-XRFMFwUx.js} +1 -1
  42. package/dist/assets/{pieDiagram-DEJITSTG-DwV0tEAW.js → pieDiagram-DEJITSTG-kiLqOnvB.js} +1 -1
  43. package/dist/assets/{quadrantDiagram-34T5L4WZ-DvHIwgsa.js → quadrantDiagram-34T5L4WZ-B0Iiewfx.js} +1 -1
  44. package/dist/assets/{requirementDiagram-MS252O5E-DgSgWjaP.js → requirementDiagram-MS252O5E-BrHeAbUK.js} +1 -1
  45. package/dist/assets/{sankeyDiagram-XADWPNL6-k3HRQmAt.js → sankeyDiagram-XADWPNL6-d3u5t5tk.js} +1 -1
  46. package/dist/assets/{sequenceDiagram-FGHM5R23-BLd2_BAi.js → sequenceDiagram-FGHM5R23-DAe0V9U4.js} +1 -1
  47. package/dist/assets/{stateDiagram-FHFEXIEX-DDDK8elV.js → stateDiagram-FHFEXIEX-NTviBaYL.js} +1 -1
  48. package/dist/assets/stateDiagram-v2-QKLJ7IA2-DS4y8FWC.js +1 -0
  49. package/dist/assets/{timeline-definition-GMOUNBTQ-Dj2EEEZe.js → timeline-definition-GMOUNBTQ-DfsdKhLR.js} +1 -1
  50. package/dist/assets/{vennDiagram-DHZGUBPP-C8NSdF_G.js → vennDiagram-DHZGUBPP-CrLXjk0j.js} +1 -1
  51. package/dist/assets/wardley-RL74JXVD-9q7UxPyC.js +162 -0
  52. package/dist/assets/{wardleyDiagram-NUSXRM2D-Dt3gXCVo.js → wardleyDiagram-NUSXRM2D-D4HzW-Z_.js} +1 -1
  53. package/dist/assets/{xychartDiagram-5P7HB3ND-BKUiyZNZ.js → xychartDiagram-5P7HB3ND-B4oqzUM2.js} +1 -1
  54. package/dist/index.html +2 -2
  55. package/dist/sitemap.xml +20 -8
  56. package/package.json +1 -1
  57. package/dist/assets/channel-CX3imDlU.js +0 -1
  58. package/dist/assets/classDiagram-6PBFFD2Q-o2YNBl67.js +0 -1
  59. package/dist/assets/classDiagram-v2-HSJHXN6E-o2YNBl67.js +0 -1
  60. package/dist/assets/clone-EE9raDlI.js +0 -1
  61. package/dist/assets/index-BO4rLId3.css +0 -1
  62. package/dist/assets/index-C1TQE8f6.js +0 -615
  63. package/dist/assets/stateDiagram-v2-QKLJ7IA2-Dts2YAxm.js +0 -1
  64. package/dist/assets/wardley-RL74JXVD-BQtHLuaO.js +0 -162
@@ -0,0 +1,162 @@
1
+ var Gp=Object.defineProperty;var jp=(t,e,r)=>e in t?Gp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var er=(t,e,r)=>jp(t,typeof e!="symbol"?e+"":e,r);import{c as at,b as zp,_ as Ot}from"./index-CtoiZ6Pv.js";import{m as Gt,f as Up,d as Bp}from"./min-CqAOoSgE.js";import{b as Wp,l as Kp,c as Vp,m as qp,r as Yc,n as no}from"./_baseUniq-VCPfrKF9.js";import{aP as Hp}from"./MermaidRenderer-COe0fSY4.js";function Xp(t,e){return Wp(Gt(t,e))}function Yp(t,e){return t&&t.length?Kp(t,Vp(e)):[]}function je(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function pt(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}function rr(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}function Jp(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function ci(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}class Nd{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 je(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 Oi(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function _d(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function Id(t){return Oi(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 Qe})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=Zp(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?Qe:{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 Qe})}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(es(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return Qe})}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(es(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return Qe})}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?Qe: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 Qe})}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 Zp(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function es(t){return!!t&&typeof t[Symbol.iterator]=="function"}const Pd=new xe(()=>{},()=>Qe),Qe=Object.freeze({done:!0,value:void 0});function ce(...t){if(t.length===1){const e=t[0];if(e instanceof xe)return e;if(es(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++]}:Qe)}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++];es(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return Qe}):Pd}class Sc 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 Qe})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Io;(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})(Io||(Io={}));function Po(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{je(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&Po(i,e))}):je(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&Po(n,e)))}function _s(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function jt(t){const r=Ga(t).$document;if(!r)throw new Error("AST node has no document.");return r}function Ga(t){for(;t.$container;)t=t.$container;return t}function Jc(t){return pt(t)?t.ref?[t.ref]:[]:rr(t)?t.items.map(e=>e.ref):[]}function wc(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(je(a)){if(n.keyIndex++,Zc(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(je(o)&&Zc(o,r))return{done:!1,value:o}}n.arrayIndex=0}}n.keyIndex++}return Qe})}function Hi(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Sc(t,r=>wc(r,e))}function zt(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Sc(t,r=>wc(r,e),{includeRoot:!0})}function Zc(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?Em(r,e):!1}function ts(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(pt(n)||rr(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(pt(a)||rr(n))return{done:!1,value:{reference:a,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Qe})}function Qp(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]=Od(i.defaultValue))}function Od(t){return Array.isArray(t)?[...t.map(Od)]:t}const Ze={$type:"AbstractElement",cardinality:"cardinality"};function em(t){return Y.isInstance(t,Ze.$type)}const ja={$type:"AbstractParserRule"};function Xi(t){return Y.isInstance(t,ja.$type)}const Ea={$type:"AbstractRule"},ft={$type:"AbstractType"},Er={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Is(t){return Y.isInstance(t,Er.$type)}const za={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Ld(t){return Y.isInstance(t,za.$type)}const Qc={$type:"ArrayLiteral",elements:"elements"},eu={$type:"ArrayType",elementType:"elementType"},Ar={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function _r(t){return Y.isInstance(t,Ar.$type)}const Oo={$type:"BooleanLiteral",true:"true"};function tm(t){return Y.isInstance(t,Oo.$type)}const $r={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function rm(t){return Y.isInstance(t,$r.$type)}const jr={$type:"Condition"},Ua={$type:"Conjunction",left:"left",right:"right"};function nm(t){return Y.isInstance(t,Ua.$type)}const Cr={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Ps(t){return Y.isInstance(t,Cr.$type)}const Ba={$type:"Disjunction",left:"left",right:"right"};function im(t){return Y.isInstance(t,Ba.$type)}const Lo={$type:"EndOfFile",cardinality:"cardinality"};function am(t){return Y.isInstance(t,Lo.$type)}const yr={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"},tu={$type:"GrammarImport",path:"path"},Vr={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function kc(t){return Y.isInstance(t,Vr.$type)}const xo={$type:"InferredType",name:"name"};function xd(t){return Y.isInstance(t,xo.$type)}const Lt={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function rs(t){return Y.isInstance(t,Lt.$type)}const io={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"},ru={$type:"InfixRuleOperators",precedences:"precedences"},Ei={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function sm(t){return Y.isInstance(t,Ei.$type)}const Ai={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Ir(t){return Y.isInstance(t,Ai.$type)}const Aa={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"},qr={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function om(t){return Y.isInstance(t,qr.$type)}const Do={$type:"Negation",value:"value"};function lm(t){return Y.isInstance(t,Do.$type)}const nu={$type:"NumberLiteral",value:"value"},$a={$type:"Parameter",name:"name"},Mo={$type:"ParameterReference",parameter:"parameter"};function cm(t){return Y.isInstance(t,Mo.$type)}const Rt={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function Vt(t){return Y.isInstance(t,Rt.$type)}const ao={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"},Hr={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function um(t){return Y.isInstance(t,Hr.$type)}const Fo={$type:"ReturnType",name:"name"};function fm(t){return Y.isInstance(t,Fo.$type)}const Xr={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Pr(t){return Y.isInstance(t,Xr.$type)}const $i={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function dm(t){return Y.isInstance(t,$i.$type)}const iu={$type:"StringLiteral",value:"value"},Yr={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function hm(t){return Y.isInstance(t,Yr.$type)}const nt={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"},Jr={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function pm(t){return Y.isInstance(t,Jr.$type)}const tr={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function qt(t){return Y.isInstance(t,tr.$type)}const Zr={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function mm(t){return Y.isInstance(t,Zr.$type)}const Wa={$type:"Type",name:"name",type:"type"};function gm(t){return Y.isInstance(t,Wa.$type)}const ui={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"},fi={$type:"TypeDefinition"},au={$type:"UnionType",types:"types"},Ka={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function Dd(t){return Y.isInstance(t,Ka.$type)}const Qr={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function ym(t){return Y.isInstance(t,Qr.$type)}const di={$type:"ValueLiteral"},Ci={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function Tm(t){return Y.isInstance(t,Ci.$type)}class Md extends Nd{constructor(){super(...arguments),this.types={AbstractElement:{name:Ze.$type,properties:{cardinality:{name:Ze.cardinality}},superTypes:[]},AbstractParserRule:{name:ja.$type,properties:{},superTypes:[Ea.$type,ft.$type]},AbstractRule:{name:Ea.$type,properties:{},superTypes:[]},AbstractType:{name:ft.$type,properties:{},superTypes:[]},Action:{name:Er.$type,properties:{cardinality:{name:Er.cardinality},feature:{name:Er.feature},inferredType:{name:Er.inferredType},operator:{name:Er.operator},type:{name:Er.type,referenceType:ft.$type}},superTypes:[Ze.$type]},Alternatives:{name:za.$type,properties:{cardinality:{name:za.cardinality},elements:{name:za.elements,defaultValue:[]}},superTypes:[Ze.$type]},ArrayLiteral:{name:Qc.$type,properties:{elements:{name:Qc.elements,defaultValue:[]}},superTypes:[di.$type]},ArrayType:{name:eu.$type,properties:{elementType:{name:eu.elementType}},superTypes:[fi.$type]},Assignment:{name:Ar.$type,properties:{cardinality:{name:Ar.cardinality},feature:{name:Ar.feature},operator:{name:Ar.operator},predicate:{name:Ar.predicate},terminal:{name:Ar.terminal}},superTypes:[Ze.$type]},BooleanLiteral:{name:Oo.$type,properties:{true:{name:Oo.true,defaultValue:!1}},superTypes:[jr.$type,di.$type]},CharacterRange:{name:$r.$type,properties:{cardinality:{name:$r.cardinality},left:{name:$r.left},lookahead:{name:$r.lookahead},parenthesized:{name:$r.parenthesized,defaultValue:!1},right:{name:$r.right}},superTypes:[nt.$type]},Condition:{name:jr.$type,properties:{},superTypes:[]},Conjunction:{name:Ua.$type,properties:{left:{name:Ua.left},right:{name:Ua.right}},superTypes:[jr.$type]},CrossReference:{name:Cr.$type,properties:{cardinality:{name:Cr.cardinality},deprecatedSyntax:{name:Cr.deprecatedSyntax,defaultValue:!1},isMulti:{name:Cr.isMulti,defaultValue:!1},terminal:{name:Cr.terminal},type:{name:Cr.type,referenceType:ft.$type}},superTypes:[Ze.$type]},Disjunction:{name:Ba.$type,properties:{left:{name:Ba.left},right:{name:Ba.right}},superTypes:[jr.$type]},EndOfFile:{name:Lo.$type,properties:{cardinality:{name:Lo.cardinality}},superTypes:[Ze.$type]},Grammar:{name:yr.$type,properties:{imports:{name:yr.imports,defaultValue:[]},interfaces:{name:yr.interfaces,defaultValue:[]},isDeclared:{name:yr.isDeclared,defaultValue:!1},name:{name:yr.name},rules:{name:yr.rules,defaultValue:[]},types:{name:yr.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:tu.$type,properties:{path:{name:tu.path}},superTypes:[]},Group:{name:Vr.$type,properties:{cardinality:{name:Vr.cardinality},elements:{name:Vr.elements,defaultValue:[]},guardCondition:{name:Vr.guardCondition},predicate:{name:Vr.predicate}},superTypes:[Ze.$type]},InferredType:{name:xo.$type,properties:{name:{name:xo.name}},superTypes:[ft.$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:ft.$type}},superTypes:[ja.$type]},InfixRuleOperatorList:{name:io.$type,properties:{associativity:{name:io.associativity},operators:{name:io.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:ru.$type,properties:{precedences:{name:ru.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:Ei.$type,properties:{attributes:{name:Ei.attributes,defaultValue:[]},name:{name:Ei.name},superTypes:{name:Ei.superTypes,defaultValue:[],referenceType:ft.$type}},superTypes:[ft.$type]},Keyword:{name:Ai.$type,properties:{cardinality:{name:Ai.cardinality},predicate:{name:Ai.predicate},value:{name:Ai.value}},superTypes:[Ze.$type]},NamedArgument:{name:Aa.$type,properties:{calledByName:{name:Aa.calledByName,defaultValue:!1},parameter:{name:Aa.parameter,referenceType:$a.$type},value:{name:Aa.value}},superTypes:[]},NegatedToken:{name:qr.$type,properties:{cardinality:{name:qr.cardinality},lookahead:{name:qr.lookahead},parenthesized:{name:qr.parenthesized,defaultValue:!1},terminal:{name:qr.terminal}},superTypes:[nt.$type]},Negation:{name:Do.$type,properties:{value:{name:Do.value}},superTypes:[jr.$type]},NumberLiteral:{name:nu.$type,properties:{value:{name:nu.value}},superTypes:[di.$type]},Parameter:{name:$a.$type,properties:{name:{name:$a.name}},superTypes:[]},ParameterReference:{name:Mo.$type,properties:{parameter:{name:Mo.parameter,referenceType:$a.$type}},superTypes:[jr.$type]},ParserRule:{name:Rt.$type,properties:{dataType:{name:Rt.dataType},definition:{name:Rt.definition},entry:{name:Rt.entry,defaultValue:!1},fragment:{name:Rt.fragment,defaultValue:!1},inferredType:{name:Rt.inferredType},name:{name:Rt.name},parameters:{name:Rt.parameters,defaultValue:[]},returnType:{name:Rt.returnType,referenceType:ft.$type}},superTypes:[ja.$type]},ReferenceType:{name:ao.$type,properties:{isMulti:{name:ao.isMulti,defaultValue:!1},referenceType:{name:ao.referenceType}},superTypes:[fi.$type]},RegexToken:{name:Hr.$type,properties:{cardinality:{name:Hr.cardinality},lookahead:{name:Hr.lookahead},parenthesized:{name:Hr.parenthesized,defaultValue:!1},regex:{name:Hr.regex}},superTypes:[nt.$type]},ReturnType:{name:Fo.$type,properties:{name:{name:Fo.name}},superTypes:[]},RuleCall:{name:Xr.$type,properties:{arguments:{name:Xr.arguments,defaultValue:[]},cardinality:{name:Xr.cardinality},predicate:{name:Xr.predicate},rule:{name:Xr.rule,referenceType:Ea.$type}},superTypes:[Ze.$type]},SimpleType:{name:$i.$type,properties:{primitiveType:{name:$i.primitiveType},stringType:{name:$i.stringType},typeRef:{name:$i.typeRef,referenceType:ft.$type}},superTypes:[fi.$type]},StringLiteral:{name:iu.$type,properties:{value:{name:iu.value}},superTypes:[di.$type]},TerminalAlternatives:{name:Yr.$type,properties:{cardinality:{name:Yr.cardinality},elements:{name:Yr.elements,defaultValue:[]},lookahead:{name:Yr.lookahead},parenthesized:{name:Yr.parenthesized,defaultValue:!1}},superTypes:[nt.$type]},TerminalElement:{name:nt.$type,properties:{cardinality:{name:nt.cardinality},lookahead:{name:nt.lookahead},parenthesized:{name:nt.parenthesized,defaultValue:!1}},superTypes:[Ze.$type]},TerminalGroup:{name:Jr.$type,properties:{cardinality:{name:Jr.cardinality},elements:{name:Jr.elements,defaultValue:[]},lookahead:{name:Jr.lookahead},parenthesized:{name:Jr.parenthesized,defaultValue:!1}},superTypes:[nt.$type]},TerminalRule:{name:tr.$type,properties:{definition:{name:tr.definition},fragment:{name:tr.fragment,defaultValue:!1},hidden:{name:tr.hidden,defaultValue:!1},name:{name:tr.name},type:{name:tr.type}},superTypes:[Ea.$type]},TerminalRuleCall:{name:Zr.$type,properties:{cardinality:{name:Zr.cardinality},lookahead:{name:Zr.lookahead},parenthesized:{name:Zr.parenthesized,defaultValue:!1},rule:{name:Zr.rule,referenceType:tr.$type}},superTypes:[nt.$type]},Type:{name:Wa.$type,properties:{name:{name:Wa.name},type:{name:Wa.type}},superTypes:[ft.$type]},TypeAttribute:{name:ui.$type,properties:{defaultValue:{name:ui.defaultValue},isOptional:{name:ui.isOptional,defaultValue:!1},name:{name:ui.name},type:{name:ui.type}},superTypes:[]},TypeDefinition:{name:fi.$type,properties:{},superTypes:[]},UnionType:{name:au.$type,properties:{types:{name:au.types,defaultValue:[]}},superTypes:[fi.$type]},UnorderedGroup:{name:Ka.$type,properties:{cardinality:{name:Ka.cardinality},elements:{name:Ka.elements,defaultValue:[]}},superTypes:[Ze.$type]},UntilToken:{name:Qr.$type,properties:{cardinality:{name:Qr.cardinality},lookahead:{name:Qr.lookahead},parenthesized:{name:Qr.parenthesized,defaultValue:!1},terminal:{name:Qr.terminal}},superTypes:[nt.$type]},ValueLiteral:{name:di.$type,properties:{},superTypes:[]},Wildcard:{name:Ci.$type,properties:{cardinality:{name:Ci.cardinality},lookahead:{name:Ci.lookahead},parenthesized:{name:Ci.parenthesized,defaultValue:!1}},superTypes:[nt.$type]}}}}const Y=new Md;function Go(t){return new Sc(t,e=>Oi(e)?e.content:[],{includeRoot:!0})}function Rm(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function jo(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function ns(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 vm(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 Em(t,e){return vm(t,e)>Mt.After}const Am=/^[\w\p{L}]$/u;function $m(t,e){if(t){const r=Cm(t,!0);if(r&&su(r,e))return r;if(Id(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(su(a,e))return a}}}}function su(t,e){return _d(t)&&e.includes(t.tokenType.name)}function Cm(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 Fd extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}}function Yi(t,e="Error: Got unexpected value."){throw new Error(e)}function U(t){return t.charCodeAt(0)}function so(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function hi(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function zr(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function Sm(){throw Error("Internal Error - Should never get here!")}function ou(t){return t.type==="Character"}const is=[];for(let t=U("0");t<=U("9");t++)is.push(t);const as=[U("_")].concat(is);for(let t=U("a");t<=U("z");t++)as.push(t);for(let t=U("A");t<=U("Z");t++)as.push(t);const lu=[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")],wm=/[0-9a-fA-F]/,Ca=/[0-9]/,km=/[1-9]/;class Gd{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":hi(n,"global");break;case"i":hi(n,"ignoreCase");break;case"m":hi(n,"multiLine");break;case"u":hi(n,"unicode");break;case"y":hi(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}}zr(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return Sm()}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;zr(r);break}if(!(e===!0&&r===void 0)&&zr(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()),zr(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=is;break;case"D":e=is,r=!0;break;case"s":e=lu;break;case"S":e=lu,r=!0;break;case"w":e=as;break;case"W":e=as,r=!0;break}if(zr(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(zr(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,ou(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,ou(i)){if(i.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:i.value})}else so(n.value,e),e.push(U("-")),so(i.value,e)}else so(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(km.test(e)===!1)throw Error("Expecting a positive integer");for(;Ca.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Ca.test(e)===!1)throw Error("Expecting an integer");for(;Ca.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 Ca.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(wm.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 Os{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 bm=/\r?\n/gm,Nm=new Gd;class _m extends Os{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=Ls(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 oo=new _m;function Im(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),oo.reset(t),oo.visit(Nm.pattern(t)),oo.multiline}catch{return!1}}const Pm=`\f
12
+ \r \v              \u2028\u2029   \uFEFF`.split("");function jd(t){const e=typeof t=="string"?new RegExp(t):t;return Pm.some(r=>e.test(r))}function Ls(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Om(t,e){const r=Lm(t),n=e.match(r);return!!n&&n[0].length>0}function Lm(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 xm(t){return t.rules.find(e=>Vt(e)&&e.entry)}function Dm(t){return t.rules.filter(e=>qt(e)&&e.hidden)}function zd(t,e){const r=new Set,n=xm(t);if(!n)return new Set(t.rules);const i=[n].concat(Dm(t));for(const s of i)Ud(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||qt(s)&&s.hidden)&&a.add(s);return a}function Ud(t,e,r){e.add(t.name),Hi(t).forEach(n=>{if(Pr(n)||r){const i=n.rule.ref;i&&!e.has(i.name)&&Ud(i,e,r)}})}function Mm(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=Wd(t.type.ref);return e==null?void 0:e.terminal}}function Fm(t){return t.hidden&&!jd(Nc(t))}function Gm(t,e){return!t||!e?[]:bc(t,e,t.astNode,!0)}function Bd(t,e,r){if(!t||!e)return;const n=bc(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 bc(t,e,r,n){if(!n){const i=_s(t.grammarSource,_r);if(i&&i.feature===e)return[t]}return Oi(t)&&t.astNode===r?t.content.flatMap(i=>bc(i,e,r,!1)):[]}function jm(t,e,r){if(!t)return;const n=zm(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 zm(t,e,r){if(t.astNode!==r)return[];if(Ir(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=Go(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?Ir(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}function Um(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=_s(t.grammarSource,_r);if(n)return n;t=t.container}}function Wd(t){let e=t;return xd(e)&&(Is(e.$container)?e=e.$container.$container:Xi(e.$container)?e=e.$container:Yi(e.$container)),Kd(t,e,new Map)}function Kd(t,e,r){var i;function n(a,s){let o;return _s(a,_r)||(o=Kd(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 Hi(e)){if(_r(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(Pr(a)&&Vt(a.rule.ref))return n(a,a.rule.ref);if(dm(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}function Vd(t){return qd(t,new Set)}function qd(t,e){if(e.has(t))return!0;e.add(t);for(const r of Hi(t))if(Pr(r)){if(!r.rule.ref||Vt(r.rule.ref)&&!qd(r.rule.ref,e)||rs(r.rule.ref))return!1}else{if(_r(r))return!1;if(Is(r))return!1}return!!t.definition}function Hd(t){if(!qt(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 Li(t){if(Xi(t))return Vt(t)&&Vd(t)?t.name:Hd(t)??t.name;if(sm(t)||gm(t)||fm(t))return t.name;if(Is(t)){const e=Bm(t);if(e)return e}else if(xd(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function Bm(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return Li(t.type.ref)}function Wm(t){var e;return qt(t)?((e=t.type)==null?void 0:e.name)??"string":Hd(t)??t.name}function Nc(t){const e={s:!1,i:!1,u:!1},r=qn(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}const _c=/[\s\S]/.source;function qn(t,e){var r;if(hm(t))return Km(t);if(pm(t))return Vm(t);if(rm(t))return Xm(t);if(mm(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Ut(qn(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(om(t))return Hm(t);if(ym(t))return qm(t);if(um(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(Tm(t))return Ut(_c,{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 Km(t){return Ut(t.elements.map(e=>qn(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function Vm(t){return Ut(t.elements.map(e=>qn(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function qm(t){return Ut(`${_c}*?${qn(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function Hm(t){return Ut(`(?!${qn(t.terminal)})${_c}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function Xm(t){return t.right?Ut(`[${lo(t.left)}-${lo(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):Ut(lo(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function lo(t){return Ls(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 Ym(t){const e=[],r=t.Grammar;for(const n of r.rules)qt(n)&&Fm(n)&&Im(Nc(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:Am}}function zo(t){console&&console.error&&console.error(`Error: ${t}`)}function Xd(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function Yd(t){const e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function Jd(t){function e(){}e.prototype=t;const r=new e;function n(){return typeof r.bar}return n(),n(),t}function Jm(t){return Zm(t)?t.LABEL:t.name}function Zm(t){return typeof t.LABEL=="string"&&t.LABEL!==""}class wt{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 We extends wt{constructor(e){super([]),this.idx=1,Object.assign(this,kt(e))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class Hn extends wt{constructor(e){super(e.definition),this.orgText="",Object.assign(this,kt(e))}}class He extends wt{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,kt(e))}}let Me=class extends wt{constructor(e){super(e.definition),this.idx=1,Object.assign(this,kt(e))}};class tt extends wt{constructor(e){super(e.definition),this.idx=1,Object.assign(this,kt(e))}}class rt extends wt{constructor(e){super(e.definition),this.idx=1,Object.assign(this,kt(e))}}class ye extends wt{constructor(e){super(e.definition),this.idx=1,Object.assign(this,kt(e))}}class Xe extends wt{constructor(e){super(e.definition),this.idx=1,Object.assign(this,kt(e))}}class Ye extends wt{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,kt(e))}}class se{constructor(e){this.idx=1,Object.assign(this,kt(e))}accept(e){e.visit(this)}}function Qm(t){return t.map(Va)}function Va(t){function e(r){return r.map(Va)}if(t instanceof We){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return typeof t.label=="string"&&(r.label=t.label),r}else{if(t instanceof He)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Me)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof tt)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof rt)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Va(new se({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Xe)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Va(new se({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ye)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof Ye)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof se){const r={type:"Terminal",name:t.terminalType.name,label:Jm(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 Hn)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}function kt(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0))}class Xn{visit(e){const r=e;switch(r.constructor){case We:return this.visitNonTerminal(r);case He:return this.visitAlternative(r);case Me:return this.visitOption(r);case tt:return this.visitRepetitionMandatory(r);case rt:return this.visitRepetitionMandatoryWithSeparator(r);case Xe:return this.visitRepetitionWithSeparator(r);case ye:return this.visitRepetition(r);case Ye:return this.visitAlternation(r);case se:return this.visitTerminal(r);case Hn: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 eg(t){return t instanceof He||t instanceof Me||t instanceof ye||t instanceof tt||t instanceof rt||t instanceof Xe||t instanceof se||t instanceof Hn}function ss(t,e=[]){return t instanceof Me||t instanceof ye||t instanceof Xe?!0:t instanceof Ye?t.definition.some(n=>ss(n,e)):t instanceof We&&e.includes(t)?!1:t instanceof wt?(t instanceof We&&e.push(t),t.definition.every(n=>ss(n,e))):!1}function tg(t){return t instanceof Ye}function vt(t){if(t instanceof We)return"SUBRULE";if(t instanceof Me)return"OPTION";if(t instanceof Ye)return"OR";if(t instanceof tt)return"AT_LEAST_ONE";if(t instanceof rt)return"AT_LEAST_ONE_SEP";if(t instanceof Xe)return"MANY_SEP";if(t instanceof ye)return"MANY";if(t instanceof se)return"CONSUME";throw Error("non exhaustive match")}class xs{walk(e,r=[]){e.definition.forEach((n,i)=>{const a=e.definition.slice(i+1);if(n instanceof We)this.walkProdRef(n,a,r);else if(n instanceof se)this.walkTerminal(n,a,r);else if(n instanceof He)this.walkFlat(n,a,r);else if(n instanceof Me)this.walkOption(n,a,r);else if(n instanceof tt)this.walkAtLeastOne(n,a,r);else if(n instanceof rt)this.walkAtLeastOneSep(n,a,r);else if(n instanceof Xe)this.walkManySep(n,a,r);else if(n instanceof ye)this.walkMany(n,a,r);else if(n instanceof Ye)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=cu(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=cu(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);e.definition.forEach(a=>{const s=new He({definition:[a]});this.walk(s,i)})}}function cu(t,e,r){return[new Me({definition:[new se({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function Ji(t){if(t instanceof We)return Ji(t.referencedRule);if(t instanceof se)return ig(t);if(eg(t))return rg(t);if(tg(t))return ng(t);throw Error("non exhaustive match")}function rg(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=ss(a),e=e.concat(Ji(a)),n=n+1,i=r.length>n;return[...new Set(e)]}function ng(t){const e=t.definition.map(r=>Ji(r));return[...new Set(e.flat())]}function ig(t){return[t.terminalType]}const Zd="_~IN~_";class ag extends xs{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=og(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new He({definition:a}),o=Ji(s);this.follows[i]=o}}function sg(t){const e={};return t.forEach(r=>{const n=new ag(r).startWalking();Object.assign(e,n)}),e}function og(t,e){return t.name+e+Zd}let qa={};const lg=new Gd;function Ds(t){const e=t.toString();if(qa.hasOwnProperty(e))return qa[e];{const r=lg.pattern(e);return qa[e]=r,r}}function cg(){qa={}}const Qd="Complement Sets are not supported for first char optimization",os=`Unable to use "first char" lexer optimizations:
13
+ `;function ug(t,e=!1){try{const r=Ds(t);return Uo(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===Qd)e&&Xd(`${os} 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.`),zo(`${os}
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 Uo(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)Uo(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":Sa(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error(Qd);s.value.forEach(l=>{if(typeof l=="number")Sa(l,e,r);else{const c=l;if(r===!0)for(let f=c.from;f<=c.to;f++)Sa(f,e,r);else{for(let f=c.from;f<=c.to&&f<wi;f++)Sa(f,e,r);if(c.to>=wi){const f=c.from>=wi?c.from:wi,h=c.to,p=ur(f),g=ur(h);for(let C=p;C<=g;C++)e[C]=C}}}});break;case"Group":Uo(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"&&Bo(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return Object.values(e)}function Sa(t,e,r){const n=ur(t);e[n]=n,r===!0&&fg(t,e)}function fg(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=ur(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=ur(i.charCodeAt(0));e[a]=a}}}function uu(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 Bo(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Array.isArray(t.value)?t.value.every(Bo):Bo(t.value):!1}class dg extends Os{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?uu(e,this.targetCharCodes)===void 0&&(this.found=!0):uu(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function Ic(t,e){if(e instanceof RegExp){const r=Ds(e),n=new dg(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 Or="PATTERN",Si="defaultMode",wa="modes";function hg(t,e){e=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
22
+ `],tracer:(O,N)=>N()},e);const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{Mg()});let n;r("Reject Lexer.NA",()=>{n=t.filter(O=>O[Or]!==qe.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=n.map(O=>{const N=O[Or];if(N instanceof RegExp){const L=N.source;return L.length===1&&L!=="^"&&L!=="$"&&L!=="."&&!N.ignoreCase?L:L.length===2&&L[0]==="\\"&&!["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(L[1])?L[1]:fu(N)}else{if(typeof N=="function")return i=!0,{exec:N};if(typeof N=="object")return i=!0,N;if(typeof N=="string"){if(N.length===1)return N;{const L=N.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),H=new RegExp(L);return fu(H)}}else throw Error("non exhaustive match")}})});let s,o,l,c,f;r("misc mapping",()=>{s=n.map(O=>O.tokenTypeIdx),o=n.map(O=>{const N=O.GROUP;if(N!==qe.SKIPPED){if(typeof N=="string")return N;if(N===void 0)return!1;throw Error("non exhaustive match")}}),l=n.map(O=>{const N=O.LONGER_ALT;if(N)return Array.isArray(N)?N.map(H=>n.indexOf(H)):[n.indexOf(N)]}),c=n.map(O=>O.PUSH_MODE),f=n.map(O=>Object.hasOwn(O,"POP_MODE"))});let h;r("Line Terminator Handling",()=>{const O=rh(e.lineTerminatorCharacters);h=n.map(N=>!1),e.positionTracking!=="onlyOffset"&&(h=n.map(N=>Object.hasOwn(N,"LINE_BREAKS")?!!N.LINE_BREAKS:th(N,O)===!1&&Ic(O,N.PATTERN)))});let p,g,C,k;r("Misc Mapping #2",()=>{p=n.map(eh),g=a.map(Lg),C=n.reduce((O,N)=>{const L=N.GROUP;return typeof L=="string"&&L!==qe.SKIPPED&&(O[L]=[]),O},{}),k=a.map((O,N)=>({pattern:a[N],longerAlt:l[N],canLineTerminator:h[N],isCustom:p[N],short:g[N],group:o[N],push:c[N],pop:f[N],tokenTypeIdx:s[N],tokenType:n[N]}))});let D=!0,b=[];return e.safeMode||r("First Char Optimization",()=>{b=n.reduce((O,N,L)=>{if(typeof N.PATTERN=="string"){const H=N.PATTERN.charCodeAt(0),ee=ur(H);co(O,ee,k[L])}else if(Array.isArray(N.START_CHARS_HINT)){let H;N.START_CHARS_HINT.forEach(ee=>{const te=typeof ee=="string"?ee.charCodeAt(0):ee,$e=ur(te);H!==$e&&(H=$e,co(O,$e,k[L]))})}else if(N.PATTERN instanceof RegExp)if(N.PATTERN.unicode)D=!1,e.ensureOptimizations&&zo(`${os} Unable to analyze < ${N.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 H=ug(N.PATTERN,e.ensureOptimizations);H.length===0&&(D=!1),H.forEach(ee=>{co(O,ee,k[L])})}else e.ensureOptimizations&&zo(`${os} TokenType: <${N.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`),D=!1;return O},[])}),{emptyGroups:C,patternIdxToConfig:k,charCodeToPatternIdxToConfig:b,hasCustom:i,canBeOptimized:D}}function pg(t,e){let r=[];const n=gg(t);r=r.concat(n.errors);const i=yg(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(mg(a)),r=r.concat(Sg(a)),r=r.concat(wg(a,e)),r=r.concat(kg(a)),r}function mg(t){let e=[];const r=t.filter(n=>n[Or]instanceof RegExp);return e=e.concat(Rg(r)),e=e.concat(Ag(r)),e=e.concat($g(r)),e=e.concat(Cg(r)),e=e.concat(vg(r)),e}function gg(t){const e=t.filter(i=>!Object.hasOwn(i,Or)),r=e.map(i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Te.MISSING_PATTERN,tokenTypes:[i]})),n=t.filter(i=>!e.includes(i));return{errors:r,valid:n}}function yg(t){const e=t.filter(i=>{const a=i[Or];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:Te.INVALID_PATTERN,tokenTypes:[i]})),n=t.filter(i=>!e.includes(i));return{errors:r,valid:n}}const Tg=/[^\\][$]/;function Rg(t){class e extends Os{constructor(){super(...arguments),this.found=!1}visitEndAnchor(a){this.found=!0}}return t.filter(i=>{const a=i.PATTERN;try{const s=Ds(a),o=new e;return o.visit(s),o.found}catch{return Tg.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:Te.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function vg(t){return t.filter(n=>n.PATTERN.test("")).map(n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Te.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}const Eg=/[^\\[][\^]|^\^/;function Ag(t){class e extends Os{constructor(){super(...arguments),this.found=!1}visitStartAnchor(a){this.found=!0}}return t.filter(i=>{const a=i.PATTERN;try{const s=Ds(a),o=new e;return o.visit(s),o.found}catch{return Eg.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:Te.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function $g(t){return t.filter(n=>{const i=n[Or];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:Te.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function Cg(t){const e=[];let r=t.map(a=>t.reduce((s,o)=>(a.PATTERN.source===o.PATTERN.source&&!e.includes(o)&&o.PATTERN!==qe.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:Te.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}function Sg(t){return t.filter(n=>{if(!Object.hasOwn(n,"GROUP"))return!1;const i=n.GROUP;return i!==qe.SKIPPED&&i!==qe.NA&&typeof i!="string"}).map(n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Te.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function wg(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:Te.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function kg(t){const e=[],r=t.reduce((n,i,a)=>{const s=i.PATTERN;return s===qe.NA||(typeof s=="string"?n.push({str:s,idx:a,tokenType:i}):s instanceof RegExp&&Ng(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&&bg(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:Te.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}function bg(t,e){if(e instanceof RegExp){if(_g(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 Ng(t){return[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(r=>t.source.indexOf(r)!==-1)===void 0}function _g(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(t.source)}function fu(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function Ig(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:Te.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(t,wa)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+wa+`> property in its definition
35
+ `,type:Te.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(t,wa)&&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:Te.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(t,wa)&&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:Te.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:Te.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),n}function Pg(t,e,r){const n=[];let i=!1;const s=Object.values(t.modes||{}).flat().filter(Boolean).filter(l=>l[Or]!==qe.NA),o=rh(r);return e&&s.forEach(l=>{const c=th(l,o);if(c!==!1){const h={message:Dg(l,c),type:c.issue,tokenType:l};n.push(h)}else Object.hasOwn(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):Ic(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:Te.NO_LINE_BREAKS_FLAGS}),n}function Og(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 eh(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 Lg(t){return typeof t=="string"&&t.length===1?t.charCodeAt(0):!1}const xg={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 th(t,e){if(Object.hasOwn(t,"LINE_BREAKS"))return!1;if(t.PATTERN instanceof RegExp){try{Ic(e,t.PATTERN)}catch(r){return{issue:Te.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(typeof t.PATTERN=="string")return!1;if(eh(t))return{issue:Te.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function Dg(t,e){if(e.issue===Te.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===Te.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 rh(t){return t.map(r=>typeof r=="string"?r.charCodeAt(0):r)}function co(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}const wi=256;let Ha=[];function ur(t){return t<wi?t:Ha[t]}function Mg(){if(Ha.length===0){Ha=new Array(65536);for(let t=0;t<65536;t++)Ha[t]=t>255?255+~~(t/255):t}}function Zi(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function ls(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let du=1;const nh={};function Qi(t){const e=Fg(t);Gg(e),zg(e),jg(e),e.forEach(r=>{r.isParent=r.categoryMatches.length>0})}function Fg(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 Gg(t){t.forEach(e=>{ah(e)||(nh[du]=e,e.tokenTypeIdx=du++),hu(e)&&!Array.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),hu(e)||(e.CATEGORIES=[]),Ug(e)||(e.categoryMatches=[]),Bg(e)||(e.categoryMatchesMap={})})}function jg(t){t.forEach(e=>{e.categoryMatches=[],Object.keys(e.categoryMatchesMap).forEach(r=>{e.categoryMatches.push(nh[r].tokenTypeIdx)})})}function zg(t){t.forEach(e=>{ih([],e)})}function ih(t,e){t.forEach(r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),e.CATEGORIES.forEach(r=>{const n=t.concat(e);n.includes(r)||ih(n,r)})}function ah(t){return Object.hasOwn(t??{},"tokenTypeIdx")}function hu(t){return Object.hasOwn(t??{},"CATEGORIES")}function Ug(t){return Object.hasOwn(t??{},"categoryMatches")}function Bg(t){return Object.hasOwn(t??{},"categoryMatchesMap")}function Wg(t){return Object.hasOwn(t??{},"tokenTypeIdx")}const Wo={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 Te;(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"})(Te||(Te={}));const ki={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
48
+ `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Wo,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(ki);class qe{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}=Yd(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=xg;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(Ig(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Pg(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(pg(l,s))}),this.lexerDefinitionErrors.length===0){Qi(l);let c;this.TRACE_INIT("analyzeTokenTypes",()=>{c=hg(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=>{Xd(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,f])=>(f===!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",()=>{cg()}),this.TRACE_INIT("toFastProperties",()=>{Jd(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,f,h,p,g,C,k,D,b;const O=e,N=O.length;let L=0,H=0;const ee=this.hasCustom?0:Math.floor(e.length/10),te=new Array(ee),$e=[];let be=this.trackStartLines?1:void 0,Re=this.trackStartLines?1:void 0;const w=Og(this.emptyGroups),E=this.trackStartLines,m=this.config.lineTerminatorsPattern;let $=0,y=[],T=[];const v=[],I=[];Object.freeze(I);let x=!1;const P=z=>{if(v.length===1&&z.tokenType.PUSH_MODE===void 0){const Z=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(z);$e.push({offset:z.startOffset,line:z.startLine,column:z.startColumn,length:z.image.length,message:Z})}else{v.pop();const Z=v.at(-1);y=this.patternIdxToConfig[Z],T=this.charCodeToPatternIdxToConfig[Z],$=y.length;const Pe=this.canModeBeOptimized[Z]&&this.config.safeMode===!1;T&&Pe?x=!0:x=!1}};function j(z){v.push(z),T=this.charCodeToPatternIdxToConfig[z],y=this.patternIdxToConfig[z],$=y.length,$=y.length;const Z=this.canModeBeOptimized[z]&&this.config.safeMode===!1;T&&Z?x=!0:x=!1}j.call(this,r);let F;const re=this.config.recoveryEnabled;for(;L<N;){l=null,h=-1;const z=O.charCodeAt(L);let Z;if(x){const he=ur(z),oe=T[he];Z=oe!==void 0?oe:I}else Z=y;const Pe=Z.length;for(n=0;n<Pe;n++){F=Z[n];const he=F.pattern;c=null;const oe=F.short;if(oe!==!1?z===oe&&(h=1,l=he):F.isCustom===!0?(b=he.exec(O,L,te,w),b!==null?(l=b[0],h=l.length,b.payload!==void 0&&(c=b.payload)):l=null):(he.lastIndex=L,h=this.matchLength(he,e,L)),h!==-1){if(o=F.longerAlt,o!==void 0){l=e.substring(L,L+h);const Ne=o.length;for(a=0;a<Ne;a++){const Oe=y[o[a]],Ce=Oe.pattern;if(f=null,Oe.isCustom===!0?(b=Ce.exec(O,L,te,w),b!==null?(s=b[0],b.payload!==void 0&&(f=b.payload)):s=null):(Ce.lastIndex=L,s=this.match(Ce,e,L)),s&&s.length>l.length){l=s,h=s.length,c=f,F=Oe;break}}}break}}if(h!==-1){if(p=F.group,p!==void 0&&(l=l!==null?l:e.substring(L,L+h),g=F.tokenTypeIdx,C=this.createTokenInstance(l,L,g,F.tokenType,be,Re,h),this.handlePayload(C,c),p===!1?H=this.addToken(te,H,C):w[p].push(C)),E===!0&&F.canLineTerminator===!0){let he=0,oe,Ne;m.lastIndex=0;do l=l!==null?l:e.substring(L,L+h),oe=m.test(l),oe===!0&&(Ne=m.lastIndex-1,he++);while(oe===!0);he!==0?(be=be+he,Re=h-Ne,this.updateTokenEndLineColumnLocation(C,p,Ne,he,be,Re,h)):Re=this.computeNewColumn(Re,h)}else Re=this.computeNewColumn(Re,h);L=L+h,this.handleModes(F,P,j,C)}else{const he=L,oe=be,Ne=Re;let Oe=re===!1;for(;Oe===!1&&L<N;)for(L++,i=0;i<$;i++){const Ce=y[i],X=Ce.pattern,Je=Ce.short;if(Je!==!1?O.charCodeAt(L)===Je&&(Oe=!0):Ce.isCustom===!0?Oe=X.exec(O,L,te,w)!==null:(X.lastIndex=L,Oe=X.exec(e)!==null),Oe===!0)break}if(k=L-he,Re=this.computeNewColumn(Re,k),D=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(O,he,k,oe,Ne,v.at(-1)),$e.push({offset:he,line:oe,column:Ne,length:k,message:D}),re===!1)break}}return this.hasCustom||(te.length=H),{tokens:te,groups:w,errors:$e}}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}}qe.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.";qe.NA=/NOT_APPLICABLE/;function cn(t){return sh(t)?t.LABEL:t.name}function sh(t){return typeof t.LABEL=="string"&&t.LABEL!==""}const Kg="parent",pu="categories",mu="label",gu="group",yu="push_mode",Tu="pop_mode",Ru="longer_alt",vu="line_breaks",Eu="start_chars_hint";function oh(t){return Vg(t)}function Vg(t){const e=t.pattern,r={};if(r.name=t.name,e!==void 0&&(r.PATTERN=e),Object.hasOwn(t,Kg))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,pu)&&(r.CATEGORIES=t[pu]),Qi([r]),Object.hasOwn(t,mu)&&(r.LABEL=t[mu]),Object.hasOwn(t,gu)&&(r.GROUP=t[gu]),Object.hasOwn(t,Tu)&&(r.POP_MODE=t[Tu]),Object.hasOwn(t,yu)&&(r.PUSH_MODE=t[yu]),Object.hasOwn(t,Ru)&&(r.LONGER_ALT=t[Ru]),Object.hasOwn(t,vu)&&(r.LINE_BREAKS=t[vu]),Object.hasOwn(t,Eu)&&(r.START_CHARS_HINT=t[Eu]),r}const fr=oh({name:"EOF",pattern:qe.NA});Qi([fr]);function Pc(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 lh(t,e){return Zi(t,e)}const on={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${sh(t)?`--> ${cn(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 h=`one of these possible Token sequences:
59
+ ${t.reduce((p,g)=>p.concat(g),[]).map(p=>`[${p.map(g=>cn(g)).join(", ")}]`).map((p,g)=>` ${g+1}. ${p}`).join(`
60
+ `)}`;return a+h+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(f=>cn(f)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(on);const qg={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
63
+ inside top level rule: ->`+t.name+"<-"}},br={buildDuplicateFoundError(t,e){function r(f){return f instanceof se?f.terminalType.name:f instanceof We?f.nonTerminalName:""}const n=t.name,i=e[0],a=i.idx,s=vt(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=>cn(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=>cn(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=vt(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 Hn?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function Hg(t,e){const r=new Xg(t,e);return r.resolveRefs(),r.errors}class Xg 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:Ke.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class Yg extends xs{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 Jg extends Yg{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 He({definition:i});this.possibleTokTypes=Ji(a),this.found=!0}}}class Ms extends xs{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 Zg extends Ms{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 Au extends Ms{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 Qg extends Ms{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 $u extends Ms{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 Ko(t,e,r=[]){r=[...r];let n=[],i=0;function a(o){return o.concat(t.slice(i+1))}function s(o){const l=Ko(a(o),e,r);return n.concat(l)}for(;r.length<e&&i<t.length;){const o=t[i];if(o instanceof He)return s(o.definition);if(o instanceof We)return s(o.definition);if(o instanceof Me)n=s(o.definition);else if(o instanceof tt){const l=o.definition.concat([new ye({definition:o.definition})]);return s(l)}else if(o instanceof rt){const l=[new He({definition:o.definition}),new ye({definition:[new se({terminalType:o.separator})].concat(o.definition)})];return s(l)}else if(o instanceof Xe){const l=o.definition.concat([new ye({definition:[new se({terminalType:o.separator})].concat(o.definition)})]);n=s(l)}else if(o instanceof ye){const l=o.definition.concat([new ye({definition:o.definition})]);n=s(l)}else{if(o instanceof Ye)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 ey(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,f=[],h=[];for(h.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});h.length!==0;){const p=h.pop();if(p===s){o&&h.at(-1).idx<=c&&h.pop();continue}const g=p.def,C=p.idx,k=p.ruleStack,D=p.occurrenceStack;if(g.length===0)continue;const b=g[0];if(b===i){const O={idx:C,def:g.slice(1),ruleStack:k.slice(0,-1),occurrenceStack:D.slice(0,-1)};h.push(O)}else if(b instanceof se)if(C<l-1){const O=C+1,N=e[O];if(r(N,b.terminalType)){const L={idx:O,def:g.slice(1),ruleStack:k,occurrenceStack:D};h.push(L)}}else if(C===l-1)f.push({nextTokenType:b.terminalType,nextTokenOccurrence:b.idx,ruleStack:k,occurrenceStack:D}),o=!0;else throw Error("non exhaustive match");else if(b instanceof We){const O=[...k];O.push(b.nonTerminalName);const N=[...D];N.push(b.idx);const L={idx:C,def:b.definition.concat(a,g.slice(1)),ruleStack:O,occurrenceStack:N};h.push(L)}else if(b instanceof Me){const O={idx:C,def:g.slice(1),ruleStack:k,occurrenceStack:D};h.push(O),h.push(s);const N={idx:C,def:b.definition.concat(g.slice(1)),ruleStack:k,occurrenceStack:D};h.push(N)}else if(b instanceof tt){const O=new ye({definition:b.definition,idx:b.idx}),N=b.definition.concat([O],g.slice(1)),L={idx:C,def:N,ruleStack:k,occurrenceStack:D};h.push(L)}else if(b instanceof rt){const O=new se({terminalType:b.separator}),N=new ye({definition:[O].concat(b.definition),idx:b.idx}),L=b.definition.concat([N],g.slice(1)),H={idx:C,def:L,ruleStack:k,occurrenceStack:D};h.push(H)}else if(b instanceof Xe){const O={idx:C,def:g.slice(1),ruleStack:k,occurrenceStack:D};h.push(O),h.push(s);const N=new se({terminalType:b.separator}),L=new ye({definition:[N].concat(b.definition),idx:b.idx}),H=b.definition.concat([L],g.slice(1)),ee={idx:C,def:H,ruleStack:k,occurrenceStack:D};h.push(ee)}else if(b instanceof ye){const O={idx:C,def:g.slice(1),ruleStack:k,occurrenceStack:D};h.push(O),h.push(s);const N=new ye({definition:b.definition,idx:b.idx}),L=b.definition.concat([N],g.slice(1)),H={idx:C,def:L,ruleStack:k,occurrenceStack:D};h.push(H)}else if(b instanceof Ye)for(let O=b.definition.length-1;O>=0;O--){const N=b.definition[O],L={idx:C,def:N.definition.concat(g.slice(1)),ruleStack:k,occurrenceStack:D};h.push(L),h.push(s)}else if(b instanceof He)h.push({idx:C,def:b.definition.concat(g.slice(1)),ruleStack:k,occurrenceStack:D});else if(b instanceof Hn)h.push(ty(b,C,k,D));else throw Error("non exhaustive match")}return f}function ty(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 ue;(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"})(ue||(ue={}));function Oc(t){if(t instanceof Me||t==="Option")return ue.OPTION;if(t instanceof ye||t==="Repetition")return ue.REPETITION;if(t instanceof tt||t==="RepetitionMandatory")return ue.REPETITION_MANDATORY;if(t instanceof rt||t==="RepetitionMandatoryWithSeparator")return ue.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof Xe||t==="RepetitionWithSeparator")return ue.REPETITION_WITH_SEPARATOR;if(t instanceof Ye||t==="Alternation")return ue.ALTERNATION;throw Error("non exhaustive match")}function Cu(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=Oc(n);return a===ue.ALTERNATION?Fs(e,r,i):Gs(e,r,a,i)}function ry(t,e,r,n,i,a){const s=Fs(t,e,r),o=fh(s)?ls:Zi;return a(s,n,o,i)}function ny(t,e,r,n,i,a){const s=Gs(t,e,i,r),o=fh(s)?ls:Zi;return a(s[0],o,n)}function iy(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],f=c.length,h=o[l];if(!(h!==void 0&&h.call(this)===!1))e:for(let p=0;p<f;p++){const g=c[p],C=g.length;for(let k=0;k<C;k++){const D=this.LA_FAST(k+1);if(r(D,g[k])===!1)continue e}return l}}};if(a&&!n){const o=t.map(l=>l.flat()).reduce((l,c,f)=>(c.forEach(h=>{h.tokenTypeIdx in l||(l[h.tokenTypeIdx]=f),h.categoryMatches.forEach(p=>{Object.hasOwn(l,p)||(l[p]=f)})}),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 f=o[c],h=f.length;for(let p=0;p<h;p++){const g=this.LA_FAST(p+1);if(r(g,f[p])===!1)continue e}return s}}}}function ay(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(f=>{o[f]=!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 sy extends xs{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,ue.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,ue.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,ue.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,ue.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,ue.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}}class ch 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,ue.OPTION)}visitRepetition(e){this.checkIsTarget(e,ue.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,ue.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,ue.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,ue.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,ue.ALTERNATION)}}function Su(t){const e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function uo(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 oy(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 uh(t,e){const r=t.map(s=>Ko([s],1)),n=Su(r.length),i=r.map(s=>{const o={};return s.forEach(l=>{uo(l.partialPath).forEach(f=>{o[f]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=Su(o.length);for(let l=0;l<o.length;l++){const c=o[l];for(let f=0;f<c.length;f++){const h=c[f].partialPath,p=c[f].suffixDef,g=uo(h);if(oy(i,g,l)||p.length===0||h.length===e){const k=n[l];if(Vo(k,h)===!1){k.push(h);for(let D=0;D<g.length;D++){const b=g[D];i[l][b]=!0}}}else{const k=Ko(p,s+1,h);a[l]=a[l].concat(k),k.forEach(D=>{uo(D.partialPath).forEach(O=>{i[l][O]=!0})})}}}}return n}function Fs(t,e,r,n){const i=new ch(t,ue.ALTERNATION,n);return e.accept(i),uh(i.result,r)}function Gs(t,e,r,n){const i=new ch(t,r);e.accept(i);const a=i.result,o=new sy(e,t,r).startWalking(),l=new He({definition:a}),c=new He({definition:o});return uh([l,c],n)}function Vo(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 ly(t,e){return t.length<e.length&&t.every((r,n)=>{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function fh(t){return t.every(e=>e.every(r=>r.every(n=>n.categoryMatches.length===0)))}function cy(t){return t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName}).map(r=>Object.assign({type:Ke.CUSTOM_LOOKAHEAD_VALIDATION},r))}function uy(t,e,r,n){const i=t.flatMap(l=>fy(l,r)),a=$y(t,e,r),s=t.flatMap(l=>Ry(l,r)),o=t.flatMap(l=>py(l,t,n,r));return i.concat(a,s,o)}function fy(t,e){const r=new hy;t.accept(r);const n=r.allProductions,i=Object.groupBy(n,dy),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),f=vt(l),h={message:c,type:Ke.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:f,occurrence:l.idx},p=dh(l);return p&&(h.parameter=p),h})}function dy(t){return`${vt(t)}_#_${t.idx}_#_${dh(t)}`}function dh(t){return t instanceof se?t.terminalType.name:t instanceof We?t.nonTerminalName:""}class hy 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 py(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:Ke.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function my(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:Ke.INVALID_RULE_OVERRIDE,ruleName:t})),n}function hh(t,e,r,n=[]){const i=[],a=Xa(e.definition);if(a.length===0)return[];{const s=t.name;a.includes(t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:Ke.LEFT_RECURSION,ruleName:s});const l=n.concat([t]),f=a.filter(h=>!l.includes(h)).flatMap(h=>{const p=[...n];return p.push(h),hh(t,h,r,p)});return i.concat(f)}}function Xa(t){let e=[];if(t.length===0)return e;const r=t[0];if(r instanceof We)e.push(r.referencedRule);else if(r instanceof He||r instanceof Me||r instanceof tt||r instanceof rt||r instanceof Xe||r instanceof ye)e=e.concat(Xa(r.definition));else if(r instanceof Ye)e=r.definition.map(a=>Xa(a.definition)).flat();else if(!(r instanceof se))throw Error("non exhaustive match");const n=ss(r),i=t.length>1;if(n&&i){const a=t.slice(1);return e.concat(Xa(a))}else return e}class Lc extends Xn{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function gy(t,e){const r=new Lc;return t.accept(r),r.alternations.flatMap(a=>a.definition.slice(0,-1).flatMap((o,l)=>ey([o],[],Zi,1).length===0?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:Ke.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]))}function yy(t,e,r){const n=new Lc;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=Fs(o,t,l,s),f=Ey(c,s,t,r),h=Ay(c,s,t,r);return f.concat(h)})}class Ty 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 Ry(t,e){const r=new Lc;return t.accept(r),r.alternations.flatMap(a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:Ke.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}function vy(t,e,r){const n=[];return t.forEach(i=>{const a=new Ty;i.accept(a),a.allProductions.forEach(o=>{const l=Oc(o),c=o.maxLookahead||e,f=o.idx;if(Gs(f,i,l,c)[0].flat().length===0){const g=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:g,type:Ke.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function Ey(t,e,r,n){const i=[];return t.reduce((o,l,c)=>(e.definition[c].ignoreAmbiguities===!0||l.forEach(f=>{const h=[c];t.forEach((p,g)=>{c!==g&&Vo(p,f)&&e.definition[g].ignoreAmbiguities!==!0&&h.push(g)}),h.length>1&&!Vo(i,f)&&(i.push(f),o.push({alts:h,path:f}))}),o),[]).map(o=>{const l=o.alts.map(f=>f+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:Ke.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}function Ay(t,e,r,n){const i=t.reduce((s,o,l)=>{const c=o.map(f=>({idx:l,path:f}));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(p=>e.definition[p.idx].ignoreAmbiguities!==!0&&p.idx<l&&ly(p.path,c)).map(p=>{const g=[p.idx+1,l+1],C=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:g,prefixPath:p.path}),type:Ke.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:C,alternatives:g}})})}function $y(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:Ke.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function Cy(t){const e=Object.assign({errMsgProvider:qg},t),r={};return t.rules.forEach(n=>{r[n.name]=n}),Hg(r,e.errMsgProvider)}function Sy(t){var e;const r=(e=t.errMsgProvider)!==null&&e!==void 0?e:br;return uy(t.rules,t.tokenTypes,r,t.grammarName)}const ph="MismatchedTokenException",mh="NoViableAltException",gh="EarlyExitException",yh="NotAllInputParsedException",Th=[ph,mh,gh,yh];Object.freeze(Th);function cs(t){return Th.includes(t.name)}class js 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 Rh extends js{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=ph}}class wy extends js{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=mh}}class ky extends js{constructor(e,r){super(e,r),this.name=yh}}class by extends js{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=gh}}const fo={},vh="InRuleRecoveryException";class Ny extends Error{constructor(e){super(e),this.name=vh}}class _y{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:Wt.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Iy)}getTokenToInsert(e){const r=Pc(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 f=this.LA_FAST(1);const h=()=>{const p=this.LA(0),g=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:c,previous:p,ruleName:this.getCurrRuleFullName()}),C=new Rh(g,c,this.LA(0));C.resyncedTokens=o.slice(0,-1),this.SAVE_ERROR(C)};for(;!l;)if(this.tokenMatcher(f,i)){h();return}else if(n.call(this)){h(),e.apply(this,r);return}else this.tokenMatcher(f,a)?l=!0:(f=this.SKIP_TOKEN(),this.addToResyncTokens(f,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 Jg(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 Ny("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=>lh(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK_IDX===0)return fo;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]=fo: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===fo)return[fr];const r=e.ruleName+e.idxInCallingRule+Zd+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,fr)||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 Iy(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const p=this.getCurrRuleFullName(),g=this.getGAstProductions()[p];l=new a(g,i).startWalking(),this.firstAfterRepMap[o]=l}let c=l.token,f=l.occurrence;const h=l.isEndOfRule;this.RULE_STACK_IDX===0&&h&&c===void 0&&(c=fr,f=1),!(c===void 0||f===void 0)&&this.shouldInRepetitionRecoveryBeTried(c,f,s)&&this.tryInRepetitionRecovery(t,e,r,c)}const Py=4,pr=8,Eh=1<<pr,Ah=2<<pr,qo=3<<pr,Ho=4<<pr,Xo=5<<pr,Ya=6<<pr;function ho(t,e,r){return r|e|t}class xc{constructor(e){var r;this.maxLookahead=(r=e==null?void 0:e.maxLookahead)!==null&&r!==void 0?r:Wt.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=>hh(r,r,br))}validateEmptyOrAlternatives(e){return e.flatMap(r=>gy(r,br))}validateAmbiguousAlternationAlternatives(e,r){return e.flatMap(n=>yy(n,r,br))}validateSomeNonEmptyLookaheadPath(e,r){return vy(e,r,br)}buildLookaheadForAlternation(e){return ry(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,iy)}buildLookaheadForOptional(e){return ny(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Oc(e.prodType),ay)}}class Oy{initLooksAhead(e){this.dynamicTokensEnabled=Object.hasOwn(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Wt.dynamicTokensEnabled,this.maxLookahead=Object.hasOwn(e,"maxLookahead")?e.maxLookahead:Wt.maxLookahead,this.lookaheadStrategy=Object.hasOwn(e,"lookaheadStrategy")?e.lookaheadStrategy:new xc({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}=xy(r);n.forEach(c=>{const f=c.idx===0?"":c.idx;this.TRACE_INIT(`${vt(c)}${f}`,()=>{const h=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:c.idx,rule:r,maxLookahead:c.maxLookahead||this.maxLookahead,hasPredicates:c.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),p=ho(this.fullRuleNameToShort[r.name],Eh,c.idx);this.setLaFuncCache(p,h)})}),i.forEach(c=>{this.computeLookaheadFunc(r,c.idx,qo,"Repetition",c.maxLookahead,vt(c))}),a.forEach(c=>{this.computeLookaheadFunc(r,c.idx,Ah,"Option",c.maxLookahead,vt(c))}),s.forEach(c=>{this.computeLookaheadFunc(r,c.idx,Ho,"RepetitionMandatory",c.maxLookahead,vt(c))}),o.forEach(c=>{this.computeLookaheadFunc(r,c.idx,Ya,"RepetitionMandatoryWithSeparator",c.maxLookahead,vt(c))}),l.forEach(c=>{this.computeLookaheadFunc(r,c.idx,Xo,"RepetitionWithSeparator",c.maxLookahead,vt(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=ho(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){return ho(this.currRuleShortName,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}}class Ly 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 ka=new Ly;function xy(t){ka.reset(),t.accept(ka);const e=ka.dslMethods;return ka.reset(),e}function wu(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function ku(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 Dy(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function My(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}const Fy="name";function $h(t,e){Object.defineProperty(t,Fy,{enumerable:!1,configurable:!0,writable:!1,value:e})}function Gy(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 jy(t,e){const r=function(){};$h(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=Uy(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 zy(t,e,r){const n=function(){};$h(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return e.forEach(a=>{i[a]=Gy}),n.prototype=i,n.prototype.constructor=n,n}var Yo;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Yo||(Yo={}));function Uy(t,e){return By(t,e)}function By(t,e){return e.filter(i=>typeof t[i]!="function").map(i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:Yo.MISSING_METHOD,methodName:i})).filter(Boolean)}class Wy{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,"nodeLocationTracking")?e.nodeLocationTracking:Wt.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{};else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=ku,this.setNodeLocationFromNode=ku,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=wu,this.setNodeLocationFromNode=wu,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];Dy(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];My(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(this.baseCstVisitorConstructor===void 0){const e=jy(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(this.baseCstVisitorWithDefaultsConstructor===void 0){const e=zy(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 Ky{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)):_n}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?_n: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 Vy{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=fs){if(this.definedRulesNames.includes(e)){const s={message:br.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Ke.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=fs){const i=my(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(cs(s))return!1;throw s}finally{this.reloadRecogState(a),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Qm(Object.values(this.gastProductionsCache))}}class qy{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=ls,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(Wg)){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=fr;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?ls:Zi,Qi(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:fs.resyncEnabled,a=Object.hasOwn(n,"recoveryValueFunc")?n.recoveryValueFunc:fs.recoveryValueFunc,s=this.ruleShortNameIdx<<Py+pr;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let o;return this.outputCst===!0?o=function(...h){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,h);const p=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(p),p}catch(p){return this.invokeRuleCatch(p,i,a)}finally{this.ruleFinallyStateUpdate()}}:o=function(...h){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,h)}catch(p){return this.invokeRuleCatch(p,i,a)}finally{this.ruleFinallyStateUpdate()}},Object.assign(function(...h){this.onBeforeParse(e);try{return o.apply(this,h)}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(cs(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(Ah,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(Ho,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,ue.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,Ho,e,Qg)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(Ya,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,$u],o,Ya,e,$u)}else throw this.raiseEarlyExitException(e,ue.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(qo,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,qo,e,Zg,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(Xo,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,Au],o,Xo,e,Au)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,Ya,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(Eh,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 cs(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 Rh(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===vh?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),fr)}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(_n)}onAfterParse(e){if(this.isAtEndOfInput()===!1){const r=this.LA(1),n=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:r,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new ky(n,r))}for(;this.tokVector.at(-1)===_n;)this.tokVector.pop()}}class Hy{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:Wt.errorMessageProvider}SAVE_ERROR(e){if(cs(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=Gs(e,a,r,this.maxLookahead)[0],l=[];for(let f=1;f<=this.maxLookahead;f++)l.push(this.LA(f));const c=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new by(c,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=Fs(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 wy(l,this.LA(1),o))}}const zs={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(zs);const bu=!0,Nu=Math.pow(2,pr)-1,Ch=oh({name:"RECORDING_PHASE_TOKEN",pattern:qe.NA});Qi([Ch]);const Sh=Pc(Ch,`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(Sh);const Xy={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 Yy{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 _n}topLevelRuleRecord(e,r){try{const n=new Hn({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 pi.call(this,Me,e,r)}atLeastOneInternalRecord(e,r){pi.call(this,tt,r,e)}atLeastOneSepFirstInternalRecord(e,r){pi.call(this,rt,r,e,bu)}manyInternalRecord(e,r){pi.call(this,ye,r,e)}manySepFirstInternalRecord(e,r){pi.call(this,Xe,r,e,bu)}orInternalRecord(e,r){return Jy.call(this,e,r)}subruleInternalRecord(e,r,n){if(us(r),!e||!Object.hasOwn(e,"ruleName")){const o=new Error(`<SUBRULE${_u(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 We({idx:r,nonTerminalName:a,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?Xy:zs}consumeInternalRecord(e,r,n){if(us(r),!ah(e)){const s=new Error(`<CONSUME${_u(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),Sh}}function pi(t,e,r,n=!1){us(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(),zs}function Jy(t,e){us(e);const r=this.recordingProdStack.at(-1),n=Array.isArray(t)===!1,i=n===!1?t:t.DEF,a=new Ye({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 He({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()}),zs}function _u(t){return t===0?"":`${t}`}function us(t){if(t<0||t>Nu){const e=new Error(`Invalid DSL Method idx value: <${t}>
107
+ Idx value must be a none negative value smaller than ${Nu+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class Zy{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=Wt.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}=Yd(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 Qy(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 _n=Pc(fr,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(_n);const Wt=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:on,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),fs=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var Ke;(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"})(Ke||(Ke={}));function Iu(t=void 0){return function(){return t}}class ea{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",()=>{Jd(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=Cy({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=Sy({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:br,grammarName:r}),a=cy({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=sg(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))})),!ea.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:Wt.skipValidations}}ea.DEFER_DEFINITION_ERRORS_HANDLING=!1;Qy(ea,[_y,Oy,Wy,Ky,qy,Vy,Hy,Yy,Zy]);class eT extends ea{constructor(e,r=Wt){const n=Object.assign({},r);n.outputCst=!1,super(e,n)}}function In(t,e,r){return`${t.name}_${e}_${r}`}const dr=1,tT=2,wh=4,kh=5,ta=7,rT=8,nT=9,iT=10,aT=11,bh=12;class Dc{constructor(e){this.target=e}isEpsilon(){return!1}}class Mc extends Dc{constructor(e,r){super(e),this.tokenType=r}}class Nh extends Dc{constructor(e){super(e)}isEpsilon(){return!0}}class Fc extends Dc{constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}}function sT(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};oT(e,t);const r=t.length;for(let n=0;n<r;n++){const i=t[n],a=Dr(e,i,i);a!==void 0&&TT(e,i,a)}return e}function oT(t,e){const r=e.length;for(let n=0;n<r;n++){const i=e[n],a=Ie(t,i,void 0,{type:tT}),s=Ie(t,i,void 0,{type:ta});a.stop=s,t.ruleToStartState.set(i,a),t.ruleToStopState.set(i,s)}}function _h(t,e,r){return r instanceof se?Gc(t,e,r.terminalType,r):r instanceof We?yT(t,e,r):r instanceof Ye?dT(t,e,r):r instanceof Me?hT(t,e,r):r instanceof ye?lT(t,e,r):r instanceof Xe?cT(t,e,r):r instanceof tt?uT(t,e,r):r instanceof rt?fT(t,e,r):Dr(t,e,r)}function lT(t,e,r){const n=Ie(t,e,r,{type:kh});mr(t,n);const i=Yn(t,e,n,r,Dr(t,e,r));return Ph(t,e,r,i)}function cT(t,e,r){const n=Ie(t,e,r,{type:kh});mr(t,n);const i=Yn(t,e,n,r,Dr(t,e,r)),a=Gc(t,e,r.separator,r);return Ph(t,e,r,i,a)}function uT(t,e,r){const n=Ie(t,e,r,{type:wh});mr(t,n);const i=Yn(t,e,n,r,Dr(t,e,r));return Ih(t,e,r,i)}function fT(t,e,r){const n=Ie(t,e,r,{type:wh});mr(t,n);const i=Yn(t,e,n,r,Dr(t,e,r)),a=Gc(t,e,r.separator,r);return Ih(t,e,r,i,a)}function dT(t,e,r){const n=Ie(t,e,r,{type:dr});mr(t,n);const i=Gt(r.definition,s=>_h(t,e,s));return Yn(t,e,n,r,...i)}function hT(t,e,r){const n=Ie(t,e,r,{type:dr});mr(t,n);const i=Yn(t,e,n,r,Dr(t,e,r));return pT(t,e,r,i)}function Dr(t,e,r){const n=qp(Gt(r.definition,i=>_h(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:gT(t,n)}function Ih(t,e,r,n,i){const a=n.left,s=n.right,o=Ie(t,e,r,{type:aT});mr(t,o);const l=Ie(t,e,r,{type:bh});return a.loopback=o,l.loopback=o,t.decisionMap[In(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 Ph(t,e,r,n,i){const a=n.left,s=n.right,o=Ie(t,e,r,{type:iT});mr(t,o);const l=Ie(t,e,r,{type:bh}),c=Ie(t,e,r,{type:nT});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[In(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}function pT(t,e,r,n){const i=n.left,a=n.right;return Se(i,a),t.decisionMap[In(e,"Option",r.idx)]=i,n}function mr(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function Yn(t,e,r,n,...i){const a=Ie(t,e,n,{type:rT,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[In(e,mT(n),n.idx)]=r,s}function mT(t){if(t instanceof Ye)return"Alternation";if(t instanceof Me)return"Option";if(t instanceof ye)return"Repetition";if(t instanceof Xe)return"RepetitionWithSeparator";if(t instanceof tt)return"RepetitionMandatory";if(t instanceof rt)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function gT(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 Fc,c=o,f=e[a+1].left;s.left.type===dr&&s.right.type===dr&&o!==void 0&&(l&&c.followState===s.right||o.target===s.right)?(l?c.followState=f:o.target=f,RT(t,s.right)):Se(s.right,f)}const n=e[0],i=e[r-1];return{left:n.left,right:i.right}}function Gc(t,e,r,n){const i=Ie(t,e,n,{type:dr}),a=Ie(t,e,n,{type:dr});return jc(i,new Mc(a,r)),{left:i,right:a}}function yT(t,e,r){const n=r.referencedRule,i=t.ruleToStartState.get(n),a=Ie(t,e,r,{type:dr}),s=Ie(t,e,r,{type:dr}),o=new Fc(i,n,s);return jc(a,o),{left:a,right:s}}function TT(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 Nh(e);jc(t,r)}function Ie(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 jc(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function RT(t,e){t.states.splice(t.states.indexOf(e),1)}const ds={};class Jo{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const r=Oh(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 Oh(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}function vT(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 Lh{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 Pu=new Lh;class ET extends xc{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=sT(e.rules),this.dfas=AT(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=In(n,"Alternation",r),f=this.atn.decisionMap[l].decision,h=Gt(Cu({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),p=>Gt(p,g=>g[0]));if(Ou(h,!1)&&!a){const p=Yc(h,(g,C,k)=>(no(C,D=>{D&&(g[D.tokenTypeIdx]=k,no(D.categoryMatches,b=>{g[b]=k}))}),g),{});return i?function(g){var C;const k=this.LA_FAST(1),D=p[k.tokenTypeIdx];if(g!==void 0&&D!==void 0){const b=(C=g[D])===null||C===void 0?void 0:C.GATE;if(b!==void 0&&b.call(this)===!1)return}return D}:function(){const g=this.LA_FAST(1);return p[g.tokenTypeIdx]}}else return i?function(p){const g=new Lh,C=p===void 0?0:p.length;for(let D=0;D<C;D++){const b=p==null?void 0:p[D].GATE;g.set(D,b===void 0||b.call(this))}const k=po.call(this,s,f,g,o);return typeof k=="number"?k:void 0}:function(){const p=po.call(this,s,f,Pu,o);return typeof p=="number"?p:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:r,rule:n,prodType:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=In(n,i,r),f=this.atn.decisionMap[l].decision,h=Gt(Cu({maxLookahead:1,occurrence:r,prodType:i,rule:n}),p=>Gt(p,g=>g[0]));if(Ou(h)&&h[0][0]&&!a){const p=h[0],g=Up(p);if(g.length===1&&Hp(g[0].categoryMatches)){const k=g[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===k}}else{const C=Yc(g,(k,D)=>(D!==void 0&&(k[D.tokenTypeIdx]=!0,no(D.categoryMatches,b=>{k[b]=!0})),k),{});return function(){const k=this.LA_FAST(1);return C[k.tokenTypeIdx]===!0}}}return function(){const p=po.call(this,s,f,Pu,o);return typeof p=="object"?!1:p===0}}}function Ou(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 AT(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=vT(t.decisionStates[n],n);return r}function po(t,e,r,n){const i=t[e](r);let a=i.start;if(a===void 0){const o=OT(i.atnStartState);a=Dh(i,xh(o)),i.start=a}return $T.apply(this,[i,a,r,n])}function $T(t,e,r,n){let i=e,a=1;const s=[];let o=this.LA_FAST(a++);for(;;){let l=NT(i,o);if(l===void 0&&(l=CT.apply(this,[t,i,o,a,r,n])),l===ds)return bT(s,i,o);if(l.isAcceptState===!0)return l.prediction;i=l,s.push(o),o=this.LA(a++)}}function CT(t,e,r,n,i,a){const s=_T(e.configs,r,i);if(s.size===0)return Lu(t,e,r,ds),ds;let o=xh(s);const l=PT(s,i);if(l!==void 0)o.isAcceptState=!0,o.prediction=l,o.configs.uniqueAlt=l;else if(MT(s)){const c=Bp(s.alts);o.isAcceptState=!0,o.prediction=c,o.configs.uniqueAlt=c,ST.apply(this,[t,n,s.alts,a])}return o=Lu(t,e,r,o),o}function ST(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=wT({topLevelRule:s,ambiguityIndices:r,production:o,prefixPath:i});n(l)}function wT(t){const e=Gt(t.prefixPath,i=>cn(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${kT(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 kT(t){if(t instanceof We)return"SUBRULE";if(t instanceof Me)return"OPTION";if(t instanceof Ye)return"OR";if(t instanceof tt)return"AT_LEAST_ONE";if(t instanceof rt)return"AT_LEAST_ONE_SEP";if(t instanceof Xe)return"MANY_SEP";if(t instanceof ye)return"MANY";if(t instanceof se)return"CONSUME";throw Error("non exhaustive match")}function bT(t,e,r){const n=Xp(e.configs.elements,a=>a.state.transitions),i=Yp(n.filter(a=>a instanceof Mc).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function NT(t,e){return t.edges[e.tokenTypeIdx]}function _T(t,e,r){const n=new Jo,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===ta){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l<o;l++){const c=s.state.transitions[l],f=IT(c,e);f!==void 0&&n.add({state:f,alt:s.alt,stack:s.stack})}}let a;if(i.length===0&&n.size===1&&(a=n),a===void 0){a=new Jo;for(const s of n.elements)hs(s,a)}if(i.length>0&&!xT(a))for(const s of i)a.add(s);return a}function IT(t,e){if(t instanceof Mc&&lh(e,t.tokenType))return t.target}function PT(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 xh(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function Lu(t,e,r,n){return n=Dh(t,n),e.edges[r.tokenTypeIdx]=n,n}function Dh(t,e){if(e===ds)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 OT(t){const e=new Jo,r=t.transitions.length;for(let n=0;n<r;n++){const a={state:t.transitions[n].target,alt:n,stack:[]};hs(a,e)}return e}function hs(t,e){const r=t.state;if(r.type===ta){if(t.stack.length>0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};hs(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=LT(t,a);s!==void 0&&hs(s,e)}}function LT(t,e){if(e instanceof Nh)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Fc){const r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}function xT(t){for(const e of t.elements)if(e.state.type===ta)return!0;return!1}function DT(t){for(const e of t.elements)if(e.state.type!==ta)return!1;return!0}function MT(t){if(DT(t))return!0;const e=FT(t.elements);return GT(e)&&!jT(e)}function FT(t){const e=new Map;for(const r of t){const n=Oh(r,!1);let i=e.get(n);i===void 0&&(i={},e.set(n,i)),i[r.alt]=!0}return e}function GT(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function jT(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var Zo;(function(t){function e(r){return typeof r=="string"}t.is=e})(Zo||(Zo={}));var ps;(function(t){function e(r){return typeof r=="string"}t.is=e})(ps||(ps={}));var Qo;(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})(Qo||(Qo={}));var xi;(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})(xi||(xi={}));var J;(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=xi.MAX_VALUE),i===Number.MAX_VALUE&&(i=xi.MAX_VALUE),{line:n,character:i}}t.create=e;function r(n){let i=n;return R.objectLiteral(i)&&R.uinteger(i.line)&&R.uinteger(i.character)}t.is=r})(J||(J={}));var V;(function(t){function e(n,i,a,s){if(R.uinteger(n)&&R.uinteger(i)&&R.uinteger(a)&&R.uinteger(s))return{start:J.create(n,i),end:J.create(a,s)};if(J.is(n)&&J.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 R.objectLiteral(i)&&J.is(i.start)&&J.is(i.end)}t.is=r})(V||(V={}));var Di;(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return R.objectLiteral(i)&&V.is(i.range)&&(R.string(i.uri)||R.undefined(i.uri))}t.is=r})(Di||(Di={}));var el;(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 R.objectLiteral(i)&&V.is(i.targetRange)&&R.string(i.targetUri)&&V.is(i.targetSelectionRange)&&(V.is(i.originSelectionRange)||R.undefined(i.originSelectionRange))}t.is=r})(el||(el={}));var ms;(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 R.objectLiteral(i)&&R.numberRange(i.red,0,1)&&R.numberRange(i.green,0,1)&&R.numberRange(i.blue,0,1)&&R.numberRange(i.alpha,0,1)}t.is=r})(ms||(ms={}));var tl;(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){const i=n;return R.objectLiteral(i)&&V.is(i.range)&&ms.is(i.color)}t.is=r})(tl||(tl={}));var rl;(function(t){function e(n,i,a){return{label:n,textEdit:i,additionalTextEdits:a}}t.create=e;function r(n){const i=n;return R.objectLiteral(i)&&R.string(i.label)&&(R.undefined(i.textEdit)||$t.is(i))&&(R.undefined(i.additionalTextEdits)||R.typedArray(i.additionalTextEdits,$t.is))}t.is=r})(rl||(rl={}));var nl;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(nl||(nl={}));var il;(function(t){function e(n,i,a,s,o,l){const c={startLine:n,endLine:i};return R.defined(a)&&(c.startCharacter=a),R.defined(s)&&(c.endCharacter=s),R.defined(o)&&(c.kind=o),R.defined(l)&&(c.collapsedText=l),c}t.create=e;function r(n){const i=n;return R.objectLiteral(i)&&R.uinteger(i.startLine)&&R.uinteger(i.startLine)&&(R.undefined(i.startCharacter)||R.uinteger(i.startCharacter))&&(R.undefined(i.endCharacter)||R.uinteger(i.endCharacter))&&(R.undefined(i.kind)||R.string(i.kind))}t.is=r})(il||(il={}));var gs;(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return R.defined(i)&&Di.is(i.location)&&R.string(i.message)}t.is=r})(gs||(gs={}));var al;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(al||(al={}));var sl;(function(t){t.Unnecessary=1,t.Deprecated=2})(sl||(sl={}));var ol;(function(t){function e(r){const n=r;return R.objectLiteral(n)&&R.string(n.href)}t.is=e})(ol||(ol={}));var Mi;(function(t){function e(n,i,a,s,o,l){let c={range:n,message:i};return R.defined(a)&&(c.severity=a),R.defined(s)&&(c.code=s),R.defined(o)&&(c.source=o),R.defined(l)&&(c.relatedInformation=l),c}t.create=e;function r(n){var i;let a=n;return R.defined(a)&&V.is(a.range)&&R.string(a.message)&&(R.number(a.severity)||R.undefined(a.severity))&&(R.integer(a.code)||R.string(a.code)||R.undefined(a.code))&&(R.undefined(a.codeDescription)||R.string((i=a.codeDescription)===null||i===void 0?void 0:i.href))&&(R.string(a.source)||R.undefined(a.source))&&(R.undefined(a.relatedInformation)||R.typedArray(a.relatedInformation,gs.is))}t.is=r})(Mi||(Mi={}));var Lr;(function(t){function e(n,i,...a){let s={title:n,command:i};return R.defined(a)&&a.length>0&&(s.arguments=a),s}t.create=e;function r(n){let i=n;return R.defined(i)&&R.string(i.title)&&R.string(i.command)}t.is=r})(Lr||(Lr={}));var $t;(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 R.objectLiteral(s)&&R.string(s.newText)&&V.is(s.range)}t.is=i})($t||($t={}));var Nr;(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 R.objectLiteral(i)&&R.string(i.label)&&(R.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(R.string(i.description)||i.description===void 0)}t.is=r})(Nr||(Nr={}));var De;(function(t){function e(r){const n=r;return R.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 $t.is(s)&&(Nr.is(s.annotationId)||De.is(s.annotationId))}t.is=i})(Ft||(Ft={}));var Fi;(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return R.defined(i)&&Gi.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(Fi||(Fi={}));var Pn;(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"&&R.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||R.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||R.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||De.is(i.annotationId))}t.is=r})(Pn||(Pn={}));var On;(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"&&R.string(i.oldUri)&&R.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||R.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||R.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||De.is(i.annotationId))}t.is=r})(On||(On={}));var Ln;(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"&&R.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||R.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||R.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||De.is(i.annotationId))}t.is=r})(Ln||(Ln={}));var ys;(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(i=>R.string(i.kind)?Pn.is(i)||On.is(i)||Ln.is(i):Fi.is(i)))}t.is=e})(ys||(ys={}));class ba{constructor(e,r){this.edits=e,this.changeAnnotations=r}insert(e,r,n){let i,a;if(n===void 0?i=$t.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=$t.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=$t.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 xu{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 zT{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new xu(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(r=>{if(Fi.is(r)){const n=new ba(r.edits,this._changeAnnotations);this._textEditChanges[r.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(r=>{const n=new ba(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(Gi.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 ba(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 ba(n),this._textEditChanges[e]=r}return r}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new xu,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;Nr.is(r)||De.is(r)?i=r:n=r;let a,s;if(i===void 0?a=Pn.create(e,n):(s=De.is(i)?i:this._changeAnnotations.manage(i),a=Pn.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;Nr.is(n)||De.is(n)?a=n:i=n;let s,o;if(a===void 0?s=On.create(e,r,i):(o=De.is(a)?a:this._changeAnnotations.manage(a),s=On.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;Nr.is(r)||De.is(r)?i=r:n=r;let a,s;if(i===void 0?a=Ln.create(e,n):(s=De.is(i)?i:this._changeAnnotations.manage(i),a=Ln.create(e,n,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}}var ll;(function(t){function e(n){return{uri:n}}t.create=e;function r(n){let i=n;return R.defined(i)&&R.string(i.uri)}t.is=r})(ll||(ll={}));var cl;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return R.defined(i)&&R.string(i.uri)&&R.integer(i.version)}t.is=r})(cl||(cl={}));var Gi;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return R.defined(i)&&R.string(i.uri)&&(i.version===null||R.integer(i.version))}t.is=r})(Gi||(Gi={}));var ul;(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 R.defined(i)&&R.string(i.uri)&&R.string(i.languageId)&&R.integer(i.version)&&R.string(i.text)}t.is=r})(ul||(ul={}));var Ts;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){const n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(Ts||(Ts={}));var xn;(function(t){function e(r){const n=r;return R.objectLiteral(r)&&Ts.is(n.kind)&&R.string(n.value)}t.is=e})(xn||(xn={}));var fl;(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})(fl||(fl={}));var dl;(function(t){t.PlainText=1,t.Snippet=2})(dl||(dl={}));var hl;(function(t){t.Deprecated=1})(hl||(hl={}));var pl;(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&&R.string(i.newText)&&V.is(i.insert)&&V.is(i.replace)}t.is=r})(pl||(pl={}));var ml;(function(t){t.asIs=1,t.adjustIndentation=2})(ml||(ml={}));var gl;(function(t){function e(r){const n=r;return n&&(R.string(n.detail)||n.detail===void 0)&&(R.string(n.description)||n.description===void 0)}t.is=e})(gl||(gl={}));var yl;(function(t){function e(r){return{label:r}}t.create=e})(yl||(yl={}));var Tl;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(Tl||(Tl={}));var ji;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function r(n){const i=n;return R.string(i)||R.objectLiteral(i)&&R.string(i.language)&&R.string(i.value)}t.is=r})(ji||(ji={}));var Rl;(function(t){function e(r){let n=r;return!!n&&R.objectLiteral(n)&&(xn.is(n.contents)||ji.is(n.contents)||R.typedArray(n.contents,ji.is))&&(r.range===void 0||V.is(r.range))}t.is=e})(Rl||(Rl={}));var vl;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(vl||(vl={}));var El;(function(t){function e(r,n,...i){let a={label:r};return R.defined(n)&&(a.documentation=n),R.defined(i)?a.parameters=i:a.parameters=[],a}t.create=e})(El||(El={}));var Al;(function(t){t.Text=1,t.Read=2,t.Write=3})(Al||(Al={}));var $l;(function(t){function e(r,n){let i={range:r};return R.number(n)&&(i.kind=n),i}t.create=e})($l||($l={}));var Cl;(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})(Cl||(Cl={}));var Sl;(function(t){t.Deprecated=1})(Sl||(Sl={}));var wl;(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})(wl||(wl={}));var kl;(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})(kl||(kl={}));var bl;(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&&R.string(i.name)&&R.number(i.kind)&&V.is(i.range)&&V.is(i.selectionRange)&&(i.detail===void 0||R.string(i.detail))&&(i.deprecated===void 0||R.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=r})(bl||(bl={}));var Nl;(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"})(Nl||(Nl={}));var zi;(function(t){t.Invoked=1,t.Automatic=2})(zi||(zi={}));var _l;(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 R.defined(i)&&R.typedArray(i.diagnostics,Mi.is)&&(i.only===void 0||R.typedArray(i.only,R.string))&&(i.triggerKind===void 0||i.triggerKind===zi.Invoked||i.triggerKind===zi.Automatic)}t.is=r})(_l||(_l={}));var Il;(function(t){function e(n,i,a){let s={title:n},o=!0;return typeof i=="string"?(o=!1,s.kind=i):Lr.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&&R.string(i.title)&&(i.diagnostics===void 0||R.typedArray(i.diagnostics,Mi.is))&&(i.kind===void 0||R.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Lr.is(i.command))&&(i.isPreferred===void 0||R.boolean(i.isPreferred))&&(i.edit===void 0||ys.is(i.edit))}t.is=r})(Il||(Il={}));var Pl;(function(t){function e(n,i){let a={range:n};return R.defined(i)&&(a.data=i),a}t.create=e;function r(n){let i=n;return R.defined(i)&&V.is(i.range)&&(R.undefined(i.command)||Lr.is(i.command))}t.is=r})(Pl||(Pl={}));var Ol;(function(t){function e(n,i){return{tabSize:n,insertSpaces:i}}t.create=e;function r(n){let i=n;return R.defined(i)&&R.uinteger(i.tabSize)&&R.boolean(i.insertSpaces)}t.is=r})(Ol||(Ol={}));var Ll;(function(t){function e(n,i,a){return{range:n,target:i,data:a}}t.create=e;function r(n){let i=n;return R.defined(i)&&V.is(i.range)&&(R.undefined(i.target)||R.string(i.target))}t.is=r})(Ll||(Ll={}));var xl;(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return R.objectLiteral(i)&&V.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(xl||(xl={}));var Dl;(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"})(Dl||(Dl={}));var Ml;(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"})(Ml||(Ml={}));var Fl;(function(t){function e(r){const n=r;return R.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})(Fl||(Fl={}));var Gl;(function(t){function e(n,i){return{range:n,text:i}}t.create=e;function r(n){const i=n;return i!=null&&V.is(i.range)&&R.string(i.text)}t.is=r})(Gl||(Gl={}));var jl;(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&&V.is(i.range)&&R.boolean(i.caseSensitiveLookup)&&(R.string(i.variableName)||i.variableName===void 0)}t.is=r})(jl||(jl={}));var zl;(function(t){function e(n,i){return{range:n,expression:i}}t.create=e;function r(n){const i=n;return i!=null&&V.is(i.range)&&(R.string(i.expression)||i.expression===void 0)}t.is=r})(zl||(zl={}));var Ul;(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){const i=n;return R.defined(i)&&V.is(n.stoppedLocation)}t.is=r})(Ul||(Ul={}));var Rs;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(Rs||(Rs={}));var vs;(function(t){function e(n){return{value:n}}t.create=e;function r(n){const i=n;return R.objectLiteral(i)&&(i.tooltip===void 0||R.string(i.tooltip)||xn.is(i.tooltip))&&(i.location===void 0||Di.is(i.location))&&(i.command===void 0||Lr.is(i.command))}t.is=r})(vs||(vs={}));var Bl;(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 R.objectLiteral(i)&&J.is(i.position)&&(R.string(i.label)||R.typedArray(i.label,vs.is))&&(i.kind===void 0||Rs.is(i.kind))&&i.textEdits===void 0||R.typedArray(i.textEdits,$t.is)&&(i.tooltip===void 0||R.string(i.tooltip)||xn.is(i.tooltip))&&(i.paddingLeft===void 0||R.boolean(i.paddingLeft))&&(i.paddingRight===void 0||R.boolean(i.paddingRight))}t.is=r})(Bl||(Bl={}));var Wl;(function(t){function e(r){return{kind:"snippet",value:r}}t.createSnippet=e})(Wl||(Wl={}));var Kl;(function(t){function e(r,n,i,a){return{insertText:r,filterText:n,range:i,command:a}}t.create=e})(Kl||(Kl={}));var Vl;(function(t){function e(r){return{items:r}}t.create=e})(Vl||(Vl={}));var ql;(function(t){t.Invoked=0,t.Automatic=1})(ql||(ql={}));var Hl;(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(Hl||(Hl={}));var Xl;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(Xl||(Xl={}));var Yl;(function(t){function e(r){const n=r;return R.objectLiteral(n)&&ps.is(n.uri)&&R.string(n.name)}t.is=e})(Yl||(Yl={}));const UT=[`
117
+ `,`\r
118
+ `,"\r"];var Jl;(function(t){function e(a,s,o,l){return new BT(a,s,o,l)}t.create=e;function r(a){let s=a;return!!(R.defined(s)&&R.string(s.uri)&&(R.undefined(s.languageId)||R.string(s.languageId))&&R.uinteger(s.lineCount)&&R.func(s.getText)&&R.func(s.positionAt)&&R.func(s.offsetAt))}t.is=r;function n(a,s){let o=a.getText(),l=i(s,(f,h)=>{let p=f.range.start.line-h.range.start.line;return p===0?f.range.start.character-h.range.start.character:p}),c=o.length;for(let f=l.length-1;f>=0;f--){let h=l[f],p=a.offsetAt(h.range.start),g=a.offsetAt(h.range.end);if(g<=c)o=o.substring(0,p)+h.newText+o.substring(g,o.length);else throw new Error("Overlapping edit");c=p}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 f=0,h=0,p=0;for(;f<l.length&&h<c.length;)s(l[f],c[h])<=0?a[p++]=l[f++]:a[p++]=c[h++];for(;f<l.length;)a[p++]=l[f++];for(;h<c.length;)a[p++]=c[h++];return a}})(Jl||(Jl={}));let BT=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 J.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 J.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 R;(function(t){const e=Object.prototype.toString;function r(g){return typeof g<"u"}t.defined=r;function n(g){return typeof g>"u"}t.undefined=n;function i(g){return g===!0||g===!1}t.boolean=i;function a(g){return e.call(g)==="[object String]"}t.string=a;function s(g){return e.call(g)==="[object Number]"}t.number=s;function o(g,C,k){return e.call(g)==="[object Number]"&&C<=g&&g<=k}t.numberRange=o;function l(g){return e.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}t.integer=l;function c(g){return e.call(g)==="[object Number]"&&0<=g&&g<=2147483647}t.uinteger=c;function f(g){return e.call(g)==="[object Function]"}t.func=f;function h(g){return g!==null&&typeof g=="object"}t.objectLiteral=h;function p(g,C){return Array.isArray(g)&&g.every(C)}t.typedArray=p})(R||(R={}));const WT=Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return Ft},get ChangeAnnotation(){return Nr},get ChangeAnnotationIdentifier(){return De},get CodeAction(){return Il},get CodeActionContext(){return _l},get CodeActionKind(){return Nl},get CodeActionTriggerKind(){return zi},get CodeDescription(){return ol},get CodeLens(){return Pl},get Color(){return ms},get ColorInformation(){return tl},get ColorPresentation(){return rl},get Command(){return Lr},get CompletionItem(){return yl},get CompletionItemKind(){return fl},get CompletionItemLabelDetails(){return gl},get CompletionItemTag(){return hl},get CompletionList(){return Tl},get CreateFile(){return Pn},get DeleteFile(){return Ln},get Diagnostic(){return Mi},get DiagnosticRelatedInformation(){return gs},get DiagnosticSeverity(){return al},get DiagnosticTag(){return sl},get DocumentHighlight(){return $l},get DocumentHighlightKind(){return Al},get DocumentLink(){return Ll},get DocumentSymbol(){return bl},get DocumentUri(){return Zo},EOL:UT,get FoldingRange(){return il},get FoldingRangeKind(){return nl},get FormattingOptions(){return Ol},get Hover(){return Rl},get InlayHint(){return Bl},get InlayHintKind(){return Rs},get InlayHintLabelPart(){return vs},get InlineCompletionContext(){return Xl},get InlineCompletionItem(){return Kl},get InlineCompletionList(){return Vl},get InlineCompletionTriggerKind(){return ql},get InlineValueContext(){return Ul},get InlineValueEvaluatableExpression(){return zl},get InlineValueText(){return Gl},get InlineValueVariableLookup(){return jl},get InsertReplaceEdit(){return pl},get InsertTextFormat(){return dl},get InsertTextMode(){return ml},get Location(){return Di},get LocationLink(){return el},get MarkedString(){return ji},get MarkupContent(){return xn},get MarkupKind(){return Ts},get OptionalVersionedTextDocumentIdentifier(){return Gi},get ParameterInformation(){return vl},get Position(){return J},get Range(){return V},get RenameFile(){return On},get SelectedCompletionInfo(){return Hl},get SelectionRange(){return xl},get SemanticTokenModifiers(){return Ml},get SemanticTokenTypes(){return Dl},get SemanticTokens(){return Fl},get SignatureInformation(){return El},get StringValue(){return Wl},get SymbolInformation(){return wl},get SymbolKind(){return Cl},get SymbolTag(){return Sl},get TextDocument(){return Jl},get TextDocumentEdit(){return Fi},get TextDocumentIdentifier(){return ll},get TextDocumentItem(){return ul},get TextEdit(){return $t},get URI(){return ps},get VersionedTextDocumentIdentifier(){return cl},WorkspaceChange:zT,get WorkspaceEdit(){return ys},get WorkspaceFolder(){return Yl},get WorkspaceSymbol(){return kl},get integer(){return Qo},get uinteger(){return xi}},Symbol.toStringTag,{value:"Module"}));class KT{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Fh(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new zc;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new Zl(e.startOffset,e.image.length,jo(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 Zl(a.startOffset,a.image.length,jo(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 Mh{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 Zl extends Mh{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 zc extends Mh{constructor(){super(...arguments),this.content=new Uc(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:J.create(0,0),end:J.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 Uc extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,Uc.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 Fh extends zc{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const Ql=Symbol("Datatype");function mo(t){return t.$type===Ql}const Du="​",Gh=t=>t.endsWith(Du)?t:t+Du;class jh{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 YT(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new Uh(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 VT extends jh{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new KT,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;rs(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(Gh(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),Vt(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 rs(e)?Li(e):e.fragment?void 0:Vd(e)?Ql:Li(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,Po(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===Ql?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 f=Ir(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,f,s,l)}else if(mo(c)){let f=i.image;Ir(n)||(f=this.converter.convert(f,s).toString()),c.value+=f}}}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(mo(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)):mo(e)?this.converter.convert(e.value,e.$cstNode):(Qp(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 k=0;k<i.length;k++){const D=i[k],b=r.get(D)??{precedence:1/0,rightAssoc:!1};b.precedence>s?(s=b.precedence,a=k):b.precedence===s&&(b.rightAssoc||(a=k))}const o=i.slice(0,a),l=i.slice(a+1),c=n.slice(0,a+1),f=n.slice(a+1),h={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:c,operators:o},p={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:f,operators:l},g=this.constructInfix(h,r),C=this.constructInfix(p,r);return{$type:e.$type,$cstNode:e.$cstNode,left:g,operator:i[a],right:C}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=_s(e,_r);this.assignmentMap.set(e,{assignment:r,crossRef:r&&Ps(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 qT{buildMismatchTokenMessage(e){return on.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return on.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return on.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return on.buildEarlyExitMessage(e)}}class zh extends qT{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 HT extends jh{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(Gh(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 XT={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new zh};class Uh extends eT{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...XT,lookaheadStrategy:n?new xc({maxLookahead:r.maxLookahead}):new ET({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 YT extends Uh{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 Bh(t,e,r){return JT({parser:e,tokens:r,ruleNames:new Map},t),e}function JT(t,e){const r=zd(e,!1),n=ce(e.rules).filter(Vt).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,xr(s,a.definition))}const i=ce(e.rules).filter(rs).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,ZT(t,a))}function ZT(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(qt(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(g=>g.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 h=n.map(g=>t.tokens[g.value]).map((g,C)=>({ALT:()=>t.parser.consume(C,g,l)}));let p;return g=>{p??(p=Bc(t,r)),t.parser.subrule(0,p,!1,a,g),t.parser.many(0,{DEF:()=>{t.parser.alternatives(0,h),t.parser.subrule(1,p,!1,c,g)}})}}function xr(t,e,r=!1){let n;if(Ir(e))n=aR(t,e);else if(Is(e))n=QT(t,e);else if(_r(e))n=xr(t,e.terminal);else if(Ps(e))n=Wh(t,e);else if(Pr(e))n=eR(t,e);else if(Ld(e))n=rR(t,e);else if(Dd(e))n=nR(t,e);else if(kc(e))n=iR(t,e);else if(am(e)){const i=t.consume++;n=()=>t.parser.consume(i,fr,e)}else throw new Fd(e.$cstNode,`Unexpected element type: ${e.$type}`);return Kh(t,r?void 0:Es(e),n,e.cardinality)}function QT(t,e){const r=Li(e);return()=>t.parser.action(r,e)}function eR(t,e){const r=e.rule.ref;if(Xi(r)){const n=t.subrule++,i=Vt(r)&&r.fragment,a=e.arguments.length>0?tR(r,e.arguments):()=>({});let s;return o=>{s??(s=Bc(t,r)),t.parser.subrule(n,s,i,e,a(o))}}else if(qt(r)){const n=t.consume++,i=ec(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)Yi();else throw new Fd(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function tR(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:Et(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=>Et(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 Et(t){if(im(t)){const e=Et(t.left),r=Et(t.right);return n=>e(n)||r(n)}else if(nm(t)){const e=Et(t.left),r=Et(t.right);return n=>e(n)&&r(n)}else if(lm(t)){const e=Et(t.value);return r=>!e(r)}else if(cm(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(tm(t)){const e=!!t.true;return()=>e}Yi()}function rR(t,e){if(e.elements.length===1)return xr(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:xr(t,i,!0)},s=Es(i);s&&(a.GATE=Et(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 nR(t,e){if(e.elements.length===1)return xr(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:xr(t,o,!0)},c=Es(o);c&&(l.GATE=Et(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 f={ALT:()=>!0},h=t.parser;f.ALT=()=>{if(l.ALT(o),!h.isRecording()){const g=i(n,h);h.unorderedGroups.get(g)||h.unorderedGroups.set(g,[]);const C=h.unorderedGroups.get(g);typeof(C==null?void 0:C[c])>"u"&&(C[c]=!0)}};const p=l.GATE;return p?f.GATE=()=>p(o):f.GATE=()=>{const g=h.unorderedGroups.get(i(n,h));return!(g!=null&&g[c])},f})),s=Kh(t,Es(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function iR(t,e){const r=e.elements.map(n=>xr(t,n));return n=>r.forEach(i=>i(n))}function Es(t){if(kc(t))return t.guardCondition}function Wh(t,e,r=e.terminal){if(r)if(Pr(r)&&Vt(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return s=>{a??(a=Bc(t,n)),t.parser.subrule(i,a,!1,e,s)}}else if(Pr(r)&&qt(r.rule.ref)){const n=t.consume++,i=ec(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Ir(r)){const n=t.consume++,i=ec(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=Wd(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+Li(e.type.ref));return Wh(t,e,i)}}function aR(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 Kh(t,e,r,n){const i=e&&Et(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:()=>r(s),GATE:()=>i(s)},{ALT:Iu(),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:Iu(),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 Yi()}function Bc(t,e){const r=sR(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function sR(t,e){if(Xi(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Vt(n);)(kc(n)||Ld(n)||Dd(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 ec(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}function oR(t){const e=t.Grammar,r=t.parser.Lexer,n=new HT(t);return Bh(e,n,r.definition),n.finalize(),n}function lR(t){const e=cR(t);return e.finalize(),e}function cR(t){const e=t.Grammar,r=t.parser.Lexer,n=new VT(t);return Bh(e,n,r.definition)}class Vh{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=ce(zd(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(qt).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=Nc(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=jd(r)?qe.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(Xi).flatMap(i=>Hi(i).filter(Ir)).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(Ls(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&&Om("^"+a.source+"$",e.value)&&n.push(i),n},[])}}class qh{convert(e,r){let n=r.grammarSource;if(Ps(n)&&(n=Mm(n)),Pr(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=Wm(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 f="";for(let h=1;h<c.length-1;h++){const p=c.charAt(h);if(p==="\\"){const g=c.charAt(++h);f+=r(g)}else f+=p}return f}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 hr={},Ht={};Object.defineProperty(Ht,"__esModule",{value:!0});let tc;function rc(){if(tc===void 0)throw new Error("No runtime abstraction layer installed");return tc}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");tc=r}t.install=e})(rc||(rc={}));Ht.default=rc;var we={};Object.defineProperty(we,"__esModule",{value:!0});we.stringArray=we.array=we.func=we.error=we.number=we.string=we.boolean=void 0;function uR(t){return t===!0||t===!1}we.boolean=uR;function Hh(t){return typeof t=="string"||t instanceof String}we.string=Hh;function fR(t){return typeof t=="number"||t instanceof Number}we.number=fR;function dR(t){return t instanceof Error}we.error=dR;function hR(t){return typeof t=="function"}we.func=hR;function Xh(t){return Array.isArray(t)}we.array=Xh;function pR(t){return Xh(t)&&t.every(e=>Hh(e))}we.stringArray=pR;var Ct={};Object.defineProperty(Ct,"__esModule",{value:!0});var Yh=Ct.Emitter=Ct.Event=void 0;const mR=Ht;var Mu;(function(t){const e={dispose(){}};t.None=function(){return e}})(Mu||(Ct.Event=Mu={}));class gR{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,a=this._callbacks.length;i<a;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];const r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let a=0,s=n.length;a<s;a++)try{r.push(n[a].apply(i[a],e))}catch(o){(0,mR.default)().console.error(o)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class Us{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new gR),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);const i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=Us._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}Yh=Ct.Emitter=Us;Us._noop=function(){};var fe;Object.defineProperty(hr,"__esModule",{value:!0});var Wc=hr.CancellationTokenSource=fe=hr.CancellationToken=void 0;const yR=Ht,TR=we,nc=Ct;var As;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:nc.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:nc.Event.None});function e(r){const n=r;return n&&(n===t.None||n===t.Cancelled||TR.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(As||(fe=hr.CancellationToken=As={}));const RR=Object.freeze(function(t,e){const r=(0,yR.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}});class Fu{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?RR:(this._emitter||(this._emitter=new nc.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class vR{get token(){return this._token||(this._token=new Fu),this._token}cancel(){this._token?this._token.cancel():this._token=As.Cancelled}dispose(){this._token?this._token instanceof Fu&&this._token.dispose():this._token=As.None}}Wc=hr.CancellationTokenSource=vR;function ER(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let Ja=0,AR=10;function $R(){return Ja=performance.now(),new Wc}const ln=Symbol("OperationCancelled");function Bs(t){return t===ln}async function Be(t){if(t===fe.None)return;const e=performance.now();if(e-Ja>=AR&&(Ja=e,await ER(),Ja=performance.now()),t.isCancellationRequested)throw ln}class Kc{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}}class Ui{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(Ui.isIncremental(n)){const i=Zh(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 f=Gu(n.text,!1,a);if(l-o===f.length)for(let p=0,g=f.length;p<g;p++)c[p+o+1]=f[p];else f.length<1e4?c.splice(o+1,l-o,...f):this._lineOffsets=c=c.slice(0,o+1).concat(f,c.slice(l+1));const h=n.text.length-(s-a);if(h!==0)for(let p=o+1+f.length,g=c.length;p<g;p++)c[p]=c[p]+h}else if(Ui.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=Gu(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&&Jh(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 ic;(function(t){function e(i,a,s,o){return new Ui(i,a,s,o)}t.create=e;function r(i,a,s){if(i instanceof Ui)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=ac(a.map(CR),(f,h)=>{const p=f.range.start.line-h.range.start.line;return p===0?f.range.start.character-h.range.start.character:p});let l=0;const c=[];for(const f of o){const h=i.offsetAt(f.range.start);if(h<l)throw new Error("Overlapping edit");h>l&&c.push(s.substring(l,h)),f.newText.length&&c.push(f.newText),l=i.offsetAt(f.range.end)}return c.push(s.substr(l)),c.join("")}t.applyEdits=n})(ic||(ic={}));function ac(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);ac(n,e),ac(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 Gu(t,e,r=0){const n=e?[r]:[];for(let i=0;i<t.length;i++){const a=t.charCodeAt(i);Jh(a)&&(a===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function Jh(t){return t===13||t===10}function Zh(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 CR(t){const e=Zh(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Qh;(()=>{var t={975:w=>{function E(y){if(typeof y!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(y))}function m(y,T){for(var v,I="",x=0,P=-1,j=0,F=0;F<=y.length;++F){if(F<y.length)v=y.charCodeAt(F);else{if(v===47)break;v=47}if(v===47){if(!(P===F-1||j===1))if(P!==F-1&&j===2){if(I.length<2||x!==2||I.charCodeAt(I.length-1)!==46||I.charCodeAt(I.length-2)!==46){if(I.length>2){var re=I.lastIndexOf("/");if(re!==I.length-1){re===-1?(I="",x=0):x=(I=I.slice(0,re)).length-1-I.lastIndexOf("/"),P=F,j=0;continue}}else if(I.length===2||I.length===1){I="",x=0,P=F,j=0;continue}}T&&(I.length>0?I+="/..":I="..",x=2)}else I.length>0?I+="/"+y.slice(P+1,F):I=y.slice(P+1,F),x=F-P-1;P=F,j=0}else v===46&&j!==-1?++j:j=-1}return I}var $={resolve:function(){for(var y,T="",v=!1,I=arguments.length-1;I>=-1&&!v;I--){var x;I>=0?x=arguments[I]:(y===void 0&&(y=process.cwd()),x=y),E(x),x.length!==0&&(T=x+"/"+T,v=x.charCodeAt(0)===47)}return T=m(T,!v),v?T.length>0?"/"+T:"/":T.length>0?T:"."},normalize:function(y){if(E(y),y.length===0)return".";var T=y.charCodeAt(0)===47,v=y.charCodeAt(y.length-1)===47;return(y=m(y,!T)).length!==0||T||(y="."),y.length>0&&v&&(y+="/"),T?"/"+y:y},isAbsolute:function(y){return E(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 v=arguments[T];E(v),v.length>0&&(y===void 0?y=v:y+="/"+v)}return y===void 0?".":$.normalize(y)},relative:function(y,T){if(E(y),E(T),y===T||(y=$.resolve(y))===(T=$.resolve(T)))return"";for(var v=1;v<y.length&&y.charCodeAt(v)===47;++v);for(var I=y.length,x=I-v,P=1;P<T.length&&T.charCodeAt(P)===47;++P);for(var j=T.length-P,F=x<j?x:j,re=-1,z=0;z<=F;++z){if(z===F){if(j>F){if(T.charCodeAt(P+z)===47)return T.slice(P+z+1);if(z===0)return T.slice(P+z)}else x>F&&(y.charCodeAt(v+z)===47?re=z:z===0&&(re=0));break}var Z=y.charCodeAt(v+z);if(Z!==T.charCodeAt(P+z))break;Z===47&&(re=z)}var Pe="";for(z=v+re+1;z<=I;++z)z!==I&&y.charCodeAt(z)!==47||(Pe.length===0?Pe+="..":Pe+="/..");return Pe.length>0?Pe+T.slice(P+re):(P+=re,T.charCodeAt(P)===47&&++P,T.slice(P))},_makeLong:function(y){return y},dirname:function(y){if(E(y),y.length===0)return".";for(var T=y.charCodeAt(0),v=T===47,I=-1,x=!0,P=y.length-1;P>=1;--P)if((T=y.charCodeAt(P))===47){if(!x){I=P;break}}else x=!1;return I===-1?v?"/":".":v&&I===1?"//":y.slice(0,I)},basename:function(y,T){if(T!==void 0&&typeof T!="string")throw new TypeError('"ext" argument must be a string');E(y);var v,I=0,x=-1,P=!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(v=y.length-1;v>=0;--v){var re=y.charCodeAt(v);if(re===47){if(!P){I=v+1;break}}else F===-1&&(P=!1,F=v+1),j>=0&&(re===T.charCodeAt(j)?--j==-1&&(x=v):(j=-1,x=F))}return I===x?x=F:x===-1&&(x=y.length),y.slice(I,x)}for(v=y.length-1;v>=0;--v)if(y.charCodeAt(v)===47){if(!P){I=v+1;break}}else x===-1&&(P=!1,x=v+1);return x===-1?"":y.slice(I,x)},extname:function(y){E(y);for(var T=-1,v=0,I=-1,x=!0,P=0,j=y.length-1;j>=0;--j){var F=y.charCodeAt(j);if(F!==47)I===-1&&(x=!1,I=j+1),F===46?T===-1?T=j:P!==1&&(P=1):T!==-1&&(P=-1);else if(!x){v=j+1;break}}return T===-1||I===-1||P===0||P===1&&T===I-1&&T===v+1?"":y.slice(T,I)},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,v){var I=v.dir||v.root,x=v.base||(v.name||"")+(v.ext||"");return I?I===v.root?I+x:I+"/"+x:x}(0,y)},parse:function(y){E(y);var T={root:"",dir:"",base:"",ext:"",name:""};if(y.length===0)return T;var v,I=y.charCodeAt(0),x=I===47;x?(T.root="/",v=1):v=0;for(var P=-1,j=0,F=-1,re=!0,z=y.length-1,Z=0;z>=v;--z)if((I=y.charCodeAt(z))!==47)F===-1&&(re=!1,F=z+1),I===46?P===-1?P=z:Z!==1&&(Z=1):P!==-1&&(Z=-1);else if(!re){j=z+1;break}return P===-1||F===-1||Z===0||Z===1&&P===F-1&&P===j+1?F!==-1&&(T.base=T.name=j===0&&x?y.slice(1,F):y.slice(j,F)):(j===0&&x?(T.name=y.slice(1,P),T.base=y.slice(1,F)):(T.name=y.slice(j,P),T.base=y.slice(j,F)),T.ext=y.slice(P,F)),j>0?T.dir=y.slice(0,j-1):x&&(T.dir="/"),T},sep:"/",delimiter:":",win32:null,posix:null};$.posix=$,w.exports=$}},e={};function r(w){var E=e[w];if(E!==void 0)return E.exports;var m=e[w]={exports:{}};return t[w](m,m.exports,r),m.exports}r.d=(w,E)=>{for(var m in E)r.o(E,m)&&!r.o(w,m)&&Object.defineProperty(w,m,{enumerable:!0,get:E[m]})},r.o=(w,E)=>Object.prototype.hasOwnProperty.call(w,E),r.r=w=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(w,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:()=>p,Utils:()=>Re}),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(w,E){if(!w.scheme&&E)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${w.authority}", path: "${w.path}", query: "${w.query}", fragment: "${w.fragment}"}`);if(w.scheme&&!a.test(w.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(w.path){if(w.authority){if(!s.test(w.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(w.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="",f="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class p{constructor(E,m,$,y,T,v=!1){er(this,"scheme");er(this,"authority");er(this,"path");er(this,"query");er(this,"fragment");typeof E=="object"?(this.scheme=E.scheme||c,this.authority=E.authority||c,this.path=E.path||c,this.query=E.query||c,this.fragment=E.fragment||c):(this.scheme=function(I,x){return I||x?I:"file"}(E,v),this.authority=m||c,this.path=function(I,x){switch(I){case"https":case"http":case"file":x?x[0]!==f&&(x=f+x):x=f}return x}(this.scheme,$||c),this.query=y||c,this.fragment=T||c,l(this,v))}static isUri(E){return E instanceof p||!!E&&typeof E.authority=="string"&&typeof E.fragment=="string"&&typeof E.path=="string"&&typeof E.query=="string"&&typeof E.scheme=="string"&&typeof E.fsPath=="string"&&typeof E.with=="function"&&typeof E.toString=="function"}get fsPath(){return O(this)}with(E){if(!E)return this;let{scheme:m,authority:$,path:y,query:T,fragment:v}=E;return m===void 0?m=this.scheme:m===null&&(m=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),v===void 0?v=this.fragment:v===null&&(v=c),m===this.scheme&&$===this.authority&&y===this.path&&T===this.query&&v===this.fragment?this:new C(m,$,y,T,v)}static parse(E,m=!1){const $=h.exec(E);return $?new C($[2]||c,ee($[4]||c),ee($[5]||c),ee($[7]||c),ee($[9]||c),m):new C(c,c,c,c,c)}static file(E){let m=c;if(i&&(E=E.replace(/\\/g,f)),E[0]===f&&E[1]===f){const $=E.indexOf(f,2);$===-1?(m=E.substring(2),E=f):(m=E.substring(2,$),E=E.substring($)||f)}return new C("file",m,E,c,c)}static from(E){const m=new C(E.scheme,E.authority,E.path,E.query,E.fragment);return l(m,!0),m}toString(E=!1){return N(this,E)}toJSON(){return this}static revive(E){if(E){if(E instanceof p)return E;{const m=new C(E);return m._formatted=E.external,m._fsPath=E._sep===g?E.fsPath:null,m}}return E}}const g=i?1:void 0;class C extends p{constructor(){super(...arguments);er(this,"_formatted",null);er(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=O(this)),this._fsPath}toString(m=!1){return m?N(this,!0):(this._formatted||(this._formatted=N(this,!1)),this._formatted)}toJSON(){const m={$mid:1};return this._fsPath&&(m.fsPath=this._fsPath,m._sep=g),this._formatted&&(m.external=this._formatted),this.path&&(m.path=this.path),this.scheme&&(m.scheme=this.scheme),this.authority&&(m.authority=this.authority),this.query&&(m.query=this.query),this.fragment&&(m.fragment=this.fragment),m}}const k={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 D(w,E,m){let $,y=-1;for(let T=0;T<w.length;T++){const v=w.charCodeAt(T);if(v>=97&&v<=122||v>=65&&v<=90||v>=48&&v<=57||v===45||v===46||v===95||v===126||E&&v===47||m&&v===91||m&&v===93||m&&v===58)y!==-1&&($+=encodeURIComponent(w.substring(y,T)),y=-1),$!==void 0&&($+=w.charAt(T));else{$===void 0&&($=w.substr(0,T));const I=k[v];I!==void 0?(y!==-1&&($+=encodeURIComponent(w.substring(y,T)),y=-1),$+=I):y===-1&&(y=T)}}return y!==-1&&($+=encodeURIComponent(w.substring(y))),$!==void 0?$:w}function b(w){let E;for(let m=0;m<w.length;m++){const $=w.charCodeAt(m);$===35||$===63?(E===void 0&&(E=w.substr(0,m)),E+=k[$]):E!==void 0&&(E+=w[m])}return E!==void 0?E:w}function O(w,E){let m;return m=w.authority&&w.path.length>1&&w.scheme==="file"?`//${w.authority}${w.path}`:w.path.charCodeAt(0)===47&&(w.path.charCodeAt(1)>=65&&w.path.charCodeAt(1)<=90||w.path.charCodeAt(1)>=97&&w.path.charCodeAt(1)<=122)&&w.path.charCodeAt(2)===58?w.path[1].toLowerCase()+w.path.substr(2):w.path,i&&(m=m.replace(/\//g,"\\")),m}function N(w,E){const m=E?b:D;let $="",{scheme:y,authority:T,path:v,query:I,fragment:x}=w;if(y&&($+=y,$+=":"),(T||y==="file")&&($+=f,$+=f),T){let P=T.indexOf("@");if(P!==-1){const j=T.substr(0,P);T=T.substr(P+1),P=j.lastIndexOf(":"),P===-1?$+=m(j,!1,!1):($+=m(j.substr(0,P),!1,!1),$+=":",$+=m(j.substr(P+1),!1,!0)),$+="@"}T=T.toLowerCase(),P=T.lastIndexOf(":"),P===-1?$+=m(T,!1,!0):($+=m(T.substr(0,P),!1,!0),$+=T.substr(P))}if(v){if(v.length>=3&&v.charCodeAt(0)===47&&v.charCodeAt(2)===58){const P=v.charCodeAt(1);P>=65&&P<=90&&(v=`/${String.fromCharCode(P+32)}:${v.substr(3)}`)}else if(v.length>=2&&v.charCodeAt(1)===58){const P=v.charCodeAt(0);P>=65&&P<=90&&(v=`${String.fromCharCode(P+32)}:${v.substr(2)}`)}$+=m(v,!0,!1)}return I&&($+="?",$+=m(I,!1,!1)),x&&($+="#",$+=E?x:D(x,!1,!1)),$}function L(w){try{return decodeURIComponent(w)}catch{return w.length>3?w.substr(0,3)+L(w.substr(3)):w}}const H=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function ee(w){return w.match(H)?w.replace(H,E=>L(E)):w}var te=r(975);const $e=te.posix||te,be="/";var Re;(function(w){w.joinPath=function(E,...m){return E.with({path:$e.join(E.path,...m)})},w.resolvePath=function(E,...m){let $=E.path,y=!1;$[0]!==be&&($=be+$,y=!0);let T=$e.resolve($,...m);return y&&T[0]===be&&!E.authority&&(T=T.substring(1)),E.with({path:T})},w.dirname=function(E){if(E.path.length===0||E.path===be)return E;let m=$e.dirname(E.path);return m.length===1&&m.charCodeAt(0)===46&&(m=""),E.with({path:m})},w.basename=function(E){return $e.basename(E.path)},w.extname=function(E){return $e.extname(E.path)}})(Re||(Re={})),Qh=n})();const{URI:gt,Utils:mi}=Qh;var et;(function(t){t.basename=mi.basename,t.dirname=mi.dirname,t.extname=mi.extname,t.joinPath=mi.joinPath,t.resolvePath=mi.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"?gt.parse(s).path:s.path,c=typeof o=="string"?gt.parse(o).path:o.path,f=l.split("/").filter(k=>k.length>0),h=c.split("/").filter(k=>k.length>0);if(e){const k=/^[A-Z]:$/;if(f[0]&&k.test(f[0])&&(f[0]=f[0].toLowerCase()),h[0]&&k.test(h[0])&&(h[0]=h[0].toLowerCase()),f[0]!==h[0])return c.substring(1)}let p=0;for(;p<f.length&&f[p]===h[p];p++);const g="../".repeat(f.length-p),C=h.slice(p).join("/");return g+C}t.relative=n;function i(s){return gt.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})(et||(et={}));class SR{constructor(){this.root={name:"",children:new Map}}normalizeUri(e){return et.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:et.joinPath(gt.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:et.joinPath(gt.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(et.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 W;(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"})(W||(W={}));class wR{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=fe.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??gt.parse(e.uri),fe.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return fe.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:W.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:W.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=W.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=ic.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}}class kR{constructor(e){this.documentTrie=new SR,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return ce(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,W.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=W.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=W.Changed;return this.documentTrie.delete(r),n}}const Ur=Symbol("RefResolving");class bR{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=fe.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 Be(r),ts(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 Be(r),ts(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=Ur;try{const i=this.getCandidate(e);if(ci(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=Ur;try{const i=this.getCandidates(e),a=[];if(ci(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(je(this._ref))return this._ref;if(Jp(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=Ur;const o=Ga(e).$document,l=a.getLinkedNode({reference:s,container:e,property:r});if(l.error&&o&&o.state<W.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===Ur&&a.throwCyclicReferenceError(e,r,i);return je(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return ci(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=Ur;const o=Ga(e).$document,l=a.getCandidates({reference:s,container:e,property:r}),c=[];if(ci(l))this._linkingError=l;else for(const f of l){const h=a.loadAstNode(f);h&&c.push({ref:h,$nodeDescription:f})}this._items=c,o==null||o.references.push(this)}else this._items===Ur&&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(ci(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=Ga(e.container).$document;n&&n.state<W.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 NR(t){return typeof t.name=="string"}class _R{getName(e){if(NR(e))return e.name}getNameNode(e){return Bd(e.$cstNode,"name")}}class IR{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=>Ps(r)&&r.isMulti)}findDeclarations(e){if(e){const r=Um(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(pt(i)||rr(i))return Jc(i);if(Array.isArray(i)){for(const a of i)if((pt(a)||rr(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return Jc(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||Rm(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 ts(n))if(rr(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=>et.equals(a.sourceUri,r.documentUri))),n.push(...i),ce(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:ns(a),local:!0})}}return n}}class Bi{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return Io.sum(ce(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?ce(r):Pd}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 ce(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return ce(this.map.keys())}values(){return ce(this.map.values()).flat()}entriesGroupedByKey(){return ce(this.map.entries())}}class ju{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 PR{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=fe.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=wc,i=fe.None){const a=[];this.addExportedSymbol(e,a,r);for(const s of n(e))await Be(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=fe.None){const n=e.parseResult.value,i=new Bi;for(const a of Hi(n))await Be(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 zu{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 OR{constructor(e,r,n){this.elements=new Bi,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?ce(n).concat(this.outerScope.getElements(e)):ce(n)}getAllElements(){let e=ce(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class ep{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 LR extends ep{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 xR extends ep{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 DR extends LR{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 MR{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 DR(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 zu(ce(e),r,n)}createScopeForNodes(e,r,n){const i=ce(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new zu(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new OR(this.indexManager.allElements(e)))}}function FR(t){return typeof t.$comment=="string"}function Uu(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class GR{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,f;if(!this.ignoreProperties.has(e))if(pt(r)){const h=r.ref,p=n?r.$refText:void 0;if(h){const g=jt(h);let C="";this.currentDocument&&this.currentDocument!==g&&(o?C=o(g.uri,h):C=g.uri.toString());const k=this.astNodeLocator.getAstNodePath(h);return{$ref:`${C}#${k}`,$refText:p}}else return{$error:((l=r.error)==null?void 0:l.message)??"Could not resolve reference",$refText:p}}else if(rr(r)){const h=n?r.$refText:void 0,p=[];for(const g of r.items){const C=g.ref,k=jt(g.ref);let D="";this.currentDocument&&this.currentDocument!==k&&(o?D=o(k.uri,C):D=k.uri.toString());const b=this.astNodeLocator.getAstNodePath(C);p.push(`${D}#${b}`)}return{$refs:p,$refText:h}}else if(je(r)){let h;if(a&&(h=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&(h!=null&&h.$textRegion)&&(h.$textRegion.documentURI=(c=this.currentDocument)==null?void 0:c.uri.toString())),i&&!e&&(h??(h={...r}),h.$sourceText=(f=r.$cstNode)==null?void 0:f.text),s){h??(h={...r});const p=this.commentProvider.getComment(r);p&&(h.$comment=p.replace(/\r/g,""))}return h??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=Gm(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 f=0;f<c.length;f++){const h=c[f];Uu(h)?c[f]=this.reviveReference(e,l,r,h,n):je(h)&&this.linkNode(h,r,n,e,l,f)}else Uu(c)?e[l]=this.reviveReference(e,l,r,c,n):je(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(je(c))return s||(s=this.nameProvider.getName(c)),{$refText:s??"",ref:c};o=c}else if(i.$refs){const c=[];for(const f of i.$refs){const h=this.getRefNode(n,f,a.uriConverter);je(h)&&c.push({ref:h})}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):gt.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)):gt.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 jR{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=et.extname(e),i=et.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 sc;(function(t){t.defaults=["fast","slow","built-in"],t.all=t.defaults})(sc||(sc={}));class zR{constructor(e){this.entries=new Bi,this.knownCategories=new Set(sc.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 Yi()}}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(Bs(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=ce(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 UR=Object.freeze({validateNode:!0,validateChildren:!0});class BR{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=fe.None){const i=e.parseResult,a=[];if(await Be(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)===ht.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ht.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ht.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(Bs(s))throw s;console.error("An error occurred during validation:",s)}return await Be(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:go(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:KR(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=jo(i.token);if(a){const s={severity:go("error"),range:a,message:i.message,data:bi(ht.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:ht.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=fe.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=fe.None){const a=this.validationRegistry.checksBefore;for(const s of a)await Be(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=fe.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 f=this.validationRegistry.getChecks(l.$type,r.categories);for(const h of f)await h(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 Be(i);const l=this.validateSingleNodeOptions(o,r);if(l.validateNode){const c=this.validationRegistry.getChecks(o.$type,r.categories);for(const f of c)await f(o,n,i)}l.validateChildren||s.prune()}}}validateSingleNodeOptions(e,r){return UR}async validateAstAfter(e,r,n,i=fe.None){const a=this.validationRegistry.checksAfter;for(const s of a)await Be(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:WR(n),severity:go(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 WR(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=Bd(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=jm(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function go(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 KR(t){switch(t){case"error":return bi(ht.LexingError);case"warning":return bi(ht.LexingWarning);case"info":return bi(ht.LexingInfo);case"hint":return bi(ht.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var ht;(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"})(ht||(ht={}));class VR{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=ns(this.nameProvider.getNameNode(e)??e.$cstNode));return{node:e,name:r,get nameSegment(){return o()},selectionSegment:ns(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}}class qR{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=fe.None){const n=[],i=e.parseResult.value;for(const a of zt(i))await Be(r),ts(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=[];pt(r)&&r.$nodeDescription?n=[r.$nodeDescription]:rr(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=ns(r.$refNode);for(const l of n)s.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:et.equals(l.documentUri,i)});return s}}class HR{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)}}class XR{constructor(e){this._ready=new Kc,this.onConfigurationSectionUpdateEmitter=new Yh,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 Ni={},Mr={},Vc={},$s={},G={};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 Sr=we;var oc;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(oc||(G.ErrorCodes=oc={}));class qc extends Error{constructor(e,r,n){super(r),this.code=Sr.number(e)?e:oc.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,qc.prototype)}toJson(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}}G.ResponseError=qc;class ze{constructor(e){this.kind=e}static is(e){return e===ze.auto||e===ze.byName||e===ze.byPosition}toString(){return this.kind}}G.ParameterStructures=ze;ze.auto=new ze("auto");ze.byPosition=new ze("byPosition");ze.byName=new ze("byName");class de{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return ze.auto}}G.AbstractMessageSignature=de;class YR extends de{constructor(e){super(e,0)}}G.RequestType0=YR;class JR extends de{constructor(e,r=ze.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}}G.RequestType=JR;class ZR extends de{constructor(e,r=ze.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}}G.RequestType1=ZR;class QR extends de{constructor(e){super(e,2)}}G.RequestType2=QR;class ev extends de{constructor(e){super(e,3)}}G.RequestType3=ev;class tv extends de{constructor(e){super(e,4)}}G.RequestType4=tv;class rv extends de{constructor(e){super(e,5)}}G.RequestType5=rv;class nv extends de{constructor(e){super(e,6)}}G.RequestType6=nv;class iv extends de{constructor(e){super(e,7)}}G.RequestType7=iv;class av extends de{constructor(e){super(e,8)}}G.RequestType8=av;class sv extends de{constructor(e){super(e,9)}}G.RequestType9=sv;class ov extends de{constructor(e,r=ze.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}}G.NotificationType=ov;class lv extends de{constructor(e){super(e,0)}}G.NotificationType0=lv;class cv extends de{constructor(e,r=ze.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}}G.NotificationType1=cv;class uv extends de{constructor(e){super(e,2)}}G.NotificationType2=uv;class fv extends de{constructor(e){super(e,3)}}G.NotificationType3=fv;class dv extends de{constructor(e){super(e,4)}}G.NotificationType4=dv;class hv extends de{constructor(e){super(e,5)}}G.NotificationType5=hv;class pv extends de{constructor(e){super(e,6)}}G.NotificationType6=pv;class mv extends de{constructor(e){super(e,7)}}G.NotificationType7=mv;class gv extends de{constructor(e){super(e,8)}}G.NotificationType8=gv;class yv extends de{constructor(e){super(e,9)}}G.NotificationType9=yv;var Bu;(function(t){function e(i){const a=i;return a&&Sr.string(a.method)&&(Sr.string(a.id)||Sr.number(a.id))}t.isRequest=e;function r(i){const a=i;return a&&Sr.string(a.method)&&i.id===void 0}t.isNotification=r;function n(i){const a=i;return a&&(a.result!==void 0||!!a.error)&&(Sr.string(a.id)||Sr.number(a.id)||a.id===null)}t.isResponse=n})(Bu||(G.Message=Bu={}));var Bt={},Wu;Object.defineProperty(Bt,"__esModule",{value:!0});Bt.LRUCache=Bt.LinkedMap=Bt.Touch=void 0;var Fe;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Fe||(Bt.Touch=Fe={}));class tp{constructor(){this[Wu]="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 e;return(e=this._head)==null?void 0:e.value}get last(){var e;return(e=this._tail)==null?void 0:e.value}has(e){return this._map.has(e)}get(e,r=Fe.None){const n=this._map.get(e);if(n)return r!==Fe.None&&this.touch(n,r),n.value}set(e,r,n=Fe.None){let i=this._map.get(e);if(i)i.value=r,n!==Fe.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case Fe.None:this.addItemLast(i);break;case Fe.First:this.addItemFirst(i);break;case Fe.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){const n=this._state;let i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){const e=this._state;let r=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){const i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){const e=this._state;let r=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){const i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){const e=this._state;let r=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){const i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(Wu=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==Fe.First&&r!==Fe.Last)){if(r===Fe.First){if(e===this._head)return;const n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===Fe.Last){if(e===this._tail)return;const n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(const[r,n]of e)this.set(r,n)}}Bt.LinkedMap=tp;class Tv extends tp{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=Fe.AsNew){return super.get(e,r)}peek(e){return super.get(e,Fe.None)}set(e,r){return super.set(e,r,Fe.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}Bt.LRUCache=Tv;var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.Disposable=void 0;var Ku;(function(t){function e(r){return{dispose:r}}t.create=e})(Ku||(Ws.Disposable=Ku={}));var Dn={};Object.defineProperty(Dn,"__esModule",{value:!0});Dn.SharedArrayReceiverStrategy=Dn.SharedArraySenderStrategy=void 0;const Rv=hr;var Wi;(function(t){t.Continue=0,t.Cancelled=1})(Wi||(Wi={}));class vv{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;const r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=Wi.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){const n=this.buffers.get(r);if(n===void 0)return;const i=new Int32Array(n,0,1);Atomics.store(i,0,Wi.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}}Dn.SharedArraySenderStrategy=vv;class Ev{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Wi.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class Av{constructor(e){this.token=new Ev(e)}cancel(){}dispose(){}}class $v{constructor(){this.kind="request"}createCancellationTokenSource(e){const r=e.$cancellationData;return r===void 0?new Rv.CancellationTokenSource:new Av(r)}}Dn.SharedArrayReceiverStrategy=$v;var nr={},ra={};Object.defineProperty(ra,"__esModule",{value:!0});ra.Semaphore=void 0;const Cv=Ht;class Sv{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,Cv.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}}ra.Semaphore=Sv;Object.defineProperty(nr,"__esModule",{value:!0});nr.ReadableStreamMessageReader=nr.AbstractMessageReader=nr.MessageReader=void 0;const lc=Ht,en=we,yo=Ct,wv=ra;var Vu;(function(t){function e(r){let n=r;return n&&en.func(n.listen)&&en.func(n.dispose)&&en.func(n.onError)&&en.func(n.onClose)&&en.func(n.onPartialMessage)}t.is=e})(Vu||(nr.MessageReader=Vu={}));class rp{constructor(){this.errorEmitter=new yo.Emitter,this.closeEmitter=new yo.Emitter,this.partialMessageEmitter=new yo.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${en.string(e.message)?e.message:"unknown"}`)}}nr.AbstractMessageReader=rp;var cc;(function(t){function e(r){let n,i;const a=new Map;let s;const o=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(i=r.contentDecoder,a.set(i.name,i)),r.contentDecoders!==void 0)for(const l of r.contentDecoders)a.set(l.name,l);if(r.contentTypeDecoder!==void 0&&(s=r.contentTypeDecoder,o.set(s.name,s)),r.contentTypeDecoders!==void 0)for(const l of r.contentTypeDecoders)o.set(l.name,l)}return s===void 0&&(s=(0,lc.default)().applicationJson.decoder,o.set(s.name,s)),{charset:n,contentDecoder:i,contentDecoders:a,contentTypeDecoder:s,contentTypeDecoders:o}}t.fromOptions=e})(cc||(cc={}));class kv extends rp{constructor(e,r){super(),this.readable=e,this.options=cc.fromOptions(r),this.buffer=(0,lc.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new wv.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;const r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){const n=this.buffer.tryReadHeaders(!0);if(!n)return;const i=n.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
122
+ ${JSON.stringify(Object.fromEntries(n))}`));return}const a=parseInt(i);if(isNaN(a)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=a}const r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,i=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(i)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,lc.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}nr.ReadableStreamMessageReader=kv;var ir={};Object.defineProperty(ir,"__esModule",{value:!0});ir.WriteableStreamMessageWriter=ir.AbstractMessageWriter=ir.MessageWriter=void 0;const qu=Ht,_i=we,bv=ra,Hu=Ct,Nv="Content-Length: ",Xu=`\r
123
+ `;var Yu;(function(t){function e(r){let n=r;return n&&_i.func(n.dispose)&&_i.func(n.onClose)&&_i.func(n.onError)&&_i.func(n.write)}t.is=e})(Yu||(ir.MessageWriter=Yu={}));class np{constructor(){this.errorEmitter=new Hu.Emitter,this.closeEmitter=new Hu.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${_i.string(e.message)?e.message:"unknown"}`)}}ir.AbstractMessageWriter=np;var uc;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,qu.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,qu.default)().applicationJson.encoder}}t.fromOptions=e})(uc||(uc={}));class _v extends np{constructor(e,r){super(),this.writable=e,this.options=uc.fromOptions(r),this.errorCount=0,this.writeSemaphore=new bv.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{const i=[];return i.push(Nv,n.byteLength.toString(),Xu),i.push(Xu),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}}ir.WriteableStreamMessageWriter=_v;var Ks={};Object.defineProperty(Ks,"__esModule",{value:!0});Ks.AbstractMessageBuffer=void 0;const Iv=13,Pv=10,Ov=`\r
124
+ `;class Lv{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){const r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,i=0,a=0;e:for(;n<this._chunks.length;){const c=this._chunks[n];for(i=0;i<c.length;){switch(c[i]){case Iv:switch(r){case 0:r=1;break;case 2:r=3;break;default:r=0}break;case Pv:switch(r){case 1:r=2;break;case 3:r=4,i++;break e;default:r=0}break;default:r=0}i++}a+=c.byteLength,n++}if(r!==4)return;const s=this._read(a+i),o=new Map,l=this.toString(s,"ascii").split(Ov);if(l.length<2)return o;for(let c=0;c<l.length-2;c++){const f=l[c],h=f.indexOf(":");if(h===-1)throw new Error(`Message header must separate key and value using ':'
125
+ ${f}`);const p=f.substr(0,h),g=f.substr(h+1).trim();o.set(e?p.toLowerCase():p,g)}return o}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const a=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(a)}if(this._chunks[0].byteLength>e){const a=this._chunks[0],s=this.asNative(a,e);return this._chunks[0]=a.slice(e),this._totalLength-=e,s}const r=this.allocNative(e);let n=0,i=0;for(;e>0;){const a=this._chunks[i];if(a.byteLength>e){const s=a.slice(0,e);r.set(s,n),n+=e,this._chunks[i]=a.slice(e),this._totalLength-=e,e-=e}else r.set(a,n),n+=a.byteLength,this._chunks.shift(),this._totalLength-=a.byteLength,e-=a.byteLength}return r}}Ks.AbstractMessageBuffer=Lv;var ip={};(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=Ht,r=we,n=G,i=Bt,a=Ct,s=hr;var o;(function(m){m.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(m){function $(y){return typeof y=="string"||typeof y=="number"}m.is=$})(l||(t.ProgressToken=l={}));var c;(function(m){m.type=new n.NotificationType("$/progress")})(c||(c={}));class f{constructor(){}}t.ProgressType=f;var h;(function(m){function $(y){return r.func(y)}m.is=$})(h||(h={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var p;(function(m){m[m.Off=0]="Off",m[m.Messages=1]="Messages",m[m.Compact=2]="Compact",m[m.Verbose=3]="Verbose"})(p||(t.Trace=p={}));var g;(function(m){m.Off="off",m.Messages="messages",m.Compact="compact",m.Verbose="verbose"})(g||(t.TraceValues=g={})),function(m){function $(T){if(!r.string(T))return m.Off;switch(T=T.toLowerCase(),T){case"off":return m.Off;case"messages":return m.Messages;case"compact":return m.Compact;case"verbose":return m.Verbose;default:return m.Off}}m.fromString=$;function y(T){switch(T){case m.Off:return"off";case m.Messages:return"messages";case m.Compact:return"compact";case m.Verbose:return"verbose";default:return"off"}}m.toString=y}(p||(t.Trace=p={}));var C;(function(m){m.Text="text",m.JSON="json"})(C||(t.TraceFormat=C={})),function(m){function $(y){return r.string(y)?(y=y.toLowerCase(),y==="json"?m.JSON:m.Text):m.Text}m.fromString=$}(C||(t.TraceFormat=C={}));var k;(function(m){m.type=new n.NotificationType("$/setTrace")})(k||(t.SetTraceNotification=k={}));var D;(function(m){m.type=new n.NotificationType("$/logTrace")})(D||(t.LogTraceNotification=D={}));var b;(function(m){m[m.Closed=1]="Closed",m[m.Disposed=2]="Disposed",m[m.AlreadyListening=3]="AlreadyListening"})(b||(t.ConnectionErrors=b={}));class O extends Error{constructor($,y){super(y),this.code=$,Object.setPrototypeOf(this,O.prototype)}}t.ConnectionError=O;var N;(function(m){function $(y){const T=y;return T&&r.func(T.cancelUndispatched)}m.is=$})(N||(t.ConnectionStrategy=N={}));var L;(function(m){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))}m.is=$})(L||(t.IdCancellationReceiverStrategy=L={}));var H;(function(m){function $(y){const T=y;return T&&T.kind==="request"&&r.func(T.createCancellationTokenSource)&&(T.dispose===void 0||r.func(T.dispose))}m.is=$})(H||(t.RequestCancellationReceiverStrategy=H={}));var ee;(function(m){m.Message=Object.freeze({createCancellationTokenSource(y){return new s.CancellationTokenSource}});function $(y){return L.is(y)||H.is(y)}m.is=$})(ee||(t.CancellationReceiverStrategy=ee={}));var te;(function(m){m.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)}m.is=$})(te||(t.CancellationSenderStrategy=te={}));var $e;(function(m){m.Message=Object.freeze({receiver:ee.Message,sender:te.Message});function $(y){const T=y;return T&&ee.is(T.receiver)&&te.is(T.sender)}m.is=$})($e||(t.CancellationStrategy=$e={}));var be;(function(m){function $(y){const T=y;return T&&r.func(T.handleMessage)}m.is=$})(be||(t.MessageStrategy=be={}));var Re;(function(m){function $(y){const T=y;return T&&($e.is(T.cancellationStrategy)||N.is(T.connectionStrategy)||be.is(T.messageStrategy))}m.is=$})(Re||(t.ConnectionOptions=Re={}));var w;(function(m){m[m.New=1]="New",m[m.Listening=2]="Listening",m[m.Closed=3]="Closed",m[m.Disposed=4]="Disposed"})(w||(w={}));function E(m,$,y,T){const v=y!==void 0?y:t.NullLogger;let I=0,x=0,P=0;const j="2.0";let F;const re=new Map;let z;const Z=new Map,Pe=new Map;let he,oe=new i.LinkedMap,Ne=new Map,Oe=new Set,Ce=new Map,X=p.Off,Je=C.Text,pe,lt=w.New;const Fr=new a.Emitter,Zn=new a.Emitter,Qn=new a.Emitter,ei=new a.Emitter,ti=new a.Emitter,ct=T&&T.cancellationStrategy?T.cancellationStrategy:$e.Message;function ri(d){if(d===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+d.toString()}function na(d){return d===null?"res-unknown-"+(++P).toString():"res-"+d.toString()}function ia(){return"not-"+(++x).toString()}function aa(d,A){n.Message.isRequest(A)?d.set(ri(A.id),A):n.Message.isResponse(A)?d.set(na(A.id),A):d.set(ia(),A)}function sa(d){}function ni(){return lt===w.Listening}function ii(){return lt===w.Closed}function It(){return lt===w.Disposed}function ai(){(lt===w.New||lt===w.Listening)&&(lt=w.Closed,Zn.fire(void 0))}function oa(d){Fr.fire([d,void 0,void 0])}function la(d){Fr.fire(d)}m.onClose(ai),m.onError(oa),$.onClose(ai),$.onError(la);function si(){he||oe.size===0||(he=(0,e.default)().timer.setImmediate(()=>{he=void 0,ca()}))}function oi(d){n.Message.isRequest(d)?fa(d):n.Message.isNotification(d)?ha(d):n.Message.isResponse(d)?da(d):pa(d)}function ca(){if(oe.size===0)return;const d=oe.shift();try{const A=T==null?void 0:T.messageStrategy;be.is(A)?A.handleMessage(d,oi):oi(d)}finally{si()}}const ua=d=>{try{if(n.Message.isNotification(d)&&d.method===o.type.method){const A=d.params.id,_=ri(A),M=oe.get(_);if(n.Message.isRequest(M)){const ne=T==null?void 0:T.connectionStrategy,ie=ne&&ne.cancelUndispatched?ne.cancelUndispatched(M,sa):void 0;if(ie&&(ie.error!==void 0||ie.result!==void 0)){oe.delete(_),Ce.delete(A),ie.id=M.id,gr(ie,d.method,Date.now()),$.write(ie).catch(()=>v.error("Sending response for canceled message failed."));return}}const ae=Ce.get(A);if(ae!==void 0){ae.cancel(),Gr(d);return}else Oe.add(A)}aa(oe,d)}finally{si()}};function fa(d){if(It())return;function A(q,le,Q){const _e={jsonrpc:j,id:d.id};q instanceof n.ResponseError?_e.error=q.toJson():_e.result=q===void 0?null:q,gr(_e,le,Q),$.write(_e).catch(()=>v.error("Sending response failed."))}function _(q,le,Q){const _e={jsonrpc:j,id:d.id,error:q.toJson()};gr(_e,le,Q),$.write(_e).catch(()=>v.error("Sending response failed."))}function M(q,le,Q){q===void 0&&(q=null);const _e={jsonrpc:j,id:d.id,result:q};gr(_e,le,Q),$.write(_e).catch(()=>v.error("Sending response failed."))}ya(d);const ae=re.get(d.method);let ne,ie;ae&&(ne=ae.type,ie=ae.handler);const Ae=Date.now();if(ie||F){const q=d.id??String(Date.now()),le=L.is(ct.receiver)?ct.receiver.createCancellationTokenSource(q):ct.receiver.createCancellationTokenSource(d);d.id!==null&&Oe.has(d.id)&&le.cancel(),d.id!==null&&Ce.set(q,le);try{let Q;if(ie)if(d.params===void 0){if(ne!==void 0&&ne.numberOfParams!==0){_(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${d.method} defines ${ne.numberOfParams} params but received none.`),d.method,Ae);return}Q=ie(le.token)}else if(Array.isArray(d.params)){if(ne!==void 0&&ne.parameterStructures===n.ParameterStructures.byName){_(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${d.method} defines parameters by name but received parameters by position`),d.method,Ae);return}Q=ie(...d.params,le.token)}else{if(ne!==void 0&&ne.parameterStructures===n.ParameterStructures.byPosition){_(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${d.method} defines parameters by position but received parameters by name`),d.method,Ae);return}Q=ie(d.params,le.token)}else F&&(Q=F(d.method,d.params,le.token));const _e=Q;Q?_e.then?_e.then(Ue=>{Ce.delete(q),A(Ue,d.method,Ae)},Ue=>{Ce.delete(q),Ue instanceof n.ResponseError?_(Ue,d.method,Ae):Ue&&r.string(Ue.message)?_(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${d.method} failed with message: ${Ue.message}`),d.method,Ae):_(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${d.method} failed unexpectedly without providing any details.`),d.method,Ae)}):(Ce.delete(q),A(Q,d.method,Ae)):(Ce.delete(q),M(Q,d.method,Ae))}catch(Q){Ce.delete(q),Q instanceof n.ResponseError?A(Q,d.method,Ae):Q&&r.string(Q.message)?_(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${d.method} failed with message: ${Q.message}`),d.method,Ae):_(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${d.method} failed unexpectedly without providing any details.`),d.method,Ae)}}else _(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${d.method}`),d.method,Ae)}function da(d){if(!It())if(d.id===null)d.error?v.error(`Received response message without id: Error is:
126
+ ${JSON.stringify(d.error,void 0,4)}`):v.error("Received response message without id. No further error information provided.");else{const A=d.id,_=Ne.get(A);if(Ta(d,_),_!==void 0){Ne.delete(A);try{if(d.error){const M=d.error;_.reject(new n.ResponseError(M.code,M.message,M.data))}else if(d.result!==void 0)_.resolve(d.result);else throw new Error("Should never happen.")}catch(M){M.message?v.error(`Response handler '${_.method}' failed with message: ${M.message}`):v.error(`Response handler '${_.method}' failed unexpectedly.`)}}}}function ha(d){if(It())return;let A,_;if(d.method===o.type.method){const M=d.params.id;Oe.delete(M),Gr(d);return}else{const M=Z.get(d.method);M&&(_=M.handler,A=M.type)}if(_||z)try{if(Gr(d),_)if(d.params===void 0)A!==void 0&&A.numberOfParams!==0&&A.parameterStructures!==n.ParameterStructures.byName&&v.error(`Notification ${d.method} defines ${A.numberOfParams} params but received none.`),_();else if(Array.isArray(d.params)){const M=d.params;d.method===c.type.method&&M.length===2&&l.is(M[0])?_({token:M[0],value:M[1]}):(A!==void 0&&(A.parameterStructures===n.ParameterStructures.byName&&v.error(`Notification ${d.method} defines parameters by name but received parameters by position`),A.numberOfParams!==d.params.length&&v.error(`Notification ${d.method} defines ${A.numberOfParams} params but received ${M.length} arguments`)),_(...M))}else A!==void 0&&A.parameterStructures===n.ParameterStructures.byPosition&&v.error(`Notification ${d.method} defines parameters by position but received parameters by name`),_(d.params);else z&&z(d.method,d.params)}catch(M){M.message?v.error(`Notification handler '${d.method}' failed with message: ${M.message}`):v.error(`Notification handler '${d.method}' failed unexpectedly.`)}else Qn.fire(d)}function pa(d){if(!d){v.error("Received empty message.");return}v.error(`Received message which is neither a response nor a notification message:
127
+ ${JSON.stringify(d,null,4)}`);const A=d;if(r.string(A.id)||r.number(A.id)){const _=A.id,M=Ne.get(_);M&&M.reject(new Error("The received response has neither a result nor an error property."))}}function ut(d){if(d!=null)switch(X){case p.Verbose:return JSON.stringify(d,null,4);case p.Compact:return JSON.stringify(d);default:return}}function ma(d){if(!(X===p.Off||!pe))if(Je===C.Text){let A;(X===p.Verbose||X===p.Compact)&&d.params&&(A=`Params: ${ut(d.params)}
128
+
129
+ `),pe.log(`Sending request '${d.method} - (${d.id})'.`,A)}else Pt("send-request",d)}function ga(d){if(!(X===p.Off||!pe))if(Je===C.Text){let A;(X===p.Verbose||X===p.Compact)&&(d.params?A=`Params: ${ut(d.params)}
130
+
131
+ `:A=`No parameters provided.
132
+
133
+ `),pe.log(`Sending notification '${d.method}'.`,A)}else Pt("send-notification",d)}function gr(d,A,_){if(!(X===p.Off||!pe))if(Je===C.Text){let M;(X===p.Verbose||X===p.Compact)&&(d.error&&d.error.data?M=`Error data: ${ut(d.error.data)}
134
+
135
+ `:d.result?M=`Result: ${ut(d.result)}
136
+
137
+ `:d.error===void 0&&(M=`No result returned.
138
+
139
+ `)),pe.log(`Sending response '${A} - (${d.id})'. Processing request took ${Date.now()-_}ms`,M)}else Pt("send-response",d)}function ya(d){if(!(X===p.Off||!pe))if(Je===C.Text){let A;(X===p.Verbose||X===p.Compact)&&d.params&&(A=`Params: ${ut(d.params)}
140
+
141
+ `),pe.log(`Received request '${d.method} - (${d.id})'.`,A)}else Pt("receive-request",d)}function Gr(d){if(!(X===p.Off||!pe||d.method===D.type.method))if(Je===C.Text){let A;(X===p.Verbose||X===p.Compact)&&(d.params?A=`Params: ${ut(d.params)}
142
+
143
+ `:A=`No parameters provided.
144
+
145
+ `),pe.log(`Received notification '${d.method}'.`,A)}else Pt("receive-notification",d)}function Ta(d,A){if(!(X===p.Off||!pe))if(Je===C.Text){let _;if((X===p.Verbose||X===p.Compact)&&(d.error&&d.error.data?_=`Error data: ${ut(d.error.data)}
146
+
147
+ `:d.result?_=`Result: ${ut(d.result)}
148
+
149
+ `:d.error===void 0&&(_=`No result returned.
150
+
151
+ `)),A){const M=d.error?` Request failed: ${d.error.message} (${d.error.code}).`:"";pe.log(`Received response '${A.method} - (${d.id})' in ${Date.now()-A.timerStart}ms.${M}`,_)}else pe.log(`Received response ${d.id} without active response promise.`,_)}else Pt("receive-response",d)}function Pt(d,A){if(!pe||X===p.Off)return;const _={isLSPMessage:!0,type:d,message:A,timestamp:Date.now()};pe.log(_)}function Zt(){if(ii())throw new O(b.Closed,"Connection is closed.");if(It())throw new O(b.Disposed,"Connection is disposed.")}function Ra(){if(ni())throw new O(b.AlreadyListening,"Connection is already listening")}function va(){if(!ni())throw new Error("Call listen() first.")}function Qt(d){return d===void 0?null:d}function li(d){if(d!==null)return d}function u(d){return d!=null&&!Array.isArray(d)&&typeof d=="object"}function ve(d,A){switch(d){case n.ParameterStructures.auto:return u(A)?li(A):[Qt(A)];case n.ParameterStructures.byName:if(!u(A))throw new Error("Received parameters by name but param is not an object literal.");return li(A);case n.ParameterStructures.byPosition:return[Qt(A)];default:throw new Error(`Unknown parameter structure ${d.toString()}`)}}function Ee(d,A){let _;const M=d.numberOfParams;switch(M){case 0:_=void 0;break;case 1:_=ve(d.parameterStructures,A[0]);break;default:_=[];for(let ae=0;ae<A.length&&ae<M;ae++)_.push(Qt(A[ae]));if(A.length<M)for(let ae=A.length;ae<M;ae++)_.push(null);break}return _}const B={sendNotification:(d,...A)=>{Zt();let _,M;if(r.string(d)){_=d;const ne=A[0];let ie=0,Ae=n.ParameterStructures.auto;n.ParameterStructures.is(ne)&&(ie=1,Ae=ne);let q=A.length;const le=q-ie;switch(le){case 0:M=void 0;break;case 1:M=ve(Ae,A[ie]);break;default:if(Ae===n.ParameterStructures.byName)throw new Error(`Received ${le} parameters for 'by Name' notification parameter structure.`);M=A.slice(ie,q).map(Q=>Qt(Q));break}}else{const ne=A;_=d.method,M=Ee(d,ne)}const ae={jsonrpc:j,method:_,params:M};return ga(ae),$.write(ae).catch(ne=>{throw v.error("Sending notification failed."),ne})},onNotification:(d,A)=>{Zt();let _;return r.func(d)?z=d:A&&(r.string(d)?(_=d,Z.set(d,{type:void 0,handler:A})):(_=d.method,Z.set(d.method,{type:d,handler:A}))),{dispose:()=>{_!==void 0?Z.delete(_):z=void 0}}},onProgress:(d,A,_)=>{if(Pe.has(A))throw new Error(`Progress handler for token ${A} already registered`);return Pe.set(A,_),{dispose:()=>{Pe.delete(A)}}},sendProgress:(d,A,_)=>B.sendNotification(c.type,{token:A,value:_}),onUnhandledProgress:ei.event,sendRequest:(d,...A)=>{Zt(),va();let _,M,ae;if(r.string(d)){_=d;const q=A[0],le=A[A.length-1];let Q=0,_e=n.ParameterStructures.auto;n.ParameterStructures.is(q)&&(Q=1,_e=q);let Ue=A.length;s.CancellationToken.is(le)&&(Ue=Ue-1,ae=le);const yt=Ue-Q;switch(yt){case 0:M=void 0;break;case 1:M=ve(_e,A[Q]);break;default:if(_e===n.ParameterStructures.byName)throw new Error(`Received ${yt} parameters for 'by Name' request parameter structure.`);M=A.slice(Q,Ue).map(Fp=>Qt(Fp));break}}else{const q=A;_=d.method,M=Ee(d,q);const le=d.numberOfParams;ae=s.CancellationToken.is(q[le])?q[le]:void 0}const ne=I++;let ie;ae&&(ie=ae.onCancellationRequested(()=>{const q=ct.sender.sendCancellation(B,ne);return q===void 0?(v.log(`Received no promise from cancellation strategy when cancelling id ${ne}`),Promise.resolve()):q.catch(()=>{v.log(`Sending cancellation messages for id ${ne} failed`)})}));const Ae={jsonrpc:j,id:ne,method:_,params:M};return ma(Ae),typeof ct.sender.enableCancellation=="function"&&ct.sender.enableCancellation(Ae),new Promise(async(q,le)=>{const Q=yt=>{q(yt),ct.sender.cleanup(ne),ie==null||ie.dispose()},_e=yt=>{le(yt),ct.sender.cleanup(ne),ie==null||ie.dispose()},Ue={method:_,timerStart:Date.now(),resolve:Q,reject:_e};try{await $.write(Ae),Ne.set(ne,Ue)}catch(yt){throw v.error("Sending request failed."),Ue.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,yt.message?yt.message:"Unknown reason")),yt}})},onRequest:(d,A)=>{Zt();let _=null;return h.is(d)?(_=void 0,F=d):r.string(d)?(_=null,A!==void 0&&(_=d,re.set(d,{handler:A,type:void 0}))):A!==void 0&&(_=d.method,re.set(d.method,{type:d,handler:A})),{dispose:()=>{_!==null&&(_!==void 0?re.delete(_):F=void 0)}}},hasPendingResponse:()=>Ne.size>0,trace:async(d,A,_)=>{let M=!1,ae=C.Text;_!==void 0&&(r.boolean(_)?M=_:(M=_.sendNotification||!1,ae=_.traceFormat||C.Text)),X=d,Je=ae,X===p.Off?pe=void 0:pe=A,M&&!ii()&&!It()&&await B.sendNotification(k.type,{value:p.toString(d)})},onError:Fr.event,onClose:Zn.event,onUnhandledNotification:Qn.event,onDispose:ti.event,end:()=>{$.end()},dispose:()=>{if(It())return;lt=w.Disposed,ti.fire(void 0);const d=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const A of Ne.values())A.reject(d);Ne=new Map,Ce=new Map,Oe=new Set,oe=new i.LinkedMap,r.func($.dispose)&&$.dispose(),r.func(m.dispose)&&m.dispose()},listen:()=>{Zt(),Ra(),lt=w.Listening,m.listen(ua)},inspect:()=>{(0,e.default)().console.log("inspect")}};return B.onNotification(D.type,d=>{if(X===p.Off||!pe)return;const A=X===p.Verbose||X===p.Compact;pe.log(d.message,A?d.verbose:void 0)}),B.onNotification(c.type,d=>{const A=Pe.get(d.token);A?A(d.value):ei.fire(d)}),B}t.createMessageConnection=E})(ip);(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=G;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=Bt;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=Ws;Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return n.Disposable}});const i=Ct;Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const a=hr;Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return a.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return a.CancellationToken}});const s=Dn;Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return s.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return s.SharedArrayReceiverStrategy}});const o=nr;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=ir;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=Ks;Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return c.AbstractMessageBuffer}});const f=ip;Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return f.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return f.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return f.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return f.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return f.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return f.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return f.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return f.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return f.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return f.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return f.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return f.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return f.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return f.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return f.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return f.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:function(){return f.MessageStrategy}});const h=Ht;t.RAL=h.default})($s);Object.defineProperty(Vc,"__esModule",{value:!0});const At=$s;class Vs extends At.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return Vs.emptyBuffer}fromString(e,r){return new TextEncoder().encode(e)}toString(e,r){return r==="ascii"?this.asciiDecoder.decode(e):new TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e:e.slice(0,r)}allocNative(e){return new Uint8Array(e)}}Vs.emptyBuffer=new Uint8Array(0);class xv{constructor(e){this.socket=e,this._onData=new At.Emitter,this._messageListener=r=>{r.data.arrayBuffer().then(i=>{this._onData.fire(new Uint8Array(i))},()=>{(0,At.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),At.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),At.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),At.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}}class Dv{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),At.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),At.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),At.Disposable.create(()=>this.socket.removeEventListener("end",e))}write(e,r){if(typeof e=="string"){if(r!==void 0&&r!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${r}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}}const Mv=new TextEncoder,ap=Object.freeze({messageBuffer:Object.freeze({create:t=>new Vs(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{if(e.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${e.charset}`);return Promise.resolve(Mv.encode(JSON.stringify(t,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{if(!(t instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(e.charset).decode(t)))}})}),stream:Object.freeze({asReadableStream:t=>new xv(t),asWritableStream:t=>new Dv(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){const n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){const r=setTimeout(t,0,...e);return{dispose:()=>clearTimeout(r)}},setInterval(t,e,...r){const n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function fc(){return ap}(function(t){function e(){At.RAL.install(ap)}t.install=e})(fc||(fc={}));Vc.default=fc;(function(t){var e=at&&at.__createBinding||(Object.create?function(l,c,f,h){h===void 0&&(h=f);var p=Object.getOwnPropertyDescriptor(c,f);(!p||("get"in p?!c.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return c[f]}}),Object.defineProperty(l,h,p)}:function(l,c,f,h){h===void 0&&(h=f),l[h]=c[f]}),r=at&&at.__exportStar||function(l,c){for(var f in l)f!=="default"&&!Object.prototype.hasOwnProperty.call(c,f)&&e(c,l,f)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0,Vc.default.install();const i=$s;r($s,t);class a extends i.AbstractMessageReader{constructor(c){super(),this._onData=new i.Emitter,this._messageListener=f=>{this._onData.fire(f.data)},c.addEventListener("error",f=>this.fireError(f)),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",f=>this.fireError(f))}write(c){try{return this.port.postMessage(c),Promise.resolve()}catch(f){return this.handleError(f,c),Promise.reject(f)}}handleError(c,f){this.errorCount++,this.fireError(c,f,this.errorCount)}end(){}}t.BrowserMessageWriter=s;function o(l,c,f,h){return f===void 0&&(f=i.NullLogger),i.ConnectionStrategy.is(h)&&(h={connectionStrategy:h}),(0,i.createMessageConnection)(l,c,f,h)}t.createMessageConnection=o})(Mr);var Ju=Mr,sp={};const Hc=zp(WT);var K={};Object.defineProperty(K,"__esModule",{value:!0});K.ProtocolNotificationType=K.ProtocolNotificationType0=K.ProtocolRequestType=K.ProtocolRequestType0=K.RegistrationType=K.MessageDirection=void 0;const Mn=Mr;var Zu;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(Zu||(K.MessageDirection=Zu={}));class Fv{constructor(e){this.method=e}}K.RegistrationType=Fv;class Gv extends Mn.RequestType0{constructor(e){super(e)}}K.ProtocolRequestType0=Gv;class jv extends Mn.RequestType{constructor(e){super(e,Mn.ParameterStructures.byName)}}K.ProtocolRequestType=jv;class zv extends Mn.NotificationType0{constructor(e){super(e)}}K.ProtocolNotificationType0=zv;class Uv extends Mn.NotificationType{constructor(e){super(e,Mn.ParameterStructures.byName)}}K.ProtocolNotificationType=Uv;var op={},ge={};Object.defineProperty(ge,"__esModule",{value:!0});ge.objectLiteral=ge.typedArray=ge.stringArray=ge.array=ge.func=ge.error=ge.number=ge.string=ge.boolean=void 0;function Bv(t){return t===!0||t===!1}ge.boolean=Bv;function lp(t){return typeof t=="string"||t instanceof String}ge.string=lp;function Wv(t){return typeof t=="number"||t instanceof Number}ge.number=Wv;function Kv(t){return t instanceof Error}ge.error=Kv;function Vv(t){return typeof t=="function"}ge.func=Vv;function cp(t){return Array.isArray(t)}ge.array=cp;function qv(t){return cp(t)&&t.every(e=>lp(e))}ge.stringArray=qv;function Hv(t,e){return Array.isArray(t)&&t.every(e)}ge.typedArray=Hv;function Xv(t){return t!==null&&typeof t=="object"}ge.objectLiteral=Xv;var qs={};Object.defineProperty(qs,"__esModule",{value:!0});qs.ImplementationRequest=void 0;const Qu=K;var ef;(function(t){t.method="textDocument/implementation",t.messageDirection=Qu.MessageDirection.clientToServer,t.type=new Qu.ProtocolRequestType(t.method)})(ef||(qs.ImplementationRequest=ef={}));var Hs={};Object.defineProperty(Hs,"__esModule",{value:!0});Hs.TypeDefinitionRequest=void 0;const tf=K;var rf;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=tf.MessageDirection.clientToServer,t.type=new tf.ProtocolRequestType(t.method)})(rf||(Hs.TypeDefinitionRequest=rf={}));var Fn={};Object.defineProperty(Fn,"__esModule",{value:!0});Fn.DidChangeWorkspaceFoldersNotification=Fn.WorkspaceFoldersRequest=void 0;const Cs=K;var nf;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Cs.MessageDirection.serverToClient,t.type=new Cs.ProtocolRequestType0(t.method)})(nf||(Fn.WorkspaceFoldersRequest=nf={}));var af;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Cs.MessageDirection.clientToServer,t.type=new Cs.ProtocolNotificationType(t.method)})(af||(Fn.DidChangeWorkspaceFoldersNotification=af={}));var Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.ConfigurationRequest=void 0;const sf=K;var of;(function(t){t.method="workspace/configuration",t.messageDirection=sf.MessageDirection.serverToClient,t.type=new sf.ProtocolRequestType(t.method)})(of||(Xs.ConfigurationRequest=of={}));var Gn={};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.ColorPresentationRequest=Gn.DocumentColorRequest=void 0;const Ss=K;var lf;(function(t){t.method="textDocument/documentColor",t.messageDirection=Ss.MessageDirection.clientToServer,t.type=new Ss.ProtocolRequestType(t.method)})(lf||(Gn.DocumentColorRequest=lf={}));var cf;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Ss.MessageDirection.clientToServer,t.type=new Ss.ProtocolRequestType(t.method)})(cf||(Gn.ColorPresentationRequest=cf={}));var jn={};Object.defineProperty(jn,"__esModule",{value:!0});jn.FoldingRangeRefreshRequest=jn.FoldingRangeRequest=void 0;const ws=K;var uf;(function(t){t.method="textDocument/foldingRange",t.messageDirection=ws.MessageDirection.clientToServer,t.type=new ws.ProtocolRequestType(t.method)})(uf||(jn.FoldingRangeRequest=uf={}));var ff;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=ws.MessageDirection.serverToClient,t.type=new ws.ProtocolRequestType0(t.method)})(ff||(jn.FoldingRangeRefreshRequest=ff={}));var Ys={};Object.defineProperty(Ys,"__esModule",{value:!0});Ys.DeclarationRequest=void 0;const df=K;var hf;(function(t){t.method="textDocument/declaration",t.messageDirection=df.MessageDirection.clientToServer,t.type=new df.ProtocolRequestType(t.method)})(hf||(Ys.DeclarationRequest=hf={}));var Js={};Object.defineProperty(Js,"__esModule",{value:!0});Js.SelectionRangeRequest=void 0;const pf=K;var mf;(function(t){t.method="textDocument/selectionRange",t.messageDirection=pf.MessageDirection.clientToServer,t.type=new pf.ProtocolRequestType(t.method)})(mf||(Js.SelectionRangeRequest=mf={}));var ar={};Object.defineProperty(ar,"__esModule",{value:!0});ar.WorkDoneProgressCancelNotification=ar.WorkDoneProgressCreateRequest=ar.WorkDoneProgress=void 0;const Yv=Mr,ks=K;var gf;(function(t){t.type=new Yv.ProgressType;function e(r){return r===t.type}t.is=e})(gf||(ar.WorkDoneProgress=gf={}));var yf;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=ks.MessageDirection.serverToClient,t.type=new ks.ProtocolRequestType(t.method)})(yf||(ar.WorkDoneProgressCreateRequest=yf={}));var Tf;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=ks.MessageDirection.clientToServer,t.type=new ks.ProtocolNotificationType(t.method)})(Tf||(ar.WorkDoneProgressCancelNotification=Tf={}));var sr={};Object.defineProperty(sr,"__esModule",{value:!0});sr.CallHierarchyOutgoingCallsRequest=sr.CallHierarchyIncomingCallsRequest=sr.CallHierarchyPrepareRequest=void 0;const zn=K;var Rf;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=zn.MessageDirection.clientToServer,t.type=new zn.ProtocolRequestType(t.method)})(Rf||(sr.CallHierarchyPrepareRequest=Rf={}));var vf;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=zn.MessageDirection.clientToServer,t.type=new zn.ProtocolRequestType(t.method)})(vf||(sr.CallHierarchyIncomingCallsRequest=vf={}));var Ef;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=zn.MessageDirection.clientToServer,t.type=new zn.ProtocolRequestType(t.method)})(Ef||(sr.CallHierarchyOutgoingCallsRequest=Ef={}));var Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.SemanticTokensRefreshRequest=Ve.SemanticTokensRangeRequest=Ve.SemanticTokensDeltaRequest=Ve.SemanticTokensRequest=Ve.SemanticTokensRegistrationType=Ve.TokenFormat=void 0;const Kt=K;var Af;(function(t){t.Relative="relative"})(Af||(Ve.TokenFormat=Af={}));var Ki;(function(t){t.method="textDocument/semanticTokens",t.type=new Kt.RegistrationType(t.method)})(Ki||(Ve.SemanticTokensRegistrationType=Ki={}));var $f;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=Kt.MessageDirection.clientToServer,t.type=new Kt.ProtocolRequestType(t.method),t.registrationMethod=Ki.method})($f||(Ve.SemanticTokensRequest=$f={}));var Cf;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=Kt.MessageDirection.clientToServer,t.type=new Kt.ProtocolRequestType(t.method),t.registrationMethod=Ki.method})(Cf||(Ve.SemanticTokensDeltaRequest=Cf={}));var Sf;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=Kt.MessageDirection.clientToServer,t.type=new Kt.ProtocolRequestType(t.method),t.registrationMethod=Ki.method})(Sf||(Ve.SemanticTokensRangeRequest=Sf={}));var wf;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=Kt.MessageDirection.serverToClient,t.type=new Kt.ProtocolRequestType0(t.method)})(wf||(Ve.SemanticTokensRefreshRequest=wf={}));var Zs={};Object.defineProperty(Zs,"__esModule",{value:!0});Zs.ShowDocumentRequest=void 0;const kf=K;var bf;(function(t){t.method="window/showDocument",t.messageDirection=kf.MessageDirection.serverToClient,t.type=new kf.ProtocolRequestType(t.method)})(bf||(Zs.ShowDocumentRequest=bf={}));var Qs={};Object.defineProperty(Qs,"__esModule",{value:!0});Qs.LinkedEditingRangeRequest=void 0;const Nf=K;var _f;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=Nf.MessageDirection.clientToServer,t.type=new Nf.ProtocolRequestType(t.method)})(_f||(Qs.LinkedEditingRangeRequest=_f={}));var Ge={};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.WillDeleteFilesRequest=Ge.DidDeleteFilesNotification=Ge.DidRenameFilesNotification=Ge.WillRenameFilesRequest=Ge.DidCreateFilesNotification=Ge.WillCreateFilesRequest=Ge.FileOperationPatternKind=void 0;const st=K;var If;(function(t){t.file="file",t.folder="folder"})(If||(Ge.FileOperationPatternKind=If={}));var Pf;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=st.MessageDirection.clientToServer,t.type=new st.ProtocolRequestType(t.method)})(Pf||(Ge.WillCreateFilesRequest=Pf={}));var Of;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=st.MessageDirection.clientToServer,t.type=new st.ProtocolNotificationType(t.method)})(Of||(Ge.DidCreateFilesNotification=Of={}));var Lf;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=st.MessageDirection.clientToServer,t.type=new st.ProtocolRequestType(t.method)})(Lf||(Ge.WillRenameFilesRequest=Lf={}));var xf;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=st.MessageDirection.clientToServer,t.type=new st.ProtocolNotificationType(t.method)})(xf||(Ge.DidRenameFilesNotification=xf={}));var Df;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=st.MessageDirection.clientToServer,t.type=new st.ProtocolNotificationType(t.method)})(Df||(Ge.DidDeleteFilesNotification=Df={}));var Mf;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=st.MessageDirection.clientToServer,t.type=new st.ProtocolRequestType(t.method)})(Mf||(Ge.WillDeleteFilesRequest=Mf={}));var or={};Object.defineProperty(or,"__esModule",{value:!0});or.MonikerRequest=or.MonikerKind=or.UniquenessLevel=void 0;const Ff=K;var Gf;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(Gf||(or.UniquenessLevel=Gf={}));var jf;(function(t){t.$import="import",t.$export="export",t.local="local"})(jf||(or.MonikerKind=jf={}));var zf;(function(t){t.method="textDocument/moniker",t.messageDirection=Ff.MessageDirection.clientToServer,t.type=new Ff.ProtocolRequestType(t.method)})(zf||(or.MonikerRequest=zf={}));var lr={};Object.defineProperty(lr,"__esModule",{value:!0});lr.TypeHierarchySubtypesRequest=lr.TypeHierarchySupertypesRequest=lr.TypeHierarchyPrepareRequest=void 0;const Un=K;var Uf;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Un.MessageDirection.clientToServer,t.type=new Un.ProtocolRequestType(t.method)})(Uf||(lr.TypeHierarchyPrepareRequest=Uf={}));var Bf;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Un.MessageDirection.clientToServer,t.type=new Un.ProtocolRequestType(t.method)})(Bf||(lr.TypeHierarchySupertypesRequest=Bf={}));var Wf;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Un.MessageDirection.clientToServer,t.type=new Un.ProtocolRequestType(t.method)})(Wf||(lr.TypeHierarchySubtypesRequest=Wf={}));var Bn={};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.InlineValueRefreshRequest=Bn.InlineValueRequest=void 0;const bs=K;var Kf;(function(t){t.method="textDocument/inlineValue",t.messageDirection=bs.MessageDirection.clientToServer,t.type=new bs.ProtocolRequestType(t.method)})(Kf||(Bn.InlineValueRequest=Kf={}));var Vf;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=bs.MessageDirection.serverToClient,t.type=new bs.ProtocolRequestType0(t.method)})(Vf||(Bn.InlineValueRefreshRequest=Vf={}));var cr={};Object.defineProperty(cr,"__esModule",{value:!0});cr.InlayHintRefreshRequest=cr.InlayHintResolveRequest=cr.InlayHintRequest=void 0;const Wn=K;var qf;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolRequestType(t.method)})(qf||(cr.InlayHintRequest=qf={}));var Hf;(function(t){t.method="inlayHint/resolve",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolRequestType(t.method)})(Hf||(cr.InlayHintResolveRequest=Hf={}));var Xf;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Wn.MessageDirection.serverToClient,t.type=new Wn.ProtocolRequestType0(t.method)})(Xf||(cr.InlayHintRefreshRequest=Xf={}));var it={};Object.defineProperty(it,"__esModule",{value:!0});it.DiagnosticRefreshRequest=it.WorkspaceDiagnosticRequest=it.DocumentDiagnosticRequest=it.DocumentDiagnosticReportKind=it.DiagnosticServerCancellationData=void 0;const up=Mr,Jv=ge,Kn=K;var Yf;(function(t){function e(r){const n=r;return n&&Jv.boolean(n.retriggerRequest)}t.is=e})(Yf||(it.DiagnosticServerCancellationData=Yf={}));var Jf;(function(t){t.Full="full",t.Unchanged="unchanged"})(Jf||(it.DocumentDiagnosticReportKind=Jf={}));var Zf;(function(t){t.method="textDocument/diagnostic",t.messageDirection=Kn.MessageDirection.clientToServer,t.type=new Kn.ProtocolRequestType(t.method),t.partialResult=new up.ProgressType})(Zf||(it.DocumentDiagnosticRequest=Zf={}));var Qf;(function(t){t.method="workspace/diagnostic",t.messageDirection=Kn.MessageDirection.clientToServer,t.type=new Kn.ProtocolRequestType(t.method),t.partialResult=new up.ProgressType})(Qf||(it.WorkspaceDiagnosticRequest=Qf={}));var ed;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=Kn.MessageDirection.serverToClient,t.type=new Kn.ProtocolRequestType0(t.method)})(ed||(it.DiagnosticRefreshRequest=ed={}));var me={};Object.defineProperty(me,"__esModule",{value:!0});me.DidCloseNotebookDocumentNotification=me.DidSaveNotebookDocumentNotification=me.DidChangeNotebookDocumentNotification=me.NotebookCellArrayChange=me.DidOpenNotebookDocumentNotification=me.NotebookDocumentSyncRegistrationType=me.NotebookDocument=me.NotebookCell=me.ExecutionSummary=me.NotebookCellKind=void 0;const Vi=Hc,mt=ge,St=K;var dc;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(dc||(me.NotebookCellKind=dc={}));var hc;(function(t){function e(i,a){const s={executionOrder:i};return(a===!0||a===!1)&&(s.success=a),s}t.create=e;function r(i){const a=i;return mt.objectLiteral(a)&&Vi.uinteger.is(a.executionOrder)&&(a.success===void 0||mt.boolean(a.success))}t.is=r;function n(i,a){return i===a?!0:i==null||a===null||a===void 0?!1:i.executionOrder===a.executionOrder&&i.success===a.success}t.equals=n})(hc||(me.ExecutionSummary=hc={}));var Ns;(function(t){function e(a,s){return{kind:a,document:s}}t.create=e;function r(a){const s=a;return mt.objectLiteral(s)&&dc.is(s.kind)&&Vi.DocumentUri.is(s.document)&&(s.metadata===void 0||mt.objectLiteral(s.metadata))}t.is=r;function n(a,s){const o=new Set;return a.document!==s.document&&o.add("document"),a.kind!==s.kind&&o.add("kind"),a.executionSummary!==s.executionSummary&&o.add("executionSummary"),(a.metadata!==void 0||s.metadata!==void 0)&&!i(a.metadata,s.metadata)&&o.add("metadata"),(a.executionSummary!==void 0||s.executionSummary!==void 0)&&!hc.equals(a.executionSummary,s.executionSummary)&&o.add("executionSummary"),o}t.diff=n;function i(a,s){if(a===s)return!0;if(a==null||s===null||s===void 0||typeof a!=typeof s||typeof a!="object")return!1;const o=Array.isArray(a),l=Array.isArray(s);if(o!==l)return!1;if(o&&l){if(a.length!==s.length)return!1;for(let c=0;c<a.length;c++)if(!i(a[c],s[c]))return!1}if(mt.objectLiteral(a)&&mt.objectLiteral(s)){const c=Object.keys(a),f=Object.keys(s);if(c.length!==f.length||(c.sort(),f.sort(),!i(c,f)))return!1;for(let h=0;h<c.length;h++){const p=c[h];if(!i(a[p],s[p]))return!1}}return!0}})(Ns||(me.NotebookCell=Ns={}));var td;(function(t){function e(n,i,a,s){return{uri:n,notebookType:i,version:a,cells:s}}t.create=e;function r(n){const i=n;return mt.objectLiteral(i)&&mt.string(i.uri)&&Vi.integer.is(i.version)&&mt.typedArray(i.cells,Ns.is)}t.is=r})(td||(me.NotebookDocument=td={}));var Vn;(function(t){t.method="notebookDocument/sync",t.messageDirection=St.MessageDirection.clientToServer,t.type=new St.RegistrationType(t.method)})(Vn||(me.NotebookDocumentSyncRegistrationType=Vn={}));var rd;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=St.MessageDirection.clientToServer,t.type=new St.ProtocolNotificationType(t.method),t.registrationMethod=Vn.method})(rd||(me.DidOpenNotebookDocumentNotification=rd={}));var nd;(function(t){function e(n){const i=n;return mt.objectLiteral(i)&&Vi.uinteger.is(i.start)&&Vi.uinteger.is(i.deleteCount)&&(i.cells===void 0||mt.typedArray(i.cells,Ns.is))}t.is=e;function r(n,i,a){const s={start:n,deleteCount:i};return a!==void 0&&(s.cells=a),s}t.create=r})(nd||(me.NotebookCellArrayChange=nd={}));var id;(function(t){t.method="notebookDocument/didChange",t.messageDirection=St.MessageDirection.clientToServer,t.type=new St.ProtocolNotificationType(t.method),t.registrationMethod=Vn.method})(id||(me.DidChangeNotebookDocumentNotification=id={}));var ad;(function(t){t.method="notebookDocument/didSave",t.messageDirection=St.MessageDirection.clientToServer,t.type=new St.ProtocolNotificationType(t.method),t.registrationMethod=Vn.method})(ad||(me.DidSaveNotebookDocumentNotification=ad={}));var sd;(function(t){t.method="notebookDocument/didClose",t.messageDirection=St.MessageDirection.clientToServer,t.type=new St.ProtocolNotificationType(t.method),t.registrationMethod=Vn.method})(sd||(me.DidCloseNotebookDocumentNotification=sd={}));var eo={};Object.defineProperty(eo,"__esModule",{value:!0});eo.InlineCompletionRequest=void 0;const od=K;var ld;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=od.MessageDirection.clientToServer,t.type=new od.ProtocolRequestType(t.method)})(ld||(eo.InlineCompletionRequest=ld={}));(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=K,r=Hc,n=ge,i=qs;Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const a=Hs;Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return a.TypeDefinitionRequest}});const s=Fn;Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return s.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return s.DidChangeWorkspaceFoldersNotification}});const o=Xs;Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return o.ConfigurationRequest}});const l=Gn;Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return l.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return l.ColorPresentationRequest}});const c=jn;Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return c.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return c.FoldingRangeRefreshRequest}});const f=Ys;Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return f.DeclarationRequest}});const h=Js;Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return h.SelectionRangeRequest}});const p=ar;Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return p.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return p.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return p.WorkDoneProgressCancelNotification}});const g=sr;Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return g.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return g.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return g.CallHierarchyPrepareRequest}});const C=Ve;Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return C.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return C.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return C.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return C.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return C.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return C.SemanticTokensRegistrationType}});const k=Zs;Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return k.ShowDocumentRequest}});const D=Qs;Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return D.LinkedEditingRangeRequest}});const b=Ge;Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return b.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return b.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return b.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return b.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return b.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return b.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return b.WillDeleteFilesRequest}});const O=or;Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return O.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return O.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return O.MonikerRequest}});const N=lr;Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return N.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return N.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return N.TypeHierarchySupertypesRequest}});const L=Bn;Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return L.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return L.InlineValueRefreshRequest}});const H=cr;Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return H.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return H.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return H.InlayHintRefreshRequest}});const ee=it;Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return ee.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return ee.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return ee.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return ee.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return ee.DiagnosticRefreshRequest}});const te=me;Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return te.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return te.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return te.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return te.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return te.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return te.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return te.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return te.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return te.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return te.DidCloseNotebookDocumentNotification}});const $e=eo;Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return $e.InlineCompletionRequest}});var be;(function(u){function ve(Ee){const B=Ee;return n.string(B)||n.string(B.language)||n.string(B.scheme)||n.string(B.pattern)}u.is=ve})(be||(t.TextDocumentFilter=be={}));var Re;(function(u){function ve(Ee){const B=Ee;return n.objectLiteral(B)&&(n.string(B.notebookType)||n.string(B.scheme)||n.string(B.pattern))}u.is=ve})(Re||(t.NotebookDocumentFilter=Re={}));var w;(function(u){function ve(Ee){const B=Ee;return n.objectLiteral(B)&&(n.string(B.notebook)||Re.is(B.notebook))&&(B.language===void 0||n.string(B.language))}u.is=ve})(w||(t.NotebookCellTextDocumentFilter=w={}));var E;(function(u){function ve(Ee){if(!Array.isArray(Ee))return!1;for(let B of Ee)if(!n.string(B)&&!be.is(B)&&!w.is(B))return!1;return!0}u.is=ve})(E||(t.DocumentSelector=E={}));var m;(function(u){u.method="client/registerCapability",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolRequestType(u.method)})(m||(t.RegistrationRequest=m={}));var $;(function(u){u.method="client/unregisterCapability",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolRequestType(u.method)})($||(t.UnregistrationRequest=$={}));var y;(function(u){u.Create="create",u.Rename="rename",u.Delete="delete"})(y||(t.ResourceOperationKind=y={}));var T;(function(u){u.Abort="abort",u.Transactional="transactional",u.TextOnlyTransactional="textOnlyTransactional",u.Undo="undo"})(T||(t.FailureHandlingKind=T={}));var v;(function(u){u.UTF8="utf-8",u.UTF16="utf-16",u.UTF32="utf-32"})(v||(t.PositionEncodingKind=v={}));var I;(function(u){function ve(Ee){const B=Ee;return B&&n.string(B.id)&&B.id.length>0}u.hasId=ve})(I||(t.StaticRegistrationOptions=I={}));var x;(function(u){function ve(Ee){const B=Ee;return B&&(B.documentSelector===null||E.is(B.documentSelector))}u.is=ve})(x||(t.TextDocumentRegistrationOptions=x={}));var P;(function(u){function ve(B){const d=B;return n.objectLiteral(d)&&(d.workDoneProgress===void 0||n.boolean(d.workDoneProgress))}u.is=ve;function Ee(B){const d=B;return d&&n.boolean(d.workDoneProgress)}u.hasWorkDoneProgress=Ee})(P||(t.WorkDoneProgressOptions=P={}));var j;(function(u){u.method="initialize",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(j||(t.InitializeRequest=j={}));var F;(function(u){u.unknownProtocolVersion=1})(F||(t.InitializeErrorCodes=F={}));var re;(function(u){u.method="initialized",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(re||(t.InitializedNotification=re={}));var z;(function(u){u.method="shutdown",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType0(u.method)})(z||(t.ShutdownRequest=z={}));var Z;(function(u){u.method="exit",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType0(u.method)})(Z||(t.ExitNotification=Z={}));var Pe;(function(u){u.method="workspace/didChangeConfiguration",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(Pe||(t.DidChangeConfigurationNotification=Pe={}));var he;(function(u){u.Error=1,u.Warning=2,u.Info=3,u.Log=4,u.Debug=5})(he||(t.MessageType=he={}));var oe;(function(u){u.method="window/showMessage",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolNotificationType(u.method)})(oe||(t.ShowMessageNotification=oe={}));var Ne;(function(u){u.method="window/showMessageRequest",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolRequestType(u.method)})(Ne||(t.ShowMessageRequest=Ne={}));var Oe;(function(u){u.method="window/logMessage",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolNotificationType(u.method)})(Oe||(t.LogMessageNotification=Oe={}));var Ce;(function(u){u.method="telemetry/event",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolNotificationType(u.method)})(Ce||(t.TelemetryEventNotification=Ce={}));var X;(function(u){u.None=0,u.Full=1,u.Incremental=2})(X||(t.TextDocumentSyncKind=X={}));var Je;(function(u){u.method="textDocument/didOpen",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(Je||(t.DidOpenTextDocumentNotification=Je={}));var pe;(function(u){function ve(B){let d=B;return d!=null&&typeof d.text=="string"&&d.range!==void 0&&(d.rangeLength===void 0||typeof d.rangeLength=="number")}u.isIncremental=ve;function Ee(B){let d=B;return d!=null&&typeof d.text=="string"&&d.range===void 0&&d.rangeLength===void 0}u.isFull=Ee})(pe||(t.TextDocumentContentChangeEvent=pe={}));var lt;(function(u){u.method="textDocument/didChange",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(lt||(t.DidChangeTextDocumentNotification=lt={}));var Fr;(function(u){u.method="textDocument/didClose",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(Fr||(t.DidCloseTextDocumentNotification=Fr={}));var Zn;(function(u){u.method="textDocument/didSave",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(Zn||(t.DidSaveTextDocumentNotification=Zn={}));var Qn;(function(u){u.Manual=1,u.AfterDelay=2,u.FocusOut=3})(Qn||(t.TextDocumentSaveReason=Qn={}));var ei;(function(u){u.method="textDocument/willSave",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(ei||(t.WillSaveTextDocumentNotification=ei={}));var ti;(function(u){u.method="textDocument/willSaveWaitUntil",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(ti||(t.WillSaveTextDocumentWaitUntilRequest=ti={}));var ct;(function(u){u.method="workspace/didChangeWatchedFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(ct||(t.DidChangeWatchedFilesNotification=ct={}));var ri;(function(u){u.Created=1,u.Changed=2,u.Deleted=3})(ri||(t.FileChangeType=ri={}));var na;(function(u){function ve(Ee){const B=Ee;return n.objectLiteral(B)&&(r.URI.is(B.baseUri)||r.WorkspaceFolder.is(B.baseUri))&&n.string(B.pattern)}u.is=ve})(na||(t.RelativePattern=na={}));var ia;(function(u){u.Create=1,u.Change=2,u.Delete=4})(ia||(t.WatchKind=ia={}));var aa;(function(u){u.method="textDocument/publishDiagnostics",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolNotificationType(u.method)})(aa||(t.PublishDiagnosticsNotification=aa={}));var sa;(function(u){u.Invoked=1,u.TriggerCharacter=2,u.TriggerForIncompleteCompletions=3})(sa||(t.CompletionTriggerKind=sa={}));var ni;(function(u){u.method="textDocument/completion",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(ni||(t.CompletionRequest=ni={}));var ii;(function(u){u.method="completionItem/resolve",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(ii||(t.CompletionResolveRequest=ii={}));var It;(function(u){u.method="textDocument/hover",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(It||(t.HoverRequest=It={}));var ai;(function(u){u.Invoked=1,u.TriggerCharacter=2,u.ContentChange=3})(ai||(t.SignatureHelpTriggerKind=ai={}));var oa;(function(u){u.method="textDocument/signatureHelp",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(oa||(t.SignatureHelpRequest=oa={}));var la;(function(u){u.method="textDocument/definition",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(la||(t.DefinitionRequest=la={}));var si;(function(u){u.method="textDocument/references",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(si||(t.ReferencesRequest=si={}));var oi;(function(u){u.method="textDocument/documentHighlight",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(oi||(t.DocumentHighlightRequest=oi={}));var ca;(function(u){u.method="textDocument/documentSymbol",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(ca||(t.DocumentSymbolRequest=ca={}));var ua;(function(u){u.method="textDocument/codeAction",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(ua||(t.CodeActionRequest=ua={}));var fa;(function(u){u.method="codeAction/resolve",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(fa||(t.CodeActionResolveRequest=fa={}));var da;(function(u){u.method="workspace/symbol",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(da||(t.WorkspaceSymbolRequest=da={}));var ha;(function(u){u.method="workspaceSymbol/resolve",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(ha||(t.WorkspaceSymbolResolveRequest=ha={}));var pa;(function(u){u.method="textDocument/codeLens",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(pa||(t.CodeLensRequest=pa={}));var ut;(function(u){u.method="codeLens/resolve",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(ut||(t.CodeLensResolveRequest=ut={}));var ma;(function(u){u.method="workspace/codeLens/refresh",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolRequestType0(u.method)})(ma||(t.CodeLensRefreshRequest=ma={}));var ga;(function(u){u.method="textDocument/documentLink",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(ga||(t.DocumentLinkRequest=ga={}));var gr;(function(u){u.method="documentLink/resolve",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(gr||(t.DocumentLinkResolveRequest=gr={}));var ya;(function(u){u.method="textDocument/formatting",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(ya||(t.DocumentFormattingRequest=ya={}));var Gr;(function(u){u.method="textDocument/rangeFormatting",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(Gr||(t.DocumentRangeFormattingRequest=Gr={}));var Ta;(function(u){u.method="textDocument/rangesFormatting",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(Ta||(t.DocumentRangesFormattingRequest=Ta={}));var Pt;(function(u){u.method="textDocument/onTypeFormatting",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(Pt||(t.DocumentOnTypeFormattingRequest=Pt={}));var Zt;(function(u){u.Identifier=1})(Zt||(t.PrepareSupportDefaultBehavior=Zt={}));var Ra;(function(u){u.method="textDocument/rename",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(Ra||(t.RenameRequest=Ra={}));var va;(function(u){u.method="textDocument/prepareRename",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(va||(t.PrepareRenameRequest=va={}));var Qt;(function(u){u.method="workspace/executeCommand",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(Qt||(t.ExecuteCommandRequest=Qt={}));var li;(function(u){u.method="workspace/applyEdit",u.messageDirection=e.MessageDirection.serverToClient,u.type=new e.ProtocolRequestType("workspace/applyEdit")})(li||(t.ApplyWorkspaceEditRequest=li={}))})(op);var to={};Object.defineProperty(to,"__esModule",{value:!0});to.createProtocolConnection=void 0;const cd=Mr;function Zv(t,e,r,n){return cd.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,cd.createMessageConnection)(t,e,r,n)}to.createProtocolConnection=Zv;(function(t){var e=at&&at.__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=at&&at.__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(Mr,t),r(Hc,t),r(K,t),r(op,t);var n=to;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={}))})(sp);(function(t){var e=at&&at.__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=at&&at.__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=Ju;r(Ju,t),r(sp,t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}t.createProtocolConnection=i})(Ni);var Pi;(function(t){function e(r){return{dispose:async()=>await r()}}t.create=e})(Pi||(Pi={}));class Qv{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Bi,this.documentPhaseListeners=new Bi,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=W.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=fe.None){var i;for(const a of e){const s=a.uri.toString();if(a.state===W.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,W.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=W.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=W.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=fe.None){this.currentState=W.Changed;const i=[];for(const l of r){const c=this.langiumDocuments.deleteDocuments(l);for(const f of c)i.push(f.uri),this.cleanUpDeleted(f)}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=W.Changed,this.langiumDocuments.addDocument(c)),this.resetToState(c,W.Changed)}const s=ce(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,W.ComputedScopes)),await this.emitUpdate(a,i),await Be(n);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>{var c;return l.state<W.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 ce(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),Pi.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case W.Changed:case W.Parsed:this.indexManager.removeContent(e.uri);case W.IndexedContent:e.localSymbols=void 0;case W.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case W.Linked:this.indexManager.removeReferences(e.uri);case W.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case W.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=W.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,W.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,W.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,W.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,W.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,W.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,W.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 Be(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),Pi.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),Pi.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=fe.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(ln);if(this.currentState>=e&&e>i.state)return Promise.reject(new Ni.ResponseError(Ni.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${W[i.state]}, requiring ${W[e]}, but workspace state is already ${W[this.currentState]}. Returning undefined.`))}else return Promise.reject(new Ni.ResponseError(Ni.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,c=>{et.equals(c.uri,r)&&(o.dispose(),l.dispose(),a(c.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(ln)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(ln):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(ln)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await Be(n),await s(e,n)}catch(o){if(!Bs(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 Be(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=ce(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 eE{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new xR,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=>{et.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),ce(i)}allElements(e,r){let n=ce(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=fe.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=fe.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 tE{constructor(e){this.initialBuildOptions={},this._ready=new Kc,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=fe.None){const n=await this.performStartup(e);await Be(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=ce(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 gt.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=et.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}}class rE{buildUnexpectedCharactersMessage(e,r,n,i,a){return Wo.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return Wo.buildUnableToPopLexerModeMessage(e)}}const nE={mode:"full"};class iE{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=ud(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new qe(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=nE){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(ud(e))return e;const r=fp(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}}function aE(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function fp(t){return t&&"modes"in t&&"defaultMode"in t}function ud(t){return!aE(t)&&!fp(t)}function sE(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=J.create(0,0));const a=dp(t),s=Xc(n),o=cE({lines:a,position:i,options:s});return pE({index:0,tokens:o,position:i})}function oE(t,e){const r=Xc(e),n=dp(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 dp(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(bm)}const fd=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,lE=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function cE(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 f=t.lines[o],h=0;if(l&&t.options.start){const g=(i=t.options.start)==null?void 0:i.exec(f);g&&(h=g.index+g[0].length)}else{const g=(a=t.options.line)==null?void 0:a.exec(f);g&&(h=g.index+g[0].length)}if(c){const g=(s=t.options.end)==null?void 0:s.exec(f);g&&(f=f.substring(0,g.index))}if(f=f.substring(0,hE(f)),pc(f,h)>=f.length){if(e.length>0){const g=J.create(r,n);e.push({type:"break",content:"",range:V.create(g,g)})}}else{fd.lastIndex=h;const g=fd.exec(f);if(g){const C=g[0],k=g[1],D=J.create(r,n+h),b=J.create(r,n+h+C.length);e.push({type:"tag",content:k,range:V.create(D,b)}),h+=C.length,h=pc(f,h)}if(h<f.length){const C=f.substring(h),k=Array.from(C.matchAll(lE));e.push(...uE(k,C,r,n+h))}}r++,n=0}return e.length>0&&e[e.length-1].type==="break"?e.slice(0,-1):e}function uE(t,e,r,n){const i=[];if(t.length===0){const a=J.create(r,n),s=J.create(r,n+e.length);i.push({type:"text",content:e,range:V.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:V.create(J.create(r,a+n),J.create(r,l+n))});let f=c.length+1;const h=o[1];if(i.push({type:"inline-tag",content:h,range:V.create(J.create(r,a+f+n),J.create(r,a+f+h.length+n))}),f+=h.length,o.length===4){f+=o[2].length;const p=o[3];i.push({type:"text",content:p,range:V.create(J.create(r,a+f+n),J.create(r,a+f+p.length+n))})}else i.push({type:"text",content:"",range:V.create(J.create(r,a+f+n),J.create(r,a+f+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:V.create(J.create(r,a+n),J.create(r,a+n+s.length))})}return i}const fE=/\S/,dE=/\s*$/;function pc(t,e){const r=t.substring(e).match(fE);return r?e+r.index:t.length}function hE(t){const e=t.match(dE);if(e&&typeof e.index=="number")return e.index}function pE(t){var a,s;const e=J.create(t.position.line,t.position.character);if(t.tokens.length===0)return new dd([],V.create(e,e));const r=[];for(;t.index<t.tokens.length;){const o=mE(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 dd(r,V.create(n,i))}function mE(t,e){const r=t.tokens[t.index];if(r.type==="tag")return pp(t,!1);if(r.type==="text"||r.type==="inline-tag")return hp(t);gE(r,e),t.index++}function gE(t,e){if(e){const r=new gp("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function hp(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(yE(t)),n=e,e=t.tokens[t.index];return new mc(i,V.create(r.range.start,n.range.end))}function yE(t){return t.tokens[t.index].type==="inline-tag"?pp(t,!0):mp(t)}function pp(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=mp(t);return new Ro(n,new mc([a],a.range),e,V.create(r.range.start,a.range.end))}else{const a=hp(t);return new Ro(n,a,e,V.create(r.range.start,a.range.end))}else{const a=r.range;return new Ro(n,new mc([],a),e,a)}}function mp(t){const e=t.tokens[t.index++];return new gp(e.content,e.range)}function Xc(t){if(!t)return Xc({start:"/**",end:"*/",line:"*"});const{start:e,end:r,line:n}=t;return{start:To(e,!0),end:To(r,!1),line:To(n,!0)}}function To(t,e){if(typeof t=="string"||typeof t=="object"){const r=typeof t=="string"?Ls(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}class dd{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+=hd(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+=hd(r)+i}return r.trim()}}class Ro{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=TE(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 TE(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const o=pc(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))??RE(e,a)}}function RE(t,e){try{return gt.parse(t,!0),`[${e}](${t})`}catch{return t}}class mc{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 gp{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}}function hd(t){return t.endsWith(`
156
+ `)?`
157
+ `:`
158
+
159
+ `}class vE{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&oE(r))return sE(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 EE{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return FR(e)?e.$comment:(r=$m(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}}class AE{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}}class $E{constructor(){this.previousTokenSource=new Wc,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=$R();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=fe.None){const i=new Kc,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){Bs(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class CE{constructor(e){this.grammarElementIdMap=new ju,this.tokenTypeIdMap=new ju,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 Go(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)je(o)?s.push(this.dehydrateAstNode(o,r)):pt(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else je(a)?n[i]=this.dehydrateAstNode(a,r):pt(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 Id(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Oi(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):_d(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 Go(e.$cstNode)){let s;"fullText"in a?(s=new Fh(a.fullText),i=s):"content"in a?s=new zc:"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)je(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):pt(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else je(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):pt(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),Oi(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 Zl(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))em(r)&&this.grammarElementIdMap.set(r,e++)}}function bt(t){return{documentation:{CommentProvider:e=>new EE(e),DocumentationProvider:e=>new vE(e)},parser:{AsyncParser:e=>new AE(e),GrammarConfig:e=>Ym(e),LangiumParser:e=>lR(e),CompletionParser:e=>oR(e),ValueConverter:()=>new qh,TokenBuilder:()=>new Vh,Lexer:e=>new iE(e),ParserErrorMessageProvider:()=>new zh,LexerErrorMessageProvider:()=>new rE},workspace:{AstNodeLocator:()=>new HR,AstNodeDescriptionProvider:e=>new VR(e),ReferenceDescriptionProvider:e=>new qR(e)},references:{Linker:e=>new bR(e),NameProvider:()=>new _R,ScopeProvider:e=>new MR(e),ScopeComputation:e=>new PR(e),References:e=>new IR(e)},serializer:{Hydrator:e=>new CE(e),JsonSerializer:e=>new GR(e)},validation:{DocumentValidator:e=>new BR(e),ValidationRegistry:e=>new zR(e)},shared:()=>t.shared}}function Nt(t){return{ServiceRegistry:e=>new jR(e),workspace:{LangiumDocuments:e=>new kR(e),LangiumDocumentFactory:e=>new wR(e),DocumentBuilder:e=>new Qv(e),IndexManager:e=>new eE(e),WorkspaceManager:e=>new tE(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new $E,ConfigurationProvider:e=>new XR(e)},profilers:{}}}var pd;(function(t){t.merge=(e,r)=>qi(qi({},e),r)})(pd||(pd={}));function ke(t,e,r,n,i,a,s,o,l){const c=[t,e,r,n,i,a,s,o,l].reduce(qi,{});return yp(c)}const SE=Symbol("isProxy");function yp(t,e){const r=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(n,i)=>i===SE?!0:gd(n,i,t,e||r),getOwnPropertyDescriptor:(n,i)=>(gd(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),has:(n,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return r}const md=Symbol();function gd(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]===md)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]=md;try{t[e]=typeof i=="function"?i(n):yp(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}function qi(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]=qi(i,n):t[r]=qi({},n)}else t[r]=n}return t}class wE{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 _t={fileSystemProvider:()=>new wE},kE={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},bE={AstReflection:()=>new Md};function NE(){const t=ke(Nt(_t),bE),e=ke(bt({shared:t}),kE);return t.ServiceRegistry.register(e),e}function Xt(t){const e=NE(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,gt.parse(`memory:/${r.name??"grammar"}.langium`)),r}var _E=Object.defineProperty,S=(t,e)=>_E(t,"name",{value:e,configurable:!0}),gc;(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 ]+)\]/}})(gc||(gc={}));var yc;(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])?/}})(yc||(yc={}));var Tc;(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]*/}})(Tc||(Tc={}));var Rc;(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]*/}})(Rc||(Rc={}));var vc;(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]*/}})(vc||(vc={}));var Ec;(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]*/}})(Ec||(Ec={}));var Ac;(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:/"[^"]*"|'[^']*'/}})(Ac||(Ac={}));var $c;(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:/"[^"]*"|'[^']*'/}})($c||($c={}));var Cc;(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]*/}})(Cc||(Cc={}));({...gc.Terminals,...yc.Terminals,...Tc.Terminals,...Rc.Terminals,...vc.Terminals,...Ec.Terminals,...$c.Terminals,...Ac.Terminals,...Cc.Terminals});var Na={$type:"Accelerator",name:"name",x:"x",y:"y"},_a={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},gi={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},vo={$type:"Annotations",x:"x",y:"y"},xt={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function IE(t){return ot.isInstance(t,xt.$type)}S(IE,"isArchitecture");var Ia={$type:"Axis",label:"label",name:"name"},Za={$type:"Branch",name:"name",order:"order"};function PE(t){return ot.isInstance(t,Za.$type)}S(PE,"isBranch");var yd={$type:"Checkout",branch:"branch"},Pa={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},Eo={$type:"ClassDefStatement",className:"className",styleText:"styleText"},tn={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function OE(t){return ot.isInstance(t,tn.$type)}S(OE,"isCommit");var Tr={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},Oa={$type:"Curve",entries:"entries",label:"label",name:"name"},La={$type:"Deaccelerator",name:"name",x:"x",y:"y"},Td={$type:"Decorator",strategy:"strategy"},Br={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},Tt={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},Ao={$type:"Entry",axis:"axis",value:"value"},Rd={$type:"Evolution",stages:"stages"},xa={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},$o={$type:"Evolve",component:"component",target:"target"},wr={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function LE(t){return ot.isInstance(t,wr.$type)}S(LE,"isGitGraph");var yi={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},Ii={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function xE(t){return ot.isInstance(t,Ii.$type)}S(xE,"isInfo");var Ti={$type:"Item",classSelector:"classSelector",name:"name"},Co={$type:"Junction",id:"id",in:"in"},Ri={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},Da={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},Rr={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},rn={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function DE(t){return ot.isInstance(t,rn.$type)}S(DE,"isMerge");var Ma={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},So={$type:"Option",name:"name",value:"value"},nn={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function ME(t){return ot.isInstance(t,nn.$type)}S(ME,"isPacket");var an={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function FE(t){return ot.isInstance(t,an.$type)}S(FE,"isPacketBlock");var kr={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function GE(t){return ot.isInstance(t,kr.$type)}S(GE,"isPie");var Qa={$type:"PieSection",label:"label",value:"value"};function jE(t){return ot.isInstance(t,Qa.$type)}S(jE,"isPieSection");var wo={$type:"Pipeline",components:"components",parent:"parent"},Fa={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},vr={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},ko={$type:"Section",classSelector:"classSelector",name:"name"},Wr={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},bo={$type:"Size",height:"height",width:"width"},Kr={$type:"Statement"},sn={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function zE(t){return ot.isInstance(t,sn.$type)}S(zE,"isTreemap");var No={$type:"TreemapRow",indent:"indent",item:"item"},_o={$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 UE(t){return ot.isInstance(t,Le.$type)}S(UE,"isWardley");var un,Tp=(un=class extends Nd{constructor(){super(...arguments),this.types={Accelerator:{name:Na.$type,properties:{name:{name:Na.name},x:{name:Na.x},y:{name:Na.y}},superTypes:[]},Anchor:{name:_a.$type,properties:{evolution:{name:_a.evolution},name:{name:_a.name},visibility:{name:_a.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:vo.$type,properties:{x:{name:vo.x},y:{name:vo.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:Ia.$type,properties:{label:{name:Ia.label},name:{name:Ia.name}},superTypes:[]},Branch:{name:Za.$type,properties:{name:{name:Za.name},order:{name:Za.order}},superTypes:[Kr.$type]},Checkout:{name:yd.$type,properties:{branch:{name:yd.branch}},superTypes:[Kr.$type]},CherryPicking:{name:Pa.$type,properties:{id:{name:Pa.id},parent:{name:Pa.parent},tags:{name:Pa.tags,defaultValue:[]}},superTypes:[Kr.$type]},ClassDefStatement:{name:Eo.$type,properties:{className:{name:Eo.className},styleText:{name:Eo.styleText}},superTypes:[]},Commit:{name:tn.$type,properties:{id:{name:tn.id},message:{name:tn.message},tags:{name:tn.tags,defaultValue:[]},type:{name:tn.type}},superTypes:[Kr.$type]},Component:{name:Tr.$type,properties:{decorator:{name:Tr.decorator},evolution:{name:Tr.evolution},inertia:{name:Tr.inertia,defaultValue:!1},label:{name:Tr.label},name:{name:Tr.name},visibility:{name:Tr.visibility}},superTypes:[]},Curve:{name:Oa.$type,properties:{entries:{name:Oa.entries,defaultValue:[]},label:{name:Oa.label},name:{name:Oa.name}},superTypes:[]},Deaccelerator:{name:La.$type,properties:{name:{name:La.name},x:{name:La.x},y:{name:La.y}},superTypes:[]},Decorator:{name:Td.$type,properties:{strategy:{name:Td.strategy}},superTypes:[]},Direction:{name:Br.$type,properties:{accDescr:{name:Br.accDescr},accTitle:{name:Br.accTitle},dir:{name:Br.dir},statements:{name:Br.statements,defaultValue:[]},title:{name:Br.title}},superTypes:[wr.$type]},Edge:{name:Tt.$type,properties:{lhsDir:{name:Tt.lhsDir},lhsGroup:{name:Tt.lhsGroup,defaultValue:!1},lhsId:{name:Tt.lhsId},lhsInto:{name:Tt.lhsInto,defaultValue:!1},rhsDir:{name:Tt.rhsDir},rhsGroup:{name:Tt.rhsGroup,defaultValue:!1},rhsId:{name:Tt.rhsId},rhsInto:{name:Tt.rhsInto,defaultValue:!1},title:{name:Tt.title}},superTypes:[]},Entry:{name:Ao.$type,properties:{axis:{name:Ao.axis,referenceType:Ia.$type},value:{name:Ao.value}},superTypes:[]},Evolution:{name:Rd.$type,properties:{stages:{name:Rd.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:xa.$type,properties:{boundary:{name:xa.boundary},name:{name:xa.name},secondName:{name:xa.secondName}},superTypes:[]},Evolve:{name:$o.$type,properties:{component:{name:$o.component},target:{name:$o.target}},superTypes:[]},GitGraph:{name:wr.$type,properties:{accDescr:{name:wr.accDescr},accTitle:{name:wr.accTitle},statements:{name:wr.statements,defaultValue:[]},title:{name:wr.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:Ii.$type,properties:{accDescr:{name:Ii.accDescr},accTitle:{name:Ii.accTitle},title:{name:Ii.title}},superTypes:[]},Item:{name:Ti.$type,properties:{classSelector:{name:Ti.classSelector},name:{name:Ti.name}},superTypes:[]},Junction:{name:Co.$type,properties:{id:{name:Co.id},in:{name:Co.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:Da.$type,properties:{classSelector:{name:Da.classSelector},name:{name:Da.name},value:{name:Da.value}},superTypes:[Ti.$type]},Link:{name:Rr.$type,properties:{arrow:{name:Rr.arrow},from:{name:Rr.from},fromPort:{name:Rr.fromPort},linkLabel:{name:Rr.linkLabel},to:{name:Rr.to},toPort:{name:Rr.toPort}},superTypes:[]},Merge:{name:rn.$type,properties:{branch:{name:rn.branch},id:{name:rn.id},tags:{name:rn.tags,defaultValue:[]},type:{name:rn.type}},superTypes:[Kr.$type]},Note:{name:Ma.$type,properties:{evolution:{name:Ma.evolution},text:{name:Ma.text},visibility:{name:Ma.visibility}},superTypes:[]},Option:{name:So.$type,properties:{name:{name:So.name},value:{name:So.value,defaultValue:!1}},superTypes:[]},Packet:{name:nn.$type,properties:{accDescr:{name:nn.accDescr},accTitle:{name:nn.accTitle},blocks:{name:nn.blocks,defaultValue:[]},title:{name:nn.title}},superTypes:[]},PacketBlock:{name:an.$type,properties:{bits:{name:an.bits},end:{name:an.end},label:{name:an.label},start:{name:an.start}},superTypes:[]},Pie:{name:kr.$type,properties:{accDescr:{name:kr.accDescr},accTitle:{name:kr.accTitle},sections:{name:kr.sections,defaultValue:[]},showData:{name:kr.showData,defaultValue:!1},title:{name:kr.title}},superTypes:[]},PieSection:{name:Qa.$type,properties:{label:{name:Qa.label},value:{name:Qa.value}},superTypes:[]},Pipeline:{name:wo.$type,properties:{components:{name:wo.components,defaultValue:[]},parent:{name:wo.parent}},superTypes:[]},PipelineComponent:{name:Fa.$type,properties:{evolution:{name:Fa.evolution},label:{name:Fa.label},name:{name:Fa.name}},superTypes:[]},Radar:{name:vr.$type,properties:{accDescr:{name:vr.accDescr},accTitle:{name:vr.accTitle},axes:{name:vr.axes,defaultValue:[]},curves:{name:vr.curves,defaultValue:[]},options:{name:vr.options,defaultValue:[]},title:{name:vr.title}},superTypes:[]},Section:{name:ko.$type,properties:{classSelector:{name:ko.classSelector},name:{name:ko.name}},superTypes:[Ti.$type]},Service:{name:Wr.$type,properties:{icon:{name:Wr.icon},iconText:{name:Wr.iconText},id:{name:Wr.id},in:{name:Wr.in},title:{name:Wr.title}},superTypes:[]},Size:{name:bo.$type,properties:{height:{name:bo.height},width:{name:bo.width}},superTypes:[]},Statement:{name:Kr.$type,properties:{},superTypes:[]},TreeNode:{name:_o.$type,properties:{indent:{name:_o.indent},name:{name:_o.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:sn.$type,properties:{accDescr:{name:sn.accDescr},accTitle:{name:sn.accTitle},title:{name:sn.title},TreemapRows:{name:sn.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:No.$type,properties:{indent:{name:No.indent},item:{name:No.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:[]}}}},S(un,"MermaidAstReflection"),un),ot=new Tp,vd,BE=S(()=>vd??(vd=Xt(`{"$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"),Ed,WE=S(()=>Ed??(Ed=Xt(`{"$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"),Ad,KE=S(()=>Ad??(Ad=Xt(`{"$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"),$d,VE=S(()=>$d??($d=Xt(`{"$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"),Cd,qE=S(()=>Cd??(Cd=Xt(`{"$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"),Sd,HE=S(()=>Sd??(Sd=Xt(`{"$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"),wd,XE=S(()=>wd??(wd=Xt(`{"$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"),kd,YE=S(()=>kd??(kd=Xt(`{"$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"),bd,JE=S(()=>bd??(bd=Xt(`{"$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"),ZE={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},QE={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},eA={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},tA={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},rA={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},nA={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},iA={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},aA={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},sA={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Yt={AstReflection:S(()=>new Tp,"AstReflection")},oA={Grammar:S(()=>BE(),"Grammar"),LanguageMetaData:S(()=>ZE,"LanguageMetaData"),parser:{}},lA={Grammar:S(()=>WE(),"Grammar"),LanguageMetaData:S(()=>QE,"LanguageMetaData"),parser:{}},cA={Grammar:S(()=>KE(),"Grammar"),LanguageMetaData:S(()=>eA,"LanguageMetaData"),parser:{}},uA={Grammar:S(()=>VE(),"Grammar"),LanguageMetaData:S(()=>tA,"LanguageMetaData"),parser:{}},fA={Grammar:S(()=>qE(),"Grammar"),LanguageMetaData:S(()=>rA,"LanguageMetaData"),parser:{}},dA={Grammar:S(()=>HE(),"Grammar"),LanguageMetaData:S(()=>nA,"LanguageMetaData"),parser:{}},hA={Grammar:S(()=>XE(),"Grammar"),LanguageMetaData:S(()=>iA,"LanguageMetaData"),parser:{}},pA={Grammar:S(()=>YE(),"Grammar"),LanguageMetaData:S(()=>aA,"LanguageMetaData"),parser:{}},mA={Grammar:S(()=>JE(),"Grammar"),LanguageMetaData:S(()=>sA,"LanguageMetaData"),parser:{}},gA=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,yA=/accTitle[\t ]*:([^\n\r]*)/,TA=/title([\t ][^\n\r]*|)/,RA={ACC_DESCR:gA,ACC_TITLE:yA,TITLE:TA},fn,Jn=(fn=class extends qh{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=RA[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
+ `)}}},S(fn,"AbstractMermaidValueConverter"),fn),dn,ro=(dn=class extends Jn{runCustomConverter(e,r,n){}},S(dn,"CommonValueConverter"),dn),hn,Jt=(hn=class extends Vh{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}},S(hn,"AbstractMermaidTokenBuilder"),hn),pn;pn=class extends Jt{},S(pn,"CommonTokenBuilder");var mn,vA=(mn=class extends Jt{constructor(){super(["treemap"])}},S(mn,"TreemapTokenBuilder"),mn),EA=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,gn,AA=(gn=class extends Jn{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=EA.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},S(gn,"TreemapValueConverter"),gn);function Rp(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}S(Rp,"registerValidationChecks");var yn,$A=(yn=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"}))}},S(yn,"TreemapValidator"),yn),vp={parser:{TokenBuilder:S(()=>new vA,"TokenBuilder"),ValueConverter:S(()=>new AA,"ValueConverter")},validation:{TreemapValidator:S(()=>new $A,"TreemapValidator")}};function Ep(t=_t){const e=ke(Nt(t),Yt),r=ke(bt({shared:e}),hA,vp);return e.ServiceRegistry.register(r),Rp(r),{shared:e,Treemap:r}}S(Ep,"createTreemapServices");var Tn,CA=(Tn=class extends Jn{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},S(Tn,"WardleyValueConverter"),Tn),Ap={parser:{ValueConverter:S(()=>new CA,"ValueConverter")}};function $p(t=_t){const e=ke(Nt(t),Yt),r=ke(bt({shared:e}),mA,Ap);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}S($p,"createWardleyServices");var Rn,SA=(Rn=class extends Jt{constructor(){super(["gitGraph"])}},S(Rn,"GitGraphTokenBuilder"),Rn),Cp={parser:{TokenBuilder:S(()=>new SA,"TokenBuilder"),ValueConverter:S(()=>new ro,"ValueConverter")}};function Sp(t=_t){const e=ke(Nt(t),Yt),r=ke(bt({shared:e}),lA,Cp);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}S(Sp,"createGitGraphServices");var vn,wA=(vn=class extends Jt{constructor(){super(["info","showInfo"])}},S(vn,"InfoTokenBuilder"),vn),wp={parser:{TokenBuilder:S(()=>new wA,"TokenBuilder"),ValueConverter:S(()=>new ro,"ValueConverter")}};function kp(t=_t){const e=ke(Nt(t),Yt),r=ke(bt({shared:e}),cA,wp);return e.ServiceRegistry.register(r),{shared:e,Info:r}}S(kp,"createInfoServices");var En,kA=(En=class extends Jt{constructor(){super(["packet"])}},S(En,"PacketTokenBuilder"),En),bp={parser:{TokenBuilder:S(()=>new kA,"TokenBuilder"),ValueConverter:S(()=>new ro,"ValueConverter")}};function Np(t=_t){const e=ke(Nt(t),Yt),r=ke(bt({shared:e}),uA,bp);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}S(Np,"createPacketServices");var An,bA=(An=class extends Jt{constructor(){super(["pie","showData"])}},S(An,"PieTokenBuilder"),An),$n,NA=($n=class extends Jn{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},S($n,"PieValueConverter"),$n),_p={parser:{TokenBuilder:S(()=>new bA,"TokenBuilder"),ValueConverter:S(()=>new NA,"ValueConverter")}};function Ip(t=_t){const e=ke(Nt(t),Yt),r=ke(bt({shared:e}),fA,_p);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}S(Ip,"createPieServices");var Cn,_A=(Cn=class extends Jn{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)}},S(Cn,"TreeViewValueConverter"),Cn),Sn,IA=(Sn=class extends Jt{constructor(){super(["treeView-beta"])}},S(Sn,"TreeViewTokenBuilder"),Sn),Pp={parser:{TokenBuilder:S(()=>new IA,"TokenBuilder"),ValueConverter:S(()=>new _A,"ValueConverter")}};function Op(t=_t){const e=ke(Nt(t),Yt),r=ke(bt({shared:e}),pA,Pp);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}S(Op,"createTreeViewServices");var wn,PA=(wn=class extends Jt{constructor(){super(["architecture"])}},S(wn,"ArchitectureTokenBuilder"),wn),kn,OA=(kn=class extends Jn{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()}}},S(kn,"ArchitectureValueConverter"),kn),Lp={parser:{TokenBuilder:S(()=>new PA,"TokenBuilder"),ValueConverter:S(()=>new OA,"ValueConverter")}};function xp(t=_t){const e=ke(Nt(t),Yt),r=ke(bt({shared:e}),oA,Lp);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}S(xp,"createArchitectureServices");var bn,LA=(bn=class extends Jt{constructor(){super(["radar-beta"])}},S(bn,"RadarTokenBuilder"),bn),Dp={parser:{TokenBuilder:S(()=>new LA,"TokenBuilder"),ValueConverter:S(()=>new ro,"ValueConverter")}};function Mp(t=_t){const e=ke(Nt(t),Yt),r=ke(bt({shared:e}),dA,Dp);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}S(Mp,"createRadarServices");var dt={},xA={info:S(async()=>{const{createInfoServices:t}=await Ot(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>FA);return{createInfoServices:r}},void 0),e=t().Info.parser.LangiumParser;dt.info=e},"info"),packet:S(async()=>{const{createPacketServices:t}=await Ot(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>GA);return{createPacketServices:r}},void 0),e=t().Packet.parser.LangiumParser;dt.packet=e},"packet"),pie:S(async()=>{const{createPieServices:t}=await Ot(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>jA);return{createPieServices:r}},void 0),e=t().Pie.parser.LangiumParser;dt.pie=e},"pie"),treeView:S(async()=>{const{createTreeViewServices:t}=await Ot(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>zA);return{createTreeViewServices:r}},void 0),e=t().TreeView.parser.LangiumParser;dt.treeView=e},"treeView"),architecture:S(async()=>{const{createArchitectureServices:t}=await Ot(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>UA);return{createArchitectureServices:r}},void 0),e=t().Architecture.parser.LangiumParser;dt.architecture=e},"architecture"),gitGraph:S(async()=>{const{createGitGraphServices:t}=await Ot(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>BA);return{createGitGraphServices:r}},void 0),e=t().GitGraph.parser.LangiumParser;dt.gitGraph=e},"gitGraph"),radar:S(async()=>{const{createRadarServices:t}=await Ot(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>WA);return{createRadarServices:r}},void 0),e=t().Radar.parser.LangiumParser;dt.radar=e},"radar"),treemap:S(async()=>{const{createTreemapServices:t}=await Ot(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>KA);return{createTreemapServices:r}},void 0),e=t().Treemap.parser.LangiumParser;dt.treemap=e},"treemap"),wardley:S(async()=>{const{createWardleyServices:t}=await Ot(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>VA);return{createWardleyServices:r}},void 0),e=t().Wardley.parser.LangiumParser;dt.wardley=e},"wardley")};async function DA(t,e){const r=xA[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);dt[t]||await r();const i=dt[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new MA(i);return i.value}S(DA,"parse");var Nn,MA=(Nn=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}},S(Nn,"MermaidParseError"),Nn);const FA=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:wp,createInfoServices:kp},Symbol.toStringTag,{value:"Module"})),GA=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:bp,createPacketServices:Np},Symbol.toStringTag,{value:"Module"})),jA=Object.freeze(Object.defineProperty({__proto__:null,PieModule:_p,createPieServices:Ip},Symbol.toStringTag,{value:"Module"})),zA=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:Pp,createTreeViewServices:Op},Symbol.toStringTag,{value:"Module"})),UA=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:Lp,createArchitectureServices:xp},Symbol.toStringTag,{value:"Module"})),BA=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:Cp,createGitGraphServices:Sp},Symbol.toStringTag,{value:"Module"})),WA=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:Dp,createRadarServices:Mp},Symbol.toStringTag,{value:"Module"})),KA=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:vp,createTreemapServices:Ep},Symbol.toStringTag,{value:"Module"})),VA=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:Ap,createWardleyServices:$p},Symbol.toStringTag,{value:"Module"}));export{DA as p};