@launchsecure/launch-kit 0.0.40 → 0.0.41

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 (106) hide show
  1. package/dist/chart-client/assets/index-Dd6IotOZ.css +1 -0
  2. package/dist/chart-client/index.html +2 -2
  3. package/dist/client/assets/index-DE0uje6k.css +32 -0
  4. package/dist/client/index.html +2 -2
  5. package/dist/council-client/assets/index-CGYusOCK.css +1 -0
  6. package/dist/council-client/assets/{index-B1v46vTE.js → index-DkTFX53U.js} +1 -1
  7. package/dist/council-client/index.html +2 -2
  8. package/dist/deck-client/assets/_baseUniq-mvYvzeEJ.js +1 -0
  9. package/dist/deck-client/assets/arc-CX4ylnp2.js +1 -0
  10. package/dist/deck-client/assets/architectureDiagram-Q4EWVU46-BkR-5IRK.js +36 -0
  11. package/dist/deck-client/assets/{blockDiagram-DXYQGD6D-CUdblaWk.js → blockDiagram-DXYQGD6D-DVNQht7c.js} +2 -2
  12. package/dist/deck-client/assets/{c4Diagram-AHTNJAMY-MfAO5lak.js → c4Diagram-AHTNJAMY-Cbq1rlG8.js} +2 -2
  13. package/dist/deck-client/assets/channel-B9GC-CLn.js +1 -0
  14. package/dist/deck-client/assets/chunk-4BX2VUAB-D58Co4lU.js +1 -0
  15. package/dist/deck-client/assets/{chunk-4TB4RGXK-BUJtZ7jO.js → chunk-4TB4RGXK-BYvhTm3d.js} +1 -1
  16. package/dist/deck-client/assets/chunk-55IACEB6-oWukUhYg.js +1 -0
  17. package/dist/deck-client/assets/chunk-EDXVE4YY-Cm58kVnZ.js +1 -0
  18. package/dist/deck-client/assets/{chunk-FMBD7UC4-PnZ9v6ey.js → chunk-FMBD7UC4-Dg-i7kzi.js} +1 -1
  19. package/dist/deck-client/assets/{chunk-OYMX7WX6-DXrWNOsV.js → chunk-OYMX7WX6-C72wigPl.js} +1 -1
  20. package/dist/deck-client/assets/chunk-QZHKN3VN-CLgeuAKw.js +1 -0
  21. package/dist/deck-client/assets/chunk-YZCP3GAM-HDDlJ5oI.js +1 -0
  22. package/dist/deck-client/assets/classDiagram-6PBFFD2Q-CFBvYQ9j.js +1 -0
  23. package/dist/deck-client/assets/classDiagram-v2-HSJHXN6E-CFBvYQ9j.js +1 -0
  24. package/dist/deck-client/assets/clone-n-WQlAGe.js +1 -0
  25. package/dist/deck-client/assets/cose-bilkent-S5V4N54A-CUXQKg2M.js +1 -0
  26. package/dist/deck-client/assets/dagre-KV5264BT-C5M-fVDc.js +4 -0
  27. package/dist/deck-client/assets/diagram-5BDNPKRD-CcVsQ0S8.js +10 -0
  28. package/dist/deck-client/assets/diagram-G4DWMVQ6-DJswXyep.js +24 -0
  29. package/dist/deck-client/assets/diagram-MMDJMWI5-CGT76fm1.js +43 -0
  30. package/dist/deck-client/assets/diagram-TYMM5635-BBsYUNN6.js +24 -0
  31. package/dist/deck-client/assets/{erDiagram-SMLLAGMA-56pn_93p.js → erDiagram-SMLLAGMA-DKWYEHQS.js} +2 -2
  32. package/dist/deck-client/assets/{flowDiagram-DWJPFMVM-BtV3M5xJ.js → flowDiagram-DWJPFMVM-DLuDYIKT.js} +2 -2
  33. package/dist/deck-client/assets/ganttDiagram-T4ZO3ILL-B19b6Qtj.js +292 -0
  34. package/dist/deck-client/assets/gitGraphDiagram-UUTBAWPF-BYLAfYVS.js +106 -0
  35. package/dist/deck-client/assets/graph-CfzQUfPh.js +1 -0
  36. package/dist/deck-client/assets/index-DlwdTgE_.js +892 -0
  37. package/dist/deck-client/assets/index-evAPhGvM.css +1 -0
  38. package/dist/deck-client/assets/infoDiagram-42DDH7IO-Dp3mUA9c.js +2 -0
  39. package/dist/deck-client/assets/{ishikawaDiagram-UXIWVN3A-DXYkdO3T.js → ishikawaDiagram-UXIWVN3A-BhrNX_jI.js} +5 -5
  40. package/dist/deck-client/assets/{journeyDiagram-VCZTEJTY-C2zBr-J5.js → journeyDiagram-VCZTEJTY-B5lJI492.js} +2 -2
  41. package/dist/deck-client/assets/{kanban-definition-6JOO6SKY-CdoYLS4Z.js → kanban-definition-6JOO6SKY-D9-lmhQf.js} +2 -2
  42. package/dist/deck-client/assets/layout-CfIe_Su8.js +1 -0
  43. package/dist/deck-client/assets/linear-09ZFRoh_.js +1 -0
  44. package/dist/deck-client/assets/mermaid.core-BaQyIOvj.js +309 -0
  45. package/dist/deck-client/assets/min-CYwCzYaL.js +1 -0
  46. package/dist/deck-client/assets/{mindmap-definition-QFDTVHPH-oAybLedr.js → mindmap-definition-QFDTVHPH-CouFxf6C.js} +2 -2
  47. package/dist/deck-client/assets/pieDiagram-DEJITSTG-DMB1ufC0.js +30 -0
  48. package/dist/deck-client/assets/{quadrantDiagram-34T5L4WZ-dtluDZXs.js → quadrantDiagram-34T5L4WZ-CBiOKudN.js} +2 -2
  49. package/dist/deck-client/assets/{requirementDiagram-MS252O5E-Cq8l7bOl.js → requirementDiagram-MS252O5E-BMc3GJkx.js} +2 -2
  50. package/dist/deck-client/assets/sankeyDiagram-XADWPNL6-CxACUncm.js +10 -0
  51. package/dist/deck-client/assets/{sequenceDiagram-FGHM5R23-CYkd7oQK.js → sequenceDiagram-FGHM5R23-Ch-P3Mzc.js} +2 -2
  52. package/dist/deck-client/assets/stateDiagram-FHFEXIEX-Cy8n7Yzk.js +1 -0
  53. package/dist/deck-client/assets/stateDiagram-v2-QKLJ7IA2-C14VKCzi.js +1 -0
  54. package/dist/deck-client/assets/{timeline-definition-GMOUNBTQ-DZIxSyd1.js → timeline-definition-GMOUNBTQ-C2V4sSkm.js} +2 -2
  55. package/dist/deck-client/assets/{vennDiagram-DHZGUBPP-Ct4JVRDM.js → vennDiagram-DHZGUBPP-YOqt4VbE.js} +2 -2
  56. package/dist/deck-client/assets/{wardley-RL74JXVD-V29ycxOW.js → wardley-RL74JXVD-Bxo5x40D.js} +3 -3
  57. package/dist/deck-client/assets/{wardleyDiagram-NUSXRM2D-D-Ua6Cmi.js → wardleyDiagram-NUSXRM2D-DW9SOqbx.js} +2 -2
  58. package/dist/deck-client/assets/{xychartDiagram-5P7HB3ND-BPCOuRVl.js → xychartDiagram-5P7HB3ND-D-rZvZOL.js} +2 -2
  59. package/dist/deck-client/index.html +2 -2
  60. package/dist/server/cli.js +488 -215
  61. package/dist/server/council-entry.js +7 -1
  62. package/dist/server/council-serve.js +7 -1
  63. package/dist/server/deck-mcp-entry.js +287 -49
  64. package/dist/server/deck-serve.js +258 -48
  65. package/dist/server/graph-mcp-entry.js +331 -37
  66. package/dist/server/init-entry.js +17 -7
  67. package/dist/server/rover-entry.js +1 -1
  68. package/package.json +1 -1
  69. package/scaffolds/ls-marketplace/plugins/kit/skills/comms/SKILL.md +34 -1
  70. package/scaffolds/ls-marketplace/plugins/kit/skills/gen-test/SKILL.md +126 -0
  71. package/dist/chart-client/assets/index-CWJFFDPu.css +0 -1
  72. package/dist/client/assets/index-CTzFcfGV.css +0 -32
  73. package/dist/council-client/assets/index-ArgRc5mN.css +0 -1
  74. package/dist/deck-client/assets/_baseUniq-BZP7n41F.js +0 -1
  75. package/dist/deck-client/assets/arc-31biU3Az.js +0 -1
  76. package/dist/deck-client/assets/architectureDiagram-Q4EWVU46-DHg6Ss--.js +0 -36
  77. package/dist/deck-client/assets/channel-BBkRLdnC.js +0 -1
  78. package/dist/deck-client/assets/chunk-4BX2VUAB-DQ1MrGgN.js +0 -1
  79. package/dist/deck-client/assets/chunk-55IACEB6-BdSnXB6g.js +0 -1
  80. package/dist/deck-client/assets/chunk-EDXVE4YY-94yZIUI8.js +0 -1
  81. package/dist/deck-client/assets/chunk-QZHKN3VN-CsIGIDKX.js +0 -1
  82. package/dist/deck-client/assets/chunk-YZCP3GAM-DVkBO9tn.js +0 -1
  83. package/dist/deck-client/assets/classDiagram-6PBFFD2Q-DFCaeF-7.js +0 -1
  84. package/dist/deck-client/assets/classDiagram-v2-HSJHXN6E-DFCaeF-7.js +0 -1
  85. package/dist/deck-client/assets/clone-GCEVRScB.js +0 -1
  86. package/dist/deck-client/assets/cose-bilkent-S5V4N54A-m126Oh3b.js +0 -1
  87. package/dist/deck-client/assets/dagre-KV5264BT-C2aig8U5.js +0 -4
  88. package/dist/deck-client/assets/diagram-5BDNPKRD-CKpoRfGn.js +0 -10
  89. package/dist/deck-client/assets/diagram-G4DWMVQ6-Cjh115Ep.js +0 -24
  90. package/dist/deck-client/assets/diagram-MMDJMWI5-DKlBv_2L.js +0 -43
  91. package/dist/deck-client/assets/diagram-TYMM5635-CdBh4cEn.js +0 -24
  92. package/dist/deck-client/assets/ganttDiagram-T4ZO3ILL-DTIsC6Zg.js +0 -292
  93. package/dist/deck-client/assets/gitGraphDiagram-UUTBAWPF-CJYeyCLe.js +0 -106
  94. package/dist/deck-client/assets/graph-BDvMu1Ss.js +0 -1
  95. package/dist/deck-client/assets/index-D4eSxcBn.css +0 -1
  96. package/dist/deck-client/assets/index-QnGVE9PZ.js +0 -1196
  97. package/dist/deck-client/assets/infoDiagram-42DDH7IO-BWyKJnpW.js +0 -2
  98. package/dist/deck-client/assets/layout-vOnxnCQU.js +0 -1
  99. package/dist/deck-client/assets/linear-B0J0WCGz.js +0 -1
  100. package/dist/deck-client/assets/min-B0AXlT9L.js +0 -1
  101. package/dist/deck-client/assets/pieDiagram-DEJITSTG-BjHyHxGk.js +0 -30
  102. package/dist/deck-client/assets/sankeyDiagram-XADWPNL6-C1Vih91z.js +0 -10
  103. package/dist/deck-client/assets/stateDiagram-FHFEXIEX-CtyG8wBK.js +0 -1
  104. package/dist/deck-client/assets/stateDiagram-v2-QKLJ7IA2-BLyKWfcN.js +0 -1
  105. /package/dist/chart-client/assets/{index-Dzlj-oCj.js → index-CrYM1-ac.js} +0 -0
  106. /package/dist/client/assets/{index-tTg_ezUF.js → index-BoIjawzY.js} +0 -0
