likec4 1.19.2 → 1.20.1

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 (38) hide show
  1. package/__app__/react/likec4.tsx +16 -114
  2. package/__app__/src/chunks/{-index-overview-COSF42be.js → -index-overview-B8Ngh4J7.js} +20 -19
  3. package/__app__/src/chunks/{likec4-CusAw_j6.js → likec4-CK8zVxjc.js} +1172 -1209
  4. package/__app__/src/chunks/main-DwHOiMDD.js +23884 -0
  5. package/__app__/src/chunks/{mantine-B_6mKFFA.js → mantine-B9NZkjVg.js} +993 -981
  6. package/__app__/src/chunks/tanstack-router-B9I-d36d.js +3032 -0
  7. package/__app__/src/main.js +1 -2
  8. package/__app__/src/style.css +1 -1
  9. package/__app__/webcomponent/webcomponent.js +31795 -32402
  10. package/dist/chunks/prompt.cjs +1 -1
  11. package/dist/chunks/prompt.mjs +1 -1
  12. package/dist/cli/index.cjs +47 -58
  13. package/dist/cli/index.mjs +29 -40
  14. package/dist/index.cjs +1 -1
  15. package/dist/index.d.cts +106 -81
  16. package/dist/index.d.mts +106 -81
  17. package/dist/index.d.ts +106 -81
  18. package/dist/index.mjs +1 -1
  19. package/dist/model/index.cjs +1 -1
  20. package/dist/model/index.d.cts +4 -257
  21. package/dist/model/index.d.mts +4 -257
  22. package/dist/model/index.d.ts +4 -257
  23. package/dist/model/index.mjs +1 -1
  24. package/dist/shared/likec4.Buej2FfJ.mjs +1857 -0
  25. package/dist/shared/likec4.pZxbrzrY.cjs +1857 -0
  26. package/package.json +39 -39
  27. package/react/index.d.ts +771 -1546
  28. package/react/index.js +36196 -36908
  29. package/react/style.css +1 -1
  30. package/__app__/src/chunks/main-CtzxB_vG.js +0 -24136
  31. package/__app__/src/chunks/tanstack-router-BBWuTKWO.js +0 -2373
  32. package/dist/shared/likec4.-U9_Dinu.cjs +0 -1856
  33. package/dist/shared/likec4.CVn8U3Og.cjs +0 -9
  34. package/dist/shared/likec4.Cgd5VecV.mjs +0 -9
  35. package/dist/shared/likec4.D7BM0ZAO.mjs +0 -1856
  36. package/dist/shared/likec4.DJeGiAvE.d.cts +0 -1639
  37. package/dist/shared/likec4.DJeGiAvE.d.mts +0 -1639
  38. package/dist/shared/likec4.DJeGiAvE.d.ts +0 -1639
@@ -1,1856 +0,0 @@
1
- import*as P0 from"node:fs";import{writeFileSync as x0,statSync as x2,readFileSync as qm,appendFileSync as I2,createReadStream as I0,createWriteStream as N0,existsSync as N2}from"node:fs";import Hr,{sep as O0,resolve as O2,basename as F2}from"node:path";import{fileURLToPath as jm,pathToFileURL as L2}from"node:url";import{isatty as M2}from"tty";import B2,{formatWithOptions as F0,debuglog as z2,stripVTControlCharacters as q2,inspect as Hd,promisify as j2,callbackify as go,aborted as U2}from"node:util";import G2 from"util";import Tr from"path";import W2 from"os";import H2 from"crypto";import V2 from"net";import K2 from"url";import yo from"fs";import L0 from"child_process";import{stat as Y2}from"node:fs/promises";import ot,{cwd as X2,platform as J2,hrtime as Vd,execPath as Z2,execArgv as Q2}from"node:process";import*as Um from"node:tty";import M0 from"node:tty";import{s as eN,p as tN,r as nN,t as B0,x as Kd,n as Oe,k as ka,E as Ca,o as Ce,i as Yd,H as ms,J as z0,K as rN,M as fn,N as iN,R as Aa,S as _a,Z as q0,X as sN,Y as oN,_ as aN,a0 as cN,a1 as j0,a2 as uN,a3 as lN,a4 as dN,T as U0,a as Xd,a5 as G0,a6 as fN,a7 as pN,a8 as Pa,a9 as W0,aa as Gm,ab as xa,ac as sr,ad as hN,ae as mN,af as H0,ag as V0,Q as gN}from"./likec4.Cgd5VecV.mjs";import{Graphviz as Wm}from"@hpcc-js/wasm-graphviz";import{Buffer as Hm}from"buffer";import{ChildProcess as K0,spawnSync as yN,spawn as vN}from"node:child_process";import{StringDecoder as Y0}from"node:string_decoder";import{setTimeout as X0,scheduler as J0,setImmediate as wN}from"node:timers/promises";import{constants as gs}from"node:os";import{once as Sn,addAbortListener as Z0,EventEmitter as bN,on as Jd,setMaxListeners as DN}from"node:events";import{serialize as EN}from"node:v8";import{Transform as RN,getDefaultHighWaterMark as Zd,PassThrough as Q0,Readable as ys,Writable as Vm,Duplex as Km}from"node:stream";import{Buffer as Ym}from"node:buffer";import{finished as ki}from"node:stream/promises";import{createLogger as $N}from"vite";const TN=["amber","blue","gray","slate","green","indigo","muted","primary","red","secondary","sky"];function eD(t){return t in TN}function SN(t,e){let n=Math.ceil(t),r=Math.floor(e);if(r<n)throw new RangeError(`randomInteger: The range [${t.toString()},${e.toString()}] contains no integer`);return Math.floor(Math.random()*(r-n+1)+n)}var Xm,tD;function kN(){if(tD)return Xm;tD=1;var t=tN(),e=nN();function n(){this.clear()}return n.prototype.clear=function(){this.head=null,this.tail=null,this.size=0},n.prototype.first=function(){return this.head?this.head.item:void 0},n.prototype.peek=n.prototype.first,n.prototype.last=function(){return this.tail?this.tail.item:void 0},n.prototype.push=function(r){var i={item:r,next:null};return this.head?(this.tail.next=i,this.tail=i):(this.head=i,this.tail=i),this.size++,this.size},n.prototype.unshift=function(r){var i={item:r,next:null};return this.head?(this.head.next||(this.tail=this.head),i.next=this.head,this.head=i):(this.head=i,this.tail=i),this.size++,this.size},n.prototype.shift=function(){if(this.size){var r=this.head;return this.head=r.next,this.size--,r.item}},n.prototype.forEach=function(r,i){if(this.size){i=arguments.length>1?i:this;for(var s=this.head,o=0;s;)r.call(i,s.item,o,this),s=s.next,o++}},n.prototype.toArray=function(){if(!this.size)return[];for(var r=new Array(this.size),i=0,s=this.size,o=this.head;i<s;i++)r[i]=o.item,o=o.next;return r},n.prototype.values=function(){var r=this.head;return new t(function(){if(!r)return{done:!0};var i=r.item;return r=r.next,{value:i,done:!1}})},n.prototype.entries=function(){var r=this.head,i=0;return new t(function(){if(!r)return{done:!0};var s=r.item;return r=r.next,i++,{value:[i-1,s],done:!1}})},typeof Symbol<"u"&&(n.prototype[Symbol.iterator]=n.prototype.values),n.prototype.toString=function(){return this.toArray().join(",")},n.prototype.toJSON=function(){return this.toArray()},n.prototype.inspect=function(){var r=this.toArray();return Object.defineProperty(r,"constructor",{value:n,enumerable:!1}),r},typeof Symbol<"u"&&(n.prototype[Symbol.for("nodejs.util.inspect.custom")]=n.prototype.inspect),n.from=function(r){var i=new n;return e(r,function(s){i.push(s)}),i},Xm=n,Xm}var CN=kN();const Jm=eN(CN),AN="LIKEC4_DELAY";function nD(...t){let e=100;return t.length===2?e=SN(t[0],t[1]):t.length===1&&(e=t[0]),new Promise(n=>{setTimeout(()=>{n(AN)},e??100)})}const _N=(t,e)=>{const n=B0(t.source,t.target),r=B0(e.source,e.target);if(n&&!r)return 1;if(!n&&r)return-1;const i=n&&r?Kd(n,r):0;if(i!==0)return i;const s=Kd(t.source,e.source);return s!==0?s:Kd(t.target,e.target)},{min:PN,max:xN}=Math,vs=(t,e=0,n=1)=>PN(xN(e,t),n),Zm=t=>{t._clipped=!1,t._unclipped=t.slice(0);for(let e=0;e<=3;e++)e<3?((t[e]<0||t[e]>255)&&(t._clipped=!0),t[e]=vs(t[e],0,255)):e===3&&(t[e]=vs(t[e],0,1));return t},rD={};for(let t of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])rD[`[object ${t}]`]=t.toLowerCase();function Le(t){return rD[Object.prototype.toString.call(t)]||"object"}const ke=(t,e=null)=>t.length>=3?Array.prototype.slice.call(t):Le(t[0])=="object"&&e?e.split("").filter(n=>t[0][n]!==void 0).map(n=>t[0][n]):t[0].slice(0),vo=t=>{if(t.length<2)return null;const e=t.length-1;return Le(t[e])=="string"?t[e].toLowerCase():null},{PI:Qd,min:iD,max:sD}=Math,Vn=t=>Math.round(t*100)/100,Qm=t=>Math.round(t*100)/100,Vr=Qd*2,eg=Qd/3,IN=Qd/180,NN=180/Qd;function oD(t){return[...t.slice(0,3).reverse(),...t.slice(3)]}const Te={format:{},autodetect:[]};let re=class{constructor(...e){const n=this;if(Le(e[0])==="object"&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];let r=vo(e),i=!1;if(!r){i=!0,Te.sorted||(Te.autodetect=Te.autodetect.sort((s,o)=>o.p-s.p),Te.sorted=!0);for(let s of Te.autodetect)if(r=s.test(...e),r)break}if(Te.format[r]){const s=Te.format[r].apply(null,i?e:e.slice(0,-1));n._rgb=Zm(s)}else throw new Error("unknown format: "+e);n._rgb.length===3&&n._rgb.push(1)}toString(){return Le(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}};const ON="3.1.2",ze=(...t)=>new re(...t);ze.version=ON;const wo={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},FN=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,LN=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,aD=t=>{if(t.match(FN)){(t.length===4||t.length===7)&&(t=t.substr(1)),t.length===3&&(t=t.split(""),t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const e=parseInt(t,16),n=e>>16,r=e>>8&255,i=e&255;return[n,r,i,1]}if(t.match(LN)){(t.length===5||t.length===9)&&(t=t.substr(1)),t.length===4&&(t=t.split(""),t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);const e=parseInt(t,16),n=e>>24&255,r=e>>16&255,i=e>>8&255,s=Math.round((e&255)/255*100)/100;return[n,r,i,s]}throw new Error(`unknown hex color: ${t}`)},{round:ef}=Math,cD=(...t)=>{let[e,n,r,i]=ke(t,"rgba"),s=vo(t)||"auto";i===void 0&&(i=1),s==="auto"&&(s=i<1?"rgba":"rgb"),e=ef(e),n=ef(n),r=ef(r);let o="000000"+(e<<16|n<<8|r).toString(16);o=o.substr(o.length-6);let a="0"+ef(i*255).toString(16);switch(a=a.substr(a.length-2),s.toLowerCase()){case"rgba":return`#${o}${a}`;case"argb":return`#${a}${o}`;default:return`#${o}`}};re.prototype.name=function(){const t=cD(this._rgb,"rgb");for(let e of Object.keys(wo))if(wo[e]===t)return e.toLowerCase();return t},Te.format.named=t=>{if(t=t.toLowerCase(),wo[t])return aD(wo[t]);throw new Error("unknown color name: "+t)},Te.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&Le(t)==="string"&&wo[t.toLowerCase()])return"named"}}),re.prototype.alpha=function(t,e=!1){return t!==void 0&&Le(t)==="number"?e?(this._rgb[3]=t,this):new re([this._rgb[0],this._rgb[1],this._rgb[2],t],"rgb"):this._rgb[3]},re.prototype.clipped=function(){return this._rgb._clipped||!1};const Sr={Kn:18,labWhitePoint:"d65",Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},MN=new Map([["a",[1.0985,.35585]],["b",[1.0985,.35585]],["c",[.98074,1.18232]],["d50",[.96422,.82521]],["d55",[.95682,.92149]],["d65",[.95047,1.08883]],["e",[1,1,1]],["f2",[.99186,.67393]],["f7",[.95041,1.08747]],["f11",[1.00962,.6435]],["icc",[.96422,.82521]]]);function Kr(t){const e=MN.get(String(t).toLowerCase());if(!e)throw new Error("unknown Lab illuminant "+t);Sr.labWhitePoint=t,Sr.Xn=e[0],Sr.Zn=e[1]}function Ia(){return Sr.labWhitePoint}const tg=(...t)=>{t=ke(t,"lab");const[e,n,r]=t,[i,s,o]=BN(e,n,r),[a,c,u]=uD(i,s,o);return[a,c,u,t.length>3?t[3]:1]},BN=(t,e,n)=>{const{kE:r,kK:i,kKE:s,Xn:o,Yn:a,Zn:c}=Sr,u=(t+16)/116,l=.002*e+u,d=u-.005*n,f=l*l*l,p=d*d*d,h=f>r?f:(116*l-16)/i,v=t>s?Math.pow((t+16)/116,3):t/i,b=p>r?p:(116*d-16)/i,g=h*o,w=v*a,R=b*c;return[g,w,R]},ng=t=>{const e=Math.sign(t);return t=Math.abs(t),(t<=.0031308?t*12.92:1.055*Math.pow(t,1/2.4)-.055)*e},uD=(t,e,n)=>{const{MtxAdaptMa:r,MtxAdaptMaI:i,MtxXYZ2RGB:s,RefWhiteRGB:o,Xn:a,Yn:c,Zn:u}=Sr,l=a*r.m00+c*r.m10+u*r.m20,d=a*r.m01+c*r.m11+u*r.m21,f=a*r.m02+c*r.m12+u*r.m22,p=o.X*r.m00+o.Y*r.m10+o.Z*r.m20,h=o.X*r.m01+o.Y*r.m11+o.Z*r.m21,v=o.X*r.m02+o.Y*r.m12+o.Z*r.m22,b=(t*r.m00+e*r.m10+n*r.m20)*(p/l),g=(t*r.m01+e*r.m11+n*r.m21)*(h/d),w=(t*r.m02+e*r.m12+n*r.m22)*(v/f),R=b*i.m00+g*i.m10+w*i.m20,k=b*i.m01+g*i.m11+w*i.m21,A=b*i.m02+g*i.m12+w*i.m22,N=ng(R*s.m00+k*s.m10+A*s.m20),_=ng(R*s.m01+k*s.m11+A*s.m21),B=ng(R*s.m02+k*s.m12+A*s.m22);return[N*255,_*255,B*255]},rg=(...t)=>{const[e,n,r,...i]=ke(t,"rgb"),[s,o,a]=lD(e,n,r),[c,u,l]=zN(s,o,a);return[c,u,l,...i.length>0&&i[0]<1?[i[0]]:[]]};function zN(t,e,n){const{Xn:r,Yn:i,Zn:s,kE:o,kK:a}=Sr,c=t/r,u=e/i,l=n/s,d=c>o?Math.pow(c,1/3):(a*c+16)/116,f=u>o?Math.pow(u,1/3):(a*u+16)/116,p=l>o?Math.pow(l,1/3):(a*l+16)/116;return[116*f-16,500*(d-f),200*(f-p)]}function ig(t){const e=Math.sign(t);return t=Math.abs(t),(t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4))*e}const lD=(t,e,n)=>{t=ig(t/255),e=ig(e/255),n=ig(n/255);const{MtxRGB2XYZ:r,MtxAdaptMa:i,MtxAdaptMaI:s,Xn:o,Yn:a,Zn:c,As:u,Bs:l,Cs:d}=Sr;let f=t*r.m00+e*r.m10+n*r.m20,p=t*r.m01+e*r.m11+n*r.m21,h=t*r.m02+e*r.m12+n*r.m22;const v=o*i.m00+a*i.m10+c*i.m20,b=o*i.m01+a*i.m11+c*i.m21,g=o*i.m02+a*i.m12+c*i.m22;let w=f*i.m00+p*i.m10+h*i.m20,R=f*i.m01+p*i.m11+h*i.m21,k=f*i.m02+p*i.m12+h*i.m22;return w*=v/u,R*=b/l,k*=g/d,f=w*s.m00+R*s.m10+k*s.m20,p=w*s.m01+R*s.m11+k*s.m21,h=w*s.m02+R*s.m12+k*s.m22,[f,p,h]};re.prototype.lab=function(){return rg(this._rgb)};const qN=(...t)=>new re(...t,"lab");Object.assign(ze,{lab:qN,getLabWhitePoint:Ia,setLabWhitePoint:Kr}),Te.format.lab=tg,Te.autodetect.push({p:2,test:(...t)=>{if(t=ke(t,"lab"),Le(t)==="array"&&t.length===3)return"lab"}}),re.prototype.darken=function(t=1){const e=this,n=e.lab();return n[0]-=Sr.Kn*t,new re(n,"lab").alpha(e.alpha(),!0)},re.prototype.brighten=function(t=1){return this.darken(-t)},re.prototype.darker=re.prototype.darken,re.prototype.brighter=re.prototype.brighten,re.prototype.get=function(t){const[e,n]=t.split("."),r=this[e]();if(n){const i=e.indexOf(n)-(e.substr(0,2)==="ok"?2:0);if(i>-1)return r[i];throw new Error(`unknown channel ${n} in mode ${e}`)}else return r};const{pow:jN}=Math,UN=1e-7,GN=20;re.prototype.luminance=function(t,e="rgb"){if(t!==void 0&&Le(t)==="number"){if(t===0)return new re([0,0,0,this._rgb[3]],"rgb");if(t===1)return new re([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),r=GN;const i=(o,a)=>{const c=o.interpolate(a,.5,e),u=c.luminance();return Math.abs(t-u)<UN||!r--?c:u>t?i(o,c):i(c,a)},s=(n>t?i(new re([0,0,0]),this):i(this,new re([255,255,255]))).rgb();return new re([...s,this._rgb[3]])}return WN(...this._rgb.slice(0,3))};const WN=(t,e,n)=>(t=sg(t),e=sg(e),n=sg(n),.2126*t+.7152*e+.0722*n),sg=t=>(t/=255,t<=.03928?t/12.92:jN((t+.055)/1.055,2.4)),tn={},bo=(t,e,n=.5,...r)=>{let i=r[0]||"lrgb";if(!tn[i]&&!r.length&&(i=Object.keys(tn)[0]),!tn[i])throw new Error(`interpolation mode ${i} is not defined`);return Le(t)!=="object"&&(t=new re(t)),Le(e)!=="object"&&(e=new re(e)),tn[i](t,e,n).alpha(t.alpha()+n*(e.alpha()-t.alpha()))};re.prototype.mix=re.prototype.interpolate=function(t,e=.5,...n){return bo(this,t,e,...n)},re.prototype.premultiply=function(t=!1){const e=this._rgb,n=e[3];return t?(this._rgb=[e[0]*n,e[1]*n,e[2]*n,n],this):new re([e[0]*n,e[1]*n,e[2]*n,n],"rgb")};const{sin:HN,cos:VN}=Math,dD=(...t)=>{let[e,n,r]=ke(t,"lch");return isNaN(r)&&(r=0),r=r*IN,[e,VN(r)*n,HN(r)*n]},og=(...t)=>{t=ke(t,"lch");const[e,n,r]=t,[i,s,o]=dD(e,n,r),[a,c,u]=tg(i,s,o);return[a,c,u,t.length>3?t[3]:1]},KN=(...t)=>{const e=oD(ke(t,"hcl"));return og(...e)},{sqrt:YN,atan2:XN,round:JN}=Math,fD=(...t)=>{const[e,n,r]=ke(t,"lab"),i=YN(n*n+r*r);let s=(XN(r,n)*NN+360)%360;return JN(i*1e4)===0&&(s=Number.NaN),[e,i,s]},ag=(...t)=>{const[e,n,r,...i]=ke(t,"rgb"),[s,o,a]=rg(e,n,r),[c,u,l]=fD(s,o,a);return[c,u,l,...i.length>0&&i[0]<1?[i[0]]:[]]};re.prototype.lch=function(){return ag(this._rgb)},re.prototype.hcl=function(){return oD(ag(this._rgb))};const ZN=(...t)=>new re(...t,"lch"),QN=(...t)=>new re(...t,"hcl");Object.assign(ze,{lch:ZN,hcl:QN}),Te.format.lch=og,Te.format.hcl=KN,["lch","hcl"].forEach(t=>Te.autodetect.push({p:2,test:(...e)=>{if(e=ke(e,t),Le(e)==="array"&&e.length===3)return t}})),re.prototype.saturate=function(t=1){const e=this,n=e.lch();return n[1]+=Sr.Kn*t,n[1]<0&&(n[1]=0),new re(n,"lch").alpha(e.alpha(),!0)},re.prototype.desaturate=function(t=1){return this.saturate(-t)},re.prototype.set=function(t,e,n=!1){const[r,i]=t.split("."),s=this[r]();if(i){const o=r.indexOf(i)-(r.substr(0,2)==="ok"?2:0);if(o>-1){if(Le(e)=="string")switch(e.charAt(0)){case"+":s[o]+=+e;break;case"-":s[o]+=+e;break;case"*":s[o]*=+e.substr(1);break;case"/":s[o]/=+e.substr(1);break;default:s[o]=+e}else if(Le(e)==="number")s[o]=e;else throw new Error("unsupported value for Color.set");const a=new re(s,r);return n?(this._rgb=a._rgb,this):a}throw new Error(`unknown channel ${i} in mode ${r}`)}else return s},re.prototype.tint=function(t=.5,...e){return bo(this,"white",t,...e)},re.prototype.shade=function(t=.5,...e){return bo(this,"black",t,...e)};const eO=(t,e,n)=>{const r=t._rgb,i=e._rgb;return new re(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"rgb")};tn.rgb=eO;const{sqrt:cg,pow:Do}=Math,tO=(t,e,n)=>{const[r,i,s]=t._rgb,[o,a,c]=e._rgb;return new re(cg(Do(r,2)*(1-n)+Do(o,2)*n),cg(Do(i,2)*(1-n)+Do(a,2)*n),cg(Do(s,2)*(1-n)+Do(c,2)*n),"rgb")};tn.lrgb=tO;const nO=(t,e,n)=>{const r=t.lab(),i=e.lab();return new re(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"lab")};tn.lab=nO;const Eo=(t,e,n,r)=>{let i,s;r==="hsl"?(i=t.hsl(),s=e.hsl()):r==="hsv"?(i=t.hsv(),s=e.hsv()):r==="hcg"?(i=t.hcg(),s=e.hcg()):r==="hsi"?(i=t.hsi(),s=e.hsi()):r==="lch"||r==="hcl"?(r="hcl",i=t.hcl(),s=e.hcl()):r==="oklch"&&(i=t.oklch().reverse(),s=e.oklch().reverse());let o,a,c,u,l,d;(r.substr(0,1)==="h"||r==="oklch")&&([o,c,l]=i,[a,u,d]=s);let f,p,h,v;return!isNaN(o)&&!isNaN(a)?(a>o&&a-o>180?v=a-(o+360):a<o&&o-a>180?v=a+360-o:v=a-o,p=o+n*v):isNaN(o)?isNaN(a)?p=Number.NaN:(p=a,(l==1||l==0)&&r!="hsv"&&(f=u)):(p=o,(d==1||d==0)&&r!="hsv"&&(f=c)),f===void 0&&(f=c+n*(u-c)),h=l+n*(d-l),r==="oklch"?new re([h,f,p],r):new re([p,f,h],r)},pD=(t,e,n)=>Eo(t,e,n,"lch");tn.lch=pD,tn.hcl=pD;const rO=t=>{if(Le(t)=="number"&&t>=0&&t<=16777215){const e=t>>16,n=t>>8&255,r=t&255;return[e,n,r,1]}throw new Error("unknown num color: "+t)},iO=(...t)=>{const[e,n,r]=ke(t,"rgb");return(e<<16)+(n<<8)+r};re.prototype.num=function(){return iO(this._rgb)};const sO=(...t)=>new re(...t,"num");Object.assign(ze,{num:sO}),Te.format.num=rO,Te.autodetect.push({p:5,test:(...t)=>{if(t.length===1&&Le(t[0])==="number"&&t[0]>=0&&t[0]<=16777215)return"num"}});const oO=(t,e,n)=>{const r=t.num(),i=e.num();return new re(r+n*(i-r),"num")};tn.num=oO;const{floor:aO}=Math,cO=(...t)=>{t=ke(t,"hcg");let[e,n,r]=t,i,s,o;r=r*255;const a=n*255;if(n===0)i=s=o=r;else{e===360&&(e=0),e>360&&(e-=360),e<0&&(e+=360),e/=60;const c=aO(e),u=e-c,l=r*(1-n),d=l+a*(1-u),f=l+a*u,p=l+a;switch(c){case 0:[i,s,o]=[p,f,l];break;case 1:[i,s,o]=[d,p,l];break;case 2:[i,s,o]=[l,p,f];break;case 3:[i,s,o]=[l,d,p];break;case 4:[i,s,o]=[f,l,p];break;case 5:[i,s,o]=[p,l,d];break}}return[i,s,o,t.length>3?t[3]:1]},uO=(...t)=>{const[e,n,r]=ke(t,"rgb"),i=iD(e,n,r),s=sD(e,n,r),o=s-i,a=o*100/255,c=i/(255-o)*100;let u;return o===0?u=Number.NaN:(e===s&&(u=(n-r)/o),n===s&&(u=2+(r-e)/o),r===s&&(u=4+(e-n)/o),u*=60,u<0&&(u+=360)),[u,a,c]};re.prototype.hcg=function(){return uO(this._rgb)};const lO=(...t)=>new re(...t,"hcg");ze.hcg=lO,Te.format.hcg=cO,Te.autodetect.push({p:1,test:(...t)=>{if(t=ke(t,"hcg"),Le(t)==="array"&&t.length===3)return"hcg"}});const dO=(t,e,n)=>Eo(t,e,n,"hcg");tn.hcg=dO;const{cos:Ro}=Math,fO=(...t)=>{t=ke(t,"hsi");let[e,n,r]=t,i,s,o;return isNaN(e)&&(e=0),isNaN(n)&&(n=0),e>360&&(e-=360),e<0&&(e+=360),e/=360,e<1/3?(o=(1-n)/3,i=(1+n*Ro(Vr*e)/Ro(eg-Vr*e))/3,s=1-(o+i)):e<2/3?(e-=1/3,i=(1-n)/3,s=(1+n*Ro(Vr*e)/Ro(eg-Vr*e))/3,o=1-(i+s)):(e-=2/3,s=(1-n)/3,o=(1+n*Ro(Vr*e)/Ro(eg-Vr*e))/3,i=1-(s+o)),i=vs(r*i*3),s=vs(r*s*3),o=vs(r*o*3),[i*255,s*255,o*255,t.length>3?t[3]:1]},{min:pO,sqrt:hO,acos:mO}=Math,gO=(...t)=>{let[e,n,r]=ke(t,"rgb");e/=255,n/=255,r/=255;let i;const s=pO(e,n,r),o=(e+n+r)/3,a=o>0?1-s/o:0;return a===0?i=NaN:(i=(e-n+(e-r))/2,i/=hO((e-n)*(e-n)+(e-r)*(n-r)),i=mO(i),r>n&&(i=Vr-i),i/=Vr),[i*360,a,o]};re.prototype.hsi=function(){return gO(this._rgb)};const yO=(...t)=>new re(...t,"hsi");ze.hsi=yO,Te.format.hsi=fO,Te.autodetect.push({p:2,test:(...t)=>{if(t=ke(t,"hsi"),Le(t)==="array"&&t.length===3)return"hsi"}});const vO=(t,e,n)=>Eo(t,e,n,"hsi");tn.hsi=vO;const ug=(...t)=>{t=ke(t,"hsl");const[e,n,r]=t;let i,s,o;if(n===0)i=s=o=r*255;else{const a=[0,0,0],c=[0,0,0],u=r<.5?r*(1+n):r+n-r*n,l=2*r-u,d=e/360;a[0]=d+1/3,a[1]=d,a[2]=d-1/3;for(let f=0;f<3;f++)a[f]<0&&(a[f]+=1),a[f]>1&&(a[f]-=1),6*a[f]<1?c[f]=l+(u-l)*6*a[f]:2*a[f]<1?c[f]=u:3*a[f]<2?c[f]=l+(u-l)*(2/3-a[f])*6:c[f]=l;[i,s,o]=[c[0]*255,c[1]*255,c[2]*255]}return t.length>3?[i,s,o,t[3]]:[i,s,o,1]},hD=(...t)=>{t=ke(t,"rgba");let[e,n,r]=t;e/=255,n/=255,r/=255;const i=iD(e,n,r),s=sD(e,n,r),o=(s+i)/2;let a,c;return s===i?(a=0,c=Number.NaN):a=o<.5?(s-i)/(s+i):(s-i)/(2-s-i),e==s?c=(n-r)/(s-i):n==s?c=2+(r-e)/(s-i):r==s&&(c=4+(e-n)/(s-i)),c*=60,c<0&&(c+=360),t.length>3&&t[3]!==void 0?[c,a,o,t[3]]:[c,a,o]};re.prototype.hsl=function(){return hD(this._rgb)};const wO=(...t)=>new re(...t,"hsl");ze.hsl=wO,Te.format.hsl=ug,Te.autodetect.push({p:2,test:(...t)=>{if(t=ke(t,"hsl"),Le(t)==="array"&&t.length===3)return"hsl"}});const bO=(t,e,n)=>Eo(t,e,n,"hsl");tn.hsl=bO;const{floor:DO}=Math,EO=(...t)=>{t=ke(t,"hsv");let[e,n,r]=t,i,s,o;if(r*=255,n===0)i=s=o=r;else{e===360&&(e=0),e>360&&(e-=360),e<0&&(e+=360),e/=60;const a=DO(e),c=e-a,u=r*(1-n),l=r*(1-n*c),d=r*(1-n*(1-c));switch(a){case 0:[i,s,o]=[r,d,u];break;case 1:[i,s,o]=[l,r,u];break;case 2:[i,s,o]=[u,r,d];break;case 3:[i,s,o]=[u,l,r];break;case 4:[i,s,o]=[d,u,r];break;case 5:[i,s,o]=[r,u,l];break}}return[i,s,o,t.length>3?t[3]:1]},{min:RO,max:$O}=Math,TO=(...t)=>{t=ke(t,"rgb");let[e,n,r]=t;const i=RO(e,n,r),s=$O(e,n,r),o=s-i;let a,c,u;return u=s/255,s===0?(a=Number.NaN,c=0):(c=o/s,e===s&&(a=(n-r)/o),n===s&&(a=2+(r-e)/o),r===s&&(a=4+(e-n)/o),a*=60,a<0&&(a+=360)),[a,c,u]};re.prototype.hsv=function(){return TO(this._rgb)};const SO=(...t)=>new re(...t,"hsv");ze.hsv=SO,Te.format.hsv=EO,Te.autodetect.push({p:2,test:(...t)=>{if(t=ke(t,"hsv"),Le(t)==="array"&&t.length===3)return"hsv"}});const kO=(t,e,n)=>Eo(t,e,n,"hsv");tn.hsv=kO;function tf(t,e){let n=t.length;Array.isArray(t[0])||(t=[t]),Array.isArray(e[0])||(e=e.map(o=>[o]));let r=e[0].length,i=e[0].map((o,a)=>e.map(c=>c[a])),s=t.map(o=>i.map(a=>Array.isArray(o)?o.reduce((c,u,l)=>c+u*(a[l]||0),0):a.reduce((c,u)=>c+u*o,0)));return n===1&&(s=s[0]),r===1?s.map(o=>o[0]):s}const lg=(...t)=>{t=ke(t,"lab");const[e,n,r,...i]=t,[s,o,a]=CO([e,n,r]),[c,u,l]=uD(s,o,a);return[c,u,l,...i.length>0&&i[0]<1?[i[0]]:[]]};function CO(t){var e=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],n=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],r=tf(n,t);return tf(e,r.map(i=>i**3))}const dg=(...t)=>{const[e,n,r,...i]=ke(t,"rgb"),s=lD(e,n,r);return[...AO(s),...i.length>0&&i[0]<1?[i[0]]:[]]};function AO(t){const e=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],n=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],r=tf(e,t);return tf(n,r.map(i=>Math.cbrt(i)))}re.prototype.oklab=function(){return dg(this._rgb)};const _O=(...t)=>new re(...t,"oklab");Object.assign(ze,{oklab:_O}),Te.format.oklab=lg,Te.autodetect.push({p:2,test:(...t)=>{if(t=ke(t,"oklab"),Le(t)==="array"&&t.length===3)return"oklab"}});const PO=(t,e,n)=>{const r=t.oklab(),i=e.oklab();return new re(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"oklab")};tn.oklab=PO;const xO=(t,e,n)=>Eo(t,e,n,"oklch");tn.oklch=xO;const{pow:fg,sqrt:pg,PI:hg,cos:mD,sin:gD,atan2:IO}=Math,NO=(t,e="lrgb",n=null)=>{const r=t.length;n||(n=Array.from(new Array(r)).map(()=>1));const i=r/n.reduce(function(d,f){return d+f});if(n.forEach((d,f)=>{n[f]*=i}),t=t.map(d=>new re(d)),e==="lrgb")return OO(t,n);const s=t.shift(),o=s.get(e),a=[];let c=0,u=0;for(let d=0;d<o.length;d++)if(o[d]=(o[d]||0)*n[0],a.push(isNaN(o[d])?0:n[0]),e.charAt(d)==="h"&&!isNaN(o[d])){const f=o[d]/180*hg;c+=mD(f)*n[0],u+=gD(f)*n[0]}let l=s.alpha()*n[0];t.forEach((d,f)=>{const p=d.get(e);l+=d.alpha()*n[f+1];for(let h=0;h<o.length;h++)if(!isNaN(p[h]))if(a[h]+=n[f+1],e.charAt(h)==="h"){const v=p[h]/180*hg;c+=mD(v)*n[f+1],u+=gD(v)*n[f+1]}else o[h]+=p[h]*n[f+1]});for(let d=0;d<o.length;d++)if(e.charAt(d)==="h"){let f=IO(u/a[d],c/a[d])/hg*180;for(;f<0;)f+=360;for(;f>=360;)f-=360;o[d]=f}else o[d]=o[d]/a[d];return l/=r,new re(o,e).alpha(l>.99999?1:l,!0)},OO=(t,e)=>{const n=t.length,r=[0,0,0,0];for(let i=0;i<t.length;i++){const s=t[i],o=e[i]/n,a=s._rgb;r[0]+=fg(a[0],2)*o,r[1]+=fg(a[1],2)*o,r[2]+=fg(a[2],2)*o,r[3]+=a[3]*o}return r[0]=pg(r[0]),r[1]=pg(r[1]),r[2]=pg(r[2]),r[3]>.9999999&&(r[3]=1),new re(Zm(r))},{pow:FO}=Math;function nf(t){let e="rgb",n=ze("#ccc"),r=0,i=[0,1],s=[],o=[0,0],a=!1,c=[],u=!1,l=0,d=1,f=!1,p={},h=!0,v=1;const b=function(_){if(_=_||["#fff","#000"],_&&Le(_)==="string"&&ze.brewer&&ze.brewer[_.toLowerCase()]&&(_=ze.brewer[_.toLowerCase()]),Le(_)==="array"){_.length===1&&(_=[_[0],_[0]]),_=_.slice(0);for(let B=0;B<_.length;B++)_[B]=ze(_[B]);s.length=0;for(let B=0;B<_.length;B++)s.push(B/(_.length-1))}return A(),c=_},g=function(_){if(a!=null){const B=a.length-1;let z=0;for(;z<B&&_>=a[z];)z++;return z-1}return 0};let w=_=>_,R=_=>_;const k=function(_,B){let z,Q;if(B==null&&(B=!1),isNaN(_)||_===null)return n;B?Q=_:a&&a.length>2?Q=g(_)/(a.length-2):d!==l?Q=(_-l)/(d-l):Q=1,Q=R(Q),B||(Q=w(Q)),v!==1&&(Q=FO(Q,v)),Q=o[0]+Q*(1-o[0]-o[1]),Q=vs(Q,0,1);const I=Math.floor(Q*1e4);if(h&&p[I])z=p[I];else{if(Le(c)==="array")for(let T=0;T<s.length;T++){const $=s[T];if(Q<=$){z=c[T];break}if(Q>=$&&T===s.length-1){z=c[T];break}if(Q>$&&Q<s[T+1]){Q=(Q-$)/(s[T+1]-$),z=ze.interpolate(c[T],c[T+1],Q,e);break}}else Le(c)==="function"&&(z=c(Q));h&&(p[I]=z)}return z};var A=()=>p={};b(t);const N=function(_){const B=ze(k(_));return u&&B[u]?B[u]():B};return N.classes=function(_){if(_!=null){if(Le(_)==="array")a=_,i=[_[0],_[_.length-1]];else{const B=ze.analyze(i);_===0?a=[B.min,B.max]:a=ze.limits(B,"e",_)}return N}return a},N.domain=function(_){if(!arguments.length)return i;l=_[0],d=_[_.length-1],s=[];const B=c.length;if(_.length===B&&l!==d)for(let z of Array.from(_))s.push((z-l)/(d-l));else{for(let z=0;z<B;z++)s.push(z/(B-1));if(_.length>2){const z=_.map((I,T)=>T/(_.length-1)),Q=_.map(I=>(I-l)/(d-l));Q.every((I,T)=>z[T]===I)||(R=I=>{if(I<=0||I>=1)return I;let T=0;for(;I>=Q[T+1];)T++;const $=(I-Q[T])/(Q[T+1]-Q[T]);return z[T]+$*(z[T+1]-z[T])})}}return i=[l,d],N},N.mode=function(_){return arguments.length?(e=_,A(),N):e},N.range=function(_,B){return b(_),N},N.out=function(_){return u=_,N},N.spread=function(_){return arguments.length?(r=_,N):r},N.correctLightness=function(_){return _==null&&(_=!0),f=_,A(),f?w=function(B){const z=k(0,!0).lab()[0],Q=k(1,!0).lab()[0],I=z>Q;let T=k(B,!0).lab()[0];const $=z+(Q-z)*B;let L=T-$,V=0,H=1,K=20;for(;Math.abs(L)>.01&&K-- >0;)(function(){return I&&(L*=-1),L<0?(V=B,B+=(H-B)*.5):(H=B,B+=(V-B)*.5),T=k(B,!0).lab()[0],L=T-$})();return B}:w=B=>B,N},N.padding=function(_){return _!=null?(Le(_)==="number"&&(_=[_,_]),o=_,N):o},N.colors=function(_,B){arguments.length<2&&(B="hex");let z=[];if(arguments.length===0)z=c.slice(0);else if(_===1)z=[N(.5)];else if(_>1){const Q=i[0],I=i[1]-Q;z=LO(0,_).map(T=>N(Q+T/(_-1)*I))}else{t=[];let Q=[];if(a&&a.length>2)for(let I=1,T=a.length,$=1<=T;$?I<T:I>T;$?I++:I--)Q.push((a[I-1]+a[I])*.5);else Q=i;z=Q.map(I=>N(I))}return ze[B]&&(z=z.map(Q=>Q[B]())),z},N.cache=function(_){return _!=null?(h=_,N):h},N.gamma=function(_){return _!=null?(v=_,N):v},N.nodata=function(_){return _!=null?(n=ze(_),N):n},N}function LO(t,e,n){let r=[],i=t<e,s=e;for(let o=t;i?o<s:o>s;i?o++:o--)r.push(o);return r}const MO=function(t){let e=[1,1];for(let n=1;n<t;n++){let r=[1];for(let i=1;i<=e.length;i++)r[i]=(e[i]||0)+e[i-1];e=r}return e},BO=function(t){let e,n,r,i;if(t=t.map(s=>new re(s)),t.length===2)[n,r]=t.map(s=>s.lab()),e=function(s){const o=[0,1,2].map(a=>n[a]+s*(r[a]-n[a]));return new re(o,"lab")};else if(t.length===3)[n,r,i]=t.map(s=>s.lab()),e=function(s){const o=[0,1,2].map(a=>(1-s)*(1-s)*n[a]+2*(1-s)*s*r[a]+s*s*i[a]);return new re(o,"lab")};else if(t.length===4){let s;[n,r,i,s]=t.map(o=>o.lab()),e=function(o){const a=[0,1,2].map(c=>(1-o)*(1-o)*(1-o)*n[c]+3*(1-o)*(1-o)*o*r[c]+3*(1-o)*o*o*i[c]+o*o*o*s[c]);return new re(a,"lab")}}else if(t.length>=5){let s,o,a;s=t.map(c=>c.lab()),a=t.length-1,o=MO(a),e=function(c){const u=1-c,l=[0,1,2].map(d=>s.reduce((f,p,h)=>f+o[h]*u**(a-h)*c**h*p[d],0));return new re(l,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return e},zO=t=>{const e=BO(t);return e.scale=()=>nf(e),e},{round:yD}=Math;re.prototype.rgb=function(t=!0){return t===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(yD)},re.prototype.rgba=function(t=!0){return this._rgb.slice(0,4).map((e,n)=>n<3?t===!1?e:yD(e):e)};const qO=(...t)=>new re(...t,"rgb");Object.assign(ze,{rgb:qO}),Te.format.rgb=(...t)=>{const e=ke(t,"rgba");return e[3]===void 0&&(e[3]=1),e},Te.autodetect.push({p:3,test:(...t)=>{if(t=ke(t,"rgba"),Le(t)==="array"&&(t.length===3||t.length===4&&Le(t[3])=="number"&&t[3]>=0&&t[3]<=1))return"rgb"}});const or=(t,e,n)=>{if(!or[n])throw new Error("unknown blend mode "+n);return or[n](t,e)},Ci=t=>(e,n)=>{const r=ze(n).rgb(),i=ze(e).rgb();return ze.rgb(t(r,i))},Ai=t=>(e,n)=>{const r=[];return r[0]=t(e[0],n[0]),r[1]=t(e[1],n[1]),r[2]=t(e[2],n[2]),r},jO=t=>t,UO=(t,e)=>t*e/255,GO=(t,e)=>t>e?e:t,WO=(t,e)=>t>e?t:e,HO=(t,e)=>255*(1-(1-t/255)*(1-e/255)),VO=(t,e)=>e<128?2*t*e/255:255*(1-2*(1-t/255)*(1-e/255)),KO=(t,e)=>255*(1-(1-e/255)/(t/255)),YO=(t,e)=>t===255?255:(t=255*(e/255)/(1-t/255),t>255?255:t);or.normal=Ci(Ai(jO)),or.multiply=Ci(Ai(UO)),or.screen=Ci(Ai(HO)),or.overlay=Ci(Ai(VO)),or.darken=Ci(Ai(GO)),or.lighten=Ci(Ai(WO)),or.dodge=Ci(Ai(YO)),or.burn=Ci(Ai(KO));const{pow:XO,sin:JO,cos:ZO}=Math;function QO(t=300,e=-1.5,n=1,r=1,i=[0,1]){let s=0,o;Le(i)==="array"?o=i[1]-i[0]:(o=0,i=[i,i]);const a=function(c){const u=Vr*((t+120)/360+e*c),l=XO(i[0]+o*c,r),d=(s!==0?n[0]+c*s:n)*l*(1-l)/2,f=ZO(u),p=JO(u),h=l+d*(-.14861*f+1.78277*p),v=l+d*(-.29227*f-.90649*p),b=l+d*(1.97294*f);return ze(Zm([h*255,v*255,b*255,1]))};return a.start=function(c){return c==null?t:(t=c,a)},a.rotations=function(c){return c==null?e:(e=c,a)},a.gamma=function(c){return c==null?r:(r=c,a)},a.hue=function(c){return c==null?n:(n=c,Le(n)==="array"?(s=n[1]-n[0],s===0&&(n=n[1])):s=0,a)},a.lightness=function(c){return c==null?i:(Le(c)==="array"?(i=c,o=c[1]-c[0]):(i=[c,c],o=0),a)},a.scale=()=>ze.scale(a),a.hue(n),a}const eF="0123456789abcdef",{floor:tF,random:nF}=Math,rF=()=>{let t="#";for(let e=0;e<6;e++)t+=eF.charAt(tF(nF()*16));return new re(t,"hex")},{log:vD,pow:iF,floor:sF,abs:oF}=Math;function wD(t,e=null){const n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return Le(t)==="object"&&(t=Object.values(t)),t.forEach(r=>{e&&Le(r)==="object"&&(r=r[e]),r!=null&&!isNaN(r)&&(n.values.push(r),n.sum+=r,r<n.min&&(n.min=r),r>n.max&&(n.max=r),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(r,i)=>bD(n,r,i),n}function bD(t,e="equal",n=7){Le(t)=="array"&&(t=wD(t));const{min:r,max:i}=t,s=t.values.sort((a,c)=>a-c);if(n===1)return[r,i];const o=[];if(e.substr(0,1)==="c"&&(o.push(r),o.push(i)),e.substr(0,1)==="e"){o.push(r);for(let a=1;a<n;a++)o.push(r+a/n*(i-r));o.push(i)}else if(e.substr(0,1)==="l"){if(r<=0)throw new Error("Logarithmic scales are only possible for values > 0");const a=Math.LOG10E*vD(r),c=Math.LOG10E*vD(i);o.push(r);for(let u=1;u<n;u++)o.push(iF(10,a+u/n*(c-a)));o.push(i)}else if(e.substr(0,1)==="q"){o.push(r);for(let a=1;a<n;a++){const c=(s.length-1)*a/n,u=sF(c);if(u===c)o.push(s[u]);else{const l=c-u;o.push(s[u]*(1-l)+s[u+1]*l)}}o.push(i)}else if(e.substr(0,1)==="k"){let a;const c=s.length,u=new Array(c),l=new Array(n);let d=!0,f=0,p=null;p=[],p.push(r);for(let b=1;b<n;b++)p.push(r+b/n*(i-r));for(p.push(i);d;){for(let g=0;g<n;g++)l[g]=0;for(let g=0;g<c;g++){const w=s[g];let R=Number.MAX_VALUE,k;for(let A=0;A<n;A++){const N=oF(p[A]-w);N<R&&(R=N,k=A),l[k]++,u[g]=k}}const b=new Array(n);for(let g=0;g<n;g++)b[g]=null;for(let g=0;g<c;g++)a=u[g],b[a]===null?b[a]=s[g]:b[a]+=s[g];for(let g=0;g<n;g++)b[g]*=1/l[g];d=!1;for(let g=0;g<n;g++)if(b[g]!==p[g]){d=!0;break}p=b,f++,f>200&&(d=!1)}const h={};for(let b=0;b<n;b++)h[b]=[];for(let b=0;b<c;b++)a=u[b],h[a].push(s[b]);let v=[];for(let b=0;b<n;b++)v.push(h[b][0]),v.push(h[b][h[b].length-1]);v=v.sort((b,g)=>b-g),o.push(v[0]);for(let b=1;b<v.length;b+=2){const g=v[b];!isNaN(g)&&o.indexOf(g)===-1&&o.push(g)}}return o}const aF=(t,e)=>{t=new re(t),e=new re(e);const n=t.luminance(),r=e.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},DD=.027,cF=5e-4,uF=.1,ED=1.14,rf=.022,RD=1.414,lF=(t,e)=>{t=new re(t),e=new re(e),t.alpha()<1&&(t=bo(e,t,t.alpha(),"rgb"));const n=$D(...t.rgb()),r=$D(...e.rgb()),i=n>=rf?n:n+Math.pow(rf-n,RD),s=r>=rf?r:r+Math.pow(rf-r,RD),o=Math.pow(s,.56)-Math.pow(i,.57),a=Math.pow(s,.65)-Math.pow(i,.62),c=Math.abs(s-i)<cF?0:i<s?o*ED:a*ED;return(Math.abs(c)<uF?0:c>0?c-DD:c+DD)*100};function $D(t,e,n){return .2126729*Math.pow(t/255,2.4)+.7151522*Math.pow(e/255,2.4)+.072175*Math.pow(n/255,2.4)}const{sqrt:Yr,pow:It,min:dF,max:fF,atan2:TD,abs:SD,cos:sf,sin:kD,exp:pF,PI:CD}=Math;function hF(t,e,n=1,r=1,i=1){var s=function(Ye){return 360*Ye/(2*CD)},o=function(Ye){return 2*CD*Ye/360};t=new re(t),e=new re(e);const[a,c,u]=Array.from(t.lab()),[l,d,f]=Array.from(e.lab()),p=(a+l)/2,h=Yr(It(c,2)+It(u,2)),v=Yr(It(d,2)+It(f,2)),b=(h+v)/2,g=.5*(1-Yr(It(b,7)/(It(b,7)+It(25,7)))),w=c*(1+g),R=d*(1+g),k=Yr(It(w,2)+It(u,2)),A=Yr(It(R,2)+It(f,2)),N=(k+A)/2,_=s(TD(u,w)),B=s(TD(f,R)),z=_>=0?_:_+360,Q=B>=0?B:B+360,I=SD(z-Q)>180?(z+Q+360)/2:(z+Q)/2,T=1-.17*sf(o(I-30))+.24*sf(o(2*I))+.32*sf(o(3*I+6))-.2*sf(o(4*I-63));let $=Q-z;$=SD($)<=180?$:Q<=z?$+360:$-360,$=2*Yr(k*A)*kD(o($)/2);const L=l-a,V=A-k,H=1+.015*It(p-50,2)/Yr(20+It(p-50,2)),K=1+.045*N,we=1+.015*N*T,te=30*pF(-It((I-275)/25,2)),C=-(2*Yr(It(N,7)/(It(N,7)+It(25,7))))*kD(2*o(te)),he=Yr(It(L/(n*H),2)+It(V/(r*K),2)+It($/(i*we),2)+C*(V/(r*K))*($/(i*we)));return fF(0,dF(100,he))}function mF(t,e,n="lab"){t=new re(t),e=new re(e);const r=t.get(n),i=e.get(n);let s=0;for(let o in r){const a=(r[o]||0)-(i[o]||0);s+=a*a}return Math.sqrt(s)}const gF=(...t)=>{try{return new re(...t),!0}catch{return!1}},yF={cool(){return nf([ze.hsl(180,1,.9),ze.hsl(250,.7,.4)])},hot(){return nf(["#000","#f00","#ff0","#fff"]).mode("rgb")}},mg={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},AD=Object.keys(mg),_D=new Map(AD.map(t=>[t.toLowerCase(),t])),vF=typeof Proxy=="function"?new Proxy(mg,{get(t,e){const n=e.toLowerCase();if(_D.has(n))return t[_D.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(AD)}}):mg,wF=(...t)=>{t=ke(t,"cmyk");const[e,n,r,i]=t,s=t.length>4?t[4]:1;return i===1?[0,0,0,s]:[e>=1?0:255*(1-e)*(1-i),n>=1?0:255*(1-n)*(1-i),r>=1?0:255*(1-r)*(1-i),s]},{max:PD}=Math,bF=(...t)=>{let[e,n,r]=ke(t,"rgb");e=e/255,n=n/255,r=r/255;const i=1-PD(e,PD(n,r)),s=i<1?1/(1-i):0,o=(1-e-i)*s,a=(1-n-i)*s,c=(1-r-i)*s;return[o,a,c,i]};re.prototype.cmyk=function(){return bF(this._rgb)};const DF=(...t)=>new re(...t,"cmyk");Object.assign(ze,{cmyk:DF}),Te.format.cmyk=wF,Te.autodetect.push({p:2,test:(...t)=>{if(t=ke(t,"cmyk"),Le(t)==="array"&&t.length===4)return"cmyk"}});const EF=(...t)=>{const e=ke(t,"hsla");let n=vo(t)||"lsa";return e[0]=Vn(e[0]||0)+"deg",e[1]=Vn(e[1]*100)+"%",e[2]=Vn(e[2]*100)+"%",n==="hsla"||e.length>3&&e[3]<1?(e[3]="/ "+(e.length>3?e[3]:1),n="hsla"):e.length=3,`${n.substr(0,3)}(${e.join(" ")})`},RF=(...t)=>{const e=ke(t,"lab");let n=vo(t)||"lab";return e[0]=Vn(e[0])+"%",e[1]=Vn(e[1]),e[2]=Vn(e[2]),n==="laba"||e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`lab(${e.join(" ")})`},$F=(...t)=>{const e=ke(t,"lch");let n=vo(t)||"lab";return e[0]=Vn(e[0])+"%",e[1]=Vn(e[1]),e[2]=isNaN(e[2])?"none":Vn(e[2])+"deg",n==="lcha"||e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`lch(${e.join(" ")})`},TF=(...t)=>{const e=ke(t,"lab");return e[0]=Vn(e[0]*100)+"%",e[1]=Qm(e[1]),e[2]=Qm(e[2]),e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`oklab(${e.join(" ")})`},xD=(...t)=>{const[e,n,r,...i]=ke(t,"rgb"),[s,o,a]=dg(e,n,r),[c,u,l]=fD(s,o,a);return[c,u,l,...i.length>0&&i[0]<1?[i[0]]:[]]},SF=(...t)=>{const e=ke(t,"lch");return e[0]=Vn(e[0]*100)+"%",e[1]=Qm(e[1]),e[2]=isNaN(e[2])?"none":Vn(e[2])+"deg",e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`oklch(${e.join(" ")})`},{round:gg}=Math,kF=(...t)=>{const e=ke(t,"rgba");let n=vo(t)||"rgb";if(n.substr(0,3)==="hsl")return EF(hD(e),n);if(n.substr(0,3)==="lab"){const r=Ia();Kr("d50");const i=RF(rg(e),n);return Kr(r),i}if(n.substr(0,3)==="lch"){const r=Ia();Kr("d50");const i=$F(ag(e),n);return Kr(r),i}return n.substr(0,5)==="oklab"?TF(dg(e)):n.substr(0,5)==="oklch"?SF(xD(e)):(e[0]=gg(e[0]),e[1]=gg(e[1]),e[2]=gg(e[2]),(n==="rgba"||e.length>3&&e[3]<1)&&(e[3]="/ "+(e.length>3?e[3]:1),n="rgba"),`${n.substr(0,3)}(${e.slice(0,n==="rgb"?3:4).join(" ")})`)},ID=(...t)=>{t=ke(t,"lch");const[e,n,r,...i]=t,[s,o,a]=dD(e,n,r),[c,u,l]=lg(s,o,a);return[c,u,l,...i.length>0&&i[0]<1?[i[0]]:[]]},Xr=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,ar=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,of=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,Kn=/\s*/.source,$o=/\s+/.source,yg=/\s*,\s*/.source,af=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,To=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,ND=new RegExp("^rgba?\\("+Kn+[Xr,Xr,Xr].join($o)+To+"\\)$"),OD=new RegExp("^rgb\\("+Kn+[Xr,Xr,Xr].join(yg)+Kn+"\\)$"),FD=new RegExp("^rgba\\("+Kn+[Xr,Xr,Xr,ar].join(yg)+Kn+"\\)$"),LD=new RegExp("^hsla?\\("+Kn+[af,of,of].join($o)+To+"\\)$"),MD=new RegExp("^hsl?\\("+Kn+[af,of,of].join(yg)+Kn+"\\)$"),BD=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,zD=new RegExp("^lab\\("+Kn+[ar,ar,ar].join($o)+To+"\\)$"),qD=new RegExp("^lch\\("+Kn+[ar,ar,af].join($o)+To+"\\)$"),jD=new RegExp("^oklab\\("+Kn+[ar,ar,ar].join($o)+To+"\\)$"),UD=new RegExp("^oklch\\("+Kn+[ar,ar,af].join($o)+To+"\\)$"),{round:GD}=Math,So=t=>t.map((e,n)=>n<=2?vs(GD(e),0,255):e),Nt=(t,e=0,n=100,r=!1)=>(typeof t=="string"&&t.endsWith("%")&&(t=parseFloat(t.substring(0,t.length-1))/100,r?t=e+(t+1)*.5*(n-e):t=e+t*(n-e)),+t),pn=(t,e)=>t==="none"?e:t,vg=t=>{if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e;if(Te.format.named)try{return Te.format.named(t)}catch{}if((e=t.match(ND))||(e=t.match(OD))){let n=e.slice(1,4);for(let i=0;i<3;i++)n[i]=+Nt(pn(n[i],0),0,255);n=So(n);const r=e[4]!==void 0?+Nt(e[4],0,1):1;return n[3]=r,n}if(e=t.match(FD)){const n=e.slice(1,5);for(let r=0;r<4;r++)n[r]=+Nt(n[r],0,255);return n}if((e=t.match(LD))||(e=t.match(MD))){const n=e.slice(1,4);n[0]=+pn(n[0].replace("deg",""),0),n[1]=+Nt(pn(n[1],0),0,100)*.01,n[2]=+Nt(pn(n[2],0),0,100)*.01;const r=So(ug(n)),i=e[4]!==void 0?+Nt(e[4],0,1):1;return r[3]=i,r}if(e=t.match(BD)){const n=e.slice(1,4);n[1]*=.01,n[2]*=.01;const r=ug(n);for(let i=0;i<3;i++)r[i]=GD(r[i]);return r[3]=+e[4],r}if(e=t.match(zD)){const n=e.slice(1,4);n[0]=Nt(pn(n[0],0),0,100),n[1]=Nt(pn(n[1],0),-125,125,!0),n[2]=Nt(pn(n[2],0),-125,125,!0);const r=Ia();Kr("d50");const i=So(tg(n));Kr(r);const s=e[4]!==void 0?+Nt(e[4],0,1):1;return i[3]=s,i}if(e=t.match(qD)){const n=e.slice(1,4);n[0]=Nt(n[0],0,100),n[1]=Nt(pn(n[1],0),0,150,!1),n[2]=+pn(n[2].replace("deg",""),0);const r=Ia();Kr("d50");const i=So(og(n));Kr(r);const s=e[4]!==void 0?+Nt(e[4],0,1):1;return i[3]=s,i}if(e=t.match(jD)){const n=e.slice(1,4);n[0]=Nt(pn(n[0],0),0,1),n[1]=Nt(pn(n[1],0),-.4,.4,!0),n[2]=Nt(pn(n[2],0),-.4,.4,!0);const r=So(lg(n)),i=e[4]!==void 0?+Nt(e[4],0,1):1;return r[3]=i,r}if(e=t.match(UD)){const n=e.slice(1,4);n[0]=Nt(pn(n[0],0),0,1),n[1]=Nt(pn(n[1],0),0,.4,!1),n[2]=+pn(n[2].replace("deg",""),0);const r=So(ID(n)),i=e[4]!==void 0?+Nt(e[4],0,1):1;return r[3]=i,r}};vg.test=t=>ND.test(t)||LD.test(t)||zD.test(t)||qD.test(t)||jD.test(t)||UD.test(t)||OD.test(t)||FD.test(t)||MD.test(t)||BD.test(t)||t==="transparent",re.prototype.css=function(t){return kF(this._rgb,t)};const CF=(...t)=>new re(...t,"css");ze.css=CF,Te.format.css=vg,Te.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&Le(t)==="string"&&vg.test(t))return"css"}}),Te.format.gl=(...t)=>{const e=ke(t,"rgba");return e[0]*=255,e[1]*=255,e[2]*=255,e};const AF=(...t)=>new re(...t,"gl");ze.gl=AF,re.prototype.gl=function(){const t=this._rgb;return[t[0]/255,t[1]/255,t[2]/255,t[3]]},re.prototype.hex=function(t){return cD(this._rgb,t)};const _F=(...t)=>new re(...t,"hex");ze.hex=_F,Te.format.hex=aD,Te.autodetect.push({p:4,test:(t,...e)=>{if(!e.length&&Le(t)==="string"&&[3,4,5,6,7,8,9].indexOf(t.length)>=0)return"hex"}});const{log:cf}=Math,WD=t=>{const e=t/100;let n,r,i;return e<66?(n=255,r=e<6?0:-155.25485562709179-.44596950469579133*(r=e-2)+104.49216199393888*cf(r),i=e<20?0:-254.76935184120902+.8274096064007395*(i=e-10)+115.67994401066147*cf(i)):(n=351.97690566805693+.114206453784165*(n=e-55)-40.25366309332127*cf(n),r=325.4494125711974+.07943456536662342*(r=e-50)-28.0852963507957*cf(r),i=255),[n,r,i,1]},{round:PF}=Math,xF=(...t)=>{const e=ke(t,"rgb"),n=e[0],r=e[2];let i=1e3,s=4e4;const o=.4;let a;for(;s-i>o;){a=(s+i)*.5;const c=WD(a);c[2]/c[0]>=r/n?s=a:i=a}return PF(a)};re.prototype.temp=re.prototype.kelvin=re.prototype.temperature=function(){return xF(this._rgb)};const wg=(...t)=>new re(...t,"temp");Object.assign(ze,{temp:wg,kelvin:wg,temperature:wg}),Te.format.temp=Te.format.kelvin=Te.format.temperature=WD,re.prototype.oklch=function(){return xD(this._rgb)};const IF=(...t)=>new re(...t,"oklch");Object.assign(ze,{oklch:IF}),Te.format.oklch=ID,Te.autodetect.push({p:2,test:(...t)=>{if(t=ke(t,"oklch"),Le(t)==="array"&&t.length===3)return"oklch"}}),Object.assign(ze,{analyze:wD,average:NO,bezier:zO,blend:or,brewer:vF,Color:re,colors:wo,contrast:aF,contrastAPCA:lF,cubehelix:QO,deltaE:hF,distance:mF,input:Te,interpolate:bo,limits:bD,mix:bo,random:rF,scale:nf,scales:yF,valid:gF});const bg=[.96,.907,.805,.697,.605,.547,.518,.445,.395,.34],HD=[.32,.16,.08,.04,0,0,.04,.08,.16,.32];function NF(t){const e=t.get("hsl.l");return bg.reduce((n,r)=>Math.abs(r-e)<Math.abs(n-e)?r:n)}function OF(t){const e=ze(t),n=NF(e),r=bg.findIndex(s=>s===n),i=bg.map(s=>e.set("hsl.l",s)).map(s=>ze(s)).map((s,o)=>{const a=HD[o]-HD[r];return a>=0?s.saturate(a):s.desaturate(a*-1)});return{baseColorIndex:r,colors:i}}function FF(t){return OF(t).colors.map(e=>e.hex())}const VD={fill:"#3b82f6",stroke:"#2563eb",hiContrast:"#eff6ff",loContrast:"#bfdbfe"},KD={fill:"#0284c7",stroke:"#0369a1",hiContrast:"#f0f9ff",loContrast:"#B6ECF7"},YD={fill:"#64748b",stroke:"#475569",hiContrast:"#f8fafc",loContrast:"#cbd5e1"},LF={primary:VD,blue:VD,secondary:KD,sky:KD,muted:YD,slate:YD,gray:{fill:"#737373",stroke:"#525252",hiContrast:"#fafafa",loContrast:"#d4d4d4"},red:{fill:"#AC4D39",stroke:"#853A2D",hiContrast:"#FBD3CB",loContrast:"#f5b2a3"},green:{fill:"#428a4f",stroke:"#2d5d39",hiContrast:"#f8fafc",loContrast:"#c2f0c2"},amber:{fill:"#A35829",stroke:"#7E451D",hiContrast:"#FFE0C2",loContrast:"#f9b27c"},indigo:{fill:"#6366f1",stroke:"#4f46e5",hiContrast:"#eef2ff",loContrast:"#c7d2fe"}},MF={lineColor:"#6E6E6E",labelBgColor:"#18191b",labelColor:"#C6C6C6"},XD={lineColor:"#64748b",labelBgColor:"#0f172a",labelColor:"#cbd5e1"},JD={lineColor:"#3b82f6",labelBgColor:"#172554",labelColor:"#60a5fa"},ZD={lineColor:"#0ea5e9",labelBgColor:"#082f49",labelColor:"#38bdf8"},BF={amber:{lineColor:"#b45309",labelBgColor:"#78350f",labelColor:"#FFE0C2"},blue:JD,gray:MF,green:{lineColor:"#15803d",labelBgColor:"#052e16",labelColor:"#22c55e"},indigo:{lineColor:"#6366f1",labelBgColor:"#1e1b4b",labelColor:"#818cf8"},muted:XD,primary:JD,red:{lineColor:"#AC4D39",labelBgColor:"#b91c1c",labelColor:"#f5b2a3"},secondary:ZD,sky:ZD,slate:XD},cr={elements:LF,relationships:BF,font:"Arial",shadow:"#0a0a0a"};function zF(t){if(t.match(/^#([0-9a-f]{3}){1,2}$/i)){const e=FF(t);return{elements:{fill:e[6],stroke:e[7],hiContrast:e[0],loContrast:e[1]},relationships:{lineColor:e[4],labelColor:e[3],labelBgColor:e[9]}}}else return{elements:cr.elements.primary,relationships:cr.relationships.primary}}function Dg(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function Eg(t,e,n=".",r){if(!Dg(e))return Eg(t,{},n,r);const i=Object.assign({},e);for(const s in t){if(s==="__proto__"||s==="constructor")continue;const o=t[s];o!=null&&(r&&r(i,s,o,n)||(Array.isArray(o)&&Array.isArray(i[s])?i[s]=[...o,...i[s]]:Dg(o)&&Dg(i[s])?i[s]=Eg(o,i[s],(n?`${n}.`:"")+s.toString(),r):i[s]=o))}return i}function qF(t){return(...e)=>e.reduce((n,r)=>Eg(n,r,"",t),{})}const Rg=qF();function Tt(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function Yn(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}function jF(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function uf(t){return typeof t=="object"&&t!==null&&Tt(t.container)&&Yn(t.reference)&&typeof t.message=="string"}class QD{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,n){return Tt(e)&&this.isSubtype(e.$type,n)}isSubtype(e,n){if(e===n)return!0;let r=this.subtypes[e];r||(r=this.subtypes[e]={});const i=r[n];if(i!==void 0)return i;{const s=this.computeIsSubtype(e,n);return r[n]=s,s}}getAllSubTypes(e){const n=this.allSubtypes[e];if(n)return n;{const r=this.getAllTypes(),i=[];for(const s of r)this.isSubtype(s,e)&&i.push(s);return this.allSubtypes[e]=i,i}}}function Jr(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function ws(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function eE(t){return Jr(t)&&typeof t.fullText=="string"}class Mt{constructor(e,n){this.startFn=e,this.nextFn=n}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 n=0,r=e.next();for(;!r.done;)n++,r=e.next();return n}toArray(){const e=[],n=this.iterator();let r;do r=n.next(),r.value!==void 0&&e.push(r.value);while(!r.done);return e}toSet(){return new Set(this)}toMap(e,n){const r=this.map(i=>[e?e(i):i,n?n(i):i]);return new Map(r)}toString(){return this.join()}concat(e){return new Mt(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),n=>{let r;if(!n.firstDone){do if(r=this.nextFn(n.first),!r.done)return r;while(!r.done);n.firstDone=!0}do if(r=n.iterator.next(),!r.done)return r;while(!r.done);return nn})}join(e=","){const n=this.iterator();let r="",i,s=!1;do i=n.next(),i.done||(s&&(r+=e),r+=UF(i.value)),s=!0;while(!i.done);return r}indexOf(e,n=0){const r=this.iterator();let i=0,s=r.next();for(;!s.done;){if(i>=n&&s.value===e)return i;s=r.next(),i++}return-1}every(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(!e(r.value))return!1;r=n.next()}return!0}some(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return!0;r=n.next()}return!1}forEach(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;)e(i.value,r),i=n.next(),r++}map(e){return new Mt(this.startFn,n=>{const{done:r,value:i}=this.nextFn(n);return r?nn:{done:!1,value:e(i)}})}filter(e){return new Mt(this.startFn,n=>{let r;do if(r=this.nextFn(n),!r.done&&e(r.value))return r;while(!r.done);return nn})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,n){const r=this.iterator();let i=n,s=r.next();for(;!s.done;)i===void 0?i=s.value:i=e(i,s.value),s=r.next();return i}reduceRight(e,n){return this.recursiveReduce(this.iterator(),e,n)}recursiveReduce(e,n,r){const i=e.next();if(i.done)return r;const s=this.recursiveReduce(e,n,r);return s===void 0?i.value:n(s,i.value)}find(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return r.value;r=n.next()}}findIndex(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;){if(e(i.value))return r;i=n.next(),r++}return-1}includes(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(r.value===e)return!0;r=n.next()}return!1}flatMap(e){return new Mt(()=>({this:this.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:r,value:i}=this.nextFn(n.this);if(!r){const s=e(i);if(lf(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(n.iterator);return nn})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const n=e>1?this.flat(e-1):this;return new Mt(()=>({this:n.startFn()}),r=>{do{if(r.iterator){const o=r.iterator.next();if(o.done)r.iterator=void 0;else return o}const{done:i,value:s}=n.nextFn(r.this);if(!i)if(lf(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(r.iterator);return nn})}head(){const n=this.iterator().next();if(!n.done)return n.value}tail(e=1){return new Mt(()=>{const n=this.startFn();for(let r=0;r<e;r++)if(this.nextFn(n).done)return n;return n},this.nextFn)}limit(e){return new Mt(()=>({size:0,state:this.startFn()}),n=>(n.size++,n.size>e?nn:this.nextFn(n.state)))}distinct(e){return new Mt(()=>({set:new Set,internalState:this.startFn()}),n=>{let r;do if(r=this.nextFn(n.internalState),!r.done){const i=e?e(r.value):r.value;if(!n.set.has(i))return n.set.add(i),r}while(!r.done);return nn})}exclude(e,n){const r=new Set;for(const i of e){const s=n?n(i):i;r.add(s)}return this.filter(i=>{const s=n?n(i):i;return!r.has(s)})}}function UF(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function lf(t){return!!t&&typeof t[Symbol.iterator]=="function"}const ko=new Mt(()=>{},()=>nn),nn=Object.freeze({done:!0,value:void 0});function st(...t){if(t.length===1){const e=t[0];if(e instanceof Mt)return e;if(lf(e))return new Mt(()=>e[Symbol.iterator](),n=>n.next());if(typeof e.length=="number")return new Mt(()=>({index:0}),n=>n.index<e.length?{done:!1,value:e[n.index++]}:nn)}return t.length>1?new Mt(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const n=e.iterator.next();if(!n.done)return n;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 n=t[e.collIndex++];lf(n)?e.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(e.array=n)}}while(e.iterator||e.array||e.collIndex<t.length);return nn}):ko}class Co extends Mt{constructor(e,n,r){super(()=>({iterators:r?.includeRoot?[[e][Symbol.iterator]()]:[n(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const o=i.iterators[i.iterators.length-1].next();if(o.done)i.iterators.pop();else return i.iterators.push(n(o.value)[Symbol.iterator]()),o}return nn})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var $g;(function(t){function e(s){return s.reduce((o,a)=>o+a,0)}t.sum=e;function n(s){return s.reduce((o,a)=>o*a,0)}t.product=n;function r(s){return s.reduce((o,a)=>Math.min(o,a))}t.min=r;function i(s){return s.reduce((o,a)=>Math.max(o,a))}t.max=i})($g||($g={}));function Na(t){return new Co(t,e=>Jr(e)?e.content:[],{includeRoot:!0})}function tE(t){return Na(t).filter(ws)}function nE(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function df(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function Oa(t){if(!t)return;const{offset:e,end:n,range:r}=t;return{range:r,offset:e,end:n,length:n-e}}var kr;(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"})(kr||(kr={}));function rE(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return kr.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return kr.After;const n=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,r=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return n&&r?kr.Inside:n?kr.OverlapBack:r?kr.OverlapFront:kr.Outside}function Tg(t,e){return rE(t,e)>kr.After}const Sg=/^[\w\p{L}]$/u;function _i(t,e,n=Sg){if(t){if(e>0){const r=e-t.offset,i=t.text.charAt(r);n.test(i)||e--}return Cg(t,e)}}function ff(t,e){if(t){const n=sE(t,!0);if(n&&kg(n,e))return n;if(eE(t)){const r=t.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){const s=t.content[i];if(kg(s,e))return s}}}}function kg(t,e){return ws(t)&&e.includes(t.tokenType.name)}function Cg(t,e){if(ws(t))return t;if(Jr(t)){const n=iE(t,e,!1);if(n)return Cg(n,e)}}function pf(t,e){if(ws(t))return t;if(Jr(t)){const n=iE(t,e,!0);if(n)return pf(n,e)}}function iE(t,e,n){let r=0,i=t.content.length-1,s;for(;r<=i;){const o=Math.floor((r+i)/2),a=t.content[o];if(a.offset<=e&&a.end>e)return a;a.end<=e?(s=n?a:void 0,r=o+1):i=o-1}return s}function sE(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);for(;r>0;){r--;const i=n.content[r];if(e||!i.hidden)return i}t=n}}function oE(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);const i=n.content.length-1;for(;r<i;){r++;const s=n.content[r];if(e||!s.hidden)return s}t=n}}function GF(t){if(t.range.start.character===0)return t;const e=t.range.start.line;let n=t,r;for(;t.container;){const i=t.container,s=r??i.content.indexOf(t);if(s===0?(t=i,r=void 0):(r=s-1,t=i.content[r]),t.range.start.line!==e)break;n=t}return n}function aE(t,e){const n=WF(t,e);return n?n.parent.content.slice(n.a+1,n.b):[]}function WF(t,e){const n=cE(t),r=cE(e);let i;for(let s=0;s<n.length&&s<r.length;s++){const o=n[s],a=r[s];if(o.parent===a.parent)i={parent:o.parent,a:o.index,b:a.index};else break}return i}function cE(t){const e=[];for(;t.container;){const n=t.container,r=n.content.indexOf(t);e.push({parent:n,index:r}),t=n}return e.reverse()}const HF={__proto__:null,DefaultNameRegexp:Sg,get RangeComparison(){return kr},compareRange:rE,findCommentNode:ff,findDeclarationNodeAtOffset:_i,findLeafNodeAtOffset:Cg,findLeafNodeBeforeOffset:pf,flattenCst:tE,getInteriorNodes:aE,getNextNode:oE,getPreviousNode:sE,getStartlineNode:GF,inRange:Tg,isChildNode:nE,isCommentNode:kg,streamCst:Na,toDocumentSegment:Oa,tokenToRange:df};class uE extends Error{constructor(e,n){super(e?`${n} at ${e.range.start.line}:${e.range.start.character}`:n)}}function Fa(t){throw new Error("Error! The input value was not handled.")}const hf="AbstractRule",mf="AbstractType",Ag="Condition",lE="TypeDefinition",_g="ValueLiteral",La="AbstractElement";function Pg(t){return Ge.isInstance(t,La)}const gf="ArrayLiteral",Ma="ArrayType";function VF(t){return Ge.isInstance(t,Ma)}const Ba="BooleanLiteral";function KF(t){return Ge.isInstance(t,Ba)}const za="Conjunction";function YF(t){return Ge.isInstance(t,za)}const qa="Disjunction";function XF(t){return Ge.isInstance(t,qa)}const yf="Grammar",xg="GrammarImport",ja="InferredType";function dE(t){return Ge.isInstance(t,ja)}const Ua="Interface";function fE(t){return Ge.isInstance(t,Ua)}const Ig="NamedArgument",Ga="Negation";function JF(t){return Ge.isInstance(t,Ga)}const vf="NumberLiteral",wf="Parameter",Wa="ParameterReference";function ZF(t){return Ge.isInstance(t,Wa)}const Ha="ParserRule";function rn(t){return Ge.isInstance(t,Ha)}const Va="ReferenceType";function QF(t){return Ge.isInstance(t,Va)}const bf="ReturnType";function eL(t){return Ge.isInstance(t,bf)}const Ka="SimpleType";function pE(t){return Ge.isInstance(t,Ka)}const Df="StringLiteral",Ao="TerminalRule";function Zr(t){return Ge.isInstance(t,Ao)}const Ya="Type";function Ng(t){return Ge.isInstance(t,Ya)}const Og="TypeAttribute",Xa="UnionType";function tL(t){return Ge.isInstance(t,Xa)}const Ja="Action";function bs(t){return Ge.isInstance(t,Ja)}const Za="Alternatives";function Fg(t){return Ge.isInstance(t,Za)}const Qa="Assignment";function Cr(t){return Ge.isInstance(t,Qa)}const ec="CharacterRange";function nL(t){return Ge.isInstance(t,ec)}const tc="CrossReference";function nc(t){return Ge.isInstance(t,tc)}const rc="EndOfFile";function rL(t){return Ge.isInstance(t,rc)}const ic="Group";function Pi(t){return Ge.isInstance(t,ic)}const sc="Keyword";function Ar(t){return Ge.isInstance(t,sc)}const oc="NegatedToken";function iL(t){return Ge.isInstance(t,oc)}const ac="RegexToken";function sL(t){return Ge.isInstance(t,ac)}const cc="RuleCall";function Qr(t){return Ge.isInstance(t,cc)}const uc="TerminalAlternatives";function oL(t){return Ge.isInstance(t,uc)}const lc="TerminalGroup";function aL(t){return Ge.isInstance(t,lc)}const dc="TerminalRuleCall";function hE(t){return Ge.isInstance(t,dc)}const fc="UnorderedGroup";function Lg(t){return Ge.isInstance(t,fc)}const pc="UntilToken";function cL(t){return Ge.isInstance(t,pc)}const hc="Wildcard";function uL(t){return Ge.isInstance(t,hc)}class mE extends QD{getAllTypes(){return[La,hf,mf,Ja,Za,gf,Ma,Qa,Ba,ec,Ag,za,tc,qa,rc,yf,xg,ic,ja,Ua,sc,Ig,oc,Ga,vf,wf,Wa,Ha,Va,ac,bf,cc,Ka,Df,uc,lc,Ao,dc,Ya,Og,lE,Xa,fc,pc,_g,hc]}computeIsSubtype(e,n){switch(e){case Ja:case Za:case Qa:case ec:case tc:case rc:case ic:case sc:case oc:case ac:case cc:case uc:case lc:case dc:case fc:case pc:case hc:return this.isSubtype(La,n);case gf:case vf:case Df:return this.isSubtype(_g,n);case Ma:case Va:case Ka:case Xa:return this.isSubtype(lE,n);case Ba:return this.isSubtype(Ag,n)||this.isSubtype(_g,n);case za:case qa:case Ga:case Wa:return this.isSubtype(Ag,n);case ja:case Ua:case Ya:return this.isSubtype(mf,n);case Ha:return this.isSubtype(hf,n)||this.isSubtype(mf,n);case Ao:return this.isSubtype(hf,n);default:return!1}}getReferenceType(e){const n=`${e.container.$type}:${e.property}`;switch(n){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return mf;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return hf;case"Grammar:usedGrammars":return yf;case"NamedArgument:parameter":case"ParameterReference:parameter":return wf;case"TerminalRuleCall:rule":return Ao;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case La:return{name:La,properties:[{name:"cardinality"},{name:"lookahead"}]};case gf:return{name:gf,properties:[{name:"elements",defaultValue:[]}]};case Ma:return{name:Ma,properties:[{name:"elementType"}]};case Ba:return{name:Ba,properties:[{name:"true",defaultValue:!1}]};case za:return{name:za,properties:[{name:"left"},{name:"right"}]};case qa:return{name:qa,properties:[{name:"left"},{name:"right"}]};case yf:return{name:yf,properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case xg:return{name:xg,properties:[{name:"path"}]};case ja:return{name:ja,properties:[{name:"name"}]};case Ua:return{name:Ua,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case Ig:return{name:Ig,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case Ga:return{name:Ga,properties:[{name:"value"}]};case vf:return{name:vf,properties:[{name:"value"}]};case wf:return{name:wf,properties:[{name:"name"}]};case Wa:return{name:Wa,properties:[{name:"parameter"}]};case Ha:return{name:Ha,properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case Va:return{name:Va,properties:[{name:"referenceType"}]};case bf:return{name:bf,properties:[{name:"name"}]};case Ka:return{name:Ka,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case Df:return{name:Df,properties:[{name:"value"}]};case Ao:return{name:Ao,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case Ya:return{name:Ya,properties:[{name:"name"},{name:"type"}]};case Og:return{name:Og,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case Xa:return{name:Xa,properties:[{name:"types",defaultValue:[]}]};case Ja:return{name:Ja,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case Za:return{name:Za,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Qa:return{name:Qa,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case ec:return{name:ec,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case tc:return{name:tc,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case rc:return{name:rc,properties:[{name:"cardinality"},{name:"lookahead"}]};case ic:return{name:ic,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case sc:return{name:sc,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case oc:return{name:oc,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case ac:return{name:ac,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case cc:return{name:cc,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case uc:return{name:uc,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case lc:return{name:lc,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case dc:return{name:dc,properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case fc:return{name:fc,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case pc:return{name:pc,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case hc:return{name:hc,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const Ge=new mE;function Mg(t){for(const[e,n]of Object.entries(t))e.startsWith("$")||(Array.isArray(n)?n.forEach((r,i)=>{Tt(r)&&(r.$container=t,r.$containerProperty=e,r.$containerIndex=i)}):Tt(n)&&(n.$container=t,n.$containerProperty=e))}function sn(t,e){let n=t;for(;n;){if(e(n))return n;n=n.$container}}function xi(t,e){let n=t;for(;n;){if(e(n))return!0;n=n.$container}return!1}function bt(t){const n=Ef(t).$document;if(!n)throw new Error("AST node has no document.");return n}function Ef(t){for(;t.$container;)t=t.$container;return t}function mc(t,e){if(!t)throw new Error("Node must be an AstNode.");const n=e?.range;return new Mt(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),r=>{for(;r.keyIndex<r.keys.length;){const i=r.keys[r.keyIndex];if(!i.startsWith("$")){const s=t[i];if(Tt(s)){if(r.keyIndex++,Bg(s,n))return{done:!1,value:s}}else if(Array.isArray(s)){for(;r.arrayIndex<s.length;){const o=r.arrayIndex++,a=s[o];if(Tt(a)&&Bg(a,n))return{done:!1,value:a}}r.arrayIndex=0}}r.keyIndex++}return nn})}function _r(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Co(t,n=>mc(n,e))}function ei(t,e){if(t){if(e?.range&&!Bg(t,e.range))return new Co(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new Co(t,n=>mc(n,e),{includeRoot:!0})}function Bg(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)===null||n===void 0?void 0:n.range;return r?Tg(r,e):!1}function Rf(t){return new Mt(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){const n=e.keys[e.keyIndex];if(!n.startsWith("$")){const r=t[n];if(Yn(r))return e.keyIndex++,{done:!1,value:{reference:r,container:t,property:n}};if(Array.isArray(r)){for(;e.arrayIndex<r.length;){const i=e.arrayIndex++,s=r[i];if(Yn(s))return{done:!1,value:{reference:s,container:t,property:n,index:i}}}e.arrayIndex=0}}e.keyIndex++}return nn})}function lL(t,e=bt(t).parseResult.value){const n=[];return ei(e).forEach(r=>{Rf(r).forEach(i=>{i.reference.ref===t&&n.push(i.reference)})}),st(n)}function zg(t,e){const n=t.getTypeMetaData(e.$type),r=e;for(const i of n.properties)i.defaultValue!==void 0&&r[i.name]===void 0&&(r[i.name]=gE(i.defaultValue))}function gE(t){return Array.isArray(t)?[...t.map(gE)]:t}function qg(t,e){const n={$type:t.$type};for(const[r,i]of Object.entries(t))if(!r.startsWith("$"))if(Tt(i))n[r]=qg(i,e);else if(Yn(i))n[r]=e(n,r,i.$refNode,i.$refText);else if(Array.isArray(i)){const s=[];for(const o of i)Tt(o)?s.push(qg(o,e)):Yn(o)?s.push(e(n,r,o.$refNode,o.$refText)):s.push(o);n[r]=s}else n[r]=i;return Mg(n),n}const gc={__proto__:null,assignMandatoryProperties:zg,copyAstNode:qg,findLocalReferences:lL,findRootNode:Ef,getContainerOfType:sn,getDocument:bt,hasContainerOfType:xi,linkContentToContainer:Mg,streamAllContents:_r,streamAst:ei,streamContents:mc,streamReferences:Rf};function $e(t){return t.charCodeAt(0)}function jg(t,e){Array.isArray(t)?t.forEach(function(n){e.push(n)}):e.push(t)}function yc(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function _o(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function dL(){throw Error("Internal Error - Should never get here!")}function yE(t){return t.type==="Character"}const $f=[];for(let t=$e("0");t<=$e("9");t++)$f.push(t);const Tf=[$e("_")].concat($f);for(let t=$e("a");t<=$e("z");t++)Tf.push(t);for(let t=$e("A");t<=$e("Z");t++)Tf.push(t);const vE=[$e(" "),$e("\f"),$e(`
2
- `),$e("\r"),$e(" "),$e("\v"),$e(" "),$e("\xA0"),$e("\u1680"),$e("\u2000"),$e("\u2001"),$e("\u2002"),$e("\u2003"),$e("\u2004"),$e("\u2005"),$e("\u2006"),$e("\u2007"),$e("\u2008"),$e("\u2009"),$e("\u200A"),$e("\u2028"),$e("\u2029"),$e("\u202F"),$e("\u205F"),$e("\u3000"),$e("\uFEFF")],fL=/[0-9a-fA-F]/,Sf=/[0-9]/,pL=/[1-9]/;class wE{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 n=this.disjunction();this.consumeChar("/");const r={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":yc(r,"global");break;case"i":yc(r,"ignoreCase");break;case"m":yc(r,"multiLine");break;case"u":yc(r,"unicode");break;case"y":yc(r,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:n,loc:this.loc(0)}}disjunction(){const e=[],n=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(n)}}alternative(){const e=[],n=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(n)}}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 n;switch(this.popChar()){case"=":n="Lookahead";break;case"!":n="NegativeLookahead";break}_o(n);const r=this.disjunction();return this.consumeChar(")"),{type:n,value:r,loc:this.loc(e)}}return dL()}quantifier(e=!1){let n;const r=this.idx;switch(this.popChar()){case"*":n={atLeast:0,atMost:1/0};break;case"+":n={atLeast:1,atMost:1/0};break;case"?":n={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":n={atLeast:i,atMost:i};break;case",":let s;this.isDigit()?(s=this.integerIncludingZero(),n={atLeast:i,atMost:s}):n={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&n===void 0)return;_o(n);break}if(!(e===!0&&n===void 0)&&_o(n))return this.peekChar(0)==="?"?(this.consumeChar("?"),n.greedy=!1):n.greedy=!0,n.type="Quantifier",n.loc=this.loc(r),n}atom(){let e;const n=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()),_o(e))return e.loc=this.loc(n),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[$e(`
3
- `),$e("\r"),$e("\u2028"),$e("\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,n=!1;switch(this.popChar()){case"d":e=$f;break;case"D":e=$f,n=!0;break;case"s":e=vE;break;case"S":e=vE,n=!0;break;case"w":e=Tf;break;case"W":e=Tf,n=!0;break}if(_o(e))return{type:"Set",value:e,complement:n}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=$e("\f");break;case"n":e=$e(`
4
- `);break;case"r":e=$e("\r");break;case"t":e=$e(" ");break;case"v":e=$e("\v");break}if(_o(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:$e("\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:$e(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
5
- `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:$e(e)}}}characterClass(){const e=[];let n=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),n=!0);this.isClassAtom();){const r=this.classAtom();if(r.type,yE(r)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,yE(i)){if(i.value<r.value)throw Error("Range out of order in character class");e.push({from:r.value,to:i.value})}else jg(r.value,e),e.push($e("-")),jg(i.value,e)}else jg(r.value,e)}return this.consumeChar("]"),{type:"Set",complement:n,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
6
- `:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:$e("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}const n=this.disjunction();this.consumeChar(")");const r={type:"Group",capturing:e,value:n};return e&&(r.idx=this.groupIdx),r}positiveInteger(){let e=this.popChar();if(pL.test(e)===!1)throw Error("Expecting a positive integer");for(;Sf.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Sf.test(e)===!1)throw Error("Expecting an integer");for(;Sf.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case`
7
- `:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:$e(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return Sf.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
8
- `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}}isQuantifier(){const e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
9
- `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let n="";for(let i=0;i<e;i++){const s=this.popChar();if(fL.test(s)===!1)throw Error("Expecting a HexDecimal digits");n+=s}return{type:"Character",value:parseInt(n,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){const e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}}class kf{visitChildren(e){for(const n in e){const r=e[n];e.hasOwnProperty(n)&&(r.type!==void 0?this.visit(r):Array.isArray(r)&&r.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}const bE=/\r?\n/gm,hL=new wE;class mL extends kf{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const n=String.fromCharCode(e.value);if(!this.multiline&&n===`
10
- `&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=Cf(n);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitSet(e){if(!this.multiline){const n=this.regex.substring(e.loc.begin,e.loc.end),r=new RegExp(n);this.multiline=!!`
11
- `.match(r)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}}const Ug=new mL;function gL(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),Ug.reset(t),Ug.visit(hL.pattern(t)),Ug.multiline}catch{return!1}}const yL=`\f
12
- \r \v \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`.split("");function Gg(t){const e=typeof t=="string"?new RegExp(t):t;return yL.some(n=>e.test(n))}function Cf(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vL(t){return Array.prototype.map.call(t,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:Cf(e)).join("")}function wL(t,e){const n=bL(t),r=e.match(n);return!!r&&r[0].length>0}function bL(t){typeof t=="string"&&(t=new RegExp(t));const e=t,n=t.source;let r=0;function i(){let s="",o;function a(u){s+=n.substr(r,u),r+=u}function c(u){s+="(?:"+n.substr(r,u)+"|$)",r+=u}for(;r<n.length;)switch(n[r]){case"\\":switch(n[r+1]){case"c":c(3);break;case"x":c(4);break;case"u":e.unicode?n[r+2]==="{"?c(n.indexOf("}",r)-r+1):c(6):c(2);break;case"p":case"P":e.unicode?c(n.indexOf("}",r)-r+1):c(2);break;case"k":c(n.indexOf(">",r)-r+1);break;default:c(2);break}break;case"[":o=/\[(?:\\.|.)*?\]/g,o.lastIndex=r,o=o.exec(n)||[],c(o[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":a(1);break;case"{":o=/\{\d+,?\d*\}/g,o.lastIndex=r,o=o.exec(n),o?a(o[0].length):c(1);break;case"(":if(n[r+1]==="?")switch(n[r+2]){case":":s+="(?:",r+=3,s+=i()+"|$)";break;case"=":s+="(?=",r+=3,s+=i()+")";break;case"!":o=r,r+=3,i(),s+=n.substr(o,r-o);break;case"<":switch(n[r+3]){case"=":case"!":o=r,r+=4,i(),s+=n.substr(o,r-o);break;default:a(n.indexOf(">",r)-r+1),s+=i()+"|$)";break}break}else a(1),s+=i()+"|$)";break;case")":return++r,s;default:c(1);break}return s}return new RegExp(i(),t.flags)}function Af(t){return t.rules.find(e=>rn(e)&&e.entry)}function DE(t){return t.rules.filter(e=>Zr(e)&&e.hidden)}function Wg(t,e){const n=new Set,r=Af(t);if(!r)return new Set(t.rules);const i=[r].concat(DE(t));for(const o of i)EE(o,n,e);const s=new Set;for(const o of t.rules)(n.has(o.name)||Zr(o)&&o.hidden)&&s.add(o);return s}function EE(t,e,n){e.add(t.name),_r(t).forEach(r=>{if(Qr(r)||n&&hE(r)){const i=r.rule.ref;i&&!e.has(i.name)&&EE(i,e,n)}})}function Hg(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=Xg(t.type.ref);return e?.terminal}}function RE(t){return t.hidden&&!Gg(bc(t))}function Po(t,e){return!t||!e?[]:Vg(t,e,t.astNode,!0)}function kn(t,e,n){if(!t||!e)return;const r=Vg(t,e,t.astNode,!0);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function Vg(t,e,n,r){if(!r){const i=sn(t.grammarSource,Cr);if(i&&i.feature===e)return[t]}return Jr(t)&&t.astNode===n?t.content.flatMap(i=>Vg(i,e,n,!1)):[]}function Kg(t,e){return t?Yg(t,e,t?.astNode):[]}function vc(t,e,n){if(!t)return;const r=Yg(t,e,t?.astNode);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function Yg(t,e,n){if(t.astNode!==n)return[];if(Ar(t.grammarSource)&&t.grammarSource.value===e)return[t];const r=Na(t).iterator();let i;const s=[];do if(i=r.next(),!i.done){const o=i.value;o.astNode===n?Ar(o.grammarSource)&&o.grammarSource.value===e&&s.push(o):r.prune()}while(!i.done);return s}function $E(t){var e;const n=t.astNode;for(;n===((e=t.container)===null||e===void 0?void 0:e.astNode);){const r=sn(t.grammarSource,Cr);if(r)return r;t=t.container}}function Xg(t){let e=t;return dE(e)&&(bs(e.$container)?e=e.$container.$container:rn(e.$container)?e=e.$container:Fa(e.$container)),TE(t,e,new Map)}function TE(t,e,n){var r;function i(s,o){let a;return sn(s,Cr)||(a=TE(o,o,n)),n.set(t,a),a}if(n.has(t))return n.get(t);n.set(t,void 0);for(const s of _r(e)){if(Cr(s)&&s.feature.toLowerCase()==="name")return n.set(t,s),s;if(Qr(s)&&rn(s.rule.ref))return i(s,s.rule.ref);if(pE(s)&&(!((r=s.typeRef)===null||r===void 0)&&r.ref))return i(s,s.typeRef.ref)}}function SE(t){const e=t.$container;if(Pi(e)){const n=e.elements,r=n.indexOf(t);for(let i=r-1;i>=0;i--){const s=n[i];if(bs(s))return s;{const o=_r(n[i]).find(bs);if(o)return o}}}if(Pg(e))return SE(e)}function xo(t,e){return t==="?"||t==="*"||Pi(e)&&!!e.guardCondition}function kE(t){return t==="*"||t==="+"}function DL(t){return t==="+="}function _f(t){return CE(t,new Set)}function CE(t,e){if(e.has(t))return!0;e.add(t);for(const n of _r(t))if(Qr(n)){if(!n.rule.ref||rn(n.rule.ref)&&!CE(n.rule.ref,e))return!1}else{if(Cr(n))return!1;if(bs(n))return!1}return!!t.definition}function EL(t){return Jg(t.type,new Set)}function Jg(t,e){if(e.has(t))return!0;if(e.add(t),VF(t))return!1;if(QF(t))return!1;if(tL(t))return t.types.every(n=>Jg(n,e));if(pE(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){const n=t.typeRef.ref;return Ng(n)?Jg(n.type,e):!1}else return!1}else return!1}function Ds(t){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e){if(rn(e))return e.name;if(fE(e)||Ng(e))return e.name}}}function wc(t){var e;if(rn(t))return _f(t)?t.name:(e=Ds(t))!==null&&e!==void 0?e:t.name;if(fE(t)||Ng(t)||eL(t))return t.name;if(bs(t)){const n=AE(t);if(n)return n}else if(dE(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function AE(t){var e;if(t.inferredType)return t.inferredType.name;if(!((e=t.type)===null||e===void 0)&&e.ref)return wc(t.type.ref)}function RL(t){var e,n,r;return Zr(t)?(n=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:"string":_f(t)?t.name:(r=Ds(t))!==null&&r!==void 0?r:t.name}function _E(t){var e,n,r;return Zr(t)?(n=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:"string":(r=Ds(t))!==null&&r!==void 0?r:t.name}function bc(t){const e={s:!1,i:!1,u:!1},n=Io(t.definition,e),r=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(n,r)}const Zg=/[\s\S]/.source;function Io(t,e){if(oL(t))return $L(t);if(aL(t))return TL(t);if(nL(t))return CL(t);if(hE(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return ti(Io(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}else{if(iL(t))return kL(t);if(cL(t))return SL(t);if(sL(t)){const n=t.regex.lastIndexOf("/"),r=t.regex.substring(1,n),i=t.regex.substring(n+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),ti(r,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}else{if(uL(t))return ti(Zg,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${t?.$type}`)}}}function $L(t){return ti(t.elements.map(e=>Io(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function TL(t){return ti(t.elements.map(e=>Io(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function SL(t){return ti(`${Zg}*?${Io(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function kL(t){return ti(`(?!${Io(t.terminal)})${Zg}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function CL(t){return t.right?ti(`[${Qg(t.left)}-${Qg(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):ti(Qg(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function Qg(t){return Cf(t.value)}function ti(t,e){var n;return(e.wrap!==!1||e.lookahead)&&(t=`(${(n=e.lookahead)!==null&&n!==void 0?n:""}${t})`),e.cardinality?`${t}${e.cardinality}`:t}const Pf={__proto__:null,findAssignment:$E,findNameAssignment:Xg,findNodeForKeyword:vc,findNodeForProperty:kn,findNodesForKeyword:Kg,findNodesForKeywordInternal:Yg,findNodesForProperty:Po,getActionAtElement:SE,getActionType:AE,getAllReachableRules:Wg,getCrossReferenceTerminal:Hg,getEntryRule:Af,getExplicitRuleType:Ds,getHiddenRules:DE,getRuleType:_E,getRuleTypeName:RL,getTypeName:wc,isArrayCardinality:kE,isArrayOperator:DL,isCommentTerminal:RE,isDataType:EL,isDataTypeRule:_f,isOptionalCardinality:xo,terminalRegex:bc};function AL(t){const e=[],n=t.Grammar;for(const r of n.rules)Zr(r)&&RE(r)&&gL(bc(r))&&e.push(r.name);return{multilineCommentRules:e,nameRegexp:Sg}}var PE=typeof global=="object"&&global&&global.Object===Object&&global,_L=typeof self=="object"&&self&&self.Object===Object&&self,Pr=PE||_L||Function("return this")(),Xn=Pr.Symbol,xE=Object.prototype,PL=xE.hasOwnProperty,xL=xE.toString,Dc=Xn?Xn.toStringTag:void 0;function IL(t){var e=PL.call(t,Dc),n=t[Dc];try{t[Dc]=void 0;var r=!0}catch{}var i=xL.call(t);return r&&(e?t[Dc]=n:delete t[Dc]),i}var NL=Object.prototype,OL=NL.toString;function FL(t){return OL.call(t)}var LL="[object Null]",ML="[object Undefined]",IE=Xn?Xn.toStringTag:void 0;function Ii(t){return t==null?t===void 0?ML:LL:IE&&IE in Object(t)?IL(t):FL(t)}function ur(t){return t!=null&&typeof t=="object"}var BL="[object Symbol]";function Ec(t){return typeof t=="symbol"||ur(t)&&Ii(t)==BL}function xf(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var We=Array.isArray,zL=1/0,NE=Xn?Xn.prototype:void 0,OE=NE?NE.toString:void 0;function FE(t){if(typeof t=="string")return t;if(We(t))return xf(t,FE)+"";if(Ec(t))return OE?OE.call(t):"";var e=t+"";return e=="0"&&1/t==-zL?"-0":e}var qL=/\s/;function jL(t){for(var e=t.length;e--&&qL.test(t.charAt(e)););return e}var UL=/^\s+/;function GL(t){return t&&t.slice(0,jL(t)+1).replace(UL,"")}function Jn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var LE=NaN,WL=/^[-+]0x[0-9a-f]+$/i,HL=/^0b[01]+$/i,VL=/^0o[0-7]+$/i,KL=parseInt;function YL(t){if(typeof t=="number")return t;if(Ec(t))return LE;if(Jn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Jn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=GL(t);var n=HL.test(t);return n||VL.test(t)?KL(t.slice(2),n?2:8):WL.test(t)?LE:+t}var ME=1/0,XL=17976931348623157e292;function JL(t){if(!t)return t===0?t:0;if(t=YL(t),t===ME||t===-ME){var e=t<0?-1:1;return e*XL}return t===t?t:0}function If(t){var e=JL(t),n=e%1;return e===e?n?e-n:e:0}function Es(t){return t}var ZL="[object AsyncFunction]",QL="[object Function]",eM="[object GeneratorFunction]",tM="[object Proxy]";function ni(t){if(!Jn(t))return!1;var e=Ii(t);return e==QL||e==eM||e==ZL||e==tM}var ey=Pr["__core-js_shared__"],BE=function(){var t=/[^.]+$/.exec(ey&&ey.keys&&ey.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function nM(t){return!!BE&&BE in t}var rM=Function.prototype,iM=rM.toString;function Rs(t){if(t!=null){try{return iM.call(t)}catch{}try{return t+""}catch{}}return""}var sM=/[\\^$.*+?()[\]{}|]/g,oM=/^\[object .+?Constructor\]$/,aM=Function.prototype,cM=Object.prototype,uM=aM.toString,lM=cM.hasOwnProperty,dM=RegExp("^"+uM.call(lM).replace(sM,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function fM(t){if(!Jn(t)||nM(t))return!1;var e=ni(t)?dM:oM;return e.test(Rs(t))}function pM(t,e){return t?.[e]}function $s(t,e){var n=pM(t,e);return fM(n)?n:void 0}var ty=$s(Pr,"WeakMap"),zE=Object.create,hM=function(){function t(){}return function(e){if(!Jn(e))return{};if(zE)return zE(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function mM(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function zt(){}function gM(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var yM=800,vM=16,wM=Date.now;function bM(t){var e=0,n=0;return function(){var r=wM(),i=vM-(r-n);if(n=r,i>0){if(++e>=yM)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function DM(t){return function(){return t}}var Nf=function(){try{var t=$s(Object,"defineProperty");return t({},"",{}),t}catch{}}(),EM=Nf?function(t,e){return Nf(t,"toString",{configurable:!0,enumerable:!1,value:DM(e),writable:!0})}:Es,RM=bM(EM);function qE(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function jE(t,e,n,r){for(var i=t.length,s=n+-1;++s<i;)if(e(t[s],s,t))return s;return-1}function $M(t){return t!==t}function TM(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function ny(t,e,n){return e===e?TM(t,e,n):jE(t,$M,n)}function UE(t,e){var n=t==null?0:t.length;return!!n&&ny(t,e,0)>-1}var SM=9007199254740991,kM=/^(?:0|[1-9]\d*)$/;function Of(t,e){var n=typeof t;return e=e??SM,!!e&&(n=="number"||n!="symbol"&&kM.test(t))&&t>-1&&t%1==0&&t<e}function ry(t,e,n){e=="__proto__"&&Nf?Nf(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Rc(t,e){return t===e||t!==t&&e!==e}var CM=Object.prototype,AM=CM.hasOwnProperty;function Ff(t,e,n){var r=t[e];(!(AM.call(t,e)&&Rc(r,n))||n===void 0&&!(e in t))&&ry(t,e,n)}function iy(t,e,n,r){var i=!n;n||(n={});for(var s=-1,o=e.length;++s<o;){var a=e[s],c=void 0;c===void 0&&(c=t[a]),i?ry(n,a,c):Ff(n,a,c)}return n}var GE=Math.max;function _M(t,e,n){return e=GE(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=GE(r.length-e,0),o=Array(s);++i<s;)o[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=n(o),mM(t,this,a)}}function sy(t,e){return RM(_M(t,e,Es),t+"")}var PM=9007199254740991;function oy(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=PM}function xr(t){return t!=null&&oy(t.length)&&!ni(t)}function WE(t,e,n){if(!Jn(n))return!1;var r=typeof e;return(r=="number"?xr(n)&&Of(e,n.length):r=="string"&&e in n)?Rc(n[e],t):!1}function xM(t){return sy(function(e,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(s=t.length>3&&typeof s=="function"?(i--,s):void 0,o&&WE(n[0],n[1],o)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var a=n[r];a&&t(e,a,r,s)}return e})}var IM=Object.prototype;function $c(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||IM;return t===n}function NM(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var OM="[object Arguments]";function HE(t){return ur(t)&&Ii(t)==OM}var VE=Object.prototype,FM=VE.hasOwnProperty,LM=VE.propertyIsEnumerable,Lf=HE(function(){return arguments}())?HE:function(t){return ur(t)&&FM.call(t,"callee")&&!LM.call(t,"callee")};function MM(){return!1}var KE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,YE=KE&&typeof module=="object"&&module&&!module.nodeType&&module,BM=YE&&YE.exports===KE,XE=BM?Pr.Buffer:void 0,zM=XE?XE.isBuffer:void 0,Tc=zM||MM,qM="[object Arguments]",jM="[object Array]",UM="[object Boolean]",GM="[object Date]",WM="[object Error]",HM="[object Function]",VM="[object Map]",KM="[object Number]",YM="[object Object]",XM="[object RegExp]",JM="[object Set]",ZM="[object String]",QM="[object WeakMap]",e3="[object ArrayBuffer]",t3="[object DataView]",n3="[object Float32Array]",r3="[object Float64Array]",i3="[object Int8Array]",s3="[object Int16Array]",o3="[object Int32Array]",a3="[object Uint8Array]",c3="[object Uint8ClampedArray]",u3="[object Uint16Array]",l3="[object Uint32Array]",mt={};mt[n3]=mt[r3]=mt[i3]=mt[s3]=mt[o3]=mt[a3]=mt[c3]=mt[u3]=mt[l3]=!0,mt[qM]=mt[jM]=mt[e3]=mt[UM]=mt[t3]=mt[GM]=mt[WM]=mt[HM]=mt[VM]=mt[KM]=mt[YM]=mt[XM]=mt[JM]=mt[ZM]=mt[QM]=!1;function d3(t){return ur(t)&&oy(t.length)&&!!mt[Ii(t)]}function Mf(t){return function(e){return t(e)}}var JE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Sc=JE&&typeof module=="object"&&module&&!module.nodeType&&module,f3=Sc&&Sc.exports===JE,ay=f3&&PE.process,Ni=function(){try{var t=Sc&&Sc.require&&Sc.require("util").types;return t||ay&&ay.binding&&ay.binding("util")}catch{}}(),ZE=Ni&&Ni.isTypedArray,cy=ZE?Mf(ZE):d3,p3=Object.prototype,h3=p3.hasOwnProperty;function QE(t,e){var n=We(t),r=!n&&Lf(t),i=!n&&!r&&Tc(t),s=!n&&!r&&!i&&cy(t),o=n||r||i||s,a=o?NM(t.length,String):[],c=a.length;for(var u in t)(e||h3.call(t,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Of(u,c)))&&a.push(u);return a}function eR(t,e){return function(n){return t(e(n))}}var m3=eR(Object.keys,Object),g3=Object.prototype,y3=g3.hasOwnProperty;function tR(t){if(!$c(t))return m3(t);var e=[];for(var n in Object(t))y3.call(t,n)&&n!="constructor"&&e.push(n);return e}function Zn(t){return xr(t)?QE(t):tR(t)}var v3=Object.prototype,w3=v3.hasOwnProperty,On=xM(function(t,e){if($c(e)||xr(e)){iy(e,Zn(e),t);return}for(var n in e)w3.call(e,n)&&Ff(t,n,e[n])});function b3(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var D3=Object.prototype,E3=D3.hasOwnProperty;function R3(t){if(!Jn(t))return b3(t);var e=$c(t),n=[];for(var r in t)r=="constructor"&&(e||!E3.call(t,r))||n.push(r);return n}function nR(t){return xr(t)?QE(t,!0):R3(t)}var $3=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T3=/^\w*$/;function uy(t,e){if(We(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Ec(t)?!0:T3.test(t)||!$3.test(t)||e!=null&&t in Object(e)}var kc=$s(Object,"create");function S3(){this.__data__=kc?kc(null):{},this.size=0}function k3(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var C3="__lodash_hash_undefined__",A3=Object.prototype,_3=A3.hasOwnProperty;function P3(t){var e=this.__data__;if(kc){var n=e[t];return n===C3?void 0:n}return _3.call(e,t)?e[t]:void 0}var x3=Object.prototype,I3=x3.hasOwnProperty;function N3(t){var e=this.__data__;return kc?e[t]!==void 0:I3.call(e,t)}var O3="__lodash_hash_undefined__";function F3(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=kc&&e===void 0?O3:e,this}function Ts(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ts.prototype.clear=S3,Ts.prototype.delete=k3,Ts.prototype.get=P3,Ts.prototype.has=N3,Ts.prototype.set=F3;function L3(){this.__data__=[],this.size=0}function Bf(t,e){for(var n=t.length;n--;)if(Rc(t[n][0],e))return n;return-1}var M3=Array.prototype,B3=M3.splice;function z3(t){var e=this.__data__,n=Bf(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():B3.call(e,n,1),--this.size,!0}function q3(t){var e=this.__data__,n=Bf(e,t);return n<0?void 0:e[n][1]}function j3(t){return Bf(this.__data__,t)>-1}function U3(t,e){var n=this.__data__,r=Bf(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function ri(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}ri.prototype.clear=L3,ri.prototype.delete=z3,ri.prototype.get=q3,ri.prototype.has=j3,ri.prototype.set=U3;var Cc=$s(Pr,"Map");function G3(){this.size=0,this.__data__={hash:new Ts,map:new(Cc||ri),string:new Ts}}function W3(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function zf(t,e){var n=t.__data__;return W3(e)?n[typeof e=="string"?"string":"hash"]:n.map}function H3(t){var e=zf(this,t).delete(t);return this.size-=e?1:0,e}function V3(t){return zf(this,t).get(t)}function K3(t){return zf(this,t).has(t)}function Y3(t,e){var n=zf(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function ii(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}ii.prototype.clear=G3,ii.prototype.delete=H3,ii.prototype.get=V3,ii.prototype.has=K3,ii.prototype.set=Y3;var X3="Expected a function";function ly(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(X3);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=t.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(ly.Cache||ii),n}ly.Cache=ii;var J3=500;function Z3(t){var e=ly(t,function(r){return n.size===J3&&n.clear(),r}),n=e.cache;return e}var Q3=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,e8=/\\(\\)?/g,t8=Z3(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Q3,function(n,r,i,s){e.push(i?s.replace(e8,"$1"):r||n)}),e});function n8(t){return t==null?"":FE(t)}function qf(t,e){return We(t)?t:uy(t,e)?[t]:t8(n8(t))}var r8=1/0;function Ac(t){if(typeof t=="string"||Ec(t))return t;var e=t+"";return e=="0"&&1/t==-r8?"-0":e}function dy(t,e){e=qf(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Ac(e[n++])];return n&&n==r?t:void 0}function i8(t,e,n){var r=t==null?void 0:dy(t,e);return r===void 0?n:r}function fy(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var rR=Xn?Xn.isConcatSpreadable:void 0;function s8(t){return We(t)||Lf(t)||!!(rR&&t&&t[rR])}function py(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=s8),i||(i=[]);++s<o;){var a=t[s];n(a)?fy(i,a):r||(i[i.length]=a)}return i}function Qn(t){var e=t==null?0:t.length;return e?py(t):[]}var iR=eR(Object.getPrototypeOf,Object);function sR(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}function o8(t,e,n,r){var i=-1,s=t==null?0:t.length;for(r&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}function a8(){this.__data__=new ri,this.size=0}function c8(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function u8(t){return this.__data__.get(t)}function l8(t){return this.__data__.has(t)}var d8=200;function f8(t,e){var n=this.__data__;if(n instanceof ri){var r=n.__data__;if(!Cc||r.length<d8-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new ii(r)}return n.set(t,e),this.size=n.size,this}function Ir(t){var e=this.__data__=new ri(t);this.size=e.size}Ir.prototype.clear=a8,Ir.prototype.delete=c8,Ir.prototype.get=u8,Ir.prototype.has=l8,Ir.prototype.set=f8;function p8(t,e){return t&&iy(e,Zn(e),t)}var oR=typeof exports=="object"&&exports&&!exports.nodeType&&exports,aR=oR&&typeof module=="object"&&module&&!module.nodeType&&module,h8=aR&&aR.exports===oR,cR=h8?Pr.Buffer:void 0,uR=cR?cR.allocUnsafe:void 0;function m8(t,e){var n=t.length,r=uR?uR(n):new t.constructor(n);return t.copy(r),r}function hy(t,e){for(var n=-1,r=t==null?0:t.length,i=0,s=[];++n<r;){var o=t[n];e(o,n,t)&&(s[i++]=o)}return s}function lR(){return[]}var g8=Object.prototype,y8=g8.propertyIsEnumerable,dR=Object.getOwnPropertySymbols,my=dR?function(t){return t==null?[]:(t=Object(t),hy(dR(t),function(e){return y8.call(t,e)}))}:lR;function v8(t,e){return iy(t,my(t),e)}var w8=Object.getOwnPropertySymbols,b8=w8?function(t){for(var e=[];t;)fy(e,my(t)),t=iR(t);return e}:lR;function fR(t,e,n){var r=e(t);return We(t)?r:fy(r,n(t))}function gy(t){return fR(t,Zn,my)}function D8(t){return fR(t,nR,b8)}var yy=$s(Pr,"DataView"),vy=$s(Pr,"Promise"),No=$s(Pr,"Set"),pR="[object Map]",E8="[object Object]",hR="[object Promise]",mR="[object Set]",gR="[object WeakMap]",yR="[object DataView]",R8=Rs(yy),$8=Rs(Cc),T8=Rs(vy),S8=Rs(No),k8=Rs(ty),er=Ii;(yy&&er(new yy(new ArrayBuffer(1)))!=yR||Cc&&er(new Cc)!=pR||vy&&er(vy.resolve())!=hR||No&&er(new No)!=mR||ty&&er(new ty)!=gR)&&(er=function(t){var e=Ii(t),n=e==E8?t.constructor:void 0,r=n?Rs(n):"";if(r)switch(r){case R8:return yR;case $8:return pR;case T8:return hR;case S8:return mR;case k8:return gR}return e});var C8=Object.prototype,A8=C8.hasOwnProperty;function _8(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&A8.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var jf=Pr.Uint8Array;function P8(t){var e=new t.constructor(t.byteLength);return new jf(e).set(new jf(t)),e}function x8(t,e){var n=t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var I8=/\w*$/;function N8(t){var e=new t.constructor(t.source,I8.exec(t));return e.lastIndex=t.lastIndex,e}var vR=Xn?Xn.prototype:void 0,wR=vR?vR.valueOf:void 0;function O8(t){return wR?Object(wR.call(t)):{}}function F8(t,e){var n=t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var L8="[object Boolean]",M8="[object Date]",B8="[object Map]",z8="[object Number]",q8="[object RegExp]",j8="[object Set]",U8="[object String]",G8="[object Symbol]",W8="[object ArrayBuffer]",H8="[object DataView]",V8="[object Float32Array]",K8="[object Float64Array]",Y8="[object Int8Array]",X8="[object Int16Array]",J8="[object Int32Array]",Z8="[object Uint8Array]",Q8="[object Uint8ClampedArray]",eB="[object Uint16Array]",tB="[object Uint32Array]";function nB(t,e,n){var r=t.constructor;switch(e){case W8:return P8(t);case L8:case M8:return new r(+t);case H8:return x8(t);case V8:case K8:case Y8:case X8:case J8:case Z8:case Q8:case eB:case tB:return F8(t);case B8:return new r;case z8:case U8:return new r(t);case q8:return N8(t);case j8:return new r;case G8:return O8(t)}}function rB(t){return typeof t.constructor=="function"&&!$c(t)?hM(iR(t)):{}}var iB="[object Map]";function sB(t){return ur(t)&&er(t)==iB}var bR=Ni&&Ni.isMap,oB=bR?Mf(bR):sB,aB="[object Set]";function cB(t){return ur(t)&&er(t)==aB}var DR=Ni&&Ni.isSet,uB=DR?Mf(DR):cB,ER="[object Arguments]",lB="[object Array]",dB="[object Boolean]",fB="[object Date]",pB="[object Error]",RR="[object Function]",hB="[object GeneratorFunction]",mB="[object Map]",gB="[object Number]",$R="[object Object]",yB="[object RegExp]",vB="[object Set]",wB="[object String]",bB="[object Symbol]",DB="[object WeakMap]",EB="[object ArrayBuffer]",RB="[object DataView]",$B="[object Float32Array]",TB="[object Float64Array]",SB="[object Int8Array]",kB="[object Int16Array]",CB="[object Int32Array]",AB="[object Uint8Array]",_B="[object Uint8ClampedArray]",PB="[object Uint16Array]",xB="[object Uint32Array]",dt={};dt[ER]=dt[lB]=dt[EB]=dt[RB]=dt[dB]=dt[fB]=dt[$B]=dt[TB]=dt[SB]=dt[kB]=dt[CB]=dt[mB]=dt[gB]=dt[$R]=dt[yB]=dt[vB]=dt[wB]=dt[bB]=dt[AB]=dt[_B]=dt[PB]=dt[xB]=!0,dt[pB]=dt[RR]=dt[DB]=!1;function Uf(t,e,n,r,i,s){var o;if(o!==void 0)return o;if(!Jn(t))return t;var a=We(t);if(a)return o=_8(t),gM(t,o);var c=er(t),u=c==RR||c==hB;if(Tc(t))return m8(t);if(c==$R||c==ER||u&&!i)return o=u?{}:rB(t),v8(t,p8(o,t));if(!dt[c])return i?t:{};o=nB(t,c),s||(s=new Ir);var l=s.get(t);if(l)return l;s.set(t,o),uB(t)?t.forEach(function(p){o.add(Uf(p,e,n,p,t,s))}):oB(t)&&t.forEach(function(p,h){o.set(h,Uf(p,e,n,h,t,s))});var d=gy,f=a?void 0:d(t);return qE(f||t,function(p,h){f&&(h=p,p=t[h]),Ff(o,h,Uf(p,e,n,h,t,s))}),o}var IB=4;function Kt(t){return Uf(t,IB)}function _c(t){for(var e=-1,n=t==null?0:t.length,r=0,i=[];++e<n;){var s=t[e];s&&(i[r++]=s)}return i}var NB="__lodash_hash_undefined__";function OB(t){return this.__data__.set(t,NB),this}function FB(t){return this.__data__.has(t)}function Oo(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new ii;++e<n;)this.add(t[e])}Oo.prototype.add=Oo.prototype.push=OB,Oo.prototype.has=FB;function TR(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function wy(t,e){return t.has(e)}var LB=1,MB=2;function SR(t,e,n,r,i,s){var o=n&LB,a=t.length,c=e.length;if(a!=c&&!(o&&c>a))return!1;var u=s.get(t),l=s.get(e);if(u&&l)return u==e&&l==t;var d=-1,f=!0,p=n&MB?new Oo:void 0;for(s.set(t,e),s.set(e,t);++d<a;){var h=t[d],v=e[d];if(r)var b=o?r(v,h,d,e,t,s):r(h,v,d,t,e,s);if(b!==void 0){if(b)continue;f=!1;break}if(p){if(!TR(e,function(g,w){if(!wy(p,w)&&(h===g||i(h,g,n,r,s)))return p.push(w)})){f=!1;break}}else if(!(h===v||i(h,v,n,r,s))){f=!1;break}}return s.delete(t),s.delete(e),f}function BB(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function by(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var zB=1,qB=2,jB="[object Boolean]",UB="[object Date]",GB="[object Error]",WB="[object Map]",HB="[object Number]",VB="[object RegExp]",KB="[object Set]",YB="[object String]",XB="[object Symbol]",JB="[object ArrayBuffer]",ZB="[object DataView]",kR=Xn?Xn.prototype:void 0,Dy=kR?kR.valueOf:void 0;function QB(t,e,n,r,i,s,o){switch(n){case ZB:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case JB:return!(t.byteLength!=e.byteLength||!s(new jf(t),new jf(e)));case jB:case UB:case HB:return Rc(+t,+e);case GB:return t.name==e.name&&t.message==e.message;case VB:case YB:return t==e+"";case WB:var a=BB;case KB:var c=r&zB;if(a||(a=by),t.size!=e.size&&!c)return!1;var u=o.get(t);if(u)return u==e;r|=qB,o.set(t,e);var l=SR(a(t),a(e),r,i,s,o);return o.delete(t),l;case XB:if(Dy)return Dy.call(t)==Dy.call(e)}return!1}var e4=1,t4=Object.prototype,n4=t4.hasOwnProperty;function r4(t,e,n,r,i,s){var o=n&e4,a=gy(t),c=a.length,u=gy(e),l=u.length;if(c!=l&&!o)return!1;for(var d=c;d--;){var f=a[d];if(!(o?f in e:n4.call(e,f)))return!1}var p=s.get(t),h=s.get(e);if(p&&h)return p==e&&h==t;var v=!0;s.set(t,e),s.set(e,t);for(var b=o;++d<c;){f=a[d];var g=t[f],w=e[f];if(r)var R=o?r(w,g,f,e,t,s):r(g,w,f,t,e,s);if(!(R===void 0?g===w||i(g,w,n,r,s):R)){v=!1;break}b||(b=f=="constructor")}if(v&&!b){var k=t.constructor,A=e.constructor;k!=A&&"constructor"in t&&"constructor"in e&&!(typeof k=="function"&&k instanceof k&&typeof A=="function"&&A instanceof A)&&(v=!1)}return s.delete(t),s.delete(e),v}var i4=1,CR="[object Arguments]",AR="[object Array]",Gf="[object Object]",s4=Object.prototype,_R=s4.hasOwnProperty;function o4(t,e,n,r,i,s){var o=We(t),a=We(e),c=o?AR:er(t),u=a?AR:er(e);c=c==CR?Gf:c,u=u==CR?Gf:u;var l=c==Gf,d=u==Gf,f=c==u;if(f&&Tc(t)){if(!Tc(e))return!1;o=!0,l=!1}if(f&&!l)return s||(s=new Ir),o||cy(t)?SR(t,e,n,r,i,s):QB(t,e,c,n,r,i,s);if(!(n&i4)){var p=l&&_R.call(t,"__wrapped__"),h=d&&_R.call(e,"__wrapped__");if(p||h){var v=p?t.value():t,b=h?e.value():e;return s||(s=new Ir),i(v,b,n,r,s)}}return f?(s||(s=new Ir),r4(t,e,n,r,i,s)):!1}function Ey(t,e,n,r,i){return t===e?!0:t==null||e==null||!ur(t)&&!ur(e)?t!==t&&e!==e:o4(t,e,n,r,Ey,i)}var a4=1,c4=2;function u4(t,e,n,r){var i=n.length,s=i;if(t==null)return!s;for(t=Object(t);i--;){var o=n[i];if(o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++i<s;){o=n[i];var a=o[0],c=t[a],u=o[1];if(o[2]){if(c===void 0&&!(a in t))return!1}else{var l=new Ir,d;if(!(d===void 0?Ey(u,c,a4|c4,r,l):d))return!1}}return!0}function PR(t){return t===t&&!Jn(t)}function l4(t){for(var e=Zn(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,PR(i)]}return e}function xR(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function d4(t){var e=l4(t);return e.length==1&&e[0][2]?xR(e[0][0],e[0][1]):function(n){return n===t||u4(n,t,e)}}function f4(t,e){return t!=null&&e in Object(t)}function IR(t,e,n){e=qf(e,t);for(var r=-1,i=e.length,s=!1;++r<i;){var o=Ac(e[r]);if(!(s=t!=null&&n(t,o)))break;t=t[o]}return s||++r!=i?s:(i=t==null?0:t.length,!!i&&oy(i)&&Of(o,i)&&(We(t)||Lf(t)))}function p4(t,e){return t!=null&&IR(t,e,f4)}var h4=1,m4=2;function g4(t,e){return uy(t)&&PR(e)?xR(Ac(t),e):function(n){var r=i8(n,t);return r===void 0&&r===e?p4(n,t):Ey(e,r,h4|m4)}}function y4(t){return function(e){return e?.[t]}}function v4(t){return function(e){return dy(e,t)}}function w4(t){return uy(t)?y4(Ac(t)):v4(t)}function lr(t){return typeof t=="function"?t:t==null?Es:typeof t=="object"?We(t)?g4(t[0],t[1]):d4(t):w4(t)}function b4(t,e,n,r){for(var i=-1,s=t==null?0:t.length;++i<s;){var o=t[i];e(r,o,n(o),t)}return r}function D4(t){return function(e,n,r){for(var i=-1,s=Object(e),o=r(e),a=o.length;a--;){var c=o[++i];if(n(s[c],c,s)===!1)break}return e}}var E4=D4();function R4(t,e){return t&&E4(t,e,Zn)}function $4(t,e){return function(n,r){if(n==null)return n;if(!xr(n))return t(n,r);for(var i=n.length,s=-1,o=Object(n);++s<i&&r(o[s],s,o)!==!1;);return n}}var Ss=$4(R4);function T4(t,e,n,r){return Ss(t,function(i,s,o){e(r,i,n(i),o)}),r}function S4(t,e){return function(n,r){var i=We(n)?b4:T4,s=e?e():{};return i(n,t,lr(r),s)}}var NR=Object.prototype,k4=NR.hasOwnProperty,Ry=sy(function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&WE(e[0],e[1],i)&&(r=1);++n<r;)for(var s=e[n],o=nR(s),a=-1,c=o.length;++a<c;){var u=o[a],l=t[u];(l===void 0||Rc(l,NR[u])&&!k4.call(t,u))&&(t[u]=s[u])}return t});function OR(t){return ur(t)&&xr(t)}var C4=200;function A4(t,e,n,r){var i=-1,s=UE,o=!0,a=t.length,c=[],u=e.length;if(!a)return c;e.length>=C4&&(s=wy,o=!1,e=new Oo(e));e:for(;++i<a;){var l=t[i],d=l;if(l=l!==0?l:0,o&&d===d){for(var f=u;f--;)if(e[f]===d)continue e;c.push(l)}else s(e,d,r)||c.push(l)}return c}var Wf=sy(function(t,e){return OR(t)?A4(t,py(e,1,OR,!0)):[]});function Fo(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Yt(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:If(e),sR(t,e<0?0:e,r)):[]}function Pc(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:If(e),e=r-e,sR(t,0,e<0?0:e)):[]}function _4(t){return typeof t=="function"?t:Es}function Ee(t,e){var n=We(t)?qE:Ss;return n(t,_4(e))}function P4(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function x4(t,e){var n=!0;return Ss(t,function(r,i,s){return n=!!e(r,i,s),n}),n}function dr(t,e,n){var r=We(t)?P4:x4;return r(t,lr(e))}function FR(t,e){var n=[];return Ss(t,function(r,i,s){e(r,i,s)&&n.push(r)}),n}function Fn(t,e){var n=We(t)?hy:FR;return n(t,lr(e))}function I4(t){return function(e,n,r){var i=Object(e);if(!xr(e)){var s=lr(n);e=Zn(e),n=function(a){return s(i[a],a,i)}}var o=t(e,n,r);return o>-1?i[s?e[o]:o]:void 0}}var N4=Math.max;function O4(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:If(n);return i<0&&(i=N4(r+i,0)),jE(t,lr(e),i)}var Lo=I4(O4);function fr(t){return t&&t.length?t[0]:void 0}function F4(t,e){var n=-1,r=xr(t)?Array(t.length):[];return Ss(t,function(i,s,o){r[++n]=e(i,s,o)}),r}function pe(t,e){var n=We(t)?xf:F4;return n(t,lr(e))}function Ln(t,e){return py(pe(t,e))}var L4=Object.prototype,M4=L4.hasOwnProperty,B4=S4(function(t,e,n){M4.call(t,n)?t[n].push(e):ry(t,n,[e])}),z4=Object.prototype,q4=z4.hasOwnProperty;function j4(t,e){return t!=null&&q4.call(t,e)}function Re(t,e){return t!=null&&IR(t,e,j4)}var U4="[object String]";function Cn(t){return typeof t=="string"||!We(t)&&ur(t)&&Ii(t)==U4}function G4(t,e){return xf(e,function(n){return t[n]})}function qt(t){return t==null?[]:G4(t,Zn(t))}var W4=Math.max;function hn(t,e,n,r){t=xr(t)?t:qt(t),n=n&&!r?If(n):0;var i=t.length;return n<0&&(n=W4(i+n,0)),Cn(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&ny(t,e,n)>-1}function LR(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=0;return ny(t,e,i)}var H4="[object Map]",V4="[object Set]",K4=Object.prototype,Y4=K4.hasOwnProperty;function at(t){if(t==null)return!0;if(xr(t)&&(We(t)||typeof t=="string"||typeof t.splice=="function"||Tc(t)||cy(t)||Lf(t)))return!t.length;var e=er(t);if(e==H4||e==V4)return!t.size;if($c(t))return!tR(t).length;for(var n in t)if(Y4.call(t,n))return!1;return!0}var X4="[object RegExp]";function J4(t){return ur(t)&&Ii(t)==X4}var MR=Ni&&Ni.isRegExp,si=MR?Mf(MR):J4;function oi(t){return t===void 0}function Z4(t,e){return t<e}function Q4(t,e,n){for(var r=-1,i=t.length;++r<i;){var s=t[r],o=e(s);if(o!=null&&(a===void 0?o===o&&!Ec(o):n(o,a)))var a=o,c=s}return c}function e6(t){return t&&t.length?Q4(t,Es,Z4):void 0}var t6="Expected a function";function n6(t){if(typeof t!="function")throw new TypeError(t6);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function r6(t,e,n,r){if(!Jn(t))return t;e=qf(e,t);for(var i=-1,s=e.length,o=s-1,a=t;a!=null&&++i<s;){var c=Ac(e[i]),u=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(i!=o){var l=a[c];u=void 0,u===void 0&&(u=Jn(l)?l:Of(e[i+1])?[]:{})}Ff(a,c,u),a=a[c]}return t}function i6(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],a=dy(t,o);n(a,o)&&r6(s,qf(o,t),a)}return s}function pr(t,e){if(t==null)return{};var n=xf(D8(t),function(r){return[r]});return e=lr(e),i6(t,n,function(r,i){return e(r,i[0])})}function s6(t,e,n,r,i){return i(t,function(s,o,a){n=r?(r=!1,s):e(n,s,o,a)}),n}function mn(t,e,n){var r=We(t)?o8:s6,i=arguments.length<3;return r(t,lr(e),n,i,Ss)}function Hf(t,e){var n=We(t)?hy:FR;return n(t,n6(lr(e)))}function o6(t,e){var n;return Ss(t,function(r,i,s){return n=e(r,i,s),!n}),!!n}function BR(t,e,n){var r=We(t)?TR:o6;return r(t,lr(e))}var a6=1/0,c6=No&&1/by(new No([,-0]))[1]==a6?function(t){return new No(t)}:zt,u6=200;function zR(t,e,n){var r=-1,i=UE,s=t.length,o=!0,a=[],c=a;if(s>=u6){var u=e?null:c6(t);if(u)return by(u);o=!1,i=wy,c=new Oo}else c=e?[]:a;e:for(;++r<s;){var l=t[r],d=e?e(l):l;if(l=l!==0?l:0,o&&d===d){for(var f=c.length;f--;)if(c[f]===d)continue e;e&&c.push(d),a.push(l)}else i(c,d,n)||(c!==a&&c.push(d),a.push(l))}return a}function $y(t){return t&&t.length?zR(t):[]}function l6(t,e){return t&&t.length?zR(t,lr(e)):[]}function Ty(t){console&&console.error&&console.error(`Error: ${t}`)}function qR(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function jR(t){const e=new Date().getTime(),n=t();return{time:new Date().getTime()-e,value:n}}function UR(t){function e(){}e.prototype=t;const n=new e;function r(){return typeof n.bar}return r(),r(),t}function d6(t){return f6(t)?t.LABEL:t.name}function f6(t){return Cn(t.LABEL)&&t.LABEL!==""}class Nr{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),Ee(this.definition,n=>{n.accept(e)})}}class gn extends Nr{constructor(e){super([]),this.idx=1,On(this,pr(e,n=>n!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class Mo extends Nr{constructor(e){super(e.definition),this.orgText="",On(this,pr(e,n=>n!==void 0))}}class An extends Nr{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,On(this,pr(e,n=>n!==void 0))}}class Xt extends Nr{constructor(e){super(e.definition),this.idx=1,On(this,pr(e,n=>n!==void 0))}}class Mn extends Nr{constructor(e){super(e.definition),this.idx=1,On(this,pr(e,n=>n!==void 0))}}class Bn extends Nr{constructor(e){super(e.definition),this.idx=1,On(this,pr(e,n=>n!==void 0))}}class St extends Nr{constructor(e){super(e.definition),this.idx=1,On(this,pr(e,n=>n!==void 0))}}class _n extends Nr{constructor(e){super(e.definition),this.idx=1,On(this,pr(e,n=>n!==void 0))}}class Pn extends Nr{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,On(this,pr(e,n=>n!==void 0))}}class gt{constructor(e){this.idx=1,On(this,pr(e,n=>n!==void 0))}accept(e){e.visit(this)}}function p6(t){return pe(t,Vf)}function Vf(t){function e(n){return pe(n,Vf)}if(t instanceof gn){const n={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return Cn(t.label)&&(n.label=t.label),n}else{if(t instanceof An)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Xt)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Mn)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Bn)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Vf(new gt({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof _n)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Vf(new gt({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof St)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof Pn)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof gt){const n={type:"Terminal",name:t.terminalType.name,label:d6(t.terminalType),idx:t.idx};Cn(t.label)&&(n.terminalLabel=t.label);const r=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(n.pattern=si(r)?r.source:r),n}else{if(t instanceof Mo)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}class Bo{visit(e){const n=e;switch(n.constructor){case gn:return this.visitNonTerminal(n);case An:return this.visitAlternative(n);case Xt:return this.visitOption(n);case Mn:return this.visitRepetitionMandatory(n);case Bn:return this.visitRepetitionMandatoryWithSeparator(n);case _n:return this.visitRepetitionWithSeparator(n);case St:return this.visitRepetition(n);case Pn:return this.visitAlternation(n);case gt:return this.visitTerminal(n);case Mo:return this.visitRule(n);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function h6(t){return t instanceof An||t instanceof Xt||t instanceof St||t instanceof Mn||t instanceof Bn||t instanceof _n||t instanceof gt||t instanceof Mo}function Kf(t,e=[]){return t instanceof Xt||t instanceof St||t instanceof _n?!0:t instanceof Pn?BR(t.definition,r=>Kf(r,e)):t instanceof gn&&hn(e,t)?!1:t instanceof Nr?(t instanceof gn&&e.push(t),dr(t.definition,r=>Kf(r,e))):!1}function m6(t){return t instanceof Pn}function Or(t){if(t instanceof gn)return"SUBRULE";if(t instanceof Xt)return"OPTION";if(t instanceof Pn)return"OR";if(t instanceof Mn)return"AT_LEAST_ONE";if(t instanceof Bn)return"AT_LEAST_ONE_SEP";if(t instanceof _n)return"MANY_SEP";if(t instanceof St)return"MANY";if(t instanceof gt)return"CONSUME";throw Error("non exhaustive match")}class Yf{walk(e,n=[]){Ee(e.definition,(r,i)=>{const s=Yt(e.definition,i+1);if(r instanceof gn)this.walkProdRef(r,s,n);else if(r instanceof gt)this.walkTerminal(r,s,n);else if(r instanceof An)this.walkFlat(r,s,n);else if(r instanceof Xt)this.walkOption(r,s,n);else if(r instanceof Mn)this.walkAtLeastOne(r,s,n);else if(r instanceof Bn)this.walkAtLeastOneSep(r,s,n);else if(r instanceof _n)this.walkManySep(r,s,n);else if(r instanceof St)this.walkMany(r,s,n);else if(r instanceof Pn)this.walkOr(r,s,n);else throw Error("non exhaustive match")})}walkTerminal(e,n,r){}walkProdRef(e,n,r){}walkFlat(e,n,r){const i=n.concat(r);this.walk(e,i)}walkOption(e,n,r){const i=n.concat(r);this.walk(e,i)}walkAtLeastOne(e,n,r){const i=[new Xt({definition:e.definition})].concat(n,r);this.walk(e,i)}walkAtLeastOneSep(e,n,r){const i=GR(e,n,r);this.walk(e,i)}walkMany(e,n,r){const i=[new Xt({definition:e.definition})].concat(n,r);this.walk(e,i)}walkManySep(e,n,r){const i=GR(e,n,r);this.walk(e,i)}walkOr(e,n,r){const i=n.concat(r);Ee(e.definition,s=>{const o=new An({definition:[s]});this.walk(o,i)})}}function GR(t,e,n){return[new Xt({definition:[new gt({terminalType:t.separator})].concat(t.definition)})].concat(e,n)}function xc(t){if(t instanceof gn)return xc(t.referencedRule);if(t instanceof gt)return v6(t);if(h6(t))return g6(t);if(m6(t))return y6(t);throw Error("non exhaustive match")}function g6(t){let e=[];const n=t.definition;let r=0,i=n.length>r,s,o=!0;for(;i&&o;)s=n[r],o=Kf(s),e=e.concat(xc(s)),r=r+1,i=n.length>r;return $y(e)}function y6(t){const e=pe(t.definition,n=>xc(n));return $y(Qn(e))}function v6(t){return[t.terminalType]}const WR="_~IN~_";class w6 extends Yf{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,n,r){}walkProdRef(e,n,r){const i=D6(e.referencedRule,e.idx)+this.topProd.name,s=n.concat(r),o=new An({definition:s}),a=xc(o);this.follows[i]=a}}function b6(t){const e={};return Ee(t,n=>{const r=new w6(n).startWalking();On(e,r)}),e}function D6(t,e){return t.name+e+WR}let Xf={};const E6=new wE;function Jf(t){const e=t.toString();if(Xf.hasOwnProperty(e))return Xf[e];{const n=E6.pattern(e);return Xf[e]=n,n}}function R6(){Xf={}}const HR="Complement Sets are not supported for first char optimization",Zf=`Unable to use "first char" lexer optimizations:
13
- `;function $6(t,e=!1){try{const n=Jf(t);return Sy(n.value,{},n.flags.ignoreCase)}catch(n){if(n.message===HR)e&&qR(`${Zf} Unable to optimize: < ${t.toString()} >
14
- Complement Sets cannot be automatically optimized.
15
- This will disable the lexer's first char optimizations.
16
- See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let r="";e&&(r=`
17
- This will disable the lexer's first char optimizations.
18
- See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Ty(`${Zf}
19
- Failed parsing: < ${t.toString()} >
20
- Using the @chevrotain/regexp-to-ast library
21
- Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+r)}}return[]}function Sy(t,e,n){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)Sy(t.value[i],e,n);break;case"Alternative":const r=t.value;for(let i=0;i<r.length;i++){const s=r[i];switch(s.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const o=s;switch(o.type){case"Character":Qf(o.value,e,n);break;case"Set":if(o.complement===!0)throw Error(HR);Ee(o.value,c=>{if(typeof c=="number")Qf(c,e,n);else{const u=c;if(n===!0)for(let l=u.from;l<=u.to;l++)Qf(l,e,n);else{for(let l=u.from;l<=u.to&&l<Nc;l++)Qf(l,e,n);if(u.to>=Nc){const l=u.from>=Nc?u.from:Nc,d=u.to,f=Oi(l),p=Oi(d);for(let h=f;h<=p;h++)e[h]=h}}}});break;case"Group":Sy(o.value,e,n);break;default:throw Error("Non Exhaustive Match")}const a=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&ky(o)===!1||o.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return qt(e)}function Qf(t,e,n){const r=Oi(t);e[r]=r,n===!0&&T6(t,e)}function T6(t,e){const n=String.fromCharCode(t),r=n.toUpperCase();if(r!==n){const i=Oi(r.charCodeAt(0));e[i]=i}else{const i=n.toLowerCase();if(i!==n){const s=Oi(i.charCodeAt(0));e[s]=s}}}function VR(t,e){return Lo(t.value,n=>{if(typeof n=="number")return hn(e,n);{const r=n;return Lo(e,i=>r.from<=i&&i<=r.to)!==void 0}})}function ky(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?We(t.value)?dr(t.value,ky):ky(t.value):!1}class S6 extends kf{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return}super.visitChildren(e)}}visitCharacter(e){hn(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?VR(e,this.targetCharCodes)===void 0&&(this.found=!0):VR(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function Cy(t,e){if(e instanceof RegExp){const n=Jf(e),r=new S6(t);return r.visit(n),r.found}else return Lo(e,n=>hn(t,n.charCodeAt(0)))!==void 0}const ks="PATTERN",Ic="defaultMode",ep="modes";let KR=typeof new RegExp("(?:)").sticky=="boolean";function k6(t,e){e=Ry(e,{useSticky:KR,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
22
- `],tracer:(w,R)=>R()});const n=e.tracer;n("initCharCodeToOptimizedIndexMap",()=>{X6()});let r;n("Reject Lexer.NA",()=>{r=Hf(t,w=>w[ks]===xn.NA)});let i=!1,s;n("Transform Patterns",()=>{i=!1,s=pe(r,w=>{const R=w[ks];if(si(R)){const k=R.source;return k.length===1&&k!=="^"&&k!=="$"&&k!=="."&&!R.ignoreCase?k:k.length===2&&k[0]==="\\"&&!hn(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],k[1])?k[1]:e.useSticky?XR(R):YR(R)}else{if(ni(R))return i=!0,{exec:R};if(typeof R=="object")return i=!0,R;if(typeof R=="string"){if(R.length===1)return R;{const k=R.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),A=new RegExp(k);return e.useSticky?XR(A):YR(A)}}else throw Error("non exhaustive match")}})});let o,a,c,u,l;n("misc mapping",()=>{o=pe(r,w=>w.tokenTypeIdx),a=pe(r,w=>{const R=w.GROUP;if(R!==xn.SKIPPED){if(Cn(R))return R;if(oi(R))return!1;throw Error("non exhaustive match")}}),c=pe(r,w=>{const R=w.LONGER_ALT;if(R)return We(R)?pe(R,A=>LR(r,A)):[LR(r,R)]}),u=pe(r,w=>w.PUSH_MODE),l=pe(r,w=>Re(w,"POP_MODE"))});let d;n("Line Terminator Handling",()=>{const w=QR(e.lineTerminatorCharacters);d=pe(r,R=>!1),e.positionTracking!=="onlyOffset"&&(d=pe(r,R=>Re(R,"LINE_BREAKS")?!!R.LINE_BREAKS:ZR(R,w)===!1&&Cy(w,R.PATTERN)))});let f,p,h,v;n("Misc Mapping #2",()=>{f=pe(r,JR),p=pe(s,V6),h=mn(r,(w,R)=>{const k=R.GROUP;return Cn(k)&&k!==xn.SKIPPED&&(w[k]=[]),w},{}),v=pe(s,(w,R)=>({pattern:s[R],longerAlt:c[R],canLineTerminator:d[R],isCustom:f[R],short:p[R],group:a[R],push:u[R],pop:l[R],tokenTypeIdx:o[R],tokenType:r[R]}))});let b=!0,g=[];return e.safeMode||n("First Char Optimization",()=>{g=mn(r,(w,R,k)=>{if(typeof R.PATTERN=="string"){const A=R.PATTERN.charCodeAt(0),N=Oi(A);Ay(w,N,v[k])}else if(We(R.START_CHARS_HINT)){let A;Ee(R.START_CHARS_HINT,N=>{const _=typeof N=="string"?N.charCodeAt(0):N,B=Oi(_);A!==B&&(A=B,Ay(w,B,v[k]))})}else if(si(R.PATTERN))if(R.PATTERN.unicode)b=!1,e.ensureOptimizations&&Ty(`${Zf} Unable to analyze < ${R.PATTERN.toString()} > pattern.
23
- The regexp unicode flag is not currently supported by the regexp-to-ast library.
24
- This will disable the lexer's first char optimizations.
25
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const A=$6(R.PATTERN,e.ensureOptimizations);at(A)&&(b=!1),Ee(A,N=>{Ay(w,N,v[k])})}else e.ensureOptimizations&&Ty(`${Zf} TokenType: <${R.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
26
- This will disable the lexer's first char optimizations.
27
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),b=!1;return w},[])}),{emptyGroups:h,patternIdxToConfig:v,charCodeToPatternIdxToConfig:g,hasCustom:i,canBeOptimized:b}}function C6(t,e){let n=[];const r=_6(t);n=n.concat(r.errors);const i=P6(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(A6(s)),n=n.concat(B6(s)),n=n.concat(z6(s,e)),n=n.concat(q6(s)),n}function A6(t){let e=[];const n=Fn(t,r=>si(r[ks]));return e=e.concat(I6(n)),e=e.concat(F6(n)),e=e.concat(L6(n)),e=e.concat(M6(n)),e=e.concat(N6(n)),e}function _6(t){const e=Fn(t,i=>!Re(i,ks)),n=pe(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:kt.MISSING_PATTERN,tokenTypes:[i]})),r=Wf(t,e);return{errors:n,valid:r}}function P6(t){const e=Fn(t,i=>{const s=i[ks];return!si(s)&&!ni(s)&&!Re(s,"exec")&&!Cn(s)}),n=pe(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:kt.INVALID_PATTERN,tokenTypes:[i]})),r=Wf(t,e);return{errors:n,valid:r}}const x6=/[^\\][$]/;function I6(t){class e extends kf{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}const n=Fn(t,i=>{const s=i.PATTERN;try{const o=Jf(s),a=new e;return a.visit(o),a.found}catch{return x6.test(s.source)}});return pe(n,i=>({message:`Unexpected RegExp Anchor Error:
28
- Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
29
- See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:kt.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function N6(t){const e=Fn(t,r=>r.PATTERN.test(""));return pe(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:kt.EMPTY_MATCH_PATTERN,tokenTypes:[r]}))}const O6=/[^\\[][\^]|^\^/;function F6(t){class e extends kf{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}const n=Fn(t,i=>{const s=i.PATTERN;try{const o=Jf(s),a=new e;return a.visit(o),a.found}catch{return O6.test(s.source)}});return pe(n,i=>({message:`Unexpected RegExp Anchor Error:
30
- Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
31
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:kt.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function L6(t){const e=Fn(t,r=>{const i=r[ks];return i instanceof RegExp&&(i.multiline||i.global)});return pe(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:kt.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}))}function M6(t){const e=[];let n=pe(t,s=>mn(t,(o,a)=>(s.PATTERN.source===a.PATTERN.source&&!hn(e,a)&&a.PATTERN!==xn.NA&&(e.push(a),o.push(a)),o),[]));n=_c(n);const r=Fn(n,s=>s.length>1);return pe(r,s=>{const o=pe(s,c=>c.name);return{message:`The same RegExp pattern ->${fr(s).PATTERN}<-has been used in all of the following Token Types: ${o.join(", ")} <-`,type:kt.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}function B6(t){const e=Fn(t,r=>{if(!Re(r,"GROUP"))return!1;const i=r.GROUP;return i!==xn.SKIPPED&&i!==xn.NA&&!Cn(i)});return pe(e,r=>({message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:kt.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}))}function z6(t,e){const n=Fn(t,i=>i.PUSH_MODE!==void 0&&!hn(e,i.PUSH_MODE));return pe(n,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:kt.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function q6(t){const e=[],n=mn(t,(r,i,s)=>{const o=i.PATTERN;return o===xn.NA||(Cn(o)?r.push({str:o,idx:s,tokenType:i}):si(o)&&U6(o)&&r.push({str:o.source,idx:s,tokenType:i})),r},[]);return Ee(t,(r,i)=>{Ee(n,({str:s,idx:o,tokenType:a})=>{if(i<o&&j6(s,r.PATTERN)){const c=`Token: ->${a.name}<- can never be matched.
32
- Because it appears AFTER the Token Type ->${r.name}<-in the lexer's definition.
33
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:kt.UNREACHABLE_PATTERN,tokenTypes:[r,a]})}})}),e}function j6(t,e){if(si(e)){const n=e.exec(t);return n!==null&&n.index===0}else{if(ni(e))return e(t,0,[],{});if(Re(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function U6(t){return Lo([".","\\","[","]","|","^","$","(",")","?","*","+","{"],n=>t.source.indexOf(n)!==-1)===void 0}function YR(t){const e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function XR(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function G6(t,e,n){const r=[];return Re(t,Ic)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ic+`> property in its definition
34
- `,type:kt.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Re(t,ep)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+ep+`> property in its definition
35
- `,type:kt.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Re(t,ep)&&Re(t,Ic)&&!Re(t.modes,t.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${Ic}: <${t.defaultMode}>which does not exist
36
- `,type:kt.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Re(t,ep)&&Ee(t.modes,(i,s)=>{Ee(i,(o,a)=>{if(oi(o))r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${a}>
37
- `,type:kt.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Re(o,"LONGER_ALT")){const c=We(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT];Ee(c,u=>{!oi(u)&&!hn(i,u)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${o.name}> outside of mode <${s}>
38
- `,type:kt.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),r}function W6(t,e,n){const r=[];let i=!1;const s=_c(Qn(qt(t.modes))),o=Hf(s,c=>c[ks]===xn.NA),a=QR(n);return e&&Ee(o,c=>{const u=ZR(c,a);if(u!==!1){const d={message:Y6(c,u),type:u.issue,tokenType:c};r.push(d)}else Re(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(i=!0):Cy(a,c.PATTERN)&&(i=!0)}),e&&!i&&r.push({message:`Warning: No LINE_BREAKS Found.
39
- This Lexer has been defined to track line and column information,
40
- But none of the Token Types can be identified as matching a line terminator.
41
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
42
- for details.`,type:kt.NO_LINE_BREAKS_FLAGS}),r}function H6(t){const e={},n=Zn(t);return Ee(n,r=>{const i=t[r];if(We(i))e[r]=[];else throw Error("non exhaustive match")}),e}function JR(t){const e=t.PATTERN;if(si(e))return!1;if(ni(e))return!0;if(Re(e,"exec"))return!0;if(Cn(e))return!1;throw Error("non exhaustive match")}function V6(t){return Cn(t)&&t.length===1?t.charCodeAt(0):!1}const K6={test:function(t){const e=t.length;for(let n=this.lastIndex;n<e;n++){const r=t.charCodeAt(n);if(r===10)return this.lastIndex=n+1,!0;if(r===13)return t.charCodeAt(n+1)===10?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function ZR(t,e){if(Re(t,"LINE_BREAKS"))return!1;if(si(t.PATTERN)){try{Cy(e,t.PATTERN)}catch(n){return{issue:kt.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}else{if(Cn(t.PATTERN))return!1;if(JR(t))return{issue:kt.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function Y6(t,e){if(e.issue===kt.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
43
- The problem is in the <${t.name}> Token Type
44
- Root cause: ${e.errMsg}.
45
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===kt.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
46
- The problem is in the <${t.name}> Token Type
47
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function QR(t){return pe(t,n=>Cn(n)?n.charCodeAt(0):n)}function Ay(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}const Nc=256;let tp=[];function Oi(t){return t<Nc?t:tp[t]}function X6(){if(at(tp)){tp=new Array(65536);for(let t=0;t<65536;t++)tp[t]=t>255?255+~~(t/255):t}}function Oc(t,e){const n=t.tokenTypeIdx;return n===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[n]===!0}function np(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let e$=1;const t$={};function Fc(t){const e=J6(t);Z6(e),ez(e),Q6(e),Ee(e,n=>{n.isParent=n.categoryMatches.length>0})}function J6(t){let e=Kt(t),n=t,r=!0;for(;r;){n=_c(Qn(pe(n,s=>s.CATEGORIES)));const i=Wf(n,e);e=e.concat(i),at(i)?r=!1:n=i}return e}function Z6(t){Ee(t,e=>{r$(e)||(t$[e$]=e,e.tokenTypeIdx=e$++),i$(e)&&!We(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),i$(e)||(e.CATEGORIES=[]),tz(e)||(e.categoryMatches=[]),nz(e)||(e.categoryMatchesMap={})})}function Q6(t){Ee(t,e=>{e.categoryMatches=[],Ee(e.categoryMatchesMap,(n,r)=>{e.categoryMatches.push(t$[r].tokenTypeIdx)})})}function ez(t){Ee(t,e=>{n$([],e)})}function n$(t,e){Ee(t,n=>{e.categoryMatchesMap[n.tokenTypeIdx]=!0}),Ee(e.CATEGORIES,n=>{const r=t.concat(e);hn(r,n)||n$(r,n)})}function r$(t){return Re(t,"tokenTypeIdx")}function i$(t){return Re(t,"CATEGORIES")}function tz(t){return Re(t,"categoryMatches")}function nz(t){return Re(t,"categoryMatchesMap")}function rz(t){return Re(t,"tokenTypeIdx")}const _y={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,n,r,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${n} characters.`}};var kt;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(kt||(kt={}));const Lc={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
48
- `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:_y,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Lc);class xn{constructor(e,n=Lc){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,s)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const o=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${o}--> <${i}>`);const{time:a,value:c}=jR(s),u=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&u(`${o}<-- <${i}> time: ${a}ms`),this.traceInitIndent--,c}else return s()},typeof n=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
49
- a boolean 2nd argument is no longer supported`);this.config=On({},Lc,n);const r=this.config.traceInitPerf;r===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof r=="number"&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,s=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Lc.lineTerminatorsPattern)this.config.lineTerminatorsPattern=K6;else if(this.config.lineTerminatorCharacters===Lc.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
50
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(n.safeMode&&n.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),We(e)?i={modes:{defaultMode:Kt(e)},defaultMode:Ic}:(s=!1,i=Kt(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(G6(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(W6(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},Ee(i.modes,(a,c)=>{i.modes[c]=Hf(a,u=>oi(u))});const o=Zn(i.modes);if(Ee(i.modes,(a,c)=>{this.TRACE_INIT(`Mode: <${c}> processing`,()=>{if(this.modes.push(c),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(C6(a,o))}),at(this.lexerDefinitionErrors)){Fc(a);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=k6(a,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:n.positionTracking,ensureOptimizations:n.ensureOptimizations,safeMode:n.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[c]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[c]=u.charCodeToPatternIdxToConfig,this.emptyGroups=On({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[c]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!at(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const c=pe(this.lexerDefinitionErrors,u=>u.message).join(`-----------------------
51
- `);throw new Error(`Errors detected in definition of Lexer:
52
- `+c)}Ee(this.lexerDefinitionWarning,a=>{qR(a.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(KR?(this.chopInput=Es,this.match=this.matchWithTest):(this.updateLastIndex=zt,this.match=this.matchWithExec),s&&(this.handleModes=zt),this.trackStartLines===!1&&(this.computeNewColumn=Es),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=zt),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const a=mn(this.canModeBeOptimized,(c,u,l)=>(u===!1&&c.push(l),c),[]);if(n.ensureOptimizations&&!at(a))throw Error(`Lexer Modes: < ${a.join(", ")} > cannot be optimized.
53
- Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
54
- Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{R6()}),this.TRACE_INIT("toFastProperties",()=>{UR(this)})})}tokenize(e,n=this.defaultMode){if(!at(this.lexerDefinitionErrors)){const i=pe(this.lexerDefinitionErrors,s=>s.message).join(`-----------------------
55
- `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
56
- `+i)}return this.tokenizeInternal(e,n)}tokenizeInternal(e,n){let r,i,s,o,a,c,u,l,d,f,p,h,v,b,g;const w=e,R=w.length;let k=0,A=0;const N=this.hasCustom?0:Math.floor(e.length/10),_=new Array(N),B=[];let z=this.trackStartLines?1:void 0,Q=this.trackStartLines?1:void 0;const I=H6(this.emptyGroups),T=this.trackStartLines,$=this.config.lineTerminatorsPattern;let L=0,V=[],H=[];const K=[],we=[];Object.freeze(we);let te;function C(){return V}function he(Ie){const oe=Oi(Ie),be=H[oe];return be===void 0?we:be}const Ye=Ie=>{if(K.length===1&&Ie.tokenType.PUSH_MODE===void 0){const oe=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Ie);B.push({offset:Ie.startOffset,line:Ie.startLine,column:Ie.startColumn,length:Ie.image.length,message:oe})}else{K.pop();const oe=Fo(K);V=this.patternIdxToConfig[oe],H=this.charCodeToPatternIdxToConfig[oe],L=V.length;const be=this.canModeBeOptimized[oe]&&this.config.safeMode===!1;H&&be?te=he:te=C}};function pt(Ie){K.push(Ie),H=this.charCodeToPatternIdxToConfig[Ie],V=this.patternIdxToConfig[Ie],L=V.length,L=V.length;const oe=this.canModeBeOptimized[Ie]&&this.config.safeMode===!1;H&&oe?te=he:te=C}pt.call(this,n);let W;const X=this.config.recoveryEnabled;for(;k<R;){c=null;const Ie=w.charCodeAt(k),oe=te(Ie),be=oe.length;for(r=0;r<be;r++){W=oe[r];const Se=W.pattern;u=null;const ae=W.short;if(ae!==!1?Ie===ae&&(c=Se):W.isCustom===!0?(g=Se.exec(w,k,_,I),g!==null?(c=g[0],g.payload!==void 0&&(u=g.payload)):c=null):(this.updateLastIndex(Se,k),c=this.match(Se,e,k)),c!==null){if(a=W.longerAlt,a!==void 0){const O=a.length;for(s=0;s<O;s++){const j=V[a[s]],de=j.pattern;if(l=null,j.isCustom===!0?(g=de.exec(w,k,_,I),g!==null?(o=g[0],g.payload!==void 0&&(l=g.payload)):o=null):(this.updateLastIndex(de,k),o=this.match(de,e,k)),o&&o.length>c.length){c=o,u=l,W=j;break}}}break}}if(c!==null){if(d=c.length,f=W.group,f!==void 0&&(p=W.tokenTypeIdx,h=this.createTokenInstance(c,k,p,W.tokenType,z,Q,d),this.handlePayload(h,u),f===!1?A=this.addToken(_,A,h):I[f].push(h)),e=this.chopInput(e,d),k=k+d,Q=this.computeNewColumn(Q,d),T===!0&&W.canLineTerminator===!0){let Se=0,ae,O;$.lastIndex=0;do ae=$.test(c),ae===!0&&(O=$.lastIndex-1,Se++);while(ae===!0);Se!==0&&(z=z+Se,Q=d-O,this.updateTokenEndLineColumnLocation(h,f,O,Se,z,Q,d))}this.handleModes(W,Ye,pt,h)}else{const Se=k,ae=z,O=Q;let j=X===!1;for(;j===!1&&k<R;)for(e=this.chopInput(e,1),k++,i=0;i<L;i++){const de=V[i],U=de.pattern,ce=de.short;if(ce!==!1?w.charCodeAt(k)===ce&&(j=!0):de.isCustom===!0?j=U.exec(w,k,_,I)!==null:(this.updateLastIndex(U,k),j=U.exec(e)!==null),j===!0)break}if(v=k-Se,Q=this.computeNewColumn(Q,v),b=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(w,Se,v,ae,O),B.push({offset:Se,line:ae,column:O,length:v,message:b}),X===!1)break}}return this.hasCustom||(_.length=A),{tokens:_,groups:I,errors:B}}handleModes(e,n,r,i){if(e.pop===!0){const s=e.push;n(i),s!==void 0&&r.call(this,s)}else e.push!==void 0&&r.call(this,e.push)}chopInput(e,n){return e.substring(n)}updateLastIndex(e,n){e.lastIndex=n}updateTokenEndLineColumnLocation(e,n,r,i,s,o,a){let c,u;n!==void 0&&(c=r===a-1,u=c?-1:0,i===1&&c===!0||(e.endLine=s+u,e.endColumn=o-1+-u))}computeNewColumn(e,n){return e+n}createOffsetOnlyToken(e,n,r,i){return{image:e,startOffset:n,tokenTypeIdx:r,tokenType:i}}createStartOnlyToken(e,n,r,i,s,o){return{image:e,startOffset:n,startLine:s,startColumn:o,tokenTypeIdx:r,tokenType:i}}createFullToken(e,n,r,i,s,o,a){return{image:e,startOffset:n,endOffset:n+a-1,startLine:s,endLine:s,startColumn:o,endColumn:o+a-1,tokenTypeIdx:r,tokenType:i}}addTokenUsingPush(e,n,r){return e.push(r),n}addTokenUsingMemberAccess(e,n,r){return e[n]=r,n++,n}handlePayloadNoCustom(e,n){}handlePayloadWithCustom(e,n){n!==null&&(e.payload=n)}matchWithTest(e,n,r){return e.test(n)===!0?n.substring(r,e.lastIndex):null}matchWithExec(e,n){const r=e.exec(n);return r!==null?r[0]:null}}xn.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",xn.NA=/NOT_APPLICABLE/;function zo(t){return s$(t)?t.LABEL:t.name}function s$(t){return Cn(t.LABEL)&&t.LABEL!==""}const iz="parent",o$="categories",a$="label",c$="group",u$="push_mode",l$="pop_mode",d$="longer_alt",f$="line_breaks",p$="start_chars_hint";function h$(t){return sz(t)}function sz(t){const e=t.pattern,n={};if(n.name=t.name,oi(e)||(n.PATTERN=e),Re(t,iz))throw`The parent property is no longer supported.
57
- See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Re(t,o$)&&(n.CATEGORIES=t[o$]),Fc([n]),Re(t,a$)&&(n.LABEL=t[a$]),Re(t,c$)&&(n.GROUP=t[c$]),Re(t,l$)&&(n.POP_MODE=t[l$]),Re(t,u$)&&(n.PUSH_MODE=t[u$]),Re(t,d$)&&(n.LONGER_ALT=t[d$]),Re(t,f$)&&(n.LINE_BREAKS=t[f$]),Re(t,p$)&&(n.START_CHARS_HINT=t[p$]),n}const Fi=h$({name:"EOF",pattern:xn.NA});Fc([Fi]);function Py(t,e,n,r,i,s,o,a){return{image:e,startOffset:n,endOffset:r,startLine:i,endLine:s,startColumn:o,endColumn:a,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function m$(t,e){return Oc(t,e)}const qo={buildMismatchTokenMessage({expected:t,actual:e,previous:n,ruleName:r}){return`Expecting ${s$(t)?`--> ${zo(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",a=`
58
- but found: '`+fr(e).image+"'";if(r)return s+r+a;{const c=mn(t,(f,p)=>f.concat(p),[]),u=pe(c,f=>`[${pe(f,p=>zo(p)).join(", ")}]`),d=`one of these possible Token sequences:
59
- ${pe(u,(f,p)=>` ${p+1}. ${f}`).join(`
60
- `)}`;return s+d+a}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:n,ruleName:r}){const i="Expecting: ",o=`
61
- but found: '`+fr(e).image+"'";if(n)return i+n+o;{const c=`expecting at least one iteration which starts with one of these possible Token sequences::
62
- <${pe(t,u=>`[${pe(u,l=>zo(l)).join(",")}]`).join(" ,")}>`;return i+c+o}}};Object.freeze(qo);const oz={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
63
- inside top level rule: ->`+t.name+"<-"}},Cs={buildDuplicateFoundError(t,e){function n(l){return l instanceof gt?l.terminalType.name:l instanceof gn?l.nonTerminalName:""}const r=t.name,i=fr(e),s=i.idx,o=Or(i),a=n(i),c=s>0;let u=`->${o}${c?s:""}<- ${a?`with argument: ->${a}<-`:""}
64
- appears more than once (${e.length} times) in the top level rule: ->${r}<-.
65
- For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
66
- `;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,`
67
- `),u},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.
68
- The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
69
- To resolve this make sure each Terminal and Non-Terminal names are unique
70
- This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
71
- and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=pe(t.prefixPath,i=>zo(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
72
- in <OR${n}> inside <${t.topLevelRule.name}> Rule,
73
- <${e}> may appears as a prefix path in all these alternatives.
74
- See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
75
- For Further details.`},buildAlternationAmbiguityError(t){const e=pe(t.prefixPath,i=>zo(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${n}> inside <${t.topLevelRule.name}> Rule,
76
- <${e}> may appears as a prefix path in all these alternatives.
77
- `;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
78
- For Further details.`,r},buildEmptyRepetitionError(t){let e=Or(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
79
- This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
80
- Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
81
- <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
82
- has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,n=pe(t.leftRecursionPath,s=>s.name),r=`${e} --> ${n.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
83
- rule: <${e}> can be invoked from itself (directly or indirectly)
84
- without consuming any Tokens. The grammar path that causes this is:
85
- ${r}
86
- To fix this refactor your grammar to remove the left recursion.
87
- see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Mo?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function az(t,e){const n=new cz(t,e);return n.resolveRefs(),n.errors}class cz extends Bo{constructor(e,n){super(),this.nameToTopRule=e,this.errMsgProvider=n,this.errors=[]}resolveRefs(){Ee(qt(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const n=this.nameToTopRule[e.nonTerminalName];if(n)e.referencedRule=n;else{const r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:yn.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class uz extends Yf{constructor(e,n){super(),this.topProd=e,this.path=n,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Kt(this.path.ruleStack).reverse(),this.occurrenceStack=Kt(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,n=[]){this.found||super.walk(e,n)}walkProdRef(e,n,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=n.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){at(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class lz extends uz{constructor(e,n){super(e,n),this.path=n,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,n,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=n.concat(r),s=new An({definition:i});this.possibleTokTypes=xc(s),this.found=!0}}}class rp extends Yf{constructor(e,n){super(),this.topRule=e,this.occurrence=n,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class dz extends rp{walkMany(e,n,r){if(e.idx===this.occurrence){const i=fr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof gt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,n,r)}}class g$ extends rp{walkManySep(e,n,r){if(e.idx===this.occurrence){const i=fr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof gt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,n,r)}}class fz extends rp{walkAtLeastOne(e,n,r){if(e.idx===this.occurrence){const i=fr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof gt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,n,r)}}class y$ extends rp{walkAtLeastOneSep(e,n,r){if(e.idx===this.occurrence){const i=fr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof gt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,n,r)}}function xy(t,e,n=[]){n=Kt(n);let r=[],i=0;function s(a){return a.concat(Yt(t,i+1))}function o(a){const c=xy(s(a),e,n);return r.concat(c)}for(;n.length<e&&i<t.length;){const a=t[i];if(a instanceof An)return o(a.definition);if(a instanceof gn)return o(a.definition);if(a instanceof Xt)r=o(a.definition);else if(a instanceof Mn){const c=a.definition.concat([new St({definition:a.definition})]);return o(c)}else if(a instanceof Bn){const c=[new An({definition:a.definition}),new St({definition:[new gt({terminalType:a.separator})].concat(a.definition)})];return o(c)}else if(a instanceof _n){const c=a.definition.concat([new St({definition:[new gt({terminalType:a.separator})].concat(a.definition)})]);r=o(c)}else if(a instanceof St){const c=a.definition.concat([new St({definition:a.definition})]);r=o(c)}else{if(a instanceof Pn)return Ee(a.definition,c=>{at(c.definition)===!1&&(r=o(c.definition))}),r;if(a instanceof gt)n.push(a.terminalType);else throw Error("non exhaustive match")}i++}return r.push({partialPath:n,suffixDef:Yt(t,i)}),r}function v$(t,e,n,r){const i="EXIT_NONE_TERMINAL",s=[i],o="EXIT_ALTERNATIVE";let a=!1;const c=e.length,u=c-r-1,l=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!at(d);){const f=d.pop();if(f===o){a&&Fo(d).idx<=u&&d.pop();continue}const p=f.def,h=f.idx,v=f.ruleStack,b=f.occurrenceStack;if(at(p))continue;const g=p[0];if(g===i){const w={idx:h,def:Yt(p),ruleStack:Pc(v),occurrenceStack:Pc(b)};d.push(w)}else if(g instanceof gt)if(h<c-1){const w=h+1,R=e[w];if(n(R,g.terminalType)){const k={idx:w,def:Yt(p),ruleStack:v,occurrenceStack:b};d.push(k)}}else if(h===c-1)l.push({nextTokenType:g.terminalType,nextTokenOccurrence:g.idx,ruleStack:v,occurrenceStack:b}),a=!0;else throw Error("non exhaustive match");else if(g instanceof gn){const w=Kt(v);w.push(g.nonTerminalName);const R=Kt(b);R.push(g.idx);const k={idx:h,def:g.definition.concat(s,Yt(p)),ruleStack:w,occurrenceStack:R};d.push(k)}else if(g instanceof Xt){const w={idx:h,def:Yt(p),ruleStack:v,occurrenceStack:b};d.push(w),d.push(o);const R={idx:h,def:g.definition.concat(Yt(p)),ruleStack:v,occurrenceStack:b};d.push(R)}else if(g instanceof Mn){const w=new St({definition:g.definition,idx:g.idx}),R=g.definition.concat([w],Yt(p)),k={idx:h,def:R,ruleStack:v,occurrenceStack:b};d.push(k)}else if(g instanceof Bn){const w=new gt({terminalType:g.separator}),R=new St({definition:[w].concat(g.definition),idx:g.idx}),k=g.definition.concat([R],Yt(p)),A={idx:h,def:k,ruleStack:v,occurrenceStack:b};d.push(A)}else if(g instanceof _n){const w={idx:h,def:Yt(p),ruleStack:v,occurrenceStack:b};d.push(w),d.push(o);const R=new gt({terminalType:g.separator}),k=new St({definition:[R].concat(g.definition),idx:g.idx}),A=g.definition.concat([k],Yt(p)),N={idx:h,def:A,ruleStack:v,occurrenceStack:b};d.push(N)}else if(g instanceof St){const w={idx:h,def:Yt(p),ruleStack:v,occurrenceStack:b};d.push(w),d.push(o);const R=new St({definition:g.definition,idx:g.idx}),k=g.definition.concat([R],Yt(p)),A={idx:h,def:k,ruleStack:v,occurrenceStack:b};d.push(A)}else if(g instanceof Pn)for(let w=g.definition.length-1;w>=0;w--){const R=g.definition[w],k={idx:h,def:R.definition.concat(Yt(p)),ruleStack:v,occurrenceStack:b};d.push(k),d.push(o)}else if(g instanceof An)d.push({idx:h,def:g.definition.concat(Yt(p)),ruleStack:v,occurrenceStack:b});else if(g instanceof Mo)d.push(pz(g,h,v,b));else throw Error("non exhaustive match")}return l}function pz(t,e,n,r){const i=Kt(n);i.push(t.name);const s=Kt(r);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}var Dt;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(Dt||(Dt={}));function Iy(t){if(t instanceof Xt||t==="Option")return Dt.OPTION;if(t instanceof St||t==="Repetition")return Dt.REPETITION;if(t instanceof Mn||t==="RepetitionMandatory")return Dt.REPETITION_MANDATORY;if(t instanceof Bn||t==="RepetitionMandatoryWithSeparator")return Dt.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof _n||t==="RepetitionWithSeparator")return Dt.REPETITION_WITH_SEPARATOR;if(t instanceof Pn||t==="Alternation")return Dt.ALTERNATION;throw Error("non exhaustive match")}function w$(t){const{occurrence:e,rule:n,prodType:r,maxLookahead:i}=t,s=Iy(r);return s===Dt.ALTERNATION?ip(e,n,i):sp(e,n,s,i)}function hz(t,e,n,r,i,s){const o=ip(t,e,n),a=R$(o)?np:Oc;return s(o,r,a,i)}function mz(t,e,n,r,i,s){const o=sp(t,e,i,n),a=R$(o)?np:Oc;return s(o[0],a,r)}function gz(t,e,n,r){const i=t.length,s=dr(t,o=>dr(o,a=>a.length===1));if(e)return function(o){const a=pe(o,c=>c.GATE);for(let c=0;c<i;c++){const u=t[c],l=u.length,d=a[c];if(!(d!==void 0&&d.call(this)===!1))e:for(let f=0;f<l;f++){const p=u[f],h=p.length;for(let v=0;v<h;v++){const b=this.LA(v+1);if(n(b,p[v])===!1)continue e}return c}}};if(s&&!r){const o=pe(t,c=>Qn(c)),a=mn(o,(c,u,l)=>(Ee(u,d=>{Re(c,d.tokenTypeIdx)||(c[d.tokenTypeIdx]=l),Ee(d.categoryMatches,f=>{Re(c,f)||(c[f]=l)})}),c),{});return function(){const c=this.LA(1);return a[c.tokenTypeIdx]}}else return function(){for(let o=0;o<i;o++){const a=t[o],c=a.length;e:for(let u=0;u<c;u++){const l=a[u],d=l.length;for(let f=0;f<d;f++){const p=this.LA(f+1);if(n(p,l[f])===!1)continue e}return o}}}}function yz(t,e,n){const r=dr(t,s=>s.length===1),i=t.length;if(r&&!n){const s=Qn(t);if(s.length===1&&at(s[0].categoryMatches)){const a=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}else{const o=mn(s,(a,c,u)=>(a[c.tokenTypeIdx]=!0,Ee(c.categoryMatches,l=>{a[l]=!0}),a),[]);return function(){const a=this.LA(1);return o[a.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;s<i;s++){const o=t[s],a=o.length;for(let c=0;c<a;c++){const u=this.LA(c+1);if(e(u,o[c])===!1)continue e}return!0}return!1}}class vz extends Yf{constructor(e,n,r){super(),this.topProd=e,this.targetOccurrence=n,this.targetProdType=r}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,n,r,i){return e.idx===this.targetOccurrence&&this.targetProdType===n?(this.restDef=r.concat(i),!0):!1}walkOption(e,n,r){this.checkIsTarget(e,Dt.OPTION,n,r)||super.walkOption(e,n,r)}walkAtLeastOne(e,n,r){this.checkIsTarget(e,Dt.REPETITION_MANDATORY,n,r)||super.walkOption(e,n,r)}walkAtLeastOneSep(e,n,r){this.checkIsTarget(e,Dt.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}walkMany(e,n,r){this.checkIsTarget(e,Dt.REPETITION,n,r)||super.walkOption(e,n,r)}walkManySep(e,n,r){this.checkIsTarget(e,Dt.REPETITION_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}}class b$ extends Bo{constructor(e,n,r){super(),this.targetOccurrence=e,this.targetProdType=n,this.targetRef=r,this.result=[]}checkIsTarget(e,n){e.idx===this.targetOccurrence&&this.targetProdType===n&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,Dt.OPTION)}visitRepetition(e){this.checkIsTarget(e,Dt.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,Dt.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,Dt.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,Dt.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,Dt.ALTERNATION)}}function D$(t){const e=new Array(t);for(let n=0;n<t;n++)e[n]=[];return e}function Ny(t){let e=[""];for(let n=0;n<t.length;n++){const r=t[n],i=[];for(let s=0;s<e.length;s++){const o=e[s];i.push(o+"_"+r.tokenTypeIdx);for(let a=0;a<r.categoryMatches.length;a++){const c="_"+r.categoryMatches[a];i.push(o+c)}}e=i}return e}function wz(t,e,n){for(let r=0;r<t.length;r++){if(r===n)continue;const i=t[r];for(let s=0;s<e.length;s++){const o=e[s];if(i[o]===!0)return!1}}return!0}function E$(t,e){const n=pe(t,o=>xy([o],1)),r=D$(n.length),i=pe(n,o=>{const a={};return Ee(o,c=>{const u=Ny(c.partialPath);Ee(u,l=>{a[l]=!0})}),a});let s=n;for(let o=1;o<=e;o++){const a=s;s=D$(a.length);for(let c=0;c<a.length;c++){const u=a[c];for(let l=0;l<u.length;l++){const d=u[l].partialPath,f=u[l].suffixDef,p=Ny(d);if(wz(i,p,c)||at(f)||d.length===e){const v=r[c];if(Oy(v,d)===!1){v.push(d);for(let b=0;b<p.length;b++){const g=p[b];i[c][g]=!0}}}else{const v=xy(f,o+1,d);s[c]=s[c].concat(v),Ee(v,b=>{const g=Ny(b.partialPath);Ee(g,w=>{i[c][w]=!0})})}}}}return r}function ip(t,e,n,r){const i=new b$(t,Dt.ALTERNATION,r);return e.accept(i),E$(i.result,n)}function sp(t,e,n,r){const i=new b$(t,n);e.accept(i);const s=i.result,a=new vz(e,t,n).startWalking(),c=new An({definition:s}),u=new An({definition:a});return E$([c,u],r)}function Oy(t,e){e:for(let n=0;n<t.length;n++){const r=t[n];if(r.length===e.length){for(let i=0;i<r.length;i++){const s=e[i],o=r[i];if((s===o||o.categoryMatchesMap[s.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function bz(t,e){return t.length<e.length&&dr(t,(n,r)=>{const i=e[r];return n===i||i.categoryMatchesMap[n.tokenTypeIdx]})}function R$(t){return dr(t,e=>dr(e,n=>dr(n,r=>at(r.categoryMatches))))}function Dz(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return pe(e,n=>Object.assign({type:yn.CUSTOM_LOOKAHEAD_VALIDATION},n))}function Ez(t,e,n,r){const i=Ln(t,c=>Rz(c,n)),s=Oz(t,e,n),o=Ln(t,c=>Pz(c,n)),a=Ln(t,c=>Sz(c,t,r,n));return i.concat(s,o,a)}function Rz(t,e){const n=new Tz;t.accept(n);const r=n.allProductions,i=B4(r,$z),s=pr(i,a=>a.length>1);return pe(qt(s),a=>{const c=fr(a),u=e.buildDuplicateFoundError(t,a),l=Or(c),d={message:u,type:yn.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:l,occurrence:c.idx},f=$$(c);return f&&(d.parameter=f),d})}function $z(t){return`${Or(t)}_#_${t.idx}_#_${$$(t)}`}function $$(t){return t instanceof gt?t.terminalType.name:t instanceof gn?t.nonTerminalName:""}class Tz extends Bo{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function Sz(t,e,n,r){const i=[];if(mn(e,(o,a)=>a.name===t.name?o+1:o,0)>1){const o=r.buildDuplicateRuleNameError({topLevelRule:t,grammarName:n});i.push({message:o,type:yn.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function kz(t,e,n){const r=[];let i;return hn(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:yn.INVALID_RULE_OVERRIDE,ruleName:t})),r}function T$(t,e,n,r=[]){const i=[],s=op(e.definition);if(at(s))return[];{const o=t.name;hn(s,t)&&i.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:r}),type:yn.LEFT_RECURSION,ruleName:o});const c=Wf(s,r.concat([t])),u=Ln(c,l=>{const d=Kt(r);return d.push(l),T$(t,l,n,d)});return i.concat(u)}}function op(t){let e=[];if(at(t))return e;const n=fr(t);if(n instanceof gn)e.push(n.referencedRule);else if(n instanceof An||n instanceof Xt||n instanceof Mn||n instanceof Bn||n instanceof _n||n instanceof St)e=e.concat(op(n.definition));else if(n instanceof Pn)e=Qn(pe(n.definition,s=>op(s.definition)));else if(!(n instanceof gt))throw Error("non exhaustive match");const r=Kf(n),i=t.length>1;if(r&&i){const s=Yt(t);return e.concat(op(s))}else return e}class Fy extends Bo{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function Cz(t,e){const n=new Fy;t.accept(n);const r=n.alternations;return Ln(r,s=>{const o=Pc(s.definition);return Ln(o,(a,c)=>{const u=v$([a],[],Oc,1);return at(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:c}),type:yn.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:c+1}]:[]})})}function Az(t,e,n){const r=new Fy;t.accept(r);let i=r.alternations;return i=Hf(i,o=>o.ignoreAmbiguities===!0),Ln(i,o=>{const a=o.idx,c=o.maxLookahead||e,u=ip(a,t,c,o),l=Iz(u,o,t,n),d=Nz(u,o,t,n);return l.concat(d)})}class _z extends Bo{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}function Pz(t,e){const n=new Fy;t.accept(n);const r=n.alternations;return Ln(r,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:yn.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}function xz(t,e,n){const r=[];return Ee(t,i=>{const s=new _z;i.accept(s);const o=s.allProductions;Ee(o,a=>{const c=Iy(a),u=a.maxLookahead||e,l=a.idx,f=sp(l,i,c,u)[0];if(at(Qn(f))){const p=n.buildEmptyRepetitionError({topLevelRule:i,repetition:a});r.push({message:p,type:yn.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),r}function Iz(t,e,n,r){const i=[],s=mn(t,(a,c,u)=>(e.definition[u].ignoreAmbiguities===!0||Ee(c,l=>{const d=[u];Ee(t,(f,p)=>{u!==p&&Oy(f,l)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!Oy(i,l)&&(i.push(l),a.push({alts:d,path:l}))}),a),[]);return pe(s,a=>{const c=pe(a.alts,l=>l+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:c,prefixPath:a.path}),type:yn.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:e.idx,alternatives:a.alts}})}function Nz(t,e,n,r){const i=mn(t,(o,a,c)=>{const u=pe(a,l=>({idx:c,path:l}));return o.concat(u)},[]);return _c(Ln(i,o=>{if(e.definition[o.idx].ignoreAmbiguities===!0)return[];const c=o.idx,u=o.path,l=Fn(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx<c&&bz(f.path,u));return pe(l,f=>{const p=[f.idx+1,c+1],h=e.idx===0?"":e.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:yn.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:h,alternatives:p}})}))}function Oz(t,e,n){const r=[],i=pe(e,s=>s.name);return Ee(t,s=>{const o=s.name;if(hn(i,o)){const a=n.buildNamespaceConflictError(s);r.push({message:a,type:yn.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:o})}}),r}function Fz(t){const e=Ry(t,{errMsgProvider:oz}),n={};return Ee(t.rules,r=>{n[r.name]=r}),az(n,e.errMsgProvider)}function Lz(t){return t=Ry(t,{errMsgProvider:Cs}),Ez(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}const S$="MismatchedTokenException",k$="NoViableAltException",C$="EarlyExitException",A$="NotAllInputParsedException",_$=[S$,k$,C$,A$];Object.freeze(_$);function ap(t){return hn(_$,t.name)}class cp extends Error{constructor(e,n){super(e),this.token=n,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class P$ extends cp{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=S$}}class Mz extends cp{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=k$}}class Bz extends cp{constructor(e,n){super(e,n),this.name=A$}}class zz extends cp{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=C$}}const Ly={},x$="InRuleRecoveryException";class qz extends Error{constructor(e){super(e),this.name=x$}}class jz{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Re(e,"recoveryEnabled")?e.recoveryEnabled:ai.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Uz)}getTokenToInsert(e){const n=Py(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return n.isInsertedInRecovery=!0,n}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,n,r,i){const s=this.findReSyncTokenType(),o=this.exportLexerState(),a=[];let c=!1;const u=this.LA(1);let l=this.LA(1);const d=()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),h=new P$(p,u,this.LA(0));h.resyncedTokens=Pc(a),this.SAVE_ERROR(h)};for(;!c;)if(this.tokenMatcher(l,i)){d();return}else if(r.call(this)){d(),e.apply(this,n);return}else this.tokenMatcher(l,s)?c=!0:(l=this.SKIP_TOKEN(),this.addToResyncTokens(l,a));this.importLexerState(o)}shouldInRepetitionRecoveryBeTried(e,n,r){return!(r===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,n)))}getFollowsForInRuleRecovery(e,n){const r=this.getCurrentGrammarPath(e,n);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(e,n){if(this.canRecoverWithSingleTokenInsertion(e,n))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new qz("sad sad panda")}canPerformInRuleRecovery(e,n){return this.canRecoverWithSingleTokenInsertion(e,n)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,n){if(!this.canTokenTypeBeInsertedInRecovery(e)||at(n))return!1;const r=this.LA(1);return Lo(n,s=>this.tokenMatcher(r,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const n=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(n);return hn(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let n=this.LA(1),r=2;for(;;){const i=Lo(e,s=>m$(n,s));if(i!==void 0)return i;n=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Ly;const e=this.getLastExplicitRuleShortName(),n=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:n,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return pe(e,(r,i)=>i===0?Ly:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:n[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=pe(this.buildFullFollowKeyStack(),n=>this.getFollowSetFromFollowKey(n));return Qn(e)}getFollowSetFromFollowKey(e){if(e===Ly)return[Fi];const n=e.ruleName+e.idxInCallingRule+WR+e.inRule;return this.resyncFollows[n]}addToResyncTokens(e,n){return this.tokenMatcher(e,Fi)||n.push(e),n}reSyncTo(e){const n=[];let r=this.LA(1);for(;this.tokenMatcher(r,e)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,n);return Pc(n)}attemptInRepetitionRecovery(e,n,r,i,s,o,a){}getCurrentGrammarPath(e,n){const r=this.getHumanReadableRuleStack(),i=Kt(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:i,lastTok:e,lastTokOccurrence:n}}getHumanReadableRuleStack(){return pe(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function Uz(t,e,n,r,i,s,o){const a=this.getKeyForAutomaticLookahead(r,i);let c=this.firstAfterRepMap[a];if(c===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];c=new s(p,i).startWalking(),this.firstAfterRepMap[a]=c}let u=c.token,l=c.occurrence;const d=c.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=Fi,l=1),!(u===void 0||l===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,l,o)&&this.tryInRepetitionRecovery(t,e,n,u)}const Gz=4,Li=8,I$=1<<Li,N$=2<<Li,My=3<<Li,By=4<<Li,zy=5<<Li,up=6<<Li;function qy(t,e,n){return n|e|t}class jy{constructor(e){var n;this.maxLookahead=(n=e?.maxLookahead)!==null&&n!==void 0?n:ai.maxLookahead}validate(e){const n=this.validateNoLeftRecursion(e.rules);if(at(n)){const r=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),s=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...n,...r,...i,...s]}return n}validateNoLeftRecursion(e){return Ln(e,n=>T$(n,n,Cs))}validateEmptyOrAlternatives(e){return Ln(e,n=>Cz(n,Cs))}validateAmbiguousAlternationAlternatives(e,n){return Ln(e,r=>Az(r,n,Cs))}validateSomeNonEmptyLookaheadPath(e,n){return xz(e,n,Cs)}buildLookaheadForAlternation(e){return hz(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,gz)}buildLookaheadForOptional(e){return mz(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Iy(e.prodType),yz)}}class Wz{initLooksAhead(e){this.dynamicTokensEnabled=Re(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:ai.dynamicTokensEnabled,this.maxLookahead=Re(e,"maxLookahead")?e.maxLookahead:ai.maxLookahead,this.lookaheadStrategy=Re(e,"lookaheadStrategy")?e.lookaheadStrategy:new jy({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){Ee(e,n=>{this.TRACE_INIT(`${n.name} Rule Lookahead`,()=>{const{alternation:r,repetition:i,option:s,repetitionMandatory:o,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:c}=Vz(n);Ee(r,u=>{const l=u.idx===0?"":u.idx;this.TRACE_INIT(`${Or(u)}${l}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:n,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=qy(this.fullRuleNameToShort[n.name],I$,u.idx);this.setLaFuncCache(f,d)})}),Ee(i,u=>{this.computeLookaheadFunc(n,u.idx,My,"Repetition",u.maxLookahead,Or(u))}),Ee(s,u=>{this.computeLookaheadFunc(n,u.idx,N$,"Option",u.maxLookahead,Or(u))}),Ee(o,u=>{this.computeLookaheadFunc(n,u.idx,By,"RepetitionMandatory",u.maxLookahead,Or(u))}),Ee(a,u=>{this.computeLookaheadFunc(n,u.idx,up,"RepetitionMandatoryWithSeparator",u.maxLookahead,Or(u))}),Ee(c,u=>{this.computeLookaheadFunc(n,u.idx,zy,"RepetitionWithSeparator",u.maxLookahead,Or(u))})})})}computeLookaheadFunc(e,n,r,i,s,o){this.TRACE_INIT(`${o}${n===0?"":n}`,()=>{const a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:n,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),c=qy(this.fullRuleNameToShort[e.name],r,n);this.setLaFuncCache(c,a)})}getKeyForAutomaticLookahead(e,n){const r=this.getLastExplicitRuleShortName();return qy(r,e,n)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,n){this.lookAheadFuncsCache.set(e,n)}}class Hz extends Bo{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}}const lp=new Hz;function Vz(t){lp.reset(),t.accept(lp);const e=lp.dslMethods;return lp.reset(),e}function O$(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function F$(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function Kz(t,e,n){t.children[n]===void 0?t.children[n]=[e]:t.children[n].push(e)}function Yz(t,e,n){t.children[e]===void 0?t.children[e]=[n]:t.children[e].push(n)}const Xz="name";function L$(t,e){Object.defineProperty(t,Xz,{enumerable:!1,configurable:!0,writable:!1,value:e})}function Jz(t,e){const n=Zn(t),r=n.length;for(let i=0;i<r;i++){const s=n[i],o=t[s],a=o.length;for(let c=0;c<a;c++){const u=o[c];u.tokenTypeIdx===void 0&&this[u.name](u.children,e)}}}function Zz(t,e){const n=function(){};L$(n,t+"BaseSemantics");const r={visit:function(i,s){if(We(i)&&(i=i[0]),!oi(i))return this[i.name](i.children,s)},validateVisitor:function(){const i=e5(this,e);if(!at(i)){const s=pe(i,o=>o.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
88
- ${s.join(`
89
-
90
- `).replace(/\n/g,`
91
- `)}`)}}};return n.prototype=r,n.prototype.constructor=n,n._RULE_NAMES=e,n}function Qz(t,e,n){const r=function(){};L$(r,t+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return Ee(e,s=>{i[s]=Jz}),r.prototype=i,r.prototype.constructor=r,r}var Uy;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Uy||(Uy={}));function e5(t,e){return t5(t,e)}function t5(t,e){const n=Fn(e,i=>ni(t[i])===!1),r=pe(n,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:Uy.MISSING_METHOD,methodName:i}));return _c(r)}class n5{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Re(e,"nodeLocationTracking")?e.nodeLocationTracking:ai.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=zt,this.cstFinallyStateUpdate=zt,this.cstPostTerminal=zt,this.cstPostNonTerminal=zt,this.cstPostRule=zt;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=F$,this.setNodeLocationFromNode=F$,this.cstPostRule=zt,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=zt,this.setNodeLocationFromNode=zt,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=O$,this.setNodeLocationFromNode=O$,this.cstPostRule=zt,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=zt,this.setNodeLocationFromNode=zt,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=zt,this.setNodeLocationFromNode=zt,this.cstPostRule=zt,this.setInitialNodeLocation=zt;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const n=this.LA(1);e.location={startOffset:n.startOffset,startLine:n.startLine,startColumn:n.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const n={name:e,children:Object.create(null)};this.setInitialNodeLocation(n),this.CST_STACK.push(n)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?(r.endOffset=n.endOffset,r.endLine=n.endLine,r.endColumn=n.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)}cstPostRuleOnlyOffset(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?r.endOffset=n.endOffset:r.startOffset=NaN}cstPostTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];Kz(r,n,e),this.setNodeLocationFromToken(r.location,n)}cstPostNonTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];Yz(r,n,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(oi(this.baseCstVisitorConstructor)){const e=Zz(this.className,Zn(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(oi(this.baseCstVisitorWithDefaultsConstructor)){const e=Qz(this.className,Zn(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}}class r5{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):pp}LA(e){const n=this.currIdx+e;return n<0||this.tokVectorLength<=n?pp:this.tokVector[n]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}}class i5{ACTION(e){return e.call(this)}consume(e,n,r){return this.consumeInternal(n,e,r)}subrule(e,n,r){return this.subruleInternal(n,e,r)}option(e,n){return this.optionInternal(n,e)}or(e,n){return this.orInternal(n,e)}many(e,n){return this.manyInternal(e,n)}atLeastOne(e,n){return this.atLeastOneInternal(e,n)}CONSUME(e,n){return this.consumeInternal(e,0,n)}CONSUME1(e,n){return this.consumeInternal(e,1,n)}CONSUME2(e,n){return this.consumeInternal(e,2,n)}CONSUME3(e,n){return this.consumeInternal(e,3,n)}CONSUME4(e,n){return this.consumeInternal(e,4,n)}CONSUME5(e,n){return this.consumeInternal(e,5,n)}CONSUME6(e,n){return this.consumeInternal(e,6,n)}CONSUME7(e,n){return this.consumeInternal(e,7,n)}CONSUME8(e,n){return this.consumeInternal(e,8,n)}CONSUME9(e,n){return this.consumeInternal(e,9,n)}SUBRULE(e,n){return this.subruleInternal(e,0,n)}SUBRULE1(e,n){return this.subruleInternal(e,1,n)}SUBRULE2(e,n){return this.subruleInternal(e,2,n)}SUBRULE3(e,n){return this.subruleInternal(e,3,n)}SUBRULE4(e,n){return this.subruleInternal(e,4,n)}SUBRULE5(e,n){return this.subruleInternal(e,5,n)}SUBRULE6(e,n){return this.subruleInternal(e,6,n)}SUBRULE7(e,n){return this.subruleInternal(e,7,n)}SUBRULE8(e,n){return this.subruleInternal(e,8,n)}SUBRULE9(e,n){return this.subruleInternal(e,9,n)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,n,r=hp){if(hn(this.definedRulesNames,e)){const o={message:Cs.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:yn.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(o)}this.definedRulesNames.push(e);const i=this.defineRule(e,n,r);return this[e]=i,i}OVERRIDE_RULE(e,n,r=hp){const i=kz(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const s=this.defineRule(e,n,r);return this[e]=s,s}BACKTRACK(e,n){return function(){this.isBackTrackingStack.push(1);const r=this.saveRecogState();try{return e.apply(this,n),!0}catch(i){if(ap(i))return!1;throw i}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return p6(qt(this.gastProductionsCache))}}class s5{initRecognizerEngine(e,n){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=np,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Re(n,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
92
- See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
93
- For Further details.`);if(We(e)){if(at(e))throw Error(`A Token Vocabulary cannot be empty.
94
- Note that the first argument for the parser constructor
95
- is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
96
- See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
97
- For Further details.`)}if(We(e))this.tokensMap=mn(e,(s,o)=>(s[o.name]=o,s),{});else if(Re(e,"modes")&&dr(Qn(qt(e.modes)),rz)){const s=Qn(qt(e.modes)),o=$y(s);this.tokensMap=mn(o,(a,c)=>(a[c.name]=c,a),{})}else if(Jn(e))this.tokensMap=Kt(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Fi;const r=Re(e,"modes")?Qn(qt(e.modes)):qt(e),i=dr(r,s=>at(s.categoryMatches));this.tokenMatcher=i?np:Oc,Fc(qt(this.tokensMap))}defineRule(e,n,r){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
98
- Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=Re(r,"resyncEnabled")?r.resyncEnabled:hp.resyncEnabled,s=Re(r,"recoveryValueFunc")?r.recoveryValueFunc:hp.recoveryValueFunc,o=this.ruleShortNameIdx<<Gz+Li;this.ruleShortNameIdx++,this.shortRuleNameToFull[o]=e,this.fullRuleNameToShort[e]=o;let a;return this.outputCst===!0?a=function(...l){try{this.ruleInvocationStateUpdate(o,e,this.subruleIdx),n.apply(this,l);const d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}catch(d){return this.invokeRuleCatch(d,i,s)}finally{this.ruleFinallyStateUpdate()}}:a=function(...l){try{return this.ruleInvocationStateUpdate(o,e,this.subruleIdx),n.apply(this,l)}catch(d){return this.invokeRuleCatch(d,i,s)}finally{this.ruleFinallyStateUpdate()}},Object.assign(a,{ruleName:e,originalGrammarAction:n})}invokeRuleCatch(e,n,r){const i=this.RULE_STACK.length===1,s=n&&!this.isBackTracking()&&this.recoveryEnabled;if(ap(e)){const o=e;if(s){const a=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))if(o.resyncedTokens=this.reSyncTo(a),this.outputCst){const c=this.CST_STACK[this.CST_STACK.length-1];return c.recoveredNode=!0,c}else return r(e);else{if(this.outputCst){const c=this.CST_STACK[this.CST_STACK.length-1];c.recoveredNode=!0,o.partialCstResult=c}throw o}}else{if(i)return this.moveToTerminatedState(),r(e);throw o}}else throw e}optionInternal(e,n){const r=this.getKeyForAutomaticLookahead(N$,n);return this.optionInternalLogic(e,n,r)}optionInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof e!="function"){s=e.DEF;const o=e.GATE;if(o!==void 0){const a=i;i=()=>o.call(this)&&a.call(this)}}else s=e;if(i.call(this)===!0)return s.call(this)}atLeastOneInternal(e,n){const r=this.getKeyForAutomaticLookahead(By,e);return this.atLeastOneInternalLogic(e,n,r)}atLeastOneInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const o=n.GATE;if(o!==void 0){const a=i;i=()=>o.call(this)&&a.call(this)}}else s=n;if(i.call(this)===!0){let o=this.doSingleRepetition(s);for(;i.call(this)===!0&&o===!0;)o=this.doSingleRepetition(s)}else throw this.raiseEarlyExitException(e,Dt.REPETITION_MANDATORY,n.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,n],i,By,e,fz)}atLeastOneSepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(up,e);this.atLeastOneSepFirstInternalLogic(e,n,r)}atLeastOneSepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){i.call(this);const a=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,a,i,y$],a,up,e,y$)}else throw this.raiseEarlyExitException(e,Dt.REPETITION_MANDATORY_WITH_SEPARATOR,n.ERR_MSG)}manyInternal(e,n){const r=this.getKeyForAutomaticLookahead(My,e);return this.manyInternalLogic(e,n,r)}manyInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const a=n.GATE;if(a!==void 0){const c=i;i=()=>a.call(this)&&c.call(this)}}else s=n;let o=!0;for(;i.call(this)===!0&&o===!0;)o=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[e,n],i,My,e,dz,o)}manySepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(zy,e);this.manySepFirstInternalLogic(e,n,r)}manySepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){i.call(this);const a=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,a,i,g$],a,zy,e,g$)}}repetitionSepSecondInternal(e,n,r,i,s){for(;r();)this.CONSUME(n),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,n,r,i,s],r,up,e,s)}doSingleRepetition(e){const n=this.getLexerPosition();return e.call(this),this.getLexerPosition()>n}orInternal(e,n){const r=this.getKeyForAutomaticLookahead(I$,n),i=We(e)?e:e.DEF,o=this.getLaFuncFromCache(r).call(this,i);if(o!==void 0)return i[o].ALT.call(this);this.raiseNoAltException(n,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),n=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Bz(n,e))}}subruleInternal(e,n,r){let i;try{const s=r!==void 0?r.ARGS:void 0;return this.subruleIdx=n,i=e.apply(this,s),this.cstPostNonTerminal(i,r!==void 0&&r.LABEL!==void 0?r.LABEL:e.ruleName),i}catch(s){throw this.subruleInternalError(s,r,e.ruleName)}}subruleInternalError(e,n,r){throw ap(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,n!==void 0&&n.LABEL!==void 0?n.LABEL:r),delete e.partialCstResult),e}consumeInternal(e,n,r){let i;try{const s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),i=s):this.consumeInternalError(e,s,r)}catch(s){i=this.consumeInternalRecovery(e,n,s)}return this.cstPostTerminal(r!==void 0&&r.LABEL!==void 0?r.LABEL:e.name,i),i}consumeInternalError(e,n,r){let i;const s=this.LA(0);throw r!==void 0&&r.ERR_MSG?i=r.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:n,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new P$(i,n,s))}consumeInternalRecovery(e,n,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,n);try{return this.tryInRuleRecovery(e,i)}catch(s){throw s.name===x$?r:s}}else throw r}saveRecogState(){const e=this.errors,n=Kt(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:n,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,n,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(n)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Fi)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class o5{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Re(e,"errorMessageProvider")?e.errorMessageProvider:ai.errorMessageProvider}SAVE_ERROR(e){if(ap(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Kt(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Kt(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,n,r){const i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],a=sp(e,s,n,this.maxLookahead)[0],c=[];for(let l=1;l<=this.maxLookahead;l++)c.push(this.LA(l));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:c,previous:this.LA(0),customUserDescription:r,ruleName:i});throw this.SAVE_ERROR(new zz(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,n){const r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],s=ip(e,i,this.maxLookahead),o=[];for(let u=1;u<=this.maxLookahead;u++)o.push(this.LA(u));const a=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:o,previous:a,customUserDescription:n,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Mz(c,this.LA(1),a))}}class a5{initContentAssist(){}computeContentAssist(e,n){const r=this.gastProductionsCache[e];if(oi(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return v$([r],n,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const n=fr(e.ruleStack),i=this.getGAstProductions()[n];return new lz(i,e).startWalking()}}const dp={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(dp);const M$=!0,B$=Math.pow(2,Li)-1,z$=h$({name:"RECORDING_PHASE_TOKEN",pattern:xn.NA});Fc([z$]);const q$=Py(z$,`This IToken indicates the Parser is in Recording Phase
99
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(q$);const c5={name:`This CSTNode indicates the Parser is in Recording Phase
100
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};class u5{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const n=e>0?e:"";this[`CONSUME${n}`]=function(r,i){return this.consumeInternalRecord(r,e,i)},this[`SUBRULE${n}`]=function(r,i){return this.subruleInternalRecord(r,e,i)},this[`OPTION${n}`]=function(r){return this.optionInternalRecord(r,e)},this[`OR${n}`]=function(r){return this.orInternalRecord(r,e)},this[`MANY${n}`]=function(r){this.manyInternalRecord(e,r)},this[`MANY_SEP${n}`]=function(r){this.manySepFirstInternalRecord(e,r)},this[`AT_LEAST_ONE${n}`]=function(r){this.atLeastOneInternalRecord(e,r)},this[`AT_LEAST_ONE_SEP${n}`]=function(r){this.atLeastOneSepFirstInternalRecord(e,r)}}this.consume=function(e,n,r){return this.consumeInternalRecord(n,e,r)},this.subrule=function(e,n,r){return this.subruleInternalRecord(n,e,r)},this.option=function(e,n){return this.optionInternalRecord(n,e)},this.or=function(e,n){return this.orInternalRecord(n,e)},this.many=function(e,n){this.manyInternalRecord(e,n)},this.atLeastOne=function(e,n){this.atLeastOneInternalRecord(e,n)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let n=0;n<10;n++){const r=n>0?n:"";delete e[`CONSUME${r}`],delete e[`SUBRULE${r}`],delete e[`OPTION${r}`],delete e[`OR${r}`],delete e[`MANY${r}`],delete e[`MANY_SEP${r}`],delete e[`AT_LEAST_ONE${r}`],delete e[`AT_LEAST_ONE_SEP${r}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,n){return()=>!0}LA_RECORD(e){return pp}topLevelRuleRecord(e,n){try{const r=new Mo({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),n.call(this),this.recordingProdStack.pop(),r}catch(r){if(r.KNOWN_RECORDER_ERROR!==!0)try{r.message=r.message+`
101
- This error was thrown during the "grammar recording phase" For more info see:
102
- https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw r}throw r}}optionInternalRecord(e,n){return Mc.call(this,Xt,e,n)}atLeastOneInternalRecord(e,n){Mc.call(this,Mn,n,e)}atLeastOneSepFirstInternalRecord(e,n){Mc.call(this,Bn,n,e,M$)}manyInternalRecord(e,n){Mc.call(this,St,n,e)}manySepFirstInternalRecord(e,n){Mc.call(this,_n,n,e,M$)}orInternalRecord(e,n){return l5.call(this,e,n)}subruleInternalRecord(e,n,r){if(fp(n),!e||Re(e,"ruleName")===!1){const a=new Error(`<SUBRULE${j$(n)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
103
- inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}const i=Fo(this.recordingProdStack),s=e.ruleName,o=new gn({idx:n,nonTerminalName:s,label:r?.LABEL,referencedRule:void 0});return i.definition.push(o),this.outputCst?c5:dp}consumeInternalRecord(e,n,r){if(fp(n),!r$(e)){const o=new Error(`<CONSUME${j$(n)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
104
- inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=Fo(this.recordingProdStack),s=new gt({idx:n,terminalType:e,label:r?.LABEL});return i.definition.push(s),q$}}function Mc(t,e,n,r=!1){fp(n);const i=Fo(this.recordingProdStack),s=ni(e)?e:e.DEF,o=new t({definition:[],idx:n});return r&&(o.separator=e.SEP),Re(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),i.definition.push(o),this.recordingProdStack.pop(),dp}function l5(t,e){fp(e);const n=Fo(this.recordingProdStack),r=We(t)===!1,i=r===!1?t:t.DEF,s=new Pn({definition:[],idx:e,ignoreAmbiguities:r&&t.IGNORE_AMBIGUITIES===!0});Re(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);const o=BR(i,a=>ni(a.GATE));return s.hasPredicates=o,n.definition.push(s),Ee(i,a=>{const c=new An({definition:[]});s.definition.push(c),Re(a,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:Re(a,"GATE")&&(c.ignoreAmbiguities=!0),this.recordingProdStack.push(c),a.ALT.call(this),this.recordingProdStack.pop()}),dp}function j$(t){return t===0?"":`${t}`}function fp(t){if(t<0||t>B$){const e=new Error(`Invalid DSL Method idx value: <${t}>
105
- Idx value must be a none negative value smaller than ${B$+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class d5{initPerformanceTracer(e){if(Re(e,"traceInitPerf")){const n=e.traceInitPerf,r=typeof n=="number";this.traceInitMaxIdent=r?n:1/0,this.traceInitPerf=r?n>0:n}else this.traceInitMaxIdent=0,this.traceInitPerf=ai.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,n){if(this.traceInitPerf===!0){this.traceInitIndent++;const r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${r}--> <${e}>`);const{time:i,value:s}=jR(n),o=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&o(`${r}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,s}else return n()}}function f5(t,e){e.forEach(n=>{const r=n.prototype;Object.getOwnPropertyNames(r).forEach(i=>{if(i==="constructor")return;const s=Object.getOwnPropertyDescriptor(r,i);s&&(s.get||s.set)?Object.defineProperty(t.prototype,i,s):t.prototype[i]=n.prototype[i]})})}const pp=Py(Fi,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(pp);const ai=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:qo,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),hp=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var yn;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(yn||(yn={}));function U$(t=void 0){return function(){return t}}class Gd{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const n=this.className;this.TRACE_INIT("toFastProps",()=>{UR(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),Ee(this.definedRulesNames,i=>{const o=this[i].originalGrammarAction;let a;this.TRACE_INIT(`${i} Rule`,()=>{a=this.topLevelRuleRecord(i,o)}),this.gastProductionsCache[i]=a})}finally{this.disableRecording()}});let r=[];if(this.TRACE_INIT("Grammar Resolving",()=>{r=Fz({rules:qt(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT("Grammar Validations",()=>{if(at(r)&&this.skipValidations===!1){const i=Lz({rules:qt(this.gastProductionsCache),tokenTypes:qt(this.tokensMap),errMsgProvider:Cs,grammarName:n}),s=Dz({lookaheadStrategy:this.lookaheadStrategy,rules:qt(this.gastProductionsCache),tokenTypes:qt(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(i,s)}}),at(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=b6(qt(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,s;(s=(i=this.lookaheadStrategy).initialize)===null||s===void 0||s.call(i,{rules:qt(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(qt(this.gastProductionsCache))})),!Gd.DEFER_DEFINITION_ERRORS_HANDLING&&!at(this.definitionErrors))throw e=pe(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
106
- ${e.join(`
107
- -------------------------------
108
- `)}`)})}constructor(e,n){this.definitionErrors=[],this.selfAnalysisDone=!1;const r=this;if(r.initErrorHandler(n),r.initLexerAdapter(),r.initLooksAhead(n),r.initRecognizerEngine(e,n),r.initRecoverable(n),r.initTreeBuilder(n),r.initContentAssist(),r.initGastRecorder(n),r.initPerformanceTracer(n),Re(n,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
109
- Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
110
- See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
111
- For further details.`);this.skipValidations=Re(n,"skipValidations")?n.skipValidations:ai.skipValidations}}Gd.DEFER_DEFINITION_ERRORS_HANDLING=!1,f5(Gd,[jz,Wz,n5,r5,s5,i5,o5,a5,u5,d5]);class p5 extends Gd{constructor(e,n=ai){const r=Kt(n);r.outputCst=!1,super(e,r)}}function jo(t,e,n){return`${t.name}_${e}_${n}`}const Mi=1,h5=2,G$=4,W$=5,Bc=7,m5=8,g5=9,y5=10,v5=11,H$=12;class Gy{constructor(e){this.target=e}isEpsilon(){return!1}}class Wy extends Gy{constructor(e,n){super(e),this.tokenType=n}}class V$ extends Gy{constructor(e){super(e)}isEpsilon(){return!0}}class Hy extends Gy{constructor(e,n,r){super(e),this.rule=n,this.followState=r}isEpsilon(){return!0}}function w5(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};b5(e,t);const n=t.length;for(let r=0;r<n;r++){const i=t[r],s=As(e,i,i);s!==void 0&&P5(e,i,s)}return e}function b5(t,e){const n=e.length;for(let r=0;r<n;r++){const i=e[r],s=Wt(t,i,void 0,{type:h5}),o=Wt(t,i,void 0,{type:Bc});s.stop=o,t.ruleToStartState.set(i,s),t.ruleToStopState.set(i,o)}}function K$(t,e,n){return n instanceof gt?Vy(t,e,n.terminalType,n):n instanceof gn?_5(t,e,n):n instanceof Pn?T5(t,e,n):n instanceof Xt?S5(t,e,n):n instanceof St?D5(t,e,n):n instanceof _n?E5(t,e,n):n instanceof Mn?R5(t,e,n):n instanceof Bn?$5(t,e,n):As(t,e,n)}function D5(t,e,n){const r=Wt(t,e,n,{type:W$});Bi(t,r);const i=Uo(t,e,r,n,As(t,e,n));return X$(t,e,n,i)}function E5(t,e,n){const r=Wt(t,e,n,{type:W$});Bi(t,r);const i=Uo(t,e,r,n,As(t,e,n)),s=Vy(t,e,n.separator,n);return X$(t,e,n,i,s)}function R5(t,e,n){const r=Wt(t,e,n,{type:G$});Bi(t,r);const i=Uo(t,e,r,n,As(t,e,n));return Y$(t,e,n,i)}function $5(t,e,n){const r=Wt(t,e,n,{type:G$});Bi(t,r);const i=Uo(t,e,r,n,As(t,e,n)),s=Vy(t,e,n.separator,n);return Y$(t,e,n,i,s)}function T5(t,e,n){const r=Wt(t,e,n,{type:Mi});Bi(t,r);const i=pe(n.definition,o=>K$(t,e,o));return Uo(t,e,r,n,...i)}function S5(t,e,n){const r=Wt(t,e,n,{type:Mi});Bi(t,r);const i=Uo(t,e,r,n,As(t,e,n));return k5(t,e,n,i)}function As(t,e,n){const r=Fn(pe(n.definition,i=>K$(t,e,i)),i=>i!==void 0);return r.length===1?r[0]:r.length===0?void 0:A5(t,r)}function Y$(t,e,n,r,i){const s=r.left,o=r.right,a=Wt(t,e,n,{type:v5});Bi(t,a);const c=Wt(t,e,n,{type:H$});return s.loopback=a,c.loopback=a,t.decisionMap[jo(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",n.idx)]=a,Ot(o,a),i===void 0?(Ot(a,s),Ot(a,c)):(Ot(a,c),Ot(a,i.left),Ot(i.right,s)),{left:s,right:c}}function X$(t,e,n,r,i){const s=r.left,o=r.right,a=Wt(t,e,n,{type:y5});Bi(t,a);const c=Wt(t,e,n,{type:H$}),u=Wt(t,e,n,{type:g5});return a.loopback=u,c.loopback=u,Ot(a,s),Ot(a,c),Ot(o,u),i!==void 0?(Ot(u,c),Ot(u,i.left),Ot(i.right,s)):Ot(u,a),t.decisionMap[jo(e,i?"RepetitionWithSeparator":"Repetition",n.idx)]=a,{left:a,right:c}}function k5(t,e,n,r){const i=r.left,s=r.right;return Ot(i,s),t.decisionMap[jo(e,"Option",n.idx)]=i,r}function Bi(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function Uo(t,e,n,r,...i){const s=Wt(t,e,r,{type:m5,start:n});n.end=s;for(const a of i)a!==void 0?(Ot(n,a.left),Ot(a.right,s)):Ot(n,s);const o={left:n,right:s};return t.decisionMap[jo(e,C5(r),r.idx)]=n,o}function C5(t){if(t instanceof Pn)return"Alternation";if(t instanceof Xt)return"Option";if(t instanceof St)return"Repetition";if(t instanceof _n)return"RepetitionWithSeparator";if(t instanceof Mn)return"RepetitionMandatory";if(t instanceof Bn)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function A5(t,e){const n=e.length;for(let s=0;s<n-1;s++){const o=e[s];let a;o.left.transitions.length===1&&(a=o.left.transitions[0]);const c=a instanceof Hy,u=a,l=e[s+1].left;o.left.type===Mi&&o.right.type===Mi&&a!==void 0&&(c&&u.followState===o.right||a.target===o.right)?(c?u.followState=l:a.target=l,x5(t,o.right)):Ot(o.right,l)}const r=e[0],i=e[n-1];return{left:r.left,right:i.right}}function Vy(t,e,n,r){const i=Wt(t,e,r,{type:Mi}),s=Wt(t,e,r,{type:Mi});return Ky(i,new Wy(s,n)),{left:i,right:s}}function _5(t,e,n){const r=n.referencedRule,i=t.ruleToStartState.get(r),s=Wt(t,e,n,{type:Mi}),o=Wt(t,e,n,{type:Mi}),a=new Hy(i,r,o);return Ky(s,a),{left:s,right:o}}function P5(t,e,n){const r=t.ruleToStartState.get(e);Ot(r,n.left);const i=t.ruleToStopState.get(e);return Ot(n.right,i),{left:r,right:i}}function Ot(t,e){const n=new V$(e);Ky(t,n)}function Wt(t,e,n,r){const i=Object.assign({atn:t,production:n,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},r);return t.states.push(i),i}function Ky(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function x5(t,e){t.states.splice(t.states.indexOf(e),1)}const mp={};class Yy{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const n=J$(e);n in this.map||(this.map[n]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return pe(this.configs,e=>e.alt)}get key(){let e="";for(const n in this.map)e+=n+":";return e}}function J$(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(n=>n.stateNumber.toString()).join("_")}`}function I5(t,e){const n={};return r=>{const i=r.toString();let s=n[i];return s!==void 0||(s={atnStartState:t,decision:e,states:{}},n[i]=s),s}}class Z${constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,n){this.predicates[e]=n}toString(){let e="";const n=this.predicates.length;for(let r=0;r<n;r++)e+=this.predicates[r]===!0?"1":"0";return e}}const Q$=new Z$;class N5 extends jy{constructor(e){var n;super(),this.logging=(n=e?.logging)!==null&&n!==void 0?n:r=>console.log(r)}initialize(e){this.atn=w5(e.rules),this.dfas=O5(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:n,rule:r,hasPredicates:i,dynamicTokensEnabled:s}=e,o=this.dfas,a=this.logging,c=jo(r,"Alternation",n),l=this.atn.decisionMap[c].decision,d=pe(w$({maxLookahead:1,occurrence:n,prodType:"Alternation",rule:r}),f=>pe(f,p=>p[0]));if(eT(d,!1)&&!s){const f=mn(d,(p,h,v)=>(Ee(h,b=>{b&&(p[b.tokenTypeIdx]=v,Ee(b.categoryMatches,g=>{p[g]=v}))}),p),{});return i?function(p){var h;const v=this.LA(1),b=f[v.tokenTypeIdx];if(p!==void 0&&b!==void 0){const g=(h=p[b])===null||h===void 0?void 0:h.GATE;if(g!==void 0&&g.call(this)===!1)return}return b}:function(){const p=this.LA(1);return f[p.tokenTypeIdx]}}else return i?function(f){const p=new Z$,h=f===void 0?0:f.length;for(let b=0;b<h;b++){const g=f?.[b].GATE;p.set(b,g===void 0||g.call(this))}const v=Xy.call(this,o,l,p,a);return typeof v=="number"?v:void 0}:function(){const f=Xy.call(this,o,l,Q$,a);return typeof f=="number"?f:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:n,rule:r,prodType:i,dynamicTokensEnabled:s}=e,o=this.dfas,a=this.logging,c=jo(r,i,n),l=this.atn.decisionMap[c].decision,d=pe(w$({maxLookahead:1,occurrence:n,prodType:i,rule:r}),f=>pe(f,p=>p[0]));if(eT(d)&&d[0][0]&&!s){const f=d[0],p=Qn(f);if(p.length===1&&at(p[0].categoryMatches)){const v=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===v}}else{const h=mn(p,(v,b)=>(b!==void 0&&(v[b.tokenTypeIdx]=!0,Ee(b.categoryMatches,g=>{v[g]=!0})),v),{});return function(){const v=this.LA(1);return h[v.tokenTypeIdx]===!0}}}return function(){const f=Xy.call(this,o,l,Q$,a);return typeof f=="object"?!1:f===0}}}function eT(t,e=!0){const n=new Set;for(const r of t){const i=new Set;for(const s of r){if(s===void 0){if(e)break;return!1}const o=[s.tokenTypeIdx].concat(s.categoryMatches);for(const a of o)if(n.has(a)){if(!i.has(a))return!1}else n.add(a),i.add(a)}}return!0}function O5(t){const e=t.decisionStates.length,n=Array(e);for(let r=0;r<e;r++)n[r]=I5(t.decisionStates[r],r);return n}function Xy(t,e,n,r){const i=t[e](n);let s=i.start;if(s===void 0){const a=H5(i.atnStartState);s=rT(i,tT(a)),i.start=s}return F5.apply(this,[i,s,n,r])}function F5(t,e,n,r){let i=e,s=1;const o=[];let a=this.LA(s++);for(;;){let c=j5(i,a);if(c===void 0&&(c=L5.apply(this,[t,i,a,s,n,r])),c===mp)return q5(o,i,a);if(c.isAcceptState===!0)return c.prediction;i=c,o.push(a),a=this.LA(s++)}}function L5(t,e,n,r,i,s){const o=U5(e.configs,n,i);if(o.size===0)return nT(t,e,n,mp),mp;let a=tT(o);const c=W5(o,i);if(c!==void 0)a.isAcceptState=!0,a.prediction=c,a.configs.uniqueAlt=c;else if(X5(o)){const u=e6(o.alts);a.isAcceptState=!0,a.prediction=u,a.configs.uniqueAlt=u,M5.apply(this,[t,r,o.alts,s])}return a=nT(t,e,n,a),a}function M5(t,e,n,r){const i=[];for(let u=1;u<=e;u++)i.push(this.LA(u).tokenType);const s=t.atnStartState,o=s.rule,a=s.production,c=B5({topLevelRule:o,ambiguityIndices:n,production:a,prefixPath:i});r(c)}function B5(t){const e=pe(t.prefixPath,i=>zo(i)).join(", "),n=t.production.idx===0?"":t.production.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${z5(t.production)}${n}> inside <${t.topLevelRule.name}> Rule,
112
- <${e}> may appears as a prefix path in all these alternatives.
113
- `;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
114
- For Further details.`,r}function z5(t){if(t instanceof gn)return"SUBRULE";if(t instanceof Xt)return"OPTION";if(t instanceof Pn)return"OR";if(t instanceof Mn)return"AT_LEAST_ONE";if(t instanceof Bn)return"AT_LEAST_ONE_SEP";if(t instanceof _n)return"MANY_SEP";if(t instanceof St)return"MANY";if(t instanceof gt)return"CONSUME";throw Error("non exhaustive match")}function q5(t,e,n){const r=Ln(e.configs.elements,s=>s.state.transitions),i=l6(r.filter(s=>s instanceof Wy).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:n,possibleTokenTypes:i,tokenPath:t}}function j5(t,e){return t.edges[e.tokenTypeIdx]}function U5(t,e,n){const r=new Yy,i=[];for(const o of t.elements){if(n.is(o.alt)===!1)continue;if(o.state.type===Bc){i.push(o);continue}const a=o.state.transitions.length;for(let c=0;c<a;c++){const u=o.state.transitions[c],l=G5(u,e);l!==void 0&&r.add({state:l,alt:o.alt,stack:o.stack})}}let s;if(i.length===0&&r.size===1&&(s=r),s===void 0){s=new Yy;for(const o of r.elements)gp(o,s)}if(i.length>0&&!K5(s))for(const o of i)s.add(o);return s}function G5(t,e){if(t instanceof Wy&&m$(e,t.tokenType))return t.target}function W5(t,e){let n;for(const r of t.elements)if(e.is(r.alt)===!0){if(n===void 0)n=r.alt;else if(n!==r.alt)return}return n}function tT(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function nT(t,e,n,r){return r=rT(t,r),e.edges[n.tokenTypeIdx]=r,r}function rT(t,e){if(e===mp)return e;const n=e.configs.key,r=t.states[n];return r!==void 0?r:(e.configs.finalize(),t.states[n]=e,e)}function H5(t){const e=new Yy,n=t.transitions.length;for(let r=0;r<n;r++){const s={state:t.transitions[r].target,alt:r,stack:[]};gp(s,e)}return e}function gp(t,e){const n=t.state;if(n.type===Bc){if(t.stack.length>0){const i=[...t.stack],o={state:i.pop(),alt:t.alt,stack:i};gp(o,e)}else e.add(t);return}n.epsilonOnlyTransitions||e.add(t);const r=n.transitions.length;for(let i=0;i<r;i++){const s=n.transitions[i],o=V5(t,s);o!==void 0&&gp(o,e)}}function V5(t,e){if(e instanceof V$)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Hy){const n=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:n}}}function K5(t){for(const e of t.elements)if(e.state.type===Bc)return!0;return!1}function Y5(t){for(const e of t.elements)if(e.state.type!==Bc)return!1;return!0}function X5(t){if(Y5(t))return!0;const e=J5(t.elements);return Z5(e)&&!Q5(e)}function J5(t){const e=new Map;for(const n of t){const r=J$(n,!1);let i=e.get(r);i===void 0&&(i={},e.set(r,i)),i[n.alt]=!0}return e}function Z5(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function Q5(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var iT;(function(t){function e(n){return typeof n=="string"}t.is=e})(iT||(iT={}));var Jy;(function(t){function e(n){return typeof n=="string"}t.is=e})(Jy||(Jy={}));var sT;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(sT||(sT={}));var yp;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(yp||(yp={}));var nt;(function(t){function e(r,i){return r===Number.MAX_VALUE&&(r=yp.MAX_VALUE),i===Number.MAX_VALUE&&(i=yp.MAX_VALUE),{line:r,character:i}}t.create=e;function n(r){let i=r;return q.objectLiteral(i)&&q.uinteger(i.line)&&q.uinteger(i.character)}t.is=n})(nt||(nt={}));var Ue;(function(t){function e(r,i,s,o){if(q.uinteger(r)&&q.uinteger(i)&&q.uinteger(s)&&q.uinteger(o))return{start:nt.create(r,i),end:nt.create(s,o)};if(nt.is(r)&&nt.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${s}, ${o}]`)}t.create=e;function n(r){let i=r;return q.objectLiteral(i)&&nt.is(i.start)&&nt.is(i.end)}t.is=n})(Ue||(Ue={}));var vp;(function(t){function e(r,i){return{uri:r,range:i}}t.create=e;function n(r){let i=r;return q.objectLiteral(i)&&Ue.is(i.range)&&(q.string(i.uri)||q.undefined(i.uri))}t.is=n})(vp||(vp={}));var oT;(function(t){function e(r,i,s,o){return{targetUri:r,targetRange:i,targetSelectionRange:s,originSelectionRange:o}}t.create=e;function n(r){let i=r;return q.objectLiteral(i)&&Ue.is(i.targetRange)&&q.string(i.targetUri)&&Ue.is(i.targetSelectionRange)&&(Ue.is(i.originSelectionRange)||q.undefined(i.originSelectionRange))}t.is=n})(oT||(oT={}));var Zy;(function(t){function e(r,i,s,o){return{red:r,green:i,blue:s,alpha:o}}t.create=e;function n(r){const i=r;return q.objectLiteral(i)&&q.numberRange(i.red,0,1)&&q.numberRange(i.green,0,1)&&q.numberRange(i.blue,0,1)&&q.numberRange(i.alpha,0,1)}t.is=n})(Zy||(Zy={}));var aT;(function(t){function e(r,i){return{range:r,color:i}}t.create=e;function n(r){const i=r;return q.objectLiteral(i)&&Ue.is(i.range)&&Zy.is(i.color)}t.is=n})(aT||(aT={}));var cT;(function(t){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}t.create=e;function n(r){const i=r;return q.objectLiteral(i)&&q.string(i.label)&&(q.undefined(i.textEdit)||In.is(i))&&(q.undefined(i.additionalTextEdits)||q.typedArray(i.additionalTextEdits,In.is))}t.is=n})(cT||(cT={}));var uT;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(uT||(uT={}));var lT;(function(t){function e(r,i,s,o,a,c){const u={startLine:r,endLine:i};return q.defined(s)&&(u.startCharacter=s),q.defined(o)&&(u.endCharacter=o),q.defined(a)&&(u.kind=a),q.defined(c)&&(u.collapsedText=c),u}t.create=e;function n(r){const i=r;return q.objectLiteral(i)&&q.uinteger(i.startLine)&&q.uinteger(i.startLine)&&(q.undefined(i.startCharacter)||q.uinteger(i.startCharacter))&&(q.undefined(i.endCharacter)||q.uinteger(i.endCharacter))&&(q.undefined(i.kind)||q.string(i.kind))}t.is=n})(lT||(lT={}));var Qy;(function(t){function e(r,i){return{location:r,message:i}}t.create=e;function n(r){let i=r;return q.defined(i)&&vp.is(i.location)&&q.string(i.message)}t.is=n})(Qy||(Qy={}));var zc;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(zc||(zc={}));var dT;(function(t){t.Unnecessary=1,t.Deprecated=2})(dT||(dT={}));var fT;(function(t){function e(n){const r=n;return q.objectLiteral(r)&&q.string(r.href)}t.is=e})(fT||(fT={}));var wp;(function(t){function e(r,i,s,o,a,c){let u={range:r,message:i};return q.defined(s)&&(u.severity=s),q.defined(o)&&(u.code=o),q.defined(a)&&(u.source=a),q.defined(c)&&(u.relatedInformation=c),u}t.create=e;function n(r){var i;let s=r;return q.defined(s)&&Ue.is(s.range)&&q.string(s.message)&&(q.number(s.severity)||q.undefined(s.severity))&&(q.integer(s.code)||q.string(s.code)||q.undefined(s.code))&&(q.undefined(s.codeDescription)||q.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(q.string(s.source)||q.undefined(s.source))&&(q.undefined(s.relatedInformation)||q.typedArray(s.relatedInformation,Qy.is))}t.is=n})(wp||(wp={}));var Go;(function(t){function e(r,i,...s){let o={title:r,command:i};return q.defined(s)&&s.length>0&&(o.arguments=s),o}t.create=e;function n(r){let i=r;return q.defined(i)&&q.string(i.title)&&q.string(i.command)}t.is=n})(Go||(Go={}));var In;(function(t){function e(s,o){return{range:s,newText:o}}t.replace=e;function n(s,o){return{range:{start:s,end:s},newText:o}}t.insert=n;function r(s){return{range:s,newText:""}}t.del=r;function i(s){const o=s;return q.objectLiteral(o)&&q.string(o.newText)&&Ue.is(o.range)}t.is=i})(In||(In={}));var ev;(function(t){function e(r,i,s){const o={label:r};return i!==void 0&&(o.needsConfirmation=i),s!==void 0&&(o.description=s),o}t.create=e;function n(r){const i=r;return q.objectLiteral(i)&&q.string(i.label)&&(q.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(q.string(i.description)||i.description===void 0)}t.is=n})(ev||(ev={}));var Wo;(function(t){function e(n){const r=n;return q.string(r)}t.is=e})(Wo||(Wo={}));var pT;(function(t){function e(s,o,a){return{range:s,newText:o,annotationId:a}}t.replace=e;function n(s,o,a){return{range:{start:s,end:s},newText:o,annotationId:a}}t.insert=n;function r(s,o){return{range:s,newText:"",annotationId:o}}t.del=r;function i(s){const o=s;return In.is(o)&&(ev.is(o.annotationId)||Wo.is(o.annotationId))}t.is=i})(pT||(pT={}));var tv;(function(t){function e(r,i){return{textDocument:r,edits:i}}t.create=e;function n(r){let i=r;return q.defined(i)&&ov.is(i.textDocument)&&Array.isArray(i.edits)}t.is=n})(tv||(tv={}));var nv;(function(t){function e(r,i,s){let o={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}t.create=e;function n(r){let i=r;return i&&i.kind==="create"&&q.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||q.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||q.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Wo.is(i.annotationId))}t.is=n})(nv||(nv={}));var rv;(function(t){function e(r,i,s,o){let a={kind:"rename",oldUri:r,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(a.options=s),o!==void 0&&(a.annotationId=o),a}t.create=e;function n(r){let i=r;return i&&i.kind==="rename"&&q.string(i.oldUri)&&q.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||q.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||q.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Wo.is(i.annotationId))}t.is=n})(rv||(rv={}));var iv;(function(t){function e(r,i,s){let o={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}t.create=e;function n(r){let i=r;return i&&i.kind==="delete"&&q.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||q.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||q.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Wo.is(i.annotationId))}t.is=n})(iv||(iv={}));var sv;(function(t){function e(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>q.string(i.kind)?nv.is(i)||rv.is(i)||iv.is(i):tv.is(i)))}t.is=e})(sv||(sv={}));var hT;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let i=r;return q.defined(i)&&q.string(i.uri)}t.is=n})(hT||(hT={}));var mT;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return q.defined(i)&&q.string(i.uri)&&q.integer(i.version)}t.is=n})(mT||(mT={}));var ov;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return q.defined(i)&&q.string(i.uri)&&(i.version===null||q.integer(i.version))}t.is=n})(ov||(ov={}));var gT;(function(t){function e(r,i,s,o){return{uri:r,languageId:i,version:s,text:o}}t.create=e;function n(r){let i=r;return q.defined(i)&&q.string(i.uri)&&q.string(i.languageId)&&q.integer(i.version)&&q.string(i.text)}t.is=n})(gT||(gT={}));var av;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){const r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(av||(av={}));var qc;(function(t){function e(n){const r=n;return q.objectLiteral(n)&&av.is(r.kind)&&q.string(r.value)}t.is=e})(qc||(qc={}));var Ft;(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})(Ft||(Ft={}));var tr;(function(t){t.PlainText=1,t.Snippet=2})(tr||(tr={}));var yT;(function(t){t.Deprecated=1})(yT||(yT={}));var vT;(function(t){function e(r,i,s){return{newText:r,insert:i,replace:s}}t.create=e;function n(r){const i=r;return i&&q.string(i.newText)&&Ue.is(i.insert)&&Ue.is(i.replace)}t.is=n})(vT||(vT={}));var wT;(function(t){t.asIs=1,t.adjustIndentation=2})(wT||(wT={}));var bT;(function(t){function e(n){const r=n;return r&&(q.string(r.detail)||r.detail===void 0)&&(q.string(r.description)||r.description===void 0)}t.is=e})(bT||(bT={}));var DT;(function(t){function e(n){return{label:n}}t.create=e})(DT||(DT={}));var ET;(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(ET||(ET={}));var bp;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){const i=r;return q.string(i)||q.objectLiteral(i)&&q.string(i.language)&&q.string(i.value)}t.is=n})(bp||(bp={}));var RT;(function(t){function e(n){let r=n;return!!r&&q.objectLiteral(r)&&(qc.is(r.contents)||bp.is(r.contents)||q.typedArray(r.contents,bp.is))&&(n.range===void 0||Ue.is(n.range))}t.is=e})(RT||(RT={}));var $T;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})($T||($T={}));var TT;(function(t){function e(n,r,...i){let s={label:n};return q.defined(r)&&(s.documentation=r),q.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(TT||(TT={}));var ST;(function(t){t.Text=1,t.Read=2,t.Write=3})(ST||(ST={}));var kT;(function(t){function e(n,r){let i={range:n};return q.number(r)&&(i.kind=r),i}t.create=e})(kT||(kT={}));var hr;(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})(hr||(hr={}));var CT;(function(t){t.Deprecated=1})(CT||(CT={}));var AT;(function(t){function e(n,r,i,s,o){let a={name:n,kind:r,location:{uri:s,range:i}};return o&&(a.containerName=o),a}t.create=e})(AT||(AT={}));var _T;(function(t){function e(n,r,i,s){return s!==void 0?{name:n,kind:r,location:{uri:i,range:s}}:{name:n,kind:r,location:{uri:i}}}t.create=e})(_T||(_T={}));var PT;(function(t){function e(r,i,s,o,a,c){let u={name:r,detail:i,kind:s,range:o,selectionRange:a};return c!==void 0&&(u.children=c),u}t.create=e;function n(r){let i=r;return i&&q.string(i.name)&&q.number(i.kind)&&Ue.is(i.range)&&Ue.is(i.selectionRange)&&(i.detail===void 0||q.string(i.detail))&&(i.deprecated===void 0||q.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=n})(PT||(PT={}));var xT;(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"})(xT||(xT={}));var Dp;(function(t){t.Invoked=1,t.Automatic=2})(Dp||(Dp={}));var IT;(function(t){function e(r,i,s){let o={diagnostics:r};return i!=null&&(o.only=i),s!=null&&(o.triggerKind=s),o}t.create=e;function n(r){let i=r;return q.defined(i)&&q.typedArray(i.diagnostics,wp.is)&&(i.only===void 0||q.typedArray(i.only,q.string))&&(i.triggerKind===void 0||i.triggerKind===Dp.Invoked||i.triggerKind===Dp.Automatic)}t.is=n})(IT||(IT={}));var NT;(function(t){function e(r,i,s){let o={title:r},a=!0;return typeof i=="string"?(a=!1,o.kind=i):Go.is(i)?o.command=i:o.edit=i,a&&s!==void 0&&(o.kind=s),o}t.create=e;function n(r){let i=r;return i&&q.string(i.title)&&(i.diagnostics===void 0||q.typedArray(i.diagnostics,wp.is))&&(i.kind===void 0||q.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Go.is(i.command))&&(i.isPreferred===void 0||q.boolean(i.isPreferred))&&(i.edit===void 0||sv.is(i.edit))}t.is=n})(NT||(NT={}));var OT;(function(t){function e(r,i){let s={range:r};return q.defined(i)&&(s.data=i),s}t.create=e;function n(r){let i=r;return q.defined(i)&&Ue.is(i.range)&&(q.undefined(i.command)||Go.is(i.command))}t.is=n})(OT||(OT={}));var FT;(function(t){function e(r,i){return{tabSize:r,insertSpaces:i}}t.create=e;function n(r){let i=r;return q.defined(i)&&q.uinteger(i.tabSize)&&q.boolean(i.insertSpaces)}t.is=n})(FT||(FT={}));var LT;(function(t){function e(r,i,s){return{range:r,target:i,data:s}}t.create=e;function n(r){let i=r;return q.defined(i)&&Ue.is(i.range)&&(q.undefined(i.target)||q.string(i.target))}t.is=n})(LT||(LT={}));var MT;(function(t){function e(r,i){return{range:r,parent:i}}t.create=e;function n(r){let i=r;return q.objectLiteral(i)&&Ue.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=n})(MT||(MT={}));var je;(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"})(je||(je={}));var rt;(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"})(rt||(rt={}));var BT;(function(t){function e(n){const r=n;return q.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})(BT||(BT={}));var zT;(function(t){function e(r,i){return{range:r,text:i}}t.create=e;function n(r){const i=r;return i!=null&&Ue.is(i.range)&&q.string(i.text)}t.is=n})(zT||(zT={}));var qT;(function(t){function e(r,i,s){return{range:r,variableName:i,caseSensitiveLookup:s}}t.create=e;function n(r){const i=r;return i!=null&&Ue.is(i.range)&&q.boolean(i.caseSensitiveLookup)&&(q.string(i.variableName)||i.variableName===void 0)}t.is=n})(qT||(qT={}));var jT;(function(t){function e(r,i){return{range:r,expression:i}}t.create=e;function n(r){const i=r;return i!=null&&Ue.is(i.range)&&(q.string(i.expression)||i.expression===void 0)}t.is=n})(jT||(jT={}));var UT;(function(t){function e(r,i){return{frameId:r,stoppedLocation:i}}t.create=e;function n(r){const i=r;return q.defined(i)&&Ue.is(r.stoppedLocation)}t.is=n})(UT||(UT={}));var cv;(function(t){t.Type=1,t.Parameter=2;function e(n){return n===1||n===2}t.is=e})(cv||(cv={}));var uv;(function(t){function e(r){return{value:r}}t.create=e;function n(r){const i=r;return q.objectLiteral(i)&&(i.tooltip===void 0||q.string(i.tooltip)||qc.is(i.tooltip))&&(i.location===void 0||vp.is(i.location))&&(i.command===void 0||Go.is(i.command))}t.is=n})(uv||(uv={}));var GT;(function(t){function e(r,i,s){const o={position:r,label:i};return s!==void 0&&(o.kind=s),o}t.create=e;function n(r){const i=r;return q.objectLiteral(i)&&nt.is(i.position)&&(q.string(i.label)||q.typedArray(i.label,uv.is))&&(i.kind===void 0||cv.is(i.kind))&&i.textEdits===void 0||q.typedArray(i.textEdits,In.is)&&(i.tooltip===void 0||q.string(i.tooltip)||qc.is(i.tooltip))&&(i.paddingLeft===void 0||q.boolean(i.paddingLeft))&&(i.paddingRight===void 0||q.boolean(i.paddingRight))}t.is=n})(GT||(GT={}));var WT;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(WT||(WT={}));var HT;(function(t){function e(n,r,i,s){return{insertText:n,filterText:r,range:i,command:s}}t.create=e})(HT||(HT={}));var VT;(function(t){function e(n){return{items:n}}t.create=e})(VT||(VT={}));var KT;(function(t){t.Invoked=0,t.Automatic=1})(KT||(KT={}));var YT;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(YT||(YT={}));var XT;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(XT||(XT={}));var JT;(function(t){function e(n){const r=n;return q.objectLiteral(r)&&Jy.is(r.uri)&&q.string(r.name)}t.is=e})(JT||(JT={}));var ZT;(function(t){function e(s,o,a,c){return new eq(s,o,a,c)}t.create=e;function n(s){let o=s;return!!(q.defined(o)&&q.string(o.uri)&&(q.undefined(o.languageId)||q.string(o.languageId))&&q.uinteger(o.lineCount)&&q.func(o.getText)&&q.func(o.positionAt)&&q.func(o.offsetAt))}t.is=n;function r(s,o){let a=s.getText(),c=i(o,(l,d)=>{let f=l.range.start.line-d.range.start.line;return f===0?l.range.start.character-d.range.start.character:f}),u=a.length;for(let l=c.length-1;l>=0;l--){let d=c[l],f=s.offsetAt(d.range.start),p=s.offsetAt(d.range.end);if(p<=u)a=a.substring(0,f)+d.newText+a.substring(p,a.length);else throw new Error("Overlapping edit");u=f}return a}t.applyEdits=r;function i(s,o){if(s.length<=1)return s;const a=s.length/2|0,c=s.slice(0,a),u=s.slice(a);i(c,o),i(u,o);let l=0,d=0,f=0;for(;l<c.length&&d<u.length;)o(c[l],u[d])<=0?s[f++]=c[l++]:s[f++]=u[d++];for(;l<c.length;)s[f++]=c[l++];for(;d<u.length;)s[f++]=u[d++];return s}})(ZT||(ZT={}));let eq=class{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){this._content=e.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],n=this._content,r=!0;for(let i=0;i<n.length;i++){r&&(e.push(i),r=!1);let s=n.charAt(i);r=s==="\r"||s===`
115
- `,s==="\r"&&i+1<n.length&&n.charAt(i+1)===`
116
- `&&i++}r&&n.length>0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return nt.create(0,e);for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return nt.create(s,e-n[s])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}};var q;(function(t){const e=Object.prototype.toString;function n(p){return typeof p<"u"}t.defined=n;function r(p){return typeof p>"u"}t.undefined=r;function i(p){return p===!0||p===!1}t.boolean=i;function s(p){return e.call(p)==="[object String]"}t.string=s;function o(p){return e.call(p)==="[object Number]"}t.number=o;function a(p,h,v){return e.call(p)==="[object Number]"&&h<=p&&p<=v}t.numberRange=a;function c(p){return e.call(p)==="[object Number]"&&-2147483648<=p&&p<=2147483647}t.integer=c;function u(p){return e.call(p)==="[object Number]"&&0<=p&&p<=2147483647}t.uinteger=u;function l(p){return e.call(p)==="[object Function]"}t.func=l;function d(p){return p!==null&&typeof p=="object"}t.objectLiteral=d;function f(p,h){return Array.isArray(p)&&p.every(h)}t.typedArray=f})(q||(q={}));class tq{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]}buildRootNode(e){return this.rootNode=new eS(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const n=new dv;return n.grammarSource=e,n.root=this.rootNode,this.current.content.push(n),this.nodeStack.push(n),n}buildLeafNode(e,n){const r=new lv(e.startOffset,e.image.length,df(e),e.tokenType,!1);return r.grammarSource=n,r.root=this.rootNode,this.current.content.push(r),r}removeNode(e){const n=e.container;if(n){const r=n.content.indexOf(e);r>=0&&n.content.splice(r,1)}}construct(e){const n=this.current;typeof e.$type=="string"&&(this.current.astNode=e),e.$cstNode=n;const r=this.nodeStack.pop();r?.content.length===0&&this.removeNode(r)}addHiddenTokens(e){for(const n of e){const r=new lv(n.startOffset,n.image.length,df(n),n.tokenType,!0);r.root=this.rootNode,this.addHiddenToken(this.rootNode,r)}}addHiddenToken(e,n){const{offset:r,end:i}=n;for(let s=0;s<e.content.length;s++){const o=e.content[s],{offset:a,end:c}=o;if(Jr(o)&&r>a&&i<c){this.addHiddenToken(o,n);return}else if(i<=a){e.content.splice(s,0,n);return}}e.content.push(n)}}class QT{get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var e,n;const r=typeof((e=this._astNode)===null||e===void 0?void 0:e.$type)=="string"?this._astNode:(n=this.container)===null||n===void 0?void 0:n.astNode;if(!r)throw new Error("This node has no associated AST element");return r}set astNode(e){this._astNode=e}get element(){return this.astNode}get text(){return this.root.fullText.substring(this.offset,this.end)}}class lv extends QT{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,n,r,i,s=!1){super(),this._hidden=s,this._offset=e,this._tokenType=i,this._length=n,this._range=r}}class dv extends QT{constructor(){super(...arguments),this.content=new C0(this)}get children(){return this.content}get offset(){var e,n;return(n=(e=this.firstNonHiddenNode)===null||e===void 0?void 0:e.offset)!==null&&n!==void 0?n:0}get length(){return this.end-this.offset}get end(){var e,n;return(n=(e=this.lastNonHiddenNode)===null||e===void 0?void 0:e.end)!==null&&n!==void 0?n:0}get range(){const e=this.firstNonHiddenNode,n=this.lastNonHiddenNode;if(e&&n){if(this._rangeCache===void 0){const{range:r}=e,{range:i}=n;this._rangeCache={start:r.start,end:i.end.line<r.start.line?r.start:i.end}}return this._rangeCache}else return{start:nt.create(0,0),end:nt.create(0,0)}}get firstNonHiddenNode(){for(const e of this.content)if(!e.hidden)return e;return this.content[0]}get lastNonHiddenNode(){for(let e=this.content.length-1;e>=0;e--){const n=this.content[e];if(!n.hidden)return n}return this.content[this.content.length-1]}}class C0 extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,C0.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,n,...r){return this.addParents(r),super.splice(e,n,...r)}addParents(e){for(const n of e)n.container=this.parent}}class eS extends dv{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const fv=Symbol("Datatype");function pv(t){return t.$type===fv}const tS="\u200B",nS=t=>t.endsWith(tS)?t:t+tS;class rS{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const n=this.lexer.definition,r=e.LanguageMetaData.mode==="production";this.wrapper=new oq(n,Object.assign(Object.assign({},e.parser.ParserConfig),{skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,n){this.wrapper.wrapOr(e,n)}optional(e,n){this.wrapper.wrapOption(e,n)}many(e,n){this.wrapper.wrapMany(e,n)}atLeastOne(e,n){this.wrapper.wrapAtLeastOne(e,n)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}}class nq extends rS{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new tq,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,n){const r=this.computeRuleType(e),i=this.wrapper.DEFINE_RULE(nS(e.name),this.startImplementation(r,n).bind(this));return this.allRules.set(e.name,i),e.entry&&(this.mainRule=i),i}computeRuleType(e){if(!e.fragment){if(_f(e))return fv;{const n=Ds(e);return n??e.name}}}parse(e,n={}){this.nodeBuilder.buildRootNode(e);const r=this.lexer.tokenize(e);this.wrapper.input=r.tokens;const i=n.rule?this.allRules.get(n.rule):this.mainRule;if(!i)throw new Error(n.rule?`No rule found with name '${n.rule}'`:"No main rule available.");const s=i.call(this.wrapper,{});return this.nodeBuilder.addHiddenTokens(r.hidden),this.unorderedGroups.clear(),{value:s,lexerErrors:r.errors,lexerReport:r.report,parserErrors:this.wrapper.errors}}startImplementation(e,n){return r=>{if(!this.isRecording()){const s={$type:e};this.stack.push(s),e===fv&&(s.value="")}let i;try{i=n(r)}catch{i=void 0}return!this.isRecording()&&i===void 0&&(i=this.construct()),i}}consume(e,n,r){const i=this.wrapper.wrapConsume(e,n);if(!this.isRecording()&&this.isValidToken(i)){const s=this.nodeBuilder.buildLeafNode(i,r),{assignment:o,isCrossRef:a}=this.getAssignment(r),c=this.current;if(o){const u=Ar(r)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,u,s,a)}else if(pv(c)){let u=i.image;Ar(r)||(u=this.converter.convert(u,s).toString()),c.value+=u}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,n,r,i){let s;this.isRecording()||(s=this.nodeBuilder.buildCompositeNode(r));const o=this.wrapper.wrapSubrule(e,n,i);!this.isRecording()&&s&&s.length>0&&this.performSubruleAssignment(o,r,s)}performSubruleAssignment(e,n,r){const{assignment:i,isCrossRef:s}=this.getAssignment(n);if(i)this.assign(i.operator,i.feature,e,r,s);else if(!i){const o=this.current;if(pv(o))o.value+=e.toString();else if(typeof e=="object"&&e){const a=e.$type,c=this.assignWithoutOverride(e,o);a&&(c.$type=a);const u=c;this.stack.pop(),this.stack.push(u)}}}action(e,n){if(!this.isRecording()){let r=this.current;if(n.feature&&n.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode),this.nodeBuilder.buildCompositeNode(n).content.push(r.$cstNode);const s={$type:e};this.stack.push(s),this.assign(n.operator,n.feature,r,r.$cstNode,!1)}else r.$type=e}}construct(){if(this.isRecording())return;const e=this.current;return Mg(e),this.nodeBuilder.construct(e),this.stack.pop(),pv(e)?this.converter.convert(e.value,e.$cstNode):(zg(this.astReflection,e),e)}getAssignment(e){if(!this.assignmentMap.has(e)){const n=sn(e,Cr);this.assignmentMap.set(e,{assignment:n,isCrossRef:n?nc(n.terminal):!1})}return this.assignmentMap.get(e)}assign(e,n,r,i,s){const o=this.current;let a;switch(s&&typeof r=="string"?a=this.linker.buildReference(o,n,i,r):a=r,e){case"=":{o[n]=a;break}case"?=":{o[n]=!0;break}case"+=":Array.isArray(o[n])||(o[n]=[]),o[n].push(a)}}assignWithoutOverride(e,n){for(const[i,s]of Object.entries(n)){const o=e[i];o===void 0?e[i]=s:Array.isArray(o)&&Array.isArray(s)&&(s.push(...o),e[i]=s)}const r=e.$cstNode;return r&&(r.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}}class rq{buildMismatchTokenMessage(e){return qo.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return qo.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return qo.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return qo.buildEarlyExitMessage(e)}}class iS extends rq{buildMismatchTokenMessage({expected:e,actual:n}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${n.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}}class iq extends rS{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const n=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=n.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,n){const r=this.wrapper.DEFINE_RULE(nS(e.name),this.startImplementation(n).bind(this));return this.allRules.set(e.name,r),e.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return n=>{const r=this.keepStackSize();try{e(n)}finally{this.resetStackSize(r)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,n,r){this.wrapper.wrapConsume(e,n),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(e,n,r,i){this.before(r),this.wrapper.wrapSubrule(e,n,i),this.after(r)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const n=this.elementStack.lastIndexOf(e);n>=0&&this.elementStack.splice(n)}}get currIdx(){return this.wrapper.currIdx}}const sq={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new iS};class oq extends p5{constructor(e,n){const r=n&&"maxLookahead"in n;super(e,Object.assign(Object.assign(Object.assign({},sq),{lookaheadStrategy:r?new jy({maxLookahead:n.maxLookahead}):new N5({logging:n.skipValidations?()=>{}:void 0})}),n))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,n){return this.RULE(e,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,n){return this.consume(e,n)}wrapSubrule(e,n,r){return this.subrule(e,n,{ARGS:[r]})}wrapOr(e,n){this.or(e,n)}wrapOption(e,n){this.option(e,n)}wrapMany(e,n){this.many(e,n)}wrapAtLeastOne(e,n){this.atLeastOne(e,n)}}function sS(t,e,n){return aq({parser:e,tokens:n,ruleNames:new Map},t),e}function aq(t,e){const n=Wg(e,!1),r=st(e.rules).filter(rn).filter(i=>n.has(i));for(const i of r){const s=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});t.parser.rule(i,_s(s,i.definition))}}function _s(t,e,n=!1){let r;if(Ar(e))r=hq(t,e);else if(bs(e))r=cq(t,e);else if(Cr(e))r=_s(t,e.terminal);else if(nc(e))r=oS(t,e);else if(Qr(e))r=uq(t,e);else if(Fg(e))r=dq(t,e);else if(Lg(e))r=fq(t,e);else if(Pi(e))r=pq(t,e);else if(rL(e)){const i=t.consume++;r=()=>t.parser.consume(i,Fi,e)}else throw new uE(e.$cstNode,`Unexpected element type: ${e.$type}`);return aS(t,n?void 0:Ep(e),r,e.cardinality)}function cq(t,e){const n=wc(e);return()=>t.parser.action(n,e)}function uq(t,e){const n=e.rule.ref;if(rn(n)){const r=t.subrule++,i=e.arguments.length>0?lq(n,e.arguments):()=>({});return s=>t.parser.subrule(r,cS(t,n),e,i(s))}else if(Zr(n)){const r=t.consume++,i=hv(t,n.name);return()=>t.parser.consume(r,i,e)}else if(n)Fa();else throw new uE(e.$cstNode,`Undefined rule type: ${e.$type}`)}function lq(t,e){const n=e.map(r=>ci(r.value));return r=>{const i={};for(let s=0;s<n.length;s++){const o=t.parameters[s],a=n[s];i[o.name]=a(r)}return i}}function ci(t){if(XF(t)){const e=ci(t.left),n=ci(t.right);return r=>e(r)||n(r)}else if(YF(t)){const e=ci(t.left),n=ci(t.right);return r=>e(r)&&n(r)}else if(JF(t)){const e=ci(t.value);return n=>!e(n)}else if(ZF(t)){const e=t.parameter.ref.name;return n=>n!==void 0&&n[e]===!0}else if(KF(t)){const e=!!t.true;return()=>e}Fa()}function dq(t,e){if(e.elements.length===1)return _s(t,e.elements[0]);{const n=[];for(const i of e.elements){const s={ALT:_s(t,i,!0)},o=Ep(i);o&&(s.GATE=ci(o)),n.push(s)}const r=t.or++;return i=>t.parser.alternatives(r,n.map(s=>{const o={ALT:()=>s.ALT(i)},a=s.GATE;return a&&(o.GATE=()=>a(i)),o}))}}function fq(t,e){if(e.elements.length===1)return _s(t,e.elements[0]);const n=[];for(const a of e.elements){const c={ALT:_s(t,a,!0)},u=Ep(a);u&&(c.GATE=ci(u)),n.push(c)}const r=t.or++,i=(a,c)=>{const u=c.getRuleStack().join("-");return`uGroup_${a}_${u}`},s=a=>t.parser.alternatives(r,n.map((c,u)=>{const l={ALT:()=>!0},d=t.parser;l.ALT=()=>{if(c.ALT(a),!d.isRecording()){const p=i(r,d);d.unorderedGroups.get(p)||d.unorderedGroups.set(p,[]);const h=d.unorderedGroups.get(p);typeof h?.[u]>"u"&&(h[u]=!0)}};const f=c.GATE;return f?l.GATE=()=>f(a):l.GATE=()=>{const p=d.unorderedGroups.get(i(r,d));return!p?.[u]},l})),o=aS(t,Ep(e),s,"*");return a=>{o(a),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(r,t.parser))}}function pq(t,e){const n=e.elements.map(r=>_s(t,r));return r=>n.forEach(i=>i(r))}function Ep(t){if(Pi(t))return t.guardCondition}function oS(t,e,n=e.terminal){if(n)if(Qr(n)&&rn(n.rule.ref)){const r=t.subrule++;return i=>t.parser.subrule(r,cS(t,n.rule.ref),e,i)}else if(Qr(n)&&Zr(n.rule.ref)){const r=t.consume++,i=hv(t,n.rule.ref.name);return()=>t.parser.consume(r,i,e)}else if(Ar(n)){const r=t.consume++,i=hv(t,n.value);return()=>t.parser.consume(r,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const r=Xg(e.type.ref),i=r?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+wc(e.type.ref));return oS(t,e,i)}}function hq(t,e){const n=t.consume++,r=t.tokens[e.value];if(!r)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(n,r,e)}function aS(t,e,n,r){const i=e&&ci(e);if(!r)if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:()=>n(o),GATE:()=>i(o)},{ALT:U$(),GATE:()=>!i(o)}])}else return n;if(r==="*"){const s=t.many++;return o=>t.parser.many(s,{DEF:()=>n(o),GATE:i?()=>i(o):void 0})}else if(r==="+"){const s=t.many++;if(i){const o=t.or++;return a=>t.parser.alternatives(o,[{ALT:()=>t.parser.atLeastOne(s,{DEF:()=>n(a)}),GATE:()=>i(a)},{ALT:U$(),GATE:()=>!i(a)}])}else return o=>t.parser.atLeastOne(s,{DEF:()=>n(o)})}else if(r==="?"){const s=t.optional++;return o=>t.parser.optional(s,{DEF:()=>n(o),GATE:i?()=>i(o):void 0})}else Fa()}function cS(t,e){const n=mq(t,e),r=t.parser.getRule(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function mq(t,e){if(rn(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let n=e,r=n.$container,i=e.$type;for(;!rn(r);)(Pi(r)||Fg(r)||Lg(r))&&(i=r.elements.indexOf(n).toString()+":"+i),n=r,r=r.$container;return i=r.name+":"+i,t.ruleNames.set(e,i),i}}function hv(t,e){const n=t.tokens[e];if(!n)throw new Error(`Token "${e}" not found."`);return n}function gq(t){const e=t.Grammar,n=t.parser.Lexer,r=new iq(t);return sS(e,r,n.definition),r.finalize(),r}function yq(t){const e=vq(t);return e.finalize(),e}function vq(t){const e=t.Grammar,n=t.parser.Lexer,r=new nq(t);return sS(e,r,n.definition)}class wq{constructor(){this.diagnostics=[]}buildTokens(e,n){const r=st(Wg(e,!1)),i=this.buildTerminalTokens(r),s=this.buildKeywordTokens(r,i,n);return i.forEach(o=>{const a=o.PATTERN;typeof a=="object"&&a&&"test"in a&&Gg(a)?s.unshift(o):s.push(o)}),s}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Zr).filter(n=>!n.fragment).map(n=>this.buildTerminalToken(n)).toArray()}buildTerminalToken(e){const n=bc(e),r=this.requiresCustomPattern(n)?this.regexPatternFunction(n):n,i={name:e.name,PATTERN:r};return typeof r=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=Gg(n)?xn.SKIPPED:"hidden"),i}requiresCustomPattern(e){return e.flags.includes("u")||e.flags.includes("s")?!0:!!(e.source.includes("?<=")||e.source.includes("?<!"))}regexPatternFunction(e){const n=new RegExp(e,e.flags+"y");return(r,i)=>(n.lastIndex=i,n.exec(r))}buildKeywordTokens(e,n,r){return e.filter(rn).flatMap(i=>_r(i).filter(Ar)).distinct(i=>i.value).toArray().sort((i,s)=>s.value.length-i.value.length).map(i=>this.buildKeywordToken(i,n,!!r?.caseInsensitive))}buildKeywordToken(e,n,r){const i=this.buildKeywordPattern(e,r),s={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,n)};return typeof i=="function"&&(s.LINE_BREAKS=!0),s}buildKeywordPattern(e,n){return n?new RegExp(vL(e.value)):e.value}findLongerAlt(e,n){return n.reduce((r,i)=>{const s=i?.PATTERN;return s?.source&&wL("^"+s.source+"$",e.value)&&r.push(i),r},[])}}class bq{convert(e,n){let r=n.grammarSource;if(nc(r)&&(r=Hg(r)),Qr(r)){const i=r.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,n)}return e}runConverter(e,n,r){var i;switch(e.name.toUpperCase()){case"INT":return ui.convertInt(n);case"STRING":return ui.convertString(n);case"ID":return ui.convertID(n)}switch((i=_E(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return ui.convertNumber(n);case"boolean":return ui.convertBoolean(n);case"bigint":return ui.convertBigint(n);case"date":return ui.convertDate(n);default:return n}}}var ui;(function(t){function e(u){let l="";for(let d=1;d<u.length-1;d++){const f=u.charAt(d);if(f==="\\"){const p=u.charAt(++d);l+=n(p)}else l+=f}return l}t.convertString=e;function n(u){switch(u){case"b":return"\b";case"f":return"\f";case"n":return`
117
- `;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return u}}function r(u){return u.charAt(0)==="^"?u.substring(1):u}t.convertID=r;function i(u){return parseInt(u)}t.convertInt=i;function s(u){return BigInt(u)}t.convertBigint=s;function o(u){return new Date(u)}t.convertDate=o;function a(u){return Number(u)}t.convertNumber=a;function c(u){return u.toLowerCase()==="true"}t.convertBoolean=c})(ui||(ui={}));var Dq=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rp(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ps={},$p={},uS;function xs(){if(uS)return $p;uS=1,Object.defineProperty($p,"__esModule",{value:!0});let t;function e(){if(t===void 0)throw new Error("No runtime abstraction layer installed");return t}return function(n){function r(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");t=i}n.install=r}(e),$p.default=e,$p}var Jt={},lS;function jc(){if(lS)return Jt;lS=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.stringArray=Jt.array=Jt.func=Jt.error=Jt.number=Jt.string=Jt.boolean=void 0;function t(a){return a===!0||a===!1}Jt.boolean=t;function e(a){return typeof a=="string"||a instanceof String}Jt.string=e;function n(a){return typeof a=="number"||a instanceof Number}Jt.number=n;function r(a){return a instanceof Error}Jt.error=r;function i(a){return typeof a=="function"}Jt.func=i;function s(a){return Array.isArray(a)}Jt.array=s;function o(a){return s(a)&&a.every(c=>e(c))}return Jt.stringArray=o,Jt}var Is={},dS;function Ho(){if(dS)return Is;dS=1,Object.defineProperty(Is,"__esModule",{value:!0}),Is.Emitter=Is.Event=void 0;const t=xs();var e;(function(i){const s={dispose(){}};i.None=function(){return s}})(e||(Is.Event=e={}));class n{add(s,o=null,a){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(s),this._contexts.push(o),Array.isArray(a)&&a.push({dispose:()=>this.remove(s,o)})}remove(s,o=null){if(!this._callbacks)return;let a=!1;for(let c=0,u=this._callbacks.length;c<u;c++)if(this._callbacks[c]===s)if(this._contexts[c]===o){this._callbacks.splice(c,1),this._contexts.splice(c,1);return}else a=!0;if(a)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...s){if(!this._callbacks)return[];const o=[],a=this._callbacks.slice(0),c=this._contexts.slice(0);for(let u=0,l=a.length;u<l;u++)try{o.push(a[u].apply(c[u],s))}catch(d){(0,t.default)().console.error(d)}return o}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class r{constructor(s){this._options=s}get event(){return this._event||(this._event=(s,o,a)=>{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(s,o);const c={dispose:()=>{this._callbacks&&(this._callbacks.remove(s,o),c.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(a)&&a.push(c),c}),this._event}fire(s){this._callbacks&&this._callbacks.invoke.call(this._callbacks,s)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return Is.Emitter=r,r._noop=function(){},Is}var fS;function Tp(){if(fS)return Ps;fS=1,Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.CancellationTokenSource=Ps.CancellationToken=void 0;const t=xs(),e=jc(),n=Ho();var r;(function(a){a.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),a.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function c(u){const l=u;return l&&(l===a.None||l===a.Cancelled||e.boolean(l.isCancellationRequested)&&!!l.onCancellationRequested)}a.is=c})(r||(Ps.CancellationToken=r={}));const i=Object.freeze(function(a,c){const u=(0,t.default)().timer.setTimeout(a.bind(c),0);return{dispose(){u.dispose()}}});class s{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?i:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class o{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=r.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=r.None}}return Ps.CancellationTokenSource=o,Ps}var ct=Tp();function Eq(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let mv=0,Rq=10;function $q(){return mv=performance.now(),new ct.CancellationTokenSource}const Sp=Symbol("OperationCancelled");function kp(t){return t===Sp}async function jt(t){if(t===ct.CancellationToken.None)return;const e=performance.now();if(e-mv>=Rq&&(mv=e,await Eq()),t.isCancellationRequested)throw Sp}class gv{constructor(){this.promise=new Promise((e,n)=>{this.resolve=r=>(e(r),this),this.reject=r=>(n(r),this)})}}class Wd{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(let r of e)if(Wd.isIncremental(r)){const i=hS(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(o,this._content.length);const a=Math.max(i.start.line,0),c=Math.max(i.end.line,0);let u=this._lineOffsets;const l=pS(r.text,!1,s);if(c-a===l.length)for(let f=0,p=l.length;f<p;f++)u[f+a+1]=l[f];else l.length<1e4?u.splice(a+1,c-a,...l):this._lineOffsets=u=u.slice(0,a+1).concat(l,u.slice(c+1));const d=r.text.length-(o-s);if(d!==0)for(let f=a+1+l.length,p=u.length;f<p;f++)u[f]=u[f]+d}else if(Wd.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=pS(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return{line:s,character:e-n[s]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}}var Cp;(function(t){function e(i,s,o,a){return new Wd(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof Wd)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){let o=i.getText(),a=yv(s.map(Tq),(l,d)=>{let f=l.range.start.line-d.range.start.line;return f===0?l.range.start.character-d.range.start.character:f}),c=0;const u=[];for(const l of a){let d=i.offsetAt(l.range.start);if(d<c)throw new Error("Overlapping edit");d>c&&u.push(o.substring(c,d)),l.newText.length&&u.push(l.newText),c=i.offsetAt(l.range.end)}return u.push(o.substr(c)),u.join("")}t.applyEdits=r})(Cp||(Cp={}));function yv(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);yv(r,e),yv(i,e);let s=0,o=0,a=0;for(;s<r.length&&o<i.length;)e(r[s],i[o])<=0?t[a++]=r[s++]:t[a++]=i[o++];for(;s<r.length;)t[a++]=r[s++];for(;o<i.length;)t[a++]=i[o++];return t}function pS(t,e,n=0){const r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);(s===13||s===10)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function hS(t){const e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function Tq(t){const e=hS(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var mS;(()=>{var t={470:i=>{function s(c){if(typeof c!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(c))}function o(c,u){for(var l,d="",f=0,p=-1,h=0,v=0;v<=c.length;++v){if(v<c.length)l=c.charCodeAt(v);else{if(l===47)break;l=47}if(l===47){if(!(p===v-1||h===1))if(p!==v-1&&h===2){if(d.length<2||f!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var b=d.lastIndexOf("/");if(b!==d.length-1){b===-1?(d="",f=0):f=(d=d.slice(0,b)).length-1-d.lastIndexOf("/"),p=v,h=0;continue}}else if(d.length===2||d.length===1){d="",f=0,p=v,h=0;continue}}u&&(d.length>0?d+="/..":d="..",f=2)}else d.length>0?d+="/"+c.slice(p+1,v):d=c.slice(p+1,v),f=v-p-1;p=v,h=0}else l===46&&h!==-1?++h:h=-1}return d}var a={resolve:function(){for(var c,u="",l=!1,d=arguments.length-1;d>=-1&&!l;d--){var f;d>=0?f=arguments[d]:(c===void 0&&(c=process.cwd()),f=c),s(f),f.length!==0&&(u=f+"/"+u,l=f.charCodeAt(0)===47)}return u=o(u,!l),l?u.length>0?"/"+u:"/":u.length>0?u:"."},normalize:function(c){if(s(c),c.length===0)return".";var u=c.charCodeAt(0)===47,l=c.charCodeAt(c.length-1)===47;return(c=o(c,!u)).length!==0||u||(c="."),c.length>0&&l&&(c+="/"),u?"/"+c:c},isAbsolute:function(c){return s(c),c.length>0&&c.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var c,u=0;u<arguments.length;++u){var l=arguments[u];s(l),l.length>0&&(c===void 0?c=l:c+="/"+l)}return c===void 0?".":a.normalize(c)},relative:function(c,u){if(s(c),s(u),c===u||(c=a.resolve(c))===(u=a.resolve(u)))return"";for(var l=1;l<c.length&&c.charCodeAt(l)===47;++l);for(var d=c.length,f=d-l,p=1;p<u.length&&u.charCodeAt(p)===47;++p);for(var h=u.length-p,v=f<h?f:h,b=-1,g=0;g<=v;++g){if(g===v){if(h>v){if(u.charCodeAt(p+g)===47)return u.slice(p+g+1);if(g===0)return u.slice(p+g)}else f>v&&(c.charCodeAt(l+g)===47?b=g:g===0&&(b=0));break}var w=c.charCodeAt(l+g);if(w!==u.charCodeAt(p+g))break;w===47&&(b=g)}var R="";for(g=l+b+1;g<=d;++g)g!==d&&c.charCodeAt(g)!==47||(R.length===0?R+="..":R+="/..");return R.length>0?R+u.slice(p+b):(p+=b,u.charCodeAt(p)===47&&++p,u.slice(p))},_makeLong:function(c){return c},dirname:function(c){if(s(c),c.length===0)return".";for(var u=c.charCodeAt(0),l=u===47,d=-1,f=!0,p=c.length-1;p>=1;--p)if((u=c.charCodeAt(p))===47){if(!f){d=p;break}}else f=!1;return d===-1?l?"/":".":l&&d===1?"//":c.slice(0,d)},basename:function(c,u){if(u!==void 0&&typeof u!="string")throw new TypeError('"ext" argument must be a string');s(c);var l,d=0,f=-1,p=!0;if(u!==void 0&&u.length>0&&u.length<=c.length){if(u.length===c.length&&u===c)return"";var h=u.length-1,v=-1;for(l=c.length-1;l>=0;--l){var b=c.charCodeAt(l);if(b===47){if(!p){d=l+1;break}}else v===-1&&(p=!1,v=l+1),h>=0&&(b===u.charCodeAt(h)?--h==-1&&(f=l):(h=-1,f=v))}return d===f?f=v:f===-1&&(f=c.length),c.slice(d,f)}for(l=c.length-1;l>=0;--l)if(c.charCodeAt(l)===47){if(!p){d=l+1;break}}else f===-1&&(p=!1,f=l+1);return f===-1?"":c.slice(d,f)},extname:function(c){s(c);for(var u=-1,l=0,d=-1,f=!0,p=0,h=c.length-1;h>=0;--h){var v=c.charCodeAt(h);if(v!==47)d===-1&&(f=!1,d=h+1),v===46?u===-1?u=h:p!==1&&(p=1):u!==-1&&(p=-1);else if(!f){l=h+1;break}}return u===-1||d===-1||p===0||p===1&&u===d-1&&u===l+1?"":c.slice(u,d)},format:function(c){if(c===null||typeof c!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof c);return function(u,l){var d=l.dir||l.root,f=l.base||(l.name||"")+(l.ext||"");return d?d===l.root?d+f:d+"/"+f:f}(0,c)},parse:function(c){s(c);var u={root:"",dir:"",base:"",ext:"",name:""};if(c.length===0)return u;var l,d=c.charCodeAt(0),f=d===47;f?(u.root="/",l=1):l=0;for(var p=-1,h=0,v=-1,b=!0,g=c.length-1,w=0;g>=l;--g)if((d=c.charCodeAt(g))!==47)v===-1&&(b=!1,v=g+1),d===46?p===-1?p=g:w!==1&&(w=1):p!==-1&&(w=-1);else if(!b){h=g+1;break}return p===-1||v===-1||w===0||w===1&&p===v-1&&p===h+1?v!==-1&&(u.base=u.name=h===0&&f?c.slice(1,v):c.slice(h,v)):(h===0&&f?(u.name=c.slice(1,p),u.base=c.slice(1,v)):(u.name=c.slice(h,p),u.base=c.slice(h,v)),u.ext=c.slice(p,v)),h>0?u.dir=c.slice(0,h-1):f&&(u.dir="/"),u},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,i.exports=a}},e={};function n(i){var s=e[i];if(s!==void 0)return s.exports;var o=e[i]={exports:{}};return t[i](o,o.exports,n),o.exports}n.d=(i,s)=>{for(var o in s)n.o(s,o)&&!n.o(i,o)&&Object.defineProperty(i,o,{enumerable:!0,get:s[o]})},n.o=(i,s)=>Object.prototype.hasOwnProperty.call(i,s),n.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var r={};(()=>{let i;n.r(r),n.d(r,{URI:()=>f,Utils:()=>Q}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,o=/^\//,a=/^\/\//;function c(I,T){if(!I.scheme&&T)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${I.authority}", path: "${I.path}", query: "${I.query}", fragment: "${I.fragment}"}`);if(I.scheme&&!s.test(I.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(I.path){if(I.authority){if(!o.test(I.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(a.test(I.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const u="",l="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class f{static isUri(T){return T instanceof f||!!T&&typeof T.authority=="string"&&typeof T.fragment=="string"&&typeof T.path=="string"&&typeof T.query=="string"&&typeof T.scheme=="string"&&typeof T.fsPath=="string"&&typeof T.with=="function"&&typeof T.toString=="function"}scheme;authority;path;query;fragment;constructor(T,$,L,V,H,K=!1){typeof T=="object"?(this.scheme=T.scheme||u,this.authority=T.authority||u,this.path=T.path||u,this.query=T.query||u,this.fragment=T.fragment||u):(this.scheme=function(we,te){return we||te?we:"file"}(T,K),this.authority=$||u,this.path=function(we,te){switch(we){case"https":case"http":case"file":te?te[0]!==l&&(te=l+te):te=l}return te}(this.scheme,L||u),this.query=V||u,this.fragment=H||u,c(this,K))}get fsPath(){return w(this)}with(T){if(!T)return this;let{scheme:$,authority:L,path:V,query:H,fragment:K}=T;return $===void 0?$=this.scheme:$===null&&($=u),L===void 0?L=this.authority:L===null&&(L=u),V===void 0?V=this.path:V===null&&(V=u),H===void 0?H=this.query:H===null&&(H=u),K===void 0?K=this.fragment:K===null&&(K=u),$===this.scheme&&L===this.authority&&V===this.path&&H===this.query&&K===this.fragment?this:new h($,L,V,H,K)}static parse(T,$=!1){const L=d.exec(T);return L?new h(L[2]||u,N(L[4]||u),N(L[5]||u),N(L[7]||u),N(L[9]||u),$):new h(u,u,u,u,u)}static file(T){let $=u;if(i&&(T=T.replace(/\\/g,l)),T[0]===l&&T[1]===l){const L=T.indexOf(l,2);L===-1?($=T.substring(2),T=l):($=T.substring(2,L),T=T.substring(L)||l)}return new h("file",$,T,u,u)}static from(T){const $=new h(T.scheme,T.authority,T.path,T.query,T.fragment);return c($,!0),$}toString(T=!1){return R(this,T)}toJSON(){return this}static revive(T){if(T){if(T instanceof f)return T;{const $=new h(T);return $._formatted=T.external,$._fsPath=T._sep===p?T.fsPath:null,$}}return T}}const p=i?1:void 0;class h extends f{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=w(this)),this._fsPath}toString(T=!1){return T?R(this,!0):(this._formatted||(this._formatted=R(this,!1)),this._formatted)}toJSON(){const T={$mid:1};return this._fsPath&&(T.fsPath=this._fsPath,T._sep=p),this._formatted&&(T.external=this._formatted),this.path&&(T.path=this.path),this.scheme&&(T.scheme=this.scheme),this.authority&&(T.authority=this.authority),this.query&&(T.query=this.query),this.fragment&&(T.fragment=this.fragment),T}}const v={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function b(I,T,$){let L,V=-1;for(let H=0;H<I.length;H++){const K=I.charCodeAt(H);if(K>=97&&K<=122||K>=65&&K<=90||K>=48&&K<=57||K===45||K===46||K===95||K===126||T&&K===47||$&&K===91||$&&K===93||$&&K===58)V!==-1&&(L+=encodeURIComponent(I.substring(V,H)),V=-1),L!==void 0&&(L+=I.charAt(H));else{L===void 0&&(L=I.substr(0,H));const we=v[K];we!==void 0?(V!==-1&&(L+=encodeURIComponent(I.substring(V,H)),V=-1),L+=we):V===-1&&(V=H)}}return V!==-1&&(L+=encodeURIComponent(I.substring(V))),L!==void 0?L:I}function g(I){let T;for(let $=0;$<I.length;$++){const L=I.charCodeAt($);L===35||L===63?(T===void 0&&(T=I.substr(0,$)),T+=v[L]):T!==void 0&&(T+=I[$])}return T!==void 0?T:I}function w(I,T){let $;return $=I.authority&&I.path.length>1&&I.scheme==="file"?`//${I.authority}${I.path}`:I.path.charCodeAt(0)===47&&(I.path.charCodeAt(1)>=65&&I.path.charCodeAt(1)<=90||I.path.charCodeAt(1)>=97&&I.path.charCodeAt(1)<=122)&&I.path.charCodeAt(2)===58?I.path[1].toLowerCase()+I.path.substr(2):I.path,i&&($=$.replace(/\//g,"\\")),$}function R(I,T){const $=T?g:b;let L="",{scheme:V,authority:H,path:K,query:we,fragment:te}=I;if(V&&(L+=V,L+=":"),(H||V==="file")&&(L+=l,L+=l),H){let C=H.indexOf("@");if(C!==-1){const he=H.substr(0,C);H=H.substr(C+1),C=he.lastIndexOf(":"),C===-1?L+=$(he,!1,!1):(L+=$(he.substr(0,C),!1,!1),L+=":",L+=$(he.substr(C+1),!1,!0)),L+="@"}H=H.toLowerCase(),C=H.lastIndexOf(":"),C===-1?L+=$(H,!1,!0):(L+=$(H.substr(0,C),!1,!0),L+=H.substr(C))}if(K){if(K.length>=3&&K.charCodeAt(0)===47&&K.charCodeAt(2)===58){const C=K.charCodeAt(1);C>=65&&C<=90&&(K=`/${String.fromCharCode(C+32)}:${K.substr(3)}`)}else if(K.length>=2&&K.charCodeAt(1)===58){const C=K.charCodeAt(0);C>=65&&C<=90&&(K=`${String.fromCharCode(C+32)}:${K.substr(2)}`)}L+=$(K,!0,!1)}return we&&(L+="?",L+=$(we,!1,!1)),te&&(L+="#",L+=T?te:b(te,!1,!1)),L}function k(I){try{return decodeURIComponent(I)}catch{return I.length>3?I.substr(0,3)+k(I.substr(3)):I}}const A=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function N(I){return I.match(A)?I.replace(A,T=>k(T)):I}var _=n(470);const B=_.posix||_,z="/";var Q;(function(I){I.joinPath=function(T,...$){return T.with({path:B.join(T.path,...$)})},I.resolvePath=function(T,...$){let L=T.path,V=!1;L[0]!==z&&(L=z+L,V=!0);let H=B.resolve(L,...$);return V&&H[0]===z&&!T.authority&&(H=H.substring(1)),T.with({path:H})},I.dirname=function(T){if(T.path.length===0||T.path===z)return T;let $=B.dirname(T.path);return $.length===1&&$.charCodeAt(0)===46&&($=""),T.with({path:$})},I.basename=function(T){return B.basename(T.path)},I.extname=function(T){return B.extname(T.path)}})(Q||(Q={}))})(),mS=r})();const{URI:Zt,Utils:Uc}=mS;var Ct;(function(t){t.basename=Uc.basename,t.dirname=Uc.dirname,t.extname=Uc.extname,t.joinPath=Uc.joinPath,t.resolvePath=Uc.resolvePath;function e(i,s){return i?.toString()===s?.toString()}t.equals=e;function n(i,s){const o=typeof i=="string"?i:i.path,a=typeof s=="string"?s:s.path,c=o.split("/").filter(p=>p.length>0),u=a.split("/").filter(p=>p.length>0);let l=0;for(;l<c.length&&c[l]===u[l];l++);const d="../".repeat(c.length-l),f=u.slice(l).join("/");return d+f}t.relative=n;function r(i){return Zt.parse(i.toString()).toString()}t.normalize=r})(Ct||(Ct={}));var He;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(He||(He={}));class Sq{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,n=ct.CancellationToken.None){const r=await this.fileSystemProvider.readFile(e);return this.createAsync(e,r,n)}fromTextDocument(e,n,r){return n=n??Zt.parse(e.uri),ct.CancellationToken.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromString(e,n,r){return ct.CancellationToken.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromModel(e,n){return this.create(n,{$model:e})}create(e,n,r){if(typeof n=="string"){const i=this.parse(e,n,r);return this.createLangiumDocument(i,e,void 0,n)}else if("$model"in n){const i={value:n.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,n.getText(),r);return this.createLangiumDocument(i,e,n)}}async createAsync(e,n,r){if(typeof n=="string"){const i=await this.parseAsync(e,n,r);return this.createLangiumDocument(i,e,void 0,n)}else{const i=await this.parseAsync(e,n.getText(),r);return this.createLangiumDocument(i,e,n)}}createLangiumDocument(e,n,r,i){let s;if(r)s={parseResult:e,uri:n,state:He.Parsed,references:[],textDocument:r};else{const o=this.createTextDocumentGetter(n,i);s={parseResult:e,uri:n,state:He.Parsed,references:[],get textDocument(){return o()}}}return e.value.$document=s,s}async update(e,n){var r,i;const s=(r=e.parseResult.value.$cstNode)===null||r===void 0?void 0:r.root.fullText,o=(i=this.textDocuments)===null||i===void 0?void 0:i.get(e.uri.toString()),a=o?o.getText():await this.fileSystemProvider.readFile(e.uri);if(o)Object.defineProperty(e,"textDocument",{value:o});else{const c=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:c})}return s!==a&&(e.parseResult=await this.parseAsync(e.uri,a,n),e.parseResult.value.$document=e),e.state=He.Parsed,e}parse(e,n,r){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(n,r)}parseAsync(e,n,r){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(n,r)}createTextDocumentGetter(e,n){const r=this.serviceRegistry;let i;return()=>i??(i=Cp.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,n??""))}}class kq{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return st(this.documentMap.values())}addDocument(e){const n=e.uri.toString();if(this.documentMap.has(n))throw new Error(`A document with the URI '${n}' is already present.`);this.documentMap.set(n,e)}getDocument(e){const n=e.toString();return this.documentMap.get(n)}async getOrCreateDocument(e,n){let r=this.getDocument(e);return r||(r=await this.langiumDocumentFactory.fromUri(e,n),this.addDocument(r),r)}createDocument(e,n,r){if(r)return this.langiumDocumentFactory.fromString(n,e,r).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(n,e);return this.addDocument(i),i}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){const n=e.toString(),r=this.documentMap.get(n);return r&&(this.serviceRegistry.getServices(e).references.Linker.unlink(r),r.state=He.Changed,r.precomputedScopes=void 0,r.diagnostics=void 0),r}deleteDocument(e){const n=e.toString(),r=this.documentMap.get(n);return r&&(r.state=He.Changed,this.documentMap.delete(n)),r}}const vv=Symbol("ref_resolving");class Cq{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,n=ct.CancellationToken.None){for(const r of ei(e.parseResult.value))await jt(n),Rf(r).forEach(i=>this.doLink(i,e))}doLink(e,n){var r;const i=e.reference;if(i._ref===void 0){i._ref=vv;try{const s=this.getCandidate(e);if(uf(s))i._ref=s;else if(i._nodeDescription=s,this.langiumDocuments().hasDocument(s.documentUri)){const o=this.loadAstNode(s);i._ref=o??this.createLinkingError(e,s)}else i._ref=void 0}catch(s){console.error(`An error occurred while resolving reference to '${i.$refText}':`,s);const o=(r=s.message)!==null&&r!==void 0?r:String(s);i._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${i.$refText}': ${o}`})}n.references.push(i)}}unlink(e){for(const n of e.references)delete n._ref,delete n._nodeDescription;e.references=[]}getCandidate(e){const r=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return r??this.createLinkingError(e)}buildReference(e,n,r,i){const s=this,o={$refNode:r,$refText:i,get ref(){var a;if(Tt(this._ref))return this._ref;if(jF(this._nodeDescription)){const c=s.loadAstNode(this._nodeDescription);this._ref=c??s.createLinkingError({reference:o,container:e,property:n},this._nodeDescription)}else if(this._ref===void 0){this._ref=vv;const c=Ef(e).$document,u=s.getLinkedNode({reference:o,container:e,property:n});if(u.error&&c&&c.state<He.ComputedScopes)return this._ref=void 0;this._ref=(a=u.node)!==null&&a!==void 0?a:u.error,this._nodeDescription=u.descr,c?.references.push(this)}else if(this._ref===vv)throw new Error(`Cyclic reference resolution detected: ${s.astNodeLocator.getAstNodePath(e)}/${n} (symbol '${i}')`);return Tt(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return uf(this._ref)?this._ref:void 0}};return o}getLinkedNode(e){var n;try{const r=this.getCandidate(e);if(uf(r))return{error:r};const i=this.loadAstNode(r);return i?{node:i,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const i=(n=r.message)!==null&&n!==void 0?n:String(r);return{error:Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${e.reference.$refText}': ${i}`})}}}loadAstNode(e){if(e.node)return e.node;const n=this.langiumDocuments().getDocument(e.documentUri);if(n)return this.astNodeLocator.getAstNode(n.parseResult.value,e.path)}createLinkingError(e,n){const r=Ef(e.container).$document;r&&r.state<He.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${r.uri}).`);const i=this.reflection.getReferenceType(e);return Object.assign(Object.assign({},e),{message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:n})}}function Ap(t){return typeof t.name=="string"}class gS{getName(e){if(Ap(e))return e.name}getNameNode(e){return kn(e.$cstNode,"name")}}class Aq{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){const n=$E(e),r=e.astNode;if(n&&r){const i=r[n.feature];if(Yn(i))return i.ref;if(Array.isArray(i)){for(const s of i)if(Yn(s)&&s.$refNode&&s.$refNode.offset<=e.offset&&s.$refNode.end>=e.end)return s.ref}}if(r){const i=this.nameProvider.getNameNode(r);if(i&&(i===e||nE(e,i)))return r}}}findDeclarationNode(e){const n=this.findDeclaration(e);if(n?.$cstNode){const r=this.nameProvider.getNameNode(n);return r??n.$cstNode}}findReferences(e,n){const r=[];if(n.includeDeclaration){const s=this.getReferenceToSelf(e);s&&r.push(s)}let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return n.documentUri&&(i=i.filter(s=>Ct.equals(s.sourceUri,n.documentUri))),r.push(...i),st(r)}getReferenceToSelf(e){const n=this.nameProvider.getNameNode(e);if(n){const r=bt(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:r.uri,sourcePath:i,targetUri:r.uri,targetPath:i,segment:Oa(n),local:!0}}}}class zn{constructor(e){if(this.map=new Map,e)for(const[n,r]of e)this.add(n,r)}get size(){return $g.sum(st(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,n){if(n===void 0)return this.map.delete(e);{const r=this.map.get(e);if(r){const i=r.indexOf(n);if(i>=0)return r.length===1?this.map.delete(e):r.splice(i,1),!0}return!1}}get(e){var n;return(n=this.map.get(e))!==null&&n!==void 0?n:[]}has(e,n){if(n===void 0)return this.map.has(e);{const r=this.map.get(e);return r?r.indexOf(n)>=0:!1}}add(e,n){return this.map.has(e)?this.map.get(e).push(n):this.map.set(e,[n]),this}addAll(e,n){return this.map.has(e)?this.map.get(e).push(...n):this.map.set(e,Array.from(n)),this}forEach(e){this.map.forEach((n,r)=>n.forEach(i=>e(i,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return st(this.map.entries()).flatMap(([e,n])=>n.map(r=>[e,r]))}keys(){return st(this.map.keys())}values(){return st(this.map.values()).flat()}entriesGroupedByKey(){return st(this.map.entries())}}class yS{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[n,r]of e)this.set(n,r)}clear(){this.map.clear(),this.inverse.clear()}set(e,n){return this.map.set(e,n),this.inverse.set(n,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const n=this.map.get(e);return n!==void 0?(this.map.delete(e),this.inverse.delete(n),!0):!1}}class vS{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,n=ct.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,n)}async computeExportsForNode(e,n,r=mc,i=ct.CancellationToken.None){const s=[];this.exportNode(e,s,n);for(const o of r(e))await jt(i),this.exportNode(o,s,n);return s}exportNode(e,n,r){const i=this.nameProvider.getName(e);i&&n.push(this.descriptions.createDescription(e,i,r))}async computeLocalScopes(e,n=ct.CancellationToken.None){const r=e.parseResult.value,i=new zn;for(const s of _r(r))await jt(n),this.processNode(s,e,i);return i}processNode(e,n,r){const i=e.$container;if(i){const s=this.nameProvider.getName(e);s&&r.add(i,this.descriptions.createDescription(e,s,n))}}}class Ns{constructor(e,n,r){var i;this.elements=e,this.outerScope=n,this.caseInsensitive=(i=r?.caseInsensitive)!==null&&i!==void 0?i:!1}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const n=this.caseInsensitive?this.elements.find(r=>r.name.toLowerCase()===e.toLowerCase()):this.elements.find(r=>r.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}}class wS{constructor(e,n,r){var i;this.elements=new Map,this.caseInsensitive=(i=r?.caseInsensitive)!==null&&i!==void 0?i:!1;for(const s of e){const o=this.caseInsensitive?s.name.toLowerCase():s.name;this.elements.set(o,s)}this.outerScope=n}getElement(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(n);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getAllElements(){let e=st(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}const _p={getElement(){},getAllElements(){return ko}};class bS{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}}class _q extends bS{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,n){this.throwIfDisposed(),this.cache.set(e,n)}get(e,n){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(n){const r=n();return this.cache.set(e,r),r}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}}class DS extends bS{constructor(e){super(),this.cache=new Map,this.converter=e??(n=>n)}has(e,n){return this.throwIfDisposed(),this.cacheForContext(e).has(n)}set(e,n,r){this.throwIfDisposed(),this.cacheForContext(e).set(n,r)}get(e,n,r){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(n))return i.get(n);if(r){const s=r();return i.set(n,s),s}else return}delete(e,n){return this.throwIfDisposed(),this.cacheForContext(e).delete(n)}clear(e){if(this.throwIfDisposed(),e){const n=this.converter(e);this.cache.delete(n)}else this.cache.clear()}cacheForContext(e){const n=this.converter(e);let r=this.cache.get(n);return r||(r=new Map,this.cache.set(n,r)),r}}class Pq extends DS{constructor(e,n){super(r=>r.toString()),n?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(n,r=>{this.clear(r.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,i)=>{for(const s of i)this.clear(s)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,i)=>{const s=r.concat(i);for(const o of s)this.clear(o)}))}}class ES extends _q{constructor(e,n){super(),n?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(n,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}class RS{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new ES(e.shared)}getScope(e){const n=[],r=this.reflection.getReferenceType(e),i=bt(e.container).precomputedScopes;if(i){let o=e.container;do{const a=i.get(o);a.length>0&&n.push(st(a).filter(c=>this.reflection.isSubtype(c.type,r))),o=o.$container}while(o)}let s=this.getGlobalScope(r,e);for(let o=n.length-1;o>=0;o--)s=this.createScope(n[o],s);return s}createScope(e,n,r){return new Ns(st(e),n,r)}createScopeForNodes(e,n,r){const i=st(e).map(s=>{const o=this.nameProvider.getName(s);if(o)return this.descriptions.createDescription(s,o)}).nonNullable();return new Ns(i,n,r)}getGlobalScope(e,n){return this.globalScopeCache.get(e,()=>new wS(this.indexManager.allElements(e)))}}function xq(t){return typeof t.$comment=="string"}function $S(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class Iq{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,n){const r=n??{},i=n?.replacer,s=(a,c)=>this.replacer(a,c,r),o=i?(a,c)=>i(a,c,s):s;try{return this.currentDocument=bt(e),JSON.stringify(e,o,n?.space)}finally{this.currentDocument=void 0}}deserialize(e,n){const r=n??{},i=JSON.parse(e);return this.linkNode(i,i,r),i}replacer(e,n,{refText:r,sourceText:i,textRegions:s,comments:o,uriConverter:a}){var c,u,l,d;if(!this.ignoreProperties.has(e))if(Yn(n)){const f=n.ref,p=r?n.$refText:void 0;if(f){const h=bt(f);let v="";this.currentDocument&&this.currentDocument!==h&&(a?v=a(h.uri,n):v=h.uri.toString());const b=this.astNodeLocator.getAstNodePath(f);return{$ref:`${v}#${b}`,$refText:p}}else return{$error:(u=(c=n.error)===null||c===void 0?void 0:c.message)!==null&&u!==void 0?u:"Could not resolve reference",$refText:p}}else if(Tt(n)){let f;if(s&&(f=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},n)),(!e||n.$document)&&f?.$textRegion&&(f.$textRegion.documentURI=(l=this.currentDocument)===null||l===void 0?void 0:l.uri.toString())),i&&!e&&(f??(f=Object.assign({},n)),f.$sourceText=(d=n.$cstNode)===null||d===void 0?void 0:d.text),o){f??(f=Object.assign({},n));const p=this.commentProvider.getComment(n);p&&(f.$comment=p.replace(/\r/g,""))}return f??n}else return n}addAstNodeRegionWithAssignmentsTo(e){const n=r=>({offset:r.offset,end:r.end,length:r.length,range:r.range});if(e.$cstNode){const r=e.$textRegion=n(e.$cstNode),i=r.assignments={};return Object.keys(e).filter(s=>!s.startsWith("$")).forEach(s=>{const o=Po(e.$cstNode,s).map(n);o.length!==0&&(i[s]=o)}),e}}linkNode(e,n,r,i,s,o){for(const[c,u]of Object.entries(e))if(Array.isArray(u))for(let l=0;l<u.length;l++){const d=u[l];$S(d)?u[l]=this.reviveReference(e,c,n,d,r):Tt(d)&&this.linkNode(d,n,r,e,c,l)}else $S(u)?e[c]=this.reviveReference(e,c,n,u,r):Tt(u)&&this.linkNode(u,n,r,e,c);const a=e;a.$container=i,a.$containerProperty=s,a.$containerIndex=o}reviveReference(e,n,r,i,s){let o=i.$refText,a=i.$error;if(i.$ref){const c=this.getRefNode(r,i.$ref,s.uriConverter);if(Tt(c))return o||(o=this.nameProvider.getName(c)),{$refText:o??"",ref:c};a=c}if(a){const c={$refText:o??""};return c.error={container:e,property:n,message:a,reference:c},c}else return}getRefNode(e,n,r){try{const i=n.indexOf("#");if(i===0){const c=this.astNodeLocator.getAstNode(e,n.substring(1));return c||"Could not resolve path: "+n}if(i<0){const c=r?r(n):Zt.parse(n),u=this.langiumDocuments.getDocument(c);return u?u.parseResult.value:"Could not find document for URI: "+n}const s=r?r(n.substring(0,i)):Zt.parse(n.substring(0,i)),o=this.langiumDocuments.getDocument(s);if(!o)return"Could not find document for URI: "+n;if(i===n.length-1)return o.parseResult.value;const a=this.astNodeLocator.getAstNode(o.parseResult.value,n.substring(i+1));return a||"Could not resolve URI: "+n}catch(i){return String(i)}}}class Nq{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.textDocuments=e?.workspace.TextDocuments}register(e){const n=e.LanguageMetaData;for(const r of n.fileExtensions)this.fileExtensionMap.has(r)&&console.warn(`The file extension ${r} is used by multiple languages. It is now assigned to '${n.languageId}'.`),this.fileExtensionMap.set(r,e);this.languageIdMap.set(n.languageId,e),this.languageIdMap.size===1?this.singleton=e:this.singleton=void 0}getServices(e){var n,r;if(this.singleton!==void 0)return this.singleton;if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const i=(r=(n=this.textDocuments)===null||n===void 0?void 0:n.get(e))===null||r===void 0?void 0:r.languageId;if(i!==void 0){const a=this.languageIdMap.get(i);if(a)return a}const s=Ct.extname(e),o=this.fileExtensionMap.get(s);if(!o)throw i?new Error(`The service registry contains no services for the extension '${s}' for language '${i}'.`):new Error(`The service registry contains no services for the extension '${s}'.`);return o}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function Gc(t){return{code:t}}var Pp;(function(t){t.all=["fast","slow","built-in"]})(Pp||(Pp={}));class Oq{constructor(e){this.entries=new zn,this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,n=this,r="fast"){if(r==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");for(const[i,s]of Object.entries(e)){const o=s;if(Array.isArray(o))for(const a of o){const c={check:this.wrapValidationException(a,n),category:r};this.addEntry(i,c)}else if(typeof o=="function"){const a={check:this.wrapValidationException(o,n),category:r};this.addEntry(i,a)}else Fa()}}wrapValidationException(e,n){return async(r,i,s)=>{await this.handleException(()=>e.call(n,r,i,s),"An error occurred during validation",i,r)}}async handleException(e,n,r,i){try{await e()}catch(s){if(kp(s))throw s;console.error(`${n}:`,s),s instanceof Error&&s.stack&&console.error(s.stack);const o=s instanceof Error?s.message:String(s);r("error",`${n}: ${o}`,{node:i})}}addEntry(e,n){if(e==="AstNode"){this.entries.add("AstNode",n);return}for(const r of this.reflection.getAllSubTypes(e))this.entries.add(r,n)}getChecks(e,n){let r=st(this.entries.get(e)).concat(this.entries.get("AstNode"));return n&&(r=r.filter(i=>n.includes(i.category))),r.map(i=>i.check)}registerBeforeDocument(e,n=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",n))}registerAfterDocument(e,n=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",n))}wrapPreparationException(e,n,r){return async(i,s,o,a)=>{await this.handleException(()=>e.call(r,i,s,o,a),n,s,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}}class Fq{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,n={},r=ct.CancellationToken.None){const i=e.parseResult,s=[];if(await jt(r),(!n.categories||n.categories.includes("built-in"))&&(this.processLexingErrors(i,s,n),n.stopAfterLexingErrors&&s.some(o=>{var a;return((a=o.data)===null||a===void 0?void 0:a.code)===mr.LexingError})||(this.processParsingErrors(i,s,n),n.stopAfterParsingErrors&&s.some(o=>{var a;return((a=o.data)===null||a===void 0?void 0:a.code)===mr.ParsingError}))||(this.processLinkingErrors(e,s,n),n.stopAfterLinkingErrors&&s.some(o=>{var a;return((a=o.data)===null||a===void 0?void 0:a.code)===mr.LinkingError}))))return s;try{s.push(...await this.validateAst(i.value,n,r))}catch(o){if(kp(o))throw o;console.error("An error occurred during validation:",o)}return await jt(r),s}processLexingErrors(e,n,r){var i,s,o;const a=[...e.lexerErrors,...(s=(i=e.lexerReport)===null||i===void 0?void 0:i.diagnostics)!==null&&s!==void 0?s:[]];for(const c of a){const u=(o=c.severity)!==null&&o!==void 0?o:"error",l={severity:wv(u),range:{start:{line:c.line-1,character:c.column-1},end:{line:c.line-1,character:c.column+c.length-1}},message:c.message,data:Mq(u),source:this.getSource()};n.push(l)}}processParsingErrors(e,n,r){for(const i of e.parserErrors){let s;if(isNaN(i.token.startOffset)){if("previousToken"in i){const o=i.previousToken;if(isNaN(o.startOffset)){const a={line:0,character:0};s={start:a,end:a}}else{const a={line:o.endLine-1,character:o.endColumn};s={start:a,end:a}}}}else s=df(i.token);if(s){const o={severity:wv("error"),range:s,message:i.message,data:Gc(mr.ParsingError),source:this.getSource()};n.push(o)}}}processLinkingErrors(e,n,r){for(const i of e.references){const s=i.error;if(s){const o={node:s.container,property:s.property,index:s.index,data:{code:mr.LinkingError,containerType:s.container.$type,property:s.property,refText:s.reference.$refText}};n.push(this.toDiagnostic("error",s.message,o))}}}async validateAst(e,n,r=ct.CancellationToken.None){const i=[],s=(o,a,c)=>{i.push(this.toDiagnostic(o,a,c))};return await this.validateAstBefore(e,n,s,r),await this.validateAstNodes(e,n,s,r),await this.validateAstAfter(e,n,s,r),i}async validateAstBefore(e,n,r,i=ct.CancellationToken.None){var s;const o=this.validationRegistry.checksBefore;for(const a of o)await jt(i),await a(e,r,(s=n.categories)!==null&&s!==void 0?s:[],i)}async validateAstNodes(e,n,r,i=ct.CancellationToken.None){await Promise.all(ei(e).map(async s=>{await jt(i);const o=this.validationRegistry.getChecks(s.$type,n.categories);for(const a of o)await a(s,r,i)}))}async validateAstAfter(e,n,r,i=ct.CancellationToken.None){var s;const o=this.validationRegistry.checksAfter;for(const a of o)await jt(i),await a(e,r,(s=n.categories)!==null&&s!==void 0?s:[],i)}toDiagnostic(e,n,r){return{message:n,range:Lq(r),severity:wv(e),code:r.code,codeDescription:r.codeDescription,tags:r.tags,relatedInformation:r.relatedInformation,data:r.data,source:this.getSource()}}getSource(){return this.metadata.languageId}}function Lq(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=kn(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=vc(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function wv(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}function Mq(t){switch(t){case"error":return Gc(mr.LexingError);case"warning":return Gc(mr.LexingWarning);case"info":return Gc(mr.LexingInfo);case"hint":return Gc(mr.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var mr;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(mr||(mr={}));class Bq{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,n,r){const i=r??bt(e);n??(n=this.nameProvider.getName(e));const s=this.astNodeLocator.getAstNodePath(e);if(!n)throw new Error(`Node at path ${s} has no name.`);let o;const a=()=>{var c;return o??(o=Oa((c=this.nameProvider.getNameNode(e))!==null&&c!==void 0?c:e.$cstNode))};return{node:e,name:n,get nameSegment(){return a()},selectionSegment:Oa(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}}class zq{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,n=ct.CancellationToken.None){const r=[],i=e.parseResult.value;for(const s of ei(i))await jt(n),Rf(s).filter(o=>!uf(o)).forEach(o=>{const a=this.createDescription(o);a&&r.push(a)});return r}createDescription(e){const n=e.reference.$nodeDescription,r=e.reference.$refNode;if(!n||!r)return;const i=bt(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:n.documentUri,targetPath:n.path,segment:Oa(r),local:Ct.equals(n.documentUri,i)}}}class qq{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const n=this.getAstNodePath(e.$container),r=this.getPathSegment(e);return n+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:e,$containerIndex:n}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return n!==void 0?e+this.indexSeparator+n:e}getAstNode(e,n){return n.split(this.segmentSeparator).reduce((i,s)=>{if(!i||s.length===0)return i;const o=s.indexOf(this.indexSeparator);if(o>0){const a=s.substring(0,o),c=parseInt(s.substring(o+1)),u=i[a];return u?.[c]}return i[s]},e)}}var jq=Ho();class Uq{constructor(e){this._ready=new gv,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new jq.Emitter,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var n,r;this.workspaceConfig=(r=(n=e.capabilities.workspace)===null||n===void 0?void 0:n.configuration)!==null&&r!==void 0?r:!1}async initialized(e){if(this.workspaceConfig){if(e.register){const n=this.serviceRegistry.all;e.register({section:n.map(r=>this.toSectionName(r.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const n=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),r=await e.fetchConfiguration(n);n.forEach((i,s)=>{this.updateSectionConfiguration(i.section,r[s])})}}this._ready.resolve()}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach(n=>{const r=e.settings[n];this.updateSectionConfiguration(n,r),this.onConfigurationSectionUpdateEmitter.fire({section:n,configuration:r})})}updateSectionConfiguration(e,n){this.settings[e]=n}async getConfiguration(e,n){await this.ready;const r=this.toSectionName(e);if(this.settings[r])return this.settings[r][n]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}var Os;(function(t){function e(n){return{dispose:async()=>await n()}}t.create=e})(Os||(Os={}));class Gq{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new zn,this.documentPhaseListeners=new zn,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=He.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,n={},r=ct.CancellationToken.None){var i,s;for(const o of e){const a=o.uri.toString();if(o.state===He.Validated){if(typeof n.validation=="boolean"&&n.validation)o.state=He.IndexedReferences,o.diagnostics=void 0,this.buildState.delete(a);else if(typeof n.validation=="object"){const c=this.buildState.get(a),u=(i=c?.result)===null||i===void 0?void 0:i.validationChecks;if(u){const d=((s=n.validation.categories)!==null&&s!==void 0?s:Pp.all).filter(f=>!u.includes(f));d.length>0&&(this.buildState.set(a,{completed:!1,options:{validation:Object.assign(Object.assign({},n.validation),{categories:d})},result:c.result}),o.state=He.IndexedReferences)}}}else this.buildState.delete(a)}this.currentState=He.Changed,await this.emitUpdate(e.map(o=>o.uri),[]),await this.buildDocuments(e,n,r)}async update(e,n,r=ct.CancellationToken.None){this.currentState=He.Changed;for(const o of n)this.langiumDocuments.deleteDocument(o),this.buildState.delete(o.toString()),this.indexManager.remove(o);for(const o of e){if(!this.langiumDocuments.invalidateDocument(o)){const c=this.langiumDocumentFactory.fromModel({$type:"INVALID"},o);c.state=He.Changed,this.langiumDocuments.addDocument(c)}this.buildState.delete(o.toString())}const i=st(e).concat(n).map(o=>o.toString()).toSet();this.langiumDocuments.all.filter(o=>!i.has(o.uri.toString())&&this.shouldRelink(o,i)).forEach(o=>{this.serviceRegistry.getServices(o.uri).references.Linker.unlink(o),o.state=Math.min(o.state,He.ComputedScopes),o.diagnostics=void 0}),await this.emitUpdate(e,n),await jt(r);const s=this.sortDocuments(this.langiumDocuments.all.filter(o=>{var a;return o.state<He.Linked||!(!((a=this.buildState.get(o.uri.toString()))===null||a===void 0)&&a.completed)}).toArray());await this.buildDocuments(s,this.updateBuildOptions,r)}async emitUpdate(e,n){await Promise.all(this.updateListeners.map(r=>r(e,n)))}sortDocuments(e){let n=0,r=e.length-1;for(;n<r;){for(;n<e.length&&this.hasTextDocument(e[n]);)n++;for(;r>=0&&!this.hasTextDocument(e[r]);)r--;n<r&&([e[n],e[r]]=[e[r],e[n]])}return e}hasTextDocument(e){var n;return!!(!((n=this.textDocuments)===null||n===void 0)&&n.get(e.uri))}shouldRelink(e,n){return e.references.some(r=>r.error!==void 0)?!0:this.indexManager.isAffected(e,n)}onUpdate(e){return this.updateListeners.push(e),Os.create(()=>{const n=this.updateListeners.indexOf(e);n>=0&&this.updateListeners.splice(n,1)})}async buildDocuments(e,n,r){this.prepareBuild(e,n),await this.runCancelable(e,He.Parsed,r,s=>this.langiumDocumentFactory.update(s,r)),await this.runCancelable(e,He.IndexedContent,r,s=>this.indexManager.updateContent(s,r)),await this.runCancelable(e,He.ComputedScopes,r,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.precomputedScopes=await o.computeLocalScopes(s,r)}),await this.runCancelable(e,He.Linked,r,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,r)),await this.runCancelable(e,He.IndexedReferences,r,s=>this.indexManager.updateReferences(s,r));const i=e.filter(s=>this.shouldValidate(s));await this.runCancelable(i,He.Validated,r,s=>this.validate(s,r));for(const s of e){const o=this.buildState.get(s.uri.toString());o&&(o.completed=!0)}}prepareBuild(e,n){for(const r of e){const i=r.uri.toString(),s=this.buildState.get(i);(!s||s.completed)&&this.buildState.set(i,{completed:!1,options:n,result:s?.result})}}async runCancelable(e,n,r,i){const s=e.filter(a=>a.state<n);for(const a of s)await jt(r),await i(a),a.state=n,await this.notifyDocumentPhase(a,n,r);const o=e.filter(a=>a.state===n);await this.notifyBuildPhase(o,n,r),this.currentState=n}onBuildPhase(e,n){return this.buildPhaseListeners.add(e,n),Os.create(()=>{this.buildPhaseListeners.delete(e,n)})}onDocumentPhase(e,n){return this.documentPhaseListeners.add(e,n),Os.create(()=>{this.documentPhaseListeners.delete(e,n)})}waitUntil(e,n,r){let i;if(n&&"path"in n?i=n:r=n,r??(r=ct.CancellationToken.None),i){const s=this.langiumDocuments.getDocument(i);if(s&&s.state>e)return Promise.resolve(i)}return this.currentState>=e?Promise.resolve(void 0):r.isCancellationRequested?Promise.reject(Sp):new Promise((s,o)=>{const a=this.onBuildPhase(e,()=>{if(a.dispose(),c.dispose(),i){const u=this.langiumDocuments.getDocument(i);s(u?.uri)}else s(void 0)}),c=r.onCancellationRequested(()=>{a.dispose(),c.dispose(),o(Sp)})})}async notifyDocumentPhase(e,n,r){const s=this.documentPhaseListeners.get(n).slice();for(const o of s)try{await o(e,r)}catch(a){if(!kp(a))throw a}}async notifyBuildPhase(e,n,r){if(e.length===0)return;const s=this.buildPhaseListeners.get(n).slice();for(const o of s)await jt(r),await o(e,r)}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,n){var r,i;const s=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,o=this.getBuildOptions(e).validation,a=typeof o=="object"?o:void 0,c=await s.validateDocument(e,a,n);e.diagnostics?e.diagnostics.push(...c):e.diagnostics=c;const u=this.buildState.get(e.uri.toString());if(u){(r=u.result)!==null&&r!==void 0||(u.result={});const l=(i=a?.categories)!==null&&i!==void 0?i:Pp.all;u.result.validationChecks?u.result.validationChecks.push(...l):u.result.validationChecks=[...l]}}getBuildOptions(e){var n,r;return(r=(n=this.buildState.get(e.uri.toString()))===null||n===void 0?void 0:n.options)!==null&&r!==void 0?r:{}}}class Wq{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new DS,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,n){const r=bt(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(o=>{Ct.equals(o.targetUri,r)&&o.targetPath===n&&i.push(o)})}),st(i)}allElements(e,n){let r=st(this.symbolIndex.keys());return n&&(r=r.filter(i=>!n||n.has(i))),r.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,n){var r;return n?this.symbolByTypeIndex.get(e,n,()=>{var s;return((s=this.symbolIndex.get(e))!==null&&s!==void 0?s:[]).filter(a=>this.astReflection.isSubtype(a.type,n))}):(r=this.symbolIndex.get(e))!==null&&r!==void 0?r:[]}remove(e){const n=e.toString();this.symbolIndex.delete(n),this.symbolByTypeIndex.clear(n),this.referenceIndex.delete(n)}async updateContent(e,n=ct.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,n),s=e.uri.toString();this.symbolIndex.set(s,i),this.symbolByTypeIndex.clear(s)}async updateReferences(e,n=ct.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,n);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,n){const r=this.referenceIndex.get(e.uri.toString());return r?r.some(i=>!i.local&&n.has(i.targetUri.toString())):!1}}class TS{constructor(e){this.initialBuildOptions={},this._ready=new gv,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){var n;this.folders=(n=e.workspaceFolders)!==null&&n!==void 0?n:void 0}initialized(e){return this.mutex.write(n=>{var r;return this.initializeWorkspace((r=this.folders)!==null&&r!==void 0?r:[],n)})}async initializeWorkspace(e,n=ct.CancellationToken.None){const r=await this.performStartup(e);await jt(n),await this.documentBuilder.build(r,this.initialBuildOptions,n)}async performStartup(e){const n=this.serviceRegistry.all.flatMap(s=>s.LanguageMetaData.fileExtensions),r=[],i=s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)};return await this.loadAdditionalDocuments(e,i),await Promise.all(e.map(s=>[s,this.getRootFolder(s)]).map(async s=>this.traverseFolder(...s,n,i))),this._ready.resolve(),r}loadAdditionalDocuments(e,n){return Promise.resolve()}getRootFolder(e){return Zt.parse(e.uri)}async traverseFolder(e,n,r,i){const s=await this.fileSystemProvider.readDirectory(n);await Promise.all(s.map(async o=>{if(this.includeEntry(e,o,r)){if(o.isDirectory)await this.traverseFolder(e,o.uri,r,i);else if(o.isFile){const a=await this.langiumDocuments.getOrCreateDocument(o.uri);i(a)}}}))}includeEntry(e,n,r){const i=Ct.basename(n.uri);if(i.startsWith("."))return!1;if(n.isDirectory)return i!=="node_modules"&&i!=="out";if(n.isFile){const s=Ct.extname(n.uri);return r.includes(s)}return!1}}class Hq{buildUnexpectedCharactersMessage(e,n,r,i,s){return _y.buildUnexpectedCharactersMessage(e,n,r,i,s)}buildUnableToPopLexerModeMessage(e){return _y.buildUnableToPopLexerModeMessage(e)}}const Vq={mode:"full"};class Kq{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const n=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(n);const r=kS(n)?Object.values(n):n,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new xn(r,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,n=Vq){var r,i,s;const o=this.chevrotainLexer.tokenize(e);return{tokens:o.tokens,errors:o.errors,hidden:(r=o.groups.hidden)!==null&&r!==void 0?r:[],report:(s=(i=this.tokenBuilder).flushLexingReport)===null||s===void 0?void 0:s.call(i,e)}}toTokenTypeDictionary(e){if(kS(e))return e;const n=SS(e)?Object.values(e.modes).flat():e,r={};return n.forEach(i=>r[i.name]=i),r}}function Yq(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function SS(t){return t&&"modes"in t&&"defaultMode"in t}function kS(t){return!Yq(t)&&!SS(t)}function Xq(t,e,n){let r,i;typeof t=="string"?(i=e,r=n):(i=t.range.start,r=e),i||(i=nt.create(0,0));const s=CS(t),o=Dv(r),a=Qq({lines:s,position:i,options:o});return ij({index:0,tokens:a,position:i})}function Jq(t,e){const n=Dv(e),r=CS(t);if(r.length===0)return!1;const i=r[0],s=r[r.length-1],o=n.start,a=n.end;return!!o?.exec(i)&&!!a?.exec(s)}function CS(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(bE)}const AS=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,Zq=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function Qq(t){var e,n,r;const i=[];let s=t.position.line,o=t.position.character;for(let a=0;a<t.lines.length;a++){const c=a===0,u=a===t.lines.length-1;let l=t.lines[a],d=0;if(c&&t.options.start){const p=(e=t.options.start)===null||e===void 0?void 0:e.exec(l);p&&(d=p.index+p[0].length)}else{const p=(n=t.options.line)===null||n===void 0?void 0:n.exec(l);p&&(d=p.index+p[0].length)}if(u){const p=(r=t.options.end)===null||r===void 0?void 0:r.exec(l);p&&(l=l.substring(0,p.index))}if(l=l.substring(0,rj(l)),bv(l,d)>=l.length){if(i.length>0){const p=nt.create(s,o);i.push({type:"break",content:"",range:Ue.create(p,p)})}}else{AS.lastIndex=d;const p=AS.exec(l);if(p){const h=p[0],v=p[1],b=nt.create(s,o+d),g=nt.create(s,o+d+h.length);i.push({type:"tag",content:v,range:Ue.create(b,g)}),d+=h.length,d=bv(l,d)}if(d<l.length){const h=l.substring(d),v=Array.from(h.matchAll(Zq));i.push(...ej(v,h,s,o+d))}}s++,o=0}return i.length>0&&i[i.length-1].type==="break"?i.slice(0,-1):i}function ej(t,e,n,r){const i=[];if(t.length===0){const s=nt.create(n,r),o=nt.create(n,r+e.length);i.push({type:"text",content:e,range:Ue.create(s,o)})}else{let s=0;for(const a of t){const c=a.index,u=e.substring(s,c);u.length>0&&i.push({type:"text",content:e.substring(s,c),range:Ue.create(nt.create(n,s+r),nt.create(n,c+r))});let l=u.length+1;const d=a[1];if(i.push({type:"inline-tag",content:d,range:Ue.create(nt.create(n,s+l+r),nt.create(n,s+l+d.length+r))}),l+=d.length,a.length===4){l+=a[2].length;const f=a[3];i.push({type:"text",content:f,range:Ue.create(nt.create(n,s+l+r),nt.create(n,s+l+f.length+r))})}else i.push({type:"text",content:"",range:Ue.create(nt.create(n,s+l+r),nt.create(n,s+l+r))});s=c+a[0].length}const o=e.substring(s);o.length>0&&i.push({type:"text",content:o,range:Ue.create(nt.create(n,s+r),nt.create(n,s+r+o.length))})}return i}const tj=/\S/,nj=/\s*$/;function bv(t,e){const n=t.substring(e).match(tj);return n?e+n.index:t.length}function rj(t){const e=t.match(nj);if(e&&typeof e.index=="number")return e.index}function ij(t){var e,n,r,i;const s=nt.create(t.position.line,t.position.character);if(t.tokens.length===0)return new IS([],Ue.create(s,s));const o=[];for(;t.index<t.tokens.length;){const u=sj(t,o[o.length-1]);u&&o.push(u)}const a=(n=(e=o[0])===null||e===void 0?void 0:e.range.start)!==null&&n!==void 0?n:s,c=(i=(r=o[o.length-1])===null||r===void 0?void 0:r.range.end)!==null&&i!==void 0?i:s;return new IS(o,Ue.create(a,c))}function sj(t,e){const n=t.tokens[t.index];if(n.type==="tag")return PS(t,!1);if(n.type==="text"||n.type==="inline-tag")return _S(t);oj(n,e),t.index++}function oj(t,e){if(e){const n=new NS("",t.range);"inlines"in e?e.inlines.push(n):e.content.inlines.push(n)}}function _S(t){let e=t.tokens[t.index];const n=e;let r=e;const i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(aj(t)),r=e,e=t.tokens[t.index];return new $v(i,Ue.create(n.range.start,r.range.end))}function aj(t){return t.tokens[t.index].type==="inline-tag"?PS(t,!0):xS(t)}function PS(t,e){const n=t.tokens[t.index++],r=n.content.substring(1),i=t.tokens[t.index];if(i?.type==="text")if(e){const s=xS(t);return new Rv(r,new $v([s],s.range),e,Ue.create(n.range.start,s.range.end))}else{const s=_S(t);return new Rv(r,s,e,Ue.create(n.range.start,s.range.end))}else{const s=n.range;return new Rv(r,new $v([],s),e,s)}}function xS(t){const e=t.tokens[t.index++];return new NS(e.content,e.range)}function Dv(t){if(!t)return Dv({start:"/**",end:"*/",line:"*"});const{start:e,end:n,line:r}=t;return{start:Ev(e,!0),end:Ev(n,!1),line:Ev(r,!0)}}function Ev(t,e){if(typeof t=="string"||typeof t=="object"){const n=typeof t=="string"?Cf(t):t.source;return e?new RegExp(`^\\s*${n}`):new RegExp(`\\s*${n}\\s*$`)}else return t}class IS{constructor(e,n){this.elements=e,this.range=n}getTag(e){return this.getAllTags().find(n=>n.name===e)}getTags(e){return this.getAllTags().filter(n=>n.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const n of this.elements)if(e.length===0)e=n.toString();else{const r=n.toString();e+=OS(e)+r}return e.trim()}toMarkdown(e){let n="";for(const r of this.elements)if(n.length===0)n=r.toMarkdown(e);else{const i=r.toMarkdown(e);n+=OS(n)+i}return n.trim()}}class Rv{constructor(e,n,r,i){this.name=e,this.content=n,this.inline=r,this.range=i}toString(){let e=`@${this.name}`;const n=this.content.toString();return this.content.inlines.length===1?e=`${e} ${n}`:this.content.inlines.length>1&&(e=`${e}
118
- ${n}`),this.inline?`{${e}}`:e}toMarkdown(e){var n,r;return(r=(n=e?.renderTag)===null||n===void 0?void 0:n.call(e,this))!==null&&r!==void 0?r:this.toMarkdownDefault(e)}toMarkdownDefault(e){const n=this.content.toMarkdown(e);if(this.inline){const s=cj(this.name,n,e??{});if(typeof s=="string")return s}let r="";e?.tag==="italic"||e?.tag===void 0?r="*":e?.tag==="bold"?r="**":e?.tag==="bold-italic"&&(r="***");let i=`${r}@${this.name}${r}`;return this.content.inlines.length===1?i=`${i} \u2014 ${n}`:this.content.inlines.length>1&&(i=`${i}
119
- ${n}`),this.inline?`{${i}}`:i}}function cj(t,e,n){var r,i;if(t==="linkplain"||t==="linkcode"||t==="link"){const s=e.indexOf(" ");let o=e;if(s>0){const c=bv(e,s);o=e.substring(c),e=e.substring(0,s)}return(t==="linkcode"||t==="link"&&n.link==="code")&&(o=`\`${o}\``),(i=(r=n.renderLink)===null||r===void 0?void 0:r.call(n,e,o))!==null&&i!==void 0?i:uj(e,o)}}function uj(t,e){try{return Zt.parse(t,!0),`[${e}](${t})`}catch{return t}}class $v{constructor(e,n){this.inlines=e,this.range=n}toString(){let e="";for(let n=0;n<this.inlines.length;n++){const r=this.inlines[n],i=this.inlines[n+1];e+=r.toString(),i&&i.range.start.line>r.range.start.line&&(e+=`
120
- `)}return e}toMarkdown(e){let n="";for(let r=0;r<this.inlines.length;r++){const i=this.inlines[r],s=this.inlines[r+1];n+=i.toMarkdown(e),s&&s.range.start.line>i.range.start.line&&(n+=`
121
- `)}return n}}class NS{constructor(e,n){this.text=e,this.range=n}toString(){return this.text}toMarkdown(){return this.text}}function OS(t){return t.endsWith(`
122
- `)?`
123
- `:`
124
-
125
- `}class lj{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const n=this.commentProvider.getComment(e);if(n&&Jq(n))return Xq(n).toMarkdown({renderLink:(i,s)=>this.documentationLinkRenderer(e,i,s),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,n,r){var i;const s=(i=this.findNameInPrecomputedScopes(e,n))!==null&&i!==void 0?i:this.findNameInGlobalScope(e,n);if(s&&s.nameSegment){const o=s.nameSegment.range.start.line+1,a=s.nameSegment.range.start.character+1,c=s.documentUri.with({fragment:`L${o},${a}`});return`[${r}](${c.toString()})`}else return}documentationTagRenderer(e,n){}findNameInPrecomputedScopes(e,n){const i=bt(e).precomputedScopes;if(!i)return;let s=e;do{const a=i.get(s).find(c=>c.name===n);if(a)return a;s=s.$container}while(s)}findNameInGlobalScope(e,n){return this.indexManager.allElements().find(i=>i.name===n)}}class dj{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var n;return xq(e)?e.$comment:(n=ff(e.$cstNode,this.grammarConfig().multilineCommentRules))===null||n===void 0?void 0:n.text}}class fj{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,n){return Promise.resolve(this.syncParser.parse(e))}}class pj{constructor(){this.previousTokenSource=new ct.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const n=$q();return this.previousTokenSource=n,this.enqueue(this.writeQueue,e,n.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,n,r=ct.CancellationToken.None){const i=new gv,s={action:n,deferred:i,cancellationToken:r};return e.push(s),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:n,deferred:r,cancellationToken:i})=>{try{const s=await Promise.resolve().then(()=>n(i));r.resolve(s)}catch(s){kp(s)?r.resolve(void 0):r.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class hj{constructor(e){this.grammarElementIdMap=new yS,this.tokenTypeIdMap=new yS,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(n=>Object.assign(Object.assign({},n),{message:n.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const n=new Map,r=new Map;for(const i of ei(e))n.set(i,{});if(e.$cstNode)for(const i of Na(e.$cstNode))r.set(i,{});return{astNodes:n,cstNodes:r}}dehydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(r.$cstNode=this.dehydrateCstNode(e.$cstNode,n));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const o=[];r[i]=o;for(const a of s)Tt(a)?o.push(this.dehydrateAstNode(a,n)):Yn(a)?o.push(this.dehydrateReference(a,n)):o.push(a)}else Tt(s)?r[i]=this.dehydrateAstNode(s,n):Yn(s)?r[i]=this.dehydrateReference(s,n):s!==void 0&&(r[i]=s);return r}dehydrateReference(e,n){const r={};return r.$refText=e.$refText,e.$refNode&&(r.$refNode=n.cstNodes.get(e.$refNode)),r}dehydrateCstNode(e,n){const r=n.cstNodes.get(e);return eE(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=n.astNodes.get(e.astNode),Jr(e)?r.content=e.content.map(i=>this.dehydrateCstNode(i,n)):ws(e)&&(r.tokenType=e.tokenType.name,r.offset=e.offset,r.length=e.length,r.startLine=e.range.start.line,r.startColumn=e.range.start.character,r.endLine=e.range.end.line,r.endColumn=e.range.end.character),r}hydrate(e){const n=e.value,r=this.createHydrationContext(n);return"$cstNode"in n&&this.hydrateCstNode(n.$cstNode,r),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(n,r)}}createHydrationContext(e){const n=new Map,r=new Map;for(const s of ei(e))n.set(s,{});let i;if(e.$cstNode)for(const s of Na(e.$cstNode)){let o;"fullText"in s?(o=new eS(s.fullText),i=o):"content"in s?o=new dv:"tokenType"in s&&(o=this.hydrateCstLeafNode(s)),o&&(r.set(s,o),o.root=i)}return{astNodes:n,cstNodes:r}}hydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode&&(r.$cstNode=n.cstNodes.get(e.$cstNode));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const o=[];r[i]=o;for(const a of s)Tt(a)?o.push(this.setParent(this.hydrateAstNode(a,n),r)):Yn(a)?o.push(this.hydrateReference(a,r,i,n)):o.push(a)}else Tt(s)?r[i]=this.setParent(this.hydrateAstNode(s,n),r):Yn(s)?r[i]=this.hydrateReference(s,r,i,n):s!==void 0&&(r[i]=s);return r}setParent(e,n){return e.$container=n,e}hydrateReference(e,n,r,i){return this.linker.buildReference(n,r,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,n,r=0){const i=n.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=n.astNodes.get(e.astNode),Jr(i))for(const s of e.content){const o=this.hydrateCstNode(s,n,r++);i.content.push(o)}return i}hydrateCstLeafNode(e){const n=this.getTokenType(e.tokenType),r=e.offset,i=e.length,s=e.startLine,o=e.startColumn,a=e.endLine,c=e.endColumn,u=e.hidden;return new lv(r,i,{start:{line:s,character:o},end:{line:a,character:c}},n,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap();const n=this.grammarElementIdMap.getKey(e);if(n)return n;throw new Error("Invalid grammar element id: "+e)}createGrammarElementIdMap(){let e=0;for(const n of ei(this.grammar))Pg(n)&&this.grammarElementIdMap.set(n,e++)}}function FS(t){return{documentation:{CommentProvider:e=>new dj(e),DocumentationProvider:e=>new lj(e)},parser:{AsyncParser:e=>new fj(e),GrammarConfig:e=>AL(e),LangiumParser:e=>yq(e),CompletionParser:e=>gq(e),ValueConverter:()=>new bq,TokenBuilder:()=>new wq,Lexer:e=>new Kq(e),ParserErrorMessageProvider:()=>new iS,LexerErrorMessageProvider:()=>new Hq},workspace:{AstNodeLocator:()=>new qq,AstNodeDescriptionProvider:e=>new Bq(e),ReferenceDescriptionProvider:e=>new zq(e)},references:{Linker:e=>new Cq(e),NameProvider:()=>new gS,ScopeProvider:e=>new RS(e),ScopeComputation:e=>new vS(e),References:e=>new Aq(e)},serializer:{Hydrator:e=>new hj(e),JsonSerializer:e=>new Iq(e)},validation:{DocumentValidator:e=>new Fq(e),ValidationRegistry:e=>new Oq(e)},shared:()=>t.shared}}function LS(t){return{ServiceRegistry:e=>new Nq(e),workspace:{LangiumDocuments:e=>new kq(e),LangiumDocumentFactory:e=>new Sq(e),DocumentBuilder:e=>new Gq(e),IndexManager:e=>new Wq(e),WorkspaceManager:e=>new TS(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new pj,ConfigurationProvider:e=>new Uq(e)}}}var xp;(function(t){t.merge=(e,n)=>Np(Np({},e),n)})(xp||(xp={}));function Ip(t,e,n,r,i,s,o,a,c){const u=[t,e,n,r,i,s,o,a,c].reduce(Np,{});return BS(u)}const MS=Symbol("isProxy");function Tv(t){if(t&&t[MS])for(const e of Object.values(t))Tv(e);return t}function BS(t,e){const n=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(r,i)=>i===MS?!0:qS(r,i,t,e||n),getOwnPropertyDescriptor:(r,i)=>(qS(r,i,t,e||n),Object.getOwnPropertyDescriptor(r,i)),has:(r,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return n}const zS=Symbol();function qS(t,e,n,r){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:t[e]});if(t[e]===zS)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in n){const i=n[e];t[e]=zS;try{t[e]=typeof i=="function"?i(r):BS(i,r)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}function Np(t,e){if(e){for(const[n,r]of Object.entries(e))if(r!==void 0){const i=t[n];i!==null&&r!==null&&typeof i=="object"&&typeof r=="object"?t[n]=Np(i,r):t[n]=r}}return t}class mj{readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}}const jS={fileSystemProvider:()=>new mj},gj={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},yj={AstReflection:()=>new mE};function vj(){const t=Ip(LS(jS),yj),e=Ip(FS({shared:t}),gj);return t.ServiceRegistry.register(e),e}function wj(t){var e;const n=vj(),r=n.serializer.JsonSerializer.deserialize(t);return n.shared.workspace.LangiumDocumentFactory.fromModel(r,Zt.parse(`memory://${(e=r.name)!==null&&e!==void 0?e:"grammar"}.langium`)),r}function bj(t,e,n){let r=i=>t(i,...e);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:e})}function ut(t,e,n){let r=t.length-e.length;if(r===0)return t(...e);if(r===1)return bj(t,e,n);throw new Error("Wrong number of arguments")}function Wc(...t){return ut(Object.values,t)}var Dj={done:!0,hasNext:!1},Hc={done:!1,hasNext:!1},Ej=()=>Dj,Rj=t=>({hasNext:!0,next:t,done:!1});function tt(t,...e){let n=t,r=e.map(s=>"lazy"in s?$j(s):void 0),i=0;for(;i<e.length;){if(r[i]===void 0||!Tj(n)){let c=e[i];n=c(n),i+=1;continue}let s=[];for(let c=i;c<e.length;c++){let u=r[c];if(u===void 0||(s.push(u),u.isSingle))break}let o=[];for(let c of n)if(US(c,o,s))break;let{isSingle:a}=s.at(-1);n=a?o[0]:o,i+=s.length}return n}function US(t,e,n){if(n.length===0)return e.push(t),!1;let r=t,i=Hc,s=!1;for(let[o,a]of n.entries()){let{index:c,items:u}=a;if(u.push(r),i=a(r,c,u),a.index+=1,i.hasNext){if(i.hasMany??!1){for(let l of i.next)if(US(l,e,n.slice(o+1)))return!0;return s}r=i.next}if(!i.hasNext)break;i.done&&(s=!0)}return i.hasNext&&e.push(r),s}function $j(t){let{lazy:e,lazyArgs:n}=t,r=e(...n);return Object.assign(r,{isSingle:e.single??!1,index:0,items:[]})}function Tj(t){return typeof t=="string"||typeof t=="object"&&t!==null&&Symbol.iterator in t}function GS(t,e){let n=e.length-t.length;if(n===1){let[r,...i]=e;return tt(r,{lazy:t,lazyArgs:i})}if(n===0){let r={lazy:t,lazyArgs:e};return Object.assign(i=>tt(i,r),r)}throw new Error("Wrong number of arguments")}function Sv(...t){return GS(Sj,t)}function Sj(){let t=new Set;return e=>t.has(e)?Hc:(t.add(e),{done:!1,hasNext:!0,next:e})}function kj(...t){return ut(Cj,t,Aj)}var Cj=(t,e)=>e<0?[]:t.slice(0,e);function Aj(t){if(t<=0)return Ej;let e=t;return n=>(e-=1,{done:e<=0,hasNext:!0,next:n})}function Vc(...t){return ut(_j,t)}var _j=(t,e)=>t.length>=e;function Pj(...t){return ut(xj,t)}function xj(t,e){return e(t),t}function WS(...t){return ut(Ij,t)}function Ij(t,e){let n=[...t];return n.sort(e),n}function kv(...t){return ut(Nj,t)}var Nj=(t,e,n)=>t.reduce(e,n);function HS(...t){return ut(Oj,t)}function Oj(t){return[...t].reverse()}function Fj(...t){return ut(Lj,t)}function Lj(t,e){let n={};for(let r of e)r in t&&(n[r]=t[r]);return n}function Kc(...t){return ut(Mj,t)}var Mj=(t,e)=>t[e];function Yc(...t){return ut(Bj,t)}var Bj=t=>t.at(-1);function vn(...t){return ut(zj,t,qj)}var zj=(t,e)=>t.map(e),qj=t=>(e,n,r)=>({done:!1,hasNext:!0,next:t(e,n,r)});function gr(...t){return ut(jj,t)}function jj(t,e){let n={};for(let[r,i]of t.entries()){let[s,o]=e(i,r,t);n[s]=o}return n}function Xc(...t){return ut(Uj,t)}function Uj(t,e){let n={};for(let[r,i]of Object.entries(t)){let s=e(i,r,t);n[r]=s}return n}function Gj(t){return t instanceof Promise}function VS(t){return typeof t=="string"}function ue(t){return!!t}function on(t){return t!=null}function Et(t){return t==null}function Op(t){return typeof t=="number"&&!Number.isNaN(t)}function Wj(t){return Array.isArray(t)}function Qt(t){return t!==void 0}function Fs(t){return t===void 0?!0:typeof t=="string"||Array.isArray(t)?t.length===0:Object.keys(t).length===0}function Hj(t){return t instanceof Error}function Cv(...t){return ut(Vj,t)}function Vj(t,e){let n={};for(let[r,i]of t.entries()){let s=e(i,r,t);n[s]=i}return n}function zi(...t){return ut(Kj,t,Yj)}var Kj=(t,e)=>t.flatMap(e),Yj=t=>(e,n,r)=>{let i=t(e,n,r);return Array.isArray(i)?{done:!1,hasNext:!0,hasMany:!0,next:i}:{done:!1,hasNext:!0,next:i}};function Xj(...t){return ut(Jj,t,Zj)}function Jj(t,e){return t.forEach(e),t}var Zj=t=>(e,n,r)=>(t(e,n,r),{done:!1,hasNext:!0,next:e});function Fp(...t){return ut(Qj,t)}function Qj(t,e){for(let[n,r]of Object.entries(t))e(r,n,t);return t}function Ls(...t){return ut(e9,t)}var e9=(t,e)=>{let n={};for(let[r,i]of t.entries()){let s=e(i,r,t);if(s!==void 0){let{[s]:o}=n;o===void 0&&(o=[],n[s]=o),o.push(i)}}return n};function Ve(...t){return ut(t9,t,n9)}var t9=(t,e)=>t.filter(e),n9=t=>(e,n,r)=>t(e,n,r)?{done:!1,hasNext:!0,next:e}:Hc,KS=t=>Object.assign(t,{single:!0});function YS(...t){return ut(r9,t,KS(i9))}var r9=(t,e)=>t.find(e),i9=t=>(e,n,r)=>t(e,n,r)?{done:!0,hasNext:!0,next:e}:Hc;function XS(...t){return ut(s9,t)}var s9=(t,e)=>{for(let n=t.length-1;n>=0;n--){let r=t[n];if(e(r,n,t))return r}};function Vo(...t){return ut(o9,t,KS(a9))}var o9=([t])=>t,a9=()=>c9,c9=t=>({hasNext:!0,next:t,done:!0});function Lp(...t){return ut(Object.entries,t)}function JS(...t){return ut(u9,t)}var u9=(t,e)=>[...t,...e];function l9(t,{waitMs:e,timing:n="trailing",maxWaitMs:r}){if(r!==void 0&&e!==void 0&&r<e)throw new Error(`debounce: maxWaitMs (${r.toString()}) cannot be less than waitMs (${e.toString()})`);let i,s,o,a,c=()=>{if(s!==void 0){let f=s;s=void 0,clearTimeout(f)}if(o===void 0)throw new Error("REMEDA[debounce]: latestCallArgs was unexpectedly undefined.");let d=o;o=void 0,a=t(...d)},u=()=>{if(i===void 0)return;let d=i;i=void 0,clearTimeout(d),o!==void 0&&c()},l=d=>{o=d,r!==void 0&&s===void 0&&(s=setTimeout(c,r))};return{call:(...d)=>{if(i===void 0)n==="trailing"?l(d):a=t(...d);else{n!=="leading"&&l(d);let f=i;i=void 0,clearTimeout(f)}return i=setTimeout(u,e??r??0),a},cancel:()=>{if(i!==void 0){let d=i;i=void 0,clearTimeout(d)}if(s!==void 0){let d=s;s=void 0,clearTimeout(d)}o=void 0},flush:()=>(u(),a),get isPending(){return i!==void 0},get cachedValue(){return a}}}function d9(...t){return GS(f9,t)}function f9(t){if(t.length===0)return Rj;let e=new Map;for(let n of t)e.set(n,(e.get(n)??0)+1);return n=>{let r=e.get(n);return r===void 0||r===0?{done:!1,hasNext:!0,next:n}:(e.set(n,r-1),Hc)}}function p9(...t){return ut(h9,t)}var h9=(t,e)=>e.some(n=>n(t));function m9(...t){return ut(g9,t)}function g9(t,e){if(e<1)throw new RangeError(`chunk: A chunk size of '${e.toString()}' would result in an infinite array`);if(t.length===0)return[];if(e>=t.length)return[[...t]];let n=Math.ceil(t.length/e),r=new Array(n);if(e===1)for(let[i,s]of t.entries())r[i]=[s];else for(let i=0;i<n;i+=1){let s=i*e;r[i]=t.slice(s,s+e)}return r}function ZS(...t){return ut(y9,t)}var y9=(t,{min:e,max:n})=>e!==void 0&&t<e?e:n!==void 0&&t>n?n:t,v9={reset:[0,0],bold:[1,22,"\x1B[22m\x1B[1m"],dim:[2,22,"\x1B[22m\x1B[2m"],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]},w9=Object.entries(v9);function Av(t){return String(t)}Av.open="",Av.close="";function b9(t=!1){let e=typeof process<"u"?process:void 0,n=e?.env||{},r=e?.argv||[];return!("NO_COLOR"in n||r.includes("--no-color"))&&("FORCE_COLOR"in n||r.includes("--color")||e?.platform==="win32"||t&&n.TERM!=="dumb"||"CI"in n)||typeof window<"u"&&!!window.chrome}function D9(t=!1){let e=b9(t),n=(o,a,c,u)=>{let l="",d=0;do l+=o.substring(d,u)+c,d=u+a.length,u=o.indexOf(a,d);while(~u);return l+o.substring(d)},r=(o,a,c=o)=>{let u=l=>{let d=String(l),f=d.indexOf(a,o.length);return~f?o+n(d,a,c,f)+a:o+d+a};return u.open=o,u.close=a,u},i={isColorSupported:e},s=o=>`\x1B[${o}m`;for(let[o,a]of w9)i[o]=e?r(s(a[0]),s(a[1]),a[2]):Av;return i}var yt=D9(M2(1)),Jc={},At={},QS;function _v(){if(QS)return At;QS=1,Object.defineProperty(At,"__esModule",{value:!0}),At.thenable=At.typedArray=At.stringArray=At.array=At.func=At.error=At.number=At.string=At.boolean=void 0;function t(u){return u===!0||u===!1}At.boolean=t;function e(u){return typeof u=="string"||u instanceof String}At.string=e;function n(u){return typeof u=="number"||u instanceof Number}At.number=n;function r(u){return u instanceof Error}At.error=r;function i(u){return typeof u=="function"}At.func=i;function s(u){return Array.isArray(u)}At.array=s;function o(u){return s(u)&&u.every(l=>e(l))}At.stringArray=o;function a(u,l){return Array.isArray(u)&&u.every(l)}At.typedArray=a;function c(u){return u&&i(u.then)}return At.thenable=c,At}var Ke={},Zc={},Qc={},Mp={},Pv={},ge={},ek;function tk(){if(ek)return ge;ek=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.Message=ge.NotificationType9=ge.NotificationType8=ge.NotificationType7=ge.NotificationType6=ge.NotificationType5=ge.NotificationType4=ge.NotificationType3=ge.NotificationType2=ge.NotificationType1=ge.NotificationType0=ge.NotificationType=ge.RequestType9=ge.RequestType8=ge.RequestType7=ge.RequestType6=ge.RequestType5=ge.RequestType4=ge.RequestType3=ge.RequestType2=ge.RequestType1=ge.RequestType=ge.RequestType0=ge.AbstractMessageSignature=ge.ParameterStructures=ge.ResponseError=ge.ErrorCodes=void 0;const t=jc();var e;(function(T){T.ParseError=-32700,T.InvalidRequest=-32600,T.MethodNotFound=-32601,T.InvalidParams=-32602,T.InternalError=-32603,T.jsonrpcReservedErrorRangeStart=-32099,T.serverErrorStart=-32099,T.MessageWriteError=-32099,T.MessageReadError=-32098,T.PendingResponseRejected=-32097,T.ConnectionInactive=-32096,T.ServerNotInitialized=-32002,T.UnknownErrorCode=-32001,T.jsonrpcReservedErrorRangeEnd=-32e3,T.serverErrorEnd=-32e3})(e||(ge.ErrorCodes=e={}));class n extends Error{constructor($,L,V){super(L),this.code=t.number($)?$:e.UnknownErrorCode,this.data=V,Object.setPrototypeOf(this,n.prototype)}toJson(){const $={code:this.code,message:this.message};return this.data!==void 0&&($.data=this.data),$}}ge.ResponseError=n;class r{constructor($){this.kind=$}static is($){return $===r.auto||$===r.byName||$===r.byPosition}toString(){return this.kind}}ge.ParameterStructures=r,r.auto=new r("auto"),r.byPosition=new r("byPosition"),r.byName=new r("byName");class i{constructor($,L){this.method=$,this.numberOfParams=L}get parameterStructures(){return r.auto}}ge.AbstractMessageSignature=i;class s extends i{constructor($){super($,0)}}ge.RequestType0=s;class o extends i{constructor($,L=r.auto){super($,1),this._parameterStructures=L}get parameterStructures(){return this._parameterStructures}}ge.RequestType=o;class a extends i{constructor($,L=r.auto){super($,1),this._parameterStructures=L}get parameterStructures(){return this._parameterStructures}}ge.RequestType1=a;class c extends i{constructor($){super($,2)}}ge.RequestType2=c;class u extends i{constructor($){super($,3)}}ge.RequestType3=u;class l extends i{constructor($){super($,4)}}ge.RequestType4=l;class d extends i{constructor($){super($,5)}}ge.RequestType5=d;class f extends i{constructor($){super($,6)}}ge.RequestType6=f;class p extends i{constructor($){super($,7)}}ge.RequestType7=p;class h extends i{constructor($){super($,8)}}ge.RequestType8=h;class v extends i{constructor($){super($,9)}}ge.RequestType9=v;class b extends i{constructor($,L=r.auto){super($,1),this._parameterStructures=L}get parameterStructures(){return this._parameterStructures}}ge.NotificationType=b;class g extends i{constructor($){super($,0)}}ge.NotificationType0=g;class w extends i{constructor($,L=r.auto){super($,1),this._parameterStructures=L}get parameterStructures(){return this._parameterStructures}}ge.NotificationType1=w;class R extends i{constructor($){super($,2)}}ge.NotificationType2=R;class k extends i{constructor($){super($,3)}}ge.NotificationType3=k;class A extends i{constructor($){super($,4)}}ge.NotificationType4=A;class N extends i{constructor($){super($,5)}}ge.NotificationType5=N;class _ extends i{constructor($){super($,6)}}ge.NotificationType6=_;class B extends i{constructor($){super($,7)}}ge.NotificationType7=B;class z extends i{constructor($){super($,8)}}ge.NotificationType8=z;class Q extends i{constructor($){super($,9)}}ge.NotificationType9=Q;var I;return function(T){function $(H){const K=H;return K&&t.string(K.method)&&(t.string(K.id)||t.number(K.id))}T.isRequest=$;function L(H){const K=H;return K&&t.string(K.method)&&H.id===void 0}T.isNotification=L;function V(H){const K=H;return K&&(K.result!==void 0||!!K.error)&&(t.string(K.id)||t.number(K.id)||K.id===null)}T.isResponse=V}(I||(ge.Message=I={})),ge}var li={},nk;function rk(){if(nk)return li;nk=1;var t;Object.defineProperty(li,"__esModule",{value:!0}),li.LRUCache=li.LinkedMap=li.Touch=void 0;var e;(function(i){i.None=0,i.First=1,i.AsOld=i.First,i.Last=2,i.AsNew=i.Last})(e||(li.Touch=e={}));class n{constructor(){this[t]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(s){return this._map.has(s)}get(s,o=e.None){const a=this._map.get(s);if(a)return o!==e.None&&this.touch(a,o),a.value}set(s,o,a=e.None){let c=this._map.get(s);if(c)c.value=o,a!==e.None&&this.touch(c,a);else{switch(c={key:s,value:o,next:void 0,previous:void 0},a){case e.None:this.addItemLast(c);break;case e.First:this.addItemFirst(c);break;case e.Last:this.addItemLast(c);break;default:this.addItemLast(c);break}this._map.set(s,c),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){const o=this._map.get(s);if(o)return this._map.delete(s),this.removeItem(o),this._size--,o.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,o){const a=this._state;let c=this._head;for(;c;){if(o?s.bind(o)(c.value,c.key,this):s(c.value,c.key,this),this._state!==a)throw new Error("LinkedMap got modified during iteration.");c=c.next}}keys(){const s=this._state;let o=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const c={value:o.key,done:!1};return o=o.next,c}else return{value:void 0,done:!0}}};return a}values(){const s=this._state;let o=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const c={value:o.value,done:!1};return o=o.next,c}else return{value:void 0,done:!0}}};return a}entries(){const s=this._state;let o=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const c={value:[o.key,o.value],done:!1};return o=o.next,c}else return{value:void 0,done:!0}}};return a}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let o=this._head,a=this.size;for(;o&&a>s;)this._map.delete(o.key),o=o.next,a--;this._head=o,this._size=a,o&&(o.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw new Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw new Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw new Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw new Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{const o=s.next,a=s.previous;if(!o||!a)throw new Error("Invalid list");o.previous=a,a.next=o}s.next=void 0,s.previous=void 0,this._state++}touch(s,o){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(o!==e.First&&o!==e.Last)){if(o===e.First){if(s===this._head)return;const a=s.next,c=s.previous;s===this._tail?(c.next=void 0,this._tail=c):(a.previous=c,c.next=a),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(o===e.Last){if(s===this._tail)return;const a=s.next,c=s.previous;s===this._head?(a.previous=void 0,this._head=a):(a.previous=c,c.next=a),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){const s=[];return this.forEach((o,a)=>{s.push([a,o])}),s}fromJSON(s){this.clear();for(const[o,a]of s)this.set(o,a)}}li.LinkedMap=n;class r extends n{constructor(s,o=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,o),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.min(Math.max(0,s),1),this.checkTrim()}get(s,o=e.AsNew){return super.get(s,o)}peek(s){return super.get(s,e.None)}set(s,o){return super.set(s,o,e.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}return li.LRUCache=r,li}var eu={},ik;function E9(){if(ik)return eu;ik=1,Object.defineProperty(eu,"__esModule",{value:!0}),eu.Disposable=void 0;var t;return function(e){function n(r){return{dispose:r}}e.create=n}(t||(eu.Disposable=t={})),eu}var Ms={},sk;function R9(){if(sk)return Ms;sk=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.SharedArrayReceiverStrategy=Ms.SharedArraySenderStrategy=void 0;const t=Tp();var e;(function(o){o.Continue=0,o.Cancelled=1})(e||(e={}));class n{constructor(){this.buffers=new Map}enableCancellation(a){if(a.id===null)return;const c=new SharedArrayBuffer(4),u=new Int32Array(c,0,1);u[0]=e.Continue,this.buffers.set(a.id,c),a.$cancellationData=c}async sendCancellation(a,c){const u=this.buffers.get(c);if(u===void 0)return;const l=new Int32Array(u,0,1);Atomics.store(l,0,e.Cancelled)}cleanup(a){this.buffers.delete(a)}dispose(){this.buffers.clear()}}Ms.SharedArraySenderStrategy=n;class r{constructor(a){this.data=new Int32Array(a,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===e.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class i{constructor(a){this.token=new r(a)}cancel(){}dispose(){}}class s{constructor(){this.kind="request"}createCancellationTokenSource(a){const c=a.$cancellationData;return c===void 0?new t.CancellationTokenSource:new i(c)}}return Ms.SharedArrayReceiverStrategy=s,Ms}var di={},tu={},ok;function ak(){if(ok)return tu;ok=1,Object.defineProperty(tu,"__esModule",{value:!0}),tu.Semaphore=void 0;const t=xs();class e{constructor(r=1){if(r<=0)throw new Error("Capacity must be greater than 0");this._capacity=r,this._active=0,this._waiting=[]}lock(r){return new Promise((i,s)=>{this._waiting.push({thunk:r,resolve:i,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const r=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const i=r.thunk();i instanceof Promise?i.then(s=>{this._active--,r.resolve(s),this.runNext()},s=>{this._active--,r.reject(s),this.runNext()}):(this._active--,r.resolve(i),this.runNext())}catch(i){this._active--,r.reject(i),this.runNext()}}}return tu.Semaphore=e,tu}var ck;function $9(){if(ck)return di;ck=1,Object.defineProperty(di,"__esModule",{value:!0}),di.ReadableStreamMessageReader=di.AbstractMessageReader=di.MessageReader=void 0;const t=xs(),e=jc(),n=Ho(),r=ak();var i;(function(c){function u(l){let d=l;return d&&e.func(d.listen)&&e.func(d.dispose)&&e.func(d.onError)&&e.func(d.onClose)&&e.func(d.onPartialMessage)}c.is=u})(i||(di.MessageReader=i={}));class s{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(u){this.errorEmitter.fire(this.asError(u))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(u){this.partialMessageEmitter.fire(u)}asError(u){return u instanceof Error?u:new Error(`Reader received error. Reason: ${e.string(u.message)?u.message:"unknown"}`)}}di.AbstractMessageReader=s;var o;(function(c){function u(l){let d,f;const p=new Map;let h;const v=new Map;if(l===void 0||typeof l=="string")d=l??"utf-8";else{if(d=l.charset??"utf-8",l.contentDecoder!==void 0&&(f=l.contentDecoder,p.set(f.name,f)),l.contentDecoders!==void 0)for(const b of l.contentDecoders)p.set(b.name,b);if(l.contentTypeDecoder!==void 0&&(h=l.contentTypeDecoder,v.set(h.name,h)),l.contentTypeDecoders!==void 0)for(const b of l.contentTypeDecoders)v.set(b.name,b)}return h===void 0&&(h=(0,t.default)().applicationJson.decoder,v.set(h.name,h)),{charset:d,contentDecoder:f,contentDecoders:p,contentTypeDecoder:h,contentTypeDecoders:v}}c.fromOptions=u})(o||(o={}));class a extends s{constructor(u,l){super(),this.readable=u,this.options=o.fromOptions(l),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new r.Semaphore(1)}set partialMessageTimeout(u){this._partialMessageTimeout=u}get partialMessageTimeout(){return this._partialMessageTimeout}listen(u){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=u;const l=this.readable.onData(d=>{this.onData(d)});return this.readable.onError(d=>this.fireError(d)),this.readable.onClose(()=>this.fireClose()),l}onData(u){try{for(this.buffer.append(u);;){if(this.nextMessageLength===-1){const d=this.buffer.tryReadHeaders(!0);if(!d)return;const f=d.get("content-length");if(!f){this.fireError(new Error(`Header must provide a Content-Length property.
126
- ${JSON.stringify(Object.fromEntries(d))}`));return}const p=parseInt(f);if(isNaN(p)){this.fireError(new Error(`Content-Length value must be a number. Got ${f}`));return}this.nextMessageLength=p}const l=this.buffer.tryReadBody(this.nextMessageLength);if(l===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const d=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(l):l,f=await this.options.contentTypeDecoder.decode(d,this.options);this.callback(f)}).catch(d=>{this.fireError(d)})}}catch(l){this.fireError(l)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((u,l)=>{this.partialMessageTimer=void 0,u===this.messageToken&&(this.firePartialMessage({messageToken:u,waitingTime:l}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}return di.ReadableStreamMessageReader=a,di}var fi={},uk;function T9(){if(uk)return fi;uk=1,Object.defineProperty(fi,"__esModule",{value:!0}),fi.WriteableStreamMessageWriter=fi.AbstractMessageWriter=fi.MessageWriter=void 0;const t=xs(),e=jc(),n=ak(),r=Ho(),i="Content-Length: ",s=`\r
127
- `;var o;(function(l){function d(f){let p=f;return p&&e.func(p.dispose)&&e.func(p.onClose)&&e.func(p.onError)&&e.func(p.write)}l.is=d})(o||(fi.MessageWriter=o={}));class a{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(d,f,p){this.errorEmitter.fire([this.asError(d),f,p])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(d){return d instanceof Error?d:new Error(`Writer received error. Reason: ${e.string(d.message)?d.message:"unknown"}`)}}fi.AbstractMessageWriter=a;var c;(function(l){function d(f){return f===void 0||typeof f=="string"?{charset:f??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:f.charset??"utf-8",contentEncoder:f.contentEncoder,contentTypeEncoder:f.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}l.fromOptions=d})(c||(c={}));class u extends a{constructor(d,f){super(),this.writable=d,this.options=c.fromOptions(f),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(p=>this.fireError(p)),this.writable.onClose(()=>this.fireClose())}async write(d){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(d,this.options).then(p=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(p):p).then(p=>{const h=[];return h.push(i,p.byteLength.toString(),s),h.push(s),this.doWrite(d,h,p)},p=>{throw this.fireError(p),p}))}async doWrite(d,f,p){try{return await this.writable.write(f.join(""),"ascii"),this.writable.write(p)}catch(h){return this.handleError(h,d),Promise.reject(h)}}handleError(d,f){this.errorCount++,this.fireError(d,f,this.errorCount)}end(){this.writable.end()}}return fi.WriteableStreamMessageWriter=u,fi}var nu={},lk;function S9(){if(lk)return nu;lk=1,Object.defineProperty(nu,"__esModule",{value:!0}),nu.AbstractMessageBuffer=void 0;const t=13,e=10,n=`\r
128
- `;class r{constructor(s="utf-8"){this._encoding=s,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(s){const o=typeof s=="string"?this.fromString(s,this._encoding):s;this._chunks.push(o),this._totalLength+=o.byteLength}tryReadHeaders(s=!1){if(this._chunks.length===0)return;let o=0,a=0,c=0,u=0;e:for(;a<this._chunks.length;){const p=this._chunks[a];for(c=0;c<p.length;){switch(p[c]){case t:switch(o){case 0:o=1;break;case 2:o=3;break;default:o=0}break;case e:switch(o){case 1:o=2;break;case 3:o=4,c++;break e;default:o=0}break;default:o=0}c++}u+=p.byteLength,a++}if(o!==4)return;const l=this._read(u+c),d=new Map,f=this.toString(l,"ascii").split(n);if(f.length<2)return d;for(let p=0;p<f.length-2;p++){const h=f[p],v=h.indexOf(":");if(v===-1)throw new Error(`Message header must separate key and value using ':'
129
- ${h}`);const b=h.substr(0,v),g=h.substr(v+1).trim();d.set(s?b.toLowerCase():b,g)}return d}tryReadBody(s){if(!(this._totalLength<s))return this._read(s)}get numberOfBytes(){return this._totalLength}_read(s){if(s===0)return this.emptyBuffer();if(s>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){const u=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(u)}if(this._chunks[0].byteLength>s){const u=this._chunks[0],l=this.asNative(u,s);return this._chunks[0]=u.slice(s),this._totalLength-=s,l}const o=this.allocNative(s);let a=0,c=0;for(;s>0;){const u=this._chunks[c];if(u.byteLength>s){const l=u.slice(0,s);o.set(l,a),a+=s,this._chunks[c]=u.slice(s),this._totalLength-=s,s-=s}else o.set(u,a),a+=u.byteLength,this._chunks.shift(),this._totalLength-=u.byteLength,s-=u.byteLength}return o}}return nu.AbstractMessageBuffer=r,nu}var xv={},dk;function k9(){return dk||(dk=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;const e=xs(),n=jc(),r=tk(),i=rk(),s=Ho(),o=Tp();var a;(function($){$.type=new r.NotificationType("$/cancelRequest")})(a||(a={}));var c;(function($){function L(V){return typeof V=="string"||typeof V=="number"}$.is=L})(c||(t.ProgressToken=c={}));var u;(function($){$.type=new r.NotificationType("$/progress")})(u||(u={}));class l{constructor(){}}t.ProgressType=l;var d;(function($){function L(V){return n.func(V)}$.is=L})(d||(d={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var f;(function($){$[$.Off=0]="Off",$[$.Messages=1]="Messages",$[$.Compact=2]="Compact",$[$.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function($){$.Off="off",$.Messages="messages",$.Compact="compact",$.Verbose="verbose"})(p||(t.TraceValues=p={})),function($){function L(H){if(!n.string(H))return $.Off;switch(H=H.toLowerCase(),H){case"off":return $.Off;case"messages":return $.Messages;case"compact":return $.Compact;case"verbose":return $.Verbose;default:return $.Off}}$.fromString=L;function V(H){switch(H){case $.Off:return"off";case $.Messages:return"messages";case $.Compact:return"compact";case $.Verbose:return"verbose";default:return"off"}}$.toString=V}(f||(t.Trace=f={}));var h;(function($){$.Text="text",$.JSON="json"})(h||(t.TraceFormat=h={})),function($){function L(V){return n.string(V)?(V=V.toLowerCase(),V==="json"?$.JSON:$.Text):$.Text}$.fromString=L}(h||(t.TraceFormat=h={}));var v;(function($){$.type=new r.NotificationType("$/setTrace")})(v||(t.SetTraceNotification=v={}));var b;(function($){$.type=new r.NotificationType("$/logTrace")})(b||(t.LogTraceNotification=b={}));var g;(function($){$[$.Closed=1]="Closed",$[$.Disposed=2]="Disposed",$[$.AlreadyListening=3]="AlreadyListening"})(g||(t.ConnectionErrors=g={}));class w extends Error{constructor(L,V){super(V),this.code=L,Object.setPrototypeOf(this,w.prototype)}}t.ConnectionError=w;var R;(function($){function L(V){const H=V;return H&&n.func(H.cancelUndispatched)}$.is=L})(R||(t.ConnectionStrategy=R={}));var k;(function($){function L(V){const H=V;return H&&(H.kind===void 0||H.kind==="id")&&n.func(H.createCancellationTokenSource)&&(H.dispose===void 0||n.func(H.dispose))}$.is=L})(k||(t.IdCancellationReceiverStrategy=k={}));var A;(function($){function L(V){const H=V;return H&&H.kind==="request"&&n.func(H.createCancellationTokenSource)&&(H.dispose===void 0||n.func(H.dispose))}$.is=L})(A||(t.RequestCancellationReceiverStrategy=A={}));var N;(function($){$.Message=Object.freeze({createCancellationTokenSource(V){return new o.CancellationTokenSource}});function L(V){return k.is(V)||A.is(V)}$.is=L})(N||(t.CancellationReceiverStrategy=N={}));var _;(function($){$.Message=Object.freeze({sendCancellation(V,H){return V.sendNotification(a.type,{id:H})},cleanup(V){}});function L(V){const H=V;return H&&n.func(H.sendCancellation)&&n.func(H.cleanup)}$.is=L})(_||(t.CancellationSenderStrategy=_={}));var B;(function($){$.Message=Object.freeze({receiver:N.Message,sender:_.Message});function L(V){const H=V;return H&&N.is(H.receiver)&&_.is(H.sender)}$.is=L})(B||(t.CancellationStrategy=B={}));var z;(function($){function L(V){const H=V;return H&&n.func(H.handleMessage)}$.is=L})(z||(t.MessageStrategy=z={}));var Q;(function($){function L(V){const H=V;return H&&(B.is(H.cancellationStrategy)||R.is(H.connectionStrategy)||z.is(H.messageStrategy))}$.is=L})(Q||(t.ConnectionOptions=Q={}));var I;(function($){$[$.New=1]="New",$[$.Listening=2]="Listening",$[$.Closed=3]="Closed",$[$.Disposed=4]="Disposed"})(I||(I={}));function T($,L,V,H){const K=V!==void 0?V:t.NullLogger;let we=0,te=0,C=0;const he="2.0";let Ye;const pt=new Map;let W;const X=new Map,Ie=new Map;let oe,be=new i.LinkedMap,Se=new Map,ae=new Set,O=new Map,j=f.Off,de=h.Text,U,ce=I.New;const qe=new s.Emitter,et=new s.Emitter,se=new s.Emitter,_e=new s.Emitter,ne=new s.Emitter,De=H&&H.cancellationStrategy?H.cancellationStrategy:B.Message;function Me(E){if(E===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+E.toString()}function ht(E){return E===null?"res-unknown-"+(++C).toString():"res-"+E.toString()}function Xe(){return"not-"+(++te).toString()}function Ut(E,G){r.Message.isRequest(G)?E.set(Me(G.id),G):r.Message.isResponse(G)?E.set(ht(G.id),G):E.set(Xe(),G)}function Ht(E){}function ln(){return ce===I.Listening}function J(){return ce===I.Closed}function Z(){return ce===I.Disposed}function fe(){(ce===I.New||ce===I.Listening)&&(ce=I.Closed,et.fire(void 0))}function Vt(E){qe.fire([E,void 0,void 0])}function Gt(E){qe.fire(E)}$.onClose(fe),$.onError(Vt),L.onClose(fe),L.onError(Gt);function Er(){oe||be.size===0||(oe=(0,e.default)().timer.setImmediate(()=>{oe=void 0,as()}))}function $i(E){r.Message.isRequest(E)?us(E):r.Message.isNotification(E)?Ti(E):r.Message.isResponse(E)?ls(E):Si(E)}function as(){if(be.size===0)return;const E=be.shift();try{const G=H?.messageStrategy;z.is(G)?G.handleMessage(E,$i):$i(E)}finally{Er()}}const cs=E=>{try{if(r.Message.isNotification(E)&&E.method===a.type.method){const G=E.params.id,ee=Me(G),ie=be.get(ee);if(r.Message.isRequest(ie)){const Ne=H?.connectionStrategy,Je=Ne&&Ne.cancelUndispatched?Ne.cancelUndispatched(ie,Ht):void 0;if(Je&&(Je.error!==void 0||Je.result!==void 0)){be.delete(ee),O.delete(G),Je.id=ie.id,Rr(Je,E.method,Date.now()),L.write(Je).catch(()=>K.error("Sending response for canceled message failed."));return}}const Be=O.get(G);if(Be!==void 0){Be.cancel(),Wr(E);return}else ae.add(G)}Ut(be,E)}finally{Er()}};function us(E){if(Z())return;function G(Pe,it,Ze){const Bt={jsonrpc:he,id:E.id};Pe instanceof r.ResponseError?Bt.error=Pe.toJson():Bt.result=Pe===void 0?null:Pe,Rr(Bt,it,Ze),L.write(Bt).catch(()=>K.error("Sending response failed."))}function ee(Pe,it,Ze){const Bt={jsonrpc:he,id:E.id,error:Pe.toJson()};Rr(Bt,it,Ze),L.write(Bt).catch(()=>K.error("Sending response failed."))}function ie(Pe,it,Ze){Pe===void 0&&(Pe=null);const Bt={jsonrpc:he,id:E.id,result:Pe};Rr(Bt,it,Ze),L.write(Bt).catch(()=>K.error("Sending response failed."))}ps(E);const Be=pt.get(E.method);let Ne,Je;Be&&(Ne=Be.type,Je=Be.handler);const me=Date.now();if(Je||Ye){const Pe=E.id??String(Date.now()),it=k.is(De.receiver)?De.receiver.createCancellationTokenSource(Pe):De.receiver.createCancellationTokenSource(E);E.id!==null&&ae.has(E.id)&&it.cancel(),E.id!==null&&O.set(Pe,it);try{let Ze;if(Je)if(E.params===void 0){if(Ne!==void 0&&Ne.numberOfParams!==0){ee(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${E.method} defines ${Ne.numberOfParams} params but received none.`),E.method,me);return}Ze=Je(it.token)}else if(Array.isArray(E.params)){if(Ne!==void 0&&Ne.parameterStructures===r.ParameterStructures.byName){ee(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${E.method} defines parameters by name but received parameters by position`),E.method,me);return}Ze=Je(...E.params,it.token)}else{if(Ne!==void 0&&Ne.parameterStructures===r.ParameterStructures.byPosition){ee(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${E.method} defines parameters by position but received parameters by name`),E.method,me);return}Ze=Je(E.params,it.token)}else Ye&&(Ze=Ye(E.method,E.params,it.token));const Bt=Ze;Ze?Bt.then?Bt.then(dn=>{O.delete(Pe),G(dn,E.method,me)},dn=>{O.delete(Pe),dn instanceof r.ResponseError?ee(dn,E.method,me):dn&&n.string(dn.message)?ee(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${E.method} failed with message: ${dn.message}`),E.method,me):ee(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${E.method} failed unexpectedly without providing any details.`),E.method,me)}):(O.delete(Pe),G(Ze,E.method,me)):(O.delete(Pe),ie(Ze,E.method,me))}catch(Ze){O.delete(Pe),Ze instanceof r.ResponseError?G(Ze,E.method,me):Ze&&n.string(Ze.message)?ee(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${E.method} failed with message: ${Ze.message}`),E.method,me):ee(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${E.method} failed unexpectedly without providing any details.`),E.method,me)}}else ee(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${E.method}`),E.method,me)}function ls(E){if(!Z())if(E.id===null)E.error?K.error(`Received response message without id: Error is:
130
- ${JSON.stringify(E.error,void 0,4)}`):K.error("Received response message without id. No further error information provided.");else{const G=E.id,ee=Se.get(G);if(hs(E,ee),ee!==void 0){Se.delete(G);try{if(E.error){const ie=E.error;ee.reject(new r.ResponseError(ie.code,ie.message,ie.data))}else if(E.result!==void 0)ee.resolve(E.result);else throw new Error("Should never happen.")}catch(ie){ie.message?K.error(`Response handler '${ee.method}' failed with message: ${ie.message}`):K.error(`Response handler '${ee.method}' failed unexpectedly.`)}}}}function Ti(E){if(Z())return;let G,ee;if(E.method===a.type.method){const ie=E.params.id;ae.delete(ie),Wr(E);return}else{const ie=X.get(E.method);ie&&(ee=ie.handler,G=ie.type)}if(ee||W)try{if(Wr(E),ee)if(E.params===void 0)G!==void 0&&G.numberOfParams!==0&&G.parameterStructures!==r.ParameterStructures.byName&&K.error(`Notification ${E.method} defines ${G.numberOfParams} params but received none.`),ee();else if(Array.isArray(E.params)){const ie=E.params;E.method===u.type.method&&ie.length===2&&c.is(ie[0])?ee({token:ie[0],value:ie[1]}):(G!==void 0&&(G.parameterStructures===r.ParameterStructures.byName&&K.error(`Notification ${E.method} defines parameters by name but received parameters by position`),G.numberOfParams!==E.params.length&&K.error(`Notification ${E.method} defines ${G.numberOfParams} params but received ${ie.length} arguments`)),ee(...ie))}else G!==void 0&&G.parameterStructures===r.ParameterStructures.byPosition&&K.error(`Notification ${E.method} defines parameters by position but received parameters by name`),ee(E.params);else W&&W(E.method,E.params)}catch(ie){ie.message?K.error(`Notification handler '${E.method}' failed with message: ${ie.message}`):K.error(`Notification handler '${E.method}' failed unexpectedly.`)}else se.fire(E)}function Si(E){if(!E){K.error("Received empty message.");return}K.error(`Received message which is neither a response nor a notification message:
131
- ${JSON.stringify(E,null,4)}`);const G=E;if(n.string(G.id)||n.number(G.id)){const ee=G.id,ie=Se.get(ee);ie&&ie.reject(new Error("The received response has neither a result nor an error property."))}}function Tn(E){if(E!=null)switch(j){case f.Verbose:return JSON.stringify(E,null,4);case f.Compact:return JSON.stringify(E);default:return}}function ds(E){if(!(j===f.Off||!U))if(de===h.Text){let G;(j===f.Verbose||j===f.Compact)&&E.params&&(G=`Params: ${Tn(E.params)}
132
-
133
- `),U.log(`Sending request '${E.method} - (${E.id})'.`,G)}else Hn("send-request",E)}function fs(E){if(!(j===f.Off||!U))if(de===h.Text){let G;(j===f.Verbose||j===f.Compact)&&(E.params?G=`Params: ${Tn(E.params)}
134
-
135
- `:G=`No parameters provided.
136
-
137
- `),U.log(`Sending notification '${E.method}'.`,G)}else Hn("send-notification",E)}function Rr(E,G,ee){if(!(j===f.Off||!U))if(de===h.Text){let ie;(j===f.Verbose||j===f.Compact)&&(E.error&&E.error.data?ie=`Error data: ${Tn(E.error.data)}
138
-
139
- `:E.result?ie=`Result: ${Tn(E.result)}
140
-
141
- `:E.error===void 0&&(ie=`No result returned.
142
-
143
- `)),U.log(`Sending response '${G} - (${E.id})'. Processing request took ${Date.now()-ee}ms`,ie)}else Hn("send-response",E)}function ps(E){if(!(j===f.Off||!U))if(de===h.Text){let G;(j===f.Verbose||j===f.Compact)&&E.params&&(G=`Params: ${Tn(E.params)}
144
-
145
- `),U.log(`Received request '${E.method} - (${E.id})'.`,G)}else Hn("receive-request",E)}function Wr(E){if(!(j===f.Off||!U||E.method===b.type.method))if(de===h.Text){let G;(j===f.Verbose||j===f.Compact)&&(E.params?G=`Params: ${Tn(E.params)}
146
-
147
- `:G=`No parameters provided.
148
-
149
- `),U.log(`Received notification '${E.method}'.`,G)}else Hn("receive-notification",E)}function hs(E,G){if(!(j===f.Off||!U))if(de===h.Text){let ee;if((j===f.Verbose||j===f.Compact)&&(E.error&&E.error.data?ee=`Error data: ${Tn(E.error.data)}
150
-
151
- `:E.result?ee=`Result: ${Tn(E.result)}
152
-
153
- `:E.error===void 0&&(ee=`No result returned.
154
-
155
- `)),G){const ie=E.error?` Request failed: ${E.error.message} (${E.error.code}).`:"";U.log(`Received response '${G.method} - (${E.id})' in ${Date.now()-G.timerStart}ms.${ie}`,ee)}else U.log(`Received response ${E.id} without active response promise.`,ee)}else Hn("receive-response",E)}function Hn(E,G){if(!U||j===f.Off)return;const ee={isLSPMessage:!0,type:E,message:G,timestamp:Date.now()};U.log(ee)}function ir(){if(J())throw new w(g.Closed,"Connection is closed.");if(Z())throw new w(g.Disposed,"Connection is disposed.")}function mo(){if(ln())throw new w(g.AlreadyListening,"Connection is already listening")}function M(){if(!ln())throw new Error("Call listen() first.")}function D(E){return E===void 0?null:E}function P(E){if(E!==null)return E}function m(E){return E!=null&&!Array.isArray(E)&&typeof E=="object"}function S(E,G){switch(E){case r.ParameterStructures.auto:return m(G)?P(G):[D(G)];case r.ParameterStructures.byName:if(!m(G))throw new Error("Received parameters by name but param is not an object literal.");return P(G);case r.ParameterStructures.byPosition:return[D(G)];default:throw new Error(`Unknown parameter structure ${E.toString()}`)}}function y(E,G){let ee;const ie=E.numberOfParams;switch(ie){case 0:ee=void 0;break;case 1:ee=S(E.parameterStructures,G[0]);break;default:ee=[];for(let Be=0;Be<G.length&&Be<ie;Be++)ee.push(D(G[Be]));if(G.length<ie)for(let Be=G.length;Be<ie;Be++)ee.push(null);break}return ee}const x={sendNotification:(E,...G)=>{ir();let ee,ie;if(n.string(E)){ee=E;const Ne=G[0];let Je=0,me=r.ParameterStructures.auto;r.ParameterStructures.is(Ne)&&(Je=1,me=Ne);let Pe=G.length;const it=Pe-Je;switch(it){case 0:ie=void 0;break;case 1:ie=S(me,G[Je]);break;default:if(me===r.ParameterStructures.byName)throw new Error(`Received ${it} parameters for 'by Name' notification parameter structure.`);ie=G.slice(Je,Pe).map(Ze=>D(Ze));break}}else{const Ne=G;ee=E.method,ie=y(E,Ne)}const Be={jsonrpc:he,method:ee,params:ie};return fs(Be),L.write(Be).catch(Ne=>{throw K.error("Sending notification failed."),Ne})},onNotification:(E,G)=>{ir();let ee;return n.func(E)?W=E:G&&(n.string(E)?(ee=E,X.set(E,{type:void 0,handler:G})):(ee=E.method,X.set(E.method,{type:E,handler:G}))),{dispose:()=>{ee!==void 0?X.delete(ee):W=void 0}}},onProgress:(E,G,ee)=>{if(Ie.has(G))throw new Error(`Progress handler for token ${G} already registered`);return Ie.set(G,ee),{dispose:()=>{Ie.delete(G)}}},sendProgress:(E,G,ee)=>x.sendNotification(u.type,{token:G,value:ee}),onUnhandledProgress:_e.event,sendRequest:(E,...G)=>{ir(),M();let ee,ie,Be;if(n.string(E)){ee=E;const Pe=G[0],it=G[G.length-1];let Ze=0,Bt=r.ParameterStructures.auto;r.ParameterStructures.is(Pe)&&(Ze=1,Bt=Pe);let dn=G.length;o.CancellationToken.is(it)&&(dn=dn-1,Be=it);const $r=dn-Ze;switch($r){case 0:ie=void 0;break;case 1:ie=S(Bt,G[Ze]);break;default:if(Bt===r.ParameterStructures.byName)throw new Error(`Received ${$r} parameters for 'by Name' request parameter structure.`);ie=G.slice(Ze,dn).map(P2=>D(P2));break}}else{const Pe=G;ee=E.method,ie=y(E,Pe);const it=E.numberOfParams;Be=o.CancellationToken.is(Pe[it])?Pe[it]:void 0}const Ne=we++;let Je;Be&&(Je=Be.onCancellationRequested(()=>{const Pe=De.sender.sendCancellation(x,Ne);return Pe===void 0?(K.log(`Received no promise from cancellation strategy when cancelling id ${Ne}`),Promise.resolve()):Pe.catch(()=>{K.log(`Sending cancellation messages for id ${Ne} failed`)})}));const me={jsonrpc:he,id:Ne,method:ee,params:ie};return ds(me),typeof De.sender.enableCancellation=="function"&&De.sender.enableCancellation(me),new Promise(async(Pe,it)=>{const Ze=$r=>{Pe($r),De.sender.cleanup(Ne),Je?.dispose()},Bt=$r=>{it($r),De.sender.cleanup(Ne),Je?.dispose()},dn={method:ee,timerStart:Date.now(),resolve:Ze,reject:Bt};try{await L.write(me),Se.set(Ne,dn)}catch($r){throw K.error("Sending request failed."),dn.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,$r.message?$r.message:"Unknown reason")),$r}})},onRequest:(E,G)=>{ir();let ee=null;return d.is(E)?(ee=void 0,Ye=E):n.string(E)?(ee=null,G!==void 0&&(ee=E,pt.set(E,{handler:G,type:void 0}))):G!==void 0&&(ee=E.method,pt.set(E.method,{type:E,handler:G})),{dispose:()=>{ee!==null&&(ee!==void 0?pt.delete(ee):Ye=void 0)}}},hasPendingResponse:()=>Se.size>0,trace:async(E,G,ee)=>{let ie=!1,Be=h.Text;ee!==void 0&&(n.boolean(ee)?ie=ee:(ie=ee.sendNotification||!1,Be=ee.traceFormat||h.Text)),j=E,de=Be,j===f.Off?U=void 0:U=G,ie&&!J()&&!Z()&&await x.sendNotification(v.type,{value:f.toString(E)})},onError:qe.event,onClose:et.event,onUnhandledNotification:se.event,onDispose:ne.event,end:()=>{L.end()},dispose:()=>{if(Z())return;ce=I.Disposed,ne.fire(void 0);const E=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const G of Se.values())G.reject(E);Se=new Map,O=new Map,ae=new Set,be=new i.LinkedMap,n.func(L.dispose)&&L.dispose(),n.func($.dispose)&&$.dispose()},listen:()=>{ir(),mo(),ce=I.Listening,$.listen(cs)},inspect:()=>{(0,e.default)().console.log("inspect")}};return x.onNotification(b.type,E=>{if(j===f.Off||!U)return;const G=j===f.Verbose||j===f.Compact;U.log(E.message,G?E.verbose:void 0)}),x.onNotification(u.type,E=>{const G=Ie.get(E.token);G?G(E.value):_e.fire(E)}),x}t.createMessageConnection=T}(xv)),xv}var fk;function Iv(){return fk||(fk=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=tk();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 n=rk();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(t,"Touch",{enumerable:!0,get:function(){return n.Touch}});const r=E9();Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=Ho();Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const s=Tp();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return s.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return s.CancellationToken}});const o=R9();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return o.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return o.SharedArrayReceiverStrategy}});const a=$9();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return a.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return a.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return a.ReadableStreamMessageReader}});const c=T9();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return c.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return c.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return c.WriteableStreamMessageWriter}});const u=S9();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return u.AbstractMessageBuffer}});const l=k9();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return l.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return l.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return l.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return l.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return l.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return l.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return l.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return l.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return l.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return l.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return l.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return l.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return l.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return l.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return l.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return l.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:function(){return l.MessageStrategy}});const d=xs();t.RAL=d.default}(Pv)),Pv}var pk;function C9(){if(pk)return Mp;pk=1,Object.defineProperty(Mp,"__esModule",{value:!0});const t=G2,e=Iv();class n extends e.AbstractMessageBuffer{constructor(c="utf-8"){super(c)}emptyBuffer(){return n.emptyBuffer}fromString(c,u){return Buffer.from(c,u)}toString(c,u){return c instanceof Buffer?c.toString(u):new t.TextDecoder(u).decode(c)}asNative(c,u){return u===void 0?c instanceof Buffer?c:Buffer.from(c):c instanceof Buffer?c.slice(0,u):Buffer.from(c,0,u)}allocNative(c){return Buffer.allocUnsafe(c)}}n.emptyBuffer=Buffer.allocUnsafe(0);class r{constructor(c){this.stream=c}onClose(c){return this.stream.on("close",c),e.Disposable.create(()=>this.stream.off("close",c))}onError(c){return this.stream.on("error",c),e.Disposable.create(()=>this.stream.off("error",c))}onEnd(c){return this.stream.on("end",c),e.Disposable.create(()=>this.stream.off("end",c))}onData(c){return this.stream.on("data",c),e.Disposable.create(()=>this.stream.off("data",c))}}class i{constructor(c){this.stream=c}onClose(c){return this.stream.on("close",c),e.Disposable.create(()=>this.stream.off("close",c))}onError(c){return this.stream.on("error",c),e.Disposable.create(()=>this.stream.off("error",c))}onEnd(c){return this.stream.on("end",c),e.Disposable.create(()=>this.stream.off("end",c))}write(c,u){return new Promise((l,d)=>{const f=p=>{p==null?l():d(p)};typeof c=="string"?this.stream.write(c,u,f):this.stream.write(c,f)})}end(){this.stream.end()}}const s=Object.freeze({messageBuffer:Object.freeze({create:a=>new n(a)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(a,c)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(a,void 0,0),c.charset))}catch(u){return Promise.reject(u)}}}),decoder:Object.freeze({name:"application/json",decode:(a,c)=>{try{return a instanceof Buffer?Promise.resolve(JSON.parse(a.toString(c.charset))):Promise.resolve(JSON.parse(new t.TextDecoder(c.charset).decode(a)))}catch(u){return Promise.reject(u)}}})}),stream:Object.freeze({asReadableStream:a=>new r(a),asWritableStream:a=>new i(a)}),console,timer:Object.freeze({setTimeout(a,c,...u){const l=setTimeout(a,c,...u);return{dispose:()=>clearTimeout(l)}},setImmediate(a,...c){const u=setImmediate(a,...c);return{dispose:()=>clearImmediate(u)}},setInterval(a,c,...u){const l=setInterval(a,c,...u);return{dispose:()=>clearInterval(l)}}})});function o(){return s}return function(a){function c(){e.RAL.install(s)}a.install=c}(o),Mp.default=o,Mp}var hk;function Bs(){return hk||(hk=1,function(t){var e=Qc.__createBinding||(Object.create?function(I,T,$,L){L===void 0&&(L=$);var V=Object.getOwnPropertyDescriptor(T,$);(!V||("get"in V?!T.__esModule:V.writable||V.configurable))&&(V={enumerable:!0,get:function(){return T[$]}}),Object.defineProperty(I,L,V)}:function(I,T,$,L){L===void 0&&(L=$),I[L]=T[$]}),n=Qc.__exportStar||function(I,T){for(var $ in I)$!=="default"&&!Object.prototype.hasOwnProperty.call(T,$)&&e(T,I,$)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.createServerSocketTransport=t.createClientSocketTransport=t.createServerPipeTransport=t.createClientPipeTransport=t.generateRandomPipeName=t.StreamMessageWriter=t.StreamMessageReader=t.SocketMessageWriter=t.SocketMessageReader=t.PortMessageWriter=t.PortMessageReader=t.IPCMessageWriter=t.IPCMessageReader=void 0;const r=C9();r.default.install();const i=Tr,s=W2,o=H2,a=V2,c=Iv();n(Iv(),t);class u extends c.AbstractMessageReader{constructor(T){super(),this.process=T;let $=this.process;$.on("error",L=>this.fireError(L)),$.on("close",()=>this.fireClose())}listen(T){return this.process.on("message",T),c.Disposable.create(()=>this.process.off("message",T))}}t.IPCMessageReader=u;class l extends c.AbstractMessageWriter{constructor(T){super(),this.process=T,this.errorCount=0;const $=this.process;$.on("error",L=>this.fireError(L)),$.on("close",()=>this.fireClose)}write(T){try{return typeof this.process.send=="function"&&this.process.send(T,void 0,void 0,$=>{$?(this.errorCount++,this.handleError($,T)):this.errorCount=0}),Promise.resolve()}catch($){return this.handleError($,T),Promise.reject($)}}handleError(T,$){this.errorCount++,this.fireError(T,$,this.errorCount)}end(){}}t.IPCMessageWriter=l;class d extends c.AbstractMessageReader{constructor(T){super(),this.onData=new c.Emitter,T.on("close",()=>this.fireClose),T.on("error",$=>this.fireError($)),T.on("message",$=>{this.onData.fire($)})}listen(T){return this.onData.event(T)}}t.PortMessageReader=d;class f extends c.AbstractMessageWriter{constructor(T){super(),this.port=T,this.errorCount=0,T.on("close",()=>this.fireClose()),T.on("error",$=>this.fireError($))}write(T){try{return this.port.postMessage(T),Promise.resolve()}catch($){return this.handleError($,T),Promise.reject($)}}handleError(T,$){this.errorCount++,this.fireError(T,$,this.errorCount)}end(){}}t.PortMessageWriter=f;class p extends c.ReadableStreamMessageReader{constructor(T,$="utf-8"){super((0,r.default)().stream.asReadableStream(T),$)}}t.SocketMessageReader=p;class h extends c.WriteableStreamMessageWriter{constructor(T,$){super((0,r.default)().stream.asWritableStream(T),$),this.socket=T}dispose(){super.dispose(),this.socket.destroy()}}t.SocketMessageWriter=h;class v extends c.ReadableStreamMessageReader{constructor(T,$){super((0,r.default)().stream.asReadableStream(T),$)}}t.StreamMessageReader=v;class b extends c.WriteableStreamMessageWriter{constructor(T,$){super((0,r.default)().stream.asWritableStream(T),$)}}t.StreamMessageWriter=b;const g=process.env.XDG_RUNTIME_DIR,w=new Map([["linux",107],["darwin",103]]);function R(){const I=(0,o.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${I}-sock`;let T;g?T=i.join(g,`vscode-ipc-${I}.sock`):T=i.join(s.tmpdir(),`vscode-${I}.sock`);const $=w.get(process.platform);return $!==void 0&&T.length>$&&(0,r.default)().console.warn(`WARNING: IPC handle "${T}" is longer than ${$} characters.`),T}t.generateRandomPipeName=R;function k(I,T="utf-8"){let $;const L=new Promise((V,H)=>{$=V});return new Promise((V,H)=>{let K=(0,a.createServer)(we=>{K.close(),$([new p(we,T),new h(we,T)])});K.on("error",H),K.listen(I,()=>{K.removeListener("error",H),V({onConnected:()=>L})})})}t.createClientPipeTransport=k;function A(I,T="utf-8"){const $=(0,a.createConnection)(I);return[new p($,T),new h($,T)]}t.createServerPipeTransport=A;function N(I,T="utf-8"){let $;const L=new Promise((V,H)=>{$=V});return new Promise((V,H)=>{const K=(0,a.createServer)(we=>{K.close(),$([new p(we,T),new h(we,T)])});K.on("error",H),K.listen(I,"127.0.0.1",()=>{K.removeListener("error",H),V({onConnected:()=>L})})})}t.createClientSocketTransport=N;function _(I,T="utf-8"){const $=(0,a.createConnection)(I,"127.0.0.1");return[new p($,T),new h($,T)]}t.createServerSocketTransport=_;function B(I){const T=I;return T.read!==void 0&&T.addListener!==void 0}function z(I){const T=I;return T.write!==void 0&&T.addListener!==void 0}function Q(I,T,$,L){$||($=c.NullLogger);const V=B(I)?new v(I):I,H=z(T)?new b(T):T;return c.ConnectionStrategy.is(L)&&(L={connectionStrategy:L}),(0,c.createMessageConnection)(V,H,$,L)}t.createMessageConnection=Q}(Qc)),Qc}var Nv,mk;function gk(){return mk||(mk=1,Nv=Bs()),Nv}var ru={};function A9(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Bp={exports:{}},yk;function Ov(){return yk||(yk=1,function(t,e){(function(n){{var r=n(A9,e);r!==void 0&&(t.exports=r)}})(function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.TextDocument=r.EOL=r.WorkspaceFolder=r.InlineCompletionContext=r.SelectedCompletionInfo=r.InlineCompletionTriggerKind=r.InlineCompletionList=r.InlineCompletionItem=r.StringValue=r.InlayHint=r.InlayHintLabelPart=r.InlayHintKind=r.InlineValueContext=r.InlineValueEvaluatableExpression=r.InlineValueVariableLookup=r.InlineValueText=r.SemanticTokens=r.SemanticTokenModifiers=r.SemanticTokenTypes=r.SelectionRange=r.DocumentLink=r.FormattingOptions=r.CodeLens=r.CodeAction=r.CodeActionContext=r.CodeActionTriggerKind=r.CodeActionKind=r.DocumentSymbol=r.WorkspaceSymbol=r.SymbolInformation=r.SymbolTag=r.SymbolKind=r.DocumentHighlight=r.DocumentHighlightKind=r.SignatureInformation=r.ParameterInformation=r.Hover=r.MarkedString=r.CompletionList=r.CompletionItem=r.CompletionItemLabelDetails=r.InsertTextMode=r.InsertReplaceEdit=r.CompletionItemTag=r.InsertTextFormat=r.CompletionItemKind=r.MarkupContent=r.MarkupKind=r.TextDocumentItem=r.OptionalVersionedTextDocumentIdentifier=r.VersionedTextDocumentIdentifier=r.TextDocumentIdentifier=r.WorkspaceChange=r.WorkspaceEdit=r.DeleteFile=r.RenameFile=r.CreateFile=r.TextDocumentEdit=r.AnnotatedTextEdit=r.ChangeAnnotationIdentifier=r.ChangeAnnotation=r.TextEdit=r.Command=r.Diagnostic=r.CodeDescription=r.DiagnosticTag=r.DiagnosticSeverity=r.DiagnosticRelatedInformation=r.FoldingRange=r.FoldingRangeKind=r.ColorPresentation=r.ColorInformation=r.Color=r.LocationLink=r.Location=r.Range=r.Position=r.uinteger=r.integer=r.URI=r.DocumentUri=void 0;var i;(function(D){function P(m){return typeof m=="string"}D.is=P})(i||(r.DocumentUri=i={}));var s;(function(D){function P(m){return typeof m=="string"}D.is=P})(s||(r.URI=s={}));var o;(function(D){D.MIN_VALUE=-2147483648,D.MAX_VALUE=2147483647;function P(m){return typeof m=="number"&&D.MIN_VALUE<=m&&m<=D.MAX_VALUE}D.is=P})(o||(r.integer=o={}));var a;(function(D){D.MIN_VALUE=0,D.MAX_VALUE=2147483647;function P(m){return typeof m=="number"&&D.MIN_VALUE<=m&&m<=D.MAX_VALUE}D.is=P})(a||(r.uinteger=a={}));var c;(function(D){function P(S,y){return S===Number.MAX_VALUE&&(S=a.MAX_VALUE),y===Number.MAX_VALUE&&(y=a.MAX_VALUE),{line:S,character:y}}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&M.uinteger(y.line)&&M.uinteger(y.character)}D.is=m})(c||(r.Position=c={}));var u;(function(D){function P(S,y,x,E){if(M.uinteger(S)&&M.uinteger(y)&&M.uinteger(x)&&M.uinteger(E))return{start:c.create(S,y),end:c.create(x,E)};if(c.is(S)&&c.is(y))return{start:S,end:y};throw new Error("Range#create called with invalid arguments[".concat(S,", ").concat(y,", ").concat(x,", ").concat(E,"]"))}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&c.is(y.start)&&c.is(y.end)}D.is=m})(u||(r.Range=u={}));var l;(function(D){function P(S,y){return{uri:S,range:y}}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&u.is(y.range)&&(M.string(y.uri)||M.undefined(y.uri))}D.is=m})(l||(r.Location=l={}));var d;(function(D){function P(S,y,x,E){return{targetUri:S,targetRange:y,targetSelectionRange:x,originSelectionRange:E}}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&u.is(y.targetRange)&&M.string(y.targetUri)&&u.is(y.targetSelectionRange)&&(u.is(y.originSelectionRange)||M.undefined(y.originSelectionRange))}D.is=m})(d||(r.LocationLink=d={}));var f;(function(D){function P(S,y,x,E){return{red:S,green:y,blue:x,alpha:E}}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&M.numberRange(y.red,0,1)&&M.numberRange(y.green,0,1)&&M.numberRange(y.blue,0,1)&&M.numberRange(y.alpha,0,1)}D.is=m})(f||(r.Color=f={}));var p;(function(D){function P(S,y){return{range:S,color:y}}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&u.is(y.range)&&f.is(y.color)}D.is=m})(p||(r.ColorInformation=p={}));var h;(function(D){function P(S,y,x){return{label:S,textEdit:y,additionalTextEdits:x}}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&M.string(y.label)&&(M.undefined(y.textEdit)||_.is(y))&&(M.undefined(y.additionalTextEdits)||M.typedArray(y.additionalTextEdits,_.is))}D.is=m})(h||(r.ColorPresentation=h={}));var v;(function(D){D.Comment="comment",D.Imports="imports",D.Region="region"})(v||(r.FoldingRangeKind=v={}));var b;(function(D){function P(S,y,x,E,G,ee){var ie={startLine:S,endLine:y};return M.defined(x)&&(ie.startCharacter=x),M.defined(E)&&(ie.endCharacter=E),M.defined(G)&&(ie.kind=G),M.defined(ee)&&(ie.collapsedText=ee),ie}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&M.uinteger(y.startLine)&&M.uinteger(y.startLine)&&(M.undefined(y.startCharacter)||M.uinteger(y.startCharacter))&&(M.undefined(y.endCharacter)||M.uinteger(y.endCharacter))&&(M.undefined(y.kind)||M.string(y.kind))}D.is=m})(b||(r.FoldingRange=b={}));var g;(function(D){function P(S,y){return{location:S,message:y}}D.create=P;function m(S){var y=S;return M.defined(y)&&l.is(y.location)&&M.string(y.message)}D.is=m})(g||(r.DiagnosticRelatedInformation=g={}));var w;(function(D){D.Error=1,D.Warning=2,D.Information=3,D.Hint=4})(w||(r.DiagnosticSeverity=w={}));var R;(function(D){D.Unnecessary=1,D.Deprecated=2})(R||(r.DiagnosticTag=R={}));var k;(function(D){function P(m){var S=m;return M.objectLiteral(S)&&M.string(S.href)}D.is=P})(k||(r.CodeDescription=k={}));var A;(function(D){function P(S,y,x,E,G,ee){var ie={range:S,message:y};return M.defined(x)&&(ie.severity=x),M.defined(E)&&(ie.code=E),M.defined(G)&&(ie.source=G),M.defined(ee)&&(ie.relatedInformation=ee),ie}D.create=P;function m(S){var y,x=S;return M.defined(x)&&u.is(x.range)&&M.string(x.message)&&(M.number(x.severity)||M.undefined(x.severity))&&(M.integer(x.code)||M.string(x.code)||M.undefined(x.code))&&(M.undefined(x.codeDescription)||M.string((y=x.codeDescription)===null||y===void 0?void 0:y.href))&&(M.string(x.source)||M.undefined(x.source))&&(M.undefined(x.relatedInformation)||M.typedArray(x.relatedInformation,g.is))}D.is=m})(A||(r.Diagnostic=A={}));var N;(function(D){function P(S,y){for(var x=[],E=2;E<arguments.length;E++)x[E-2]=arguments[E];var G={title:S,command:y};return M.defined(x)&&x.length>0&&(G.arguments=x),G}D.create=P;function m(S){var y=S;return M.defined(y)&&M.string(y.title)&&M.string(y.command)}D.is=m})(N||(r.Command=N={}));var _;(function(D){function P(x,E){return{range:x,newText:E}}D.replace=P;function m(x,E){return{range:{start:x,end:x},newText:E}}D.insert=m;function S(x){return{range:x,newText:""}}D.del=S;function y(x){var E=x;return M.objectLiteral(E)&&M.string(E.newText)&&u.is(E.range)}D.is=y})(_||(r.TextEdit=_={}));var B;(function(D){function P(S,y,x){var E={label:S};return y!==void 0&&(E.needsConfirmation=y),x!==void 0&&(E.description=x),E}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&M.string(y.label)&&(M.boolean(y.needsConfirmation)||y.needsConfirmation===void 0)&&(M.string(y.description)||y.description===void 0)}D.is=m})(B||(r.ChangeAnnotation=B={}));var z;(function(D){function P(m){var S=m;return M.string(S)}D.is=P})(z||(r.ChangeAnnotationIdentifier=z={}));var Q;(function(D){function P(x,E,G){return{range:x,newText:E,annotationId:G}}D.replace=P;function m(x,E,G){return{range:{start:x,end:x},newText:E,annotationId:G}}D.insert=m;function S(x,E){return{range:x,newText:"",annotationId:E}}D.del=S;function y(x){var E=x;return _.is(E)&&(B.is(E.annotationId)||z.is(E.annotationId))}D.is=y})(Q||(r.AnnotatedTextEdit=Q={}));var I;(function(D){function P(S,y){return{textDocument:S,edits:y}}D.create=P;function m(S){var y=S;return M.defined(y)&&he.is(y.textDocument)&&Array.isArray(y.edits)}D.is=m})(I||(r.TextDocumentEdit=I={}));var T;(function(D){function P(S,y,x){var E={kind:"create",uri:S};return y!==void 0&&(y.overwrite!==void 0||y.ignoreIfExists!==void 0)&&(E.options=y),x!==void 0&&(E.annotationId=x),E}D.create=P;function m(S){var y=S;return y&&y.kind==="create"&&M.string(y.uri)&&(y.options===void 0||(y.options.overwrite===void 0||M.boolean(y.options.overwrite))&&(y.options.ignoreIfExists===void 0||M.boolean(y.options.ignoreIfExists)))&&(y.annotationId===void 0||z.is(y.annotationId))}D.is=m})(T||(r.CreateFile=T={}));var $;(function(D){function P(S,y,x,E){var G={kind:"rename",oldUri:S,newUri:y};return x!==void 0&&(x.overwrite!==void 0||x.ignoreIfExists!==void 0)&&(G.options=x),E!==void 0&&(G.annotationId=E),G}D.create=P;function m(S){var y=S;return y&&y.kind==="rename"&&M.string(y.oldUri)&&M.string(y.newUri)&&(y.options===void 0||(y.options.overwrite===void 0||M.boolean(y.options.overwrite))&&(y.options.ignoreIfExists===void 0||M.boolean(y.options.ignoreIfExists)))&&(y.annotationId===void 0||z.is(y.annotationId))}D.is=m})($||(r.RenameFile=$={}));var L;(function(D){function P(S,y,x){var E={kind:"delete",uri:S};return y!==void 0&&(y.recursive!==void 0||y.ignoreIfNotExists!==void 0)&&(E.options=y),x!==void 0&&(E.annotationId=x),E}D.create=P;function m(S){var y=S;return y&&y.kind==="delete"&&M.string(y.uri)&&(y.options===void 0||(y.options.recursive===void 0||M.boolean(y.options.recursive))&&(y.options.ignoreIfNotExists===void 0||M.boolean(y.options.ignoreIfNotExists)))&&(y.annotationId===void 0||z.is(y.annotationId))}D.is=m})(L||(r.DeleteFile=L={}));var V;(function(D){function P(m){var S=m;return S&&(S.changes!==void 0||S.documentChanges!==void 0)&&(S.documentChanges===void 0||S.documentChanges.every(function(y){return M.string(y.kind)?T.is(y)||$.is(y)||L.is(y):I.is(y)}))}D.is=P})(V||(r.WorkspaceEdit=V={}));var H=function(){function D(P,m){this.edits=P,this.changeAnnotations=m}return D.prototype.insert=function(P,m,S){var y,x;if(S===void 0?y=_.insert(P,m):z.is(S)?(x=S,y=Q.insert(P,m,S)):(this.assertChangeAnnotations(this.changeAnnotations),x=this.changeAnnotations.manage(S),y=Q.insert(P,m,x)),this.edits.push(y),x!==void 0)return x},D.prototype.replace=function(P,m,S){var y,x;if(S===void 0?y=_.replace(P,m):z.is(S)?(x=S,y=Q.replace(P,m,S)):(this.assertChangeAnnotations(this.changeAnnotations),x=this.changeAnnotations.manage(S),y=Q.replace(P,m,x)),this.edits.push(y),x!==void 0)return x},D.prototype.delete=function(P,m){var S,y;if(m===void 0?S=_.del(P):z.is(m)?(y=m,S=Q.del(P,m)):(this.assertChangeAnnotations(this.changeAnnotations),y=this.changeAnnotations.manage(m),S=Q.del(P,y)),this.edits.push(S),y!==void 0)return y},D.prototype.add=function(P){this.edits.push(P)},D.prototype.all=function(){return this.edits},D.prototype.clear=function(){this.edits.splice(0,this.edits.length)},D.prototype.assertChangeAnnotations=function(P){if(P===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},D}(),K=function(){function D(P){this._annotations=P===void 0?Object.create(null):P,this._counter=0,this._size=0}return D.prototype.all=function(){return this._annotations},Object.defineProperty(D.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),D.prototype.manage=function(P,m){var S;if(z.is(P)?S=P:(S=this.nextId(),m=P),this._annotations[S]!==void 0)throw new Error("Id ".concat(S," is already in use."));if(m===void 0)throw new Error("No annotation provided for id ".concat(S));return this._annotations[S]=m,this._size++,S},D.prototype.nextId=function(){return this._counter++,this._counter.toString()},D}(),we=function(){function D(P){var m=this;this._textEditChanges=Object.create(null),P!==void 0?(this._workspaceEdit=P,P.documentChanges?(this._changeAnnotations=new K(P.changeAnnotations),P.changeAnnotations=this._changeAnnotations.all(),P.documentChanges.forEach(function(S){if(I.is(S)){var y=new H(S.edits,m._changeAnnotations);m._textEditChanges[S.textDocument.uri]=y}})):P.changes&&Object.keys(P.changes).forEach(function(S){var y=new H(P.changes[S]);m._textEditChanges[S]=y})):this._workspaceEdit={}}return Object.defineProperty(D.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),D.prototype.getTextEditChange=function(P){if(he.is(P)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m={uri:P.uri,version:P.version},S=this._textEditChanges[m.uri];if(!S){var y=[],x={textDocument:m,edits:y};this._workspaceEdit.documentChanges.push(x),S=new H(y,this._changeAnnotations),this._textEditChanges[m.uri]=S}return S}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var S=this._textEditChanges[P];if(!S){var y=[];this._workspaceEdit.changes[P]=y,S=new H(y),this._textEditChanges[P]=S}return S}},D.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new K,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},D.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},D.prototype.createFile=function(P,m,S){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var y;B.is(m)||z.is(m)?y=m:S=m;var x,E;if(y===void 0?x=T.create(P,S):(E=z.is(y)?y:this._changeAnnotations.manage(y),x=T.create(P,S,E)),this._workspaceEdit.documentChanges.push(x),E!==void 0)return E},D.prototype.renameFile=function(P,m,S,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var x;B.is(S)||z.is(S)?x=S:y=S;var E,G;if(x===void 0?E=$.create(P,m,y):(G=z.is(x)?x:this._changeAnnotations.manage(x),E=$.create(P,m,y,G)),this._workspaceEdit.documentChanges.push(E),G!==void 0)return G},D.prototype.deleteFile=function(P,m,S){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var y;B.is(m)||z.is(m)?y=m:S=m;var x,E;if(y===void 0?x=L.create(P,S):(E=z.is(y)?y:this._changeAnnotations.manage(y),x=L.create(P,S,E)),this._workspaceEdit.documentChanges.push(x),E!==void 0)return E},D}();r.WorkspaceChange=we;var te;(function(D){function P(S){return{uri:S}}D.create=P;function m(S){var y=S;return M.defined(y)&&M.string(y.uri)}D.is=m})(te||(r.TextDocumentIdentifier=te={}));var C;(function(D){function P(S,y){return{uri:S,version:y}}D.create=P;function m(S){var y=S;return M.defined(y)&&M.string(y.uri)&&M.integer(y.version)}D.is=m})(C||(r.VersionedTextDocumentIdentifier=C={}));var he;(function(D){function P(S,y){return{uri:S,version:y}}D.create=P;function m(S){var y=S;return M.defined(y)&&M.string(y.uri)&&(y.version===null||M.integer(y.version))}D.is=m})(he||(r.OptionalVersionedTextDocumentIdentifier=he={}));var Ye;(function(D){function P(S,y,x,E){return{uri:S,languageId:y,version:x,text:E}}D.create=P;function m(S){var y=S;return M.defined(y)&&M.string(y.uri)&&M.string(y.languageId)&&M.integer(y.version)&&M.string(y.text)}D.is=m})(Ye||(r.TextDocumentItem=Ye={}));var pt;(function(D){D.PlainText="plaintext",D.Markdown="markdown";function P(m){var S=m;return S===D.PlainText||S===D.Markdown}D.is=P})(pt||(r.MarkupKind=pt={}));var W;(function(D){function P(m){var S=m;return M.objectLiteral(m)&&pt.is(S.kind)&&M.string(S.value)}D.is=P})(W||(r.MarkupContent=W={}));var X;(function(D){D.Text=1,D.Method=2,D.Function=3,D.Constructor=4,D.Field=5,D.Variable=6,D.Class=7,D.Interface=8,D.Module=9,D.Property=10,D.Unit=11,D.Value=12,D.Enum=13,D.Keyword=14,D.Snippet=15,D.Color=16,D.File=17,D.Reference=18,D.Folder=19,D.EnumMember=20,D.Constant=21,D.Struct=22,D.Event=23,D.Operator=24,D.TypeParameter=25})(X||(r.CompletionItemKind=X={}));var Ie;(function(D){D.PlainText=1,D.Snippet=2})(Ie||(r.InsertTextFormat=Ie={}));var oe;(function(D){D.Deprecated=1})(oe||(r.CompletionItemTag=oe={}));var be;(function(D){function P(S,y,x){return{newText:S,insert:y,replace:x}}D.create=P;function m(S){var y=S;return y&&M.string(y.newText)&&u.is(y.insert)&&u.is(y.replace)}D.is=m})(be||(r.InsertReplaceEdit=be={}));var Se;(function(D){D.asIs=1,D.adjustIndentation=2})(Se||(r.InsertTextMode=Se={}));var ae;(function(D){function P(m){var S=m;return S&&(M.string(S.detail)||S.detail===void 0)&&(M.string(S.description)||S.description===void 0)}D.is=P})(ae||(r.CompletionItemLabelDetails=ae={}));var O;(function(D){function P(m){return{label:m}}D.create=P})(O||(r.CompletionItem=O={}));var j;(function(D){function P(m,S){return{items:m||[],isIncomplete:!!S}}D.create=P})(j||(r.CompletionList=j={}));var de;(function(D){function P(S){return S.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}D.fromPlainText=P;function m(S){var y=S;return M.string(y)||M.objectLiteral(y)&&M.string(y.language)&&M.string(y.value)}D.is=m})(de||(r.MarkedString=de={}));var U;(function(D){function P(m){var S=m;return!!S&&M.objectLiteral(S)&&(W.is(S.contents)||de.is(S.contents)||M.typedArray(S.contents,de.is))&&(m.range===void 0||u.is(m.range))}D.is=P})(U||(r.Hover=U={}));var ce;(function(D){function P(m,S){return S?{label:m,documentation:S}:{label:m}}D.create=P})(ce||(r.ParameterInformation=ce={}));var qe;(function(D){function P(m,S){for(var y=[],x=2;x<arguments.length;x++)y[x-2]=arguments[x];var E={label:m};return M.defined(S)&&(E.documentation=S),M.defined(y)?E.parameters=y:E.parameters=[],E}D.create=P})(qe||(r.SignatureInformation=qe={}));var et;(function(D){D.Text=1,D.Read=2,D.Write=3})(et||(r.DocumentHighlightKind=et={}));var se;(function(D){function P(m,S){var y={range:m};return M.number(S)&&(y.kind=S),y}D.create=P})(se||(r.DocumentHighlight=se={}));var _e;(function(D){D.File=1,D.Module=2,D.Namespace=3,D.Package=4,D.Class=5,D.Method=6,D.Property=7,D.Field=8,D.Constructor=9,D.Enum=10,D.Interface=11,D.Function=12,D.Variable=13,D.Constant=14,D.String=15,D.Number=16,D.Boolean=17,D.Array=18,D.Object=19,D.Key=20,D.Null=21,D.EnumMember=22,D.Struct=23,D.Event=24,D.Operator=25,D.TypeParameter=26})(_e||(r.SymbolKind=_e={}));var ne;(function(D){D.Deprecated=1})(ne||(r.SymbolTag=ne={}));var De;(function(D){function P(m,S,y,x,E){var G={name:m,kind:S,location:{uri:x,range:y}};return E&&(G.containerName=E),G}D.create=P})(De||(r.SymbolInformation=De={}));var Me;(function(D){function P(m,S,y,x){return x!==void 0?{name:m,kind:S,location:{uri:y,range:x}}:{name:m,kind:S,location:{uri:y}}}D.create=P})(Me||(r.WorkspaceSymbol=Me={}));var ht;(function(D){function P(S,y,x,E,G,ee){var ie={name:S,detail:y,kind:x,range:E,selectionRange:G};return ee!==void 0&&(ie.children=ee),ie}D.create=P;function m(S){var y=S;return y&&M.string(y.name)&&M.number(y.kind)&&u.is(y.range)&&u.is(y.selectionRange)&&(y.detail===void 0||M.string(y.detail))&&(y.deprecated===void 0||M.boolean(y.deprecated))&&(y.children===void 0||Array.isArray(y.children))&&(y.tags===void 0||Array.isArray(y.tags))}D.is=m})(ht||(r.DocumentSymbol=ht={}));var Xe;(function(D){D.Empty="",D.QuickFix="quickfix",D.Refactor="refactor",D.RefactorExtract="refactor.extract",D.RefactorInline="refactor.inline",D.RefactorRewrite="refactor.rewrite",D.Source="source",D.SourceOrganizeImports="source.organizeImports",D.SourceFixAll="source.fixAll"})(Xe||(r.CodeActionKind=Xe={}));var Ut;(function(D){D.Invoked=1,D.Automatic=2})(Ut||(r.CodeActionTriggerKind=Ut={}));var Ht;(function(D){function P(S,y,x){var E={diagnostics:S};return y!=null&&(E.only=y),x!=null&&(E.triggerKind=x),E}D.create=P;function m(S){var y=S;return M.defined(y)&&M.typedArray(y.diagnostics,A.is)&&(y.only===void 0||M.typedArray(y.only,M.string))&&(y.triggerKind===void 0||y.triggerKind===Ut.Invoked||y.triggerKind===Ut.Automatic)}D.is=m})(Ht||(r.CodeActionContext=Ht={}));var ln;(function(D){function P(S,y,x){var E={title:S},G=!0;return typeof y=="string"?(G=!1,E.kind=y):N.is(y)?E.command=y:E.edit=y,G&&x!==void 0&&(E.kind=x),E}D.create=P;function m(S){var y=S;return y&&M.string(y.title)&&(y.diagnostics===void 0||M.typedArray(y.diagnostics,A.is))&&(y.kind===void 0||M.string(y.kind))&&(y.edit!==void 0||y.command!==void 0)&&(y.command===void 0||N.is(y.command))&&(y.isPreferred===void 0||M.boolean(y.isPreferred))&&(y.edit===void 0||V.is(y.edit))}D.is=m})(ln||(r.CodeAction=ln={}));var J;(function(D){function P(S,y){var x={range:S};return M.defined(y)&&(x.data=y),x}D.create=P;function m(S){var y=S;return M.defined(y)&&u.is(y.range)&&(M.undefined(y.command)||N.is(y.command))}D.is=m})(J||(r.CodeLens=J={}));var Z;(function(D){function P(S,y){return{tabSize:S,insertSpaces:y}}D.create=P;function m(S){var y=S;return M.defined(y)&&M.uinteger(y.tabSize)&&M.boolean(y.insertSpaces)}D.is=m})(Z||(r.FormattingOptions=Z={}));var fe;(function(D){function P(S,y,x){return{range:S,target:y,data:x}}D.create=P;function m(S){var y=S;return M.defined(y)&&u.is(y.range)&&(M.undefined(y.target)||M.string(y.target))}D.is=m})(fe||(r.DocumentLink=fe={}));var Vt;(function(D){function P(S,y){return{range:S,parent:y}}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&u.is(y.range)&&(y.parent===void 0||D.is(y.parent))}D.is=m})(Vt||(r.SelectionRange=Vt={}));var Gt;(function(D){D.namespace="namespace",D.type="type",D.class="class",D.enum="enum",D.interface="interface",D.struct="struct",D.typeParameter="typeParameter",D.parameter="parameter",D.variable="variable",D.property="property",D.enumMember="enumMember",D.event="event",D.function="function",D.method="method",D.macro="macro",D.keyword="keyword",D.modifier="modifier",D.comment="comment",D.string="string",D.number="number",D.regexp="regexp",D.operator="operator",D.decorator="decorator"})(Gt||(r.SemanticTokenTypes=Gt={}));var Er;(function(D){D.declaration="declaration",D.definition="definition",D.readonly="readonly",D.static="static",D.deprecated="deprecated",D.abstract="abstract",D.async="async",D.modification="modification",D.documentation="documentation",D.defaultLibrary="defaultLibrary"})(Er||(r.SemanticTokenModifiers=Er={}));var $i;(function(D){function P(m){var S=m;return M.objectLiteral(S)&&(S.resultId===void 0||typeof S.resultId=="string")&&Array.isArray(S.data)&&(S.data.length===0||typeof S.data[0]=="number")}D.is=P})($i||(r.SemanticTokens=$i={}));var as;(function(D){function P(S,y){return{range:S,text:y}}D.create=P;function m(S){var y=S;return y!=null&&u.is(y.range)&&M.string(y.text)}D.is=m})(as||(r.InlineValueText=as={}));var cs;(function(D){function P(S,y,x){return{range:S,variableName:y,caseSensitiveLookup:x}}D.create=P;function m(S){var y=S;return y!=null&&u.is(y.range)&&M.boolean(y.caseSensitiveLookup)&&(M.string(y.variableName)||y.variableName===void 0)}D.is=m})(cs||(r.InlineValueVariableLookup=cs={}));var us;(function(D){function P(S,y){return{range:S,expression:y}}D.create=P;function m(S){var y=S;return y!=null&&u.is(y.range)&&(M.string(y.expression)||y.expression===void 0)}D.is=m})(us||(r.InlineValueEvaluatableExpression=us={}));var ls;(function(D){function P(S,y){return{frameId:S,stoppedLocation:y}}D.create=P;function m(S){var y=S;return M.defined(y)&&u.is(S.stoppedLocation)}D.is=m})(ls||(r.InlineValueContext=ls={}));var Ti;(function(D){D.Type=1,D.Parameter=2;function P(m){return m===1||m===2}D.is=P})(Ti||(r.InlayHintKind=Ti={}));var Si;(function(D){function P(S){return{value:S}}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&(y.tooltip===void 0||M.string(y.tooltip)||W.is(y.tooltip))&&(y.location===void 0||l.is(y.location))&&(y.command===void 0||N.is(y.command))}D.is=m})(Si||(r.InlayHintLabelPart=Si={}));var Tn;(function(D){function P(S,y,x){var E={position:S,label:y};return x!==void 0&&(E.kind=x),E}D.create=P;function m(S){var y=S;return M.objectLiteral(y)&&c.is(y.position)&&(M.string(y.label)||M.typedArray(y.label,Si.is))&&(y.kind===void 0||Ti.is(y.kind))&&y.textEdits===void 0||M.typedArray(y.textEdits,_.is)&&(y.tooltip===void 0||M.string(y.tooltip)||W.is(y.tooltip))&&(y.paddingLeft===void 0||M.boolean(y.paddingLeft))&&(y.paddingRight===void 0||M.boolean(y.paddingRight))}D.is=m})(Tn||(r.InlayHint=Tn={}));var ds;(function(D){function P(m){return{kind:"snippet",value:m}}D.createSnippet=P})(ds||(r.StringValue=ds={}));var fs;(function(D){function P(m,S,y,x){return{insertText:m,filterText:S,range:y,command:x}}D.create=P})(fs||(r.InlineCompletionItem=fs={}));var Rr;(function(D){function P(m){return{items:m}}D.create=P})(Rr||(r.InlineCompletionList=Rr={}));var ps;(function(D){D.Invoked=0,D.Automatic=1})(ps||(r.InlineCompletionTriggerKind=ps={}));var Wr;(function(D){function P(m,S){return{range:m,text:S}}D.create=P})(Wr||(r.SelectedCompletionInfo=Wr={}));var hs;(function(D){function P(m,S){return{triggerKind:m,selectedCompletionInfo:S}}D.create=P})(hs||(r.InlineCompletionContext=hs={}));var Hn;(function(D){function P(m){var S=m;return M.objectLiteral(S)&&s.is(S.uri)&&M.string(S.name)}D.is=P})(Hn||(r.WorkspaceFolder=Hn={})),r.EOL=[`
156
- `,`\r
157
- `,"\r"];var ir;(function(D){function P(x,E,G,ee){return new mo(x,E,G,ee)}D.create=P;function m(x){var E=x;return!!(M.defined(E)&&M.string(E.uri)&&(M.undefined(E.languageId)||M.string(E.languageId))&&M.uinteger(E.lineCount)&&M.func(E.getText)&&M.func(E.positionAt)&&M.func(E.offsetAt))}D.is=m;function S(x,E){for(var G=x.getText(),ee=y(E,function(Pe,it){var Ze=Pe.range.start.line-it.range.start.line;return Ze===0?Pe.range.start.character-it.range.start.character:Ze}),ie=G.length,Be=ee.length-1;Be>=0;Be--){var Ne=ee[Be],Je=x.offsetAt(Ne.range.start),me=x.offsetAt(Ne.range.end);if(me<=ie)G=G.substring(0,Je)+Ne.newText+G.substring(me,G.length);else throw new Error("Overlapping edit");ie=Je}return G}D.applyEdits=S;function y(x,E){if(x.length<=1)return x;var G=x.length/2|0,ee=x.slice(0,G),ie=x.slice(G);y(ee,E),y(ie,E);for(var Be=0,Ne=0,Je=0;Be<ee.length&&Ne<ie.length;){var me=E(ee[Be],ie[Ne]);me<=0?x[Je++]=ee[Be++]:x[Je++]=ie[Ne++]}for(;Be<ee.length;)x[Je++]=ee[Be++];for(;Ne<ie.length;)x[Je++]=ie[Ne++];return x}})(ir||(r.TextDocument=ir={}));var mo=function(){function D(P,m,S,y){this._uri=P,this._languageId=m,this._version=S,this._content=y,this._lineOffsets=void 0}return Object.defineProperty(D.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),D.prototype.getText=function(P){if(P){var m=this.offsetAt(P.start),S=this.offsetAt(P.end);return this._content.substring(m,S)}return this._content},D.prototype.update=function(P,m){this._content=P.text,this._version=m,this._lineOffsets=void 0},D.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var P=[],m=this._content,S=!0,y=0;y<m.length;y++){S&&(P.push(y),S=!1);var x=m.charAt(y);S=x==="\r"||x===`
158
- `,x==="\r"&&y+1<m.length&&m.charAt(y+1)===`
159
- `&&y++}S&&m.length>0&&P.push(m.length),this._lineOffsets=P}return this._lineOffsets},D.prototype.positionAt=function(P){P=Math.max(Math.min(P,this._content.length),0);var m=this.getLineOffsets(),S=0,y=m.length;if(y===0)return c.create(0,P);for(;S<y;){var x=Math.floor((S+y)/2);m[x]>P?y=x:S=x+1}var E=S-1;return c.create(E,P-m[E])},D.prototype.offsetAt=function(P){var m=this.getLineOffsets();if(P.line>=m.length)return this._content.length;if(P.line<0)return 0;var S=m[P.line],y=P.line+1<m.length?m[P.line+1]:this._content.length;return Math.max(Math.min(S+P.character,y),S)},Object.defineProperty(D.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),D}(),M;(function(D){var P=Object.prototype.toString;function m(me){return typeof me<"u"}D.defined=m;function S(me){return typeof me>"u"}D.undefined=S;function y(me){return me===!0||me===!1}D.boolean=y;function x(me){return P.call(me)==="[object String]"}D.string=x;function E(me){return P.call(me)==="[object Number]"}D.number=E;function G(me,Pe,it){return P.call(me)==="[object Number]"&&Pe<=me&&me<=it}D.numberRange=G;function ee(me){return P.call(me)==="[object Number]"&&-2147483648<=me&&me<=2147483647}D.integer=ee;function ie(me){return P.call(me)==="[object Number]"&&0<=me&&me<=2147483647}D.uinteger=ie;function Be(me){return P.call(me)==="[object Function]"}D.func=Be;function Ne(me){return me!==null&&typeof me=="object"}D.objectLiteral=Ne;function Je(me,Pe){return Array.isArray(me)&&me.every(Pe)}D.typedArray=Je})(M||(M={}))})}(Bp,Bp.exports)),Bp.exports}var wn={},vk;function Rt(){if(vk)return wn;vk=1,Object.defineProperty(wn,"__esModule",{value:!0}),wn.ProtocolNotificationType=wn.ProtocolNotificationType0=wn.ProtocolRequestType=wn.ProtocolRequestType0=wn.RegistrationType=wn.MessageDirection=void 0;const t=Bs();var e;(function(a){a.clientToServer="clientToServer",a.serverToClient="serverToClient",a.both="both"})(e||(wn.MessageDirection=e={}));class n{constructor(c){this.method=c}}wn.RegistrationType=n;class r extends t.RequestType0{constructor(c){super(c)}}wn.ProtocolRequestType0=r;class i extends t.RequestType{constructor(c){super(c,t.ParameterStructures.byName)}}wn.ProtocolRequestType=i;class s extends t.NotificationType0{constructor(c){super(c)}}wn.ProtocolNotificationType0=s;class o extends t.NotificationType{constructor(c){super(c,t.ParameterStructures.byName)}}return wn.ProtocolNotificationType=o,wn}var Fv={},_t={},wk;function Lv(){if(wk)return _t;wk=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.objectLiteral=_t.typedArray=_t.stringArray=_t.array=_t.func=_t.error=_t.number=_t.string=_t.boolean=void 0;function t(u){return u===!0||u===!1}_t.boolean=t;function e(u){return typeof u=="string"||u instanceof String}_t.string=e;function n(u){return typeof u=="number"||u instanceof Number}_t.number=n;function r(u){return u instanceof Error}_t.error=r;function i(u){return typeof u=="function"}_t.func=i;function s(u){return Array.isArray(u)}_t.array=s;function o(u){return s(u)&&u.every(l=>e(l))}_t.stringArray=o;function a(u,l){return Array.isArray(u)&&u.every(l)}_t.typedArray=a;function c(u){return u!==null&&typeof u=="object"}return _t.objectLiteral=c,_t}var iu={},bk;function _9(){if(bk)return iu;bk=1,Object.defineProperty(iu,"__esModule",{value:!0}),iu.ImplementationRequest=void 0;const t=Rt();var e;return function(n){n.method="textDocument/implementation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(iu.ImplementationRequest=e={})),iu}var su={},Dk;function P9(){if(Dk)return su;Dk=1,Object.defineProperty(su,"__esModule",{value:!0}),su.TypeDefinitionRequest=void 0;const t=Rt();var e;return function(n){n.method="textDocument/typeDefinition",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(su.TypeDefinitionRequest=e={})),su}var zs={},Ek;function x9(){if(Ek)return zs;Ek=1,Object.defineProperty(zs,"__esModule",{value:!0}),zs.DidChangeWorkspaceFoldersNotification=zs.WorkspaceFoldersRequest=void 0;const t=Rt();var e;(function(r){r.method="workspace/workspaceFolders",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)})(e||(zs.WorkspaceFoldersRequest=e={}));var n;return function(r){r.method="workspace/didChangeWorkspaceFolders",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolNotificationType(r.method)}(n||(zs.DidChangeWorkspaceFoldersNotification=n={})),zs}var ou={},Rk;function I9(){if(Rk)return ou;Rk=1,Object.defineProperty(ou,"__esModule",{value:!0}),ou.ConfigurationRequest=void 0;const t=Rt();var e;return function(n){n.method="workspace/configuration",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(e||(ou.ConfigurationRequest=e={})),ou}var qs={},$k;function N9(){if($k)return qs;$k=1,Object.defineProperty(qs,"__esModule",{value:!0}),qs.ColorPresentationRequest=qs.DocumentColorRequest=void 0;const t=Rt();var e;(function(r){r.method="textDocument/documentColor",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(qs.DocumentColorRequest=e={}));var n;return function(r){r.method="textDocument/colorPresentation",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)}(n||(qs.ColorPresentationRequest=n={})),qs}var js={},Tk;function O9(){if(Tk)return js;Tk=1,Object.defineProperty(js,"__esModule",{value:!0}),js.FoldingRangeRefreshRequest=js.FoldingRangeRequest=void 0;const t=Rt();var e;(function(r){r.method="textDocument/foldingRange",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(js.FoldingRangeRequest=e={}));var n;return function(r){r.method="workspace/foldingRange/refresh",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)}(n||(js.FoldingRangeRefreshRequest=n={})),js}var au={},Sk;function F9(){if(Sk)return au;Sk=1,Object.defineProperty(au,"__esModule",{value:!0}),au.DeclarationRequest=void 0;const t=Rt();var e;return function(n){n.method="textDocument/declaration",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(au.DeclarationRequest=e={})),au}var cu={},kk;function L9(){if(kk)return cu;kk=1,Object.defineProperty(cu,"__esModule",{value:!0}),cu.SelectionRangeRequest=void 0;const t=Rt();var e;return function(n){n.method="textDocument/selectionRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(cu.SelectionRangeRequest=e={})),cu}var pi={},Ck;function M9(){if(Ck)return pi;Ck=1,Object.defineProperty(pi,"__esModule",{value:!0}),pi.WorkDoneProgressCancelNotification=pi.WorkDoneProgressCreateRequest=pi.WorkDoneProgress=void 0;const t=Bs(),e=Rt();var n;(function(s){s.type=new t.ProgressType;function o(a){return a===s.type}s.is=o})(n||(pi.WorkDoneProgress=n={}));var r;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=e.MessageDirection.serverToClient,s.type=new e.ProtocolRequestType(s.method)})(r||(pi.WorkDoneProgressCreateRequest=r={}));var i;return function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolNotificationType(s.method)}(i||(pi.WorkDoneProgressCancelNotification=i={})),pi}var hi={},Ak;function B9(){if(Ak)return hi;Ak=1,Object.defineProperty(hi,"__esModule",{value:!0}),hi.CallHierarchyOutgoingCallsRequest=hi.CallHierarchyIncomingCallsRequest=hi.CallHierarchyPrepareRequest=void 0;const t=Rt();var e;(function(i){i.method="textDocument/prepareCallHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(hi.CallHierarchyPrepareRequest=e={}));var n;(function(i){i.method="callHierarchy/incomingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(hi.CallHierarchyIncomingCallsRequest=n={}));var r;return function(i){i.method="callHierarchy/outgoingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(hi.CallHierarchyOutgoingCallsRequest=r={})),hi}var bn={},_k;function z9(){if(_k)return bn;_k=1,Object.defineProperty(bn,"__esModule",{value:!0}),bn.SemanticTokensRefreshRequest=bn.SemanticTokensRangeRequest=bn.SemanticTokensDeltaRequest=bn.SemanticTokensRequest=bn.SemanticTokensRegistrationType=bn.TokenFormat=void 0;const t=Rt();var e;(function(a){a.Relative="relative"})(e||(bn.TokenFormat=e={}));var n;(function(a){a.method="textDocument/semanticTokens",a.type=new t.RegistrationType(a.method)})(n||(bn.SemanticTokensRegistrationType=n={}));var r;(function(a){a.method="textDocument/semanticTokens/full",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method),a.registrationMethod=n.method})(r||(bn.SemanticTokensRequest=r={}));var i;(function(a){a.method="textDocument/semanticTokens/full/delta",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method),a.registrationMethod=n.method})(i||(bn.SemanticTokensDeltaRequest=i={}));var s;(function(a){a.method="textDocument/semanticTokens/range",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method),a.registrationMethod=n.method})(s||(bn.SemanticTokensRangeRequest=s={}));var o;return function(a){a.method="workspace/semanticTokens/refresh",a.messageDirection=t.MessageDirection.serverToClient,a.type=new t.ProtocolRequestType0(a.method)}(o||(bn.SemanticTokensRefreshRequest=o={})),bn}var uu={},Pk;function q9(){if(Pk)return uu;Pk=1,Object.defineProperty(uu,"__esModule",{value:!0}),uu.ShowDocumentRequest=void 0;const t=Rt();var e;return function(n){n.method="window/showDocument",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(e||(uu.ShowDocumentRequest=e={})),uu}var lu={},xk;function j9(){if(xk)return lu;xk=1,Object.defineProperty(lu,"__esModule",{value:!0}),lu.LinkedEditingRangeRequest=void 0;const t=Rt();var e;return function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(lu.LinkedEditingRangeRequest=e={})),lu}var en={},Ik;function U9(){if(Ik)return en;Ik=1,Object.defineProperty(en,"__esModule",{value:!0}),en.WillDeleteFilesRequest=en.DidDeleteFilesNotification=en.DidRenameFilesNotification=en.WillRenameFilesRequest=en.DidCreateFilesNotification=en.WillCreateFilesRequest=en.FileOperationPatternKind=void 0;const t=Rt();var e;(function(c){c.file="file",c.folder="folder"})(e||(en.FileOperationPatternKind=e={}));var n;(function(c){c.method="workspace/willCreateFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(n||(en.WillCreateFilesRequest=n={}));var r;(function(c){c.method="workspace/didCreateFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(r||(en.DidCreateFilesNotification=r={}));var i;(function(c){c.method="workspace/willRenameFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(i||(en.WillRenameFilesRequest=i={}));var s;(function(c){c.method="workspace/didRenameFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(s||(en.DidRenameFilesNotification=s={}));var o;(function(c){c.method="workspace/didDeleteFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(o||(en.DidDeleteFilesNotification=o={}));var a;return function(c){c.method="workspace/willDeleteFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)}(a||(en.WillDeleteFilesRequest=a={})),en}var mi={},Nk;function G9(){if(Nk)return mi;Nk=1,Object.defineProperty(mi,"__esModule",{value:!0}),mi.MonikerRequest=mi.MonikerKind=mi.UniquenessLevel=void 0;const t=Rt();var e;(function(i){i.document="document",i.project="project",i.group="group",i.scheme="scheme",i.global="global"})(e||(mi.UniquenessLevel=e={}));var n;(function(i){i.$import="import",i.$export="export",i.local="local"})(n||(mi.MonikerKind=n={}));var r;return function(i){i.method="textDocument/moniker",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(mi.MonikerRequest=r={})),mi}var gi={},Ok;function W9(){if(Ok)return gi;Ok=1,Object.defineProperty(gi,"__esModule",{value:!0}),gi.TypeHierarchySubtypesRequest=gi.TypeHierarchySupertypesRequest=gi.TypeHierarchyPrepareRequest=void 0;const t=Rt();var e;(function(i){i.method="textDocument/prepareTypeHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(gi.TypeHierarchyPrepareRequest=e={}));var n;(function(i){i.method="typeHierarchy/supertypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(gi.TypeHierarchySupertypesRequest=n={}));var r;return function(i){i.method="typeHierarchy/subtypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(gi.TypeHierarchySubtypesRequest=r={})),gi}var Us={},Fk;function H9(){if(Fk)return Us;Fk=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.InlineValueRefreshRequest=Us.InlineValueRequest=void 0;const t=Rt();var e;(function(r){r.method="textDocument/inlineValue",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Us.InlineValueRequest=e={}));var n;return function(r){r.method="workspace/inlineValue/refresh",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)}(n||(Us.InlineValueRefreshRequest=n={})),Us}var yi={},Lk;function V9(){if(Lk)return yi;Lk=1,Object.defineProperty(yi,"__esModule",{value:!0}),yi.InlayHintRefreshRequest=yi.InlayHintResolveRequest=yi.InlayHintRequest=void 0;const t=Rt();var e;(function(i){i.method="textDocument/inlayHint",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(yi.InlayHintRequest=e={}));var n;(function(i){i.method="inlayHint/resolve",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(yi.InlayHintResolveRequest=n={}));var r;return function(i){i.method="workspace/inlayHint/refresh",i.messageDirection=t.MessageDirection.serverToClient,i.type=new t.ProtocolRequestType0(i.method)}(r||(yi.InlayHintRefreshRequest=r={})),yi}var qn={},Mk;function K9(){if(Mk)return qn;Mk=1,Object.defineProperty(qn,"__esModule",{value:!0}),qn.DiagnosticRefreshRequest=qn.WorkspaceDiagnosticRequest=qn.DocumentDiagnosticRequest=qn.DocumentDiagnosticReportKind=qn.DiagnosticServerCancellationData=void 0;const t=Bs(),e=Lv(),n=Rt();var r;(function(c){function u(l){const d=l;return d&&e.boolean(d.retriggerRequest)}c.is=u})(r||(qn.DiagnosticServerCancellationData=r={}));var i;(function(c){c.Full="full",c.Unchanged="unchanged"})(i||(qn.DocumentDiagnosticReportKind=i={}));var s;(function(c){c.method="textDocument/diagnostic",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method),c.partialResult=new t.ProgressType})(s||(qn.DocumentDiagnosticRequest=s={}));var o;(function(c){c.method="workspace/diagnostic",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method),c.partialResult=new t.ProgressType})(o||(qn.WorkspaceDiagnosticRequest=o={}));var a;return function(c){c.method="workspace/diagnostic/refresh",c.messageDirection=n.MessageDirection.serverToClient,c.type=new n.ProtocolRequestType0(c.method)}(a||(qn.DiagnosticRefreshRequest=a={})),qn}var $t={},Bk;function Y9(){if(Bk)return $t;Bk=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.DidCloseNotebookDocumentNotification=$t.DidSaveNotebookDocumentNotification=$t.DidChangeNotebookDocumentNotification=$t.NotebookCellArrayChange=$t.DidOpenNotebookDocumentNotification=$t.NotebookDocumentSyncRegistrationType=$t.NotebookDocument=$t.NotebookCell=$t.ExecutionSummary=$t.NotebookCellKind=void 0;const t=Ov(),e=Lv(),n=Rt();var r;(function(p){p.Markup=1,p.Code=2;function h(v){return v===1||v===2}p.is=h})(r||($t.NotebookCellKind=r={}));var i;(function(p){function h(g,w){const R={executionOrder:g};return(w===!0||w===!1)&&(R.success=w),R}p.create=h;function v(g){const w=g;return e.objectLiteral(w)&&t.uinteger.is(w.executionOrder)&&(w.success===void 0||e.boolean(w.success))}p.is=v;function b(g,w){return g===w?!0:g==null||w===null||w===void 0?!1:g.executionOrder===w.executionOrder&&g.success===w.success}p.equals=b})(i||($t.ExecutionSummary=i={}));var s;(function(p){function h(w,R){return{kind:w,document:R}}p.create=h;function v(w){const R=w;return e.objectLiteral(R)&&r.is(R.kind)&&t.DocumentUri.is(R.document)&&(R.metadata===void 0||e.objectLiteral(R.metadata))}p.is=v;function b(w,R){const k=new Set;return w.document!==R.document&&k.add("document"),w.kind!==R.kind&&k.add("kind"),w.executionSummary!==R.executionSummary&&k.add("executionSummary"),(w.metadata!==void 0||R.metadata!==void 0)&&!g(w.metadata,R.metadata)&&k.add("metadata"),(w.executionSummary!==void 0||R.executionSummary!==void 0)&&!i.equals(w.executionSummary,R.executionSummary)&&k.add("executionSummary"),k}p.diff=b;function g(w,R){if(w===R)return!0;if(w==null||R===null||R===void 0||typeof w!=typeof R||typeof w!="object")return!1;const k=Array.isArray(w),A=Array.isArray(R);if(k!==A)return!1;if(k&&A){if(w.length!==R.length)return!1;for(let N=0;N<w.length;N++)if(!g(w[N],R[N]))return!1}if(e.objectLiteral(w)&&e.objectLiteral(R)){const N=Object.keys(w),_=Object.keys(R);if(N.length!==_.length||(N.sort(),_.sort(),!g(N,_)))return!1;for(let B=0;B<N.length;B++){const z=N[B];if(!g(w[z],R[z]))return!1}}return!0}})(s||($t.NotebookCell=s={}));var o;(function(p){function h(b,g,w,R){return{uri:b,notebookType:g,version:w,cells:R}}p.create=h;function v(b){const g=b;return e.objectLiteral(g)&&e.string(g.uri)&&t.integer.is(g.version)&&e.typedArray(g.cells,s.is)}p.is=v})(o||($t.NotebookDocument=o={}));var a;(function(p){p.method="notebookDocument/sync",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.RegistrationType(p.method)})(a||($t.NotebookDocumentSyncRegistrationType=a={}));var c;(function(p){p.method="notebookDocument/didOpen",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=a.method})(c||($t.DidOpenNotebookDocumentNotification=c={}));var u;(function(p){function h(b){const g=b;return e.objectLiteral(g)&&t.uinteger.is(g.start)&&t.uinteger.is(g.deleteCount)&&(g.cells===void 0||e.typedArray(g.cells,s.is))}p.is=h;function v(b,g,w){const R={start:b,deleteCount:g};return w!==void 0&&(R.cells=w),R}p.create=v})(u||($t.NotebookCellArrayChange=u={}));var l;(function(p){p.method="notebookDocument/didChange",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=a.method})(l||($t.DidChangeNotebookDocumentNotification=l={}));var d;(function(p){p.method="notebookDocument/didSave",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=a.method})(d||($t.DidSaveNotebookDocumentNotification=d={}));var f;return function(p){p.method="notebookDocument/didClose",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=a.method}(f||($t.DidCloseNotebookDocumentNotification=f={})),$t}var du={},zk;function X9(){if(zk)return du;zk=1,Object.defineProperty(du,"__esModule",{value:!0}),du.InlineCompletionRequest=void 0;const t=Rt();var e;return function(n){n.method="textDocument/inlineCompletion",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(du.InlineCompletionRequest=e={})),du}var qk;function J9(){return qk||(qk=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceSymbolRequest=t.CodeActionResolveRequest=t.CodeActionRequest=t.DocumentSymbolRequest=t.DocumentHighlightRequest=t.ReferencesRequest=t.DefinitionRequest=t.SignatureHelpRequest=t.SignatureHelpTriggerKind=t.HoverRequest=t.CompletionResolveRequest=t.CompletionRequest=t.CompletionTriggerKind=t.PublishDiagnosticsNotification=t.WatchKind=t.RelativePattern=t.FileChangeType=t.DidChangeWatchedFilesNotification=t.WillSaveTextDocumentWaitUntilRequest=t.WillSaveTextDocumentNotification=t.TextDocumentSaveReason=t.DidSaveTextDocumentNotification=t.DidCloseTextDocumentNotification=t.DidChangeTextDocumentNotification=t.TextDocumentContentChangeEvent=t.DidOpenTextDocumentNotification=t.TextDocumentSyncKind=t.TelemetryEventNotification=t.LogMessageNotification=t.ShowMessageRequest=t.ShowMessageNotification=t.MessageType=t.DidChangeConfigurationNotification=t.ExitNotification=t.ShutdownRequest=t.InitializedNotification=t.InitializeErrorCodes=t.InitializeRequest=t.WorkDoneProgressOptions=t.TextDocumentRegistrationOptions=t.StaticRegistrationOptions=t.PositionEncodingKind=t.FailureHandlingKind=t.ResourceOperationKind=t.UnregistrationRequest=t.RegistrationRequest=t.DocumentSelector=t.NotebookCellTextDocumentFilter=t.NotebookDocumentFilter=t.TextDocumentFilter=void 0,t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.WillRenameFilesRequest=t.DidRenameFilesNotification=t.WillCreateFilesRequest=t.DidCreateFilesNotification=t.FileOperationPatternKind=t.LinkedEditingRangeRequest=t.ShowDocumentRequest=t.SemanticTokensRegistrationType=t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.TokenFormat=t.CallHierarchyPrepareRequest=t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=t.SelectionRangeRequest=t.DeclarationRequest=t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=t.ColorPresentationRequest=t.DocumentColorRequest=t.ConfigurationRequest=t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=t.TypeDefinitionRequest=t.ImplementationRequest=t.ApplyWorkspaceEditRequest=t.ExecuteCommandRequest=t.PrepareRenameRequest=t.RenameRequest=t.PrepareSupportDefaultBehavior=t.DocumentOnTypeFormattingRequest=t.DocumentRangesFormattingRequest=t.DocumentRangeFormattingRequest=t.DocumentFormattingRequest=t.DocumentLinkResolveRequest=t.DocumentLinkRequest=t.CodeLensRefreshRequest=t.CodeLensResolveRequest=t.CodeLensRequest=t.WorkspaceSymbolResolveRequest=void 0,t.InlineCompletionRequest=t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=t.InlineValueRefreshRequest=t.InlineValueRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchySubtypesRequest=t.TypeHierarchyPrepareRequest=void 0;const e=Rt(),n=Ov(),r=Lv(),i=_9();Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const s=P9();Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return s.TypeDefinitionRequest}});const o=x9();Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return o.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return o.DidChangeWorkspaceFoldersNotification}});const a=I9();Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return a.ConfigurationRequest}});const c=N9();Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return c.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return c.ColorPresentationRequest}});const u=O9();Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return u.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return u.FoldingRangeRefreshRequest}});const l=F9();Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return l.DeclarationRequest}});const d=L9();Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return d.SelectionRangeRequest}});const f=M9();Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return f.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return f.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return f.WorkDoneProgressCancelNotification}});const p=B9();Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return p.CallHierarchyPrepareRequest}});const h=z9();Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return h.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return h.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return h.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return h.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return h.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return h.SemanticTokensRegistrationType}});const v=q9();Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return v.ShowDocumentRequest}});const b=j9();Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return b.LinkedEditingRangeRequest}});const g=U9();Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return g.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return g.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return g.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return g.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return g.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return g.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return g.WillDeleteFilesRequest}});const w=G9();Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return w.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return w.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return w.MonikerRequest}});const R=W9();Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return R.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return R.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return R.TypeHierarchySupertypesRequest}});const k=H9();Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return k.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return k.InlineValueRefreshRequest}});const A=V9();Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return A.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return A.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return A.InlayHintRefreshRequest}});const N=K9();Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return N.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return N.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return N.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return N.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return N.DiagnosticRefreshRequest}});const _=Y9();Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return _.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return _.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return _.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return _.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return _.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return _.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return _.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return _.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return _.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return _.DidCloseNotebookDocumentNotification}});const B=X9();Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return B.InlineCompletionRequest}});var z;(function(m){function S(y){const x=y;return r.string(x)||r.string(x.language)||r.string(x.scheme)||r.string(x.pattern)}m.is=S})(z||(t.TextDocumentFilter=z={}));var Q;(function(m){function S(y){const x=y;return r.objectLiteral(x)&&(r.string(x.notebookType)||r.string(x.scheme)||r.string(x.pattern))}m.is=S})(Q||(t.NotebookDocumentFilter=Q={}));var I;(function(m){function S(y){const x=y;return r.objectLiteral(x)&&(r.string(x.notebook)||Q.is(x.notebook))&&(x.language===void 0||r.string(x.language))}m.is=S})(I||(t.NotebookCellTextDocumentFilter=I={}));var T;(function(m){function S(y){if(!Array.isArray(y))return!1;for(let x of y)if(!r.string(x)&&!z.is(x)&&!I.is(x))return!1;return!0}m.is=S})(T||(t.DocumentSelector=T={}));var $;(function(m){m.method="client/registerCapability",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType(m.method)})($||(t.RegistrationRequest=$={}));var L;(function(m){m.method="client/unregisterCapability",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType(m.method)})(L||(t.UnregistrationRequest=L={}));var V;(function(m){m.Create="create",m.Rename="rename",m.Delete="delete"})(V||(t.ResourceOperationKind=V={}));var H;(function(m){m.Abort="abort",m.Transactional="transactional",m.TextOnlyTransactional="textOnlyTransactional",m.Undo="undo"})(H||(t.FailureHandlingKind=H={}));var K;(function(m){m.UTF8="utf-8",m.UTF16="utf-16",m.UTF32="utf-32"})(K||(t.PositionEncodingKind=K={}));var we;(function(m){function S(y){const x=y;return x&&r.string(x.id)&&x.id.length>0}m.hasId=S})(we||(t.StaticRegistrationOptions=we={}));var te;(function(m){function S(y){const x=y;return x&&(x.documentSelector===null||T.is(x.documentSelector))}m.is=S})(te||(t.TextDocumentRegistrationOptions=te={}));var C;(function(m){function S(x){const E=x;return r.objectLiteral(E)&&(E.workDoneProgress===void 0||r.boolean(E.workDoneProgress))}m.is=S;function y(x){const E=x;return E&&r.boolean(E.workDoneProgress)}m.hasWorkDoneProgress=y})(C||(t.WorkDoneProgressOptions=C={}));var he;(function(m){m.method="initialize",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(he||(t.InitializeRequest=he={}));var Ye;(function(m){m.unknownProtocolVersion=1})(Ye||(t.InitializeErrorCodes=Ye={}));var pt;(function(m){m.method="initialized",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(pt||(t.InitializedNotification=pt={}));var W;(function(m){m.method="shutdown",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType0(m.method)})(W||(t.ShutdownRequest=W={}));var X;(function(m){m.method="exit",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType0(m.method)})(X||(t.ExitNotification=X={}));var Ie;(function(m){m.method="workspace/didChangeConfiguration",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(Ie||(t.DidChangeConfigurationNotification=Ie={}));var oe;(function(m){m.Error=1,m.Warning=2,m.Info=3,m.Log=4,m.Debug=5})(oe||(t.MessageType=oe={}));var be;(function(m){m.method="window/showMessage",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(be||(t.ShowMessageNotification=be={}));var Se;(function(m){m.method="window/showMessageRequest",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType(m.method)})(Se||(t.ShowMessageRequest=Se={}));var ae;(function(m){m.method="window/logMessage",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(ae||(t.LogMessageNotification=ae={}));var O;(function(m){m.method="telemetry/event",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(O||(t.TelemetryEventNotification=O={}));var j;(function(m){m.None=0,m.Full=1,m.Incremental=2})(j||(t.TextDocumentSyncKind=j={}));var de;(function(m){m.method="textDocument/didOpen",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(de||(t.DidOpenTextDocumentNotification=de={}));var U;(function(m){function S(x){let E=x;return E!=null&&typeof E.text=="string"&&E.range!==void 0&&(E.rangeLength===void 0||typeof E.rangeLength=="number")}m.isIncremental=S;function y(x){let E=x;return E!=null&&typeof E.text=="string"&&E.range===void 0&&E.rangeLength===void 0}m.isFull=y})(U||(t.TextDocumentContentChangeEvent=U={}));var ce;(function(m){m.method="textDocument/didChange",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(ce||(t.DidChangeTextDocumentNotification=ce={}));var qe;(function(m){m.method="textDocument/didClose",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(qe||(t.DidCloseTextDocumentNotification=qe={}));var et;(function(m){m.method="textDocument/didSave",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(et||(t.DidSaveTextDocumentNotification=et={}));var se;(function(m){m.Manual=1,m.AfterDelay=2,m.FocusOut=3})(se||(t.TextDocumentSaveReason=se={}));var _e;(function(m){m.method="textDocument/willSave",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(_e||(t.WillSaveTextDocumentNotification=_e={}));var ne;(function(m){m.method="textDocument/willSaveWaitUntil",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ne||(t.WillSaveTextDocumentWaitUntilRequest=ne={}));var De;(function(m){m.method="workspace/didChangeWatchedFiles",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(De||(t.DidChangeWatchedFilesNotification=De={}));var Me;(function(m){m.Created=1,m.Changed=2,m.Deleted=3})(Me||(t.FileChangeType=Me={}));var ht;(function(m){function S(y){const x=y;return r.objectLiteral(x)&&(n.URI.is(x.baseUri)||n.WorkspaceFolder.is(x.baseUri))&&r.string(x.pattern)}m.is=S})(ht||(t.RelativePattern=ht={}));var Xe;(function(m){m.Create=1,m.Change=2,m.Delete=4})(Xe||(t.WatchKind=Xe={}));var Ut;(function(m){m.method="textDocument/publishDiagnostics",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(Ut||(t.PublishDiagnosticsNotification=Ut={}));var Ht;(function(m){m.Invoked=1,m.TriggerCharacter=2,m.TriggerForIncompleteCompletions=3})(Ht||(t.CompletionTriggerKind=Ht={}));var ln;(function(m){m.method="textDocument/completion",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ln||(t.CompletionRequest=ln={}));var J;(function(m){m.method="completionItem/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(J||(t.CompletionResolveRequest=J={}));var Z;(function(m){m.method="textDocument/hover",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Z||(t.HoverRequest=Z={}));var fe;(function(m){m.Invoked=1,m.TriggerCharacter=2,m.ContentChange=3})(fe||(t.SignatureHelpTriggerKind=fe={}));var Vt;(function(m){m.method="textDocument/signatureHelp",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Vt||(t.SignatureHelpRequest=Vt={}));var Gt;(function(m){m.method="textDocument/definition",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Gt||(t.DefinitionRequest=Gt={}));var Er;(function(m){m.method="textDocument/references",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Er||(t.ReferencesRequest=Er={}));var $i;(function(m){m.method="textDocument/documentHighlight",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})($i||(t.DocumentHighlightRequest=$i={}));var as;(function(m){m.method="textDocument/documentSymbol",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(as||(t.DocumentSymbolRequest=as={}));var cs;(function(m){m.method="textDocument/codeAction",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(cs||(t.CodeActionRequest=cs={}));var us;(function(m){m.method="codeAction/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(us||(t.CodeActionResolveRequest=us={}));var ls;(function(m){m.method="workspace/symbol",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ls||(t.WorkspaceSymbolRequest=ls={}));var Ti;(function(m){m.method="workspaceSymbol/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Ti||(t.WorkspaceSymbolResolveRequest=Ti={}));var Si;(function(m){m.method="textDocument/codeLens",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Si||(t.CodeLensRequest=Si={}));var Tn;(function(m){m.method="codeLens/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Tn||(t.CodeLensResolveRequest=Tn={}));var ds;(function(m){m.method="workspace/codeLens/refresh",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType0(m.method)})(ds||(t.CodeLensRefreshRequest=ds={}));var fs;(function(m){m.method="textDocument/documentLink",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(fs||(t.DocumentLinkRequest=fs={}));var Rr;(function(m){m.method="documentLink/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Rr||(t.DocumentLinkResolveRequest=Rr={}));var ps;(function(m){m.method="textDocument/formatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ps||(t.DocumentFormattingRequest=ps={}));var Wr;(function(m){m.method="textDocument/rangeFormatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Wr||(t.DocumentRangeFormattingRequest=Wr={}));var hs;(function(m){m.method="textDocument/rangesFormatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(hs||(t.DocumentRangesFormattingRequest=hs={}));var Hn;(function(m){m.method="textDocument/onTypeFormatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Hn||(t.DocumentOnTypeFormattingRequest=Hn={}));var ir;(function(m){m.Identifier=1})(ir||(t.PrepareSupportDefaultBehavior=ir={}));var mo;(function(m){m.method="textDocument/rename",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(mo||(t.RenameRequest=mo={}));var M;(function(m){m.method="textDocument/prepareRename",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(M||(t.PrepareRenameRequest=M={}));var D;(function(m){m.method="workspace/executeCommand",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(D||(t.ExecuteCommandRequest=D={}));var P;(function(m){m.method="workspace/applyEdit",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType("workspace/applyEdit")})(P||(t.ApplyWorkspaceEditRequest=P={}))}(Fv)),Fv}var fu={},jk;function Z9(){if(jk)return fu;jk=1,Object.defineProperty(fu,"__esModule",{value:!0}),fu.createProtocolConnection=void 0;const t=Bs();function e(n,r,i,s){return t.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,t.createMessageConnection)(n,r,i,s)}return fu.createProtocolConnection=e,fu}var Uk;function Q9(){return Uk||(Uk=1,function(t){var e=ru.__createBinding||(Object.create?function(s,o,a,c){c===void 0&&(c=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(s,c,u)}:function(s,o,a,c){c===void 0&&(c=a),s[c]=o[a]}),n=ru.__exportStar||function(s,o){for(var a in s)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,s,a)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,n(Bs(),t),n(Ov(),t),n(Rt(),t),n(J9(),t);var r=Z9();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:function(){return r.createProtocolConnection}});var i;(function(s){s.lspReservedErrorRangeStart=-32899,s.RequestFailed=-32803,s.ServerCancelled=-32802,s.ContentModified=-32801,s.RequestCancelled=-32800,s.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}(ru)),ru}var Gk;function Pt(){return Gk||(Gk=1,function(t){var e=Zc.__createBinding||(Object.create?function(s,o,a,c){c===void 0&&(c=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(s,c,u)}:function(s,o,a,c){c===void 0&&(c=a),s[c]=o[a]}),n=Zc.__exportStar||function(s,o){for(var a in s)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,s,a)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const r=gk();n(gk(),t),n(Q9(),t);function i(s,o,a,c){return(0,r.createMessageConnection)(s,o,a,c)}t.createProtocolConnection=i}(Zc)),Zc}var jn={},Wk;function Hk(){if(Wk)return jn;Wk=1,Object.defineProperty(jn,"__esModule",{value:!0}),jn.generateUuid=jn.parse=jn.isUUID=jn.v4=jn.empty=void 0;class t{constructor(c){this._value=c}asHex(){return this._value}equals(c){return this.asHex()===c.asHex()}}class e extends t{static _oneOf(c){return c[Math.floor(c.length*Math.random())]}static _randomHex(){return e._oneOf(e._chars)}constructor(){super([e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-","4",e._randomHex(),e._randomHex(),e._randomHex(),"-",e._oneOf(e._timeHighBits),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex()].join(""))}}e._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"],e._timeHighBits=["8","9","a","b"],jn.empty=new t("00000000-0000-0000-0000-000000000000");function n(){return new e}jn.v4=n;const r=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function i(a){return r.test(a)}jn.isUUID=i;function s(a){if(!i(a))throw new Error("invalid uuid");return new t(a)}jn.parse=s;function o(){return n().asHex()}return jn.generateUuid=o,jn}var vi={},Vk;function e7(){if(Vk)return vi;Vk=1,Object.defineProperty(vi,"__esModule",{value:!0}),vi.attachPartialResult=vi.ProgressFeature=vi.attachWorkDone=void 0;const t=Pt(),e=Hk();class n{constructor(f,p){this._connection=f,this._token=p,n.Instances.set(this._token,this)}begin(f,p,h,v){let b={kind:"begin",title:f,percentage:p,message:h,cancellable:v};this._connection.sendProgress(t.WorkDoneProgress.type,this._token,b)}report(f,p){let h={kind:"report"};typeof f=="number"?(h.percentage=f,p!==void 0&&(h.message=p)):h.message=f,this._connection.sendProgress(t.WorkDoneProgress.type,this._token,h)}done(){n.Instances.delete(this._token),this._connection.sendProgress(t.WorkDoneProgress.type,this._token,{kind:"end"})}}n.Instances=new Map;class r extends n{constructor(f,p){super(f,p),this._source=new t.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}}class i{constructor(){}begin(){}report(){}done(){}}class s extends i{constructor(){super(),this._source=new t.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}}function o(d,f){if(f===void 0||f.workDoneToken===void 0)return new i;const p=f.workDoneToken;return delete f.workDoneToken,new n(d,p)}vi.attachWorkDone=o;const a=d=>class extends d{constructor(){super(),this._progressSupported=!1}initialize(f){super.initialize(f),f?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(t.WorkDoneProgressCancelNotification.type,p=>{let h=n.Instances.get(p.token);(h instanceof r||h instanceof s)&&h.cancel()}))}attachWorkDoneProgress(f){return f===void 0?new i:new n(this.connection,f)}createWorkDoneProgress(){if(this._progressSupported){const f=(0,e.generateUuid)();return this.connection.sendRequest(t.WorkDoneProgressCreateRequest.type,{token:f}).then(()=>new r(this.connection,f))}else return Promise.resolve(new s)}};vi.ProgressFeature=a;var c;(function(d){d.type=new t.ProgressType})(c||(c={}));class u{constructor(f,p){this._connection=f,this._token=p}report(f){this._connection.sendProgress(c.type,this._token,f)}}function l(d,f){if(f===void 0||f.partialResultToken===void 0)return;const p=f.partialResultToken;return delete f.partialResultToken,new u(d,p)}return vi.attachPartialResult=l,vi}var pu={},Kk;function t7(){if(Kk)return pu;Kk=1,Object.defineProperty(pu,"__esModule",{value:!0}),pu.ConfigurationFeature=void 0;const t=Pt(),e=_v(),n=r=>class extends r{getConfiguration(i){return i?e.string(i)?this._getConfiguration({section:i}):this._getConfiguration(i):this._getConfiguration({})}_getConfiguration(i){let s={items:Array.isArray(i)?i:[i]};return this.connection.sendRequest(t.ConfigurationRequest.type,s).then(o=>Array.isArray(o)?Array.isArray(i)?o:o[0]:Array.isArray(i)?[]:null)}};return pu.ConfigurationFeature=n,pu}var hu={},Yk;function n7(){if(Yk)return hu;Yk=1,Object.defineProperty(hu,"__esModule",{value:!0}),hu.WorkspaceFoldersFeature=void 0;const t=Pt(),e=n=>class extends n{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(r){super.initialize(r);let i=r.workspace;i&&i.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new t.Emitter,this.connection.onNotification(t.DidChangeWorkspaceFoldersNotification.type,s=>{this._onDidChangeWorkspaceFolders.fire(s.event)}))}fillServerCapabilities(r){super.fillServerCapabilities(r);const i=r.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=i===!0||typeof i=="string"}getWorkspaceFolders(){return this.connection.sendRequest(t.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(t.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};return hu.WorkspaceFoldersFeature=e,hu}var mu={},Xk;function r7(){if(Xk)return mu;Xk=1,Object.defineProperty(mu,"__esModule",{value:!0}),mu.CallHierarchyFeature=void 0;const t=Pt(),e=n=>class extends n{get callHierarchy(){return{onPrepare:r=>this.connection.onRequest(t.CallHierarchyPrepareRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),void 0)),onIncomingCalls:r=>{const i=t.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))},onOutgoingCalls:r=>{const i=t.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return mu.CallHierarchyFeature=e,mu}var wi={},Jk;function Zk(){if(Jk)return wi;Jk=1,Object.defineProperty(wi,"__esModule",{value:!0}),wi.SemanticTokensBuilder=wi.SemanticTokensDiff=wi.SemanticTokensFeature=void 0;const t=Pt(),e=i=>class extends i{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(t.SemanticTokensRefreshRequest.type),on:s=>{const o=t.SemanticTokensRequest.type;return this.connection.onRequest(o,(a,c)=>s(a,c,this.attachWorkDoneProgress(a),this.attachPartialResultProgress(o,a)))},onDelta:s=>{const o=t.SemanticTokensDeltaRequest.type;return this.connection.onRequest(o,(a,c)=>s(a,c,this.attachWorkDoneProgress(a),this.attachPartialResultProgress(o,a)))},onRange:s=>{const o=t.SemanticTokensRangeRequest.type;return this.connection.onRequest(o,(a,c)=>s(a,c,this.attachWorkDoneProgress(a),this.attachPartialResultProgress(o,a)))}}}};wi.SemanticTokensFeature=e;class n{constructor(s,o){this.originalSequence=s,this.modifiedSequence=o}computeDiff(){const s=this.originalSequence.length,o=this.modifiedSequence.length;let a=0;for(;a<o&&a<s&&this.originalSequence[a]===this.modifiedSequence[a];)a++;if(a<o&&a<s){let c=s-1,u=o-1;for(;c>=a&&u>=a&&this.originalSequence[c]===this.modifiedSequence[u];)c--,u--;(c<a||u<a)&&(c++,u++);const l=c-a+1,d=this.modifiedSequence.slice(a,u+1);return d.length===1&&d[0]===this.originalSequence[c]?[{start:a,deleteCount:l-1}]:[{start:a,deleteCount:l,data:d}]}else return a<o?[{start:a,deleteCount:0,data:this.modifiedSequence.slice(a)}]:a<s?[{start:a,deleteCount:s-a}]:[]}}wi.SemanticTokensDiff=n;class r{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(s,o,a,c,u){let l=s,d=o;this._dataLen>0&&(l-=this._prevLine,l===0&&(d-=this._prevChar)),this._data[this._dataLen++]=l,this._data[this._dataLen++]=d,this._data[this._dataLen++]=a,this._data[this._dataLen++]=c,this._data[this._dataLen++]=u,this._prevLine=s,this._prevChar=o}get id(){return this._id.toString()}previousResult(s){this.id===s&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new n(this._prevData,this._data).computeDiff()}:this.build()}}return wi.SemanticTokensBuilder=r,wi}var gu={},Qk;function i7(){if(Qk)return gu;Qk=1,Object.defineProperty(gu,"__esModule",{value:!0}),gu.ShowDocumentFeature=void 0;const t=Pt(),e=n=>class extends n{showDocument(r){return this.connection.sendRequest(t.ShowDocumentRequest.type,r)}};return gu.ShowDocumentFeature=e,gu}var yu={},e1;function s7(){if(e1)return yu;e1=1,Object.defineProperty(yu,"__esModule",{value:!0}),yu.FileOperationsFeature=void 0;const t=Pt(),e=n=>class extends n{onDidCreateFiles(r){return this.connection.onNotification(t.DidCreateFilesNotification.type,i=>{r(i)})}onDidRenameFiles(r){return this.connection.onNotification(t.DidRenameFilesNotification.type,i=>{r(i)})}onDidDeleteFiles(r){return this.connection.onNotification(t.DidDeleteFilesNotification.type,i=>{r(i)})}onWillCreateFiles(r){return this.connection.onRequest(t.WillCreateFilesRequest.type,(i,s)=>r(i,s))}onWillRenameFiles(r){return this.connection.onRequest(t.WillRenameFilesRequest.type,(i,s)=>r(i,s))}onWillDeleteFiles(r){return this.connection.onRequest(t.WillDeleteFilesRequest.type,(i,s)=>r(i,s))}};return yu.FileOperationsFeature=e,yu}var vu={},t1;function o7(){if(t1)return vu;t1=1,Object.defineProperty(vu,"__esModule",{value:!0}),vu.LinkedEditingRangeFeature=void 0;const t=Pt(),e=n=>class extends n{onLinkedEditingRange(r){return this.connection.onRequest(t.LinkedEditingRangeRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),void 0))}};return vu.LinkedEditingRangeFeature=e,vu}var wu={},n1;function a7(){if(n1)return wu;n1=1,Object.defineProperty(wu,"__esModule",{value:!0}),wu.TypeHierarchyFeature=void 0;const t=Pt(),e=n=>class extends n{get typeHierarchy(){return{onPrepare:r=>this.connection.onRequest(t.TypeHierarchyPrepareRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),void 0)),onSupertypes:r=>{const i=t.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))},onSubtypes:r=>{const i=t.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return wu.TypeHierarchyFeature=e,wu}var bu={},r1;function c7(){if(r1)return bu;r1=1,Object.defineProperty(bu,"__esModule",{value:!0}),bu.InlineValueFeature=void 0;const t=Pt(),e=n=>class extends n{get inlineValue(){return{refresh:()=>this.connection.sendRequest(t.InlineValueRefreshRequest.type),on:r=>this.connection.onRequest(t.InlineValueRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i)))}}};return bu.InlineValueFeature=e,bu}var Du={},i1;function u7(){if(i1)return Du;i1=1,Object.defineProperty(Du,"__esModule",{value:!0}),Du.FoldingRangeFeature=void 0;const t=Pt(),e=n=>class extends n{get foldingRange(){return{refresh:()=>this.connection.sendRequest(t.FoldingRangeRefreshRequest.type),on:r=>{const i=t.FoldingRangeRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return Du.FoldingRangeFeature=e,Du}var Eu={},s1;function l7(){if(s1)return Eu;s1=1,Object.defineProperty(Eu,"__esModule",{value:!0}),Eu.InlayHintFeature=void 0;const t=Pt(),e=n=>class extends n{get inlayHint(){return{refresh:()=>this.connection.sendRequest(t.InlayHintRefreshRequest.type),on:r=>this.connection.onRequest(t.InlayHintRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i))),resolve:r=>this.connection.onRequest(t.InlayHintResolveRequest.type,(i,s)=>r(i,s))}}};return Eu.InlayHintFeature=e,Eu}var Ru={},o1;function d7(){if(o1)return Ru;o1=1,Object.defineProperty(Ru,"__esModule",{value:!0}),Ru.DiagnosticFeature=void 0;const t=Pt(),e=n=>class extends n{get diagnostics(){return{refresh:()=>this.connection.sendRequest(t.DiagnosticRefreshRequest.type),on:r=>this.connection.onRequest(t.DocumentDiagnosticRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t.DocumentDiagnosticRequest.partialResult,i))),onWorkspace:r=>this.connection.onRequest(t.WorkspaceDiagnosticRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t.WorkspaceDiagnosticRequest.partialResult,i)))}}};return Ru.DiagnosticFeature=e,Ru}var Gs={},$u={},a1;function c1(){if(a1)return $u;a1=1,Object.defineProperty($u,"__esModule",{value:!0}),$u.TextDocuments=void 0;const t=Pt();class e{constructor(r){this._configuration=r,this._syncedDocuments=new Map,this._onDidChangeContent=new t.Emitter,this._onDidOpen=new t.Emitter,this._onDidClose=new t.Emitter,this._onDidSave=new t.Emitter,this._onWillSave=new t.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(r){this._willSaveWaitUntil=r}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(r){return this._syncedDocuments.get(r)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(r){r.__textDocumentSync=t.TextDocumentSyncKind.Incremental;const i=[];return i.push(r.onDidOpenTextDocument(s=>{const o=s.textDocument,a=this._configuration.create(o.uri,o.languageId,o.version,o.text);this._syncedDocuments.set(o.uri,a);const c=Object.freeze({document:a});this._onDidOpen.fire(c),this._onDidChangeContent.fire(c)})),i.push(r.onDidChangeTextDocument(s=>{const o=s.textDocument,a=s.contentChanges;if(a.length===0)return;const{version:c}=o;if(c==null)throw new Error(`Received document change event for ${o.uri} without valid version identifier`);let u=this._syncedDocuments.get(o.uri);u!==void 0&&(u=this._configuration.update(u,a,c),this._syncedDocuments.set(o.uri,u),this._onDidChangeContent.fire(Object.freeze({document:u})))})),i.push(r.onDidCloseTextDocument(s=>{let o=this._syncedDocuments.get(s.textDocument.uri);o!==void 0&&(this._syncedDocuments.delete(s.textDocument.uri),this._onDidClose.fire(Object.freeze({document:o})))})),i.push(r.onWillSaveTextDocument(s=>{let o=this._syncedDocuments.get(s.textDocument.uri);o!==void 0&&this._onWillSave.fire(Object.freeze({document:o,reason:s.reason}))})),i.push(r.onWillSaveTextDocumentWaitUntil((s,o)=>{let a=this._syncedDocuments.get(s.textDocument.uri);return a!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:a,reason:s.reason}),o):[]})),i.push(r.onDidSaveTextDocument(s=>{let o=this._syncedDocuments.get(s.textDocument.uri);o!==void 0&&this._onDidSave.fire(Object.freeze({document:o}))})),t.Disposable.create(()=>{i.forEach(s=>s.dispose())})}}return $u.TextDocuments=e,$u}var u1;function l1(){if(u1)return Gs;u1=1,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.NotebookDocuments=Gs.NotebookSyncFeature=void 0;const t=Pt(),e=c1(),n=s=>class extends s{get synchronization(){return{onDidOpenNotebookDocument:o=>this.connection.onNotification(t.DidOpenNotebookDocumentNotification.type,a=>{o(a)}),onDidChangeNotebookDocument:o=>this.connection.onNotification(t.DidChangeNotebookDocumentNotification.type,a=>{o(a)}),onDidSaveNotebookDocument:o=>this.connection.onNotification(t.DidSaveNotebookDocumentNotification.type,a=>{o(a)}),onDidCloseNotebookDocument:o=>this.connection.onNotification(t.DidCloseNotebookDocumentNotification.type,a=>{o(a)})}}};Gs.NotebookSyncFeature=n;class r{onDidOpenTextDocument(o){return this.openHandler=o,t.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(o){this.openHandler&&this.openHandler(o)}onDidChangeTextDocument(o){return this.changeHandler=o,t.Disposable.create(()=>{this.changeHandler=o})}changeTextDocument(o){this.changeHandler&&this.changeHandler(o)}onDidCloseTextDocument(o){return this.closeHandler=o,t.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(o){this.closeHandler&&this.closeHandler(o)}onWillSaveTextDocument(){return r.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return r.NULL_DISPOSE}onDidSaveTextDocument(){return r.NULL_DISPOSE}}r.NULL_DISPOSE=Object.freeze({dispose:()=>{}});class i{constructor(o){o instanceof e.TextDocuments?this._cellTextDocuments=o:this._cellTextDocuments=new e.TextDocuments(o),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new t.Emitter,this._onDidChange=new t.Emitter,this._onDidSave=new t.Emitter,this._onDidClose=new t.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(o){return this._cellTextDocuments.get(o.document)}getNotebookDocument(o){return this.notebookDocuments.get(o)}getNotebookCell(o){const a=this.notebookCellMap.get(o);return a&&a[0]}findNotebookDocumentForCell(o){const a=typeof o=="string"?o:o.document,c=this.notebookCellMap.get(a);return c&&c[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(o){const a=new r,c=[];return c.push(this.cellTextDocuments.listen(a)),c.push(o.notebooks.synchronization.onDidOpenNotebookDocument(u=>{this.notebookDocuments.set(u.notebookDocument.uri,u.notebookDocument);for(const l of u.cellTextDocuments)a.openTextDocument({textDocument:l});this.updateCellMap(u.notebookDocument),this._onDidOpen.fire(u.notebookDocument)})),c.push(o.notebooks.synchronization.onDidChangeNotebookDocument(u=>{const l=this.notebookDocuments.get(u.notebookDocument.uri);if(l===void 0)return;l.version=u.notebookDocument.version;const d=l.metadata;let f=!1;const p=u.change;p.metadata!==void 0&&(f=!0,l.metadata=p.metadata);const h=[],v=[],b=[],g=[];if(p.cells!==void 0){const N=p.cells;if(N.structure!==void 0){const _=N.structure.array;if(l.cells.splice(_.start,_.deleteCount,..._.cells!==void 0?_.cells:[]),N.structure.didOpen!==void 0)for(const B of N.structure.didOpen)a.openTextDocument({textDocument:B}),h.push(B.uri);if(N.structure.didClose)for(const B of N.structure.didClose)a.closeTextDocument({textDocument:B}),v.push(B.uri)}if(N.data!==void 0){const _=new Map(N.data.map(B=>[B.document,B]));for(let B=0;B<=l.cells.length;B++){const z=_.get(l.cells[B].document);if(z!==void 0){const Q=l.cells.splice(B,1,z);if(b.push({old:Q[0],new:z}),_.delete(z.document),_.size===0)break}}}if(N.textContent!==void 0)for(const _ of N.textContent)a.changeTextDocument({textDocument:_.document,contentChanges:_.changes}),g.push(_.document.uri)}this.updateCellMap(l);const w={notebookDocument:l};f&&(w.metadata={old:d,new:l.metadata});const R=[];for(const N of h)R.push(this.getNotebookCell(N));const k=[];for(const N of v)k.push(this.getNotebookCell(N));const A=[];for(const N of g)A.push(this.getNotebookCell(N));(R.length>0||k.length>0||b.length>0||A.length>0)&&(w.cells={added:R,removed:k,changed:{data:b,textContent:A}}),(w.metadata!==void 0||w.cells!==void 0)&&this._onDidChange.fire(w)})),c.push(o.notebooks.synchronization.onDidSaveNotebookDocument(u=>{const l=this.notebookDocuments.get(u.notebookDocument.uri);l!==void 0&&this._onDidSave.fire(l)})),c.push(o.notebooks.synchronization.onDidCloseNotebookDocument(u=>{const l=this.notebookDocuments.get(u.notebookDocument.uri);if(l!==void 0){this._onDidClose.fire(l);for(const d of u.cellTextDocuments)a.closeTextDocument({textDocument:d});this.notebookDocuments.delete(u.notebookDocument.uri);for(const d of l.cells)this.notebookCellMap.delete(d.document)}})),t.Disposable.create(()=>{c.forEach(u=>u.dispose())})}updateCellMap(o){for(const a of o.cells)this.notebookCellMap.set(a.document,[a,o])}}return Gs.NotebookDocuments=i,Gs}var Tu={},d1;function f7(){if(d1)return Tu;d1=1,Object.defineProperty(Tu,"__esModule",{value:!0}),Tu.MonikerFeature=void 0;const t=Pt(),e=n=>class extends n{get moniker(){return{on:r=>{const i=t.MonikerRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return Tu.MonikerFeature=e,Tu}var f1;function p1(){if(f1)return Ke;f1=1,Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.createConnection=Ke.combineFeatures=Ke.combineNotebooksFeatures=Ke.combineLanguagesFeatures=Ke.combineWorkspaceFeatures=Ke.combineWindowFeatures=Ke.combineClientFeatures=Ke.combineTracerFeatures=Ke.combineTelemetryFeatures=Ke.combineConsoleFeatures=Ke._NotebooksImpl=Ke._LanguagesImpl=Ke.BulkUnregistration=Ke.BulkRegistration=Ke.ErrorMessageTracker=void 0;const t=Pt(),e=_v(),n=Hk(),r=e7(),i=t7(),s=n7(),o=r7(),a=Zk(),c=i7(),u=s7(),l=o7(),d=a7(),f=c7(),p=u7(),h=l7(),v=d7(),b=l1(),g=f7();function w(ae){if(ae!==null)return ae}class R{constructor(){this._messages=Object.create(null)}add(O){let j=this._messages[O];j||(j=0),j++,this._messages[O]=j}sendErrors(O){Object.keys(this._messages).forEach(j=>{O.window.showErrorMessage(j)})}}Ke.ErrorMessageTracker=R;class k{constructor(){}rawAttach(O){this._rawConnection=O}attach(O){this._connection=O}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(O){}initialize(O){}error(O){this.send(t.MessageType.Error,O)}warn(O){this.send(t.MessageType.Warning,O)}info(O){this.send(t.MessageType.Info,O)}log(O){this.send(t.MessageType.Log,O)}debug(O){this.send(t.MessageType.Debug,O)}send(O,j){this._rawConnection&&this._rawConnection.sendNotification(t.LogMessageNotification.type,{type:O,message:j}).catch(()=>{(0,t.RAL)().console.error("Sending log message failed")})}}class A{constructor(){}attach(O){this._connection=O}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(O){}fillServerCapabilities(O){}showErrorMessage(O,...j){let de={type:t.MessageType.Error,message:O,actions:j};return this.connection.sendRequest(t.ShowMessageRequest.type,de).then(w)}showWarningMessage(O,...j){let de={type:t.MessageType.Warning,message:O,actions:j};return this.connection.sendRequest(t.ShowMessageRequest.type,de).then(w)}showInformationMessage(O,...j){let de={type:t.MessageType.Info,message:O,actions:j};return this.connection.sendRequest(t.ShowMessageRequest.type,de).then(w)}}const N=(0,c.ShowDocumentFeature)((0,r.ProgressFeature)(A));var _;(function(ae){function O(){return new B}ae.create=O})(_||(Ke.BulkRegistration=_={}));class B{constructor(){this._registrations=[],this._registered=new Set}add(O,j){const de=e.string(O)?O:O.method;if(this._registered.has(de))throw new Error(`${de} is already added to this registration`);const U=n.generateUuid();this._registrations.push({id:U,method:de,registerOptions:j||{}}),this._registered.add(de)}asRegistrationParams(){return{registrations:this._registrations}}}var z;(function(ae){function O(){return new Q(void 0,[])}ae.create=O})(z||(Ke.BulkUnregistration=z={}));class Q{constructor(O,j){this._connection=O,this._unregistrations=new Map,j.forEach(de=>{this._unregistrations.set(de.method,de)})}get isAttached(){return!!this._connection}attach(O){this._connection=O}add(O){this._unregistrations.set(O.method,O)}dispose(){let O=[];for(let de of this._unregistrations.values())O.push(de);let j={unregisterations:O};this._connection.sendRequest(t.UnregistrationRequest.type,j).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(O){const j=e.string(O)?O:O.method,de=this._unregistrations.get(j);if(!de)return!1;let U={unregisterations:[de]};return this._connection.sendRequest(t.UnregistrationRequest.type,U).then(()=>{this._unregistrations.delete(j)},ce=>{this._connection.console.info(`Un-registering request handler for ${de.id} failed.`)}),!0}}class I{attach(O){this._connection=O}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(O){}fillServerCapabilities(O){}register(O,j,de){return O instanceof B?this.registerMany(O):O instanceof Q?this.registerSingle1(O,j,de):this.registerSingle2(O,j)}registerSingle1(O,j,de){const U=e.string(j)?j:j.method,ce=n.generateUuid();let qe={registrations:[{id:ce,method:U,registerOptions:de||{}}]};return O.isAttached||O.attach(this.connection),this.connection.sendRequest(t.RegistrationRequest.type,qe).then(et=>(O.add({id:ce,method:U}),O),et=>(this.connection.console.info(`Registering request handler for ${U} failed.`),Promise.reject(et)))}registerSingle2(O,j){const de=e.string(O)?O:O.method,U=n.generateUuid();let ce={registrations:[{id:U,method:de,registerOptions:j||{}}]};return this.connection.sendRequest(t.RegistrationRequest.type,ce).then(qe=>t.Disposable.create(()=>{this.unregisterSingle(U,de).catch(()=>{this.connection.console.info(`Un-registering capability with id ${U} failed.`)})}),qe=>(this.connection.console.info(`Registering request handler for ${de} failed.`),Promise.reject(qe)))}unregisterSingle(O,j){let de={unregisterations:[{id:O,method:j}]};return this.connection.sendRequest(t.UnregistrationRequest.type,de).catch(()=>{this.connection.console.info(`Un-registering request handler for ${O} failed.`)})}registerMany(O){let j=O.asRegistrationParams();return this.connection.sendRequest(t.RegistrationRequest.type,j).then(()=>new Q(this._connection,j.registrations.map(de=>({id:de.id,method:de.method}))),de=>(this.connection.console.info("Bulk registration failed."),Promise.reject(de)))}}class T{constructor(){}attach(O){this._connection=O}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(O){}fillServerCapabilities(O){}applyEdit(O){function j(U){return U&&!!U.edit}let de=j(O)?O:{edit:O};return this.connection.sendRequest(t.ApplyWorkspaceEditRequest.type,de)}}const $=(0,u.FileOperationsFeature)((0,s.WorkspaceFoldersFeature)((0,i.ConfigurationFeature)(T)));class L{constructor(){this._trace=t.Trace.Off}attach(O){this._connection=O}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(O){}fillServerCapabilities(O){}set trace(O){this._trace=O}log(O,j){this._trace!==t.Trace.Off&&this.connection.sendNotification(t.LogTraceNotification.type,{message:O,verbose:this._trace===t.Trace.Verbose?j:void 0}).catch(()=>{})}}class V{constructor(){}attach(O){this._connection=O}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(O){}fillServerCapabilities(O){}logEvent(O){this.connection.sendNotification(t.TelemetryEventNotification.type,O).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}}class H{constructor(){}attach(O){this._connection=O}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(O){}fillServerCapabilities(O){}attachWorkDoneProgress(O){return(0,r.attachWorkDone)(this.connection,O)}attachPartialResultProgress(O,j){return(0,r.attachPartialResult)(this.connection,j)}}Ke._LanguagesImpl=H;const K=(0,p.FoldingRangeFeature)((0,g.MonikerFeature)((0,v.DiagnosticFeature)((0,h.InlayHintFeature)((0,f.InlineValueFeature)((0,d.TypeHierarchyFeature)((0,l.LinkedEditingRangeFeature)((0,a.SemanticTokensFeature)((0,o.CallHierarchyFeature)(H)))))))));class we{constructor(){}attach(O){this._connection=O}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(O){}fillServerCapabilities(O){}attachWorkDoneProgress(O){return(0,r.attachWorkDone)(this.connection,O)}attachPartialResultProgress(O,j){return(0,r.attachPartialResult)(this.connection,j)}}Ke._NotebooksImpl=we;const te=(0,b.NotebookSyncFeature)(we);function C(ae,O){return function(j){return O(ae(j))}}Ke.combineConsoleFeatures=C;function he(ae,O){return function(j){return O(ae(j))}}Ke.combineTelemetryFeatures=he;function Ye(ae,O){return function(j){return O(ae(j))}}Ke.combineTracerFeatures=Ye;function pt(ae,O){return function(j){return O(ae(j))}}Ke.combineClientFeatures=pt;function W(ae,O){return function(j){return O(ae(j))}}Ke.combineWindowFeatures=W;function X(ae,O){return function(j){return O(ae(j))}}Ke.combineWorkspaceFeatures=X;function Ie(ae,O){return function(j){return O(ae(j))}}Ke.combineLanguagesFeatures=Ie;function oe(ae,O){return function(j){return O(ae(j))}}Ke.combineNotebooksFeatures=oe;function be(ae,O){function j(U,ce,qe){return U&&ce?qe(U,ce):U||ce}return{__brand:"features",console:j(ae.console,O.console,C),tracer:j(ae.tracer,O.tracer,Ye),telemetry:j(ae.telemetry,O.telemetry,he),client:j(ae.client,O.client,pt),window:j(ae.window,O.window,W),workspace:j(ae.workspace,O.workspace,X),languages:j(ae.languages,O.languages,Ie),notebooks:j(ae.notebooks,O.notebooks,oe)}}Ke.combineFeatures=be;function Se(ae,O,j){const de=j&&j.console?new(j.console(k)):new k,U=ae(de);de.rawAttach(U);const ce=j&&j.tracer?new(j.tracer(L)):new L,qe=j&&j.telemetry?new(j.telemetry(V)):new V,et=j&&j.client?new(j.client(I)):new I,se=j&&j.window?new(j.window(N)):new N,_e=j&&j.workspace?new(j.workspace($)):new $,ne=j&&j.languages?new(j.languages(K)):new K,De=j&&j.notebooks?new(j.notebooks(te)):new te,Me=[de,ce,qe,et,se,_e,ne,De];function ht(J){return J instanceof Promise?J:e.thenable(J)?new Promise((Z,fe)=>{J.then(Vt=>Z(Vt),Vt=>fe(Vt))}):Promise.resolve(J)}let Xe,Ut,Ht,ln={listen:()=>U.listen(),sendRequest:(J,...Z)=>U.sendRequest(e.string(J)?J:J.method,...Z),onRequest:(J,Z)=>U.onRequest(J,Z),sendNotification:(J,Z)=>{const fe=e.string(J)?J:J.method;return U.sendNotification(fe,Z)},onNotification:(J,Z)=>U.onNotification(J,Z),onProgress:U.onProgress,sendProgress:U.sendProgress,onInitialize:J=>(Ut=J,{dispose:()=>{Ut=void 0}}),onInitialized:J=>U.onNotification(t.InitializedNotification.type,J),onShutdown:J=>(Xe=J,{dispose:()=>{Xe=void 0}}),onExit:J=>(Ht=J,{dispose:()=>{Ht=void 0}}),get console(){return de},get telemetry(){return qe},get tracer(){return ce},get client(){return et},get window(){return se},get workspace(){return _e},get languages(){return ne},get notebooks(){return De},onDidChangeConfiguration:J=>U.onNotification(t.DidChangeConfigurationNotification.type,J),onDidChangeWatchedFiles:J=>U.onNotification(t.DidChangeWatchedFilesNotification.type,J),__textDocumentSync:void 0,onDidOpenTextDocument:J=>U.onNotification(t.DidOpenTextDocumentNotification.type,J),onDidChangeTextDocument:J=>U.onNotification(t.DidChangeTextDocumentNotification.type,J),onDidCloseTextDocument:J=>U.onNotification(t.DidCloseTextDocumentNotification.type,J),onWillSaveTextDocument:J=>U.onNotification(t.WillSaveTextDocumentNotification.type,J),onWillSaveTextDocumentWaitUntil:J=>U.onRequest(t.WillSaveTextDocumentWaitUntilRequest.type,J),onDidSaveTextDocument:J=>U.onNotification(t.DidSaveTextDocumentNotification.type,J),sendDiagnostics:J=>U.sendNotification(t.PublishDiagnosticsNotification.type,J),onHover:J=>U.onRequest(t.HoverRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),void 0)),onCompletion:J=>U.onRequest(t.CompletionRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onCompletionResolve:J=>U.onRequest(t.CompletionResolveRequest.type,J),onSignatureHelp:J=>U.onRequest(t.SignatureHelpRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),void 0)),onDeclaration:J=>U.onRequest(t.DeclarationRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onDefinition:J=>U.onRequest(t.DefinitionRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onTypeDefinition:J=>U.onRequest(t.TypeDefinitionRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onImplementation:J=>U.onRequest(t.ImplementationRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onReferences:J=>U.onRequest(t.ReferencesRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onDocumentHighlight:J=>U.onRequest(t.DocumentHighlightRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onDocumentSymbol:J=>U.onRequest(t.DocumentSymbolRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onWorkspaceSymbol:J=>U.onRequest(t.WorkspaceSymbolRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onWorkspaceSymbolResolve:J=>U.onRequest(t.WorkspaceSymbolResolveRequest.type,J),onCodeAction:J=>U.onRequest(t.CodeActionRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onCodeActionResolve:J=>U.onRequest(t.CodeActionResolveRequest.type,(Z,fe)=>J(Z,fe)),onCodeLens:J=>U.onRequest(t.CodeLensRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onCodeLensResolve:J=>U.onRequest(t.CodeLensResolveRequest.type,(Z,fe)=>J(Z,fe)),onDocumentFormatting:J=>U.onRequest(t.DocumentFormattingRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),void 0)),onDocumentRangeFormatting:J=>U.onRequest(t.DocumentRangeFormattingRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),void 0)),onDocumentOnTypeFormatting:J=>U.onRequest(t.DocumentOnTypeFormattingRequest.type,(Z,fe)=>J(Z,fe)),onRenameRequest:J=>U.onRequest(t.RenameRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),void 0)),onPrepareRename:J=>U.onRequest(t.PrepareRenameRequest.type,(Z,fe)=>J(Z,fe)),onDocumentLinks:J=>U.onRequest(t.DocumentLinkRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onDocumentLinkResolve:J=>U.onRequest(t.DocumentLinkResolveRequest.type,(Z,fe)=>J(Z,fe)),onDocumentColor:J=>U.onRequest(t.DocumentColorRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onColorPresentation:J=>U.onRequest(t.ColorPresentationRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onFoldingRanges:J=>U.onRequest(t.FoldingRangeRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onSelectionRanges:J=>U.onRequest(t.SelectionRangeRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),(0,r.attachPartialResult)(U,Z))),onExecuteCommand:J=>U.onRequest(t.ExecuteCommandRequest.type,(Z,fe)=>J(Z,fe,(0,r.attachWorkDone)(U,Z),void 0)),dispose:()=>U.dispose()};for(let J of Me)J.attach(ln);return U.onRequest(t.InitializeRequest.type,J=>{O.initialize(J),e.string(J.trace)&&(ce.trace=t.Trace.fromString(J.trace));for(let Z of Me)Z.initialize(J.capabilities);if(Ut){let Z=Ut(J,new t.CancellationTokenSource().token,(0,r.attachWorkDone)(U,J),void 0);return ht(Z).then(fe=>{if(fe instanceof t.ResponseError)return fe;let Vt=fe;Vt||(Vt={capabilities:{}});let Gt=Vt.capabilities;Gt||(Gt={},Vt.capabilities=Gt),Gt.textDocumentSync===void 0||Gt.textDocumentSync===null?Gt.textDocumentSync=e.number(ln.__textDocumentSync)?ln.__textDocumentSync:t.TextDocumentSyncKind.None:!e.number(Gt.textDocumentSync)&&!e.number(Gt.textDocumentSync.change)&&(Gt.textDocumentSync.change=e.number(ln.__textDocumentSync)?ln.__textDocumentSync:t.TextDocumentSyncKind.None);for(let Er of Me)Er.fillServerCapabilities(Gt);return Vt})}else{let Z={capabilities:{textDocumentSync:t.TextDocumentSyncKind.None}};for(let fe of Me)fe.fillServerCapabilities(Z.capabilities);return Z}}),U.onRequest(t.ShutdownRequest.type,()=>{if(O.shutdownReceived=!0,Xe)return Xe(new t.CancellationTokenSource().token)}),U.onNotification(t.ExitNotification.type,()=>{try{Ht&&Ht()}finally{O.shutdownReceived?O.exit(0):O.exit(1)}}),U.onNotification(t.SetTraceNotification.type,J=>{ce.trace=t.Trace.fromString(J.value)}),ln}return Ke.createConnection=Se,Ke}var Dn={},h1;function p7(){if(h1)return Dn;h1=1,Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.resolveModulePath=Dn.FileSystem=Dn.resolveGlobalYarnPath=Dn.resolveGlobalNodePath=Dn.resolve=Dn.uriToFilePath=void 0;const t=K2,e=Tr,n=yo,r=L0;function i(d){let f=t.parse(d);if(f.protocol!=="file:"||!f.path)return;let p=f.path.split("/");for(var h=0,v=p.length;h<v;h++)p[h]=decodeURIComponent(p[h]);if(process.platform==="win32"&&p.length>1){let b=p[0],g=p[1];b.length===0&&g.length>1&&g[1]===":"&&p.shift()}return e.normalize(p.join("/"))}Dn.uriToFilePath=i;function s(){return process.platform==="win32"}function o(d,f,p,h){const v="NODE_PATH",b=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((g,w)=>{let R=process.env,k=Object.create(null);Object.keys(R).forEach(A=>k[A]=R[A]),f&&n.existsSync(f)&&(k[v]?k[v]=f+e.delimiter+k[v]:k[v]=f,h&&h(`NODE_PATH value is: ${k[v]}`)),k.ELECTRON_RUN_AS_NODE="1";try{let A=(0,r.fork)("",[],{cwd:p,env:k,execArgv:["-e",b]});if(A.pid===void 0){w(new Error(`Starting process to resolve node module ${d} failed`));return}A.on("error",_=>{w(_)}),A.on("message",_=>{_.c==="r"&&(A.send({c:"e"}),_.s?g(_.r):w(new Error(`Failed to resolve module: ${d}`)))});let N={c:"rs",a:d};A.send(N)}catch(A){w(A)}})}Dn.resolve=o;function a(d){let f="npm";const p=Object.create(null);Object.keys(process.env).forEach(b=>p[b]=process.env[b]),p.NO_UPDATE_NOTIFIER="true";const h={encoding:"utf8",env:p};s()&&(f="npm.cmd",h.shell=!0);let v=()=>{};try{process.on("SIGPIPE",v);let b=(0,r.spawnSync)(f,["config","get","prefix"],h).stdout;if(!b){d&&d("'npm config get prefix' didn't return a value.");return}let g=b.trim();return d&&d(`'npm config get prefix' value is: ${g}`),g.length>0?s()?e.join(g,"node_modules"):e.join(g,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",v)}}Dn.resolveGlobalNodePath=a;function c(d){let f="yarn",p={encoding:"utf8"};s()&&(f="yarn.cmd",p.shell=!0);let h=()=>{};try{process.on("SIGPIPE",h);let v=(0,r.spawnSync)(f,["global","dir","--json"],p),b=v.stdout;if(!b){d&&(d("'yarn global dir' didn't return a value."),v.stderr&&d(v.stderr));return}let g=b.trim().split(/\r?\n/);for(let w of g)try{let R=JSON.parse(w);if(R.type==="log")return e.join(R.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",h)}}Dn.resolveGlobalYarnPath=c;var u;(function(d){let f;function p(){return f!==void 0||(process.platform==="win32"?f=!1:f=!n.existsSync(__filename.toUpperCase())||!n.existsSync(__filename.toLowerCase())),f}d.isCaseSensitive=p;function h(v,b){return p()?e.normalize(b).indexOf(e.normalize(v))===0:e.normalize(b).toLowerCase().indexOf(e.normalize(v).toLowerCase())===0}d.isParent=h})(u||(Dn.FileSystem=u={}));function l(d,f,p,h){return p?(e.isAbsolute(p)||(p=e.join(d,p)),o(f,p,p,h).then(v=>u.isParent(p,v)?v:Promise.reject(new Error(`Failed to load ${f} from node path location.`))).then(void 0,v=>o(f,a(h),d,h))):o(f,a(h),d,h)}return Dn.resolveModulePath=l,Dn}var Mv,m1;function g1(){return m1||(m1=1,Mv=Pt()),Mv}var Su={},ku={},y1;function h7(){if(y1)return ku;y1=1,Object.defineProperty(ku,"__esModule",{value:!0}),ku.InlineCompletionFeature=void 0;const t=Pt(),e=n=>class extends n{get inlineCompletion(){return{on:r=>this.connection.onRequest(t.InlineCompletionRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i)))}}};return ku.InlineCompletionFeature=e,ku}var v1;function m7(){return v1||(v1=1,function(t){var e=Su.__createBinding||(Object.create?function(c,u,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(u,l);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(c,d,f)}:function(c,u,l,d){d===void 0&&(d=l),c[d]=u[l]}),n=Su.__exportStar||function(c,u){for(var l in c)l!=="default"&&!Object.prototype.hasOwnProperty.call(u,l)&&e(u,c,l)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProposedFeatures=t.NotebookDocuments=t.TextDocuments=t.SemanticTokensBuilder=void 0;const r=Zk();Object.defineProperty(t,"SemanticTokensBuilder",{enumerable:!0,get:function(){return r.SemanticTokensBuilder}});const i=h7();n(Pt(),t);const s=c1();Object.defineProperty(t,"TextDocuments",{enumerable:!0,get:function(){return s.TextDocuments}});const o=l1();Object.defineProperty(t,"NotebookDocuments",{enumerable:!0,get:function(){return o.NotebookDocuments}}),n(p1(),t);var a;(function(c){c.all={__brand:"features",languages:i.InlineCompletionFeature}})(a||(t.ProposedFeatures=a={}))}(Su)),Su}var w1;function b1(){return w1||(w1=1,function(t){var e=Jc.__createBinding||(Object.create?function(g,w,R,k){k===void 0&&(k=R);var A=Object.getOwnPropertyDescriptor(w,R);(!A||("get"in A?!w.__esModule:A.writable||A.configurable))&&(A={enumerable:!0,get:function(){return w[R]}}),Object.defineProperty(g,k,A)}:function(g,w,R,k){k===void 0&&(k=R),g[k]=w[R]}),n=Jc.__exportStar||function(g,w){for(var R in g)R!=="default"&&!Object.prototype.hasOwnProperty.call(w,R)&&e(w,g,R)};Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.Files=void 0;const r=B2,i=_v(),s=p1(),o=p7(),a=g1();n(g1(),t),n(m7(),t);var c;(function(g){g.uriToFilePath=o.uriToFilePath,g.resolveGlobalNodePath=o.resolveGlobalNodePath,g.resolveGlobalYarnPath=o.resolveGlobalYarnPath,g.resolve=o.resolve,g.resolveModulePath=o.resolveModulePath})(c||(t.Files=c={}));function u(){}let l=!1,d;function f(){const g="--clientProcessId";function w(R){try{let k=parseInt(R);isNaN(k)||(d=setInterval(()=>{try{process.kill(k,0)}catch{process.exit(l?0:1)}},3e3))}catch{}}for(let R=2;R<process.argv.length;R++){let k=process.argv[R];if(k===g&&R+1<process.argv.length){w(process.argv[R+1]);return}else{let A=k.split("=");A[0]===g&&w(A[1])}}}f();const p={initialize:g=>{const w=g.processId;i.number(w)&&d===void 0&&setInterval(()=>{try{process.kill(w,0)}catch{process.exit(l?0:1)}},3e3)},get shutdownReceived(){return l},set shutdownReceived(g){l=g},exit:g=>{process.exit(g)}};function h(g,w,R,k){let A,N,_,B;return g!==void 0&&g.__brand==="features"&&(A=g,g=w,w=R,R=k),a.ConnectionStrategy.is(g)||a.ConnectionOptions.is(g)?B=g:(N=g,_=w,B=R),v(N,_,B,A)}t.createConnection=h;function v(g,w,R,k){let A=!1;if(!g&&!w&&process.argv.length>2){let z,Q,I=process.argv.slice(2);for(let T=0;T<I.length;T++){let $=I[T];if($==="--node-ipc"){g=new a.IPCMessageReader(process),w=new a.IPCMessageWriter(process);break}else if($==="--stdio"){A=!0,g=process.stdin,w=process.stdout;break}else if($==="--socket"){z=parseInt(I[T+1]);break}else if($==="--pipe"){Q=I[T+1];break}else{var N=$.split("=");if(N[0]==="--socket"){z=parseInt(N[1]);break}else if(N[0]==="--pipe"){Q=N[1];break}}}if(z){let T=(0,a.createServerSocketTransport)(z);g=T[0],w=T[1]}else if(Q){let T=(0,a.createServerPipeTransport)(Q);g=T[0],w=T[1]}}var _="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!g)throw new Error("Connection input stream is not set. "+_);if(!w)throw new Error("Connection output stream is not set. "+_);if(i.func(g.read)&&i.func(g.on)){let z=g;z.on("end",()=>{process.exit(l?0:1)}),z.on("close",()=>{process.exit(l?0:1)})}const B=z=>{const Q=(0,a.createProtocolConnection)(g,w,z,R);return A&&b(z),Q};return(0,s.createConnection)(B,p,k)}function b(g){function w(k){return k.map(A=>typeof A=="string"?A:(0,r.inspect)(A)).join(" ")}const R=new Map;console.assert=function(A,...N){if(!A)if(N.length===0)g.error("Assertion failed");else{const[_,...B]=N;g.error(`Assertion failed: ${_} ${w(B)}`)}},console.count=function(A="default"){const N=String(A);let _=R.get(N)??0;_+=1,R.set(N,_),g.log(`${N}: ${N}`)},console.countReset=function(A){A===void 0?R.clear():R.delete(String(A))},console.debug=function(...A){g.log(w(A))},console.dir=function(A,N){g.log((0,r.inspect)(A,N))},console.log=function(...A){g.log(w(A))},console.error=function(...A){g.error(w(A))},console.trace=function(...A){const N=new Error().stack.replace(/(.+\n){2}/,"");let _="Trace";A.length!==0&&(_+=`: ${w(A)}`),g.log(`${_}
160
- ${N}`)},console.warn=function(...A){g.warn(w(A))}}}(Jc)),Jc}var ye=b1();function D1(t,e){const n={stacks:t,tokens:e};return g7(n),n.stacks.flat().forEach(i=>{i.property=void 0}),R1(n.stacks).map(i=>i[i.length-1])}function Bv(t){const{next:e,cardinalities:n,visited:r,plus:i}=t,s=[],o=e.feature;if(r.has(o))return[];r.add(o);let a,c=o;for(;c.$container;)if(Pi(c.$container)){a=c.$container;break}else if(Pg(c.$container))c=c.$container;else break;if(kE(c.cardinality)){const u=Ko({next:{feature:c,type:e.type},cardinalities:n,visited:r,plus:i});for(const l of u)i.add(l.feature);s.push(...u)}if(a){const u=a.elements.indexOf(c);u!==void 0&&u<a.elements.length-1&&s.push(...E1({feature:a,type:e.type},u+1,n,r,i)),s.every(l=>xo(l.feature.cardinality,l.feature)||xo(n.get(l.feature))||i.has(l.feature))&&s.push(...Bv({next:{feature:a,type:e.type},cardinalities:n,visited:r,plus:i}))}return s}function zv(t){return Tt(t)&&(t={feature:t}),Ko({next:t,cardinalities:new Map,visited:new Set,plus:new Set})}function Ko(t){var e,n,r;const{next:i,cardinalities:s,visited:o,plus:a}=t;if(i===void 0)return[];const{feature:c,type:u}=i;if(Pi(c)){if(o.has(c))return[];o.add(c)}if(Pi(c))return E1(i,0,s,o,a).map(l=>zp(l,c.cardinality,s));if(Fg(c)||Lg(c))return c.elements.flatMap(l=>Ko({next:{feature:l,type:u,property:i.property},cardinalities:s,visited:o,plus:a})).map(l=>zp(l,c.cardinality,s));if(Cr(c)){const l={feature:c.terminal,type:u,property:(e=i.property)!==null&&e!==void 0?e:c.feature};return Ko({next:l,cardinalities:s,visited:o,plus:a}).map(d=>zp(d,c.cardinality,s))}else{if(bs(c))return Bv({next:{feature:c,type:wc(c),property:(n=i.property)!==null&&n!==void 0?n:c.feature},cardinalities:s,visited:o,plus:a});if(Qr(c)&&rn(c.rule.ref)){const l=c.rule.ref,d={feature:l.definition,type:l.fragment||l.dataType?void 0:(r=Ds(l))!==null&&r!==void 0?r:l.name,property:i.property};return Ko({next:d,cardinalities:s,visited:o,plus:a}).map(f=>zp(f,c.cardinality,s))}else return[i]}}function zp(t,e,n){return n.set(t.feature,e),t}function E1(t,e,n,r,i){var s;const o=[];let a;for(;e<t.feature.elements.length&&(a={feature:t.feature.elements[e++],type:t.type},o.push(...Ko({next:a,cardinalities:n,visited:r,plus:i})),!!xo((s=a.feature.cardinality)!==null&&s!==void 0?s:n.get(a.feature),a.feature)););return o}function g7(t){for(const e of t.tokens){const n=R1(t.stacks,e);t.stacks=n}}function R1(t,e){const n=[];for(const r of t)n.push(...y7(r,e));return n}function y7(t,e){const n=new Map,r=new Set(t.map(s=>s.feature).filter(v7)),i=[];for(;t.length>0;){const s=t.pop(),o=Bv({next:s,cardinalities:n,plus:r,visited:new Set}).filter(a=>e?qv(a.feature,e):!0);for(const a of o)i.push([...t,a]);if(!o.every(a=>xo(a.feature.cardinality,a.feature)||xo(n.get(a.feature))))break}return i}function v7(t){if(t.cardinality==="+")return!0;const e=sn(t,Cr);return!!(e&&e.cardinality==="+")}function qv(t,e){if(Ar(t))return t.value===e.image;if(Qr(t))return w7(t.rule.ref,e);if(nc(t)){const n=Hg(t);if(n)return qv(n,e)}return!1}function w7(t,e){return rn(t)?zv(t.definition).some(r=>qv(r.feature,e)):Zr(t)?bc(t).test(e.image):!1}function b7(t){const e=Array.from(new Set(t.flatMap(r=>{var i;return(i=r?.triggerCharacters)!==null&&i!==void 0?i:[]}))),n=Array.from(new Set(t.flatMap(r=>{var i;return(i=r?.allCommitCharacters)!==null&&i!==void 0?i:[]})));return{triggerCharacters:e.length>0?e:void 0,allCommitCharacters:n.length>0?n:void 0}}class $1{constructor(e){this.scopeProvider=e.references.ScopeProvider,this.grammar=e.Grammar,this.completionParser=e.parser.CompletionParser,this.nameProvider=e.references.NameProvider,this.lexer=e.parser.Lexer,this.nodeKindProvider=e.shared.lsp.NodeKindProvider,this.fuzzyMatcher=e.shared.lsp.FuzzyMatcher,this.grammarConfig=e.parser.GrammarConfig,this.astReflection=e.shared.AstReflection,this.documentationProvider=e.documentation.DocumentationProvider}async getCompletion(e,n,r){const i=[],s=this.buildContexts(e,n.position),o=(u,l)=>{const d=this.fillCompletionItem(u,l);d&&i.push(d)},a=u=>Ar(u.feature)?u.feature.value:u.feature,c=[];for(const u of s)if(await Promise.all(st(u.features).distinct(a).exclude(c).map(l=>this.completionFor(u,l,o))),c.push(...u.features),!this.continueCompletion(i))break;return ye.CompletionList.create(this.deduplicateItems(i),!0)}deduplicateItems(e){return st(e).distinct(n=>`${n.kind}_${n.label}_${n.detail}`).toArray()}findFeaturesAt(e,n){const r=e.getText({start:ye.Position.create(0,0),end:e.positionAt(n)}),i=this.completionParser.parse(r),s=i.tokens;if(i.tokenIndex===0){const c=Af(this.grammar),u=zv({feature:c.definition,type:Ds(c)});return s.length>0?(s.shift(),D1(u.map(l=>[l]),s)):u}const o=[...s].splice(i.tokenIndex);return D1([i.elementStack.map(c=>({feature:c}))],o)}*buildContexts(e,n){var r,i;const s=e.parseResult.value.$cstNode;if(!s)return;const o=e.textDocument,a=o.getText(),c=o.offsetAt(n),u={document:e,textDocument:o,offset:c,position:n},l=this.findDataTypeRuleStart(s,c);if(l){const[w,R]=l,k=(r=pf(s,w))===null||r===void 0?void 0:r.astNode;yield Object.assign(Object.assign({},u),{node:k,tokenOffset:w,tokenEndOffset:R,features:this.findFeaturesAt(o,w)})}const{nextTokenStart:d,nextTokenEnd:f,previousTokenStart:p,previousTokenEnd:h}=this.backtrackToAnyToken(a,c);let v=d;c<=d&&p!==void 0&&(v=p);const b=(i=pf(s,v))===null||i===void 0?void 0:i.astNode;let g=!0;if(p!==void 0&&h!==void 0&&h===c&&(yield Object.assign(Object.assign({},u),{node:b,tokenOffset:p,tokenEndOffset:h,features:this.findFeaturesAt(o,p)}),g=this.performNextTokenCompletion(e,a.substring(p,h),p,h),g&&(yield Object.assign(Object.assign({},u),{node:b,tokenOffset:h,tokenEndOffset:h,features:this.findFeaturesAt(o,h)}))),b)g&&(yield Object.assign(Object.assign({},u),{node:b,tokenOffset:d,tokenEndOffset:f,features:this.findFeaturesAt(o,d)}));else{const w=Af(this.grammar);if(!w)throw new Error("Missing entry parser rule");yield Object.assign(Object.assign({},u),{tokenOffset:d,tokenEndOffset:f,features:zv(w.definition)})}}performNextTokenCompletion(e,n,r,i){return new RegExp("\\P{L}$","u").test(n)}findDataTypeRuleStart(e,n){var r,i;let s=_i(e,n,this.grammarConfig.nameRegexp),o=!!(!((r=sn(s?.grammarSource,rn))===null||r===void 0)&&r.dataType);if(o){for(;o;)s=s?.container,o=!!(!((i=sn(s?.grammarSource,rn))===null||i===void 0)&&i.dataType);if(s)return[s.offset,s.end]}}continueCompletion(e){return e.length===0}backtrackToAnyToken(e,n){const r=this.lexer.tokenize(e).tokens;if(r.length===0)return{nextTokenStart:n,nextTokenEnd:n};let i;for(const s of r){if(s.startOffset>=n)return{nextTokenStart:n,nextTokenEnd:n,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0};if(s.endOffset>=n)return{nextTokenStart:s.startOffset,nextTokenEnd:s.endOffset+1,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0};i=s}return{nextTokenStart:n,nextTokenEnd:n,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0}}completionFor(e,n,r){if(Ar(n.feature))return this.completionForKeyword(e,n.feature,r);if(nc(n.feature)&&e.node)return this.completionForCrossReference(e,n,r)}completionForCrossReference(e,n,r){const i=sn(n.feature,Cr);let s=e.node;if(i&&s){n.type&&(s={$type:n.type,$container:s,$containerProperty:n.property},zg(this.astReflection,s));const o={reference:{$refText:""},container:s,property:i.feature};try{for(const a of this.getReferenceCandidates(o,e))r(e,this.createReferenceCompletionItem(a))}catch(a){console.error(a)}}}getReferenceCandidates(e,n){return this.scopeProvider.getScope(e).getAllElements()}createReferenceCompletionItem(e){const n=this.nodeKindProvider.getCompletionItemKind(e),r=this.getReferenceDocumentation(e);return{nodeDescription:e,kind:n,documentation:r,detail:e.type,sortText:"0"}}getReferenceDocumentation(e){if(!e.node)return;const n=this.documentationProvider.getDocumentation(e.node);if(n)return{kind:"markdown",value:n}}completionForKeyword(e,n,r){this.filterKeyword(e,n)&&r(e,{label:n.value,kind:this.getKeywordCompletionItemKind(n),detail:"Keyword",sortText:"1"})}getKeywordCompletionItemKind(e){return ye.CompletionItemKind.Keyword}filterKeyword(e,n){return new RegExp("\\p{L}","u").test(n.value)}fillCompletionItem(e,n){var r,i;let s;if(typeof n.label=="string")s=n.label;else if("node"in n){const u=this.nameProvider.getName(n.node);if(!u)return;s=u}else if("nodeDescription"in n)s=n.nodeDescription.name;else return;let o;typeof((r=n.textEdit)===null||r===void 0?void 0:r.newText)=="string"?o=n.textEdit.newText:typeof n.insertText=="string"?o=n.insertText:o=s;const a=(i=n.textEdit)!==null&&i!==void 0?i:this.buildCompletionTextEdit(e,s,o);return a?{additionalTextEdits:n.additionalTextEdits,command:n.command,commitCharacters:n.commitCharacters,data:n.data,detail:n.detail,documentation:n.documentation,filterText:n.filterText,insertText:n.insertText,insertTextFormat:n.insertTextFormat,insertTextMode:n.insertTextMode,kind:n.kind,labelDetails:n.labelDetails,preselect:n.preselect,sortText:n.sortText,tags:n.tags,textEditText:n.textEditText,textEdit:a,label:s}:void 0}buildCompletionTextEdit(e,n,r){const s=e.textDocument.getText().substring(e.tokenOffset,e.offset);if(this.fuzzyMatcher.match(s,n)){const o=e.textDocument.positionAt(e.tokenOffset),a=e.position;return{newText:r,range:{start:o,end:a}}}else return}}class D7{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getDefinition(e,n,r){const i=e.parseResult.value;if(i.$cstNode){const s=i.$cstNode,o=_i(s,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(o)return this.collectLocationLinks(o,n)}}collectLocationLinks(e,n){var r;const i=this.findLink(e);if(i)return[ye.LocationLink.create(i.targetDocument.textDocument.uri,((r=i.target.astNode.$cstNode)!==null&&r!==void 0?r:i.target).range,i.target.range,i.source.range)]}findLink(e){const n=this.references.findDeclarationNode(e);if(n?.astNode){const r=bt(n.astNode);if(n&&r)return{source:e,target:n,targetDocument:r}}}}class T1{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}getDocumentHighlight(e,n,r){const i=e.parseResult.value.$cstNode;if(!i)return;const s=_i(i,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(!s)return;const o=this.references.findDeclaration(s);if(o){const a=Ct.equals(bt(o).uri,e.uri),c={documentUri:e.uri,includeDeclaration:a};return this.references.findReferences(o,c).map(l=>this.createDocumentHighlight(l)).toArray()}}createDocumentHighlight(e){return ye.DocumentHighlight.create(e.segment.range)}}class E7{constructor(e){this.nameProvider=e.references.NameProvider,this.nodeKindProvider=e.shared.lsp.NodeKindProvider}getSymbols(e,n,r){return this.getSymbol(e,e.parseResult.value)}getSymbol(e,n){const r=n.$cstNode,i=this.nameProvider.getNameNode(n);if(i&&r){const s=this.nameProvider.getName(n);return[{kind:this.nodeKindProvider.getSymbolKind(n),name:s||i.text,range:r.range,selectionRange:i.range,children:this.getChildSymbols(e,n)}]}else return this.getChildSymbols(e,n)||[]}getChildSymbols(e,n){const r=[];for(const i of mc(n)){const s=this.getSymbol(e,i);r.push(...s)}if(r.length>0)return r}}class R7{constructor(e){this.workspaceManager=e.workspace.WorkspaceManager,this.documentBuilder=e.workspace.DocumentBuilder,this.workspaceLock=e.workspace.WorkspaceLock,this.serviceRegistry=e.ServiceRegistry;let n=!1;e.lsp.LanguageServer.onInitialize(r=>{var i,s;n=!!(!((s=(i=r.capabilities.workspace)===null||i===void 0?void 0:i.didChangeWatchedFiles)===null||s===void 0)&&s.dynamicRegistration)}),e.lsp.LanguageServer.onInitialized(r=>{n&&this.registerFileWatcher(e)})}registerFileWatcher(e){const n=st(e.ServiceRegistry.all).flatMap(r=>r.LanguageMetaData.fileExtensions).map(r=>r.startsWith(".")?r.substring(1):r).distinct().toArray();if(n.length>0){const r=e.lsp.Connection,i={watchers:[{globPattern:n.length===1?`**/*.${n[0]}`:`**/*.{${n.join(",")}}`}]};r?.client.register(ye.DidChangeWatchedFilesNotification.type,i)}}fireDocumentUpdate(e,n){e=e.filter(r=>this.serviceRegistry.hasServices(r)),this.workspaceManager.ready.then(()=>{this.workspaceLock.write(r=>this.documentBuilder.update(e,n,r))}).catch(r=>{console.error("Workspace initialization failed. Could not perform document update.",r)})}didChangeContent(e){this.fireDocumentUpdate([Zt.parse(e.document.uri)],[])}didChangeWatchedFiles(e){const n=st(e.changes).filter(i=>i.type!==ye.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>Zt.parse(i.uri)).toArray(),r=st(e.changes).filter(i=>i.type===ye.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>Zt.parse(i.uri)).toArray();this.fireDocumentUpdate(n,r)}}class $7{constructor(e){this.commentNames=e.parser.GrammarConfig.multilineCommentRules}getFoldingRanges(e,n,r){const i=[],s=o=>i.push(o);return this.collectFolding(e,s),i}collectFolding(e,n){var r;const i=(r=e.parseResult)===null||r===void 0?void 0:r.value;if(i){if(this.shouldProcessContent(i)){const s=_r(i).iterator();let o;do if(o=s.next(),!o.done){const a=o.value;this.shouldProcess(a)&&this.collectObjectFolding(e,a,n),this.shouldProcessContent(a)||s.prune()}while(!o.done)}this.collectCommentFolding(e,i,n)}}shouldProcess(e){return!0}shouldProcessContent(e){return!0}collectObjectFolding(e,n,r){const i=n.$cstNode;if(i){const s=this.toFoldingRange(e,i);s&&r(s)}}collectCommentFolding(e,n,r){const i=n.$cstNode;if(i){for(const s of tE(i))if(this.commentNames.includes(s.tokenType.name)){const o=this.toFoldingRange(e,s,ye.FoldingRangeKind.Comment);o&&r(o)}}}toFoldingRange(e,n,r){const i=n.range,s=i.start;let o=i.end;if(!(o.line-s.line<2))return this.includeLastFoldingLine(n,r)||(o=e.textDocument.positionAt(e.textDocument.offsetAt({line:o.line,character:0})-1)),ye.FoldingRange.create(s.line,o.line,s.character,o.character,r)}includeLastFoldingLine(e,n){if(n===ye.FoldingRangeKind.Comment)return!1;const r=e.text,i=r.charAt(r.length-1);return!(i==="}"||i===")"||i==="]")}}class T7{match(e,n){if(e.length===0)return!0;let r=!1,i,s=0;const o=n.length;for(let a=0;a<o;a++){const c=n.charCodeAt(a),u=e.charCodeAt(s);if((c===u||this.toUpperCharCode(c)===this.toUpperCharCode(u))&&(r||(r=i===void 0||this.isWordTransition(i,c)),r&&s++,s===e.length))return!0;i=c}return!1}isWordTransition(e,n){return S1<=e&&e<=k1&&S7<=n&&n<=k7||e===C1&&n!==C1}toUpperCharCode(e){return S1<=e&&e<=k1?e-32:e}}const S1=97,k1=122,S7=65,k7=90,C1=95;class A1{constructor(e){this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getHoverContent(e,n){var r,i;const s=(i=(r=e.parseResult)===null||r===void 0?void 0:r.value)===null||i===void 0?void 0:i.$cstNode;if(s){const o=e.textDocument.offsetAt(n.position),a=_i(s,o,this.grammarConfig.nameRegexp);if(a&&a.offset+a.length>o){const c=this.references.findDeclaration(a);if(c)return this.getAstNodeHoverContent(c)}}}}class C7 extends A1{constructor(e){super(e),this.documentationProvider=e.documentation.DocumentationProvider}getAstNodeHoverContent(e){const n=this.documentationProvider.getDocumentation(e);if(n)return{contents:{kind:"markdown",value:n}}}}var qp=Pt();const A7={[ye.SemanticTokenTypes.class]:0,[ye.SemanticTokenTypes.comment]:1,[ye.SemanticTokenTypes.enum]:2,[ye.SemanticTokenTypes.enumMember]:3,[ye.SemanticTokenTypes.event]:4,[ye.SemanticTokenTypes.function]:5,[ye.SemanticTokenTypes.interface]:6,[ye.SemanticTokenTypes.keyword]:7,[ye.SemanticTokenTypes.macro]:8,[ye.SemanticTokenTypes.method]:9,[ye.SemanticTokenTypes.modifier]:10,[ye.SemanticTokenTypes.namespace]:11,[ye.SemanticTokenTypes.number]:12,[ye.SemanticTokenTypes.operator]:13,[ye.SemanticTokenTypes.parameter]:14,[ye.SemanticTokenTypes.property]:15,[ye.SemanticTokenTypes.regexp]:16,[ye.SemanticTokenTypes.string]:17,[ye.SemanticTokenTypes.struct]:18,[ye.SemanticTokenTypes.type]:19,[ye.SemanticTokenTypes.typeParameter]:20,[ye.SemanticTokenTypes.variable]:21,[ye.SemanticTokenTypes.decorator]:22},_7={[ye.SemanticTokenModifiers.abstract]:1,[ye.SemanticTokenModifiers.async]:2,[ye.SemanticTokenModifiers.declaration]:4,[ye.SemanticTokenModifiers.defaultLibrary]:8,[ye.SemanticTokenModifiers.definition]:16,[ye.SemanticTokenModifiers.deprecated]:32,[ye.SemanticTokenModifiers.documentation]:64,[ye.SemanticTokenModifiers.modification]:128,[ye.SemanticTokenModifiers.readonly]:256,[ye.SemanticTokenModifiers.static]:512};function P7(t){const e=[],n=[];let r=!0,i=!0,s=!0;for(const o of t)o&&(o.legend.tokenTypes.forEach((a,c)=>{const u=e[c];if(u&&u!==a)throw new Error(`Cannot merge '${u}' and '${a}' token types. They use the same index ${c}.`);e[c]=a}),o.legend.tokenModifiers.forEach((a,c)=>{const u=n[c];if(u&&u!==a)throw new Error(`Cannot merge '${u}' and '${a}' token modifier. They use the same index ${c}.`);n[c]=a}),o.full?typeof o.full=="object"&&!o.full.delta&&(i=!1):r=!1,o.range||(s=!1));return{legend:{tokenTypes:e,tokenModifiers:n},full:r&&{delta:i},range:s}}class x7 extends ye.SemanticTokensBuilder{constructor(){super(...arguments),this._tokens=[]}push(e,n,r,i,s){this._tokens.push({line:e,char:n,length:r,tokenType:i,tokenModifiers:s})}build(){return this.applyTokens(),super.build()}buildEdits(){return this.applyTokens(),super.buildEdits()}flush(){this.previousResult(this.id)}applyTokens(){for(const e of this._tokens.sort(this.compareTokens))super.push(e.line,e.char,e.length,e.tokenType,e.tokenModifiers);this._tokens=[]}compareTokens(e,n){return e.line===n.line?e.char-n.char:e.line-n.line}}class I7{constructor(e){this.tokensBuilders=new Map,e.shared.workspace.TextDocuments.onDidClose(n=>{this.tokensBuilders.delete(n.document.uri)}),e.shared.lsp.LanguageServer.onInitialize(n=>{var r;this.initialize((r=n.capabilities.textDocument)===null||r===void 0?void 0:r.semanticTokens)})}initialize(e){this.clientCapabilities=e}get tokenTypes(){return A7}get tokenModifiers(){return _7}get semanticTokensOptions(){return{legend:{tokenTypes:Object.keys(this.tokenTypes),tokenModifiers:Object.keys(this.tokenModifiers)},full:{delta:!0},range:!0}}async semanticHighlight(e,n,r=ct.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.flush(),await this.computeHighlighting(e,this.createAcceptor(),r),this.currentTokensBuilder.build()}async semanticHighlightRange(e,n,r=ct.CancellationToken.None){return this.currentRange=n.range,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.flush(),await this.computeHighlighting(e,this.createAcceptor(),r),this.currentTokensBuilder.build()}async semanticHighlightDelta(e,n,r=ct.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.previousResult(n.previousResultId),await this.computeHighlighting(e,this.createAcceptor(),r),this.currentTokensBuilder.buildEdits()}createAcceptor(){return n=>{"line"in n?this.highlightToken({range:{start:{line:n.line,character:n.char},end:{line:n.line,character:n.char+n.length}},type:n.type,modifier:n.modifier}):"range"in n?this.highlightToken(n):"keyword"in n?this.highlightKeyword(n):"property"in n?this.highlightProperty(n):this.highlightNode({node:n.cst,type:n.type,modifier:n.modifier})}}getDocumentTokensBuilder(e){const n=this.tokensBuilders.get(e.uri.toString());if(n)return n;const r=new x7;return this.tokensBuilders.set(e.uri.toString(),r),r}async computeHighlighting(e,n,r){const i=e.parseResult.value,s=ei(i,{range:this.currentRange}).iterator();let o;do if(o=s.next(),!o.done){await jt(r);const a=o.value;this.highlightElement(a,n)==="prune"&&s.prune()}while(!o.done)}highlightToken(e){var n;const{range:r,type:i}=e;let s=e.modifier;if(this.currentRange&&!Tg(r,this.currentRange)||!this.currentDocument||!this.currentTokensBuilder)return;const o=this.tokenTypes[i];let a=0;if(s!==void 0){typeof s=="string"&&(s=[s]);for(const l of s){const d=this.tokenModifiers[l];a|=d}}const c=r.start.line,u=r.end.line;if(c===u){const l=r.start.character,d=r.end.character-l;this.currentTokensBuilder.push(c,l,d,o,a)}else if(!((n=this.clientCapabilities)===null||n===void 0)&&n.multilineTokenSupport){const l=r.start.character,d=this.currentDocument.textDocument.offsetAt(r.start),f=this.currentDocument.textDocument.offsetAt(r.end);this.currentTokensBuilder.push(c,l,f-d,o,a)}else{const l=r.start;let d=this.currentDocument.textDocument.offsetAt({line:c+1,character:0});this.currentTokensBuilder.push(l.line,l.character,d-l.character-1,o,a);for(let f=c+1;f<u;f++){const p=d;d=this.currentDocument.textDocument.offsetAt({line:f+1,character:0}),this.currentTokensBuilder.push(f,0,d-p-1,o,a)}this.currentTokensBuilder.push(u,0,r.end.character,o,a)}}highlightProperty(e){const n=[];if(typeof e.index=="number"){const s=kn(e.node.$cstNode,e.property,e.index);s&&n.push(s)}else n.push(...Po(e.node.$cstNode,e.property));const{type:r,modifier:i}=e;for(const s of n)this.highlightNode({node:s,type:r,modifier:i})}highlightKeyword(e){const{node:n,keyword:r,type:i,index:s,modifier:o}=e,a=[];if(typeof s=="number"){const c=vc(n.$cstNode,r,s);c&&a.push(c)}else a.push(...Kg(n.$cstNode,r));for(const c of a)this.highlightNode({node:c,type:i,modifier:o})}highlightNode(e){const{node:n,type:r,modifier:i}=e,s=n.range;this.highlightToken({range:s,type:r,modifier:i})}}var _1;(function(t){function e(r,i,s){const o=new Map;Object.entries(i).forEach(([u,l])=>o.set(l,u));let a=0,c=0;return n(r.data,5).map(u=>{a+=u[0],u[0]!==0&&(c=0),c+=u[1];const l=u[2];return{offset:s.textDocument.offsetAt({line:a,character:c}),tokenType:o.get(u[3]),tokenModifiers:u[4],text:s.textDocument.getText({start:{line:a,character:c},end:{line:a,character:c+l}})}})}t.decode=e;function n(r,i){const s=[];for(let o=0;o<r.length;o+=i){const a=r.slice(o,o+i);s.push(a)}return s}})(_1||(_1={}));function N7(t){const e=[],n=[];t.forEach(i=>{i?.triggerCharacters&&e.push(...i.triggerCharacters),i?.retriggerCharacters&&n.push(...i.retriggerCharacters)});const r={triggerCharacters:e.length>0?Array.from(new Set(e)).sort():void 0,retriggerCharacters:n.length>0?Array.from(new Set(n)).sort():void 0};return r.triggerCharacters?r:void 0}class O7{constructor(e){this.onInitializeEmitter=new qp.Emitter,this.onInitializedEmitter=new qp.Emitter,this.services=e}get onInitialize(){return this.onInitializeEmitter.event}get onInitialized(){return this.onInitializedEmitter.event}async initialize(e){return this.eagerLoadServices(),this.fireInitializeOnDefaultServices(e),this.onInitializeEmitter.fire(e),this.onInitializeEmitter.dispose(),this.buildInitializeResult(e)}eagerLoadServices(){Tv(this.services),this.services.ServiceRegistry.all.forEach(e=>Tv(e))}hasService(e){return this.services.ServiceRegistry.all.some(r=>e(r)!==void 0)}buildInitializeResult(e){var n,r,i,s;const o=this.services.lsp.DocumentUpdateHandler,a=(n=this.services.lsp.FileOperationHandler)===null||n===void 0?void 0:n.fileOperationOptions,c=this.services.ServiceRegistry.all,u=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.Formatter}),l=c.map(te=>{var C,he;return(he=(C=te.lsp)===null||C===void 0?void 0:C.Formatter)===null||he===void 0?void 0:he.formatOnTypeOptions}).find(te=>!!te),d=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.CodeActionProvider}),f=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.SemanticTokenProvider}),p=P7(c.map(te=>{var C,he;return(he=(C=te.lsp)===null||C===void 0?void 0:C.SemanticTokenProvider)===null||he===void 0?void 0:he.semanticTokensOptions})),h=(i=(r=this.services.lsp)===null||r===void 0?void 0:r.ExecuteCommandHandler)===null||i===void 0?void 0:i.commands,v=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.DocumentLinkProvider}),b=N7(c.map(te=>{var C,he;return(he=(C=te.lsp)===null||C===void 0?void 0:C.SignatureHelp)===null||he===void 0?void 0:he.signatureHelpOptions})),g=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.TypeProvider}),w=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.ImplementationProvider}),R=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.CompletionProvider}),k=b7(c.map(te=>{var C,he;return(he=(C=te.lsp)===null||C===void 0?void 0:C.CompletionProvider)===null||he===void 0?void 0:he.completionOptions})),A=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.ReferencesProvider}),N=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.DocumentSymbolProvider}),_=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.DefinitionProvider}),B=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.DocumentHighlightProvider}),z=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.FoldingRangeProvider}),Q=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.HoverProvider}),I=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.RenameProvider}),T=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.CallHierarchyProvider}),$=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.TypeHierarchyProvider}),L=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.CodeLensProvider}),V=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.DeclarationProvider}),H=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.InlayHintProvider}),K=(s=this.services.lsp)===null||s===void 0?void 0:s.WorkspaceSymbolProvider;return{capabilities:{workspace:{workspaceFolders:{supported:!0},fileOperations:a},executeCommandProvider:h&&{commands:h},textDocumentSync:{change:qp.TextDocumentSyncKind.Incremental,openClose:!0,save:!!o.didSaveDocument,willSave:!!o.willSaveDocument,willSaveWaitUntil:!!o.willSaveDocumentWaitUntil},completionProvider:R?k:void 0,referencesProvider:A,documentSymbolProvider:N,definitionProvider:_,typeDefinitionProvider:g,documentHighlightProvider:B,codeActionProvider:d,documentFormattingProvider:u,documentRangeFormattingProvider:u,documentOnTypeFormattingProvider:l,foldingRangeProvider:z,hoverProvider:Q,renameProvider:I?{prepareProvider:!0}:void 0,semanticTokensProvider:f?p:void 0,signatureHelpProvider:b,implementationProvider:w,callHierarchyProvider:T?{}:void 0,typeHierarchyProvider:$?{}:void 0,documentLinkProvider:v?{resolveProvider:!1}:void 0,codeLensProvider:L?{resolveProvider:!1}:void 0,declarationProvider:V,inlayHintProvider:H?{resolveProvider:!1}:void 0,workspaceSymbolProvider:K?{resolveProvider:!!K.resolveSymbol}:void 0}}}initialized(e){this.fireInitializedOnDefaultServices(e),this.onInitializedEmitter.fire(e),this.onInitializedEmitter.dispose()}fireInitializeOnDefaultServices(e){this.services.workspace.ConfigurationProvider.initialize(e),this.services.workspace.WorkspaceManager.initialize(e)}fireInitializedOnDefaultServices(e){const n=this.services.lsp.Connection,r=n?Object.assign(Object.assign({},e),{register:i=>n.client.register(qp.DidChangeConfigurationNotification.type,i),fetchConfiguration:i=>n.workspace.getConfiguration(i)}):e;this.services.workspace.ConfigurationProvider.initialized(r).catch(i=>console.error("Error in ConfigurationProvider initialization:",i)),this.services.workspace.WorkspaceManager.initialized(e).catch(i=>console.error("Error in WorkspaceManager initialization:",i))}}class F7{getSymbolKind(e){return ye.SymbolKind.Field}getCompletionItemKind(e){return ye.CompletionItemKind.Reference}}class L7{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}findReferences(e,n,r){const i=e.parseResult.value.$cstNode;if(!i)return[];const s=_i(i,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);return s?this.getReferences(s,n,e):[]}getReferences(e,n,r){const i=[],s=this.references.findDeclaration(e);if(s){const o={includeDeclaration:n.context.includeDeclaration};this.references.findReferences(s,o).forEach(a=>{i.push(ye.Location.create(a.sourceUri.toString(),a.segment.range))})}return i}}class M7{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}async rename(e,n,r){const i={},s=e.parseResult.value.$cstNode;if(!s)return;const o=e.textDocument.offsetAt(n.position),a=_i(s,o,this.grammarConfig.nameRegexp);if(!a)return;const c=this.references.findDeclaration(a);if(!c)return;const u={onlyLocal:!1,includeDeclaration:!0};return this.references.findReferences(c,u).forEach(d=>{const f=In.replace(d.segment.range,n.newName),p=d.sourceUri.toString();i[p]?i[p].push(f):i[p]=[f]}),{changes:i}}prepareRename(e,n,r){return this.renameNodeRange(e,n.position)}renameNodeRange(e,n){const r=e.parseResult.value.$cstNode,i=e.textDocument.offsetAt(n);if(r&&i){const s=_i(r,i,this.grammarConfig.nameRegexp);if(!s)return;if(this.references.findDeclaration(s)||this.isNameNode(s))return s.range}}isNameNode(e){return e?.astNode&&Ap(e.astNode)&&e===this.nameProvider.getNameNode(e.astNode)}}class P1{constructor(e){this.indexManager=e.workspace.IndexManager,this.nodeKindProvider=e.lsp.NodeKindProvider,this.fuzzyMatcher=e.lsp.FuzzyMatcher}async getSymbols(e,n=ct.CancellationToken.None){const r=[],i=e.query.toLowerCase();for(const s of this.indexManager.allElements())if(await jt(n),this.fuzzyMatcher.match(i,s.name)){const o=this.getWorkspaceSymbol(s);o&&r.push(o)}return r}getWorkspaceSymbol(e){const n=e.nameSegment;if(n)return{kind:this.nodeKindProvider.getSymbolKind(e),name:e.name,location:{range:n.range,uri:e.documentUri.toString()}}}}class B7{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new ye.Emitter,this._onDidOpen=new ye.Emitter,this._onDidClose=new ye.Emitter,this._onDidSave=new ye.Emitter,this._onWillSave=new ye.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(Ct.normalize(e))}set(e){const n=Ct.normalize(e.uri);let r=!0;this._syncedDocuments.has(n)&&(r=!1),this._syncedDocuments.set(n,e);const i=Object.freeze({document:e});return this._onDidOpen.fire(i),this._onDidChangeContent.fire(i),r}delete(e){const n=Ct.normalize(typeof e=="object"&&"uri"in e?e.uri:e),r=this._syncedDocuments.get(n);r!==void 0&&(this._syncedDocuments.delete(n),this._onDidClose.fire(Object.freeze({document:r})))}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=ye.TextDocumentSyncKind.Incremental;const n=[];return n.push(e.onDidOpenTextDocument(r=>{const i=r.textDocument,s=Ct.normalize(i.uri),o=this._configuration.create(s,i.languageId,i.version,i.text);this._syncedDocuments.set(s,o);const a=Object.freeze({document:o});this._onDidOpen.fire(a),this._onDidChangeContent.fire(a)})),n.push(e.onDidChangeTextDocument(r=>{const i=r.textDocument,s=r.contentChanges;if(s.length===0)return;const{version:o}=i;if(o==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);const a=Ct.normalize(i.uri);let c=this._syncedDocuments.get(a);c!==void 0&&(c=this._configuration.update(c,s,o),this._syncedDocuments.set(a,c),this._onDidChangeContent.fire(Object.freeze({document:c})))})),n.push(e.onDidCloseTextDocument(r=>{const i=Ct.normalize(r.textDocument.uri),s=this._syncedDocuments.get(i);s!==void 0&&(this._syncedDocuments.delete(i),this._onDidClose.fire(Object.freeze({document:s})))})),n.push(e.onWillSaveTextDocument(r=>{const i=this._syncedDocuments.get(Ct.normalize(r.textDocument.uri));i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,i)=>{const s=this._syncedDocuments.get(Ct.normalize(r.textDocument.uri));return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:r.reason}),i):[]})),n.push(e.onDidSaveTextDocument(r=>{const i=this._syncedDocuments.get(Ct.normalize(r.textDocument.uri));i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),ye.Disposable.create(()=>{n.forEach(r=>r.dispose())})}}function z7(t){return xp.merge(FS(t),q7(t))}function q7(t){return{lsp:{CompletionProvider:e=>new $1(e),DocumentSymbolProvider:e=>new E7(e),HoverProvider:e=>new C7(e),FoldingRangeProvider:e=>new $7(e),ReferencesProvider:e=>new L7(e),DefinitionProvider:e=>new D7(e),DocumentHighlightProvider:e=>new T1(e),RenameProvider:e=>new M7(e)},shared:()=>t.shared}}function j7(t){return xp.merge(LS(t),U7(t))}function U7(t){return{lsp:{Connection:()=>t.connection,LanguageServer:e=>new O7(e),DocumentUpdateHandler:e=>new R7(e),WorkspaceSymbolProvider:e=>new P1(e),NodeKindProvider:()=>new F7,FuzzyMatcher:()=>new T7},workspace:{TextDocuments:()=>new B7(Cp)}}}class G7{constructor(){this.collector=()=>{}}getNodeFormatter(e){return new W7(e,this.collector)}formatDocument(e,n){const r=e.parseResult;return r.lexerErrors.length===0&&r.parserErrors.length===0?this.doDocumentFormat(e,n.options):[]}isFormatRangeErrorFree(e,n){const r=e.parseResult;return r.lexerErrors.length||r.parserErrors.length?Math.min(...r.lexerErrors.map(s=>{var o;return(o=s.line)!==null&&o!==void 0?o:Number.MAX_VALUE}),...r.parserErrors.map(s=>{var o;return(o=s.token.startLine)!==null&&o!==void 0?o:Number.MAX_VALUE}))>n.end.line:!0}formatDocumentRange(e,n){return this.isFormatRangeErrorFree(e,n.range)?this.doDocumentFormat(e,n.options,n.range):[]}formatDocumentOnType(e,n){const r={start:{character:0,line:n.position.line},end:n.position};return this.isFormatRangeErrorFree(e,r)?this.doDocumentFormat(e,n.options,r):[]}get formatOnTypeOptions(){}doDocumentFormat(e,n,r){const i=new Map,s=(a,c,u)=>{var l,d;const f=this.nodeModeToKey(a,c),p=i.get(f),h=(l=u.options.priority)!==null&&l!==void 0?l:0,v=(d=p?.options.priority)!==null&&d!==void 0?d:0;(!p||v<=h)&&i.set(f,u)};this.collector=s,this.iterateAstFormatting(e,r);const o=this.iterateCstFormatting(e,i,n,r);return this.avoidOverlappingEdits(e.textDocument,o)}avoidOverlappingEdits(e,n){const r=[];for(const i of n){let s=r[r.length-1];for(;s;){const o=e.offsetAt(i.range.start),a=e.offsetAt(s.range.end);if(o<a)r.pop(),s=r[r.length-1];else break}r.push(i)}return r.filter(i=>this.isNecessary(i,e))}iterateAstFormatting(e,n){const r=e.parseResult.value;this.format(r);const i=_r(r).iterator();let s;do if(s=i.next(),!s.done){const o=s.value;this.insideRange(o.$cstNode.range,n)?this.format(o):i.prune()}while(!s.done)}nodeModeToKey(e,n){return`${e.offset}:${e.end}:${n}`}insideRange(e,n){return!n||e.start.line<=n.start.line&&e.end.line>=n.end.line||e.start.line>=n.start.line&&e.end.line<=n.end.line||e.start.line<=n.end.line&&e.end.line>=n.end.line}isNecessary(e,n){return e.newText!==n.getText(e.range).replace(/\r/g,"")}iterateCstFormatting(e,n,r,i){const s={indentation:0,options:r,document:e.textDocument},o=[],c=this.iterateCstTree(e,s).iterator();let u,l;do if(l=c.next(),!l.done){const d=l.value,f=ws(d),p=this.nodeModeToKey(d,"prepend"),h=n.get(p);if(n.delete(p),h){const g=this.createTextEdit(u,d,h,s);for(const w of g)w&&this.insideRange(w.range,i)&&o.push(w)}const v=this.nodeModeToKey(d,"append"),b=n.get(v);if(n.delete(v),b){const g=oE(d);if(g){const w=this.createTextEdit(d,g,b,s);for(const R of w)R&&this.insideRange(R.range,i)&&o.push(R)}}if(!h&&d.hidden){const g=this.createHiddenTextEdits(u,d,void 0,s);for(const w of g)w&&this.insideRange(w.range,i)&&o.push(w)}f&&(u=d)}while(!l.done);return o}createHiddenTextEdits(e,n,r,i){var s;const o=n.range.start.line;if(e&&e.range.end.line===o)return[];const a=[],c={start:{character:0,line:o},end:n.range.start},u=i.document.getText(c),l=this.findFittingMove(c,(s=r?.moves)!==null&&s!==void 0?s:[],i),d=this.getExistingIndentationCharacterCount(u,i),p=this.getIndentationCharacterCount(i,l)-d;if(p===0)return[];let h="";p>0&&(h=(i.options.insertSpaces?" ":" ").repeat(p));const v=n.text.split(`
161
- `);v[0]=u+v[0];for(let b=0;b<v.length;b++){const g=o+b,w={character:0,line:g};if(p>0)a.push({newText:h,range:{start:w,end:w}});else{const R=v[b];let k=0;for(;k<R.length;k++){const A=R.charAt(k);if(A!==" "&&A!==" ")break}a.push({newText:"",range:{start:w,end:{line:g,character:Math.min(k,Math.abs(p))}}})}}return a}getExistingIndentationCharacterCount(e,n){const r=" ".repeat(n.options.tabSize);return(n.options.insertSpaces?e.replaceAll(" ",r):e.replaceAll(r," ")).length}getIndentationCharacterCount(e,n){let r=e.indentation;return n&&n.tabs&&(r+=n.tabs),(e.options.insertSpaces?e.options.tabSize:1)*r}createTextEdit(e,n,r,i){var s;if(n.hidden)return this.createHiddenTextEdits(e,n,r,i);if(e&&(e.range.end.line>n.range.start.line||e.range.end.line===n.range.start.line&&e.range.end.character>n.range.start.character))return[];const o={start:(s=e?.range.end)!==null&&s!==void 0?s:{character:0,line:0},end:n.range.start},a=this.findFittingMove(o,r.moves,i);if(!a)return[];const c=a.characters,u=a.lines,l=a.tabs,d=i.indentation;i.indentation+=l??0;const f=[];return c!==void 0?e?.hidden||f.push(this.createSpaceTextEdit(o,c,r.options)):u!==void 0?f.push(this.createLineTextEdit(o,u,i,r.options)):l!==void 0&&f.push(this.createTabTextEdit(o,!!e,i)),ws(n)&&(i.indentation=d),f}createSpaceTextEdit(e,n,r){if(e.start.line===e.end.line){const s=e.end.character-e.start.character;n=this.fitIntoOptions(n,s,r)}return{newText:" ".repeat(n),range:e}}createLineTextEdit(e,n,r,i){const s=e.end.line-e.start.line;n=this.fitIntoOptions(n,s,i);const a=(r.options.insertSpaces?" ".repeat(r.options.tabSize):" ").repeat(r.indentation);return{newText:`${`
162
- `.repeat(n)}${a}`,range:e}}createTabTextEdit(e,n,r){const s=(r.options.insertSpaces?" ".repeat(r.options.tabSize):" ").repeat(r.indentation),o=n?1:0,a=Math.max(e.end.line-e.start.line,o);return{newText:`${`
163
- `.repeat(a)}${s}`,range:e}}fitIntoOptions(e,n,r){return r.allowMore?e=Math.max(n,e):r.allowLess&&(e=Math.min(n,e)),e}findFittingMove(e,n,r){if(n.length===0)return;if(n.length===1)return n[0];const i=e.end.line-e.start.line;for(const s of n){if(s.lines!==void 0&&i<=s.lines)return s;if(s.lines===void 0&&i===0)return s}return n[n.length-1]}iterateCstTree(e,n){const i=e.parseResult.value.$cstNode;return i?new Co(i,s=>this.iterateCst(s,n)):ko}iterateCst(e,n){if(!Jr(e))return ko;const r=n.indentation;return new Mt(()=>({index:0}),i=>i.index<e.content.length?{done:!1,value:e.content[i.index++]}:(n.indentation=r,nn))}}class W7{constructor(e,n){this.astNode=e,this.collector=n}node(e){return new Dr(e.$cstNode?[e.$cstNode]:[],this.collector)}nodes(...e){const n=[];for(const r of e)r.$cstNode&&n.push(r.$cstNode);return new Dr(n,this.collector)}property(e,n){const r=kn(this.astNode.$cstNode,e,n);return new Dr(r?[r]:[],this.collector)}properties(...e){const n=[];for(const r of e){const i=Po(this.astNode.$cstNode,r);n.push(...i)}return new Dr(n,this.collector)}keyword(e,n){const r=vc(this.astNode.$cstNode,e,n);return new Dr(r?[r]:[],this.collector)}keywords(...e){const n=[];for(const r of e){const i=Kg(this.astNode.$cstNode,r);n.push(...i)}return new Dr(n,this.collector)}cst(e){return new Dr([...e],this.collector)}interior(e,n){const r=e.nodes,i=n.nodes;if(r.length!==1||i.length!==1)return new Dr([],this.collector);let s=r[0],o=i[0];if(s.offset>o.offset){const a=s;s=o,o=a}return new Dr(aE(s,o),this.collector)}}class Dr{constructor(e,n){this.nodes=e,this.collector=n}prepend(e){for(const n of this.nodes)this.collector(n,"prepend",e);return this}append(e){for(const n of this.nodes)this.collector(n,"append",e);return this}surround(e){for(const n of this.nodes)this.collector(n,"prepend",e),this.collector(n,"append",e);return this}slice(e,n){return new Dr(this.nodes.slice(e,n),this.collector)}}var qi;(function(t){function e(...l){return{options:{},moves:l.flatMap(d=>d.moves).sort(u)}}t.fit=e;function n(l){return i(0,l)}t.noSpace=n;function r(l){return i(1,l)}t.oneSpace=r;function i(l,d){return{options:d??{},moves:[{characters:l}]}}t.spaces=i;function s(l){return o(1,l)}t.newLine=s;function o(l,d){return{options:d??{},moves:[{lines:l}]}}t.newLines=o;function a(l){return{options:l??{},moves:[{tabs:1,lines:1}]}}t.indent=a;function c(l){return{options:l??{},moves:[{tabs:0}]}}t.noIndent=c;function u(l,d){var f,p,h,v,b,g;const w=(f=l.lines)!==null&&f!==void 0?f:0,R=(p=d.lines)!==null&&p!==void 0?p:0,k=(h=l.tabs)!==null&&h!==void 0?h:0,A=(v=d.tabs)!==null&&v!==void 0?v:0,N=(b=l.characters)!==null&&b!==void 0?b:0,_=(g=d.characters)!==null&&g!==void 0?g:0;return w<R?-1:w>R?1:k<A?-1:k>A?1:N<_?-1:N>_?1:0}})(qi||(qi={}));var jv,x1;function H7(){return x1||(x1=1,jv=b1()),jv}H7();var Cu={},Au={},_u={},Ws={},ji={},bi={},I1;function N1(){if(I1)return bi;I1=1,Object.defineProperty(bi,"__esModule",{value:!0}),bi.normalizePath=bi.convertSlashes=bi.cleanPath=void 0;const t=Tr;function e(s){let o=(0,t.normalize)(s);return o.length>1&&o[o.length-1]===t.sep&&(o=o.substring(0,o.length-1)),o}bi.cleanPath=e;const n=/[\\/]/g;function r(s,o){return s.replace(n,o)}bi.convertSlashes=r;function i(s,o){const{resolvePaths:a,normalizePath:c,pathSeparator:u}=o,l=process.platform==="win32"&&s.includes("/")||s.startsWith(".");if(a&&(s=(0,t.resolve)(s)),(c||l)&&(s=e(s)),s===".")return"";const d=s[s.length-1]!==u;return r(d?s+u:s,u)}return bi.normalizePath=i,bi}var Di={},O1;function V7(){if(O1)return Di;O1=1,Object.defineProperty(Di,"__esModule",{value:!0}),Di.build=Di.joinDirectoryPath=Di.joinPathWithBasePath=void 0;const t=Tr,e=N1();function n(a,c){return c+a}Di.joinPathWithBasePath=n;function r(a,c){return function(u,l){return l.startsWith(a)?l.replace(a,"")+u:(0,e.convertSlashes)((0,t.relative)(a,l),c.pathSeparator)+c.pathSeparator+u}}function i(a){return a}function s(a,c,u){return c+a+u}Di.joinDirectoryPath=s;function o(a,c){const{relativePaths:u,includeBasePath:l}=c;return u&&a?r(a,c):l?n:i}return Di.build=o,Di}var Pu={},F1;function K7(){if(F1)return Pu;F1=1,Object.defineProperty(Pu,"__esModule",{value:!0}),Pu.build=void 0;function t(o){return function(a,c){c.push(a.substring(o.length)||".")}}function e(o){return function(a,c,u){const l=a.substring(o.length)||".";u.every(d=>d(l,!0))&&c.push(l)}}const n=(o,a)=>{a.push(o||".")},r=(o,a,c)=>{const u=o||".";c.every(l=>l(u,!0))&&a.push(u)},i=()=>{};function s(o,a){const{includeDirs:c,filters:u,relativePaths:l}=a;return c?l?u&&u.length?e(o):t(o):u&&u.length?r:n:i}return Pu.build=s,Pu}var xu={},L1;function Y7(){if(L1)return xu;L1=1,Object.defineProperty(xu,"__esModule",{value:!0}),xu.build=void 0;const t=(o,a,c,u)=>{u.every(l=>l(o,!1))&&c.files++},e=(o,a,c,u)=>{u.every(l=>l(o,!1))&&a.push(o)},n=(o,a,c,u)=>{c.files++},r=(o,a)=>{a.push(o)},i=()=>{};function s(o){const{excludeFiles:a,filters:c,onlyCounts:u}=o;return a?i:c&&c.length?u?t:e:u?n:r}return xu.build=s,xu}var Iu={},M1;function X7(){if(M1)return Iu;M1=1,Object.defineProperty(Iu,"__esModule",{value:!0}),Iu.build=void 0;const t=r=>r,e=()=>[""].slice(0,0);function n(r){return r.group?e:t}return Iu.build=n,Iu}var Nu={},B1;function J7(){if(B1)return Nu;B1=1,Object.defineProperty(Nu,"__esModule",{value:!0}),Nu.build=void 0;const t=(r,i,s)=>{r.push({directory:i,files:s,dir:i})},e=()=>{};function n(r){return r.group?t:e}return Nu.build=n,Nu}var Yo={},z1;function Z7(){if(z1)return Yo;z1=1;var t=Yo.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.build=void 0;const e=t(yo),n=Tr,r=function(c,u,l){const{queue:d,options:{suppressErrors:f}}=u;d.enqueue(),e.default.realpath(c,(p,h)=>{if(p)return d.dequeue(f?null:p,u);e.default.stat(h,(v,b)=>{if(v)return d.dequeue(f?null:v,u);if(b.isDirectory()&&o(c,h,u))return d.dequeue(null,u);l(b,h),d.dequeue(null,u)})})},i=function(c,u,l){const{queue:d,options:{suppressErrors:f}}=u;d.enqueue();try{const p=e.default.realpathSync(c),h=e.default.statSync(p);if(h.isDirectory()&&o(c,p,u))return;l(h,p)}catch(p){if(!f)throw p}};function s(c,u){return!c.resolveSymlinks||c.excludeSymlinks?null:u?i:r}Yo.build=s;function o(c,u,l){if(l.options.useRealPaths)return a(u,l);let d=(0,n.dirname)(c),f=1;for(;d!==l.root&&f<2;){const p=l.symlinks.get(d);!!p&&(p===u||p.startsWith(u)||u.startsWith(p))?f++:d=(0,n.dirname)(d)}return l.symlinks.set(c,u),f>1}function a(c,u){return u.visited.includes(c+u.options.pathSeparator)}return Yo}var Ou={},q1;function Q7(){if(q1)return Ou;q1=1,Object.defineProperty(Ou,"__esModule",{value:!0}),Ou.build=void 0;const t=l=>l.counts,e=l=>l.groups,n=l=>l.paths,r=l=>l.paths.slice(0,l.options.maxFiles),i=(l,d,f)=>(c(d,f,l.counts,l.options.suppressErrors),null),s=(l,d,f)=>(c(d,f,l.paths,l.options.suppressErrors),null),o=(l,d,f)=>(c(d,f,l.paths.slice(0,l.options.maxFiles),l.options.suppressErrors),null),a=(l,d,f)=>(c(d,f,l.groups,l.options.suppressErrors),null);function c(l,d,f,p){d(l&&!p?l:null,f)}function u(l,d){const{onlyCounts:f,group:p,maxFiles:h}=l;return f?d?t:i:p?d?e:a:h?d?r:o:d?n:s}return Ou.build=u,Ou}var Xo={},j1;function eU(){if(j1)return Xo;j1=1;var t=Xo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.build=void 0;const e=t(yo),n={withFileTypes:!0},r=(o,a,c,u,l)=>{if(u<0)return o.queue.dequeue(null,o);o.visited.push(a),o.counts.directories++,o.queue.enqueue(),e.default.readdir(a||".",n,(d,f=[])=>{l(f,c,u),o.queue.dequeue(o.options.suppressErrors?null:d,o)})},i=(o,a,c,u,l)=>{if(u<0)return;o.visited.push(a),o.counts.directories++;let d=[];try{d=e.default.readdirSync(a||".",n)}catch(f){if(!o.options.suppressErrors)throw f}l(d,c,u)};function s(o){return o?i:r}return Xo.build=s,Xo}var Fu={},U1;function tU(){if(U1)return Fu;U1=1,Object.defineProperty(Fu,"__esModule",{value:!0}),Fu.Queue=void 0;class t{onQueueEmpty;count=0;constructor(n){this.onQueueEmpty=n}enqueue(){this.count++}dequeue(n,r){(--this.count<=0||n)&&this.onQueueEmpty(n,r)}}return Fu.Queue=t,Fu}var Lu={},G1;function nU(){if(G1)return Lu;G1=1,Object.defineProperty(Lu,"__esModule",{value:!0}),Lu.Counter=void 0;class t{_files=0;_directories=0;set files(n){this._files=n}get files(){return this._files}set directories(n){this._directories=n}get directories(){return this._directories}get dirs(){return this._directories}}return Lu.Counter=t,Lu}var W1;function H1(){if(W1)return ji;W1=1;var t=ji.__createBinding||(Object.create?function(b,g,w,R){R===void 0&&(R=w);var k=Object.getOwnPropertyDescriptor(g,w);(!k||("get"in k?!g.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return g[w]}}),Object.defineProperty(b,R,k)}:function(b,g,w,R){R===void 0&&(R=w),b[R]=g[w]}),e=ji.__setModuleDefault||(Object.create?function(b,g){Object.defineProperty(b,"default",{enumerable:!0,value:g})}:function(b,g){b.default=g}),n=ji.__importStar||function(b){if(b&&b.__esModule)return b;var g={};if(b!=null)for(var w in b)w!=="default"&&Object.prototype.hasOwnProperty.call(b,w)&&t(g,b,w);return e(g,b),g};Object.defineProperty(ji,"__esModule",{value:!0}),ji.Walker=void 0;const r=Tr,i=N1(),s=n(V7()),o=n(K7()),a=n(Y7()),c=n(X7()),u=n(J7()),l=n(Z7()),d=n(Q7()),f=n(eU()),p=tU(),h=nU();class v{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(g,w,R){this.isSynchronous=!R,this.callbackInvoker=d.build(w,this.isSynchronous),this.root=(0,i.normalizePath)(g,w),this.state={root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new h.Counter,options:w,queue:new p.Queue((k,A)=>this.callbackInvoker(A,k,R)),symlinks:new Map,visited:[""].slice(0,0)},this.joinPath=s.build(this.root,w),this.pushDirectory=o.build(this.root,w),this.pushFile=a.build(w),this.getArray=c.build(w),this.groupFiles=u.build(w),this.resolveSymlink=l.build(w,this.isSynchronous),this.walkDirectory=f.build(this.isSynchronous)}start(){return this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(g,w,R)=>{const{paths:k,options:{filters:A,resolveSymlinks:N,excludeSymlinks:_,exclude:B,maxFiles:z,signal:Q,useRealPaths:I,pathSeparator:T}}=this.state;if(Q&&Q.aborted||z&&k.length>z)return;this.pushDirectory(w,k,A);const $=this.getArray(this.state.paths);for(let L=0;L<g.length;++L){const V=g[L];if(V.isFile()||V.isSymbolicLink()&&!N&&!_){const H=this.joinPath(V.name,w);this.pushFile(H,$,this.state.counts,A)}else if(V.isDirectory()){let H=s.joinDirectoryPath(V.name,w,this.state.options.pathSeparator);if(B&&B(V.name,H))continue;this.walkDirectory(this.state,H,H,R-1,this.walk)}else if(V.isSymbolicLink()&&this.resolveSymlink){let H=s.joinPathWithBasePath(V.name,w);this.resolveSymlink(H,this.state,(K,we)=>{if(K.isDirectory()){if(we=(0,i.normalizePath)(we,this.state.options),B&&B(V.name,we))return;this.walkDirectory(this.state,we,I?we:H+T,R-1,this.walk)}else{we=I?we:H;const te=(0,r.basename)(we),C=(0,i.normalizePath)((0,r.dirname)(we),this.state.options);we=this.joinPath(te,C),this.pushFile(we,$,this.state.counts,A)}})}}this.groupFiles(this.state.groups,w,$)}}return ji.Walker=v,ji}var V1;function rU(){if(V1)return Ws;V1=1,Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.callback=Ws.promise=void 0;const t=H1();function e(r,i){return new Promise((s,o)=>{n(r,i,(a,c)=>{if(a)return o(a);s(c)})})}Ws.promise=e;function n(r,i,s){new t.Walker(r,i,s).start()}return Ws.callback=n,Ws}var Mu={},K1;function iU(){if(K1)return Mu;K1=1,Object.defineProperty(Mu,"__esModule",{value:!0}),Mu.sync=void 0;const t=H1();function e(n,r){return new t.Walker(n,r).start()}return Mu.sync=e,Mu}var Y1;function sU(){if(Y1)return _u;Y1=1,Object.defineProperty(_u,"__esModule",{value:!0}),_u.APIBuilder=void 0;const t=rU(),e=iU();class n{root;options;constructor(i,s){this.root=i,this.options=s}withPromise(){return(0,t.promise)(this.root,this.options)}withCallback(i){(0,t.callback)(this.root,this.options,i)}sync(){return(0,e.sync)(this.root,this.options)}}return _u.APIBuilder=n,_u}var Uv={},Gv,X1;function jp(){if(X1)return Gv;X1=1;const t="\\\\/",e=`[^${t}]`,n="\\.",r="\\+",i="\\?",s="\\/",o="(?=.)",a="[^/]",c=`(?:${s}|$)`,u=`(?:^|${s})`,l=`${n}{1,2}${c}`,d=`(?!${n})`,f=`(?!${u}${l})`,p=`(?!${n}{0,1}${c})`,h=`(?!${l})`,v=`[^.${s}]`,b=`${a}*?`,w={DOT_LITERAL:n,PLUS_LITERAL:r,QMARK_LITERAL:i,SLASH_LITERAL:s,ONE_CHAR:o,QMARK:a,END_ANCHOR:c,DOTS_SLASH:l,NO_DOT:d,NO_DOTS:f,NO_DOT_SLASH:p,NO_DOTS_SLASH:h,QMARK_NO_DOT:v,STAR:b,START_ANCHOR:u,SEP:"/"},R={...w,SLASH_LITERAL:`[${t}]`,QMARK:e,STAR:`${e}*?`,DOTS_SLASH:`${n}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${t}])${n}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${n}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`,SEP:"\\"},k={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return Gv={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:k,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(A){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${A.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(A){return A===!0?R:w}},Gv}var J1;function Up(){return J1||(J1=1,function(t){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=jp();t.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),t.hasRegexChars=s=>r.test(s),t.isRegexChar=s=>s.length===1&&t.hasRegexChars(s),t.escapeRegex=s=>s.replace(i,"\\$1"),t.toPosixSlashes=s=>s.replace(e,"/"),t.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const s=navigator.platform.toLowerCase();return s==="win32"||s==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1},t.removeBackslashes=s=>s.replace(n,o=>o==="\\"?"":o),t.escapeLast=(s,o,a)=>{const c=s.lastIndexOf(o,a);return c===-1?s:s[c-1]==="\\"?t.escapeLast(s,o,c-1):`${s.slice(0,c)}\\${s.slice(c)}`},t.removePrefix=(s,o={})=>{let a=s;return a.startsWith("./")&&(a=a.slice(2),o.prefix="./"),a},t.wrapOutput=(s,o={},a={})=>{const c=a.contains?"":"^",u=a.contains?"":"$";let l=`${c}(?:${s})${u}`;return o.negated===!0&&(l=`(?:^(?!${l}).*$)`),l},t.basename=(s,{windows:o}={})=>{const a=s.split(o?/[\\/]/:"/"),c=a[a.length-1];return c===""?a[a.length-2]:c}}(Uv)),Uv}var Wv,Z1;function oU(){if(Z1)return Wv;Z1=1;const t=Up(),{CHAR_ASTERISK:e,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:i,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:d,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:p,CHAR_RIGHT_PARENTHESES:h,CHAR_RIGHT_SQUARE_BRACKET:v}=jp(),b=R=>R===a||R===r,g=R=>{R.isPrefix!==!0&&(R.depth=R.isGlobstar?1/0:1)};return Wv=(R,k)=>{const A=k||{},N=R.length-1,_=A.parts===!0||A.scanToEnd===!0,B=[],z=[],Q=[];let I=R,T=-1,$=0,L=0,V=!1,H=!1,K=!1,we=!1,te=!1,C=!1,he=!1,Ye=!1,pt=!1,W=!1,X=0,Ie,oe,be={value:"",depth:0,isGlob:!1};const Se=()=>T>=N,ae=()=>I.charCodeAt(T+1),O=()=>(Ie=oe,I.charCodeAt(++T));for(;T<N;){oe=O();let qe;if(oe===r){he=be.backslashes=!0,oe=O(),oe===c&&(C=!0);continue}if(C===!0||oe===c){for(X++;Se()!==!0&&(oe=O());){if(oe===r){he=be.backslashes=!0,O();continue}if(oe===c){X++;continue}if(C!==!0&&oe===s&&(oe=O())===s){if(V=be.isBrace=!0,K=be.isGlob=!0,W=!0,_===!0)continue;break}if(C!==!0&&oe===i){if(V=be.isBrace=!0,K=be.isGlob=!0,W=!0,_===!0)continue;break}if(oe===p&&(X--,X===0)){C=!1,V=be.isBrace=!0,W=!0;break}}if(_===!0)continue;break}if(oe===a){if(B.push(T),z.push(be),be={value:"",depth:0,isGlob:!1},W===!0)continue;if(Ie===s&&T===$+1){$+=2;continue}L=T+1;continue}if(A.noext!==!0&&(oe===d||oe===n||oe===e||oe===f||oe===o)===!0&&ae()===u){if(K=be.isGlob=!0,we=be.isExtglob=!0,W=!0,oe===o&&T===$&&(pt=!0),_===!0){for(;Se()!==!0&&(oe=O());){if(oe===r){he=be.backslashes=!0,oe=O();continue}if(oe===h){K=be.isGlob=!0,W=!0;break}}continue}break}if(oe===e){if(Ie===e&&(te=be.isGlobstar=!0),K=be.isGlob=!0,W=!0,_===!0)continue;break}if(oe===f){if(K=be.isGlob=!0,W=!0,_===!0)continue;break}if(oe===l){for(;Se()!==!0&&(qe=O());){if(qe===r){he=be.backslashes=!0,O();continue}if(qe===v){H=be.isBracket=!0,K=be.isGlob=!0,W=!0;break}}if(_===!0)continue;break}if(A.nonegate!==!0&&oe===o&&T===$){Ye=be.negated=!0,$++;continue}if(A.noparen!==!0&&oe===u){if(K=be.isGlob=!0,_===!0){for(;Se()!==!0&&(oe=O());){if(oe===u){he=be.backslashes=!0,oe=O();continue}if(oe===h){W=!0;break}}continue}break}if(K===!0){if(W=!0,_===!0)continue;break}}A.noext===!0&&(we=!1,K=!1);let j=I,de="",U="";$>0&&(de=I.slice(0,$),I=I.slice($),L-=$),j&&K===!0&&L>0?(j=I.slice(0,L),U=I.slice(L)):K===!0?(j="",U=I):j=I,j&&j!==""&&j!=="/"&&j!==I&&b(j.charCodeAt(j.length-1))&&(j=j.slice(0,-1)),A.unescape===!0&&(U&&(U=t.removeBackslashes(U)),j&&he===!0&&(j=t.removeBackslashes(j)));const ce={prefix:de,input:R,start:$,base:j,glob:U,isBrace:V,isBracket:H,isGlob:K,isExtglob:we,isGlobstar:te,negated:Ye,negatedExtglob:pt};if(A.tokens===!0&&(ce.maxDepth=0,b(oe)||z.push(be),ce.tokens=z),A.parts===!0||A.tokens===!0){let qe;for(let et=0;et<B.length;et++){const se=qe?qe+1:$,_e=B[et],ne=R.slice(se,_e);A.tokens&&(et===0&&$!==0?(z[et].isPrefix=!0,z[et].value=de):z[et].value=ne,g(z[et]),ce.maxDepth+=z[et].depth),(et!==0||ne!=="")&&Q.push(ne),qe=_e}if(qe&&qe+1<R.length){const et=R.slice(qe+1);Q.push(et),A.tokens&&(z[z.length-1].value=et,g(z[z.length-1]),ce.maxDepth+=z[z.length-1].depth)}ce.slashes=B,ce.parts=Q}return ce},Wv}var Hv,Q1;function aU(){if(Q1)return Hv;Q1=1;const t=jp(),e=Up(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:o}=t,a=(l,d)=>{if(typeof d.expandRange=="function")return d.expandRange(...l,d);l.sort();const f=`[${l.join("-")}]`;try{new RegExp(f)}catch{return l.map(h=>e.escapeRegex(h)).join("..")}return f},c=(l,d)=>`Missing ${l}: "${d}" - use "\\\\${d}" to match literal characters`,u=(l,d)=>{if(typeof l!="string")throw new TypeError("Expected a string");l=o[l]||l;const f={...d},p=typeof f.maxLength=="number"?Math.min(n,f.maxLength):n;let h=l.length;if(h>p)throw new SyntaxError(`Input length: ${h}, exceeds maximum allowed length: ${p}`);const v={type:"bos",value:"",output:f.prepend||""},b=[v],g=f.capture?"":"?:",w=t.globChars(f.windows),R=t.extglobChars(w),{DOT_LITERAL:k,PLUS_LITERAL:A,SLASH_LITERAL:N,ONE_CHAR:_,DOTS_SLASH:B,NO_DOT:z,NO_DOT_SLASH:Q,NO_DOTS_SLASH:I,QMARK:T,QMARK_NO_DOT:$,STAR:L,START_ANCHOR:V}=w,H=se=>`(${g}(?:(?!${V}${se.dot?B:k}).)*?)`,K=f.dot?"":z,we=f.dot?T:$;let te=f.bash===!0?H(f):L;f.capture&&(te=`(${te})`),typeof f.noext=="boolean"&&(f.noextglob=f.noext);const C={input:l,index:-1,start:0,dot:f.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:b};l=e.removePrefix(l,C),h=l.length;const he=[],Ye=[],pt=[];let W=v,X;const Ie=()=>C.index===h-1,oe=C.peek=(se=1)=>l[C.index+se],be=C.advance=()=>l[++C.index]||"",Se=()=>l.slice(C.index+1),ae=(se="",_e=0)=>{C.consumed+=se,C.index+=_e},O=se=>{C.output+=se.output!=null?se.output:se.value,ae(se.value)},j=()=>{let se=1;for(;oe()==="!"&&(oe(2)!=="("||oe(3)==="?");)be(),C.start++,se++;return se%2===0?!1:(C.negated=!0,C.start++,!0)},de=se=>{C[se]++,pt.push(se)},U=se=>{C[se]--,pt.pop()},ce=se=>{if(W.type==="globstar"){const _e=C.braces>0&&(se.type==="comma"||se.type==="brace"),ne=se.extglob===!0||he.length&&(se.type==="pipe"||se.type==="paren");se.type!=="slash"&&se.type!=="paren"&&!_e&&!ne&&(C.output=C.output.slice(0,-W.output.length),W.type="star",W.value="*",W.output=te,C.output+=W.output)}if(he.length&&se.type!=="paren"&&(he[he.length-1].inner+=se.value),(se.value||se.output)&&O(se),W&&W.type==="text"&&se.type==="text"){W.output=(W.output||W.value)+se.value,W.value+=se.value;return}se.prev=W,b.push(se),W=se},qe=(se,_e)=>{const ne={...R[_e],conditions:1,inner:""};ne.prev=W,ne.parens=C.parens,ne.output=C.output;const De=(f.capture?"(":"")+ne.open;de("parens"),ce({type:se,value:_e,output:C.output?"":_}),ce({type:"paren",extglob:!0,value:be(),output:De}),he.push(ne)},et=se=>{let _e=se.close+(f.capture?")":""),ne;if(se.type==="negate"){let De=te;if(se.inner&&se.inner.length>1&&se.inner.includes("/")&&(De=H(f)),(De!==te||Ie()||/^\)+$/.test(Se()))&&(_e=se.close=`)$))${De}`),se.inner.includes("*")&&(ne=Se())&&/^\.[^\\/.]+$/.test(ne)){const Me=u(ne,{...d,fastpaths:!1}).output;_e=se.close=`)${Me})${De})`}se.prev.type==="bos"&&(C.negatedExtglob=!0)}ce({type:"paren",extglob:!0,value:X,output:_e}),U("parens")};if(f.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(l)){let se=!1,_e=l.replace(s,(ne,De,Me,ht,Xe,Ut)=>ht==="\\"?(se=!0,ne):ht==="?"?De?De+ht+(Xe?T.repeat(Xe.length):""):Ut===0?we+(Xe?T.repeat(Xe.length):""):T.repeat(Me.length):ht==="."?k.repeat(Me.length):ht==="*"?De?De+ht+(Xe?te:""):te:De?ne:`\\${ne}`);return se===!0&&(f.unescape===!0?_e=_e.replace(/\\/g,""):_e=_e.replace(/\\+/g,ne=>ne.length%2===0?"\\\\":ne?"\\":"")),_e===l&&f.contains===!0?(C.output=l,C):(C.output=e.wrapOutput(_e,C,d),C)}for(;!Ie();){if(X=be(),X==="\0")continue;if(X==="\\"){const ne=oe();if(ne==="/"&&f.bash!==!0||ne==="."||ne===";")continue;if(!ne){X+="\\",ce({type:"text",value:X});continue}const De=/^\\+/.exec(Se());let Me=0;if(De&&De[0].length>2&&(Me=De[0].length,C.index+=Me,Me%2!==0&&(X+="\\")),f.unescape===!0?X=be():X+=be(),C.brackets===0){ce({type:"text",value:X});continue}}if(C.brackets>0&&(X!=="]"||W.value==="["||W.value==="[^")){if(f.posix!==!1&&X===":"){const ne=W.value.slice(1);if(ne.includes("[")&&(W.posix=!0,ne.includes(":"))){const De=W.value.lastIndexOf("["),Me=W.value.slice(0,De),ht=W.value.slice(De+2),Xe=r[ht];if(Xe){W.value=Me+Xe,C.backtrack=!0,be(),!v.output&&b.indexOf(W)===1&&(v.output=_);continue}}}(X==="["&&oe()!==":"||X==="-"&&oe()==="]")&&(X=`\\${X}`),X==="]"&&(W.value==="["||W.value==="[^")&&(X=`\\${X}`),f.posix===!0&&X==="!"&&W.value==="["&&(X="^"),W.value+=X,O({value:X});continue}if(C.quotes===1&&X!=='"'){X=e.escapeRegex(X),W.value+=X,O({value:X});continue}if(X==='"'){C.quotes=C.quotes===1?0:1,f.keepQuotes===!0&&ce({type:"text",value:X});continue}if(X==="("){de("parens"),ce({type:"paren",value:X});continue}if(X===")"){if(C.parens===0&&f.strictBrackets===!0)throw new SyntaxError(c("opening","("));const ne=he[he.length-1];if(ne&&C.parens===ne.parens+1){et(he.pop());continue}ce({type:"paren",value:X,output:C.parens?")":"\\)"}),U("parens");continue}if(X==="["){if(f.nobracket===!0||!Se().includes("]")){if(f.nobracket!==!0&&f.strictBrackets===!0)throw new SyntaxError(c("closing","]"));X=`\\${X}`}else de("brackets");ce({type:"bracket",value:X});continue}if(X==="]"){if(f.nobracket===!0||W&&W.type==="bracket"&&W.value.length===1){ce({type:"text",value:X,output:`\\${X}`});continue}if(C.brackets===0){if(f.strictBrackets===!0)throw new SyntaxError(c("opening","["));ce({type:"text",value:X,output:`\\${X}`});continue}U("brackets");const ne=W.value.slice(1);if(W.posix!==!0&&ne[0]==="^"&&!ne.includes("/")&&(X=`/${X}`),W.value+=X,O({value:X}),f.literalBrackets===!1||e.hasRegexChars(ne))continue;const De=e.escapeRegex(W.value);if(C.output=C.output.slice(0,-W.value.length),f.literalBrackets===!0){C.output+=De,W.value=De;continue}W.value=`(${g}${De}|${W.value})`,C.output+=W.value;continue}if(X==="{"&&f.nobrace!==!0){de("braces");const ne={type:"brace",value:X,output:"(",outputIndex:C.output.length,tokensIndex:C.tokens.length};Ye.push(ne),ce(ne);continue}if(X==="}"){const ne=Ye[Ye.length-1];if(f.nobrace===!0||!ne){ce({type:"text",value:X,output:X});continue}let De=")";if(ne.dots===!0){const Me=b.slice(),ht=[];for(let Xe=Me.length-1;Xe>=0&&(b.pop(),Me[Xe].type!=="brace");Xe--)Me[Xe].type!=="dots"&&ht.unshift(Me[Xe].value);De=a(ht,f),C.backtrack=!0}if(ne.comma!==!0&&ne.dots!==!0){const Me=C.output.slice(0,ne.outputIndex),ht=C.tokens.slice(ne.tokensIndex);ne.value=ne.output="\\{",X=De="\\}",C.output=Me;for(const Xe of ht)C.output+=Xe.output||Xe.value}ce({type:"brace",value:X,output:De}),U("braces"),Ye.pop();continue}if(X==="|"){he.length>0&&he[he.length-1].conditions++,ce({type:"text",value:X});continue}if(X===","){let ne=X;const De=Ye[Ye.length-1];De&&pt[pt.length-1]==="braces"&&(De.comma=!0,ne="|"),ce({type:"comma",value:X,output:ne});continue}if(X==="/"){if(W.type==="dot"&&C.index===C.start+1){C.start=C.index+1,C.consumed="",C.output="",b.pop(),W=v;continue}ce({type:"slash",value:X,output:N});continue}if(X==="."){if(C.braces>0&&W.type==="dot"){W.value==="."&&(W.output=k);const ne=Ye[Ye.length-1];W.type="dots",W.output+=X,W.value+=X,ne.dots=!0;continue}if(C.braces+C.parens===0&&W.type!=="bos"&&W.type!=="slash"){ce({type:"text",value:X,output:k});continue}ce({type:"dot",value:X,output:k});continue}if(X==="?"){if(!(W&&W.value==="(")&&f.noextglob!==!0&&oe()==="("&&oe(2)!=="?"){qe("qmark",X);continue}if(W&&W.type==="paren"){const De=oe();let Me=X;(W.value==="("&&!/[!=<:]/.test(De)||De==="<"&&!/<([!=]|\w+>)/.test(Se()))&&(Me=`\\${X}`),ce({type:"text",value:X,output:Me});continue}if(f.dot!==!0&&(W.type==="slash"||W.type==="bos")){ce({type:"qmark",value:X,output:$});continue}ce({type:"qmark",value:X,output:T});continue}if(X==="!"){if(f.noextglob!==!0&&oe()==="("&&(oe(2)!=="?"||!/[!=<:]/.test(oe(3)))){qe("negate",X);continue}if(f.nonegate!==!0&&C.index===0){j();continue}}if(X==="+"){if(f.noextglob!==!0&&oe()==="("&&oe(2)!=="?"){qe("plus",X);continue}if(W&&W.value==="("||f.regex===!1){ce({type:"plus",value:X,output:A});continue}if(W&&(W.type==="bracket"||W.type==="paren"||W.type==="brace")||C.parens>0){ce({type:"plus",value:X});continue}ce({type:"plus",value:A});continue}if(X==="@"){if(f.noextglob!==!0&&oe()==="("&&oe(2)!=="?"){ce({type:"at",extglob:!0,value:X,output:""});continue}ce({type:"text",value:X});continue}if(X!=="*"){(X==="$"||X==="^")&&(X=`\\${X}`);const ne=i.exec(Se());ne&&(X+=ne[0],C.index+=ne[0].length),ce({type:"text",value:X});continue}if(W&&(W.type==="globstar"||W.star===!0)){W.type="star",W.star=!0,W.value+=X,W.output=te,C.backtrack=!0,C.globstar=!0,ae(X);continue}let se=Se();if(f.noextglob!==!0&&/^\([^?]/.test(se)){qe("star",X);continue}if(W.type==="star"){if(f.noglobstar===!0){ae(X);continue}const ne=W.prev,De=ne.prev,Me=ne.type==="slash"||ne.type==="bos",ht=De&&(De.type==="star"||De.type==="globstar");if(f.bash===!0&&(!Me||se[0]&&se[0]!=="/")){ce({type:"star",value:X,output:""});continue}const Xe=C.braces>0&&(ne.type==="comma"||ne.type==="brace"),Ut=he.length&&(ne.type==="pipe"||ne.type==="paren");if(!Me&&ne.type!=="paren"&&!Xe&&!Ut){ce({type:"star",value:X,output:""});continue}for(;se.slice(0,3)==="/**";){const Ht=l[C.index+4];if(Ht&&Ht!=="/")break;se=se.slice(3),ae("/**",3)}if(ne.type==="bos"&&Ie()){W.type="globstar",W.value+=X,W.output=H(f),C.output=W.output,C.globstar=!0,ae(X);continue}if(ne.type==="slash"&&ne.prev.type!=="bos"&&!ht&&Ie()){C.output=C.output.slice(0,-(ne.output+W.output).length),ne.output=`(?:${ne.output}`,W.type="globstar",W.output=H(f)+(f.strictSlashes?")":"|$)"),W.value+=X,C.globstar=!0,C.output+=ne.output+W.output,ae(X);continue}if(ne.type==="slash"&&ne.prev.type!=="bos"&&se[0]==="/"){const Ht=se[1]!==void 0?"|$":"";C.output=C.output.slice(0,-(ne.output+W.output).length),ne.output=`(?:${ne.output}`,W.type="globstar",W.output=`${H(f)}${N}|${N}${Ht})`,W.value+=X,C.output+=ne.output+W.output,C.globstar=!0,ae(X+be()),ce({type:"slash",value:"/",output:""});continue}if(ne.type==="bos"&&se[0]==="/"){W.type="globstar",W.value+=X,W.output=`(?:^|${N}|${H(f)}${N})`,C.output=W.output,C.globstar=!0,ae(X+be()),ce({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-W.output.length),W.type="globstar",W.output=H(f),W.value+=X,C.output+=W.output,C.globstar=!0,ae(X);continue}const _e={type:"star",value:X,output:te};if(f.bash===!0){_e.output=".*?",(W.type==="bos"||W.type==="slash")&&(_e.output=K+_e.output),ce(_e);continue}if(W&&(W.type==="bracket"||W.type==="paren")&&f.regex===!0){_e.output=X,ce(_e);continue}(C.index===C.start||W.type==="slash"||W.type==="dot")&&(W.type==="dot"?(C.output+=Q,W.output+=Q):f.dot===!0?(C.output+=I,W.output+=I):(C.output+=K,W.output+=K),oe()!=="*"&&(C.output+=_,W.output+=_)),ce(_e)}for(;C.brackets>0;){if(f.strictBrackets===!0)throw new SyntaxError(c("closing","]"));C.output=e.escapeLast(C.output,"["),U("brackets")}for(;C.parens>0;){if(f.strictBrackets===!0)throw new SyntaxError(c("closing",")"));C.output=e.escapeLast(C.output,"("),U("parens")}for(;C.braces>0;){if(f.strictBrackets===!0)throw new SyntaxError(c("closing","}"));C.output=e.escapeLast(C.output,"{"),U("braces")}if(f.strictSlashes!==!0&&(W.type==="star"||W.type==="bracket")&&ce({type:"maybe_slash",value:"",output:`${N}?`}),C.backtrack===!0){C.output="";for(const se of C.tokens)C.output+=se.output!=null?se.output:se.value,se.suffix&&(C.output+=se.suffix)}return C};return u.fastpaths=(l,d)=>{const f={...d},p=typeof f.maxLength=="number"?Math.min(n,f.maxLength):n,h=l.length;if(h>p)throw new SyntaxError(`Input length: ${h}, exceeds maximum allowed length: ${p}`);l=o[l]||l;const{DOT_LITERAL:v,SLASH_LITERAL:b,ONE_CHAR:g,DOTS_SLASH:w,NO_DOT:R,NO_DOTS:k,NO_DOTS_SLASH:A,STAR:N,START_ANCHOR:_}=t.globChars(f.windows),B=f.dot?k:R,z=f.dot?A:R,Q=f.capture?"":"?:",I={negated:!1,prefix:""};let T=f.bash===!0?".*?":N;f.capture&&(T=`(${T})`);const $=K=>K.noglobstar===!0?T:`(${Q}(?:(?!${_}${K.dot?w:v}).)*?)`,L=K=>{switch(K){case"*":return`${B}${g}${T}`;case".*":return`${v}${g}${T}`;case"*.*":return`${B}${T}${v}${g}${T}`;case"*/*":return`${B}${T}${b}${g}${z}${T}`;case"**":return B+$(f);case"**/*":return`(?:${B}${$(f)}${b})?${z}${g}${T}`;case"**/*.*":return`(?:${B}${$(f)}${b})?${z}${T}${v}${g}${T}`;case"**/.*":return`(?:${B}${$(f)}${b})?${v}${g}${T}`;default:{const we=/^(.*?)\.(\w+)$/.exec(K);if(!we)return;const te=L(we[1]);return te?te+v+we[2]:void 0}}},V=e.removePrefix(l,I);let H=L(V);return H&&f.strictSlashes!==!0&&(H+=`${b}?`),H},Hv=u,Hv}var Vv,eC;function cU(){if(eC)return Vv;eC=1;const t=oU(),e=aU(),n=Up(),r=jp(),i=o=>o&&typeof o=="object"&&!Array.isArray(o),s=(o,a,c=!1)=>{if(Array.isArray(o)){const b=o.map(w=>s(w,a,c));return w=>{for(const R of b){const k=R(w);if(k)return k}return!1}}const u=i(o)&&o.tokens&&o.input;if(o===""||typeof o!="string"&&!u)throw new TypeError("Expected pattern to be a non-empty string");const l=a||{},d=l.windows,f=u?s.compileRe(o,a):s.makeRe(o,a,!1,!0),p=f.state;delete f.state;let h=()=>!1;if(l.ignore){const b={...a,ignore:null,onMatch:null,onResult:null};h=s(l.ignore,b,c)}const v=(b,g=!1)=>{const{isMatch:w,match:R,output:k}=s.test(b,f,a,{glob:o,posix:d}),A={glob:o,state:p,regex:f,posix:d,input:b,output:k,match:R,isMatch:w};return typeof l.onResult=="function"&&l.onResult(A),w===!1?(A.isMatch=!1,g?A:!1):h(b)?(typeof l.onIgnore=="function"&&l.onIgnore(A),A.isMatch=!1,g?A:!1):(typeof l.onMatch=="function"&&l.onMatch(A),g?A:!0)};return c&&(v.state=p),v};return s.test=(o,a,c,{glob:u,posix:l}={})=>{if(typeof o!="string")throw new TypeError("Expected input to be a string");if(o==="")return{isMatch:!1,output:""};const d=c||{},f=d.format||(l?n.toPosixSlashes:null);let p=o===u,h=p&&f?f(o):o;return p===!1&&(h=f?f(o):o,p=h===u),(p===!1||d.capture===!0)&&(d.matchBase===!0||d.basename===!0?p=s.matchBase(o,a,c,l):p=a.exec(h)),{isMatch:!!p,match:p,output:h}},s.matchBase=(o,a,c)=>(a instanceof RegExp?a:s.makeRe(a,c)).test(n.basename(o)),s.isMatch=(o,a,c)=>s(a,c)(o),s.parse=(o,a)=>Array.isArray(o)?o.map(c=>s.parse(c,a)):e(o,{...a,fastpaths:!1}),s.scan=(o,a)=>t(o,a),s.compileRe=(o,a,c=!1,u=!1)=>{if(c===!0)return o.output;const l=a||{},d=l.contains?"":"^",f=l.contains?"":"$";let p=`${d}(?:${o.output})${f}`;o&&o.negated===!0&&(p=`^(?!${p}).*$`);const h=s.toRegex(p,a);return u===!0&&(h.state=o),h},s.makeRe=(o,a={},c=!1,u=!1)=>{if(!o||typeof o!="string")throw new TypeError("Expected a non-empty string");let l={negated:!1,fastpaths:!0};return a.fastpaths!==!1&&(o[0]==="."||o[0]==="*")&&(l.output=e.fastpaths(o,a)),l.output||(l=e(o,a)),s.compileRe(l,a,c,u)},s.toRegex=(o,a)=>{try{const c=a||{};return new RegExp(o,c.flags||(c.nocase?"i":""))}catch(c){if(a&&a.debug===!0)throw c;return/$^/}},s.constants=r,Vv=s,Vv}var Kv,tC;function uU(){if(tC)return Kv;tC=1;const t=cU(),e=Up();function n(r,i,s=!1){return i&&(i.windows===null||i.windows===void 0)&&(i={...i,windows:e.isWindows()}),t(r,i,s)}return Object.assign(n,t),Kv=n,Kv}var nC;function lU(){if(nC)return Au;nC=1,Object.defineProperty(Au,"__esModule",{value:!0}),Au.Builder=void 0;const t=Tr,e=sU();var n=null;try{require.resolve("picomatch"),n=uU()}catch{}class r{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:t.sep,filters:[]};globFunction;constructor(s){this.options={...this.options,...s},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(s){return this.options.pathSeparator=s,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(s){return this.options.maxDepth=s,this}withMaxFiles(s){return this.options.maxFiles=s,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:s=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=s,this.withFullPaths()}withAbortSignal(s){return this.options.signal=s,this}normalize(){return this.options.normalizePath=!0,this}filter(s){return this.options.filters.push(s),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(s){return this.options.exclude=s,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(s){return new e.APIBuilder(s||".",this.options)}withGlobFunction(s){return this.globFunction=s,this}crawlWithOptions(s,o){return this.options={...this.options,...o},new e.APIBuilder(s||".",this.options)}glob(...s){return this.globFunction?this.globWithOptions(s):this.globWithOptions(s,{dot:!0})}globWithOptions(s,...o){const a=this.globFunction||n;if(!a)throw new Error("Please specify a glob function to use glob matching.");var c=this.globCache[s.join("\0")];return c||(c=a(s,...o),this.globCache[s.join("\0")]=c),this.options.filters.push(u=>c(u)),this}}return Au.Builder=r,Au}var Yv={},rC;function dU(){return rC||(rC=1,Object.defineProperty(Yv,"__esModule",{value:!0})),Yv}var iC;function fU(){return iC||(iC=1,function(t){var e=Cu.__createBinding||(Object.create?function(i,s,o,a){a===void 0&&(a=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(i,a,c)}:function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]}),n=Cu.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,i,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.fdir=void 0;const r=lU();Object.defineProperty(t,"fdir",{enumerable:!0,get:function(){return r.Builder}}),n(dU(),t)}(Cu)),Cu}var pU=fU();class hU{constructor(){this.encoding="utf-8"}readFile(e){return P0.promises.readFile(e.fsPath,this.encoding)}async readDirectory(e){return(await P0.promises.readdir(e.fsPath,{withFileTypes:!0})).map(r=>({dirent:r,isFile:r.isFile(),isDirectory:r.isDirectory(),uri:Ct.joinPath(e,r.name)}))}}const wt={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},sC={silent:{level:-1},fatal:{level:wt.fatal},error:{level:wt.error},warn:{level:wt.warn},log:{level:wt.log},info:{level:wt.info},success:{level:wt.success},fail:{level:wt.fail},ready:{level:wt.info},start:{level:wt.info},box:{level:wt.info},debug:{level:wt.debug},trace:{level:wt.trace},verbose:{level:wt.verbose}};function Xv(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function Jv(t,e,n=".",r){if(!Xv(e))return Jv(t,{},n);const i=Object.assign({},e);for(const s in t){if(s==="__proto__"||s==="constructor")continue;const o=t[s];o!=null&&(Array.isArray(o)&&Array.isArray(i[s])?i[s]=[...o,...i[s]]:Xv(o)&&Xv(i[s])?i[s]=Jv(o,i[s],(n?`${n}.`:"")+s.toString()):i[s]=o)}return i}function mU(t){return(...e)=>e.reduce((n,r)=>Jv(n,r,""),{})}const gU=mU();function yU(t){return Object.prototype.toString.call(t)==="[object Object]"}function vU(t){return!(!yU(t)||!t.message&&!t.args||t.stack)}let Zv=!1;const oC=[];let En=class _2{options;_lastLog;_mockFn;constructor(e={}){const n=e.types||sC;this.options=gU({...e,defaults:{...e.defaults},level:Qv(e.level,n),reporters:[...e.reporters||[]]},{types:sC,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(const r in n){const i={type:r,...this.options.defaults,...n[r]};this[r]=this._wrapLogFn(i),this[r].raw=this._wrapLogFn(i,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(e){this.options.level=Qv(e,this.options.types,this.options.level)}prompt(e,n){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(e,n)}create(e){const n=new _2({...this.options,...e});return this._mockFn&&n.mockTypes(this._mockFn),n}withDefaults(e){return this.create({...this.options,defaults:{...this.options.defaults,...e}})}withTag(e){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+e:e})}addReporter(e){return this.options.reporters.push(e),this}removeReporter(e){if(e){const n=this.options.reporters.indexOf(e);if(n!==-1)return this.options.reporters.splice(n,1)}else this.options.reporters.splice(0);return this}setReporters(e){return this.options.reporters=Array.isArray(e)?e:[e],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(const e in this.options.types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e].raw}restoreConsole(){for(const e in this.options.types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(e,n){e&&(e.__write||(e.__write=e.write),e.write=r=>{this[n].raw(String(r).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}pauseLogs(){Zv=!0}resumeLogs(){Zv=!1;const e=oC.splice(0);for(const n of e)n[0]._logFn(n[1],n[2])}mockTypes(e){const n=e||this.options.mockFn;if(this._mockFn=n,typeof n=="function")for(const r in this.options.types)this[r]=n(r,this.options.types[r])||this[r],this[r].raw=this[r]}_wrapLogFn(e,n){return(...r)=>{if(Zv){oC.push([this,e,r,n]);return}return this._logFn(e,r,n)}}_logFn(e,n,r){if((e.level||0)>this.level)return!1;const i={date:new Date,args:[],...e,level:Qv(e.level,this.options.types)};!r&&n.length===1&&vU(n[0])?Object.assign(i,n[0]):i.args=[...n],i.message&&(i.args.unshift(i.message),delete i.message),i.additional&&(Array.isArray(i.additional)||(i.additional=i.additional.split(`
164
- `)),i.args.push(`
165
- `+i.additional.join(`
166
- `)),delete i.additional),i.type=typeof i.type=="string"?i.type.toLowerCase():"log",i.tag=typeof i.tag=="string"?i.tag:"";const s=(a=!1)=>{const c=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&c>0){const u=[...this._lastLog.object.args];c>1&&u.push(`(repeated ${c} times)`),this._log({...this._lastLog.object,args:u}),this._lastLog.count=1}a&&(this._lastLog.object=i,this._log(i))};clearTimeout(this._lastLog.timeout);const o=this._lastLog.time&&i.date?i.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=i.date,o<this.options.throttle)try{const a=JSON.stringify([i.type,i.tag,i.args]),c=this._lastLog.serialized===a;if(this._lastLog.serialized=a,c&&(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin)){this._lastLog.timeout=setTimeout(s,this.options.throttle);return}}catch{}s(!0)}_log(e){for(const n of this.options.reporters)n.log(e,{options:this.options})}};function Qv(t,e={},n=3){return t===void 0?n:typeof t=="number"?t:e[t]&&e[t].level!==void 0?e[t].level:n}En.prototype.add=En.prototype.addReporter,En.prototype.remove=En.prototype.removeReporter,En.prototype.clear=En.prototype.removeReporter,En.prototype.withScope=En.prototype.withTag,En.prototype.mock=En.prototype.mockTypes,En.prototype.pause=En.prototype.pauseLogs,En.prototype.resume=En.prototype.resumeLogs;function wU(t={}){return new En(t)}function aC(t){const e=process.cwd()+O0;return t.split(`
167
- `).splice(1).map(n=>n.trim().replace("file://","").replace(e,""))}function bU(t,e){return(e.__write||e.write).call(e,t)}const ew=t=>t?`[${t}]`:"";class cC{formatStack(e,n){const r=" ".repeat((n?.errorLevel||0)+1);return r+aC(e).join(`
168
- ${r}`)}formatError(e,n){const r=e.message??F0(n,e),i=e.stack?this.formatStack(e.stack,n):"",s=n?.errorLevel||0,o=s>0?`${" ".repeat(s)}[cause]: `:"",a=e.cause?`
169
-
170
- `+this.formatError(e.cause,{...n,errorLevel:s+1}):"";return o+r+`
171
- `+i+a}formatArgs(e,n){const r=e.map(i=>i&&typeof i.stack=="string"?this.formatError(i,n):i);return F0(n,...r)}formatDate(e,n){return n.date?e.toLocaleTimeString():""}filterAndJoin(e){return e.filter(Boolean).join(" ")}formatLogObj(e,n){const r=this.formatArgs(e.args,n);return e.type==="box"?`
172
- `+[ew(e.tag),e.title&&e.title,...r.split(`
173
- `)].filter(Boolean).map(i=>" > "+i).join(`
174
- `)+`
175
- `:this.filterAndJoin([ew(e.type),ew(e.tag),r])}log(e,n){const r=this.formatLogObj(e,{columns:n.options.stdout.columns||0,...n.options.formatOptions});return bU(r+`
176
- `,e.level<2?n.options.stderr||process.stderr:n.options.stdout||process.stdout)}}const{env:Ui={},argv:uC=[],platform:DU=""}=typeof process>"u"?{}:process,EU="NO_COLOR"in Ui||uC.includes("--no-color"),RU="FORCE_COLOR"in Ui||uC.includes("--color"),$U=DU==="win32",lC=Ui.TERM==="dumb",TU=Um&&Um.isatty&&Um.isatty(1)&&Ui.TERM&&!lC,SU="CI"in Ui&&("GITHUB_ACTIONS"in Ui||"GITLAB_CI"in Ui||"CIRCLECI"in Ui),kU=!EU&&(RU||$U&&!lC||TU||SU);function dC(t,e,n,r,i=e.slice(0,Math.max(0,t))+r,s=e.slice(Math.max(0,t+n.length)),o=s.indexOf(n)){return i+(o<0?s:dC(o,s,n,r))}function CU(t,e,n,r,i){return t<0?n+e+r:n+dC(t,e,r,i)+r}function AU(t,e,n=t,r=t.length+1){return i=>i||!(i===""||i===void 0)?CU((""+i).indexOf(e,r),i,t,e,n):""}function Ae(t,e,n){return AU(`\x1B[${t}m`,`\x1B[${e}m`,n)}const fC={reset:Ae(0,0),bold:Ae(1,22,"\x1B[22m\x1B[1m"),dim:Ae(2,22,"\x1B[22m\x1B[2m"),italic:Ae(3,23),underline:Ae(4,24),inverse:Ae(7,27),hidden:Ae(8,28),strikethrough:Ae(9,29),black:Ae(30,39),red:Ae(31,39),green:Ae(32,39),yellow:Ae(33,39),blue:Ae(34,39),magenta:Ae(35,39),cyan:Ae(36,39),white:Ae(37,39),gray:Ae(90,39),bgBlack:Ae(40,49),bgRed:Ae(41,49),bgGreen:Ae(42,49),bgYellow:Ae(43,49),bgBlue:Ae(44,49),bgMagenta:Ae(45,49),bgCyan:Ae(46,49),bgWhite:Ae(47,49),blackBright:Ae(90,39),redBright:Ae(91,39),greenBright:Ae(92,39),yellowBright:Ae(93,39),blueBright:Ae(94,39),magentaBright:Ae(95,39),cyanBright:Ae(96,39),whiteBright:Ae(97,39),bgBlackBright:Ae(100,49),bgRedBright:Ae(101,49),bgGreenBright:Ae(102,49),bgYellowBright:Ae(103,49),bgBlueBright:Ae(104,49),bgMagentaBright:Ae(105,49),bgCyanBright:Ae(106,49),bgWhiteBright:Ae(107,49)};function _U(t=kU){return t?fC:Object.fromEntries(Object.keys(fC).map(e=>[e,String]))}const Rn=_U();function PU(t,e="reset"){return Rn[t]||Rn[e]}const xU=[String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");function Bu(t){return t.replace(new RegExp(xU,"g"),"")}const pC={solid:{tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502"},double:{tl:"\u2554",tr:"\u2557",bl:"\u255A",br:"\u255D",h:"\u2550",v:"\u2551"},doubleSingle:{tl:"\u2553",tr:"\u2556",bl:"\u2559",br:"\u255C",h:"\u2500",v:"\u2551"},doubleSingleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2551"},singleThick:{tl:"\u250F",tr:"\u2513",bl:"\u2517",br:"\u251B",h:"\u2501",v:"\u2503"},singleDouble:{tl:"\u2552",tr:"\u2555",bl:"\u2558",br:"\u255B",h:"\u2550",v:"\u2502"},singleDoubleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2550",v:"\u2502"},rounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2502"}},IU={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};function NU(t,e={}){const n={...e,style:{...IU,...e.style}},r=t.split(`
177
- `),i=[],s=PU(n.style.borderColor),o={...typeof n.style.borderStyle=="string"?pC[n.style.borderStyle]||pC.solid:n.style.borderStyle};if(s)for(const p in o)o[p]=s(o[p]);const a=n.style.padding%2===0?n.style.padding:n.style.padding+1,c=r.length+a,u=Math.max(...r.map(p=>p.length))+a,l=u+a,d=n.style.marginLeft>0?" ".repeat(n.style.marginLeft):"";if(n.style.marginTop>0&&i.push("".repeat(n.style.marginTop)),n.title){const p=s?s(n.title):n.title,h=o.h.repeat(Math.floor((u-Bu(n.title).length)/2)),v=o.h.repeat(u-Bu(n.title).length-Bu(h).length+a);i.push(`${d}${o.tl}${h}${p}${v}${o.tr}`)}else i.push(`${d}${o.tl}${o.h.repeat(l)}${o.tr}`);const f=n.style.valign==="center"?Math.floor((c-r.length)/2):n.style.valign==="top"?c-r.length-a:c-r.length;for(let p=0;p<c;p++)if(p<f||p>=f+r.length)i.push(`${d}${o.v}${" ".repeat(l)}${o.v}`);else{const h=r[p-f],v=" ".repeat(a),b=" ".repeat(u-Bu(h).length);i.push(`${d}${o.v}${v}${h}${b}${o.v}`)}return i.push(`${d}${o.bl}${o.h.repeat(l)}${o.br}`),n.style.marginBottom>0&&i.push("".repeat(n.style.marginBottom)),i.join(`
178
- `)}const Gp=Object.create(null),zu=t=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?Gp:globalThis),Gi=new Proxy(Gp,{get(t,e){return zu()[e]??Gp[e]},has(t,e){const n=zu();return e in n||e in Gp},set(t,e,n){const r=zu(!0);return r[e]=n,!0},deleteProperty(t,e){if(!e)return!1;const n=zu(!0);return delete n[e],!0},ownKeys(){const t=zu(!0);return Object.keys(t)}}),OU=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",FU=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function LU(){if(globalThis.process?.env)for(const t of FU){const e=t[1]||t[0];if(globalThis.process?.env[e])return{name:t[0].toLowerCase(),...t[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}const hC=LU();hC.name;function Hs(t){return t?t!=="false":!1}const MU=globalThis.process?.platform||"",BU=Hs(Gi.CI)||hC.ci!==!1,zU=Hs(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),qU=Hs(Gi.DEBUG),mC=OU==="test"||Hs(Gi.TEST);Hs(Gi.MINIMAL);const jU=/^win/i.test(MU);!Hs(Gi.NO_COLOR)&&(Hs(Gi.FORCE_COLOR)||(zU||jU)&&Gi.TERM);const UU=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(UU?.split(".")[0]);const GU=globalThis.process||Object.create(null),gC={versions:{}};new Proxy(GU,{get(t,e){if(e==="env")return Gi;if(e in t)return t[e];if(e in gC)return gC[e]}});const WU=globalThis.process?.release?.name==="node",HU=!!globalThis.Bun||!!globalThis.process?.versions?.bun,VU=!!globalThis.Deno,KU=!!globalThis.fastly,YU=!!globalThis.Netlify,XU=!!globalThis.EdgeRuntime,JU=globalThis.navigator?.userAgent==="Cloudflare-Workers",ZU=[[YU,"netlify"],[XU,"edge-light"],[JU,"workerd"],[KU,"fastly"],[VU,"deno"],[HU,"bun"],[WU,"node"]];function QU(){const t=ZU.find(e=>e[0]);if(t)return{name:t[1]}}const eG=QU();eG?.name;function tG({onlyFirst:t=!1}={}){const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}const nG=tG();function rG(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(nG,"")}function iG(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function sG(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function oG(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t===94192||t===94193||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101631&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129673||t>=129679&&t<=129734||t>=129742&&t<=129756||t>=129759&&t<=129769||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}function aG(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function cG(t,{ambiguousAsWide:e=!1}={}){return aG(t),sG(t)||oG(t)||e&&iG(t)?2:1}const uG=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,lG=globalThis.Intl?.Segmenter?new Intl.Segmenter:{segment:t=>t.split("")},dG=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function fG(t,e={}){if(typeof t!="string"||t.length===0)return 0;const{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=e;if(r||(t=rG(t)),t.length===0)return 0;let i=0;const s={ambiguousAsWide:!n};for(const{segment:o}of lG.segment(t)){const a=o.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!dG.test(o)){if(uG().test(o)){i+=2;continue}i+=cG(a,s)}}return i}function yC(){const{env:t}=ot,{TERM:e,TERM_PROGRAM:n}=t;return ot.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||n==="Terminus-Sublime"||n==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const pG={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},hG={0:"red",1:"yellow"},mG=yC(),Fr=(t,e)=>mG?t:e,vC={error:Fr("\u2716","\xD7"),fatal:Fr("\u2716","\xD7"),ready:Fr("\u2714","\u221A"),warn:Fr("\u26A0","\u203C"),info:Fr("\u2139","i"),success:Fr("\u2714","\u221A"),debug:Fr("\u2699","D"),trace:Fr("\u2192","\u2192"),fail:Fr("\u2716","\xD7"),start:Fr("\u25D0","o"),log:""};function wC(t){return typeof Intl!="object"||!Intl.Segmenter?Bu(t).length:fG(t)}class gG extends cC{formatStack(e,n){const r=" ".repeat((n?.errorLevel||0)+1);return`
179
- ${r}`+aC(e).map(i=>" "+i.replace(/^at +/,s=>Rn.gray(s)).replace(/\((.+)\)/,(s,o)=>`(${Rn.cyan(o)})`)).join(`
180
- ${r}`)}formatType(e,n,r){const i=pG[e.type]||hG[e.level]||"gray";if(n)return vG(i)(Rn.black(` ${e.type.toUpperCase()} `));const s=typeof vC[e.type]=="string"?vC[e.type]:e.icon||e.type;return s?yG(i)(s):""}formatLogObj(e,n){const[r,...i]=this.formatArgs(e.args,n).split(`
181
- `);if(e.type==="box")return NU(Wp(r+(i.length>0?`
182
- `+i.join(`
183
- `):"")),{title:e.title?Wp(e.title):void 0,style:e.style});const s=this.formatDate(e.date,n),o=s&&Rn.gray(s),a=e.badge??e.level<2,c=this.formatType(e,a,n),u=e.tag?Rn.gray(e.tag):"";let l;const d=this.filterAndJoin([c,Wp(r)]),f=this.filterAndJoin(n.columns?[u,o]:[u]),p=(n.columns||0)-wC(d)-wC(f)-2;if(l=p>0&&(n.columns||0)>=80?d+" ".repeat(p)+f:(f?`${Rn.gray(`[${f}]`)} `:"")+d,l+=Wp(i.length>0?`
184
- `+i.join(`
185
- `):""),e.type==="trace"){const h=new Error("Trace: "+e.message);l+=this.formatStack(h.stack||"")}return a?`
186
- `+l+`
187
- `:l}}function Wp(t){return t.replace(/`([^`]+)`/gm,(e,n)=>Rn.cyan(n)).replace(/\s+_([^_]+)_\s+/gm,(e,n)=>` ${Rn.underline(n)} `)}function yG(t="white"){return Rn[t]||Rn.white}function vG(t="bgWhite"){return Rn[`bg${t[0].toUpperCase()}${t.slice(1)}`]||Rn.bgWhite}function bC(t={}){let e=wG();return process.env.CONSOLA_LEVEL&&(e=Number.parseInt(process.env.CONSOLA_LEVEL)??e),wU({level:e,defaults:{level:e},stdout:process.stdout,stderr:process.stderr,prompt:(...n)=>import("../chunks/prompt.mjs").then(r=>r.prompt(...n)),reporters:t.reporters||[t.fancy??!(BU||mC)?new gG:new cC],...t})}function wG(){return qU?wt.debug:mC?wt.warn:wt.info}bC();const bG=t=>{tw.forEach(e=>{DG(t,e)})},tw=["name","message","stack","cause","errors"],DG=(t,e)=>{const n=nw(t,e);if(n!==void 0){if(EG(n)){Ei(t,e,t[e]);return}RG(n)&&DC(t,e,n)}},nw=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?void 0:nw(r,e)},EG=({get:t,set:e})=>t!==void 0&&e===void 0,RG=({enumerable:t,writable:e})=>t||!e,Ei=(t,e,n)=>{DC(t,e,{value:n})},DC=(t,e,n)=>{Object.defineProperty(t,e,{...n,..."get"in n||"set"in n?{}:{writable:!0},enumerable:!1,configurable:!0})},$G=(t,e)=>{if(Array.isArray(t.errors)){const n=t.errors.filter(TG).map(e).filter(Boolean);Ei(t,"errors",n)}else SG(t)?Ei(t,"errors",[]):t.errors!==void 0&&kG(t)},TG=t=>t!==void 0,SG=t=>"AggregateError"in globalThis&&(t.name==="AggregateError"||t instanceof AggregateError),kG=t=>{delete t.errors,t.errors!==void 0&&Ei(t,"errors",[])},CG=(t,e)=>{if(!("cause"in t))return;const n=t.cause===void 0?t.cause:e(t.cause);n===void 0?delete t.cause:Ei(t,"cause",n)},AG=t=>_G(t)||PG(t),_G=t=>{try{return t instanceof Error}catch{return!1}},PG=t=>{try{return xG.has(Object.prototype.toString.call(t))}catch{return!1}},xG=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]);function Hp(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}const IG=t=>!Object.isExtensible(t)||tw.some(e=>NG(t,e)||OG(t,e)),NG=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);return n!==void 0&&!n.configurable},OG=(t,e)=>{try{return t[e],!1}catch{return!0}},rw=t=>{const e=FG(t.message,t.name);Ei(t,"stack",e)},FG=(t="",e="Error")=>{const n=LG(e),{stack:r}=new n(t);return typeof r=="string"&&r!==""?r:`${e}: ${t}`},LG=t=>{const e={value:t,enumerable:!1,writable:!0,configurable:!0},n=Object.defineProperty(class extends Error{},"name",e);return Object.defineProperty(n.prototype,"name",e),n},MG=t=>{const e={};for(const n of BG(t))try{const r=t[n],{enumerable:i,configurable:s,writable:o=!0}=nw(t,n);Object.defineProperty(e,n,{value:r,enumerable:i,configurable:s,writable:o})}catch{}return e},BG=t=>{const e=zG(t);for(const n of tw)qG(t,n)&&e.push(n);return e},zG=t=>{try{return Reflect.ownKeys(t)}catch{return[]}},qG=(t,e)=>{try{return e in t&&!Object.hasOwn(t,e)}catch{return!1}},EC=t=>{const{name:e,message:n,stack:r,cause:i,errors:s,...o}=MG(t),a=jG(n,o),c=HG(e,a);return n===a&&VG(c,o),Object.entries({name:e,stack:r,cause:i,errors:s}).forEach(([u,l])=>{KG(c,u,l)}),r===void 0&&rw(c),c},jG=(t,e)=>typeof t=="string"&&t!==""?t:WG(UG(e)),UG=t=>{try{return JSON.stringify(t)}catch{return GG(t)}},GG=t=>{try{return String(t)}catch{return"Invalid error"}},WG=t=>t.length<RC?t:`${t.slice(0,RC)}...`,RC=1e3,HG=(t,e)=>t==="AggregateError"&&"AggregateError"in globalThis?new AggregateError([],e):t in $C?new $C[t](e):new Error(e),$C={Error,ReferenceError,TypeError,SyntaxError,RangeError,URIError,EvalError},VG=(t,e)=>{for(const n in e)n in t||(t[n]=e[n])},KG=(t,e,n)=>{n!==void 0&&Ei(t,e,n)},YG=t=>{try{const e=new Error(String(t));return rw(e),e}catch(e){return e}},{toString:XG}=Object.prototype,JG=t=>ZG(t)?EC(t):AG(t)?QG(t)?EC(t):t:YG(t),ZG=t=>{try{return Hp(t)}catch{return!1}},QG=t=>eW(t)||IG(t)||tW(t),eW=t=>{try{return XG.call(t)==="[object Object]"}catch{return!0}},tW=t=>typeof t.constructor!="function"||typeof t.constructor.name!="string"||t.constructor.name===""||t.constructor.prototype!==Object.getPrototypeOf(t),Vp=(t,{shallow:e=!1}={})=>TC(t,[],e),TC=(t,e,n)=>{if(e.includes(t))return;const r=n?nW:s=>TC(s,[...e,t],n),i=JG(t);return rW(i,r),i},nW=t=>t,rW=(t,e)=>{iW(t),sW(t),oW(t),CG(t,e),$G(t,e),bG(t)},iW=t=>{if(Kp(t.name))return;const e=Object.getPrototypeOf(t).name,n=Kp(e)?e:t.constructor.name;Ei(t,"name",n)},sW=t=>{Kp(t.message)||Ei(t,"message","")},oW=t=>{Kp(t.stack)||rw(t)},Kp=t=>typeof t=="string"&&t!=="",aW=(t,e,n=t.name)=>{if(cW(e),typeof n!="string")throw new TypeError(`currentName must be a string: ${n}`);return n},cW=t=>{if(!uW(t))throw new TypeError(`ErrorClass must be a class: ${t}`);if(!SC(t.prototype))throw new TypeError(`ErrorClass must inherit from Error: ${t}`);if(!lW(t))throw new TypeError(`ErrorClass must be have a valid constructor: ${t}`)},uW=t=>typeof t=="function"&&typeof t.prototype=="object"&&t.prototype!==null,SC=t=>t!==null&&(t.name==="Error"||SC(Object.getPrototypeOf(t))),lW=t=>typeof t.prototype.constructor=="function",kC=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},dW=(t,e)=>{Object.getPrototypeOf(t)!==e.prototype&&(fW(t,e),_C(t,"constructor"),pW(t,e))},fW=(t,e)=>{Object.setPrototypeOf(t,e.prototype)},pW=(t,e)=>{_C(t,"name");const n=CC(e.prototype);t.name!==n&&kC(t,"name",n)},CC=t=>hW(t)??mW(t)??CC(Object.getPrototypeOf(t)),hW=t=>Object.hasOwn(t,"name")&&AC(t.name)?t.name:void 0,mW=t=>typeof t.constructor=="function"&&AC(t.constructor.name)?t.constructor.name:void 0,AC=t=>typeof t=="string"&&t!=="",_C=(t,e)=>{Object.hasOwn(t,e)&&delete t[e]},gW=(t,e)=>{if(!yW(t,e))return;const n=wW(t,e);kC(t,"stack",n)},yW=(t,e)=>e!==t.name&&e!==""&&t.stack.includes(e)&&vW(),vW=()=>{class t extends Error{}const e={value:PC,enumerable:!1,writable:!0,configurable:!0};Object.defineProperty(t,"name",e),Object.defineProperty(t.prototype,"name",e);const{stack:n}=new t("");return typeof n=="string"&&n.includes(PC)},PC="SetErrorClassError",wW=({name:t,stack:e},n)=>{if(e.startsWith(`${n}: `))return e.replace(n,t);const r=bW(n,t),[i,s]=r.find(([o])=>e.includes(o));return e.replace(i,s)},bW=(t,e)=>[[`
188
- ${t}: `,`
189
- ${e}: `],[`${t}: `,`${e}: `],[`${t} `,`${e} `],[t,e]],DW=(t,e,n)=>{const r=Vp(t),i=aW(r,e,n);return dW(r,e),gW(r,i),r},EW=(t,e)=>e.configurable===!1?RW(t,e):SW(t,e),RW=(t,e)=>({...e,...$W(t,e),...TW(t,e)}),$W=(t,e)=>e.writable===!0&&t.writable===!1?{writable:!1}:{},TW=(t,e)=>t.hasValue&&"value"in e&&e.writable===!0?{value:t.value}:{},SW=(t,e)=>{const n=qu(t.enumerable,e.enumerable,!0),r=qu(t.writable,e.writable,!0),i=qu(t.configurable,e.configurable,!0);return{...kW(t,e,r),enumerable:n,configurable:i}},kW=(t,e,n)=>t.hasValue?{value:t.value,writable:n}:!xC(t)&&!xC(e)?{value:e.value,writable:n}:{get:qu(t.get,e.get),set:qu(t.set,e.set)},xC=({get:t,set:e})=>t!==void 0||e!==void 0,qu=(t,e,n)=>t??e??n,CW=(t,e,n)=>{if(!AW(t))throw new TypeError(`Argument must be an object: ${t}`);if(!_W(e))throw new TypeError(`Property key must be a string, a symbol or an integer: ${e}`);return PW(n)},AW=t=>typeof t=="object"&&t!==null,_W=t=>{const e=typeof t;return e==="string"||e==="symbol"||e==="number"},PW=t=>{if(!Hp(t))throw new TypeError(`Descriptor must be a plain object: ${t}`);const{enumerable:e,writable:n,configurable:r,value:i,get:s,set:o,...a}=t,c="value"in t;return xW({enumerable:e,writable:n,configurable:r,get:s,set:o,unknownProps:a,hasValue:c}),{enumerable:e,writable:n,configurable:r,value:i,get:s,set:o,hasValue:c}},xW=({enumerable:t,writable:e,configurable:n,get:r,set:i,unknownProps:s,hasValue:o})=>{IC(o,r,"get"),IC(o,i,"set"),iw(t,"enumerable"),iw(e,"writable"),iw(n,"configurable"),NW(s)},IC=(t,e,n)=>{if(IW(e,n),t&&e!==void 0)throw new TypeError(`Descriptor property "value" and "${n}" must not both be defined: ${e}`)},IW=(t,e)=>{if(t!==void 0&&typeof t!="function")throw new TypeError(`Descriptor property "${e}" must be a function: ${t}`)},iw=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`Descriptor property "${e}" must be a boolean: ${t}`)},NW=t=>{const[e]=Object.keys(t);if(e!==void 0)throw new TypeError(`Unknown descriptor property "${e}": ${t[e]}`)},OW=(t,e,n)=>{const r=CW(t,e,n),i=NC(t,e),s=EW(r,i);return FW(t,e,s),t},NC=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?{}:NC(r,e)},FW=(t,e,n)=>{try{Object.defineProperty(t,e,n)}catch{}},LW=(t,e,n)=>{if(n!==void 0)return OC(t,e,n);try{delete t[e]}catch{}if(t[e]!==void 0)return OC(t,e)},OC=(t,e,n)=>{const r=MW(e);OW(t,e,{value:n,...r})},MW=t=>typeof t=="string"&&t.startsWith("_")?{enumerable:!1}:{},BW=t=>zW(t)||qW(t),zW=t=>{try{return t instanceof Error}catch{return!1}},qW=t=>{try{return jW.has(Object.prototype.toString.call(t))}catch{return!1}},jW=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]),UW=(t,e,n={})=>{if(FC(t,"First argument"),FC(e,"Second argument"),!Hp(n))throw new TypeError(`Options must be a plain object: ${n}`);const{soft:r=!1}=n;if(typeof r!="boolean")throw new TypeError(`Option "soft" must be a boolean: ${r}`);return{soft:r}},FC=(t,e)=>{if(t===void 0)throw new TypeError(`${e} is required.`);if(!GW(t))throw new TypeError(`${e} must be a plain object or an error: ${t}`)},GW=t=>Hp(t)||BW(t),WW=({error:t,props:e,propName:n,soft:r})=>HW(n)||!YW.call(e,n)||r&&t[n]!==void 0,HW=t=>t in VW||KW.has(t),VW=new Error("check"),KW=new Set(["prototype","errors","cause"]),{propertyIsEnumerable:YW}=Object.prototype,XW=(t,e,n)=>{const{soft:r}=UW(t,e,n);for(const i of Reflect.ownKeys(e))JW({error:t,props:e,propName:i,soft:r});return t},JW=({error:t,props:e,propName:n,soft:r})=>{WW({error:t,props:e,propName:n,soft:r})||LW(t,n,e[n])},Yp=(t,e,n)=>{Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!1,configurable:!0})},ZW=(t,e)=>{if(t.errors===void 0)return;const n=t.errors.map(r=>e(r).error).filter(Boolean);Yp(t,"errors",n)},QW=({target:t,source:e,parent:n,child:r})=>{if(!LC(t)){eH(t,e);return}LC(e)&&Yp(t,"errors",[...r.errors,...n.errors])},eH=(t,e)=>{e.errors!==void 0&&Yp(t,"errors",e.errors)},LC=t=>t.errors!==void 0&&t.errors.length!==0,tH=(t,e,n=t.message)=>{if(typeof e!="string")throw new TypeError(`newMessage must be a string: ${e}`);if(typeof n!="string")throw new TypeError(`currentMessage must be a string: ${n}`);return n},nH=({name:t,stack:e},n,r)=>r!==""&&e.includes(r)?rH({name:t,stack:e,newMessage:n,currentMessage:r}):sH(t,e,n),rH=({name:t,stack:e,newMessage:n,currentMessage:r})=>{const i=iH(t,n,r),[s,o]=i.find(([a])=>e.includes(a));return e.replace(s,o)},iH=(t,e,n)=>[[`${t}: ${n}`,`${t}: ${e}`],[`: ${n}`,`: ${e}`],[`
190
- ${n}`,`
191
- ${e}`],[` ${n}`,` ${e}`],[n,e]],sH=(t,e,n)=>{const r=`${t}: `,i=n.trimEnd();return e===t||e.startsWith(`${t}
192
- `)?e.replace(t,`${r}${i}`):e.startsWith(r)?e.replace(r,`${r}${i}
193
- `):`${r}${i}
194
- ${e}`},oH=(t,e,n)=>{const r=Vp(t),i=tH(r,e,n);return BC(r,"message",e),aH(r,e,i),r},aH=(t,e,n)=>{if(e===n||!cH())return;const r=nH(t,e,n);BC(t,"stack",r)},cH=()=>{const{stack:t}=new Error(MC);return typeof t=="string"&&t.includes(MC)},MC="set-error-message test message",BC=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},zC=(t,e,n)=>{if(typeof e!="string")throw new TypeError(`Second argument must be a message string: ${e}`);const r=Vp(t),i=uH(e,r.message);return oH(r,i,n)},uH=(t,e)=>{const n=t.trim(),r=e.trim();return n===""?r:r===""?n:lH(n,r,t)},lH=(t,e,n)=>t.endsWith(dH)?n.endsWith(fH)?`${t}
195
- ${e}`:`${t} ${e}`:`${e}
196
- ${t}`,dH=":",fH=`
197
- `,pH=({parent:t,child:e,target:n,stackError:r})=>{const i=t.message;return n.message=e.message,zC(n,i,r.message)},hH=(t,e)=>qC(t)===e,qC=t=>typeof t=="object"&&t!==null?t.stack:void 0,mH=({wrap:t,target:e,source:n,childHasStack:r})=>t===r?e:(Yp(e,"stack",n.stack),n),gH=t=>{const{wrap:e,name:n}=t;return typeof e!="boolean"?n==="Error":(Object.hasOwn(t,"wrap")&&delete t.wrap,e)},yH=t=>jC(t,[]).error,jC=(t,e)=>{if(e.includes(t))return{};const n=c=>jC(c,[...e,t]),r=qC(t),i=Vp(t,{shallow:!0}),s=hH(i,r);ZW(i,n);const{parent:o,childHasStack:a}=vH(i,n);return{error:o,errorHasStack:s||a}},vH=(t,e)=>{const n=gH(t);if(t.cause===void 0)return{parent:t,childHasStack:!1};const{error:r,errorHasStack:i}=e(t.cause);return delete t.cause,{parent:wH({parent:t,child:r,childHasStack:i,wrap:n}),childHasStack:i}},wH=({parent:t,child:e,childHasStack:n,wrap:r})=>{if(e===void 0)return t;const[i,s]=r?[e,t]:[t,e],o=mH({wrap:r,target:i,source:s,childHasStack:n}),a=DW(i,i.constructor,o.name),c=pH({parent:t,child:e,target:a,stackError:o});return QW({target:c,source:s,parent:t,child:e}),XW(c,s,{soft:!r})};function UC(t){return function(e,n){if(typeof n?.toJSON=="function"&&(n=n.toJSON()),!(n!==null&&typeof n=="object"))return n;if(t.has(n))return"[Circular]";t.add(n);const r=Array.isArray(n)?[]:{};for(const[i,s]of Object.entries(n))r[i]=UC(t)(i,s);return t.delete(n),r}}function GC(t,{indentation:e}={}){return JSON.stringify(t,UC(new WeakSet),e)}const bH=t=>t.split(`
198
- `).map(e=>e.trim().replace("file://",""));function DH(t,e=bH){const n={message:""},r=t.args.find(s=>s instanceof Error);if(!r)return n.message=t.args.map(s=>typeof s=="string"?s:GC(s)).join("; "),typeof t.tag=="string"&&t.tag.length>0&&(n.message=`[${t.tag}] ${n.message}`),n;const i=t.args.reduce((s,o)=>{if(o===r)return s;const a=typeof o=="string"?o:GC(o);return zC(s,a)},yH(r));if(n.message=i.message,n.error={message:i.message,name:i.name},i.stack){const s=e(i.stack);n.error.stack=s.join(`
199
- `),n.message+=`
200
- `+s.slice(1).map(o=>" "+o).join(`
201
- `)}return typeof t.tag=="string"&&t.tag.length>0&&(n.message=`[${t.tag}] ${n.message}`),n}function EH(t){const e=X2()+O0;return t.split(`
202
- `).map(n=>n.trim().replace("file://","").replace(e,""))}function RH(t){return DH(t,EH)}const WC=wt.debug,xt=bC({level:WC,defaults:{level:WC},throttle:2,throttleMin:500,formatOptions:{colors:!0,compact:!1,date:!1}}),Fe=xt.withTag("lsp");function HC(t){Fe.error(t)}function ve(t){if(t instanceof Error){Fe.warn(t.stack??t.message);return}Fe.warn(t)}function $H(t){Fe.level=wt[t]}function TH(t){const e={log:(n,r)=>{const{message:i,error:s}=RH(n);switch(n.type){case"silent":break;case"verbose":case"trace":{t.tracer.log(i);break}case"debug":{t.console.debug(i);break}case"log":{t.console.log(i);break}case"info":case"box":case"ready":case"start":case"success":{t.console.info(i);break}case"warn":{t.console.warn(i);break}case"fail":case"error":case"fatal":{t.console.error(i),s?t.telemetry.logEvent({eventName:"error",...s}):t.telemetry.logEvent({eventName:"error",message:i});break}default:Oe(n.type)}}};xt.setReporters([e]),Fe.setReporters(xt.options.reporters)}const SH={fileSystemProvider:()=>new kH};let kH=class extends hU{async readDirectory(e){const n=await new pU.fdir().withSymlinks().withFullPaths().crawl(e.fsPath).withPromise(),r=[];for(const i of n)try{const s=await Y2(i);r.push({isFile:s.isFile(),isDirectory:s.isDirectory(),uri:Zt.file(i)})}catch(s){Fe.error(s)}return r}};function VC(t){return typeof t=="object"&&t!==null&&typeof t.id=="string"}function sw(t){return typeof t=="object"&&t!==null&&t.$$type==="Node"&&typeof t.id=="string"}function KC(t){return sw(t)||VC(t)}function ju(t){return typeof t=="string"||KC(t)}function CH(t){return Array.isArray(t)&&t.every(ju)}function AH(t){return["n","ne","e","se","s","sw","w","nw","c"].includes(t)}function YC(t){if(KC(t))return t;const[e,n,r]=t.split(":");return AH(r)?{id:e,port:n,compass:r}:{id:e,port:n}}function _H(t){if(t.length<2&&(ju(t[0])&&ju(t[1]))===!1)throw Error("EdgeTargets must have at least 2 elements.");return t.map(e=>YC(e))}const Xp=Object.seal({Graph:null,Digraph:null,Subgraph:null,Node:null,Edge:null});function PH(t){return Object.assign(Object.seal(Object.assign({},Xp)),t)}function xH(...t){const[e,...n]=t;return(...r)=>n.reduce((i,s)=>s(i),e(...r))}function nr(t,...e){return xH(t,...e)}const IH=t=>(...e)=>n=>t(n,...e),NH=t=>({[Symbol.iterator]:t}),yr=IH((t,e)=>Array.from(NH(function*(){for(const n of t)yield e(n)})));class XC{options;getLocation(){return this.options?.locationFunction?.()??null}constructor(e){this.options=e}createElement(e,n,r=[]){return{location:this.getLocation(),...n,type:e,children:r}}}const Qe=XC.prototype.createElement.bind(new XC),OH=/\r?\n/;function vr(t){return e=>e.join(t)}function FH(t){return e=>t+e+t}function Wi(t,e){return n=>t+n+e}function Jp(t){return e=>t+e}const JC=t=>t.replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/"/g,'\\"'),Zp=t=>t.split(OH),Uu=(t,e,n)=>nr(Zp,yr(Jp(t==="space"?" ".repeat(e):`
203
- `)),vr(n)),Vs=t=>{switch(t){case"crlf":return`\r
204
- `;case"lf":return`
205
- `}},LH={match(t){return t.type==="AttributeList"},print(t,e){if(e.children.length===0)return`${e.kind.toLocaleLowerCase()} [];`;const n=Vs(t.endOfLine);return nr(yr(t.print),vr(n),Uu(t.indentStyle,t.indentSize,n),Wi(`${e.kind.toLocaleLowerCase()} [${n}`,`${n}];`))(e.children)}},MH={match(t){return t.type==="Attribute"},print(t,e){return`${t.print(e.key)} = ${t.print(e.value)};`}},BH={match(t){return t.type==="Comment"},print(t,e){const n=Vs(t.endOfLine);switch(e.kind){case"Block":return nr(Zp,yr(Jp(" * ")),vr(n),Wi(`/**${n}`,`${n} */`))(e.value);case"Macro":return nr(Zp,yr(Jp("# ")),vr(n))(e.value);case"Slash":default:return nr(Zp,yr(Jp("// ")),vr(n))(e.value)}}},zH={match(t){return t.type==="Dot"},print(t,e){return e.children.map(t.print).join(Vs(t.endOfLine))}},qH={match(t){return t.type==="Edge"},print(t,e){const n=nr(yr(t.print),vr(t.directed?" -> ":" -- "))(e.targets);if(e.children.length===0)return`${n};`;const r=Vs(t.endOfLine),i=nr(yr(t.print),vr(r),Uu(t.indentStyle,t.indentSize,r),Wi(`[${r}`,`${r}];`))(e.children);return`${n} ${i}`}},jH={match(t){return t.type==="Graph"},print(t,e){t.directed=e.directed;const n=[];if(e.strict&&n.push("strict"),n.push(e.directed?"digraph":"graph"),e.id&&n.push(t.print(e.id)),e.children.length===0)return`${n.join(" ")} {}`;const r=Vs(t.endOfLine),i=nr(yr(t.print),vr(r),Uu(t.indentStyle,t.indentSize,r),Wi(`{${r}`,`${r}}`))(e.children);return`${n.join(" ")} ${i}`}},UH=nr(JC,FH('"')),GH=Wi("<",">"),WH={match(t){return t.type==="Literal"},print(t,e){switch(e.quoted){case"html":return GH(e.value);case!0:return UH(e.value);case!1:default:return JC(e.value)}}},HH={match(t){return t.type==="Node"},print(t,e){const n=t.print(e.id);if(e.children.length===0)return`${n};`;const r=Vs(t.endOfLine),i=nr(yr(t.print),vr(r),Uu(t.indentStyle,t.indentSize,r),Wi(`[${r}`,`${r}];`))(e.children);return`${n} ${i}`}},VH={match(t){return t.type==="NodeRefGroup"},print(t,e){return nr(yr(t.print),vr(" "),Wi("{","}"))(e.children)}},KH={match(t){return t.type==="NodeRef"},print(t,e){const n=[t.print(e.id)];return e.port&&n.push(t.print(e.port)),e.compass&&n.push(t.print(e.compass)),n.join(":")}},YH={match(t){return t.type==="Subgraph"},print(t,e){const n=["subgraph"];if(e.id&&n.push(t.print(e.id)),e.children.length===0)return`${n.join(" ")} {}`;const r=Vs(t.endOfLine),i=nr(yr(t.print),vr(r),Uu(t.indentStyle,t.indentSize,r),Wi(`{${r}`,`${r}}`))(e.children);return`${n.join(" ")} ${i}`}},XH=[LH,MH,BH,zH,qH,jH,WH,HH,VH,KH,YH];class JH{options;#e=[...XH];constructor(e={}){this.options=e}print(e){const n=[...this.#e],{indentSize:r=2,indentStyle:i="space",endOfLine:s="lf"}=this.options,o={directed:!0,indentSize:r,indentStyle:i,endOfLine:s,print(a){for(const c of n)if(c.match(a))return c.print(o,a);throw Error()}};return o.print(e)}}function ZH(t,e){const n=new JH(e).print(t);if(!n)throw new Error;return n}function Qp(t,e){if(typeof e=="string"){const n=e.trim();return/^<.+>$/ms.test(n)?Qe("Attribute",{key:Qe("Literal",{value:t,quoted:!1},[]),value:Qe("Literal",{value:n.slice(1,n.length-1),quoted:"html"},[])},[]):Qe("Attribute",{key:Qe("Literal",{value:t,quoted:!1},[]),value:Qe("Literal",{value:e,quoted:!0},[])},[])}return Qe("Attribute",{key:Qe("Literal",{value:t,quoted:!1},[]),value:Qe("Literal",{value:String(e),quoted:!1},[])},[])}function Ks(t,e){return Qe("Comment",{kind:e,value:t},[])}function ZC(t,e){return Array.from(function*(){for(const[n,r]of e.values)yield Qp(n,r);for(const n of Object.values(e.attributes))n.size>0&&(n.comment&&(yield Ks(n.comment,t.commentKind)),yield t.convert(n));for(const n of e.nodes)n.comment&&(yield Ks(n.comment,t.commentKind)),yield t.convert(n);for(const n of e.subgraphs)n.comment&&(yield Ks(n.comment,t.commentKind)),yield t.convert(n);for(const n of e.edges)n.comment&&(yield Ks(n.comment,t.commentKind)),yield t.convert(n)}())}const QH={match(t){return t.$$type==="AttributeList"},convert(t,e){return Qe("AttributeList",{kind:e.$$kind},e.values.map(([n,r])=>Qp(n,r)))}},eV={match(t){return t.$$type==="Edge"},convert(t,e){return Qe("Edge",{targets:e.targets.map(n=>sw(n)?Qe("NodeRef",{id:Qe("Literal",{value:n.id,quoted:!0},[])},[]):VC(n)?Qe("NodeRef",{id:Qe("Literal",{value:n.id,quoted:!0},[]),port:n.port?Qe("Literal",{value:n.port,quoted:!0},[]):void 0,compass:n.compass?Qe("Literal",{value:n.compass,quoted:!0},[]):void 0},[]):Qe("NodeRefGroup",{},n.map(r=>sw(r)?Qe("NodeRef",{id:Qe("Literal",{value:r.id,quoted:!0},[])},[]):Qe("NodeRef",{id:Qe("Literal",{value:r.id,quoted:!0},[]),port:r.port?Qe("Literal",{value:r.port,quoted:!0},[]):void 0,compass:r.compass?Qe("Literal",{value:r.compass,quoted:!0},[]):void 0},[]))))},[...e.attributes.comment?[Ks(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([n,r])=>Qp(n,r))])}},tV={match(t){return t.$$type==="Graph"},convert(t,e){return Qe("Dot",{},[...e.comment?[Ks(e.comment,t.commentKind)]:[],Qe("Graph",{directed:e.directed,strict:e.strict,id:e.id?Qe("Literal",{value:e.id,quoted:!0},[]):void 0},ZC(t,e))])}},nV={match(t){return t.$$type==="Node"},convert(t,e){return Qe("Node",{id:Qe("Literal",{value:e.id,quoted:!0},[])},[...e.attributes.comment?[Ks(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([n,r])=>Qp(n,r))])}},rV={match(t){return t.$$type==="Subgraph"},convert(t,e){return Qe("Subgraph",{id:e.id?Qe("Literal",{value:e.id,quoted:!0},[]):void 0},ZC(t,e))}},iV=[QH,eV,nV,tV,rV];class sV{options;#e=[...iV];constructor(e={}){this.options=e}convert(e){const n=[...this.#e],{commentKind:r="Slash"}=this.options,i={commentKind:r,convert(s){for(const o of n)if(o.match(s))return o.convert(i,s);throw Error()}};return i.convert(e)}}function oV(t,e){return new sV(e).convert(t)}const F=new Proxy(Object.freeze({}),{get:(t,e)=>e});class ow{}class aw extends ow{#e=new Map;constructor(e){super(),e!==void 0&&this.apply(e)}get values(){return Array.from(this.#e.entries())}get size(){return this.#e.size}get(e){return this.#e.get(e)}set(e,n){n!=null&&this.#e.set(e,n)}delete(e){this.#e.delete(e)}apply(e){const n=Array.isArray(e)?e:Object.entries(e);for(const[r,i]of n)this.set(r,i)}clear(){this.#e.clear()}}class cw extends aw{$$kind;get $$type(){return"AttributeList"}comment;constructor(e,n){super(n),this.$$kind=e}}class QC extends aw{#e=Xp;id;comment;attributes=Object.freeze({graph:new cw("Graph"),edge:new cw("Edge"),node:new cw("Node")});get nodes(){return Array.from(this.#t.nodes.values())}get edges(){return Array.from(this.#t.edges.values())}get subgraphs(){return Array.from(this.#t.subgraphs.values())}#t={nodes:new Map,edges:new Set,subgraphs:new Set};with(e){this.#e=PH(e)}addNode(e){this.#t.nodes.set(e.id,e)}addEdge(e){this.#t.edges.add(e)}addSubgraph(e){this.#t.subgraphs.add(e)}existNode(e){return this.#t.nodes.has(e)}existEdge(e){return this.#t.edges.has(e)}existSubgraph(e){return this.#t.subgraphs.has(e)}createSubgraph(...e){const n=new this.#e.Subgraph(...e);return n.with(this.#e),this.addSubgraph(n),n}removeNode(e){this.#t.nodes.delete(typeof e=="string"?e:e.id)}removeEdge(e){this.#t.edges.delete(e)}removeSubgraph(e){this.#t.subgraphs.delete(e)}createNode(e,n){const r=new this.#e.Node(e,n);return this.addNode(r),r}getSubgraph(e){return Array.from(this.#t.subgraphs.values()).find(n=>n.id===e)}getNode(e){return this.#t.nodes.get(e)}createEdge(e,n){const r=e.map(s=>CH(s)?_H(s):YC(s)),i=new this.#e.Edge(r,n);return this.addEdge(i),i}subgraph(...e){const n=e.find(o=>typeof o=="string"),r=e.find(o=>typeof o=="object"&&o!==null),i=e.find(o=>typeof o=="function"),s=n?this.getSubgraph(n)??this.createSubgraph(n):this.createSubgraph();return r!==void 0&&s.apply(r),i!==void 0&&i(s),s}node(e,...n){if(typeof e=="string"){const r=e,i=n.find(a=>typeof a=="object"&&a!==null),s=n.find(a=>typeof a=="function"),o=this.getNode(r)??this.createNode(r);return i!==void 0&&o.attributes.apply(i),s!==void 0&&s(o),o}typeof e=="object"&&e!==null&&this.attributes.node.apply(e)}edge(e,...n){if(Array.isArray(e)){const r=e,i=n.find(a=>typeof a=="object"),s=n.find(a=>typeof a=="function"),o=this.createEdge(r,i);return s!==void 0&&s(o),o}typeof e=="object"&&e!==null&&this.attributes.edge.apply(e)}graph(e){this.attributes.graph.apply(e)}}class eA extends QC{get $$type(){return"Graph"}id;strict;constructor(...e){super(),this.id=e.find(r=>typeof r=="string"),this.strict=e.find(r=>typeof r=="boolean")??!1;const n=e.find(r=>typeof r=="object"&&r!==null);n!==void 0&&this.apply(n)}}class aV extends eA{get directed(){return!0}}class cV extends eA{get directed(){return!1}}class uV extends QC{get $$type(){return"Subgraph"}id;constructor(...e){super(),this.id=e.find(r=>typeof r=="string");const n=e.find(r=>typeof r=="object"&&r!==null);n!==void 0&&this.apply(n)}isSubgraphCluster(){return typeof this.id=="string"?this.id.startsWith("cluster"):!1}}class tA extends aw{comment}let lV=class extends ow{id;get $$type(){return"Node"}comment;attributes;constructor(e,n){super(),this.id=e,this.attributes=new tA(n)}port(e){return typeof e=="string"?{id:this.id,port:e}:{id:this.id,...e}}};class dV extends ow{targets;get $$type(){return"Edge"}comment;attributes;constructor(e,n){if(super(),this.targets=e,e.length<2&&(ju(e[0])&&ju(e[1]))===!1)throw Error("The element of Edge target is missing or not satisfied as Edge target.");this.attributes=new tA(n)}}Object.assign(Xp,{Graph:cV,Digraph:aV,Subgraph:uV,Node:lV,Edge:dV});function nA(t,e){return(...n)=>{const r=t?this.Digraph:this.Graph,i=n.find(c=>typeof c=="string"),s=n.find(c=>typeof c=="object"),o=n.find(c=>typeof c=="function"),a=new r(i,e,s);return a.with(this),typeof o=="function"&&o(a),a}}function rA(t,e=Xp){return Object.freeze({digraph:nA.call(e,!0,t),graph:nA.call(e,!1,t)})}const iA=rA(!1),fV=iA.digraph;iA.graph;const pV=rA(!0);function sA(t,e){const n=oV(t,e?.convert);return ZH(n,e?.print)}var uw,oA;function hV(){if(oA)return uw;oA=1;function t(r){let i=r.length-1,s=r[i];for(;s===" "||s===" ";)s=r[--i];return r.substring(0,i+1)}function e(r){return r.split(`
206
- `).map(o=>t(o)).join(`
207
- `)}uw=function(r,i){if(i=i||{},r==null)return r;var s=i.width||50,o=typeof i.indent=="string"?i.indent:" ",a=i.newline||`
208
- `+o,c=typeof i.escape=="function"?i.escape:n,u=".{1,"+s+"}";i.cut!==!0&&(u+="([\\s\u200B]+|$)|[^\\s\u200B]+?([\\s\u200B]+|$)");var l=new RegExp(u,"g"),d=r.match(l)||[],f=o+d.map(function(p){return p.slice(-1)===`
209
- `&&(p=p.slice(0,p.length-1)),c(p)}).join(a);return i.trim===!0&&(f=e(f)),f};function n(r){return r}return uw}var mV=hV();const gV=Rp(mV),eh={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t),hsl2rgb:({h:t,s:e,l:n},r)=>{if(!e)return n*2.55;t/=360,e/=100,n/=100;const i=n<.5?n*(1+e):n+e-n*e,s=2*n-i;switch(r){case"r":return eh.hue2rgb(s,i,t+1/3)*255;case"g":return eh.hue2rgb(s,i,t)*255;case"b":return eh.hue2rgb(s,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:n},r)=>{t/=255,e/=255,n/=255;const i=Math.max(t,e,n),s=Math.min(t,e,n),o=(i+s)/2;if(r==="l")return o*100;if(i===s)return 0;const a=i-s,c=o>.5?a/(2-i-s):a/(i+s);if(r==="s")return c*100;switch(i){case t:return((e-n)/a+(e<n?6:0))*60;case e:return((n-t)/a+2)*60;case n:return((t-e)/a+4)*60;default:return-1}}},yV={clamp:(t,e,n)=>e>n?Math.min(e,Math.max(n,t)):Math.min(n,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},vV={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},xe={channel:eh,lang:yV,unit:vV},Hi={};for(let t=0;t<=255;t++)Hi[t]=xe.unit.dec2hex(t);const an={ALL:0,RGB:1,HSL:2};class wV{constructor(){this.type=an.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=an.ALL}is(e){return this.type===e}}class bV{constructor(e,n){this.color=n,this.changed=!1,this.data=e,this.type=new wV}set(e,n){return this.color=n,this.changed=!1,this.data=e,this.type.type=an.ALL,this}_ensureHSL(){const e=this.data,{h:n,s:r,l:i}=e;n===void 0&&(e.h=xe.channel.rgb2hsl(e,"h")),r===void 0&&(e.s=xe.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=xe.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r:n,g:r,b:i}=e;n===void 0&&(e.r=xe.channel.hsl2rgb(e,"r")),r===void 0&&(e.g=xe.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=xe.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,n=e.r;return!this.type.is(an.HSL)&&n!==void 0?n:(this._ensureHSL(),xe.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,n=e.g;return!this.type.is(an.HSL)&&n!==void 0?n:(this._ensureHSL(),xe.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,n=e.b;return!this.type.is(an.HSL)&&n!==void 0?n:(this._ensureHSL(),xe.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,n=e.h;return!this.type.is(an.RGB)&&n!==void 0?n:(this._ensureRGB(),xe.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,n=e.s;return!this.type.is(an.RGB)&&n!==void 0?n:(this._ensureRGB(),xe.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,n=e.l;return!this.type.is(an.RGB)&&n!==void 0?n:(this._ensureRGB(),xe.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(an.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(an.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(an.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(an.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(an.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(an.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const lw=new bV({r:0,g:0,b:0,a:0},"transparent"),Jo={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(Jo.re);if(!e)return;const n=e[1],r=parseInt(n,16),i=n.length,s=i%4===0,o=i>4,a=o?1:17,c=o?8:4,u=s?0:-1,l=o?255:15;return lw.set({r:(r>>c*(u+3)&l)*a,g:(r>>c*(u+2)&l)*a,b:(r>>c*(u+1)&l)*a,a:s?(r&l)*a/255:1},t)},stringify:t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`#${Hi[Math.round(e)]}${Hi[Math.round(n)]}${Hi[Math.round(r)]}${Hi[Math.round(i*255)]}`:`#${Hi[Math.round(e)]}${Hi[Math.round(n)]}${Hi[Math.round(r)]}`}},Ys={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(Ys.hueRe);if(e){const[,n,r]=e;switch(r){case"grad":return xe.channel.clamp.h(parseFloat(n)*.9);case"rad":return xe.channel.clamp.h(parseFloat(n)*180/Math.PI);case"turn":return xe.channel.clamp.h(parseFloat(n)*360)}}return xe.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const n=t.match(Ys.re);if(!n)return;const[,r,i,s,o,a]=n;return lw.set({h:Ys._hue2deg(r),s:xe.channel.clamp.s(parseFloat(i)),l:xe.channel.clamp.l(parseFloat(s)),a:o?xe.channel.clamp.a(a?parseFloat(o)/100:parseFloat(o)):1},t)},stringify:t=>{const{h:e,s:n,l:r,a:i}=t;return i<1?`hsla(${xe.lang.round(e)}, ${xe.lang.round(n)}%, ${xe.lang.round(r)}%, ${i})`:`hsl(${xe.lang.round(e)}, ${xe.lang.round(n)}%, ${xe.lang.round(r)}%)`}},Gu={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=Gu.colors[t];if(e)return Jo.parse(e)},stringify:t=>{const e=Jo.stringify(t);for(const n in Gu.colors)if(Gu.colors[n]===e)return n}},Wu={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const n=t.match(Wu.re);if(!n)return;const[,r,i,s,o,a,c,u,l]=n;return lw.set({r:xe.channel.clamp.r(i?parseFloat(r)*2.55:parseFloat(r)),g:xe.channel.clamp.g(o?parseFloat(s)*2.55:parseFloat(s)),b:xe.channel.clamp.b(c?parseFloat(a)*2.55:parseFloat(a)),a:u?xe.channel.clamp.a(l?parseFloat(u)/100:parseFloat(u)):1},t)},stringify:t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`rgba(${xe.lang.round(e)}, ${xe.lang.round(n)}, ${xe.lang.round(r)}, ${xe.lang.round(i)})`:`rgb(${xe.lang.round(e)}, ${xe.lang.round(n)}, ${xe.lang.round(r)})`}},Vi={format:{keyword:Gu,hex:Jo,rgb:Wu,rgba:Wu,hsl:Ys,hsla:Ys},parse:t=>{if(typeof t!="string")return t;const e=Jo.parse(t)||Wu.parse(t)||Ys.parse(t)||Gu.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(an.HSL)||t.data.r===void 0?Ys.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?Wu.stringify(t):Jo.stringify(t)},DV=(t,e)=>{const n=Vi.parse(t);for(const r in e)n[r]=xe.channel.clamp[r](e[r]);return Vi.stringify(n)},aA=t=>Vi.format.hex.stringify(Vi.parse(t)),EV=(t,e,n)=>{const r=Vi.parse(t),i=r[e],s=xe.channel.clamp[e](i+n);return i!==s&&(r[e]=s),Vi.stringify(r)},RV=(t,e)=>EV(t,"a",-e),$V=(t,e)=>{const n=Vi.parse(t),r={};for(const i in e)e[i]&&(r[i]=n[i]+e[i]);return DV(t,r)},TV=(t,e)=>{const n=Vi.parse(t),r={},i=(s,o,a)=>o>0?(a-s)*o/100:s*o/100;for(const s in e)r[s]=i(n[s],e[s],xe.channel.max[s]);return $V(t,r)};class SV{value;next;constructor(e){this.value=e}}class kV{#e;#t;#n;constructor(){this.clear()}enqueue(e){const n=new SV(e);this.#e?(this.#t.next=n,this.#t=n):(this.#e=n,this.#t=n),this.#n++}dequeue(){const e=this.#e;if(e)return this.#e=this.#e.next,this.#n--,e.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#n=0}get size(){return this.#n}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}}function dw(t){cA(t);const e=new kV;let n=0;const r=()=>{n<t&&e.size>0&&(e.dequeue()(),n++)},i=()=>{n--,r()},s=async(c,u,l)=>{const d=(async()=>c(...l))();u(d);try{await d}catch{}i()},o=(c,u,l)=>{new Promise(d=>{e.enqueue(d)}).then(s.bind(void 0,c,u,l)),(async()=>(await Promise.resolve(),n<t&&r()))()},a=(c,...u)=>new Promise(l=>{o(c,l,u)});return Object.defineProperties(a,{activeCount:{get:()=>n},pendingCount:{get:()=>e.size},clearQueue:{value(){e.clear()}},concurrency:{get:()=>t,set(c){cA(c),t=c,queueMicrotask(()=>{for(;n<t&&e.size>0;)r()})}}}),a}function cA(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}var CV=Object.getOwnPropertyNames,AV=Object.getOwnPropertySymbols,_V=Object.prototype.hasOwnProperty;function uA(t,e){return function(n,r,i){return t(n,r,i)&&e(n,r,i)}}function th(t){return function(e,n,r){if(!e||!n||typeof e!="object"||typeof n!="object")return t(e,n,r);var i=r.cache,s=i.get(e),o=i.get(n);if(s&&o)return s===n&&o===e;i.set(e,n),i.set(n,e);var a=t(e,n,r);return i.delete(e),i.delete(n),a}}function lA(t){return CV(t).concat(AV(t))}var dA=Object.hasOwn||function(t,e){return _V.call(t,e)};function Zo(t,e){return t||e?t===e:t===e||t!==t&&e!==e}var fA="_owner",pA=Object.getOwnPropertyDescriptor,hA=Object.keys;function PV(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function xV(t,e){return Zo(t.getTime(),e.getTime())}function mA(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.entries(),s=0,o,a;(o=i.next())&&!o.done;){for(var c=e.entries(),u=!1,l=0;(a=c.next())&&!a.done;){var d=o.value,f=d[0],p=d[1],h=a.value,v=h[0],b=h[1];!u&&!r[l]&&(u=n.equals(f,v,s,l,t,e,n)&&n.equals(p,b,f,v,t,e,n))&&(r[l]=!0),l++}if(!u)return!1;s++}return!0}function IV(t,e,n){var r=hA(t),i=r.length;if(hA(e).length!==i)return!1;for(var s;i-- >0;)if(s=r[i],s===fA&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!dA(e,s)||!n.equals(t[s],e[s],s,s,t,e,n))return!1;return!0}function Hu(t,e,n){var r=lA(t),i=r.length;if(lA(e).length!==i)return!1;for(var s,o,a;i-- >0;)if(s=r[i],s===fA&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!dA(e,s)||!n.equals(t[s],e[s],s,s,t,e,n)||(o=pA(t,s),a=pA(e,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function NV(t,e){return Zo(t.valueOf(),e.valueOf())}function OV(t,e){return t.source===e.source&&t.flags===e.flags}function gA(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.values(),s,o;(s=i.next())&&!s.done;){for(var a=e.values(),c=!1,u=0;(o=a.next())&&!o.done;)!c&&!r[u]&&(c=n.equals(s.value,o.value,s.value,o.value,t,e,n))&&(r[u]=!0),u++;if(!c)return!1}return!0}function FV(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var LV="[object Arguments]",MV="[object Boolean]",BV="[object Date]",zV="[object Map]",qV="[object Number]",jV="[object Object]",UV="[object RegExp]",GV="[object Set]",WV="[object String]",HV=Array.isArray,yA=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,vA=Object.assign,VV=Object.prototype.toString.call.bind(Object.prototype.toString);function KV(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,s=t.arePrimitiveWrappersEqual,o=t.areRegExpsEqual,a=t.areSetsEqual,c=t.areTypedArraysEqual;return function(u,l,d){if(u===l)return!0;if(u==null||l==null||typeof u!="object"||typeof l!="object")return u!==u&&l!==l;var f=u.constructor;if(f!==l.constructor)return!1;if(f===Object)return i(u,l,d);if(HV(u))return e(u,l,d);if(yA!=null&&yA(u))return c(u,l,d);if(f===Date)return n(u,l,d);if(f===RegExp)return o(u,l,d);if(f===Map)return r(u,l,d);if(f===Set)return a(u,l,d);var p=VV(u);return p===BV?n(u,l,d):p===UV?o(u,l,d):p===zV?r(u,l,d):p===GV?a(u,l,d):p===jV?typeof u.then!="function"&&typeof l.then!="function"&&i(u,l,d):p===LV?i(u,l,d):p===MV||p===qV||p===WV?s(u,l,d):!1}}function YV(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?Hu:PV,areDatesEqual:xV,areMapsEqual:r?uA(mA,Hu):mA,areObjectsEqual:r?Hu:IV,arePrimitiveWrappersEqual:NV,areRegExpsEqual:OV,areSetsEqual:r?uA(gA,Hu):gA,areTypedArraysEqual:r?Hu:FV};if(n&&(i=vA({},i,n(i))),e){var s=th(i.areArraysEqual),o=th(i.areMapsEqual),a=th(i.areObjectsEqual),c=th(i.areSetsEqual);i=vA({},i,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:a,areSetsEqual:c})}return i}function XV(t){return function(e,n,r,i,s,o,a){return t(e,n,a)}}function JV(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,s=t.strict;if(r)return function(a,c){var u=r(),l=u.cache,d=l===void 0?e?new WeakMap:void 0:l,f=u.meta;return n(a,c,{cache:d,equals:i,meta:f,strict:s})};if(e)return function(a,c){return n(a,c,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};var o={cache:void 0,equals:i,meta:void 0,strict:s};return function(a,c){return n(a,c,o)}}var ZV=Ki();Ki({strict:!0}),Ki({circular:!0}),Ki({circular:!0,strict:!0}),Ki({createInternalComparator:function(){return Zo}}),Ki({strict:!0,createInternalComparator:function(){return Zo}}),Ki({circular:!0,createInternalComparator:function(){return Zo}}),Ki({circular:!0,createInternalComparator:function(){return Zo},strict:!0});function Ki(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,s=t.strict,o=s===void 0?!1:s,a=YV(t),c=KV(a),u=r?r(c):XV(c);return JV({circular:n,comparator:c,createState:i,equals:u,strict:o})}function wA(t,e){const n=t.nodes.map(i=>{const s=e.nodes[i.id];if(!s)return i;const{x:o,y:a,width:c,height:u}=s;return{...i,width:c,height:u,position:[o,a]}}),r=t.edges.map(i=>{const s=e.edges[i.id];return s?{...i,...s}:i});return{...t,bounds:{x:e.x,y:e.y,width:e.width,height:e.height},nodes:n,edges:r}}const bA=(t,e)=>t.width>e.width+10||t.height>e.height+10;function QV(t,e){if(t.hash===e.hash)return{diagram:wA(t,e)};if(ZV(t.autoLayout,e.autoLayout)&&t.nodes.every(r=>{const i=e.nodes[r.id];return!!i&&(r.children.length>0&&i.isCompound||r.children.length===0&&!i.isCompound)&&(i.isCompound||bA(r,i)===!1)})&&t.edges.every(r=>{const i=e.edges[r.id];return!!i&&(!r.labelBBox&&!i.labelBBox||!!r.labelBBox&&!!i.labelBBox&&r.labelBBox.width<=i.labelBBox.width&&r.labelBBox.height<=i.labelBBox.height)}))return{diagram:wA(t,e)};const n=t.nodes.reduce((r,i)=>{const s=e.nodes[i.id];if(i.children.length>0||!s)return r;const o={id:i.id,center:{x:Math.round(s.x+s.width/2),y:Math.round(s.y+s.height/2)}};return s.isCompound||bA(i,s)||(o.fixedsize={width:s.width,height:s.height}),r.push(o),r},[]);return{relayout:{x:e.x,y:e.y,height:e.height,nodes:n,edges:Lp(e.edges).flatMap(([r,i])=>i.dotpos?{id:r,dotpos:i.dotpos}:[])}}}function Un(t){return t.children.length>0}function cn(t){switch(t){case"open":return"vee";default:return t}}function Lr(t){return Array.isArray(t)?[Lr(t[0]),Lr(t[1])]:(Ce(isFinite(t),`Invalid not finite point value ${t}`),Math.round(t))}const DA=t=>(Ce(isFinite(t),`Invalid not finite inch value ${t}`),Math.floor(t*72)),ft=t=>Math.ceil(t/72*1e3)/1e3,Gn=t=>Math.ceil(t);Gn(40).toString();function EA(t,e){return aA(TV(t,{l:-35-5*e,s:-15-5*e}))}function eK(t){return aA(RV(t,.3))}function tK(t){return t.trim().replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function fw(t,e,n){let r=gV(t,{width:e,indent:"",escape:tK}).split(`
210
- `);return Qt(n)&&n>0&&r.length>n&&(r=r.slice(0,n-1)),r}function Xs({text:t,maxchars:e,fontsize:n,maxLines:r,bold:i,color:s}){let o=fw(t,e,r).join("<BR/>");i&&(o=`<B>${o}</B>`);const a=s?` COLOR="${s}"`:"";return`<FONT POINT-SIZE="${Gn(n)}"${a}>${o}</FONT>`}function nK(t,e){const n=ue(t.icon),r=[Xs({text:t.title,fontsize:19,maxchars:35,maxLines:3})];if(ue(t.technology)&&r.push(Xs({text:t.technology,fontsize:12,maxchars:n?35:45,maxLines:1,color:e.loContrast})),ue(t.description)&&r.push(Xs({text:t.description,fontsize:14,maxchars:n?35:45,maxLines:5,color:e.loContrast})),r.length===1&&!n)return`<${r[0]}>`;const i=n?(s,o,a)=>{let c=`<TD ALIGN="TEXT" BALIGN="LEFT">${s}</TD>`;if(o===0){const u=a.length>1?` ROWSPAN="${a.length}"`:"";let l=76;(t.shape==="queue"||t.shape==="mobile")&&(l+=20),c=`<TD${u} WIDTH="${l}"> </TD>${c}`,c=`${c}<TD${u} WIDTH="16"> </TD>`}return`<TR>${c}</TR>`}:s=>`<TR><TD>${s}</TD></TR>`;return`<<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="6">${r.map(i).join("")}</TABLE>>`}function rK(t,e){const n=Xs({text:t.title.toUpperCase(),maxchars:50,fontsize:11,maxLines:1,bold:!0,color:e});return n.includes("<BR/>")?`<<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"><TR><TD ALIGN="TEXT" BALIGN="LEFT">${n}</TD></TR></TABLE>>`:`<${n}>`}const Vu=40,pw=`BGCOLOR="${cr.relationships[Ca].labelBgColor}A0"`;function RA({label:t,technology:e}){const n=[];if(ue(t)&&n.push(Xs({text:t,maxchars:Vu,fontsize:14,maxLines:5,bold:t==="[...]"})),ue(e)&&n.push(Xs({text:`[ ${e} ]`,fontsize:12,maxLines:1,maxchars:Vu})),n.length===0)return null;const r=n.map(i=>`<TR><TD ALIGN="TEXT" BALIGN="LEFT">${i}</TD></TR>`).join("");return`<<TABLE BORDER="0" CELLPADDING="3" CELLSPACING="0" ${pw}>${r}</TABLE>>`}function iK(t,e){const n=`<TABLE BORDER="0" CELLPADDING="6" ${pw}><TR><TD WIDTH="20" HEIGHT="20"><FONT POINT-SIZE="${Gn(14)}"><B>${t}</B></FONT></TD></TR></TABLE>`;return ue(e)?`<${['<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">',"<TR>",`<TD>${n}</TD>`,`<TD ${pw} CELLPADDING="2">`,Xs({text:e,maxchars:Vu,fontsize:14}),"</TD>","</TR>","</TABLE>"].join("")}>`:`<${n}>`}const hw="dashed",mw=cr.font;class gw{constructor(e){this.view=e,this.compoundIds=new Set(e.nodes.filter(Un).map(i=>i.id)),this.edgesWithCompounds=new Set(this.compoundIds.size>0?e.edges.filter(i=>this.compoundIds.has(i.source)||this.compoundIds.has(i.target)).map(i=>i.id):[]);const n=new Map;for(const i of e.edges)n.set(i.id,iN(i.source,i.target));this.edgeDistances=n;const r=this.graphvizModel=this.createGraph();this.applyNodeAttributes(r.attributes.node),this.applyEdgeAttributes(r.attributes.edge)}ids=new Set;subgraphs=new Map;nodes=new Map;edges=new Map;compoundIds;edgesWithCompounds;edgeDistances;graphvizModel;get hasEdgesWithCompounds(){return this.edgesWithCompounds.size>0}postBuild(e){}build(e){const n=(i,s)=>{const o=this.nodeId(i),a=this.elementToSubgraph(i,s.subgraph(o));this.subgraphs.set(i.id,a);for(const c of i.children){const u=this.viewElement(c);if(Un(u))n(u,a);else{const l=fn(this.getGraphNode(u.id),`Graphviz Node not found for ${u.id}`);a.node(l.id)}}},r=[];for(const i of this.view.nodes)if(Un(i))Et(i.parent)&&r.push(i);else{const s=this.nodeId(i),o=this.elementToNode(i,e.node(s));this.nodes.set(i.id,o)}for(const i of r)n(i,e);for(const i of this.view.edges){const s=this.addEdge(i,e);s&&this.edges.set(i.id,s)}}print(){const e=this.graphvizModel;return this.build(e),this.postBuild(e),sA(this.graphvizModel,{print:{indentStyle:"space",indentSize:2}})}createGraph(){const e=this.view.autoLayout,n=fV({[F.bgcolor]:"transparent",[F.layout]:"dot",[F.compound]:!0,[F.rankdir]:e.direction,[F.TBbalance]:"min",[F.splines]:"spline",[F.outputorder]:"nodesfirst",[F.nodesep]:ft(e.nodeSep??110),[F.ranksep]:ft(e.rankSep??120),[F.pack]:Gn(e.rankSep??120),[F.packmode]:"array_3",[F.pad]:ft(15),[F.fontname]:mw});return n.attributes.graph.apply({[F.fontsize]:Gn(15),[F.labeljust]:e.direction==="RL"?"r":"l",[F.labelloc]:e.direction==="BT"?"b":"t",[F.margin]:50.1}),n}applyNodeAttributes(e){e.apply({[F.fontname]:mw,[F.shape]:"rect",[F.width]:ft(320),[F.height]:ft(180),[F.style]:"filled",[F.penwidth]:0})}applyEdgeAttributes(e){e.apply({[F.arrowsize]:.75,[F.fontname]:mw,[F.fontsize]:Gn(14),[F.penwidth]:Gn(2),[F.color]:cr.relationships[Ca].lineColor,[F.fontcolor]:cr.relationships[Ca].labelColor})}checkNodeId(e,n=!1){return n?e="cluster_"+e:e.toLowerCase().startsWith("cluster")&&(e="nd_"+e),this.ids.has(e)?null:(this.ids.add(e),e)}nodeId(e){const n=Un(e);let r=Aa(e.id).toLowerCase(),i=this.checkNodeId(r,n);if(i!==null)return i;let s=e.id,o;for(;o=_a(s);){if(r=Aa(o).toLowerCase()+"_"+r,i=this.checkNodeId(r,n),i!==null)return i;s=o}r=Aa(e.id).toLowerCase();let a=1;do i=this.checkNodeId(r+"_"+a++,n);while(i===null);return i}elementToSubgraph(e,n){Ce(Un(e),"node should be compound"),Ce(Op(e.depth),"node.depth should be defined");const r=this.getElementColorValues(e.color),i=eK(r.loContrast);return n.apply({[F.likec4_id]:e.id,[F.likec4_level]:e.level,[F.likec4_depth]:e.depth,[F.fillcolor]:EA(r.fill,e.depth),[F.color]:EA(r.stroke,e.depth),[F.style]:"filled",[F.margin]:Gn(e.children.length>1?40:32)}),Fs(e.title.trim())||n.set(F.label,rK(e,i)),n}elementToNode(e,n){Ce(!Un(e),"node should not be compound");const r=ue(e.icon),i=this.getElementColorValues(e.color);switch(n.attributes.apply({[F.likec4_id]:e.id,[F.likec4_level]:e.level,[F.fillcolor]:i.fill,[F.fontcolor]:i.hiContrast,[F.color]:i.stroke,[F.margin]:`${ft(r?10:26)},${ft(26)}`}),e.shape){case"cylinder":case"storage":{n.attributes.apply({[F.margin]:`${ft(r?10:26)},${ft(0)}`,[F.penwidth]:Gn(2),[F.shape]:"cylinder"});break}case"browser":{n.attributes.apply({[F.margin]:`${ft(r?10:30)},${ft(32)}`});break}case"mobile":{n.attributes.apply({[F.margin]:`${ft(r?10:30)},${ft(26)}`});break}case"queue":{n.attributes.apply({[F.width]:ft(320),[F.height]:ft(165),[F.margin]:`${ft(r?10:30)},${ft(26)}`});break}}return n.attributes.set(F.label,nK(e,i)),n}leafElements(e){return e===null?this.view.nodes.filter(n=>!Un(n)):this.viewElement(e).children.flatMap(n=>{const r=this.viewElement(n);return Un(r)?this.leafElements(r.id):r})}descendants(e){return e===null?this.view.nodes.slice():this.viewElement(e).children.flatMap(n=>{const r=this.viewElement(n);return[r,...this.descendants(r.id)]})}viewElement(e){return fn(this.view.nodes.find(n=>n.id===e),`Node ${e} not found`)}getGraphNode(e){return this.nodes.get(e)??null}getSubgraph(e){return this.subgraphs.get(e)??null}edgeEndpoint(e,n){let r=this.viewElement(e),i=this.getGraphNode(e),s;return i||(Ce(Un(r),"endpoint node should be compound"),s=this.getSubgraph(e)?.id,Ce(s,`subgraph ${e} not found`),r=fn(n(this.leafElements(e)),`leaf element in ${e} not found`),i=fn(this.getGraphNode(r.id),`source graphviz node ${r.id} not found`)),[r,i,s]}findInternalEdges(e){if(e===null)return this.view.edges.slice();const n=this.viewElement(e);return tt(this.descendants(e),zi(r=>JS(r.inEdges,r.outEdges)),Sv(),d9(JS(n.inEdges,n.outEdges)),vn(r=>this.view.edges.find(i=>i.id===r)),Ve(ue))}withoutCompoundEdges(e){return this.edgesWithCompounds.size===0?e:{...e,inEdges:e.inEdges.filter(n=>!this.edgesWithCompounds.has(n)),outEdges:e.outEdges.filter(n=>!this.edgesWithCompounds.has(n))}}assignGroups(){const e=tt(this.view.nodes,Ve(Un),vn(r=>r.id),WS(Kd),HS(),vn(r=>{const i=this.findInternalEdges(r).filter(s=>s.source!==s.target&&!this.compoundIds.has(s.source)&&!this.compoundIds.has(s.target));return{id:r,edges:i}}),Ve(({edges:r})=>r.length>1&&r.length<8),kj(4)),n=new Set;for(const r of e){const i=r.edges.filter(s=>!n.has(s.source)&&!n.has(s.target));for(const s of i)try{const o=fn(this.getGraphNode(s.source),`Graphviz Node not found for ${s.source}`),a=fn(this.getGraphNode(s.target),`Graphviz Node not found for ${s.target}`);n.add(s.source),n.add(s.target),o.attributes.set(F.group,r.id),a.attributes.set(F.group,r.id)}catch(o){xt.error(o)}}}applyManualLayout({height:e,...n}){const r=n.x<0?-n.x:0,i=n.y<0?-n.y:0,s=r>0||i>0;for(const{id:o,...a}of n.nodes){const c=this.getGraphNode(o);if(!c)continue;const u=ft(a.center.x)+r,l=ft(e-a.center.y);a.fixedsize?c.attributes.apply({[F.pos]:`${u},${l}!`,[F.pin]:!0,[F.width]:ft(a.fixedsize.width),[F.height]:ft(a.fixedsize.height),[F.fixedsize]:!0}):c.attributes.set(F.pos,`${u},${l}`)}for(const[o,a]of this.edges.entries()){a.attributes.delete(F.weight),a.attributes.delete(F.minlen),a.attributes.delete(F.constraint);const c=n.edges.find(u=>u.id===o)?.dotpos;c&&!s&&a.attributes.set(F.pos,c)}return this.graphvizModel.apply({[F.layout]:"fdp",[F.overlap]:"vpsc",[F.sep]:"+50,50",[F.esep]:"+10,10",[F.start]:"random2",[F.splines]:"compound"}),this.graphvizModel.delete(F.compound),this.graphvizModel.delete(F.rankdir),this.graphvizModel.delete(F.nodesep),this.graphvizModel.delete(F.ranksep),this.graphvizModel.delete(F.pack),this.graphvizModel.delete(F.pad),this.graphvizModel.delete(F.packmode),this.graphvizModel.attributes.graph.delete(F.margin),this}getRelationshipColorValues(e){return eD(e)?cr.relationships[e]:this.view.customColorDefinitions[e]?.relationships??cr.relationships[q0]}getElementColorValues(e){return eD(e)?cr.elements[e]:this.view.customColorDefinitions[e]?.elements??cr.elements[q0]}}class sK extends gw{createGraph(){const e=super.createGraph(),n=this.view.autoLayout;return e.delete(F.TBbalance),e.apply({[F.nodesep]:ft(n.nodeSep??130),[F.ranksep]:ft(n.rankSep??130)}),e}postBuild(e){tt(this.view.nodes,vn(n=>({node:n,graphvizNode:this.getGraphNode(n.id)})),Ls(({node:n,graphvizNode:r})=>{if(r!=null)return Yd.modelRef(n)??void 0}),Wc(),Ve(Vc(2)),Xj(n=>{e.subgraph({[F.rank]:"same"},r=>{for(const{graphvizNode:i}of n)r.node(fn(i).id)})}),Pj(()=>{e.set(F.newrank,!0),e.set(F.clusterrank,"global"),e.delete(F.pack),e.delete(F.packmode)}))}elementToSubgraph(e,n){const r=super.elementToSubgraph(e,n);return e.children.length>1&&r.set(F.margin,Gn(50)),r}addEdge(e,n){const[r,i]=[e.source,e.target],[s,o,a]=this.edgeEndpoint(r,w=>Yc(w)),[c,u,l]=this.edgeEndpoint(i,Vo),d=on(l)||on(a),f=n.edge([o,u],{[F.likec4_id]:e.id,[F.style]:e.line??hw});l&&f.attributes.set(F.lhead,l),a&&f.attributes.set(F.ltail,a);const p=this.edgeDistances.get(e.id)??0,h=[...s.inEdges,...s.outEdges,...c.inEdges,...c.outEdges].reduce((w,R)=>Math.max(w,this.edgeDistances.get(R)??0),0);h-p>1&&f.attributes.set(F.weight,h-p);const v=RA(e);if(v&&f.attributes.set(d?F.xlabel:F.label,v),e.color){const w=this.getRelationshipColorValues(e.color);f.attributes.apply({[F.color]:w.lineColor,[F.fontcolor]:w.labelColor})}let[b,g]=[e.head??ms,e.tail??"none"];return b==="none"&&g==="none"?(f.attributes.apply({[F.arrowtail]:"none",[F.arrowhead]:"none",[F.dir]:"none"}),f):e.dir==="both"?(f.attributes.apply({[F.arrowhead]:cn(b),[F.arrowtail]:cn(e.tail??b),[F.dir]:"both"}),!d&&Yd.modelRef(s)!==Yd.modelRef(c)&&f.attributes.set(F.constraint,!1),f):(b!==ms&&f.attributes.set(F.arrowhead,cn(b)),g!=="none"&&f.attributes.set(F.arrowtail,cn(g)),f)}}class A0 extends gw{static toDot(e){return new A0(e).print()}postBuild(e){e.set(F.TBbalance,"max"),z0(this.edgesWithCompounds,n=>this.view.edges.some(r=>r.id===n&&r.label))&&(e.delete(F.pack),e.delete(F.packmode))}addEdge(e,n){const{nodes:r}=this.view,[i,s]=e.dir==="back"?[e.target,e.source]:[e.source,e.target],[o,a,c]=this.edgeEndpoint(i,k=>Yc(k)),[u,l,d]=this.edgeEndpoint(s,Vo),f=n.edge([a,l],{[F.likec4_id]:e.id,[F.style]:e.line??hw});if(d&&f.attributes.set(F.lhead,d),c&&f.attributes.set(F.ltail,c),e.color&&e.color!==Ca){const k=this.getRelationshipColorValues(e.color);f.attributes.apply({[F.color]:k.lineColor,[F.fontcolor]:k.labelColor})}const p=rN(e.id),h=iK(p,e.label?.trim());f.attributes.set(F.label,h);const v=this.edgeDistances.get(e.id)??0,b=[...o.inEdges,...o.outEdges,...u.inEdges,...u.outEdges].reduce((k,A)=>Math.max(k,this.edgeDistances.get(A)??0),0);b-v>1&&f.attributes.set(F.weight,b-v);const g=r.findIndex(k=>k.id===i);r.findIndex(k=>k.id===s)<g&&e.dir!=="back"&&f.attributes.apply({[F.constraint]:!1});let[w,R]=[e.head??ms,e.tail??"none"];return e.dir==="back"?(f.attributes.apply({[F.arrowtail]:cn(w),[F.minlen]:0,[F.dir]:"back"}),R!=="none"&&f.attributes.apply({[F.arrowhead]:cn(R),[F.dir]:"both"}),f):w==="none"&&R==="none"||w!=="none"&&R!=="none"?(f.attributes.apply({[F.arrowhead]:cn(w),[F.arrowtail]:cn(R),[F.dir]:"both"}),f):w==="none"?(f.attributes.delete(F.arrowhead),f.attributes.apply({[F.arrowtail]:cn(R),[F.minlen]:0,[F.dir]:"back"}),f):(w!==ms&&f.attributes.set(F.arrowhead,cn(w)),f)}}class oK extends gw{postBuild(e){this.assignGroups();const n=new Set,r=this.view.nodes.reduce((i,s)=>(Un(s)&&(n.add(s.id),i.push(s)),i),[]);for(const i of r){const s=tt(i.children,Ve(u=>!this.compoundIds.has(u)),vn(u=>this.viewElement(u)),Ve(u=>u.inEdges.length===0&&u.outEdges.length===0));if(s.length<=2)continue;let o=2;switch(!0){case s.length>11:o=4;break;case s.length>4:o=3;break}const a=fn(this.getSubgraph(i.id),`Subgraph not found for ${i.id}`);let c=null;m9(s,o).forEach(u=>{const l=u.length>1?a.createSubgraph({[F.rank]:"same"}):null;u.forEach((d,f)=>{const p=this.getGraphNode(d.id);p&&(l?.node(p.id),f===0&&(c&&a.edge([c,p],{[F.style]:"invis"}),c=p))})})}z0(this.edgesWithCompounds,i=>this.view.edges.some(s=>s.id===i&&s.label))&&(e.delete(F.pack),e.delete(F.packmode))}addEdge(e,n){const r=this.view.edges,[i,s]=e.dir==="back"?[e.target,e.source]:[e.source,e.target],[o,a,c]=this.edgeEndpoint(i,A=>Yc(A)),[u,l,d]=this.edgeEndpoint(s,Vo),f=e.parent,p=n.edge([a,l],{[F.likec4_id]:e.id,[F.style]:e.line??hw});d&&p.attributes.set(F.lhead,d),c&&p.attributes.set(F.ltail,c);const h=on(d)||on(c),v=this.edgeDistances.get(e.id)??0,b=[...o.inEdges,...o.outEdges,...u.inEdges,...u.outEdges].reduce((A,N)=>Math.max(A,this.edgeDistances.get(N)??0),0);b-v>1&&p.attributes.set(F.weight,b-v);const g=RA(e);if(g&&p.attributes.set(h?F.xlabel:F.label,g),e.color){const A=this.getRelationshipColorValues(e.color);p.attributes.apply({[F.color]:A.lineColor,[F.fontcolor]:A.labelColor})}let[w,R]=[e.head??ms,e.tail??"none"];if(e.dir==="back")return p.attributes.apply({[F.arrowtail]:cn(w),[F.dir]:"back"}),R!=="none"&&p.attributes.apply({[F.arrowhead]:cn(R),[F.dir]:"both",[F.minlen]:0}),p;if(w==="none"&&R==="none")return p.attributes.apply({[F.arrowtail]:"none",[F.arrowhead]:"none",[F.dir]:"none",[F.minlen]:0,[F.constraint]:!1}),p;if(w!=="none"&&R!=="none")return p.attributes.apply({[F.arrowhead]:cn(w),[F.arrowtail]:cn(R),[F.dir]:"both",[F.minlen]:0}),p;if(w!==ms&&p.attributes.set(F.arrowhead,cn(w)),R!=="none"&&p.attributes.set(F.arrowtail,cn(R)),r.length===1)return p;let k;return f===null&&o.parent==null&&u.parent==null?k=r.filter(A=>{if(A.id===e.id||A.parent!==null||A.source===e.source&&A.target===e.target||A.source===e.target&&A.target===e.source)return!1;const N=this.viewElement(A.source),_=this.viewElement(A.target);return Un(N)||Un(_)?!1:N.parent==null&&_.parent==null}):k=this.findInternalEdges(f).filter(A=>!(A.id===e.id||A.source===e.source&&A.target===e.target||A.source===e.target&&A.target===e.source)),k.length===0&&(f===null||this.leafElements(f).length<=3)&&p.attributes.set(F.minlen,0),p}}function nh(t){const[e,n,r,i]=t?t.split(",").map(a=>Lr(+a)):[0,0,0,0],s=Math.round(r-e),o=Math.round(n-i);return{x:Math.round(e),y:Math.round(i),width:s,height:o}}function aK(t){try{const[e,n]=t.split(",");return{x:Lr(parseFloat(e)),y:Lr(parseFloat(n))}}catch(e){throw new Error(`Failed on parsing pos: ${t}`,{cause:e})}}function $A(t){const{x:e,y:n}=aK(t.pos),r=DA(parseFloat(t.width)),i=DA(parseFloat(t.height));return{x:e-Math.round(r/2),y:n-Math.round(i/2),width:r,height:i}}function TA(t,[e,n]=[0,0]){if(!t||t.length===0)return null;let r=1/0,i=1/0,s=-1/0,o=-1/0,a=13;try{for(const u of t){if(u.op==="F"){a=Lr(u.size);continue}if(u.op==="T"){let l=Lr(u.pt[0])-e,d=Lr(u.width);switch(u.align){case"r":l-=d;break;case"c":l-=Math.round(d/2);break}r=Math.min(r,l),s=Math.max(s,l+d);let f=Lr(u.pt[1])-n;i=Math.min(i,Math.round(f-a)),o=Math.max(o,f)}}}catch(u){return xt.warn(`Failed on parsing label draw ops: ${u}
211
- ${JSON.stringify(t,null,2)}`),null}if(r===1/0)return null;const c=2;return{x:r-c,y:i-c,width:s-r+2*c,height:o-i+2*c}}function SA({_draw_:t,likec4_id:e="???"},n="<unknown view>"){try{const r=t.filter(s=>s.op.toLowerCase()==="b");Ce(Vc(r,1),`view ${n} edge ${e} should have at least one bezier draw op`),r.length>1&&xt.warn(`view ${n} edge ${e} has more than one bezier draw op, using the first one only`);const i=r[0].points.map(s=>Lr(s));return Ce(Vc(i,2),`view ${n} edge ${e} should have at least two points`),i}catch(r){throw new Error(`failed on parsing view ${n} edge ${e} _draw_:
212
- ${JSON.stringify(t,null,2)}`,{cause:r})}}function cK(t,{id:e,source:n,target:r,dir:i,label:s,description:o,...a},c){const u=TA(t._ldraw_??t._tldraw_??t._hldraw_),l=t.dir==="back"||i==="back";return s=s?fw(s,Vu).join(`
213
- `):null,o=o?fw(o,Vu).join(`
214
- `):void 0,{id:e,source:n,target:r,label:s,...ue(o)&&{description:o},...ue(t.pos)&&{dotpos:t.pos},points:SA(t,c),labelBBox:u,...l?{dir:"back"}:{},...a}}function kA(t,e){const n=JSON.parse(t),r=nh(n.bb),{nodes:i,edges:s,manualLayout:o,...a}=e,c={...a,bounds:r,nodes:[],edges:[]},u=n.objects??[];for(const d of i){const f=u.find(p=>p.likec4_id===d.id);Ce(f,`View ${a.id} node ${d.id} not found in graphviz output`);try{const{x:p,y:h,width:v,height:b}="bb"in f?nh(f.bb):$A(f),g=[p,h];c.nodes.push({...d,position:g,width:v,height:b,labelBBox:TA(f._ldraw_,g)??{x:p,y:h,width:v,height:b}})}catch(p){throw new Error(`Failed on parsing node ${d.id}:
215
- ${JSON.stringify(f,null,2)}`,{cause:p})}}const l=n.edges??[];for(const d of s){const f=l.find(p=>p.likec4_id===d.id);if(!f){xt.warn(`View ${a.id} edge ${d.id} not found in graphviz output, skipping`);continue}c.edges.push(cK(f,d,a.id))}return c}const rh=t=>String(t+1).padStart(2,"0");function uK(t){const e=JSON.parse(t),n=nh(e.bb),r={nodes:[],edges:[],bounds:n},i=new Map,s=e.objects??[];for(const o of s){if(!o.likec4_type)continue;const a=rh(o._gvid),c=o.likec4_path??"",u=i.get(o._gvid),{x:l,y:d,width:f,height:p}="bb"in o?nh(o.bb):$A(o),h={x:l,y:d};if(o.likec4_type==="view")Ce(o.likec4_id,`View ${o} has no likec4_id`),r.nodes.push({id:a,type:"view",parentId:u?.id??null,height:p,width:f,position:h,label:o.label??"",viewId:o.likec4_id});else{const v={id:a,type:o.likec4_type,parentId:u?.id??null,height:p,width:f,position:h,path:c,label:o.label??""},b=[..."subgraphs"in o?o.subgraphs:[],..."nodes"in o?o.nodes:[]];for(const g of b)i.set(g,v);r.nodes.push(v)}}for(const o of e.edges??[])try{const a=rh(o.tail),c=rh(o.head);r.edges.push({id:`link${rh(o._gvid)}`,source:a,target:c,points:SA(o)})}catch(a){xt.warn(a)}return r}const CA=cr.font,ih="/";class _0{static toDot(e){return new _0(e).print()}subgraphs=new Map;graphvizModel;constructor(e){const n=this.graphvizModel=pV.graph({[F.layout]:"osage",[F.pack]:Gn(100),[F.packmode]:"array_ltc",[F.pad]:ft(15),[F.fontname]:CA,[F.splines]:"polyline",[F.esep]:"+20"});n.attributes.graph.apply({[F.fontsize]:Gn(20),[F.labeljust]:"l",[F.labelloc]:"t"}),n.attributes.node.apply({[F.fontname]:CA,[F.shape]:"rect",[F.width]:ft(400),[F.height]:ft(300),[F.fixedsize]:!0,[F.fontsize]:10}),n.attributes.edge.apply({[F.penwidth]:Gn(2)});const r=new Set(e.map(c=>c.relativePath??""));let i=0,s=[...e];const o=r.size>1;o&&s.sort((c,u)=>{const l=c.relativePath?.split(ih)??[""],d=u.relativePath?.split(ih)??[""];l.push(c.title??"Untitled"),d.push(u.title??"Untitled");const f=l.length,p=d.length;switch(i=Math.max(i,f,p),!0){case f>p:return-1;case f<p:return 1;default:{for(let h=0;h<f;h++){const v=l[h].localeCompare(d[h]);if(v!==0)return v}return 0}}});const a=new Map;s.forEach((c,u)=>{this.addView(o?c:{...c,relativePath:""},u+i);const l=c.nodes.reduce((d,f)=>(f.navigateTo&&d.add(f.navigateTo),d),new Set);l.size>0&&a.set(c.id,l)});for(const[c,u]of a)for(const l of u)n.edge([c,l])}getParentForPath(e){if(e==="")return this.graphvizModel;const n=e.toLowerCase();let r=this.subgraphs.get(n);if(!r){const i=n.endsWith(".c4")||n.endsWith(".likec4"),s=e.includes(ih)?e.slice(0,e.lastIndexOf(ih)):"";r=this.getParentForPath(s).subgraph("cluster"+String(this.subgraphs.size+1),{[F.likec4_type]:i?"file":"folder",[F.likec4_path]:e,[F.sortv]:this.subgraphs.size,[F.label]:ue(s)?e.slice(s.length+1):e}),this.subgraphs.set(n,r)}return r}addView(e,n=0){return this.getParentForPath(e.relativePath??"").node(e.id,{[F.likec4_type]:"view",[F.likec4_id]:e.id,[F.sortv]:n,[F.label]:e.title||"Untitled"})}print(){return sA(this.graphvizModel,{print:{indentStyle:"space",indentSize:2}})}}const AA=t=>{switch(!0){case ka.isDynamic(t):return new A0(t);case ka.isDeployment(t):return new sK(t);case ka.isElement(t):return new oK(t);default:Oe(t)}};class _A{constructor(e){this.graphviz=e}get port(){return this.graphviz}changePort(e){this.graphviz=e}async layout(e){try{let n=await this.dot(e);const r=await this.graphviz.layoutJson(n);let i=kA(r,e);if(e.manualLayout){const s=QV(i,e.manualLayout);if(s.diagram)i=s.diagram;else{if(s.relayout.nodes.length>0){const o=AA(e);if(o.hasEdgesWithCompounds)xt.warn(`Manual layout for view ${e.id} is ignored, as edges with compounds are not supported`);else{o.applyManualLayout(s.relayout);const a=await this.graphviz.layoutJson(o.print());i=kA(a,e)}}i.hasLayoutDrift=!0}}return n=n.split(`
216
- `).filter(s=>!(s.includes("margin")&&s.includes("50.1"))).join(`
217
- `),{dot:n,diagram:i}}catch(n){throw new Error(`Error during layout: ${e.id}`,{cause:n})}}async svg(e){let n=await this.dot(e);return n=n.split(`
218
- `).filter(r=>!(r.includes("margin")&&r.includes("50.1"))).join(`
219
- `),{svg:await this.graphviz.svg(n),dot:n}}async dot(e){let n=AA(e).print();if(!ka.isElement(e))return n;try{return await this.graphviz.unflatten(n)}catch(r){return xt.warn(`Error during unflatten: ${e.id}`,r),n}}async layoutOverviewGraph(e){if(e.length===0)return Promise.resolve({nodes:[],edges:[],bounds:{x:0,y:0,width:10,height:10}});const n=_0.toDot(e),r=await this.graphviz.layoutJson(n);return uK(r)}}const lK=dw(1);let PA=class Bm{static _graphviz=null;graphviz(){return Promise.resolve().then(()=>Bm._graphviz??=Wm.load())}async attempt(e,n){return await lK(async()=>{const r=xt.withTag("graphviz-wasm");try{return await n()}catch(i){r.error(`FAILED GraphvizWasmAdapter: ${e}`,i),Wm.unload(),Bm._graphviz=null}r.warn("Retrying..."),await nD(50,300);try{return await n()}finally{Wm.unload(),Bm._graphviz=null}})}async unflatten(e){return await this.attempt(`unflatten
220
- ${e}`,async()=>(await this.graphviz()).unflatten(e,1,!1,3).replaceAll(/\t\[/g," [").replaceAll(/\t/g," "))}async acyclic(e){return await this.attempt(`acyclic
221
- ${e}`,async()=>{const n=(await this.graphviz()).acyclic(e,!0);return n.acyclic&&n.outFile||e})}async layoutJson(e){return await this.attempt(`dot
222
- ${e}`,async()=>(await this.graphviz()).layout(e,"json",void 0,{yInvert:!0}))}async svg(e){return await this.attempt(`svg
223
- ${e}`,async()=>(await this.graphviz()).layout(e,"svg"))}};const yw="DeploymentElement";function xA(t){return Y.isInstance(t,yw)}const sh="DeploymentViewRule";function dK(t){return Y.isInstance(t,sh)}const Ku="DynamicViewRule";function vw(t){return Y.isInstance(t,Ku)}const Yu="ElementExpression";function ww(t){return Y.isInstance(t,Yu)}const oh="ElementPredicate";function fK(t){return Y.isInstance(t,oh)}const ah="ElementPredicateOrWhere";function pK(t){return Y.isInstance(t,ah)}const Js="ElementProperty";function hK(t){return Y.isInstance(t,Js)}const bw="ExpressionV2";function mK(t){return Y.isInstance(t,bw)}const Xu="FqnExpr";function gK(t){return Y.isInstance(t,Xu)}const Dw="FqnReferenceable",Zs="LikeC4View";function Ew(t){return Y.isInstance(t,Zs)}const ch="MetadataProperty";function Qo(t){return Y.isInstance(t,ch)}const Rw="Predicate";function yK(t){return Y.isInstance(t,Rw)}const Ju="Referenceable",uh="RelationExpr";function IA(t){return Y.isInstance(t,uh)}const lh="RelationExpression";function $w(t){return Y.isInstance(t,lh)}const dh="RelationPredicate";function vK(t){return Y.isInstance(t,dh)}const fh="RelationPredicateOrWhere";function wK(t){return Y.isInstance(t,fh)}const Tw="RelationPredicateOrWhereV2",Zu="RelationProperty",ph="RelationshipStyleProperty";function NA(t){return Y.isInstance(t,ph)}const ea="StringProperty";function OA(t){return Y.isInstance(t,ea)}const Qu="StyleProperty";function Sw(t){return Y.isInstance(t,Qu)}const hh="ViewProperty";function bK(t){return Y.isInstance(t,hh)}const el="ViewRule";function DK(t){return Y.isInstance(t,el)}const mh="ViewRulePredicate";function gh(t){return Y.isInstance(t,mh)}const yh="ViewRuleStyleOrGlobalRef";function kw(t){return Y.isInstance(t,yh)}const tl="WhereElement";function FA(t){return Y.isInstance(t,tl)}const nl="WhereElementExpression";function EK(t){return Y.isInstance(t,nl)}const LA="WhereExpression",vh="WhereKindEqual";function RK(t){return Y.isInstance(t,vh)}const rl="WhereRelation";function MA(t){return Y.isInstance(t,rl)}const il="WhereRelationExpression";function $K(t){return Y.isInstance(t,il)}const wh="WhereTagEqual";function TK(t){return Y.isInstance(t,wh)}const sl="ArrowProperty";function ol(t){return Y.isInstance(t,sl)}const al="BorderProperty";function bh(t){return Y.isInstance(t,al)}const cl="ColorProperty";function Qs(t){return Y.isInstance(t,cl)}const eo="CustomColor",Dh="CustomElementProperties";function SK(t){return Y.isInstance(t,Dh)}const Eh="CustomRelationProperties";function kK(t){return Y.isInstance(t,Eh)}const Yi="DeployedInstance";function Mr(t){return Y.isInstance(t,Yi)}const Cw="DeployedInstanceBody",Xi="DeploymentNode";function Nn(t){return Y.isInstance(t,Xi)}const Aw="DeploymentNodeBody",ta="DeploymentNodeKind",Rh="DeploymentRelation";function to(t){return Y.isInstance(t,Rh)}const _w="DeploymentRelationBody",ul="DeploymentView";function BA(t){return Y.isInstance(t,ul)}const Pw="DeploymentViewBody",ll="DeploymentViewRulePredicate";function xw(t){return Y.isInstance(t,ll)}const Iw="DeploymentViewRulePredicateExpression",dl="DeploymentViewRuleStyle";function CK(t){return Y.isInstance(t,dl)}const fl="DirectedRelationExpr";function zA(t){return Y.isInstance(t,fl)}const pl="DirectedRelationExpression";function Nw(t){return Y.isInstance(t,pl)}const na="DynamicView";function qA(t){return Y.isInstance(t,na)}const $h="DynamicViewBody";function AK(t){return Y.isInstance(t,$h)}const hl="DynamicViewGlobalPredicateRef";function _K(t){return Y.isInstance(t,hl)}const ml="DynamicViewIncludePredicate";function PK(t){return Y.isInstance(t,ml)}const Th="DynamicViewParallelSteps";function Ow(t){return Y.isInstance(t,Th)}const Sh="DynamicViewPredicateIterator";function jA(t){return Y.isInstance(t,Sh)}const Fw="DynamicViewRef",kh="DynamicViewStep";function Lw(t){return Y.isInstance(t,kh)}const rr="Element";function Wn(t){return Y.isInstance(t,rr)}const Ch="ElementBody";function gl(t){return Y.isInstance(t,Ch)}const yl="ElementDescedantsExpression";function Mw(t){return Y.isInstance(t,yl)}const Ah="ElementExpressionsIterator";function xK(t){return Y.isInstance(t,Ah)}const Ji="ElementKind";function IK(t){return Y.isInstance(t,Ji)}const vl="ElementKindExpression";function _h(t){return Y.isInstance(t,vl)}const wl="ElementPredicateWhere";function Bw(t){return Y.isInstance(t,wl)}const bl="ElementPredicateWith";function Ph(t){return Y.isInstance(t,bl)}const Dl="ElementRef";function El(t){return Y.isInstance(t,Dl)}const Rl="ElementStringProperty";function $l(t){return Y.isInstance(t,Rl)}const Tl="ElementStyleProperty";function Zi(t){return Y.isInstance(t,Tl)}const Sl="ElementTagExpression";function xh(t){return Y.isInstance(t,Sl)}const ra="ElementView";function Ih(t){return Y.isInstance(t,ra)}const Nh="ElementViewBody";function UA(t){return Y.isInstance(t,Nh)}const zw="ElementViewRef",kl="ExcludePredicate";function Oh(t){return Y.isInstance(t,kl)}const Cl="ExpandElementExpression";function GA(t){return Y.isInstance(t,Cl)}const no="ExtendElement";function ia(t){return Y.isInstance(t,no)}const Fh="ExtendElementBody";function WA(t){return Y.isInstance(t,Fh)}const Lh="FqnElementRef";function HA(t){return Y.isInstance(t,Lh)}const qw="FqnExpressions",Mh="FqnRef";function VA(t){return Y.isInstance(t,Mh)}const Al="FqnRefExpr";function jw(t){return Y.isInstance(t,Al)}const sa="GlobalDynamicPredicateGroup";function KA(t){return Y.isInstance(t,sa)}const oa="GlobalPredicateGroup";function YA(t){return Y.isInstance(t,oa)}const aa="Globals";function Uw(t){return Y.isInstance(t,aa)}const Bh="GlobalStyle";function _l(t){return Y.isInstance(t,Bh)}const zh="GlobalStyleGroup";function Pl(t){return Y.isInstance(t,zh)}const xl="GlobalStyleId",Il="IconProperty";function Br(t){return Y.isInstance(t,Il)}const Nl="IncludePredicate";function Gw(t){return Y.isInstance(t,Nl)}const Ol="IncomingRelationExpr";function XA(t){return Y.isInstance(t,Ol)}const Fl="IncomingRelationExpression";function JA(t){return Y.isInstance(t,Fl)}const Ll="InOutRelationExpr";function NK(t){return Y.isInstance(t,Ll)}const Ml="InOutRelationExpression";function Ww(t){return Y.isInstance(t,Ml)}const ro="LibIcon";function OK(t){return Y.isInstance(t,ro)}const qh="LikeC4Grammar";function FK(t){return Y.isInstance(t,qh)}const jh="LikeC4Lib";function ZA(t){return Y.isInstance(t,jh)}const Bl="LineProperty";function zl(t){return Y.isInstance(t,Bl)}const ql="LinkProperty";function Uh(t){return Y.isInstance(t,ql)}const jl="MetadataAttribute";function LK(t){return Y.isInstance(t,jl)}const Ul="MetadataBody";function MK(t){return Y.isInstance(t,Ul)}const ca="Model";function QA(t){return Y.isInstance(t,ca)}const Gl="ModelDeployments",ua="ModelViews";function Wl(t){return Y.isInstance(t,ua)}const Gh="NavigateToProperty";function Wh(t){return Y.isInstance(t,Gh)}const Hl="NotationProperty";function la(t){return Y.isInstance(t,Hl)}const Vl="NotesProperty";function e_(t){return Y.isInstance(t,Vl)}const Kl="OpacityProperty";function Hh(t){return Y.isInstance(t,Kl)}const Yl="OutgoingRelationExpr";function t_(t){return Y.isInstance(t,Yl)}const Xl="OutgoingRelationExpression";function Hw(t){return Y.isInstance(t,Xl)}const Vh="Predicates";function n_(t){return Y.isInstance(t,Vh)}const Kh="Relation";function zr(t){return Y.isInstance(t,Kh)}const Yh="RelationBody";function BK(t){return Y.isInstance(t,Yh)}const Jl="RelationNavigateToProperty";function Zl(t){return Y.isInstance(t,Jl)}const Ql="RelationPredicateWhere";function Vw(t){return Y.isInstance(t,Ql)}const ed="RelationPredicateWhereV2";function zK(t){return Y.isInstance(t,ed)}const td="RelationPredicateWith";function Kw(t){return Y.isInstance(t,td)}const Qi="RelationshipKind";function qK(t){return Y.isInstance(t,Qi)}const nd="RelationStringProperty";function rd(t){return Y.isInstance(t,nd)}const id="RelationStyleProperty";function Xh(t){return Y.isInstance(t,id)}const sd="ShapeProperty";function Jh(t){return Y.isInstance(t,sd)}const Zh="SpecificationColor";function Qh(t){return Y.isInstance(t,Zh)}const da="SpecificationDeploymentNodeKind";function em(t){return Y.isInstance(t,da)}const fa="SpecificationElementKind";function pa(t){return Y.isInstance(t,fa)}const od="SpecificationElementStringProperty";function Yw(t){return Y.isInstance(t,od)}const ha="SpecificationRelationshipKind";function ma(t){return Y.isInstance(t,ha)}const ad="SpecificationRelationshipStringProperty";function r_(t){return Y.isInstance(t,ad)}const ga="SpecificationRule";function Xw(t){return Y.isInstance(t,ga)}const ya="SpecificationTag";function tm(t){return Y.isInstance(t,ya)}const es="Tag";function i_(t){return Y.isInstance(t,es)}const nm="Tags";function Jw(t){return Y.isInstance(t,nm)}const Zw="ViewRef",cd="ViewRuleAutoLayout";function ud(t){return Y.isInstance(t,cd)}const ld="ViewRuleGlobalPredicateRef";function jK(t){return Y.isInstance(t,ld)}const dd="ViewRuleGlobalStyle";function s_(t){return Y.isInstance(t,dd)}const fd="ViewRuleGroup";function rm(t){return Y.isInstance(t,fd)}const pd="ViewRuleStyle";function hd(t){return Y.isInstance(t,pd)}const md="ViewStringProperty";function UK(t){return Y.isInstance(t,md)}const gd="WhereBinaryExpression";function GK(t){return Y.isInstance(t,gd)}const yd="WhereElementKind";function WK(t){return Y.isInstance(t,yd)}const vd="WhereElementNegation";function o_(t){return Y.isInstance(t,vd)}const wd="WhereElementTag";function HK(t){return Y.isInstance(t,wd)}const bd="WhereRelationKind";function a_(t){return Y.isInstance(t,bd)}const Dd="WhereRelationNegation";function c_(t){return Y.isInstance(t,Dd)}const Ed="WhereRelationTag";function VK(t){return Y.isInstance(t,Ed)}const Rd="WildcardExpression";function io(t){return Y.isInstance(t,Rd)}class u_ extends QD{getAllTypes(){return[sl,al,cl,eo,Dh,Eh,Yi,Cw,yw,Xi,Aw,ta,Rh,_w,ul,Pw,sh,ll,Iw,dl,fl,pl,na,$h,hl,ml,Th,Sh,Fw,Ku,kh,rr,Ch,yl,Yu,Ah,Ji,vl,oh,ah,wl,bl,Js,Dl,Rl,Tl,Sl,ra,Nh,zw,kl,Cl,bw,no,Fh,Lh,Xu,qw,Mh,Al,Dw,sa,oa,Bh,zh,xl,aa,Il,Ll,Ml,Nl,Ol,Fl,ro,qh,jh,Zs,Bl,ql,jl,Ul,ch,ca,Gl,ua,Gh,Hl,Vl,Kl,Yl,Xl,Rw,Vh,Ju,Kh,Yh,uh,lh,Jl,dh,fh,Tw,Ql,ed,td,Zu,nd,id,Qi,ph,sd,Zh,da,fa,od,ha,ad,ga,ya,ea,Qu,es,nm,hh,Zw,el,cd,ld,dd,fd,mh,pd,yh,md,gd,tl,nl,yd,vd,wd,LA,vh,rl,il,bd,Dd,Ed,wh,Rd]}computeIsSubtype(e,n){switch(e){case sl:case Bl:return this.isSubtype(ph,n);case al:case Kl:case sd:return this.isSubtype(Qu,n);case cl:return this.isSubtype(ph,n)||this.isSubtype(Qu,n);case Yi:case Xi:return this.isSubtype(yw,n)||this.isSubtype(Ju,n);case ul:case na:case ra:return this.isSubtype(Zs,n);case ll:case dl:return this.isSubtype(sh,n);case fl:case Ol:case Ll:case Yl:return this.isSubtype(uh,n);case pl:case Fl:case Ml:case Xl:return this.isSubtype(lh,n);case hl:case ml:return this.isSubtype(Ku,n);case rr:return this.isSubtype(Dw,n)||this.isSubtype(Ju,n);case yl:case vl:case Dl:case Sl:case Cl:return this.isSubtype(Yu,n);case Yu:case wl:return this.isSubtype(ah,n);case oh:case dh:return this.isSubtype(Rw,n);case ah:case bl:return this.isSubtype(oh,n);case Rl:return this.isSubtype(Js,n)||this.isSubtype(ea,n);case Tl:return this.isSubtype(Js,n);case kl:case Nl:return this.isSubtype(mh,n);case no:case Ju:return this.isSubtype(Dw,n);case Xu:case Tw:return this.isSubtype(bw,n);case Al:return this.isSubtype(Xu,n);case Il:return this.isSubtype(Js,n)||this.isSubtype(Qu,n);case ql:return this.isSubtype(Js,n)||this.isSubtype(Zu,n)||this.isSubtype(hh,n);case jl:case Hl:case Vl:case od:case ad:return this.isSubtype(ea,n);case Ul:return this.isSubtype(ch,n);case ch:return this.isSubtype(Js,n)||this.isSubtype(Zu,n);case uh:case ed:return this.isSubtype(Tw,n);case lh:case Ql:return this.isSubtype(fh,n);case Jl:case id:return this.isSubtype(Zu,n);case fh:case td:return this.isSubtype(dh,n);case nd:return this.isSubtype(Zu,n)||this.isSubtype(ea,n);case cd:return this.isSubtype(sh,n)||this.isSubtype(Ku,n)||this.isSubtype(el,n);case ld:case fd:case mh:return this.isSubtype(el,n);case dd:case pd:return this.isSubtype(yh,n);case yh:return this.isSubtype(Ku,n)||this.isSubtype(el,n);case md:return this.isSubtype(ea,n)||this.isSubtype(hh,n);case gd:return this.isSubtype(nl,n)||this.isSubtype(il,n);case tl:case vd:return this.isSubtype(nl,n);case nl:case il:return this.isSubtype(LA,n);case yd:return this.isSubtype(tl,n)||this.isSubtype(vh,n);case wd:return this.isSubtype(tl,n)||this.isSubtype(wh,n);case rl:case Dd:return this.isSubtype(il,n);case bd:return this.isSubtype(vh,n)||this.isSubtype(rl,n);case Ed:return this.isSubtype(rl,n)||this.isSubtype(wh,n);case Rd:return this.isSubtype(Yu,n)||this.isSubtype(Xu,n);default:return!1}}getReferenceType(e){const n=`${e.container.$type}:${e.property}`;switch(n){case"ColorProperty:customColor":return eo;case"DeploymentNode:kind":return ta;case"DeploymentRelation:kind":case"DynamicViewStep:kind":case"OutgoingRelationExpr:kind":case"OutgoingRelationExpression:kind":case"Relation:kind":case"WhereRelationKind:value":return Qi;case"DynamicViewGlobalPredicateRef:predicate":return sa;case"DynamicViewRef:view":return na;case"Element:kind":case"ElementKindExpression:kind":case"WhereElementKind:value":return Ji;case"ElementRef:el":case"FqnElementRef:el":return rr;case"ElementTagExpression:tag":case"Tags:values":case"WhereElementTag:value":case"WhereRelationTag:value":return es;case"ElementViewRef:view":return ra;case"FqnRef:value":return Ju;case"IconProperty:libicon":return ro;case"ViewRef:view":return Zs;case"ViewRuleGlobalPredicateRef:predicate":return oa;case"ViewRuleGlobalStyle:style":return xl;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case sl:return{name:sl,properties:[{name:"key"},{name:"value"}]};case al:return{name:al,properties:[{name:"key"},{name:"value"}]};case cl:return{name:cl,properties:[{name:"customColor"},{name:"key"},{name:"themeColor"}]};case eo:return{name:eo,properties:[{name:"name"}]};case Dh:return{name:Dh,properties:[{name:"props",defaultValue:[]}]};case Eh:return{name:Eh,properties:[{name:"props",defaultValue:[]}]};case Yi:return{name:Yi,properties:[{name:"body"},{name:"element"},{name:"name"},{name:"title"}]};case Cw:return{name:Cw,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case Xi:return{name:Xi,properties:[{name:"body"},{name:"kind"},{name:"name"},{name:"title"}]};case Aw:return{name:Aw,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case ta:return{name:ta,properties:[{name:"name"}]};case Rh:return{name:Rh,properties:[{name:"body"},{name:"kind"},{name:"source"},{name:"tags"},{name:"target"},{name:"technology"},{name:"title"}]};case _w:return{name:_w,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case ul:return{name:ul,properties:[{name:"body"},{name:"name"}]};case Pw:return{name:Pw,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"tags"}]};case ll:return{name:ll,properties:[{name:"expr"},{name:"isInclude",defaultValue:!1}]};case Iw:return{name:Iw,properties:[{name:"prev"},{name:"value"}]};case dl:return{name:dl,properties:[{name:"props",defaultValue:[]},{name:"targets"}]};case fl:return{name:fl,properties:[{name:"source"},{name:"target"}]};case pl:return{name:pl,properties:[{name:"source"},{name:"target"}]};case na:return{name:na,properties:[{name:"body"},{name:"name"}]};case $h:return{name:$h,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"steps",defaultValue:[]},{name:"tags"}]};case hl:return{name:hl,properties:[{name:"predicate"}]};case ml:return{name:ml,properties:[{name:"predicates"}]};case Th:return{name:Th,properties:[{name:"steps",defaultValue:[]}]};case Sh:return{name:Sh,properties:[{name:"prev"},{name:"value"}]};case Fw:return{name:Fw,properties:[{name:"view"}]};case kh:return{name:kh,properties:[{name:"custom"},{name:"isBackward",defaultValue:!1},{name:"kind"},{name:"source"},{name:"target"},{name:"title"}]};case rr:return{name:rr,properties:[{name:"body"},{name:"kind"},{name:"name"},{name:"props",defaultValue:[]}]};case Ch:return{name:Ch,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case yl:return{name:yl,properties:[{name:"parent"},{name:"suffix"}]};case Ah:return{name:Ah,properties:[{name:"prev"},{name:"value"}]};case Ji:return{name:Ji,properties:[{name:"name"}]};case vl:return{name:vl,properties:[{name:"isEqual",defaultValue:!1},{name:"kind"}]};case wl:return{name:wl,properties:[{name:"subject"},{name:"where"}]};case bl:return{name:bl,properties:[{name:"custom"},{name:"subject"}]};case Dl:return{name:Dl,properties:[{name:"el"},{name:"parent"}]};case Rl:return{name:Rl,properties:[{name:"key"},{name:"value"}]};case Tl:return{name:Tl,properties:[{name:"key"},{name:"props",defaultValue:[]}]};case Sl:return{name:Sl,properties:[{name:"isEqual",defaultValue:!1},{name:"tag"}]};case ra:return{name:ra,properties:[{name:"body"},{name:"extends"},{name:"name"},{name:"viewOf"}]};case Nh:return{name:Nh,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"tags"}]};case zw:return{name:zw,properties:[{name:"view"}]};case kl:return{name:kl,properties:[{name:"predicates"}]};case Cl:return{name:Cl,properties:[{name:"expand"}]};case no:return{name:no,properties:[{name:"body"},{name:"element"}]};case Fh:return{name:Fh,properties:[{name:"elements",defaultValue:[]}]};case Lh:return{name:Lh,properties:[{name:"el"},{name:"parent"}]};case qw:return{name:qw,properties:[{name:"prev"},{name:"value"}]};case Mh:return{name:Mh,properties:[{name:"parent"},{name:"value"}]};case Al:return{name:Al,properties:[{name:"ref"},{name:"selector"}]};case sa:return{name:sa,properties:[{name:"name"},{name:"predicates",defaultValue:[]}]};case oa:return{name:oa,properties:[{name:"name"},{name:"predicates",defaultValue:[]}]};case aa:return{name:aa,properties:[{name:"name"},{name:"predicates",defaultValue:[]},{name:"styles",defaultValue:[]}]};case Bh:return{name:Bh,properties:[{name:"id"},{name:"props",defaultValue:[]},{name:"target"}]};case zh:return{name:zh,properties:[{name:"id"},{name:"styles",defaultValue:[]}]};case xl:return{name:xl,properties:[{name:"name"}]};case Il:return{name:Il,properties:[{name:"key"},{name:"libicon"},{name:"value"}]};case Nl:return{name:Nl,properties:[{name:"predicates"}]};case Ol:return{name:Ol,properties:[{name:"to"}]};case Fl:return{name:Fl,properties:[{name:"to"}]};case Ll:return{name:Ll,properties:[{name:"inout"}]};case Ml:return{name:Ml,properties:[{name:"inout"}]};case ro:return{name:ro,properties:[{name:"name"}]};case qh:return{name:qh,properties:[{name:"deployments",defaultValue:[]},{name:"globals",defaultValue:[]},{name:"likec4lib",defaultValue:[]},{name:"models",defaultValue:[]},{name:"specifications",defaultValue:[]},{name:"views",defaultValue:[]}]};case jh:return{name:jh,properties:[{name:"icons",defaultValue:[]}]};case Bl:return{name:Bl,properties:[{name:"key"},{name:"value"}]};case ql:return{name:ql,properties:[{name:"key"},{name:"title"},{name:"value"}]};case jl:return{name:jl,properties:[{name:"key"},{name:"value"}]};case Ul:return{name:Ul,properties:[{name:"props",defaultValue:[]}]};case ca:return{name:ca,properties:[{name:"elements",defaultValue:[]},{name:"name"}]};case Gl:return{name:Gl,properties:[{name:"elements",defaultValue:[]},{name:"name"}]};case ua:return{name:ua,properties:[{name:"name"},{name:"styles",defaultValue:[]},{name:"views",defaultValue:[]}]};case Gh:return{name:Gh,properties:[{name:"key"},{name:"value"}]};case Hl:return{name:Hl,properties:[{name:"key"},{name:"value"}]};case Vl:return{name:Vl,properties:[{name:"key"},{name:"value"}]};case Kl:return{name:Kl,properties:[{name:"key"},{name:"value"}]};case Yl:return{name:Yl,properties:[{name:"from"},{name:"isBidirectional",defaultValue:!1},{name:"kind"}]};case Xl:return{name:Xl,properties:[{name:"from"},{name:"isBidirectional",defaultValue:!1},{name:"kind"}]};case Vh:return{name:Vh,properties:[{name:"prev"},{name:"value"}]};case Kh:return{name:Kh,properties:[{name:"body"},{name:"kind"},{name:"source"},{name:"tags"},{name:"target"},{name:"technology"},{name:"title"}]};case Yh:return{name:Yh,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case Jl:return{name:Jl,properties:[{name:"key"},{name:"value"}]};case Ql:return{name:Ql,properties:[{name:"subject"},{name:"where"}]};case ed:return{name:ed,properties:[{name:"subject"},{name:"where"}]};case td:return{name:td,properties:[{name:"custom"},{name:"subject"}]};case Qi:return{name:Qi,properties:[{name:"name"}]};case nd:return{name:nd,properties:[{name:"key"},{name:"value"}]};case id:return{name:id,properties:[{name:"key"},{name:"props",defaultValue:[]}]};case sd:return{name:sd,properties:[{name:"key"},{name:"value"}]};case Zh:return{name:Zh,properties:[{name:"color"},{name:"name"}]};case da:return{name:da,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case fa:return{name:fa,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case od:return{name:od,properties:[{name:"key"},{name:"value"}]};case ha:return{name:ha,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case ad:return{name:ad,properties:[{name:"key"},{name:"value"}]};case ga:return{name:ga,properties:[{name:"colors",defaultValue:[]},{name:"deploymentNodes",defaultValue:[]},{name:"elements",defaultValue:[]},{name:"name"},{name:"relationships",defaultValue:[]},{name:"tags",defaultValue:[]}]};case ya:return{name:ya,properties:[{name:"tag"}]};case es:return{name:es,properties:[{name:"name"}]};case nm:return{name:nm,properties:[{name:"prev"},{name:"values",defaultValue:[]}]};case Zw:return{name:Zw,properties:[{name:"view"}]};case cd:return{name:cd,properties:[{name:"direction"},{name:"nodeSep"},{name:"rankSep"}]};case ld:return{name:ld,properties:[{name:"predicate"}]};case dd:return{name:dd,properties:[{name:"style"}]};case fd:return{name:fd,properties:[{name:"groupRules",defaultValue:[]},{name:"props",defaultValue:[]},{name:"title"}]};case pd:return{name:pd,properties:[{name:"props",defaultValue:[]},{name:"target"}]};case md:return{name:md,properties:[{name:"key"},{name:"value"}]};case gd:return{name:gd,properties:[{name:"left"},{name:"operator"},{name:"right"}]};case yd:return{name:yd,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case vd:return{name:vd,properties:[{name:"value"}]};case wd:return{name:wd,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case bd:return{name:bd,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Dd:return{name:Dd,properties:[{name:"value"}]};case Ed:return{name:Ed,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Rd:return{name:Rd,properties:[{name:"isWildcard",defaultValue:!1}]};default:return{name:e,properties:[]}}}}const Y=new u_;let l_;const KK=()=>l_??(l_=wj(`{"$type":"Grammar","isDeclared":true,"name":"LikeC4","rules":[{"$type":"ParserRule","name":"LikeC4Grammar","entry":true,"definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"specifications","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"models","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"views","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]}},{"$type":"Assignment","feature":"globals","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@119"},"arguments":[]}},{"$type":"Assignment","feature":"deployments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@95"},"arguments":[]}},{"$type":"Assignment","feature":"likec4lib","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LikeC4Lib","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"likec4lib"},{"$type":"Keyword","value":"{"},{"$type":"Keyword","value":"icons"},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"icons","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LibIcon","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@142"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementKind","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Tag","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationshipKind","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomColor","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentNodeKind","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationRule","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"specification"}},{"$type":"Keyword","value":"{"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"relationships","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"colors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"deploymentNodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationElementKind","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"element"},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@133"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationElementStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"notation"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationDeploymentNodeKind","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"deploymentNode"},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@133"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationTag","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"tag"},{"$type":"Assignment","feature":"tag","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationColor","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"color"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"color","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@141"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationRelationshipKind","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"relationship"},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@136"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationRelationshipStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"notation"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Model","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"model"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":true},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Element","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false}}]}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]}},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}],"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@133"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@125"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"title"},{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"description"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExtendElement","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"extend"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExtendElementBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":true},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnElementRef","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FqnElementRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@160"},"arguments":[]},{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementRef","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@160"},"arguments":[]},{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Tags","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"values","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@144"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Tags"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"values","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@144"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"*"}],"cardinality":"*"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Relation","parameters":[{"$type":"Parameter","name":"isExplicit"}],"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","guardCondition":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@26/parameters@0"}},"elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}}]},{"$type":"Group","guardCondition":{"$type":"Negation","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@26/parameters@0"}}},"elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"?"}]}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Keyword","value":"->"}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]}},{"$type":"Assignment","feature":"technology","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"RelationBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@94"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@125"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"title"},{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"description"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationStyleProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"style"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@136"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MetadataProperty","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"metadata"},{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MetadataBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MetadataAttribute","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ModelViews","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"views"}},{"$type":"Keyword","value":"{"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"views","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]}},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@87"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LikeC4ViewRule","returnType":{"$ref":"#/types@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@103"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementView","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"view"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"extends"},{"$type":"Assignment","feature":"extends","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"of"},{"$type":"Assignment","feature":"viewOf","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}}]}],"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicView","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"dynamic"},{"$type":"Keyword","value":"view"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRef","definition":{"$type":"Assignment","feature":"view","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@0"},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementViewRef","definition":{"$type":"Assignment","feature":"view","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@36"},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewRef","definition":{"$type":"Assignment","feature":"view","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@37"},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementViewBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]},"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"steps","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}]}},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@125"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"title"},{"$type":"Keyword","value":"description"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewLayoutDirection","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"TopBottom"},{"$type":"Keyword","value":"LeftRight"},{"$type":"Keyword","value":"BottomTop"},{"$type":"Keyword","value":"RightLeft"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@87"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@126"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@131"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@127"},"arguments":[]}]},"cardinality":"*"},{"$type":"Assignment","feature":"groupRules","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@82"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@83"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@87"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewParallelSteps","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"parallel"},{"$type":"Keyword","value":"par"}]},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"steps","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewStep","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isBackward","operator":"?=","terminal":{"$type":"Keyword","value":"<-"}},{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@92"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRulePredicate","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"IncludePredicate"}},{"$type":"Keyword","value":"include"},{"$type":"Assignment","feature":"predicates","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ExcludePredicate"}},{"$type":"Keyword","value":"exclude"},{"$type":"Assignment","feature":"predicates","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Predicates","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Predicates"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Predicate","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@67"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleGlobalPredicateRef","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"global"},{"$type":"Keyword","value":"predicate"},{"$type":"Assignment","feature":"predicate","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@120"},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicate","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@56"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicates","inferredType":{"$type":"InferredType","name":"ElementPredicate"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@57"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementPredicateWith"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"with"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@91"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicateOrWhere","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementPredicateWhere"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementExpression","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementOr","inferredType":{"$type":"InferredType","name":"WhereElementExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"or"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementAnd","inferredType":{"$type":"InferredType","name":"WhereElementExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"and"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementPrimary","inferredType":{"$type":"InferredType","name":"WhereElementExpression"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]},{"$type":"Keyword","value":")"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementNegation","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"not"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElement","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereElementTag"}},{"$type":"Keyword","value":"tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@144"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereElementKind"}},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementExpression","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementSelectorExpression","inferredType":{"$type":"InferredType","name":"ElementExpression"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WildcardExpression"}},{"$type":"Assignment","feature":"isWildcard","operator":"?=","terminal":{"$type":"Keyword","value":"*"}}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementTagExpression"}},{"$type":"Keyword","value":"element.tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@149"},"arguments":[]},{"$type":"Assignment","feature":"tag","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@144"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementKindExpression"}},{"$type":"Keyword","value":"element.kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@149"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementDescedantsExpression","inferredType":{"$type":"InferredType","name":"ElementExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ExpandElementExpression"},"feature":"expand","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@157"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementDescedantsExpression"},"feature":"parent","operator":"="},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@158"},"arguments":[]}}]}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicate","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@68"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicates","inferredType":{"$type":"InferredType","name":"RelationPredicate"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@69"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"RelationPredicateWith"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"with"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@92"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicateOrWhere","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@76"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"RelationPredicateWhere"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@70"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationExpression","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@71"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationOr","inferredType":{"$type":"InferredType","name":"WhereRelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@72"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"or"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@72"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationAnd","inferredType":{"$type":"InferredType","name":"WhereRelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@73"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"and"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@73"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationPrimary","inferredType":{"$type":"InferredType","name":"WhereRelationExpression"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@70"},"arguments":[]},{"$type":"Keyword","value":")"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@74"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@75"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationNegation","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"not"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@70"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelation","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationTag"}},{"$type":"Keyword","value":"tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@144"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationKind"}},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationExpression","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@77"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@79"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"InOutRelationExpressions","inferredType":{"$type":"InferredType","name":"RelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@78"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"InOutRelationExpression"},"feature":"inout","operator":"="},{"$type":"Keyword","value":"->"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IncomingRelationExpression","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DirectedRelationExpressions","inferredType":{"$type":"InferredType","name":"RelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@80"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DirectedRelationExpression"},"feature":"source","operator":"="},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"OutgoingRelationExpression","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isBidirectional","operator":"?=","terminal":{"$type":"Keyword","value":"<->"}},{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementExpressionsIterator","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementExpressionsIterator"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewIncludePredicate","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"include"},{"$type":"Assignment","feature":"predicates","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@84"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewGlobalPredicateRef","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"global"},{"$type":"Keyword","value":"predicate"},{"$type":"Assignment","feature":"predicate","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@121"},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewPredicateIterator","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DynamicViewPredicateIterator"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@81"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@132"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleGlobalStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"global"},{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"style","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@122"},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleStyleOrGlobalRef","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@85"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@86"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleAutoLayout","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"autoLayout"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"rankSep","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@167"},"arguments":[]}},{"$type":"Assignment","feature":"nodeSep","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@167"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NotationProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"notation"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NotesProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"notes"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomElementProperties","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@93"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@132"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomRelationProperties","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@94"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@90"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@136"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NavigateToProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"navigateTo"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationNavigateToProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"navigateTo"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ModelDeployments","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"deployment"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@96"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@101"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentNode","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},"deprecatedSyntax":false}}]}]},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@97"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentNodeBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@98"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@101"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@96"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeployedInstance","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]}],"cardinality":"?"},{"$type":"Keyword","value":"instanceOf"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@99"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeployedInstanceBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnRef","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@6"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FqnRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@160"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@6"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentRelation","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@100"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@100"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]}},{"$type":"Assignment","feature":"technology","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@102"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentRelationBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentView","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"deployment"},{"$type":"Keyword","value":"view"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@104"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@105"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@107"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@106"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewRuleStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"targets","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@118"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@132"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewRulePredicate","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isInclude","operator":"?=","terminal":{"$type":"Keyword","value":"include"}},{"$type":"Keyword","value":"exclude"}]},{"$type":"Assignment","feature":"expr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@108"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewRulePredicateExpression","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@109"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DeploymentViewRulePredicateExpression"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@109"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExpressionV2","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicateOrWhereV2","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@113"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"RelationPredicateWhereV2"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@70"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnExpr","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WildcardExpression"}},{"$type":"Assignment","feature":"isWildcard","operator":"?=","terminal":{"$type":"Keyword","value":"*"}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@112"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnRefExpr","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"ref","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@100"},"arguments":[]}},{"$type":"Assignment","feature":"selector","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@157"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@158"},"arguments":[]}]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationExpr","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@114"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@116"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"InOutRelationExpr","inferredType":{"$type":"InferredType","name":"RelationExpr"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@115"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"InOutRelationExpr"},"feature":"inout","operator":"="},{"$type":"Keyword","value":"->"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IncomingRelationExpr","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DirectedRelationExpr","inferredType":{"$type":"InferredType","name":"RelationExpr"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DirectedRelationExpr"},"feature":"source","operator":"="},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"OutgoingRelationExpr","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isBidirectional","operator":"?=","terminal":{"$type":"Keyword","value":"<->"}},{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnExpressions","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FqnExpressions"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Globals","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"global"}},{"$type":"Keyword","value":"{"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"predicates","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@120"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@121"},"arguments":[]}]},"cardinality":"*"},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@123"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@124"},"arguments":[]}]},"cardinality":"*"}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalPredicateGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"predicateGroup"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"predicates","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalDynamicPredicateGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"dynamicPredicateGroup"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"predicates","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@82"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalStyleId","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@122"},"arguments":[]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@81"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@132"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalStyleGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"styleGroup"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@122"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@85"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LinkProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"link"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@143"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ColorProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"color"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"themeColor","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@139"},"arguments":[]}},{"$type":"Assignment","feature":"customColor","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@6"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"OpacityProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"opacity"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IconProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"icon"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"libicon","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@142"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"none"},{"$type":"RuleCall","rule":{"$ref":"#/rules@143"},"arguments":[]}]}}]},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ShapeProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"shape"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@140"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"BorderStyleValue","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@137"},"arguments":[]},{"$type":"Keyword","value":"none"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"BorderProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"border"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@130"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"StyleProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@126"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@129"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@131"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@127"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementStyleProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"style"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@132"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LineProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"line"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@137"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ArrowProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"head"},{"$type":"Keyword","value":"tail"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@138"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationshipStyleProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@126"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@134"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LineOptions","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"solid"},{"$type":"Keyword","value":"dashed"},{"$type":"Keyword","value":"dotted"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ArrowType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"none"},{"$type":"Keyword","value":"normal"},{"$type":"Keyword","value":"onormal"},{"$type":"Keyword","value":"dot"},{"$type":"Keyword","value":"odot"},{"$type":"Keyword","value":"diamond"},{"$type":"Keyword","value":"odiamond"},{"$type":"Keyword","value":"crow"},{"$type":"Keyword","value":"open"},{"$type":"Keyword","value":"vee"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ThemeColor","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"primary"},{"$type":"Keyword","value":"secondary"},{"$type":"Keyword","value":"muted"},{"$type":"Keyword","value":"slate"},{"$type":"Keyword","value":"blue"},{"$type":"Keyword","value":"indigo"},{"$type":"Keyword","value":"sky"},{"$type":"Keyword","value":"red"},{"$type":"Keyword","value":"gray"},{"$type":"Keyword","value":"green"},{"$type":"Keyword","value":"amber"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementShape","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rectangle"},{"$type":"Keyword","value":"person"},{"$type":"Keyword","value":"browser"},{"$type":"Keyword","value":"mobile"},{"$type":"Keyword","value":"cylinder"},{"$type":"Keyword","value":"storage"},{"$type":"Keyword","value":"queue"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomColorValue","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@167"},"arguments":[]}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IconId","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@154"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Uri","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@155"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TagId","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DotId","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@161"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomColorId","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@140"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@138"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@137"},"arguments":[]},{"$type":"Keyword","value":"element"},{"$type":"Keyword","value":"model"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Id","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@140"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@139"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@138"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@137"},"arguments":[]},{"$type":"Keyword","value":"element"},{"$type":"Keyword","value":"model"},{"$type":"Keyword","value":"group"},{"$type":"Keyword","value":"node"},{"$type":"Keyword","value":"deployment"},{"$type":"Keyword","value":"instance"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EqOperator","fragment":true,"definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@162"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"is"}},{"$type":"Assignment","feature":"not","operator":"?=","terminal":{"$type":"Keyword","value":"not"},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IsEqual","fragment":true,"definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isEqual","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@162"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","hidden":true,"name":"BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/[\\\\r\\\\n]+/"},"fragment":false},{"$type":"TerminalRule","name":"LIB_ICON","definition":{"$type":"RegexToken","regex":"/(aws|azure|gcp|tech):[-\\\\w]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"URI_WITH_SCHEMA","definition":{"$type":"RegexToken","regex":"/\\\\w+:\\\\/\\\\/\\\\S+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"URI_RELATIVE","definition":{"$type":"RegexToken","regex":"/\\\\.{0,2}\\\\/[^\\\\/]\\\\S+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DotUnderscore","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\._(?![_a-zA-Z])/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DotWildcard","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\.\\\\*{1,2}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Hash","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"#"}},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"StickyDot","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\./"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Dot","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"."}},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NotEqual","definition":{"$type":"RegexToken","regex":"/\\\\!\\\\={1,2}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Eq","definition":{"$type":"RegexToken","regex":"/\\\\={1,2}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Percent","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\d+%/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"String","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"IdTerminal","definition":{"$type":"RegexToken","regex":"/[_]*[a-zA-Z][-\\\\w]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Number","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/\\\\b\\\\d+\\\\b/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Hex","definition":{"$type":"RegexToken","regex":"/\\\\b[a-zA-Z0-9]+\\\\b/"},"fragment":false,"hidden":false}],"types":[{"$type":"Type","name":"LikeC4View","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@36"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@37"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@103"}}]}},{"$type":"Type","name":"StringProperty","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@20"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@44"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@29"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@33"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@10"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@89"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@90"}}]}},{"$type":"Type","name":"WhereTagEqual","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@63/definition/elements@0/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@75/definition/elements@0/elements@0/inferredType"}}]}},{"$type":"Type","name":"WhereKindEqual","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@63/definition/elements@1/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@75/definition/elements@1/elements@0/inferredType"}}]}},{"$type":"Type","name":"WhereExpression","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@58"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@70"}}]}},{"$type":"Type","name":"DeploymentElement","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@96"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@98"}}]}},{"$type":"Type","name":"Referenceable","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@96"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@98"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@17"}}]}},{"$type":"Type","name":"FqnReferenceable","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/types@6"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@17"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@21"}}]}}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"interfaces":[],"usedGrammars":[]}`)),d_={languageId:"likec4",fileExtensions:[".c4",".likec4",".like-c4"],caseInsensitive:!1,mode:"production"},YK={skipValidations:!0,recoveryEnabled:!0,nodeLocationTracking:"full"},XK={AstReflection:()=>new u_},JK={Grammar:()=>KK(),LanguageMetaData:()=>d_,parser:{ParserConfig:()=>YK}};function $n(t){return t.el.ref}function im(t){const e=[t.el.$refText];let n=t.parent;for(;n;)e.push(n.el.$refText),n=n.parent;return e.length===1?e[0]:e.reverse().join(".")}const $d=Symbol.for("idattr"),sm={writeId(t,e){return t[$d]=e,t},readId(t){return t[$d]}},Td={writeId(t,e){return Et(e)?t[$d]=void 0:t[$d]=e,t},readId(t){return t[$d]}};function Sd(t){return t.textDocument.languageId===d_.languageId}function Qw(t){return Sd(t)&&t.state>=He.IndexedContent&&!!t.c4fqnIndex}function va(t){return Sd(t)&&t.state==He.Validated&&!!t.c4Specification&&!!t.c4Elements&&!!t.c4Relations&&!!t.c4Views&&!!t.c4fqnIndex&&!!t.c4Deployments&&!!t.c4DeploymentRelations}function*ZK(t){const e=Jm.from(t.parseResult.value.models.flatMap(i=>i.elements)),n=[];let r;for(;r=e.shift();){if(zr(r)){n.push(r);continue}if(ia(r)){if(r.body&&r.body.elements.length>0)for(const i of r.body.elements)e.push(i);continue}if(r.body&&r.body.elements.length>0)for(const i of r.body.elements)e.push(i);yield r}yield*n}function*QK(t){const e=Jm.from(t.parseResult.value.deployments.flatMap(i=>i.elements)),n=[];let r;for(;r=e.shift();){if(to(r)){n.push(r);continue}if(Nn(r)&&r.body&&r.body.elements.length>0)for(const i of r.body.elements)e.push(i);yield r}yield*n}function eY(t){const e=$n(t.target);if(!e)throw new Error("RelationRefError: Invalid reference to target");if(Qt(t.source)){const n=$n(t.source);if(!n)throw new Error("RelationRefError: Invalid reference to source");return{source:n,target:e}}if(!gl(t.$container))throw new Error("RelationRefError: Invalid container for sourceless relation");return{source:t.$container.$container,target:e}}function f_({value:t}){const e=parseFloat(t);return isNaN(e)?100:ZS(e,{min:0,max:100})}function ts(t,e){const n={};if(!t||t.length===0)return n;for(const r of t)if(e(r))switch(!0){case bh(r):{ue(r.value)&&(n.border=r.value);break}case Qs(r):{const i=kd(r);ue(i)&&(n.color=i);break}case Jh(r):{ue(r.value)&&(n.shape=r.value);break}case Br(r):{const i=r.libicon?.ref?.name??r.value;ue(i)&&(n.icon=i);break}case Hh(r):{n.opacity=f_(r);break}default:Oe(r)}return n}function tY(t,e){const n={};if(!t||t.length===0)return n;for(const r of t)if(e(r))switch(!0){case Qs(r):{const i=kd(r);ue(i)&&(n.color=i);break}case zl(r):{n.line=r.value;break}case ol(r):{switch(r.key){case"head":{n.head=r.value;break}case"tail":{n.tail=r.value;break}default:Oe(r)}break}default:Oe(r)}return n}function eb(t,e){const{color:n,line:r,head:i,tail:s}=tY(t?.filter(NA),e);return{...n&&n!==Ca?{color:n}:{},...r&&r!==sN?{line:r}:{},...i&&i!==ms?{head:i}:{},...s?{tail:s}:{}}}function kd(t){return t?.themeColor??t?.customColor?.$refText}function tb(t){const e=t.rankSep,n=t.nodeSep;let r;switch(t.direction){case"TopBottom":{r="TB";break}case"BottomTop":{r="BT";break}case"LeftRight":{r="LR";break}case"RightLeft":{r="RL";break}default:Oe(t.direction)}return{direction:r,...n&&{nodeSep:n},...e&&{rankSep:e}}}function nY(t){switch(t){case"TB":return"TopBottom";case"BT":return"BottomTop";case"LR":return"LeftRight";case"RL":return"RightLeft";default:Oe(t)}}function p_(t){if(ww(t))return t;if(Bw(t))return t.subject;if(Ph(t))return p_(t.subject);Oe(t)}class rY{parser;locator;constructor(e){this.parser=e.likec4.ModelParser,this.locator=e.likec4.ModelLocator}getDocumentation(e){try{if(Nn(e)){const n=bt(e),r=this.parser.forDocument(n).parseDeploymentNode(e),i=[r.id];return r.title!==e.name&&i.push(" ",`**${r.title}**`),i.join(`
224
- `)}if(Mr(e)){const n=bt(e),r=this.parser.forDocument(n).parseDeployedInstance(e),i=this.locator.getParsedElement(r.element),s=[r.id,`_instance of_ ${r.element}`];return i&&s.push(" ",`**${i.title}**`),s.join(`
225
- `)}if(Wn(e)){const n=bt(e),r=this.parser.forDocument(n).parseElement(e);return r?[r.id," ",`**${r.title}**`].join(`
226
- `):void 0}}catch(n){ve(n)}}}function iY(t,e){return[t,e]=h_(t,e)>0?[e,t]:[t,e],sY(t.range,e.range.start)}function h_(t,e){const n=t.range.start.line-e.range.start.line;return n!==0?n:t.range.start.character-e.range.start.character}function sY(t,e){return!(e.line<t.start.line||e.line>t.end.line||e.line==t.start.line&&e.character<t.start.character||e.line==t.end.line&&e.character>t.end.character)}function m_(t){return t.range.start.line!=t.range.end.line}const le={newLine:qi.newLine({allowMore:!0}),oneSpace:qi.oneSpace(),noSpace:qi.noSpace(),indent:qi.indent({allowMore:!0}),noIndent:qi.noIndent()};class oY extends G7{format(e){this.removeIndentFromTopLevelStatements(e),this.indentContentInBraces(e),this.formatSpecificationRule(e),this.formatGlobals(e),this.formatElementDeclaration(e),this.formatRelation(e),this.formatMetadataProperty(e),this.formatView(e),this.formatViewRuleGroup(e),this.formatViewRuleGlobalStyle(e),this.formatIncludeExcludeExpressions(e),this.formatWhereExpression(e),this.formatAutolayoutProperty(e),this.formatWithPredicate(e),this.formatViewRuleStyle(e),this.formatLeafProperty(e),this.formatLinkProperty(e),this.formatNavigateToProperty(e),this.formatTags(e)}formatTags(e){this.on(e,Jw,(n,r)=>{r.cst(Po(n.$cstNode,"values").slice(1)).prepend(le.oneSpace),r.keywords(",").prepend(le.noSpace).append(le.oneSpace)})}formatRelation(e){this.on(e,zr,(n,r)=>{const i=n?.source?.$cstNode?[n?.source?.$cstNode]:[];r.cst(i).append(le.oneSpace),r.keywords("]->").prepend(le.noSpace),r.keywords("-[").append(le.noSpace),r.nodes(...Ve([n.target,n.tags],ue)).prepend(le.oneSpace),r.properties("title","technology").prepend(le.oneSpace)}),this.on(e,Lw,(n,r)=>{r.keywords("->","<-").surround(le.oneSpace);const i=r.property("kind");i.nodes[0]?.text.startsWith(".")&&i.surround(le.oneSpace),r.keywords("]->").prepend(le.noSpace).append(le.oneSpace),r.keywords("-[").prepend(le.oneSpace).append(le.noSpace),r.properties("title").prepend(le.oneSpace)}),this.on(e,Nw)?.property("target").prepend(le.oneSpace),this.on(e,Hw,(n,r)=>{r.property("from").append(le.oneSpace),r.keywords("]->").prepend(le.noSpace),r.keywords("-[").append(le.noSpace)}),this.on(e,JA)?.keywords("->").append(le.oneSpace),this.on(e,Ww)?.keyword("->").prepend(le.oneSpace)}removeIndentFromTopLevelStatements(e){(QA(e)||Xw(e)||Wl(e)||ZA(e)||Uw(e))&&this.getNodeFormatter(e).keywords("specification","model","views","likec4lib","global").prepend(le.noIndent)}indentContentInBraces(e){if(ZA(e)||Xw(e)||pa(e)||ma(e)||Uw(e)||_l(e)||Pl(e)||QA(e)||gl(e)||WA(e)||BK(e)||Xh(e)||MK(e)||Wl(e)||UA(e)||AK(e)||hd(e)||rm(e)||SK(e)||kK(e)||Zi(e)||Ow(e)){const n=this.getNodeFormatter(e),r=n.keywords("{"),i=n.keywords("}"),s=n.interior(r,i);let o=null;for(const a of s.nodes)(!o||!iY(o,a))&&n.cst([a]).prepend(le.indent),o=a;r.prepend(le.noIndent).prepend(le.oneSpace),i.prepend(le.noIndent).prepend(qi.newLine({allowMore:!0}))}}appendKeywordsWithSpace(e){this.on(e,IK)?.keywords("element").append(le.oneSpace)}formatView(e){this.on(e,Ih,(n,r)=>{(n.extends||n.viewOf||n.name)&&r.keywords("view").append(le.oneSpace),r.keywords("of","extends").surround(le.oneSpace)}),this.on(e,qA)?.keywords("dynamic","view").append(le.oneSpace)}formatLeafProperty(e){if($l(e)||rd(e)||UK(e)||la(e)||Yw(e)||r_(e)||Qs(e)||zl(e)||ol(e)||Br(e)||Jh(e)||bh(e)||Hh(e)){const n=this.getNodeFormatter(e),r=n.keyword(":"),i=n.keywords("title","description","technology","notation","color","line","head","tail","icon","shape","border","opacity");r.nodes.length===0?i.append(le.oneSpace):r.prepend(le.noSpace).append(le.oneSpace),n.keyword(";").prepend(le.noSpace).append(le.newLine)}}formatLinkProperty(e){this.on(e,Uh,(n,r)=>{r.keyword("link").append(le.oneSpace),r.property("value").append(le.oneSpace),r.keyword(":").prepend(le.noSpace).append(le.oneSpace),r.keyword(";").prepend(le.noSpace).append(le.newLine)})}formatNavigateToProperty(e){this.on(e,Wh)?.property("key").append(le.oneSpace)}formatAutolayoutProperty(e){this.on(e,ud,(n,r)=>{r.keyword("autoLayout").append(le.oneSpace),r.property("rankSep").prepend(le.oneSpace),r.property("nodeSep").prepend(le.oneSpace)})}formatMetadataProperty(e){this.on(e,LK,(n,r)=>{r.property("key").append(le.oneSpace),r.keyword(":").prepend(le.noSpace).append(le.oneSpace),r.keyword(";").prepend(le.noSpace).append(le.newLine)})}formatElementDeclaration(e){this.on(e,Wn,(n,r)=>{const i=kn(n.$cstNode,"kind"),s=kn(n.$cstNode,"name");s&&i&&(h_(s,i)>0?r.cst([i]).append(le.oneSpace):(r.cst([s]).append(le.oneSpace),r.cst([i]).prepend(le.oneSpace))),r.properties("props").prepend(le.oneSpace)})}formatGlobals(e){this.on(e,_l,(n,r)=>{r.keyword("style").append(le.oneSpace),r.property("id").append(le.oneSpace)}),this.on(e,Pl,(n,r)=>{r.keyword("styleGroup").append(le.oneSpace)})}formatSpecificationRule(e){if((pa(e)||ma(e)||tm(e))&&this.getNodeFormatter(e).keywords("element","relationship","tag").append(le.oneSpace),Qh(e)){const n=this.getNodeFormatter(e);n.keyword("color").append(le.oneSpace),n.property("name").append(le.oneSpace)}}formatWithPredicate(e){const n=this.getNodeFormatter(e);(Ph(e)||Kw(e))&&n.keyword("with").prepend(le.oneSpace)}formatViewRuleGlobalStyle(e){this.on(e,s_,(n,r)=>{r.keywords("global","style").append(le.oneSpace)})}formatViewRuleGroup(e){this.on(e,rm,(n,r)=>{r.keyword("group").append(le.oneSpace)})}formatViewRuleStyle(e){this.on(e,hd)?.keyword("style").append(le.oneSpace),this.on(e,xK)?.keyword(",").prepend(le.noSpace).append(le.oneSpace)}formatWhereExpression(e){if((wK(e)||pK(e))&&this.getNodeFormatter(e).keyword("where").append(le.oneSpace),($K(e)||EK(e))&&this.getNodeFormatter(e).property("operator").surround(le.oneSpace),(o_(e)||c_(e))&&this.getNodeFormatter(e).keyword("not").append(le.oneSpace),FA(e)||HK(e)||WK(e)||MA(e)||VK(e)||a_(e)){const n=this.getNodeFormatter(e);n.property("operator").surround(le.oneSpace),n.property("not").surround(le.oneSpace)}}formatIncludeExcludeExpressions(e){if(vw(e)||Gw(e)||Oh(e)){const n=this.getNodeFormatter(e);(!e.$cstNode||!m_(e.$cstNode))&&n.keywords("include","exclude").append(le.oneSpace)}if(jA(e)||n_(e)||n_(e)){const n=this.getNodeFormatter(e),r=this.findPredicateExpressionRoot(e),i=r?.$cstNode&&m_(r?.$cstNode);i&&n.property("value").prepend(le.indent),n.keyword(",").prepend(le.noSpace).append(i?le.newLine:le.oneSpace)}}findPredicateExpressionRoot(e){let n=e.$container;for(;;){if(!n||vw(n)||Gw(n)||Oh(n))return n;n=n.$container}}on(e,n,r){const i=n(e)?this.getNodeFormatter(e):void 0;return r&&i&&r(e,i),i}}class aY{constructor(e){this.services=e}async provideCodeLens(e,n,r){return e.state!==He.Validated&&(Fe.debug(`Waiting for document ${e.uri.path} to be validated`),await this.services.shared.workspace.DocumentBuilder.waitUntil(He.Validated,e.uri,r),Fe.debug(`Document ${e.uri.path} is validated`)),va(e)?e.parseResult.value.views.flatMap(i=>i.views).flatMap(i=>{const s=sm.readId(i),o=i.$cstNode?.range;return!o||!s?[]:{range:{start:o.start,end:{line:o.start.line,character:o.start.character+4}},command:{command:"likec4.open-preview",arguments:[s],title:"open preview"}}}):void 0}}class cY extends $1{completionOptions={triggerCharacters:["."]};completionForKeyword(e,n,r){if(this.filterKeyword(e,n)){if(n.value==="deployment"&&xi(e.node,Wl))return r(e,{label:n.value,detail:"Insert deployment view",kind:Ft.Class,insertTextFormat:tr.Snippet,insertText:["deployment view ${1:view_${TM_FILENAME_BASE}_${CURRENT_SECOND}} {"," title '${2:Untitled}'"," "," include $0","}"].join(`
227
- `)});if(["title","description","technology"].includes(n.value))return r(e,{label:n.value,kind:Ft.Property,insertTextFormat:tr.Snippet,insertText:`${n.value} '\${0}'`});if(["views","specification","model","deployment","with"].includes(n.value))return r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Ft.Module,insertTextFormat:tr.Snippet,insertText:`${n.value} {
228
- $0
229
- }`});if(n.value==="group")return r(e,{label:n.value,detail:"Insert group block",kind:Ft.Class,insertTextFormat:tr.Snippet,insertText:["group '${1:Title}' {"," $0","}"].join(`
230
- `)});if(n.value==="dynamic"&&xi(e.node,Wl))return r(e,{label:n.value,detail:"Insert dynamic view",kind:Ft.Class,insertTextFormat:tr.Snippet,insertText:["dynamic view ${1:view_${TM_FILENAME_BASE}_${CURRENT_SECOND}} {"," title '${2:Untitled}'"," "," $0","}"].join(`
231
- `)});if(n.value==="style"&&e.node)return xi(e.node,_l)?r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Ft.Module,insertTextFormat:tr.Snippet,insertText:`${n.value} \${1:name} \${2:*} {
232
- \${3|color,shape,border,opacity,icon|} $0
233
- }`}):xi(e.node,p9([Wl,Pl]))?r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Ft.Module,insertTextFormat:tr.Snippet,insertText:`${n.value} \${1:*} {
234
- \${2|color,shape,border,opacity,icon|} $0
235
- }`}):r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Ft.Module,insertTextFormat:tr.Snippet,insertText:`${n.value} {
236
- \${1|color,shape,border,opacity,icon|} $0
237
- }`});if(n.value==="extend")return r(e,{label:n.value,detail:"Extend another view",kind:Ft.Class,insertTextFormat:tr.Snippet,insertText:`extend \${1:element} {
238
- $0
239
- }`});if(n.value==="autoLayout")return r(e,{label:n.value,kind:Ft.Class,insertTextFormat:tr.Snippet,insertText:"autoLayout ${1|TopBottom,BottomTop,LeftRight,RightLeft|}$0"});r(e,{label:n.value,kind:this.getKeywordCompletionItemKind(n),detail:"Keyword",sortText:"1"})}}}class uY extends T1{createDocumentHighlight(e){return ye.DocumentHighlight.create(e.segment.range,ye.DocumentHighlightKind.Read)}}const lY=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,dY=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,fY=/^([/\\]\s*){2,}[^/\\]/;function g_(t){return["./","../"].some(e=>t.startsWith(e))}function nb(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?lY.test(t):dY.test(t)||(e.acceptRelative?fY.test(t):!1)}function pY(t="",e){return t.endsWith("/")}function hY(t="",e){return(pY(t)?t.slice(0,-1):t)||"/"}function mY(t="",e){return t.endsWith("/")?t:t+"/"}function om(t=""){return t.startsWith("/")}function y_(t=""){return(om(t)?t.slice(1):t)||"/"}function gY(t=""){return om(t)?t:"/"+t}function yY(t,e){if(vY(e))return t;const n=hY(e);if(!t.startsWith(n))return t;const r=t.slice(n.length);return r[0]==="/"?r:"/"+r}function vY(t){return!t||t==="/"}function am(t=""){const[e="",n="",r=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:n,hash:r}}class wY{constructor(e){this.services=e}getDocumentLinks(e,n){return va(e)?_r(e.parseResult.value).filter(Uh).map(r=>{try{const i=kn(r.$cstNode,"value")?.range,s=this.resolveLink(e,r.value);if(i&&nb(s))return{range:i,target:s}}catch(i){ve(i)}return null}).nonNullable().toArray():[]}resolveLink(e,n){if(nb(n)||om(n))return n;const r=g_(n)?new URL(e.uri.toString(!0)):this.services.shared.workspace.WorkspaceManager.workspaceURL;return new URL(n,r).toString()}relativeLink(e,n){if(om(n))return y_(n);if(g_(n)){const r=new URL(e.uri.toString(!0)),i=new URL(n,r).toString();return y_(yY(i,this.services.shared.workspace.WorkspaceManager.workspaceURL.toString()))}return null}}class bY{constructor(e){this.services=e,this.nodeKindProvider=e.shared.lsp.NodeKindProvider,this.parser=e.likec4.ModelParser,this.locator=e.likec4.ModelLocator,this.nameProvider=e.references.NameProvider}nodeKindProvider;nameProvider;parser;locator;getSymbols({parseResult:{value:{specifications:e,models:n,deployments:r,views:i,likec4lib:s}}}){return[...s.map(o=>()=>this.getLikec4LibSymbol(o)),...e.map(o=>()=>this.getSpecSymbol(o)),...n.map(o=>()=>this.getModelSymbol(o)),...r.map(o=>()=>this.getDeploymentModelSymbol(o)),...i.map(o=>()=>this.getModelViewsSymbol(o))].flatMap(o=>{try{return o()??[]}catch(a){return ve(a),[]}})}getLikec4LibSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=e.icons.map(i=>this.getLibIconSymbol(i)).filter(ue);return r.length===0?[]:[{kind:hr.Namespace,name:"icons",range:n.range,selectionRange:vc(n,"icons")?.range??n.range,children:r}]}getSpecSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=kn(n,"name");if(!r)return[];const i=tt([...e.elements,...e.tags,...e.relationships],vn(s=>{try{if(pa(s)||ma(s)||em(s))return this.getKindSymbol(s);if(tm(s))return this.getTagSymbol(s)}catch(o){return ve(o),null}Oe(s)}),Ve(ue));return i.length===0?[]:[{kind:hr.Namespace,name:e.name,range:n.range,selectionRange:r.range,children:i}]}getModelSymbol(e){const n=e.$cstNode;if(!n)return[];const r=kn(n,"name");return r?[{kind:this.symbolKind(e),name:e.name,range:n.range,selectionRange:r.range,children:e.elements.flatMap(i=>this.getElementsSymbol(i))}]:[]}getDeploymentModelSymbol(e){const n=e.$cstNode;if(!n)return[];const r=kn(n,"name");return r?[{kind:this.symbolKind(e),name:e.name,range:n.range,selectionRange:r.range,children:e.elements.flatMap(i=>this.getDeploymentElementSymbol(i))}]:[]}getElementsSymbol(e){try{if(ia(e))return this.getExtendElementSymbol(e);if(Wn(e))return this.getElementSymbol(e)}catch(n){ve(n)}return[]}getExtendElementSymbol(e){const n=e.$cstNode,r=e.element.$cstNode,i=e.body;return!n||!r?[]:[{kind:this.symbolKind(e),name:im(e.element),range:n.range,selectionRange:r.range,children:i.elements.flatMap(s=>this.getElementsSymbol(s))}]}getElementSymbol(e){const n=e.$cstNode,r=kn(n,"name");if(!r||!n)return[];const i=e.name,s=e.kind.$refText;return[{kind:this.symbolKind(e),name:i,range:n.range,selectionRange:r.range,detail:s,children:e.body?.elements.flatMap(o=>this.getElementsSymbol(o))??[]}]}getModelViewsSymbol(e){const n=e.$cstNode,r=kn(n,"name");return!r||!n?[]:[{kind:this.symbolKind(e),name:e.name,range:n.range,selectionRange:r.range,children:e.views.flatMap(i=>this.getViewSymbol(i))}]}getKindSymbol(e){return!e.$cstNode||!e.kind.$cstNode||Fs(e.kind.name)?null:{kind:this.symbolKind(e),name:e.kind.name,range:e.$cstNode.range,selectionRange:e.kind.$cstNode.range}}getTagSymbol(e){return!e.$cstNode||!e.tag.$cstNode||Fs(e.tag.name)?null:{kind:this.symbolKind(e),name:"#"+e.tag.name,range:e.$cstNode.range,selectionRange:e.tag.$cstNode.range}}getLibIconSymbol(e){return!e.$cstNode||Fs(e.name)?null:{kind:this.symbolKind(e),name:e.name,range:e.$cstNode.range,selectionRange:e.$cstNode.range}}getViewSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=e.name?kn(n,"name"):null;return r?[{kind:this.symbolKind(e),name:r.text,range:n.range,selectionRange:r.range,children:[]}]:[]}getDeploymentElementSymbol(e){try{if(Nn(e))return this.getDeploymentNodeSymbol(e);if(Mr(e))return this.getDeployedInstanceSymbol(e)}catch(n){ve(n)}return[]}getDeploymentNodeSymbol(e){const n=e.$cstNode,r=this.nameProvider.getNameNode(e);if(!r||!n)return[];const i=this.nameProvider.getNameStrict(e),s=e.kind.$refText;return[{kind:this.symbolKind(e),name:i,range:n.range,selectionRange:r.range,detail:s,children:e.body?.elements.flatMap(o=>this.getDeploymentElementSymbol(o))??[]}]}getDeployedInstanceSymbol(e){const n=e.$cstNode,r=this.nameProvider.getNameNode(e);if(!r||!n)return[];const i=bt(e),s=this.parser.forDocument(i).parseDeployedInstance(e),o=this.nameProvider.getNameStrict(e),a="instance of "+s.element;return[{kind:this.symbolKind(e),name:o,range:n.range,selectionRange:r.range,detail:a,children:[]}]}symbolKind(e){return this.nodeKindProvider.getSymbolKind(e)}}var rb,v_;function DY(){return v_||(v_=1,rb=t=>{const e=t.match(/^[ \t]*(?=\S)/gm);return e?e.reduce((n,r)=>Math.min(n,r.length),1/0):0}),rb}var EY=DY();const RY=Rp(EY);function ib(t){const e=RY(t);if(e===0)return t;const n=new RegExp(`^[ \\t]{${e}}`,"gm");return t.replace(n,"")}class $Y extends A1{parser;locator;constructor(e){super(e),this.parser=e.likec4.ModelParser,this.locator=e.likec4.ModelLocator}getAstNodeHoverContent(e){if(i_(e))return{contents:{kind:"markdown",value:ib(`
240
- tag: \`${e.name}\`
241
- `)}};if(Nn(e)){const n=bt(e),r=this.parser.forDocument(n).parseDeploymentNode(e),i=[r.id+" "];return r.title!==e.name&&i.push(`### ${r.title}`),i.push("Deployment: `"+r.kind+"` "),{contents:{kind:"markdown",value:i.join(`
242
- `)}}}if(Mr(e)){const n=bt(e),r=this.parser.forDocument(n).parseDeployedInstance(e),i=this.locator.getParsedElement(r.element),s=[r.id+" ",`instance of \`${r.element}\``];return i&&s.push(`### ${i.title}`,"Element: `"+i.kind+"` "),{contents:{kind:"markdown",value:s.join(`
243
- `)}}}if(Wn(e)){const n=this.locator.getParsedElement(e);return n?{contents:{kind:"markdown",value:[n.id,`### ${n.title}`,"Element: `"+n.kind+"` "].join(`
244
- `)}}:void 0}}}class TY extends I7{highlightElement(e,n){if(Wn(e)||Nn(e))return this.highlightNameAndKind(e,n);if(Mr(e)){"name"in e&&n({node:e,property:"name",type:je.variable,modifier:[rt.definition,rt.readonly]});return}if(Ew(e))return this.highlightView(e,n);if(qK(e))return n({node:e,property:"name",type:je.function});if(OK(e))return n({node:e,property:"name",type:je.type,modifier:[rt.definition]}),"prune";if(Hw(e)&&"kind"in e){n({node:e,property:"kind",type:je.function});return}if(zr(e)&&"kind"in e&&n({node:e,property:"kind",type:je.function}),Wh(e)||Zl(e))return n({node:e,property:"key",type:je.property}),n({node:e,property:"value",type:je.variable,modifier:[rt.definition,rt.readonly]}),"prune";if((Mw(e)||io(e))&&e.$cstNode)return n({cst:e.$cstNode,type:je.variable,modifier:[rt.definition,rt.readonly]}),"prune";if(jw(e)){e.selector&&n({node:e,property:"selector",type:je.variable,modifier:[rt.definition,rt.readonly]});return}if(a_(e)&&ue(e.value)){n({node:e,property:"value",type:je.function});return}if((FA(e)||MA(e))&&ue(e.value)){n({node:e,property:"value",type:je.type,modifier:[rt.definition,rt.readonly]});return}if(_h(e)&&ue(e.kind))return n({node:e,property:"kind",type:je.type,modifier:[rt.definition]}),"prune";if(xh(e)&&ue(e.tag))return n({node:e,property:"tag",type:je.type,modifier:[rt.definition]}),"prune";if(VA(e))return n({node:e,property:"value",type:e.parent?je.property:je.variable,modifier:[rt.definition,rt.readonly]}),e.parent?void 0:"prune";if(El(e)||HA(e))return n({node:e,property:"el",type:e.parent?je.property:je.variable,modifier:[rt.definition,rt.readonly]}),e.parent?void 0:"prune";if(Qh(e)){n({node:e,keyword:"color",type:je.keyword}),n({node:e,property:"name",type:je.type,modifier:[rt.declaration,rt.readonly]});return}if((pa(e)||ma(e)||em(e))&&n({node:e,property:"kind",type:je.type,modifier:[rt.declaration,rt.readonly]}),Jw(e))return n({node:e,property:"values",type:je.interface});if(i_(e))return n({node:e,property:"name",type:je.type,modifier:[rt.definition]});if((Xh(e)||Zi(e)&&gl(e.$container))&&n({node:e,property:"key",type:je.property}),Hh(e))return n({node:e,property:"key",type:je.property}),n({node:e,property:"value",type:je.number}),"prune";if(Uh(e)||Br(e)||OA(e))return n({node:e,property:"key",type:je.property}),Br(e)&&(e.libicon||e.value==="none")?(n({node:e,property:e.libicon?"libicon":"value",type:je.enum,modifier:[rt.defaultLibrary]}),"prune"):("value"in e&&e.value&&n({node:e,property:"value",type:je.string}),"prune");if(Qs(e)||Jh(e)||ol(e)||zl(e)||bh(e))return n({node:e,property:"key",type:je.property}),"value"in e&&n({node:e,property:"value",type:je.enum}),"prune"}highlightNameAndKind(e,n){n({node:e,property:"name",type:je.variable,modifier:[rt.declaration,rt.readonly]}),n({node:e,property:"kind",type:je.keyword,modifier:[]})}highlightView(e,n){e.name&&n({node:e,property:"name",type:je.variable,modifier:[rt.declaration,rt.readonly,"local"]})}}const w_=Symbol.for("DeploymentsIndex");class SY{constructor(e){this.services=e,this.Names=e.references.NameProvider,this.langiumDocuments=e.shared.workspace.LangiumDocuments,e.shared.workspace.DocumentBuilder.onBuildPhase(He.IndexedContent,(n,r)=>{for(const i of n)delete i[w_]})}Names;langiumDocuments;documents(){return this.langiumDocuments.all.filter(e=>Sd(e)&&e.state>=He.IndexedContent)}get(e){return e.state<He.IndexedContent&&ve(`Document ${e.uri.path} is not indexed`),e[w_]??=this.createDocumentIndex(e)}nested(e){const n=this.getFqn(e);return this.documents().flatMap(r=>this.get(r).nested(n))}byFqn(e){return this.documents().flatMap(n=>this.get(n).byFqn(e))}getFqn(e){let n=Td.readId(e);if(ue(n))return n;const r=[this.Names.getNameStrict(e)];let i=e,s;for(;s=sn(i.$container,Nn);)r.push(this.Names.getNameStrict(s)),i=s;return n=r.reduceRight((o,a)=>`${o}.${a}`),Td.writeId(e,n),n}createDocumentIndex(e){const n=e.parseResult.value.deployments.flatMap(l=>l.elements);if(n.length===0)return zm.EMPTY;const r=new Array,i=new zn,s=new zn,o=this.Names,a=this.services.workspace.AstNodeDescriptionProvider,c=l=>{const d={...a.createDescription(l.node,l.name,e),fqn:l.fqn};return Td.writeId(l.node,l.fqn),s.add(l.fqn,d),d},u=(l,d)=>{const f=[],p=l.body?.elements;if(!p||p.length===0)return[];const h=new Set;for(const v of p)if(!to(v))try{const b=o.getName(v);if(ue(b)){const g=`${d}.${b}`,w=c({node:v,name:b,fqn:g});i.add(d,w),h.add(w.name),Nn(v)&&v.body&&f.push(...u(v,g))}}catch(b){ve(b)}return f.length>0&&tt(f,Ls(Kc("name")),Fp((v,b)=>{v.length>1||h.has(b)||i.add(d,v[0])})),i.get(d)};for(const l of n)try{if(to(l))continue;const d=o.getName(l);ue(d)&&(r.push(c({node:l,name:d,fqn:d})),u(l,d))}catch(d){ve(d)}return new zm(r,i,s)}}class zm{constructor(e,n,r){this._rootNodes=e,this._nested=n,this._byfqn=r}static EMPTY=new zm([],new zn,new zn);rootNodes(){return this._rootNodes}byFqn(e){return this._byfqn.get(e)}nested(e){return this._nested.get(e)}unique(){const e=[];return tt([...this._byfqn.values()],Ls(Kc("name")),Fp(n=>{n.length===1&&e.push(n[0])})),e}}const{findNodeForProperty:kY}=Pf,{toDocumentSegment:b_}=HF;function CY(t,e,n){const r=kY(e.$cstNode,"name");return{documentUri:n.uri,name:e.name,...e.$cstNode&&{selectionSegment:b_(e.$cstNode)},...r&&{nameSegment:b_(r)},path:t.getAstNodePath(e),type:rr}}function AY(t,e){const n=t.c4fqnIndex=new zn,r=t.parseResult.value.models.flatMap(a=>a.elements);if(r.length===0)return;const i=e.workspace.AstNodeLocator,s=Jm.from(r.map(a=>[a,null]));let o;for(;o=s.shift();)try{const[a,c]=o;if(zr(a))continue;if(ia(a)){if(Qt(a.body)&&!Fs(a.body.elements)){const u=im(a.element);for(const l of a.body.elements)zr(l)||s.push([l,u])}continue}if(Wn(a)){const u=oN(a.name,c);if(n.add(u,{...CY(i,a,t),fqn:u}),Td.writeId(a,u),Qt(a.body)&&!Fs(a.body.elements))for(const l of a.body.elements)zr(l)||s.push([l,u]);continue}Oe(a)}catch(a){HC(a)}}class _Y{constructor(e){this.services=e,this.langiumDocuments=e.shared.workspace.LangiumDocuments,e.shared.workspace.DocumentBuilder.onBuildPhase(He.IndexedContent,async(n,r)=>{for(const i of n)if(Sd(i)){delete i.c4fqnIndex,delete i.c4Elements,delete i.c4Specification,delete i.c4Relations,delete i.c4Views;try{AY(i,e)}catch(s){ve(s)}}return await Promise.resolve()}),Fe.debug("[FqnIndex] Created")}langiumDocuments;get documents(){return this.langiumDocuments.all.filter(Qw)}entries(e){return this.documents.flatMap(n=>n.c4fqnIndex.keys().filter(e).flatMap(r=>n.c4fqnIndex.get(r)))}getFqn(e){return Td.readId(e)??null}byFqn(e){return this.documents.flatMap(n=>n.c4fqnIndex.get(e))}directChildrenOf(e){return st([e]).flatMap(n=>{const r=this.entries(i=>_a(i)===n).map(i=>[i.name,i]).toArray();return r.length===0?[]:new zn(r).entriesGroupedByKey().flatMap(([i,s])=>s.length===1?s:[]).iterator()})}uniqueDescedants(e){return new Mt(()=>{const n=`${e}.`,r=new Set,i=[],s=new zn;if(this.entries(o=>o.startsWith(n)).forEach(o=>{const a=Aa(o.fqn),c={...o,name:a};_a(o.fqn)===e?(r.add(a),s.add(a,c)):i.push(c)}),s.size+i.length===0)return null;for(const o of i)r.has(o.name)||s.add(o.name,o);return s.entriesGroupedByKey().flatMap(([o,a])=>a.length===1?a:[]).iterator()},n=>n?n.next():nn)}}function PY(t){const e=new aN({type:"directed"}),n=[];for(const r of cN(t))e.addNode(r.id,{view:r}),j0(r)&&n.push(r);if(n.length===0)return t;for(const r of n){if(!e.hasNode(r.extends)){console.warn(`View "${r.id}" extends from "${r.extends}" which does not exist`);continue}if(uN(e,r.id,r.extends)){console.warn(`View "${r.id}" extends from "${r.extends}" which creates a cycle`);continue}e.addDirectedEdge(r.id,r.extends)}return lN.topologicalSort(e).reverse().reduce((r,i)=>{const s=e.getNodeAttribute(i,"view");if(!j0(s))return r[s.id]=s,r;const o=r[s.extends];return!o||!dN(o)||(r[s.id]={...o,...s,rules:[...o.rules,...s.rules]}),r},{})}var xY=Object.getOwnPropertyNames,IY=Object.getOwnPropertySymbols,NY=Object.prototype.hasOwnProperty;function D_(t,e){return function(r,i,s){return t(r,i,s)&&e(r,i,s)}}function cm(t){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,i);var s=i.cache,o=s.get(n),a=s.get(r);if(o&&a)return o===r&&a===n;s.set(n,r),s.set(r,n);var c=t(n,r,i);return s.delete(n),s.delete(r),c}}function E_(t){return xY(t).concat(IY(t))}var R_=Object.hasOwn||function(t,e){return NY.call(t,e)};function wa(t,e){return t||e?t===e:t===e||t!==t&&e!==e}var $_="_owner",T_=Object.getOwnPropertyDescriptor,S_=Object.keys;function OY(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function FY(t,e){return wa(t.getTime(),e.getTime())}function k_(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.entries(),s=0,o,a;(o=i.next())&&!o.done;){for(var c=e.entries(),u=!1,l=0;(a=c.next())&&!a.done;){var d=o.value,f=d[0],p=d[1],h=a.value,v=h[0],b=h[1];!u&&!r[l]&&(u=n.equals(f,v,s,l,t,e,n)&&n.equals(p,b,f,v,t,e,n))&&(r[l]=!0),l++}if(!u)return!1;s++}return!0}function LY(t,e,n){var r=S_(t),i=r.length;if(S_(e).length!==i)return!1;for(var s;i-- >0;)if(s=r[i],s===$_&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!R_(e,s)||!n.equals(t[s],e[s],s,s,t,e,n))return!1;return!0}function Cd(t,e,n){var r=E_(t),i=r.length;if(E_(e).length!==i)return!1;for(var s,o,a;i-- >0;)if(s=r[i],s===$_&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!R_(e,s)||!n.equals(t[s],e[s],s,s,t,e,n)||(o=T_(t,s),a=T_(e,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function MY(t,e){return wa(t.valueOf(),e.valueOf())}function BY(t,e){return t.source===e.source&&t.flags===e.flags}function C_(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.values(),s,o;(s=i.next())&&!s.done;){for(var a=e.values(),c=!1,u=0;(o=a.next())&&!o.done;)!c&&!r[u]&&(c=n.equals(s.value,o.value,s.value,o.value,t,e,n))&&(r[u]=!0),u++;if(!c)return!1}return!0}function zY(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var qY="[object Arguments]",jY="[object Boolean]",UY="[object Date]",GY="[object Map]",WY="[object Number]",HY="[object Object]",VY="[object RegExp]",KY="[object Set]",YY="[object String]",XY=Array.isArray,A_=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,__=Object.assign,JY=Object.prototype.toString.call.bind(Object.prototype.toString);function ZY(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,s=t.arePrimitiveWrappersEqual,o=t.areRegExpsEqual,a=t.areSetsEqual,c=t.areTypedArraysEqual;return function(l,d,f){if(l===d)return!0;if(l==null||d==null||typeof l!="object"||typeof d!="object")return l!==l&&d!==d;var p=l.constructor;if(p!==d.constructor)return!1;if(p===Object)return i(l,d,f);if(XY(l))return e(l,d,f);if(A_!=null&&A_(l))return c(l,d,f);if(p===Date)return n(l,d,f);if(p===RegExp)return o(l,d,f);if(p===Map)return r(l,d,f);if(p===Set)return a(l,d,f);var h=JY(l);return h===UY?n(l,d,f):h===VY?o(l,d,f):h===GY?r(l,d,f):h===KY?a(l,d,f):h===HY?typeof l.then!="function"&&typeof d.then!="function"&&i(l,d,f):h===qY?i(l,d,f):h===jY||h===WY||h===YY?s(l,d,f):!1}}function QY(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?Cd:OY,areDatesEqual:FY,areMapsEqual:r?D_(k_,Cd):k_,areObjectsEqual:r?Cd:LY,arePrimitiveWrappersEqual:MY,areRegExpsEqual:BY,areSetsEqual:r?D_(C_,Cd):C_,areTypedArraysEqual:r?Cd:zY};if(n&&(i=__({},i,n(i))),e){var s=cm(i.areArraysEqual),o=cm(i.areMapsEqual),a=cm(i.areObjectsEqual),c=cm(i.areSetsEqual);i=__({},i,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:a,areSetsEqual:c})}return i}function eX(t){return function(e,n,r,i,s,o,a){return t(e,n,a)}}function tX(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,s=t.strict;if(r)return function(c,u){var l=r(),d=l.cache,f=d===void 0?e?new WeakMap:void 0:d,p=l.meta;return n(c,u,{cache:f,equals:i,meta:p,strict:s})};if(e)return function(c,u){return n(c,u,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};var o={cache:void 0,equals:i,meta:void 0,strict:s};return function(c,u){return n(c,u,o)}}var P_=ns();ns({strict:!0}),ns({circular:!0}),ns({circular:!0,strict:!0}),ns({createInternalComparator:function(){return wa}}),ns({strict:!0,createInternalComparator:function(){return wa}}),ns({circular:!0,createInternalComparator:function(){return wa}}),ns({circular:!0,createInternalComparator:function(){return wa},strict:!0});function ns(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,s=t.strict,o=s===void 0?!1:s,a=QY(t),c=ZY(a),u=r?r(c):eX(c);return tX({circular:n,comparator:c,createState:i,equals:u,strict:o})}function nX(t){const e=new Map;for(const n of t)if(ka.isElement(n)&&n.viewOf&&Et(n.extends)){const r=e.get(n.viewOf)??[];r.push(n.id),e.set(n.viewOf,r)}for(const{id:n,nodes:r}of t)for(const i of r){const s=Yd.modelRef(i);if(i.navigateTo||!s)continue;const o=YS(e.get(s)??[],a=>a!==n);o&&(i.navigateTo=o)}return t}function rX(t,e="/"){const n=tt(t,vn(c=>c.docUri),Ve(ue),Sv());if(n.length===0)return"";if(n.length===1){const c=am(n[0]).pathname.split(e);return c.length<=1?e:(c.pop(),c.join(e)+e)}Ce(Vc(n,2),"Expected at least 2 unique URIs");const[r,...i]=n,s=am(r).pathname.split(e);let o=s.length;for(const c of i){if(c===r)continue;const u=am(c).pathname.split(e);for(let l=0;l<o;l++)u[l]!==s[l]&&(o=l);if(o===0)return""}const a=s.slice(0,o).join(e);return a.endsWith(e)?a:a+e}function iX(t){const e="/",n=rX(t,e);return t.map(r=>{if(!r.docUri)return{view:r,parts:[]};let i=am(r.docUri).pathname;return n.length>0?(Ce(i.startsWith(n),`Expect path "${i}" to start with common prefix: "${n}"`),i=i.slice(n.length)):i=i.includes(e)?i.slice(i.lastIndexOf(e)+1):i,{view:r,parts:i.split(e)}}).sort((r,i)=>{if(r.parts.length!==i.parts.length)return r.parts.length-i.parts.length;for(let s=0;s<r.parts.length;s++){const o=U0(r.parts[s],i.parts[s]);if(o!==0)return o}return U0(r.view.title??r.view.id,i.view.title??i.view.id)}).map(({parts:r,view:i})=>({...i,relativePath:r.join(e)}))}function sX(t,e){const n={tags:new Set,deployments:{},elements:{},relationships:{},colors:{}},r={predicates:{},dynamicPredicates:{},styles:{}};for(const g of e){const{c4Specification:w,c4Globals:R}=g;w.tags.forEach(k=>n.tags.add(k)),Object.assign(n.elements,w.elements),Object.assign(n.relationships,w.relationships),Object.assign(n.colors,w.colors),Object.assign(n.deployments,w.deployments),Object.assign(r.predicates,R.predicates),Object.assign(r.dynamicPredicates,R.dynamicPredicates),Object.assign(r.styles,R.styles)}function i(g,w){return vn(w,R=>{try{const k=t.lsp.DocumentLinkProvider.relativeLink(g,R.url);if(k&&k!==R.url)return{...R,relative:k}}catch(k){ve(k)}return R})}const s=Xc(n.colors,g=>zF(g.color));function o(g){return({tags:w,links:R,style:{color:k,shape:A,icon:N,opacity:_,border:B},id:z,kind:Q,title:I,description:T,technology:$,metadata:L})=>{try{const V=n.elements[Q];if(!V)return Fe.warn(`No kind '${Q}' found for ${z}`),null;const H=R?i(g,R):null;return k??=V.style.color,A??=V.style.shape,N??=V.style.icon,_??=V.style.opacity,B??=V.style.border,$??=V.technology,{...k&&{color:k},...A&&{shape:A},...N&&{icon:N},...L&&!Fs(L)&&{metadata:L},...V.notation&&{notation:V.notation},style:{...B&&{border:B},...Op(_)&&{opacity:_}},links:H,tags:w??null,technology:$??null,description:T??null,title:I,kind:Q,id:z}}catch(V){ve(V)}return null}}const a=tt(e,zi(g=>vn(g.c4Elements,o(g))),Ve(ue),G0,kv((g,w)=>{const R=_a(w.id);return R&&Et(g[R])?(ve(`No parent found for ${w.id}`),g):(g[w.id]=w,g)},{}));function c(g){return({astPath:w,source:R,target:k,kind:A,links:N,id:_,...B})=>{if(Et(a[R])||Et(a[k]))return Fe.warn(`Invalid relation ${_} at ${g.uri.path} ${w}, source: ${R}(${!!a[R]}), target: ${k}(${!!a[k]})`),null;const z=N?i(g,N):null;return on(A)&&A in n.relationships?{...n.relationships[A],...B,...z&&{links:z},source:R,target:k,kind:A,id:_}:{...z&&{links:z},...B,source:R,target:k,id:_}}}const u=tt(e,zi(g=>vn(g.c4Relations,c(g))),Ve(ue),WS(_N),HS(),Cv(Kc("id")));function l(g){return w=>{if(!pN.isDeploymentNode(w)){if(!w.links||w.links.length===0)return w;const R=i(g,w.links);return{...w,links:R}}try{const R=n.deployments[w.kind];if(!R)return Fe.warn(`No kind '${w.kind}' found for ${w.id}`),null;let{technology:k=R.technology,notation:A=R.notation,links:N,style:_}=w;return{...w,...A&&{notation:A},...k&&{technology:k},style:{border:"dashed",opacity:10,...R.style,..._},links:N?i(g,N):null}}catch(R){ve(R)}return null}}const d=tt(e,zi(g=>vn(g.c4Deployments,l(g))),Ve(ue),G0,kv((g,w)=>{const R=_a(w.id);return R&&Et(g[R])?(ve(`No parent found for deployment element ${w.id}`),g):(g[w.id]=w,g)},{}));function f(g){return({astPath:w,source:R,target:k,kind:A,links:N,id:_,...B})=>{if(Et(d[R.id])||Et(d[k.id]))return Fe.warn(`Invalid deployment relation ${_} at ${g.uri.path} ${w}, source: ${R.id}(${!!d[R.id]}), target: ${k.id}(${!!d[k.id]})`),null;const z=N?i(g,N):null;return on(A)&&A in n.relationships?{...n.relationships[A],...B,...z&&{links:z},source:R,target:k,kind:A,id:_}:{...z&&{links:z},...B,source:R,target:k,id:_}}}const p=tt(e,zi(g=>vn(g.c4DeploymentRelations,f(g))),Ve(ue),kv((g,w)=>Qt(g[w.id])?(ve(`Duplicate deployment relation ${w.id}`),g):(g[w.id]=w,g),{}));function h(g){const w=g.uri.toString();return R=>{let{id:k,title:A,description:N,tags:_,links:B,astPath:z,...Q}=R;R.__==="element"&&Et(A)&&"viewOf"in R&&(A=a[R.viewOf]?.title??null),Et(A)&&k==="index"&&(A="Landscape view");const I=B?i(g,B):null;return{...Q,customColorDefinitions:s,tags:_,links:I,docUri:w,description:N,title:A,id:k}}}const v=tt(e,zi(g=>vn(g.c4Views,h(g))),iX);v.some(g=>g.id==="index")||v.unshift({__:"element",id:"index",title:"Landscape view",description:null,tags:null,links:null,customColorDefinitions:s,rules:[{include:[{wildcard:!0}]}]});const b=tt(v,Cv(Kc("id")),PY);return{specification:{tags:Array.from(n.tags),elements:n.elements,relationships:n.relationships,deployments:n.deployments},elements:a,relations:u,globals:r,views:b,deployments:{elements:d,relations:p}}}const x_="ParsedLikeC4Model",sb="ComputedLikeC4Model";class oX{constructor(e){this.services=e,this.langiumDocuments=e.shared.workspace.LangiumDocuments;const n=e.likec4.ModelParser;e.shared.workspace.DocumentBuilder.onUpdate((r,i)=>{i.length>0&&this.notifyListeners(i)}),e.shared.workspace.DocumentBuilder.onBuildPhase(He.Validated,async(r,i)=>{let s=[];try{Fe.debug(`[ModelBuilder] onValidated (${r.length} docs)`);for(const o of r)s.push(n.parse(o).uri)}catch(o){ve(o)}return s.length>0&&this.notifyListeners(s),await Promise.resolve()}),Fe.debug("[ModelBuilder] Created")}langiumDocuments;listeners=[];unsafeSyncBuildModel(){const e=this.documents();return e.length===0?(Fe.debug("[ModelBuilder] No documents to build model from"),null):this.services.WorkspaceCache.get(x_,()=>(Fe.debug(`[ModelBuilder] buildModel (${e.length} docs)`),sX(this.services,e)))}async buildModel(e){return this.services.WorkspaceCache.get(x_)||await this.services.shared.workspace.WorkspaceLock.read(async()=>(e&&await jt(e),this.unsafeSyncBuildModel()))}previousViews={};unsafeSyncBuildComputedModel(e){const n=this.services.WorkspaceCache,r=this.services.WorkspaceCache;return n.get(sb,()=>{const i=Xd.makeCompute(e),s=[];for(const a of Wc(e.views)){const c=i(a);if(!c.isSuccess){ve(c.error);continue}s.push(c.view)}nX(s);const o=gr(s,a=>{const c=this.previousViews[a.id],u=c&&P_(a,c)?c:a;return r.set(I_(a.id),u),[a.id,u]});return this.previousViews={...o},{...structuredClone(Fj(e,["specification","elements","relations","globals","deployments"])),views:o}})}async buildComputedModel(e){const n=this.services.WorkspaceCache;return n.has(sb)?n.get(sb):await this.services.shared.workspace.WorkspaceLock.read(async()=>{e&&await jt(e);const r=this.unsafeSyncBuildModel();return r?this.unsafeSyncBuildComputedModel(r):null})}async computeView(e,n){const r=this.services.WorkspaceCache,i=I_(e);return r.has(i)?r.get(i):await this.services.shared.workspace.WorkspaceLock.read(async()=>(n&&await jt(n),r.get(i,()=>{const s=this.unsafeSyncBuildModel(),o=s?.views[e];if(!o)return Fe.warn(`[ModelBuilder] Cannot find view ${e}`),null;const a=Xd.makeCompute(s)(o);if(!a.isSuccess)return ve(a.error),null;let c=a.view;const u=tt(s.views,Wc(),Ve(fN),Ve(d=>d.id!==e),Ls(d=>d.viewOf));for(const d of c.nodes)if(!d.navigateTo){const f=u[d.id];f&&(d.navigateTo=f[0].id)}const l=this.previousViews[e];return l&&P_(c,l)?c=l:this.previousViews[e]=c,c})))}onModelParsed(e){return this.listeners.push(e),Os.create(()=>{const n=this.listeners.indexOf(e);n>=0&&this.listeners.splice(n,1)})}documents(){return this.langiumDocuments.all.filter(va).toArray()}notifyListeners(e){for(const n of this.listeners)try{n(e)}catch(r){ve(r)}}}function I_(t){return`computed-view-${t}`}const{findNodeForKeyword:aX,findNodeForProperty:um}=Pf,{getDocument:cX}=gc;class uX{constructor(e){this.services=e,this.fqnIndex=e.likec4.FqnIndex,this.deploymentsIndex=e.likec4.DeploymentsIndex,this.langiumDocuments=e.shared.workspace.LangiumDocuments}fqnIndex;deploymentsIndex;langiumDocuments;documents(){return this.langiumDocuments.all.filter(va)}getParsedElement(e){if(VS(e)){const i=e,s=this.fqnIndex.byFqn(e).head();if(!s)return null;const o=this.langiumDocuments.getDocument(s.documentUri);return!o||!va(o)?null:o.c4Elements.find(a=>a.id===i)??null}const n=this.fqnIndex.getFqn(e);if(!n)return null;const r=cX(e);return va(r)?r.c4Elements.find(i=>i.id===n)??null:null}locateElement(e,n){const r=this.fqnIndex.byFqn(e).head(),i=r?.nameSegment??r?.selectionSegment;return!r||!i?null:{uri:r.documentUri.toString(),range:i.range}}locateDeploymentElement(e,n){const r=this.deploymentsIndex.byFqn(e).head(),i=r?.nameSegment??r?.selectionSegment;return!r||!i?null:{uri:r.documentUri.toString(),range:i.range}}locateRelation(e){for(const n of this.documents()){const r=n.c4Relations.find(o=>o.id===e)??n.c4DeploymentRelations.find(o=>o.id===e);if(!r)continue;const i=this.services.workspace.AstNodeLocator.getAstNode(n.parseResult.value,r.astPath);if(!zr(i)&&!to(i))continue;let s=i.title?um(i.$cstNode,"title"):void 0;if(s??=i.kind?um(i.$cstNode,"kind"):void 0,s??=um(i.$cstNode,"target"),s??=i.$cstNode,!!s)return{uri:n.uri.toString(),range:s.range}}return null}locateViewAst(e){for(const n of this.documents()){const r=n.c4Views.find(s=>s.id===e);if(!r)continue;const i=this.services.workspace.AstNodeLocator.getAstNode(n.parseResult.value,r.astPath);if(Ew(i))return{doc:n,view:r,viewAst:i}}return null}locateView(e){const n=this.locateViewAst(e);if(!n)return null;const r=n.viewAst;let i=r.name?um(r.$cstNode,"name"):void 0;return i??=aX(r.$cstNode,"view"),i??=r.$cstNode,i?{uri:n.doc.uri.toString(),range:i.range}:null}}var ob,N_;function lX(){if(N_)return ob;N_=1;function t(e){if(typeof e!="function")throw new Error("mnemonist/DefaultWeakMap.constructor: expecting a function.");this.items=new WeakMap,this.factory=e}return t.prototype.clear=function(){this.items=new WeakMap},t.prototype.get=function(e){var n=this.items.get(e);return typeof n>"u"&&(n=this.factory(e),this.items.set(e,n)),n},t.prototype.peek=function(e){return this.items.get(e)},t.prototype.set=function(e,n){return this.items.set(e,n),this},t.prototype.has=function(e){return this.items.has(e)},t.prototype.delete=function(e){return this.items.delete(e)},t.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),ob=t,ob}var dX=lX();const fX=Rp(dX),ba=["this","it","self","super","likec4lib","global"];function vt(t){return async(e,n,r)=>{try{const i=t(e,n,r);Gj(i)&&await i}catch(i){ve(i)}}}const{getDocument:pX}=gc,hX=t=>{const e=t.likec4.DeploymentsIndex,n=t.references.NameProvider;return vt((r,i)=>{const s=n.getName(r);if(!s){i("error","DeploymentNode must be named",{node:r});return}const o=fn(n.getNameNode(r),"name CstNode not found").range;ba.includes(s)&&i("error",`Reserved word: ${s}`,{node:r,range:o});const a=e.getFqn(r);e.byFqn(a).limit(2).toArray().length>1&&i("error",`Duplicate node name "${a}"`,{node:r,range:o})})},mX=t=>{const e=t.likec4.DeploymentsIndex,n=t.references.NameProvider;return vt((r,i)=>{const s=n.getName(r);if(!s){i("error","Deployed instance must be named, unique inside node",{node:r});return}const o=fn(n.getNameNode(r),"name CstNode not found").range;ba.includes(s)&&i("error",`Reserved word: ${s}`,{node:r,range:o});const a=e.getFqn(r);e.byFqn(a).limit(2).toArray().length>1&&i("error",`Duplicate instance name "${a}"`,{node:r,range:o})})},gX=t=>{const e=t.likec4.ModelParser;return vt((n,r)=>{if(!n.source?.value?.ref){let c=n.source?.$cstNode?.text??"";r("error",`DeploymentRelation source '${c}' not resolved`,{node:n,property:"source"});return}if(!n.target?.value?.ref){let c=n.target?.$cstNode?.text??"";r("error",`DeploymentRelation target '${c}' not resolved`,{node:n,property:"target"});return}const i=pX(n),s=e.forDocument(i),o=s.parseFqnRef(n.source);if(Pa.isModelRef(o)){r("error","DeploymentRelation must refer deployment element",{node:n,property:"source"});return}const a=s.parseFqnRef(n.target);if(Pa.isModelRef(a)){r("error","DeploymentRelation must refer deployment element",{node:n,property:"target"});return}W0(o.deployment,a.deployment)&&r("error","Invalid parent-child relationship",{node:n})})},yX=t=>vt((e,n)=>{const r=p_(e.value);switch(!0){case _h(r):case xh(r):case io(r):{n("warning","Predicate is ignored, as not supported in dynamic views",{node:e});return}}}),vX=t=>{const e=t.likec4.FqnIndex;return vt((n,r)=>{const i=$n(n.source),s=i&&e.getFqn(i);s||r("error","Source not found (not parsed/indexed yet)",{node:n,property:"source"});const o=$n(n.target),a=o&&e.getFqn(o);a||r("error","Target not found (not parsed/indexed yet)",{node:n,property:"target"}),s&&a&&(Gm(s,a)||Gm(a,s))&&r("error","Invalid parent-child relationship",{node:n})})},{getDocument:wX}=gc,bX=t=>{const e=t.likec4.FqnIndex,n=t.workspace.AstNodeLocator;return vt((r,i)=>{const s=e.getFqn(r);if(!s){i("error","Not indexed element",{node:r,property:"name"});return}ba.includes(r.name)&&i("error",`Reserved word: ${r.name}`,{node:r,property:"name"});const o=wX(r).uri,a=n.getAstNodePath(r),c=e.byFqn(s).filter(u=>u.documentUri!==o||u.path!==a).head();if(c){const u=c.documentUri!==o;i("error",`Duplicate element name ${r.name!==s?r.name+" ("+s+")":r.name}`,{node:r,property:"name",...u&&{relatedInformation:[{location:{range:c.nameSegment?.range??c.selectionSegment?.range,uri:c.documentUri.toString()},message:"conflicting element"}]}})}})},DX=t=>vt((e,n)=>{const r=parseFloat(e.value);(isNaN(r)||r<0||r>100)&&n("warning","Value ignored, must be between 0% and 100%",{node:e,property:"value"})}),EX=t=>(e,n)=>{const r=e.$container;r.props.some(i=>Br(i)&&i!==e)&&n("error","Icon must be defined once",{node:e}),Zi(r)&&gl(r.$container)&&r.$container.props.some(i=>Br(i))&&n("warning","Redundant as icon defined on element",{node:e})},RX=t=>(e,n)=>{xi(e,Lw)||n("error","Notes can be defined only inside dynamic view",{node:e})},$X=t=>{const e=t.likec4.FqnIndex;return vt((n,r)=>{const i=$n(n.target),s=i&&e.getFqn(i);s||r("error","Target not resolved",{node:n,property:"target"});let o;if(Qt(n.source)){if(o=$n(n.source),!o)return r("error","Source not resolved",{node:n,property:"source"})}else{if(!gl(n.$container))return r("error","Sourceless relation must be nested",{node:n});o=n.$container.$container}const a=e.getFqn(o);a||r("error","Source not resolved",{node:n}),a&&s&&W0(a,s)&&r("error","Invalid parent-child relationship",{node:n})})},TX=t=>vt((e,n)=>{e.$container.tags?.values&&e.tags?.values&&n("error","Relation cannot have tags in both header and body",{node:e.tags})}),SX=t=>vt((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one specification per document",{node:e,property:"name"})}),kX=t=>vt((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one model per document",{node:e,property:"name"})}),CX=t=>vt((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one global block per document",{node:e,property:"name"})}),AX=t=>{const e=t.shared.workspace.IndexManager;return vt((n,r)=>{ba.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=e.allElements(Ji).filter(s=>s.name===n.name&&s.node!==n).head();if(i){const s=i.documentUri!==bt(n).uri;r("error",`Duplicate element kind '${n.name}'`,{node:n,property:"name",...s&&{relatedInformation:[{location:{range:i.nameSegment.range,uri:i.documentUri.toString()},message:"conflicting definition"}]}})}})},_X=t=>{const e=t.shared.workspace.IndexManager;return vt((n,r)=>{const i="#"+n.name,s=e.allElements(es).filter(o=>o.name===i&&o.node!==n).head();if(s){const o=s.documentUri!==bt(n).uri;r("error",`Duplicate tag '${n.name}'`,{node:n,property:"name",...o&&{relatedInformation:[{location:{range:s.nameSegment.range,uri:s.documentUri.toString()},message:"conflicting definition"}]}})}})},PX=t=>{const e=t.shared.workspace.IndexManager;return vt((n,r)=>{ba.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"}),e.allElements(Qi).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate RelationshipKind '${n.name}'`,{node:n,property:"name"})})},O_=t=>{const e=t.shared.workspace.IndexManager;return vt((n,r)=>{const i=e.allElements(oa),s=e.allElements(sa);i.concat(s).filter(o=>o.name===n.name).limit(2).count()>1&&r("error",`Duplicate GlobalPredicateGroup or GlobalDynamicPredicateGroup name '${n.name}'`,{node:n,property:"name"})})},xX=t=>{const e=t.shared.workspace.IndexManager;return vt((n,r)=>{e.allElements(xl).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate GlobalStyleId name '${n.name}'`,{node:n,property:"name"})})},IX=t=>{const e=t.shared.workspace.IndexManager;return vt((n,r)=>{n.name&&(ba.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"}),e.allElements(Zs).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate view '${n.name}'`,{node:n,property:"name"}))})},NX=t=>vt((e,n)=>{const r=sn(e,gh);Oh(r)&&n("error",'Invalid usage inside "exclude"',{node:e});const i=Bw(e.subject)?e.subject.subject:e.subject;switch(!0){case El(i):case Mw(i):case GA(i):case io(i):return;case _h(i):case xh(i):n("error","Invalid target (expect reference to specific element)",{node:e,property:"subject"});return;default:Oe(i)}}),OX=t=>vt((e,n)=>{xi(e,$w)&&n("warning","Redundant usage, expand predicate resolves parent element only when used in relations",{node:e})}),FX=t=>{const e=t.likec4.ModelParser;return vt((n,r)=>{if(n.$container.$type!=="DeploymentViewRulePredicateExpression")return;const i=sn(n,xw);if(!i||i.isInclude!==!0)return;const s=bt(n),o=e.forDocument(s),a="Model reference is allowed in exclude predicate only";if(zA(n)){xa.isModelRef(o.parseFqnExpr(n.source.from))&&r("error",a,{node:n.source,property:"from"}),xa.isModelRef(o.parseFqnExpr(n.target))&&r("error",a,{node:n,property:"target"});return}let c;if(XA(n)?c=n.to:t_(n)?c=n.from:c=n.inout.to,xa.isModelRef(o.parseFqnExpr(c))){r("error",a,{node:n});return}})},LX=t=>{const e=t.likec4.ModelParser;return vt((n,r)=>{const i=n.ref.value.ref;if(Et(i)){r("error","Invalid empty reference",{node:n});return}const s=bt(n),o=e.forDocument(s).parseFqnRefExpr(n);if(n.$container.$type==="DeploymentViewRulePredicateExpression"){if(xa.isModelRef(o)){r("error","Deployment view predicate must reference deployment model",{node:n});return}if(xa.isDeploymentRef(o)&&Pa.isInsideInstanceRef(o.ref)){r("error","Must reference deployment nodes or instances, but not internals",{node:n});return}}!Nn(i)&&on(n.selector)&&r("warning",`Selector '${n.selector}' applies to deployment nodes only, ignored here`,{node:n,property:"selector"})})},MX=t=>vt((e,n)=>{if(io(e.to)&&!Ww(e.$container)){const r=sn(e,Ih);Et(r?.viewOf)&&n("warning","Predicate is ignored as it concerns all relationships",{node:e})}}),BX=t=>vt((e,n)=>{if(io(e.from)&&!Nw(e.$container)){const r=sn(e,Ih);Et(r?.viewOf)&&n("warning","Predicate is ignored as it concerns all relationships",{node:e})}}),zX=t=>vt((e,n)=>{const r=sn(e,gh);Oh(r)&&n("error",'Invalid usage inside "exclude"',{node:e})});function qX(t){return e=>t.some(n=>n(e))}const jX=qX([Uw,YA,KA,_l,Pl,jA,Ph,Kw,ww,$w,Ow,Lw,dK,xw,mK,IA,jw,bK,Sw,yK,Jw,DK,vw,Ew,kw,Mr,Nn,to,NA,Qo,zr,hK,OA,Wh,Wn,ia,pa,ma,em,tm,Qh,Xw]),UX=t=>{let e=t;for(;e&&!FK(e);){if(jX(e))return e;e=e.$container}};function GX(t){const e=t.diagnostics?.filter(r=>r.severity===zc.Error)??[],n=new WeakSet;for(const{node:r}of e){if(Et(r)||n.has(r))continue;n.add(r);const i=UX(r);i&&n.add(i)}return{isValid:r=>!n.has(r),invalidNodes:n}}function WX(t){Fe.debug("registerValidationChecks"),t.validation.ValidationRegistry.register({DeployedInstance:mX(t),DeploymentNode:hX(t),DeploymentRelation:gX(t),FqnRefExpr:LX(t),RelationExpr:FX(t),NotesProperty:RX(),OpacityProperty:DX(),IconProperty:EX(),SpecificationRule:SX(),Model:kX(),Globals:CX(),GlobalPredicateGroup:O_(t),GlobalDynamicPredicateGroup:O_(t),GlobalStyleId:xX(t),DynamicViewStep:vX(t),LikeC4View:IX(t),Element:bX(t),ElementKind:AX(t),Relation:$X(t),RelationBody:TX(),Tag:_X(t),DynamicViewPredicateIterator:yX(),ElementPredicateWith:NX(),RelationPredicateWith:zX(),ExpandElementExpression:OX(),RelationshipKind:PX(t),IncomingRelationExpression:MX(),OutgoingRelationExpression:BX()});const e=t.shared.lsp.Connection;e&&t.shared.workspace.DocumentBuilder.onUpdate((n,r)=>{for(const i of r)Fe.debug(`clear diagnostics for deleted ${i.path}`),e.sendDiagnostics({uri:i.toString(),diagnostics:[]})})}function qr(t){return on(t)?lt(t).split(`
245
- `).join(" "):void 0}function lt(t){return on(t)?ib(t).trim():void 0}class HX{constructor(e,n){this.services=e,this.doc=n,this.isValid=GX(n).isValid}isValid;resolveFqn(e){if(xA(e))return this.services.likec4.DeploymentsIndex.getFqn(e);if(ia(e))return im(e.element);const n=this.services.likec4.FqnIndex.getFqn(e);return Ce(n,`Not indexed element: ${this.getAstNodePath(e)}`),n}getAstNodePath(e){return this.services.workspace.AstNodeLocator.getAstNodePath(e)}getMetadata(e){if(!(!e||!this.isValid(e)))return gr(e.props,n=>[n.key,lt(n.value)])}convertTags(e){return this.parseTags(e)}parseTags(e){let n=e?.tags;if(!n)return null;const r=[];for(;n;){try{if(this.isValid(n)){const i=n.values.map(s=>s.ref?.name).filter(ue);i.length>0&&r.push(...i)}}catch{}n=n.prev}return r.reverse(),sr(r)?r:null}convertLinks(e){return this.parseLinks(e)}parseLinks(e){if(!(!e?.props||e.props.length===0))return tt(e.props,Ve(Uh),zi(n=>{if(!this.isValid(n))return[];const r=n.value;if(ue(r)){const i=ue(n.title)?qr(n.title):void 0;return i?{url:r,title:i}:{url:r}}return[]}))}}function Ad(...t){var e=t.length>1?t.join(":::"):t[0];return hN(e)}function VX(t){return class extends t{parseDeployment(){const e=this.doc;for(const n of QK(e))try{switch(!0){case to(n):{this.isValid(n)&&e.c4DeploymentRelations.push(this.parseDeploymentRelation(n));break}case Mr(n):e.c4Deployments.push(this.parseDeployedInstance(n));break;case Nn(n):{e.c4Deployments.push(this.parseDeploymentNode(n));break}default:Oe(n)}}catch(r){ve(r)}}parseDeploymentNode(e){const n=this.isValid,r=this.resolveFqn(e),i=fn(e.kind.ref,"DeploymentKind not resolved").name,s=this.convertTags(e.body),o=e.body?.props.find(Zi)?.props,a=ts(o,n),c=this.getMetadata(e.body?.props.find(Qo)),u=tt(e.body?.props??[],Ve(n),Ve($l),gr(v=>[v.key,v.value||void 0])),l=lt(e.title??u.title),d=lt(u.description),f=qr(u.technology),p=this.convertLinks(e.body),h=e.body?.props.find(Br);if(h&&n(h)){const v=h.libicon?.ref?.name??h.value;ue(v)&&(a.icon=v)}return{id:r,kind:i,title:l??Aa(r),...c&&{metadata:c},...s&&{tags:s},...p&&sr(p)&&{links:p},...ue(f)&&{technology:f},...ue(d)&&{description:d},style:a}}parseDeployedInstance(e){const n=this.isValid,r=this.resolveFqn(e),i=this.resolveFqn(fn($n(e.element),"DeployedInstance element not found")),s=this.convertTags(e.body),o=e.body?.props.find(Zi)?.props,a=ts(o,n),c=this.getMetadata(e.body?.props.find(Qo)),u=tt(e.body?.props??[],Ve(n),Ve($l),gr(v=>[v.key,v.value||void 0])),l=lt(e.title??u.title),d=lt(u.description),f=qr(u.technology),p=this.convertLinks(e.body),h=e.body?.props.find(Br);if(h&&n(h)){const v=h.libicon?.ref?.name??h.value;ue(v)&&(a.icon=v)}return{id:r,element:i,...c&&{metadata:c},...l&&{title:l},...s&&{tags:s},...p&&sr(p)&&{links:p},...ue(f)&&{technology:f},...ue(d)&&{description:d},style:a}}parseDeploymentRelation(e){const n=this.isValid,r=this.getAstNodePath(e),i=Pa.toDeploymentRef(this.parseFqnRef(e.source)),s=Pa.toDeploymentRef(this.parseFqnRef(e.target)),o=this.convertTags(e)??this.convertTags(e.body),a=this.convertLinks(e.body),c=e.kind?.ref?.name,u=this.getMetadata(e.body?.props.find(Qo)),l=gr(e.body?.props.filter(rd)??[],b=>[b.key,b.value]),d=tt(e.body?.props??[],Ve(Zl),vn(b=>b.value.view.ref?.name),Ve(ue),Vo()),f=lt(e.title??l.title),p=lt(l.description),h=qr(e.technology)??lt(l.technology),v=e.body?.props.find(Xh);return{id:Ad("deployment",r,i.id,s.id),source:i,target:s,...f&&{title:f},...u&&{metadata:u},...ue(h)&&{technology:h},...ue(p)&&{description:p},...c&&{kind:c},...o&&{tags:o},...sr(a)&&{links:a},...eb(v?.props,n),...d&&{navigateTo:d},astPath:r}}}}function KX(t){for(var e=t.length,n=0,r=0;r<e;){var i=t.charCodeAt(r++);if(i&4294967168)if(!(i&4294965248))n+=2;else{if(i>=55296&&i<=56319&&r<e){var s=t.charCodeAt(r);(s&64512)===56320&&(++r,i=((i&1023)<<10)+(s&1023)+65536)}i&4294901760?n+=4:n+=3}else{n++;continue}}return n}function YX(t,e,n){for(var r=t.length,i=n,s=0;s<r;){var o=t.charCodeAt(s++);if(o&4294967168)if(!(o&4294965248))e[i++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&s<r){var a=t.charCodeAt(s);(a&64512)===56320&&(++s,o=((o&1023)<<10)+(a&1023)+65536)}o&4294901760?(e[i++]=o>>18&7|240,e[i++]=o>>12&63|128,e[i++]=o>>6&63|128):(e[i++]=o>>12&15|224,e[i++]=o>>6&63|128)}else{e[i++]=o;continue}e[i++]=o&63|128}}var XX=new TextEncoder,JX=50;function ZX(t,e,n){XX.encodeInto(t,e.subarray(n))}function QX(t,e,n){t.length>JX?ZX(t,e,n):YX(t,e,n)}var eJ=4096;function F_(t,e,n){for(var r=e,i=r+n,s=[],o="";r<i;){var a=t[r++];if(!(a&128))s.push(a);else if((a&224)===192){var c=t[r++]&63;s.push((a&31)<<6|c)}else if((a&240)===224){var c=t[r++]&63,u=t[r++]&63;s.push((a&31)<<12|c<<6|u)}else if((a&248)===240){var c=t[r++]&63,u=t[r++]&63,l=t[r++]&63,d=(a&7)<<18|c<<12|u<<6|l;d>65535&&(d-=65536,s.push(d>>>10&1023|55296),d=56320|d&1023),s.push(d)}else s.push(a);s.length>=eJ&&(o+=String.fromCharCode.apply(String,s),s.length=0)}return s.length>0&&(o+=String.fromCharCode.apply(String,s)),o}var tJ=new TextDecoder,nJ=200;function rJ(t,e,n){var r=t.subarray(e,e+n);return tJ.decode(r)}function iJ(t,e,n){return n>nJ?rJ(t,e,n):F_(t,e,n)}var lm=function(){function t(e,n){this.type=e,this.data=n}return t}(),sJ=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jr=function(t){sJ(e,t);function e(n){var r=t.call(this,n)||this,i=Object.create(e.prototype);return Object.setPrototypeOf(r,i),Object.defineProperty(r,"name",{configurable:!0,enumerable:!1,value:e.name}),r}return e}(Error),_d=4294967295;function oJ(t,e,n){var r=n/4294967296,i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function L_(t,e,n){var r=Math.floor(n/4294967296),i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function M_(t,e){var n=t.getInt32(e),r=t.getUint32(e+4);return n*4294967296+r}function aJ(t,e){var n=t.getUint32(e),r=t.getUint32(e+4);return n*4294967296+r}var cJ=-1,uJ=4294967296-1,lJ=17179869184-1;function dJ(t){var e=t.sec,n=t.nsec;if(e>=0&&n>=0&&e<=lJ)if(n===0&&e<=uJ){var r=new Uint8Array(4),i=new DataView(r.buffer);return i.setUint32(0,e),r}else{var s=e/4294967296,o=e&4294967295,r=new Uint8Array(8),i=new DataView(r.buffer);return i.setUint32(0,n<<2|s&3),i.setUint32(4,o),r}else{var r=new Uint8Array(12),i=new DataView(r.buffer);return i.setUint32(0,n),L_(i,4,e),r}}function fJ(t){var e=t.getTime(),n=Math.floor(e/1e3),r=(e-n*1e3)*1e6,i=Math.floor(r/1e9);return{sec:n+i,nsec:r-i*1e9}}function pJ(t){if(t instanceof Date){var e=fJ(t);return dJ(e)}else return null}function hJ(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:{var n=e.getUint32(0),r=0;return{sec:n,nsec:r}}case 8:{var i=e.getUint32(0),s=e.getUint32(4),n=(i&3)*4294967296+s,r=i>>>2;return{sec:n,nsec:r}}case 12:{var n=M_(e,4),r=e.getUint32(0);return{sec:n,nsec:r}}default:throw new jr("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(t.length))}}function mJ(t){var e=hJ(t);return new Date(e.sec*1e3+e.nsec/1e6)}var gJ={type:cJ,encode:pJ,decode:mJ},B_=function(){function t(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(gJ)}return t.prototype.register=function(e){var n=e.type,r=e.encode,i=e.decode;if(n>=0)this.encoders[n]=r,this.decoders[n]=i;else{var s=1+n;this.builtInEncoders[s]=r,this.builtInDecoders[s]=i}},t.prototype.tryToEncode=function(e,n){for(var r=0;r<this.builtInEncoders.length;r++){var i=this.builtInEncoders[r];if(i!=null){var s=i(e,n);if(s!=null){var o=-1-r;return new lm(o,s)}}}for(var r=0;r<this.encoders.length;r++){var i=this.encoders[r];if(i!=null){var s=i(e,n);if(s!=null){var o=r;return new lm(o,s)}}}return e instanceof lm?e:null},t.prototype.decode=function(e,n,r){var i=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return i?i(e,n,r):new lm(n,e)},t.defaultCodec=new t,t}();function dm(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t instanceof ArrayBuffer?new Uint8Array(t):Uint8Array.from(t)}function yJ(t){if(t instanceof ArrayBuffer)return new DataView(t);var e=dm(t);return new DataView(e.buffer,e.byteOffset,e.byteLength)}var vJ=100,wJ=2048,bJ=function(){function t(e){var n,r,i,s,o,a,c,u;this.extensionCodec=(n=e?.extensionCodec)!==null&&n!==void 0?n:B_.defaultCodec,this.context=e?.context,this.useBigInt64=(r=e?.useBigInt64)!==null&&r!==void 0?r:!1,this.maxDepth=(i=e?.maxDepth)!==null&&i!==void 0?i:vJ,this.initialBufferSize=(s=e?.initialBufferSize)!==null&&s!==void 0?s:wJ,this.sortKeys=(o=e?.sortKeys)!==null&&o!==void 0?o:!1,this.forceFloat32=(a=e?.forceFloat32)!==null&&a!==void 0?a:!1,this.ignoreUndefined=(c=e?.ignoreUndefined)!==null&&c!==void 0?c:!1,this.forceIntegerToFloat=(u=e?.forceIntegerToFloat)!==null&&u!==void 0?u:!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}return t.prototype.reinitializeState=function(){this.pos=0},t.prototype.encodeSharedRef=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)},t.prototype.encode=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)},t.prototype.doEncode=function(e,n){if(n>this.maxDepth)throw new Error("Too deep objects in depth ".concat(n));e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,n)},t.prototype.ensureBufferSizeToWrite=function(e){var n=this.pos+e;this.view.byteLength<n&&this.resizeBuffer(n*2)},t.prototype.resizeBuffer=function(e){var n=new ArrayBuffer(e),r=new Uint8Array(n),i=new DataView(n);r.set(this.bytes),this.view=i,this.bytes=r},t.prototype.encodeNil=function(){this.writeU8(192)},t.prototype.encodeBoolean=function(e){e===!1?this.writeU8(194):this.writeU8(195)},t.prototype.encodeNumber=function(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)},t.prototype.encodeNumberAsFloat=function(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},t.prototype.encodeBigInt64=function(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))},t.prototype.writeStringHeader=function(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error("Too long string: ".concat(e," bytes in UTF-8"))},t.prototype.encodeString=function(e){var n=5,r=KX(e);this.ensureBufferSizeToWrite(n+r),this.writeStringHeader(r),QX(e,this.bytes,this.pos),this.pos+=r},t.prototype.encodeObject=function(e,n){var r=this.extensionCodec.tryToEncode(e,this.context);if(r!=null)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,n);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,n);else throw new Error("Unrecognized object: ".concat(Object.prototype.toString.apply(e)))},t.prototype.encodeBinary=function(e){var n=e.byteLength;if(n<256)this.writeU8(196),this.writeU8(n);else if(n<65536)this.writeU8(197),this.writeU16(n);else if(n<4294967296)this.writeU8(198),this.writeU32(n);else throw new Error("Too large binary: ".concat(n));var r=dm(e);this.writeU8a(r)},t.prototype.encodeArray=function(e,n){var r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<4294967296)this.writeU8(221),this.writeU32(r);else throw new Error("Too large array: ".concat(r));for(var i=0,s=e;i<s.length;i++){var o=s[i];this.doEncode(o,n+1)}},t.prototype.countWithoutUndefined=function(e,n){for(var r=0,i=0,s=n;i<s.length;i++){var o=s[i];e[o]!==void 0&&r++}return r},t.prototype.encodeMap=function(e,n){var r=Object.keys(e);this.sortKeys&&r.sort();var i=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(i<16)this.writeU8(128+i);else if(i<65536)this.writeU8(222),this.writeU16(i);else if(i<4294967296)this.writeU8(223),this.writeU32(i);else throw new Error("Too large map object: ".concat(i));for(var s=0,o=r;s<o.length;s++){var a=o[s],c=e[a];this.ignoreUndefined&&c===void 0||(this.encodeString(a),this.doEncode(c,n+1))}},t.prototype.encodeExtension=function(e){var n=e.data.length;if(n===1)this.writeU8(212);else if(n===2)this.writeU8(213);else if(n===4)this.writeU8(214);else if(n===8)this.writeU8(215);else if(n===16)this.writeU8(216);else if(n<256)this.writeU8(199),this.writeU8(n);else if(n<65536)this.writeU8(200),this.writeU16(n);else if(n<4294967296)this.writeU8(201),this.writeU32(n);else throw new Error("Too large extension object: ".concat(n));this.writeI8(e.type),this.writeU8a(e.data)},t.prototype.writeU8=function(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++},t.prototype.writeU8a=function(e){var n=e.length;this.ensureBufferSizeToWrite(n),this.bytes.set(e,this.pos),this.pos+=n},t.prototype.writeI8=function(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++},t.prototype.writeU16=function(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2},t.prototype.writeI16=function(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2},t.prototype.writeU32=function(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4},t.prototype.writeI32=function(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4},t.prototype.writeF32=function(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4},t.prototype.writeF64=function(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8},t.prototype.writeU64=function(e){this.ensureBufferSizeToWrite(8),oJ(this.view,this.pos,e),this.pos+=8},t.prototype.writeI64=function(e){this.ensureBufferSizeToWrite(8),L_(this.view,this.pos,e),this.pos+=8},t.prototype.writeBigUint64=function(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8},t.prototype.writeBigInt64=function(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8},t}();function DJ(t,e){var n=new bJ(e);return n.encodeSharedRef(t)}function ab(t){return"".concat(t<0?"-":"","0x").concat(Math.abs(t).toString(16).padStart(2,"0"))}var EJ=16,RJ=16,$J=function(){function t(e,n){e===void 0&&(e=EJ),n===void 0&&(n=RJ),this.maxKeyLength=e,this.maxLengthPerKey=n,this.hit=0,this.miss=0,this.caches=[];for(var r=0;r<this.maxKeyLength;r++)this.caches.push([])}return t.prototype.canBeCached=function(e){return e>0&&e<=this.maxKeyLength},t.prototype.find=function(e,n,r){var i=this.caches[r-1];e:for(var s=0,o=i;s<o.length;s++){for(var a=o[s],c=a.bytes,u=0;u<r;u++)if(c[u]!==e[n+u])continue e;return a.str}return null},t.prototype.store=function(e,n){var r=this.caches[e.length-1],i={bytes:e,str:n};r.length>=this.maxLengthPerKey?r[Math.random()*r.length|0]=i:r.push(i)},t.prototype.decode=function(e,n,r){var i=this.find(e,n,r);if(i!=null)return this.hit++,i;this.miss++;var s=F_(e,n,r),o=Uint8Array.prototype.slice.call(e,n,n+r);return this.store(o,s),s},t}(),TJ=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{u(r.next(l))}catch(d){o(d)}}function c(l){try{u(r.throw(l))}catch(d){o(d)}}function u(l){l.done?s(l.value):i(l.value).then(a,c)}u((r=r.apply(t,e||[])).next())})},cb=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(l){return c([u,l])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(l){u=[6,l],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},z_=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},o)}},Da=function(t){return this instanceof Da?(this.v=t,this):new Da(t)},SJ=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(f){r[f]&&(i[f]=function(p){return new Promise(function(h,v){s.push([f,p,h,v])>1||a(f,p)})})}function a(f,p){try{c(r[f](p))}catch(h){d(s[0][3],h)}}function c(f){f.value instanceof Da?Promise.resolve(f.value.v).then(u,l):d(s[0][2],f)}function u(f){a("next",f)}function l(f){a("throw",f)}function d(f,p){f(p),s.shift(),s.length&&a(s[0][0],s[0][1])}},q_="array",fm="map_key",kJ="map_value",CJ=function(t){return typeof t=="string"||typeof t=="number"},Pd=-1,ub=new DataView(new ArrayBuffer(0)),AJ=new Uint8Array(ub.buffer);try{ub.getInt8(0)}catch(t){if(!(t instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var lb=RangeError,j_=new lb("Insufficient data"),_J=new $J,PJ=function(){function t(e){var n,r,i,s,o,a,c;this.totalPos=0,this.pos=0,this.view=ub,this.bytes=AJ,this.headByte=Pd,this.stack=[],this.extensionCodec=(n=e?.extensionCodec)!==null&&n!==void 0?n:B_.defaultCodec,this.context=e?.context,this.useBigInt64=(r=e?.useBigInt64)!==null&&r!==void 0?r:!1,this.maxStrLength=(i=e?.maxStrLength)!==null&&i!==void 0?i:_d,this.maxBinLength=(s=e?.maxBinLength)!==null&&s!==void 0?s:_d,this.maxArrayLength=(o=e?.maxArrayLength)!==null&&o!==void 0?o:_d,this.maxMapLength=(a=e?.maxMapLength)!==null&&a!==void 0?a:_d,this.maxExtLength=(c=e?.maxExtLength)!==null&&c!==void 0?c:_d,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:_J}return t.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=Pd,this.stack.length=0},t.prototype.setBuffer=function(e){this.bytes=dm(e),this.view=yJ(this.bytes),this.pos=0},t.prototype.appendBuffer=function(e){if(this.headByte===Pd&&!this.hasRemaining(1))this.setBuffer(e);else{var n=this.bytes.subarray(this.pos),r=dm(e),i=new Uint8Array(n.length+r.length);i.set(n),i.set(r,n.length),this.setBuffer(i)}},t.prototype.hasRemaining=function(e){return this.view.byteLength-this.pos>=e},t.prototype.createExtraByteError=function(e){var n=this,r=n.view,i=n.pos;return new RangeError("Extra ".concat(r.byteLength-i," of ").concat(r.byteLength," byte(s) found at buffer[").concat(e,"]"))},t.prototype.decode=function(e){this.reinitializeState(),this.setBuffer(e);var n=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return n},t.prototype.decodeMulti=function(e){return cb(this,function(n){switch(n.label){case 0:this.reinitializeState(),this.setBuffer(e),n.label=1;case 1:return this.hasRemaining(1)?[4,this.doDecodeSync()]:[3,3];case 2:return n.sent(),[3,1];case 3:return[2]}})},t.prototype.decodeAsync=function(e){var n,r,i,s,o,a,c;return TJ(this,void 0,void 0,function(){var u,l,d,f,p,h,v,b;return cb(this,function(g){switch(g.label){case 0:u=!1,g.label=1;case 1:g.trys.push([1,6,7,12]),n=!0,r=z_(e),g.label=2;case 2:return[4,r.next()];case 3:if(i=g.sent(),s=i.done,!!s)return[3,5];c=i.value,n=!1;try{if(d=c,u)throw this.createExtraByteError(this.totalPos);this.appendBuffer(d);try{l=this.doDecodeSync(),u=!0}catch(w){if(!(w instanceof lb))throw w}this.totalPos+=this.pos}finally{n=!0}g.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return f=g.sent(),o={error:f},[3,12];case 7:return g.trys.push([7,,10,11]),!n&&!s&&(a=r.return)?[4,a.call(r)]:[3,9];case 8:g.sent(),g.label=9;case 9:return[3,11];case 10:if(o)throw o.error;return[7];case 11:return[7];case 12:if(u){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,l]}throw p=this,h=p.headByte,v=p.pos,b=p.totalPos,new RangeError("Insufficient data in parsing ".concat(ab(h)," at ").concat(b," (").concat(v," in the current buffer)"))}})})},t.prototype.decodeArrayStream=function(e){return this.decodeMultiAsync(e,!0)},t.prototype.decodeStream=function(e){return this.decodeMultiAsync(e,!1)},t.prototype.decodeMultiAsync=function(e,n){return SJ(this,arguments,function(){var i,s,o,a,c,u,l,d,f,p,h,v;return cb(this,function(b){switch(b.label){case 0:i=n,s=-1,b.label=1;case 1:b.trys.push([1,15,16,21]),o=!0,a=z_(e),b.label=2;case 2:return[4,Da(a.next())];case 3:if(c=b.sent(),f=c.done,!!f)return[3,14];v=c.value,o=!1,b.label=4;case 4:if(b.trys.push([4,,12,13]),u=v,n&&s===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(u),i&&(s=this.readArraySize(),i=!1,this.complete()),b.label=5;case 5:b.trys.push([5,10,,11]),b.label=6;case 6:return[4,Da(this.doDecodeSync())];case 7:return[4,b.sent()];case 8:return b.sent(),--s===0?[3,9]:[3,6];case 9:return[3,11];case 10:if(l=b.sent(),!(l instanceof lb))throw l;return[3,11];case 11:return this.totalPos+=this.pos,[3,13];case 12:return o=!0,[7];case 13:return[3,2];case 14:return[3,21];case 15:return d=b.sent(),p={error:d},[3,21];case 16:return b.trys.push([16,,19,20]),!o&&!f&&(h=a.return)?[4,Da(h.call(a))]:[3,18];case 17:b.sent(),b.label=18;case 18:return[3,20];case 19:if(p)throw p.error;return[7];case 20:return[7];case 21:return[2]}})})},t.prototype.doDecodeSync=function(){e:for(;;){var e=this.readHeadByte(),n=void 0;if(e>=224)n=e-256;else if(e<192)if(e<128)n=e;else if(e<144){var r=e-128;if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e<160){var r=e-144;if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else{var i=e-160;n=this.decodeUtf8String(i,0)}else if(e===192)n=null;else if(e===194)n=!1;else if(e===195)n=!0;else if(e===202)n=this.readF32();else if(e===203)n=this.readF64();else if(e===204)n=this.readU8();else if(e===205)n=this.readU16();else if(e===206)n=this.readU32();else if(e===207)this.useBigInt64?n=this.readU64AsBigInt():n=this.readU64();else if(e===208)n=this.readI8();else if(e===209)n=this.readI16();else if(e===210)n=this.readI32();else if(e===211)this.useBigInt64?n=this.readI64AsBigInt():n=this.readI64();else if(e===217){var i=this.lookU8();n=this.decodeUtf8String(i,1)}else if(e===218){var i=this.lookU16();n=this.decodeUtf8String(i,2)}else if(e===219){var i=this.lookU32();n=this.decodeUtf8String(i,4)}else if(e===220){var r=this.readU16();if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else if(e===221){var r=this.readU32();if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else if(e===222){var r=this.readU16();if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e===223){var r=this.readU32();if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e===196){var r=this.lookU8();n=this.decodeBinary(r,1)}else if(e===197){var r=this.lookU16();n=this.decodeBinary(r,2)}else if(e===198){var r=this.lookU32();n=this.decodeBinary(r,4)}else if(e===212)n=this.decodeExtension(1,0);else if(e===213)n=this.decodeExtension(2,0);else if(e===214)n=this.decodeExtension(4,0);else if(e===215)n=this.decodeExtension(8,0);else if(e===216)n=this.decodeExtension(16,0);else if(e===199){var r=this.lookU8();n=this.decodeExtension(r,1)}else if(e===200){var r=this.lookU16();n=this.decodeExtension(r,2)}else if(e===201){var r=this.lookU32();n=this.decodeExtension(r,4)}else throw new jr("Unrecognized type byte: ".concat(ab(e)));this.complete();for(var s=this.stack;s.length>0;){var o=s[s.length-1];if(o.type===q_)if(o.array[o.position]=n,o.position++,o.position===o.size)s.pop(),n=o.array;else continue e;else if(o.type===fm){if(!CJ(n))throw new jr("The type of key must be string or number but "+typeof n);if(n==="__proto__")throw new jr("The key __proto__ is not allowed");o.key=n,o.type=kJ;continue e}else if(o.map[o.key]=n,o.readCount++,o.readCount===o.size)s.pop(),n=o.map;else{o.key=null,o.type=fm;continue e}}return n}},t.prototype.readHeadByte=function(){return this.headByte===Pd&&(this.headByte=this.readU8()),this.headByte},t.prototype.complete=function(){this.headByte=Pd},t.prototype.readArraySize=function(){var e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new jr("Unrecognized array type byte: ".concat(ab(e)))}}},t.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new jr("Max length exceeded: map length (".concat(e,") > maxMapLengthLength (").concat(this.maxMapLength,")"));this.stack.push({type:fm,size:e,key:null,readCount:0,map:{}})},t.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new jr("Max length exceeded: array length (".concat(e,") > maxArrayLength (").concat(this.maxArrayLength,")"));this.stack.push({type:q_,size:e,array:new Array(e),position:0})},t.prototype.decodeUtf8String=function(e,n){var r;if(e>this.maxStrLength)throw new jr("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLength<this.pos+n+e)throw j_;var i=this.pos+n,s;return this.stateIsMapKey()&&(!((r=this.keyDecoder)===null||r===void 0)&&r.canBeCached(e))?s=this.keyDecoder.decode(this.bytes,i,e):s=iJ(this.bytes,i,e),this.pos+=n+e,s},t.prototype.stateIsMapKey=function(){if(this.stack.length>0){var e=this.stack[this.stack.length-1];return e.type===fm}return!1},t.prototype.decodeBinary=function(e,n){if(e>this.maxBinLength)throw new jr("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+n))throw j_;var r=this.pos+n,i=this.bytes.subarray(r,r+e);return this.pos+=n+e,i},t.prototype.decodeExtension=function(e,n){if(e>this.maxExtLength)throw new jr("Max length exceeded: ext length (".concat(e,") > maxExtLength (").concat(this.maxExtLength,")"));var r=this.view.getInt8(this.pos+n),i=this.decodeBinary(e,n+1);return this.extensionCodec.decode(i,r,this.context)},t.prototype.lookU8=function(){return this.view.getUint8(this.pos)},t.prototype.lookU16=function(){return this.view.getUint16(this.pos)},t.prototype.lookU32=function(){return this.view.getUint32(this.pos)},t.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},t.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},t.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},t.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},t.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},t.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},t.prototype.readU64=function(){var e=aJ(this.view,this.pos);return this.pos+=8,e},t.prototype.readI64=function(){var e=M_(this.view,this.pos);return this.pos+=8,e},t.prototype.readU64AsBigInt=function(){var e=this.view.getBigUint64(this.pos);return this.pos+=8,e},t.prototype.readI64AsBigInt=function(){var e=this.view.getBigInt64(this.pos);return this.pos+=8,e},t.prototype.readF32=function(){var e=this.view.getFloat32(this.pos);return this.pos+=4,e},t.prototype.readF64=function(){var e=this.view.getFloat64(this.pos);return this.pos+=8,e},t}();function xJ(t,e){var n=new PJ(e);return n.decode(t)}const IJ=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]",NJ=(t,e=0,n=t.byteLength-e)=>{if(!IJ(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return Hm.from(t,e,n)},U_=(t,e)=>{if(typeof t!="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return e?Hm.from(t,e):Hm.from(t)},OJ=/^[A-Za-z0-9+/]*={0,2}$/,FJ=t=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!OJ.exec(t))throw new TypeError("Invalid base64 string.");const e=U_(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},LJ=t=>{const e=U_(t,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT)},MJ=t=>{let e;if(typeof t=="string"?e=LJ(t):e=t,typeof e!="object"||typeof e.byteOffset!="number"||typeof e.byteLength!="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return NJ(e.buffer,e.byteOffset,e.byteLength).toString("base64")},{getDocument:BJ}=gc;function zJ({nodes:t,edges:e,...n}){return{...n,nodes:Xc(t,({x:r,y:i,width:s,height:o,isCompound:a,...c})=>({...c,b:[r,i,s,o],c:a})),edges:Xc(e,({points:r,controlPoints:i,labelBBox:s,dotpos:o,...a})=>({...!!i&&{cp:i},...!!s&&{l:s},...!!o&&{dp:o},...a,p:r}))}}function qJ({nodes:t,edges:e,autoLayout:n,...r}){return{...r,autoLayout:mN(n)?{direction:n}:n,nodes:Xc(t,({b:i,c:s,...o})=>({x:i[0],y:i[1],width:i[2],height:i[3],isCompound:s,...o})),edges:Xc(e,({p:i,cp:s,l:o,dp:a,...c})=>({...!!s&&{controlPoints:s},...!!o&&{labelBBox:o},...!!a&&{dotpos:a},...c,points:i}))}}const G_=500;function jJ(t){const e=DJ(zJ(t)),n=MJ(e),r=[];let i=0;for(;i<n.length;)r.push(" * "+n.slice(i,Math.min(i+G_,n.length))),i+=G_;return r.unshift("/**"," * @likec4-generated(v1)"),r.push(" */"),r.join(`
246
- `)}function W_(t){return t.includes("@likec4-generated")}function UJ(t){if(!W_(t))throw new Error(`Not a likec4-generated comment: ${t}`);const e=t.trim().split(`
247
- `).filter(r=>!r.includes("**")&&!r.includes("@likec4-")&&!r.includes("*/")).map(r=>r.replaceAll("*","").trim()).join(""),n=FJ(e);return qJ(xJ(n))}function db(t){const e=ff(t.$cstNode,["BLOCK_COMMENT"]);if(!(!e||!W_(e.text)))try{return UJ(e.text)}catch(n){const r=BJ(t);Fe.warn(n),Fe.warn(`Ignoring manual layout of "${t.name??"unnamed"}" at ${r.uri.fsPath}:${1+(e.range.start.line||0)}`);return}}function GJ(t){return class extends t{parseDeploymentView(e){const n=e.body;Ce(n,"DynamicElementView body is not defined");const r=n.props.filter(this.isValid),i=this.getAstNodePath(e);let s=e.name;s||(s="deployment_"+Ad(this.doc.uri.toString(),i));const o=qr(r.find(d=>d.key==="title")?.value)??null,a=lt(r.find(d=>d.key==="description")?.value)??null,c=this.convertTags(n),u=this.convertLinks(n);sm.writeId(e,s);const l=db(e);return{__:"deployment",id:s,astPath:i,title:o,description:a,tags:c,links:sr(u)?u:null,rules:n.rules.flatMap(d=>{try{return this.isValid(d)?this.parseDeploymentViewRule(d):[]}catch(f){return ve(f),[]}}),...l&&{manualLayout:l}}}parseDeploymentViewRule(e){if(xw(e))return this.parseDeploymentViewRulePredicate(e);if(ud(e))return tb(e);if(CK(e))return this.parseDeploymentViewRuleStyle(e);Oe(e)}parseDeploymentViewRulePredicate(e){const n=[];let r=e.expr;for(;r;){try{const i=r.value;if(on(i)&&this.isValid(i))switch(!0){case gK(i):n.unshift(this.parseFqnExpr(i));break;case IA(i):n.unshift(this.parseRelationExpr(i));break;case zK(i):n.unshift(this.parseRelationWhereExpr(i));break;default:Oe(i)}}catch(i){ve(i)}r=r.prev}return e.isInclude?{include:n}:{exclude:n}}parseDeploymentViewRuleStyle(e){const n=e.props.filter(Sw),r=e.props.find(la),i=lt(r?.value);return{targets:this.parseFqnExpressions(e.targets),...i&&{notation:i},style:{...ts(n,this.isValid)}}}}}function WJ(t){let e;for(;e=t.value?.ref;){if(Nn(e))return null;if(Mr(e))return e;if(Et(t.parent))return null;t=t.parent}return null}const H_=({operator:t,not:e},n)=>t.startsWith("!=")?{neq:n}:t.startsWith("=")?{eq:n}:e?{neq:n}:{eq:n};function Ea(t){switch(!0){case TK(t):{const e=t.value?.ref?.name;return Ce(e,"Expected tag name"),{tag:H_(t,e)}}case RK(t):{const e=t.value?.ref?.name;return Ce(e,"Expected kind name"),{kind:H_(t,e)}}case(o_(t)||c_(t)):return{not:Ea(t.value)};case GK(t):{const e=Ea(t.left),n=Ea(t.right),r=t.operator.toLowerCase();switch(r){case"and":{const i=[V0(e)?e.and:e,V0(n)?n.and:n].flat();return Ce(sr(i),"Expected non-empty array"),{and:i}}case"or":{const i=[H0(e)?e.or:e,H0(n)?n.or:n].flat();return Ce(sr(i),"Expected non-empty array"),{or:i}}default:Oe(r)}}default:Oe(t)}}function HJ(t){return class extends t{parseFqnRef(e){const n=fn(e.value.ref,`FqnRef is empty ${e.$cstNode?.range.start.line}:${e.$cstNode?.range.start.character}`);if(Wn(n)){const r=WJ(e);if(!r)return{model:this.resolveFqn(n)};const i=this.resolveFqn(r),s=this.resolveFqn(n);return{deployment:i,element:s}}if(xA(n))return{deployment:this.resolveFqn(n)};Oe(n)}parseFqnExpr(e){if(io(e))return{wildcard:!0};if(jw(e))return this.parseFqnRefExpr(e);Oe(e)}parseFqnRefExpr(e){const n=this.parseFqnRef(e.ref);switch(!0){case e.selector==="._":return{ref:n,selector:"expanded"};case e.selector===".**":return{ref:n,selector:"descendants"};case e.selector===".*":return{ref:n,selector:"children"};default:return{ref:n}}}parseFqnExpressions(e){const n=[];let r=e;for(;r;){try{on(r.value)&&this.isValid(r.value)&&n.push(this.parseFqnExpr(r.value))}catch(i){ve(i)}r=r.prev}return n.reverse()}parseRelationWhereExpr(e){return{where:{expr:this.parseRelationExpr(e.subject),condition:e.where?Ea(e.where):{kind:{neq:"--always-true--"}}}}}parseRelationExpr(e){if(Vw(e),zA(e))return{source:this.parseFqnExpr(e.source.from),target:this.parseFqnExpr(e.target),isBidirectional:e.source.isBidirectional};if(NK(e))return{inout:this.parseFqnExpr(e.inout.to)};if(t_(e))return{outgoing:this.parseFqnExpr(e.from)};if(XA(e))return{incoming:this.parseFqnExpr(e.to)};Oe(e)}}}function VJ(t){return class extends t{parseGlobals(){const{parseResult:e,c4Globals:n}=this.doc,r=this.isValid,i=e.value.globals.filter(r),s=i.flatMap(a=>a.predicates.filter(r));for(const a of s)try{const c=a.name;if(!ue(c))continue;if(c in n.predicates){Fe.warn(`Global predicate named "${c}" is already defined`);continue}this.parseAndStoreGlobalPredicateGroupOrDynamic(a,c,n)}catch(c){ve(c)}const o=i.flatMap(a=>a.styles.filter(r));for(const a of o)try{const c=a.id.name;if(!ue(c))continue;if(c in n.styles){Fe.warn(`Global style named "${c}" is already defined`);continue}const u=this.parseGlobalStyleOrGroup(a);u.length>0&&(n.styles[c]=u)}catch(c){ve(c)}}parseAndStoreGlobalPredicateGroupOrDynamic(e,n,r){if(YA(e)){const i=this.parseGlobalPredicateGroup(e);i.length>0&&(r.predicates[n]=i);return}if(KA(e)){const i=this.parseGlobalDynamicPredicateGroup(e);i.length>0&&(r.dynamicPredicates[n]=i);return}Oe(e)}parseGlobalPredicateGroup(e){return e.predicates.map(n=>this.parseViewRulePredicate(n))}parseGlobalDynamicPredicateGroup(e){return e.predicates.map(n=>this.parseDynamicViewIncludePredicate(n))}parseGlobalStyleOrGroup(e){if(_l(e))return[this.parseViewRuleStyle(e)];if(Pl(e))return e.styles.map(n=>this.parseViewRuleStyle(n));Oe(e)}}}function KJ(t){return class extends t{parseModel(){const e=this.doc;for(const n of ZK(e))try{if(Wn(n)){e.c4Elements.push(this.parseElement(n));continue}if(zr(n)){this.isValid(n)&&e.c4Relations.push(this.parseRelation(n));continue}Oe(n)}catch(r){ve(r)}}parseElement(e){const n=this.isValid,r=this.resolveFqn(e),i=fn(e.kind.ref,"Element kind is not resolved").name,s=this.parseTags(e.body),o=e.body?.props.find(Zi)?.props,a=ts(o,n),c=this.getMetadata(e.body?.props.find(Qo)),u=this.getAstNodePath(e);let[l,d,f]=e.props??[];const p=tt(e.body?.props??[],Ve(n),Ve($l),gr(b=>[b.key,b.value||void 0]));l=lt(l??p.title),d=lt(p.description??d),f=qr(p.technology??f);const h=this.parseLinks(e.body),v=e.body?.props.find(Br);if(v&&n(v)){const b=v.libicon?.ref?.name??v.value;ue(b)&&(a.icon=b)}return{id:r,kind:i,astPath:u,title:l??e.name,...c&&{metadata:c},...s&&{tags:s},...h&&sr(h)&&{links:h},...ue(f)&&{technology:f},...ue(d)&&{description:d},style:a}}parseRelation(e){const n=this.isValid,r=eY(e),i=this.resolveFqn(r.target),s=this.resolveFqn(r.source),o=this.parseTags(e)??this.parseTags(e.body),a=this.parseLinks(e.body),c=e.kind?.ref?.name,u=this.getMetadata(e.body?.props.find(Qo)),l=this.getAstNodePath(e),d=gr(e.body?.props.filter(rd).filter(g=>on(g.value))??[],g=>[g.key,g.value]),f=tt(e.body?.props??[],Ve(Zl),vn(g=>g.value.view.ref?.name),Ve(ue),Vo()),p=lt(e.title??d.title)??"",h=lt(d.description),v=qr(e.technology)??lt(d.technology),b=e.body?.props.find(Xh);return{id:Ad(l,s,i),astPath:l,source:s,target:i,title:p,...u&&{metadata:u},...ue(v)&&{technology:v},...ue(h)&&{description:h},...c&&{kind:c},...o&&{tags:o},...sr(a)&&{links:a},...eb(b?.props,n),...f&&{navigateTo:f}}}}}function YJ(t){return class extends t{parsePredicate(e){if(fK(e))return this.parseElementPredicate(e);if(vK(e))return this.parseRelationPredicate(e);Oe(e)}parseElementPredicate(e){if(Ph(e))return this.parseElementPredicateWith(e);if(Bw(e))return this.parseElementPredicateWhere(e);if(ww(e))return this.parseElementExpression(e);Oe(e)}parseElementExpressionsIterator(e){const n=[];let r=e;for(;r;){try{r.value&&n.unshift(this.parseElementExpression(r.value))}catch(i){ve(i)}r=r.prev}return n}parseElementExpression(e){if(io(e))return{wildcard:!0};if(_h(e))return Ce(e.kind?.ref,"ElementKindExpr kind is not resolved: "+e.$cstNode?.text),{elementKind:e.kind.ref.name,isEqual:e.isEqual};if(xh(e)){Ce(e.tag?.ref,"ElementTagExpr tag is not resolved: "+e.$cstNode?.text);let n=e.tag.$refText;return n.startsWith("#")&&(n=n.slice(1)),{elementTag:n,isEqual:e.isEqual}}if(GA(e)){const n=$n(e.expand);return Ce(n,"Element not found "+e.expand.$cstNode?.text),{expanded:this.resolveFqn(n)}}if(Mw(e)){const n=$n(e.parent);return Ce(n,"Element not found "+e.parent.$cstNode?.text),{element:this.resolveFqn(n),isChildren:e.suffix===".*",isDescendants:e.suffix===".**"}}if(El(e)){const n=$n(e);return Ce(n,"Element not found "+e.$cstNode?.text),{element:this.resolveFqn(n)}}Oe(e)}parseElementPredicateWhere(e){return{where:{expr:this.parseElementExpression(e.subject),condition:e.where?Ea(e.where):{kind:{neq:"--always-true--"}}}}}parseElementPredicateWith(e){const n=this.parseElementPredicate(e.subject);return(e.custom?.props??[]).reduce((r,i)=>{if(!this.isValid(i))return r;if(Wh(i)){const s=i.value.view.$refText;return ue(s)&&(r.custom.navigateTo=s),r}if($l(i))return Qt(i.value)&&(r.custom[i.key]=lt(i.value)||""),r;if(Br(i)){const s=i.libicon?.ref?.name??i.value;return Qt(s)&&(r.custom[i.key]=s),r}if(Qs(i)){const s=kd(i);return Qt(s)&&(r.custom[i.key]=s),r}if(Jh(i)||bh(i))return Qt(i.value)&&(r.custom[i.key]=i.value),r;if(Hh(i))return Qt(i.value)&&(r.custom[i.key]=f_(i)),r;if(la(i))return ue(i.value)&&(r.custom[i.key]=lt(i.value)),r;Oe(i)},{custom:{expr:n}})}parseRelationPredicate(e){if(Kw(e)){let n=Vw(e.subject)?this.parseRelationPredicateWhere(e.subject):this.parseRelationExpression(e.subject);return this.parseRelationPredicateWith(e,n)}if(Vw(e))return this.parseRelationPredicateWhere(e);if($w(e))return this.parseRelationExpression(e);Oe(e)}parseRelationPredicateWhere(e){return{where:{expr:this.parseRelationExpression(e.subject),condition:e.where?Ea(e.where):{kind:{neq:"--always-true--"}}}}}parseRelationPredicateWith(e,n){return(e.custom?.props??[]).reduce((r,i)=>{if(rd(i)||la(i)||e_(i))return Qt(i.value)&&(r.customRelation[i.key]=lt(i.value)??""),r;if(ol(i))return ue(i.value)&&(r.customRelation[i.key]=i.value),r;if(Qs(i)){const s=kd(i);return ue(s)&&(r.customRelation[i.key]=s),r}if(zl(i))return ue(i.value)&&(r.customRelation[i.key]=i.value),r;if(Zl(i)){const s=i.value.view.ref?.name;return ue(s)&&(r.customRelation.navigateTo=s),r}Oe(i)},{customRelation:{relation:n}})}parseRelationExpression(e){if(Nw(e))return{source:this.parseElementExpression(e.source.from),target:this.parseElementExpression(e.target),isBidirectional:e.source.isBidirectional};if(Ww(e))return{inout:this.parseElementExpression(e.inout.to)};if(Hw(e))return{outgoing:this.parseElementExpression(e.from)};if(JA(e))return{incoming:this.parseElementExpression(e.to)};Oe(e)}}}function XJ(t){return class extends t{parseSpecification(){const{parseResult:{value:{specifications:e}},c4Specification:n}=this.doc,r=this.isValid,i=e.flatMap(u=>u.elements.filter(this.isValid));for(const{kind:u,props:l}of i)try{const d=u.name;if(!ue(d))continue;if(d in n.elements){Fe.warn(`Element kind "${d}" is already defined`);continue}const f=l.find(Zi),p=tt(l.filter(Yw)??[],Ve(h=>this.isValid(h)&&on(h.value)),gr(h=>[h.key,lt(h.value)]));n.elements[d]={...p,style:{...ts(f?.props,this.isValid)}}}catch(d){ve(d)}const s=e.flatMap(u=>u.relationships.filter(this.isValid));for(const{kind:u,props:l}of s)try{const d=u.name;if(!ue(d))continue;if(d in n.relationships){Fe.warn(`Relationship kind "${d}" is already defined`);continue}const f=tt(l.filter(r_)??[],Ve(p=>this.isValid(p)&&on(p.value)),gr(p=>[p.key,lt(p.value)]));n.relationships[d]={...f,...eb(l,this.isValid)}}catch(d){ve(d)}const o=e.flatMap(u=>u.tags.filter(this.isValid));for(const u of o){const l=u.tag.name;ue(l)&&n.tags.add(l)}const a=e.flatMap(u=>u.deploymentNodes.filter(r));for(const u of a)try{Object.assign(n.deployments,this.parseSpecificationDeploymentNodeKind(u))}catch(l){ve(l)}const c=e.flatMap(u=>u.colors.filter(r));for(const{name:u,color:l}of c)try{const d=u.name;if(d in n.colors){Fe.warn(`Custom color "${d}" is already defined`);continue}n.colors[d]={color:l}}catch(d){ve(d)}}parseSpecificationDeploymentNodeKind({kind:e,props:n}){const r=e.name;if(!ue(r))throw new Error("DeploymentNodeKind name is not resolved");const i=n.find(Zi),s=tt(n.filter(Yw)??[],Ve(o=>this.isValid(o)&&on(o.value)),gr(o=>[o.key,lt(o.value)]));return{[r]:{...s,style:{...ts(i?.props,this.isValid)}}}}}}function JJ(t){return class extends t{parseViews(){const e=this.isValid;for(const n of this.doc.parseResult.value.views){const r=n.styles.flatMap(i=>{try{return e(i)?this.parseViewRuleStyleOrGlobalRef(i):[]}catch(s){return ve(s),[]}});for(const i of n.views)try{if(!e(i))continue;switch(!0){case Ih(i):this.doc.c4Views.push(this.parseElementView(i,r));break;case qA(i):this.doc.c4Views.push(this.parseDynamicElementView(i,r));break;case BA(i):this.doc.c4Views.push(this.parseDeploymentView(i));break;default:Oe(i)}}catch(s){ve(s)}}}parseElementView(e,n){const r=e.body;Ce(r,"ElementView body is not defined");const i=this.getAstNodePath(e);let s=null;if("viewOf"in e){const p=$n(e.viewOf),h=p&&this.resolveFqn(p);h?s=h:Fe.warn("viewOf is not resolved: "+e.$cstNode?.text)}let o=e.name;o||(o="view_"+Ad(this.doc.uri.toString(),i,s??""));const a=qr(r.props.find(p=>p.key==="title")?.value)??null,c=lt(r.props.find(p=>p.key==="description")?.value)??null,u=this.convertTags(r),l=this.convertLinks(r),d=db(e),f={__:"element",id:o,astPath:i,title:a,description:c,tags:u,links:sr(l)?l:null,rules:[...n,...r.rules.flatMap(p=>{try{return this.isValid(p)?this.parseViewRule(p):[]}catch(h){return ve(h),[]}})],...s&&{viewOf:s},...d&&{manualLayout:d}};if(sm.writeId(e,f.id),"extends"in e){const p=e.extends.view.ref;return Ce(p?.name,"view extends is not resolved: "+e.$cstNode?.text),Object.assign(f,{extends:p.name})}return f}parseViewRule(e){if(gh(e))return this.parseViewRulePredicate(e);if(jK(e))return this.parseViewRuleGlobalPredicateRef(e);if(kw(e))return this.parseViewRuleStyleOrGlobalRef(e);if(ud(e))return tb(e);if(rm(e))return this.parseViewRuleGroup(e);Oe(e)}parseViewRulePredicate(e){const n=[];let r=e.predicates;for(;r;){const{value:i,prev:s}=r;try{ue(i)&&this.isValid(i)&&n.unshift(this.parsePredicate(i))}catch(o){ve(o)}if(!s)break;r=s}return Gw(e)?{include:n}:{exclude:n}}parseViewRuleGlobalPredicateRef(e){return{predicateId:e.predicate.$refText}}parseViewRuleStyleOrGlobalRef(e){if(hd(e))return this.parseViewRuleStyle(e);if(s_(e))return this.parseViewRuleGlobalStyle(e);Oe(e)}parseViewRuleGroup(e){const n=[];for(const r of e.groupRules)try{if(!this.isValid(r))continue;if(gh(r)){n.push(this.parseViewRulePredicate(r));continue}if(rm(r)){n.push(this.parseViewRuleGroup(r));continue}Oe(r)}catch(i){ve(i)}return{title:qr(e.title)??null,groupRules:n,...ts(e.props,this.isValid)}}parseViewRuleStyle(e){const n=e.props.filter(Sw),r=e.target,i=e.props.find(la);return this.parseRuleStyle(n,r,i)}parseRuleStyle(e,n,r){const i=ts(e,this.isValid),s=lt(r?.value);return{targets:this.parseElementExpressionsIterator(n),...s&&{notation:s},style:{...i}}}parseViewRuleGlobalStyle(e){return{styleId:e.style.$refText}}parseDynamicElementView(e,n){const r=e.body;Ce(r,"DynamicElementView body is not defined");const i=this.isValid,s=r.props.filter(i),o=this.getAstNodePath(e);let a=e.name;a||(a="dynamic_"+Ad(this.doc.uri.toString(),o));const c=qr(s.find(p=>p.key==="title")?.value)??null,u=lt(s.find(p=>p.key==="description")?.value)??null,l=this.convertTags(r),d=this.convertLinks(r);sm.writeId(e,a);const f=db(e);return{__:"dynamic",id:a,astPath:o,title:c,description:u,tags:l,links:sr(d)?d:null,rules:[...n,...r.rules.flatMap(p=>{try{return i(p)?this.parseDynamicViewRule(p):[]}catch(h){return ve(h),[]}},[])],steps:r.steps.reduce((p,h)=>{try{i(h)&&(Ow(h)?p.push(this.parseDynamicParallelSteps(h)):p.push(this.parseDynamicStep(h)))}catch(v){ve(v)}return p},[]),...f&&{manualLayout:f}}}parseDynamicViewRule(e){if(PK(e))return this.parseDynamicViewIncludePredicate(e);if(_K(e))return this.parseViewRuleGlobalPredicateRef(e);if(kw(e))return this.parseViewRuleStyleOrGlobalRef(e);if(ud(e))return tb(e);Oe(e)}parseDynamicViewIncludePredicate(e){const n=[];let r=e.predicates;for(;r;){try{if(on(r.value)&&this.isValid(r.value)){const i=this.parseElementPredicate(r.value);n.unshift(i)}}catch(i){ve(i)}r=r.prev}return{include:n}}parseDynamicParallelSteps(e){return{__parallel:e.steps.map(n=>this.parseDynamicStep(n))}}parseDynamicStep(e){const n=$n(e.source);if(!n)throw new Error("Invalid reference to source");const r=$n(e.target);if(!r)throw new Error("Invalid reference to target");let i=this.resolveFqn(n),s=this.resolveFqn(r);const o=lt(e.title)??null;let a={source:i,target:s,title:o};if(e.isBackward&&(a={source:s,target:i,title:o,isBackward:!0}),!Wj(e.custom?.props))return a;for(const c of e.custom.props)try{switch(!0){case Zl(c):{const u=c.value.view.ref?.name;ue(u)&&(a.navigateTo=u);break}case rd(c):case la(c):case e_(c):{Qt(c.value)&&(a[c.key]=lt(c.value)??"");break}case ol(c):{Qt(c.value)&&(a[c.key]=c.value);break}case Qs(c):{const u=kd(c);Qt(u)&&(a[c.key]=u);break}case zl(c):{Qt(c.value)&&(a[c.key]=c.value);break}default:Oe(c)}}catch(u){ve(u)}return a}}}const ZJ=tt(HX,HJ,KJ,VX,GJ,YJ,XJ,JJ,VJ);class QJ extends ZJ{}class eZ{constructor(e){this.services=e}cachedParsers=new fX(e=>new QJ(this.services,e));parse(e){Ce(Qw(e),`Not a FqnIndexedDocument: ${e.uri.toString(!0)}`);try{e=Object.assign(e,{c4Specification:{tags:new Set,elements:{},relationships:{},colors:{},deployments:{}},c4Elements:[],c4Relations:[],c4Deployments:[],c4DeploymentRelations:[],c4Globals:{predicates:{},dynamicPredicates:{},styles:{}},c4Views:[]});const n=this.cachedParsers.get(e);return n.parseSpecification(),n.parseModel(),n.parseGlobals(),n.parseDeployment(),n.parseViews(),n.doc}catch(n){throw new Error(`Error parsing document ${e.uri.toString()}`,{cause:n})}}forDocument(e){return Ce(Qw(e),`Not a FqnIndexedDocument: ${e.uri.toString(!0)}`),this.cachedParsers.get(e)}}const{findNodeForKeyword:tZ,findNodeForProperty:Dle}=Pf,nZ=(t,e,n=0)=>{const r=n>0?" ".repeat(n):"";return[r+`style ${t} {`,...Lp(e).map(([i,s])=>r+` ${i} ${i==="opacity"?s.toString()+"%":s}`),r+"}"]},rZ=(t,e)=>n=>{if(!hd(n))return!1;const r=n.target.value;if(!r||ue(n.target.prev)||!El(r))return!1;const i=r.el.ref;return(i?e.getFqn(i):null)===t};function iZ(t,{view:e,viewAst:n,targets:r,style:i}){Ce(n.body,`View ${e.id} has no body`);const s=n.$cstNode;Ce(s,"viewCstNode");const o=Yc(n.body.rules)?.$cstNode?.range.end??n.body.$cstNode?.range.end;Ce(o,"insertPos is not defined");const a=s.range.start.character+2,c=t.likec4.FqnIndex,u=Ve(n.body.rules,hd),l=e.__==="element"?e.viewOf:null,d=[],f=[];r.forEach(b=>{const g=XS(u,rZ(b,c)),w=l&&Gm(l,b)?b.substring(l.length+1):b;g?d.push({fqn:w,rule:g}):f.push({fqn:w})});const p={start:o,end:o},h=b=>{b.start.line<=p.start.line&&(b.start.line==p.start.line?p.start.character=Math.min(b.start.character,p.start.character):p.start=b.start),b.end.line>=p.end.line&&(b.end.line==p.end.line?p.end.character=Math.max(b.end.character,p.end.character):p.end=b.end)},v=[];if(f.length>0){const b=f.flatMap(({fqn:g})=>nZ(g,i,a));v.push(In.insert(o,`
248
- `+b.join(`
249
- `))),p.start={line:o.line+1,character:a},p.end={line:o.line+b.length,character:Yc(b)?.length??0}}if(d.length>0)for(const{rule:b}of d){const g=b.$cstNode;Ce(g,"RuleCstNode not found");for(const[w,R]of Lp(i)){const k=w==="opacity"?R.toString()+"%":R,A=b.props.find(z=>z.key===w);if(A&&A.$cstNode){const{range:{start:z,end:Q}}=A.$cstNode;h({start:z,end:Q}),v.push(In.replace({start:z,end:Q},w+" "+k));continue}const N=tZ(g,"{")?.range.end;Ce(N,"Opening brace not found");const _=" ".repeat(2+g.range.start.character),B=_+w+" "+k;v.push(In.insert(N,`
250
- `+B)),h({start:{line:N.line+1,character:_.length},end:{line:N.line+1,character:B.length}})}}return{modifiedRange:p,edits:v}}const{findNodeForProperty:Ele,findNodeForKeyword:sZ}=Pf;function oZ(t,{view:e,viewAst:n,layout:r}){Ce(n.body,`View ${e.id} has no body`);const i=n.$cstNode;Ce(i,"viewCstNode");const s=nY(r.direction),o=XS(n.body.rules,ud);let a=`autoLayout ${s}`;if(Op(r.rankSep)&&(a+=` ${r.rankSep}`,Op(r.nodeSep)&&(a+=` ${r.nodeSep}`)),o&&o.$cstNode)return In.replace(o.$cstNode.range,a);const c=sZ(n.body.$cstNode,"}")?.range.start;Ce(c,"Closing brace not found");const u=` ${a}
251
- `;return In.insert(c,u)}function aZ(t,e=1,n={}){const{indent:r=" ",includeEmptyLines:i=!1}=n;if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``);if(typeof e!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof e}\``);if(e<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${e}\``);if(typeof r!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r}\``);if(e===0)return t;const s=i?/^/gm:/^(?!\s*$)/gm;return t.replace(s,r.repeat(e))}function cZ(t,{viewAst:e,layout:n}){Ce(e.$cstNode,"invalid view.$cstNode");const r=ff(e.$cstNode,["BLOCK_COMMENT"]);let i=jJ(n);return e.$cstNode.range.start.character>0&&(i=aZ(i,e.$cstNode.range.start.character)),r?In.replace(r.range,i.trimStart()):In.insert({line:e.$cstNode.range.start.line,character:0},i+`
252
- `)}class uZ{constructor(e){this.services=e,this.locator=e.likec4.ModelLocator}locator;async applyChange(e){const n=this.services.shared.lsp.Connection;Ce(n,"LSP Connection not available");let r=null;try{await this.services.shared.workspace.WorkspaceLock.write(async()=>{const{doc:i,edits:s,modifiedRange:o}=this.convertToTextEdit(e),a={uri:i.textDocument.uri,version:i.textDocument.version};if(!s.length)return;const c=await n.workspace.applyEdit({label:`LikeC4 - change view ${e.viewId}`,edit:{changes:{[a.uri]:s}}});if(!c.applied){n.window.showErrorMessage(`Failed to apply changes ${c.failureReason}`);return}r={uri:a.uri,range:o}})}catch(i){xt.error(`Failed to apply change ${e.change.op} ${e.viewId}`,i)}return r}convertToTextEdit({viewId:e,change:n}){const r=this.locator.locateViewAst(e);if(!r)throw new Error(`LikeC4ModelChanges: view not found: ${e}`);switch(n.op){case"change-element-style":return{doc:r.doc,...iZ(this.services,{...r,targets:n.targets,style:n.style})};case"change-autolayout":{const s=oZ(this.services,{...r,layout:n.layout});return{doc:r.doc,modifiedRange:s.range,edits:[s]}}case"save-manual-layout":const i=cZ(this.services,{...r,layout:n.layout});return{doc:r.doc,modifiedRange:i.range,edits:[i]};default:Oe(n)}}}class lZ extends gS{constructor(e){super(),this.services=e}getNameStrict(e){return fn(this.getName(e),`Failed getName for ${this.services.workspace.AstNodeLocator.getAstNodePath(e)}`)}getName(e){if(Ap(e))return e.name;if(Mr(e))return e.element.el.$refText}getNameNode(e){if(Ap(e))return super.getNameNode(e);if(Mr(e))return e.element.el.$refNode}}function dZ(t){return tt(t,Ls(e=>`${e.type}.${e.name}`),Lp(),zi(([e,n])=>n.length===1?n:[]))}class fZ extends vS{constructor(e){super(e)}async computeExports(e,n){const r=[];try{const{specifications:i,models:s,views:o,globals:a,likec4lib:c,deployments:u}=e.parseResult.value;this.exportLibrary(c,r,e),this.exportSpecification(i,r,e),this.exportModel(s,r,e),this.exportViews(o,r,e),this.exportGlobals(a,r,e),this.exportDeployments(u,r,e)}catch(i){ve(i)}return r}exportViews(e,n,r){const i=e?.flatMap(s=>s.views);if(!(Et(i)||i.length===0))for(const s of i)try{ue(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(o){ve(o)}}exportGlobals(e,n,r){if(!(Et(e)||e.length===0)){for(const i of e.flatMap(s=>s.predicates))try{const s=i;ue(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(s){ve(s)}for(const i of e.flatMap(s=>s.styles))try{const s=i.id;ue(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(s){ve(s)}}}exportModel(e,n,r){if(!(Et(e)||e.length===0))for(const i of e.flatMap(s=>s.elements))try{Wn(i)&&ue(i.name)&&n.push(this.descriptions.createDescription(i,i.name,r))}catch(s){ve(s)}}exportLibrary(e,n,r){if(!Et(e))try{for(const i of e.flatMap(s=>s.icons))n.push(this.descriptions.createDescription(i,i.name,r))}catch(i){ve(i)}}exportSpecification(e,n,r){if(!(Et(e)||e.length===0))for(const i of e.flatMap(s=>[...s.elements,...s.relationships,...s.deploymentNodes,...s.tags,...s.colors]))try{switch(!0){case em(i):case pa(i):{ue(i.kind.name)&&n.push(this.descriptions.createDescription(i.kind,i.kind.name,r));continue}case tm(i):{ue(i.tag.name)&&n.push(this.descriptions.createDescription(i.tag,"#"+i.tag.name,r));continue}case ma(i):{ue(i.kind.name)&&n.push(this.descriptions.createDescription(i.kind,i.kind.name,r),this.descriptions.createDescription(i.kind,"."+i.kind.name,r));continue}case Qh(i):{ue(i.name.name)&&n.push(this.descriptions.createDescription(i.name,i.name.name,r));continue}default:Oe(i)}}catch(s){ve(s)}}exportDeployments(e,n,r){const i=e?.flatMap(s=>s.elements);if(!(Et(i)||i.length===0))for(const s of i)try{Nn(s)&&ue(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(o){ve(o)}}computeLocalScopes(e,n){return new Promise(r=>{const i=e.parseResult.value,s=[],o=new zn;for(const a of i.models)try{s.push(...this.processContainer(a,o,e))}catch(c){ve(c)}for(const a of i.deployments)try{s.push(...this.processDeployments(a,o,e))}catch(c){ve(c)}dZ(s).forEach(a=>{o.add(i,a)}),r(o)})}processContainer(e,n,r){const i=new zn,s=[];for(const a of e.elements){if(zr(a))continue;let c;if(Wn(a)?(ue(a.name)&&i.add(a.name,this.descriptions.createDescription(a,a.name,r)),c=a.body):ia(a)&&(c=a.body),c&&c.elements.length>0)try{s.push(...this.processContainer(c,n,r))}catch(u){ve(u)}}s.length&&tt(s,Ve(a=>!i.has(a.name)),Ls(a=>a.name),Fp((a,c)=>{a.length===1&&i.add(c,a[0])}));const o=[...i.values()];return n.addAll(e,o),o}processDeployments(e,n,r){const i=new Set,s=[];for(const o of e.elements){if(to(o))continue;let a=this.nameProvider.getName(o);if(ue(a)){const c=this.descriptions.createDescription(o,a,r);n.add(e,c),i.add(c.name)}if(Nn(o)&&o.body)try{s.push(...this.processDeployments(o.body,n,r))}catch(c){ve(c)}}return s.length>0&&tt(s,Ve(o=>!i.has(o.name)),Ls(o=>o.name),Fp((o,a)=>{o.length===1&&n.add(e,o[0])})),[...n.get(e).values()]}}const{getDocument:pZ}=gc;class hZ extends RS{deploymentsIndex;fqnIndex;constructor(e){super(e),this.fqnIndex=e.likec4.FqnIndex,this.deploymentsIndex=e.likec4.DeploymentsIndex}directChildrenOf(e){return this.fqnIndex.directChildrenOf(e)}uniqueDescedants(e){return new Mt(()=>{const n=e(),r=n&&this.fqnIndex.getFqn(n);return r?this.fqnIndex.uniqueDescedants(r).iterator():null},n=>n?n.next():nn)}scopeElementRef(e){return this.uniqueDescedants(()=>e.el.ref)}scopeExtendElement({element:e}){return st([e.el.$nodeDescription]).nonNullable().concat(this.uniqueDescedants(()=>$n(e)))}scopeElementView({viewOf:e,extends:n}){return e?st([e.el.$nodeDescription]).nonNullable().concat(this.uniqueDescedants(()=>$n(e))):n?st([n]).flatMap(r=>{const i=r.view.ref;return i?this.scopeElementView(i):ko}):ko}getScope(e){try{const n=this.reflection.getReferenceType(e);try{const r=e.container;if(VA(r))return this.getScopeForFqnRef(r,e);if(n!==rr)return this.getGlobalScope(n,e);if(HA(r)&&e.property==="el"){const i=r.parent;return i?new Ns(this.directChildrenOf(im(i))):this.getGlobalScope(n,e)}if(El(r)&&e.property==="el"){const i=r.parent;if(i)return new Ns(this.scopeElementRef(i));if(e.reference.$refText==="this"||e.reference.$refText==="it"){const s=sn(r,Wn);return s?new wS([this.descriptions.createDescription(s,e.reference.$refText)]):_p}}return this.computeScope(e)}catch(r){return Fe.warn(r),this.getGlobalScope(n,e)}}catch(n){return Fe.warn(n),_p}}getScopeForFqnRef(e,n){const r=e.parent;if(!r)return this.createScope(this.computeScope(n,Xi).getAllElements(),this.createScope(this.computeScope(n,Yi).getAllElements(),xi(e,BA)?this.computeScope(n,rr):_p));const i=r.value.ref;return i?Nn(i)?new Ns(this.deploymentsIndex.nested(i)):Mr(i)?new Ns(this.scopeElementRef(i.element)):Wn(i)?new Ns(this.uniqueDescedants(()=>i)):Oe(i):_p}computeScope(e,n=this.reflection.getReferenceType(e)){const r=this.reflection.isSubtype(n,rr),i=[],s=pZ(e.container).precomputedScopes;if(!s)return this.getGlobalScope(n,e);const o=c=>this.reflection.isSubtype(c.type,n);let a=e.container;for(;a;){const c=s.get(a).filter(o);c.length>0&&i.push(st(c)),r&&WA(a)&&i.push(this.scopeExtendElement(a.$container)),r&&UA(a)&&i.push(this.scopeElementView(a.$container)),a=a.$container}return i.reduceRight((c,u)=>this.createScope(u,c),this.getGlobalScope(n,e))}}const mZ=`likec4lib { icons {
253
- aws:activate
254
- aws:alexa-for-business
255
- aws:amplify
256
- aws:apache-mxnet-on-aws
257
- aws:api-gateway
258
- aws:app-config
259
- aws:app-flow
260
- aws:app-mesh
261
- aws:app-runner
262
- aws:app-stream
263
- aws:app-sync
264
- aws:application-auto-scaling
265
- aws:application-composer
266
- aws:application-cost-profiler
267
- aws:application-discovery-service
268
- aws:application-migration-service
269
- aws:artifact
270
- aws:athena
271
- aws:audit-manager
272
- aws:augmented-ai-a2i
273
- aws:aurora
274
- aws:auto-scaling
275
- aws:backint-agent
276
- aws:backup
277
- aws:batch
278
- aws:billing-conductor
279
- aws:bottlerocket
280
- aws:braket
281
- aws:budgets
282
- aws:certificate-manager
283
- aws:chatbot
284
- aws:chime
285
- aws:chime-sdk
286
- aws:chime-voice-connector
287
- aws:clean-rooms
288
- aws:client-vpn
289
- aws:cloud-control-api
290
- aws:cloud-development-kit
291
- aws:cloud-directory
292
- aws:cloud-formation
293
- aws:cloud-front
294
- aws:cloud-hsm
295
- aws:cloud-map
296
- aws:cloud-search
297
- aws:cloud-shell
298
- aws:cloud-trail
299
- aws:cloud-wan
300
- aws:cloud-watch
301
- aws:cloud9
302
- aws:code-artifact
303
- aws:code-build
304
- aws:code-catalyst
305
- aws:code-commit
306
- aws:code-deploy
307
- aws:code-guru
308
- aws:code-pipeline
309
- aws:code-star
310
- aws:code-whisperer
311
- aws:cognito
312
- aws:command-line-interface
313
- aws:comprehend
314
- aws:comprehend-medical
315
- aws:compute-optimizer
316
- aws:config
317
- aws:connect
318
- aws:console-mobile-application
319
- aws:control-tower
320
- aws:corretto
321
- aws:cost-and-usage-report
322
- aws:cost-explorer
323
- aws:data-exchange
324
- aws:data-pipeline
325
- aws:data-sync
326
- aws:data-zone
327
- aws:database-migration-service
328
- aws:deep-composer
329
- aws:deep-learning-amis
330
- aws:deep-learning-containers
331
- aws:deep-lens
332
- aws:deep-racer
333
- aws:detective
334
- aws:dev-ops-guru
335
- aws:device-farm
336
- aws:direct-connect
337
- aws:directory-service
338
- aws:distro-for-open-telemetry
339
- aws:document-db
340
- aws:dynamo-db
341
- aws:ec2
342
- aws:ec2-auto-scaling
343
- aws:ec2-image-builder
344
- aws:ecs-anywhere
345
- aws:efs
346
- aws:eks-anywhere
347
- aws:eks-cloud
348
- aws:eks-distro
349
- aws:elasti-cache
350
- aws:elastic-beanstalk
351
- aws:elastic-block-store
352
- aws:elastic-container-registry
353
- aws:elastic-container-service
354
- aws:elastic-disaster-recovery
355
- aws:elastic-fabric-adapter
356
- aws:elastic-inference
357
- aws:elastic-kubernetes-service
358
- aws:elastic-load-balancing
359
- aws:elastic-transcoder
360
- aws:elemental-appliances-software
361
- aws:elemental-conductor
362
- aws:elemental-delta
363
- aws:elemental-link
364
- aws:elemental-live
365
- aws:elemental-media-connect
366
- aws:elemental-media-convert
367
- aws:elemental-media-live
368
- aws:elemental-media-package
369
- aws:elemental-media-store
370
- aws:elemental-media-tailor
371
- aws:elemental-server
372
- aws:emr
373
- aws:event-bridge
374
- aws:express-workflows
375
- aws:fargate
376
- aws:fault-injection-simulator
377
- aws:file-cache
378
- aws:fin-space
379
- aws:firewall-manager
380
- aws:forecast
381
- aws:fraud-detector
382
- aws:free-rtos
383
- aws:fsx
384
- aws:fsx-for-lustre
385
- aws:fsx-for-net-app-ontap
386
- aws:fsx-for-open-zfs
387
- aws:fsx-for-wfs
388
- aws:game-kit
389
- aws:game-lift
390
- aws:game-sparks
391
- aws:genomics-cli
392
- aws:global-accelerator
393
- aws:glue
394
- aws:glue-data-brew
395
- aws:glue-elastic-views
396
- aws:ground-station
397
- aws:guard-duty
398
- aws:health-lake
399
- aws:honeycode
400
- aws:iam-identity-center
401
- aws:identity-and-access-management
402
- aws:inspector
403
- aws:interactive-video-service
404
- aws:io-t-1-click
405
- aws:io-t-analytics
406
- aws:io-t-button
407
- aws:io-t-core
408
- aws:io-t-device-defender
409
- aws:io-t-device-management
410
- aws:io-t-edu-kit
411
- aws:io-t-events
412
- aws:io-t-express-link
413
- aws:io-t-fleet-wise
414
- aws:io-t-greengrass
415
- aws:io-t-robo-runner
416
- aws:io-t-site-wise
417
- aws:io-t-things-graph
418
- aws:io-t-twin-maker
419
- aws:iq
420
- aws:kendra
421
- aws:key-management-service
422
- aws:keyspaces
423
- aws:kinesis
424
- aws:kinesis-data-analytics
425
- aws:kinesis-data-streams
426
- aws:kinesis-firehose
427
- aws:kinesis-video-streams
428
- aws:lake-formation
429
- aws:lambda
430
- aws:launch-wizard
431
- aws:lex
432
- aws:license-manager
433
- aws:lightsail
434
- aws:local-zones
435
- aws:location-service
436
- aws:lookout-for-equipment
437
- aws:lookout-for-metrics
438
- aws:lookout-for-vision
439
- aws:lumberyard
440
- aws:macie
441
- aws:mainframe-modernization
442
- aws:managed-blockchain
443
- aws:managed-grafana
444
- aws:managed-service-for-prometheus
445
- aws:managed-services
446
- aws:managed-streaming-for-apache-kafka
447
- aws:managed-workflows-for-apache-airflow
448
- aws:management-console
449
- aws:marketplace-dark
450
- aws:marketplace-light
451
- aws:memory-db-for-redis
452
- aws:migration-evaluator
453
- aws:migration-hub
454
- aws:monitron
455
- aws:mq
456
- aws:neptune
457
- aws:network-firewall
458
- aws:neuron
459
- aws:nice-dcv
460
- aws:nice-engin-frame
461
- aws:nimble-studio
462
- aws:nitro-enclaves
463
- aws:omics
464
- aws:open-3d-engine
465
- aws:open-search-service
466
- aws:ops-works
467
- aws:organizations
468
- aws:outposts-family
469
- aws:outposts-rack
470
- aws:outposts-servers
471
- aws:panorama
472
- aws:parallel-cluster
473
- aws:personal-health-dashboard
474
- aws:personalize
475
- aws:pinpoint
476
- aws:pinpoint-apis
477
- aws:polly
478
- aws:private-5g
479
- aws:private-certificate-authority
480
- aws:private-link
481
- aws:professional-services
482
- aws:proton
483
- aws:quantum-ledger-database
484
- aws:quick-sight
485
- aws:rds
486
- aws:rds-on-vmware
487
- aws:re-post
488
- aws:red-hat-open-shift-service-on-aws
489
- aws:redshift
490
- aws:rekognition
491
- aws:reserved-instance-reporting
492
- aws:resilience-hub
493
- aws:resource-access-manager
494
- aws:resource-explorer
495
- aws:robo-maker
496
- aws:route-53
497
- aws:s3-on-outposts
498
- aws:sage-maker
499
- aws:sage-maker-ground-truth
500
- aws:sage-maker-studio-lab
501
- aws:savings-plans
502
- aws:secrets-manager
503
- aws:security-hub
504
- aws:security-lake
505
- aws:server-migration-service
506
- aws:serverless-application-repository
507
- aws:service-catalog
508
- aws:service-management-connector
509
- aws:shield
510
- aws:signer
511
- aws:sim-space-weaver
512
- aws:simple-email-service
513
- aws:simple-notification-service
514
- aws:simple-queue-service
515
- aws:simple-storage-service
516
- aws:simple-storage-service-glacier
517
- aws:site-to-site-vpn
518
- aws:snowball
519
- aws:snowball-edge
520
- aws:snowcone
521
- aws:snowmobile
522
- aws:step-functions
523
- aws:storage-gateway
524
- aws:sumerian
525
- aws:supply-chain
526
- aws:support
527
- aws:systems-manager
528
- aws:tensor-flow-on-aws
529
- aws:textract
530
- aws:thinkbox-deadline
531
- aws:thinkbox-frost
532
- aws:thinkbox-krakatoa
533
- aws:thinkbox-sequoia
534
- aws:thinkbox-stoke
535
- aws:thinkbox-xmesh
536
- aws:timestream
537
- aws:tools-and-sdks
538
- aws:torch-serve
539
- aws:training-certification
540
- aws:transcribe
541
- aws:transfer-family
542
- aws:transit-gateway
543
- aws:translate
544
- aws:trusted-advisor
545
- aws:verified-access
546
- aws:verified-permissions
547
- aws:virtual-private-cloud
548
- aws:vmware-cloud-on-aws
549
- aws:vpc-lattice
550
- aws:waf
551
- aws:wavelength
552
- aws:well-architected-tool
553
- aws:wickr
554
- aws:work-docs
555
- aws:work-docs-sdk
556
- aws:work-link
557
- aws:work-mail
558
- aws:work-spaces-family
559
- aws:x-ray
560
- azure:abs-member
561
- azure:active-directory-connect-health
562
- azure:activity-log
563
- azure:administrative-units
564
- azure:advisor
565
- azure:ai-studio
566
- azure:aks-automatic
567
- azure:aks-istio
568
- azure:alerts
569
- azure:all-resources
570
- azure:analysis-services
571
- azure:anomaly-detector
572
- azure:api-center
573
- azure:api-connections
574
- azure:api-management-services
575
- azure:api-proxy
576
- azure:app-compliance-automation
577
- azure:app-configuration
578
- azure:app-registrations
579
- azure:app-service-certificates
580
- azure:app-service-domains
581
- azure:app-service-environments
582
- azure:app-service-plans
583
- azure:app-services
584
- azure:app-space
585
- azure:app-space-component
586
- azure:applens
587
- azure:application-gateway-containers
588
- azure:application-gateways
589
- azure:application-group
590
- azure:application-insights
591
- azure:application-security-groups
592
- azure:aquila
593
- azure:arc-data-services
594
- azure:arc-kubernetes
595
- azure:arc-machines
596
- azure:arc-sql-managed-instance
597
- azure:arc-sql-server
598
- azure:atm-multistack
599
- azure:auto-scale
600
- azure:automanaged-vm
601
- azure:automation-accounts
602
- azure:availability-sets
603
- azure:avs-vm
604
- azure:azure-a
605
- azure:azure-ad-b2c
606
- azure:azure-api-for-fhir
607
- azure:azure-applied-ai-services
608
- azure:azure-arc
609
- azure:azure-attestation
610
- azure:azure-backup-center
611
- azure:azure-blockchain-service
612
- azure:azure-center-for-sap
613
- azure:azure-chaos-studio
614
- azure:azure-cloud-shell
615
- azure:azure-communication-services
616
- azure:azure-communications-gateway
617
- azure:azure-compute-galleries
618
- azure:azure-cosmos-db
619
- azure:azure-data-catalog
620
- azure:azure-data-explorer-clusters
621
- azure:azure-database-maria-db-server
622
- azure:azure-database-migration-services
623
- azure:azure-database-my-sql-server
624
- azure:azure-database-postgre-sql-server
625
- azure:azure-database-postgre-sql-server-group
626
- azure:azure-databox-gateway
627
- azure:azure-databricks
628
- azure:azure-deployment-environments
629
- azure:azure-dev-ops
630
- azure:azure-dev-tunnels
631
- azure:azure-edge-hardware-center
632
- azure:azure-experimentation-studio
633
- azure:azure-fileshares
634
- azure:azure-firewall-manager
635
- azure:azure-firewall-policy
636
- azure:azure-hcp-cache
637
- azure:azure-hpc-workbenches
638
- azure:azure-hybrid-center
639
- azure:azure-information-protection
640
- azure:azure-io-t-operations
641
- azure:azure-lighthouse
642
- azure:azure-load-testing
643
- azure:azure-managed-grafana
644
- azure:azure-maps-accounts
645
- azure:azure-media-service
646
- azure:azure-migrate
647
- azure:azure-monitor-dashboard
648
- azure:azure-monitor-pipeline
649
- azure:azure-monitors-for-sap-solutions
650
- azure:azure-net-app-files
651
- azure:azure-network-function-manager
652
- azure:azure-network-function-manager-functions
653
- azure:azure-object-understanding
654
- azure:azure-open-ai
655
- azure:azure-operator-5g-core
656
- azure:azure-operator-insights
657
- azure:azure-operator-nexus
658
- azure:azure-operator-service-manager
659
- azure:azure-orbital
660
- azure:azure-programmable-connectivity
661
- azure:azure-purview-accounts
662
- azure:azure-quotas
663
- azure:azure-red-hat-open-shift
664
- azure:azure-sentinel
665
- azure:azure-service-bus
666
- azure:azure-sphere
667
- azure:azure-spring-apps
668
- azure:azure-sql
669
- azure:azure-sql-edge
670
- azure:azure-sql-server-stretch-databases
671
- azure:azure-sql-vm
672
- azure:azure-stack
673
- azure:azure-stack-edge
674
- azure:azure-stack-hci-sizer
675
- azure:azure-storage-mover
676
- azure:azure-support-center-blue
677
- azure:azure-sustainability
678
- azure:azure-synapse-analytics
679
- azure:azure-token-service
680
- azure:azure-video-indexer
681
- azure:azure-virtual-desktop
682
- azure:azure-vmware-solution
683
- azure:azure-workbooks
684
- azure:azurite
685
- azure:backlog
686
- azure:backup-vault
687
- azure:bare-metal-infrastructure
688
- azure:bastions
689
- azure:batch-accounts
690
- azure:batch-ai
691
- azure:biz-talk
692
- azure:blob-block
693
- azure:blob-page
694
- azure:blockchain-applications
695
- azure:blueprints
696
- azure:bonsai
697
- azure:bot-services
698
- azure:branch
699
- azure:browser
700
- azure:bug
701
- azure:builds
702
- azure:business-process-tracking
703
- azure:cache
704
- azure:cache-redis
705
- azure:capacity
706
- azure:capacity-reservation-groups
707
- azure:cdn-profiles
708
- azure:central-service-instance-for-sap
709
- azure:ceres
710
- azure:change-analysis
711
- azure:client-apps
712
- azure:cloud-services-classic
713
- azure:cloud-services-extended-support
714
- azure:cloud-test
715
- azure:code
716
- azure:code-optimization
717
- azure:cognitive-search
718
- azure:cognitive-services
719
- azure:cognitive-services-decisions
720
- azure:collaborative-service
721
- azure:commit
722
- azure:community-images
723
- azure:compliance
724
- azure:compliance-center
725
- azure:compute-fleet
726
- azure:computer-vision
727
- azure:conditional-access
728
- azure:confidential-ledgers
729
- azure:connected-cache
730
- azure:connected-vehicle-platform
731
- azure:connections
732
- azure:consortium
733
- azure:container-apps-environments
734
- azure:container-instances
735
- azure:container-registries
736
- azure:container-services-deprecated
737
- azure:content-moderators
738
- azure:content-safety
739
- azure:controls
740
- azure:controls-horizontal
741
- azure:cost-alerts
742
- azure:cost-analysis
743
- azure:cost-budgets
744
- azure:cost-export
745
- azure:cost-management
746
- azure:cost-management-and-billing
747
- azure:counter
748
- azure:cubes
749
- azure:custom-ip-prefix
750
- azure:custom-vision
751
- azure:customer-lockbox-for-microsoft-azure
752
- azure:dashboard
753
- azure:dashboard-hub
754
- azure:data-box
755
- azure:data-collection-rules
756
- azure:data-factories
757
- azure:data-lake-analytics
758
- azure:data-lake-storage-gen1
759
- azure:data-lake-store-gen1
760
- azure:data-share-invitations
761
- azure:data-shares
762
- azure:database-instance-for-sap
763
- azure:ddo-s-protection-plans
764
- azure:dedicated-hsm
765
- azure:defender-cm-local-manager
766
- azure:defender-dcs-controller
767
- azure:defender-distributer-control-system
768
- azure:defender-engineering-station
769
- azure:defender-external-management
770
- azure:defender-freezer-monitor
771
- azure:defender-historian
772
- azure:defender-hmi
773
- azure:defender-industrial-packaging-system
774
- azure:defender-industrial-printer
775
- azure:defender-industrial-robot
776
- azure:defender-industrial-scale-system
777
- azure:defender-marquee
778
- azure:defender-meter
779
- azure:defender-plc
780
- azure:defender-pneumatic-device
781
- azure:defender-programable-board
782
- azure:defender-relay
783
- azure:defender-robot-controller
784
- azure:defender-rtu
785
- azure:defender-sensor
786
- azure:defender-slot
787
- azure:defender-web-guiding-system
788
- azure:detonation
789
- azure:dev-console
790
- azure:dev-ops-starter
791
- azure:dev-test-labs
792
- azure:device-compliance
793
- azure:device-configuration
794
- azure:device-enrollment
795
- azure:device-provisioning-services
796
- azure:device-security-apple
797
- azure:device-security-google
798
- azure:device-security-windows
799
- azure:device-update-io-t-hub
800
- azure:devices
801
- azure:diagnostics-settings
802
- azure:digital-twins
803
- azure:disk-encryption-sets
804
- azure:disk-pool
805
- azure:disks
806
- azure:disks-classic
807
- azure:disks-snapshots
808
- azure:dns-multistack
809
- azure:dns-private-resolver
810
- azure:dns-security-policy
811
- azure:dns-zones
812
- azure:download
813
- azure:e-books
814
- azure:edge-management
815
- azure:education
816
- azure:elastic-job-agents
817
- azure:elastic-san
818
- azure:endpoint-analytics
819
- azure:enterprise-applications
820
- azure:entra-connect
821
- azure:entra-connect-health
822
- azure:entra-connect-sync
823
- azure:entra-domain-services
824
- azure:entra-global-secure-access
825
- azure:entra-id-protection
826
- azure:entra-identity-custom-roles
827
- azure:entra-identity-licenses
828
- azure:entra-identity-risky-signins
829
- azure:entra-identity-risky-users
830
- azure:entra-identity-roles-and-administrators
831
- azure:entra-internet-access
832
- azure:entra-managed-identities
833
- azure:entra-private-access
834
- azure:entra-privleged-identity-management
835
- azure:entra-verified-id
836
- azure:error
837
- azure:event-grid-domains
838
- azure:event-grid-subscriptions
839
- azure:event-grid-topics
840
- azure:event-hub-clusters
841
- azure:event-hubs
842
- azure:exchange-access
843
- azure:exchange-on-premises-access
844
- azure:express-route-circuits
845
- azure:express-route-direct
846
- azure:express-route-traffic-collector
847
- azure:extended-security-updates
848
- azure:extensions
849
- azure:external-identities
850
- azure:face-apis
851
- azure:feature-previews
852
- azure:fhir-service
853
- azure:fiji
854
- azure:file
855
- azure:files
856
- azure:firewalls
857
- azure:folder-blank
858
- azure:folder-website
859
- azure:form-recognizers
860
- azure:free-services
861
- azure:front-door-and-cdn-profiles
862
- azure:ftp
863
- azure:function-apps
864
- azure:gear
865
- azure:genomics
866
- azure:genomics-accounts
867
- azure:globe-error
868
- azure:globe-success
869
- azure:globe-warning
870
- azure:groups
871
- azure:guide
872
- azure:hd-insight-clusters
873
- azure:hdi-aks-cluster
874
- azure:heart
875
- azure:help-and-support
876
- azure:host-groups
877
- azure:host-pools
878
- azure:hosts
879
- azure:ic-m-troubleshooting
880
- azure:identity-governance
881
- azure:identity-multi-factor-authentication
882
- azure:identity-secure-score
883
- azure:image
884
- azure:image-definitions
885
- azure:image-templates
886
- azure:image-versions
887
- azure:images
888
- azure:immersive-readers
889
- azure:import-export-jobs
890
- azure:industrial-io-t
891
- azure:information
892
- azure:infrastructure-backup
893
- azure:input-output
894
- azure:instance-pools
895
- azure:integration-accounts
896
- azure:integration-environments
897
- azure:integration-service-environments
898
- azure:internet-analyzer-profiles
899
- azure:intune
900
- azure:intune-app-protection
901
- azure:intune-for-education
902
- azure:intune-trends
903
- azure:io-t-central-applications
904
- azure:io-t-edge
905
- azure:io-t-hub
906
- azure:ip-address-manager
907
- azure:ip-groups
908
- azure:journey-hub
909
- azure:key-vaults
910
- azure:keys
911
- azure:kubernetes-fleet-manager
912
- azure:kubernetes-services
913
- azure:lab-accounts
914
- azure:lab-services
915
- azure:language
916
- azure:language-understanding
917
- azure:launch-portal
918
- azure:learn
919
- azure:load-balancer-hub
920
- azure:load-balancers
921
- azure:load-test
922
- azure:load-testing
923
- azure:local-network-gateways
924
- azure:location
925
- azure:log-analytics-query-pack
926
- azure:log-analytics-workspaces
927
- azure:log-streaming
928
- azure:logic-apps
929
- azure:logic-apps-custom-connector
930
- azure:machine-learning
931
- azure:machine-learning-studio-classic-web-services
932
- azure:machine-learning-studio-web-service-plans
933
- azure:machine-learning-studio-workspaces
934
- azure:machines-azure-arc
935
- azure:maintenance-configuration
936
- azure:managed-applications-center
937
- azure:managed-database
938
- azure:managed-desktop
939
- azure:managed-dev-ops-pools
940
- azure:managed-file-shares
941
- azure:managed-identities
942
- azure:managed-instance-apache-cassandra
943
- azure:managed-service-fabric
944
- azure:management-groups
945
- azure:management-portal
946
- azure:marketplace
947
- azure:marketplace-management
948
- azure:med-tech-service
949
- azure:media
950
- azure:media-file
951
- azure:mesh-applications
952
- azure:metrics
953
- azure:metrics-advisor
954
- azure:microsoft-defender-easm
955
- azure:microsoft-defender-for-cloud
956
- azure:microsoft-defender-for-io-t
957
- azure:microsoft-dev-box
958
- azure:mindaro
959
- azure:mission-landing-zone
960
- azure:mobile
961
- azure:mobile-engagement
962
- azure:mobile-networks
963
- azure:modular-data-center
964
- azure:module
965
- azure:monitor
966
- azure:monitor-health-models
967
- azure:multi-tenancy
968
- azure:multifactor-authentication
969
- azure:my-customers
970
- azure:nat
971
- azure:network-interfaces
972
- azure:network-managers
973
- azure:network-security-groups
974
- azure:network-security-perimeters
975
- azure:network-watcher
976
- azure:notification-hub-namespaces
977
- azure:notification-hubs
978
- azure:offers
979
- azure:on-premises-data-gateways
980
- azure:open-supply-chain-platform
981
- azure:operation-log-classic
982
- azure:oracle-database
983
- azure:os-images-classic
984
- azure:osconfig
985
- azure:outbound-connection
986
- azure:partner-namespace
987
- azure:partner-registration
988
- azure:partner-topic
989
- azure:peering-service
990
- azure:peerings
991
- azure:personalizers
992
- azure:plans
993
- azure:policy
994
- azure:power
995
- azure:power-bi-embedded
996
- azure:power-platform
997
- azure:power-up
998
- azure:powershell
999
- azure:preview-features
1000
- azure:private-endpoints
1001
- azure:private-link
1002
- azure:private-link-service
1003
- azure:private-link-services
1004
- azure:process-explorer
1005
- azure:production-ready-database
1006
- azure:proximity-placement-groups
1007
- azure:public-ip-addresses
1008
- azure:public-ip-addresses-classic
1009
- azure:public-ip-prefixes
1010
- azure:qn-a-makers
1011
- azure:quickstart-center
1012
- azure:recent
1013
- azure:recovery-services-vaults
1014
- azure:region-management
1015
- azure:relays
1016
- azure:remote-rendering
1017
- azure:reservations
1018
- azure:reserved-capacity
1019
- azure:reserved-ip-addresses-classic
1020
- azure:resource-explorer
1021
- azure:resource-graph-explorer
1022
- azure:resource-group-list
1023
- azure:resource-groups
1024
- azure:resource-guard
1025
- azure:resource-linked
1026
- azure:resource-management-private-link
1027
- azure:resource-mover
1028
- azure:resources-provider
1029
- azure:restore-points
1030
- azure:restore-points-collections
1031
- azure:route-filters
1032
- azure:route-tables
1033
- azure:rtos
1034
- azure:savings-plans
1035
- azure:scheduler
1036
- azure:scheduler-job-collections
1037
- azure:scvmm-management-servers
1038
- azure:search
1039
- azure:search-grid
1040
- azure:security
1041
- azure:security-baselines
1042
- azure:send-grid-accounts
1043
- azure:server-farm
1044
- azure:serverless-search
1045
- azure:service-catalog-mad
1046
- azure:service-endpoint-policies
1047
- azure:service-fabric-clusters
1048
- azure:service-health
1049
- azure:service-providers
1050
- azure:shared-image-galleries
1051
- azure:signal-r
1052
- azure:software-as-a-service
1053
- azure:software-updates
1054
- azure:solutions
1055
- azure:sonic-dash
1056
- azure:spatial-anchor-accounts
1057
- azure:speech-services
1058
- azure:spot-vm
1059
- azure:spot-vmss
1060
- azure:sql-data-warehouses
1061
- azure:sql-database
1062
- azure:sql-elastic-pools
1063
- azure:sql-managed-instance
1064
- azure:sql-server
1065
- azure:sql-server-registries
1066
- azure:ssd
1067
- azure:ssh-keys
1068
- azure:ssis-lift-and-shift-ir
1069
- azure:stack-hci-premium
1070
- azure:static-apps
1071
- azure:stor-simple-data-managers
1072
- azure:stor-simple-device-managers
1073
- azure:storage-accounts
1074
- azure:storage-accounts-classic
1075
- azure:storage-actions
1076
- azure:storage-azure-files
1077
- azure:storage-container
1078
- azure:storage-explorer
1079
- azure:storage-functions
1080
- azure:storage-queue
1081
- azure:storage-sync-services
1082
- azure:stream-analytics-jobs
1083
- azure:subnet
1084
- azure:subscriptions
1085
- azure:system-topic
1086
- azure:table
1087
- azure:tag
1088
- azure:tags
1089
- azure:targets-management
1090
- azure:template-specs
1091
- azure:templates
1092
- azure:tenant-properties
1093
- azure:tenant-status
1094
- azure:test-base
1095
- azure:tfs-vc-repository
1096
- azure:time-series-data-sets
1097
- azure:time-series-insights-access-policies
1098
- azure:time-series-insights-environments
1099
- azure:time-series-insights-event-sources
1100
- azure:toolbox
1101
- azure:traffic-manager-profiles
1102
- azure:translator-text
1103
- azure:troubleshoot
1104
- azure:universal-print
1105
- azure:update-management-center
1106
- azure:updates
1107
- azure:user-privacy
1108
- azure:user-settings
1109
- azure:user-subscriptions
1110
- azure:users
1111
- azure:verifiable-credentials
1112
- azure:verification-as-a-service
1113
- azure:versions
1114
- azure:video-analyzers
1115
- azure:virtual-clusters
1116
- azure:virtual-enclaves
1117
- azure:virtual-instance-for-sap
1118
- azure:virtual-machine
1119
- azure:virtual-machines-classic
1120
- azure:virtual-network-gateways
1121
- azure:virtual-networks
1122
- azure:virtual-networks-classic
1123
- azure:virtual-router
1124
- azure:virtual-visits-builder
1125
- azure:virtual-wan-hub
1126
- azure:virtual-wans
1127
- azure:vm-app-definitions
1128
- azure:vm-app-versions
1129
- azure:vm-image-version
1130
- azure:vm-images-classic
1131
- azure:vm-scale-sets
1132
- azure:wac
1133
- azure:wac-installer
1134
- azure:web-app-database
1135
- azure:web-application-firewall-policies-waf
1136
- azure:web-jobs
1137
- azure:web-slots
1138
- azure:web-test
1139
- azure:website-power
1140
- azure:website-staging
1141
- azure:windows-notification-services
1142
- azure:windows10-core-services
1143
- azure:workbooks
1144
- azure:worker-container-app
1145
- azure:workflow
1146
- azure:workspace-gateway
1147
- azure:workspaces
1148
- gcp:access-context-manager
1149
- gcp:administration
1150
- gcp:advanced-agent-modeling
1151
- gcp:advanced-solutions-lab
1152
- gcp:agent-assist
1153
- gcp:ai-hub
1154
- gcp:ai-platform
1155
- gcp:ai-platform-unified
1156
- gcp:analytics-hub
1157
- gcp:anthos
1158
- gcp:anthos-config-management
1159
- gcp:anthos-service-mesh
1160
- gcp:api
1161
- gcp:api-analytics
1162
- gcp:api-monetization
1163
- gcp:apigee-api-platform
1164
- gcp:apigee-sense
1165
- gcp:app-engine
1166
- gcp:artifact-registry
1167
- gcp:asset-inventory
1168
- gcp:assured-workloads
1169
- gcp:auto-ml
1170
- gcp:auto-ml-natural-language
1171
- gcp:auto-ml-tables
1172
- gcp:auto-ml-translation
1173
- gcp:auto-ml-video-intelligence
1174
- gcp:auto-ml-vision
1175
- gcp:bare-metal-solutions
1176
- gcp:batch
1177
- gcp:beyondcorp
1178
- gcp:big-query
1179
- gcp:bigtable
1180
- gcp:billing
1181
- gcp:binary-authorization
1182
- gcp:catalog
1183
- gcp:certificate-authority-service
1184
- gcp:certificate-manager
1185
- gcp:cloud-api-gateway
1186
- gcp:cloud-apis
1187
- gcp:cloud-armor
1188
- gcp:cloud-asset-inventory
1189
- gcp:cloud-audit-logs
1190
- gcp:cloud-build
1191
- gcp:cloud-cdn
1192
- gcp:cloud-code
1193
- gcp:cloud-composer
1194
- gcp:cloud-data-fusion
1195
- gcp:cloud-deploy
1196
- gcp:cloud-deployment-manager
1197
- gcp:cloud-dns
1198
- gcp:cloud-domains
1199
- gcp:cloud-ekm
1200
- gcp:cloud-endpoints
1201
- gcp:cloud-external-ip-addresses
1202
- gcp:cloud-firewall-rules
1203
- gcp:cloud-for-marketing
1204
- gcp:cloud-functions
1205
- gcp:cloud-generic
1206
- gcp:cloud-gpu
1207
- gcp:cloud-healthcare-api
1208
- gcp:cloud-healthcare-marketplace
1209
- gcp:cloud-hsm
1210
- gcp:cloud-ids
1211
- gcp:cloud-inference-api
1212
- gcp:cloud-interconnect
1213
- gcp:cloud-jobs-api
1214
- gcp:cloud-load-balancing
1215
- gcp:cloud-logging
1216
- gcp:cloud-media-edge
1217
- gcp:cloud-monitoring
1218
- gcp:cloud-nat
1219
- gcp:cloud-natural-language-api
1220
- gcp:cloud-network
1221
- gcp:cloud-ops
1222
- gcp:cloud-optimization-ai
1223
- gcp:cloud-optimization-ai-fleet-routing-api
1224
- gcp:cloud-router
1225
- gcp:cloud-routes
1226
- gcp:cloud-run
1227
- gcp:cloud-run-for-anthos
1228
- gcp:cloud-scheduler
1229
- gcp:cloud-security-scanner
1230
- gcp:cloud-shell
1231
- gcp:cloud-spanner
1232
- gcp:cloud-sql
1233
- gcp:cloud-storage
1234
- gcp:cloud-tasks
1235
- gcp:cloud-test-lab
1236
- gcp:cloud-tpu
1237
- gcp:cloud-translation-api
1238
- gcp:cloud-vision-api
1239
- gcp:cloud-vpn
1240
- gcp:compute-engine
1241
- gcp:configuration-management
1242
- gcp:connectivity-test
1243
- gcp:connectors
1244
- gcp:contact-center-ai
1245
- gcp:container-optimized-os
1246
- gcp:container-registry
1247
- gcp:data-catalog
1248
- gcp:data-labeling
1249
- gcp:data-layers
1250
- gcp:data-loss-prevention-api
1251
- gcp:data-qn-a
1252
- gcp:data-studio
1253
- gcp:data-transfer
1254
- gcp:database-migration-service
1255
- gcp:dataflow
1256
- gcp:datalab
1257
- gcp:dataplex
1258
- gcp:datapol
1259
- gcp:dataprep
1260
- gcp:dataproc
1261
- gcp:dataproc-metastore
1262
- gcp:datashare
1263
- gcp:datastore
1264
- gcp:datastream
1265
- gcp:debugger
1266
- gcp:developer-portal
1267
- gcp:dialogflow
1268
- gcp:dialogflow-cx
1269
- gcp:dialogflow-insights
1270
- gcp:document-ai
1271
- gcp:early-access-center
1272
- gcp:error-reporting
1273
- gcp:eventarc
1274
- gcp:filestore
1275
- gcp:financial-services-marketplace
1276
- gcp:firestore
1277
- gcp:fleet-engine
1278
- gcp:free-trial
1279
- gcp:game-servers
1280
- gcp:gce-systems-management
1281
- gcp:genomics
1282
- gcp:gke-on-prem
1283
- gcp:google-cloud-marketplace
1284
- gcp:google-kubernetes-engine
1285
- gcp:google-maps-platform
1286
- gcp:healthcare-nlp-api
1287
- gcp:home
1288
- gcp:identity-and-access-management
1289
- gcp:identity-aware-proxy
1290
- gcp:identity-platform
1291
- gcp:iot-core
1292
- gcp:iot-edge
1293
- gcp:key-access-justifications
1294
- gcp:key-management-service
1295
- gcp:kuberun
1296
- gcp:launcher
1297
- gcp:local-ssd
1298
- gcp:looker
1299
- gcp:managed-service-for-microsoft-active-directory
1300
- gcp:media-translation-api
1301
- gcp:memorystore
1302
- gcp:migrate-for-anthos
1303
- gcp:migrate-for-compute-engine
1304
- gcp:my-cloud
1305
- gcp:network-connectivity-center
1306
- gcp:network-intelligence-center
1307
- gcp:network-security
1308
- gcp:network-tiers
1309
- gcp:network-topology
1310
- gcp:onboarding
1311
- gcp:os-configuration-management
1312
- gcp:os-inventory-management
1313
- gcp:os-patch-management
1314
- gcp:partner-interconnect
1315
- gcp:partner-portal
1316
- gcp:performance-dashboard
1317
- gcp:permissions
1318
- gcp:persistent-disk
1319
- gcp:phishing-protection
1320
- gcp:policy-analyzer
1321
- gcp:premium-network-tier
1322
- gcp:private-connectivity
1323
- gcp:private-service-connect
1324
- gcp:producer-portal
1325
- gcp:profiler
1326
- gcp:project
1327
- gcp:pub-sub
1328
- gcp:quantum-engine
1329
- gcp:quotas
1330
- gcp:real-world-insights
1331
- gcp:recommendations-ai
1332
- gcp:release-notes
1333
- gcp:retail-api
1334
- gcp:risk-manager
1335
- gcp:runtime-config
1336
- gcp:secret-manager
1337
- gcp:security
1338
- gcp:security-command-center
1339
- gcp:security-health-advisor
1340
- gcp:security-key-enforcement
1341
- gcp:service-discovery
1342
- gcp:speech-to-text
1343
- gcp:stackdriver
1344
- gcp:standard-network-tier
1345
- gcp:stream-suite
1346
- gcp:support
1347
- gcp:tensorflow-enterprise
1348
- gcp:text-to-speech
1349
- gcp:tools-for-powershell
1350
- gcp:trace
1351
- gcp:traffic-director
1352
- gcp:transfer
1353
- gcp:transfer-appliance
1354
- gcp:user-preferences
1355
- gcp:vertex-ai
1356
- gcp:video-intelligence-api
1357
- gcp:virtual-private-cloud
1358
- gcp:visual-inspection
1359
- gcp:vmware-engine
1360
- gcp:web-risk
1361
- gcp:web-security-scanner
1362
- gcp:workflows
1363
- gcp:workload-identity-pool
1364
- tech:aarch64
1365
- tech:adobe-illustrator
1366
- tech:adobe-photoshop
1367
- tech:adobe-premiere-pro
1368
- tech:adobe-xd
1369
- tech:adonis-js
1370
- tech:after-effects
1371
- tech:airflow
1372
- tech:akka
1373
- tech:algolia
1374
- tech:alpine-js
1375
- tech:amazon-web-services
1376
- tech:anaconda
1377
- tech:android
1378
- tech:android-studio
1379
- tech:angular
1380
- tech:angular-js
1381
- tech:ansible
1382
- tech:ant-design
1383
- tech:apache
1384
- tech:apl
1385
- tech:appcelerator
1386
- tech:apple
1387
- tech:apple-safari
1388
- tech:appwrite
1389
- tech:arch-linux
1390
- tech:arduino
1391
- tech:argo-cd
1392
- tech:astro
1393
- tech:atom
1394
- tech:autodesk-maya
1395
- tech:autodesk-shot-grid
1396
- tech:awk
1397
- tech:azios
1398
- tech:azure
1399
- tech:azure-devops
1400
- tech:azure-sql-database
1401
- tech:babel
1402
- tech:backbone-js
1403
- tech:ballerina
1404
- tech:bamboo
1405
- tech:bash
1406
- tech:behance
1407
- tech:bitbucket
1408
- tech:blender
1409
- tech:bootstrap
1410
- tech:bower
1411
- tech:browserstack
1412
- tech:bulma
1413
- tech:bun
1414
- tech:c
1415
- tech:cairo-graphics
1416
- tech:cake-php
1417
- tech:canva
1418
- tech:capacitor
1419
- tech:cassandra
1420
- tech:cent-os
1421
- tech:chrome
1422
- tech:circle-ci
1423
- tech:clarity
1424
- tech:clion
1425
- tech:clojure
1426
- tech:clojure-script
1427
- tech:cloudflare
1428
- tech:cloudflare-workers
1429
- tech:cmake
1430
- tech:code-igniter
1431
- tech:code-pen
1432
- tech:codeac
1433
- tech:codecov
1434
- tech:coffee-script
1435
- tech:composer
1436
- tech:confluence
1437
- tech:consul
1438
- tech:contao
1439
- tech:corejs
1440
- tech:cosmosdb
1441
- tech:couchdb
1442
- tech:cplusplus
1443
- tech:crystal
1444
- tech:csharp
1445
- tech:css3
1446
- tech:cucumber
1447
- tech:cypress
1448
- tech:d3js
1449
- tech:dart
1450
- tech:data-grip
1451
- tech:data-spell
1452
- tech:dbeaver
1453
- tech:debian
1454
- tech:deno
1455
- tech:devicon
1456
- tech:digital-ocean
1457
- tech:discord-js
1458
- tech:django
1459
- tech:django-rest
1460
- tech:docker
1461
- tech:doctrine
1462
- tech:dropwizard
1463
- tech:drupal
1464
- tech:eclipse-ceylon
1465
- tech:eclipse-ide
1466
- tech:eclipse-vert-x
1467
- tech:elasticbeats
1468
- tech:elasticsearch
1469
- tech:electron
1470
- tech:eleventy-11ty
1471
- tech:elixir
1472
- tech:elm
1473
- tech:embedded-c
1474
- tech:ember-js
1475
- tech:envoy
1476
- tech:erlang
1477
- tech:eslint
1478
- tech:express
1479
- tech:facebook
1480
- tech:fast-api
1481
- tech:fastify
1482
- tech:fauna
1483
- tech:feathers
1484
- tech:fedora
1485
- tech:figma
1486
- tech:file-zilla
1487
- tech:firebase
1488
- tech:firefox
1489
- tech:flask
1490
- tech:flutter
1491
- tech:fortran
1492
- tech:foundation
1493
- tech:fsharp
1494
- tech:gatling
1495
- tech:gatsby
1496
- tech:gazebo
1497
- tech:gcc
1498
- tech:gentoo
1499
- tech:ghost
1500
- tech:gimp
1501
- tech:git
1502
- tech:gitbook
1503
- tech:github
1504
- tech:github-actions
1505
- tech:github-codespaces
1506
- tech:gitlab
1507
- tech:gitpod
1508
- tech:gitter
1509
- tech:gnu-emacs
1510
- tech:go
1511
- tech:go-land
1512
- tech:godot-engine
1513
- tech:google
1514
- tech:google-cloud
1515
- tech:gradle
1516
- tech:grafana
1517
- tech:grails
1518
- tech:graphql
1519
- tech:groovy
1520
- tech:grunt-js
1521
- tech:gulp-js
1522
- tech:hadoop
1523
- tech:handlebars
1524
- tech:hardhat
1525
- tech:harvester
1526
- tech:hashicorp-vault
1527
- tech:haskell
1528
- tech:haxe
1529
- tech:helm
1530
- tech:heroku
1531
- tech:hibernate
1532
- tech:homebrew
1533
- tech:html5
1534
- tech:hugo
1535
- tech:ibm-spss-statistics
1536
- tech:ie10
1537
- tech:ifttt
1538
- tech:influxdb
1539
- tech:inkscape
1540
- tech:insomnia
1541
- tech:intellij-idea
1542
- tech:ionic
1543
- tech:jaeger
1544
- tech:jamstack
1545
- tech:jasmine
1546
- tech:java
1547
- tech:javascript
1548
- tech:jeet
1549
- tech:jekyll
1550
- tech:jenkins
1551
- tech:jest
1552
- tech:jetbrains
1553
- tech:jira
1554
- tech:jira-align
1555
- tech:jquery
1556
- tech:json
1557
- tech:jule
1558
- tech:julia
1559
- tech:junit
1560
- tech:jupyter
1561
- tech:k3os
1562
- tech:k3s
1563
- tech:kafka
1564
- tech:kaggle
1565
- tech:karate
1566
- tech:karma
1567
- tech:keras
1568
- tech:kibana
1569
- tech:knex-js
1570
- tech:knockout
1571
- tech:kotlin
1572
- tech:krakenjs
1573
- tech:ktor
1574
- tech:kubernetes
1575
- tech:labview
1576
- tech:laravel
1577
- tech:latex
1578
- tech:less-js
1579
- tech:linkedin
1580
- tech:linux
1581
- tech:liquibase
1582
- tech:livewire
1583
- tech:llvm
1584
- tech:logstash
1585
- tech:lua
1586
- tech:lumen
1587
- tech:magento
1588
- tech:markdown
1589
- tech:material-ui
1590
- tech:materialize
1591
- tech:matlab
1592
- tech:matplotlib
1593
- tech:maven
1594
- tech:meteor-js
1595
- tech:microsoft-sql-server
1596
- tech:minitab
1597
- tech:mob-x
1598
- tech:mocha
1599
- tech:modx
1600
- tech:moleculer
1601
- tech:mongodb
1602
- tech:mongoose-js
1603
- tech:moodle
1604
- tech:ms-dos
1605
- tech:mysql
1606
- tech:nano
1607
- tech:nerog
1608
- tech:nestjs
1609
- tech:net
1610
- tech:net-core
1611
- tech:network-x
1612
- tech:new4j
1613
- tech:nextjs
1614
- tech:nginx
1615
- tech:nhibernate
1616
- tech:nim
1617
- tech:nimble
1618
- tech:nix
1619
- tech:nodejs
1620
- tech:nodemon
1621
- tech:nodewebkit
1622
- tech:npm
1623
- tech:nuget
1624
- tech:num-py
1625
- tech:nuxt-js
1626
- tech:objective-c
1627
- tech:ocaml
1628
- tech:oh-my-zsh
1629
- tech:okta
1630
- tech:open-al
1631
- tech:open-api
1632
- tech:open-cl
1633
- tech:open-cv
1634
- tech:open-gl
1635
- tech:open-stack
1636
- tech:open-suse
1637
- tech:open-telemetry
1638
- tech:opera
1639
- tech:oracle
1640
- tech:p5js
1641
- tech:packer
1642
- tech:pandas
1643
- tech:perl
1644
- tech:pf-sense
1645
- tech:phalcon
1646
- tech:phoenix-framework
1647
- tech:photon-engine
1648
- tech:php
1649
- tech:php-storm
1650
- tech:playwrite
1651
- tech:ploty
1652
- tech:podman
1653
- tech:polygon
1654
- tech:portainer
1655
- tech:postcss
1656
- tech:postgresql
1657
- tech:postman
1658
- tech:powershell
1659
- tech:processing
1660
- tech:prometheus
1661
- tech:protractor
1662
- tech:purescript
1663
- tech:putty
1664
- tech:pycharm
1665
- tech:pyscript
1666
- tech:pytest
1667
- tech:python
1668
- tech:python-poetry
1669
- tech:pytorch
1670
- tech:qodana
1671
- tech:qt
1672
- tech:quarkus
1673
- tech:quasar
1674
- tech:qwik
1675
- tech:r
1676
- tech:rabbitmq
1677
- tech:rancher
1678
- tech:raspberrypi
1679
- tech:reach
1680
- tech:react
1681
- tech:react-bootstrap
1682
- tech:realm
1683
- tech:red-cube-s-epic-compiler-thingy-programming-re-ct
1684
- tech:redhat
1685
- tech:redis
1686
- tech:redux
1687
- tech:ren-py
1688
- tech:rider
1689
- tech:robot-operating-system-ros
1690
- tech:rocksdb
1691
- tech:rollup-js
1692
- tech:rspec
1693
- tech:rstudio
1694
- tech:ruby
1695
- tech:ruby-mine
1696
- tech:ruby-on-rails
1697
- tech:rust
1698
- tech:salesforce
1699
- tech:sanity
1700
- tech:sass
1701
- tech:scala
1702
- tech:scalingo
1703
- tech:sdl
1704
- tech:selenium
1705
- tech:sema-software
1706
- tech:sequelize
1707
- tech:shopware
1708
- tech:sketch
1709
- tech:slack
1710
- tech:socket-io
1711
- tech:solid-js
1712
- tech:solidity
1713
- tech:sonarqube
1714
- tech:sourcetree
1715
- tech:spark
1716
- tech:splunk
1717
- tech:spring
1718
- tech:sql-developer
1719
- tech:sqlalchemy
1720
- tech:sqlite
1721
- tech:ssh
1722
- tech:stackoverflow
1723
- tech:stata
1724
- tech:storybook
1725
- tech:streamlit
1726
- tech:stylus
1727
- tech:subversion
1728
- tech:svelte
1729
- tech:swagger
1730
- tech:swift
1731
- tech:symfony
1732
- tech:tailwind-css
1733
- tech:tauri
1734
- tech:tensorflow
1735
- tech:terraform
1736
- tech:tex
1737
- tech:the-algorithms
1738
- tech:three-js
1739
- tech:titanium-sdk
1740
- tech:tomcat
1741
- tech:tortoise-git
1742
- tech:tower
1743
- tech:traefik-mesh
1744
- tech:traefik-proxy
1745
- tech:travis-ci
1746
- tech:trello
1747
- tech:twitter
1748
- tech:typescript
1749
- tech:typo3
1750
- tech:ubuntu
1751
- tech:uml
1752
- tech:unity
1753
- tech:unix
1754
- tech:unreal-engine
1755
- tech:uwsgi
1756
- tech:v8
1757
- tech:vagrant
1758
- tech:vala
1759
- tech:vercel
1760
- tech:veutify
1761
- tech:vim
1762
- tech:visualstudio
1763
- tech:vite
1764
- tech:vitejs
1765
- tech:vscode
1766
- tech:vsphere
1767
- tech:vue
1768
- tech:vue-storefront
1769
- tech:vyper
1770
- tech:webassembly
1771
- tech:webflow
1772
- tech:weblate
1773
- tech:webpack
1774
- tech:webstorm
1775
- tech:windows8
1776
- tech:windows11
1777
- tech:woo-commerce
1778
- tech:wordpress
1779
- tech:xamarin
1780
- tech:xcode
1781
- tech:xml
1782
- tech:yaml
1783
- tech:yarn
1784
- tech:yii-framework
1785
- tech:yuno-host
1786
- tech:zend-framework
1787
- tech:zig
1788
- }}`,V_="likec4builtin",gZ=`${V_}:///likec4/lib/icons.c4`;var rs=Bs();const yZ=new rs.NotificationType("likec4/onDidChangeModel"),vZ=new rs.RequestType0("likec4/fetchModel"),wZ=new rs.RequestType("likec4/fetchComputedModel"),bZ=new rs.RequestType("likec4/computeView"),DZ=new rs.RequestType("likec4/layout-view"),EZ=new rs.RequestType("likec4/build"),RZ=new rs.RequestType("likec4/locate"),$Z=new rs.RequestType("likec4/change-view");class TZ{constructor(e){this.services=e}disposables=[];init(){const e=this.services.likec4.ModelBuilder,n=this.services.likec4.ModelLocator,r=this.services.likec4.ModelChanges,i=this.services.likec4.Views,s=this.services.shared.lsp.Connection;if(!s){Fe.info("[ServerRpc] no connection, not initializing");return}Fe.info("[ServerRpc] init");const o=this.services.shared.workspace.LangiumDocuments,a=this.services.shared.workspace.DocumentBuilder,c=l9(()=>{s.sendNotification(yZ,"").catch(l=>(Fe.error(`[ServerRpc] error sending onDidChangeModel: ${l}`),Promise.resolve()))},{timing:"trailing",waitMs:300,maxWaitMs:1e3});let u=!0;this.disposables.push(Os.create(()=>{c.cancel()}),e.onModelParsed(()=>c.call()),s.onRequest(wZ,async({cleanCaches:l},d)=>(l&&this.services.WorkspaceCache.clear(),{model:await e.buildComputedModel(d)})),s.onRequest(vZ,async l=>({model:await e.buildModel(l)})),s.onRequest(bZ,async({viewId:l},d)=>({view:await e.computeView(l,d)})),s.onRequest(DZ,async({viewId:l},d)=>({result:await i.layoutView(l,d)})),s.onRequest(EZ,async({docs:l},d)=>{const f=l.map(v=>Zt.parse(v)),p=v=>f.every(b=>!Ct.equals(b,v)),h=o.all.filter(v=>Sd(v)&&p(v.uri)&&v.uri.scheme!==V_).map(v=>v.uri).toArray();Fe.debug(`[ServerRpc] received request to build:
1789
- changed (total ${f.length}):${l.map(v=>`
1790
- - `+v).join("")}
1791
- deleted (total ${h.length}):${h.map(v=>`
1792
- - `+v.toString()).join(`
1793
- `)}`),!u&&f.length+h.length>0&&(await Promise.allSettled([...f,...h].map(async v=>{const b=v.toString();Fe.debug(`clear diagnostics for ${b}`);try{await s.sendDiagnostics({uri:b,diagnostics:[]})}catch(g){Fe.warn(`error clearing diagnostics for ${b}: ${g}`)}})),await jt(d)),u=!1,await a.update(f,h,d)}),s.onRequest(RZ,l=>{if("element"in l)return n.locateElement(l.element,l.property??"name");if("relation"in l)return n.locateRelation(l.relation);if("view"in l)return n.locateView(l.view);if("deployment"in l)return n.locateDeploymentElement(l.deployment,l.property??"name");Oe(l)}),s.onRequest($Z,async(l,d)=>await r.applyChange(l)))}dispose(){let e;for(;e=this.disposables.pop();)try{e.dispose()}catch(n){HC(n)}}}class SZ{constructor(e){this.services=e}getSymbolKind(e){const n=Tt(e)?e.$type:e.type,r=(...i)=>i.some(s=>this.services.AstReflection.isSubtype(n,s));switch(!0){case r(rr,no,Xi,Yi):return hr.Constructor;case r(ca,ua,Gl,aa,ga):return hr.Namespace;case r(Zs):return hr.Class;case r(es,ro,eo,ya):return hr.EnumMember;case r(Qi,ha):return hr.Event;case r(Ji,ta,fa,da):return hr.TypeParameter}return hr.Field}getCompletionItemKind(e){const n=Tt(e)?e.$type:e.type,r=(...i)=>i.some(s=>this.services.AstReflection.isSubtype(n,s));switch(!0){case r(eo):return Ft.Color;case r(rr,Xi,Yi,no):return Ft.Constructor;case r(ca,ua,Gl,aa,ga):return Ft.Module;case r(Zs):return Ft.Class;case r(es,ro,eo,ya):return Ft.EnumMember;case r(Qi,ha):return Ft.Event;case r(Ji,fa,ta,da):return Ft.TypeParameter;default:return Ft.Reference}}}class kZ extends TS{documentFactory;constructor(e){super(e),this.documentFactory=e.workspace.LangiumDocumentFactory}async loadAdditionalDocuments(e,n){n(this.documentFactory.fromString(mZ,Zt.parse(gZ))),await super.loadAdditionalDocuments(e,n)}workspace(){return this.folders&&gN(this.folders,1)?this.folders[0]:null}get workspaceUri(){const e=this.workspace();return Ce(e,"Workspace not initialized"),Zt.parse(e.uri)}get workspaceURL(){const e=this.workspace();return Ce(e,"Workspace not initialized"),new URL(e.uri)}}class CZ extends P1{}class AZ{constructor(e){this.services=e}cache=new WeakMap;viewsWithReportedErrors=new Set;get layouter(){return this.services.likec4.Layouter}async computedViews(e){const n=await this.services.likec4.ModelBuilder.buildComputedModel(e);return n?Wc(n.views):[]}async layoutAllViews(e){const n=await this.computedViews(e);if(n.length===0)return[];const r=[],i=[];for(const s of n)this.viewsWithReportedErrors.delete(s.id),i.push(this.layouter.layout(s).then(o=>(this.cache.set(s,o),o)).catch(o=>(this.cache.delete(s),ve(o),Promise.reject(o))));for(const s of await Promise.allSettled(i))s.status==="fulfilled"&&r.push(s.value);return r}async layoutView(e,n){const r=await this.services.likec4.ModelBuilder.buildComputedModel(n);if(!r)return null;const i=r.views[e];if(!i)return null;let s=this.cache.get(i);if(s)return s;try{const o=await this.layouter.layout(i);return this.viewsWithReportedErrors.delete(e),this.cache.set(i,o),o}catch(o){if(!this.viewsWithReportedErrors.has(e)){const a=o instanceof Error?o.message:""+o;this.services.shared.lsp.Connection?.window.showErrorMessage(`LikeC4: ${a}`),this.viewsWithReportedErrors.add(e)}return Fe.error(o),Promise.reject(o)}}async diagrams(){return(await this.layoutAllViews()).map(e=>e.diagram)}async viewsAsGraphvizOut(){const e="All-LayoutedViews-DotWithSvg",n=this.services.WorkspaceCache;if(n.has(e))return await Promise.resolve(n.get(e));const r=(await this.computedViews()).map(async o=>{const{dot:a,svg:c}=await this.layouter.svg(o);return{id:o.id,dot:a,svg:c}}),i=[],s=await Promise.allSettled(r);for(const o of s)o.status==="fulfilled"?i.push(o.value):ve(o.reason);return n.set(e,i),i}async overviewGraph(){const e="OverviewGraph",n=this.services.WorkspaceCache;if(n.has(e))return await Promise.resolve(n.get(e));const r=await this.computedViews(),i=await this.layouter.layoutOverviewGraph(r);return n.set(e,i),i}}const _Z={lsp:{NodeKindProvider:t=>new SZ(t),WorkspaceSymbolProvider:t=>new CZ(t)},workspace:{WorkspaceManager:t=>new kZ(t)}};function Lt(t){return e=>new t(e)}const PZ={documentation:{DocumentationProvider:Lt(rY)},WorkspaceCache:t=>new ES(t.shared),DocumentCache:t=>new Pq(t.shared),Rpc:Lt(TZ),likec4:{Layouter:t=>(Fe.debug("Creating GraphvizLayouter with GraphvizWasmAdapter"),new _A(new PA)),Views:Lt(AZ),DeploymentsIndex:Lt(SY),ModelChanges:Lt(uZ),FqnIndex:Lt(_Y),ModelParser:Lt(eZ),ModelBuilder:Lt(oX),ModelLocator:Lt(uX)},lsp:{CompletionProvider:Lt(cY),DocumentHighlightProvider:Lt(uY),DocumentSymbolProvider:Lt(bY),SemanticTokenProvider:Lt(TY),HoverProvider:Lt($Y),CodeLensProvider:Lt(aY),DocumentLinkProvider:Lt(wY),Formatter:Lt(oY)},references:{NameProvider:Lt(lZ),ScopeComputation:Lt(fZ),ScopeProvider:Lt(hZ)}};function xZ(t,e,n,r){const i=IZ(t),s=[z7({shared:i}),JK,PZ,e,n,r].reduce(K_,{}),o=Ip(s);return i.ServiceRegistry.register(o),WX(o),t.connection?o.Rpc.init():i.workspace.ConfigurationProvider.initialized({}),{shared:i,likec4:o}}function IZ(t={}){const e={...jS,...t};return t.connection&&TH(t.connection),Ip(j7(e),XK,_Z)}function K_(t,e){if(e){for(const[n,r]of Object.entries(e))if(r!==void 0){const i=t[n];i!==null&&r!==null&&typeof i=="object"&&typeof r=="object"?t[n]=K_(i,r):t[n]=r}}return t}function un(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}const fb=(t,e)=>{const n=Y_(t);if(typeof n!="string")throw new TypeError(`${e} must be a string or a file URL: ${n}.`);return n},Y_=t=>t instanceof URL?jm(t):t,X_=(t,e=[],n={})=>{const r=fb(t,"First argument"),[i,s]=un(e)?[[],e]:[e,n];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);const o=i.map(String),a=o.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!un(s))throw new TypeError(`Last argument must be an options object: ${s}`);return[r,o,s]},{toString:J_}=Object.prototype,NZ=t=>J_.call(t)==="[object ArrayBuffer]",wr=t=>J_.call(t)==="[object Uint8Array]",xd=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),OZ=new TextEncoder,Z_=t=>OZ.encode(t),FZ=new TextDecoder,Q_=t=>FZ.decode(t),LZ=(t,e)=>MZ(t,e).join(""),MZ=(t,e)=>{if(e==="utf8"&&t.every(s=>typeof s=="string"))return t;const n=new Y0(e),r=t.map(s=>typeof s=="string"?Z_(s):s).map(s=>n.write(s)),i=n.end();return i===""?r:[...r,i]},pb=t=>t.length===1&&wr(t[0])?t[0]:eP(BZ(t)),BZ=t=>t.map(e=>typeof e=="string"?Z_(e):e),eP=t=>{const e=new Uint8Array(zZ(t));let n=0;for(const r of t)e.set(r,n),n+=r.length;return e},zZ=t=>{let e=0;for(const n of t)e+=n.length;return e},qZ=t=>Array.isArray(t)&&Array.isArray(t.raw),jZ=(t,e)=>{let n=[];for(const[s,o]of t.entries())n=UZ({templates:t,expressions:e,tokens:n,index:s,template:o});if(n.length===0)throw new TypeError("Template script must not be empty");const[r,...i]=n;return[r,i,{}]},UZ=({templates:t,expressions:e,tokens:n,index:r,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[r]}`);const{nextTokens:s,leadingWhitespaces:o,trailingWhitespaces:a}=GZ(i,t.raw[r]),c=nP(n,s,o);if(r===e.length)return c;const u=e[r],l=Array.isArray(u)?u.map(d=>rP(d)):[rP(u)];return nP(c,l,a)},GZ=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};const n=[];let r=0;const i=tP.has(e[0]);for(let o=0,a=0;o<t.length;o+=1,a+=1){const c=e[a];if(tP.has(c))r!==o&&n.push(t.slice(r,o)),r=o+1;else if(c==="\\"){const u=e[a+1];u==="u"&&e[a+2]==="{"?a=e.indexOf("}",a+3):a+=WZ[u]??1}}const s=r===t.length;return s||n.push(t.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:s}},tP=new Set([" "," ","\r",`
1794
- `]),WZ={x:3,u:5},nP=(t,e,n)=>n||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],rP=t=>{const e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(un(t)&&("stdout"in t||"isMaxBuffer"in t))return HZ(t);throw t instanceof K0||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},HZ=({stdout:t})=>{if(typeof t=="string")return t;if(wr(t))return Q_(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)},so=t=>hb.includes(t),hb=[ot.stdin,ot.stdout,ot.stderr],Ur=["stdin","stdout","stderr"],iP=t=>Ur[t]??`stdio[${t}]`,VZ=t=>{const e={...t};for(const n of cP)e[n]=sP(t,n);return e},sP=(t,e)=>{const n=Array.from({length:KZ(t)+1}),r=YZ(t[e],n,e);return eQ(r,e)},KZ=({stdio:t})=>Array.isArray(t)?Math.max(t.length,Ur.length):Ur.length,YZ=(t,e,n)=>un(t)?XZ(t,e,n):e.fill(t),XZ=(t,e,n)=>{for(const r of Object.keys(t).sort(JZ))for(const i of ZZ(r,n,e))e[i]=t[r];return e},JZ=(t,e)=>oP(t)<oP(e)?1:-1,oP=t=>t==="stdout"||t==="stderr"?0:t==="all"?2:1,ZZ=(t,e,n)=>{if(t==="ipc")return[n.length-1];const r=aP(t);if(r===void 0||r===0)throw new TypeError(`"${e}.${t}" is invalid.
1795
- It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(r>=n.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist.
1796
- Please set the "stdio" option to ensure that file descriptor exists.`);return r==="all"?[1,2]:[r]},aP=t=>{if(t==="all")return t;if(Ur.includes(t))return Ur.indexOf(t);const e=QZ.exec(t);if(e!==null)return Number(e[1])},QZ=/^fd(\d+)$/,eQ=(t,e)=>t.map(n=>n===void 0?nQ[e]:n),tQ=z2("execa").enabled?"full":"none",nQ={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:tQ,stripFinalNewline:!0},cP=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Id=(t,e)=>e==="ipc"?t.at(-1):t[e],mb=({verbose:t},e)=>yb(t,e)!=="none",gb=({verbose:t},e)=>!["none","short"].includes(yb(t,e)),rQ=({verbose:t},e)=>{const n=yb(t,e);return vb(n)?n:void 0},yb=(t,e)=>e===void 0?iQ(t):Id(t,e),iQ=t=>t.find(e=>vb(e))??wb.findLast(e=>t.includes(e)),vb=t=>typeof t=="function",wb=["none","short","full"],sQ=(t,e)=>{const n=[t,...e],r=n.join(" "),i=n.map(s=>dQ(uP(s))).join(" ");return{command:r,escapedCommand:i}},bb=t=>q2(t).split(`
1797
- `).map(e=>uP(e)).join(`
1798
- `),uP=t=>t.replaceAll(cQ,e=>oQ(e)),oQ=t=>{const e=uQ[t];if(e!==void 0)return e;const n=t.codePointAt(0),r=n.toString(16);return n<=lQ?`\\u${r.padStart(4,"0")}`:`\\U${r}`},aQ=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},cQ=aQ(),uQ={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},lQ=65535,dQ=t=>fQ.test(t)?t:J2==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,fQ=/^[\w./-]+$/;function pQ(){return ot.platform!=="win32"?ot.env.TERM!=="linux":!!ot.env.WT_SESSION||!!ot.env.TERMINUS_SUBLIME||ot.env.ConEmuTask==="{cmd::Cmder}"||ot.env.TERM_PROGRAM==="Terminus-Sublime"||ot.env.TERM_PROGRAM==="vscode"||ot.env.TERM==="xterm-256color"||ot.env.TERM==="alacritty"||ot.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const lP={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},hQ={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},mQ={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},gQ={...lP,...hQ},yQ={...lP,...mQ},vQ=pQ(),Db=vQ?gQ:yQ,wQ=M0.WriteStream.prototype.hasColors(),pm=(t,e)=>{if(!wQ)return i=>i;const n=`\x1B[${t}m`,r=`\x1B[${e}m`;return i=>{const s=i+"";let o=s.indexOf(r);if(o===-1)return n+s+r;let a=n,c=0;for(;o!==-1;)a+=s.slice(c,o)+n,c=o+r.length,o=s.indexOf(r,c);return a+=s.slice(c)+r,a}},bQ=pm(1,22),Eb=pm(90,39),DQ=pm(91,39),EQ=pm(93,39),RQ=({type:t,message:e,timestamp:n,piped:r,commandId:i,result:{failed:s=!1}={},options:{reject:o=!0}})=>{const a=$Q(n),c=TQ[t]({failed:s,reject:o,piped:r}),u=SQ[t]({reject:o});return`${Eb(`[${a}]`)} ${Eb(`[${i}]`)} ${u(c)} ${u(e)}`},$Q=t=>`${hm(t.getHours(),2)}:${hm(t.getMinutes(),2)}:${hm(t.getSeconds(),2)}.${hm(t.getMilliseconds(),3)}`,hm=(t,e)=>String(t).padStart(e,"0"),dP=({failed:t,reject:e})=>t?e?Db.cross:Db.warning:Db.tick,TQ={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:dP,duration:dP},fP=t=>t,SQ={command:()=>bQ,output:()=>fP,ipc:()=>fP,error:({reject:t})=>t?DQ:EQ,duration:()=>Eb},kQ=(t,e,n)=>{const r=rQ(e,n);return t.map(({verboseLine:i,verboseObject:s})=>CQ(i,s,r)).filter(i=>i!==void 0).map(i=>AQ(i)).join("")},CQ=(t,e,n)=>{if(n===void 0)return t;const r=n(t,e);if(typeof r=="string")return r},AQ=t=>t.endsWith(`
1799
- `)?t:`${t}
1800
- `,Nd=({type:t,verboseMessage:e,fdNumber:n,verboseInfo:r,result:i})=>{const s=_Q({type:t,result:i,verboseInfo:r}),o=PQ(e,s),a=kQ(o,r,n);x0(IQ,a)},_Q=({type:t,result:e,verboseInfo:{escapedCommand:n,commandId:r,rawOptions:{piped:i=!1,...s}}})=>({type:t,escapedCommand:n,commandId:`${r}`,timestamp:new Date,piped:i,result:e,options:s}),PQ=(t,e)=>t.split(`
1801
- `).map(n=>xQ({...e,message:n})),xQ=t=>({verboseLine:RQ(t),verboseObject:t}),IQ=2,pP=t=>{const e=typeof t=="string"?t:Hd(t);return bb(e).replaceAll(" "," ".repeat(NQ))},NQ=2,OQ=(t,e)=>{mb(e)&&Nd({type:"command",verboseMessage:t,verboseInfo:e})},FQ=(t,e,n)=>{BQ(t);const r=LQ(t);return{verbose:t,escapedCommand:e,commandId:r,rawOptions:n}},LQ=t=>mb({verbose:t})?MQ++:void 0;let MQ=0n;const BQ=t=>{for(const e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!wb.includes(e)&&!vb(e)){const n=wb.map(r=>`'${r}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${n} or a function.`)}}},hP=()=>Vd.bigint(),mP=t=>Number(Vd.bigint()-t)/1e6,gP=(t,e,n)=>{const r=hP(),{command:i,escapedCommand:s}=sQ(t,e),o=sP(n,"verbose"),a=FQ(o,s,{...n});return OQ(s,a),{command:i,escapedCommand:s,startTime:r,verboseInfo:a}};var oo={exports:{}},Rb,yP;function zQ(){if(yP)return Rb;yP=1,Rb=r,r.sync=i;var t=yo;function e(s,o){var a=o.pathExt!==void 0?o.pathExt:process.env.PATHEXT;if(!a||(a=a.split(";"),a.indexOf("")!==-1))return!0;for(var c=0;c<a.length;c++){var u=a[c].toLowerCase();if(u&&s.substr(-u.length).toLowerCase()===u)return!0}return!1}function n(s,o,a){return!s.isSymbolicLink()&&!s.isFile()?!1:e(o,a)}function r(s,o,a){t.stat(s,function(c,u){a(c,c?!1:n(u,s,o))})}function i(s,o){return n(t.statSync(s),s,o)}return Rb}var $b,vP;function qQ(){if(vP)return $b;vP=1,$b=e,e.sync=n;var t=yo;function e(s,o,a){t.stat(s,function(c,u){a(c,c?!1:r(u,o))})}function n(s,o){return r(t.statSync(s),o)}function r(s,o){return s.isFile()&&i(s,o)}function i(s,o){var a=s.mode,c=s.uid,u=s.gid,l=o.uid!==void 0?o.uid:process.getuid&&process.getuid(),d=o.gid!==void 0?o.gid:process.getgid&&process.getgid(),f=parseInt("100",8),p=parseInt("010",8),h=parseInt("001",8),v=f|p,b=a&h||a&p&&u===d||a&f&&c===l||a&v&&l===0;return b}return $b}var Tb,wP;function jQ(){if(wP)return Tb;wP=1;var t;process.platform==="win32"||Dq.TESTING_WINDOWS?t=zQ():t=qQ(),Tb=e,e.sync=n;function e(r,i,s){if(typeof i=="function"&&(s=i,i={}),!s){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(o,a){e(r,i||{},function(c,u){c?a(c):o(u)})})}t(r,i||{},function(o,a){o&&(o.code==="EACCES"||i&&i.ignoreErrors)&&(o=null,a=!1),s(o,a)})}function n(r,i){try{return t.sync(r,i||{})}catch(s){if(i&&i.ignoreErrors||s.code==="EACCES")return!1;throw s}}return Tb}var Sb,bP;function UQ(){if(bP)return Sb;bP=1;const t=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",e=Tr,n=t?";":":",r=jQ(),i=c=>Object.assign(new Error(`not found: ${c}`),{code:"ENOENT"}),s=(c,u)=>{const l=u.colon||n,d=c.match(/\//)||t&&c.match(/\\/)?[""]:[...t?[process.cwd()]:[],...(u.path||process.env.PATH||"").split(l)],f=t?u.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",p=t?f.split(l):[""];return t&&c.indexOf(".")!==-1&&p[0]!==""&&p.unshift(""),{pathEnv:d,pathExt:p,pathExtExe:f}},o=(c,u,l)=>{typeof u=="function"&&(l=u,u={}),u||(u={});const{pathEnv:d,pathExt:f,pathExtExe:p}=s(c,u),h=[],v=g=>new Promise((w,R)=>{if(g===d.length)return u.all&&h.length?w(h):R(i(c));const k=d[g],A=/^".*"$/.test(k)?k.slice(1,-1):k,N=e.join(A,c),_=!A&&/^\.[\\\/]/.test(c)?c.slice(0,2)+N:N;w(b(_,g,0))}),b=(g,w,R)=>new Promise((k,A)=>{if(R===f.length)return k(v(w+1));const N=f[R];r(g+N,{pathExt:p},(_,B)=>{if(!_&&B)if(u.all)h.push(g+N);else return k(g+N);return k(b(g,w,R+1))})});return l?v(0).then(g=>l(null,g),l):v(0)},a=(c,u)=>{u=u||{};const{pathEnv:l,pathExt:d,pathExtExe:f}=s(c,u),p=[];for(let h=0;h<l.length;h++){const v=l[h],b=/^".*"$/.test(v)?v.slice(1,-1):v,g=e.join(b,c),w=!b&&/^\.[\\\/]/.test(c)?c.slice(0,2)+g:g;for(let R=0;R<d.length;R++){const k=w+d[R];try{if(r.sync(k,{pathExt:f}))if(u.all)p.push(k);else return k}catch{}}}if(u.all&&p.length)return p;if(u.nothrow)return null;throw i(c)};return Sb=o,o.sync=a,Sb}var mm={exports:{}},DP;function GQ(){if(DP)return mm.exports;DP=1;const t=(e={})=>{const n=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(n).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};return mm.exports=t,mm.exports.default=t,mm.exports}var kb,EP;function WQ(){if(EP)return kb;EP=1;const t=Tr,e=UQ(),n=GQ();function r(s,o){const a=s.options.env||process.env,c=process.cwd(),u=s.options.cwd!=null,l=u&&process.chdir!==void 0&&!process.chdir.disabled;if(l)try{process.chdir(s.options.cwd)}catch{}let d;try{d=e.sync(s.command,{path:a[n({env:a})],pathExt:o?t.delimiter:void 0})}catch{}finally{l&&process.chdir(c)}return d&&(d=t.resolve(u?s.options.cwd:"",d)),d}function i(s){return r(s)||r(s,!0)}return kb=i,kb}var gm={},RP;function HQ(){if(RP)return gm;RP=1;const t=/([()\][%!^"`<>&|;, *?])/g;function e(r){return r=r.replace(t,"^$1"),r}function n(r,i){return r=`${r}`,r=r.replace(/(\\*)"/g,'$1$1\\"'),r=r.replace(/(\\*)$/,"$1$1"),r=`"${r}"`,r=r.replace(t,"^$1"),i&&(r=r.replace(t,"^$1")),r}return gm.command=e,gm.argument=n,gm}var Cb,$P;function VQ(){return $P||($P=1,Cb=/^#!(.*)/),Cb}var Ab,TP;function KQ(){if(TP)return Ab;TP=1;const t=VQ();return Ab=(e="")=>{const n=e.match(t);if(!n)return null;const[r,i]=n[0].replace(/#! ?/,"").split(" "),s=r.split("/").pop();return s==="env"?i:i?`${s} ${i}`:s},Ab}var _b,SP;function YQ(){if(SP)return _b;SP=1;const t=yo,e=KQ();function n(r){const s=Buffer.alloc(150);let o;try{o=t.openSync(r,"r"),t.readSync(o,s,0,150,0),t.closeSync(o)}catch{}return e(s.toString())}return _b=n,_b}var Pb,kP;function XQ(){if(kP)return Pb;kP=1;const t=Tr,e=WQ(),n=HQ(),r=YQ(),i=process.platform==="win32",s=/\.(?:com|exe)$/i,o=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function a(l){l.file=e(l);const d=l.file&&r(l.file);return d?(l.args.unshift(l.file),l.command=d,e(l)):l.file}function c(l){if(!i)return l;const d=a(l),f=!s.test(d);if(l.options.forceShell||f){const p=o.test(d);l.command=t.normalize(l.command),l.command=n.command(l.command),l.args=l.args.map(v=>n.argument(v,p));const h=[l.command].concat(l.args).join(" ");l.args=["/d","/s","/c",`"${h}"`],l.command=process.env.comspec||"cmd.exe",l.options.windowsVerbatimArguments=!0}return l}function u(l,d,f){d&&!Array.isArray(d)&&(f=d,d=null),d=d?d.slice(0):[],f=Object.assign({},f);const p={command:l,args:d,options:f,file:void 0,original:{command:l,args:d}};return f.shell?p:c(p)}return Pb=u,Pb}var xb,CP;function JQ(){if(CP)return xb;CP=1;const t=process.platform==="win32";function e(s,o){return Object.assign(new Error(`${o} ${s.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${o} ${s.command}`,path:s.command,spawnargs:s.args})}function n(s,o){if(!t)return;const a=s.emit;s.emit=function(c,u){if(c==="exit"){const l=r(u,o);if(l)return a.call(s,"error",l)}return a.apply(s,arguments)}}function r(s,o){return t&&s===1&&!o.file?e(o.original,"spawn"):null}function i(s,o){return t&&s===1&&!o.file?e(o.original,"spawnSync"):null}return xb={hookChildProcess:n,verifyENOENT:r,verifyENOENTSync:i,notFoundError:e},xb}var AP;function ZQ(){if(AP)return oo.exports;AP=1;const t=L0,e=XQ(),n=JQ();function r(s,o,a){const c=e(s,o,a),u=t.spawn(c.command,c.args,c.options);return n.hookChildProcess(u,c),u}function i(s,o,a){const c=e(s,o,a),u=t.spawnSync(c.command,c.args,c.options);return u.error=u.error||n.verifyENOENTSync(u.status,c),u}return oo.exports=r,oo.exports.spawn=r,oo.exports.sync=i,oo.exports._parse=e,oo.exports._enoent=n,oo.exports}var QQ=ZQ();const eee=Rp(QQ);function _P(t={}){const{env:e=process.env,platform:n=process.platform}=t;return n!=="win32"?"PATH":Object.keys(e).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"}const tee=({cwd:t=ot.cwd(),path:e=ot.env[_P()],preferLocal:n=!0,execPath:r=ot.execPath,addExecPath:i=!0}={})=>{const s=t instanceof URL?jm(t):t,o=Hr.resolve(s),a=[];return n&&nee(a,o),i&&ree(a,r,o),[...a,e].join(Hr.delimiter)},nee=(t,e)=>{let n;for(;n!==e;)t.push(Hr.join(e,"node_modules/.bin")),n=e,e=Hr.resolve(e,"..")},ree=(t,e,n)=>{const r=e instanceof URL?jm(e):e;t.push(Hr.resolve(n,r,".."))},iee=({env:t=ot.env,...e}={})=>{t={...t};const n=_P({env:t});return e.path=t[n],t[n]=tee(e),t},see=(t,e,n)=>{const r=n?Ob:Nb,i=t instanceof Od?{}:{cause:t};return new r(e,i)};class Od extends Error{}const PP=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,xP,{value:!0,writable:!1,enumerable:!1,configurable:!1})},oee=t=>Ib(t)&&xP in t,xP=Symbol("isExecaError"),Ib=t=>Object.prototype.toString.call(t)==="[object Error]";class Nb extends Error{}PP(Nb,Nb.name);class Ob extends Error{}PP(Ob,Ob.name);const aee=()=>{const t=NP-IP+1;return Array.from({length:t},cee)},cee=(t,e)=>({name:`SIGRT${e+1}`,number:IP+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),IP=34,NP=64,uee=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}],OP=()=>{const t=aee();return[...uee,...t].map(lee)},lee=({name:t,number:e,description:n,action:r,forced:i=!1,standard:s})=>{const{signals:{[t]:o}}=gs,a=o!==void 0;return{name:t,number:a?o:e,description:n,supported:a,action:r,forced:i,standard:s}},dee=()=>{const t=OP();return Object.fromEntries(t.map(fee))},fee=({name:t,number:e,description:n,supported:r,action:i,forced:s,standard:o})=>[t,{name:t,number:e,description:n,supported:r,action:i,forced:s,standard:o}],pee=dee(),hee=()=>{const t=OP(),e=NP+1,n=Array.from({length:e},(r,i)=>mee(i,t));return Object.assign({},...n)},mee=(t,e)=>{const n=gee(t,e);if(n===void 0)return{};const{name:r,description:i,supported:s,action:o,forced:a,standard:c}=n;return{[t]:{name:r,number:t,description:i,supported:s,action:o,forced:a,standard:c}}},gee=(t,e)=>{const n=e.find(({name:r})=>gs.signals[r]===t);return n!==void 0?n:e.find(r=>r.number===t)};hee();const yee=t=>{const e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return FP(t,e)},vee=t=>t===0?t:FP(t,"`subprocess.kill()`'s argument"),FP=(t,e)=>{if(Number.isInteger(t))return wee(t,e);if(typeof t=="string")return Dee(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer.
1802
- ${Fb()}`)},wee=(t,e)=>{if(LP.has(t))return LP.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist.
1803
- ${Fb()}`)},bee=()=>new Map(Object.entries(gs.signals).reverse().map(([t,e])=>[e,t])),LP=bee(),Dee=(t,e)=>{if(t in gs.signals)return t;throw t.toUpperCase()in gs.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist.
1804
- ${Fb()}`)},Fb=()=>`Available signal names: ${Eee()}.
1805
- Available signal numbers: ${Ree()}.`,Eee=()=>Object.keys(gs.signals).sort().map(t=>`'${t}'`).join(", "),Ree=()=>[...new Set(Object.values(gs.signals).sort((t,e)=>t-e))].join(", "),MP=t=>pee[t].description,$ee=t=>{if(t===!1)return t;if(t===!0)return Tee;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},Tee=1e3*5,See=({kill:t,options:{forceKillAfterDelay:e,killSignal:n},onInternalError:r,context:i,controller:s},o,a)=>{const{signal:c,error:u}=kee(o,a,n);Cee(u,r);const l=t(c);return Aee({kill:t,signal:c,forceKillAfterDelay:e,killSignal:n,killResult:l,context:i,controller:s}),l},kee=(t,e,n)=>{const[r=n,i]=Ib(t)?[void 0,t]:[t,e];if(typeof r!="string"&&!Number.isInteger(r))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(r)}`);if(i!==void 0&&!Ib(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:vee(r),error:i}},Cee=(t,e)=>{t!==void 0&&e.reject(t)},Aee=async({kill:t,signal:e,forceKillAfterDelay:n,killSignal:r,killResult:i,context:s,controller:o})=>{e===r&&i&&BP({kill:t,forceKillAfterDelay:n,context:s,controllerSignal:o.signal})},BP=async({kill:t,forceKillAfterDelay:e,context:n,controllerSignal:r})=>{if(e!==!1)try{await X0(e,void 0,{signal:r}),t("SIGKILL")&&(n.isForcefullyTerminated??=!0)}catch{}},zP=async(t,e)=>{t.aborted||await Sn(t,"abort",{signal:e})},_ee=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},Pee=({subprocess:t,cancelSignal:e,gracefulCancel:n,context:r,controller:i})=>e===void 0||n?[]:[xee(t,e,r,i)],xee=async(t,e,n,{signal:r})=>{throw await zP(e,r),n.terminationReason??="cancel",t.kill(),e.reason},Lb=({methodName:t,isSubprocess:e,ipc:n,isConnected:r})=>{Iee(t,e,n),qP(t,e,r)},Iee=(t,e,n)=>{if(!n)throw new Error(`${br(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},qP=(t,e,n)=>{if(!n)throw new Error(`${br(t,e)} cannot be used: the ${is(e)} has already exited or disconnected.`)},Nee=t=>{throw new Error(`${br("getOneMessage",t)} could not complete: the ${is(t)} exited or disconnected.`)},Oee=t=>{throw new Error(`${br("sendMessage",t)} failed: the ${is(t)} is sending a message too, instead of listening to incoming messages.
1806
- This can be fixed by both sending a message and listening to incoming messages at the same time:
1807
-
1808
- const [receivedMessage] = await Promise.all([
1809
- ${br("getOneMessage",t)},
1810
- ${br("sendMessage",t,"message, {strict: true}")},
1811
- ]);`)},jP=(t,e)=>new Error(`${br("sendMessage",e)} failed when sending an acknowledgment response to the ${is(e)}.`,{cause:t}),Fee=t=>{throw new Error(`${br("sendMessage",t)} failed: the ${is(t)} is not listening to incoming messages.`)},Lee=t=>{throw new Error(`${br("sendMessage",t)} failed: the ${is(t)} exited without listening to incoming messages.`)},Mee=()=>new Error(`\`cancelSignal\` aborted: the ${is(!0)} disconnected.`),Bee=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},zee=({error:t,methodName:e,isSubprocess:n})=>{if(t.code==="EPIPE")throw new Error(`${br(e,n)} cannot be used: the ${is(n)} is disconnecting.`,{cause:t})},qee=({error:t,methodName:e,isSubprocess:n,message:r})=>{if(jee(t))throw new Error(`${br(e,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:t})},jee=({code:t,message:e})=>Uee.has(t)||Gee.some(n=>e.includes(n)),Uee=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),Gee=["could not be cloned","circular structure","call stack size exceeded"],br=(t,e,n="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${Wee(e)}${t}(${n})`,Wee=t=>t?"":"subprocess.",is=t=>t?"parent process":"subprocess",Mb=t=>{t.connected&&t.disconnect()},Fd=()=>{const t={},e=new Promise((n,r)=>{Object.assign(t,{resolve:n,reject:r})});return Object.assign(e,t)},UP=(t,e="stdin")=>{const{options:r,fileDescriptors:i}=ao.get(t),s=GP(i,e,!0),o=t.stdio[s];if(o===null)throw new TypeError(WP(s,e,r,!0));return o},Bb=(t,e="stdout")=>{const{options:r,fileDescriptors:i}=ao.get(t),s=GP(i,e,!1),o=s==="all"?t.all:t.stdio[s];if(o==null)throw new TypeError(WP(s,e,r,!1));return o},ao=new WeakMap,GP=(t,e,n)=>{const r=Hee(e,n);return Vee(r,e,n,t),r},Hee=(t,e)=>{const n=aP(t);if(n!==void 0)return n;const{validOptions:r,defaultValue:i}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Ld(e)}" must not be "${t}".
1812
- It must be ${r} or "fd3", "fd4" (and so on).
1813
- It is optional and defaults to "${i}".`)},Vee=(t,e,n,r)=>{const i=r[HP(t)];if(i===void 0)throw new TypeError(`"${Ld(n)}" must not be ${e}. That file descriptor does not exist.
1814
- Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!n)throw new TypeError(`"${Ld(n)}" must not be ${e}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&n)throw new TypeError(`"${Ld(n)}" must not be ${e}. It must be a writable stream, not readable.`)},WP=(t,e,n,r)=>{if(t==="all"&&!n.all)return`The "all" option must be true to use "from: 'all'".`;const{optionName:i,optionValue:s}=Kee(t,n);return`The "${i}: ${zb(s)}" option is incompatible with using "${Ld(r)}: ${zb(e)}".
1815
- Please set this option with "pipe" instead.`},Kee=(t,{stdin:e,stdout:n,stderr:r,stdio:i})=>{const s=HP(t);return s===0&&e!==void 0?{optionName:"stdin",optionValue:e}:s===1&&n!==void 0?{optionName:"stdout",optionValue:n}:s===2&&r!==void 0?{optionName:"stderr",optionValue:r}:{optionName:`stdio[${s}]`,optionValue:i[s]}},HP=t=>t==="all"?1:t,Ld=t=>t?"to":"from",zb=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream",ym=(t,e,n)=>{const r=t.getMaxListeners();r===0||r===Number.POSITIVE_INFINITY||(t.setMaxListeners(r+e),Z0(n,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))},VP=(t,e)=>{e&&qb(t)},qb=t=>{t.refCounted()},KP=(t,e)=>{e&&jb(t)},jb=t=>{t.unrefCounted()},Yee=(t,e)=>{e&&(jb(t),jb(t))},Xee=(t,e)=>{e&&(qb(t),qb(t))},Jee=async({anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r},i)=>{if(ite(i)||gte(i))return;vm.has(t)||vm.set(t,[]);const s=vm.get(t);if(s.push(i),!(s.length>1))for(;s.length>0;){await ute(t,r,i),await J0.yield();const o=await rte({wrappedMessage:s[0],anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r});s.shift(),r.emit("message",o),r.emit("message:done")}},Zee=async({anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{tx();const s=vm.get(t);for(;s?.length>0;)await Sn(r,"message:done");t.removeListener("message",i),Xee(e,n),r.connected=!1,r.emit("disconnect")},vm=new WeakMap,wm=(t,e,n)=>{if(bm.has(t))return bm.get(t);const r=new bN;return r.connected=!0,bm.set(t,r),Qee({ipcEmitter:r,anyProcess:t,channel:e,isSubprocess:n}),r},bm=new WeakMap,Qee=({ipcEmitter:t,anyProcess:e,channel:n,isSubprocess:r})=>{const i=Jee.bind(void 0,{anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:t});e.on("message",i),e.once("disconnect",Zee.bind(void 0,{anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:t,boundOnMessage:i})),Yee(n,r)},YP=t=>{const e=bm.get(t);return e===void 0?t.channel!==null:e.connected},ete=({anyProcess:t,channel:e,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;const s=wm(t,e,n),o=Ub(t,s);return{id:tte++,type:Em,message:r,hasListeners:o}};let tte=0n;const nte=(t,e)=>{if(!(e?.type!==Em||e.hasListeners))for(const{id:n}of t)n!==void 0&&Dm[n].resolve({isDeadlock:!0,hasListeners:!1})},rte=async({wrappedMessage:t,anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(t?.type!==Em||!e.connected)return t;const{id:s,message:o}=t,a={id:s,type:XP,message:Ub(e,i)};try{await JP({anyProcess:e,channel:n,isSubprocess:r,ipc:!0},a)}catch(c){i.emit("strict:error",c)}return o},ite=t=>{if(t?.type!==XP)return!1;const{id:e,message:n}=t;return Dm[e]?.resolve({isDeadlock:!1,hasListeners:n}),!0},ste=async(t,e,n)=>{if(t?.type!==Em)return;const r=Fd();Dm[t.id]=r;const i=new AbortController;try{const{isDeadlock:s,hasListeners:o}=await Promise.race([r,ote(e,n,i)]);s&&Oee(n),o||Fee(n)}finally{i.abort(),delete Dm[t.id]}},Dm={},ote=async(t,e,{signal:n})=>{ym(t,1,n),await Sn(t,"disconnect",{signal:n}),Lee(e)},Em="execa:ipc:request",XP="execa:ipc:response",ate=(t,e,n)=>{Md.has(t)||Md.set(t,new Set);const r=Md.get(t),i=Fd(),s=n?e.id:void 0,o={onMessageSent:i,id:s};return r.add(o),{outgoingMessages:r,outgoingMessage:o}},cte=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},ute=async(t,e,n)=>{for(;!Ub(t,e)&&Md.get(t)?.size>0;){const r=[...Md.get(t)];nte(r,n),await Promise.all(r.map(({onMessageSent:i})=>i))}},Md=new WeakMap,Ub=(t,e)=>e.listenerCount("message")>lte(t),lte=t=>ao.has(t)&&!Id(ao.get(t).options.buffer,"ipc")?1:0,JP=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},i,{strict:s=!1}={})=>{const o="sendMessage";return Lb({methodName:o,isSubprocess:n,ipc:r,isConnected:t.connected}),dte({anyProcess:t,channel:e,methodName:o,isSubprocess:n,message:i,strict:s})},dte=async({anyProcess:t,channel:e,methodName:n,isSubprocess:r,message:i,strict:s})=>{const o=ete({anyProcess:t,channel:e,isSubprocess:r,message:i,strict:s}),a=ate(t,o,s);try{await ZP({anyProcess:t,methodName:n,isSubprocess:r,wrappedMessage:o,message:i})}catch(c){throw Mb(t),c}finally{cte(a)}},ZP=async({anyProcess:t,methodName:e,isSubprocess:n,wrappedMessage:r,message:i})=>{const s=fte(t);try{await Promise.all([ste(r,t,n),s(r)])}catch(o){throw zee({error:o,methodName:e,isSubprocess:n}),qee({error:o,methodName:e,isSubprocess:n,message:i}),o}},fte=t=>{if(Gb.has(t))return Gb.get(t);const e=j2(t.send.bind(t));return Gb.set(t,e),e},Gb=new WeakMap,pte=(t,e)=>{const n="cancelSignal";return qP(n,!1,t.connected),ZP({anyProcess:t,methodName:n,isSubprocess:!1,wrappedMessage:{type:ex,message:e},message:e})},hte=async({anyProcess:t,channel:e,isSubprocess:n,ipc:r})=>(await mte({anyProcess:t,channel:e,isSubprocess:n,ipc:r}),Wb.signal),mte=async({anyProcess:t,channel:e,isSubprocess:n,ipc:r})=>{if(!QP){if(QP=!0,!r){Bee();return}if(e===null){tx();return}wm(t,e,n),await J0.yield()}};let QP=!1;const gte=t=>t?.type!==ex?!1:(Wb.abort(t.message),!0),ex="execa:ipc:cancel",tx=()=>{Wb.abort(Mee())},Wb=new AbortController,yte=({gracefulCancel:t,cancelSignal:e,ipc:n,serialization:r})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!n)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(r==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},vte=({subprocess:t,cancelSignal:e,gracefulCancel:n,forceKillAfterDelay:r,context:i,controller:s})=>n?[wte({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:i,controller:s})]:[],wte=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:r,controller:{signal:i}})=>{await zP(e,i);const s=bte(e);throw await pte(t,s),BP({kill:t.kill,forceKillAfterDelay:n,context:r,controllerSignal:i}),r.terminationReason??="gracefulCancel",e.reason},bte=({reason:t})=>{if(!(t instanceof DOMException))return t;const e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e},Dte=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},Ete=(t,e,n,r)=>e===0||e===void 0?[]:[Rte(t,e,n,r)],Rte=async(t,e,n,{signal:r})=>{throw await X0(e,void 0,{signal:r}),n.terminationReason??="timeout",t.kill(),new Od},$te=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},Tte=(t,e,{node:n=!1,nodePath:r=Z2,nodeOptions:i=Q2.filter(c=>!c.startsWith("--inspect")),cwd:s,execPath:o,...a})=>{if(o!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');const c=fb(r,'The "nodePath" option'),u=Hr.resolve(s,c),l={...a,nodePath:u,node:n,cwd:s};if(!n)return[t,e,l];if(Hr.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[u,[...i,t,...e],{ipc:!0,...l,shell:!1}]},Ste=({ipcInput:t,ipc:e,serialization:n})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");Ate[n](t)}},kte=t=>{try{EN(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},Cte=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},Ate={advanced:kte,json:Cte},_te=async(t,e)=>{e!==void 0&&await t.sendMessage(e)},Pte=({encoding:t})=>{if(Hb.has(t))return;const e=Ite(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${Rm(t)}\`.
1816
- Please rename it to ${Rm(e)}.`);const n=[...Hb].map(r=>Rm(r)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Rm(t)}\`.
1817
- Please rename it to one of: ${n}.`)},xte=new Set(["utf8","utf16le"]),co=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Hb=new Set([...xte,...co]),Ite=t=>{if(t===null)return"buffer";if(typeof t!="string")return;const e=t.toLowerCase();if(e in nx)return nx[e];if(Hb.has(e))return e},nx={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Rm=t=>typeof t=="string"?`"${t}"`:String(t),Nte=(t=rx())=>{const e=fb(t,'The "cwd" option');return Hr.resolve(e)},rx=()=>{try{return ot.cwd()}catch(t){throw t.message=`The current directory does not exist.
1818
- ${t.message}`,t}},Ote=(t,e)=>{if(e===rx())return t;let n;try{n=x2(e)}catch(r){return`The "cwd" option is invalid: ${e}.
1819
- ${r.message}
1820
- ${t}`}return n.isDirectory()?t:`The "cwd" option is not a directory: ${e}.
1821
- ${t}`},ix=(t,e,n)=>{n.cwd=Nte(n.cwd);const[r,i,s]=Tte(t,e,n),{command:o,args:a,options:c}=eee._parse(r,i,s),u=VZ(c),l=Fte(u);return Dte(l),Pte(l),Ste(l),_ee(l),yte(l),l.shell=Y_(l.shell),l.env=Lte(l),l.killSignal=yee(l.killSignal),l.forceKillAfterDelay=$ee(l.forceKillAfterDelay),l.lines=l.lines.map((d,f)=>d&&!co.has(l.encoding)&&l.buffer[f]),ot.platform==="win32"&&Hr.basename(o,".exe")==="cmd"&&a.unshift("/q"),{file:o,commandArguments:a,options:l}},Fte=({extendEnv:t=!0,preferLocal:e=!1,cwd:n,localDir:r=n,encoding:i="utf8",reject:s=!0,cleanup:o=!0,all:a=!1,windowsHide:c=!0,killSignal:u="SIGTERM",forceKillAfterDelay:l=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:h="advanced",...v})=>({...v,extendEnv:t,preferLocal:e,cwd:n,localDirectory:r,encoding:i,reject:s,cleanup:o,all:a,windowsHide:c,killSignal:u,forceKillAfterDelay:l,gracefulCancel:d,ipcInput:f,ipc:p,serialization:h}),Lte=({env:t,extendEnv:e,preferLocal:n,node:r,localDirectory:i,nodePath:s})=>{const o=e?{...ot.env,...t}:t;return n||r?iee({env:o,cwd:i,execPath:s,preferLocal:n,addExecPath:r}):o};function Vb(t){if(typeof t=="string")return Mte(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return Bte(t)}const Mte=t=>t.at(-1)===sx?t.slice(0,t.at(-2)===ox?-2:-1):t,Bte=t=>t.at(-1)===zte?t.subarray(0,t.at(-2)===qte?-2:-1):t,sx=`
1822
- `,zte=sx.codePointAt(0),ox="\r",qte=ox.codePointAt(0);function uo(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function ax(t,{checkOpen:e=!0}={}){return uo(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function $m(t,{checkOpen:e=!0}={}){return uo(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function cx(t,e){return ax(t,e)&&$m(t,e)}const jte=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);let Ute=class{#e;#t;#n=!1;#r=void 0;constructor(e,n){this.#e=e,this.#t=n}next(){const e=()=>this.#s();return this.#r=this.#r?this.#r.then(e,e):e(),this.#r}return(e){const n=()=>this.#i(e);return this.#r?this.#r.then(n,n):n()}async#s(){if(this.#n)return{done:!0,value:void 0};let e;try{e=await this.#e.read()}catch(n){throw this.#r=void 0,this.#n=!0,this.#e.releaseLock(),n}return e.done&&(this.#r=void 0,this.#n=!0,this.#e.releaseLock()),e}async#i(e){if(this.#n)return{done:!0,value:e};if(this.#n=!0,!this.#t){const n=this.#e.cancel(e);return this.#e.releaseLock(),await n,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}};const Kb=Symbol();function ux(){return this[Kb].next()}Object.defineProperty(ux,"name",{value:"next"});function lx(t){return this[Kb].return(t)}Object.defineProperty(lx,"name",{value:"return"});const Gte=Object.create(jte,{next:{enumerable:!0,configurable:!0,writable:!0,value:ux},return:{enumerable:!0,configurable:!0,writable:!0,value:lx}});function Wte({preventCancel:t=!1}={}){const e=this.getReader(),n=new Ute(e,t),r=Object.create(Gte);return r[Kb]=n,r}const Hte=t=>{if($m(t,{checkOpen:!1})&&Yb.on!==void 0)return Kte(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(Vte.call(t)==="[object ReadableStream]")return Wte.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:Vte}=Object.prototype,Kte=async function*(t){const e=new AbortController,n={};Yte(t,e,n);try{for await(const[r]of Yb.on(t,"data",{signal:e.signal}))yield r}catch(r){if(n.error!==void 0)throw n.error;if(!e.signal.aborted)throw r}finally{t.destroy()}},Yte=async(t,e,n)=>{try{await Yb.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(r){n.error=r}finally{e.abort()}},Yb={},Xb=async(t,{init:e,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:o,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{const u=Hte(t),l=e();l.length=0;try{for await(const d of u){const f=Jte(d),p=n[f](d,l);dx({convertedChunk:p,state:l,getSize:r,truncateChunk:i,addChunk:s,maxBuffer:c})}return Xte({state:l,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:o,maxBuffer:c}),a(l)}catch(d){const f=typeof d=="object"&&d!==null?d:new Error(d);throw f.bufferedData=a(l),f}},Xte=({state:t,getSize:e,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:s})=>{const o=i(t);o!==void 0&&dx({convertedChunk:o,state:t,getSize:e,truncateChunk:n,addChunk:r,maxBuffer:s})},dx=({convertedChunk:t,state:e,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:s})=>{const o=n(t),a=e.length+o;if(a<=s){fx(t,e,i,a);return}const c=r(t,s-e.length);throw c!==void 0&&fx(c,e,i,s),new Tm},fx=(t,e,n,r)=>{e.contents=n(t,e,r),e.length=r},Jte=t=>{const e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";const n=px.call(t);return n==="[object ArrayBuffer]"?"arrayBuffer":n==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&px.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:px}=Object.prototype;class Tm extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const lo=t=>t,Jb=()=>{},hx=({contents:t})=>t,mx=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},gx=t=>t.length;async function Zte(t,e){return Xb(t,nne,e)}const Qte=()=>({contents:[]}),ene=()=>1,tne=(t,{contents:e})=>(e.push(t),e),nne={init:Qte,convertChunk:{string:lo,buffer:lo,arrayBuffer:lo,dataView:lo,typedArray:lo,others:lo},getSize:ene,truncateChunk:Jb,addChunk:tne,getFinalChunk:Jb,finalize:hx};async function rne(t,e){return Xb(t,fne,e)}const ine=()=>({contents:new ArrayBuffer(0)}),sne=t=>one.encode(t),one=new TextEncoder,yx=t=>new Uint8Array(t),vx=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),ane=(t,e)=>t.slice(0,e),cne=(t,{contents:e,length:n},r)=>{const i=Dx()?lne(e,r):une(e,r);return new Uint8Array(i).set(t,n),i},une=(t,e)=>{if(e<=t.byteLength)return t;const n=new ArrayBuffer(wx(e));return new Uint8Array(n).set(new Uint8Array(t),0),n},lne=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;const n=new ArrayBuffer(e,{maxByteLength:wx(e)});return new Uint8Array(n).set(new Uint8Array(t),0),n},wx=t=>bx**Math.ceil(Math.log(t)/Math.log(bx)),bx=2,dne=({contents:t,length:e})=>Dx()?t:t.slice(0,e),Dx=()=>"resize"in ArrayBuffer.prototype,fne={init:ine,convertChunk:{string:sne,buffer:yx,arrayBuffer:yx,dataView:vx,typedArray:vx,others:mx},getSize:gx,truncateChunk:ane,addChunk:cne,getFinalChunk:Jb,finalize:dne};async function pne(t,e){return Xb(t,vne,e)}const hne=()=>({contents:"",textDecoder:new TextDecoder}),Sm=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),mne=(t,{contents:e})=>e+t,gne=(t,e)=>t.slice(0,e),yne=({textDecoder:t})=>{const e=t.decode();return e===""?void 0:e},vne={init:hne,convertChunk:{string:lo,buffer:Sm,arrayBuffer:Sm,dataView:Sm,typedArray:Sm,others:mx},getSize:gx,truncateChunk:gne,addChunk:mne,getFinalChunk:yne,finalize:hx},wne=({error:t,stream:e,readableObjectMode:n,lines:r,encoding:i,fdNumber:s})=>{if(!(t instanceof Tm))throw t;if(s==="all")return t;const o=bne(n,r,i);throw t.maxBufferInfo={fdNumber:s,unit:o},e.destroy(),t},bne=(t,e,n)=>t?"objects":e?"lines":n==="buffer"?"bytes":"characters",Dne=(t,e,n)=>{if(e.length!==n)return;const r=new Tm;throw r.maxBufferInfo={fdNumber:"ipc"},r},Ene=(t,e)=>{const{streamName:n,threshold:r,unit:i}=Rne(t,e);return`Command's ${n} was larger than ${r} ${i}`},Rne=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};const{maxBufferInfo:{fdNumber:n,unit:r}}=t;delete t.maxBufferInfo;const i=Id(e,n);return n==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:iP(n),threshold:i,unit:r}},$ne=(t,e,n)=>t?.code==="ENOBUFS"&&e!==null&&e.some(r=>r!==null&&r.length>Zb(n)),Tne=(t,e,n)=>{if(!e)return t;const r=Zb(n);return t.length>r?t.slice(0,r):t},Zb=([,t])=>t,Sne=({stdio:t,all:e,ipcOutput:n,originalError:r,signal:i,signalDescription:s,exitCode:o,escapedCommand:a,timedOut:c,isCanceled:u,isGracefullyCanceled:l,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:h,maxBuffer:v,timeout:b,cwd:g})=>{const w=r?.code,R=kne({originalError:r,timedOut:c,timeout:b,isMaxBuffer:d,maxBuffer:v,errorCode:w,signal:i,signalDescription:s,exitCode:o,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:h}),k=Ane(r,g),A=k===void 0?"":`
1823
- ${k}`,N=`${R}: ${a}${A}`,_=e===void 0?[t[2],t[1]]:[e],B=[N,..._,...t.slice(3),n.map(z=>_ne(z)).join(`
1824
- `)].map(z=>bb(Vb(Pne(z)))).filter(Boolean).join(`
1825
-
1826
- `);return{originalMessage:k,shortMessage:N,message:B}},kne=({originalError:t,timedOut:e,timeout:n,isMaxBuffer:r,maxBuffer:i,errorCode:s,signal:o,signalDescription:a,exitCode:c,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{const h=Cne(d,f);return e?`Command timed out after ${n} milliseconds${h}`:l?o===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${h}`:`Command was gracefully canceled with ${o} (${a})`:u?`Command was canceled${h}`:r?`${Ene(t,i)}${h}`:s!==void 0?`Command failed with ${s}${h}`:d?`Command was killed with ${p} (${MP(p)})${h}`:o!==void 0?`Command was killed with ${o} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},Cne=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",Ane=(t,e)=>{if(t instanceof Od)return;const n=oee(t)?t.originalMessage:String(t?.message??t),r=bb(Ote(n,e));return r===""?void 0:r},_ne=t=>typeof t=="string"?t:Hd(t),Pne=t=>Array.isArray(t)?t.map(e=>Vb(Ex(e))).filter(Boolean).join(`
1827
- `):Ex(t),Ex=t=>typeof t=="string"?t:wr(t)?Q_(t):"",Rx=({command:t,escapedCommand:e,stdio:n,all:r,ipcOutput:i,options:{cwd:s},startTime:o})=>$x({command:t,escapedCommand:e,cwd:s,durationMs:mP(o),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:n[1],stderr:n[2],all:r,stdio:n,ipcOutput:i,pipedFrom:[]}),Qb=({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:o})=>e0({error:t,command:e,escapedCommand:n,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:r.length}),ipcOutput:[],options:i,isSync:o}),e0=({error:t,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:h,timeout:v=h,forceKillAfterDelay:b,killSignal:g,cwd:w,maxBuffer:R},isSync:k})=>{const{exitCode:A,signal:N,signalDescription:_}=Ine(u,l),{originalMessage:B,shortMessage:z,message:Q}=Sne({stdio:d,all:f,ipcOutput:p,originalError:t,signal:N,signalDescription:_,exitCode:A,escapedCommand:n,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:b,killSignal:g,maxBuffer:R,timeout:v,cwd:w}),I=see(t,Q,k);return Object.assign(I,xne({error:I,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:A,signal:N,signalDescription:_,stdio:d,all:f,ipcOutput:p,cwd:w,originalMessage:B,shortMessage:z})),I},xne=({error:t,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:d,stdio:f,all:p,ipcOutput:h,cwd:v,originalMessage:b,shortMessage:g})=>$x({shortMessage:g,originalMessage:b,command:e,escapedCommand:n,cwd:v,durationMs:mP(r),failed:!0,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isTerminated:l!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:h,pipedFrom:[]}),$x=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),Ine=(t,e)=>{const n=t===null?void 0:t,r=e===null?void 0:e,i=r===void 0?void 0:MP(e);return{exitCode:n,signal:r,signalDescription:i}},Tx=t=>Number.isFinite(t)?t:0;function Nne(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(Tx(t*1e3)%1e3),nanoseconds:Math.trunc(Tx(t*1e6)%1e3)}}function One(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function Fne(t){switch(typeof t){case"number":{if(Number.isFinite(t))return Nne(t);break}case"bigint":return One(t)}throw new TypeError("Expected a finite number or bigint")}const Lne=t=>t===0||t===0n,Mne=(t,e)=>e===1||e===1n?t:`${t}s`,Bne=1e-7,zne=24n*60n*60n*1000n;function Sx(t,e){const n=typeof t=="bigint";if(!n&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};const r=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[];const s=(l,d)=>{const f=Math.floor(l*10**d+Bne);return(Math.round(f)/10**d).toFixed(d)},o=(l,d,f,p)=>{if(!((i.length===0||!e.colonNotation)&&Lne(l)&&!(e.colonNotation&&f==="m"))){if(p??=String(l),e.colonNotation){const h=p.includes(".")?p.split(".")[0].length:p.length,v=i.length>0?2:1;p="0".repeat(Math.max(0,v-h))+p}else p+=e.verbose?" "+Mne(d,l):f;i.push(p)}},a=Fne(t),c=BigInt(a.days);if(e.hideYearAndDays?o(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?o(c,"day","d"):(o(c/365n,"year","y"),o(c%365n,"day","d")),o(Number(a.hours),"hour","h")),o(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3){const l=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),p=Number(a.nanoseconds);if(o(l,"second","s"),e.formatSubMilliseconds)o(d,"millisecond","ms"),o(f,"microsecond","\xB5s"),o(p,"nanosecond","ns");else{const h=d+f/1e3+p/1e6,v=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,b=h>=1?Math.round(h):Math.ceil(h),g=v?h.toFixed(v):b;o(Number.parseFloat(g),"millisecond","ms",g)}}else{const l=(n?Number(t%zne):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=s(l,d),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");o(Number.parseFloat(p),"second","s",p)}if(i.length===0)return r+"0"+(e.verbose?" milliseconds":"ms");const u=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),r+i.join(u)}const qne=(t,e)=>{t.failed&&Nd({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})},jne=(t,e)=>{mb(e)&&(qne(t,e),Une(t,e))},Une=(t,e)=>{const n=`(done in ${Sx(t.durationMs)})`;Nd({type:"duration",verboseMessage:n,verboseInfo:e,result:t})},t0=(t,e,{reject:n})=>{if(jne(t,e),t.failed&&n)throw t;return t},Gne=(t,e)=>Ra(t)?"asyncGenerator":Px(t)?"generator":r0(t)?"fileUrl":Xne(t)?"filePath":Qne(t)?"webStream":uo(t,{checkOpen:!1})?"native":wr(t)?"uint8Array":ere(t)?"asyncIterable":tre(t)?"iterable":s0(t)?kx({transform:t},e):Kne(t)?Wne(t,e):"native",Wne=(t,e)=>cx(t.transform,{checkOpen:!1})?Hne(t,e):s0(t.transform)?kx(t,e):Vne(t,e),Hne=(t,e)=>(Cx(t,e,"Duplex stream"),"duplex"),kx=(t,e)=>(Cx(t,e,"web TransformStream"),"webTransform"),Cx=({final:t,binary:e,objectMode:n},r,i)=>{Ax(t,`${r}.final`,i),Ax(e,`${r}.binary`,i),n0(n,`${r}.objectMode`)},Ax=(t,e,n)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${n}.`)},Vne=({transform:t,final:e,binary:n,objectMode:r},i)=>{if(t!==void 0&&!_x(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(cx(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(s0(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!_x(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return n0(n,`${i}.binary`),n0(r,`${i}.objectMode`),Ra(t)||Ra(e)?"asyncGenerator":"generator"},n0=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},_x=t=>Ra(t)||Px(t),Ra=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",Px=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",Kne=t=>un(t)&&(t.transform!==void 0||t.final!==void 0),r0=t=>Object.prototype.toString.call(t)==="[object URL]",Yne=t=>r0(t)&&t.protocol!=="file:",Xne=t=>un(t)&&Object.keys(t).length===1&&xx(t.file),xx=t=>typeof t=="string",Jne=(t,e)=>t==="native"&&typeof e=="string"&&!Zne.has(e),Zne=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Ix=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",i0=t=>Object.prototype.toString.call(t)==="[object WritableStream]",Qne=t=>Ix(t)||i0(t),s0=t=>Ix(t?.readable)&&i0(t?.writable),ere=t=>Nx(t)&&typeof t[Symbol.asyncIterator]=="function",tre=t=>Nx(t)&&typeof t[Symbol.iterator]=="function",Nx=t=>typeof t=="object"&&t!==null,fo=new Set(["generator","asyncGenerator","duplex","webTransform"]),Ox=new Set(["fileUrl","filePath","fileNumber"]),Fx=new Set(["fileUrl","filePath"]),nre=new Set([...Fx,"webStream","nodeStream"]),rre=new Set(["webTransform","duplex"]),km={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"},Lx=(t,e,n,r)=>r==="output"?ire(t,e,n):sre(t,e,n),ire=(t,e,n)=>{const r=e!==0&&n[e-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:t??r}},sre=(t,e,n)=>{const r=e===0?t===!0:n[e-1].value.readableObjectMode,i=e!==n.length-1&&(t??r);return{writableObjectMode:r,readableObjectMode:i}},ore=(t,e)=>{const n=t.findLast(({type:r})=>fo.has(r));return n===void 0?!1:e==="input"?n.value.writableObjectMode:n.value.readableObjectMode},are=(t,e,n,r)=>[...t.filter(({type:i})=>!fo.has(i)),...cre(t,e,n,r)],cre=(t,e,n,{encoding:r})=>{const i=t.filter(({type:o})=>fo.has(o)),s=Array.from({length:i.length});for(const[o,a]of Object.entries(i))s[o]=ure({stdioItem:a,index:Number(o),newTransforms:s,optionName:e,direction:n,encoding:r});return pre(s,n)},ure=({stdioItem:t,stdioItem:{type:e},index:n,newTransforms:r,optionName:i,direction:s,encoding:o})=>e==="duplex"?lre({stdioItem:t,optionName:i}):e==="webTransform"?dre({stdioItem:t,index:n,newTransforms:r,direction:s}):fre({stdioItem:t,index:n,newTransforms:r,direction:s,encoding:o}),lre=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:n,readableObjectMode:r},objectMode:i=r}},optionName:s})=>{if(i&&!r)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&r)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:n,readableObjectMode:r}}},dre=({stdioItem:t,stdioItem:{value:e},index:n,newTransforms:r,direction:i})=>{const{transform:s,objectMode:o}=un(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=Lx(o,n,r,i);return{...t,value:{transform:s,writableObjectMode:a,readableObjectMode:c}}},fre=({stdioItem:t,stdioItem:{value:e},index:n,newTransforms:r,direction:i,encoding:s})=>{const{transform:o,final:a,binary:c=!1,preserveNewlines:u=!1,objectMode:l}=un(e)?e:{transform:e},d=c||co.has(s),{writableObjectMode:f,readableObjectMode:p}=Lx(l,n,r,i);return{...t,value:{transform:o,final:a,binary:d,preserveNewlines:u,writableObjectMode:f,readableObjectMode:p}}},pre=(t,e)=>e==="input"?t.reverse():t,hre=(t,e,n)=>{const r=t.map(i=>mre(i,e));if(r.includes("input")&&r.includes("output"))throw new TypeError(`The \`${n}\` option must not be an array of both readable and writable values.`);return r.find(Boolean)??vre},mre=({type:t,value:e},n)=>gre[n]??Mx[t](e),gre=["input","output","output"],$a=()=>{},o0=()=>"input",Mx={generator:$a,asyncGenerator:$a,fileUrl:$a,filePath:$a,iterable:o0,asyncIterable:o0,uint8Array:o0,webStream:t=>i0(t)?"output":"input",nodeStream(t){return $m(t,{checkOpen:!1})?ax(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:$a,duplex:$a,native(t){const e=yre(t);if(e!==void 0)return e;if(uo(t,{checkOpen:!1}))return Mx.nodeStream(t)}},yre=t=>{if([0,ot.stdin].includes(t))return"input";if([1,2,ot.stdout,ot.stderr].includes(t))return"output"},vre="output",wre=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t,bre=({stdio:t,ipc:e,buffer:n,...r},i,s)=>{const o=Dre(t,r).map((a,c)=>Bx(a,c));return s?Rre(o,n,i):wre(o,e)},Dre=(t,e)=>{if(t===void 0)return Ur.map(r=>e[r]);if(Ere(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Ur.map(r=>`\`${r}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const n=Math.max(t.length,Ur.length);return Array.from({length:n},(r,i)=>t[i])},Ere=t=>Ur.some(e=>t[e]!==void 0),Bx=(t,e)=>Array.isArray(t)?t.map(n=>Bx(n,e)):t??(e>=Ur.length?"ignore":"pipe"),Rre=(t,e,n)=>t.map((r,i)=>!e[i]&&i!==0&&!gb(n,i)&&$re(r)?"ignore":r),$re=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe"),Tre=({stdioItem:t,stdioItem:{type:e},isStdioArray:n,fdNumber:r,direction:i,isSync:s})=>!n||e!=="native"?t:s?Sre({stdioItem:t,fdNumber:r,direction:i}):Are({stdioItem:t,fdNumber:r}),Sre=({stdioItem:t,stdioItem:{value:e,optionName:n},fdNumber:r,direction:i})=>{const s=kre({value:e,optionName:n,fdNumber:r,direction:i});if(s!==void 0)return s;if(uo(e,{checkOpen:!1}))throw new TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},kre=({value:t,optionName:e,fdNumber:n,direction:r})=>{const i=Cre(t,n);if(i!==void 0){if(r==="output")return{type:"fileNumber",value:i,optionName:e};if(M0.isatty(i))throw new TypeError(`The \`${e}: ${zb(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:xd(qm(i)),optionName:e}}},Cre=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;const n=hb.indexOf(t);if(n!==-1)return n},Are=({stdioItem:t,stdioItem:{value:e,optionName:n},fdNumber:r})=>e==="inherit"?{type:"nodeStream",value:zx(r,e,n),optionName:n}:typeof e=="number"?{type:"nodeStream",value:zx(e,e,n),optionName:n}:uo(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:n}:t,zx=(t,e,n)=>{const r=hb[t];if(r===void 0)throw new TypeError(`The \`${n}: ${e}\` option is invalid: no such standard stream.`);return r},_re=({input:t,inputFile:e},n)=>n===0?[...Pre(t),...Ire(e)]:[],Pre=t=>t===void 0?[]:[{type:xre(t),value:t,optionName:"input"}],xre=t=>{if($m(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(wr(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Ire=t=>t===void 0?[]:[{...Nre(t),optionName:"inputFile"}],Nre=t=>{if(r0(t))return{type:"fileUrl",value:t};if(xx(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")},Ore=t=>t.filter((e,n)=>t.every((r,i)=>e.value!==r.value||n>=i||e.type==="generator"||e.type==="asyncGenerator")),Fre=({stdioItem:{type:t,value:e,optionName:n},direction:r,fileDescriptors:i,isSync:s})=>{const o=Lre(i,t);if(o.length!==0){if(s){Mre({otherStdioItems:o,type:t,value:e,optionName:n,direction:r});return}if(nre.has(t))return qx({otherStdioItems:o,type:t,value:e,optionName:n,direction:r});rre.has(t)&&zre({otherStdioItems:o,type:t,value:e,optionName:n})}},Lre=(t,e)=>t.flatMap(({direction:n,stdioItems:r})=>r.filter(i=>i.type===e).map(i=>({...i,direction:n}))),Mre=({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})=>{Fx.has(e)&&qx({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})},qx=({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})=>{const s=t.filter(a=>Bre(a,n));if(s.length===0)return;const o=s.find(a=>a.direction!==i);return jx(o,r,e),i==="output"?s[0].stream:void 0},Bre=({type:t,value:e},n)=>t==="filePath"?e.file===n.file:t==="fileUrl"?e.href===n.href:e===n,zre=({otherStdioItems:t,type:e,value:n,optionName:r})=>{const i=t.find(({value:{transform:s}})=>s===n.transform);jx(i,r,e)},jx=(t,e,n)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${km[n]} that is the same.`)},Ux=(t,e,n,r)=>{const s=bre(e,n,r).map((a,c)=>qre({stdioOption:a,fdNumber:c,options:e,isSync:r})),o=Yre({initialFileDescriptors:s,addProperties:t,options:e,isSync:r});return e.stdio=o.map(({stdioItems:a})=>Zre(a)),o},qre=({stdioOption:t,fdNumber:e,options:n,isSync:r})=>{const i=iP(e),{stdioItems:s,isStdioArray:o}=jre({stdioOption:t,fdNumber:e,options:n,optionName:i}),a=hre(s,e,i),c=s.map(d=>Tre({stdioItem:d,isStdioArray:o,fdNumber:e,direction:a,isSync:r})),u=are(c,i,a,n),l=ore(u,a);return Kre(u,l),{direction:a,objectMode:l,stdioItems:u}},jre=({stdioOption:t,fdNumber:e,options:n,optionName:r})=>{const s=[...(Array.isArray(t)?t:[t]).map(c=>Ure(c,r)),..._re(n,e)],o=Ore(s),a=o.length>1;return Gre(o,a,r),Hre(o),{stdioItems:o,isStdioArray:a}},Ure=(t,e)=>({type:Gne(t,e),value:t,optionName:e}),Gre=(t,e,n)=>{if(t.length===0)throw new TypeError(`The \`${n}\` option must not be an empty array.`);if(e){for(const{value:r,optionName:i}of t)if(Wre.has(r))throw new Error(`The \`${i}\` option must not include \`${r}\`.`)}},Wre=new Set(["ignore","ipc"]),Hre=t=>{for(const e of t)Vre(e)},Vre=({type:t,value:e,optionName:n})=>{if(Yne(e))throw new TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
1828
- For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(Jne(t,e))throw new TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},Kre=(t,e)=>{if(!e)return;const n=t.find(({type:r})=>Ox.has(r));if(n!==void 0)throw new TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},Yre=({initialFileDescriptors:t,addProperties:e,options:n,isSync:r})=>{const i=[];try{for(const s of t)i.push(Xre({fileDescriptor:s,fileDescriptors:i,addProperties:e,options:n,isSync:r}));return i}catch(s){throw Gx(i),s}},Xre=({fileDescriptor:{direction:t,objectMode:e,stdioItems:n},fileDescriptors:r,addProperties:i,options:s,isSync:o})=>{const a=n.map(c=>Jre({stdioItem:c,addProperties:i,direction:t,options:s,fileDescriptors:r,isSync:o}));return{direction:t,objectMode:e,stdioItems:a}},Jre=({stdioItem:t,addProperties:e,direction:n,options:r,fileDescriptors:i,isSync:s})=>{const o=Fre({stdioItem:t,direction:n,fileDescriptors:i,isSync:s});return o!==void 0?{...t,stream:o}:{...t,...e[n][t.type](t,r)}},Gx=t=>{for(const{stdioItems:e}of t)for(const{stream:n}of e)n!==void 0&&!so(n)&&n.destroy()},Zre=t=>{if(t.length>1)return t.some(({value:r})=>r==="overlapped")?"overlapped":"pipe";const[{type:e,value:n}]=t;return e==="native"?n:"pipe"},Qre=(t,e)=>Ux(tie,t,e,!0),Gr=({type:t,optionName:e})=>{Wx(e,km[t])},eie=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&Wx(t,`"${e}"`),{}),Wx=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},Hx={generator(){},asyncGenerator:Gr,webStream:Gr,nodeStream:Gr,webTransform:Gr,duplex:Gr,asyncIterable:Gr,native:eie},tie={input:{...Hx,fileUrl:({value:t})=>({contents:[xd(qm(t))]}),filePath:({value:{file:t}})=>({contents:[xd(qm(t))]}),fileNumber:Gr,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...Hx,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t}})=>({path:t}),fileNumber:({value:t})=>({path:t}),iterable:Gr,string:Gr,uint8Array:Gr}},Ta=(t,{stripFinalNewline:e},n)=>Vx(e,n)&&t!==void 0&&!Array.isArray(t)?Vb(t):t,Vx=(t,e)=>e==="all"?t[1]||t[2]:t[e],Kx=(t,e,n,r)=>t||n?void 0:Jx(e,r),Yx=(t,e,n)=>n?t.flatMap(r=>Xx(r,e)):Xx(t,e),Xx=(t,e)=>{const{transform:n,final:r}=Jx(e,{});return[...n(t),...r()]},Jx=(t,e)=>(e.previousChunks="",{transform:nie.bind(void 0,e,t),final:iie.bind(void 0,e)}),nie=function*(t,e,n){if(typeof n!="string"){yield n;return}let{previousChunks:r}=t,i=-1;for(let s=0;s<n.length;s+=1)if(n[s]===`
1829
- `){const o=rie(n,s,e,t);let a=n.slice(i+1,s+1-o);r.length>0&&(a=a0(r,a),r=""),yield a,i=s}i!==n.length-1&&(r=a0(r,n.slice(i+1))),t.previousChunks=r},rie=(t,e,n,r)=>n?0:(r.isWindowsNewline=e!==0&&t[e-1]==="\r",r.isWindowsNewline?2:1),iie=function*({previousChunks:t}){t.length>0&&(yield t)},sie=({binary:t,preserveNewlines:e,readableObjectMode:n,state:r})=>t||e||n?void 0:{transform:oie.bind(void 0,r)},oie=function*({isWindowsNewline:t=!1},e){const{unixNewline:n,windowsNewline:r,LF:i,concatBytes:s}=typeof e=="string"?aie:uie;if(e.at(-1)===i){yield e;return}yield s(e,t?r:n)},a0=(t,e)=>`${t}${e}`,aie={windowsNewline:`\r
1830
- `,unixNewline:`
1831
- `,LF:`
1832
- `,concatBytes:a0},cie=(t,e)=>{const n=new Uint8Array(t.length+e.length);return n.set(t,0),n.set(e,t.length),n},uie={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:cie},lie=(t,e)=>t?void 0:die.bind(void 0,e),die=function*(t,e){if(typeof e!="string"&&!wr(e)&&!Ym.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},fie=(t,e)=>t?pie.bind(void 0,e):hie.bind(void 0,e),pie=function*(t,e){Zx(t,e),yield e},hie=function*(t,e){if(Zx(t,e),typeof e!="string"&&!wr(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},Zx=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
1833
- Instead, \`yield\` should either be called with a value, or not be called at all. For example:
1834
- if (condition) { yield value; }`)},Qx=(t,e,n)=>{if(n)return;if(t)return{transform:mie.bind(void 0,new TextEncoder)};const r=new Y0(e);return{transform:gie.bind(void 0,r),final:yie.bind(void 0,r)}},mie=function*(t,e){Ym.isBuffer(e)?yield xd(e):typeof e=="string"?yield t.encode(e):yield e},gie=function*(t,e){yield wr(e)?t.write(e):e},yie=function*(t){const e=t.end();e!==""&&(yield e)},eI=go(async(t,e,n,r)=>{e.currentIterable=t(...n);try{for await(const i of e.currentIterable)r.push(i)}finally{delete e.currentIterable}}),c0=async function*(t,e,n){if(n===e.length){yield t;return}const{transform:r=Die}=e[n];for await(const i of r(t))yield*c0(i,e,n+1)},vie=async function*(t){for(const[e,{final:n}]of Object.entries(t))yield*wie(n,Number(e),t)},wie=async function*(t,e,n){if(t!==void 0)for await(const r of t())yield*c0(r,n,e+1)},bie=go(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),Die=function*(t){yield t},tI=(t,e,n,r)=>{try{for(const i of t(...e))n.push(i);r()}catch(i){r(i)}},Eie=(t,e)=>[...e.flatMap(n=>[...Bd(n,t,0)]),...u0(t)],Bd=function*(t,e,n){if(n===e.length){yield t;return}const{transform:r=$ie}=e[n];for(const i of r(t))yield*Bd(i,e,n+1)},u0=function*(t){for(const[e,{final:n}]of Object.entries(t))yield*Rie(n,Number(e),t)},Rie=function*(t,e,n){if(t!==void 0)for(const r of t())yield*Bd(r,n,e+1)},$ie=function*(t){yield t},nI=({value:t,value:{transform:e,final:n,writableObjectMode:r,readableObjectMode:i},optionName:s},{encoding:o})=>{const a={},c=iI(t,o,s),u=Ra(e),l=Ra(n),d=u?eI.bind(void 0,c0,a):tI.bind(void 0,Bd),f=u||l?eI.bind(void 0,vie,a):tI.bind(void 0,u0),p=u||l?bie.bind(void 0,a):void 0;return{stream:new RN({writableObjectMode:r,writableHighWaterMark:Zd(r),readableObjectMode:i,readableHighWaterMark:Zd(i),transform(v,b,g){d([v,c,0],this,g)},flush(v){f([c],this,v)},destroy:p})}},rI=(t,e,n,r)=>{const i=e.filter(({type:o})=>o==="generator"),s=r?i.reverse():i;for(const{value:o,optionName:a}of s){const c=iI(o,n,a);t=Eie(c,t)}return t},iI=({transform:t,final:e,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:s},o,a)=>{const c={};return[{transform:lie(r,a)},Qx(n,o,r),Kx(n,s,r,c),{transform:t,final:e},{transform:fie(i,a)},sie({binary:n,preserveNewlines:s,readableObjectMode:i,state:c})].filter(Boolean)},Tie=(t,e)=>{for(const n of Sie(t))kie(t,n,e)},Sie=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),kie=(t,e,n)=>{const{stdioItems:r}=t[e],i=r.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){const[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${km[a]} with synchronous methods.`)}const o=i.map(({contents:a})=>a).map(a=>Cie(a,r));n.input=pb(o)},Cie=(t,e)=>{const n=rI(t,e,"utf8",!0);return Aie(n),pb(n)},Aie=t=>{const e=t.find(n=>typeof n!="string"&&!wr(n));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)},sI=({stdioItems:t,encoding:e,verboseInfo:n,fdNumber:r})=>r!=="all"&&gb(n,r)&&!co.has(e)&&_ie(r)&&(t.some(({type:i,value:s})=>i==="native"&&Pie.has(s))||t.every(({type:i})=>fo.has(i))),_ie=t=>t===1||t===2,Pie=new Set(["pipe","overlapped"]),xie=async(t,e,n,r)=>{for await(const i of t)Nie(e)||oI(i,n,r)},Iie=(t,e,n)=>{for(const r of t)oI(r,e,n)},Nie=t=>t._readableState.pipes.length>0,oI=(t,e,n)=>{const r=pP(t);Nd({type:"output",verboseMessage:r,fdNumber:e,verboseInfo:n})},Oie=({fileDescriptors:t,syncResult:{output:e},options:n,isMaxBuffer:r,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};const s={},o=new Set([]);return{output:e.map((c,u)=>Fie({result:c,fileDescriptors:t,fdNumber:u,state:s,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n)),...s}},Fie=({result:t,fileDescriptors:e,fdNumber:n,state:r,outputFiles:i,isMaxBuffer:s,verboseInfo:o},{buffer:a,encoding:c,lines:u,stripFinalNewline:l,maxBuffer:d})=>{if(t===null)return;const f=Tne(t,s,d),p=xd(f),{stdioItems:h,objectMode:v}=e[n],b=Lie([p],h,c,r),{serializedResult:g,finalResult:w=g}=Mie({chunks:b,objectMode:v,encoding:c,lines:u,stripFinalNewline:l,fdNumber:n});Bie({serializedResult:g,fdNumber:n,state:r,verboseInfo:o,encoding:c,stdioItems:h,objectMode:v});const R=a[n]?w:void 0;try{return r.error===void 0&&zie(g,h,i),R}catch(k){return r.error=k,R}},Lie=(t,e,n,r)=>{try{return rI(t,e,n,!1)}catch(i){return r.error=i,t}},Mie=({chunks:t,objectMode:e,encoding:n,lines:r,stripFinalNewline:i,fdNumber:s})=>{if(e)return{serializedResult:t};if(n==="buffer")return{serializedResult:pb(t)};const o=LZ(t,n);return r[s]?{serializedResult:o,finalResult:Yx(o,!i[s],e)}:{serializedResult:o}},Bie=({serializedResult:t,fdNumber:e,state:n,verboseInfo:r,encoding:i,stdioItems:s,objectMode:o})=>{if(!sI({stdioItems:s,encoding:i,verboseInfo:r,fdNumber:e}))return;const a=Yx(t,!1,o);try{Iie(a,e,r)}catch(c){n.error??=c}},zie=(t,e,n)=>{for(const{path:r}of e.filter(({type:i})=>Ox.has(i))){const i=typeof r=="string"?r:r.toString();n.has(i)?I2(r,t):(n.add(i),x0(r,t))}},qie=([,t,e],n)=>{if(n.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,Ta(e,n,"all")]:Array.isArray(e)?[Ta(t,n,"all"),...e]:wr(t)&&wr(e)?eP([t,e]):`${t}${e}`},jie=async(t,e)=>{const[n,r]=await Uie(t);return e.isForcefullyTerminated??=!1,[n,r]},Uie=async t=>{const[e,n]=await Promise.allSettled([Sn(t,"spawn"),Sn(t,"exit")]);return e.status==="rejected"?[]:n.status==="rejected"?aI(t):n.value},aI=async t=>{try{return await Sn(t,"exit")}catch{return aI(t)}},Gie=async t=>{const[e,n]=await t;if(!Wie(e,n)&&cI(e,n))throw new Od;return[e,n]},Wie=(t,e)=>t===void 0&&e===void 0,cI=(t,e)=>t!==0||e!==null,Hie=({error:t,status:e,signal:n,output:r},{maxBuffer:i})=>{const s=Vie(t,e,n),o=s?.code==="ETIMEDOUT",a=$ne(s,r,i);return{resultError:s,exitCode:e,signal:n,timedOut:o,isMaxBuffer:a}},Vie=(t,e,n)=>t!==void 0?t:cI(e,n)?new Od:void 0,Kie=(t,e,n)=>{const{file:r,commandArguments:i,command:s,escapedCommand:o,startTime:a,verboseInfo:c,options:u,fileDescriptors:l}=Yie(t,e,n),d=Zie({file:r,commandArguments:i,options:u,command:s,escapedCommand:o,verboseInfo:c,fileDescriptors:l,startTime:a});return t0(d,c,u)},Yie=(t,e,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:o}=gP(t,e,n),a=Xie(n),{file:c,commandArguments:u,options:l}=ix(t,e,a);Jie(l);const d=Qre(l,o);return{file:c,commandArguments:u,command:r,escapedCommand:i,startTime:s,verboseInfo:o,options:l,fileDescriptors:d}},Xie=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,Jie=({ipc:t,ipcInput:e,detached:n,cancelSignal:r})=>{e&&Cm("ipcInput"),t&&Cm("ipc: true"),n&&Cm("detached: true"),r&&Cm("cancelSignal")},Cm=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},Zie=({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,verboseInfo:s,fileDescriptors:o,startTime:a})=>{const c=Qie({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,fileDescriptors:o,startTime:a});if(c.failed)return c;const{resultError:u,exitCode:l,signal:d,timedOut:f,isMaxBuffer:p}=Hie(c,n),{output:h,error:v=u}=Oie({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:p,verboseInfo:s}),b=h.map((w,R)=>Ta(w,n,R)),g=Ta(qie(h,n),n,"all");return tse({error:v,exitCode:l,signal:d,timedOut:f,isMaxBuffer:p,stdio:b,all:g,options:n,command:r,escapedCommand:i,startTime:a})},Qie=({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,fileDescriptors:s,startTime:o})=>{try{Tie(s,n);const a=ese(n);return yN(t,e,a)}catch(a){return Qb({error:a,command:r,escapedCommand:i,fileDescriptors:s,options:n,startTime:o,isSync:!0})}},ese=({encoding:t,maxBuffer:e,...n})=>({...n,encoding:"buffer",maxBuffer:Zb(e)}),tse=({error:t,exitCode:e,signal:n,timedOut:r,isMaxBuffer:i,stdio:s,all:o,options:a,command:c,escapedCommand:u,startTime:l})=>t===void 0?Rx({command:c,escapedCommand:u,stdio:s,all:o,ipcOutput:[],options:a,startTime:l}):e0({error:t,command:c,escapedCommand:u,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:n,stdio:s,all:o,ipcOutput:[],options:a,startTime:l,isSync:!0}),nse=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},{reference:i=!0,filter:s}={})=>(Lb({methodName:"getOneMessage",isSubprocess:n,ipc:r,isConnected:YP(t)}),rse({anyProcess:t,channel:e,isSubprocess:n,filter:s,reference:i})),rse=async({anyProcess:t,channel:e,isSubprocess:n,filter:r,reference:i})=>{VP(e,i);const s=wm(t,e,n),o=new AbortController;try{return await Promise.race([ise(s,r,o),sse(s,n,o),ose(s,n,o)])}catch(a){throw Mb(t),a}finally{o.abort(),KP(e,i)}},ise=async(t,e,{signal:n})=>{if(e===void 0){const[r]=await Sn(t,"message",{signal:n});return r}for await(const[r]of Jd(t,"message",{signal:n}))if(e(r))return r},sse=async(t,e,{signal:n})=>{await Sn(t,"disconnect",{signal:n}),Nee(e)},ose=async(t,e,{signal:n})=>{const[r]=await Sn(t,"strict:error",{signal:n});throw jP(r,e)},ase=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},{reference:i=!0}={})=>uI({anyProcess:t,channel:e,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),uI=({anyProcess:t,channel:e,isSubprocess:n,ipc:r,shouldAwait:i,reference:s})=>{Lb({methodName:"getEachMessage",isSubprocess:n,ipc:r,isConnected:YP(t)}),VP(e,s);const o=wm(t,e,n),a=new AbortController,c={};return cse(t,o,a),use({ipcEmitter:o,isSubprocess:n,controller:a,state:c}),lse({anyProcess:t,channel:e,ipcEmitter:o,isSubprocess:n,shouldAwait:i,controller:a,state:c,reference:s})},cse=async(t,e,n)=>{try{await Sn(e,"disconnect",{signal:n.signal}),n.abort()}catch{}},use=async({ipcEmitter:t,isSubprocess:e,controller:n,state:r})=>{try{const[i]=await Sn(t,"strict:error",{signal:n.signal});r.error=jP(i,e),n.abort()}catch{}},lse=async function*({anyProcess:t,channel:e,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:s,state:o,reference:a}){try{for await(const[c]of Jd(n,"message",{signal:s.signal}))lI(o),yield c}catch{lI(o)}finally{s.abort(),KP(e,a),r||Mb(t),i&&await t}},lI=({error:t})=>{if(t)throw t},dse=(t,{ipc:e})=>{Object.assign(t,dI(t,!1,e))},fse=()=>{const t=ot,e=!0,n=ot.channel!==void 0;return{...dI(t,e,n),getCancelSignal:hte.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n})}},dI=(t,e,n)=>({sendMessage:JP.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n}),getOneMessage:nse.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n}),getEachMessage:ase.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n})}),pse=({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,verboseInfo:o})=>{Gx(r);const a=new K0;hse(a,r),Object.assign(a,{readable:mse,writable:gse,duplex:yse});const c=Qb({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:!1}),u=vse(c,o,i);return{subprocess:a,promise:u}},hse=(t,e)=>{const n=zd(),r=zd(),i=zd(),s=Array.from({length:e.length-3},zd),o=zd(),a=[n,r,i,...s];Object.assign(t,{stdin:n,stdout:r,stderr:i,all:o,stdio:a})},zd=()=>{const t=new Q0;return t.end(),t},mse=()=>new ys({read(){}}),gse=()=>new Vm({write(){}}),yse=()=>new Km({read(){},write(){}}),vse=async(t,e,n)=>t0(t,e,n),wse=(t,e)=>Ux(bse,t,e,!1),qd=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${km[t]}.`)},fI={fileNumber:qd,generator:nI,asyncGenerator:nI,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:n}}){const r=e||n;return{stream:Km.fromWeb(t,{objectMode:r})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},bse={input:{...fI,fileUrl:({value:t})=>({stream:I0(t)}),filePath:({value:{file:t}})=>({stream:I0(t)}),webStream:({value:t})=>({stream:ys.fromWeb(t)}),iterable:({value:t})=>({stream:ys.from(t)}),asyncIterable:({value:t})=>({stream:ys.from(t)}),string:({value:t})=>({stream:ys.from(t)}),uint8Array:({value:t})=>({stream:ys.from(Ym.from(t))})},output:{...fI,fileUrl:({value:t})=>({stream:N0(t)}),filePath:({value:{file:t}})=>({stream:N0(t)}),webStream:({value:t})=>({stream:Vm.fromWeb(t)}),iterable:qd,asyncIterable:qd,string:qd,uint8Array:qd}};function l0(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(const i of t)d0(i);const e=t.some(({readableObjectMode:i})=>i),n=Dse(t,e),r=new Ese({objectMode:e,writableHighWaterMark:n,readableHighWaterMark:n});for(const i of t)r.add(i);return r}const Dse=(t,e)=>{if(t.length===0)return Zd(e);const n=t.filter(({readableObjectMode:r})=>r===e).map(({readableHighWaterMark:r})=>r);return Math.max(...n)};class Ese extends Q0{#e=new Set([]);#t=new Set([]);#n=new Set([]);#r;#s=Symbol("unpipe");#i=new WeakMap;add(e){if(d0(e),this.#e.has(e))return;this.#e.add(e),this.#r??=Rse(this,this.#e,this.#s);const n=Sse({passThroughStream:this,stream:e,streams:this.#e,ended:this.#t,aborted:this.#n,onFinished:this.#r,unpipeEvent:this.#s});this.#i.set(e,n),e.pipe(this,{end:!1})}async remove(e){if(d0(e),!this.#e.has(e))return!1;const n=this.#i.get(e);return n===void 0?!1:(this.#i.delete(e),e.unpipe(this),await n,!0)}}const Rse=async(t,e,n)=>{Am(t,gI);const r=new AbortController;try{await Promise.race([$se(t,r),Tse(t,e,n,r)])}finally{r.abort(),Am(t,-gI)}},$se=async(t,{signal:e})=>{try{await ki(t,{signal:e,cleanup:!0})}catch(n){throw pI(t,n),n}},Tse=async(t,e,n,{signal:r})=>{for await(const[i]of Jd(t,"unpipe",{signal:r}))e.has(i)&&i.emit(n)},d0=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},Sse=async({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,onFinished:s,unpipeEvent:o})=>{Am(t,yI);const a=new AbortController;try{await Promise.race([kse(s,e,a),Cse({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,controller:a}),Ase({stream:e,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:a})])}finally{a.abort(),Am(t,-yI)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?f0(t):_se(t))},kse=async(t,e,{signal:n})=>{try{await t,n.aborted||f0(e)}catch(r){n.aborted||pI(e,r)}},Cse=async({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,controller:{signal:s}})=>{try{await ki(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),n.has(e)&&r.add(e)}catch(o){if(s.aborted||!n.has(e))return;hI(o)?i.add(e):mI(t,o)}},Ase=async({stream:t,streams:e,ended:n,aborted:r,unpipeEvent:i,controller:{signal:s}})=>{if(await Sn(t,i,{signal:s}),!t.readable)return Sn(s,"abort",{signal:s});e.delete(t),n.delete(t),r.delete(t)},_se=t=>{t.writable&&t.end()},pI=(t,e)=>{hI(e)?f0(t):mI(t,e)},hI=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",f0=t=>{(t.readable||t.writable)&&t.destroy()},mI=(t,e)=>{t.destroyed||(t.once("error",Pse),t.destroy(e))},Pse=()=>{},Am=(t,e)=>{const n=t.getMaxListeners();n!==0&&n!==Number.POSITIVE_INFINITY&&t.setMaxListeners(n+e)},gI=2,yI=1,_m=(t,e)=>{t.pipe(e),xse(t,e),Ise(t,e)},xse=async(t,e)=>{if(!(so(t)||so(e))){try{await ki(t,{cleanup:!0,readable:!0,writable:!1})}catch{}vI(e)}},vI=t=>{t.writable&&t.end()},Ise=async(t,e)=>{if(!(so(t)||so(e))){try{await ki(e,{cleanup:!0,readable:!1,writable:!0})}catch{}wI(t)}},wI=t=>{t.readable&&t.destroy()},Nse=(t,e,n)=>{const r=new Map;for(const[i,{stdioItems:s,direction:o}]of Object.entries(e)){for(const{stream:a}of s.filter(({type:c})=>fo.has(c)))Ose(t,a,o,i);for(const{stream:a}of s.filter(({type:c})=>!fo.has(c)))Lse({subprocess:t,stream:a,direction:o,fdNumber:i,pipeGroups:r,controller:n})}for(const[i,s]of r.entries()){const o=s.length===1?s[0]:l0(s);_m(o,i)}},Ose=(t,e,n,r)=>{n==="output"?_m(t.stdio[r],e):_m(e,t.stdio[r]);const i=Fse[r];i!==void 0&&(t[i]=e),t.stdio[r]=e},Fse=["stdin","stdout","stderr"],Lse=({subprocess:t,stream:e,direction:n,fdNumber:r,pipeGroups:i,controller:s})=>{if(e===void 0)return;Mse(e,s);const[o,a]=n==="output"?[e,t.stdio[r]]:[t.stdio[r],e],c=i.get(o)??[];i.set(o,[...c,a])},Mse=(t,{signal:e})=>{so(t)&&ym(t,Bse,e)},Bse=2,Sa=[];Sa.push("SIGHUP","SIGINT","SIGTERM"),process.platform!=="win32"&&Sa.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&Sa.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const Pm=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",p0=Symbol.for("signal-exit emitter"),h0=globalThis,zse=Object.defineProperty.bind(Object);class qse{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(h0[p0])return h0[p0];zse(h0,p0,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,n){this.listeners[e].push(n)}removeListener(e,n){const r=this.listeners[e],i=r.indexOf(n);i!==-1&&(i===0&&r.length===1?r.length=0:r.splice(i,1))}emit(e,n,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(const s of this.listeners[e])i=s(n,r)===!0||i;return e==="exit"&&(i=this.emit("afterExit",n,r)||i),i}}class bI{}const jse=t=>({onExit(e,n){return t.onExit(e,n)},load(){return t.load()},unload(){return t.unload()}});class Use extends bI{onExit(){return()=>{}}load(){}unload(){}}class Gse extends bI{#e=m0.platform==="win32"?"SIGINT":"SIGHUP";#t=new qse;#n;#r;#s;#i={};#o=!1;constructor(e){super(),this.#n=e,this.#i={};for(const n of Sa)this.#i[n]=()=>{const r=this.#n.listeners(n);let{count:i}=this.#t;const s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(i+=s.__signal_exit_emitter__.count),r.length===i){this.unload();const o=this.#t.emit("exit",null,n),a=n==="SIGHUP"?this.#e:n;o||e.kill(e.pid,a)}};this.#s=e.reallyExit,this.#r=e.emit}onExit(e,n){if(!Pm(this.#n))return()=>{};this.#o===!1&&this.load();const r=n?.alwaysLast?"afterExit":"exit";return this.#t.on(r,e),()=>{this.#t.removeListener(r,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(const e of Sa)try{const n=this.#i[e];n&&this.#n.on(e,n)}catch{}this.#n.emit=(e,...n)=>this.#c(e,...n),this.#n.reallyExit=e=>this.#a(e)}}unload(){this.#o&&(this.#o=!1,Sa.forEach(e=>{const n=this.#i[e];if(!n)throw new Error("Listener not defined for signal: "+e);try{this.#n.removeListener(e,n)}catch{}}),this.#n.emit=this.#r,this.#n.reallyExit=this.#s,this.#t.count-=1)}#a(e){return Pm(this.#n)?(this.#n.exitCode=e||0,this.#t.emit("exit",this.#n.exitCode,null),this.#s.call(this.#n,this.#n.exitCode)):0}#c(e,...n){const r=this.#r;if(e==="exit"&&Pm(this.#n)){typeof n[0]=="number"&&(this.#n.exitCode=n[0]);const i=r.call(this.#n,e,...n);return this.#t.emit("exit",this.#n.exitCode,null),i}else return r.call(this.#n,e,...n)}}const m0=globalThis.process,{onExit:Wse,load:$le,unload:Tle}=jse(Pm(m0)?new Gse(m0):new Use),Hse=(t,{cleanup:e,detached:n},{signal:r})=>{if(!e||n)return;const i=Wse(()=>{t.kill()});Z0(r,()=>{i()})},Vse=({source:t,sourcePromise:e,boundOptions:n,createNested:r},...i)=>{const s=hP(),{destination:o,destinationStream:a,destinationError:c,from:u,unpipeSignal:l}=Kse(n,r,i),{sourceStream:d,sourceError:f}=Xse(t,u),{options:p,fileDescriptors:h}=ao.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:o,destinationStream:a,destinationError:c,unpipeSignal:l,fileDescriptors:h,startTime:s}},Kse=(t,e,n)=>{try{const{destination:r,pipeOptions:{from:i,to:s,unpipeSignal:o}={}}=Yse(t,e,...n),a=UP(r,s);return{destination:r,destinationStream:a,from:i,unpipeSignal:o}}catch(r){return{destinationError:r}}},Yse=(t,e,n,...r)=>{if(Array.isArray(n))return{destination:e(DI,t)(n,...r),pipeOptions:t};if(typeof n=="string"||n instanceof URL){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');const[i,s,o]=X_(n,...r);return{destination:e(DI)(i,s,o),pipeOptions:o}}if(ao.has(n)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:r[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},DI=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),Xse=(t,e)=>{try{return{sourceStream:Bb(t,e)}}catch(n){return{sourceError:n}}},Jse=({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:s,startTime:o})=>{const a=Zse({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r});if(a!==void 0)throw EI({error:a,fileDescriptors:i,sourceOptions:s,startTime:o})},Zse=({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r})=>{if(e!==void 0&&r!==void 0)return r;if(r!==void 0)return wI(t),r;if(e!==void 0)return vI(n),e},EI=({error:t,fileDescriptors:e,sourceOptions:n,startTime:r})=>Qb({error:t,command:RI,escapedCommand:RI,fileDescriptors:e,options:n,startTime:r,isSync:!1}),RI="source.pipe(destination)",Qse=async t=>{const[{status:e,reason:n,value:r=n},{status:i,reason:s,value:o=s}]=await t;if(o.pipedFrom.includes(r)||o.pipedFrom.push(r),i==="rejected")throw o;if(e==="rejected")throw r;return o},eoe=(t,e,n)=>{const r=xm.has(e)?noe(t,e):toe(t,e);return ym(t,ioe,n.signal),ym(e,soe,n.signal),roe(e),r},toe=(t,e)=>{const n=l0([t]);return _m(n,e),xm.set(e,n),n},noe=(t,e)=>{const n=xm.get(e);return n.add(t),n},roe=async t=>{try{await ki(t,{cleanup:!0,readable:!1,writable:!0})}catch{}xm.delete(t)},xm=new WeakMap,ioe=2,soe=1,ooe=(t,e)=>t===void 0?[]:[aoe(t,e)],aoe=async(t,{sourceStream:e,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:s})=>{await U2(t,e),await n.remove(e);const o=new Error("Pipe canceled by `unpipeSignal` option.");throw EI({error:o,fileDescriptors:r,sourceOptions:i,startTime:s})},g0=(t,...e)=>{if(un(e[0]))return g0.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});const{destination:n,...r}=Vse(t,...e),i=coe({...r,destination:n});return i.pipe=g0.bind(void 0,{...t,source:n,sourcePromise:i,boundOptions:{}}),i},coe=async({sourcePromise:t,sourceStream:e,sourceOptions:n,sourceError:r,destination:i,destinationStream:s,destinationError:o,unpipeSignal:a,fileDescriptors:c,startTime:u})=>{const l=uoe(t,i);Jse({sourceStream:e,sourceError:r,destinationStream:s,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:u});const d=new AbortController;try{const f=eoe(e,s,d);return await Promise.race([Qse(l),...ooe(a,{sourceStream:e,mergedStream:f,sourceOptions:n,fileDescriptors:c,startTime:u})])}finally{d.abort()}},uoe=(t,e)=>Promise.allSettled([t,e]),$I=({subprocessStdout:t,subprocess:e,binary:n,shouldEncode:r,encoding:i,preserveNewlines:s})=>{const o=new AbortController;return loe(e,o),SI({stream:t,controller:o,binary:n,shouldEncode:!t.readableObjectMode&&r,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},loe=async(t,e)=>{try{await t}catch{}finally{e.abort()}},TI=({stream:t,onStreamEnd:e,lines:n,encoding:r,stripFinalNewline:i,allMixed:s})=>{const o=new AbortController;doe(e,o,t);const a=t.readableObjectMode&&!s;return SI({stream:t,controller:o,binary:r==="buffer",shouldEncode:!a,encoding:r,shouldSplit:!a&&n,preserveNewlines:!i})},doe=async(t,e,n)=>{try{await t}catch{n.destroy()}finally{e.abort()}},SI=({stream:t,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o})=>{const a=Jd(t,"data",{signal:e.signal,highWaterMark:CI,highWatermark:CI});return foe({onStdoutChunk:a,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o})},kI=Zd(!0),CI=kI,foe=async function*({onStdoutChunk:t,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o}){const a=poe({binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o});try{for await(const[c]of t)yield*Bd(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*u0(a)}},poe=({binary:t,shouldEncode:e,encoding:n,shouldSplit:r,preserveNewlines:i})=>[Qx(t,n,!e),Kx(t,i,!r,{})].filter(Boolean),hoe=async({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,buffer:i,maxBuffer:s,lines:o,allMixed:a,stripFinalNewline:c,verboseInfo:u,streamInfo:l})=>{const d=moe({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,allMixed:a,verboseInfo:u,streamInfo:l});if(!i){await Promise.all([goe(t),d]);return}const f=Vx(c,n),p=TI({stream:t,onStreamEnd:e,lines:o,encoding:r,stripFinalNewline:f,allMixed:a}),[h]=await Promise.all([yoe({stream:t,iterable:p,fdNumber:n,encoding:r,maxBuffer:s,lines:o}),d]);return h},moe=async({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,allMixed:i,verboseInfo:s,streamInfo:{fileDescriptors:o}})=>{if(!sI({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:s,fdNumber:n}))return;const a=TI({stream:t,onStreamEnd:e,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i});await xie(a,t,n,s)},goe=async t=>{await wN(),t.readableFlowing===null&&t.resume()},yoe=async({stream:t,stream:{readableObjectMode:e},iterable:n,fdNumber:r,encoding:i,maxBuffer:s,lines:o})=>{try{return e||o?await Zte(n,{maxBuffer:s}):i==="buffer"?new Uint8Array(await rne(n,{maxBuffer:s})):await pne(n,{maxBuffer:s})}catch(a){return _I(wne({error:a,stream:t,readableObjectMode:e,lines:o,encoding:i,fdNumber:r}))}},AI=async t=>{try{return await t}catch(e){return _I(e)}},_I=({bufferedData:t})=>NZ(t)?new Uint8Array(t):t,y0=async(t,e,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{const s=voe(t,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],ki(t,{cleanup:!0,signal:o.signal})])}catch(a){s.stdinCleanedUp||Doe(a,e,n,r)}finally{o.abort()}},voe=(t,{originalStreams:[e],subprocess:n})=>{const r={stdinCleanedUp:!1};return t===e&&woe(t,n,r),r},woe=(t,e,n)=>{const{_destroy:r}=t;t._destroy=(...i)=>{boe(e,n),r.call(t,...i)}},boe=({exitCode:t,signalCode:e},n)=>{(t!==null||e!==null)&&(n.stdinCleanedUp=!0)},Doe=(t,e,n,r)=>{if(!Eoe(t,e,n,r))throw t},Eoe=(t,e,n,r=!0)=>n.propagating?xI(t)||v0(t):(n.propagating=!0,PI(n,e)===r?xI(t):v0(t)),PI=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",v0=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",xI=t=>t?.code==="EPIPE",Roe=({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>t.stdio.map((c,u)=>II({stream:c,fdNumber:u,encoding:e,buffer:n[u],maxBuffer:r[u],lines:i[u],allMixed:!1,stripFinalNewline:s,verboseInfo:o,streamInfo:a})),II=async({stream:t,fdNumber:e,encoding:n,buffer:r,maxBuffer:i,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:c,streamInfo:u})=>{if(!t)return;const l=y0(t,e,u);if(PI(u,e)){await l;return}const[d]=await Promise.all([hoe({stream:t,onStreamEnd:l,fdNumber:e,encoding:n,buffer:r,maxBuffer:i,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:c,streamInfo:u}),l]);return d},$oe=({stdout:t,stderr:e},{all:n})=>n&&(t||e)?l0([t,e].filter(Boolean)):void 0,Toe=({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>II({...Soe(t,n),fdNumber:"all",encoding:e,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:koe(t),stripFinalNewline:s,verboseInfo:o,streamInfo:a}),Soe=({stdout:t,stderr:e,all:n},[,r,i])=>{const s=r||i;return s?r?i?{stream:n,buffer:s}:{stream:t,buffer:s}:{stream:e,buffer:s}:{stream:n,buffer:s}},koe=({all:t,stdout:e,stderr:n})=>t&&e&&n&&e.readableObjectMode!==n.readableObjectMode,Coe=t=>gb(t,"ipc"),Aoe=(t,e)=>{const n=pP(t);Nd({type:"ipc",verboseMessage:n,fdNumber:"ipc",verboseInfo:e})},_oe=async({subprocess:t,buffer:e,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:s})=>{if(!r)return i;const o=Coe(s),a=Id(e,"ipc"),c=Id(n,"ipc");for await(const u of uI({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))a&&(Dne(t,i,c),i.push(u)),o&&Aoe(u,s);return i},Poe=async(t,e)=>(await Promise.allSettled([t]),e),xoe=async({subprocess:t,options:{encoding:e,buffer:n,maxBuffer:r,lines:i,timeoutDuration:s,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:u,ipc:l,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:h,originalStreams:v,onInternalError:b,controller:g})=>{const w=jie(t,f),R={originalStreams:v,fileDescriptors:h,subprocess:t,exitPromise:w,propagating:!1},k=Roe({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:u,verboseInfo:p,streamInfo:R}),A=Toe({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:u,verboseInfo:p,streamInfo:R}),N=[],_=_oe({subprocess:t,buffer:n,maxBuffer:r,ipc:l,ipcOutput:N,verboseInfo:p}),B=Ioe(v,t,R),z=Noe(h,R);try{return await Promise.race([Promise.all([{},Gie(w),Promise.all(k),A,_,_te(t,d),...B,...z]),b,Ooe(t,g),...Ete(t,s,f,g),...Pee({subprocess:t,cancelSignal:o,gracefulCancel:a,context:f,controller:g}),...vte({subprocess:t,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:g})])}catch(Q){return f.terminationReason??="other",Promise.all([{error:Q},w,Promise.all(k.map(I=>AI(I))),AI(A),Poe(_,N),Promise.allSettled(B),Promise.allSettled(z)])}},Ioe=(t,e,n)=>t.map((r,i)=>r===e.stdio[i]?void 0:y0(r,i,n)),Noe=(t,e)=>t.flatMap(({stdioItems:n},r)=>n.filter(({value:i,stream:s=i})=>uo(s,{checkOpen:!1})&&!so(s)).map(({type:i,value:s,stream:o=s})=>y0(o,r,e,{isSameDirection:fo.has(i),stopOnExit:i==="native"}))),Ooe=async(t,{signal:e})=>{const[n]=await Sn(t,"error",{signal:e});throw n},Foe=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),w0=(t,e,n)=>{const r=t[n];r.has(e)||r.set(e,[]);const i=r.get(e),s=Fd();return i.push(s),{resolve:s.resolve.bind(s),promises:i}},Im=async({resolve:t,promises:e},n)=>{t();const[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...e])]);return!r},NI=async t=>{if(t!==void 0)try{await OI(t)}catch{}},Loe=async t=>{if(t!==void 0)try{await FI(t)}catch{}},OI=async t=>{await ki(t,{cleanup:!0,readable:!1,writable:!0})},FI=async t=>{await ki(t,{cleanup:!0,readable:!0,writable:!1})},LI=async(t,e)=>{if(await t,e)throw e},MI=(t,e,n)=>{n&&!v0(n)?t.destroy(n):e&&t.destroy()},Moe=({subprocess:t,concurrentStreams:e,encoding:n},{from:r,binary:i=!0,preserveNewlines:s=!0}={})=>{const o=i||co.has(n),{subprocessStdout:a,waitReadableDestroy:c}=BI(t,r,e),{readableEncoding:u,readableObjectMode:l,readableHighWaterMark:d}=zI(a,o),{read:f,onStdoutDataDone:p}=qI({subprocessStdout:a,subprocess:t,binary:o,encoding:n,preserveNewlines:s}),h=new ys({read:f,destroy:go(UI.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:l,encoding:u});return jI({subprocessStdout:a,onStdoutDataDone:p,readable:h,subprocess:t}),h},BI=(t,e,n)=>{const r=Bb(t,e),i=w0(n,r,"readableDestroy");return{subprocessStdout:r,waitReadableDestroy:i}},zI=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:n},r)=>r?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:n}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:kI},qI=({subprocessStdout:t,subprocess:e,binary:n,encoding:r,preserveNewlines:i})=>{const s=Fd(),o=$I({subprocessStdout:t,subprocess:e,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){Boe(this,o,s)},onStdoutDataDone:s}},Boe=async(t,e,n)=>{try{const{value:r,done:i}=await e.next();i?n.resolve():t.push(r)}catch{}},jI=async({subprocessStdout:t,onStdoutDataDone:e,readable:n,subprocess:r,subprocessStdin:i})=>{try{await FI(t),await r,await NI(i),await e,n.readable&&n.push(null)}catch(s){await NI(i),GI(n,s)}},UI=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:n},r)=>{await Im(n,e)&&(GI(t,r),await LI(e,r))},GI=(t,e)=>{MI(t,t.readable,e)},zoe=({subprocess:t,concurrentStreams:e},{to:n}={})=>{const{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}=WI(t,n,e),o=new Vm({...HI(r,t,i),destroy:go(KI.bind(void 0,{subprocessStdin:r,subprocess:t,waitWritableFinal:i,waitWritableDestroy:s})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return VI(r,o),o},WI=(t,e,n)=>{const r=UP(t,e),i=w0(n,r,"writableFinal"),s=w0(n,r,"writableDestroy");return{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}},HI=(t,e,n)=>({write:qoe.bind(void 0,t),final:go(joe.bind(void 0,t,e,n))}),qoe=(t,e,n,r)=>{t.write(e,n)?r():t.once("drain",r)},joe=async(t,e,n)=>{await Im(n,e)&&(t.writable&&t.end(),await e)},VI=async(t,e,n)=>{try{await OI(t),e.writable&&e.end()}catch(r){await Loe(n),YI(e,r)}},KI=async({subprocessStdin:t,subprocess:e,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await Im(n,e),await Im(r,e)&&(YI(t,i),await LI(e,i))},YI=(t,e)=>{MI(t,t.writable,e)},Uoe=({subprocess:t,concurrentStreams:e,encoding:n},{from:r,to:i,binary:s=!0,preserveNewlines:o=!0}={})=>{const a=s||co.has(n),{subprocessStdout:c,waitReadableDestroy:u}=BI(t,r,e),{subprocessStdin:l,waitWritableFinal:d,waitWritableDestroy:f}=WI(t,i,e),{readableEncoding:p,readableObjectMode:h,readableHighWaterMark:v}=zI(c,a),{read:b,onStdoutDataDone:g}=qI({subprocessStdout:c,subprocess:t,binary:a,encoding:n,preserveNewlines:o}),w=new Km({read:b,...HI(l,t,d),destroy:go(Goe.bind(void 0,{subprocessStdout:c,subprocessStdin:l,subprocess:t,waitReadableDestroy:u,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:v,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:h,writableObjectMode:l.writableObjectMode,encoding:p});return jI({subprocessStdout:c,onStdoutDataDone:g,readable:w,subprocess:t,subprocessStdin:l}),VI(l,w,c),w},Goe=async({subprocessStdout:t,subprocessStdin:e,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:s},o)=>{await Promise.all([UI({subprocessStdout:t,subprocess:n,waitReadableDestroy:r},o),KI({subprocessStdin:e,subprocess:n,waitWritableFinal:i,waitWritableDestroy:s},o)])},XI=(t,e,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{const s=r||co.has(e),o=Bb(t,n),a=$I({subprocessStdout:o,subprocess:t,binary:s,shouldEncode:!0,encoding:e,preserveNewlines:i});return Woe(a,o,t)},Woe=async function*(t,e,n){try{yield*t}finally{e.readable&&e.destroy(),await n}},Hoe=(t,{encoding:e})=>{const n=Foe();t.readable=Moe.bind(void 0,{subprocess:t,concurrentStreams:n,encoding:e}),t.writable=zoe.bind(void 0,{subprocess:t,concurrentStreams:n}),t.duplex=Uoe.bind(void 0,{subprocess:t,concurrentStreams:n,encoding:e}),t.iterable=XI.bind(void 0,t,e),t[Symbol.asyncIterator]=XI.bind(void 0,t,e,{})},Voe=(t,e)=>{for(const[n,r]of Yoe){const i=r.value.bind(e);Reflect.defineProperty(t,n,{...r,value:i})}},Koe=(async()=>{})().constructor.prototype,Yoe=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(Koe,t)]),Xoe=(t,e,n,r)=>{const{file:i,commandArguments:s,command:o,escapedCommand:a,startTime:c,verboseInfo:u,options:l,fileDescriptors:d}=Joe(t,e,n),{subprocess:f,promise:p}=Qoe({file:i,commandArguments:s,options:l,startTime:c,verboseInfo:u,command:o,escapedCommand:a,fileDescriptors:d});return f.pipe=g0.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:r}),Voe(f,p),ao.set(f,{options:l,fileDescriptors:d}),f},Joe=(t,e,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:o}=gP(t,e,n),{file:a,commandArguments:c,options:u}=ix(t,e,n),l=Zoe(u),d=wse(l,o);return{file:a,commandArguments:c,command:r,escapedCommand:i,startTime:s,verboseInfo:o,options:l,fileDescriptors:d}},Zoe=({timeout:t,signal:e,...n})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...n,timeoutDuration:t}},Qoe=({file:t,commandArguments:e,options:n,startTime:r,verboseInfo:i,command:s,escapedCommand:o,fileDescriptors:a})=>{let c;try{c=vN(t,e,n)}catch(h){return pse({error:h,command:s,escapedCommand:o,fileDescriptors:a,options:n,startTime:r,verboseInfo:i})}const u=new AbortController;DN(Number.POSITIVE_INFINITY,u.signal);const l=[...c.stdio];Nse(c,a,u),Hse(c,n,u);const d={},f=Fd();c.kill=See.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:f,context:d,controller:u}),c.all=$oe(c,n),Hoe(c,n),dse(c,n);const p=eae({subprocess:c,options:n,startTime:r,verboseInfo:i,fileDescriptors:a,originalStreams:l,command:s,escapedCommand:o,context:d,onInternalError:f,controller:u});return{subprocess:c,promise:p}},eae=async({subprocess:t,options:e,startTime:n,verboseInfo:r,fileDescriptors:i,originalStreams:s,command:o,escapedCommand:a,context:c,onInternalError:u,controller:l})=>{const[d,[f,p],h,v,b]=await xoe({subprocess:t,options:e,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:s,onInternalError:u,controller:l});l.abort(),u.resolve();const g=h.map((k,A)=>Ta(k,e,A)),w=Ta(v,e,"all"),R=tae({errorInfo:d,exitCode:f,signal:p,stdio:g,all:w,ipcOutput:b,context:c,options:e,command:o,escapedCommand:a,startTime:n});return t0(R,r,e)},tae=({errorInfo:t,exitCode:e,signal:n,stdio:r,all:i,ipcOutput:s,context:o,options:a,command:c,escapedCommand:u,startTime:l})=>"error"in t?e0({error:t.error,command:c,escapedCommand:u,timedOut:o.terminationReason==="timeout",isCanceled:o.terminationReason==="cancel"||o.terminationReason==="gracefulCancel",isGracefullyCanceled:o.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Tm,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:e,signal:n,stdio:r,all:i,ipcOutput:s,options:a,startTime:l,isSync:!1}):Rx({command:c,escapedCommand:u,stdio:r,all:i,ipcOutput:s,options:a,startTime:l}),b0=(t,e)=>{const n=Object.fromEntries(Object.entries(e).map(([r,i])=>[r,nae(r,t[r],i)]));return{...t,...n}},nae=(t,e,n)=>rae.has(t)&&un(e)&&un(n)?{...e,...n}:n,rae=new Set(["env",...cP]),po=(t,e,n,r)=>{const i=(o,a,c)=>po(o,a,n,c),s=(...o)=>iae({mapArguments:t,deepOptions:n,boundOptions:e,setBoundExeca:r,createNested:i},...o);return r!==void 0&&r(s,i,e),s},iae=({mapArguments:t,deepOptions:e={},boundOptions:n={},setBoundExeca:r,createNested:i},s,...o)=>{if(un(s))return i(t,b0(n,s),r);const{file:a,commandArguments:c,options:u,isSync:l}=sae({mapArguments:t,firstArgument:s,nextArguments:o,deepOptions:e,boundOptions:n});return l?Kie(a,c,u):Xoe(a,c,u,i)},sae=({mapArguments:t,firstArgument:e,nextArguments:n,deepOptions:r,boundOptions:i})=>{const s=qZ(e)?jZ(e,n):[e,...n],[o,a,c]=X_(...s),u=b0(b0(r,i),c),{file:l=o,commandArguments:d=a,options:f=u,isSync:p=!1}=t({file:o,commandArguments:a,options:u});return{file:l,commandArguments:d,options:f,isSync:p}},oae=({file:t,commandArguments:e})=>JI(t,e),aae=({file:t,commandArguments:e})=>({...JI(t,e),isSync:!0}),JI=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);const[n,...r]=cae(t);return{file:n,commandArguments:r}},cae=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);const e=t.trim();if(e==="")return[];const n=[];for(const r of e.split(uae)){const i=n.at(-1);i&&i.endsWith("\\")?n[n.length-1]=`${i.slice(0,-1)} ${r}`:n.push(r)}return n},uae=/ +/g,lae=(t,e,n)=>{t.sync=e(fae,n),t.s=t.sync},dae=({options:t})=>ZI(t),fae=({options:t})=>({...ZI(t),isSync:!0}),ZI=t=>({options:{...pae(t),...t}}),pae=({input:t,inputFile:e,stdio:n})=>t===void 0&&e===void 0&&n===void 0?{stdin:"inherit"}:{},hae={preferLocal:!0},D0=po(()=>({}));po(()=>({isSync:!0})),po(oae),po(aae),po($te),po(dae,{},hae,lae),fse();const E0=dw(2);let mae=class{constructor(e="dot"){this.path=e}async unflatten(e){return await E0(async()=>{const n=await D0("unflatten",["-l 1","-c 3"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});return n instanceof Error&&(n.stdout?xt.warn(`[BinaryGraphvizLayouter.layout] '${n.command}' failed: ${n.stderr}
1835
-
1836
- but returned
1837
- ${n.stdout}`):xt.error(`[BinaryGraphvizLayouter.layout] '${n.command}' failed: ${n.stderr}
1838
-
1839
- nothing returned, ignoring...`)),n.stdout&&(e=n.stdout.replaceAll(/\t\[/g," [").replaceAll(/\t/g," ")),e})}async layoutJson(e){return await E0(async()=>{const n=await D0(this.path,["-Tjson","-y"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});if(n instanceof Error){if(!n.stdout)throw xt.error(`[BinaryGraphvizLayouter.layout] '${n.command}' nothing returned and failed: "${n.stderr}"`),n;xt.warn(`[BinaryGraphvizLayouter.layout] '${n.command}' returned result but also failed "${n.stderr}"`)}return n.stdout})}async acyclic(e){return Promise.reject(new Error("Method not implemented."))}async svg(e){return await E0(async()=>{const n=await D0(this.path,["-Tsvg","-y"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});if(n instanceof Error){if(!n.stdout)throw xt.error(`[BinaryGraphvizLayouter.layout] '${n.command}' nothing returned and failed: ${n.stderr}`),n;xt.warn(`[BinaryGraphvizLayouter.layout] '${n.command}' returned result but also failed ${n.stderr}`)}return n.stdout})}};const QI="1.19.2",gae=t=>{R0.forEach(e=>{yae(t,e)})},R0=["name","message","stack","cause","errors"],yae=(t,e)=>{const n=$0(t,e);if(n!==void 0){if(vae(n)){Ri(t,e,t[e]);return}wae(n)&&e2(t,e,n)}},$0=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?void 0:$0(r,e)},vae=({get:t,set:e})=>t!==void 0&&e===void 0,wae=({enumerable:t,writable:e})=>t||!e,Ri=(t,e,n)=>{e2(t,e,{value:n})},e2=(t,e,n)=>{Object.defineProperty(t,e,{...n,..."get"in n||"set"in n?{}:{writable:!0},enumerable:!1,configurable:!0})},bae=(t,e)=>{if(Array.isArray(t.errors)){const n=t.errors.filter(Dae).map(e).filter(Boolean);Ri(t,"errors",n)}else Eae(t)?Ri(t,"errors",[]):t.errors!==void 0&&Rae(t)},Dae=t=>t!==void 0,Eae=t=>"AggregateError"in globalThis&&(t.name==="AggregateError"||t instanceof AggregateError),Rae=t=>{delete t.errors,t.errors!==void 0&&Ri(t,"errors",[])},$ae=(t,e)=>{if(!("cause"in t))return;const n=t.cause===void 0?t.cause:e(t.cause);n===void 0?delete t.cause:Ri(t,"cause",n)},Tae=t=>Sae(t)||kae(t),Sae=t=>{try{return t instanceof Error}catch{return!1}},kae=t=>{try{return Cae.has(Object.prototype.toString.call(t))}catch{return!1}},Cae=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]),Aae=t=>!Object.isExtensible(t)||R0.some(e=>_ae(t,e)||Pae(t,e)),_ae=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);return n!==void 0&&!n.configurable},Pae=(t,e)=>{try{return t[e],!1}catch{return!0}},T0=t=>{const e=xae(t.message,t.name);Ri(t,"stack",e)},xae=(t="",e="Error")=>{const n=Iae(e),{stack:r}=new n(t);return typeof r=="string"&&r!==""?r:`${e}: ${t}`},Iae=t=>{const e={value:t,enumerable:!1,writable:!0,configurable:!0},n=Object.defineProperty(class extends Error{},"name",e);return Object.defineProperty(n.prototype,"name",e),n},Nae=t=>{const e={};for(const n of Oae(t))try{const r=t[n],{enumerable:i,configurable:s,writable:o=!0}=$0(t,n);Object.defineProperty(e,n,{value:r,enumerable:i,configurable:s,writable:o})}catch{}return e},Oae=t=>{const e=Fae(t);for(const n of R0)Lae(t,n)&&e.push(n);return e},Fae=t=>{try{return Reflect.ownKeys(t)}catch{return[]}},Lae=(t,e)=>{try{return e in t&&!Object.hasOwn(t,e)}catch{return!1}},t2=t=>{const{name:e,message:n,stack:r,cause:i,errors:s,...o}=Nae(t),a=Mae(n,o),c=jae(e,a);return n===a&&Uae(c,o),Object.entries({name:e,stack:r,cause:i,errors:s}).forEach(([u,l])=>{Gae(c,u,l)}),r===void 0&&T0(c),c},Mae=(t,e)=>typeof t=="string"&&t!==""?t:qae(Bae(e)),Bae=t=>{try{return JSON.stringify(t)}catch{return zae(t)}},zae=t=>{try{return String(t)}catch{return"Invalid error"}},qae=t=>t.length<n2?t:`${t.slice(0,n2)}...`,n2=1e3,jae=(t,e)=>t==="AggregateError"&&"AggregateError"in globalThis?new AggregateError([],e):t in r2?new r2[t](e):new Error(e),r2={Error,ReferenceError,TypeError,SyntaxError,RangeError,URIError,EvalError},Uae=(t,e)=>{for(const n in e)n in t||(t[n]=e[n])},Gae=(t,e,n)=>{n!==void 0&&Ri(t,e,n)},Wae=t=>{try{const e=new Error(String(t));return T0(e),e}catch(e){return e}},{toString:Hae}=Object.prototype,Vae=t=>Kae(t)?t2(t):Tae(t)?Yae(t)?t2(t):t:Wae(t),Kae=t=>{try{return un(t)}catch{return!1}},Yae=t=>Xae(t)||Aae(t)||Jae(t),Xae=t=>{try{return Hae.call(t)==="[object Object]"}catch{return!0}},Jae=t=>typeof t.constructor!="function"||typeof t.constructor.name!="string"||t.constructor.name===""||t.constructor.prototype!==Object.getPrototypeOf(t),Nm=(t,{shallow:e=!1}={})=>i2(t,[],e),i2=(t,e,n)=>{if(e.includes(t))return;const r=n?Zae:s=>i2(s,[...e,t],n),i=Vae(t);return Qae(i,r),i},Zae=t=>t,Qae=(t,e)=>{ece(t),tce(t),nce(t),$ae(t,e),bae(t,e),gae(t)},ece=t=>{if(Om(t.name))return;const e=Object.getPrototypeOf(t).name,n=Om(e)?e:t.constructor.name;Ri(t,"name",n)},tce=t=>{Om(t.message)||Ri(t,"message","")},nce=t=>{Om(t.stack)||T0(t)},Om=t=>typeof t=="string"&&t!=="",rce=(t,e,n=t.name)=>{if(ice(e),typeof n!="string")throw new TypeError(`currentName must be a string: ${n}`);return n},ice=t=>{if(!sce(t))throw new TypeError(`ErrorClass must be a class: ${t}`);if(!s2(t.prototype))throw new TypeError(`ErrorClass must inherit from Error: ${t}`);if(!oce(t))throw new TypeError(`ErrorClass must be have a valid constructor: ${t}`)},sce=t=>typeof t=="function"&&typeof t.prototype=="object"&&t.prototype!==null,s2=t=>t!==null&&(t.name==="Error"||s2(Object.getPrototypeOf(t))),oce=t=>typeof t.prototype.constructor=="function",o2=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},ace=(t,e)=>{Object.getPrototypeOf(t)!==e.prototype&&(cce(t,e),u2(t,"constructor"),uce(t,e))},cce=(t,e)=>{Object.setPrototypeOf(t,e.prototype)},uce=(t,e)=>{u2(t,"name");const n=a2(e.prototype);t.name!==n&&o2(t,"name",n)},a2=t=>lce(t)??dce(t)??a2(Object.getPrototypeOf(t)),lce=t=>Object.hasOwn(t,"name")&&c2(t.name)?t.name:void 0,dce=t=>typeof t.constructor=="function"&&c2(t.constructor.name)?t.constructor.name:void 0,c2=t=>typeof t=="string"&&t!=="",u2=(t,e)=>{Object.hasOwn(t,e)&&delete t[e]},fce=(t,e)=>{if(!pce(t,e))return;const n=mce(t,e);o2(t,"stack",n)},pce=(t,e)=>e!==t.name&&e!==""&&t.stack.includes(e)&&hce(),hce=()=>{class t extends Error{}const e={value:l2,enumerable:!1,writable:!0,configurable:!0};Object.defineProperty(t,"name",e),Object.defineProperty(t.prototype,"name",e);const{stack:n}=new t("");return typeof n=="string"&&n.includes(l2)},l2="SetErrorClassError",mce=({name:t,stack:e},n)=>{if(e.startsWith(`${n}: `))return e.replace(n,t);const r=gce(n,t),[i,s]=r.find(([o])=>e.includes(o));return e.replace(i,s)},gce=(t,e)=>[[`
1840
- ${t}: `,`
1841
- ${e}: `],[`${t}: `,`${e}: `],[`${t} `,`${e} `],[t,e]],yce=(t,e,n)=>{const r=Nm(t),i=rce(r,e,n);return ace(r,e),fce(r,i),r},vce=(t,e)=>e.configurable===!1?wce(t,e):Ece(t,e),wce=(t,e)=>({...e,...bce(t,e),...Dce(t,e)}),bce=(t,e)=>e.writable===!0&&t.writable===!1?{writable:!1}:{},Dce=(t,e)=>t.hasValue&&"value"in e&&e.writable===!0?{value:t.value}:{},Ece=(t,e)=>{const n=jd(t.enumerable,e.enumerable,!0),r=jd(t.writable,e.writable,!0),i=jd(t.configurable,e.configurable,!0);return{...Rce(t,e,r),enumerable:n,configurable:i}},Rce=(t,e,n)=>t.hasValue?{value:t.value,writable:n}:!d2(t)&&!d2(e)?{value:e.value,writable:n}:{get:jd(t.get,e.get),set:jd(t.set,e.set)},d2=({get:t,set:e})=>t!==void 0||e!==void 0,jd=(t,e,n)=>t??e??n,$ce=(t,e,n)=>{if(!Tce(t))throw new TypeError(`Argument must be an object: ${t}`);if(!Sce(e))throw new TypeError(`Property key must be a string, a symbol or an integer: ${e}`);return kce(n)},Tce=t=>typeof t=="object"&&t!==null,Sce=t=>{const e=typeof t;return e==="string"||e==="symbol"||e==="number"},kce=t=>{if(!un(t))throw new TypeError(`Descriptor must be a plain object: ${t}`);const{enumerable:e,writable:n,configurable:r,value:i,get:s,set:o,...a}=t,c="value"in t;return Cce({enumerable:e,writable:n,configurable:r,get:s,set:o,unknownProps:a,hasValue:c}),{enumerable:e,writable:n,configurable:r,value:i,get:s,set:o,hasValue:c}},Cce=({enumerable:t,writable:e,configurable:n,get:r,set:i,unknownProps:s,hasValue:o})=>{f2(o,r,"get"),f2(o,i,"set"),S0(t,"enumerable"),S0(e,"writable"),S0(n,"configurable"),_ce(s)},f2=(t,e,n)=>{if(Ace(e,n),t&&e!==void 0)throw new TypeError(`Descriptor property "value" and "${n}" must not both be defined: ${e}`)},Ace=(t,e)=>{if(t!==void 0&&typeof t!="function")throw new TypeError(`Descriptor property "${e}" must be a function: ${t}`)},S0=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`Descriptor property "${e}" must be a boolean: ${t}`)},_ce=t=>{const[e]=Object.keys(t);if(e!==void 0)throw new TypeError(`Unknown descriptor property "${e}": ${t[e]}`)},Pce=(t,e,n)=>{const r=$ce(t,e,n),i=p2(t,e),s=vce(r,i);return xce(t,e,s),t},p2=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?{}:p2(r,e)},xce=(t,e,n)=>{try{Object.defineProperty(t,e,n)}catch{}},Ice=(t,e,n)=>{if(n!==void 0)return h2(t,e,n);try{delete t[e]}catch{}if(t[e]!==void 0)return h2(t,e)},h2=(t,e,n)=>{const r=Nce(e);Pce(t,e,{value:n,...r})},Nce=t=>typeof t=="string"&&t.startsWith("_")?{enumerable:!1}:{},Oce=t=>Fce(t)||Lce(t),Fce=t=>{try{return t instanceof Error}catch{return!1}},Lce=t=>{try{return Mce.has(Object.prototype.toString.call(t))}catch{return!1}},Mce=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]),Bce=(t,e,n={})=>{if(m2(t,"First argument"),m2(e,"Second argument"),!un(n))throw new TypeError(`Options must be a plain object: ${n}`);const{soft:r=!1}=n;if(typeof r!="boolean")throw new TypeError(`Option "soft" must be a boolean: ${r}`);return{soft:r}},m2=(t,e)=>{if(t===void 0)throw new TypeError(`${e} is required.`);if(!zce(t))throw new TypeError(`${e} must be a plain object or an error: ${t}`)},zce=t=>un(t)||Oce(t),qce=({error:t,props:e,propName:n,soft:r})=>jce(n)||!Wce.call(e,n)||r&&t[n]!==void 0,jce=t=>t in Uce||Gce.has(t),Uce=new Error("check"),Gce=new Set(["prototype","errors","cause"]),{propertyIsEnumerable:Wce}=Object.prototype,Hce=(t,e,n)=>{const{soft:r}=Bce(t,e,n);for(const i of Reflect.ownKeys(e))Vce({error:t,props:e,propName:i,soft:r});return t},Vce=({error:t,props:e,propName:n,soft:r})=>{qce({error:t,props:e,propName:n,soft:r})||Ice(t,n,e[n])},Fm=(t,e,n)=>{Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!1,configurable:!0})},Kce=(t,e)=>{if(t.errors===void 0)return;const n=t.errors.map(r=>e(r).error).filter(Boolean);Fm(t,"errors",n)},Yce=({target:t,source:e,parent:n,child:r})=>{if(!g2(t)){Xce(t,e);return}g2(e)&&Fm(t,"errors",[...r.errors,...n.errors])},Xce=(t,e)=>{e.errors!==void 0&&Fm(t,"errors",e.errors)},g2=t=>t.errors!==void 0&&t.errors.length!==0,Jce=(t,e,n=t.message)=>{if(typeof e!="string")throw new TypeError(`newMessage must be a string: ${e}`);if(typeof n!="string")throw new TypeError(`currentMessage must be a string: ${n}`);return n},Zce=({name:t,stack:e},n,r)=>r!==""&&e.includes(r)?Qce({name:t,stack:e,newMessage:n,currentMessage:r}):tue(t,e,n),Qce=({name:t,stack:e,newMessage:n,currentMessage:r})=>{const i=eue(t,n,r),[s,o]=i.find(([a])=>e.includes(a));return e.replace(s,o)},eue=(t,e,n)=>[[`${t}: ${n}`,`${t}: ${e}`],[`: ${n}`,`: ${e}`],[`
1842
- ${n}`,`
1843
- ${e}`],[` ${n}`,` ${e}`],[n,e]],tue=(t,e,n)=>{const r=`${t}: `,i=n.trimEnd();return e===t||e.startsWith(`${t}
1844
- `)?e.replace(t,`${r}${i}`):e.startsWith(r)?e.replace(r,`${r}${i}
1845
- `):`${r}${i}
1846
- ${e}`},nue=(t,e,n)=>{const r=Nm(t),i=Jce(r,e,n);return v2(r,"message",e),rue(r,e,i),r},rue=(t,e,n)=>{if(e===n||!iue())return;const r=Zce(t,e,n);v2(t,"stack",r)},iue=()=>{const{stack:t}=new Error(y2);return typeof t=="string"&&t.includes(y2)},y2="set-error-message test message",v2=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},sue=(t,e,n)=>{if(typeof e!="string")throw new TypeError(`Second argument must be a message string: ${e}`);const r=Nm(t),i=oue(e,r.message);return nue(r,i,n)},oue=(t,e)=>{const n=t.trim(),r=e.trim();return n===""?r:r===""?n:aue(n,r,t)},aue=(t,e,n)=>t.endsWith(cue)?n.endsWith(uue)?`${t}
1847
- ${e}`:`${t} ${e}`:`${e}
1848
- ${t}`,cue=":",uue=`
1849
- `,lue=({parent:t,child:e,target:n,stackError:r})=>{const i=t.message;return n.message=e.message,sue(n,i,r.message)},due=(t,e)=>w2(t)===e,w2=t=>typeof t=="object"&&t!==null?t.stack:void 0,fue=({wrap:t,target:e,source:n,childHasStack:r})=>t===r?e:(Fm(e,"stack",n.stack),n),pue=t=>{const{wrap:e,name:n}=t;return typeof e!="boolean"?n==="Error":(Object.hasOwn(t,"wrap")&&delete t.wrap,e)},hue=t=>b2(t,[]).error,b2=(t,e)=>{if(e.includes(t))return{};const n=u=>b2(u,[...e,t]),r=w2(t),i=Nm(t,{shallow:!0}),s=due(i,r);Kce(i,n);const{parent:o,childHasStack:a}=mue(i,n);return{error:o,errorHasStack:s||a}},mue=(t,e)=>{const n=pue(t);if(t.cause===void 0)return{parent:t,childHasStack:!1};const{error:r,errorHasStack:i}=e(t.cause);return delete t.cause,{parent:gue({parent:t,child:r,childHasStack:i,wrap:n}),childHasStack:i}},gue=({parent:t,child:e,childHasStack:n,wrap:r})=>{if(e===void 0)return t;const[i,s]=r?[e,t]:[t,e],o=fue({wrap:r,target:i,source:s,childHasStack:n}),a=yce(i,i.constructor,o.name),c=lue({parent:t,child:e,target:a,stackError:o});return Yce({target:c,source:s,parent:t,child:e}),Hce(c,s,{soft:!r})},Lm=Object.create(null),Ud=t=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?Lm:globalThis),ss=new Proxy(Lm,{get(t,e){return Ud()[e]??Lm[e]},has(t,e){const n=Ud();return e in n||e in Lm},set(t,e,n){const r=Ud(!0);return r[e]=n,!0},deleteProperty(t,e){if(!e)return!1;const n=Ud(!0);return delete n[e],!0},ownKeys(){const t=Ud(!0);return Object.keys(t)}}),yue=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",vue=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function wue(){if(globalThis.process?.env)for(const t of vue){const e=t[1]||t[0];if(globalThis.process?.env[e])return{name:t[0].toLowerCase(),...t[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}const D2=wue();D2.name;function ho(t){return t?t!=="false":!1}const bue=globalThis.process?.platform||"",Mm=ho(ss.CI)||D2.ci!==!1,E2=ho(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY);ho(ss.DEBUG);const Due=yue==="test"||ho(ss.TEST);ho(ss.MINIMAL);const Eue=/^win/i.test(bue);!ho(ss.NO_COLOR)&&(ho(ss.FORCE_COLOR)||(E2||Eue)&&ss.TERM);const Rue=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(Rue?.split(".")[0]);const $ue=globalThis.process||Object.create(null),R2={versions:{}};new Proxy($ue,{get(t,e){if(e==="env")return ss;if(e in t)return t[e];if(e in R2)return R2[e]}});const Tue=globalThis.process?.release?.name==="node",Sue=!!globalThis.Bun||!!globalThis.process?.versions?.bun,kue=!!globalThis.Deno,Cue=!!globalThis.fastly,Aue=!!globalThis.Netlify,_ue=!!globalThis.EdgeRuntime,Pue=globalThis.navigator?.userAgent==="Cloudflare-Workers",xue=[[Aue,"netlify"],[_ue,"edge-light"],[Pue,"workerd"],[Cue,"fastly"],[kue,"deno"],[Sue,"bun"],[Tue,"node"]];function Iue(){const t=xue.find(e=>e[0]);if(t)return{name:t[1]}}const Nue=Iue();Nue?.name;const $2=yt.bold(yt.bgRed(yt.white("ERROR"))),T2=yt.bold(yt.yellow("WARN")),Oue=yt.bold(yt.green("INFO"));function S2(t){const e=$N("info",{prefix:t,allowClearScreen:!Mm}),n=!Mm;return{...e,info(r,i){e.info(`${Oue} ${r}`,{timestamp:n,...i})},warn(r,i){if(r instanceof Error){e.warn(`${T2} ${yt.red(r.name+" "+r.message)}
1850
- ${Hd(r,{colors:!0})}`,{timestamp:n,...i});return}e.warn(`${T2} ${r}`,{timestamp:n,...i})},error(r,i){if(r instanceof Error){const s=hue(r);e.error(`${$2} ${yt.red(s.message)}
1851
- ${Hd(s,{colors:!0})}`,{timestamp:n,error:r,...i});return}e.error(`${$2} ${r}`,{timestamp:n,...i})}}}const k0=()=>{},Fue={info:k0,warn:k0,error:k0},Lue=1e6;function k2(t){const[e,n]=Vd(t),r=e*1e3+n/Lue;return{ms:r,pretty:Sx(r)}}function Mue(t){const e=Vd();return{stopAndLog(n="done in "){n=yt.green(`${n}${k2(e).pretty}`),t?t.info(n):xt.success(n)}}}class Bue{constructor(e){this.services=e}isInitialized=!1;async initWorkspace(e){if(this.isInitialized)throw new Error("Workspace already initialized");const n=this.services.logger,r=this.services.shared.workspace.WorkspaceManager;n.info(`${yt.dim("workspace:")} ${e.uri}`),r.initialize({capabilities:{},processId:null,rootUri:null,workspaceFolders:[e]}),await r.initializeWorkspace([e])}async init(){if(this.isInitialized)throw new Error("Workspace already initialized");this.isInitialized=!0;const e=this.services.logger,n=this.services.likec4.ModelBuilder,r=this.services.shared.workspace.LangiumDocuments,i=this.services.shared.workspace.DocumentBuilder,s=r.all.toArray();if(s.length===0)throw e.error("no LikeC4 sources found"),new Error("no LikeC4 sources found");e.info(`${yt.dim("workspace:")} found ${s.length} source files`),await i.build(s,{validation:!0});const o=await n.buildComputedModel(),a=Wc(o?.views??{}).length;if(a===0){e.warn(`${yt.dim("workspace:")} no views found`);return}e.info(`${yt.dim("workspace:")} ${yt.green(`\u2713 computed ${a} views`)}`);const c=await this.services.likec4.Views.diagrams();c.length===a?e.info(`${yt.dim("workspace:")} ${yt.green("\u2713 all views layouted")}`):e.warn(`${yt.dim("workspace:")} ${yt.yellow(`\u2717 layouted ${c.length} views`)}`)}}function zue(t){return e=>new t(e)}const que={logger:()=>{throw new Error("Logger must be provided")},likec4:{Layouter:()=>{throw new Error("Layouter must be provided")}},cli:{Workspace:zue(Bue)}};function C2(t){const e=Rg(t,{useFileSystem:!0,logger:"default",graphviz:"wasm"});let n;switch(e.logger){case!1:n=Fue;break;case"vite":n=S2("c4:lsp ");break;case"default":n=xt.withTag("lsp");break;default:n=e.logger}const r=e.graphviz==="binary";n.info(`${yt.dim("version")} ${QI}`),n.info(`${yt.dim("layout")} ${r?"binary":"wasm"}`);const i={logger:()=>n,likec4:{Layouter:()=>new _A(r===!0?new mae:new PA)}};return $H(e.logger===!1?"silent":"info"),e.logger!==!1&&e.logger!=="default"&&Fe.setReporters([{log:({level:s,...o},a)=>{const c=o.tag||"",u=o.args.map(d=>Hj(d)?d.stack??d.message:typeof d=="string"?d:String(d));c&&u.unshift(`[${c}]`);const l=u.join(" ");switch(!0){case s>=wt.debug:break;case s>=wt.info:{n.info(l);break}case s>=wt.log:{n.info(l);break}case s>=wt.warn:{n.warn(l);break}case s>=wt.fatal:{n.error(l);break}}}}]),xZ(e.useFileSystem?SH:{},que,i).likec4}const A2=t=>new Error(`Invalid model:
1852
- ${t.getErrors().map(e=>` ${e.sourceFsPath}:${e.line} ${e.message.slice(0,200)}`).join(`
1853
- `)}`);class os{constructor(e,n,r){this.workspace=e,this.langium=n,this.isPrintErrorEnabled=r,this.logger=n.logger,this.isPrintErrorEnabled&&this.printErrors()}static async fromSource(e,n){const r=C2(Rg(n,{useFileSystem:!1,logger:!1,graphviz:"wasm"})),i=Zt.from({scheme:"virtual",path:"/workspace"});await r.cli.Workspace.initWorkspace({uri:i.toString(),name:"virtual"});const s=Ct.joinPath(i,"source.likec4");r.shared.workspace.LangiumDocuments.createDocument(s,e),await r.cli.Workspace.init();const o=new os(i.path,r,n?.printErrors??!0);return n?.throwIfInvalid===!0&&o.hasErrors()?(o.dispose(),Promise.reject(A2(o))):o}static likec4Instances=new Map;static async fromWorkspace(e="",n){const r=O2(e);if(!N2(r))throw new Error(`Workspace not found: ${r}`);let i=os.likec4Instances.get(r);if(!i){const s=C2(Rg(n,{useFileSystem:!0,logger:"default",graphviz:"wasm"}));await s.cli.Workspace.initWorkspace({uri:L2(r).toString(),name:F2(r)}),await s.cli.Workspace.init(),i=new os(r,s,n?.printErrors??!0),os.likec4Instances.set(r,i)}return n?.throwIfInvalid===!0&&i.hasErrors()?(i.dispose(),Promise.reject(A2(i))):i}modelComputedRef;modelLayoutedRef;logger;get viewsService(){return this.langium.likec4.Views}get LangiumDocuments(){return this.langium.shared.workspace.LangiumDocuments}async diagrams(){return await this.langium.likec4.Views.diagrams()}computedModel(){let e=this.modelComputedRef?.deref();if(!e){const n=this.langium.likec4.ModelBuilder.unsafeSyncBuildModel();if(!n)throw new Error("Failed to build model");const r=this.langium.likec4.ModelBuilder.unsafeSyncBuildComputedModel(n);e=Xd.create(r),this.modelComputedRef=new WeakRef(e)}return e}async layoutedModel(){let e=this.modelLayoutedRef?.deref();if(!e){const n=await this.langium.likec4.ModelBuilder.buildComputedModel();if(!n)throw new Error("Failed to build model");const r=await this.viewsService.diagrams();e=Xd.create({...n,__:"layouted",views:Cv(r,Kc("id"))}),this.modelLayoutedRef=new WeakRef(e)}return e}getErrors(){return this.LangiumDocuments.all.toArray().flatMap(e=>(e.diagnostics??[]).filter(n=>n.severity===zc.Error).map(({message:n,range:r})=>({message:n,line:r.start.line,range:r,sourceFsPath:e.uri.fsPath})))}hasErrors(){return this.LangiumDocuments.all.some(e=>e.diagnostics?.some(n=>n.severity===zc.Error)??!1)}printErrors(){let e=!1;for(const n of this.LangiumDocuments.all){const r=n.diagnostics?.filter(i=>i.severity===1);if(r&&r.length>0){e=!0;const i=r.flatMap(s=>{const o=s.range.start.line,a=s.message.split(`
1854
- `);return a.length>10&&(a.length=10,a.push("...")),a.map((c,u)=>u===0?" "+yt.dim(`Line ${o}: `)+yt.red(c):" ".repeat(10)+yt.red(c))}).join(`
1855
- `);this.logger.error(`Invalid ${n.uri.fsPath}
1856
- ${i}`)}}return e}async notifyUpdate({changed:e,removed:n}){this.modelLayoutedRef=void 0,this.modelComputedRef=void 0;const r=this.langium.shared.workspace.WorkspaceLock;try{let i=!1;return await r.write(async s=>{await this.langium.shared.workspace.DocumentBuilder.update(e?[Zt.file(e)]:[],n?[Zt.file(n)]:[],s),i=!s.isCancellationRequested}),i}catch(i){return this.logger.error(i),!1}}onModelUpdate(e){const n=this.langium.likec4.ModelBuilder.onModelParsed(()=>e());return()=>{n.dispose()}}dispose(){for(const[e,n]of os.likec4Instances)n===this&&os.likec4Instances.delete(e)}}export{nD as E,yC as F,os as L,bE as N,Co as T,xt as Y,Po as a,Sv as b,Ve as c,ue as d,dw as e,YS as f,bt as g,gr as h,Tt as i,S2 as j,nb as k,Rn as l,gY as m,Et as n,Vo as o,yt as p,k2 as q,ib as r,Mue as s,VS as t,ZS as u,Vc as v,mY as w,tt as x,wt as y,QI as z};