@@ -1,4 +1,4 @@
1
- var Np=Object.defineProperty;var _p=(t,e,r)=>e in t?Np(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var er=(t,e,r)=>_p(t,typeof e!="symbol"?e+"":e,r);import{bc as Ip,aJ as rt,bF as Pp,bG as _t}from"./index-QnGVE9PZ.js";import{m as Gt,f as Op,d as Lp}from"./min-B0AXlT9L.js";import{b as xp,l as Dp,c as Mp,m as Fp,r as jc,n as Xs}from"./_baseUniq-BZP7n41F.js";function Gp(t,e){return xp(Gt(t,e))}function jp(t,e){return t&&t.length?Dp(t,Mp(e)):[]}function Fe(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function ft(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 zp(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function ai(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}class Ed{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){var i;const r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const n=(i=r.properties[e.property])==null?void 0:i.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){const r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return Fe(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,r)):!1;return n[r]=s,s}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const a of n)this.isSubtype(a,e)&&i.push(a);return this.allSubtypes[e]=i,i}}}function Ii(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function Ad(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function $d(t){return Ii(t)&&typeof t.fullText=="string"}class Le{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 Le(()=>({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 Ye})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=Up(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 Le(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?Ye:{done:!1,value:e(i)}})}filter(e){return new Le(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return Ye})}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 Le(()=>({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(Xa(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return Ye})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new Le(()=>({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(Xa(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return Ye})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new Le(()=>{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 Le(()=>({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?Ye:this.nextFn(r.state)))}distinct(e){return new Le(()=>({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 Ye})}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 Up(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Xa(t){return!!t&&typeof t[Symbol.iterator]=="function"}const Cd=new Le(()=>{},()=>Ye),Ye=Object.freeze({done:!0,value:void 0});function ue(...t){if(t.length===1){const e=t[0];if(e instanceof Le)return e;if(Xa(e))return new Le(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new Le(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:Ye)}return t.length>1?new Le(()=>({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++];Xa(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return Ye}):Cd}class mc extends Le{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 Ye})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Co;(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})(Co||(Co={}));function So(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Fe(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&So(i,e))}):Fe(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&So(n,e)))}function Cs(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function jt(t){const r=La(t).$document;if(!r)throw new Error("AST node has no document.");return r}function La(t){for(;t.$container;)t=t.$container;return t}function zc(t){return ft(t)?t.ref?[t.ref]:[]:rr(t)?t.items.map(e=>e.ref):[]}function gc(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new Le(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex<n.keys.length;){const i=n.keys[n.keyIndex];if(!i.startsWith("$")){const a=t[i];if(Fe(a)){if(n.keyIndex++,Uc(a,r))return{done:!1,value:a}}else if(Array.isArray(a)){for(;n.arrayIndex<a.length;){const s=n.arrayIndex++,o=a[s];if(Fe(o)&&Uc(o,r))return{done:!1,value:o}}n.arrayIndex=0}}n.keyIndex++}return Ye})}function Ki(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new mc(t,r=>gc(r,e))}function zt(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new mc(t,r=>gc(r,e),{includeRoot:!0})}function Uc(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?fm(r,e):!1}function Ya(t){return new Le(()=>({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(ft(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(ft(a)||rr(n))return{done:!1,value:{reference:a,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Ye})}function Bp(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]=Sd(i.defaultValue))}function Sd(t){return Array.isArray(t)?[...t.map(Sd)]:t}const Xe={$type:"AbstractElement",cardinality:"cardinality"};function Wp(t){return Y.isInstance(t,Xe.$type)}const xa={$type:"AbstractParserRule"};function Vi(t){return Y.isInstance(t,xa.$type)}const ga={$type:"AbstractRule"},lt={$type:"AbstractType"},Rr={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Ss(t){return Y.isInstance(t,Rr.$type)}const Da={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function wd(t){return Y.isInstance(t,Da.$type)}const Bc={$type:"ArrayLiteral",elements:"elements"},Wc={$type:"ArrayType",elementType:"elementType"},vr={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function br(t){return Y.isInstance(t,vr.$type)}const wo={$type:"BooleanLiteral",true:"true"};function Kp(t){return Y.isInstance(t,wo.$type)}const Er={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function Vp(t){return Y.isInstance(t,Er.$type)}const Mr={$type:"Condition"},Ma={$type:"Conjunction",left:"left",right:"right"};function qp(t){return Y.isInstance(t,Ma.$type)}const Ar={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function ws(t){return Y.isInstance(t,Ar.$type)}const Fa={$type:"Disjunction",left:"left",right:"right"};function Hp(t){return Y.isInstance(t,Fa.$type)}const bo={$type:"EndOfFile",cardinality:"cardinality"};function Xp(t){return Y.isInstance(t,bo.$type)}const pr={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"},Kc={$type:"GrammarImport",path:"path"},Br={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function yc(t){return Y.isInstance(t,Br.$type)}const ko={$type:"InferredType",name:"name"};function bd(t){return Y.isInstance(t,ko.$type)}const Lt={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function Ja(t){return Y.isInstance(t,Lt.$type)}const Ys={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"},Vc={$type:"InfixRuleOperators",precedences:"precedences"},vi={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function Yp(t){return Y.isInstance(t,vi.$type)}const Ei={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function kr(t){return Y.isInstance(t,Ei.$type)}const ya={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"},Wr={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Jp(t){return Y.isInstance(t,Wr.$type)}const No={$type:"Negation",value:"value"};function Zp(t){return Y.isInstance(t,No.$type)}const qc={$type:"NumberLiteral",value:"value"},Ta={$type:"Parameter",name:"name"},_o={$type:"ParameterReference",parameter:"parameter"};function Qp(t){return Y.isInstance(t,_o.$type)}const gt={$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,gt.$type)}const Js={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"},Kr={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function em(t){return Y.isInstance(t,Kr.$type)}const Io={$type:"ReturnType",name:"name"};function tm(t){return Y.isInstance(t,Io.$type)}const Vr={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Nr(t){return Y.isInstance(t,Vr.$type)}const Ai={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function rm(t){return Y.isInstance(t,Ai.$type)}const Hc={$type:"StringLiteral",value:"value"},qr={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function nm(t){return Y.isInstance(t,qr.$type)}const et={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"},Hr={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function im(t){return Y.isInstance(t,Hr.$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 Xr={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function am(t){return Y.isInstance(t,Xr.$type)}const Ga={$type:"Type",name:"name",type:"type"};function sm(t){return Y.isInstance(t,Ga.$type)}const si={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"},oi={$type:"TypeDefinition"},Xc={$type:"UnionType",types:"types"},ja={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function kd(t){return Y.isInstance(t,ja.$type)}const Yr={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function om(t){return Y.isInstance(t,Yr.$type)}const li={$type:"ValueLiteral"},$i={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function lm(t){return Y.isInstance(t,$i.$type)}class Nd extends Ed{constructor(){super(...arguments),this.types={AbstractElement:{name:Xe.$type,properties:{cardinality:{name:Xe.cardinality}},superTypes:[]},AbstractParserRule:{name:xa.$type,properties:{},superTypes:[ga.$type,lt.$type]},AbstractRule:{name:ga.$type,properties:{},superTypes:[]},AbstractType:{name:lt.$type,properties:{},superTypes:[]},Action:{name:Rr.$type,properties:{cardinality:{name:Rr.cardinality},feature:{name:Rr.feature},inferredType:{name:Rr.inferredType},operator:{name:Rr.operator},type:{name:Rr.type,referenceType:lt.$type}},superTypes:[Xe.$type]},Alternatives:{name:Da.$type,properties:{cardinality:{name:Da.cardinality},elements:{name:Da.elements,defaultValue:[]}},superTypes:[Xe.$type]},ArrayLiteral:{name:Bc.$type,properties:{elements:{name:Bc.elements,defaultValue:[]}},superTypes:[li.$type]},ArrayType:{name:Wc.$type,properties:{elementType:{name:Wc.elementType}},superTypes:[oi.$type]},Assignment:{name:vr.$type,properties:{cardinality:{name:vr.cardinality},feature:{name:vr.feature},operator:{name:vr.operator},predicate:{name:vr.predicate},terminal:{name:vr.terminal}},superTypes:[Xe.$type]},BooleanLiteral:{name:wo.$type,properties:{true:{name:wo.true,defaultValue:!1}},superTypes:[Mr.$type,li.$type]},CharacterRange:{name:Er.$type,properties:{cardinality:{name:Er.cardinality},left:{name:Er.left},lookahead:{name:Er.lookahead},parenthesized:{name:Er.parenthesized,defaultValue:!1},right:{name:Er.right}},superTypes:[et.$type]},Condition:{name:Mr.$type,properties:{},superTypes:[]},Conjunction:{name:Ma.$type,properties:{left:{name:Ma.left},right:{name:Ma.right}},superTypes:[Mr.$type]},CrossReference:{name:Ar.$type,properties:{cardinality:{name:Ar.cardinality},deprecatedSyntax:{name:Ar.deprecatedSyntax,defaultValue:!1},isMulti:{name:Ar.isMulti,defaultValue:!1},terminal:{name:Ar.terminal},type:{name:Ar.type,referenceType:lt.$type}},superTypes:[Xe.$type]},Disjunction:{name:Fa.$type,properties:{left:{name:Fa.left},right:{name:Fa.right}},superTypes:[Mr.$type]},EndOfFile:{name:bo.$type,properties:{cardinality:{name:bo.cardinality}},superTypes:[Xe.$type]},Grammar:{name:pr.$type,properties:{imports:{name:pr.imports,defaultValue:[]},interfaces:{name:pr.interfaces,defaultValue:[]},isDeclared:{name:pr.isDeclared,defaultValue:!1},name:{name:pr.name},rules:{name:pr.rules,defaultValue:[]},types:{name:pr.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:Kc.$type,properties:{path:{name:Kc.path}},superTypes:[]},Group:{name:Br.$type,properties:{cardinality:{name:Br.cardinality},elements:{name:Br.elements,defaultValue:[]},guardCondition:{name:Br.guardCondition},predicate:{name:Br.predicate}},superTypes:[Xe.$type]},InferredType:{name:ko.$type,properties:{name:{name:ko.name}},superTypes:[lt.$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:lt.$type}},superTypes:[xa.$type]},InfixRuleOperatorList:{name:Ys.$type,properties:{associativity:{name:Ys.associativity},operators:{name:Ys.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:Vc.$type,properties:{precedences:{name:Vc.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:vi.$type,properties:{attributes:{name:vi.attributes,defaultValue:[]},name:{name:vi.name},superTypes:{name:vi.superTypes,defaultValue:[],referenceType:lt.$type}},superTypes:[lt.$type]},Keyword:{name:Ei.$type,properties:{cardinality:{name:Ei.cardinality},predicate:{name:Ei.predicate},value:{name:Ei.value}},superTypes:[Xe.$type]},NamedArgument:{name:ya.$type,properties:{calledByName:{name:ya.calledByName,defaultValue:!1},parameter:{name:ya.parameter,referenceType:Ta.$type},value:{name:ya.value}},superTypes:[]},NegatedToken:{name:Wr.$type,properties:{cardinality:{name:Wr.cardinality},lookahead:{name:Wr.lookahead},parenthesized:{name:Wr.parenthesized,defaultValue:!1},terminal:{name:Wr.terminal}},superTypes:[et.$type]},Negation:{name:No.$type,properties:{value:{name:No.value}},superTypes:[Mr.$type]},NumberLiteral:{name:qc.$type,properties:{value:{name:qc.value}},superTypes:[li.$type]},Parameter:{name:Ta.$type,properties:{name:{name:Ta.name}},superTypes:[]},ParameterReference:{name:_o.$type,properties:{parameter:{name:_o.parameter,referenceType:Ta.$type}},superTypes:[Mr.$type]},ParserRule:{name:gt.$type,properties:{dataType:{name:gt.dataType},definition:{name:gt.definition},entry:{name:gt.entry,defaultValue:!1},fragment:{name:gt.fragment,defaultValue:!1},inferredType:{name:gt.inferredType},name:{name:gt.name},parameters:{name:gt.parameters,defaultValue:[]},returnType:{name:gt.returnType,referenceType:lt.$type}},superTypes:[xa.$type]},ReferenceType:{name:Js.$type,properties:{isMulti:{name:Js.isMulti,defaultValue:!1},referenceType:{name:Js.referenceType}},superTypes:[oi.$type]},RegexToken:{name:Kr.$type,properties:{cardinality:{name:Kr.cardinality},lookahead:{name:Kr.lookahead},parenthesized:{name:Kr.parenthesized,defaultValue:!1},regex:{name:Kr.regex}},superTypes:[et.$type]},ReturnType:{name:Io.$type,properties:{name:{name:Io.name}},superTypes:[]},RuleCall:{name:Vr.$type,properties:{arguments:{name:Vr.arguments,defaultValue:[]},cardinality:{name:Vr.cardinality},predicate:{name:Vr.predicate},rule:{name:Vr.rule,referenceType:ga.$type}},superTypes:[Xe.$type]},SimpleType:{name:Ai.$type,properties:{primitiveType:{name:Ai.primitiveType},stringType:{name:Ai.stringType},typeRef:{name:Ai.typeRef,referenceType:lt.$type}},superTypes:[oi.$type]},StringLiteral:{name:Hc.$type,properties:{value:{name:Hc.value}},superTypes:[li.$type]},TerminalAlternatives:{name:qr.$type,properties:{cardinality:{name:qr.cardinality},elements:{name:qr.elements,defaultValue:[]},lookahead:{name:qr.lookahead},parenthesized:{name:qr.parenthesized,defaultValue:!1}},superTypes:[et.$type]},TerminalElement:{name:et.$type,properties:{cardinality:{name:et.cardinality},lookahead:{name:et.lookahead},parenthesized:{name:et.parenthesized,defaultValue:!1}},superTypes:[Xe.$type]},TerminalGroup:{name:Hr.$type,properties:{cardinality:{name:Hr.cardinality},elements:{name:Hr.elements,defaultValue:[]},lookahead:{name:Hr.lookahead},parenthesized:{name:Hr.parenthesized,defaultValue:!1}},superTypes:[et.$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:[ga.$type]},TerminalRuleCall:{name:Xr.$type,properties:{cardinality:{name:Xr.cardinality},lookahead:{name:Xr.lookahead},parenthesized:{name:Xr.parenthesized,defaultValue:!1},rule:{name:Xr.rule,referenceType:tr.$type}},superTypes:[et.$type]},Type:{name:Ga.$type,properties:{name:{name:Ga.name},type:{name:Ga.type}},superTypes:[lt.$type]},TypeAttribute:{name:si.$type,properties:{defaultValue:{name:si.defaultValue},isOptional:{name:si.isOptional,defaultValue:!1},name:{name:si.name},type:{name:si.type}},superTypes:[]},TypeDefinition:{name:oi.$type,properties:{},superTypes:[]},UnionType:{name:Xc.$type,properties:{types:{name:Xc.types,defaultValue:[]}},superTypes:[oi.$type]},UnorderedGroup:{name:ja.$type,properties:{cardinality:{name:ja.cardinality},elements:{name:ja.elements,defaultValue:[]}},superTypes:[Xe.$type]},UntilToken:{name:Yr.$type,properties:{cardinality:{name:Yr.cardinality},lookahead:{name:Yr.lookahead},parenthesized:{name:Yr.parenthesized,defaultValue:!1},terminal:{name:Yr.terminal}},superTypes:[et.$type]},ValueLiteral:{name:li.$type,properties:{},superTypes:[]},Wildcard:{name:$i.$type,properties:{cardinality:{name:$i.cardinality},lookahead:{name:$i.lookahead},parenthesized:{name:$i.parenthesized,defaultValue:!1}},superTypes:[et.$type]}}}}const Y=new Nd;function Po(t){return new mc(t,e=>Ii(e)?e.content:[],{includeRoot:!0})}function cm(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function Oo(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function Za(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 um(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 fm(t,e){return um(t,e)>Mt.After}const dm=/^[\w\p{L}]$/u;function hm(t,e){if(t){const r=pm(t,!0);if(r&&Yc(r,e))return r;if($d(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(Yc(a,e))return a}}}}function Yc(t,e){return Ad(t)&&e.includes(t.tokenType.name)}function pm(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 _d extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}}function qi(t,e="Error: Got unexpected value."){throw new Error(e)}function U(t){return t.charCodeAt(0)}function Zs(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function ci(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function Fr(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function mm(){throw Error("Internal Error - Should never get here!")}function Jc(t){return t.type==="Character"}const Qa=[];for(let t=U("0");t<=U("9");t++)Qa.push(t);const es=[U("_")].concat(Qa);for(let t=U("a");t<=U("z");t++)es.push(t);for(let t=U("A");t<=U("Z");t++)es.push(t);const Zc=[U(" "),U("\f"),U(`
1
+ var Np=Object.defineProperty;var _p=(t,e,r)=>e in t?Np(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var er=(t,e,r)=>_p(t,typeof e!="symbol"?e+"":e,r);import{c as rt,a as Ip,_ as _t}from"./index-DlwdTgE_.js";import{m as Gt,f as Pp,d as Op}from"./min-CYwCzYaL.js";import{b as Lp,l as xp,c as Dp,m as Mp,r as jc,n as Xs}from"./_baseUniq-mvYvzeEJ.js";import{ba as Fp}from"./mermaid.core-BaQyIOvj.js";function Gp(t,e){return Lp(Gt(t,e))}function jp(t,e){return t&&t.length?xp(t,Dp(e)):[]}function Fe(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function ft(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 zp(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function ai(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}class Ed{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){var i;const r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const n=(i=r.properties[e.property])==null?void 0:i.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){const r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return Fe(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,r)):!1;return n[r]=s,s}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const a of n)this.isSubtype(a,e)&&i.push(a);return this.allSubtypes[e]=i,i}}}function Ii(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function Ad(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function $d(t){return Ii(t)&&typeof t.fullText=="string"}class Le{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 Le(()=>({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 Ye})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=Up(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 Le(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?Ye:{done:!1,value:e(i)}})}filter(e){return new Le(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return Ye})}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 Le(()=>({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(Xa(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return Ye})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new Le(()=>({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(Xa(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return Ye})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new Le(()=>{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 Le(()=>({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?Ye:this.nextFn(r.state)))}distinct(e){return new Le(()=>({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 Ye})}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 Up(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Xa(t){return!!t&&typeof t[Symbol.iterator]=="function"}const Cd=new Le(()=>{},()=>Ye),Ye=Object.freeze({done:!0,value:void 0});function ue(...t){if(t.length===1){const e=t[0];if(e instanceof Le)return e;if(Xa(e))return new Le(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new Le(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:Ye)}return t.length>1?new Le(()=>({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++];Xa(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return Ye}):Cd}class mc extends Le{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 Ye})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Co;(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})(Co||(Co={}));function So(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Fe(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&So(i,e))}):Fe(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&So(n,e)))}function Cs(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function jt(t){const r=La(t).$document;if(!r)throw new Error("AST node has no document.");return r}function La(t){for(;t.$container;)t=t.$container;return t}function zc(t){return ft(t)?t.ref?[t.ref]:[]:rr(t)?t.items.map(e=>e.ref):[]}function gc(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new Le(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex<n.keys.length;){const i=n.keys[n.keyIndex];if(!i.startsWith("$")){const a=t[i];if(Fe(a)){if(n.keyIndex++,Uc(a,r))return{done:!1,value:a}}else if(Array.isArray(a)){for(;n.arrayIndex<a.length;){const s=n.arrayIndex++,o=a[s];if(Fe(o)&&Uc(o,r))return{done:!1,value:o}}n.arrayIndex=0}}n.keyIndex++}return Ye})}function Ki(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new mc(t,r=>gc(r,e))}function zt(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new mc(t,r=>gc(r,e),{includeRoot:!0})}function Uc(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?fm(r,e):!1}function Ya(t){return new Le(()=>({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(ft(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(ft(a)||rr(n))return{done:!1,value:{reference:a,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Ye})}function Bp(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]=Sd(i.defaultValue))}function Sd(t){return Array.isArray(t)?[...t.map(Sd)]:t}const Xe={$type:"AbstractElement",cardinality:"cardinality"};function Wp(t){return Y.isInstance(t,Xe.$type)}const xa={$type:"AbstractParserRule"};function Vi(t){return Y.isInstance(t,xa.$type)}const ga={$type:"AbstractRule"},lt={$type:"AbstractType"},Rr={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Ss(t){return Y.isInstance(t,Rr.$type)}const Da={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function wd(t){return Y.isInstance(t,Da.$type)}const Bc={$type:"ArrayLiteral",elements:"elements"},Wc={$type:"ArrayType",elementType:"elementType"},vr={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function br(t){return Y.isInstance(t,vr.$type)}const wo={$type:"BooleanLiteral",true:"true"};function Kp(t){return Y.isInstance(t,wo.$type)}const Er={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function Vp(t){return Y.isInstance(t,Er.$type)}const Mr={$type:"Condition"},Ma={$type:"Conjunction",left:"left",right:"right"};function qp(t){return Y.isInstance(t,Ma.$type)}const Ar={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function ws(t){return Y.isInstance(t,Ar.$type)}const Fa={$type:"Disjunction",left:"left",right:"right"};function Hp(t){return Y.isInstance(t,Fa.$type)}const bo={$type:"EndOfFile",cardinality:"cardinality"};function Xp(t){return Y.isInstance(t,bo.$type)}const pr={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"},Kc={$type:"GrammarImport",path:"path"},Br={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function yc(t){return Y.isInstance(t,Br.$type)}const ko={$type:"InferredType",name:"name"};function bd(t){return Y.isInstance(t,ko.$type)}const Lt={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function Ja(t){return Y.isInstance(t,Lt.$type)}const Ys={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"},Vc={$type:"InfixRuleOperators",precedences:"precedences"},vi={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function Yp(t){return Y.isInstance(t,vi.$type)}const Ei={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function kr(t){return Y.isInstance(t,Ei.$type)}const ya={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"},Wr={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Jp(t){return Y.isInstance(t,Wr.$type)}const No={$type:"Negation",value:"value"};function Zp(t){return Y.isInstance(t,No.$type)}const qc={$type:"NumberLiteral",value:"value"},Ta={$type:"Parameter",name:"name"},_o={$type:"ParameterReference",parameter:"parameter"};function Qp(t){return Y.isInstance(t,_o.$type)}const gt={$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,gt.$type)}const Js={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"},Kr={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function em(t){return Y.isInstance(t,Kr.$type)}const Io={$type:"ReturnType",name:"name"};function tm(t){return Y.isInstance(t,Io.$type)}const Vr={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Nr(t){return Y.isInstance(t,Vr.$type)}const Ai={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function rm(t){return Y.isInstance(t,Ai.$type)}const Hc={$type:"StringLiteral",value:"value"},qr={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function nm(t){return Y.isInstance(t,qr.$type)}const et={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"},Hr={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function im(t){return Y.isInstance(t,Hr.$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 Xr={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function am(t){return Y.isInstance(t,Xr.$type)}const Ga={$type:"Type",name:"name",type:"type"};function sm(t){return Y.isInstance(t,Ga.$type)}const si={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"},oi={$type:"TypeDefinition"},Xc={$type:"UnionType",types:"types"},ja={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function kd(t){return Y.isInstance(t,ja.$type)}const Yr={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function om(t){return Y.isInstance(t,Yr.$type)}const li={$type:"ValueLiteral"},$i={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function lm(t){return Y.isInstance(t,$i.$type)}class Nd extends Ed{constructor(){super(...arguments),this.types={AbstractElement:{name:Xe.$type,properties:{cardinality:{name:Xe.cardinality}},superTypes:[]},AbstractParserRule:{name:xa.$type,properties:{},superTypes:[ga.$type,lt.$type]},AbstractRule:{name:ga.$type,properties:{},superTypes:[]},AbstractType:{name:lt.$type,properties:{},superTypes:[]},Action:{name:Rr.$type,properties:{cardinality:{name:Rr.cardinality},feature:{name:Rr.feature},inferredType:{name:Rr.inferredType},operator:{name:Rr.operator},type:{name:Rr.type,referenceType:lt.$type}},superTypes:[Xe.$type]},Alternatives:{name:Da.$type,properties:{cardinality:{name:Da.cardinality},elements:{name:Da.elements,defaultValue:[]}},superTypes:[Xe.$type]},ArrayLiteral:{name:Bc.$type,properties:{elements:{name:Bc.elements,defaultValue:[]}},superTypes:[li.$type]},ArrayType:{name:Wc.$type,properties:{elementType:{name:Wc.elementType}},superTypes:[oi.$type]},Assignment:{name:vr.$type,properties:{cardinality:{name:vr.cardinality},feature:{name:vr.feature},operator:{name:vr.operator},predicate:{name:vr.predicate},terminal:{name:vr.terminal}},superTypes:[Xe.$type]},BooleanLiteral:{name:wo.$type,properties:{true:{name:wo.true,defaultValue:!1}},superTypes:[Mr.$type,li.$type]},CharacterRange:{name:Er.$type,properties:{cardinality:{name:Er.cardinality},left:{name:Er.left},lookahead:{name:Er.lookahead},parenthesized:{name:Er.parenthesized,defaultValue:!1},right:{name:Er.right}},superTypes:[et.$type]},Condition:{name:Mr.$type,properties:{},superTypes:[]},Conjunction:{name:Ma.$type,properties:{left:{name:Ma.left},right:{name:Ma.right}},superTypes:[Mr.$type]},CrossReference:{name:Ar.$type,properties:{cardinality:{name:Ar.cardinality},deprecatedSyntax:{name:Ar.deprecatedSyntax,defaultValue:!1},isMulti:{name:Ar.isMulti,defaultValue:!1},terminal:{name:Ar.terminal},type:{name:Ar.type,referenceType:lt.$type}},superTypes:[Xe.$type]},Disjunction:{name:Fa.$type,properties:{left:{name:Fa.left},right:{name:Fa.right}},superTypes:[Mr.$type]},EndOfFile:{name:bo.$type,properties:{cardinality:{name:bo.cardinality}},superTypes:[Xe.$type]},Grammar:{name:pr.$type,properties:{imports:{name:pr.imports,defaultValue:[]},interfaces:{name:pr.interfaces,defaultValue:[]},isDeclared:{name:pr.isDeclared,defaultValue:!1},name:{name:pr.name},rules:{name:pr.rules,defaultValue:[]},types:{name:pr.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:Kc.$type,properties:{path:{name:Kc.path}},superTypes:[]},Group:{name:Br.$type,properties:{cardinality:{name:Br.cardinality},elements:{name:Br.elements,defaultValue:[]},guardCondition:{name:Br.guardCondition},predicate:{name:Br.predicate}},superTypes:[Xe.$type]},InferredType:{name:ko.$type,properties:{name:{name:ko.name}},superTypes:[lt.$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:lt.$type}},superTypes:[xa.$type]},InfixRuleOperatorList:{name:Ys.$type,properties:{associativity:{name:Ys.associativity},operators:{name:Ys.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:Vc.$type,properties:{precedences:{name:Vc.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:vi.$type,properties:{attributes:{name:vi.attributes,defaultValue:[]},name:{name:vi.name},superTypes:{name:vi.superTypes,defaultValue:[],referenceType:lt.$type}},superTypes:[lt.$type]},Keyword:{name:Ei.$type,properties:{cardinality:{name:Ei.cardinality},predicate:{name:Ei.predicate},value:{name:Ei.value}},superTypes:[Xe.$type]},NamedArgument:{name:ya.$type,properties:{calledByName:{name:ya.calledByName,defaultValue:!1},parameter:{name:ya.parameter,referenceType:Ta.$type},value:{name:ya.value}},superTypes:[]},NegatedToken:{name:Wr.$type,properties:{cardinality:{name:Wr.cardinality},lookahead:{name:Wr.lookahead},parenthesized:{name:Wr.parenthesized,defaultValue:!1},terminal:{name:Wr.terminal}},superTypes:[et.$type]},Negation:{name:No.$type,properties:{value:{name:No.value}},superTypes:[Mr.$type]},NumberLiteral:{name:qc.$type,properties:{value:{name:qc.value}},superTypes:[li.$type]},Parameter:{name:Ta.$type,properties:{name:{name:Ta.name}},superTypes:[]},ParameterReference:{name:_o.$type,properties:{parameter:{name:_o.parameter,referenceType:Ta.$type}},superTypes:[Mr.$type]},ParserRule:{name:gt.$type,properties:{dataType:{name:gt.dataType},definition:{name:gt.definition},entry:{name:gt.entry,defaultValue:!1},fragment:{name:gt.fragment,defaultValue:!1},inferredType:{name:gt.inferredType},name:{name:gt.name},parameters:{name:gt.parameters,defaultValue:[]},returnType:{name:gt.returnType,referenceType:lt.$type}},superTypes:[xa.$type]},ReferenceType:{name:Js.$type,properties:{isMulti:{name:Js.isMulti,defaultValue:!1},referenceType:{name:Js.referenceType}},superTypes:[oi.$type]},RegexToken:{name:Kr.$type,properties:{cardinality:{name:Kr.cardinality},lookahead:{name:Kr.lookahead},parenthesized:{name:Kr.parenthesized,defaultValue:!1},regex:{name:Kr.regex}},superTypes:[et.$type]},ReturnType:{name:Io.$type,properties:{name:{name:Io.name}},superTypes:[]},RuleCall:{name:Vr.$type,properties:{arguments:{name:Vr.arguments,defaultValue:[]},cardinality:{name:Vr.cardinality},predicate:{name:Vr.predicate},rule:{name:Vr.rule,referenceType:ga.$type}},superTypes:[Xe.$type]},SimpleType:{name:Ai.$type,properties:{primitiveType:{name:Ai.primitiveType},stringType:{name:Ai.stringType},typeRef:{name:Ai.typeRef,referenceType:lt.$type}},superTypes:[oi.$type]},StringLiteral:{name:Hc.$type,properties:{value:{name:Hc.value}},superTypes:[li.$type]},TerminalAlternatives:{name:qr.$type,properties:{cardinality:{name:qr.cardinality},elements:{name:qr.elements,defaultValue:[]},lookahead:{name:qr.lookahead},parenthesized:{name:qr.parenthesized,defaultValue:!1}},superTypes:[et.$type]},TerminalElement:{name:et.$type,properties:{cardinality:{name:et.cardinality},lookahead:{name:et.lookahead},parenthesized:{name:et.parenthesized,defaultValue:!1}},superTypes:[Xe.$type]},TerminalGroup:{name:Hr.$type,properties:{cardinality:{name:Hr.cardinality},elements:{name:Hr.elements,defaultValue:[]},lookahead:{name:Hr.lookahead},parenthesized:{name:Hr.parenthesized,defaultValue:!1}},superTypes:[et.$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:[ga.$type]},TerminalRuleCall:{name:Xr.$type,properties:{cardinality:{name:Xr.cardinality},lookahead:{name:Xr.lookahead},parenthesized:{name:Xr.parenthesized,defaultValue:!1},rule:{name:Xr.rule,referenceType:tr.$type}},superTypes:[et.$type]},Type:{name:Ga.$type,properties:{name:{name:Ga.name},type:{name:Ga.type}},superTypes:[lt.$type]},TypeAttribute:{name:si.$type,properties:{defaultValue:{name:si.defaultValue},isOptional:{name:si.isOptional,defaultValue:!1},name:{name:si.name},type:{name:si.type}},superTypes:[]},TypeDefinition:{name:oi.$type,properties:{},superTypes:[]},UnionType:{name:Xc.$type,properties:{types:{name:Xc.types,defaultValue:[]}},superTypes:[oi.$type]},UnorderedGroup:{name:ja.$type,properties:{cardinality:{name:ja.cardinality},elements:{name:ja.elements,defaultValue:[]}},superTypes:[Xe.$type]},UntilToken:{name:Yr.$type,properties:{cardinality:{name:Yr.cardinality},lookahead:{name:Yr.lookahead},parenthesized:{name:Yr.parenthesized,defaultValue:!1},terminal:{name:Yr.terminal}},superTypes:[et.$type]},ValueLiteral:{name:li.$type,properties:{},superTypes:[]},Wildcard:{name:$i.$type,properties:{cardinality:{name:$i.cardinality},lookahead:{name:$i.lookahead},parenthesized:{name:$i.parenthesized,defaultValue:!1}},superTypes:[et.$type]}}}}const Y=new Nd;function Po(t){return new mc(t,e=>Ii(e)?e.content:[],{includeRoot:!0})}function cm(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function Oo(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function Za(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 um(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 fm(t,e){return um(t,e)>Mt.After}const dm=/^[\w\p{L}]$/u;function hm(t,e){if(t){const r=pm(t,!0);if(r&&Yc(r,e))return r;if($d(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(Yc(a,e))return a}}}}function Yc(t,e){return Ad(t)&&e.includes(t.tokenType.name)}function pm(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 _d extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}}function qi(t,e="Error: Got unexpected value."){throw new Error(e)}function U(t){return t.charCodeAt(0)}function Zs(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function ci(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function Fr(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function mm(){throw Error("Internal Error - Should never get here!")}function Jc(t){return t.type==="Character"}const Qa=[];for(let t=U("0");t<=U("9");t++)Qa.push(t);const es=[U("_")].concat(Qa);for(let t=U("a");t<=U("z");t++)es.push(t);for(let t=U("A");t<=U("Z");t++)es.push(t);const Zc=[U(" "),U("\f"),U(`
2
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")],gm=/[0-9a-fA-F]/,Ra=/[0-9]/,ym=/[1-9]/;class Id{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":ci(n,"global");break;case"i":ci(n,"ignoreCase");break;case"m":ci(n,"multiLine");break;case"u":ci(n,"unicode");break;case"y":ci(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}}Fr(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return mm()}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;Fr(r);break}if(!(e===!0&&r===void 0)&&Fr(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()),Fr(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
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=Qa;break;case"D":e=Qa,r=!0;break;case"s":e=Zc;break;case"S":e=Zc,r=!0;break;case"w":e=es;break;case"W":e=es,r=!0;break}if(Fr(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
4
  `);break;case"r":e=U("\r");break;case"t":e=U(" ");break;case"v":e=U("\v");break}if(Fr(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`
@@ -110,7 +110,7 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis
110
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
111
  Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
112
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}}Ji.DEFER_DEFINITION_ERRORS_HANDLING=!1;By(Ji,[vy,$y,Ly,xy,My,Dy,Fy,jy,Uy]);class Wy extends Ji{constructor(e,r=Wt){const n=Object.assign({},r);n.outputCst=!1,super(e,n)}}function bn(t,e,r){return`${t.name}_${e}_${r}`}const cr=1,Ky=2,yh=4,Th=5,Kn=7,Vy=8,qy=9,Hy=10,Xy=11,Rh=12;class bc{constructor(e){this.target=e}isEpsilon(){return!1}}class kc extends bc{constructor(e,r){super(e),this.tokenType=r}}class vh extends bc{constructor(e){super(e)}isEpsilon(){return!0}}class Nc extends bc{constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}}function Yy(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};Jy(e,t);const r=t.length;for(let n=0;n<r;n++){const i=t[n],a=Or(e,i,i);a!==void 0&&lT(e,i,a)}return e}function Jy(t,e){const r=e.length;for(let n=0;n<r;n++){const i=e[n],a=_e(t,i,void 0,{type:Ky}),s=_e(t,i,void 0,{type:Kn});a.stop=s,t.ruleToStartState.set(i,a),t.ruleToStopState.set(i,s)}}function Eh(t,e,r){return r instanceof se?_c(t,e,r.terminalType,r):r instanceof ze?oT(t,e,r):r instanceof qe?rT(t,e,r):r instanceof De?nT(t,e,r):r instanceof Te?Zy(t,e,r):r instanceof Ve?Qy(t,e,r):r instanceof Ze?eT(t,e,r):r instanceof Qe?tT(t,e,r):Or(t,e,r)}function Zy(t,e,r){const n=_e(t,e,r,{type:Th});dr(t,n);const i=Vn(t,e,n,r,Or(t,e,r));return $h(t,e,r,i)}function Qy(t,e,r){const n=_e(t,e,r,{type:Th});dr(t,n);const i=Vn(t,e,n,r,Or(t,e,r)),a=_c(t,e,r.separator,r);return $h(t,e,r,i,a)}function eT(t,e,r){const n=_e(t,e,r,{type:yh});dr(t,n);const i=Vn(t,e,n,r,Or(t,e,r));return Ah(t,e,r,i)}function tT(t,e,r){const n=_e(t,e,r,{type:yh});dr(t,n);const i=Vn(t,e,n,r,Or(t,e,r)),a=_c(t,e,r.separator,r);return Ah(t,e,r,i,a)}function rT(t,e,r){const n=_e(t,e,r,{type:cr});dr(t,n);const i=Gt(r.definition,s=>Eh(t,e,s));return Vn(t,e,n,r,...i)}function nT(t,e,r){const n=_e(t,e,r,{type:cr});dr(t,n);const i=Vn(t,e,n,r,Or(t,e,r));return iT(t,e,r,i)}function Or(t,e,r){const n=Fp(Gt(r.definition,i=>Eh(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:sT(t,n)}function Ah(t,e,r,n,i){const a=n.left,s=n.right,o=_e(t,e,r,{type:Xy});dr(t,o);const l=_e(t,e,r,{type:Rh});return a.loopback=o,l.loopback=o,t.decisionMap[bn(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,Se(s,o),i===void 0?(Se(o,a),Se(o,l)):(Se(o,l),Se(o,i.left),Se(i.right,a)),{left:a,right:l}}function $h(t,e,r,n,i){const a=n.left,s=n.right,o=_e(t,e,r,{type:Hy});dr(t,o);const l=_e(t,e,r,{type:Rh}),c=_e(t,e,r,{type:qy});return o.loopback=c,l.loopback=c,Se(o,a),Se(o,l),Se(s,c),i!==void 0?(Se(c,l),Se(c,i.left),Se(i.right,a)):Se(c,o),t.decisionMap[bn(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}function iT(t,e,r,n){const i=n.left,a=n.right;return Se(i,a),t.decisionMap[bn(e,"Option",r.idx)]=i,n}function dr(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function Vn(t,e,r,n,...i){const a=_e(t,e,n,{type:Vy,start:r});r.end=a;for(const o of i)o!==void 0?(Se(r,o.left),Se(o.right,a)):Se(r,a);const s={left:r,right:a};return t.decisionMap[bn(e,aT(n),n.idx)]=r,s}function aT(t){if(t instanceof qe)return"Alternation";if(t instanceof De)return"Option";if(t instanceof Te)return"Repetition";if(t instanceof Ve)return"RepetitionWithSeparator";if(t instanceof Ze)return"RepetitionMandatory";if(t instanceof Qe)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function sT(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 Nc,c=o,u=e[a+1].left;s.left.type===cr&&s.right.type===cr&&o!==void 0&&(l&&c.followState===s.right||o.target===s.right)?(l?c.followState=u:o.target=u,cT(t,s.right)):Se(s.right,u)}const n=e[0],i=e[r-1];return{left:n.left,right:i.right}}function _c(t,e,r,n){const i=_e(t,e,n,{type:cr}),a=_e(t,e,n,{type:cr});return Ic(i,new kc(a,r)),{left:i,right:a}}function oT(t,e,r){const n=r.referencedRule,i=t.ruleToStartState.get(n),a=_e(t,e,r,{type:cr}),s=_e(t,e,r,{type:cr}),o=new Nc(i,n,s);return Ic(a,o),{left:a,right:s}}function lT(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 vh(e);Ic(t,r)}function _e(t,e,r,n){const i=Object.assign({atn:t,production:r,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},n);return t.states.push(i),i}function Ic(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function cT(t,e){t.states.splice(t.states.indexOf(e),1)}const os={};class Wo{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const r=Ch(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 Ch(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}function uT(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 Sh{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 Au=new Sh;class fT extends wc{constructor(e){var r,n;super(),this.logging=(r=e==null?void 0:e.logging)!==null&&r!==void 0?r:i=>console.log(i),this.incomplete=(n=e==null?void 0:e.incomplete)!==null&&n!==void 0?n:!1}initialize(e){this.atn=Yy(e.rules),this.dfas=dT(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=this.incomplete,c=bn(n,"Alternation",r),d=this.atn.decisionMap[c].decision,m=Gt(pu({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),g=>Gt(g,E=>E[0]));if($u(m,!1)&&!a){const g=jc(m,(E,k,P)=>(Xs(k,w=>{w&&(E[w.tokenTypeIdx]=P,Xs(w.categoryMatches,_=>{E[_]=P}))}),E),{});return i?function(E){var k;const P=this.LA_FAST(1),w=g[P.tokenTypeIdx];if(E!==void 0&&w!==void 0){const _=(k=E[w])===null||k===void 0?void 0:k.GATE;if(_!==void 0&&_.call(this)===!1)return}return w}:function(){const E=this.LA_FAST(1);return g[E.tokenTypeIdx]}}else return i?function(g){const E=new Sh,k=g===void 0?0:g.length;for(let w=0;w<k;w++){const _=g==null?void 0:g[w].GATE;E.set(w,_===void 0||_.call(this))}const P=ao.call(this,s,d,E,o,l);return typeof P=="number"?P:void 0}:function(){const g=ao.call(this,s,d,Au,o,l);return typeof g=="number"?g:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:r,rule:n,prodType:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=this.incomplete,c=bn(n,i,r),d=this.atn.decisionMap[c].decision,m=Gt(pu({maxLookahead:1,occurrence:r,prodType:i,rule:n}),g=>Gt(g,E=>E[0]));if($u(m)&&m[0][0]&&!a){const g=m[0],E=Op(g);if(E.length===1&&Ip(E[0].categoryMatches)){const P=E[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===P}}else{const k=jc(E,(P,w)=>(w!==void 0&&(P[w.tokenTypeIdx]=!0,Xs(w.categoryMatches,_=>{P[_]=!0})),P),{});return function(){const P=this.LA_FAST(1);return k[P.tokenTypeIdx]===!0}}}return function(){const g=ao.call(this,s,d,Au,o,l);return typeof g=="object"?!1:g===0}}}function $u(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 dT(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=uT(t.decisionStates[n],n);return r}function ao(t,e,r,n,i){const a=t[e](r);let s=a.start;if(s===void 0){const l=$T(a.atnStartState);s=bh(a,wh(l)),a.start=s}return hT.apply(this,[a,s,r,n,i])}function hT(t,e,r,n,i){let a=e,s=1;const o=[];let l=this.LA_FAST(s++);for(;;){let c=RT(a,l);if(c===void 0&&(c=pT.apply(this,[t,a,l,s,r,n])),c===os)return TT(o,a,l);if(c.isAcceptState===!0){if(i===!0&&$c(l,Bt)){const u=IT(a,r);if(u!==void 0)return u}return c.prediction}a=c,o.push(l),l=this.LA(s++)}}function pT(t,e,r,n,i,a){const s=vT(e.configs,r,i);if(s.size===0)return Cu(t,e,r,os),os;let o=wh(s);const l=AT(s,i);if(l!==void 0)o.isAcceptState=!0,o.prediction=l,o.configs.uniqueAlt=l;else if(bT(s)){const c=Lp(s.alts);o.isAcceptState=!0,o.prediction=c,o.configs.uniqueAlt=c,mT.apply(this,[t,n,s.alts,a])}return o=Cu(t,e,r,o),o}function mT(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=gT({topLevelRule:s,ambiguityIndices:r,production:o,prefixPath:i});n(l)}function gT(t){const e=Gt(t.prefixPath,i=>an(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${yT(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,
113
+ For further details.`);this.skipValidations=Object.hasOwn(r,"skipValidations")?r.skipValidations:Wt.skipValidations}}Ji.DEFER_DEFINITION_ERRORS_HANDLING=!1;By(Ji,[vy,$y,Ly,xy,My,Dy,Fy,jy,Uy]);class Wy extends Ji{constructor(e,r=Wt){const n=Object.assign({},r);n.outputCst=!1,super(e,n)}}function bn(t,e,r){return`${t.name}_${e}_${r}`}const cr=1,Ky=2,yh=4,Th=5,Kn=7,Vy=8,qy=9,Hy=10,Xy=11,Rh=12;class bc{constructor(e){this.target=e}isEpsilon(){return!1}}class kc extends bc{constructor(e,r){super(e),this.tokenType=r}}class vh extends bc{constructor(e){super(e)}isEpsilon(){return!0}}class Nc extends bc{constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}}function Yy(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};Jy(e,t);const r=t.length;for(let n=0;n<r;n++){const i=t[n],a=Or(e,i,i);a!==void 0&&lT(e,i,a)}return e}function Jy(t,e){const r=e.length;for(let n=0;n<r;n++){const i=e[n],a=_e(t,i,void 0,{type:Ky}),s=_e(t,i,void 0,{type:Kn});a.stop=s,t.ruleToStartState.set(i,a),t.ruleToStopState.set(i,s)}}function Eh(t,e,r){return r instanceof se?_c(t,e,r.terminalType,r):r instanceof ze?oT(t,e,r):r instanceof qe?rT(t,e,r):r instanceof De?nT(t,e,r):r instanceof Te?Zy(t,e,r):r instanceof Ve?Qy(t,e,r):r instanceof Ze?eT(t,e,r):r instanceof Qe?tT(t,e,r):Or(t,e,r)}function Zy(t,e,r){const n=_e(t,e,r,{type:Th});dr(t,n);const i=Vn(t,e,n,r,Or(t,e,r));return $h(t,e,r,i)}function Qy(t,e,r){const n=_e(t,e,r,{type:Th});dr(t,n);const i=Vn(t,e,n,r,Or(t,e,r)),a=_c(t,e,r.separator,r);return $h(t,e,r,i,a)}function eT(t,e,r){const n=_e(t,e,r,{type:yh});dr(t,n);const i=Vn(t,e,n,r,Or(t,e,r));return Ah(t,e,r,i)}function tT(t,e,r){const n=_e(t,e,r,{type:yh});dr(t,n);const i=Vn(t,e,n,r,Or(t,e,r)),a=_c(t,e,r.separator,r);return Ah(t,e,r,i,a)}function rT(t,e,r){const n=_e(t,e,r,{type:cr});dr(t,n);const i=Gt(r.definition,s=>Eh(t,e,s));return Vn(t,e,n,r,...i)}function nT(t,e,r){const n=_e(t,e,r,{type:cr});dr(t,n);const i=Vn(t,e,n,r,Or(t,e,r));return iT(t,e,r,i)}function Or(t,e,r){const n=Mp(Gt(r.definition,i=>Eh(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:sT(t,n)}function Ah(t,e,r,n,i){const a=n.left,s=n.right,o=_e(t,e,r,{type:Xy});dr(t,o);const l=_e(t,e,r,{type:Rh});return a.loopback=o,l.loopback=o,t.decisionMap[bn(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,Se(s,o),i===void 0?(Se(o,a),Se(o,l)):(Se(o,l),Se(o,i.left),Se(i.right,a)),{left:a,right:l}}function $h(t,e,r,n,i){const a=n.left,s=n.right,o=_e(t,e,r,{type:Hy});dr(t,o);const l=_e(t,e,r,{type:Rh}),c=_e(t,e,r,{type:qy});return o.loopback=c,l.loopback=c,Se(o,a),Se(o,l),Se(s,c),i!==void 0?(Se(c,l),Se(c,i.left),Se(i.right,a)):Se(c,o),t.decisionMap[bn(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}function iT(t,e,r,n){const i=n.left,a=n.right;return Se(i,a),t.decisionMap[bn(e,"Option",r.idx)]=i,n}function dr(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function Vn(t,e,r,n,...i){const a=_e(t,e,n,{type:Vy,start:r});r.end=a;for(const o of i)o!==void 0?(Se(r,o.left),Se(o.right,a)):Se(r,a);const s={left:r,right:a};return t.decisionMap[bn(e,aT(n),n.idx)]=r,s}function aT(t){if(t instanceof qe)return"Alternation";if(t instanceof De)return"Option";if(t instanceof Te)return"Repetition";if(t instanceof Ve)return"RepetitionWithSeparator";if(t instanceof Ze)return"RepetitionMandatory";if(t instanceof Qe)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function sT(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 Nc,c=o,u=e[a+1].left;s.left.type===cr&&s.right.type===cr&&o!==void 0&&(l&&c.followState===s.right||o.target===s.right)?(l?c.followState=u:o.target=u,cT(t,s.right)):Se(s.right,u)}const n=e[0],i=e[r-1];return{left:n.left,right:i.right}}function _c(t,e,r,n){const i=_e(t,e,n,{type:cr}),a=_e(t,e,n,{type:cr});return Ic(i,new kc(a,r)),{left:i,right:a}}function oT(t,e,r){const n=r.referencedRule,i=t.ruleToStartState.get(n),a=_e(t,e,r,{type:cr}),s=_e(t,e,r,{type:cr}),o=new Nc(i,n,s);return Ic(a,o),{left:a,right:s}}function lT(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 vh(e);Ic(t,r)}function _e(t,e,r,n){const i=Object.assign({atn:t,production:r,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},n);return t.states.push(i),i}function Ic(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function cT(t,e){t.states.splice(t.states.indexOf(e),1)}const os={};class Wo{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const r=Ch(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 Ch(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}function uT(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 Sh{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 Au=new Sh;class fT extends wc{constructor(e){var r,n;super(),this.logging=(r=e==null?void 0:e.logging)!==null&&r!==void 0?r:i=>console.log(i),this.incomplete=(n=e==null?void 0:e.incomplete)!==null&&n!==void 0?n:!1}initialize(e){this.atn=Yy(e.rules),this.dfas=dT(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=this.incomplete,c=bn(n,"Alternation",r),d=this.atn.decisionMap[c].decision,m=Gt(pu({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),g=>Gt(g,E=>E[0]));if($u(m,!1)&&!a){const g=jc(m,(E,k,P)=>(Xs(k,w=>{w&&(E[w.tokenTypeIdx]=P,Xs(w.categoryMatches,_=>{E[_]=P}))}),E),{});return i?function(E){var k;const P=this.LA_FAST(1),w=g[P.tokenTypeIdx];if(E!==void 0&&w!==void 0){const _=(k=E[w])===null||k===void 0?void 0:k.GATE;if(_!==void 0&&_.call(this)===!1)return}return w}:function(){const E=this.LA_FAST(1);return g[E.tokenTypeIdx]}}else return i?function(g){const E=new Sh,k=g===void 0?0:g.length;for(let w=0;w<k;w++){const _=g==null?void 0:g[w].GATE;E.set(w,_===void 0||_.call(this))}const P=ao.call(this,s,d,E,o,l);return typeof P=="number"?P:void 0}:function(){const g=ao.call(this,s,d,Au,o,l);return typeof g=="number"?g:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:r,rule:n,prodType:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=this.incomplete,c=bn(n,i,r),d=this.atn.decisionMap[c].decision,m=Gt(pu({maxLookahead:1,occurrence:r,prodType:i,rule:n}),g=>Gt(g,E=>E[0]));if($u(m)&&m[0][0]&&!a){const g=m[0],E=Pp(g);if(E.length===1&&Fp(E[0].categoryMatches)){const P=E[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===P}}else{const k=jc(E,(P,w)=>(w!==void 0&&(P[w.tokenTypeIdx]=!0,Xs(w.categoryMatches,_=>{P[_]=!0})),P),{});return function(){const P=this.LA_FAST(1);return k[P.tokenTypeIdx]===!0}}}return function(){const g=ao.call(this,s,d,Au,o,l);return typeof g=="object"?!1:g===0}}}function $u(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 dT(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=uT(t.decisionStates[n],n);return r}function ao(t,e,r,n,i){const a=t[e](r);let s=a.start;if(s===void 0){const l=$T(a.atnStartState);s=bh(a,wh(l)),a.start=s}return hT.apply(this,[a,s,r,n,i])}function hT(t,e,r,n,i){let a=e,s=1;const o=[];let l=this.LA_FAST(s++);for(;;){let c=RT(a,l);if(c===void 0&&(c=pT.apply(this,[t,a,l,s,r,n])),c===os)return TT(o,a,l);if(c.isAcceptState===!0){if(i===!0&&$c(l,Bt)){const u=IT(a,r);if(u!==void 0)return u}return c.prediction}a=c,o.push(l),l=this.LA(s++)}}function pT(t,e,r,n,i,a){const s=vT(e.configs,r,i);if(s.size===0)return Cu(t,e,r,os),os;let o=wh(s);const l=AT(s,i);if(l!==void 0)o.isAcceptState=!0,o.prediction=l,o.configs.uniqueAlt=l;else if(bT(s)){const c=Op(s.alts);o.isAcceptState=!0,o.prediction=c,o.configs.uniqueAlt=c,mT.apply(this,[t,n,s.alts,a])}return o=Cu(t,e,r,o),o}function mT(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=gT({topLevelRule:s,ambiguityIndices:r,production:o,prefixPath:i});n(l)}function gT(t){const e=Gt(t.prefixPath,i=>an(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${yT(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,
114
114
  <${e}> may appears as a prefix path in all these alternatives.
115
115
  `;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
116
116
  For Further details.`,n}function yT(t){if(t instanceof ze)return"SUBRULE";if(t instanceof De)return"OPTION";if(t instanceof qe)return"OR";if(t instanceof Ze)return"AT_LEAST_ONE";if(t instanceof Qe)return"AT_LEAST_ONE_SEP";if(t instanceof Ve)return"MANY_SEP";if(t instanceof Te)return"MANY";if(t instanceof se)return"CONSUME";throw Error("non exhaustive match")}function TT(t,e,r){const n=Gp(e.configs.elements,a=>a.state.transitions),i=jp(n.filter(a=>a instanceof kc).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function RT(t,e){return t.edges[e.tokenTypeIdx]}function vT(t,e,r){const n=new Wo,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===Kn){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l<o;l++){const c=s.state.transitions[l],u=ET(c,e);u!==void 0&&n.add({state:u,alt:s.alt,stack:s.stack})}}let a;if(i.length===0&&n.size===1&&(a=n),a===void 0){a=new Wo;for(const s of n.elements)ls(s,a)}if(i.length>0&&!ST(a))for(const s of i)a.add(s);return a}function ET(t,e){if(t instanceof kc&&$c(e,t.tokenType))return t.target}function AT(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 wh(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function Cu(t,e,r,n){return n=bh(t,n),e.edges[r.tokenTypeIdx]=n,n}function bh(t,e){if(e===os)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 $T(t){const e=new Wo,r=t.transitions.length;for(let n=0;n<r;n++){const a={state:t.transitions[n].target,alt:n,stack:[]};ls(a,e)}return e}function ls(t,e){const r=t.state;if(r.type===Kn){if(t.stack.length>0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};ls(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=CT(t,a);s!==void 0&&ls(s,e)}}function CT(t,e){if(e instanceof vh)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Nc){const r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}function ST(t){for(const e of t.elements)if(e.state.type===Kn)return!0;return!1}function wT(t){for(const e of t.elements)if(e.state.type!==Kn)return!1;return!0}function bT(t){if(wT(t))return!0;const e=kT(t.elements);return NT(e)&&!_T(e)}function kT(t){const e=new Map;for(const r of t){const n=Ch(r,!1);let i=e.get(n);i===void 0&&(i={},e.set(n,i)),i[r.alt]=!0}return e}function NT(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function _T(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}function IT(t,e){let r;for(const n of t.configs.elements)if(!(e.is(n.alt)===!1||n.state.type===Kn)){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}var Ko;(function(t){function e(r){return typeof r=="string"}t.is=e})(Ko||(Ko={}));var cs;(function(t){function e(r){return typeof r=="string"}t.is=e})(cs||(cs={}));var Vo;(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})(Vo||(Vo={}));var Oi;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(Oi||(Oi={}));var J;(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=Oi.MAX_VALUE),i===Number.MAX_VALUE&&(i=Oi.MAX_VALUE),{line:n,character:i}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&v.uinteger(i.line)&&v.uinteger(i.character)}t.is=r})(J||(J={}));var V;(function(t){function e(n,i,a,s){if(v.uinteger(n)&&v.uinteger(i)&&v.uinteger(a)&&v.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 v.objectLiteral(i)&&J.is(i.start)&&J.is(i.end)}t.is=r})(V||(V={}));var Li;(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&V.is(i.range)&&(v.string(i.uri)||v.undefined(i.uri))}t.is=r})(Li||(Li={}));var qo;(function(t){function e(n,i,a,s){return{targetUri:n,targetRange:i,targetSelectionRange:a,originSelectionRange:s}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&V.is(i.targetRange)&&v.string(i.targetUri)&&V.is(i.targetSelectionRange)&&(V.is(i.originSelectionRange)||v.undefined(i.originSelectionRange))}t.is=r})(qo||(qo={}));var us;(function(t){function e(n,i,a,s){return{red:n,green:i,blue:a,alpha:s}}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&v.numberRange(i.red,0,1)&&v.numberRange(i.green,0,1)&&v.numberRange(i.blue,0,1)&&v.numberRange(i.alpha,0,1)}t.is=r})(us||(us={}));var Ho;(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&V.is(i.range)&&us.is(i.color)}t.is=r})(Ho||(Ho={}));var Xo;(function(t){function e(n,i,a){return{label:n,textEdit:i,additionalTextEdits:a}}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&v.string(i.label)&&(v.undefined(i.textEdit)||vt.is(i))&&(v.undefined(i.additionalTextEdits)||v.typedArray(i.additionalTextEdits,vt.is))}t.is=r})(Xo||(Xo={}));var Yo;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Yo||(Yo={}));var Jo;(function(t){function e(n,i,a,s,o,l){const c={startLine:n,endLine:i};return v.defined(a)&&(c.startCharacter=a),v.defined(s)&&(c.endCharacter=s),v.defined(o)&&(c.kind=o),v.defined(l)&&(c.collapsedText=l),c}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&v.uinteger(i.startLine)&&v.uinteger(i.startLine)&&(v.undefined(i.startCharacter)||v.uinteger(i.startCharacter))&&(v.undefined(i.endCharacter)||v.uinteger(i.endCharacter))&&(v.undefined(i.kind)||v.string(i.kind))}t.is=r})(Jo||(Jo={}));var fs;(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&Li.is(i.location)&&v.string(i.message)}t.is=r})(fs||(fs={}));var Zo;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Zo||(Zo={}));var Qo;(function(t){t.Unnecessary=1,t.Deprecated=2})(Qo||(Qo={}));var el;(function(t){function e(r){const n=r;return v.objectLiteral(n)&&v.string(n.href)}t.is=e})(el||(el={}));var xi;(function(t){function e(n,i,a,s,o,l){let c={range:n,message:i};return v.defined(a)&&(c.severity=a),v.defined(s)&&(c.code=s),v.defined(o)&&(c.source=o),v.defined(l)&&(c.relatedInformation=l),c}t.create=e;function r(n){var i;let a=n;return v.defined(a)&&V.is(a.range)&&v.string(a.message)&&(v.number(a.severity)||v.undefined(a.severity))&&(v.integer(a.code)||v.string(a.code)||v.undefined(a.code))&&(v.undefined(a.codeDescription)||v.string((i=a.codeDescription)===null||i===void 0?void 0:i.href))&&(v.string(a.source)||v.undefined(a.source))&&(v.undefined(a.relatedInformation)||v.typedArray(a.relatedInformation,fs.is))}t.is=r})(xi||(xi={}));var Ir;(function(t){function e(n,i,...a){let s={title:n,command:i};return v.defined(a)&&a.length>0&&(s.arguments=a),s}t.create=e;function r(n){let i=n;return v.defined(i)&&v.string(i.title)&&v.string(i.command)}t.is=r})(Ir||(Ir={}));var vt;(function(t){function e(a,s){return{range:a,newText:s}}t.replace=e;function r(a,s){return{range:{start:a,end:a},newText:s}}t.insert=r;function n(a){return{range:a,newText:""}}t.del=n;function i(a){const s=a;return v.objectLiteral(s)&&v.string(s.newText)&&V.is(s.range)}t.is=i})(vt||(vt={}));var wr;(function(t){function e(n,i,a){const s={label:n};return i!==void 0&&(s.needsConfirmation=i),a!==void 0&&(s.description=a),s}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&v.string(i.label)&&(v.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(v.string(i.description)||i.description===void 0)}t.is=r})(wr||(wr={}));var xe;(function(t){function e(r){const n=r;return v.string(n)}t.is=e})(xe||(xe={}));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 vt.is(s)&&(wr.is(s.annotationId)||xe.is(s.annotationId))}t.is=i})(Ft||(Ft={}));var Di;(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&Mi.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(Di||(Di={}));var kn;(function(t){function e(n,i,a){let s={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(s.options=i),a!==void 0&&(s.annotationId=a),s}t.create=e;function r(n){let i=n;return i&&i.kind==="create"&&v.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||v.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||v.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||xe.is(i.annotationId))}t.is=r})(kn||(kn={}));var Nn;(function(t){function e(n,i,a,s){let o={kind:"rename",oldUri:n,newUri:i};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}t.create=e;function r(n){let i=n;return i&&i.kind==="rename"&&v.string(i.oldUri)&&v.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||v.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||v.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||xe.is(i.annotationId))}t.is=r})(Nn||(Nn={}));var _n;(function(t){function e(n,i,a){let s={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(s.options=i),a!==void 0&&(s.annotationId=a),s}t.create=e;function r(n){let i=n;return i&&i.kind==="delete"&&v.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||v.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||v.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||xe.is(i.annotationId))}t.is=r})(_n||(_n={}));var ds;(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(i=>v.string(i.kind)?kn.is(i)||Nn.is(i)||_n.is(i):Di.is(i)))}t.is=e})(ds||(ds={}));class $a{constructor(e,r){this.edits=e,this.changeAnnotations=r}insert(e,r,n){let i,a;if(n===void 0?i=vt.insert(e,r):xe.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=vt.replace(e,r):xe.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=vt.del(e):xe.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 Su{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(xe.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 PT{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Su(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(r=>{if(Di.is(r)){const n=new $a(r.edits,this._changeAnnotations);this._textEditChanges[r.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(r=>{const n=new $a(e.changes[r]);this._textEditChanges[r]=n})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(Mi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const r={uri:e.uri,version:e.version};let n=this._textEditChanges[r.uri];if(!n){const i=[],a={textDocument:r,edits:i};this._workspaceEdit.documentChanges.push(a),n=new $a(i,this._changeAnnotations),this._textEditChanges[r.uri]=n}return n}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let r=this._textEditChanges[e];if(!r){let n=[];this._workspaceEdit.changes[e]=n,r=new $a(n),this._textEditChanges[e]=r}return r}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Su,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;wr.is(r)||xe.is(r)?i=r:n=r;let a,s;if(i===void 0?a=kn.create(e,n):(s=xe.is(i)?i:this._changeAnnotations.manage(i),a=kn.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;wr.is(n)||xe.is(n)?a=n:i=n;let s,o;if(a===void 0?s=Nn.create(e,r,i):(o=xe.is(a)?a:this._changeAnnotations.manage(a),s=Nn.create(e,r,i,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}deleteFile(e,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;wr.is(r)||xe.is(r)?i=r:n=r;let a,s;if(i===void 0?a=_n.create(e,n):(s=xe.is(i)?i:this._changeAnnotations.manage(i),a=_n.create(e,n,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}}var tl;(function(t){function e(n){return{uri:n}}t.create=e;function r(n){let i=n;return v.defined(i)&&v.string(i.uri)}t.is=r})(tl||(tl={}));var rl;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&v.string(i.uri)&&v.integer(i.version)}t.is=r})(rl||(rl={}));var Mi;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&v.string(i.uri)&&(i.version===null||v.integer(i.version))}t.is=r})(Mi||(Mi={}));var nl;(function(t){function e(n,i,a,s){return{uri:n,languageId:i,version:a,text:s}}t.create=e;function r(n){let i=n;return v.defined(i)&&v.string(i.uri)&&v.string(i.languageId)&&v.integer(i.version)&&v.string(i.text)}t.is=r})(nl||(nl={}));var hs;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){const n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(hs||(hs={}));var In;(function(t){function e(r){const n=r;return v.objectLiteral(r)&&hs.is(n.kind)&&v.string(n.value)}t.is=e})(In||(In={}));var il;(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})(il||(il={}));var al;(function(t){t.PlainText=1,t.Snippet=2})(al||(al={}));var sl;(function(t){t.Deprecated=1})(sl||(sl={}));var ol;(function(t){function e(n,i,a){return{newText:n,insert:i,replace:a}}t.create=e;function r(n){const i=n;return i&&v.string(i.newText)&&V.is(i.insert)&&V.is(i.replace)}t.is=r})(ol||(ol={}));var ll;(function(t){t.asIs=1,t.adjustIndentation=2})(ll||(ll={}));var cl;(function(t){function e(r){const n=r;return n&&(v.string(n.detail)||n.detail===void 0)&&(v.string(n.description)||n.description===void 0)}t.is=e})(cl||(cl={}));var ul;(function(t){function e(r){return{label:r}}t.create=e})(ul||(ul={}));var fl;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(fl||(fl={}));var Fi;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function r(n){const i=n;return v.string(i)||v.objectLiteral(i)&&v.string(i.language)&&v.string(i.value)}t.is=r})(Fi||(Fi={}));var dl;(function(t){function e(r){let n=r;return!!n&&v.objectLiteral(n)&&(In.is(n.contents)||Fi.is(n.contents)||v.typedArray(n.contents,Fi.is))&&(r.range===void 0||V.is(r.range))}t.is=e})(dl||(dl={}));var hl;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(hl||(hl={}));var pl;(function(t){function e(r,n,...i){let a={label:r};return v.defined(n)&&(a.documentation=n),v.defined(i)?a.parameters=i:a.parameters=[],a}t.create=e})(pl||(pl={}));var ml;(function(t){t.Text=1,t.Read=2,t.Write=3})(ml||(ml={}));var gl;(function(t){function e(r,n){let i={range:r};return v.number(n)&&(i.kind=n),i}t.create=e})(gl||(gl={}));var yl;(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})(yl||(yl={}));var Tl;(function(t){t.Deprecated=1})(Tl||(Tl={}));var Rl;(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})(Rl||(Rl={}));var vl;(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})(vl||(vl={}));var El;(function(t){function e(n,i,a,s,o,l){let c={name:n,detail:i,kind:a,range:s,selectionRange:o};return l!==void 0&&(c.children=l),c}t.create=e;function r(n){let i=n;return i&&v.string(i.name)&&v.number(i.kind)&&V.is(i.range)&&V.is(i.selectionRange)&&(i.detail===void 0||v.string(i.detail))&&(i.deprecated===void 0||v.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=r})(El||(El={}));var Al;(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"})(Al||(Al={}));var Gi;(function(t){t.Invoked=1,t.Automatic=2})(Gi||(Gi={}));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 v.defined(i)&&v.typedArray(i.diagnostics,xi.is)&&(i.only===void 0||v.typedArray(i.only,v.string))&&(i.triggerKind===void 0||i.triggerKind===Gi.Invoked||i.triggerKind===Gi.Automatic)}t.is=r})($l||($l={}));var Cl;(function(t){function e(n,i,a){let s={title:n},o=!0;return typeof i=="string"?(o=!1,s.kind=i):Ir.is(i)?s.command=i:s.edit=i,o&&a!==void 0&&(s.kind=a),s}t.create=e;function r(n){let i=n;return i&&v.string(i.title)&&(i.diagnostics===void 0||v.typedArray(i.diagnostics,xi.is))&&(i.kind===void 0||v.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Ir.is(i.command))&&(i.isPreferred===void 0||v.boolean(i.isPreferred))&&(i.edit===void 0||ds.is(i.edit))}t.is=r})(Cl||(Cl={}));var Sl;(function(t){function e(n,i){let a={range:n};return v.defined(i)&&(a.data=i),a}t.create=e;function r(n){let i=n;return v.defined(i)&&V.is(i.range)&&(v.undefined(i.command)||Ir.is(i.command))}t.is=r})(Sl||(Sl={}));var wl;(function(t){function e(n,i){return{tabSize:n,insertSpaces:i}}t.create=e;function r(n){let i=n;return v.defined(i)&&v.uinteger(i.tabSize)&&v.boolean(i.insertSpaces)}t.is=r})(wl||(wl={}));var bl;(function(t){function e(n,i,a){return{range:n,target:i,data:a}}t.create=e;function r(n){let i=n;return v.defined(i)&&V.is(i.range)&&(v.undefined(i.target)||v.string(i.target))}t.is=r})(bl||(bl={}));var kl;(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return v.objectLiteral(i)&&V.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(kl||(kl={}));var Nl;(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"})(Nl||(Nl={}));var _l;(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"})(_l||(_l={}));var Il;(function(t){function e(r){const n=r;return v.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}t.is=e})(Il||(Il={}));var Pl;(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)&&v.string(i.text)}t.is=r})(Pl||(Pl={}));var Ol;(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)&&v.boolean(i.caseSensitiveLookup)&&(v.string(i.variableName)||i.variableName===void 0)}t.is=r})(Ol||(Ol={}));var Ll;(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)&&(v.string(i.expression)||i.expression===void 0)}t.is=r})(Ll||(Ll={}));var xl;(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){const i=n;return v.defined(i)&&V.is(n.stoppedLocation)}t.is=r})(xl||(xl={}));var ps;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(ps||(ps={}));var ms;(function(t){function e(n){return{value:n}}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&(i.tooltip===void 0||v.string(i.tooltip)||In.is(i.tooltip))&&(i.location===void 0||Li.is(i.location))&&(i.command===void 0||Ir.is(i.command))}t.is=r})(ms||(ms={}));var Dl;(function(t){function e(n,i,a){const s={position:n,label:i};return a!==void 0&&(s.kind=a),s}t.create=e;function r(n){const i=n;return v.objectLiteral(i)&&J.is(i.position)&&(v.string(i.label)||v.typedArray(i.label,ms.is))&&(i.kind===void 0||ps.is(i.kind))&&i.textEdits===void 0||v.typedArray(i.textEdits,vt.is)&&(i.tooltip===void 0||v.string(i.tooltip)||In.is(i.tooltip))&&(i.paddingLeft===void 0||v.boolean(i.paddingLeft))&&(i.paddingRight===void 0||v.boolean(i.paddingRight))}t.is=r})(Dl||(Dl={}));var Ml;(function(t){function e(r){return{kind:"snippet",value:r}}t.createSnippet=e})(Ml||(Ml={}));var Fl;(function(t){function e(r,n,i,a){return{insertText:r,filterText:n,range:i,command:a}}t.create=e})(Fl||(Fl={}));var Gl;(function(t){function e(r){return{items:r}}t.create=e})(Gl||(Gl={}));var jl;(function(t){t.Invoked=0,t.Automatic=1})(jl||(jl={}));var zl;(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(zl||(zl={}));var Ul;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(Ul||(Ul={}));var Bl;(function(t){function e(r){const n=r;return v.objectLiteral(n)&&cs.is(n.uri)&&v.string(n.name)}t.is=e})(Bl||(Bl={}));const OT=[`
@@ -148,7 +148,7 @@ ${JSON.stringify(h,null,4)}`);const C=h;if(r.string(C.id)||r.number(C.id)){const
148
148
 
149
149
  `:h.error===void 0&&(I=`No result returned.
150
150
 
151
- `)),C){const M=h.error?` Request failed: ${h.error.message} (${h.error.code}).`:"";me.log(`Received response '${C.method} - (${h.id})' in ${Date.now()-C.timerStart}ms.${M}`,I)}else me.log(`Received response ${h.id} without active response promise.`,I)}else Nt("receive-response",h)}function Nt(h,C){if(!me||X===m.Off)return;const I={isLSPMessage:!0,type:h,message:C,timestamp:Date.now()};me.log(I)}function Zt(){if(ei())throw new _(w.Closed,"Connection is closed.");if(kt())throw new _(w.Disposed,"Connection is disposed.")}function pa(){if(Qn())throw new _(w.AlreadyListening,"Connection is already listening")}function ma(){if(!Qn())throw new Error("Call listen() first.")}function Qt(h){return h===void 0?null:h}function ii(h){if(h!==null)return h}function f(h){return h!=null&&!Array.isArray(h)&&typeof h=="object"}function Ee(h,C){switch(h){case n.ParameterStructures.auto:return f(C)?ii(C):[Qt(C)];case n.ParameterStructures.byName:if(!f(C))throw new Error("Received parameters by name but param is not an object literal.");return ii(C);case n.ParameterStructures.byPosition:return[Qt(C)];default:throw new Error(`Unknown parameter structure ${h.toString()}`)}}function Ae(h,C){let I;const M=h.numberOfParams;switch(M){case 0:I=void 0;break;case 1:I=Ee(h.parameterStructures,C[0]);break;default:I=[];for(let ae=0;ae<C.length&&ae<M;ae++)I.push(Qt(C[ae]));if(C.length<M)for(let ae=C.length;ae<M;ae++)I.push(null);break}return I}const B={sendNotification:(h,...C)=>{Zt();let I,M;if(r.string(h)){I=h;const ne=C[0];let ie=0,$e=n.ParameterStructures.auto;n.ParameterStructures.is(ne)&&(ie=1,$e=ne);let H=C.length;const ce=H-ie;switch(ce){case 0:M=void 0;break;case 1:M=Ee($e,C[ie]);break;default:if($e===n.ParameterStructures.byName)throw new Error(`Received ${ce} parameters for 'by Name' notification parameter structure.`);M=C.slice(ie,H).map(te=>Qt(te));break}}else{const ne=C;I=h.method,M=Ae(h,ne)}const ae={jsonrpc:j,method:I,params:M};return fa(ae),$.write(ae).catch(ne=>{throw A.error("Sending notification failed."),ne})},onNotification:(h,C)=>{Zt();let I;return r.func(h)?z=h:C&&(r.string(h)?(I=h,ee.set(h,{type:void 0,handler:C})):(I=h.method,ee.set(h.method,{type:h,handler:C}))),{dispose:()=>{I!==void 0?ee.delete(I):z=void 0}}},onProgress:(h,C,I)=>{if(Ie.has(C))throw new Error(`Progress handler for token ${C} already registered`);return Ie.set(C,I),{dispose:()=>{Ie.delete(C)}}},sendProgress:(h,C,I)=>B.sendNotification(c.type,{token:C,value:I}),onUnhandledProgress:Yn.event,sendRequest:(h,...C)=>{Zt(),ma();let I,M,ae;if(r.string(h)){I=h;const H=C[0],ce=C[C.length-1];let te=0,Ne=n.ParameterStructures.auto;n.ParameterStructures.is(H)&&(te=1,Ne=H);let Ge=C.length;s.CancellationToken.is(ce)&&(Ge=Ge-1,ae=ce);const pt=Ge-te;switch(pt){case 0:M=void 0;break;case 1:M=Ee(Ne,C[te]);break;default:if(Ne===n.ParameterStructures.byName)throw new Error(`Received ${pt} parameters for 'by Name' request parameter structure.`);M=C.slice(te,Ge).map(kp=>Qt(kp));break}}else{const H=C;I=h.method,M=Ae(h,H);const ce=h.numberOfParams;ae=s.CancellationToken.is(H[ce])?H[ce]:void 0}const ne=O++;let ie;ae&&(ie=ae.onCancellationRequested(()=>{const H=st.sender.sendCancellation(B,ne);return H===void 0?(A.log(`Received no promise from cancellation strategy when cancelling id ${ne}`),Promise.resolve()):H.catch(()=>{A.log(`Sending cancellation messages for id ${ne} failed`)})}));const $e={jsonrpc:j,id:ne,method:I,params:M};return ua($e),typeof st.sender.enableCancellation=="function"&&st.sender.enableCancellation($e),new Promise(async(H,ce)=>{const te=pt=>{H(pt),st.sender.cleanup(ne),ie==null||ie.dispose()},Ne=pt=>{ce(pt),st.sender.cleanup(ne),ie==null||ie.dispose()},Ge={method:I,timerStart:Date.now(),resolve:te,reject:Ne};try{await $.write($e),ke.set(ne,Ge)}catch(pt){throw A.error("Sending request failed."),Ge.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,pt.message?pt.message:"Unknown reason")),pt}})},onRequest:(h,C)=>{Zt();let I=null;return d.is(h)?(I=void 0,F=h):r.string(h)?(I=null,C!==void 0&&(I=h,re.set(h,{handler:C,type:void 0}))):C!==void 0&&(I=h.method,re.set(h.method,{type:h,handler:C})),{dispose:()=>{I!==null&&(I!==void 0?re.delete(I):F=void 0)}}},hasPendingResponse:()=>ke.size>0,trace:async(h,C,I)=>{let M=!1,ae=E.Text;I!==void 0&&(r.boolean(I)?M=I:(M=I.sendNotification||!1,ae=I.traceFormat||E.Text)),X=h,He=ae,X===m.Off?me=void 0:me=C,M&&!ei()&&!kt()&&await B.sendNotification(k.type,{value:m.toString(h)})},onError:xr.event,onClose:Hn.event,onUnhandledNotification:Xn.event,onDispose:Jn.event,end:()=>{$.end()},dispose:()=>{if(kt())return;at=S.Disposed,Jn.fire(void 0);const h=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const C of ke.values())C.reject(h);ke=new Map,Ce=new Map,Pe=new Set,le=new i.LinkedMap,r.func($.dispose)&&$.dispose(),r.func(p.dispose)&&p.dispose()},listen:()=>{Zt(),pa(),at=S.Listening,p.listen(aa)},inspect:()=>{(0,e.default)().console.log("inspect")}};return B.onNotification(P.type,h=>{if(X===m.Off||!me)return;const C=X===m.Verbose||X===m.Compact;me.log(h.message,C?h.verbose:void 0)}),B.onNotification(c.type,h=>{const C=Ie.get(h.token);C?C(h.value):Yn.fire(h)}),B}t.createMessageConnection=R}(co)),co}var Uu;function ec(){return Uu||(Uu=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;const e=Vh();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=qh();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=zR();Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return n.Disposable}});const i=Et;Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const a=ur;Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return a.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return a.CancellationToken}});const s=UR();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return s.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return s.SharedArrayReceiverStrategy}});const o=BR();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=WR();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=KR();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return c.AbstractMessageBuffer}});const u=VR();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return u.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return u.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return u.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return u.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return u.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return u.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return u.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return u.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return u.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return u.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return u.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return u.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return u.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return u.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return u.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return u.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:function(){return u.MessageStrategy}});const d=Ht;t.RAL=d.default}(lo)),lo}Object.defineProperty(Mc,"__esModule",{value:!0});const Rt=ec();class Fs extends Rt.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return Fs.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)}}Fs.emptyBuffer=new Uint8Array(0);class qR{constructor(e){this.socket=e,this._onData=new Rt.Emitter,this._messageListener=r=>{r.data.arrayBuffer().then(i=>{this._onData.fire(new Uint8Array(i))},()=>{(0,Rt.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),Rt.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Rt.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Rt.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}}class HR{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),Rt.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Rt.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Rt.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 XR=new TextEncoder,Xh=Object.freeze({messageBuffer:Object.freeze({create:t=>new Fs(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(XR.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 qR(t),asWritableStream:t=>new HR(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 tc(){return Xh}(function(t){function e(){Rt.RAL.install(Xh)}t.install=e})(tc||(tc={}));Mc.default=tc;(function(t){var e=rt&&rt.__createBinding||(Object.create?function(l,c,u,d){d===void 0&&(d=u);var m=Object.getOwnPropertyDescriptor(c,u);(!m||("get"in m?!c.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return c[u]}}),Object.defineProperty(l,d,m)}:function(l,c,u,d){d===void 0&&(d=u),l[d]=c[u]}),r=rt&&rt.__exportStar||function(l,c){for(var u in l)u!=="default"&&!Object.prototype.hasOwnProperty.call(c,u)&&e(c,l,u)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0,Mc.default.install();const i=ec();r(ec(),t);class a extends i.AbstractMessageReader{constructor(c){super(),this._onData=new i.Emitter,this._messageListener=u=>{this._onData.fire(u.data)},c.addEventListener("error",u=>this.fireError(u)),c.onmessage=this._messageListener}listen(c){return this._onData.event(c)}}t.BrowserMessageReader=a;class s extends i.AbstractMessageWriter{constructor(c){super(),this.port=c,this.errorCount=0,c.addEventListener("error",u=>this.fireError(u))}write(c){try{return this.port.postMessage(c),Promise.resolve()}catch(u){return this.handleError(u,c),Promise.reject(u)}}handleError(c,u){this.errorCount++,this.fireError(c,u,this.errorCount)}end(){}}t.BrowserMessageWriter=s;function o(l,c,u,d){return u===void 0&&(u=i.NullLogger),i.ConnectionStrategy.is(d)&&(d={connectionStrategy:d}),(0,i.createMessageConnection)(l,c,u,d)}t.createMessageConnection=o})(Lr);var Bu=Lr,Yh={};const Fc=Pp(xT);var K={};Object.defineProperty(K,"__esModule",{value:!0});K.ProtocolNotificationType=K.ProtocolNotificationType0=K.ProtocolRequestType=K.ProtocolRequestType0=K.RegistrationType=K.MessageDirection=void 0;const Pn=Lr;var Wu;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(Wu||(K.MessageDirection=Wu={}));class YR{constructor(e){this.method=e}}K.RegistrationType=YR;class JR extends Pn.RequestType0{constructor(e){super(e)}}K.ProtocolRequestType0=JR;class ZR extends Pn.RequestType{constructor(e){super(e,Pn.ParameterStructures.byName)}}K.ProtocolRequestType=ZR;class QR extends Pn.NotificationType0{constructor(e){super(e)}}K.ProtocolNotificationType0=QR;class ev extends Pn.NotificationType{constructor(e){super(e,Pn.ParameterStructures.byName)}}K.ProtocolNotificationType=ev;var Jh={},ye={};Object.defineProperty(ye,"__esModule",{value:!0});ye.objectLiteral=ye.typedArray=ye.stringArray=ye.array=ye.func=ye.error=ye.number=ye.string=ye.boolean=void 0;function tv(t){return t===!0||t===!1}ye.boolean=tv;function Zh(t){return typeof t=="string"||t instanceof String}ye.string=Zh;function rv(t){return typeof t=="number"||t instanceof Number}ye.number=rv;function nv(t){return t instanceof Error}ye.error=nv;function iv(t){return typeof t=="function"}ye.func=iv;function Qh(t){return Array.isArray(t)}ye.array=Qh;function av(t){return Qh(t)&&t.every(e=>Zh(e))}ye.stringArray=av;function sv(t,e){return Array.isArray(t)&&t.every(e)}ye.typedArray=sv;function ov(t){return t!==null&&typeof t=="object"}ye.objectLiteral=ov;var Gs={};Object.defineProperty(Gs,"__esModule",{value:!0});Gs.ImplementationRequest=void 0;const Ku=K;var Vu;(function(t){t.method="textDocument/implementation",t.messageDirection=Ku.MessageDirection.clientToServer,t.type=new Ku.ProtocolRequestType(t.method)})(Vu||(Gs.ImplementationRequest=Vu={}));var js={};Object.defineProperty(js,"__esModule",{value:!0});js.TypeDefinitionRequest=void 0;const qu=K;var Hu;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=qu.MessageDirection.clientToServer,t.type=new qu.ProtocolRequestType(t.method)})(Hu||(js.TypeDefinitionRequest=Hu={}));var On={};Object.defineProperty(On,"__esModule",{value:!0});On.DidChangeWorkspaceFoldersNotification=On.WorkspaceFoldersRequest=void 0;const Ts=K;var Xu;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Ts.MessageDirection.serverToClient,t.type=new Ts.ProtocolRequestType0(t.method)})(Xu||(On.WorkspaceFoldersRequest=Xu={}));var Yu;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Ts.MessageDirection.clientToServer,t.type=new Ts.ProtocolNotificationType(t.method)})(Yu||(On.DidChangeWorkspaceFoldersNotification=Yu={}));var zs={};Object.defineProperty(zs,"__esModule",{value:!0});zs.ConfigurationRequest=void 0;const Ju=K;var Zu;(function(t){t.method="workspace/configuration",t.messageDirection=Ju.MessageDirection.serverToClient,t.type=new Ju.ProtocolRequestType(t.method)})(Zu||(zs.ConfigurationRequest=Zu={}));var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.ColorPresentationRequest=Ln.DocumentColorRequest=void 0;const Rs=K;var Qu;(function(t){t.method="textDocument/documentColor",t.messageDirection=Rs.MessageDirection.clientToServer,t.type=new Rs.ProtocolRequestType(t.method)})(Qu||(Ln.DocumentColorRequest=Qu={}));var ef;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Rs.MessageDirection.clientToServer,t.type=new Rs.ProtocolRequestType(t.method)})(ef||(Ln.ColorPresentationRequest=ef={}));var xn={};Object.defineProperty(xn,"__esModule",{value:!0});xn.FoldingRangeRefreshRequest=xn.FoldingRangeRequest=void 0;const vs=K;var tf;(function(t){t.method="textDocument/foldingRange",t.messageDirection=vs.MessageDirection.clientToServer,t.type=new vs.ProtocolRequestType(t.method)})(tf||(xn.FoldingRangeRequest=tf={}));var rf;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=vs.MessageDirection.serverToClient,t.type=new vs.ProtocolRequestType0(t.method)})(rf||(xn.FoldingRangeRefreshRequest=rf={}));var Us={};Object.defineProperty(Us,"__esModule",{value:!0});Us.DeclarationRequest=void 0;const nf=K;var af;(function(t){t.method="textDocument/declaration",t.messageDirection=nf.MessageDirection.clientToServer,t.type=new nf.ProtocolRequestType(t.method)})(af||(Us.DeclarationRequest=af={}));var Bs={};Object.defineProperty(Bs,"__esModule",{value:!0});Bs.SelectionRangeRequest=void 0;const sf=K;var of;(function(t){t.method="textDocument/selectionRange",t.messageDirection=sf.MessageDirection.clientToServer,t.type=new sf.ProtocolRequestType(t.method)})(of||(Bs.SelectionRangeRequest=of={}));var nr={};Object.defineProperty(nr,"__esModule",{value:!0});nr.WorkDoneProgressCancelNotification=nr.WorkDoneProgressCreateRequest=nr.WorkDoneProgress=void 0;const lv=Lr,Es=K;var lf;(function(t){t.type=new lv.ProgressType;function e(r){return r===t.type}t.is=e})(lf||(nr.WorkDoneProgress=lf={}));var cf;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Es.MessageDirection.serverToClient,t.type=new Es.ProtocolRequestType(t.method)})(cf||(nr.WorkDoneProgressCreateRequest=cf={}));var uf;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Es.MessageDirection.clientToServer,t.type=new Es.ProtocolNotificationType(t.method)})(uf||(nr.WorkDoneProgressCancelNotification=uf={}));var ir={};Object.defineProperty(ir,"__esModule",{value:!0});ir.CallHierarchyOutgoingCallsRequest=ir.CallHierarchyIncomingCallsRequest=ir.CallHierarchyPrepareRequest=void 0;const Dn=K;var ff;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Dn.MessageDirection.clientToServer,t.type=new Dn.ProtocolRequestType(t.method)})(ff||(ir.CallHierarchyPrepareRequest=ff={}));var df;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Dn.MessageDirection.clientToServer,t.type=new Dn.ProtocolRequestType(t.method)})(df||(ir.CallHierarchyIncomingCallsRequest=df={}));var hf;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Dn.MessageDirection.clientToServer,t.type=new Dn.ProtocolRequestType(t.method)})(hf||(ir.CallHierarchyOutgoingCallsRequest=hf={}));var Be={};Object.defineProperty(Be,"__esModule",{value:!0});Be.SemanticTokensRefreshRequest=Be.SemanticTokensRangeRequest=Be.SemanticTokensDeltaRequest=Be.SemanticTokensRequest=Be.SemanticTokensRegistrationType=Be.TokenFormat=void 0;const Kt=K;var pf;(function(t){t.Relative="relative"})(pf||(Be.TokenFormat=pf={}));var Ui;(function(t){t.method="textDocument/semanticTokens",t.type=new Kt.RegistrationType(t.method)})(Ui||(Be.SemanticTokensRegistrationType=Ui={}));var mf;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=Kt.MessageDirection.clientToServer,t.type=new Kt.ProtocolRequestType(t.method),t.registrationMethod=Ui.method})(mf||(Be.SemanticTokensRequest=mf={}));var gf;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=Kt.MessageDirection.clientToServer,t.type=new Kt.ProtocolRequestType(t.method),t.registrationMethod=Ui.method})(gf||(Be.SemanticTokensDeltaRequest=gf={}));var yf;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=Kt.MessageDirection.clientToServer,t.type=new Kt.ProtocolRequestType(t.method),t.registrationMethod=Ui.method})(yf||(Be.SemanticTokensRangeRequest=yf={}));var Tf;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=Kt.MessageDirection.serverToClient,t.type=new Kt.ProtocolRequestType0(t.method)})(Tf||(Be.SemanticTokensRefreshRequest=Tf={}));var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.ShowDocumentRequest=void 0;const Rf=K;var vf;(function(t){t.method="window/showDocument",t.messageDirection=Rf.MessageDirection.serverToClient,t.type=new Rf.ProtocolRequestType(t.method)})(vf||(Ws.ShowDocumentRequest=vf={}));var Ks={};Object.defineProperty(Ks,"__esModule",{value:!0});Ks.LinkedEditingRangeRequest=void 0;const Ef=K;var Af;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=Ef.MessageDirection.clientToServer,t.type=new Ef.ProtocolRequestType(t.method)})(Af||(Ks.LinkedEditingRangeRequest=Af={}));var Me={};Object.defineProperty(Me,"__esModule",{value:!0});Me.WillDeleteFilesRequest=Me.DidDeleteFilesNotification=Me.DidRenameFilesNotification=Me.WillRenameFilesRequest=Me.DidCreateFilesNotification=Me.WillCreateFilesRequest=Me.FileOperationPatternKind=void 0;const nt=K;var $f;(function(t){t.file="file",t.folder="folder"})($f||(Me.FileOperationPatternKind=$f={}));var Cf;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=nt.MessageDirection.clientToServer,t.type=new nt.ProtocolRequestType(t.method)})(Cf||(Me.WillCreateFilesRequest=Cf={}));var Sf;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=nt.MessageDirection.clientToServer,t.type=new nt.ProtocolNotificationType(t.method)})(Sf||(Me.DidCreateFilesNotification=Sf={}));var wf;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=nt.MessageDirection.clientToServer,t.type=new nt.ProtocolRequestType(t.method)})(wf||(Me.WillRenameFilesRequest=wf={}));var bf;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=nt.MessageDirection.clientToServer,t.type=new nt.ProtocolNotificationType(t.method)})(bf||(Me.DidRenameFilesNotification=bf={}));var kf;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=nt.MessageDirection.clientToServer,t.type=new nt.ProtocolNotificationType(t.method)})(kf||(Me.DidDeleteFilesNotification=kf={}));var Nf;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=nt.MessageDirection.clientToServer,t.type=new nt.ProtocolRequestType(t.method)})(Nf||(Me.WillDeleteFilesRequest=Nf={}));var ar={};Object.defineProperty(ar,"__esModule",{value:!0});ar.MonikerRequest=ar.MonikerKind=ar.UniquenessLevel=void 0;const _f=K;var If;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(If||(ar.UniquenessLevel=If={}));var Pf;(function(t){t.$import="import",t.$export="export",t.local="local"})(Pf||(ar.MonikerKind=Pf={}));var Of;(function(t){t.method="textDocument/moniker",t.messageDirection=_f.MessageDirection.clientToServer,t.type=new _f.ProtocolRequestType(t.method)})(Of||(ar.MonikerRequest=Of={}));var sr={};Object.defineProperty(sr,"__esModule",{value:!0});sr.TypeHierarchySubtypesRequest=sr.TypeHierarchySupertypesRequest=sr.TypeHierarchyPrepareRequest=void 0;const Mn=K;var Lf;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Mn.MessageDirection.clientToServer,t.type=new Mn.ProtocolRequestType(t.method)})(Lf||(sr.TypeHierarchyPrepareRequest=Lf={}));var xf;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Mn.MessageDirection.clientToServer,t.type=new Mn.ProtocolRequestType(t.method)})(xf||(sr.TypeHierarchySupertypesRequest=xf={}));var Df;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Mn.MessageDirection.clientToServer,t.type=new Mn.ProtocolRequestType(t.method)})(Df||(sr.TypeHierarchySubtypesRequest=Df={}));var Fn={};Object.defineProperty(Fn,"__esModule",{value:!0});Fn.InlineValueRefreshRequest=Fn.InlineValueRequest=void 0;const As=K;var Mf;(function(t){t.method="textDocument/inlineValue",t.messageDirection=As.MessageDirection.clientToServer,t.type=new As.ProtocolRequestType(t.method)})(Mf||(Fn.InlineValueRequest=Mf={}));var Ff;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=As.MessageDirection.serverToClient,t.type=new As.ProtocolRequestType0(t.method)})(Ff||(Fn.InlineValueRefreshRequest=Ff={}));var or={};Object.defineProperty(or,"__esModule",{value:!0});or.InlayHintRefreshRequest=or.InlayHintResolveRequest=or.InlayHintRequest=void 0;const Gn=K;var Gf;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Gn.MessageDirection.clientToServer,t.type=new Gn.ProtocolRequestType(t.method)})(Gf||(or.InlayHintRequest=Gf={}));var jf;(function(t){t.method="inlayHint/resolve",t.messageDirection=Gn.MessageDirection.clientToServer,t.type=new Gn.ProtocolRequestType(t.method)})(jf||(or.InlayHintResolveRequest=jf={}));var zf;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Gn.MessageDirection.serverToClient,t.type=new Gn.ProtocolRequestType0(t.method)})(zf||(or.InlayHintRefreshRequest=zf={}));var tt={};Object.defineProperty(tt,"__esModule",{value:!0});tt.DiagnosticRefreshRequest=tt.WorkspaceDiagnosticRequest=tt.DocumentDiagnosticRequest=tt.DocumentDiagnosticReportKind=tt.DiagnosticServerCancellationData=void 0;const ep=Lr,cv=ye,jn=K;var Uf;(function(t){function e(r){const n=r;return n&&cv.boolean(n.retriggerRequest)}t.is=e})(Uf||(tt.DiagnosticServerCancellationData=Uf={}));var Bf;(function(t){t.Full="full",t.Unchanged="unchanged"})(Bf||(tt.DocumentDiagnosticReportKind=Bf={}));var Wf;(function(t){t.method="textDocument/diagnostic",t.messageDirection=jn.MessageDirection.clientToServer,t.type=new jn.ProtocolRequestType(t.method),t.partialResult=new ep.ProgressType})(Wf||(tt.DocumentDiagnosticRequest=Wf={}));var Kf;(function(t){t.method="workspace/diagnostic",t.messageDirection=jn.MessageDirection.clientToServer,t.type=new jn.ProtocolRequestType(t.method),t.partialResult=new ep.ProgressType})(Kf||(tt.WorkspaceDiagnosticRequest=Kf={}));var Vf;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=jn.MessageDirection.serverToClient,t.type=new jn.ProtocolRequestType0(t.method)})(Vf||(tt.DiagnosticRefreshRequest=Vf={}));var ge={};Object.defineProperty(ge,"__esModule",{value:!0});ge.DidCloseNotebookDocumentNotification=ge.DidSaveNotebookDocumentNotification=ge.DidChangeNotebookDocumentNotification=ge.NotebookCellArrayChange=ge.DidOpenNotebookDocumentNotification=ge.NotebookDocumentSyncRegistrationType=ge.NotebookDocument=ge.NotebookCell=ge.ExecutionSummary=ge.NotebookCellKind=void 0;const Bi=Fc,dt=ye,At=K;var rc;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(rc||(ge.NotebookCellKind=rc={}));var nc;(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 dt.objectLiteral(a)&&Bi.uinteger.is(a.executionOrder)&&(a.success===void 0||dt.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})(nc||(ge.ExecutionSummary=nc={}));var $s;(function(t){function e(a,s){return{kind:a,document:s}}t.create=e;function r(a){const s=a;return dt.objectLiteral(s)&&rc.is(s.kind)&&Bi.DocumentUri.is(s.document)&&(s.metadata===void 0||dt.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)&&!nc.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(dt.objectLiteral(a)&&dt.objectLiteral(s)){const c=Object.keys(a),u=Object.keys(s);if(c.length!==u.length||(c.sort(),u.sort(),!i(c,u)))return!1;for(let d=0;d<c.length;d++){const m=c[d];if(!i(a[m],s[m]))return!1}}return!0}})($s||(ge.NotebookCell=$s={}));var qf;(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 dt.objectLiteral(i)&&dt.string(i.uri)&&Bi.integer.is(i.version)&&dt.typedArray(i.cells,$s.is)}t.is=r})(qf||(ge.NotebookDocument=qf={}));var zn;(function(t){t.method="notebookDocument/sync",t.messageDirection=At.MessageDirection.clientToServer,t.type=new At.RegistrationType(t.method)})(zn||(ge.NotebookDocumentSyncRegistrationType=zn={}));var Hf;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=At.MessageDirection.clientToServer,t.type=new At.ProtocolNotificationType(t.method),t.registrationMethod=zn.method})(Hf||(ge.DidOpenNotebookDocumentNotification=Hf={}));var Xf;(function(t){function e(n){const i=n;return dt.objectLiteral(i)&&Bi.uinteger.is(i.start)&&Bi.uinteger.is(i.deleteCount)&&(i.cells===void 0||dt.typedArray(i.cells,$s.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})(Xf||(ge.NotebookCellArrayChange=Xf={}));var Yf;(function(t){t.method="notebookDocument/didChange",t.messageDirection=At.MessageDirection.clientToServer,t.type=new At.ProtocolNotificationType(t.method),t.registrationMethod=zn.method})(Yf||(ge.DidChangeNotebookDocumentNotification=Yf={}));var Jf;(function(t){t.method="notebookDocument/didSave",t.messageDirection=At.MessageDirection.clientToServer,t.type=new At.ProtocolNotificationType(t.method),t.registrationMethod=zn.method})(Jf||(ge.DidSaveNotebookDocumentNotification=Jf={}));var Zf;(function(t){t.method="notebookDocument/didClose",t.messageDirection=At.MessageDirection.clientToServer,t.type=new At.ProtocolNotificationType(t.method),t.registrationMethod=zn.method})(Zf||(ge.DidCloseNotebookDocumentNotification=Zf={}));var Vs={};Object.defineProperty(Vs,"__esModule",{value:!0});Vs.InlineCompletionRequest=void 0;const Qf=K;var ed;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=Qf.MessageDirection.clientToServer,t.type=new Qf.ProtocolRequestType(t.method)})(ed||(Vs.InlineCompletionRequest=ed={}));(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=Fc,n=ye,i=Gs;Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const a=js;Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return a.TypeDefinitionRequest}});const s=On;Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return s.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return s.DidChangeWorkspaceFoldersNotification}});const o=zs;Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return o.ConfigurationRequest}});const l=Ln;Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return l.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return l.ColorPresentationRequest}});const c=xn;Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return c.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return c.FoldingRangeRefreshRequest}});const u=Us;Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return u.DeclarationRequest}});const d=Bs;Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return d.SelectionRangeRequest}});const m=nr;Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return m.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return m.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return m.WorkDoneProgressCancelNotification}});const g=ir;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 E=Be;Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return E.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return E.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return E.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return E.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return E.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return E.SemanticTokensRegistrationType}});const k=Ws;Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return k.ShowDocumentRequest}});const P=Ks;Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return P.LinkedEditingRangeRequest}});const w=Me;Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return w.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return w.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return w.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return w.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return w.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return w.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return w.WillDeleteFilesRequest}});const _=ar;Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return _.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return _.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return _.MonikerRequest}});const N=sr;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 x=Fn;Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return x.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return x.InlineValueRefreshRequest}});const q=or;Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return q.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return q.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return q.InlayHintRefreshRequest}});const Z=tt;Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Z.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Z.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Z.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Z.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Z.DiagnosticRefreshRequest}});const Q=ge;Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return Q.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return Q.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return Q.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return Q.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Q.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Q.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Q.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Q.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Q.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Q.DidCloseNotebookDocumentNotification}});const he=Vs;Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return he.InlineCompletionRequest}});var ve;(function(f){function Ee(Ae){const B=Ae;return n.string(B)||n.string(B.language)||n.string(B.scheme)||n.string(B.pattern)}f.is=Ee})(ve||(t.TextDocumentFilter=ve={}));var oe;(function(f){function Ee(Ae){const B=Ae;return n.objectLiteral(B)&&(n.string(B.notebookType)||n.string(B.scheme)||n.string(B.pattern))}f.is=Ee})(oe||(t.NotebookDocumentFilter=oe={}));var S;(function(f){function Ee(Ae){const B=Ae;return n.objectLiteral(B)&&(n.string(B.notebook)||oe.is(B.notebook))&&(B.language===void 0||n.string(B.language))}f.is=Ee})(S||(t.NotebookCellTextDocumentFilter=S={}));var R;(function(f){function Ee(Ae){if(!Array.isArray(Ae))return!1;for(let B of Ae)if(!n.string(B)&&!ve.is(B)&&!S.is(B))return!1;return!0}f.is=Ee})(R||(t.DocumentSelector=R={}));var p;(function(f){f.method="client/registerCapability",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType(f.method)})(p||(t.RegistrationRequest=p={}));var $;(function(f){f.method="client/unregisterCapability",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType(f.method)})($||(t.UnregistrationRequest=$={}));var y;(function(f){f.Create="create",f.Rename="rename",f.Delete="delete"})(y||(t.ResourceOperationKind=y={}));var T;(function(f){f.Abort="abort",f.Transactional="transactional",f.TextOnlyTransactional="textOnlyTransactional",f.Undo="undo"})(T||(t.FailureHandlingKind=T={}));var A;(function(f){f.UTF8="utf-8",f.UTF16="utf-16",f.UTF32="utf-32"})(A||(t.PositionEncodingKind=A={}));var O;(function(f){function Ee(Ae){const B=Ae;return B&&n.string(B.id)&&B.id.length>0}f.hasId=Ee})(O||(t.StaticRegistrationOptions=O={}));var D;(function(f){function Ee(Ae){const B=Ae;return B&&(B.documentSelector===null||R.is(B.documentSelector))}f.is=Ee})(D||(t.TextDocumentRegistrationOptions=D={}));var L;(function(f){function Ee(B){const h=B;return n.objectLiteral(h)&&(h.workDoneProgress===void 0||n.boolean(h.workDoneProgress))}f.is=Ee;function Ae(B){const h=B;return h&&n.boolean(h.workDoneProgress)}f.hasWorkDoneProgress=Ae})(L||(t.WorkDoneProgressOptions=L={}));var j;(function(f){f.method="initialize",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(j||(t.InitializeRequest=j={}));var F;(function(f){f.unknownProtocolVersion=1})(F||(t.InitializeErrorCodes=F={}));var re;(function(f){f.method="initialized",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(re||(t.InitializedNotification=re={}));var z;(function(f){f.method="shutdown",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType0(f.method)})(z||(t.ShutdownRequest=z={}));var ee;(function(f){f.method="exit",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType0(f.method)})(ee||(t.ExitNotification=ee={}));var Ie;(function(f){f.method="workspace/didChangeConfiguration",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(Ie||(t.DidChangeConfigurationNotification=Ie={}));var pe;(function(f){f.Error=1,f.Warning=2,f.Info=3,f.Log=4,f.Debug=5})(pe||(t.MessageType=pe={}));var le;(function(f){f.method="window/showMessage",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolNotificationType(f.method)})(le||(t.ShowMessageNotification=le={}));var ke;(function(f){f.method="window/showMessageRequest",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType(f.method)})(ke||(t.ShowMessageRequest=ke={}));var Pe;(function(f){f.method="window/logMessage",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolNotificationType(f.method)})(Pe||(t.LogMessageNotification=Pe={}));var Ce;(function(f){f.method="telemetry/event",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolNotificationType(f.method)})(Ce||(t.TelemetryEventNotification=Ce={}));var X;(function(f){f.None=0,f.Full=1,f.Incremental=2})(X||(t.TextDocumentSyncKind=X={}));var He;(function(f){f.method="textDocument/didOpen",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(He||(t.DidOpenTextDocumentNotification=He={}));var me;(function(f){function Ee(B){let h=B;return h!=null&&typeof h.text=="string"&&h.range!==void 0&&(h.rangeLength===void 0||typeof h.rangeLength=="number")}f.isIncremental=Ee;function Ae(B){let h=B;return h!=null&&typeof h.text=="string"&&h.range===void 0&&h.rangeLength===void 0}f.isFull=Ae})(me||(t.TextDocumentContentChangeEvent=me={}));var at;(function(f){f.method="textDocument/didChange",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(at||(t.DidChangeTextDocumentNotification=at={}));var xr;(function(f){f.method="textDocument/didClose",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(xr||(t.DidCloseTextDocumentNotification=xr={}));var Hn;(function(f){f.method="textDocument/didSave",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(Hn||(t.DidSaveTextDocumentNotification=Hn={}));var Xn;(function(f){f.Manual=1,f.AfterDelay=2,f.FocusOut=3})(Xn||(t.TextDocumentSaveReason=Xn={}));var Yn;(function(f){f.method="textDocument/willSave",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(Yn||(t.WillSaveTextDocumentNotification=Yn={}));var Jn;(function(f){f.method="textDocument/willSaveWaitUntil",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Jn||(t.WillSaveTextDocumentWaitUntilRequest=Jn={}));var st;(function(f){f.method="workspace/didChangeWatchedFiles",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(st||(t.DidChangeWatchedFilesNotification=st={}));var Zn;(function(f){f.Created=1,f.Changed=2,f.Deleted=3})(Zn||(t.FileChangeType=Zn={}));var Zi;(function(f){function Ee(Ae){const B=Ae;return n.objectLiteral(B)&&(r.URI.is(B.baseUri)||r.WorkspaceFolder.is(B.baseUri))&&n.string(B.pattern)}f.is=Ee})(Zi||(t.RelativePattern=Zi={}));var Qi;(function(f){f.Create=1,f.Change=2,f.Delete=4})(Qi||(t.WatchKind=Qi={}));var ea;(function(f){f.method="textDocument/publishDiagnostics",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolNotificationType(f.method)})(ea||(t.PublishDiagnosticsNotification=ea={}));var ta;(function(f){f.Invoked=1,f.TriggerCharacter=2,f.TriggerForIncompleteCompletions=3})(ta||(t.CompletionTriggerKind=ta={}));var Qn;(function(f){f.method="textDocument/completion",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Qn||(t.CompletionRequest=Qn={}));var ei;(function(f){f.method="completionItem/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ei||(t.CompletionResolveRequest=ei={}));var kt;(function(f){f.method="textDocument/hover",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(kt||(t.HoverRequest=kt={}));var ti;(function(f){f.Invoked=1,f.TriggerCharacter=2,f.ContentChange=3})(ti||(t.SignatureHelpTriggerKind=ti={}));var ra;(function(f){f.method="textDocument/signatureHelp",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ra||(t.SignatureHelpRequest=ra={}));var na;(function(f){f.method="textDocument/definition",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(na||(t.DefinitionRequest=na={}));var ri;(function(f){f.method="textDocument/references",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ri||(t.ReferencesRequest=ri={}));var ni;(function(f){f.method="textDocument/documentHighlight",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ni||(t.DocumentHighlightRequest=ni={}));var ia;(function(f){f.method="textDocument/documentSymbol",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ia||(t.DocumentSymbolRequest=ia={}));var aa;(function(f){f.method="textDocument/codeAction",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(aa||(t.CodeActionRequest=aa={}));var sa;(function(f){f.method="codeAction/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(sa||(t.CodeActionResolveRequest=sa={}));var oa;(function(f){f.method="workspace/symbol",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(oa||(t.WorkspaceSymbolRequest=oa={}));var la;(function(f){f.method="workspaceSymbol/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(la||(t.WorkspaceSymbolResolveRequest=la={}));var ca;(function(f){f.method="textDocument/codeLens",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ca||(t.CodeLensRequest=ca={}));var ot;(function(f){f.method="codeLens/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ot||(t.CodeLensResolveRequest=ot={}));var ua;(function(f){f.method="workspace/codeLens/refresh",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType0(f.method)})(ua||(t.CodeLensRefreshRequest=ua={}));var fa;(function(f){f.method="textDocument/documentLink",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(fa||(t.DocumentLinkRequest=fa={}));var hr;(function(f){f.method="documentLink/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(hr||(t.DocumentLinkResolveRequest=hr={}));var da;(function(f){f.method="textDocument/formatting",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(da||(t.DocumentFormattingRequest=da={}));var Dr;(function(f){f.method="textDocument/rangeFormatting",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Dr||(t.DocumentRangeFormattingRequest=Dr={}));var ha;(function(f){f.method="textDocument/rangesFormatting",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ha||(t.DocumentRangesFormattingRequest=ha={}));var Nt;(function(f){f.method="textDocument/onTypeFormatting",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Nt||(t.DocumentOnTypeFormattingRequest=Nt={}));var Zt;(function(f){f.Identifier=1})(Zt||(t.PrepareSupportDefaultBehavior=Zt={}));var pa;(function(f){f.method="textDocument/rename",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(pa||(t.RenameRequest=pa={}));var ma;(function(f){f.method="textDocument/prepareRename",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ma||(t.PrepareRenameRequest=ma={}));var Qt;(function(f){f.method="workspace/executeCommand",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Qt||(t.ExecuteCommandRequest=Qt={}));var ii;(function(f){f.method="workspace/applyEdit",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType("workspace/applyEdit")})(ii||(t.ApplyWorkspaceEditRequest=ii={}))})(Jh);var qs={};Object.defineProperty(qs,"__esModule",{value:!0});qs.createProtocolConnection=void 0;const td=Lr;function uv(t,e,r,n){return td.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,td.createMessageConnection)(t,e,r,n)}qs.createProtocolConnection=uv;(function(t){var e=rt&&rt.__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=rt&&rt.__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(Lr,t),r(Fc,t),r(K,t),r(Jh,t);var n=qs;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={}))})(Yh);(function(t){var e=rt&&rt.__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=rt&&rt.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const n=Bu;r(Bu,t),r(Yh,t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}t.createProtocolConnection=i})(ki);var _i;(function(t){function e(r){return{dispose:async()=>await r()}}t.create=e})(_i||(_i={}));class fv{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new zi,this.documentPhaseListeners=new zi,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=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=de.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=de.None){this.currentState=W.Changed;const i=[];for(const l of r){const c=this.langiumDocuments.deleteDocuments(l);for(const u of c)i.push(u.uri),this.cleanUpDeleted(u)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let c=this.langiumDocuments.getDocument(l);c===void 0&&(c=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),c.state=W.Changed,this.langiumDocuments.addDocument(c)),this.resetToState(c,W.Changed)}const s=ue(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 je(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 ue(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),_i.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 je(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),_i.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),_i.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=de.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(nn);if(this.currentState>=e&&e>i.state)return Promise.reject(new ki.ResponseError(ki.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 ki.ResponseError(ki.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,c=>{Je.equals(c.uri,r)&&(o.dispose(),l.dispose(),a(c.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(nn)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(nn):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(nn)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await je(n),await s(e,n)}catch(o){if(!Ms(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 je(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=ue(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 dv{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new wR,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=>{Je.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),ue(i)}allElements(e,r){let n=ue(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=de.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=de.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 hv{constructor(e){this.initialBuildOptions={},this._ready=new Dc,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=de.None){const n=await this.performStartup(e);await je(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=ue(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 ht.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=Je.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}}class pv{buildUnexpectedCharactersMessage(e,r,n,i,a){return Mo.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return Mo.buildUnableToPopLexerModeMessage(e)}}const mv={mode:"full"};class gv{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=rd(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new We(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=mv){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(rd(e))return e;const r=tp(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}}function yv(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function tp(t){return t&&"modes"in t&&"defaultMode"in t}function rd(t){return!yv(t)&&!tp(t)}function Tv(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=rp(t),s=Gc(n),o=Ev({lines:a,position:i,options:s});return wv({index:0,tokens:o,position:i})}function Rv(t,e){const r=Gc(e),n=rp(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 rp(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(Tm)}const nd=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,vv=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function Ev(t){var i,a,s;const e=[];let r=t.position.line,n=t.position.character;for(let o=0;o<t.lines.length;o++){const l=o===0,c=o===t.lines.length-1;let u=t.lines[o],d=0;if(l&&t.options.start){const g=(i=t.options.start)==null?void 0:i.exec(u);g&&(d=g.index+g[0].length)}else{const g=(a=t.options.line)==null?void 0:a.exec(u);g&&(d=g.index+g[0].length)}if(c){const g=(s=t.options.end)==null?void 0:s.exec(u);g&&(u=u.substring(0,g.index))}if(u=u.substring(0,Sv(u)),ic(u,d)>=u.length){if(e.length>0){const g=J.create(r,n);e.push({type:"break",content:"",range:V.create(g,g)})}}else{nd.lastIndex=d;const g=nd.exec(u);if(g){const E=g[0],k=g[1],P=J.create(r,n+d),w=J.create(r,n+d+E.length);e.push({type:"tag",content:k,range:V.create(P,w)}),d+=E.length,d=ic(u,d)}if(d<u.length){const E=u.substring(d),k=Array.from(E.matchAll(vv));e.push(...Av(k,E,r,n+d))}}r++,n=0}return e.length>0&&e[e.length-1].type==="break"?e.slice(0,-1):e}function Av(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 u=c.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:V.create(J.create(r,a+u+n),J.create(r,a+u+d.length+n))}),u+=d.length,o.length===4){u+=o[2].length;const m=o[3];i.push({type:"text",content:m,range:V.create(J.create(r,a+u+n),J.create(r,a+u+m.length+n))})}else i.push({type:"text",content:"",range:V.create(J.create(r,a+u+n),J.create(r,a+u+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:V.create(J.create(r,a+n),J.create(r,a+n+s.length))})}return i}const $v=/\S/,Cv=/\s*$/;function ic(t,e){const r=t.substring(e).match($v);return r?e+r.index:t.length}function Sv(t){const e=t.match(Cv);if(e&&typeof e.index=="number")return e.index}function wv(t){var a,s;const e=J.create(t.position.line,t.position.character);if(t.tokens.length===0)return new id([],V.create(e,e));const r=[];for(;t.index<t.tokens.length;){const o=bv(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 id(r,V.create(n,i))}function bv(t,e){const r=t.tokens[t.index];if(r.type==="tag")return ip(t,!1);if(r.type==="text"||r.type==="inline-tag")return np(t);kv(r,e),t.index++}function kv(t,e){if(e){const r=new sp("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function np(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(Nv(t)),n=e,e=t.tokens[t.index];return new ac(i,V.create(r.range.start,n.range.end))}function Nv(t){return t.tokens[t.index].type==="inline-tag"?ip(t,!0):ap(t)}function ip(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=ap(t);return new fo(n,new ac([a],a.range),e,V.create(r.range.start,a.range.end))}else{const a=np(t);return new fo(n,a,e,V.create(r.range.start,a.range.end))}else{const a=r.range;return new fo(n,new ac([],a),e,a)}}function ap(t){const e=t.tokens[t.index++];return new sp(e.content,e.range)}function Gc(t){if(!t)return Gc({start:"/**",end:"*/",line:"*"});const{start:e,end:r,line:n}=t;return{start:uo(e,!0),end:uo(r,!1),line:uo(n,!0)}}function uo(t,e){if(typeof t=="string"||typeof t=="object"){const r=typeof t=="string"?ks(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}class id{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+=ad(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+=ad(r)+i}return r.trim()}}class fo{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}
151
+ `)),C){const M=h.error?` Request failed: ${h.error.message} (${h.error.code}).`:"";me.log(`Received response '${C.method} - (${h.id})' in ${Date.now()-C.timerStart}ms.${M}`,I)}else me.log(`Received response ${h.id} without active response promise.`,I)}else Nt("receive-response",h)}function Nt(h,C){if(!me||X===m.Off)return;const I={isLSPMessage:!0,type:h,message:C,timestamp:Date.now()};me.log(I)}function Zt(){if(ei())throw new _(w.Closed,"Connection is closed.");if(kt())throw new _(w.Disposed,"Connection is disposed.")}function pa(){if(Qn())throw new _(w.AlreadyListening,"Connection is already listening")}function ma(){if(!Qn())throw new Error("Call listen() first.")}function Qt(h){return h===void 0?null:h}function ii(h){if(h!==null)return h}function f(h){return h!=null&&!Array.isArray(h)&&typeof h=="object"}function Ee(h,C){switch(h){case n.ParameterStructures.auto:return f(C)?ii(C):[Qt(C)];case n.ParameterStructures.byName:if(!f(C))throw new Error("Received parameters by name but param is not an object literal.");return ii(C);case n.ParameterStructures.byPosition:return[Qt(C)];default:throw new Error(`Unknown parameter structure ${h.toString()}`)}}function Ae(h,C){let I;const M=h.numberOfParams;switch(M){case 0:I=void 0;break;case 1:I=Ee(h.parameterStructures,C[0]);break;default:I=[];for(let ae=0;ae<C.length&&ae<M;ae++)I.push(Qt(C[ae]));if(C.length<M)for(let ae=C.length;ae<M;ae++)I.push(null);break}return I}const B={sendNotification:(h,...C)=>{Zt();let I,M;if(r.string(h)){I=h;const ne=C[0];let ie=0,$e=n.ParameterStructures.auto;n.ParameterStructures.is(ne)&&(ie=1,$e=ne);let H=C.length;const ce=H-ie;switch(ce){case 0:M=void 0;break;case 1:M=Ee($e,C[ie]);break;default:if($e===n.ParameterStructures.byName)throw new Error(`Received ${ce} parameters for 'by Name' notification parameter structure.`);M=C.slice(ie,H).map(te=>Qt(te));break}}else{const ne=C;I=h.method,M=Ae(h,ne)}const ae={jsonrpc:j,method:I,params:M};return fa(ae),$.write(ae).catch(ne=>{throw A.error("Sending notification failed."),ne})},onNotification:(h,C)=>{Zt();let I;return r.func(h)?z=h:C&&(r.string(h)?(I=h,ee.set(h,{type:void 0,handler:C})):(I=h.method,ee.set(h.method,{type:h,handler:C}))),{dispose:()=>{I!==void 0?ee.delete(I):z=void 0}}},onProgress:(h,C,I)=>{if(Ie.has(C))throw new Error(`Progress handler for token ${C} already registered`);return Ie.set(C,I),{dispose:()=>{Ie.delete(C)}}},sendProgress:(h,C,I)=>B.sendNotification(c.type,{token:C,value:I}),onUnhandledProgress:Yn.event,sendRequest:(h,...C)=>{Zt(),ma();let I,M,ae;if(r.string(h)){I=h;const H=C[0],ce=C[C.length-1];let te=0,Ne=n.ParameterStructures.auto;n.ParameterStructures.is(H)&&(te=1,Ne=H);let Ge=C.length;s.CancellationToken.is(ce)&&(Ge=Ge-1,ae=ce);const pt=Ge-te;switch(pt){case 0:M=void 0;break;case 1:M=Ee(Ne,C[te]);break;default:if(Ne===n.ParameterStructures.byName)throw new Error(`Received ${pt} parameters for 'by Name' request parameter structure.`);M=C.slice(te,Ge).map(kp=>Qt(kp));break}}else{const H=C;I=h.method,M=Ae(h,H);const ce=h.numberOfParams;ae=s.CancellationToken.is(H[ce])?H[ce]:void 0}const ne=O++;let ie;ae&&(ie=ae.onCancellationRequested(()=>{const H=st.sender.sendCancellation(B,ne);return H===void 0?(A.log(`Received no promise from cancellation strategy when cancelling id ${ne}`),Promise.resolve()):H.catch(()=>{A.log(`Sending cancellation messages for id ${ne} failed`)})}));const $e={jsonrpc:j,id:ne,method:I,params:M};return ua($e),typeof st.sender.enableCancellation=="function"&&st.sender.enableCancellation($e),new Promise(async(H,ce)=>{const te=pt=>{H(pt),st.sender.cleanup(ne),ie==null||ie.dispose()},Ne=pt=>{ce(pt),st.sender.cleanup(ne),ie==null||ie.dispose()},Ge={method:I,timerStart:Date.now(),resolve:te,reject:Ne};try{await $.write($e),ke.set(ne,Ge)}catch(pt){throw A.error("Sending request failed."),Ge.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,pt.message?pt.message:"Unknown reason")),pt}})},onRequest:(h,C)=>{Zt();let I=null;return d.is(h)?(I=void 0,F=h):r.string(h)?(I=null,C!==void 0&&(I=h,re.set(h,{handler:C,type:void 0}))):C!==void 0&&(I=h.method,re.set(h.method,{type:h,handler:C})),{dispose:()=>{I!==null&&(I!==void 0?re.delete(I):F=void 0)}}},hasPendingResponse:()=>ke.size>0,trace:async(h,C,I)=>{let M=!1,ae=E.Text;I!==void 0&&(r.boolean(I)?M=I:(M=I.sendNotification||!1,ae=I.traceFormat||E.Text)),X=h,He=ae,X===m.Off?me=void 0:me=C,M&&!ei()&&!kt()&&await B.sendNotification(k.type,{value:m.toString(h)})},onError:xr.event,onClose:Hn.event,onUnhandledNotification:Xn.event,onDispose:Jn.event,end:()=>{$.end()},dispose:()=>{if(kt())return;at=S.Disposed,Jn.fire(void 0);const h=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const C of ke.values())C.reject(h);ke=new Map,Ce=new Map,Pe=new Set,le=new i.LinkedMap,r.func($.dispose)&&$.dispose(),r.func(p.dispose)&&p.dispose()},listen:()=>{Zt(),pa(),at=S.Listening,p.listen(aa)},inspect:()=>{(0,e.default)().console.log("inspect")}};return B.onNotification(P.type,h=>{if(X===m.Off||!me)return;const C=X===m.Verbose||X===m.Compact;me.log(h.message,C?h.verbose:void 0)}),B.onNotification(c.type,h=>{const C=Ie.get(h.token);C?C(h.value):Yn.fire(h)}),B}t.createMessageConnection=R}(co)),co}var Uu;function ec(){return Uu||(Uu=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;const e=Vh();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=qh();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=zR();Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return n.Disposable}});const i=Et;Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const a=ur;Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return a.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return a.CancellationToken}});const s=UR();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return s.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return s.SharedArrayReceiverStrategy}});const o=BR();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=WR();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=KR();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return c.AbstractMessageBuffer}});const u=VR();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return u.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return u.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return u.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return u.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return u.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return u.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return u.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return u.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return u.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return u.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return u.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return u.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return u.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return u.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return u.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return u.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:function(){return u.MessageStrategy}});const d=Ht;t.RAL=d.default}(lo)),lo}Object.defineProperty(Mc,"__esModule",{value:!0});const Rt=ec();class Fs extends Rt.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return Fs.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)}}Fs.emptyBuffer=new Uint8Array(0);class qR{constructor(e){this.socket=e,this._onData=new Rt.Emitter,this._messageListener=r=>{r.data.arrayBuffer().then(i=>{this._onData.fire(new Uint8Array(i))},()=>{(0,Rt.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),Rt.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Rt.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Rt.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}}class HR{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),Rt.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Rt.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Rt.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 XR=new TextEncoder,Xh=Object.freeze({messageBuffer:Object.freeze({create:t=>new Fs(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(XR.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 qR(t),asWritableStream:t=>new HR(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 tc(){return Xh}(function(t){function e(){Rt.RAL.install(Xh)}t.install=e})(tc||(tc={}));Mc.default=tc;(function(t){var e=rt&&rt.__createBinding||(Object.create?function(l,c,u,d){d===void 0&&(d=u);var m=Object.getOwnPropertyDescriptor(c,u);(!m||("get"in m?!c.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return c[u]}}),Object.defineProperty(l,d,m)}:function(l,c,u,d){d===void 0&&(d=u),l[d]=c[u]}),r=rt&&rt.__exportStar||function(l,c){for(var u in l)u!=="default"&&!Object.prototype.hasOwnProperty.call(c,u)&&e(c,l,u)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0,Mc.default.install();const i=ec();r(ec(),t);class a extends i.AbstractMessageReader{constructor(c){super(),this._onData=new i.Emitter,this._messageListener=u=>{this._onData.fire(u.data)},c.addEventListener("error",u=>this.fireError(u)),c.onmessage=this._messageListener}listen(c){return this._onData.event(c)}}t.BrowserMessageReader=a;class s extends i.AbstractMessageWriter{constructor(c){super(),this.port=c,this.errorCount=0,c.addEventListener("error",u=>this.fireError(u))}write(c){try{return this.port.postMessage(c),Promise.resolve()}catch(u){return this.handleError(u,c),Promise.reject(u)}}handleError(c,u){this.errorCount++,this.fireError(c,u,this.errorCount)}end(){}}t.BrowserMessageWriter=s;function o(l,c,u,d){return u===void 0&&(u=i.NullLogger),i.ConnectionStrategy.is(d)&&(d={connectionStrategy:d}),(0,i.createMessageConnection)(l,c,u,d)}t.createMessageConnection=o})(Lr);var Bu=Lr,Yh={};const Fc=Ip(xT);var K={};Object.defineProperty(K,"__esModule",{value:!0});K.ProtocolNotificationType=K.ProtocolNotificationType0=K.ProtocolRequestType=K.ProtocolRequestType0=K.RegistrationType=K.MessageDirection=void 0;const Pn=Lr;var Wu;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(Wu||(K.MessageDirection=Wu={}));class YR{constructor(e){this.method=e}}K.RegistrationType=YR;class JR extends Pn.RequestType0{constructor(e){super(e)}}K.ProtocolRequestType0=JR;class ZR extends Pn.RequestType{constructor(e){super(e,Pn.ParameterStructures.byName)}}K.ProtocolRequestType=ZR;class QR extends Pn.NotificationType0{constructor(e){super(e)}}K.ProtocolNotificationType0=QR;class ev extends Pn.NotificationType{constructor(e){super(e,Pn.ParameterStructures.byName)}}K.ProtocolNotificationType=ev;var Jh={},ye={};Object.defineProperty(ye,"__esModule",{value:!0});ye.objectLiteral=ye.typedArray=ye.stringArray=ye.array=ye.func=ye.error=ye.number=ye.string=ye.boolean=void 0;function tv(t){return t===!0||t===!1}ye.boolean=tv;function Zh(t){return typeof t=="string"||t instanceof String}ye.string=Zh;function rv(t){return typeof t=="number"||t instanceof Number}ye.number=rv;function nv(t){return t instanceof Error}ye.error=nv;function iv(t){return typeof t=="function"}ye.func=iv;function Qh(t){return Array.isArray(t)}ye.array=Qh;function av(t){return Qh(t)&&t.every(e=>Zh(e))}ye.stringArray=av;function sv(t,e){return Array.isArray(t)&&t.every(e)}ye.typedArray=sv;function ov(t){return t!==null&&typeof t=="object"}ye.objectLiteral=ov;var Gs={};Object.defineProperty(Gs,"__esModule",{value:!0});Gs.ImplementationRequest=void 0;const Ku=K;var Vu;(function(t){t.method="textDocument/implementation",t.messageDirection=Ku.MessageDirection.clientToServer,t.type=new Ku.ProtocolRequestType(t.method)})(Vu||(Gs.ImplementationRequest=Vu={}));var js={};Object.defineProperty(js,"__esModule",{value:!0});js.TypeDefinitionRequest=void 0;const qu=K;var Hu;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=qu.MessageDirection.clientToServer,t.type=new qu.ProtocolRequestType(t.method)})(Hu||(js.TypeDefinitionRequest=Hu={}));var On={};Object.defineProperty(On,"__esModule",{value:!0});On.DidChangeWorkspaceFoldersNotification=On.WorkspaceFoldersRequest=void 0;const Ts=K;var Xu;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Ts.MessageDirection.serverToClient,t.type=new Ts.ProtocolRequestType0(t.method)})(Xu||(On.WorkspaceFoldersRequest=Xu={}));var Yu;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Ts.MessageDirection.clientToServer,t.type=new Ts.ProtocolNotificationType(t.method)})(Yu||(On.DidChangeWorkspaceFoldersNotification=Yu={}));var zs={};Object.defineProperty(zs,"__esModule",{value:!0});zs.ConfigurationRequest=void 0;const Ju=K;var Zu;(function(t){t.method="workspace/configuration",t.messageDirection=Ju.MessageDirection.serverToClient,t.type=new Ju.ProtocolRequestType(t.method)})(Zu||(zs.ConfigurationRequest=Zu={}));var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.ColorPresentationRequest=Ln.DocumentColorRequest=void 0;const Rs=K;var Qu;(function(t){t.method="textDocument/documentColor",t.messageDirection=Rs.MessageDirection.clientToServer,t.type=new Rs.ProtocolRequestType(t.method)})(Qu||(Ln.DocumentColorRequest=Qu={}));var ef;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Rs.MessageDirection.clientToServer,t.type=new Rs.ProtocolRequestType(t.method)})(ef||(Ln.ColorPresentationRequest=ef={}));var xn={};Object.defineProperty(xn,"__esModule",{value:!0});xn.FoldingRangeRefreshRequest=xn.FoldingRangeRequest=void 0;const vs=K;var tf;(function(t){t.method="textDocument/foldingRange",t.messageDirection=vs.MessageDirection.clientToServer,t.type=new vs.ProtocolRequestType(t.method)})(tf||(xn.FoldingRangeRequest=tf={}));var rf;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=vs.MessageDirection.serverToClient,t.type=new vs.ProtocolRequestType0(t.method)})(rf||(xn.FoldingRangeRefreshRequest=rf={}));var Us={};Object.defineProperty(Us,"__esModule",{value:!0});Us.DeclarationRequest=void 0;const nf=K;var af;(function(t){t.method="textDocument/declaration",t.messageDirection=nf.MessageDirection.clientToServer,t.type=new nf.ProtocolRequestType(t.method)})(af||(Us.DeclarationRequest=af={}));var Bs={};Object.defineProperty(Bs,"__esModule",{value:!0});Bs.SelectionRangeRequest=void 0;const sf=K;var of;(function(t){t.method="textDocument/selectionRange",t.messageDirection=sf.MessageDirection.clientToServer,t.type=new sf.ProtocolRequestType(t.method)})(of||(Bs.SelectionRangeRequest=of={}));var nr={};Object.defineProperty(nr,"__esModule",{value:!0});nr.WorkDoneProgressCancelNotification=nr.WorkDoneProgressCreateRequest=nr.WorkDoneProgress=void 0;const lv=Lr,Es=K;var lf;(function(t){t.type=new lv.ProgressType;function e(r){return r===t.type}t.is=e})(lf||(nr.WorkDoneProgress=lf={}));var cf;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Es.MessageDirection.serverToClient,t.type=new Es.ProtocolRequestType(t.method)})(cf||(nr.WorkDoneProgressCreateRequest=cf={}));var uf;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Es.MessageDirection.clientToServer,t.type=new Es.ProtocolNotificationType(t.method)})(uf||(nr.WorkDoneProgressCancelNotification=uf={}));var ir={};Object.defineProperty(ir,"__esModule",{value:!0});ir.CallHierarchyOutgoingCallsRequest=ir.CallHierarchyIncomingCallsRequest=ir.CallHierarchyPrepareRequest=void 0;const Dn=K;var ff;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Dn.MessageDirection.clientToServer,t.type=new Dn.ProtocolRequestType(t.method)})(ff||(ir.CallHierarchyPrepareRequest=ff={}));var df;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Dn.MessageDirection.clientToServer,t.type=new Dn.ProtocolRequestType(t.method)})(df||(ir.CallHierarchyIncomingCallsRequest=df={}));var hf;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Dn.MessageDirection.clientToServer,t.type=new Dn.ProtocolRequestType(t.method)})(hf||(ir.CallHierarchyOutgoingCallsRequest=hf={}));var Be={};Object.defineProperty(Be,"__esModule",{value:!0});Be.SemanticTokensRefreshRequest=Be.SemanticTokensRangeRequest=Be.SemanticTokensDeltaRequest=Be.SemanticTokensRequest=Be.SemanticTokensRegistrationType=Be.TokenFormat=void 0;const Kt=K;var pf;(function(t){t.Relative="relative"})(pf||(Be.TokenFormat=pf={}));var Ui;(function(t){t.method="textDocument/semanticTokens",t.type=new Kt.RegistrationType(t.method)})(Ui||(Be.SemanticTokensRegistrationType=Ui={}));var mf;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=Kt.MessageDirection.clientToServer,t.type=new Kt.ProtocolRequestType(t.method),t.registrationMethod=Ui.method})(mf||(Be.SemanticTokensRequest=mf={}));var gf;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=Kt.MessageDirection.clientToServer,t.type=new Kt.ProtocolRequestType(t.method),t.registrationMethod=Ui.method})(gf||(Be.SemanticTokensDeltaRequest=gf={}));var yf;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=Kt.MessageDirection.clientToServer,t.type=new Kt.ProtocolRequestType(t.method),t.registrationMethod=Ui.method})(yf||(Be.SemanticTokensRangeRequest=yf={}));var Tf;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=Kt.MessageDirection.serverToClient,t.type=new Kt.ProtocolRequestType0(t.method)})(Tf||(Be.SemanticTokensRefreshRequest=Tf={}));var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.ShowDocumentRequest=void 0;const Rf=K;var vf;(function(t){t.method="window/showDocument",t.messageDirection=Rf.MessageDirection.serverToClient,t.type=new Rf.ProtocolRequestType(t.method)})(vf||(Ws.ShowDocumentRequest=vf={}));var Ks={};Object.defineProperty(Ks,"__esModule",{value:!0});Ks.LinkedEditingRangeRequest=void 0;const Ef=K;var Af;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=Ef.MessageDirection.clientToServer,t.type=new Ef.ProtocolRequestType(t.method)})(Af||(Ks.LinkedEditingRangeRequest=Af={}));var Me={};Object.defineProperty(Me,"__esModule",{value:!0});Me.WillDeleteFilesRequest=Me.DidDeleteFilesNotification=Me.DidRenameFilesNotification=Me.WillRenameFilesRequest=Me.DidCreateFilesNotification=Me.WillCreateFilesRequest=Me.FileOperationPatternKind=void 0;const nt=K;var $f;(function(t){t.file="file",t.folder="folder"})($f||(Me.FileOperationPatternKind=$f={}));var Cf;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=nt.MessageDirection.clientToServer,t.type=new nt.ProtocolRequestType(t.method)})(Cf||(Me.WillCreateFilesRequest=Cf={}));var Sf;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=nt.MessageDirection.clientToServer,t.type=new nt.ProtocolNotificationType(t.method)})(Sf||(Me.DidCreateFilesNotification=Sf={}));var wf;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=nt.MessageDirection.clientToServer,t.type=new nt.ProtocolRequestType(t.method)})(wf||(Me.WillRenameFilesRequest=wf={}));var bf;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=nt.MessageDirection.clientToServer,t.type=new nt.ProtocolNotificationType(t.method)})(bf||(Me.DidRenameFilesNotification=bf={}));var kf;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=nt.MessageDirection.clientToServer,t.type=new nt.ProtocolNotificationType(t.method)})(kf||(Me.DidDeleteFilesNotification=kf={}));var Nf;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=nt.MessageDirection.clientToServer,t.type=new nt.ProtocolRequestType(t.method)})(Nf||(Me.WillDeleteFilesRequest=Nf={}));var ar={};Object.defineProperty(ar,"__esModule",{value:!0});ar.MonikerRequest=ar.MonikerKind=ar.UniquenessLevel=void 0;const _f=K;var If;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(If||(ar.UniquenessLevel=If={}));var Pf;(function(t){t.$import="import",t.$export="export",t.local="local"})(Pf||(ar.MonikerKind=Pf={}));var Of;(function(t){t.method="textDocument/moniker",t.messageDirection=_f.MessageDirection.clientToServer,t.type=new _f.ProtocolRequestType(t.method)})(Of||(ar.MonikerRequest=Of={}));var sr={};Object.defineProperty(sr,"__esModule",{value:!0});sr.TypeHierarchySubtypesRequest=sr.TypeHierarchySupertypesRequest=sr.TypeHierarchyPrepareRequest=void 0;const Mn=K;var Lf;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Mn.MessageDirection.clientToServer,t.type=new Mn.ProtocolRequestType(t.method)})(Lf||(sr.TypeHierarchyPrepareRequest=Lf={}));var xf;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Mn.MessageDirection.clientToServer,t.type=new Mn.ProtocolRequestType(t.method)})(xf||(sr.TypeHierarchySupertypesRequest=xf={}));var Df;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Mn.MessageDirection.clientToServer,t.type=new Mn.ProtocolRequestType(t.method)})(Df||(sr.TypeHierarchySubtypesRequest=Df={}));var Fn={};Object.defineProperty(Fn,"__esModule",{value:!0});Fn.InlineValueRefreshRequest=Fn.InlineValueRequest=void 0;const As=K;var Mf;(function(t){t.method="textDocument/inlineValue",t.messageDirection=As.MessageDirection.clientToServer,t.type=new As.ProtocolRequestType(t.method)})(Mf||(Fn.InlineValueRequest=Mf={}));var Ff;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=As.MessageDirection.serverToClient,t.type=new As.ProtocolRequestType0(t.method)})(Ff||(Fn.InlineValueRefreshRequest=Ff={}));var or={};Object.defineProperty(or,"__esModule",{value:!0});or.InlayHintRefreshRequest=or.InlayHintResolveRequest=or.InlayHintRequest=void 0;const Gn=K;var Gf;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Gn.MessageDirection.clientToServer,t.type=new Gn.ProtocolRequestType(t.method)})(Gf||(or.InlayHintRequest=Gf={}));var jf;(function(t){t.method="inlayHint/resolve",t.messageDirection=Gn.MessageDirection.clientToServer,t.type=new Gn.ProtocolRequestType(t.method)})(jf||(or.InlayHintResolveRequest=jf={}));var zf;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Gn.MessageDirection.serverToClient,t.type=new Gn.ProtocolRequestType0(t.method)})(zf||(or.InlayHintRefreshRequest=zf={}));var tt={};Object.defineProperty(tt,"__esModule",{value:!0});tt.DiagnosticRefreshRequest=tt.WorkspaceDiagnosticRequest=tt.DocumentDiagnosticRequest=tt.DocumentDiagnosticReportKind=tt.DiagnosticServerCancellationData=void 0;const ep=Lr,cv=ye,jn=K;var Uf;(function(t){function e(r){const n=r;return n&&cv.boolean(n.retriggerRequest)}t.is=e})(Uf||(tt.DiagnosticServerCancellationData=Uf={}));var Bf;(function(t){t.Full="full",t.Unchanged="unchanged"})(Bf||(tt.DocumentDiagnosticReportKind=Bf={}));var Wf;(function(t){t.method="textDocument/diagnostic",t.messageDirection=jn.MessageDirection.clientToServer,t.type=new jn.ProtocolRequestType(t.method),t.partialResult=new ep.ProgressType})(Wf||(tt.DocumentDiagnosticRequest=Wf={}));var Kf;(function(t){t.method="workspace/diagnostic",t.messageDirection=jn.MessageDirection.clientToServer,t.type=new jn.ProtocolRequestType(t.method),t.partialResult=new ep.ProgressType})(Kf||(tt.WorkspaceDiagnosticRequest=Kf={}));var Vf;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=jn.MessageDirection.serverToClient,t.type=new jn.ProtocolRequestType0(t.method)})(Vf||(tt.DiagnosticRefreshRequest=Vf={}));var ge={};Object.defineProperty(ge,"__esModule",{value:!0});ge.DidCloseNotebookDocumentNotification=ge.DidSaveNotebookDocumentNotification=ge.DidChangeNotebookDocumentNotification=ge.NotebookCellArrayChange=ge.DidOpenNotebookDocumentNotification=ge.NotebookDocumentSyncRegistrationType=ge.NotebookDocument=ge.NotebookCell=ge.ExecutionSummary=ge.NotebookCellKind=void 0;const Bi=Fc,dt=ye,At=K;var rc;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(rc||(ge.NotebookCellKind=rc={}));var nc;(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 dt.objectLiteral(a)&&Bi.uinteger.is(a.executionOrder)&&(a.success===void 0||dt.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})(nc||(ge.ExecutionSummary=nc={}));var $s;(function(t){function e(a,s){return{kind:a,document:s}}t.create=e;function r(a){const s=a;return dt.objectLiteral(s)&&rc.is(s.kind)&&Bi.DocumentUri.is(s.document)&&(s.metadata===void 0||dt.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)&&!nc.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(dt.objectLiteral(a)&&dt.objectLiteral(s)){const c=Object.keys(a),u=Object.keys(s);if(c.length!==u.length||(c.sort(),u.sort(),!i(c,u)))return!1;for(let d=0;d<c.length;d++){const m=c[d];if(!i(a[m],s[m]))return!1}}return!0}})($s||(ge.NotebookCell=$s={}));var qf;(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 dt.objectLiteral(i)&&dt.string(i.uri)&&Bi.integer.is(i.version)&&dt.typedArray(i.cells,$s.is)}t.is=r})(qf||(ge.NotebookDocument=qf={}));var zn;(function(t){t.method="notebookDocument/sync",t.messageDirection=At.MessageDirection.clientToServer,t.type=new At.RegistrationType(t.method)})(zn||(ge.NotebookDocumentSyncRegistrationType=zn={}));var Hf;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=At.MessageDirection.clientToServer,t.type=new At.ProtocolNotificationType(t.method),t.registrationMethod=zn.method})(Hf||(ge.DidOpenNotebookDocumentNotification=Hf={}));var Xf;(function(t){function e(n){const i=n;return dt.objectLiteral(i)&&Bi.uinteger.is(i.start)&&Bi.uinteger.is(i.deleteCount)&&(i.cells===void 0||dt.typedArray(i.cells,$s.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})(Xf||(ge.NotebookCellArrayChange=Xf={}));var Yf;(function(t){t.method="notebookDocument/didChange",t.messageDirection=At.MessageDirection.clientToServer,t.type=new At.ProtocolNotificationType(t.method),t.registrationMethod=zn.method})(Yf||(ge.DidChangeNotebookDocumentNotification=Yf={}));var Jf;(function(t){t.method="notebookDocument/didSave",t.messageDirection=At.MessageDirection.clientToServer,t.type=new At.ProtocolNotificationType(t.method),t.registrationMethod=zn.method})(Jf||(ge.DidSaveNotebookDocumentNotification=Jf={}));var Zf;(function(t){t.method="notebookDocument/didClose",t.messageDirection=At.MessageDirection.clientToServer,t.type=new At.ProtocolNotificationType(t.method),t.registrationMethod=zn.method})(Zf||(ge.DidCloseNotebookDocumentNotification=Zf={}));var Vs={};Object.defineProperty(Vs,"__esModule",{value:!0});Vs.InlineCompletionRequest=void 0;const Qf=K;var ed;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=Qf.MessageDirection.clientToServer,t.type=new Qf.ProtocolRequestType(t.method)})(ed||(Vs.InlineCompletionRequest=ed={}));(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=Fc,n=ye,i=Gs;Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const a=js;Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return a.TypeDefinitionRequest}});const s=On;Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return s.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return s.DidChangeWorkspaceFoldersNotification}});const o=zs;Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return o.ConfigurationRequest}});const l=Ln;Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return l.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return l.ColorPresentationRequest}});const c=xn;Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return c.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return c.FoldingRangeRefreshRequest}});const u=Us;Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return u.DeclarationRequest}});const d=Bs;Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return d.SelectionRangeRequest}});const m=nr;Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return m.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return m.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return m.WorkDoneProgressCancelNotification}});const g=ir;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 E=Be;Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return E.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return E.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return E.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return E.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return E.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return E.SemanticTokensRegistrationType}});const k=Ws;Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return k.ShowDocumentRequest}});const P=Ks;Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return P.LinkedEditingRangeRequest}});const w=Me;Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return w.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return w.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return w.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return w.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return w.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return w.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return w.WillDeleteFilesRequest}});const _=ar;Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return _.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return _.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return _.MonikerRequest}});const N=sr;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 x=Fn;Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return x.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return x.InlineValueRefreshRequest}});const q=or;Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return q.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return q.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return q.InlayHintRefreshRequest}});const Z=tt;Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Z.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Z.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Z.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Z.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Z.DiagnosticRefreshRequest}});const Q=ge;Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return Q.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return Q.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return Q.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return Q.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Q.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Q.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Q.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Q.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Q.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Q.DidCloseNotebookDocumentNotification}});const he=Vs;Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return he.InlineCompletionRequest}});var ve;(function(f){function Ee(Ae){const B=Ae;return n.string(B)||n.string(B.language)||n.string(B.scheme)||n.string(B.pattern)}f.is=Ee})(ve||(t.TextDocumentFilter=ve={}));var oe;(function(f){function Ee(Ae){const B=Ae;return n.objectLiteral(B)&&(n.string(B.notebookType)||n.string(B.scheme)||n.string(B.pattern))}f.is=Ee})(oe||(t.NotebookDocumentFilter=oe={}));var S;(function(f){function Ee(Ae){const B=Ae;return n.objectLiteral(B)&&(n.string(B.notebook)||oe.is(B.notebook))&&(B.language===void 0||n.string(B.language))}f.is=Ee})(S||(t.NotebookCellTextDocumentFilter=S={}));var R;(function(f){function Ee(Ae){if(!Array.isArray(Ae))return!1;for(let B of Ae)if(!n.string(B)&&!ve.is(B)&&!S.is(B))return!1;return!0}f.is=Ee})(R||(t.DocumentSelector=R={}));var p;(function(f){f.method="client/registerCapability",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType(f.method)})(p||(t.RegistrationRequest=p={}));var $;(function(f){f.method="client/unregisterCapability",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType(f.method)})($||(t.UnregistrationRequest=$={}));var y;(function(f){f.Create="create",f.Rename="rename",f.Delete="delete"})(y||(t.ResourceOperationKind=y={}));var T;(function(f){f.Abort="abort",f.Transactional="transactional",f.TextOnlyTransactional="textOnlyTransactional",f.Undo="undo"})(T||(t.FailureHandlingKind=T={}));var A;(function(f){f.UTF8="utf-8",f.UTF16="utf-16",f.UTF32="utf-32"})(A||(t.PositionEncodingKind=A={}));var O;(function(f){function Ee(Ae){const B=Ae;return B&&n.string(B.id)&&B.id.length>0}f.hasId=Ee})(O||(t.StaticRegistrationOptions=O={}));var D;(function(f){function Ee(Ae){const B=Ae;return B&&(B.documentSelector===null||R.is(B.documentSelector))}f.is=Ee})(D||(t.TextDocumentRegistrationOptions=D={}));var L;(function(f){function Ee(B){const h=B;return n.objectLiteral(h)&&(h.workDoneProgress===void 0||n.boolean(h.workDoneProgress))}f.is=Ee;function Ae(B){const h=B;return h&&n.boolean(h.workDoneProgress)}f.hasWorkDoneProgress=Ae})(L||(t.WorkDoneProgressOptions=L={}));var j;(function(f){f.method="initialize",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(j||(t.InitializeRequest=j={}));var F;(function(f){f.unknownProtocolVersion=1})(F||(t.InitializeErrorCodes=F={}));var re;(function(f){f.method="initialized",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(re||(t.InitializedNotification=re={}));var z;(function(f){f.method="shutdown",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType0(f.method)})(z||(t.ShutdownRequest=z={}));var ee;(function(f){f.method="exit",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType0(f.method)})(ee||(t.ExitNotification=ee={}));var Ie;(function(f){f.method="workspace/didChangeConfiguration",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(Ie||(t.DidChangeConfigurationNotification=Ie={}));var pe;(function(f){f.Error=1,f.Warning=2,f.Info=3,f.Log=4,f.Debug=5})(pe||(t.MessageType=pe={}));var le;(function(f){f.method="window/showMessage",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolNotificationType(f.method)})(le||(t.ShowMessageNotification=le={}));var ke;(function(f){f.method="window/showMessageRequest",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType(f.method)})(ke||(t.ShowMessageRequest=ke={}));var Pe;(function(f){f.method="window/logMessage",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolNotificationType(f.method)})(Pe||(t.LogMessageNotification=Pe={}));var Ce;(function(f){f.method="telemetry/event",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolNotificationType(f.method)})(Ce||(t.TelemetryEventNotification=Ce={}));var X;(function(f){f.None=0,f.Full=1,f.Incremental=2})(X||(t.TextDocumentSyncKind=X={}));var He;(function(f){f.method="textDocument/didOpen",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(He||(t.DidOpenTextDocumentNotification=He={}));var me;(function(f){function Ee(B){let h=B;return h!=null&&typeof h.text=="string"&&h.range!==void 0&&(h.rangeLength===void 0||typeof h.rangeLength=="number")}f.isIncremental=Ee;function Ae(B){let h=B;return h!=null&&typeof h.text=="string"&&h.range===void 0&&h.rangeLength===void 0}f.isFull=Ae})(me||(t.TextDocumentContentChangeEvent=me={}));var at;(function(f){f.method="textDocument/didChange",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(at||(t.DidChangeTextDocumentNotification=at={}));var xr;(function(f){f.method="textDocument/didClose",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(xr||(t.DidCloseTextDocumentNotification=xr={}));var Hn;(function(f){f.method="textDocument/didSave",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(Hn||(t.DidSaveTextDocumentNotification=Hn={}));var Xn;(function(f){f.Manual=1,f.AfterDelay=2,f.FocusOut=3})(Xn||(t.TextDocumentSaveReason=Xn={}));var Yn;(function(f){f.method="textDocument/willSave",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(Yn||(t.WillSaveTextDocumentNotification=Yn={}));var Jn;(function(f){f.method="textDocument/willSaveWaitUntil",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Jn||(t.WillSaveTextDocumentWaitUntilRequest=Jn={}));var st;(function(f){f.method="workspace/didChangeWatchedFiles",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolNotificationType(f.method)})(st||(t.DidChangeWatchedFilesNotification=st={}));var Zn;(function(f){f.Created=1,f.Changed=2,f.Deleted=3})(Zn||(t.FileChangeType=Zn={}));var Zi;(function(f){function Ee(Ae){const B=Ae;return n.objectLiteral(B)&&(r.URI.is(B.baseUri)||r.WorkspaceFolder.is(B.baseUri))&&n.string(B.pattern)}f.is=Ee})(Zi||(t.RelativePattern=Zi={}));var Qi;(function(f){f.Create=1,f.Change=2,f.Delete=4})(Qi||(t.WatchKind=Qi={}));var ea;(function(f){f.method="textDocument/publishDiagnostics",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolNotificationType(f.method)})(ea||(t.PublishDiagnosticsNotification=ea={}));var ta;(function(f){f.Invoked=1,f.TriggerCharacter=2,f.TriggerForIncompleteCompletions=3})(ta||(t.CompletionTriggerKind=ta={}));var Qn;(function(f){f.method="textDocument/completion",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Qn||(t.CompletionRequest=Qn={}));var ei;(function(f){f.method="completionItem/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ei||(t.CompletionResolveRequest=ei={}));var kt;(function(f){f.method="textDocument/hover",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(kt||(t.HoverRequest=kt={}));var ti;(function(f){f.Invoked=1,f.TriggerCharacter=2,f.ContentChange=3})(ti||(t.SignatureHelpTriggerKind=ti={}));var ra;(function(f){f.method="textDocument/signatureHelp",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ra||(t.SignatureHelpRequest=ra={}));var na;(function(f){f.method="textDocument/definition",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(na||(t.DefinitionRequest=na={}));var ri;(function(f){f.method="textDocument/references",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ri||(t.ReferencesRequest=ri={}));var ni;(function(f){f.method="textDocument/documentHighlight",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ni||(t.DocumentHighlightRequest=ni={}));var ia;(function(f){f.method="textDocument/documentSymbol",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ia||(t.DocumentSymbolRequest=ia={}));var aa;(function(f){f.method="textDocument/codeAction",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(aa||(t.CodeActionRequest=aa={}));var sa;(function(f){f.method="codeAction/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(sa||(t.CodeActionResolveRequest=sa={}));var oa;(function(f){f.method="workspace/symbol",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(oa||(t.WorkspaceSymbolRequest=oa={}));var la;(function(f){f.method="workspaceSymbol/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(la||(t.WorkspaceSymbolResolveRequest=la={}));var ca;(function(f){f.method="textDocument/codeLens",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ca||(t.CodeLensRequest=ca={}));var ot;(function(f){f.method="codeLens/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ot||(t.CodeLensResolveRequest=ot={}));var ua;(function(f){f.method="workspace/codeLens/refresh",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType0(f.method)})(ua||(t.CodeLensRefreshRequest=ua={}));var fa;(function(f){f.method="textDocument/documentLink",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(fa||(t.DocumentLinkRequest=fa={}));var hr;(function(f){f.method="documentLink/resolve",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(hr||(t.DocumentLinkResolveRequest=hr={}));var da;(function(f){f.method="textDocument/formatting",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(da||(t.DocumentFormattingRequest=da={}));var Dr;(function(f){f.method="textDocument/rangeFormatting",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Dr||(t.DocumentRangeFormattingRequest=Dr={}));var ha;(function(f){f.method="textDocument/rangesFormatting",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ha||(t.DocumentRangesFormattingRequest=ha={}));var Nt;(function(f){f.method="textDocument/onTypeFormatting",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Nt||(t.DocumentOnTypeFormattingRequest=Nt={}));var Zt;(function(f){f.Identifier=1})(Zt||(t.PrepareSupportDefaultBehavior=Zt={}));var pa;(function(f){f.method="textDocument/rename",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(pa||(t.RenameRequest=pa={}));var ma;(function(f){f.method="textDocument/prepareRename",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(ma||(t.PrepareRenameRequest=ma={}));var Qt;(function(f){f.method="workspace/executeCommand",f.messageDirection=e.MessageDirection.clientToServer,f.type=new e.ProtocolRequestType(f.method)})(Qt||(t.ExecuteCommandRequest=Qt={}));var ii;(function(f){f.method="workspace/applyEdit",f.messageDirection=e.MessageDirection.serverToClient,f.type=new e.ProtocolRequestType("workspace/applyEdit")})(ii||(t.ApplyWorkspaceEditRequest=ii={}))})(Jh);var qs={};Object.defineProperty(qs,"__esModule",{value:!0});qs.createProtocolConnection=void 0;const td=Lr;function uv(t,e,r,n){return td.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,td.createMessageConnection)(t,e,r,n)}qs.createProtocolConnection=uv;(function(t){var e=rt&&rt.__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=rt&&rt.__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(Lr,t),r(Fc,t),r(K,t),r(Jh,t);var n=qs;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={}))})(Yh);(function(t){var e=rt&&rt.__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=rt&&rt.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const n=Bu;r(Bu,t),r(Yh,t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}t.createProtocolConnection=i})(ki);var _i;(function(t){function e(r){return{dispose:async()=>await r()}}t.create=e})(_i||(_i={}));class fv{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new zi,this.documentPhaseListeners=new zi,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=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=de.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=de.None){this.currentState=W.Changed;const i=[];for(const l of r){const c=this.langiumDocuments.deleteDocuments(l);for(const u of c)i.push(u.uri),this.cleanUpDeleted(u)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let c=this.langiumDocuments.getDocument(l);c===void 0&&(c=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),c.state=W.Changed,this.langiumDocuments.addDocument(c)),this.resetToState(c,W.Changed)}const s=ue(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 je(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 ue(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),_i.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 je(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),_i.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),_i.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=de.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(nn);if(this.currentState>=e&&e>i.state)return Promise.reject(new ki.ResponseError(ki.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 ki.ResponseError(ki.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,c=>{Je.equals(c.uri,r)&&(o.dispose(),l.dispose(),a(c.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(nn)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(nn):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(nn)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await je(n),await s(e,n)}catch(o){if(!Ms(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 je(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=ue(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 dv{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new wR,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=>{Je.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),ue(i)}allElements(e,r){let n=ue(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=de.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=de.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 hv{constructor(e){this.initialBuildOptions={},this._ready=new Dc,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=de.None){const n=await this.performStartup(e);await je(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=ue(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 ht.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=Je.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}}class pv{buildUnexpectedCharactersMessage(e,r,n,i,a){return Mo.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return Mo.buildUnableToPopLexerModeMessage(e)}}const mv={mode:"full"};class gv{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=rd(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new We(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=mv){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(rd(e))return e;const r=tp(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}}function yv(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function tp(t){return t&&"modes"in t&&"defaultMode"in t}function rd(t){return!yv(t)&&!tp(t)}function Tv(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=rp(t),s=Gc(n),o=Ev({lines:a,position:i,options:s});return wv({index:0,tokens:o,position:i})}function Rv(t,e){const r=Gc(e),n=rp(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 rp(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(Tm)}const nd=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,vv=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function Ev(t){var i,a,s;const e=[];let r=t.position.line,n=t.position.character;for(let o=0;o<t.lines.length;o++){const l=o===0,c=o===t.lines.length-1;let u=t.lines[o],d=0;if(l&&t.options.start){const g=(i=t.options.start)==null?void 0:i.exec(u);g&&(d=g.index+g[0].length)}else{const g=(a=t.options.line)==null?void 0:a.exec(u);g&&(d=g.index+g[0].length)}if(c){const g=(s=t.options.end)==null?void 0:s.exec(u);g&&(u=u.substring(0,g.index))}if(u=u.substring(0,Sv(u)),ic(u,d)>=u.length){if(e.length>0){const g=J.create(r,n);e.push({type:"break",content:"",range:V.create(g,g)})}}else{nd.lastIndex=d;const g=nd.exec(u);if(g){const E=g[0],k=g[1],P=J.create(r,n+d),w=J.create(r,n+d+E.length);e.push({type:"tag",content:k,range:V.create(P,w)}),d+=E.length,d=ic(u,d)}if(d<u.length){const E=u.substring(d),k=Array.from(E.matchAll(vv));e.push(...Av(k,E,r,n+d))}}r++,n=0}return e.length>0&&e[e.length-1].type==="break"?e.slice(0,-1):e}function Av(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 u=c.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:V.create(J.create(r,a+u+n),J.create(r,a+u+d.length+n))}),u+=d.length,o.length===4){u+=o[2].length;const m=o[3];i.push({type:"text",content:m,range:V.create(J.create(r,a+u+n),J.create(r,a+u+m.length+n))})}else i.push({type:"text",content:"",range:V.create(J.create(r,a+u+n),J.create(r,a+u+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:V.create(J.create(r,a+n),J.create(r,a+n+s.length))})}return i}const $v=/\S/,Cv=/\s*$/;function ic(t,e){const r=t.substring(e).match($v);return r?e+r.index:t.length}function Sv(t){const e=t.match(Cv);if(e&&typeof e.index=="number")return e.index}function wv(t){var a,s;const e=J.create(t.position.line,t.position.character);if(t.tokens.length===0)return new id([],V.create(e,e));const r=[];for(;t.index<t.tokens.length;){const o=bv(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 id(r,V.create(n,i))}function bv(t,e){const r=t.tokens[t.index];if(r.type==="tag")return ip(t,!1);if(r.type==="text"||r.type==="inline-tag")return np(t);kv(r,e),t.index++}function kv(t,e){if(e){const r=new sp("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function np(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(Nv(t)),n=e,e=t.tokens[t.index];return new ac(i,V.create(r.range.start,n.range.end))}function Nv(t){return t.tokens[t.index].type==="inline-tag"?ip(t,!0):ap(t)}function ip(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=ap(t);return new fo(n,new ac([a],a.range),e,V.create(r.range.start,a.range.end))}else{const a=np(t);return new fo(n,a,e,V.create(r.range.start,a.range.end))}else{const a=r.range;return new fo(n,new ac([],a),e,a)}}function ap(t){const e=t.tokens[t.index++];return new sp(e.content,e.range)}function Gc(t){if(!t)return Gc({start:"/**",end:"*/",line:"*"});const{start:e,end:r,line:n}=t;return{start:uo(e,!0),end:uo(r,!1),line:uo(n,!0)}}function uo(t,e){if(typeof t=="string"||typeof t=="object"){const r=typeof t=="string"?ks(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}class id{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+=ad(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+=ad(r)+i}return r.trim()}}class fo{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
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=_v(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
153
  ${r}`),this.inline?`{${i}}`:i}}function _v(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const o=ic(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))??Iv(e,a)}}function Iv(t,e){try{return ht.parse(t,!0),`[${e}](${t})`}catch{return t}}class ac{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
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+=`