likec4 1.12.2 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1816 +0,0 @@
1
- import*as M0 from"node:fs";import{writeFileSync as z0,statSync as vP,readFileSync as Bp,appendFileSync as wP,createReadStream as B0,createWriteStream as j0,existsSync as bP}from"node:fs";import Vr,{sep as DP,resolve as EP,basename as TP}from"node:path";import{fileURLToPath as jp,pathToFileURL as RP}from"node:url";import{isatty as SP}from"tty";import{Graphviz as qp}from"@hpcc-js/wasm-graphviz";import*as kP from"node:util";import{formatWithOptions as $P,debuglog as CP,stripVTControlCharacters as _P,inspect as q0,promisify as AP,callbackify as mo,aborted as xP}from"node:util";import ke,{platform as IP,hrtime as Xl,execPath as PP,execArgv as NP}from"node:process";import*as Up from"node:tty";import U0 from"node:tty";import{ChildProcess as W0,spawnSync as OP,spawn as FP}from"node:child_process";import{StringDecoder as G0}from"node:string_decoder";import*as LP from"child_process";import*as MP from"path";import*as zP from"fs";import{setTimeout as H0,scheduler as K0,setImmediate as BP}from"node:timers/promises";import{constants as ps}from"node:os";import{once as mn,addAbortListener as V0,EventEmitter as jP,on as Jl,setMaxListeners as qP}from"node:events";import{serialize as UP}from"node:v8";import{Transform as WP,getDefaultHighWaterMark as Zl,PassThrough as Y0,Readable as gs,Writable as Wp,Duplex as Gp}from"node:stream";import{Buffer as Hp}from"node:buffer";import{finished as $i}from"node:stream/promises";import{createLogger as GP}from"vite";import{Buffer as Kp}from"buffer";import*as HP from"util";import*as KP from"os";import*as VP from"crypto";import*as YP from"net";import*as XP from"url";function et(t,e){if(typeof t>"u"||t==null)throw new Error(e??`Expected defined value, but received ${t}`);return t}function ge(t,e){if(!t)throw new Error(e??"Invariant failed")}function Ae(t){throw new Error(`NonExhaustive value: ${t}`)}function JP(t,e,n){let r=i=>t(i,...e);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:e})}function Ql(t,e,n){let r=t.length-e.length;if(r===0)return t(...e);if(r===1)return JP(t,e,n);throw new Error("Wrong number of arguments")}function ZP(t){return e=>!t(e)}function Ci(t){return t==null}function QP(t){return Array.isArray(t)}function eN(...t){return Ql(tN,t)}var tN=(t,e)=>e.every(n=>n(t));function nN(...t){return Ql(rN,t)}var rN=(t,e)=>e.some(n=>n(t));const X0="dashed",yo="normal",ms="gray";function iN(t,e){return e?e+"."+t:t}const sN=["solid","dashed","dotted","none"],oN=["rectangle","person","browser","mobile","cylinder","storage","queue"],ed="primary",J0="rectangle";function Z0(t){return"element"in t}function Q0(t){return"expanded"in t}function eb(t){return"custom"in t&&(td(t.custom.expr)||Vp(t.custom.expr))}function tb(t){return"wildcard"in t}function nb(t){return"elementKind"in t&&"isEqual"in t}function rb(t){return"elementTag"in t&&"isEqual"in t}function td(t){return Z0(t)||tb(t)||nb(t)||rb(t)||Q0(t)}function Vp(t){return"where"in t&&td(t.where.expr)}function aN(t){return td(t)||Vp(t)||eb(t)}function ib(t){return"source"in t&&"target"in t}function sb(t){return"inout"in t}function ob(t){return"incoming"in t}function ab(t){return"outgoing"in t}function Yp(t){return ib(t)||sb(t)||ob(t)||ab(t)}function cb(t){return"where"in t&&Yp(t.where.expr)}function ub(t){return"customRelation"in t}function cN(t){return Yp(t)||cb(t)||ub(t)}const de={__proto__:null,isCustomElement:eb,isCustomRelationExpr:ub,isElement:td,isElementKindExpr:nb,isElementPredicateExpr:aN,isElementRef:Z0,isElementTagExpr:rb,isElementWhere:Vp,isExpandedElementExpr:Q0,isInOut:sb,isIncoming:ob,isOutgoing:ab,isRelation:ib,isRelationExpression:Yp,isRelationPredicateExpr:cN,isRelationWhere:cb,isWildcard:tb},uN=t=>"tag"in t,lN=t=>"kind"in t,dN=t=>"not"in t,Xp=t=>"and"in t,Jp=t=>"or"in t;function vo(t){switch(!0){case uN(t):{if("eq"in t.tag){const n=t.tag.eq;return r=>Array.isArray(r.tags)&&r.tags.includes(n)}const e=t.tag.neq;return n=>!Array.isArray(n.tags)||!n.tags.includes(e)}case lN(t):{if("eq"in t.kind){const n=t.kind.eq;return r=>r.kind===n}const e=t.kind.neq;return n=>Ci(n.kind)||n.kind!==e}case dN(t):{const e=vo(t.not);return ZP(e)}case Xp(t):{const e=t.and.map(vo);return eN(e)}case Jp(t):{const e=t.or.map(vo);return nN(e)}default:Ae(t)}}const fN=["amber","blue","gray","slate","green","indigo","muted","primary","red","secondary","sky"];function lb(t){return t in fN}function hN(t){return"include"in t&&Array.isArray(t.include)||"exclude"in t&&Array.isArray(t.exclude)}function pN(t){return"style"in t&&"targets"in t}function gN(t){return t==="TB"||t==="BT"||t==="LR"||t==="RL"}function db(t){return"direction"in t}function mN(t){return"include"in t&&Array.isArray(t.include)}function yN(t){return"__parallel"in t&&QP(t.__parallel)}function nd(t){return Ci(t.__)||t.__==="element"}function fb(t){return nd(t)&&"extends"in t}function hb(t){return nd(t)&&"viewOf"in t}function pb(t,e){const n=`step-${String(t).padStart(2,"0")}`;return e?`${n}.${e}`:n}function gb(t){return t.startsWith("step-")}function mb(t){if(!gb(t))throw new Error(`Invalid step edge id: ${t}`);return parseFloat(t.slice(5))}function Zp(t){return t.__==="dynamic"}function vN(t){return Ci(t.__)||t.__==="element"}const{min:wN,max:bN}=Math,ys=(t,e=0,n=1)=>wN(bN(e,t),n),Qp=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]=ys(t[e],0,255)):e===3&&(t[e]=ys(t[e],0,1));return t},yb={};for(let t of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])yb[`[object ${t}]`]=t.toLowerCase();function Te(t){return yb[Object.prototype.toString.call(t)]||"object"}const ve=(t,e=null)=>t.length>=3?Array.prototype.slice.call(t):Te(t[0])=="object"&&e?e.split("").filter(n=>t[0][n]!==void 0).map(n=>t[0][n]):t[0].slice(0),wo=t=>{if(t.length<2)return null;const e=t.length-1;return Te(t[e])=="string"?t[e].toLowerCase():null},{PI:rd,min:vb,max:wb}=Math,Bn=t=>Math.round(t*100)/100,eg=t=>Math.round(t*100)/100,Yr=rd*2,tg=rd/3,DN=rd/180,EN=180/rd,me={format:{},autodetect:[]};let Q=class{constructor(...e){const n=this;if(Te(e[0])==="object"&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];let r=wo(e),i=!1;if(!r){i=!0,me.sorted||(me.autodetect=me.autodetect.sort((s,o)=>o.p-s.p),me.sorted=!0);for(let s of me.autodetect)if(r=s.test(...e),r)break}if(me.format[r]){const s=me.format[r].apply(null,i?e:e.slice(0,-1));n._rgb=Qp(s)}else throw new Error("unknown format: "+e);n._rgb.length===3&&n._rgb.push(1)}toString(){return Te(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}};const TN="3.1.1",Se=(...t)=>new Q(...t);Se.version=TN;const bo={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"},RN=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,SN=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,bb=t=>{if(t.match(RN)){(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(SN)){(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:id}=Math,Db=(...t)=>{let[e,n,r,i]=ve(t,"rgba"),s=wo(t)||"auto";i===void 0&&(i=1),s==="auto"&&(s=i<1?"rgba":"rgb"),e=id(e),n=id(n),r=id(r);let o="000000"+(e<<16|n<<8|r).toString(16);o=o.substr(o.length-6);let a="0"+id(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}`}};Q.prototype.name=function(){const t=Db(this._rgb,"rgb");for(let e of Object.keys(bo))if(bo[e]===t)return e.toLowerCase();return t},me.format.named=t=>{if(t=t.toLowerCase(),bo[t])return bb(bo[t]);throw new Error("unknown color name: "+t)},me.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&Te(t)==="string"&&bo[t.toLowerCase()])return"named"}}),Q.prototype.alpha=function(t,e=!1){return t!==void 0&&Te(t)==="number"?e?(this._rgb[3]=t,this):new Q([this._rgb[0],this._rgb[1],this._rgb[2],t],"rgb"):this._rgb[3]},Q.prototype.clipped=function(){return this._rgb._clipped||!1};const Tr={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}},kN=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 Xr(t){const e=kN.get(String(t).toLowerCase());if(!e)throw new Error("unknown Lab illuminant "+t);Tr.labWhitePoint=t,Tr.Xn=e[0],Tr.Zn=e[1]}function ka(){return Tr.labWhitePoint}const ng=(...t)=>{t=ve(t,"lab");const[e,n,r]=t,[i,s,o]=$N(e,n,r),[a,c,u]=Eb(i,s,o);return[a,c,u,t.length>3?t[3]:1]},$N=(t,e,n)=>{const{kE:r,kK:i,kKE:s,Xn:o,Yn:a,Zn:c}=Tr,u=(t+16)/116,l=.002*e+u,d=u-.005*n,f=l*l*l,h=d*d*d,p=f>r?f:(116*l-16)/i,m=t>s?Math.pow((t+16)/116,3):t/i,w=h>r?h:(116*d-16)/i,v=p*o,E=m*a,S=w*c;return[v,E,S]},rg=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},Eb=(t,e,n)=>{const{MtxAdaptMa:r,MtxAdaptMaI:i,MtxXYZ2RGB:s,RefWhiteRGB:o,Xn:a,Yn:c,Zn:u}=Tr,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,h=o.X*r.m00+o.Y*r.m10+o.Z*r.m20,p=o.X*r.m01+o.Y*r.m11+o.Z*r.m21,m=o.X*r.m02+o.Y*r.m12+o.Z*r.m22,w=(t*r.m00+e*r.m10+n*r.m20)*(h/l),v=(t*r.m01+e*r.m11+n*r.m21)*(p/d),E=(t*r.m02+e*r.m12+n*r.m22)*(m/f),S=w*i.m00+v*i.m10+E*i.m20,$=w*i.m01+v*i.m11+E*i.m21,I=w*i.m02+v*i.m12+E*i.m22,N=rg(S*s.m00+$*s.m10+I*s.m20),A=rg(S*s.m01+$*s.m11+I*s.m21),q=rg(S*s.m02+$*s.m12+I*s.m22);return[N*255,A*255,q*255]},ig=(...t)=>{const[e,n,r,...i]=ve(t,"rgb"),[s,o,a]=Tb(e,n,r),[c,u,l]=CN(s,o,a);return[c,u,l,...i.length>0&&i[0]<1?[i[0]]:[]]};function CN(t,e,n){const{Xn:r,Yn:i,Zn:s,kE:o,kK:a}=Tr,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,h=l>o?Math.pow(l,1/3):(a*l+16)/116;return[116*f-16,500*(d-f),200*(f-h)]}function sg(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 Tb=(t,e,n)=>{t=sg(t/255),e=sg(e/255),n=sg(n/255);const{MtxRGB2XYZ:r,MtxAdaptMa:i,MtxAdaptMaI:s,Xn:o,Yn:a,Zn:c,As:u,Bs:l,Cs:d}=Tr;let f=t*r.m00+e*r.m10+n*r.m20,h=t*r.m01+e*r.m11+n*r.m21,p=t*r.m02+e*r.m12+n*r.m22;const m=o*i.m00+a*i.m10+c*i.m20,w=o*i.m01+a*i.m11+c*i.m21,v=o*i.m02+a*i.m12+c*i.m22;let E=f*i.m00+h*i.m10+p*i.m20,S=f*i.m01+h*i.m11+p*i.m21,$=f*i.m02+h*i.m12+p*i.m22;return E*=m/u,S*=w/l,$*=v/d,f=E*s.m00+S*s.m10+$*s.m20,h=E*s.m01+S*s.m11+$*s.m21,p=E*s.m02+S*s.m12+$*s.m22,[f,h,p]};Q.prototype.lab=function(){return ig(this._rgb)};const _N=(...t)=>new Q(...t,"lab");Object.assign(Se,{lab:_N,getLabWhitePoint:ka,setLabWhitePoint:Xr}),me.format.lab=ng,me.autodetect.push({p:2,test:(...t)=>{if(t=ve(t,"lab"),Te(t)==="array"&&t.length===3)return"lab"}}),Q.prototype.darken=function(t=1){const e=this,n=e.lab();return n[0]-=Tr.Kn*t,new Q(n,"lab").alpha(e.alpha(),!0)},Q.prototype.brighten=function(t=1){return this.darken(-t)},Q.prototype.darker=Q.prototype.darken,Q.prototype.brighter=Q.prototype.brighten,Q.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:AN}=Math,xN=1e-7,IN=20;Q.prototype.luminance=function(t,e="rgb"){if(t!==void 0&&Te(t)==="number"){if(t===0)return new Q([0,0,0,this._rgb[3]],"rgb");if(t===1)return new Q([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),r=IN;const i=(o,a)=>{const c=o.interpolate(a,.5,e),u=c.luminance();return Math.abs(t-u)<xN||!r--?c:u>t?i(o,c):i(c,a)},s=(n>t?i(new Q([0,0,0]),this):i(this,new Q([255,255,255]))).rgb();return new Q([...s,this._rgb[3]])}return PN(...this._rgb.slice(0,3))};const PN=(t,e,n)=>(t=og(t),e=og(e),n=og(n),.2126*t+.7152*e+.0722*n),og=t=>(t/=255,t<=.03928?t/12.92:AN((t+.055)/1.055,2.4)),Ht={},Do=(t,e,n=.5,...r)=>{let i=r[0]||"lrgb";if(!Ht[i]&&!r.length&&(i=Object.keys(Ht)[0]),!Ht[i])throw new Error(`interpolation mode ${i} is not defined`);return Te(t)!=="object"&&(t=new Q(t)),Te(e)!=="object"&&(e=new Q(e)),Ht[i](t,e,n).alpha(t.alpha()+n*(e.alpha()-t.alpha()))};Q.prototype.mix=Q.prototype.interpolate=function(t,e=.5,...n){return Do(this,t,e,...n)},Q.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 Q([e[0]*n,e[1]*n,e[2]*n,n],"rgb")};const{sin:NN,cos:ON}=Math,Rb=(...t)=>{let[e,n,r]=ve(t,"lch");return isNaN(r)&&(r=0),r=r*DN,[e,ON(r)*n,NN(r)*n]},ag=(...t)=>{t=ve(t,"lch");const[e,n,r]=t,[i,s,o]=Rb(e,n,r),[a,c,u]=ng(i,s,o);return[a,c,u,t.length>3?t[3]:1]},FN=(...t)=>{const e=ve(t,"hcl").reverse();return ag(...e)},{sqrt:LN,atan2:MN,round:zN}=Math,Sb=(...t)=>{const[e,n,r]=ve(t,"lab"),i=LN(n*n+r*r);let s=(MN(r,n)*EN+360)%360;return zN(i*1e4)===0&&(s=Number.NaN),[e,i,s]},cg=(...t)=>{const[e,n,r,...i]=ve(t,"rgb"),[s,o,a]=ig(e,n,r),[c,u,l]=Sb(s,o,a);return[c,u,l,...i.length>0&&i[0]<1?[i[0]]:[]]};Q.prototype.lch=function(){return cg(this._rgb)},Q.prototype.hcl=function(){return cg(this._rgb).reverse()};const BN=(...t)=>new Q(...t,"lch"),jN=(...t)=>new Q(...t,"hcl");Object.assign(Se,{lch:BN,hcl:jN}),me.format.lch=ag,me.format.hcl=FN,["lch","hcl"].forEach(t=>me.autodetect.push({p:2,test:(...e)=>{if(e=ve(e,t),Te(e)==="array"&&e.length===3)return t}})),Q.prototype.saturate=function(t=1){const e=this,n=e.lch();return n[1]+=Tr.Kn*t,n[1]<0&&(n[1]=0),new Q(n,"lch").alpha(e.alpha(),!0)},Q.prototype.desaturate=function(t=1){return this.saturate(-t)},Q.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(Te(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(Te(e)==="number")s[o]=e;else throw new Error("unsupported value for Color.set");const a=new Q(s,r);return n?(this._rgb=a._rgb,this):a}throw new Error(`unknown channel ${i} in mode ${r}`)}else return s},Q.prototype.tint=function(t=.5,...e){return Do(this,"white",t,...e)},Q.prototype.shade=function(t=.5,...e){return Do(this,"black",t,...e)};const qN=(t,e,n)=>{const r=t._rgb,i=e._rgb;return new Q(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"rgb")};Ht.rgb=qN;const{sqrt:ug,pow:Eo}=Math,UN=(t,e,n)=>{const[r,i,s]=t._rgb,[o,a,c]=e._rgb;return new Q(ug(Eo(r,2)*(1-n)+Eo(o,2)*n),ug(Eo(i,2)*(1-n)+Eo(a,2)*n),ug(Eo(s,2)*(1-n)+Eo(c,2)*n),"rgb")};Ht.lrgb=UN;const WN=(t,e,n)=>{const r=t.lab(),i=e.lab();return new Q(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"lab")};Ht.lab=WN;const To=(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,h,p,m;return!isNaN(o)&&!isNaN(a)?(a>o&&a-o>180?m=a-(o+360):a<o&&o-a>180?m=a+360-o:m=a-o,h=o+n*m):isNaN(o)?isNaN(a)?h=Number.NaN:(h=a,(l==1||l==0)&&r!="hsv"&&(f=u)):(h=o,(d==1||d==0)&&r!="hsv"&&(f=c)),f===void 0&&(f=c+n*(u-c)),p=l+n*(d-l),r==="oklch"?new Q([p,f,h],r):new Q([h,f,p],r)},kb=(t,e,n)=>To(t,e,n,"lch");Ht.lch=kb,Ht.hcl=kb;const GN=t=>{if(Te(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)},HN=(...t)=>{const[e,n,r]=ve(t,"rgb");return(e<<16)+(n<<8)+r};Q.prototype.num=function(){return HN(this._rgb)};const KN=(...t)=>new Q(...t,"num");Object.assign(Se,{num:KN}),me.format.num=GN,me.autodetect.push({p:5,test:(...t)=>{if(t.length===1&&Te(t[0])==="number"&&t[0]>=0&&t[0]<=16777215)return"num"}});const VN=(t,e,n)=>{const r=t.num(),i=e.num();return new Q(r+n*(i-r),"num")};Ht.num=VN;const{floor:YN}=Math,XN=(...t)=>{t=ve(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=YN(e),u=e-c,l=r*(1-n),d=l+a*(1-u),f=l+a*u,h=l+a;switch(c){case 0:[i,s,o]=[h,f,l];break;case 1:[i,s,o]=[d,h,l];break;case 2:[i,s,o]=[l,h,f];break;case 3:[i,s,o]=[l,d,h];break;case 4:[i,s,o]=[f,l,h];break;case 5:[i,s,o]=[h,l,d];break}}return[i,s,o,t.length>3?t[3]:1]},JN=(...t)=>{const[e,n,r]=ve(t,"rgb"),i=vb(e,n,r),s=wb(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]};Q.prototype.hcg=function(){return JN(this._rgb)};const ZN=(...t)=>new Q(...t,"hcg");Se.hcg=ZN,me.format.hcg=XN,me.autodetect.push({p:1,test:(...t)=>{if(t=ve(t,"hcg"),Te(t)==="array"&&t.length===3)return"hcg"}});const QN=(t,e,n)=>To(t,e,n,"hcg");Ht.hcg=QN;const{cos:Ro}=Math,e2=(...t)=>{t=ve(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(Yr*e)/Ro(tg-Yr*e))/3,s=1-(o+i)):e<2/3?(e-=1/3,i=(1-n)/3,s=(1+n*Ro(Yr*e)/Ro(tg-Yr*e))/3,o=1-(i+s)):(e-=2/3,s=(1-n)/3,o=(1+n*Ro(Yr*e)/Ro(tg-Yr*e))/3,i=1-(s+o)),i=ys(r*i*3),s=ys(r*s*3),o=ys(r*o*3),[i*255,s*255,o*255,t.length>3?t[3]:1]},{min:t2,sqrt:n2,acos:r2}=Math,i2=(...t)=>{let[e,n,r]=ve(t,"rgb");e/=255,n/=255,r/=255;let i;const s=t2(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/=n2((e-n)*(e-n)+(e-r)*(n-r)),i=r2(i),r>n&&(i=Yr-i),i/=Yr),[i*360,a,o]};Q.prototype.hsi=function(){return i2(this._rgb)};const s2=(...t)=>new Q(...t,"hsi");Se.hsi=s2,me.format.hsi=e2,me.autodetect.push({p:2,test:(...t)=>{if(t=ve(t,"hsi"),Te(t)==="array"&&t.length===3)return"hsi"}});const o2=(t,e,n)=>To(t,e,n,"hsi");Ht.hsi=o2;const lg=(...t)=>{t=ve(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]},$b=(...t)=>{t=ve(t,"rgba");let[e,n,r]=t;e/=255,n/=255,r/=255;const i=vb(e,n,r),s=wb(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]};Q.prototype.hsl=function(){return $b(this._rgb)};const a2=(...t)=>new Q(...t,"hsl");Se.hsl=a2,me.format.hsl=lg,me.autodetect.push({p:2,test:(...t)=>{if(t=ve(t,"hsl"),Te(t)==="array"&&t.length===3)return"hsl"}});const c2=(t,e,n)=>To(t,e,n,"hsl");Ht.hsl=c2;const{floor:u2}=Math,l2=(...t)=>{t=ve(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=u2(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:d2,max:f2}=Math,h2=(...t)=>{t=ve(t,"rgb");let[e,n,r]=t;const i=d2(e,n,r),s=f2(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]};Q.prototype.hsv=function(){return h2(this._rgb)};const p2=(...t)=>new Q(...t,"hsv");Se.hsv=p2,me.format.hsv=l2,me.autodetect.push({p:2,test:(...t)=>{if(t=ve(t,"hsv"),Te(t)==="array"&&t.length===3)return"hsv"}});const g2=(t,e,n)=>To(t,e,n,"hsv");Ht.hsv=g2;function sd(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 dg=(...t)=>{t=ve(t,"lab");const[e,n,r,...i]=t,[s,o,a]=m2([e,n,r]),[c,u,l]=Eb(s,o,a);return[c,u,l,...i.length>0&&i[0]<1?[i[0]]:[]]};function m2(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=sd(n,t);return sd(e,r.map(i=>i**3))}const fg=(...t)=>{const[e,n,r,...i]=ve(t,"rgb"),s=Tb(e,n,r);return[...y2(s),...i.length>0&&i[0]<1?[i[0]]:[]]};function y2(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=sd(e,t);return sd(n,r.map(i=>Math.cbrt(i)))}Q.prototype.oklab=function(){return fg(this._rgb)};const v2=(...t)=>new Q(...t,"oklab");Object.assign(Se,{oklab:v2}),me.format.oklab=dg,me.autodetect.push({p:2,test:(...t)=>{if(t=ve(t,"oklab"),Te(t)==="array"&&t.length===3)return"oklab"}});const w2=(t,e,n)=>{const r=t.oklab(),i=e.oklab();return new Q(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"oklab")};Ht.oklab=w2;const b2=(t,e,n)=>To(t,e,n,"oklch");Ht.oklch=b2;const{pow:hg,sqrt:pg,PI:gg,cos:Cb,sin:_b,atan2:D2}=Math,E2=(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 Q(d)),e==="lrgb")return T2(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*gg;c+=Cb(f)*n[0],u+=_b(f)*n[0]}let l=s.alpha()*n[0];t.forEach((d,f)=>{const h=d.get(e);l+=d.alpha()*n[f+1];for(let p=0;p<o.length;p++)if(!isNaN(h[p]))if(a[p]+=n[f+1],e.charAt(p)==="h"){const m=h[p]/180*gg;c+=Cb(m)*n[f+1],u+=_b(m)*n[f+1]}else o[p]+=h[p]*n[f+1]});for(let d=0;d<o.length;d++)if(e.charAt(d)==="h"){let f=D2(u/a[d],c/a[d])/gg*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 Q(o,e).alpha(l>.99999?1:l,!0)},T2=(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]+=hg(a[0],2)*o,r[1]+=hg(a[1],2)*o,r[2]+=hg(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 Q(Qp(r))},{pow:R2}=Math;function od(t){let e="rgb",n=Se("#ccc"),r=0,i=[0,1],s=[],o=[0,0],a=!1,c=[],u=!1,l=0,d=1,f=!1,h={},p=!0,m=1;const w=function(A){if(A=A||["#fff","#000"],A&&Te(A)==="string"&&Se.brewer&&Se.brewer[A.toLowerCase()]&&(A=Se.brewer[A.toLowerCase()]),Te(A)==="array"){A.length===1&&(A=[A[0],A[0]]),A=A.slice(0);for(let q=0;q<A.length;q++)A[q]=Se(A[q]);s.length=0;for(let q=0;q<A.length;q++)s.push(q/(A.length-1))}return I(),c=A},v=function(A){if(a!=null){const q=a.length-1;let W=0;for(;W<q&&A>=a[W];)W++;return W-1}return 0};let E=A=>A,S=A=>A;const $=function(A,q){let W,V;if(q==null&&(q=!1),isNaN(A)||A===null)return n;q?V=A:a&&a.length>2?V=v(A)/(a.length-2):d!==l?V=(A-l)/(d-l):V=1,V=S(V),q||(V=E(V)),m!==1&&(V=R2(V,m)),V=o[0]+V*(1-o[0]-o[1]),V=ys(V,0,1);const x=Math.floor(V*1e4);if(p&&h[x])W=h[x];else{if(Te(c)==="array")for(let k=0;k<s.length;k++){const T=s[k];if(V<=T){W=c[k];break}if(V>=T&&k===s.length-1){W=c[k];break}if(V>T&&V<s[k+1]){V=(V-T)/(s[k+1]-T),W=Se.interpolate(c[k],c[k+1],V,e);break}}else Te(c)==="function"&&(W=c(V));p&&(h[x]=W)}return W};var I=()=>h={};w(t);const N=function(A){const q=Se($(A));return u&&q[u]?q[u]():q};return N.classes=function(A){if(A!=null){if(Te(A)==="array")a=A,i=[A[0],A[A.length-1]];else{const q=Se.analyze(i);A===0?a=[q.min,q.max]:a=Se.limits(q,"e",A)}return N}return a},N.domain=function(A){if(!arguments.length)return i;l=A[0],d=A[A.length-1],s=[];const q=c.length;if(A.length===q&&l!==d)for(let W of Array.from(A))s.push((W-l)/(d-l));else{for(let W=0;W<q;W++)s.push(W/(q-1));if(A.length>2){const W=A.map((x,k)=>k/(A.length-1)),V=A.map(x=>(x-l)/(d-l));V.every((x,k)=>W[k]===x)||(S=x=>{if(x<=0||x>=1)return x;let k=0;for(;x>=V[k+1];)k++;const T=(x-V[k])/(V[k+1]-V[k]);return W[k]+T*(W[k+1]-W[k])})}}return i=[l,d],N},N.mode=function(A){return arguments.length?(e=A,I(),N):e},N.range=function(A,q){return w(A),N},N.out=function(A){return u=A,N},N.spread=function(A){return arguments.length?(r=A,N):r},N.correctLightness=function(A){return A==null&&(A=!0),f=A,I(),f?E=function(q){const W=$(0,!0).lab()[0],V=$(1,!0).lab()[0],x=W>V;let k=$(q,!0).lab()[0];const T=W+(V-W)*q;let L=k-T,Y=0,G=1,X=20;for(;Math.abs(L)>.01&&X-- >0;)(function(){return x&&(L*=-1),L<0?(Y=q,q+=(G-q)*.5):(G=q,q+=(Y-q)*.5),k=$(q,!0).lab()[0],L=k-T})();return q}:E=q=>q,N},N.padding=function(A){return A!=null?(Te(A)==="number"&&(A=[A,A]),o=A,N):o},N.colors=function(A,q){arguments.length<2&&(q="hex");let W=[];if(arguments.length===0)W=c.slice(0);else if(A===1)W=[N(.5)];else if(A>1){const V=i[0],x=i[1]-V;W=S2(0,A).map(k=>N(V+k/(A-1)*x))}else{t=[];let V=[];if(a&&a.length>2)for(let x=1,k=a.length,T=1<=k;T?x<k:x>k;T?x++:x--)V.push((a[x-1]+a[x])*.5);else V=i;W=V.map(x=>N(x))}return Se[q]&&(W=W.map(V=>V[q]())),W},N.cache=function(A){return A!=null?(p=A,N):p},N.gamma=function(A){return A!=null?(m=A,N):m},N.nodata=function(A){return A!=null?(n=Se(A),N):n},N}function S2(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 k2=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},$2=function(t){let e,n,r,i;if(t=t.map(s=>new Q(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 Q(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 Q(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 Q(a,"lab")}}else if(t.length>=5){let s,o,a;s=t.map(c=>c.lab()),a=t.length-1,o=k2(a),e=function(c){const u=1-c,l=[0,1,2].map(d=>s.reduce((f,h,p)=>f+o[p]*u**(a-p)*c**p*h[d],0));return new Q(l,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return e},C2=t=>{const e=$2(t);return e.scale=()=>od(e),e},{round:Ab}=Math;Q.prototype.rgb=function(t=!0){return t===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Ab)},Q.prototype.rgba=function(t=!0){return this._rgb.slice(0,4).map((e,n)=>n<3?t===!1?e:Ab(e):e)};const _2=(...t)=>new Q(...t,"rgb");Object.assign(Se,{rgb:_2}),me.format.rgb=(...t)=>{const e=ve(t,"rgba");return e[3]===void 0&&(e[3]=1),e},me.autodetect.push({p:3,test:(...t)=>{if(t=ve(t,"rgba"),Te(t)==="array"&&(t.length===3||t.length===4&&Te(t[3])=="number"&&t[3]>=0&&t[3]<=1))return"rgb"}});const ir=(t,e,n)=>{if(!ir[n])throw new Error("unknown blend mode "+n);return ir[n](t,e)},_i=t=>(e,n)=>{const r=Se(n).rgb(),i=Se(e).rgb();return Se.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},A2=t=>t,x2=(t,e)=>t*e/255,I2=(t,e)=>t>e?e:t,P2=(t,e)=>t>e?t:e,N2=(t,e)=>255*(1-(1-t/255)*(1-e/255)),O2=(t,e)=>e<128?2*t*e/255:255*(1-2*(1-t/255)*(1-e/255)),F2=(t,e)=>255*(1-(1-e/255)/(t/255)),L2=(t,e)=>t===255?255:(t=255*(e/255)/(1-t/255),t>255?255:t);ir.normal=_i(Ai(A2)),ir.multiply=_i(Ai(x2)),ir.screen=_i(Ai(N2)),ir.overlay=_i(Ai(O2)),ir.darken=_i(Ai(I2)),ir.lighten=_i(Ai(P2)),ir.dodge=_i(Ai(L2)),ir.burn=_i(Ai(F2));const{pow:M2,sin:z2,cos:B2}=Math;function j2(t=300,e=-1.5,n=1,r=1,i=[0,1]){let s=0,o;Te(i)==="array"?o=i[1]-i[0]:(o=0,i=[i,i]);const a=function(c){const u=Yr*((t+120)/360+e*c),l=M2(i[0]+o*c,r),d=(s!==0?n[0]+c*s:n)*l*(1-l)/2,f=B2(u),h=z2(u),p=l+d*(-.14861*f+1.78277*h),m=l+d*(-.29227*f-.90649*h),w=l+d*(1.97294*f);return Se(Qp([p*255,m*255,w*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,Te(n)==="array"?(s=n[1]-n[0],s===0&&(n=n[1])):s=0,a)},a.lightness=function(c){return c==null?i:(Te(c)==="array"?(i=c,o=c[1]-c[0]):(i=[c,c],o=0),a)},a.scale=()=>Se.scale(a),a.hue(n),a}const q2="0123456789abcdef",{floor:U2,random:W2}=Math,G2=()=>{let t="#";for(let e=0;e<6;e++)t+=q2.charAt(U2(W2()*16));return new Q(t,"hex")},{log:xb,pow:H2,floor:K2,abs:V2}=Math;function Ib(t,e=null){const n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return Te(t)==="object"&&(t=Object.values(t)),t.forEach(r=>{e&&Te(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)=>Pb(n,r,i),n}function Pb(t,e="equal",n=7){Te(t)=="array"&&(t=Ib(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*xb(r),c=Math.LOG10E*xb(i);o.push(r);for(let u=1;u<n;u++)o.push(H2(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=K2(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,h=null;h=[],h.push(r);for(let w=1;w<n;w++)h.push(r+w/n*(i-r));for(h.push(i);d;){for(let v=0;v<n;v++)l[v]=0;for(let v=0;v<c;v++){const E=s[v];let S=Number.MAX_VALUE,$;for(let I=0;I<n;I++){const N=V2(h[I]-E);N<S&&(S=N,$=I),l[$]++,u[v]=$}}const w=new Array(n);for(let v=0;v<n;v++)w[v]=null;for(let v=0;v<c;v++)a=u[v],w[a]===null?w[a]=s[v]:w[a]+=s[v];for(let v=0;v<n;v++)w[v]*=1/l[v];d=!1;for(let v=0;v<n;v++)if(w[v]!==h[v]){d=!0;break}h=w,f++,f>200&&(d=!1)}const p={};for(let w=0;w<n;w++)p[w]=[];for(let w=0;w<c;w++)a=u[w],p[a].push(s[w]);let m=[];for(let w=0;w<n;w++)m.push(p[w][0]),m.push(p[w][p[w].length-1]);m=m.sort((w,v)=>w-v),o.push(m[0]);for(let w=1;w<m.length;w+=2){const v=m[w];!isNaN(v)&&o.indexOf(v)===-1&&o.push(v)}}return o}const Y2=(t,e)=>{t=new Q(t),e=new Q(e);const n=t.luminance(),r=e.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},Nb=.027,X2=5e-4,J2=.1,Ob=1.14,ad=.022,Fb=1.414,Z2=(t,e)=>{t=new Q(t),e=new Q(e),t.alpha()<1&&(t=Do(e,t,t.alpha(),"rgb"));const n=Lb(...t.rgb()),r=Lb(...e.rgb()),i=n>=ad?n:n+Math.pow(ad-n,Fb),s=r>=ad?r:r+Math.pow(ad-r,Fb),o=Math.pow(s,.56)-Math.pow(i,.57),a=Math.pow(s,.65)-Math.pow(i,.62),c=Math.abs(s-i)<X2?0:i<s?o*Ob:a*Ob;return(Math.abs(c)<J2?0:c>0?c-Nb:c+Nb)*100};function Lb(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:Jr,pow:Tt,min:Q2,max:eO,atan2:Mb,abs:zb,cos:cd,sin:Bb,exp:tO,PI:jb}=Math;function nO(t,e,n=1,r=1,i=1){var s=function(Et){return 360*Et/(2*jb)},o=function(Et){return 2*jb*Et/360};t=new Q(t),e=new Q(e);const[a,c,u]=Array.from(t.lab()),[l,d,f]=Array.from(e.lab()),h=(a+l)/2,p=Jr(Tt(c,2)+Tt(u,2)),m=Jr(Tt(d,2)+Tt(f,2)),w=(p+m)/2,v=.5*(1-Jr(Tt(w,7)/(Tt(w,7)+Tt(25,7)))),E=c*(1+v),S=d*(1+v),$=Jr(Tt(E,2)+Tt(u,2)),I=Jr(Tt(S,2)+Tt(f,2)),N=($+I)/2,A=s(Mb(u,E)),q=s(Mb(f,S)),W=A>=0?A:A+360,V=q>=0?q:q+360,x=zb(W-V)>180?(W+V+360)/2:(W+V)/2,k=1-.17*cd(o(x-30))+.24*cd(o(2*x))+.32*cd(o(3*x+6))-.2*cd(o(4*x-63));let T=V-W;T=zb(T)<=180?T:V<=W?T+360:T-360,T=2*Jr($*I)*Bb(o(T)/2);const L=l-a,Y=I-$,G=1+.015*Tt(h-50,2)/Jr(20+Tt(h-50,2)),X=1+.045*N,_e=1+.015*N*k,te=30*tO(-Tt((x-275)/25,2)),U=-(2*Jr(Tt(N,7)/(Tt(N,7)+Tt(25,7))))*Bb(2*o(te)),ye=Jr(Tt(L/(n*G),2)+Tt(Y/(r*X),2)+Tt(T/(i*_e),2)+U*(Y/(r*X))*(T/(i*_e)));return eO(0,Q2(100,ye))}function rO(t,e,n="lab"){t=new Q(t),e=new Q(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 iO=(...t)=>{try{return new Q(...t),!0}catch{return!1}},sO={cool(){return od([Se.hsl(180,1,.9),Se.hsl(250,.7,.4)])},hot(){return od(["#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"]},qb=Object.keys(mg),Ub=new Map(qb.map(t=>[t.toLowerCase(),t])),oO=typeof Proxy=="function"?new Proxy(mg,{get(t,e){const n=e.toLowerCase();if(Ub.has(n))return t[Ub.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(qb)}}):mg,aO=(...t)=>{t=ve(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:Wb}=Math,cO=(...t)=>{let[e,n,r]=ve(t,"rgb");e=e/255,n=n/255,r=r/255;const i=1-Wb(e,Wb(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]};Q.prototype.cmyk=function(){return cO(this._rgb)};const uO=(...t)=>new Q(...t,"cmyk");Object.assign(Se,{cmyk:uO}),me.format.cmyk=aO,me.autodetect.push({p:2,test:(...t)=>{if(t=ve(t,"cmyk"),Te(t)==="array"&&t.length===4)return"cmyk"}});const lO=(...t)=>{const e=ve(t,"hsla");let n=wo(t)||"lsa";return e[0]=Bn(e[0]||0)+"deg",e[1]=Bn(e[1]*100)+"%",e[2]=Bn(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(" ")})`},dO=(...t)=>{const e=ve(t,"lab");let n=wo(t)||"lab";return e[0]=Bn(e[0])+"%",e[1]=Bn(e[1]),e[2]=Bn(e[2]),n==="laba"||e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`lab(${e.join(" ")})`},fO=(...t)=>{const e=ve(t,"lch");let n=wo(t)||"lab";return e[0]=Bn(e[0])+"%",e[1]=Bn(e[1]),e[2]=isNaN(e[2])?"none":Bn(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(" ")})`},hO=(...t)=>{const e=ve(t,"lab");return e[0]=Bn(e[0]*100)+"%",e[1]=eg(e[1]),e[2]=eg(e[2]),e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`oklab(${e.join(" ")})`},Gb=(...t)=>{const[e,n,r,...i]=ve(t,"rgb"),[s,o,a]=fg(e,n,r),[c,u,l]=Sb(s,o,a);return[c,u,l,...i.length>0&&i[0]<1?[i[0]]:[]]},pO=(...t)=>{const e=ve(t,"lch");return e[0]=Bn(e[0]*100)+"%",e[1]=eg(e[1]),e[2]=isNaN(e[2])?"none":Bn(e[2])+"deg",e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`oklch(${e.join(" ")})`},{round:yg}=Math,gO=(...t)=>{const e=ve(t,"rgba");let n=wo(t)||"rgb";if(n.substr(0,3)==="hsl")return lO($b(e),n);if(n.substr(0,3)==="lab"){const r=ka();Xr("d50");const i=dO(ig(e),n);return Xr(r),i}if(n.substr(0,3)==="lch"){const r=ka();Xr("d50");const i=fO(cg(e),n);return Xr(r),i}return n.substr(0,5)==="oklab"?hO(fg(e)):n.substr(0,5)==="oklch"?pO(Gb(e)):(e[0]=yg(e[0]),e[1]=yg(e[1]),e[2]=yg(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(" ")})`)},Hb=(...t)=>{t=ve(t,"lch");const[e,n,r,...i]=t,[s,o,a]=Rb(e,n,r),[c,u,l]=dg(s,o,a);return[c,u,l,...i.length>0&&i[0]<1?[i[0]]:[]]},Zr=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,sr=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,ud=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,jn=/\s*/.source,So=/\s+/.source,vg=/\s*,\s*/.source,ld=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,ko=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,Kb=new RegExp("^rgba?\\("+jn+[Zr,Zr,Zr].join(So)+ko+"\\)$"),Vb=new RegExp("^rgb\\("+jn+[Zr,Zr,Zr].join(vg)+jn+"\\)$"),Yb=new RegExp("^rgba\\("+jn+[Zr,Zr,Zr,sr].join(vg)+jn+"\\)$"),Xb=new RegExp("^hsla?\\("+jn+[ld,ud,ud].join(So)+ko+"\\)$"),Jb=new RegExp("^hsl?\\("+jn+[ld,ud,ud].join(vg)+jn+"\\)$"),Zb=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Qb=new RegExp("^lab\\("+jn+[sr,sr,sr].join(So)+ko+"\\)$"),eD=new RegExp("^lch\\("+jn+[sr,sr,ld].join(So)+ko+"\\)$"),tD=new RegExp("^oklab\\("+jn+[sr,sr,sr].join(So)+ko+"\\)$"),nD=new RegExp("^oklch\\("+jn+[sr,sr,ld].join(So)+ko+"\\)$"),{round:rD}=Math,$o=t=>t.map((e,n)=>n<=2?ys(rD(e),0,255):e),Rt=(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),tn=(t,e)=>t==="none"?e:t,wg=t=>{if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e;if(me.format.named)try{return me.format.named(t)}catch{}if((e=t.match(Kb))||(e=t.match(Vb))){let n=e.slice(1,4);for(let i=0;i<3;i++)n[i]=+Rt(tn(n[i],0),0,255);n=$o(n);const r=e[4]!==void 0?+Rt(e[4],0,1):1;return n[3]=r,n}if(e=t.match(Yb)){const n=e.slice(1,5);for(let r=0;r<4;r++)n[r]=+Rt(n[r],0,255);return n}if((e=t.match(Xb))||(e=t.match(Jb))){const n=e.slice(1,4);n[0]=+tn(n[0].replace("deg",""),0),n[1]=+Rt(tn(n[1],0),0,100)*.01,n[2]=+Rt(tn(n[2],0),0,100)*.01;const r=$o(lg(n)),i=e[4]!==void 0?+Rt(e[4],0,1):1;return r[3]=i,r}if(e=t.match(Zb)){const n=e.slice(1,4);n[1]*=.01,n[2]*=.01;const r=lg(n);for(let i=0;i<3;i++)r[i]=rD(r[i]);return r[3]=+e[4],r}if(e=t.match(Qb)){const n=e.slice(1,4);n[0]=Rt(tn(n[0],0),0,100),n[1]=Rt(tn(n[1],0),-125,125,!0),n[2]=Rt(tn(n[2],0),-125,125,!0);const r=ka();Xr("d50");const i=$o(ng(n));Xr(r);const s=e[4]!==void 0?+Rt(e[4],0,1):1;return i[3]=s,i}if(e=t.match(eD)){const n=e.slice(1,4);n[0]=Rt(n[0],0,100),n[1]=Rt(tn(n[1],0),0,150,!1),n[2]=+tn(n[2].replace("deg",""),0);const r=ka();Xr("d50");const i=$o(ag(n));Xr(r);const s=e[4]!==void 0?+Rt(e[4],0,1):1;return i[3]=s,i}if(e=t.match(tD)){const n=e.slice(1,4);n[0]=Rt(tn(n[0],0),0,1),n[1]=Rt(tn(n[1],0),-.4,.4,!0),n[2]=Rt(tn(n[2],0),-.4,.4,!0);const r=$o(dg(n)),i=e[4]!==void 0?+Rt(e[4],0,1):1;return r[3]=i,r}if(e=t.match(nD)){const n=e.slice(1,4);n[0]=Rt(tn(n[0],0),0,1),n[1]=Rt(tn(n[1],0),0,.4,!1),n[2]=+tn(n[2].replace("deg",""),0);const r=$o(Hb(n)),i=e[4]!==void 0?+Rt(e[4],0,1):1;return r[3]=i,r}};wg.test=t=>Kb.test(t)||Xb.test(t)||Qb.test(t)||eD.test(t)||tD.test(t)||nD.test(t)||Vb.test(t)||Yb.test(t)||Jb.test(t)||Zb.test(t)||t==="transparent",Q.prototype.css=function(t){return gO(this._rgb,t)};const mO=(...t)=>new Q(...t,"css");Se.css=mO,me.format.css=wg,me.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&Te(t)==="string"&&wg.test(t))return"css"}}),me.format.gl=(...t)=>{const e=ve(t,"rgba");return e[0]*=255,e[1]*=255,e[2]*=255,e};const yO=(...t)=>new Q(...t,"gl");Se.gl=yO,Q.prototype.gl=function(){const t=this._rgb;return[t[0]/255,t[1]/255,t[2]/255,t[3]]},Q.prototype.hex=function(t){return Db(this._rgb,t)};const vO=(...t)=>new Q(...t,"hex");Se.hex=vO,me.format.hex=bb,me.autodetect.push({p:4,test:(t,...e)=>{if(!e.length&&Te(t)==="string"&&[3,4,5,6,7,8,9].indexOf(t.length)>=0)return"hex"}});const{log:dd}=Math,iD=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*dd(r),i=e<20?0:-254.76935184120902+.8274096064007395*(i=e-10)+115.67994401066147*dd(i)):(n=351.97690566805693+.114206453784165*(n=e-55)-40.25366309332127*dd(n),r=325.4494125711974+.07943456536662342*(r=e-50)-28.0852963507957*dd(r),i=255),[n,r,i,1]},{round:wO}=Math,bO=(...t)=>{const e=ve(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=iD(a);c[2]/c[0]>=r/n?s=a:i=a}return wO(a)};Q.prototype.temp=Q.prototype.kelvin=Q.prototype.temperature=function(){return bO(this._rgb)};const bg=(...t)=>new Q(...t,"temp");Object.assign(Se,{temp:bg,kelvin:bg,temperature:bg}),me.format.temp=me.format.kelvin=me.format.temperature=iD,Q.prototype.oklch=function(){return Gb(this._rgb)};const DO=(...t)=>new Q(...t,"oklch");Object.assign(Se,{oklch:DO}),me.format.oklch=Hb,me.autodetect.push({p:2,test:(...t)=>{if(t=ve(t,"oklch"),Te(t)==="array"&&t.length===3)return"oklch"}}),Object.assign(Se,{analyze:Ib,average:E2,bezier:C2,blend:ir,brewer:oO,Color:Q,colors:bo,contrast:Y2,contrastAPCA:Z2,cubehelix:j2,deltaE:nO,distance:rO,input:me,interpolate:Do,limits:Pb,mix:Do,random:G2,scale:od,scales:sO,valid:iO});const Dg=[.96,.907,.805,.697,.605,.547,.518,.445,.395,.34],sD=[.32,.16,.08,.04,0,0,.04,.08,.16,.32];function EO(t){const e=t.get("hsl.l");return Dg.reduce((n,r)=>Math.abs(r-e)<Math.abs(n-e)?r:n)}function TO(t){const e=Se(t),n=EO(e),r=Dg.findIndex(s=>s===n),i=Dg.map(s=>e.set("hsl.l",s)).map(s=>Se(s)).map((s,o)=>{const a=sD[o]-sD[r];return a>=0?s.saturate(a):s.desaturate(a*-1)});return{baseColorIndex:r,colors:i}}function RO(t){return TO(t).colors.map(e=>e.hex())}const oD={fill:"#3b82f6",stroke:"#2563eb",hiContrast:"#eff6ff",loContrast:"#bfdbfe"},aD={fill:"#0284c7",stroke:"#0369a1",hiContrast:"#f0f9ff",loContrast:"#B6ECF7"},cD={fill:"#64748b",stroke:"#475569",hiContrast:"#f8fafc",loContrast:"#cbd5e1"},uD={primary:oD,blue:oD,secondary:aD,sky:aD,muted:cD,slate:cD,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"}},SO={lineColor:"#6E6E6E",labelBgColor:"#18191b",labelColor:"#C6C6C6"},lD={lineColor:"#64748b",labelBgColor:"#0f172a",labelColor:"#cbd5e1"},dD={lineColor:"#3b82f6",labelBgColor:"#172554",labelColor:"#60a5fa"},fD={lineColor:"#0ea5e9",labelBgColor:"#082f49",labelColor:"#38bdf8"},hD={amber:{lineColor:"#b45309",labelBgColor:"#78350f",labelColor:"#FFE0C2"},blue:dD,gray:SO,green:{lineColor:"#15803d",labelBgColor:"#052e16",labelColor:"#22c55e"},indigo:{lineColor:"#6366f1",labelBgColor:"#1e1b4b",labelColor:"#818cf8"},muted:lD,primary:dD,red:{lineColor:"#AC4D39",labelBgColor:"#b91c1c",labelColor:"#f5b2a3"},secondary:fD,sky:fD,slate:lD},qn={elements:uD,relationships:hD,font:"Arial",shadow:"#0a0a0a"};function kO(t){if(t.match(/^#([0-9a-f]{3}){1,2}$/i)){const e=RO(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:qn.elements.primary,relationships:qn.relationships.primary}}function Co(...t){return Ql(Object.values,t)}function Eg(...t){return Ql($O,t)}var $O=(t,e)=>t.length>=e;function CO(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)}function $a(t){return typeof t=="string"}function pD(t){return!!t}function tt(t){return $a(t)?t:t.id}let Ca=class I0{constructor(e,n){this.view=e,this.model=n;for(const r of e.nodes){const i=new I0.Element(r,this);this._elements.set(r.id,i),Ci(r.parent)&&this._rootElements.add(i)}this._connections=new Map(e.edges.map(r=>[r.id,new I0.Connection(r,this)]))}_rootElements=new Set;_elements=new Map;_connections;get isDynamic(){return this.view.__==="dynamic"}get id(){return this.view.id}get title(){return this.view.title}get viewOf(){if(Ci(this.view.__)||this.view.__==="element"){const e=this.view;return e.viewOf?this.model.element(e.viewOf):null}return null}get tags(){return this.view.tags??[]}roots(){return[...this._rootElements]}elements(){return[...this._elements.values()]}element(e){return et(this._elements.get(e),`LikeC4DiagramModel.Element ${e} in view ${this.view.id} not found`)}hasElement(e){return this._elements.has(e)}connections(){return[...this._connections.values()]}connection(e){return et(this._connections.get(e),`Connection ${e} in view ${this.view.id} not found`)}findConnections(e,n,r="direct"){const i=tt(e),s=tt(n);return this.connections().filter(o=>o.source.id===i&&o.target.id===s||r==="both"&&o.source.id===s&&o.target.id===i)}parent(e){const n=this.element(tt(e));return n.node.parent?this.element(n.node.parent):null}children(e){return this.element(tt(e)).node.children.map(n=>this.element(n))}siblings(e){const n=tt(e),r=this.parent(n);return(r?this.children(r):this.roots()).filter(i=>i.id!==n)}ancestors(e){let n=tt(e);const r=[];let i;for(;i=this.parent(n);)r.push(i),n=i.id;return r}descendants(e){return this.children(e).flatMap(n=>[n,...this.descendants(n.id)])}incoming(e,n="all"){const r=this.element(tt(e)),i=r.node.inEdges.map(s=>this.connection(s));return n==="all"||i.length===0?i:i.filter(s=>n==="direct"?s.target.id===r.id:s.target.id!==r.id)}incomers(e,n="all"){return this.incoming(e,n).map(r=>r.source)}outgoing(e,n="all"){const r=this.element(tt(e)),i=r.node.outEdges.map(s=>this.connection(s));return n==="all"||i.length===0?i:i.filter(s=>n==="direct"?s.source.id===r.id:s.source.id!==r.id)}outgoers(e,n="all"){return this.outgoing(e,n).map(r=>r.target)}};(t=>{class e{constructor(i,s){this.node=i,this.view=s}get id(){return this.node.id}get title(){return this.node.title}get kind(){return this.node.kind}get isRoot(){return Ci(this.node.parent)}get hasNested(){return this.node.children.length>0}get shape(){return this.node.shape}get color(){return this.node.color}get tags(){return this.node.tags??[]}get level(){return this.node.level}get depth(){return this.node.depth??0}model(){return this.view.model.element(this.id)}parent(){return this.node.parent?this.view.element(this.node.parent):null}metadata(i,s){return this.model().metadata(i)??s}hasMetadata(i){return this.model().hasMetadata(i)}ancestors(){return this.view.ancestors(this)}siblings(){return this.view.siblings(this)}descendants(){return this.view.descendants(this)}children(){return this.view.children(this)}incoming(i="all"){return this.view.incoming(this,i)}incomers(i="all"){return this.view.incomers(this,i)}outgoing(i="all"){return this.view.outgoing(this,i)}outgoers(i="all"){return this.view.outgoers(this,i)}connectionsTo(i){return this.view.findConnections(this,i)}}t.Element=e;class n{constructor(i,s){this.edge=i,this.view=s}get id(){return this.edge.id}get source(){return this.view.element(this.edge.source)}get target(){return this.view.element(this.edge.target)}get tags(){return this.edge.tags??[]}get color(){return this.edge.color??ms}relationships(){return this.edge.relations.map(i=>et(this.view.model.relationship(i)))}}t.Connection=n})(Ca||(Ca={}));function _O(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Tg={exports:{}},gD;function AO(){if(gD)return Tg.exports;gD=1;var t=function(e,n){var r,i,s=1,o=0,a=0,c=String.alphabet;function u(l,d,f){if(f){for(r=d;f=u(l,r),f<76&&f>65;)++r;return+l.slice(d-1,r)}return f=c&&c.indexOf(l.charAt(d)),f>-1?f+76:(f=l.charCodeAt(d)||0,f<45||f>127?f:f<46?65:f<48?f-1:f<58?f+18:f<65?f-11:f<91?f+11:f<97?f-37:f<123?f+5:f-63)}if((e+="")!=(n+="")){for(;s;)if(i=u(e,o++),s=u(n,a++),i<76&&s<76&&i>66&&s>66&&(i=u(e,o,o),s=u(n,a,o=r),a=r),i!=s)return i<s?-1:1}return 0};try{Tg.exports=t}catch{String.naturalCompare=t}return Tg.exports}var xO=AO();const IO=_O(xO);function fd(t,e){return t===e?0:$a(t)?$a(e)?IO(t,e):1:$a(e)?-1:0}function hd(t){return t!=null&&typeof t=="string"}function vs(t){return!!t&&Array.isArray(t)&&t.length>0}function _a(t){const e=t.lastIndexOf(".");return e>0?t.slice(e+1):t}function Rr(...t){const e=hd(t[0])?t[0]:t[0].id;return(hd(t[1])?t[1]:t[1].id).startsWith(e+".")}function pd(t,e){const n=hd(t)?t:t.id,r=hd(e)?e:e.id;return n===r||r.startsWith(n+".")||n.startsWith(r+".")}function PO(t){const e=t.flatMap(n=>[r=>r.id===n.id,r=>Rr(n,r)]);return n=>e.some(r=>r(n))}function ws(t,e){const n=St(t),r=St(e);if(n===r)return n;if(!n||!r)return null;const i=t.split("."),s=e.split(".");let o=null;for(;i.length>1&&s.length>1&&i[0]&&i[0]===s[0];)o=o?`${o}.${i[0]}`:i[0],i.shift(),s.shift();return o}function St(t){const e=t.lastIndexOf(".");return e>0?t.slice(0,e):null}function mD(t){const e=t+".";return n=>!!n.parent&&(n.parent===t||n.parent.startsWith(e))}function or(t){const e=t.split(".");return e.pop(),e.length===0?[]:e.reduce((n,r,i)=>i===0?(n.push(r),n):(n.unshift(`${n[0]}.${r}`),n),[])}function _o(t,e){const n=t.split(".").length,r=e.split(".").length;switch(!0){case n>r:return 1;case n<r:return-1;default:return 0}}function Rg(t,e){return _o(t.id,e.id)}function NO(t){return t.map(e=>({item:e,fqn:e.id.split(".")})).sort((e,n)=>e.fqn.length-n.fqn.length).map(({item:e})=>e)}let gd=class P0{constructor(e,n){this.view=e,this.model=n;for(const r of e.nodes){const i=new P0.Element(r,this);this._elements.set(r.id,i),Ci(r.parent)&&this._rootElements.add(i)}this._connections=new Map(e.edges.map(r=>[r.id,new P0.Connection(r,this)]))}_rootElements=new Set;_elements=new Map;_connections;get id(){return this.view.id}get title(){return this.view.title}get viewOf(){return this.view.__!=="dynamic"&&this.view.viewOf?this.model.element(this.view.viewOf):null}get tags(){return this.view.tags??[]}roots(){return[...this._rootElements]}elements(){return[...this._elements.values()]}element(e){return et(this._elements.get(e),`LikeC4ViewModel.Element ${e} in view ${this.id} not found`)}hasElement(e){return this._elements.has(e)}connections(){return[...this._connections.values()]}connection(e){return et(this._connections.get(e),`Connection ${e} in view ${this.id} not found`)}findConnections(e,n,r="direct"){const i=tt(e),s=tt(n);return this.connections().filter(o=>o.source.id===i&&o.target.id===s||r==="both"&&o.source.id===s&&o.target.id===i)}parent(e){const n=this.element(tt(e));return n.node.parent?this.element(n.node.parent):null}children(e){return this.element(tt(e)).node.children.map(n=>this.element(n))}siblings(e){const n=tt(e),r=this.parent(n);return(r?this.children(r):this.roots()).filter(i=>i.id!==n)}ancestors(e){let n=tt(e);const r=[];let i;for(;i=this.parent(n);)r.push(i),n=i.id;return r}descendants(e){return this.children(e).flatMap(n=>[n,...this.descendants(n.id)])}incoming(e,n="all"){const r=this.element(tt(e)),i=r.node.inEdges.map(s=>et(this._connections.get(s),`Edge ${s} not found`));return n==="all"||i.length===0?i:i.filter(s=>n==="direct"?s.target.id===r.id:s.target.id!==r.id)}incomers(e,n="all"){return this.incoming(e,n).map(r=>r.source)}outgoing(e,n="all"){const r=this.element(tt(e)),i=r.node.outEdges.map(s=>et(this._connections.get(s),`Edge ${s} not found`));return n==="all"||i.length===0?i:i.filter(s=>n==="direct"?s.source.id===r.id:s.source.id!==r.id)}outgoers(e,n="all"){return this.outgoing(e,n).map(r=>r.target)}};(t=>{class e{constructor(i,s){this.node=i,this.viewmodel=s}get id(){return this.node.id}get title(){return this.node.title}get kind(){return this.node.kind}get isRoot(){return Ci(this.node.parent)}get hasNested(){return this.node.children.length>0}get shape(){return this.node.shape}get color(){return this.node.color}get tags(){return this.node.tags??[]}model(){return this.viewmodel.model.element(this.id)}parent(){return this.node.parent?this.viewmodel.element(this.node.parent):null}metadata(i,s){return this.model().metadata(i)??s}hasMetadata(i){return this.model().hasMetadata(i)}ancestors(){return this.viewmodel.ancestors(this)}siblings(){return this.viewmodel.siblings(this)}descendants(){return this.viewmodel.descendants(this)}children(){return this.viewmodel.children(this)}incoming(i="all"){return this.viewmodel.incoming(this,i)}incomers(i="all"){return this.viewmodel.incomers(this,i)}outgoing(i="all"){return this.viewmodel.outgoing(this,i)}outgoers(i="all"){return this.viewmodel.outgoers(this,i)}connectionsTo(i){return this.viewmodel.findConnections(this,i)}}t.Element=e;class n{constructor(i,s){this.edge=i,this.viewmodel=s}get id(){return this.edge.id}get source(){return this.viewmodel.element(this.edge.source)}get target(){return this.viewmodel.element(this.edge.target)}get tags(){return this.edge.tags??[]}relationships(){return this.edge.relations.map(i=>et(this.viewmodel.model.relationship(i)))}}t.Connection=n})(gd||(gd={}));let Aa=class po{constructor(e,n,r,i){this.type=e,this.sourcemodel=n;for(const s of r)this.addElement(s);for(const s of i)this.addRelation(s)}_elements=new Map;_parents=new Map;_children=new Map;_rootElements=new Set;_relations=new Map;_incoming=new Map;_outgoing=new Map;_internal=new Map;_cacheAscendingSiblings=new Map;_views=new Map;static create(e){return e.__==="layouted"?po.layouted(e):po.computed(e)}static computed(e){const n=new po("computed",e,Co(e.elements),Co(e.relations));for(const r of Co(e.views))n._views.set(r.id,new gd(r,n));return n}static layouted(e){const n=new po("layouted",e,Co(e.elements),Co(e.relations));for(const r of Co(e.views))n._views.set(r.id,new Ca(r,n));return n}roots(){return[...this._rootElements]}elements(){return[...this._elements.values()]}element(e){return et(this._elements.get(e),`Element ${e} not found`)}relationships(){return[...this._relations.values()]}relationship(e){return et(this._relations.get(e),`Relation ${e} not found`)}views(){return[...this._views.values()]}view(e){return et(this._views.get(e),`View ${e} not found`)}parent(e){const n=tt(e);return this._parents.get(n)||null}children(e){const n=tt(e);return this._childrenOf(n)}siblings(e){const n=tt(e),r=this._parents.get(n);return(r?this._childrenOf(r.id):this.roots()).filter(i=>i.id!==n)}ancestors(e){let n=$a(e)?e:e.id;const r=[];let i;for(;i=this._parents.get(n);)r.push(i),n=i.id;return r}descendants(e){const n=tt(e);return this._childrenOf(n).flatMap(r=>[r,...this.descendants(r.id)])}incoming(e,n="all"){const r=tt(e),i=Array.from(this._incomingTo(r));return n==="all"||i.length===0?i:i.filter(s=>n==="direct"?s.target.id===r:s.target.id!==r)}incomers(e,n="all"){return this.incoming(e,n).map(r=>r.source)}outgoing(e,n="all"){const r=tt(e),i=Array.from(this._outgoingFrom(r));return n==="all"||i.length===0?i:i.filter(s=>n==="direct"?s.source.id===r:s.source.id!==r)}outgoers(e,n="all"){return this.outgoing(e,n).map(r=>r.target)}internal(e){const n=tt(e);return Array.from(this._internalOf(n))}ascendingSiblings(e){const n=tt(e);let r=this._cacheAscendingSiblings.get(n);return r||(r=[...this.siblings(n),...this.ancestors(n).flatMap(i=>this.siblings(i.id))],this._cacheAscendingSiblings.set(n,r)),r.slice()}viewsWithElement(e){const n=tt(e);return[...this._views.values()].filter(r=>r.hasElement(n))}addElement(e){if(this._elements.has(e.id))throw new Error(`Element ${e.id} already exists`);const n=new po.ElementModel(e,this);this._elements.set(n.id,n);const r=St(n.id);r?(this._parents.set(n.id,this.element(r)),this._childrenOf(r).push(n)):this._rootElements.add(n)}addRelation(e){if(this._relations.has(e.id))throw new Error(`Relation ${e.id} already exists`);const n=new po.Relationship(e,this);this._relations.set(n.id,n),this._incomingTo(e.target).add(n),this._outgoingFrom(e.source).add(n);const r=ws(e.source,e.target);if(r)for(const i of[r,...or(r)])this._internalOf(i).add(n);for(const i of or(e.source)){if(i===r)break;this._outgoingFrom(i).add(n)}for(const i of or(e.target)){if(i===r)break;this._incomingTo(i).add(n)}}_childrenOf(e){let n=this._children.get(e);return n||(n=[],this._children.set(e,n)),n}_incomingTo(e){let n=this._incoming.get(e);return n||(n=new Set,this._incoming.set(e,n)),n}_outgoingFrom(e){let n=this._outgoing.get(e);return n||(n=new Set,this._outgoing.set(e,n)),n}_internalOf(e){let n=this._internal.get(e);return n||(n=new Set,this._internal.set(e,n)),n}};(t=>{function e(s){return s instanceof t}t.isModel=e,(s=>{function o(a){return a instanceof Ca}s.isLayouted=o})(t.ViewModel||(t.ViewModel={}));function n(s){return s.type==="layouted"}t.isLayouted=n;class r{constructor(o,a){this.relationship=o,this.model=a}get id(){return this.relationship.id}get title(){return this.relationship.title}get kind(){return this.relationship.kind??null}get tags(){return this.relationship.tags??[]}get source(){return this.model.element(this.relationship.source)}get target(){return this.model.element(this.relationship.target)}metadata(o,a){return this.relationship.metadata?.[o]??a}hasMetadata(o){return pD(this.relationship.metadata?.[o])}}t.Relationship=r;class i{constructor(o,a){this.element=o,this.model=a}get id(){return this.element.id}get title(){return this.element.title}get kind(){return this.element.kind}get isRoot(){return St(this.element.id)===null}get hasNested(){return this.model.children(this).length>0}get shape(){return this.element.shape??J0}get color(){return this.element.color??ed}get tags(){return this.element.tags??[]}parent(){return this.model.parent(this)}metadata(o,a){return this.element.metadata?.[o]??a}hasMetadata(o){return pD(this.element.metadata?.[o])}ancestors(){return this.model.ancestors(this)}siblings(){return this.model.siblings(this)}descendants(){return this.model.descendants(this)}children(){return this.model.children(this)}views(){return this.model.viewsWithElement(this)}incoming(o){return this.model.incoming(this,o)}incomers(o){return this.model.incomers(this,o)}outgoing(o){return this.model.outgoing(this,o)}outgoers(o){return this.model.outgoers(this,o)}internal(){return this.model.internal(this)}}t.ElementModel=i})(Aa||(Aa={}));const OO="LIKEC4_DELAY";function yD(...t){let e=100;return t.length===2?e=CO(t[0],t[1]):t.length===1&&(e=t[0]),new Promise(n=>{setTimeout(()=>{n(OO)},e??100)})}const xa=(t,e)=>{const n=ws(t.source,t.target),r=ws(e.source,e.target);if(n&&!r)return 1;if(!n&&r)return-1;const i=n&&r?_o(n,r):0;if(i!==0)return i;const s=_o(t.source,e.source);return s!==0?s:_o(t.target,e.target)};function Sg(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 kg(t,e,n=".",r){if(!Sg(e))return kg(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]]:Sg(o)&&Sg(i[s])?i[s]=kg(o,i[s],(n?`${n}.`:"")+s.toString(),r):i[s]=o))}return i}function FO(t){return(...e)=>e.reduce((n,r)=>kg(n,r,"",t),{})}const $g=FO();function ht(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function Un(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}function LO(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function md(t){return typeof t=="object"&&t!==null&&ht(t.container)&&Un(t.reference)&&typeof t.message=="string"}class vD{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,n){return ht(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 Qr(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function bs(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function wD(t){return Qr(t)&&typeof t.fullText=="string"}class Ct{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 Ct(()=>({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 Kt})}join(e=","){const n=this.iterator();let r="",i,s=!1;do i=n.next(),i.done||(s&&(r+=e),r+=MO(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 Ct(this.startFn,n=>{const{done:r,value:i}=this.nextFn(n);return r?Kt:{done:!1,value:e(i)}})}filter(e){return new Ct(this.startFn,n=>{let r;do if(r=this.nextFn(n),!r.done&&e(r.value))return r;while(!r.done);return Kt})}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 Ct(()=>({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(yd(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(n.iterator);return Kt})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const n=e>1?this.flat(e-1):this;return new Ct(()=>({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(yd(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(r.iterator);return Kt})}head(){const n=this.iterator().next();if(!n.done)return n.value}tail(e=1){return new Ct(()=>{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 Ct(()=>({size:0,state:this.startFn()}),n=>(n.size++,n.size>e?Kt:this.nextFn(n.state)))}distinct(e){return new Ct(()=>({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 Kt})}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 MO(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function yd(t){return!!t&&typeof t[Symbol.iterator]=="function"}const Ao=new Ct(()=>{},()=>Kt),Kt=Object.freeze({done:!0,value:void 0});function He(...t){if(t.length===1){const e=t[0];if(e instanceof Ct)return e;if(yd(e))return new Ct(()=>e[Symbol.iterator](),n=>n.next());if(typeof e.length=="number")return new Ct(()=>({index:0}),n=>n.index<e.length?{done:!1,value:e[n.index++]}:Kt)}return t.length>1?new Ct(()=>({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++];yd(n)?e.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(e.array=n)}}while(e.iterator||e.array||e.collIndex<t.length);return Kt}):Ao}class xo extends Ct{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 Kt})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Cg;(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})(Cg||(Cg={}));function Ia(t){return new xo(t,e=>Qr(e)?e.content:[],{includeRoot:!0})}function bD(t){return Ia(t).filter(bs)}function DD(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function vd(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function Pa(t){if(!t)return;const{offset:e,end:n,range:r}=t;return{range:r,offset:e,end:n,length:n-e}}var Sr;(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"})(Sr||(Sr={}));function ED(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return Sr.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return Sr.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?Sr.Inside:n?Sr.OverlapBack:r?Sr.OverlapFront:Sr.Outside}function _g(t,e){return ED(t,e)>Sr.After}const Ag=/^[\w\p{L}]$/u;function xi(t,e,n=Ag){if(t){if(e>0){const r=e-t.offset,i=t.text.charAt(r);n.test(i)||e--}return Ig(t,e)}}function wd(t,e){if(t){const n=RD(t,!0);if(n&&xg(n,e))return n;if(wD(t)){const r=t.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){const s=t.content[i];if(xg(s,e))return s}}}}function xg(t,e){return bs(t)&&e.includes(t.tokenType.name)}function Ig(t,e){if(bs(t))return t;if(Qr(t)){const n=TD(t,e,!1);if(n)return Ig(n,e)}}function bd(t,e){if(bs(t))return t;if(Qr(t)){const n=TD(t,e,!0);if(n)return bd(n,e)}}function TD(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 RD(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 SD(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 zO(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 kD(t,e){const n=BO(t,e);return n?n.parent.content.slice(n.a+1,n.b):[]}function BO(t,e){const n=$D(t),r=$D(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 $D(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 jO={__proto__:null,DefaultNameRegexp:Ag,get RangeComparison(){return Sr},compareRange:ED,findCommentNode:wd,findDeclarationNodeAtOffset:xi,findLeafNodeAtOffset:Ig,findLeafNodeBeforeOffset:bd,flattenCst:bD,getInteriorNodes:kD,getNextNode:SD,getPreviousNode:RD,getStartlineNode:zO,inRange:_g,isChildNode:DD,isCommentNode:xg,streamCst:Ia,toDocumentSegment:Pa,tokenToRange:vd};class CD extends Error{constructor(e,n){super(e?`${n} at ${e.range.start.line}:${e.range.start.character}`:n)}}function Dd(t){throw new Error("Error! The input value was not handled.")}const Ed="AbstractRule",Td="AbstractType",Pg="Condition",_D="TypeDefinition",Ng="ValueLiteral",Na="AbstractElement";function Og(t){return xe.isInstance(t,Na)}const Rd="ArrayLiteral",Oa="ArrayType";function qO(t){return xe.isInstance(t,Oa)}const Fa="BooleanLiteral";function UO(t){return xe.isInstance(t,Fa)}const La="Conjunction";function WO(t){return xe.isInstance(t,La)}const Ma="Disjunction";function GO(t){return xe.isInstance(t,Ma)}const Sd="Grammar",Fg="GrammarImport",za="InferredType";function AD(t){return xe.isInstance(t,za)}const Ba="Interface";function xD(t){return xe.isInstance(t,Ba)}const Lg="NamedArgument",ja="Negation";function HO(t){return xe.isInstance(t,ja)}const kd="NumberLiteral",$d="Parameter",qa="ParameterReference";function KO(t){return xe.isInstance(t,qa)}const Ua="ParserRule";function Vt(t){return xe.isInstance(t,Ua)}const Wa="ReferenceType";function VO(t){return xe.isInstance(t,Wa)}const Cd="ReturnType";function YO(t){return xe.isInstance(t,Cd)}const Ga="SimpleType";function ID(t){return xe.isInstance(t,Ga)}const _d="StringLiteral",Io="TerminalRule";function ei(t){return xe.isInstance(t,Io)}const Ha="Type";function Mg(t){return xe.isInstance(t,Ha)}const zg="TypeAttribute",Ka="UnionType";function XO(t){return xe.isInstance(t,Ka)}const Va="Action";function Ds(t){return xe.isInstance(t,Va)}const Ya="Alternatives";function Bg(t){return xe.isInstance(t,Ya)}const Xa="Assignment";function kr(t){return xe.isInstance(t,Xa)}const Ja="CharacterRange";function JO(t){return xe.isInstance(t,Ja)}const Za="CrossReference";function Qa(t){return xe.isInstance(t,Za)}const ec="EndOfFile";function ZO(t){return xe.isInstance(t,ec)}const tc="Group";function Ii(t){return xe.isInstance(t,tc)}const nc="Keyword";function $r(t){return xe.isInstance(t,nc)}const rc="NegatedToken";function QO(t){return xe.isInstance(t,rc)}const ic="RegexToken";function eF(t){return xe.isInstance(t,ic)}const sc="RuleCall";function ti(t){return xe.isInstance(t,sc)}const oc="TerminalAlternatives";function tF(t){return xe.isInstance(t,oc)}const ac="TerminalGroup";function nF(t){return xe.isInstance(t,ac)}const cc="TerminalRuleCall";function PD(t){return xe.isInstance(t,cc)}const uc="UnorderedGroup";function jg(t){return xe.isInstance(t,uc)}const lc="UntilToken";function rF(t){return xe.isInstance(t,lc)}const dc="Wildcard";function iF(t){return xe.isInstance(t,dc)}class ND extends vD{getAllTypes(){return[Na,Ed,Td,Va,Ya,Rd,Oa,Xa,Fa,Ja,Pg,La,Za,Ma,ec,Sd,Fg,tc,za,Ba,nc,Lg,rc,ja,kd,$d,qa,Ua,Wa,ic,Cd,sc,Ga,_d,oc,ac,Io,cc,Ha,zg,_D,Ka,uc,lc,Ng,dc]}computeIsSubtype(e,n){switch(e){case Va:case Ya:case Xa:case Ja:case Za:case ec:case tc:case nc:case rc:case ic:case sc:case oc:case ac:case cc:case uc:case lc:case dc:return this.isSubtype(Na,n);case Rd:case kd:case _d:return this.isSubtype(Ng,n);case Oa:case Wa:case Ga:case Ka:return this.isSubtype(_D,n);case Fa:return this.isSubtype(Pg,n)||this.isSubtype(Ng,n);case La:case Ma:case ja:case qa:return this.isSubtype(Pg,n);case za:case Ba:case Ha:return this.isSubtype(Td,n);case Ua:return this.isSubtype(Ed,n)||this.isSubtype(Td,n);case Io:return this.isSubtype(Ed,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 Td;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return Ed;case"Grammar:usedGrammars":return Sd;case"NamedArgument:parameter":case"ParameterReference:parameter":return $d;case"TerminalRuleCall:rule":return Io;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case Na:return{name:Na,properties:[{name:"cardinality"},{name:"lookahead"}]};case Rd:return{name:Rd,properties:[{name:"elements",defaultValue:[]}]};case Oa:return{name:Oa,properties:[{name:"elementType"}]};case Fa:return{name:Fa,properties:[{name:"true",defaultValue:!1}]};case La:return{name:La,properties:[{name:"left"},{name:"right"}]};case Ma:return{name:Ma,properties:[{name:"left"},{name:"right"}]};case Sd:return{name:Sd,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 Fg:return{name:Fg,properties:[{name:"path"}]};case za:return{name:za,properties:[{name:"name"}]};case Ba:return{name:Ba,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case Lg:return{name:Lg,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case ja:return{name:ja,properties:[{name:"value"}]};case kd:return{name:kd,properties:[{name:"value"}]};case $d:return{name:$d,properties:[{name:"name"}]};case qa:return{name:qa,properties:[{name:"parameter"}]};case Ua:return{name:Ua,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 Wa:return{name:Wa,properties:[{name:"referenceType"}]};case Cd:return{name:Cd,properties:[{name:"name"}]};case Ga:return{name:Ga,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case _d:return{name:_d,properties:[{name:"value"}]};case Io:return{name:Io,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case Ha:return{name:Ha,properties:[{name:"name"},{name:"type"}]};case zg:return{name:zg,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case Ka:return{name:Ka,properties:[{name:"types",defaultValue:[]}]};case Va:return{name:Va,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case Ya:return{name:Ya,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Xa:return{name:Xa,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case Ja:return{name:Ja,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case Za:return{name:Za,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case ec:return{name:ec,properties:[{name:"cardinality"},{name:"lookahead"}]};case tc:return{name:tc,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case nc:return{name:nc,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case rc:return{name:rc,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case ic:return{name:ic,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case sc:return{name:sc,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case oc:return{name:oc,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case ac:return{name:ac,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case cc:return{name:cc,properties:[{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:"lookahead"},{name:"terminal"}]};case dc:return{name:dc,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const xe=new ND;function qg(t){for(const[e,n]of Object.entries(t))e.startsWith("$")||(Array.isArray(n)?n.forEach((r,i)=>{ht(r)&&(r.$container=t,r.$containerProperty=e,r.$containerIndex=i)}):ht(n)&&(n.$container=t,n.$containerProperty=e))}function yn(t,e){let n=t;for(;n;){if(e(n))return n;n=n.$container}}function Ug(t,e){let n=t;for(;n;){if(e(n))return!0;n=n.$container}return!1}function nn(t){const n=Ad(t).$document;if(!n)throw new Error("AST node has no document.");return n}function Ad(t){for(;t.$container;)t=t.$container;return t}function fc(t,e){if(!t)throw new Error("Node must be an AstNode.");const n=e?.range;return new Ct(()=>({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(ht(s)){if(r.keyIndex++,Wg(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(ht(a)&&Wg(a,n))return{done:!1,value:a}}r.arrayIndex=0}}r.keyIndex++}return Kt})}function Cr(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new xo(t,n=>fc(n,e))}function ni(t,e){if(t){if(e?.range&&!Wg(t,e.range))return new xo(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new xo(t,n=>fc(n,e),{includeRoot:!0})}function Wg(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)===null||n===void 0?void 0:n.range;return r?_g(r,e):!1}function xd(t){return new Ct(()=>({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(Un(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(Un(s))return{done:!1,value:{reference:s,container:t,property:n,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Kt})}function sF(t,e=nn(t).parseResult.value){const n=[];return ni(e).forEach(r=>{xd(r).forEach(i=>{i.reference.ref===t&&n.push(i.reference)})}),He(n)}function Gg(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]=OD(i.defaultValue))}function OD(t){return Array.isArray(t)?[...t.map(OD)]:t}function Hg(t,e){const n={$type:t.$type};for(const[r,i]of Object.entries(t))if(!r.startsWith("$"))if(ht(i))n[r]=Hg(i,e);else if(Un(i))n[r]=e(n,r,i.$refNode,i.$refText);else if(Array.isArray(i)){const s=[];for(const o of i)ht(o)?s.push(Hg(o,e)):Un(o)?s.push(e(n,r,o.$refNode,o.$refText)):s.push(o);n[r]=s}else n[r]=i;return qg(n),n}const Id={__proto__:null,assignMandatoryProperties:Gg,copyAstNode:Hg,findLocalReferences:sF,findRootNode:Ad,getContainerOfType:yn,getDocument:nn,hasContainerOfType:Ug,linkContentToContainer:qg,streamAllContents:Cr,streamAst:ni,streamContents:fc,streamReferences:xd};function pe(t){return t.charCodeAt(0)}function Kg(t,e){Array.isArray(t)?t.forEach(function(n){e.push(n)}):e.push(t)}function hc(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function Po(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function oF(){throw Error("Internal Error - Should never get here!")}function FD(t){return t.type==="Character"}const Pd=[];for(let t=pe("0");t<=pe("9");t++)Pd.push(t);const Nd=[pe("_")].concat(Pd);for(let t=pe("a");t<=pe("z");t++)Nd.push(t);for(let t=pe("A");t<=pe("Z");t++)Nd.push(t);const LD=[pe(" "),pe("\f"),pe(`
2
- `),pe("\r"),pe(" "),pe("\v"),pe(" "),pe("\xA0"),pe("\u1680"),pe("\u2000"),pe("\u2001"),pe("\u2002"),pe("\u2003"),pe("\u2004"),pe("\u2005"),pe("\u2006"),pe("\u2007"),pe("\u2008"),pe("\u2009"),pe("\u200A"),pe("\u2028"),pe("\u2029"),pe("\u202F"),pe("\u205F"),pe("\u3000"),pe("\uFEFF")],aF=/[0-9a-fA-F]/,Od=/[0-9]/,cF=/[1-9]/;class MD{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":hc(r,"global");break;case"i":hc(r,"ignoreCase");break;case"m":hc(r,"multiLine");break;case"u":hc(r,"unicode");break;case"y":hc(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}Po(n);const r=this.disjunction();return this.consumeChar(")"),{type:n,value:r,loc:this.loc(e)}}return oF()}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;Po(n);break}if(!(e===!0&&n===void 0)&&Po(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()),Po(e))return e.loc=this.loc(n),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[pe(`
3
- `),pe("\r"),pe("\u2028"),pe("\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=Pd;break;case"D":e=Pd,n=!0;break;case"s":e=LD;break;case"S":e=LD,n=!0;break;case"w":e=Nd;break;case"W":e=Nd,n=!0;break}if(Po(e))return{type:"Set",value:e,complement:n}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=pe("\f");break;case"n":e=pe(`
4
- `);break;case"r":e=pe("\r");break;case"t":e=pe(" ");break;case"v":e=pe("\v");break}if(Po(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:pe("\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:pe(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:pe(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,FD(r)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,FD(i)){if(i.value<r.value)throw Error("Range out of order in character class");e.push({from:r.value,to:i.value})}else Kg(r.value,e),e.push(pe("-")),Kg(i.value,e)}else Kg(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:pe("\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(cF.test(e)===!1)throw Error("Expecting a positive integer");for(;Od.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Od.test(e)===!1)throw Error("Expecting an integer");for(;Od.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:pe(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 Od.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(aF.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 Fd{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 zD=/\r?\n/gm,uF=new MD;class lF extends Fd{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=Ld(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 Vg=new lF;function dF(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),Vg.reset(t),Vg.visit(uF.pattern(t)),Vg.multiline}catch{return!1}}const fF=`\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 Yg(t){const e=typeof t=="string"?new RegExp(t):t;return fF.some(n=>e.test(n))}function Ld(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function hF(t){return Array.prototype.map.call(t,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:Ld(e)).join("")}function pF(t,e){const n=gF(t),r=e.match(n);return!!r&&r[0].length>0}function gF(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 Md(t){return t.rules.find(e=>Vt(e)&&e.entry)}function BD(t){return t.rules.filter(e=>ei(e)&&e.hidden)}function Xg(t,e){const n=new Set,r=Md(t);if(!r)return new Set(t.rules);const i=[r].concat(BD(t));for(const o of i)jD(o,n,e);const s=new Set;for(const o of t.rules)(n.has(o.name)||ei(o)&&o.hidden)&&s.add(o);return s}function jD(t,e,n){e.add(t.name),Cr(t).forEach(r=>{if(ti(r)||n&&PD(r)){const i=r.rule.ref;i&&!e.has(i.name)&&jD(i,e,n)}})}function Jg(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=tm(t.type.ref);return e?.terminal}}function qD(t){return t.hidden&&!Yg(mc(t))}function No(t,e){return!t||!e?[]:Zg(t,e,t.astNode,!0)}function Cn(t,e,n){if(!t||!e)return;const r=Zg(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 Zg(t,e,n,r){if(!r){const i=yn(t.grammarSource,kr);if(i&&i.feature===e)return[t]}return Qr(t)&&t.astNode===n?t.content.flatMap(i=>Zg(i,e,n,!1)):[]}function Qg(t,e){return t?em(t,e,t?.astNode):[]}function pc(t,e,n){if(!t)return;const r=em(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 em(t,e,n){if(t.astNode!==n)return[];if($r(t.grammarSource)&&t.grammarSource.value===e)return[t];const r=Ia(t).iterator();let i;const s=[];do if(i=r.next(),!i.done){const o=i.value;o.astNode===n?$r(o.grammarSource)&&o.grammarSource.value===e&&s.push(o):r.prune()}while(!i.done);return s}function UD(t){var e;const n=t.astNode;for(;n===((e=t.container)===null||e===void 0?void 0:e.astNode);){const r=yn(t.grammarSource,kr);if(r)return r;t=t.container}}function tm(t){let e=t;return AD(e)&&(Ds(e.$container)?e=e.$container.$container:Vt(e.$container)?e=e.$container:Dd(e.$container)),WD(t,e,new Map)}function WD(t,e,n){var r;function i(s,o){let a;return yn(s,kr)||(a=WD(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 Cr(e)){if(kr(s)&&s.feature.toLowerCase()==="name")return n.set(t,s),s;if(ti(s)&&Vt(s.rule.ref))return i(s,s.rule.ref);if(ID(s)&&(!((r=s.typeRef)===null||r===void 0)&&r.ref))return i(s,s.typeRef.ref)}}function GD(t){const e=t.$container;if(Ii(e)){const n=e.elements,r=n.indexOf(t);for(let i=r-1;i>=0;i--){const s=n[i];if(Ds(s))return s;{const o=Cr(n[i]).find(Ds);if(o)return o}}}if(Og(e))return GD(e)}function Oo(t,e){return t==="?"||t==="*"||Ii(e)&&!!e.guardCondition}function HD(t){return t==="*"||t==="+"}function mF(t){return t==="+="}function zd(t){return KD(t,new Set)}function KD(t,e){if(e.has(t))return!0;e.add(t);for(const n of Cr(t))if(ti(n)){if(!n.rule.ref||Vt(n.rule.ref)&&!KD(n.rule.ref,e))return!1}else{if(kr(n))return!1;if(Ds(n))return!1}return!!t.definition}function yF(t){return nm(t.type,new Set)}function nm(t,e){if(e.has(t))return!0;if(e.add(t),qO(t))return!1;if(VO(t))return!1;if(XO(t))return t.types.every(n=>nm(n,e));if(ID(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 Mg(n)?nm(n.type,e):!1}else return!1}else return!1}function Es(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(Vt(e))return e.name;if(xD(e)||Mg(e))return e.name}}}function gc(t){var e;if(Vt(t))return zd(t)?t.name:(e=Es(t))!==null&&e!==void 0?e:t.name;if(xD(t)||Mg(t)||YO(t))return t.name;if(Ds(t)){const n=VD(t);if(n)return n}else if(AD(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function VD(t){var e;if(t.inferredType)return t.inferredType.name;if(!((e=t.type)===null||e===void 0)&&e.ref)return gc(t.type.ref)}function vF(t){var e,n,r;return ei(t)?(n=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:"string":zd(t)?t.name:(r=Es(t))!==null&&r!==void 0?r:t.name}function YD(t){var e,n,r;return ei(t)?(n=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:"string":(r=Es(t))!==null&&r!==void 0?r:t.name}function mc(t){const e={s:!1,i:!1,u:!1},n=Fo(t.definition,e),r=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(n,r)}const rm=/[\s\S]/.source;function Fo(t,e){if(tF(t))return wF(t);if(nF(t))return bF(t);if(JO(t))return TF(t);if(PD(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return ri(Fo(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}else{if(QO(t))return EF(t);if(rF(t))return DF(t);if(eF(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")),ri(r,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}else{if(iF(t))return ri(rm,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${t?.$type}`)}}}function wF(t){return ri(t.elements.map(e=>Fo(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function bF(t){return ri(t.elements.map(e=>Fo(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function DF(t){return ri(`${rm}*?${Fo(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function EF(t){return ri(`(?!${Fo(t.terminal)})${rm}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function TF(t){return t.right?ri(`[${im(t.left)}-${im(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):ri(im(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function im(t){return Ld(t.value)}function ri(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 Bd={__proto__:null,findAssignment:UD,findNameAssignment:tm,findNodeForKeyword:pc,findNodeForProperty:Cn,findNodesForKeyword:Qg,findNodesForKeywordInternal:em,findNodesForProperty:No,getActionAtElement:GD,getActionType:VD,getAllReachableRules:Xg,getCrossReferenceTerminal:Jg,getEntryRule:Md,getExplicitRuleType:Es,getHiddenRules:BD,getRuleType:YD,getRuleTypeName:vF,getTypeName:gc,isArrayCardinality:HD,isArrayOperator:mF,isCommentTerminal:qD,isDataType:yF,isDataTypeRule:zd,isOptionalCardinality:Oo,terminalRegex:mc};function RF(t){const e=[],n=t.Grammar;for(const r of n.rules)ei(r)&&qD(r)&&dF(mc(r))&&e.push(r.name);return{multilineCommentRules:e,nameRegexp:Ag}}var XD=typeof global=="object"&&global&&global.Object===Object&&global,SF=typeof self=="object"&&self&&self.Object===Object&&self,_r=XD||SF||Function("return this")(),Wn=_r.Symbol,JD=Object.prototype,kF=JD.hasOwnProperty,$F=JD.toString,yc=Wn?Wn.toStringTag:void 0;function CF(t){var e=kF.call(t,yc),n=t[yc];try{t[yc]=void 0;var r=!0}catch{}var i=$F.call(t);return r&&(e?t[yc]=n:delete t[yc]),i}var _F=Object.prototype,AF=_F.toString;function xF(t){return AF.call(t)}var IF="[object Null]",PF="[object Undefined]",ZD=Wn?Wn.toStringTag:void 0;function Pi(t){return t==null?t===void 0?PF:IF:ZD&&ZD in Object(t)?CF(t):xF(t)}function ar(t){return t!=null&&typeof t=="object"}var NF="[object Symbol]";function vc(t){return typeof t=="symbol"||ar(t)&&Pi(t)==NF}function jd(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 Ie=Array.isArray,OF=1/0,QD=Wn?Wn.prototype:void 0,eE=QD?QD.toString:void 0;function tE(t){if(typeof t=="string")return t;if(Ie(t))return jd(t,tE)+"";if(vc(t))return eE?eE.call(t):"";var e=t+"";return e=="0"&&1/t==-OF?"-0":e}var FF=/\s/;function LF(t){for(var e=t.length;e--&&FF.test(t.charAt(e)););return e}var MF=/^\s+/;function zF(t){return t&&t.slice(0,LF(t)+1).replace(MF,"")}function Gn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var nE=NaN,BF=/^[-+]0x[0-9a-f]+$/i,jF=/^0b[01]+$/i,qF=/^0o[0-7]+$/i,UF=parseInt;function WF(t){if(typeof t=="number")return t;if(vc(t))return nE;if(Gn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Gn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=zF(t);var n=jF.test(t);return n||qF.test(t)?UF(t.slice(2),n?2:8):BF.test(t)?nE:+t}var rE=1/0,GF=17976931348623157e292;function HF(t){if(!t)return t===0?t:0;if(t=WF(t),t===rE||t===-rE){var e=t<0?-1:1;return e*GF}return t===t?t:0}function qd(t){var e=HF(t),n=e%1;return e===e?n?e-n:e:0}function Ts(t){return t}var KF="[object AsyncFunction]",VF="[object Function]",YF="[object GeneratorFunction]",XF="[object Proxy]";function ii(t){if(!Gn(t))return!1;var e=Pi(t);return e==VF||e==YF||e==KF||e==XF}var sm=_r["__core-js_shared__"],iE=function(){var t=/[^.]+$/.exec(sm&&sm.keys&&sm.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function JF(t){return!!iE&&iE in t}var ZF=Function.prototype,QF=ZF.toString;function Rs(t){if(t!=null){try{return QF.call(t)}catch{}try{return t+""}catch{}}return""}var eL=/[\\^$.*+?()[\]{}|]/g,tL=/^\[object .+?Constructor\]$/,nL=Function.prototype,rL=Object.prototype,iL=nL.toString,sL=rL.hasOwnProperty,oL=RegExp("^"+iL.call(sL).replace(eL,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function aL(t){if(!Gn(t)||JF(t))return!1;var e=ii(t)?oL:tL;return e.test(Rs(t))}function cL(t,e){return t?.[e]}function Ss(t,e){var n=cL(t,e);return aL(n)?n:void 0}var om=Ss(_r,"WeakMap"),sE=Object.create,uL=function(){function t(){}return function(e){if(!Gn(e))return{};if(sE)return sE(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function lL(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 xt(){}function dL(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var fL=800,hL=16,pL=Date.now;function gL(t){var e=0,n=0;return function(){var r=pL(),i=hL-(r-n);if(n=r,i>0){if(++e>=fL)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function mL(t){return function(){return t}}var Ud=function(){try{var t=Ss(Object,"defineProperty");return t({},"",{}),t}catch{}}(),yL=Ud?function(t,e){return Ud(t,"toString",{configurable:!0,enumerable:!1,value:mL(e),writable:!0})}:Ts,vL=gL(yL);function oE(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function aE(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 wL(t){return t!==t}function bL(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function am(t,e,n){return e===e?bL(t,e,n):aE(t,wL,n)}function cE(t,e){var n=t==null?0:t.length;return!!n&&am(t,e,0)>-1}var DL=9007199254740991,EL=/^(?:0|[1-9]\d*)$/;function Wd(t,e){var n=typeof t;return e=e??DL,!!e&&(n=="number"||n!="symbol"&&EL.test(t))&&t>-1&&t%1==0&&t<e}function cm(t,e,n){e=="__proto__"&&Ud?Ud(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function wc(t,e){return t===e||t!==t&&e!==e}var TL=Object.prototype,RL=TL.hasOwnProperty;function Gd(t,e,n){var r=t[e];(!(RL.call(t,e)&&wc(r,n))||n===void 0&&!(e in t))&&cm(t,e,n)}function um(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?cm(n,a,c):Gd(n,a,c)}return n}var uE=Math.max;function SL(t,e,n){return e=uE(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=uE(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),lL(t,this,a)}}function lm(t,e){return vL(SL(t,e,Ts),t+"")}var kL=9007199254740991;function dm(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=kL}function Ar(t){return t!=null&&dm(t.length)&&!ii(t)}function lE(t,e,n){if(!Gn(n))return!1;var r=typeof e;return(r=="number"?Ar(n)&&Wd(e,n.length):r=="string"&&e in n)?wc(n[e],t):!1}function $L(t){return lm(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&&lE(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 CL=Object.prototype;function bc(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||CL;return t===n}function _L(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var AL="[object Arguments]";function dE(t){return ar(t)&&Pi(t)==AL}var fE=Object.prototype,xL=fE.hasOwnProperty,IL=fE.propertyIsEnumerable,Hd=dE(function(){return arguments}())?dE:function(t){return ar(t)&&xL.call(t,"callee")&&!IL.call(t,"callee")},PL=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function si(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}function NL(){return!1}var hE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,pE=hE&&typeof module=="object"&&module&&!module.nodeType&&module,OL=pE&&pE.exports===hE,gE=OL?_r.Buffer:void 0,FL=gE?gE.isBuffer:void 0,Dc=FL||NL,LL="[object Arguments]",ML="[object Array]",zL="[object Boolean]",BL="[object Date]",jL="[object Error]",qL="[object Function]",UL="[object Map]",WL="[object Number]",GL="[object Object]",HL="[object RegExp]",KL="[object Set]",VL="[object String]",YL="[object WeakMap]",XL="[object ArrayBuffer]",JL="[object DataView]",ZL="[object Float32Array]",QL="[object Float64Array]",eM="[object Int8Array]",tM="[object Int16Array]",nM="[object Int32Array]",rM="[object Uint8Array]",iM="[object Uint8ClampedArray]",sM="[object Uint16Array]",oM="[object Uint32Array]",nt={};nt[ZL]=nt[QL]=nt[eM]=nt[tM]=nt[nM]=nt[rM]=nt[iM]=nt[sM]=nt[oM]=!0,nt[LL]=nt[ML]=nt[XL]=nt[zL]=nt[JL]=nt[BL]=nt[jL]=nt[qL]=nt[UL]=nt[WL]=nt[GL]=nt[HL]=nt[KL]=nt[VL]=nt[YL]=!1;function aM(t){return ar(t)&&dm(t.length)&&!!nt[Pi(t)]}function Kd(t){return function(e){return t(e)}}var mE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ec=mE&&typeof module=="object"&&module&&!module.nodeType&&module,cM=Ec&&Ec.exports===mE,fm=cM&&XD.process,Ni=function(){try{var t=Ec&&Ec.require&&Ec.require("util").types;return t||fm&&fm.binding&&fm.binding("util")}catch{}}(),yE=Ni&&Ni.isTypedArray,hm=yE?Kd(yE):aM,uM=Object.prototype,lM=uM.hasOwnProperty;function vE(t,e){var n=Ie(t),r=!n&&Hd(t),i=!n&&!r&&Dc(t),s=!n&&!r&&!i&&hm(t),o=n||r||i||s,a=o?_L(t.length,String):[],c=a.length;for(var u in t)(e||lM.call(t,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Wd(u,c)))&&a.push(u);return a}function wE(t,e){return function(n){return t(e(n))}}var dM=wE(Object.keys,Object),fM=Object.prototype,hM=fM.hasOwnProperty;function bE(t){if(!bc(t))return dM(t);var e=[];for(var n in Object(t))hM.call(t,n)&&n!="constructor"&&e.push(n);return e}function Hn(t){return Ar(t)?vE(t):bE(t)}var pM=Object.prototype,gM=pM.hasOwnProperty,_n=$L(function(t,e){if(bc(e)||Ar(e)){um(e,Hn(e),t);return}for(var n in e)gM.call(e,n)&&Gd(t,n,e[n])});function mM(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var yM=Object.prototype,vM=yM.hasOwnProperty;function wM(t){if(!Gn(t))return mM(t);var e=bc(t),n=[];for(var r in t)r=="constructor"&&(e||!vM.call(t,r))||n.push(r);return n}function DE(t){return Ar(t)?vE(t,!0):wM(t)}var bM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,DM=/^\w*$/;function pm(t,e){if(Ie(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||vc(t)?!0:DM.test(t)||!bM.test(t)||e!=null&&t in Object(e)}var Tc=Ss(Object,"create");function EM(){this.__data__=Tc?Tc(null):{},this.size=0}function TM(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var RM="__lodash_hash_undefined__",SM=Object.prototype,kM=SM.hasOwnProperty;function $M(t){var e=this.__data__;if(Tc){var n=e[t];return n===RM?void 0:n}return kM.call(e,t)?e[t]:void 0}var CM=Object.prototype,_M=CM.hasOwnProperty;function AM(t){var e=this.__data__;return Tc?e[t]!==void 0:_M.call(e,t)}var xM="__lodash_hash_undefined__";function IM(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Tc&&e===void 0?xM:e,this}function ks(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])}}ks.prototype.clear=EM,ks.prototype.delete=TM,ks.prototype.get=$M,ks.prototype.has=AM,ks.prototype.set=IM;function PM(){this.__data__=[],this.size=0}function Vd(t,e){for(var n=t.length;n--;)if(wc(t[n][0],e))return n;return-1}var NM=Array.prototype,OM=NM.splice;function FM(t){var e=this.__data__,n=Vd(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():OM.call(e,n,1),--this.size,!0}function LM(t){var e=this.__data__,n=Vd(e,t);return n<0?void 0:e[n][1]}function MM(t){return Vd(this.__data__,t)>-1}function zM(t,e){var n=this.__data__,r=Vd(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function oi(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])}}oi.prototype.clear=PM,oi.prototype.delete=FM,oi.prototype.get=LM,oi.prototype.has=MM,oi.prototype.set=zM;var Rc=Ss(_r,"Map");function BM(){this.size=0,this.__data__={hash:new ks,map:new(Rc||oi),string:new ks}}function jM(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Yd(t,e){var n=t.__data__;return jM(e)?n[typeof e=="string"?"string":"hash"]:n.map}function qM(t){var e=Yd(this,t).delete(t);return this.size-=e?1:0,e}function UM(t){return Yd(this,t).get(t)}function WM(t){return Yd(this,t).has(t)}function GM(t,e){var n=Yd(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function ai(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])}}ai.prototype.clear=BM,ai.prototype.delete=qM,ai.prototype.get=UM,ai.prototype.has=WM,ai.prototype.set=GM;var HM="Expected a function";function gm(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(HM);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(gm.Cache||ai),n}gm.Cache=ai;var KM=500;function VM(t){var e=gm(t,function(r){return n.size===KM&&n.clear(),r}),n=e.cache;return e}var YM=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,XM=/\\(\\)?/g,JM=VM(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(YM,function(n,r,i,s){e.push(i?s.replace(XM,"$1"):r||n)}),e});function ZM(t){return t==null?"":tE(t)}function Xd(t,e){return Ie(t)?t:pm(t,e)?[t]:JM(ZM(t))}var QM=1/0;function Sc(t){if(typeof t=="string"||vc(t))return t;var e=t+"";return e=="0"&&1/t==-QM?"-0":e}function mm(t,e){e=Xd(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Sc(e[n++])];return n&&n==r?t:void 0}function e3(t,e,n){var r=t==null?void 0:mm(t,e);return r===void 0?n:r}function ym(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var EE=Wn?Wn.isConcatSpreadable:void 0;function t3(t){return Ie(t)||Hd(t)||!!(EE&&t&&t[EE])}function vm(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=t3),i||(i=[]);++s<o;){var a=t[s];n(a)?ym(i,a):r||(i[i.length]=a)}return i}function Kn(t){var e=t==null?0:t.length;return e?vm(t):[]}var TE=wE(Object.getPrototypeOf,Object);function RE(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 n3(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 r3(){this.__data__=new oi,this.size=0}function i3(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function s3(t){return this.__data__.get(t)}function o3(t){return this.__data__.has(t)}var a3=200;function c3(t,e){var n=this.__data__;if(n instanceof oi){var r=n.__data__;if(!Rc||r.length<a3-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new ai(r)}return n.set(t,e),this.size=n.size,this}function xr(t){var e=this.__data__=new oi(t);this.size=e.size}xr.prototype.clear=r3,xr.prototype.delete=i3,xr.prototype.get=s3,xr.prototype.has=o3,xr.prototype.set=c3;function u3(t,e){return t&&um(e,Hn(e),t)}var SE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,kE=SE&&typeof module=="object"&&module&&!module.nodeType&&module,l3=kE&&kE.exports===SE,$E=l3?_r.Buffer:void 0,CE=$E?$E.allocUnsafe:void 0;function d3(t,e){var n=t.length,r=CE?CE(n):new t.constructor(n);return t.copy(r),r}function wm(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 _E(){return[]}var f3=Object.prototype,h3=f3.propertyIsEnumerable,AE=Object.getOwnPropertySymbols,bm=AE?function(t){return t==null?[]:(t=Object(t),wm(AE(t),function(e){return h3.call(t,e)}))}:_E;function p3(t,e){return um(t,bm(t),e)}var g3=Object.getOwnPropertySymbols,m3=g3?function(t){for(var e=[];t;)ym(e,bm(t)),t=TE(t);return e}:_E;function xE(t,e,n){var r=e(t);return Ie(t)?r:ym(r,n(t))}function Dm(t){return xE(t,Hn,bm)}function y3(t){return xE(t,DE,m3)}var Em=Ss(_r,"DataView"),Tm=Ss(_r,"Promise"),Lo=Ss(_r,"Set"),IE="[object Map]",v3="[object Object]",PE="[object Promise]",NE="[object Set]",OE="[object WeakMap]",FE="[object DataView]",w3=Rs(Em),b3=Rs(Rc),D3=Rs(Tm),E3=Rs(Lo),T3=Rs(om),Vn=Pi;(Em&&Vn(new Em(new ArrayBuffer(1)))!=FE||Rc&&Vn(new Rc)!=IE||Tm&&Vn(Tm.resolve())!=PE||Lo&&Vn(new Lo)!=NE||om&&Vn(new om)!=OE)&&(Vn=function(t){var e=Pi(t),n=e==v3?t.constructor:void 0,r=n?Rs(n):"";if(r)switch(r){case w3:return FE;case b3:return IE;case D3:return PE;case E3:return NE;case T3:return OE}return e});var R3=Object.prototype,S3=R3.hasOwnProperty;function k3(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&S3.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var Jd=_r.Uint8Array;function $3(t){var e=new t.constructor(t.byteLength);return new Jd(e).set(new Jd(t)),e}function C3(t,e){var n=t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var _3=/\w*$/;function A3(t){var e=new t.constructor(t.source,_3.exec(t));return e.lastIndex=t.lastIndex,e}var LE=Wn?Wn.prototype:void 0,ME=LE?LE.valueOf:void 0;function x3(t){return ME?Object(ME.call(t)):{}}function I3(t,e){var n=t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var P3="[object Boolean]",N3="[object Date]",O3="[object Map]",F3="[object Number]",L3="[object RegExp]",M3="[object Set]",z3="[object String]",B3="[object Symbol]",j3="[object ArrayBuffer]",q3="[object DataView]",U3="[object Float32Array]",W3="[object Float64Array]",G3="[object Int8Array]",H3="[object Int16Array]",K3="[object Int32Array]",V3="[object Uint8Array]",Y3="[object Uint8ClampedArray]",X3="[object Uint16Array]",J3="[object Uint32Array]";function Z3(t,e,n){var r=t.constructor;switch(e){case j3:return $3(t);case P3:case N3:return new r(+t);case q3:return C3(t);case U3:case W3:case G3:case H3:case K3:case V3:case Y3:case X3:case J3:return I3(t);case O3:return new r;case F3:case z3:return new r(t);case L3:return A3(t);case M3:return new r;case B3:return x3(t)}}function Q3(t){return typeof t.constructor=="function"&&!bc(t)?uL(TE(t)):{}}var e8="[object Map]";function t8(t){return ar(t)&&Vn(t)==e8}var zE=Ni&&Ni.isMap,n8=zE?Kd(zE):t8,r8="[object Set]";function i8(t){return ar(t)&&Vn(t)==r8}var BE=Ni&&Ni.isSet,s8=BE?Kd(BE):i8,jE="[object Arguments]",o8="[object Array]",a8="[object Boolean]",c8="[object Date]",u8="[object Error]",qE="[object Function]",l8="[object GeneratorFunction]",d8="[object Map]",f8="[object Number]",UE="[object Object]",h8="[object RegExp]",p8="[object Set]",g8="[object String]",m8="[object Symbol]",y8="[object WeakMap]",v8="[object ArrayBuffer]",w8="[object DataView]",b8="[object Float32Array]",D8="[object Float64Array]",E8="[object Int8Array]",T8="[object Int16Array]",R8="[object Int32Array]",S8="[object Uint8Array]",k8="[object Uint8ClampedArray]",$8="[object Uint16Array]",C8="[object Uint32Array]",Xe={};Xe[jE]=Xe[o8]=Xe[v8]=Xe[w8]=Xe[a8]=Xe[c8]=Xe[b8]=Xe[D8]=Xe[E8]=Xe[T8]=Xe[R8]=Xe[d8]=Xe[f8]=Xe[UE]=Xe[h8]=Xe[p8]=Xe[g8]=Xe[m8]=Xe[S8]=Xe[k8]=Xe[$8]=Xe[C8]=!0,Xe[u8]=Xe[qE]=Xe[y8]=!1;function Zd(t,e,n,r,i,s){var o;if(o!==void 0)return o;if(!Gn(t))return t;var a=Ie(t);if(a)return o=k3(t),dL(t,o);var c=Vn(t),u=c==qE||c==l8;if(Dc(t))return d3(t);if(c==UE||c==jE||u&&!i)return o=u?{}:Q3(t),p3(t,u3(o,t));if(!Xe[c])return i?t:{};o=Z3(t,c),s||(s=new xr);var l=s.get(t);if(l)return l;s.set(t,o),s8(t)?t.forEach(function(h){o.add(Zd(h,e,n,h,t,s))}):n8(t)&&t.forEach(function(h,p){o.set(p,Zd(h,e,n,p,t,s))});var d=Dm,f=a?void 0:d(t);return oE(f||t,function(h,p){f&&(p=h,h=t[p]),Gd(o,p,Zd(h,e,n,p,t,s))}),o}var _8=4;function zt(t){return Zd(t,_8)}function kc(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 A8="__lodash_hash_undefined__";function x8(t){return this.__data__.set(t,A8),this}function I8(t){return this.__data__.has(t)}function Mo(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new ai;++e<n;)this.add(t[e])}Mo.prototype.add=Mo.prototype.push=x8,Mo.prototype.has=I8;function WE(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 Rm(t,e){return t.has(e)}var P8=1,N8=2;function GE(t,e,n,r,i,s){var o=n&P8,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,h=n&N8?new Mo:void 0;for(s.set(t,e),s.set(e,t);++d<a;){var p=t[d],m=e[d];if(r)var w=o?r(m,p,d,e,t,s):r(p,m,d,t,e,s);if(w!==void 0){if(w)continue;f=!1;break}if(h){if(!WE(e,function(v,E){if(!Rm(h,E)&&(p===v||i(p,v,n,r,s)))return h.push(E)})){f=!1;break}}else if(!(p===m||i(p,m,n,r,s))){f=!1;break}}return s.delete(t),s.delete(e),f}function O8(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function Sm(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var F8=1,L8=2,M8="[object Boolean]",z8="[object Date]",B8="[object Error]",j8="[object Map]",q8="[object Number]",U8="[object RegExp]",W8="[object Set]",G8="[object String]",H8="[object Symbol]",K8="[object ArrayBuffer]",V8="[object DataView]",HE=Wn?Wn.prototype:void 0,km=HE?HE.valueOf:void 0;function Y8(t,e,n,r,i,s,o){switch(n){case V8:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case K8:return!(t.byteLength!=e.byteLength||!s(new Jd(t),new Jd(e)));case M8:case z8:case q8:return wc(+t,+e);case B8:return t.name==e.name&&t.message==e.message;case U8:case G8:return t==e+"";case j8:var a=O8;case W8:var c=r&F8;if(a||(a=Sm),t.size!=e.size&&!c)return!1;var u=o.get(t);if(u)return u==e;r|=L8,o.set(t,e);var l=GE(a(t),a(e),r,i,s,o);return o.delete(t),l;case H8:if(km)return km.call(t)==km.call(e)}return!1}var X8=1,J8=Object.prototype,Z8=J8.hasOwnProperty;function Q8(t,e,n,r,i,s){var o=n&X8,a=Dm(t),c=a.length,u=Dm(e),l=u.length;if(c!=l&&!o)return!1;for(var d=c;d--;){var f=a[d];if(!(o?f in e:Z8.call(e,f)))return!1}var h=s.get(t),p=s.get(e);if(h&&p)return h==e&&p==t;var m=!0;s.set(t,e),s.set(e,t);for(var w=o;++d<c;){f=a[d];var v=t[f],E=e[f];if(r)var S=o?r(E,v,f,e,t,s):r(v,E,f,t,e,s);if(!(S===void 0?v===E||i(v,E,n,r,s):S)){m=!1;break}w||(w=f=="constructor")}if(m&&!w){var $=t.constructor,I=e.constructor;$!=I&&"constructor"in t&&"constructor"in e&&!(typeof $=="function"&&$ instanceof $&&typeof I=="function"&&I instanceof I)&&(m=!1)}return s.delete(t),s.delete(e),m}var ez=1,KE="[object Arguments]",VE="[object Array]",Qd="[object Object]",tz=Object.prototype,YE=tz.hasOwnProperty;function nz(t,e,n,r,i,s){var o=Ie(t),a=Ie(e),c=o?VE:Vn(t),u=a?VE:Vn(e);c=c==KE?Qd:c,u=u==KE?Qd:u;var l=c==Qd,d=u==Qd,f=c==u;if(f&&Dc(t)){if(!Dc(e))return!1;o=!0,l=!1}if(f&&!l)return s||(s=new xr),o||hm(t)?GE(t,e,n,r,i,s):Y8(t,e,c,n,r,i,s);if(!(n&ez)){var h=l&&YE.call(t,"__wrapped__"),p=d&&YE.call(e,"__wrapped__");if(h||p){var m=h?t.value():t,w=p?e.value():e;return s||(s=new xr),i(m,w,n,r,s)}}return f?(s||(s=new xr),Q8(t,e,n,r,i,s)):!1}function $m(t,e,n,r,i){return t===e?!0:t==null||e==null||!ar(t)&&!ar(e)?t!==t&&e!==e:nz(t,e,n,r,$m,i)}var rz=1,iz=2;function sz(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 xr,d;if(!(d===void 0?$m(u,c,rz|iz,r,l):d))return!1}}return!0}function XE(t){return t===t&&!Gn(t)}function oz(t){for(var e=Hn(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,XE(i)]}return e}function JE(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function az(t){var e=oz(t);return e.length==1&&e[0][2]?JE(e[0][0],e[0][1]):function(n){return n===t||sz(n,t,e)}}function cz(t,e){return t!=null&&e in Object(t)}function ZE(t,e,n){e=Xd(e,t);for(var r=-1,i=e.length,s=!1;++r<i;){var o=Sc(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&&dm(i)&&Wd(o,i)&&(Ie(t)||Hd(t)))}function uz(t,e){return t!=null&&ZE(t,e,cz)}var lz=1,dz=2;function fz(t,e){return pm(t)&&XE(e)?JE(Sc(t),e):function(n){var r=e3(n,t);return r===void 0&&r===e?uz(n,t):$m(e,r,lz|dz)}}function hz(t){return function(e){return e?.[t]}}function pz(t){return function(e){return mm(e,t)}}function gz(t){return pm(t)?hz(Sc(t)):pz(t)}function cr(t){return typeof t=="function"?t:t==null?Ts:typeof t=="object"?Ie(t)?fz(t[0],t[1]):az(t):gz(t)}function mz(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 yz(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 vz=yz();function wz(t,e){return t&&vz(t,e,Hn)}function bz(t,e){return function(n,r){if(n==null)return n;if(!Ar(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 $s=bz(wz);function Dz(t,e,n,r){return $s(t,function(i,s,o){e(r,i,n(i),o)}),r}function Ez(t,e){return function(n,r){var i=Ie(n)?mz:Dz,s=e?e():{};return i(n,t,cr(r),s)}}var QE=Object.prototype,Tz=QE.hasOwnProperty,Cm=lm(function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&lE(e[0],e[1],i)&&(r=1);++n<r;)for(var s=e[n],o=DE(s),a=-1,c=o.length;++a<c;){var u=o[a],l=t[u];(l===void 0||wc(l,QE[u])&&!Tz.call(t,u))&&(t[u]=s[u])}return t});function eT(t){return ar(t)&&Ar(t)}var Rz=200;function Sz(t,e,n,r){var i=-1,s=cE,o=!0,a=t.length,c=[],u=e.length;if(!a)return c;e.length>=Rz&&(s=Rm,o=!1,e=new Mo(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 ef=lm(function(t,e){return eT(t)?Sz(t,vm(e,1,eT,!0)):[]});function zo(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Bt(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:qd(e),RE(t,e<0?0:e,r)):[]}function $c(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:qd(e),e=r-e,RE(t,0,e<0?0:e)):[]}function kz(t){return typeof t=="function"?t:Ts}function fe(t,e){var n=Ie(t)?oE:$s;return n(t,kz(e))}function $z(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 Cz(t,e){var n=!0;return $s(t,function(r,i,s){return n=!!e(r,i,s),n}),n}function ur(t,e,n){var r=Ie(t)?$z:Cz;return r(t,cr(e))}function tT(t,e){var n=[];return $s(t,function(r,i,s){e(r,i,s)&&n.push(r)}),n}function An(t,e){var n=Ie(t)?wm:tT;return n(t,cr(e))}function _z(t){return function(e,n,r){var i=Object(e);if(!Ar(e)){var s=cr(n);e=Hn(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 Az=Math.max;function xz(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:qd(n);return i<0&&(i=Az(r+i,0)),aE(t,cr(e),i)}var Bo=_z(xz);function lr(t){return t&&t.length?t[0]:void 0}function Iz(t,e){var n=-1,r=Ar(t)?Array(t.length):[];return $s(t,function(i,s,o){r[++n]=e(i,s,o)}),r}function ae(t,e){var n=Ie(t)?jd:Iz;return n(t,cr(e))}function xn(t,e){return vm(ae(t,e))}var Pz=Object.prototype,Nz=Pz.hasOwnProperty,Oz=Ez(function(t,e,n){Nz.call(t,n)?t[n].push(e):cm(t,n,[e])}),Fz=Object.prototype,Lz=Fz.hasOwnProperty;function Mz(t,e){return t!=null&&Lz.call(t,e)}function he(t,e){return t!=null&&ZE(t,e,Mz)}var zz="[object String]";function vn(t){return typeof t=="string"||!Ie(t)&&ar(t)&&Pi(t)==zz}function Bz(t,e){return jd(e,function(n){return t[n]})}function It(t){return t==null?[]:Bz(t,Hn(t))}var jz=Math.max;function rn(t,e,n,r){t=Ar(t)?t:It(t),n=n&&!r?qd(n):0;var i=t.length;return n<0&&(n=jz(i+n,0)),vn(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&am(t,e,n)>-1}function nT(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=0;return am(t,e,i)}var qz="[object Map]",Uz="[object Set]",Wz=Object.prototype,Gz=Wz.hasOwnProperty;function Ve(t){if(t==null)return!0;if(Ar(t)&&(Ie(t)||typeof t=="string"||typeof t.splice=="function"||Dc(t)||hm(t)||Hd(t)))return!t.length;var e=Vn(t);if(e==qz||e==Uz)return!t.size;if(bc(t))return!bE(t).length;for(var n in t)if(Gz.call(t,n))return!1;return!0}var Hz="[object RegExp]";function Kz(t){return ar(t)&&Pi(t)==Hz}var rT=Ni&&Ni.isRegExp,ci=rT?Kd(rT):Kz;function ui(t){return t===void 0}function Vz(t,e){return t<e}function Yz(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&&!vc(o):n(o,a)))var a=o,c=s}return c}function Xz(t){return t&&t.length?Yz(t,Ts,Vz):void 0}var Jz="Expected a function";function Zz(t){if(typeof t!="function")throw new TypeError(Jz);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 Qz(t,e,n,r){if(!Gn(t))return t;e=Xd(e,t);for(var i=-1,s=e.length,o=s-1,a=t;a!=null&&++i<s;){var c=Sc(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=Gn(l)?l:Wd(e[i+1])?[]:{})}Gd(a,c,u),a=a[c]}return t}function eB(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],a=mm(t,o);n(a,o)&&Qz(s,Xd(o,t),a)}return s}function dr(t,e){if(t==null)return{};var n=jd(y3(t),function(r){return[r]});return e=cr(e),eB(t,n,function(r,i){return e(r,i[0])})}function tB(t,e,n,r,i){return i(t,function(s,o,a){n=r?(r=!1,s):e(n,s,o,a)}),n}function sn(t,e,n){var r=Ie(t)?n3:tB,i=arguments.length<3;return r(t,cr(e),n,i,$s)}function tf(t,e){var n=Ie(t)?wm:tT;return n(t,Zz(cr(e)))}function nB(t,e){var n;return $s(t,function(r,i,s){return n=e(r,i,s),!n}),!!n}function iT(t,e,n){var r=Ie(t)?WE:nB;return r(t,cr(e))}var rB=1/0,iB=Lo&&1/Sm(new Lo([,-0]))[1]==rB?function(t){return new Lo(t)}:xt,sB=200;function sT(t,e,n){var r=-1,i=cE,s=t.length,o=!0,a=[],c=a;if(s>=sB){var u=e?null:iB(t);if(u)return Sm(u);o=!1,i=Rm,c=new Mo}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 _m(t){return t&&t.length?sT(t):[]}function oB(t,e){return t&&t.length?sT(t,cr(e)):[]}function Am(t){console&&console.error&&console.error(`Error: ${t}`)}function oT(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function aT(t){const e=new Date().getTime(),n=t();return{time:new Date().getTime()-e,value:n}}function cT(t){function e(){}e.prototype=t;const n=new e;function r(){return typeof n.bar}return r(),r(),t}function aB(t){return cB(t)?t.LABEL:t.name}function cB(t){return vn(t.LABEL)&&t.LABEL!==""}class Ir{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),fe(this.definition,n=>{n.accept(e)})}}class on extends Ir{constructor(e){super([]),this.idx=1,_n(this,dr(e,n=>n!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class jo extends Ir{constructor(e){super(e.definition),this.orgText="",_n(this,dr(e,n=>n!==void 0))}}class wn extends Ir{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,_n(this,dr(e,n=>n!==void 0))}}class jt extends Ir{constructor(e){super(e.definition),this.idx=1,_n(this,dr(e,n=>n!==void 0))}}class In extends Ir{constructor(e){super(e.definition),this.idx=1,_n(this,dr(e,n=>n!==void 0))}}class Pn extends Ir{constructor(e){super(e.definition),this.idx=1,_n(this,dr(e,n=>n!==void 0))}}class pt extends Ir{constructor(e){super(e.definition),this.idx=1,_n(this,dr(e,n=>n!==void 0))}}class bn extends Ir{constructor(e){super(e.definition),this.idx=1,_n(this,dr(e,n=>n!==void 0))}}class Dn extends Ir{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,_n(this,dr(e,n=>n!==void 0))}}class rt{constructor(e){this.idx=1,_n(this,dr(e,n=>n!==void 0))}accept(e){e.visit(this)}}function uB(t){return ae(t,nf)}function nf(t){function e(n){return ae(n,nf)}if(t instanceof on){const n={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return vn(t.label)&&(n.label=t.label),n}else{if(t instanceof wn)return{type:"Alternative",definition:e(t.definition)};if(t instanceof jt)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof In)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Pn)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:nf(new rt({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof bn)return{type:"RepetitionWithSeparator",idx:t.idx,separator:nf(new rt({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof pt)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof Dn)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof rt){const n={type:"Terminal",name:t.terminalType.name,label:aB(t.terminalType),idx:t.idx};vn(t.label)&&(n.terminalLabel=t.label);const r=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(n.pattern=ci(r)?r.source:r),n}else{if(t instanceof jo)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}class qo{visit(e){const n=e;switch(n.constructor){case on:return this.visitNonTerminal(n);case wn:return this.visitAlternative(n);case jt:return this.visitOption(n);case In:return this.visitRepetitionMandatory(n);case Pn:return this.visitRepetitionMandatoryWithSeparator(n);case bn:return this.visitRepetitionWithSeparator(n);case pt:return this.visitRepetition(n);case Dn:return this.visitAlternation(n);case rt:return this.visitTerminal(n);case jo: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 lB(t){return t instanceof wn||t instanceof jt||t instanceof pt||t instanceof In||t instanceof Pn||t instanceof bn||t instanceof rt||t instanceof jo}function rf(t,e=[]){return t instanceof jt||t instanceof pt||t instanceof bn?!0:t instanceof Dn?iT(t.definition,r=>rf(r,e)):t instanceof on&&rn(e,t)?!1:t instanceof Ir?(t instanceof on&&e.push(t),ur(t.definition,r=>rf(r,e))):!1}function dB(t){return t instanceof Dn}function Pr(t){if(t instanceof on)return"SUBRULE";if(t instanceof jt)return"OPTION";if(t instanceof Dn)return"OR";if(t instanceof In)return"AT_LEAST_ONE";if(t instanceof Pn)return"AT_LEAST_ONE_SEP";if(t instanceof bn)return"MANY_SEP";if(t instanceof pt)return"MANY";if(t instanceof rt)return"CONSUME";throw Error("non exhaustive match")}class sf{walk(e,n=[]){fe(e.definition,(r,i)=>{const s=Bt(e.definition,i+1);if(r instanceof on)this.walkProdRef(r,s,n);else if(r instanceof rt)this.walkTerminal(r,s,n);else if(r instanceof wn)this.walkFlat(r,s,n);else if(r instanceof jt)this.walkOption(r,s,n);else if(r instanceof In)this.walkAtLeastOne(r,s,n);else if(r instanceof Pn)this.walkAtLeastOneSep(r,s,n);else if(r instanceof bn)this.walkManySep(r,s,n);else if(r instanceof pt)this.walkMany(r,s,n);else if(r instanceof Dn)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 jt({definition:e.definition})].concat(n,r);this.walk(e,i)}walkAtLeastOneSep(e,n,r){const i=uT(e,n,r);this.walk(e,i)}walkMany(e,n,r){const i=[new jt({definition:e.definition})].concat(n,r);this.walk(e,i)}walkManySep(e,n,r){const i=uT(e,n,r);this.walk(e,i)}walkOr(e,n,r){const i=n.concat(r);fe(e.definition,s=>{const o=new wn({definition:[s]});this.walk(o,i)})}}function uT(t,e,n){return[new jt({definition:[new rt({terminalType:t.separator})].concat(t.definition)})].concat(e,n)}function Cc(t){if(t instanceof on)return Cc(t.referencedRule);if(t instanceof rt)return pB(t);if(lB(t))return fB(t);if(dB(t))return hB(t);throw Error("non exhaustive match")}function fB(t){let e=[];const n=t.definition;let r=0,i=n.length>r,s,o=!0;for(;i&&o;)s=n[r],o=rf(s),e=e.concat(Cc(s)),r=r+1,i=n.length>r;return _m(e)}function hB(t){const e=ae(t.definition,n=>Cc(n));return _m(Kn(e))}function pB(t){return[t.terminalType]}const lT="_~IN~_";class gB extends sf{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=yB(e.referencedRule,e.idx)+this.topProd.name,s=n.concat(r),o=new wn({definition:s}),a=Cc(o);this.follows[i]=a}}function mB(t){const e={};return fe(t,n=>{const r=new gB(n).startWalking();_n(e,r)}),e}function yB(t,e){return t.name+e+lT}let of={};const vB=new MD;function af(t){const e=t.toString();if(of.hasOwnProperty(e))return of[e];{const n=vB.pattern(e);return of[e]=n,n}}function wB(){of={}}const dT="Complement Sets are not supported for first char optimization",cf=`Unable to use "first char" lexer optimizations:
13
- `;function bB(t,e=!1){try{const n=af(t);return xm(n.value,{},n.flags.ignoreCase)}catch(n){if(n.message===dT)e&&oT(`${cf} 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.`),Am(`${cf}
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 xm(t,e,n){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)xm(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":uf(o.value,e,n);break;case"Set":if(o.complement===!0)throw Error(dT);fe(o.value,c=>{if(typeof c=="number")uf(c,e,n);else{const u=c;if(n===!0)for(let l=u.from;l<=u.to;l++)uf(l,e,n);else{for(let l=u.from;l<=u.to&&l<Ac;l++)uf(l,e,n);if(u.to>=Ac){const l=u.from>=Ac?u.from:Ac,d=u.to,f=Oi(l),h=Oi(d);for(let p=f;p<=h;p++)e[p]=p}}}});break;case"Group":xm(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"&&Im(o)===!1||o.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return It(e)}function uf(t,e,n){const r=Oi(t);e[r]=r,n===!0&&DB(t,e)}function DB(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 fT(t,e){return Bo(t.value,n=>{if(typeof n=="number")return rn(e,n);{const r=n;return Bo(e,i=>r.from<=i&&i<=r.to)!==void 0}})}function Im(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Ie(t.value)?ur(t.value,Im):Im(t.value):!1}class EB extends Fd{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){rn(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?fT(e,this.targetCharCodes)===void 0&&(this.found=!0):fT(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function Pm(t,e){if(e instanceof RegExp){const n=af(e),r=new EB(t);return r.visit(n),r.found}else return Bo(e,n=>rn(t,n.charCodeAt(0)))!==void 0}const Cs="PATTERN",_c="defaultMode",lf="modes";let hT=typeof new RegExp("(?:)").sticky=="boolean";function TB(t,e){e=Cm(e,{useSticky:hT,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
22
- `],tracer:(E,S)=>S()});const n=e.tracer;n("initCharCodeToOptimizedIndexMap",()=>{HB()});let r;n("Reject Lexer.NA",()=>{r=tf(t,E=>E[Cs]===En.NA)});let i=!1,s;n("Transform Patterns",()=>{i=!1,s=ae(r,E=>{const S=E[Cs];if(ci(S)){const $=S.source;return $.length===1&&$!=="^"&&$!=="$"&&$!=="."&&!S.ignoreCase?$:$.length===2&&$[0]==="\\"&&!rn(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],$[1])?$[1]:e.useSticky?gT(S):pT(S)}else{if(ii(S))return i=!0,{exec:S};if(typeof S=="object")return i=!0,S;if(typeof S=="string"){if(S.length===1)return S;{const $=S.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),I=new RegExp($);return e.useSticky?gT(I):pT(I)}}else throw Error("non exhaustive match")}})});let o,a,c,u,l;n("misc mapping",()=>{o=ae(r,E=>E.tokenTypeIdx),a=ae(r,E=>{const S=E.GROUP;if(S!==En.SKIPPED){if(vn(S))return S;if(ui(S))return!1;throw Error("non exhaustive match")}}),c=ae(r,E=>{const S=E.LONGER_ALT;if(S)return Ie(S)?ae(S,I=>nT(r,I)):[nT(r,S)]}),u=ae(r,E=>E.PUSH_MODE),l=ae(r,E=>he(E,"POP_MODE"))});let d;n("Line Terminator Handling",()=>{const E=vT(e.lineTerminatorCharacters);d=ae(r,S=>!1),e.positionTracking!=="onlyOffset"&&(d=ae(r,S=>he(S,"LINE_BREAKS")?!!S.LINE_BREAKS:yT(S,E)===!1&&Pm(E,S.PATTERN)))});let f,h,p,m;n("Misc Mapping #2",()=>{f=ae(r,mT),h=ae(s,UB),p=sn(r,(E,S)=>{const $=S.GROUP;return vn($)&&$!==En.SKIPPED&&(E[$]=[]),E},{}),m=ae(s,(E,S)=>({pattern:s[S],longerAlt:c[S],canLineTerminator:d[S],isCustom:f[S],short:h[S],group:a[S],push:u[S],pop:l[S],tokenTypeIdx:o[S],tokenType:r[S]}))});let w=!0,v=[];return e.safeMode||n("First Char Optimization",()=>{v=sn(r,(E,S,$)=>{if(typeof S.PATTERN=="string"){const I=S.PATTERN.charCodeAt(0),N=Oi(I);Nm(E,N,m[$])}else if(Ie(S.START_CHARS_HINT)){let I;fe(S.START_CHARS_HINT,N=>{const A=typeof N=="string"?N.charCodeAt(0):N,q=Oi(A);I!==q&&(I=q,Nm(E,q,m[$]))})}else if(ci(S.PATTERN))if(S.PATTERN.unicode)w=!1,e.ensureOptimizations&&Am(`${cf} Unable to analyze < ${S.PATTERN.toString()} > pattern.
23
- The regexp unicode flag is not currently supported by the regexp-to-ast library.
24
- This will disable the lexer's first char optimizations.
25
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const I=bB(S.PATTERN,e.ensureOptimizations);Ve(I)&&(w=!1),fe(I,N=>{Nm(E,N,m[$])})}else e.ensureOptimizations&&Am(`${cf} TokenType: <${S.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
26
- This will disable the lexer's first char optimizations.
27
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),w=!1;return E},[])}),{emptyGroups:p,patternIdxToConfig:m,charCodeToPatternIdxToConfig:v,hasCustom:i,canBeOptimized:w}}function RB(t,e){let n=[];const r=kB(t);n=n.concat(r.errors);const i=$B(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(SB(s)),n=n.concat(OB(s)),n=n.concat(FB(s,e)),n=n.concat(LB(s)),n}function SB(t){let e=[];const n=An(t,r=>ci(r[Cs]));return e=e.concat(_B(n)),e=e.concat(IB(n)),e=e.concat(PB(n)),e=e.concat(NB(n)),e=e.concat(AB(n)),e}function kB(t){const e=An(t,i=>!he(i,Cs)),n=ae(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:gt.MISSING_PATTERN,tokenTypes:[i]})),r=ef(t,e);return{errors:n,valid:r}}function $B(t){const e=An(t,i=>{const s=i[Cs];return!ci(s)&&!ii(s)&&!he(s,"exec")&&!vn(s)}),n=ae(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:gt.INVALID_PATTERN,tokenTypes:[i]})),r=ef(t,e);return{errors:n,valid:r}}const CB=/[^\\][$]/;function _B(t){class e extends Fd{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}const n=An(t,i=>{const s=i.PATTERN;try{const o=af(s),a=new e;return a.visit(o),a.found}catch{return CB.test(s.source)}});return ae(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:gt.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function AB(t){const e=An(t,r=>r.PATTERN.test(""));return ae(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:gt.EMPTY_MATCH_PATTERN,tokenTypes:[r]}))}const xB=/[^\\[][\^]|^\^/;function IB(t){class e extends Fd{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}const n=An(t,i=>{const s=i.PATTERN;try{const o=af(s),a=new e;return a.visit(o),a.found}catch{return xB.test(s.source)}});return ae(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:gt.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function PB(t){const e=An(t,r=>{const i=r[Cs];return i instanceof RegExp&&(i.multiline||i.global)});return ae(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:gt.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}))}function NB(t){const e=[];let n=ae(t,s=>sn(t,(o,a)=>(s.PATTERN.source===a.PATTERN.source&&!rn(e,a)&&a.PATTERN!==En.NA&&(e.push(a),o.push(a)),o),[]));n=kc(n);const r=An(n,s=>s.length>1);return ae(r,s=>{const o=ae(s,c=>c.name);return{message:`The same RegExp pattern ->${lr(s).PATTERN}<-has been used in all of the following Token Types: ${o.join(", ")} <-`,type:gt.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}function OB(t){const e=An(t,r=>{if(!he(r,"GROUP"))return!1;const i=r.GROUP;return i!==En.SKIPPED&&i!==En.NA&&!vn(i)});return ae(e,r=>({message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:gt.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}))}function FB(t,e){const n=An(t,i=>i.PUSH_MODE!==void 0&&!rn(e,i.PUSH_MODE));return ae(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:gt.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function LB(t){const e=[],n=sn(t,(r,i,s)=>{const o=i.PATTERN;return o===En.NA||(vn(o)?r.push({str:o,idx:s,tokenType:i}):ci(o)&&zB(o)&&r.push({str:o.source,idx:s,tokenType:i})),r},[]);return fe(t,(r,i)=>{fe(n,({str:s,idx:o,tokenType:a})=>{if(i<o&&MB(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:gt.UNREACHABLE_PATTERN,tokenTypes:[r,a]})}})}),e}function MB(t,e){if(ci(e)){const n=e.exec(t);return n!==null&&n.index===0}else{if(ii(e))return e(t,0,[],{});if(he(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function zB(t){return Bo([".","\\","[","]","|","^","$","(",")","?","*","+","{"],n=>t.source.indexOf(n)!==-1)===void 0}function pT(t){const e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function gT(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function BB(t,e,n){const r=[];return he(t,_c)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+_c+`> property in its definition
34
- `,type:gt.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),he(t,lf)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+lf+`> property in its definition
35
- `,type:gt.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),he(t,lf)&&he(t,_c)&&!he(t.modes,t.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${_c}: <${t.defaultMode}>which does not exist
36
- `,type:gt.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),he(t,lf)&&fe(t.modes,(i,s)=>{fe(i,(o,a)=>{if(ui(o))r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${a}>
37
- `,type:gt.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(he(o,"LONGER_ALT")){const c=Ie(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT];fe(c,u=>{!ui(u)&&!rn(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:gt.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),r}function jB(t,e,n){const r=[];let i=!1;const s=kc(Kn(It(t.modes))),o=tf(s,c=>c[Cs]===En.NA),a=vT(n);return e&&fe(o,c=>{const u=yT(c,a);if(u!==!1){const d={message:GB(c,u),type:u.issue,tokenType:c};r.push(d)}else he(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(i=!0):Pm(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:gt.NO_LINE_BREAKS_FLAGS}),r}function qB(t){const e={},n=Hn(t);return fe(n,r=>{const i=t[r];if(Ie(i))e[r]=[];else throw Error("non exhaustive match")}),e}function mT(t){const e=t.PATTERN;if(ci(e))return!1;if(ii(e))return!0;if(he(e,"exec"))return!0;if(vn(e))return!1;throw Error("non exhaustive match")}function UB(t){return vn(t)&&t.length===1?t.charCodeAt(0):!1}const WB={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 yT(t,e){if(he(t,"LINE_BREAKS"))return!1;if(ci(t.PATTERN)){try{Pm(e,t.PATTERN)}catch(n){return{issue:gt.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}else{if(vn(t.PATTERN))return!1;if(mT(t))return{issue:gt.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function GB(t,e){if(e.issue===gt.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===gt.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 vT(t){return ae(t,n=>vn(n)?n.charCodeAt(0):n)}function Nm(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}const Ac=256;let df=[];function Oi(t){return t<Ac?t:df[t]}function HB(){if(Ve(df)){df=new Array(65536);for(let t=0;t<65536;t++)df[t]=t>255?255+~~(t/255):t}}function xc(t,e){const n=t.tokenTypeIdx;return n===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[n]===!0}function ff(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let wT=1;const bT={};function Ic(t){const e=KB(t);VB(e),XB(e),YB(e),fe(e,n=>{n.isParent=n.categoryMatches.length>0})}function KB(t){let e=zt(t),n=t,r=!0;for(;r;){n=kc(Kn(ae(n,s=>s.CATEGORIES)));const i=ef(n,e);e=e.concat(i),Ve(i)?r=!1:n=i}return e}function VB(t){fe(t,e=>{ET(e)||(bT[wT]=e,e.tokenTypeIdx=wT++),TT(e)&&!Ie(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),TT(e)||(e.CATEGORIES=[]),JB(e)||(e.categoryMatches=[]),ZB(e)||(e.categoryMatchesMap={})})}function YB(t){fe(t,e=>{e.categoryMatches=[],fe(e.categoryMatchesMap,(n,r)=>{e.categoryMatches.push(bT[r].tokenTypeIdx)})})}function XB(t){fe(t,e=>{DT([],e)})}function DT(t,e){fe(t,n=>{e.categoryMatchesMap[n.tokenTypeIdx]=!0}),fe(e.CATEGORIES,n=>{const r=t.concat(e);rn(r,n)||DT(r,n)})}function ET(t){return he(t,"tokenTypeIdx")}function TT(t){return he(t,"CATEGORIES")}function JB(t){return he(t,"categoryMatches")}function ZB(t){return he(t,"categoryMatchesMap")}function QB(t){return he(t,"tokenTypeIdx")}const e4={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 gt;(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"})(gt||(gt={}));const Pc={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
48
- `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:e4,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Pc);class En{constructor(e,n=Pc){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}=aT(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=_n({},Pc,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===Pc.lineTerminatorsPattern)this.config.lineTerminatorsPattern=WB;else if(this.config.lineTerminatorCharacters===Pc.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),Ie(e)?i={modes:{defaultMode:zt(e)},defaultMode:_c}:(s=!1,i=zt(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(BB(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(jB(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},fe(i.modes,(a,c)=>{i.modes[c]=tf(a,u=>ui(u))});const o=Hn(i.modes);if(fe(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(RB(a,o))}),Ve(this.lexerDefinitionErrors)){Ic(a);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=TB(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=_n({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[c]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Ve(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const c=ae(this.lexerDefinitionErrors,u=>u.message).join(`-----------------------
51
- `);throw new Error(`Errors detected in definition of Lexer:
52
- `+c)}fe(this.lexerDefinitionWarning,a=>{oT(a.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(hT?(this.chopInput=Ts,this.match=this.matchWithTest):(this.updateLastIndex=xt,this.match=this.matchWithExec),s&&(this.handleModes=xt),this.trackStartLines===!1&&(this.computeNewColumn=Ts),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=xt),/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=sn(this.canModeBeOptimized,(c,u,l)=>(u===!1&&c.push(l),c),[]);if(n.ensureOptimizations&&!Ve(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",()=>{wB()}),this.TRACE_INIT("toFastProperties",()=>{cT(this)})})}tokenize(e,n=this.defaultMode){if(!Ve(this.lexerDefinitionErrors)){const i=ae(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,h,p,m,w,v;const E=e,S=E.length;let $=0,I=0;const N=this.hasCustom?0:Math.floor(e.length/10),A=new Array(N),q=[];let W=this.trackStartLines?1:void 0,V=this.trackStartLines?1:void 0;const x=qB(this.emptyGroups),k=this.trackStartLines,T=this.config.lineTerminatorsPattern;let L=0,Y=[],G=[];const X=[],_e=[];Object.freeze(_e);let te;function U(){return Y}function ye(ze){const Qe=Oi(ze),ft=G[Qe];return ft===void 0?_e:ft}const Et=ze=>{if(X.length===1&&ze.tokenType.PUSH_MODE===void 0){const Qe=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(ze);q.push({offset:ze.startOffset,line:ze.startLine,column:ze.startColumn,length:ze.image.length,message:Qe})}else{X.pop();const Qe=zo(X);Y=this.patternIdxToConfig[Qe],G=this.charCodeToPatternIdxToConfig[Qe],L=Y.length;const ft=this.canModeBeOptimized[Qe]&&this.config.safeMode===!1;G&&ft?te=ye:te=U}};function Ft(ze){X.push(ze),G=this.charCodeToPatternIdxToConfig[ze],Y=this.patternIdxToConfig[ze],L=Y.length,L=Y.length;const Qe=this.canModeBeOptimized[ze]&&this.config.safeMode===!1;G&&Qe?te=ye:te=U}Ft.call(this,n);let Ue;const Gt=this.config.recoveryEnabled;for(;$<S;){c=null;const ze=E.charCodeAt($),Qe=te(ze),ft=Qe.length;for(r=0;r<ft;r++){Ue=Qe[r];const We=Ue.pattern;u=null;const oe=Ue.short;if(oe!==!1?ze===oe&&(c=We):Ue.isCustom===!0?(v=We.exec(E,$,A,x),v!==null?(c=v[0],v.payload!==void 0&&(u=v.payload)):c=null):(this.updateLastIndex(We,$),c=this.match(We,e,$)),c!==null){if(a=Ue.longerAlt,a!==void 0){const P=a.length;for(s=0;s<P;s++){const j=Y[a[s]],se=j.pattern;if(l=null,j.isCustom===!0?(v=se.exec(E,$,A,x),v!==null?(o=v[0],v.payload!==void 0&&(l=v.payload)):o=null):(this.updateLastIndex(se,$),o=this.match(se,e,$)),o&&o.length>c.length){c=o,u=l,Ue=j;break}}}break}}if(c!==null){if(d=c.length,f=Ue.group,f!==void 0&&(h=Ue.tokenTypeIdx,p=this.createTokenInstance(c,$,h,Ue.tokenType,W,V,d),this.handlePayload(p,u),f===!1?I=this.addToken(A,I,p):x[f].push(p)),e=this.chopInput(e,d),$=$+d,V=this.computeNewColumn(V,d),k===!0&&Ue.canLineTerminator===!0){let We=0,oe,P;T.lastIndex=0;do oe=T.test(c),oe===!0&&(P=T.lastIndex-1,We++);while(oe===!0);We!==0&&(W=W+We,V=d-P,this.updateTokenEndLineColumnLocation(p,f,P,We,W,V,d))}this.handleModes(Ue,Et,Ft,p)}else{const We=$,oe=W,P=V;let j=Gt===!1;for(;j===!1&&$<S;)for(e=this.chopInput(e,1),$++,i=0;i<L;i++){const se=Y[i],B=se.pattern,Ne=se.short;if(Ne!==!1?E.charCodeAt($)===Ne&&(j=!0):se.isCustom===!0?j=B.exec(E,$,A,x)!==null:(this.updateLastIndex(B,$),j=B.exec(e)!==null),j===!0)break}if(m=$-We,V=this.computeNewColumn(V,m),w=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(E,We,m,oe,P),q.push({offset:We,line:oe,column:P,length:m,message:w}),Gt===!1)break}}return this.hasCustom||(A.length=I),{tokens:A,groups:x,errors:q}}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}}En.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.",En.NA=/NOT_APPLICABLE/;function Uo(t){return RT(t)?t.LABEL:t.name}function RT(t){return vn(t.LABEL)&&t.LABEL!==""}const t4="parent",ST="categories",kT="label",$T="group",CT="push_mode",_T="pop_mode",AT="longer_alt",xT="line_breaks",IT="start_chars_hint";function PT(t){return n4(t)}function n4(t){const e=t.pattern,n={};if(n.name=t.name,ui(e)||(n.PATTERN=e),he(t,t4))throw`The parent property is no longer supported.
57
- See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return he(t,ST)&&(n.CATEGORIES=t[ST]),Ic([n]),he(t,kT)&&(n.LABEL=t[kT]),he(t,$T)&&(n.GROUP=t[$T]),he(t,_T)&&(n.POP_MODE=t[_T]),he(t,CT)&&(n.PUSH_MODE=t[CT]),he(t,AT)&&(n.LONGER_ALT=t[AT]),he(t,xT)&&(n.LINE_BREAKS=t[xT]),he(t,IT)&&(n.START_CHARS_HINT=t[IT]),n}const Fi=PT({name:"EOF",pattern:En.NA});Ic([Fi]);function Om(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 NT(t,e){return xc(t,e)}const Wo={buildMismatchTokenMessage({expected:t,actual:e,previous:n,ruleName:r}){return`Expecting ${RT(t)?`--> ${Uo(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: '`+lr(e).image+"'";if(r)return s+r+a;{const c=sn(t,(f,h)=>f.concat(h),[]),u=ae(c,f=>`[${ae(f,h=>Uo(h)).join(", ")}]`),d=`one of these possible Token sequences:
59
- ${ae(u,(f,h)=>` ${h+1}. ${f}`).join(`
60
- `)}`;return s+d+a}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:n,ruleName:r}){const i="Expecting: ",o=`
61
- but found: '`+lr(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
- <${ae(t,u=>`[${ae(u,l=>Uo(l)).join(",")}]`).join(" ,")}>`;return i+c+o}}};Object.freeze(Wo);const r4={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
63
- inside top level rule: ->`+t.name+"<-"}},_s={buildDuplicateFoundError(t,e){function n(l){return l instanceof rt?l.terminalType.name:l instanceof on?l.nonTerminalName:""}const r=t.name,i=lr(e),s=i.idx,o=Pr(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=ae(t.prefixPath,i=>Uo(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=ae(t.prefixPath,i=>Uo(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=Pr(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=ae(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 jo?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function i4(t,e){const n=new s4(t,e);return n.resolveRefs(),n.errors}class s4 extends qo{constructor(e,n){super(),this.nameToTopRule=e,this.errMsgProvider=n,this.errors=[]}resolveRefs(){fe(It(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:an.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class o4 extends sf{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=zt(this.path.ruleStack).reverse(),this.occurrenceStack=zt(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(){Ve(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class a4 extends o4{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 wn({definition:i});this.possibleTokTypes=Cc(s),this.found=!0}}}class hf extends sf{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 c4 extends hf{walkMany(e,n,r){if(e.idx===this.occurrence){const i=lr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof rt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,n,r)}}class OT extends hf{walkManySep(e,n,r){if(e.idx===this.occurrence){const i=lr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof rt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,n,r)}}class u4 extends hf{walkAtLeastOne(e,n,r){if(e.idx===this.occurrence){const i=lr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof rt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,n,r)}}class FT extends hf{walkAtLeastOneSep(e,n,r){if(e.idx===this.occurrence){const i=lr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof rt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,n,r)}}function Fm(t,e,n=[]){n=zt(n);let r=[],i=0;function s(a){return a.concat(Bt(t,i+1))}function o(a){const c=Fm(s(a),e,n);return r.concat(c)}for(;n.length<e&&i<t.length;){const a=t[i];if(a instanceof wn)return o(a.definition);if(a instanceof on)return o(a.definition);if(a instanceof jt)r=o(a.definition);else if(a instanceof In){const c=a.definition.concat([new pt({definition:a.definition})]);return o(c)}else if(a instanceof Pn){const c=[new wn({definition:a.definition}),new pt({definition:[new rt({terminalType:a.separator})].concat(a.definition)})];return o(c)}else if(a instanceof bn){const c=a.definition.concat([new pt({definition:[new rt({terminalType:a.separator})].concat(a.definition)})]);r=o(c)}else if(a instanceof pt){const c=a.definition.concat([new pt({definition:a.definition})]);r=o(c)}else{if(a instanceof Dn)return fe(a.definition,c=>{Ve(c.definition)===!1&&(r=o(c.definition))}),r;if(a instanceof rt)n.push(a.terminalType);else throw Error("non exhaustive match")}i++}return r.push({partialPath:n,suffixDef:Bt(t,i)}),r}function LT(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:[]});!Ve(d);){const f=d.pop();if(f===o){a&&zo(d).idx<=u&&d.pop();continue}const h=f.def,p=f.idx,m=f.ruleStack,w=f.occurrenceStack;if(Ve(h))continue;const v=h[0];if(v===i){const E={idx:p,def:Bt(h),ruleStack:$c(m),occurrenceStack:$c(w)};d.push(E)}else if(v instanceof rt)if(p<c-1){const E=p+1,S=e[E];if(n(S,v.terminalType)){const $={idx:E,def:Bt(h),ruleStack:m,occurrenceStack:w};d.push($)}}else if(p===c-1)l.push({nextTokenType:v.terminalType,nextTokenOccurrence:v.idx,ruleStack:m,occurrenceStack:w}),a=!0;else throw Error("non exhaustive match");else if(v instanceof on){const E=zt(m);E.push(v.nonTerminalName);const S=zt(w);S.push(v.idx);const $={idx:p,def:v.definition.concat(s,Bt(h)),ruleStack:E,occurrenceStack:S};d.push($)}else if(v instanceof jt){const E={idx:p,def:Bt(h),ruleStack:m,occurrenceStack:w};d.push(E),d.push(o);const S={idx:p,def:v.definition.concat(Bt(h)),ruleStack:m,occurrenceStack:w};d.push(S)}else if(v instanceof In){const E=new pt({definition:v.definition,idx:v.idx}),S=v.definition.concat([E],Bt(h)),$={idx:p,def:S,ruleStack:m,occurrenceStack:w};d.push($)}else if(v instanceof Pn){const E=new rt({terminalType:v.separator}),S=new pt({definition:[E].concat(v.definition),idx:v.idx}),$=v.definition.concat([S],Bt(h)),I={idx:p,def:$,ruleStack:m,occurrenceStack:w};d.push(I)}else if(v instanceof bn){const E={idx:p,def:Bt(h),ruleStack:m,occurrenceStack:w};d.push(E),d.push(o);const S=new rt({terminalType:v.separator}),$=new pt({definition:[S].concat(v.definition),idx:v.idx}),I=v.definition.concat([$],Bt(h)),N={idx:p,def:I,ruleStack:m,occurrenceStack:w};d.push(N)}else if(v instanceof pt){const E={idx:p,def:Bt(h),ruleStack:m,occurrenceStack:w};d.push(E),d.push(o);const S=new pt({definition:v.definition,idx:v.idx}),$=v.definition.concat([S],Bt(h)),I={idx:p,def:$,ruleStack:m,occurrenceStack:w};d.push(I)}else if(v instanceof Dn)for(let E=v.definition.length-1;E>=0;E--){const S=v.definition[E],$={idx:p,def:S.definition.concat(Bt(h)),ruleStack:m,occurrenceStack:w};d.push($),d.push(o)}else if(v instanceof wn)d.push({idx:p,def:v.definition.concat(Bt(h)),ruleStack:m,occurrenceStack:w});else if(v instanceof jo)d.push(l4(v,p,m,w));else throw Error("non exhaustive match")}return l}function l4(t,e,n,r){const i=zt(n);i.push(t.name);const s=zt(r);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}var at;(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"})(at||(at={}));function Lm(t){if(t instanceof jt||t==="Option")return at.OPTION;if(t instanceof pt||t==="Repetition")return at.REPETITION;if(t instanceof In||t==="RepetitionMandatory")return at.REPETITION_MANDATORY;if(t instanceof Pn||t==="RepetitionMandatoryWithSeparator")return at.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof bn||t==="RepetitionWithSeparator")return at.REPETITION_WITH_SEPARATOR;if(t instanceof Dn||t==="Alternation")return at.ALTERNATION;throw Error("non exhaustive match")}function MT(t){const{occurrence:e,rule:n,prodType:r,maxLookahead:i}=t,s=Lm(r);return s===at.ALTERNATION?pf(e,n,i):gf(e,n,s,i)}function d4(t,e,n,r,i,s){const o=pf(t,e,n),a=qT(o)?ff:xc;return s(o,r,a,i)}function f4(t,e,n,r,i,s){const o=gf(t,e,i,n),a=qT(o)?ff:xc;return s(o[0],a,r)}function h4(t,e,n,r){const i=t.length,s=ur(t,o=>ur(o,a=>a.length===1));if(e)return function(o){const a=ae(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 h=u[f],p=h.length;for(let m=0;m<p;m++){const w=this.LA(m+1);if(n(w,h[m])===!1)continue e}return c}}};if(s&&!r){const o=ae(t,c=>Kn(c)),a=sn(o,(c,u,l)=>(fe(u,d=>{he(c,d.tokenTypeIdx)||(c[d.tokenTypeIdx]=l),fe(d.categoryMatches,f=>{he(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 h=this.LA(f+1);if(n(h,l[f])===!1)continue e}return o}}}}function p4(t,e,n){const r=ur(t,s=>s.length===1),i=t.length;if(r&&!n){const s=Kn(t);if(s.length===1&&Ve(s[0].categoryMatches)){const a=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}else{const o=sn(s,(a,c,u)=>(a[c.tokenTypeIdx]=!0,fe(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 g4 extends sf{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,at.OPTION,n,r)||super.walkOption(e,n,r)}walkAtLeastOne(e,n,r){this.checkIsTarget(e,at.REPETITION_MANDATORY,n,r)||super.walkOption(e,n,r)}walkAtLeastOneSep(e,n,r){this.checkIsTarget(e,at.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}walkMany(e,n,r){this.checkIsTarget(e,at.REPETITION,n,r)||super.walkOption(e,n,r)}walkManySep(e,n,r){this.checkIsTarget(e,at.REPETITION_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}}class zT extends qo{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,at.OPTION)}visitRepetition(e){this.checkIsTarget(e,at.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,at.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,at.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,at.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,at.ALTERNATION)}}function BT(t){const e=new Array(t);for(let n=0;n<t;n++)e[n]=[];return e}function Mm(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 m4(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 jT(t,e){const n=ae(t,o=>Fm([o],1)),r=BT(n.length),i=ae(n,o=>{const a={};return fe(o,c=>{const u=Mm(c.partialPath);fe(u,l=>{a[l]=!0})}),a});let s=n;for(let o=1;o<=e;o++){const a=s;s=BT(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,h=Mm(d);if(m4(i,h,c)||Ve(f)||d.length===e){const m=r[c];if(zm(m,d)===!1){m.push(d);for(let w=0;w<h.length;w++){const v=h[w];i[c][v]=!0}}}else{const m=Fm(f,o+1,d);s[c]=s[c].concat(m),fe(m,w=>{const v=Mm(w.partialPath);fe(v,E=>{i[c][E]=!0})})}}}}return r}function pf(t,e,n,r){const i=new zT(t,at.ALTERNATION,r);return e.accept(i),jT(i.result,n)}function gf(t,e,n,r){const i=new zT(t,n);e.accept(i);const s=i.result,a=new g4(e,t,n).startWalking(),c=new wn({definition:s}),u=new wn({definition:a});return jT([c,u],r)}function zm(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 y4(t,e){return t.length<e.length&&ur(t,(n,r)=>{const i=e[r];return n===i||i.categoryMatchesMap[n.tokenTypeIdx]})}function qT(t){return ur(t,e=>ur(e,n=>ur(n,r=>Ve(r.categoryMatches))))}function v4(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return ae(e,n=>Object.assign({type:an.CUSTOM_LOOKAHEAD_VALIDATION},n))}function w4(t,e,n,r){const i=xn(t,c=>b4(c,n)),s=I4(t,e,n),o=xn(t,c=>C4(c,n)),a=xn(t,c=>T4(c,t,r,n));return i.concat(s,o,a)}function b4(t,e){const n=new E4;t.accept(n);const r=n.allProductions,i=Oz(r,D4),s=dr(i,a=>a.length>1);return ae(It(s),a=>{const c=lr(a),u=e.buildDuplicateFoundError(t,a),l=Pr(c),d={message:u,type:an.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:l,occurrence:c.idx},f=UT(c);return f&&(d.parameter=f),d})}function D4(t){return`${Pr(t)}_#_${t.idx}_#_${UT(t)}`}function UT(t){return t instanceof rt?t.terminalType.name:t instanceof on?t.nonTerminalName:""}class E4 extends qo{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 T4(t,e,n,r){const i=[];if(sn(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:an.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function R4(t,e,n){const r=[];let i;return rn(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:an.INVALID_RULE_OVERRIDE,ruleName:t})),r}function WT(t,e,n,r=[]){const i=[],s=mf(e.definition);if(Ve(s))return[];{const o=t.name;rn(s,t)&&i.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:r}),type:an.LEFT_RECURSION,ruleName:o});const c=ef(s,r.concat([t])),u=xn(c,l=>{const d=zt(r);return d.push(l),WT(t,l,n,d)});return i.concat(u)}}function mf(t){let e=[];if(Ve(t))return e;const n=lr(t);if(n instanceof on)e.push(n.referencedRule);else if(n instanceof wn||n instanceof jt||n instanceof In||n instanceof Pn||n instanceof bn||n instanceof pt)e=e.concat(mf(n.definition));else if(n instanceof Dn)e=Kn(ae(n.definition,s=>mf(s.definition)));else if(!(n instanceof rt))throw Error("non exhaustive match");const r=rf(n),i=t.length>1;if(r&&i){const s=Bt(t);return e.concat(mf(s))}else return e}class Bm extends qo{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function S4(t,e){const n=new Bm;t.accept(n);const r=n.alternations;return xn(r,s=>{const o=$c(s.definition);return xn(o,(a,c)=>{const u=LT([a],[],xc,1);return Ve(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:c}),type:an.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:c+1}]:[]})})}function k4(t,e,n){const r=new Bm;t.accept(r);let i=r.alternations;return i=tf(i,o=>o.ignoreAmbiguities===!0),xn(i,o=>{const a=o.idx,c=o.maxLookahead||e,u=pf(a,t,c,o),l=A4(u,o,t,n),d=x4(u,o,t,n);return l.concat(d)})}class $4 extends qo{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 C4(t,e){const n=new Bm;t.accept(n);const r=n.alternations;return xn(r,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:an.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}function _4(t,e,n){const r=[];return fe(t,i=>{const s=new $4;i.accept(s);const o=s.allProductions;fe(o,a=>{const c=Lm(a),u=a.maxLookahead||e,l=a.idx,f=gf(l,i,c,u)[0];if(Ve(Kn(f))){const h=n.buildEmptyRepetitionError({topLevelRule:i,repetition:a});r.push({message:h,type:an.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),r}function A4(t,e,n,r){const i=[],s=sn(t,(a,c,u)=>(e.definition[u].ignoreAmbiguities===!0||fe(c,l=>{const d=[u];fe(t,(f,h)=>{u!==h&&zm(f,l)&&e.definition[h].ignoreAmbiguities!==!0&&d.push(h)}),d.length>1&&!zm(i,l)&&(i.push(l),a.push({alts:d,path:l}))}),a),[]);return ae(s,a=>{const c=ae(a.alts,l=>l+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:c,prefixPath:a.path}),type:an.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:e.idx,alternatives:a.alts}})}function x4(t,e,n,r){const i=sn(t,(o,a,c)=>{const u=ae(a,l=>({idx:c,path:l}));return o.concat(u)},[]);return kc(xn(i,o=>{if(e.definition[o.idx].ignoreAmbiguities===!0)return[];const c=o.idx,u=o.path,l=An(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx<c&&y4(f.path,u));return ae(l,f=>{const h=[f.idx+1,c+1],p=e.idx===0?"":e.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:h,prefixPath:f.path}),type:an.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:p,alternatives:h}})}))}function I4(t,e,n){const r=[],i=ae(e,s=>s.name);return fe(t,s=>{const o=s.name;if(rn(i,o)){const a=n.buildNamespaceConflictError(s);r.push({message:a,type:an.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:o})}}),r}function P4(t){const e=Cm(t,{errMsgProvider:r4}),n={};return fe(t.rules,r=>{n[r.name]=r}),i4(n,e.errMsgProvider)}function N4(t){return t=Cm(t,{errMsgProvider:_s}),w4(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}const GT="MismatchedTokenException",HT="NoViableAltException",KT="EarlyExitException",VT="NotAllInputParsedException",YT=[GT,HT,KT,VT];Object.freeze(YT);function yf(t){return rn(YT,t.name)}class vf 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 XT extends vf{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=GT}}class O4 extends vf{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=HT}}class F4 extends vf{constructor(e,n){super(e,n),this.name=VT}}class L4 extends vf{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=KT}}const jm={},JT="InRuleRecoveryException";class M4 extends Error{constructor(e){super(e),this.name=JT}}class z4{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=he(e,"recoveryEnabled")?e.recoveryEnabled:li.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=B4)}getTokenToInsert(e){const n=Om(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),h=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),p=new XT(h,u,this.LA(0));p.resyncedTokens=$c(a),this.SAVE_ERROR(p)};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 M4("sad sad panda")}canPerformInRuleRecovery(e,n){return this.canRecoverWithSingleTokenInsertion(e,n)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,n){if(!this.canTokenTypeBeInsertedInRecovery(e)||Ve(n))return!1;const r=this.LA(1);return Bo(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 rn(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let n=this.LA(1),r=2;for(;;){const i=Bo(e,s=>NT(n,s));if(i!==void 0)return i;n=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return jm;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 ae(e,(r,i)=>i===0?jm:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:n[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=ae(this.buildFullFollowKeyStack(),n=>this.getFollowSetFromFollowKey(n));return Kn(e)}getFollowSetFromFollowKey(e){if(e===jm)return[Fi];const n=e.ruleName+e.idxInCallingRule+lT+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 $c(n)}attemptInRepetitionRecovery(e,n,r,i,s,o,a){}getCurrentGrammarPath(e,n){const r=this.getHumanReadableRuleStack(),i=zt(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:i,lastTok:e,lastTokOccurrence:n}}getHumanReadableRuleStack(){return ae(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function B4(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(),h=this.getGAstProductions()[f];c=new s(h,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 j4=4,Li=8,ZT=1<<Li,QT=2<<Li,qm=3<<Li,Um=4<<Li,Wm=5<<Li,wf=6<<Li;function Gm(t,e,n){return n|e|t}class Hm{constructor(e){var n;this.maxLookahead=(n=e?.maxLookahead)!==null&&n!==void 0?n:li.maxLookahead}validate(e){const n=this.validateNoLeftRecursion(e.rules);if(Ve(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 xn(e,n=>WT(n,n,_s))}validateEmptyOrAlternatives(e){return xn(e,n=>S4(n,_s))}validateAmbiguousAlternationAlternatives(e,n){return xn(e,r=>k4(r,n,_s))}validateSomeNonEmptyLookaheadPath(e,n){return _4(e,n,_s)}buildLookaheadForAlternation(e){return d4(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,h4)}buildLookaheadForOptional(e){return f4(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Lm(e.prodType),p4)}}class q4{initLooksAhead(e){this.dynamicTokensEnabled=he(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:li.dynamicTokensEnabled,this.maxLookahead=he(e,"maxLookahead")?e.maxLookahead:li.maxLookahead,this.lookaheadStrategy=he(e,"lookaheadStrategy")?e.lookaheadStrategy:new Hm({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){fe(e,n=>{this.TRACE_INIT(`${n.name} Rule Lookahead`,()=>{const{alternation:r,repetition:i,option:s,repetitionMandatory:o,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:c}=W4(n);fe(r,u=>{const l=u.idx===0?"":u.idx;this.TRACE_INIT(`${Pr(u)}${l}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:n,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=Gm(this.fullRuleNameToShort[n.name],ZT,u.idx);this.setLaFuncCache(f,d)})}),fe(i,u=>{this.computeLookaheadFunc(n,u.idx,qm,"Repetition",u.maxLookahead,Pr(u))}),fe(s,u=>{this.computeLookaheadFunc(n,u.idx,QT,"Option",u.maxLookahead,Pr(u))}),fe(o,u=>{this.computeLookaheadFunc(n,u.idx,Um,"RepetitionMandatory",u.maxLookahead,Pr(u))}),fe(a,u=>{this.computeLookaheadFunc(n,u.idx,wf,"RepetitionMandatoryWithSeparator",u.maxLookahead,Pr(u))}),fe(c,u=>{this.computeLookaheadFunc(n,u.idx,Wm,"RepetitionWithSeparator",u.maxLookahead,Pr(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=Gm(this.fullRuleNameToShort[e.name],r,n);this.setLaFuncCache(c,a)})}getKeyForAutomaticLookahead(e,n){const r=this.getLastExplicitRuleShortName();return Gm(r,e,n)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,n){this.lookAheadFuncsCache.set(e,n)}}class U4 extends qo{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 bf=new U4;function W4(t){bf.reset(),t.accept(bf);const e=bf.dslMethods;return bf.reset(),e}function eR(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function tR(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 G4(t,e,n){t.children[n]===void 0?t.children[n]=[e]:t.children[n].push(e)}function H4(t,e,n){t.children[e]===void 0?t.children[e]=[n]:t.children[e].push(n)}const K4="name";function nR(t,e){Object.defineProperty(t,K4,{enumerable:!1,configurable:!0,writable:!1,value:e})}function V4(t,e){const n=Hn(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 Y4(t,e){const n=function(){};nR(n,t+"BaseSemantics");const r={visit:function(i,s){if(Ie(i)&&(i=i[0]),!ui(i))return this[i.name](i.children,s)},validateVisitor:function(){const i=J4(this,e);if(!Ve(i)){const s=ae(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 X4(t,e,n){const r=function(){};nR(r,t+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return fe(e,s=>{i[s]=V4}),r.prototype=i,r.prototype.constructor=r,r}var Km;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Km||(Km={}));function J4(t,e){return Z4(t,e)}function Z4(t,e){const n=An(e,i=>ii(t[i])===!1),r=ae(n,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:Km.MISSING_METHOD,methodName:i}));return kc(r)}class Q4{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=he(e,"nodeLocationTracking")?e.nodeLocationTracking:li.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=xt,this.cstFinallyStateUpdate=xt,this.cstPostTerminal=xt,this.cstPostNonTerminal=xt,this.cstPostRule=xt;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=tR,this.setNodeLocationFromNode=tR,this.cstPostRule=xt,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=xt,this.setNodeLocationFromNode=xt,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=eR,this.setNodeLocationFromNode=eR,this.cstPostRule=xt,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=xt,this.setNodeLocationFromNode=xt,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=xt,this.setNodeLocationFromNode=xt,this.cstPostRule=xt,this.setInitialNodeLocation=xt;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];G4(r,n,e),this.setNodeLocationFromToken(r.location,n)}cstPostNonTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];H4(r,n,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(ui(this.baseCstVisitorConstructor)){const e=Y4(this.className,Hn(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(ui(this.baseCstVisitorWithDefaultsConstructor)){const e=X4(this.className,Hn(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 e6{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)):Tf}LA(e){const n=this.currIdx+e;return n<0||this.tokVectorLength<=n?Tf: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 t6{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=Rf){if(rn(this.definedRulesNames,e)){const o={message:_s.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:an.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=Rf){const i=R4(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(yf(i))return!1;throw i}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return uB(It(this.gastProductionsCache))}}class n6{initRecognizerEngine(e,n){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=ff,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},he(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(Ie(e)){if(Ve(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(Ie(e))this.tokensMap=sn(e,(s,o)=>(s[o.name]=o,s),{});else if(he(e,"modes")&&ur(Kn(It(e.modes)),QB)){const s=Kn(It(e.modes)),o=_m(s);this.tokensMap=sn(o,(a,c)=>(a[c.name]=c,a),{})}else if(Gn(e))this.tokensMap=zt(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=he(e,"modes")?Kn(It(e.modes)):It(e),i=ur(r,s=>Ve(s.categoryMatches));this.tokenMatcher=i?ff:xc,Ic(It(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=he(r,"resyncEnabled")?r.resyncEnabled:Rf.resyncEnabled,s=he(r,"recoveryValueFunc")?r.recoveryValueFunc:Rf.recoveryValueFunc,o=this.ruleShortNameIdx<<j4+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(yf(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(QT,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(Um,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,at.REPETITION_MANDATORY,n.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,n],i,Um,e,u4)}atLeastOneSepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(wf,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,FT],a,wf,e,FT)}else throw this.raiseEarlyExitException(e,at.REPETITION_MANDATORY_WITH_SEPARATOR,n.ERR_MSG)}manyInternal(e,n){const r=this.getKeyForAutomaticLookahead(qm,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,qm,e,c4,o)}manySepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(Wm,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,OT],a,Wm,e,OT)}}repetitionSepSecondInternal(e,n,r,i,s){for(;r();)this.CONSUME(n),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,n,r,i,s],r,wf,e,s)}doSingleRepetition(e){const n=this.getLexerPosition();return e.call(this),this.getLexerPosition()>n}orInternal(e,n){const r=this.getKeyForAutomaticLookahead(ZT,n),i=Ie(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 F4(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 yf(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 XT(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===JT?r:s}}else throw r}saveRecogState(){const e=this.errors,n=zt(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 r6{initErrorHandler(e){this._errors=[],this.errorMessageProvider=he(e,"errorMessageProvider")?e.errorMessageProvider:li.errorMessageProvider}SAVE_ERROR(e){if(yf(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:zt(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return zt(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,n,r){const i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],a=gf(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 L4(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,n){const r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],s=pf(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 O4(c,this.LA(1),a))}}class i6{initContentAssist(){}computeContentAssist(e,n){const r=this.gastProductionsCache[e];if(ui(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return LT([r],n,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const n=lr(e.ruleStack),i=this.getGAstProductions()[n];return new a4(i,e).startWalking()}}const Df={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Df);const rR=!0,iR=Math.pow(2,Li)-1,sR=PT({name:"RECORDING_PHASE_TOKEN",pattern:En.NA});Ic([sR]);const oR=Om(sR,`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(oR);const s6={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 o6{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 Tf}topLevelRuleRecord(e,n){try{const r=new jo({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 Nc.call(this,jt,e,n)}atLeastOneInternalRecord(e,n){Nc.call(this,In,n,e)}atLeastOneSepFirstInternalRecord(e,n){Nc.call(this,Pn,n,e,rR)}manyInternalRecord(e,n){Nc.call(this,pt,n,e)}manySepFirstInternalRecord(e,n){Nc.call(this,bn,n,e,rR)}orInternalRecord(e,n){return a6.call(this,e,n)}subruleInternalRecord(e,n,r){if(Ef(n),!e||he(e,"ruleName")===!1){const a=new Error(`<SUBRULE${aR(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=zo(this.recordingProdStack),s=e.ruleName,o=new on({idx:n,nonTerminalName:s,label:r?.LABEL,referencedRule:void 0});return i.definition.push(o),this.outputCst?s6:Df}consumeInternalRecord(e,n,r){if(Ef(n),!ET(e)){const o=new Error(`<CONSUME${aR(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=zo(this.recordingProdStack),s=new rt({idx:n,terminalType:e,label:r?.LABEL});return i.definition.push(s),oR}}function Nc(t,e,n,r=!1){Ef(n);const i=zo(this.recordingProdStack),s=ii(e)?e:e.DEF,o=new t({definition:[],idx:n});return r&&(o.separator=e.SEP),he(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),i.definition.push(o),this.recordingProdStack.pop(),Df}function a6(t,e){Ef(e);const n=zo(this.recordingProdStack),r=Ie(t)===!1,i=r===!1?t:t.DEF,s=new Dn({definition:[],idx:e,ignoreAmbiguities:r&&t.IGNORE_AMBIGUITIES===!0});he(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);const o=iT(i,a=>ii(a.GATE));return s.hasPredicates=o,n.definition.push(s),fe(i,a=>{const c=new wn({definition:[]});s.definition.push(c),he(a,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:he(a,"GATE")&&(c.ignoreAmbiguities=!0),this.recordingProdStack.push(c),a.ALT.call(this),this.recordingProdStack.pop()}),Df}function aR(t){return t===0?"":`${t}`}function Ef(t){if(t<0||t>iR){const e=new Error(`Invalid DSL Method idx value: <${t}>
105
- Idx value must be a none negative value smaller than ${iR+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class c6{initPerformanceTracer(e){if(he(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=li.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}=aT(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 u6(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 Tf=Om(Fi,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Tf);const li=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Wo,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Rf=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var an;(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"})(an||(an={}));function cR(t=void 0){return function(){return t}}class Vl{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",()=>{cT(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),fe(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=P4({rules:It(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT("Grammar Validations",()=>{if(Ve(r)&&this.skipValidations===!1){const i=N4({rules:It(this.gastProductionsCache),tokenTypes:It(this.tokensMap),errMsgProvider:_s,grammarName:n}),s=v4({lookaheadStrategy:this.lookaheadStrategy,rules:It(this.gastProductionsCache),tokenTypes:It(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(i,s)}}),Ve(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=mB(It(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:It(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(It(this.gastProductionsCache))})),!Vl.DEFER_DEFINITION_ERRORS_HANDLING&&!Ve(this.definitionErrors))throw e=ae(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),he(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=he(n,"skipValidations")?n.skipValidations:li.skipValidations}}Vl.DEFER_DEFINITION_ERRORS_HANDLING=!1,u6(Vl,[z4,q4,Q4,e6,n6,t6,r6,i6,o6,c6]);class l6 extends Vl{constructor(e,n=li){const r=zt(n);r.outputCst=!1,super(e,r)}}function Go(t,e,n){return`${t.name}_${e}_${n}`}const Mi=1,d6=2,uR=4,lR=5,Oc=7,f6=8,h6=9,p6=10,g6=11,dR=12;class Vm{constructor(e){this.target=e}isEpsilon(){return!1}}class Ym extends Vm{constructor(e,n){super(e),this.tokenType=n}}class fR extends Vm{constructor(e){super(e)}isEpsilon(){return!0}}class Xm extends Vm{constructor(e,n,r){super(e),this.rule=n,this.followState=r}isEpsilon(){return!0}}function m6(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};y6(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&&C6(e,i,s)}return e}function y6(t,e){const n=e.length;for(let r=0;r<n;r++){const i=e[r],s=Nt(t,i,void 0,{type:d6}),o=Nt(t,i,void 0,{type:Oc});s.stop=o,t.ruleToStartState.set(i,s),t.ruleToStopState.set(i,o)}}function hR(t,e,n){return n instanceof rt?Jm(t,e,n.terminalType,n):n instanceof on?$6(t,e,n):n instanceof Dn?E6(t,e,n):n instanceof jt?T6(t,e,n):n instanceof pt?v6(t,e,n):n instanceof bn?w6(t,e,n):n instanceof In?b6(t,e,n):n instanceof Pn?D6(t,e,n):As(t,e,n)}function v6(t,e,n){const r=Nt(t,e,n,{type:lR});zi(t,r);const i=Ho(t,e,r,n,As(t,e,n));return gR(t,e,n,i)}function w6(t,e,n){const r=Nt(t,e,n,{type:lR});zi(t,r);const i=Ho(t,e,r,n,As(t,e,n)),s=Jm(t,e,n.separator,n);return gR(t,e,n,i,s)}function b6(t,e,n){const r=Nt(t,e,n,{type:uR});zi(t,r);const i=Ho(t,e,r,n,As(t,e,n));return pR(t,e,n,i)}function D6(t,e,n){const r=Nt(t,e,n,{type:uR});zi(t,r);const i=Ho(t,e,r,n,As(t,e,n)),s=Jm(t,e,n.separator,n);return pR(t,e,n,i,s)}function E6(t,e,n){const r=Nt(t,e,n,{type:Mi});zi(t,r);const i=ae(n.definition,o=>hR(t,e,o));return Ho(t,e,r,n,...i)}function T6(t,e,n){const r=Nt(t,e,n,{type:Mi});zi(t,r);const i=Ho(t,e,r,n,As(t,e,n));return R6(t,e,n,i)}function As(t,e,n){const r=An(ae(n.definition,i=>hR(t,e,i)),i=>i!==void 0);return r.length===1?r[0]:r.length===0?void 0:k6(t,r)}function pR(t,e,n,r,i){const s=r.left,o=r.right,a=Nt(t,e,n,{type:g6});zi(t,a);const c=Nt(t,e,n,{type:dR});return s.loopback=a,c.loopback=a,t.decisionMap[Go(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",n.idx)]=a,kt(o,a),i===void 0?(kt(a,s),kt(a,c)):(kt(a,c),kt(a,i.left),kt(i.right,s)),{left:s,right:c}}function gR(t,e,n,r,i){const s=r.left,o=r.right,a=Nt(t,e,n,{type:p6});zi(t,a);const c=Nt(t,e,n,{type:dR}),u=Nt(t,e,n,{type:h6});return a.loopback=u,c.loopback=u,kt(a,s),kt(a,c),kt(o,u),i!==void 0?(kt(u,c),kt(u,i.left),kt(i.right,s)):kt(u,a),t.decisionMap[Go(e,i?"RepetitionWithSeparator":"Repetition",n.idx)]=a,{left:a,right:c}}function R6(t,e,n,r){const i=r.left,s=r.right;return kt(i,s),t.decisionMap[Go(e,"Option",n.idx)]=i,r}function zi(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function Ho(t,e,n,r,...i){const s=Nt(t,e,r,{type:f6,start:n});n.end=s;for(const a of i)a!==void 0?(kt(n,a.left),kt(a.right,s)):kt(n,s);const o={left:n,right:s};return t.decisionMap[Go(e,S6(r),r.idx)]=n,o}function S6(t){if(t instanceof Dn)return"Alternation";if(t instanceof jt)return"Option";if(t instanceof pt)return"Repetition";if(t instanceof bn)return"RepetitionWithSeparator";if(t instanceof In)return"RepetitionMandatory";if(t instanceof Pn)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function k6(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 Xm,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,_6(t,o.right)):kt(o.right,l)}const r=e[0],i=e[n-1];return{left:r.left,right:i.right}}function Jm(t,e,n,r){const i=Nt(t,e,r,{type:Mi}),s=Nt(t,e,r,{type:Mi});return Zm(i,new Ym(s,n)),{left:i,right:s}}function $6(t,e,n){const r=n.referencedRule,i=t.ruleToStartState.get(r),s=Nt(t,e,n,{type:Mi}),o=Nt(t,e,n,{type:Mi}),a=new Xm(i,r,o);return Zm(s,a),{left:s,right:o}}function C6(t,e,n){const r=t.ruleToStartState.get(e);kt(r,n.left);const i=t.ruleToStopState.get(e);return kt(n.right,i),{left:r,right:i}}function kt(t,e){const n=new fR(e);Zm(t,n)}function Nt(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 Zm(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function _6(t,e){t.states.splice(t.states.indexOf(e),1)}const Sf={};class Qm{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const n=mR(e);n in this.map||(this.map[n]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return ae(this.configs,e=>e.alt)}get key(){let e="";for(const n in this.map)e+=n+":";return e}}function mR(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(n=>n.stateNumber.toString()).join("_")}`}function A6(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 yR{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 vR=new yR;class x6 extends Hm{constructor(e){var n;super(),this.logging=(n=e?.logging)!==null&&n!==void 0?n:r=>console.log(r)}initialize(e){this.atn=m6(e.rules),this.dfas=I6(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=Go(r,"Alternation",n),l=this.atn.decisionMap[c].decision,d=ae(MT({maxLookahead:1,occurrence:n,prodType:"Alternation",rule:r}),f=>ae(f,h=>h[0]));if(wR(d,!1)&&!s){const f=sn(d,(h,p,m)=>(fe(p,w=>{w&&(h[w.tokenTypeIdx]=m,fe(w.categoryMatches,v=>{h[v]=m}))}),h),{});return i?function(h){var p;const m=this.LA(1),w=f[m.tokenTypeIdx];if(h!==void 0&&w!==void 0){const v=(p=h[w])===null||p===void 0?void 0:p.GATE;if(v!==void 0&&v.call(this)===!1)return}return w}:function(){const h=this.LA(1);return f[h.tokenTypeIdx]}}else return i?function(f){const h=new yR,p=f===void 0?0:f.length;for(let w=0;w<p;w++){const v=f?.[w].GATE;h.set(w,v===void 0||v.call(this))}const m=ey.call(this,o,l,h,a);return typeof m=="number"?m:void 0}:function(){const f=ey.call(this,o,l,vR,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=Go(r,i,n),l=this.atn.decisionMap[c].decision,d=ae(MT({maxLookahead:1,occurrence:n,prodType:i,rule:r}),f=>ae(f,h=>h[0]));if(wR(d)&&d[0][0]&&!s){const f=d[0],h=Kn(f);if(h.length===1&&Ve(h[0].categoryMatches)){const m=h[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const p=sn(h,(m,w)=>(w!==void 0&&(m[w.tokenTypeIdx]=!0,fe(w.categoryMatches,v=>{m[v]=!0})),m),{});return function(){const m=this.LA(1);return p[m.tokenTypeIdx]===!0}}}return function(){const f=ey.call(this,o,l,vR,a);return typeof f=="object"?!1:f===0}}}function wR(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 I6(t){const e=t.decisionStates.length,n=Array(e);for(let r=0;r<e;r++)n[r]=A6(t.decisionStates[r],r);return n}function ey(t,e,n,r){const i=t[e](n);let s=i.start;if(s===void 0){const a=U6(i.atnStartState);s=ER(i,bR(a)),i.start=s}return P6.apply(this,[i,s,n,r])}function P6(t,e,n,r){let i=e,s=1;const o=[];let a=this.LA(s++);for(;;){let c=z6(i,a);if(c===void 0&&(c=N6.apply(this,[t,i,a,s,n,r])),c===Sf)return M6(o,i,a);if(c.isAcceptState===!0)return c.prediction;i=c,o.push(a),a=this.LA(s++)}}function N6(t,e,n,r,i,s){const o=B6(e.configs,n,i);if(o.size===0)return DR(t,e,n,Sf),Sf;let a=bR(o);const c=q6(o,i);if(c!==void 0)a.isAcceptState=!0,a.prediction=c,a.configs.uniqueAlt=c;else if(K6(o)){const u=Xz(o.alts);a.isAcceptState=!0,a.prediction=u,a.configs.uniqueAlt=u,O6.apply(this,[t,r,o.alts,s])}return a=DR(t,e,n,a),a}function O6(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=F6({topLevelRule:o,ambiguityIndices:n,production:a,prefixPath:i});r(c)}function F6(t){const e=ae(t.prefixPath,i=>Uo(i)).join(", "),n=t.production.idx===0?"":t.production.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${L6(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 L6(t){if(t instanceof on)return"SUBRULE";if(t instanceof jt)return"OPTION";if(t instanceof Dn)return"OR";if(t instanceof In)return"AT_LEAST_ONE";if(t instanceof Pn)return"AT_LEAST_ONE_SEP";if(t instanceof bn)return"MANY_SEP";if(t instanceof pt)return"MANY";if(t instanceof rt)return"CONSUME";throw Error("non exhaustive match")}function M6(t,e,n){const r=xn(e.configs.elements,s=>s.state.transitions),i=oB(r.filter(s=>s instanceof Ym).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:n,possibleTokenTypes:i,tokenPath:t}}function z6(t,e){return t.edges[e.tokenTypeIdx]}function B6(t,e,n){const r=new Qm,i=[];for(const o of t.elements){if(n.is(o.alt)===!1)continue;if(o.state.type===Oc){i.push(o);continue}const a=o.state.transitions.length;for(let c=0;c<a;c++){const u=o.state.transitions[c],l=j6(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 Qm;for(const o of r.elements)kf(o,s)}if(i.length>0&&!G6(s))for(const o of i)s.add(o);return s}function j6(t,e){if(t instanceof Ym&&NT(e,t.tokenType))return t.target}function q6(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 bR(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function DR(t,e,n,r){return r=ER(t,r),e.edges[n.tokenTypeIdx]=r,r}function ER(t,e){if(e===Sf)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 U6(t){const e=new Qm,n=t.transitions.length;for(let r=0;r<n;r++){const s={state:t.transitions[r].target,alt:r,stack:[]};kf(s,e)}return e}function kf(t,e){const n=t.state;if(n.type===Oc){if(t.stack.length>0){const i=[...t.stack],o={state:i.pop(),alt:t.alt,stack:i};kf(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=W6(t,s);o!==void 0&&kf(o,e)}}function W6(t,e){if(e instanceof fR)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Xm){const n=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:n}}}function G6(t){for(const e of t.elements)if(e.state.type===Oc)return!0;return!1}function H6(t){for(const e of t.elements)if(e.state.type!==Oc)return!1;return!0}function K6(t){if(H6(t))return!0;const e=V6(t.elements);return Y6(e)&&!X6(e)}function V6(t){const e=new Map;for(const n of t){const r=mR(n,!1);let i=e.get(r);i===void 0&&(i={},e.set(r,i)),i[n.alt]=!0}return e}function Y6(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function X6(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var TR;(function(t){function e(n){return typeof n=="string"}t.is=e})(TR||(TR={}));var ty;(function(t){function e(n){return typeof n=="string"}t.is=e})(ty||(ty={}));var RR;(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})(RR||(RR={}));var $f;(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})($f||($f={}));var Be;(function(t){function e(r,i){return r===Number.MAX_VALUE&&(r=$f.MAX_VALUE),i===Number.MAX_VALUE&&(i=$f.MAX_VALUE),{line:r,character:i}}t.create=e;function n(r){let i=r;return F.objectLiteral(i)&&F.uinteger(i.line)&&F.uinteger(i.character)}t.is=n})(Be||(Be={}));var Ce;(function(t){function e(r,i,s,o){if(F.uinteger(r)&&F.uinteger(i)&&F.uinteger(s)&&F.uinteger(o))return{start:Be.create(r,i),end:Be.create(s,o)};if(Be.is(r)&&Be.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 F.objectLiteral(i)&&Be.is(i.start)&&Be.is(i.end)}t.is=n})(Ce||(Ce={}));var Cf;(function(t){function e(r,i){return{uri:r,range:i}}t.create=e;function n(r){let i=r;return F.objectLiteral(i)&&Ce.is(i.range)&&(F.string(i.uri)||F.undefined(i.uri))}t.is=n})(Cf||(Cf={}));var SR;(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 F.objectLiteral(i)&&Ce.is(i.targetRange)&&F.string(i.targetUri)&&Ce.is(i.targetSelectionRange)&&(Ce.is(i.originSelectionRange)||F.undefined(i.originSelectionRange))}t.is=n})(SR||(SR={}));var ny;(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 F.objectLiteral(i)&&F.numberRange(i.red,0,1)&&F.numberRange(i.green,0,1)&&F.numberRange(i.blue,0,1)&&F.numberRange(i.alpha,0,1)}t.is=n})(ny||(ny={}));var kR;(function(t){function e(r,i){return{range:r,color:i}}t.create=e;function n(r){const i=r;return F.objectLiteral(i)&&Ce.is(i.range)&&ny.is(i.color)}t.is=n})(kR||(kR={}));var $R;(function(t){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}t.create=e;function n(r){const i=r;return F.objectLiteral(i)&&F.string(i.label)&&(F.undefined(i.textEdit)||Tn.is(i))&&(F.undefined(i.additionalTextEdits)||F.typedArray(i.additionalTextEdits,Tn.is))}t.is=n})($R||($R={}));var CR;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(CR||(CR={}));var _R;(function(t){function e(r,i,s,o,a,c){const u={startLine:r,endLine:i};return F.defined(s)&&(u.startCharacter=s),F.defined(o)&&(u.endCharacter=o),F.defined(a)&&(u.kind=a),F.defined(c)&&(u.collapsedText=c),u}t.create=e;function n(r){const i=r;return F.objectLiteral(i)&&F.uinteger(i.startLine)&&F.uinteger(i.startLine)&&(F.undefined(i.startCharacter)||F.uinteger(i.startCharacter))&&(F.undefined(i.endCharacter)||F.uinteger(i.endCharacter))&&(F.undefined(i.kind)||F.string(i.kind))}t.is=n})(_R||(_R={}));var ry;(function(t){function e(r,i){return{location:r,message:i}}t.create=e;function n(r){let i=r;return F.defined(i)&&Cf.is(i.location)&&F.string(i.message)}t.is=n})(ry||(ry={}));var Fc;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Fc||(Fc={}));var AR;(function(t){t.Unnecessary=1,t.Deprecated=2})(AR||(AR={}));var xR;(function(t){function e(n){const r=n;return F.objectLiteral(r)&&F.string(r.href)}t.is=e})(xR||(xR={}));var _f;(function(t){function e(r,i,s,o,a,c){let u={range:r,message:i};return F.defined(s)&&(u.severity=s),F.defined(o)&&(u.code=o),F.defined(a)&&(u.source=a),F.defined(c)&&(u.relatedInformation=c),u}t.create=e;function n(r){var i;let s=r;return F.defined(s)&&Ce.is(s.range)&&F.string(s.message)&&(F.number(s.severity)||F.undefined(s.severity))&&(F.integer(s.code)||F.string(s.code)||F.undefined(s.code))&&(F.undefined(s.codeDescription)||F.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(F.string(s.source)||F.undefined(s.source))&&(F.undefined(s.relatedInformation)||F.typedArray(s.relatedInformation,ry.is))}t.is=n})(_f||(_f={}));var Ko;(function(t){function e(r,i,...s){let o={title:r,command:i};return F.defined(s)&&s.length>0&&(o.arguments=s),o}t.create=e;function n(r){let i=r;return F.defined(i)&&F.string(i.title)&&F.string(i.command)}t.is=n})(Ko||(Ko={}));var Tn;(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 F.objectLiteral(o)&&F.string(o.newText)&&Ce.is(o.range)}t.is=i})(Tn||(Tn={}));var iy;(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 F.objectLiteral(i)&&F.string(i.label)&&(F.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(F.string(i.description)||i.description===void 0)}t.is=n})(iy||(iy={}));var Vo;(function(t){function e(n){const r=n;return F.string(r)}t.is=e})(Vo||(Vo={}));var IR;(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 Tn.is(o)&&(iy.is(o.annotationId)||Vo.is(o.annotationId))}t.is=i})(IR||(IR={}));var sy;(function(t){function e(r,i){return{textDocument:r,edits:i}}t.create=e;function n(r){let i=r;return F.defined(i)&&ly.is(i.textDocument)&&Array.isArray(i.edits)}t.is=n})(sy||(sy={}));var oy;(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"&&F.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||F.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||F.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Vo.is(i.annotationId))}t.is=n})(oy||(oy={}));var ay;(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"&&F.string(i.oldUri)&&F.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||F.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||F.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Vo.is(i.annotationId))}t.is=n})(ay||(ay={}));var cy;(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"&&F.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||F.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||F.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Vo.is(i.annotationId))}t.is=n})(cy||(cy={}));var uy;(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=>F.string(i.kind)?oy.is(i)||ay.is(i)||cy.is(i):sy.is(i)))}t.is=e})(uy||(uy={}));var PR;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let i=r;return F.defined(i)&&F.string(i.uri)}t.is=n})(PR||(PR={}));var NR;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return F.defined(i)&&F.string(i.uri)&&F.integer(i.version)}t.is=n})(NR||(NR={}));var ly;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return F.defined(i)&&F.string(i.uri)&&(i.version===null||F.integer(i.version))}t.is=n})(ly||(ly={}));var OR;(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 F.defined(i)&&F.string(i.uri)&&F.string(i.languageId)&&F.integer(i.version)&&F.string(i.text)}t.is=n})(OR||(OR={}));var dy;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){const r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(dy||(dy={}));var Lc;(function(t){function e(n){const r=n;return F.objectLiteral(n)&&dy.is(r.kind)&&F.string(r.value)}t.is=e})(Lc||(Lc={}));var Yn;(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})(Yn||(Yn={}));var Af;(function(t){t.PlainText=1,t.Snippet=2})(Af||(Af={}));var FR;(function(t){t.Deprecated=1})(FR||(FR={}));var LR;(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&&F.string(i.newText)&&Ce.is(i.insert)&&Ce.is(i.replace)}t.is=n})(LR||(LR={}));var MR;(function(t){t.asIs=1,t.adjustIndentation=2})(MR||(MR={}));var zR;(function(t){function e(n){const r=n;return r&&(F.string(r.detail)||r.detail===void 0)&&(F.string(r.description)||r.description===void 0)}t.is=e})(zR||(zR={}));var BR;(function(t){function e(n){return{label:n}}t.create=e})(BR||(BR={}));var jR;(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(jR||(jR={}));var xf;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){const i=r;return F.string(i)||F.objectLiteral(i)&&F.string(i.language)&&F.string(i.value)}t.is=n})(xf||(xf={}));var qR;(function(t){function e(n){let r=n;return!!r&&F.objectLiteral(r)&&(Lc.is(r.contents)||xf.is(r.contents)||F.typedArray(r.contents,xf.is))&&(n.range===void 0||Ce.is(n.range))}t.is=e})(qR||(qR={}));var UR;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(UR||(UR={}));var WR;(function(t){function e(n,r,...i){let s={label:n};return F.defined(r)&&(s.documentation=r),F.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(WR||(WR={}));var GR;(function(t){t.Text=1,t.Read=2,t.Write=3})(GR||(GR={}));var HR;(function(t){function e(n,r){let i={range:n};return F.number(r)&&(i.kind=r),i}t.create=e})(HR||(HR={}));var fr;(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})(fr||(fr={}));var KR;(function(t){t.Deprecated=1})(KR||(KR={}));var VR;(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})(VR||(VR={}));var YR;(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})(YR||(YR={}));var XR;(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&&F.string(i.name)&&F.number(i.kind)&&Ce.is(i.range)&&Ce.is(i.selectionRange)&&(i.detail===void 0||F.string(i.detail))&&(i.deprecated===void 0||F.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=n})(XR||(XR={}));var JR;(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"})(JR||(JR={}));var If;(function(t){t.Invoked=1,t.Automatic=2})(If||(If={}));var ZR;(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 F.defined(i)&&F.typedArray(i.diagnostics,_f.is)&&(i.only===void 0||F.typedArray(i.only,F.string))&&(i.triggerKind===void 0||i.triggerKind===If.Invoked||i.triggerKind===If.Automatic)}t.is=n})(ZR||(ZR={}));var QR;(function(t){function e(r,i,s){let o={title:r},a=!0;return typeof i=="string"?(a=!1,o.kind=i):Ko.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&&F.string(i.title)&&(i.diagnostics===void 0||F.typedArray(i.diagnostics,_f.is))&&(i.kind===void 0||F.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Ko.is(i.command))&&(i.isPreferred===void 0||F.boolean(i.isPreferred))&&(i.edit===void 0||uy.is(i.edit))}t.is=n})(QR||(QR={}));var eS;(function(t){function e(r,i){let s={range:r};return F.defined(i)&&(s.data=i),s}t.create=e;function n(r){let i=r;return F.defined(i)&&Ce.is(i.range)&&(F.undefined(i.command)||Ko.is(i.command))}t.is=n})(eS||(eS={}));var tS;(function(t){function e(r,i){return{tabSize:r,insertSpaces:i}}t.create=e;function n(r){let i=r;return F.defined(i)&&F.uinteger(i.tabSize)&&F.boolean(i.insertSpaces)}t.is=n})(tS||(tS={}));var nS;(function(t){function e(r,i,s){return{range:r,target:i,data:s}}t.create=e;function n(r){let i=r;return F.defined(i)&&Ce.is(i.range)&&(F.undefined(i.target)||F.string(i.target))}t.is=n})(nS||(nS={}));var rS;(function(t){function e(r,i){return{range:r,parent:i}}t.create=e;function n(r){let i=r;return F.objectLiteral(i)&&Ce.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=n})(rS||(rS={}));var Me;(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"})(Me||(Me={}));var ct;(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"})(ct||(ct={}));var iS;(function(t){function e(n){const r=n;return F.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})(iS||(iS={}));var sS;(function(t){function e(r,i){return{range:r,text:i}}t.create=e;function n(r){const i=r;return i!=null&&Ce.is(i.range)&&F.string(i.text)}t.is=n})(sS||(sS={}));var oS;(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&&Ce.is(i.range)&&F.boolean(i.caseSensitiveLookup)&&(F.string(i.variableName)||i.variableName===void 0)}t.is=n})(oS||(oS={}));var aS;(function(t){function e(r,i){return{range:r,expression:i}}t.create=e;function n(r){const i=r;return i!=null&&Ce.is(i.range)&&(F.string(i.expression)||i.expression===void 0)}t.is=n})(aS||(aS={}));var cS;(function(t){function e(r,i){return{frameId:r,stoppedLocation:i}}t.create=e;function n(r){const i=r;return F.defined(i)&&Ce.is(r.stoppedLocation)}t.is=n})(cS||(cS={}));var fy;(function(t){t.Type=1,t.Parameter=2;function e(n){return n===1||n===2}t.is=e})(fy||(fy={}));var hy;(function(t){function e(r){return{value:r}}t.create=e;function n(r){const i=r;return F.objectLiteral(i)&&(i.tooltip===void 0||F.string(i.tooltip)||Lc.is(i.tooltip))&&(i.location===void 0||Cf.is(i.location))&&(i.command===void 0||Ko.is(i.command))}t.is=n})(hy||(hy={}));var uS;(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 F.objectLiteral(i)&&Be.is(i.position)&&(F.string(i.label)||F.typedArray(i.label,hy.is))&&(i.kind===void 0||fy.is(i.kind))&&i.textEdits===void 0||F.typedArray(i.textEdits,Tn.is)&&(i.tooltip===void 0||F.string(i.tooltip)||Lc.is(i.tooltip))&&(i.paddingLeft===void 0||F.boolean(i.paddingLeft))&&(i.paddingRight===void 0||F.boolean(i.paddingRight))}t.is=n})(uS||(uS={}));var lS;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(lS||(lS={}));var dS;(function(t){function e(n,r,i,s){return{insertText:n,filterText:r,range:i,command:s}}t.create=e})(dS||(dS={}));var fS;(function(t){function e(n){return{items:n}}t.create=e})(fS||(fS={}));var hS;(function(t){t.Invoked=0,t.Automatic=1})(hS||(hS={}));var pS;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(pS||(pS={}));var gS;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(gS||(gS={}));var mS;(function(t){function e(n){const r=n;return F.objectLiteral(r)&&ty.is(r.uri)&&F.string(r.name)}t.is=e})(mS||(mS={}));var yS;(function(t){function e(s,o,a,c){return new J6(s,o,a,c)}t.create=e;function n(s){let o=s;return!!(F.defined(o)&&F.string(o.uri)&&(F.undefined(o.languageId)||F.string(o.languageId))&&F.uinteger(o.lineCount)&&F.func(o.getText)&&F.func(o.positionAt)&&F.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),h=s.offsetAt(d.range.end);if(h<=u)a=a.substring(0,f)+d.newText+a.substring(h,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}})(yS||(yS={}));let J6=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 Be.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 Be.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 F;(function(t){const e=Object.prototype.toString;function n(h){return typeof h<"u"}t.defined=n;function r(h){return typeof h>"u"}t.undefined=r;function i(h){return h===!0||h===!1}t.boolean=i;function s(h){return e.call(h)==="[object String]"}t.string=s;function o(h){return e.call(h)==="[object Number]"}t.number=o;function a(h,p,m){return e.call(h)==="[object Number]"&&p<=h&&h<=m}t.numberRange=a;function c(h){return e.call(h)==="[object Number]"&&-2147483648<=h&&h<=2147483647}t.integer=c;function u(h){return e.call(h)==="[object Number]"&&0<=h&&h<=2147483647}t.uinteger=u;function l(h){return e.call(h)==="[object Function]"}t.func=l;function d(h){return h!==null&&typeof h=="object"}t.objectLiteral=d;function f(h,p){return Array.isArray(h)&&h.every(p)}t.typedArray=f})(F||(F={}));class Z6{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]}buildRootNode(e){return this.rootNode=new wS(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const n=new gy;return n.grammarSource=e,n.root=this.rootNode,this.current.content.push(n),this.nodeStack.push(n),n}buildLeafNode(e,n){const r=new py(e.startOffset,e.image.length,vd(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 py(n.startOffset,n.image.length,vd(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(Qr(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 vS{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 py extends vS{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 gy extends vS{constructor(){super(...arguments),this.content=new N0(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:Be.create(0,0),end:Be.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 N0 extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,N0.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 wS extends gy{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const my=Symbol("Datatype");function yy(t){return t.$type===my}const bS="\u200B",DS=t=>t.endsWith(bS)?t:t+bS;class ES{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const n=this.lexer.definition;this.wrapper=new r5(n,Object.assign(Object.assign({},e.parser.ParserConfig),{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 Q6 extends ES{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new Z6,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(DS(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(zd(e))return my;{const n=Es(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===my&&(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=$r(r)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,u,s,a)}else if(yy(c)){let u=i.image;$r(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(yy(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.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 qg(e),this.nodeBuilder.construct(e),this.stack.pop(),yy(e)?this.converter.convert(e.value,e.$cstNode):(Gg(this.astReflection,e),e)}getAssignment(e){if(!this.assignmentMap.has(e)){const n=yn(e,kr);this.assignmentMap.set(e,{assignment:n,isCrossRef:n?Qa(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 e5{buildMismatchTokenMessage(e){return Wo.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Wo.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Wo.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Wo.buildEarlyExitMessage(e)}}class TS extends e5{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 t5 extends ES{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(DS(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 n5={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new TS};class r5 extends l6{constructor(e,n){const r=n&&"maxLookahead"in n;super(e,Object.assign(Object.assign(Object.assign({},n5),{lookaheadStrategy:r?new Hm({maxLookahead:n.maxLookahead}):new x6}),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 RS(t,e,n){return i5({parser:e,tokens:n,ruleNames:new Map},t),e}function i5(t,e){const n=Xg(e,!1),r=He(e.rules).filter(Vt).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,xs(s,i.definition))}}function xs(t,e,n=!1){let r;if($r(e))r=d5(t,e);else if(Ds(e))r=s5(t,e);else if(kr(e))r=xs(t,e.terminal);else if(Qa(e))r=SS(t,e);else if(ti(e))r=o5(t,e);else if(Bg(e))r=c5(t,e);else if(jg(e))r=u5(t,e);else if(Ii(e))r=l5(t,e);else if(ZO(e)){const i=t.consume++;r=()=>t.parser.consume(i,Fi,e)}else throw new CD(e.$cstNode,`Unexpected element type: ${e.$type}`);return kS(t,n?void 0:Pf(e),r,e.cardinality)}function s5(t,e){const n=gc(e);return()=>t.parser.action(n,e)}function o5(t,e){const n=e.rule.ref;if(Vt(n)){const r=t.subrule++,i=e.arguments.length>0?a5(n,e.arguments):()=>({});return s=>t.parser.subrule(r,$S(t,n),e,i(s))}else if(ei(n)){const r=t.consume++,i=vy(t,n.name);return()=>t.parser.consume(r,i,e)}else if(n)Dd();else throw new CD(e.$cstNode,`Undefined rule type: ${e.$type}`)}function a5(t,e){const n=e.map(r=>di(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 di(t){if(GO(t)){const e=di(t.left),n=di(t.right);return r=>e(r)||n(r)}else if(WO(t)){const e=di(t.left),n=di(t.right);return r=>e(r)&&n(r)}else if(HO(t)){const e=di(t.value);return n=>!e(n)}else if(KO(t)){const e=t.parameter.ref.name;return n=>n!==void 0&&n[e]===!0}else if(UO(t)){const e=!!t.true;return()=>e}Dd()}function c5(t,e){if(e.elements.length===1)return xs(t,e.elements[0]);{const n=[];for(const i of e.elements){const s={ALT:xs(t,i,!0)},o=Pf(i);o&&(s.GATE=di(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 u5(t,e){if(e.elements.length===1)return xs(t,e.elements[0]);const n=[];for(const a of e.elements){const c={ALT:xs(t,a,!0)},u=Pf(a);u&&(c.GATE=di(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 h=i(r,d);d.unorderedGroups.get(h)||d.unorderedGroups.set(h,[]);const p=d.unorderedGroups.get(h);typeof p?.[u]>"u"&&(p[u]=!0)}};const f=c.GATE;return f?l.GATE=()=>f(a):l.GATE=()=>{const h=d.unorderedGroups.get(i(r,d));return!h?.[u]},l})),o=kS(t,Pf(e),s,"*");return a=>{o(a),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(r,t.parser))}}function l5(t,e){const n=e.elements.map(r=>xs(t,r));return r=>n.forEach(i=>i(r))}function Pf(t){if(Ii(t))return t.guardCondition}function SS(t,e,n=e.terminal){if(n)if(ti(n)&&Vt(n.rule.ref)){const r=t.subrule++;return i=>t.parser.subrule(r,$S(t,n.rule.ref),e,i)}else if(ti(n)&&ei(n.rule.ref)){const r=t.consume++,i=vy(t,n.rule.ref.name);return()=>t.parser.consume(r,i,e)}else if($r(n)){const r=t.consume++,i=vy(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=tm(e.type.ref),i=r?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+gc(e.type.ref));return SS(t,e,i)}}function d5(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 kS(t,e,n,r){const i=e&&di(e);if(!r)if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:()=>n(o),GATE:()=>i(o)},{ALT:cR(),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:cR(),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 Dd()}function $S(t,e){const n=f5(t,e),r=t.parser.getRule(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function f5(t,e){if(Vt(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let n=e,r=n.$container,i=e.$type;for(;!Vt(r);)(Ii(r)||Bg(r)||jg(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 vy(t,e){const n=t.tokens[e];if(!n)throw new Error(`Token "${e}" not found."`);return n}function h5(t){const e=t.Grammar,n=t.parser.Lexer,r=new t5(t);return RS(e,r,n.definition),r.finalize(),r}function p5(t){const e=g5(t);return e.finalize(),e}function g5(t){const e=t.Grammar,n=t.parser.Lexer,r=new Q6(t);return RS(e,r,n.definition)}class m5{constructor(){this.diagnostics=[]}buildTokens(e,n){const r=He(Xg(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&&Yg(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(ei).filter(n=>!n.fragment).map(n=>this.buildTerminalToken(n)).toArray()}buildTerminalToken(e){const n=mc(e),r=this.requiresCustomPattern(n)?this.regexPatternFunction(n):n,i={name:e.name,PATTERN:r,LINE_BREAKS:!0};return e.hidden&&(i.GROUP=Yg(n)?En.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(Vt).flatMap(i=>Cr(i).filter($r)).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){return{name:e.value,PATTERN:this.buildKeywordPattern(e,r),LONGER_ALT:this.findLongerAlt(e,n)}}buildKeywordPattern(e,n){return n?new RegExp(hF(e.value)):e.value}findLongerAlt(e,n){return n.reduce((r,i)=>{const s=i?.PATTERN;return s?.source&&pF("^"+s.source+"$",e.value)&&r.push(i),r},[])}}class y5{convert(e,n){let r=n.grammarSource;if(Qa(r)&&(r=Jg(r)),ti(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 fi.convertInt(n);case"STRING":return fi.convertString(n);case"ID":return fi.convertID(n)}switch((i=YD(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return fi.convertNumber(n);case"boolean":return fi.convertBoolean(n);case"bigint":return fi.convertBigint(n);case"date":return fi.convertDate(n);default:return n}}}var fi;(function(t){function e(u){let l="";for(let d=1;d<u.length-1;d++){const f=u.charAt(d);if(f==="\\"){const h=u.charAt(++d);l+=n(h)}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})(fi||(fi={}));var Is={},Nf={},CS;function Ps(){if(CS)return Nf;CS=1,Object.defineProperty(Nf,"__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||(e={})),Nf.default=e,Nf}var qt={},_S;function Mc(){if(_S)return qt;_S=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.stringArray=qt.array=qt.func=qt.error=qt.number=qt.string=qt.boolean=void 0;function t(a){return a===!0||a===!1}qt.boolean=t;function e(a){return typeof a=="string"||a instanceof String}qt.string=e;function n(a){return typeof a=="number"||a instanceof Number}qt.number=n;function r(a){return a instanceof Error}qt.error=r;function i(a){return typeof a=="function"}qt.func=i;function s(a){return Array.isArray(a)}qt.array=s;function o(a){return s(a)&&a.every(c=>e(c))}return qt.stringArray=o,qt}var Ns={},AS;function Yo(){if(AS)return Ns;AS=1,Object.defineProperty(Ns,"__esModule",{value:!0}),Ns.Emitter=Ns.Event=void 0;const t=Ps();var e;(function(i){const s={dispose(){}};i.None=function(){return s}})(e||(Ns.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 Ns.Emitter=r,r._noop=function(){},Ns}var xS;function Of(){if(xS)return Is;xS=1,Object.defineProperty(Is,"__esModule",{value:!0}),Is.CancellationTokenSource=Is.CancellationToken=void 0;const t=Ps(),e=Mc(),n=Yo();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||(Is.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 Is.CancellationTokenSource=o,Is}var it=Of();function v5(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let IS=0,w5=10;const Ff=Symbol("OperationCancelled");function Lf(t){return t===Ff}async function Ot(t){if(t===it.CancellationToken.None)return;const e=Date.now();if(e-IS>=w5&&(IS=e,await v5()),t.isCancellationRequested)throw Ff}class wy{constructor(){this.promise=new Promise((e,n)=>{this.resolve=r=>(e(r),this),this.reject=r=>(n(r),this)})}}class Yl{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(Yl.isIncremental(r)){const i=NS(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,h=l.length;f<h;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,h=u.length;f<h;f++)u[f]=u[f]+d}else if(Yl.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 Mf;(function(t){function e(i,s,o,a){return new Yl(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof Yl)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=by(s.map(b5),(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})(Mf||(Mf={}));function by(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);by(r,e),by(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 NS(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 b5(t){const e=NS(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var OS;(()=>{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,h=-1,p=0,m=0;m<=c.length;++m){if(m<c.length)l=c.charCodeAt(m);else{if(l===47)break;l=47}if(l===47){if(!(h===m-1||p===1))if(h!==m-1&&p===2){if(d.length<2||f!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var w=d.lastIndexOf("/");if(w!==d.length-1){w===-1?(d="",f=0):f=(d=d.slice(0,w)).length-1-d.lastIndexOf("/"),h=m,p=0;continue}}else if(d.length===2||d.length===1){d="",f=0,h=m,p=0;continue}}u&&(d.length>0?d+="/..":d="..",f=2)}else d.length>0?d+="/"+c.slice(h+1,m):d=c.slice(h+1,m),f=m-h-1;h=m,p=0}else l===46&&p!==-1?++p:p=-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,h=1;h<u.length&&u.charCodeAt(h)===47;++h);for(var p=u.length-h,m=f<p?f:p,w=-1,v=0;v<=m;++v){if(v===m){if(p>m){if(u.charCodeAt(h+v)===47)return u.slice(h+v+1);if(v===0)return u.slice(h+v)}else f>m&&(c.charCodeAt(l+v)===47?w=v:v===0&&(w=0));break}var E=c.charCodeAt(l+v);if(E!==u.charCodeAt(h+v))break;E===47&&(w=v)}var S="";for(v=l+w+1;v<=d;++v)v!==d&&c.charCodeAt(v)!==47||(S.length===0?S+="..":S+="/..");return S.length>0?S+u.slice(h+w):(h+=w,u.charCodeAt(h)===47&&++h,u.slice(h))},_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,h=c.length-1;h>=1;--h)if((u=c.charCodeAt(h))===47){if(!f){d=h;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,h=!0;if(u!==void 0&&u.length>0&&u.length<=c.length){if(u.length===c.length&&u===c)return"";var p=u.length-1,m=-1;for(l=c.length-1;l>=0;--l){var w=c.charCodeAt(l);if(w===47){if(!h){d=l+1;break}}else m===-1&&(h=!1,m=l+1),p>=0&&(w===u.charCodeAt(p)?--p==-1&&(f=l):(p=-1,f=m))}return d===f?f=m:f===-1&&(f=c.length),c.slice(d,f)}for(l=c.length-1;l>=0;--l)if(c.charCodeAt(l)===47){if(!h){d=l+1;break}}else f===-1&&(h=!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,h=0,p=c.length-1;p>=0;--p){var m=c.charCodeAt(p);if(m!==47)d===-1&&(f=!1,d=p+1),m===46?u===-1?u=p:h!==1&&(h=1):u!==-1&&(h=-1);else if(!f){l=p+1;break}}return u===-1||d===-1||h===0||h===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 h=-1,p=0,m=-1,w=!0,v=c.length-1,E=0;v>=l;--v)if((d=c.charCodeAt(v))!==47)m===-1&&(w=!1,m=v+1),d===46?h===-1?h=v:E!==1&&(E=1):h!==-1&&(E=-1);else if(!w){p=v+1;break}return h===-1||m===-1||E===0||E===1&&h===m-1&&h===p+1?m!==-1&&(u.base=u.name=p===0&&f?c.slice(1,m):c.slice(p,m)):(p===0&&f?(u.name=c.slice(1,h),u.base=c.slice(1,m)):(u.name=c.slice(p,h),u.base=c.slice(p,m)),u.ext=c.slice(h,m)),p>0?u.dir=c.slice(0,p-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:()=>V}),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(x,k){if(!x.scheme&&k)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${x.authority}", path: "${x.path}", query: "${x.query}", fragment: "${x.fragment}"}`);if(x.scheme&&!s.test(x.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(x.path){if(x.authority){if(!o.test(x.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(x.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(k){return k instanceof f||!!k&&typeof k.authority=="string"&&typeof k.fragment=="string"&&typeof k.path=="string"&&typeof k.query=="string"&&typeof k.scheme=="string"&&typeof k.fsPath=="string"&&typeof k.with=="function"&&typeof k.toString=="function"}scheme;authority;path;query;fragment;constructor(k,T,L,Y,G,X=!1){typeof k=="object"?(this.scheme=k.scheme||u,this.authority=k.authority||u,this.path=k.path||u,this.query=k.query||u,this.fragment=k.fragment||u):(this.scheme=function(_e,te){return _e||te?_e:"file"}(k,X),this.authority=T||u,this.path=function(_e,te){switch(_e){case"https":case"http":case"file":te?te[0]!==l&&(te=l+te):te=l}return te}(this.scheme,L||u),this.query=Y||u,this.fragment=G||u,c(this,X))}get fsPath(){return E(this)}with(k){if(!k)return this;let{scheme:T,authority:L,path:Y,query:G,fragment:X}=k;return T===void 0?T=this.scheme:T===null&&(T=u),L===void 0?L=this.authority:L===null&&(L=u),Y===void 0?Y=this.path:Y===null&&(Y=u),G===void 0?G=this.query:G===null&&(G=u),X===void 0?X=this.fragment:X===null&&(X=u),T===this.scheme&&L===this.authority&&Y===this.path&&G===this.query&&X===this.fragment?this:new p(T,L,Y,G,X)}static parse(k,T=!1){const L=d.exec(k);return L?new p(L[2]||u,N(L[4]||u),N(L[5]||u),N(L[7]||u),N(L[9]||u),T):new p(u,u,u,u,u)}static file(k){let T=u;if(i&&(k=k.replace(/\\/g,l)),k[0]===l&&k[1]===l){const L=k.indexOf(l,2);L===-1?(T=k.substring(2),k=l):(T=k.substring(2,L),k=k.substring(L)||l)}return new p("file",T,k,u,u)}static from(k){const T=new p(k.scheme,k.authority,k.path,k.query,k.fragment);return c(T,!0),T}toString(k=!1){return S(this,k)}toJSON(){return this}static revive(k){if(k){if(k instanceof f)return k;{const T=new p(k);return T._formatted=k.external,T._fsPath=k._sep===h?k.fsPath:null,T}}return k}}const h=i?1:void 0;class p extends f{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=E(this)),this._fsPath}toString(k=!1){return k?S(this,!0):(this._formatted||(this._formatted=S(this,!1)),this._formatted)}toJSON(){const k={$mid:1};return this._fsPath&&(k.fsPath=this._fsPath,k._sep=h),this._formatted&&(k.external=this._formatted),this.path&&(k.path=this.path),this.scheme&&(k.scheme=this.scheme),this.authority&&(k.authority=this.authority),this.query&&(k.query=this.query),this.fragment&&(k.fragment=this.fragment),k}}const m={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 w(x,k,T){let L,Y=-1;for(let G=0;G<x.length;G++){const X=x.charCodeAt(G);if(X>=97&&X<=122||X>=65&&X<=90||X>=48&&X<=57||X===45||X===46||X===95||X===126||k&&X===47||T&&X===91||T&&X===93||T&&X===58)Y!==-1&&(L+=encodeURIComponent(x.substring(Y,G)),Y=-1),L!==void 0&&(L+=x.charAt(G));else{L===void 0&&(L=x.substr(0,G));const _e=m[X];_e!==void 0?(Y!==-1&&(L+=encodeURIComponent(x.substring(Y,G)),Y=-1),L+=_e):Y===-1&&(Y=G)}}return Y!==-1&&(L+=encodeURIComponent(x.substring(Y))),L!==void 0?L:x}function v(x){let k;for(let T=0;T<x.length;T++){const L=x.charCodeAt(T);L===35||L===63?(k===void 0&&(k=x.substr(0,T)),k+=m[L]):k!==void 0&&(k+=x[T])}return k!==void 0?k:x}function E(x,k){let T;return T=x.authority&&x.path.length>1&&x.scheme==="file"?`//${x.authority}${x.path}`:x.path.charCodeAt(0)===47&&(x.path.charCodeAt(1)>=65&&x.path.charCodeAt(1)<=90||x.path.charCodeAt(1)>=97&&x.path.charCodeAt(1)<=122)&&x.path.charCodeAt(2)===58?x.path[1].toLowerCase()+x.path.substr(2):x.path,i&&(T=T.replace(/\//g,"\\")),T}function S(x,k){const T=k?v:w;let L="",{scheme:Y,authority:G,path:X,query:_e,fragment:te}=x;if(Y&&(L+=Y,L+=":"),(G||Y==="file")&&(L+=l,L+=l),G){let U=G.indexOf("@");if(U!==-1){const ye=G.substr(0,U);G=G.substr(U+1),U=ye.lastIndexOf(":"),U===-1?L+=T(ye,!1,!1):(L+=T(ye.substr(0,U),!1,!1),L+=":",L+=T(ye.substr(U+1),!1,!0)),L+="@"}G=G.toLowerCase(),U=G.lastIndexOf(":"),U===-1?L+=T(G,!1,!0):(L+=T(G.substr(0,U),!1,!0),L+=G.substr(U))}if(X){if(X.length>=3&&X.charCodeAt(0)===47&&X.charCodeAt(2)===58){const U=X.charCodeAt(1);U>=65&&U<=90&&(X=`/${String.fromCharCode(U+32)}:${X.substr(3)}`)}else if(X.length>=2&&X.charCodeAt(1)===58){const U=X.charCodeAt(0);U>=65&&U<=90&&(X=`${String.fromCharCode(U+32)}:${X.substr(2)}`)}L+=T(X,!0,!1)}return _e&&(L+="?",L+=T(_e,!1,!1)),te&&(L+="#",L+=k?te:w(te,!1,!1)),L}function $(x){try{return decodeURIComponent(x)}catch{return x.length>3?x.substr(0,3)+$(x.substr(3)):x}}const I=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function N(x){return x.match(I)?x.replace(I,k=>$(k)):x}var A=n(470);const q=A.posix||A,W="/";var V;(function(x){x.joinPath=function(k,...T){return k.with({path:q.join(k.path,...T)})},x.resolvePath=function(k,...T){let L=k.path,Y=!1;L[0]!==W&&(L=W+L,Y=!0);let G=q.resolve(L,...T);return Y&&G[0]===W&&!k.authority&&(G=G.substring(1)),k.with({path:G})},x.dirname=function(k){if(k.path.length===0||k.path===W)return k;let T=q.dirname(k.path);return T.length===1&&T.charCodeAt(0)===46&&(T=""),k.with({path:T})},x.basename=function(k){return q.basename(k.path)},x.extname=function(k){return q.extname(k.path)}})(V||(V={}))})(),OS=r})();const{URI:Yt,Utils:zc}=OS;var mt;(function(t){t.basename=zc.basename,t.dirname=zc.dirname,t.extname=zc.extname,t.joinPath=zc.joinPath,t.resolvePath=zc.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(h=>h.length>0),u=a.split("/").filter(h=>h.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 Yt.parse(i.toString()).toString()}t.normalize=r})(mt||(mt={}));var je;(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"})(je||(je={}));class D5{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,n=it.CancellationToken.None){const r=await this.fileSystemProvider.readFile(e);return this.createAsync(e,r,n)}fromTextDocument(e,n,r){return n=n??Yt.parse(e.uri),it.CancellationToken.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromString(e,n,r){return it.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:je.Parsed,references:[],textDocument:r};else{const o=this.createTextDocumentGetter(n,i);s={parseResult:e,uri:n,state:je.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=je.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=Mf.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,n??""))}}class E5{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return He(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=je.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=je.Changed,this.documentMap.delete(n)),r}}const Dy=Symbol("ref_resolving");class T5{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=it.CancellationToken.None){for(const r of ni(e.parseResult.value))await Ot(n),xd(r).forEach(i=>this.doLink(i,e))}doLink(e,n){var r;const i=e.reference;if(i._ref===void 0){i._ref=Dy;try{const s=this.getCandidate(e);if(md(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(ht(this._ref))return this._ref;if(LO(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=Dy;const c=Ad(e).$document,u=s.getLinkedNode({reference:o,container:e,property:n});if(u.error&&c&&c.state<je.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===Dy)throw new Error(`Cyclic reference resolution detected: ${s.astNodeLocator.getAstNodePath(e)}/${n} (symbol '${i}')`);return ht(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return md(this._ref)?this._ref:void 0}};return o}getLinkedNode(e){var n;try{const r=this.getCandidate(e);if(md(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=Ad(e.container).$document;r&&r.state<je.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 FS(t){return typeof t.name=="string"}class R5{getName(e){if(FS(e))return e.name}getNameNode(e){return Cn(e.$cstNode,"name")}}class S5{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){const n=UD(e),r=e.astNode;if(n&&r){const i=r[n.feature];if(Un(i))return i.ref;if(Array.isArray(i)){for(const s of i)if(Un(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||DD(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=>mt.equals(s.sourceUri,n.documentUri))),r.push(...i),He(r)}getReferenceToSelf(e){const n=this.nameProvider.getNameNode(e);if(n){const r=nn(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:r.uri,sourcePath:i,targetUri:r.uri,targetPath:i,segment:Pa(n),local:!0}}}}class Nr{constructor(e){if(this.map=new Map,e)for(const[n,r]of e)this.add(n,r)}get size(){return Cg.sum(He(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 He(this.map.entries()).flatMap(([e,n])=>n.map(r=>[e,r]))}keys(){return He(this.map.keys())}values(){return He(this.map.values()).flat()}entriesGroupedByKey(){return He(this.map.entries())}}class LS{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 MS{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,n=it.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,n)}async computeExportsForNode(e,n,r=fc,i=it.CancellationToken.None){const s=[];this.exportNode(e,s,n);for(const o of r(e))await Ot(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=it.CancellationToken.None){const r=e.parseResult.value,i=new Nr;for(const s of Cr(r))await Ot(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 Bc{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 zS{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=He(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}const BS={getElement(){},getAllElements(){return Ao}};class jS{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 k5 extends jS{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 $5 extends jS{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 qS extends k5{constructor(e){super(),this.onDispose(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}class US{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 qS(e.shared)}getScope(e){const n=[],r=this.reflection.getReferenceType(e),i=nn(e.container).precomputedScopes;if(i){let o=e.container;do{const a=i.get(o);a.length>0&&n.push(He(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 Bc(He(e),n,r)}createScopeForNodes(e,n,r){const i=He(e).map(s=>{const o=this.nameProvider.getName(s);if(o)return this.descriptions.createDescription(s,o)}).nonNullable();return new Bc(i,n,r)}getGlobalScope(e,n){return this.globalScopeCache.get(e,()=>new zS(this.indexManager.allElements(e)))}}function C5(t){return typeof t.$comment=="string"}function WS(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class _5{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=nn(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(Un(n)){const f=n.ref,h=r?n.$refText:void 0;if(f){const p=nn(f);let m="";this.currentDocument&&this.currentDocument!==p&&(a?m=a(p.uri,n):m=p.uri.toString());const w=this.astNodeLocator.getAstNodePath(f);return{$ref:`${m}#${w}`,$refText:h}}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:h}}else if(ht(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 h=this.commentProvider.getComment(n);h&&(f.$comment=h.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=No(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];WS(d)?u[l]=this.reviveReference(e,c,n,d,r):ht(d)&&this.linkNode(d,n,r,e,c,l)}else WS(u)?e[c]=this.reviveReference(e,c,n,u,r):ht(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(ht(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):Yt.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)):Yt.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 A5{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=mt.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 jc(t){return{code:t}}var zf;(function(t){t.all=["fast","slow","built-in"]})(zf||(zf={}));class x5{constructor(e){this.entries=new Nr,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)}}}wrapValidationException(e,n){return async(r,i,s)=>{try{await e.call(n,r,i,s)}catch(o){if(Lf(o))throw o;console.error("An error occurred during validation:",o);const a=o instanceof Error?o.message:String(o);o instanceof Error&&o.stack&&console.error(o.stack),i("error","An error occurred during validation: "+a,{node:r})}}}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=He(this.entries.get(e)).concat(this.entries.get("AstNode"));return n&&(r=r.filter(i=>n.includes(i.category))),r.map(i=>i.check)}}class I5{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,n={},r=it.CancellationToken.None){const i=e.parseResult,s=[];if(await Ot(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)===hr.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)===hr.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)===hr.LinkingError}))))return s;try{s.push(...await this.validateAst(i.value,n,r))}catch(o){if(Lf(o))throw o;console.error("An error occurred during validation:",o)}return await Ot(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:Ey(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:N5(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=vd(i.token);if(s){const o={severity:Ey("error"),range:s,message:i.message,data:jc(hr.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:hr.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=it.CancellationToken.None){const i=[],s=(o,a,c)=>{i.push(this.toDiagnostic(o,a,c))};return await Promise.all(ni(e).map(async o=>{await Ot(r);const a=this.validationRegistry.getChecks(o.$type,n.categories);for(const c of a)await c(o,s,r)})),i}toDiagnostic(e,n,r){return{message:n,range:P5(r),severity:Ey(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 P5(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=Cn(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=pc(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 Ey(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 N5(t){switch(t){case"error":return jc(hr.LexingError);case"warning":return jc(hr.LexingWarning);case"info":return jc(hr.LexingInfo);case"hint":return jc(hr.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var hr;(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"})(hr||(hr={}));class O5{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,n,r){const i=r??nn(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=Pa((c=this.nameProvider.getNameNode(e))!==null&&c!==void 0?c:e.$cstNode))};return{node:e,name:n,get nameSegment(){return a()},selectionSegment:Pa(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}}class F5{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,n=it.CancellationToken.None){const r=[],i=e.parseResult.value;for(const s of ni(i))await Ot(n),xd(s).filter(o=>!md(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=nn(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:n.documentUri,targetPath:n.path,segment:Pa(r),local:mt.equals(n.documentUri,i)}}}class L5{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 M5=Yo();class z5{constructor(e){this._ready=new wy,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new M5.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 B5{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Nr,this.documentPhaseListeners=new Nr,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=je.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=it.CancellationToken.None){var i,s;for(const o of e){const a=o.uri.toString();if(o.state===je.Validated){if(typeof n.validation=="boolean"&&n.validation)o.state=je.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:zf.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=je.IndexedReferences)}}}else this.buildState.delete(a)}this.currentState=je.Changed,await this.emitUpdate(e.map(o=>o.uri),[]),await this.buildDocuments(e,n,r)}async update(e,n,r=it.CancellationToken.None){this.currentState=je.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=je.Changed,this.langiumDocuments.addDocument(c)}this.buildState.delete(o.toString())}const i=He(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,je.ComputedScopes),o.diagnostics=void 0}),await this.emitUpdate(e,n),await Ot(r);const s=this.sortDocuments(this.langiumDocuments.all.filter(o=>{var a;return o.state<je.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,je.Parsed,r,s=>this.langiumDocumentFactory.update(s,r)),await this.runCancelable(e,je.IndexedContent,r,s=>this.indexManager.updateContent(s,r)),await this.runCancelable(e,je.ComputedScopes,r,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.precomputedScopes=await o.computeLocalScopes(s,r)}),await this.runCancelable(e,je.Linked,r,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,r)),await this.runCancelable(e,je.IndexedReferences,r,s=>this.indexManager.updateReferences(s,r));const i=e.filter(s=>this.shouldValidate(s));await this.runCancelable(i,je.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 Ot(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=it.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(Ff):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(Ff)})})}async notifyDocumentPhase(e,n,r){const i=this.documentPhaseListeners.get(n);for(const s of i)try{await s(e,r)}catch(o){if(!Lf(o))throw o}}async notifyBuildPhase(e,n,r){if(e.length===0)return;const i=this.buildPhaseListeners.get(n);for(const s of i)await Ot(r),await s(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:zf.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 j5{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new $5,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,n){const r=nn(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(o=>{mt.equals(o.targetUri,r)&&o.targetPath===n&&i.push(o)})}),He(i)}allElements(e,n){let r=He(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=it.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=it.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 GS{constructor(e){this.initialBuildOptions={},this._ready=new wy,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}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=it.CancellationToken.None){const r=await this.performStartup(e);await Ot(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 Yt.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=mt.basename(n.uri);if(i.startsWith("."))return!1;if(n.isDirectory)return i!=="node_modules"&&i!=="out";if(n.isFile){const s=mt.extname(n.uri);return r.includes(s)}return!1}}const q5={mode:"full"};class U5{constructor(e){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;this.chevrotainLexer=new En(r,{positionTracking:"full"})}get definition(){return this.tokenTypes}tokenize(e,n=q5){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=HS(e)?Object.values(e.modes).flat():e,r={};return n.forEach(i=>r[i.name]=i),r}}function W5(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function HS(t){return t&&"modes"in t&&"defaultMode"in t}function KS(t){return!W5(t)&&!HS(t)}function G5(t,e,n){let r,i;typeof t=="string"?(i=e,r=n):(i=t.range.start,r=e),i||(i=Be.create(0,0));const s=VS(t),o=Ry(r),a=V5({lines:s,position:i,options:o});return Q5({index:0,tokens:a,position:i})}function H5(t,e){const n=Ry(e),r=VS(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 VS(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(zD)}const YS=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,K5=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function V5(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 h=(e=t.options.start)===null||e===void 0?void 0:e.exec(l);h&&(d=h.index+h[0].length)}else{const h=(n=t.options.line)===null||n===void 0?void 0:n.exec(l);h&&(d=h.index+h[0].length)}if(u){const h=(r=t.options.end)===null||r===void 0?void 0:r.exec(l);h&&(l=l.substring(0,h.index))}if(l=l.substring(0,Z5(l)),Ty(l,d)>=l.length){if(i.length>0){const h=Be.create(s,o);i.push({type:"break",content:"",range:Ce.create(h,h)})}}else{YS.lastIndex=d;const h=YS.exec(l);if(h){const p=h[0],m=h[1],w=Be.create(s,o+d),v=Be.create(s,o+d+p.length);i.push({type:"tag",content:m,range:Ce.create(w,v)}),d+=p.length,d=Ty(l,d)}if(d<l.length){const p=l.substring(d),m=Array.from(p.matchAll(K5));i.push(...Y5(m,p,s,o+d))}}s++,o=0}return i.length>0&&i[i.length-1].type==="break"?i.slice(0,-1):i}function Y5(t,e,n,r){const i=[];if(t.length===0){const s=Be.create(n,r),o=Be.create(n,r+e.length);i.push({type:"text",content:e,range:Ce.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:Ce.create(Be.create(n,s+r),Be.create(n,c+r))});let l=u.length+1;const d=a[1];if(i.push({type:"inline-tag",content:d,range:Ce.create(Be.create(n,s+l+r),Be.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:Ce.create(Be.create(n,s+l+r),Be.create(n,s+l+f.length+r))})}else i.push({type:"text",content:"",range:Ce.create(Be.create(n,s+l+r),Be.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:Ce.create(Be.create(n,s+r),Be.create(n,s+r+o.length))})}return i}const X5=/\S/,J5=/\s*$/;function Ty(t,e){const n=t.substring(e).match(X5);return n?e+n.index:t.length}function Z5(t){const e=t.match(J5);if(e&&typeof e.index=="number")return e.index}function Q5(t){var e,n,r,i;const s=Be.create(t.position.line,t.position.character);if(t.tokens.length===0)return new QS([],Ce.create(s,s));const o=[];for(;t.index<t.tokens.length;){const u=ej(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 QS(o,Ce.create(a,c))}function ej(t,e){const n=t.tokens[t.index];if(n.type==="tag")return JS(t,!1);if(n.type==="text"||n.type==="inline-tag")return XS(t);tj(n,e),t.index++}function tj(t,e){if(e){const n=new e1("",t.range);"inlines"in e?e.inlines.push(n):e.content.inlines.push(n)}}function XS(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(nj(t)),r=e,e=t.tokens[t.index];return new $y(i,Ce.create(n.range.start,r.range.end))}function nj(t){return t.tokens[t.index].type==="inline-tag"?JS(t,!0):ZS(t)}function JS(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=ZS(t);return new ky(r,new $y([s],s.range),e,Ce.create(n.range.start,s.range.end))}else{const s=XS(t);return new ky(r,s,e,Ce.create(n.range.start,s.range.end))}else{const s=n.range;return new ky(r,new $y([],s),e,s)}}function ZS(t){const e=t.tokens[t.index++];return new e1(e.content,e.range)}function Ry(t){if(!t)return Ry({start:"/**",end:"*/",line:"*"});const{start:e,end:n,line:r}=t;return{start:Sy(e,!0),end:Sy(n,!1),line:Sy(r,!0)}}function Sy(t,e){if(typeof t=="string"||typeof t=="object"){const n=typeof t=="string"?Ld(t):t.source;return e?new RegExp(`^\\s*${n}`):new RegExp(`\\s*${n}\\s*$`)}else return t}class QS{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+=t1(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+=t1(n)+i}return n.trim()}}class ky{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=rj(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 rj(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=Ty(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:ij(e,o)}}function ij(t,e){try{return Yt.parse(t,!0),`[${e}](${t})`}catch{return t}}class $y{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 e1{constructor(e,n){this.text=e,this.range=n}toString(){return this.text}toMarkdown(){return this.text}}function t1(t){return t.endsWith(`
122
- `)?`
123
- `:`
124
-
125
- `}class sj{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const n=this.commentProvider.getComment(e);if(n&&H5(n))return G5(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=nn(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 oj{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var n;return C5(e)?e.$comment:(n=wd(e.$cstNode,this.grammarConfig().multilineCommentRules))===null||n===void 0?void 0:n.text}}class aj{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,n){return Promise.resolve(this.syncParser.parse(e))}}class cj{constructor(){this.previousTokenSource=new it.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const n=new it.CancellationTokenSource;return this.previousTokenSource=n,this.enqueue(this.writeQueue,e,n.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,n,r=it.CancellationToken.None){const i=new wy,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){Lf(s)?r.resolve(void 0):r.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class uj{constructor(e){this.grammarElementIdMap=new LS,this.tokenTypeIdMap=new LS,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 ni(e))n.set(i,{});if(e.$cstNode)for(const i of Ia(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)ht(a)?o.push(this.dehydrateAstNode(a,n)):Un(a)?o.push(this.dehydrateReference(a,n)):o.push(a)}else ht(s)?r[i]=this.dehydrateAstNode(s,n):Un(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 wD(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=n.astNodes.get(e.astNode),Qr(e)?r.content=e.content.map(i=>this.dehydrateCstNode(i,n)):bs(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 ni(e))n.set(s,{});let i;if(e.$cstNode)for(const s of Ia(e.$cstNode)){let o;"fullText"in s?(o=new wS(s.fullText),i=o):"content"in s?o=new gy:"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)ht(a)?o.push(this.setParent(this.hydrateAstNode(a,n),r)):Un(a)?o.push(this.hydrateReference(a,r,i,n)):o.push(a)}else ht(s)?r[i]=this.setParent(this.hydrateAstNode(s,n),r):Un(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),Qr(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 py(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 ni(this.grammar))Og(n)&&this.grammarElementIdMap.set(n,e++)}}function n1(t){return{documentation:{CommentProvider:e=>new oj(e),DocumentationProvider:e=>new sj(e)},parser:{AsyncParser:e=>new aj(e),GrammarConfig:e=>RF(e),LangiumParser:e=>p5(e),CompletionParser:e=>h5(e),ValueConverter:()=>new y5,TokenBuilder:()=>new m5,Lexer:e=>new U5(e),ParserErrorMessageProvider:()=>new TS},workspace:{AstNodeLocator:()=>new L5,AstNodeDescriptionProvider:e=>new O5(e),ReferenceDescriptionProvider:e=>new F5(e)},references:{Linker:e=>new T5(e),NameProvider:()=>new R5,ScopeProvider:e=>new US(e),ScopeComputation:e=>new MS(e),References:e=>new S5(e)},serializer:{Hydrator:e=>new uj(e),JsonSerializer:e=>new _5(e)},validation:{DocumentValidator:e=>new I5(e),ValidationRegistry:e=>new x5(e)},shared:()=>t.shared}}function r1(t){return{ServiceRegistry:e=>new A5(e),workspace:{LangiumDocuments:e=>new E5(e),LangiumDocumentFactory:e=>new D5(e),DocumentBuilder:e=>new B5(e),IndexManager:e=>new j5(e),WorkspaceManager:e=>new GS(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new cj,ConfigurationProvider:e=>new z5(e)}}}var Bf;(function(t){t.merge=(e,n)=>qf(qf({},e),n)})(Bf||(Bf={}));function jf(t,e,n,r,i,s,o,a,c){const u=[t,e,n,r,i,s,o,a,c].reduce(qf,{});return s1(u)}const i1=Symbol("isProxy");function Cy(t){if(t&&t[i1])for(const e of Object.values(t))Cy(e);return t}function s1(t,e){const n=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(r,i)=>i===i1?!0:a1(r,i,t,e||n),getOwnPropertyDescriptor:(r,i)=>(a1(r,i,t,e||n),Object.getOwnPropertyDescriptor(r,i)),has:(r,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return n}const o1=Symbol();function a1(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]===o1)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]=o1;try{t[e]=typeof i=="function"?i(r):s1(i,r)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}function qf(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]=qf(i,r):t[n]=r}}return t}class lj{readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}}const c1={fileSystemProvider:()=>new lj},dj={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},fj={AstReflection:()=>new ND};function hj(){const t=jf(r1(c1),fj),e=jf(n1({shared:t}),dj);return t.ServiceRegistry.register(e),e}function pj(t){var e;const n=hj(),r=n.serializer.JsonSerializer.deserialize(t);return n.shared.workspace.LangiumDocumentFactory.fromModel(r,Yt.parse(`memory://${(e=r.name)!==null&&e!==void 0?e:"grammar"}.langium`)),r}var gj={done:!0,hasNext:!1},Xo={done:!1,hasNext:!1},u1=()=>gj,mj=t=>({hasNext:!0,next:t,done:!1});function Ye(t,...e){let n=t,r=e.map(s=>"lazy"in s?yj(s):void 0),i=0;for(;i<e.length;){if(r[i]===void 0||!vj(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(l1(c,o,s))break;let{isSingle:a}=s.at(-1);n=a?o[0]:o,i+=s.length}return n}function l1(t,e,n){if(n.length===0)return e.push(t),!1;let r=t,i=Xo,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(l1(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 yj(t){let{lazy:e,lazyArgs:n}=t,r=e(...n);return Object.assign(r,{isSingle:e.single??!1,index:0,items:[]})}function vj(t){return typeof t=="string"||typeof t=="object"&&t!==null&&Symbol.iterator in t}function _y(t,e){let n=e.length-t.length;if(n===1){let[r,...i]=e;return Ye(r,{lazy:t,lazyArgs:i})}if(n===0){let r={lazy:t,lazyArgs:e};return Object.assign(i=>Ye(i,r),r)}throw new Error("Wrong number of arguments")}function wj(t,e,n){let r=i=>t(i,...e);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:e})}function Ke(t,e,n){let r=t.length-e.length;if(r===0)return t(...e);if(r===1)return wj(t,e,n);throw new Error("Wrong number of arguments")}function Uf(...t){return Ke(Object.values,t)}function Or(...t){return _y(bj,t)}function bj(){let t=new Set;return e=>t.has(e)?Xo:(t.add(e),{done:!1,hasNext:!0,next:e})}function Dj(...t){return Ke(Ej,t,Tj)}var Ej=(t,e)=>e<0?[]:t.slice(0,e);function Tj(t){if(t<=0)return u1;let e=t;return n=>(e-=1,{done:e<=0,hasNext:!0,next:n})}function Fr(...t){return Ke(Rj,t)}var Rj=(t,e)=>t.length>=e,d1={asc:(t,e)=>t>e,desc:(t,e)=>t<e};function Sj(t,e){let[n,...r]=e;if(!kj(n)){let s=Ay(...r);return t(n,s)}let i=Ay(n,...r);return s=>t(s,i)}function Ay(t,e,...n){let r=typeof t=="function"?t:t[0],i=typeof t=="function"?"asc":t[1],{[i]:s}=d1,o=e===void 0?void 0:Ay(e,...n);return(a,c)=>{let u=r(a),l=r(c);return s(u,l)?1:s(l,u)?-1:o?.(a,c)??0}}function kj(t){if(f1(t))return!0;if(typeof t!="object"||!Array.isArray(t))return!1;let[e,n,...r]=t;return f1(e)&&typeof n=="string"&&n in d1&&r.length===0}var f1=t=>typeof t=="function"&&t.length===1;function qc(...t){return Ke($j,t)}function $j(t,e){let n=[...t];return n.sort(e),n}function Cj(...t){return Sj(_j,t)}var _j=(t,e)=>[...t].sort(e);function h1(...t){return Ke(Aj,t)}var Aj=(t,e,n)=>t.reduce(e,n);function p1(...t){return Ke(xj,t)}function xj(t){return[...t].reverse()}function xy(...t){return e=>Ye(e,...t)}function Lr(...t){return Ke(Ij,t)}var Ij=(t,e)=>t[e];function g1(...t){return Ke(Pj,t)}function Pj(t,e){let n={...t};for(let[r,i]of Object.entries(n))e(i,r,t)&&delete n[r];return n}function Rn(...t){return Ke(Nj,t)}var Nj=t=>t.length===1?t[0]:void 0;function m1(...t){return Ke(Oj,t)}function Oj(t,e){let n={};for(let r of e)r in t&&(n[r]=t[r]);return n}function y1(...t){return Ke(Fj,t)}function Fj(t,e){if(!Fr(e,1))return{...t};if(!Fr(e,2)){let{[e[0]]:r,...i}=t;return i}let n={...t};for(let r of e)delete n[r];return n}function Uc(...t){return Ke(Lj,t)}var Lj=t=>t.at(-1);function ut(...t){return Ke(Mj,t,zj)}var Mj=(t,e)=>t.map(e),zj=t=>(e,n,r)=>({done:!1,hasNext:!0,next:t(e,n,r)});function hi(...t){return Ke(Bj,t)}function Bj(t,e){let n={};for(let[r,i]of t.entries()){let[s,o]=e(i,r,t);n[s]=o}return n}function Bi(...t){return Ke(jj,t)}function jj(t,e){let n={};for(let[r,i]of Object.entries(t)){let s=e(i,r,t);n[r]=s}return n}function ji(t){return typeof t=="string"}function ne(t){return!!t}function qj(t){return t!==null}function Mr(t){return t!=null}function $t(t){return t==null}function v1(t){return typeof t=="number"&&!Number.isNaN(t)}function w1(t){return Array.isArray(t)}function yt(t){return t!==void 0}function qi(t){return t===void 0?!0:typeof t=="string"||Array.isArray(t)?t.length===0:Object.keys(t).length===0}function Iy(t){return t instanceof Error}function Py(...t){return Ke(Uj,t)}function Uj(t,e){let n={};for(let[r,i]of t.entries()){let s=e(i,r,t);n[s]=i}return n}function Wj(...t){return _y(Gj,t)}function Gj(t){if(t.length===0)return u1;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?Xo:(r===1?e.delete(n):e.set(n,r-1),{hasNext:!0,next:n,done:e.size===0})}}function Ui(...t){return Ke(Hj,t,Kj)}var Hj=(t,e)=>t.flatMap(e),Kj=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 Vj(...t){return Ke(Yj,t,Xj)}function Yj(t,e){return t.forEach(e),t}var Xj=t=>(e,n,r)=>(t(e,n,r),{done:!1,hasNext:!0,next:e});function Wf(...t){return Ke(Jj,t)}var Jj=(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 Je(...t){return Ke(Zj,t,Qj)}var Zj=(t,e)=>t.filter(e),Qj=t=>(e,n,r)=>t(e,n,r)?{done:!1,hasNext:!0,next:e}:Xo,b1=t=>Object.assign(t,{single:!0});function D1(...t){return Ke(eq,t,b1(tq))}var eq=(t,e)=>t.find(e),tq=t=>(e,n,r)=>t(e,n,r)?{done:!0,hasNext:!0,next:e}:Xo;function nq(...t){return Ke(rq,t)}var rq=(t,e)=>{for(let n=t.length-1;n>=0;n--){let r=t[n];if(e(r,n,t))return r}};function Wc(...t){return Ke(iq,t,b1(sq))}var iq=([t])=>t,sq=()=>oq,oq=t=>({hasNext:!0,next:t,done:!0});function Jo(...t){return Ke(Object.entries,t)}function aq(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 cq(...t){return _y(uq,t)}function uq(t){if(t.length===0)return mj;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),Xo)}}function E1(...t){return Ke(lq,t)}var lq=(t,e)=>e.every(n=>n(t));function dq(...t){return Ke(fq,t)}var fq=(t,e)=>e.some(n=>n(t));function hq(...t){return Ke(pq,t)}function pq(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 T1(...t){return Ke(gq,t)}var gq=(t,{min:e,max:n})=>e!==void 0&&t<e?e:n!==void 0&&t>n?n:t,mq={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]},yq=Object.entries(mq);function Ny(t){return String(t)}Ny.open="",Ny.close="";function vq(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 wq(t=!1){let e=vq(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 yq)i[o]=e?r(s(a[0]),s(a[1]),a[2]):Ny;return i}var st=wq(SP(1)),Fs={};const bq=si(kP);var vt={},R1;function Oy(){if(R1)return vt;R1=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.thenable=vt.typedArray=vt.stringArray=vt.array=vt.func=vt.error=vt.number=vt.string=vt.boolean=void 0;function t(u){return u===!0||u===!1}vt.boolean=t;function e(u){return typeof u=="string"||u instanceof String}vt.string=e;function n(u){return typeof u=="number"||u instanceof Number}vt.number=n;function r(u){return u instanceof Error}vt.error=r;function i(u){return typeof u=="function"}vt.func=i;function s(u){return Array.isArray(u)}vt.array=s;function o(u){return s(u)&&u.every(l=>e(l))}vt.stringArray=o;function a(u,l){return Array.isArray(u)&&u.every(l)}vt.typedArray=a;function c(u){return u&&i(u.then)}return vt.thenable=c,vt}var Pe={},Ls={},Ms={},Gf={};const Dq=si(HP);var Fy={},ue={},S1;function k1(){if(S1)return ue;S1=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.Message=ue.NotificationType9=ue.NotificationType8=ue.NotificationType7=ue.NotificationType6=ue.NotificationType5=ue.NotificationType4=ue.NotificationType3=ue.NotificationType2=ue.NotificationType1=ue.NotificationType0=ue.NotificationType=ue.RequestType9=ue.RequestType8=ue.RequestType7=ue.RequestType6=ue.RequestType5=ue.RequestType4=ue.RequestType3=ue.RequestType2=ue.RequestType1=ue.RequestType=ue.RequestType0=ue.AbstractMessageSignature=ue.ParameterStructures=ue.ResponseError=ue.ErrorCodes=void 0;const t=Mc();var e;(function(k){k.ParseError=-32700,k.InvalidRequest=-32600,k.MethodNotFound=-32601,k.InvalidParams=-32602,k.InternalError=-32603,k.jsonrpcReservedErrorRangeStart=-32099,k.serverErrorStart=-32099,k.MessageWriteError=-32099,k.MessageReadError=-32098,k.PendingResponseRejected=-32097,k.ConnectionInactive=-32096,k.ServerNotInitialized=-32002,k.UnknownErrorCode=-32001,k.jsonrpcReservedErrorRangeEnd=-32e3,k.serverErrorEnd=-32e3})(e||(ue.ErrorCodes=e={}));class n extends Error{constructor(T,L,Y){super(L),this.code=t.number(T)?T:e.UnknownErrorCode,this.data=Y,Object.setPrototypeOf(this,n.prototype)}toJson(){const T={code:this.code,message:this.message};return this.data!==void 0&&(T.data=this.data),T}}ue.ResponseError=n;class r{constructor(T){this.kind=T}static is(T){return T===r.auto||T===r.byName||T===r.byPosition}toString(){return this.kind}}ue.ParameterStructures=r,r.auto=new r("auto"),r.byPosition=new r("byPosition"),r.byName=new r("byName");class i{constructor(T,L){this.method=T,this.numberOfParams=L}get parameterStructures(){return r.auto}}ue.AbstractMessageSignature=i;class s extends i{constructor(T){super(T,0)}}ue.RequestType0=s;class o extends i{constructor(T,L=r.auto){super(T,1),this._parameterStructures=L}get parameterStructures(){return this._parameterStructures}}ue.RequestType=o;class a extends i{constructor(T,L=r.auto){super(T,1),this._parameterStructures=L}get parameterStructures(){return this._parameterStructures}}ue.RequestType1=a;class c extends i{constructor(T){super(T,2)}}ue.RequestType2=c;class u extends i{constructor(T){super(T,3)}}ue.RequestType3=u;class l extends i{constructor(T){super(T,4)}}ue.RequestType4=l;class d extends i{constructor(T){super(T,5)}}ue.RequestType5=d;class f extends i{constructor(T){super(T,6)}}ue.RequestType6=f;class h extends i{constructor(T){super(T,7)}}ue.RequestType7=h;class p extends i{constructor(T){super(T,8)}}ue.RequestType8=p;class m extends i{constructor(T){super(T,9)}}ue.RequestType9=m;class w extends i{constructor(T,L=r.auto){super(T,1),this._parameterStructures=L}get parameterStructures(){return this._parameterStructures}}ue.NotificationType=w;class v extends i{constructor(T){super(T,0)}}ue.NotificationType0=v;class E extends i{constructor(T,L=r.auto){super(T,1),this._parameterStructures=L}get parameterStructures(){return this._parameterStructures}}ue.NotificationType1=E;class S extends i{constructor(T){super(T,2)}}ue.NotificationType2=S;class $ extends i{constructor(T){super(T,3)}}ue.NotificationType3=$;class I extends i{constructor(T){super(T,4)}}ue.NotificationType4=I;class N extends i{constructor(T){super(T,5)}}ue.NotificationType5=N;class A extends i{constructor(T){super(T,6)}}ue.NotificationType6=A;class q extends i{constructor(T){super(T,7)}}ue.NotificationType7=q;class W extends i{constructor(T){super(T,8)}}ue.NotificationType8=W;class V extends i{constructor(T){super(T,9)}}ue.NotificationType9=V;var x;return function(k){function T(G){const X=G;return X&&t.string(X.method)&&(t.string(X.id)||t.number(X.id))}k.isRequest=T;function L(G){const X=G;return X&&t.string(X.method)&&G.id===void 0}k.isNotification=L;function Y(G){const X=G;return X&&(X.result!==void 0||!!X.error)&&(t.string(X.id)||t.number(X.id)||X.id===null)}k.isResponse=Y}(x||(ue.Message=x={})),ue}var pi={},$1;function C1(){if($1)return pi;$1=1;var t;Object.defineProperty(pi,"__esModule",{value:!0}),pi.LRUCache=pi.LinkedMap=pi.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||(pi.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)}}pi.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 pi.LRUCache=r,pi}var Gc={},_1;function Eq(){if(_1)return Gc;_1=1,Object.defineProperty(Gc,"__esModule",{value:!0}),Gc.Disposable=void 0;var t;return function(e){function n(r){return{dispose:r}}e.create=n}(t||(Gc.Disposable=t={})),Gc}var zs={},A1;function Tq(){if(A1)return zs;A1=1,Object.defineProperty(zs,"__esModule",{value:!0}),zs.SharedArrayReceiverStrategy=zs.SharedArraySenderStrategy=void 0;const t=Of();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()}}zs.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 zs.SharedArrayReceiverStrategy=s,zs}var gi={},Hc={},x1;function I1(){if(x1)return Hc;x1=1,Object.defineProperty(Hc,"__esModule",{value:!0}),Hc.Semaphore=void 0;const t=Ps();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 Hc.Semaphore=e,Hc}var P1;function Rq(){if(P1)return gi;P1=1,Object.defineProperty(gi,"__esModule",{value:!0}),gi.ReadableStreamMessageReader=gi.AbstractMessageReader=gi.MessageReader=void 0;const t=Ps(),e=Mc(),n=Yo(),r=I1();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||(gi.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"}`)}}gi.AbstractMessageReader=s;var o;(function(c){function u(l){let d,f;const h=new Map;let p;const m=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,h.set(f.name,f)),l.contentDecoders!==void 0)for(const w of l.contentDecoders)h.set(w.name,w);if(l.contentTypeDecoder!==void 0&&(p=l.contentTypeDecoder,m.set(p.name,p)),l.contentTypeDecoders!==void 0)for(const w of l.contentTypeDecoders)m.set(w.name,w)}return p===void 0&&(p=(0,t.default)().applicationJson.decoder,m.set(p.name,p)),{charset:d,contentDecoder:f,contentDecoders:h,contentTypeDecoder:p,contentTypeDecoders:m}}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 h=parseInt(f);if(isNaN(h)){this.fireError(new Error(`Content-Length value must be a number. Got ${f}`));return}this.nextMessageLength=h}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 gi.ReadableStreamMessageReader=a,gi}var mi={},N1;function Sq(){if(N1)return mi;N1=1,Object.defineProperty(mi,"__esModule",{value:!0}),mi.WriteableStreamMessageWriter=mi.AbstractMessageWriter=mi.MessageWriter=void 0;const t=Ps(),e=Mc(),n=I1(),r=Yo(),i="Content-Length: ",s=`\r
127
- `;var o;(function(l){function d(f){let h=f;return h&&e.func(h.dispose)&&e.func(h.onClose)&&e.func(h.onError)&&e.func(h.write)}l.is=d})(o||(mi.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,h){this.errorEmitter.fire([this.asError(d),f,h])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(d){return d instanceof Error?d:new Error(`Writer received error. Reason: ${e.string(d.message)?d.message:"unknown"}`)}}mi.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(h=>this.fireError(h)),this.writable.onClose(()=>this.fireClose())}async write(d){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(d,this.options).then(h=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(h):h).then(h=>{const p=[];return p.push(i,h.byteLength.toString(),s),p.push(s),this.doWrite(d,p,h)},h=>{throw this.fireError(h),h}))}async doWrite(d,f,h){try{return await this.writable.write(f.join(""),"ascii"),this.writable.write(h)}catch(p){return this.handleError(p,d),Promise.reject(p)}}handleError(d,f){this.errorCount++,this.fireError(d,f,this.errorCount)}end(){this.writable.end()}}return mi.WriteableStreamMessageWriter=u,mi}var Kc={},O1;function kq(){if(O1)return Kc;O1=1,Object.defineProperty(Kc,"__esModule",{value:!0}),Kc.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 h=this._chunks[a];for(c=0;c<h.length;){switch(h[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+=h.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 h=0;h<f.length-2;h++){const p=f[h],m=p.indexOf(":");if(m===-1)throw new Error(`Message header must separate key and value using ':'
129
- ${p}`);const w=p.substr(0,m),v=p.substr(m+1).trim();d.set(s?w.toLowerCase():w,v)}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 Kc.AbstractMessageBuffer=r,Kc}var Ly={},F1;function $q(){return F1||(F1=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=Ps(),n=Mc(),r=k1(),i=C1(),s=Yo(),o=Of();var a;(function(T){T.type=new r.NotificationType("$/cancelRequest")})(a||(a={}));var c;(function(T){function L(Y){return typeof Y=="string"||typeof Y=="number"}T.is=L})(c||(t.ProgressToken=c={}));var u;(function(T){T.type=new r.NotificationType("$/progress")})(u||(u={}));class l{constructor(){}}t.ProgressType=l;var d;(function(T){function L(Y){return n.func(Y)}T.is=L})(d||(d={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var f;(function(T){T[T.Off=0]="Off",T[T.Messages=1]="Messages",T[T.Compact=2]="Compact",T[T.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var h;(function(T){T.Off="off",T.Messages="messages",T.Compact="compact",T.Verbose="verbose"})(h||(t.TraceValues=h={})),function(T){function L(G){if(!n.string(G))return T.Off;switch(G=G.toLowerCase(),G){case"off":return T.Off;case"messages":return T.Messages;case"compact":return T.Compact;case"verbose":return T.Verbose;default:return T.Off}}T.fromString=L;function Y(G){switch(G){case T.Off:return"off";case T.Messages:return"messages";case T.Compact:return"compact";case T.Verbose:return"verbose";default:return"off"}}T.toString=Y}(f||(t.Trace=f={}));var p;(function(T){T.Text="text",T.JSON="json"})(p||(t.TraceFormat=p={})),function(T){function L(Y){return n.string(Y)?(Y=Y.toLowerCase(),Y==="json"?T.JSON:T.Text):T.Text}T.fromString=L}(p||(t.TraceFormat=p={}));var m;(function(T){T.type=new r.NotificationType("$/setTrace")})(m||(t.SetTraceNotification=m={}));var w;(function(T){T.type=new r.NotificationType("$/logTrace")})(w||(t.LogTraceNotification=w={}));var v;(function(T){T[T.Closed=1]="Closed",T[T.Disposed=2]="Disposed",T[T.AlreadyListening=3]="AlreadyListening"})(v||(t.ConnectionErrors=v={}));class E extends Error{constructor(L,Y){super(Y),this.code=L,Object.setPrototypeOf(this,E.prototype)}}t.ConnectionError=E;var S;(function(T){function L(Y){const G=Y;return G&&n.func(G.cancelUndispatched)}T.is=L})(S||(t.ConnectionStrategy=S={}));var $;(function(T){function L(Y){const G=Y;return G&&(G.kind===void 0||G.kind==="id")&&n.func(G.createCancellationTokenSource)&&(G.dispose===void 0||n.func(G.dispose))}T.is=L})($||(t.IdCancellationReceiverStrategy=$={}));var I;(function(T){function L(Y){const G=Y;return G&&G.kind==="request"&&n.func(G.createCancellationTokenSource)&&(G.dispose===void 0||n.func(G.dispose))}T.is=L})(I||(t.RequestCancellationReceiverStrategy=I={}));var N;(function(T){T.Message=Object.freeze({createCancellationTokenSource(Y){return new o.CancellationTokenSource}});function L(Y){return $.is(Y)||I.is(Y)}T.is=L})(N||(t.CancellationReceiverStrategy=N={}));var A;(function(T){T.Message=Object.freeze({sendCancellation(Y,G){return Y.sendNotification(a.type,{id:G})},cleanup(Y){}});function L(Y){const G=Y;return G&&n.func(G.sendCancellation)&&n.func(G.cleanup)}T.is=L})(A||(t.CancellationSenderStrategy=A={}));var q;(function(T){T.Message=Object.freeze({receiver:N.Message,sender:A.Message});function L(Y){const G=Y;return G&&N.is(G.receiver)&&A.is(G.sender)}T.is=L})(q||(t.CancellationStrategy=q={}));var W;(function(T){function L(Y){const G=Y;return G&&n.func(G.handleMessage)}T.is=L})(W||(t.MessageStrategy=W={}));var V;(function(T){function L(Y){const G=Y;return G&&(q.is(G.cancellationStrategy)||S.is(G.connectionStrategy)||W.is(G.messageStrategy))}T.is=L})(V||(t.ConnectionOptions=V={}));var x;(function(T){T[T.New=1]="New",T[T.Listening=2]="Listening",T[T.Closed=3]="Closed",T[T.Disposed=4]="Disposed"})(x||(x={}));function k(T,L,Y,G){const X=Y!==void 0?Y:t.NullLogger;let _e=0,te=0,U=0;const ye="2.0";let Et;const Ft=new Map;let Ue;const Gt=new Map,ze=new Map;let Qe,ft=new i.LinkedMap,We=new Map,oe=new Set,P=new Map,j=f.Off,se=p.Text,B,Ne=x.New;const _t=new s.Emitter,hn=new s.Emitter,er=new s.Emitter,tr=new s.Emitter,nr=new s.Emitter,Lt=G&&G.cancellationStrategy?G.cancellationStrategy:q.Message;function $n(D){if(D===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+D.toString()}function Hr(D){return D===null?"res-unknown-"+(++U).toString():"res-"+D.toString()}function Ln(){return"not-"+(++te).toString()}function pn(D,z){r.Message.isRequest(z)?D.set($n(z.id),z):r.Message.isResponse(z)?D.set(Hr(z.id),z):D.set(Ln(),z)}function Mn(D){}function Qt(){return Ne===x.Listening}function H(){return Ne===x.Closed}function K(){return Ne===x.Disposed}function re(){(Ne===x.New||Ne===x.Listening)&&(Ne=x.Closed,hn.fire(void 0))}function Mt(D){_t.fire([D,void 0,void 0])}function Pt(D){_t.fire(D)}T.onClose(re),T.onError(Mt),L.onClose(re),L.onError(Pt);function br(){Qe||ft.size===0||(Qe=(0,e.default)().timer.setImmediate(()=>{Qe=void 0,os()}))}function Ri(D){r.Message.isRequest(D)?cs(D):r.Message.isNotification(D)?Si(D):r.Message.isResponse(D)?us(D):ki(D)}function os(){if(ft.size===0)return;const D=ft.shift();try{const z=G?.messageStrategy;W.is(z)?z.handleMessage(D,Ri):Ri(D)}finally{br()}}const as=D=>{try{if(r.Message.isNotification(D)&&D.method===a.type.method){const z=D.params.id,J=$n(z),ee=ft.get(J);if(r.Message.isRequest(ee)){const Ee=G?.connectionStrategy,Oe=Ee&&Ee.cancelUndispatched?Ee.cancelUndispatched(ee,Mn):void 0;if(Oe&&(Oe.error!==void 0||Oe.result!==void 0)){ft.delete(J),P.delete(z),Oe.id=ee.id,Dr(Oe,D.method,Date.now()),L.write(Oe).catch(()=>X.error("Sending response for canceled message failed."));return}}const Re=P.get(z);if(Re!==void 0){Re.cancel(),Kr(D);return}else oe.add(z)}pn(ft,D)}finally{br()}};function cs(D){if(K())return;function z(be,Ge,Fe){const At={jsonrpc:ye,id:D.id};be instanceof r.ResponseError?At.error=be.toJson():At.result=be===void 0?null:be,Dr(At,Ge,Fe),L.write(At).catch(()=>X.error("Sending response failed."))}function J(be,Ge,Fe){const At={jsonrpc:ye,id:D.id,error:be.toJson()};Dr(At,Ge,Fe),L.write(At).catch(()=>X.error("Sending response failed."))}function ee(be,Ge,Fe){be===void 0&&(be=null);const At={jsonrpc:ye,id:D.id,result:be};Dr(At,Ge,Fe),L.write(At).catch(()=>X.error("Sending response failed."))}fs(D);const Re=Ft.get(D.method);let Ee,Oe;Re&&(Ee=Re.type,Oe=Re.handler);const ce=Date.now();if(Oe||Et){const be=D.id??String(Date.now()),Ge=$.is(Lt.receiver)?Lt.receiver.createCancellationTokenSource(be):Lt.receiver.createCancellationTokenSource(D);D.id!==null&&oe.has(D.id)&&Ge.cancel(),D.id!==null&&P.set(be,Ge);try{let Fe;if(Oe)if(D.params===void 0){if(Ee!==void 0&&Ee.numberOfParams!==0){J(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${D.method} defines ${Ee.numberOfParams} params but received none.`),D.method,ce);return}Fe=Oe(Ge.token)}else if(Array.isArray(D.params)){if(Ee!==void 0&&Ee.parameterStructures===r.ParameterStructures.byName){J(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${D.method} defines parameters by name but received parameters by position`),D.method,ce);return}Fe=Oe(...D.params,Ge.token)}else{if(Ee!==void 0&&Ee.parameterStructures===r.ParameterStructures.byPosition){J(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${D.method} defines parameters by position but received parameters by name`),D.method,ce);return}Fe=Oe(D.params,Ge.token)}else Et&&(Fe=Et(D.method,D.params,Ge.token));const At=Fe;Fe?At.then?At.then(en=>{P.delete(be),z(en,D.method,ce)},en=>{P.delete(be),en instanceof r.ResponseError?J(en,D.method,ce):en&&n.string(en.message)?J(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${D.method} failed with message: ${en.message}`),D.method,ce):J(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${D.method} failed unexpectedly without providing any details.`),D.method,ce)}):(P.delete(be),z(Fe,D.method,ce)):(P.delete(be),ee(Fe,D.method,ce))}catch(Fe){P.delete(be),Fe instanceof r.ResponseError?z(Fe,D.method,ce):Fe&&n.string(Fe.message)?J(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${D.method} failed with message: ${Fe.message}`),D.method,ce):J(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${D.method} failed unexpectedly without providing any details.`),D.method,ce)}}else J(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${D.method}`),D.method,ce)}function us(D){if(!K())if(D.id===null)D.error?X.error(`Received response message without id: Error is:
130
- ${JSON.stringify(D.error,void 0,4)}`):X.error("Received response message without id. No further error information provided.");else{const z=D.id,J=We.get(z);if(hs(D,J),J!==void 0){We.delete(z);try{if(D.error){const ee=D.error;J.reject(new r.ResponseError(ee.code,ee.message,ee.data))}else if(D.result!==void 0)J.resolve(D.result);else throw new Error("Should never happen.")}catch(ee){ee.message?X.error(`Response handler '${J.method}' failed with message: ${ee.message}`):X.error(`Response handler '${J.method}' failed unexpectedly.`)}}}}function Si(D){if(K())return;let z,J;if(D.method===a.type.method){const ee=D.params.id;oe.delete(ee),Kr(D);return}else{const ee=Gt.get(D.method);ee&&(J=ee.handler,z=ee.type)}if(J||Ue)try{if(Kr(D),J)if(D.params===void 0)z!==void 0&&z.numberOfParams!==0&&z.parameterStructures!==r.ParameterStructures.byName&&X.error(`Notification ${D.method} defines ${z.numberOfParams} params but received none.`),J();else if(Array.isArray(D.params)){const ee=D.params;D.method===u.type.method&&ee.length===2&&c.is(ee[0])?J({token:ee[0],value:ee[1]}):(z!==void 0&&(z.parameterStructures===r.ParameterStructures.byName&&X.error(`Notification ${D.method} defines parameters by name but received parameters by position`),z.numberOfParams!==D.params.length&&X.error(`Notification ${D.method} defines ${z.numberOfParams} params but received ${ee.length} arguments`)),J(...ee))}else z!==void 0&&z.parameterStructures===r.ParameterStructures.byPosition&&X.error(`Notification ${D.method} defines parameters by position but received parameters by name`),J(D.params);else Ue&&Ue(D.method,D.params)}catch(ee){ee.message?X.error(`Notification handler '${D.method}' failed with message: ${ee.message}`):X.error(`Notification handler '${D.method}' failed unexpectedly.`)}else er.fire(D)}function ki(D){if(!D){X.error("Received empty message.");return}X.error(`Received message which is neither a response nor a notification message:
131
- ${JSON.stringify(D,null,4)}`);const z=D;if(n.string(z.id)||n.number(z.id)){const J=z.id,ee=We.get(J);ee&&ee.reject(new Error("The received response has neither a result nor an error property."))}}function gn(D){if(D!=null)switch(j){case f.Verbose:return JSON.stringify(D,null,4);case f.Compact:return JSON.stringify(D);default:return}}function ls(D){if(!(j===f.Off||!B))if(se===p.Text){let z;(j===f.Verbose||j===f.Compact)&&D.params&&(z=`Params: ${gn(D.params)}
132
-
133
- `),B.log(`Sending request '${D.method} - (${D.id})'.`,z)}else zn("send-request",D)}function ds(D){if(!(j===f.Off||!B))if(se===p.Text){let z;(j===f.Verbose||j===f.Compact)&&(D.params?z=`Params: ${gn(D.params)}
134
-
135
- `:z=`No parameters provided.
136
-
137
- `),B.log(`Sending notification '${D.method}'.`,z)}else zn("send-notification",D)}function Dr(D,z,J){if(!(j===f.Off||!B))if(se===p.Text){let ee;(j===f.Verbose||j===f.Compact)&&(D.error&&D.error.data?ee=`Error data: ${gn(D.error.data)}
138
-
139
- `:D.result?ee=`Result: ${gn(D.result)}
140
-
141
- `:D.error===void 0&&(ee=`No result returned.
142
-
143
- `)),B.log(`Sending response '${z} - (${D.id})'. Processing request took ${Date.now()-J}ms`,ee)}else zn("send-response",D)}function fs(D){if(!(j===f.Off||!B))if(se===p.Text){let z;(j===f.Verbose||j===f.Compact)&&D.params&&(z=`Params: ${gn(D.params)}
144
-
145
- `),B.log(`Received request '${D.method} - (${D.id})'.`,z)}else zn("receive-request",D)}function Kr(D){if(!(j===f.Off||!B||D.method===w.type.method))if(se===p.Text){let z;(j===f.Verbose||j===f.Compact)&&(D.params?z=`Params: ${gn(D.params)}
146
-
147
- `:z=`No parameters provided.
148
-
149
- `),B.log(`Received notification '${D.method}'.`,z)}else zn("receive-notification",D)}function hs(D,z){if(!(j===f.Off||!B))if(se===p.Text){let J;if((j===f.Verbose||j===f.Compact)&&(D.error&&D.error.data?J=`Error data: ${gn(D.error.data)}
150
-
151
- `:D.result?J=`Result: ${gn(D.result)}
152
-
153
- `:D.error===void 0&&(J=`No result returned.
154
-
155
- `)),z){const ee=D.error?` Request failed: ${D.error.message} (${D.error.code}).`:"";B.log(`Received response '${z.method} - (${D.id})' in ${Date.now()-z.timerStart}ms.${ee}`,J)}else B.log(`Received response ${D.id} without active response promise.`,J)}else zn("receive-response",D)}function zn(D,z){if(!B||j===f.Off)return;const J={isLSPMessage:!0,type:D,message:z,timestamp:Date.now()};B.log(J)}function rr(){if(H())throw new E(v.Closed,"Connection is closed.");if(K())throw new E(v.Disposed,"Connection is disposed.")}function go(){if(Qt())throw new E(v.AlreadyListening,"Connection is already listening")}function O(){if(!Qt())throw new Error("Call listen() first.")}function b(D){return D===void 0?null:D}function C(D){if(D!==null)return D}function g(D){return D!=null&&!Array.isArray(D)&&typeof D=="object"}function R(D,z){switch(D){case r.ParameterStructures.auto:return g(z)?C(z):[b(z)];case r.ParameterStructures.byName:if(!g(z))throw new Error("Received parameters by name but param is not an object literal.");return C(z);case r.ParameterStructures.byPosition:return[b(z)];default:throw new Error(`Unknown parameter structure ${D.toString()}`)}}function y(D,z){let J;const ee=D.numberOfParams;switch(ee){case 0:J=void 0;break;case 1:J=R(D.parameterStructures,z[0]);break;default:J=[];for(let Re=0;Re<z.length&&Re<ee;Re++)J.push(b(z[Re]));if(z.length<ee)for(let Re=z.length;Re<ee;Re++)J.push(null);break}return J}const _={sendNotification:(D,...z)=>{rr();let J,ee;if(n.string(D)){J=D;const Ee=z[0];let Oe=0,ce=r.ParameterStructures.auto;r.ParameterStructures.is(Ee)&&(Oe=1,ce=Ee);let be=z.length;const Ge=be-Oe;switch(Ge){case 0:ee=void 0;break;case 1:ee=R(ce,z[Oe]);break;default:if(ce===r.ParameterStructures.byName)throw new Error(`Received ${Ge} parameters for 'by Name' notification parameter structure.`);ee=z.slice(Oe,be).map(Fe=>b(Fe));break}}else{const Ee=z;J=D.method,ee=y(D,Ee)}const Re={jsonrpc:ye,method:J,params:ee};return ds(Re),L.write(Re).catch(Ee=>{throw X.error("Sending notification failed."),Ee})},onNotification:(D,z)=>{rr();let J;return n.func(D)?Ue=D:z&&(n.string(D)?(J=D,Gt.set(D,{type:void 0,handler:z})):(J=D.method,Gt.set(D.method,{type:D,handler:z}))),{dispose:()=>{J!==void 0?Gt.delete(J):Ue=void 0}}},onProgress:(D,z,J)=>{if(ze.has(z))throw new Error(`Progress handler for token ${z} already registered`);return ze.set(z,J),{dispose:()=>{ze.delete(z)}}},sendProgress:(D,z,J)=>_.sendNotification(u.type,{token:z,value:J}),onUnhandledProgress:tr.event,sendRequest:(D,...z)=>{rr(),O();let J,ee,Re;if(n.string(D)){J=D;const be=z[0],Ge=z[z.length-1];let Fe=0,At=r.ParameterStructures.auto;r.ParameterStructures.is(be)&&(Fe=1,At=be);let en=z.length;o.CancellationToken.is(Ge)&&(en=en-1,Re=Ge);const Er=en-Fe;switch(Er){case 0:ee=void 0;break;case 1:ee=R(At,z[Fe]);break;default:if(At===r.ParameterStructures.byName)throw new Error(`Received ${Er} parameters for 'by Name' request parameter structure.`);ee=z.slice(Fe,en).map(yP=>b(yP));break}}else{const be=z;J=D.method,ee=y(D,be);const Ge=D.numberOfParams;Re=o.CancellationToken.is(be[Ge])?be[Ge]:void 0}const Ee=_e++;let Oe;Re&&(Oe=Re.onCancellationRequested(()=>{const be=Lt.sender.sendCancellation(_,Ee);return be===void 0?(X.log(`Received no promise from cancellation strategy when cancelling id ${Ee}`),Promise.resolve()):be.catch(()=>{X.log(`Sending cancellation messages for id ${Ee} failed`)})}));const ce={jsonrpc:ye,id:Ee,method:J,params:ee};return ls(ce),typeof Lt.sender.enableCancellation=="function"&&Lt.sender.enableCancellation(ce),new Promise(async(be,Ge)=>{const Fe=Er=>{be(Er),Lt.sender.cleanup(Ee),Oe?.dispose()},At=Er=>{Ge(Er),Lt.sender.cleanup(Ee),Oe?.dispose()},en={method:J,timerStart:Date.now(),resolve:Fe,reject:At};try{await L.write(ce),We.set(Ee,en)}catch(Er){throw X.error("Sending request failed."),en.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,Er.message?Er.message:"Unknown reason")),Er}})},onRequest:(D,z)=>{rr();let J=null;return d.is(D)?(J=void 0,Et=D):n.string(D)?(J=null,z!==void 0&&(J=D,Ft.set(D,{handler:z,type:void 0}))):z!==void 0&&(J=D.method,Ft.set(D.method,{type:D,handler:z})),{dispose:()=>{J!==null&&(J!==void 0?Ft.delete(J):Et=void 0)}}},hasPendingResponse:()=>We.size>0,trace:async(D,z,J)=>{let ee=!1,Re=p.Text;J!==void 0&&(n.boolean(J)?ee=J:(ee=J.sendNotification||!1,Re=J.traceFormat||p.Text)),j=D,se=Re,j===f.Off?B=void 0:B=z,ee&&!H()&&!K()&&await _.sendNotification(m.type,{value:f.toString(D)})},onError:_t.event,onClose:hn.event,onUnhandledNotification:er.event,onDispose:nr.event,end:()=>{L.end()},dispose:()=>{if(K())return;Ne=x.Disposed,nr.fire(void 0);const D=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const z of We.values())z.reject(D);We=new Map,P=new Map,oe=new Set,ft=new i.LinkedMap,n.func(L.dispose)&&L.dispose(),n.func(T.dispose)&&T.dispose()},listen:()=>{rr(),go(),Ne=x.Listening,T.listen(as)},inspect:()=>{(0,e.default)().console.log("inspect")}};return _.onNotification(w.type,D=>{if(j===f.Off||!B)return;const z=j===f.Verbose||j===f.Compact;B.log(D.message,z?D.verbose:void 0)}),_.onNotification(u.type,D=>{const z=ze.get(D.token);z?z(D.value):tr.fire(D)}),_}t.createMessageConnection=k}(Ly)),Ly}var L1;function My(){return L1||(L1=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=k1();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=C1();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=Eq();Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=Yo();Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const s=Of();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return s.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return s.CancellationToken}});const o=Tq();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return o.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return o.SharedArrayReceiverStrategy}});const a=Rq();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=Sq();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=kq();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return u.AbstractMessageBuffer}});const l=$q();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=Ps();t.RAL=d.default}(Fy)),Fy}var M1;function Cq(){if(M1)return Gf;M1=1,Object.defineProperty(Gf,"__esModule",{value:!0});const t=Dq,e=My();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=h=>{h==null?l():d(h)};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||(o={})),Gf.default=o,Gf}const Vc=si(MP),_q=si(KP),z1=si(VP),Aq=si(YP);var B1;function Bs(){return B1||(B1=1,function(t){var e=Ms&&Ms.__createBinding||(Object.create?function(x,k,T,L){L===void 0&&(L=T);var Y=Object.getOwnPropertyDescriptor(k,T);(!Y||("get"in Y?!k.__esModule:Y.writable||Y.configurable))&&(Y={enumerable:!0,get:function(){return k[T]}}),Object.defineProperty(x,L,Y)}:function(x,k,T,L){L===void 0&&(L=T),x[L]=k[T]}),n=Ms&&Ms.__exportStar||function(x,k){for(var T in x)T!=="default"&&!Object.prototype.hasOwnProperty.call(k,T)&&e(k,x,T)};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=Cq();r.default.install();const i=Vc,s=_q,o=z1,a=Aq,c=My();n(My(),t);class u extends c.AbstractMessageReader{constructor(k){super(),this.process=k;let T=this.process;T.on("error",L=>this.fireError(L)),T.on("close",()=>this.fireClose())}listen(k){return this.process.on("message",k),c.Disposable.create(()=>this.process.off("message",k))}}t.IPCMessageReader=u;class l extends c.AbstractMessageWriter{constructor(k){super(),this.process=k,this.errorCount=0;const T=this.process;T.on("error",L=>this.fireError(L)),T.on("close",()=>this.fireClose)}write(k){try{return typeof this.process.send=="function"&&this.process.send(k,void 0,void 0,T=>{T?(this.errorCount++,this.handleError(T,k)):this.errorCount=0}),Promise.resolve()}catch(T){return this.handleError(T,k),Promise.reject(T)}}handleError(k,T){this.errorCount++,this.fireError(k,T,this.errorCount)}end(){}}t.IPCMessageWriter=l;class d extends c.AbstractMessageReader{constructor(k){super(),this.onData=new c.Emitter,k.on("close",()=>this.fireClose),k.on("error",T=>this.fireError(T)),k.on("message",T=>{this.onData.fire(T)})}listen(k){return this.onData.event(k)}}t.PortMessageReader=d;class f extends c.AbstractMessageWriter{constructor(k){super(),this.port=k,this.errorCount=0,k.on("close",()=>this.fireClose()),k.on("error",T=>this.fireError(T))}write(k){try{return this.port.postMessage(k),Promise.resolve()}catch(T){return this.handleError(T,k),Promise.reject(T)}}handleError(k,T){this.errorCount++,this.fireError(k,T,this.errorCount)}end(){}}t.PortMessageWriter=f;class h extends c.ReadableStreamMessageReader{constructor(k,T="utf-8"){super((0,r.default)().stream.asReadableStream(k),T)}}t.SocketMessageReader=h;class p extends c.WriteableStreamMessageWriter{constructor(k,T){super((0,r.default)().stream.asWritableStream(k),T),this.socket=k}dispose(){super.dispose(),this.socket.destroy()}}t.SocketMessageWriter=p;class m extends c.ReadableStreamMessageReader{constructor(k,T){super((0,r.default)().stream.asReadableStream(k),T)}}t.StreamMessageReader=m;class w extends c.WriteableStreamMessageWriter{constructor(k,T){super((0,r.default)().stream.asWritableStream(k),T)}}t.StreamMessageWriter=w;const v=process.env.XDG_RUNTIME_DIR,E=new Map([["linux",107],["darwin",103]]);function S(){const x=(0,o.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${x}-sock`;let k;v?k=i.join(v,`vscode-ipc-${x}.sock`):k=i.join(s.tmpdir(),`vscode-${x}.sock`);const T=E.get(process.platform);return T!==void 0&&k.length>T&&(0,r.default)().console.warn(`WARNING: IPC handle "${k}" is longer than ${T} characters.`),k}t.generateRandomPipeName=S;function $(x,k="utf-8"){let T;const L=new Promise((Y,G)=>{T=Y});return new Promise((Y,G)=>{let X=(0,a.createServer)(_e=>{X.close(),T([new h(_e,k),new p(_e,k)])});X.on("error",G),X.listen(x,()=>{X.removeListener("error",G),Y({onConnected:()=>L})})})}t.createClientPipeTransport=$;function I(x,k="utf-8"){const T=(0,a.createConnection)(x);return[new h(T,k),new p(T,k)]}t.createServerPipeTransport=I;function N(x,k="utf-8"){let T;const L=new Promise((Y,G)=>{T=Y});return new Promise((Y,G)=>{const X=(0,a.createServer)(_e=>{X.close(),T([new h(_e,k),new p(_e,k)])});X.on("error",G),X.listen(x,"127.0.0.1",()=>{X.removeListener("error",G),Y({onConnected:()=>L})})})}t.createClientSocketTransport=N;function A(x,k="utf-8"){const T=(0,a.createConnection)(x,"127.0.0.1");return[new h(T,k),new p(T,k)]}t.createServerSocketTransport=A;function q(x){const k=x;return k.read!==void 0&&k.addListener!==void 0}function W(x){const k=x;return k.write!==void 0&&k.addListener!==void 0}function V(x,k,T,L){T||(T=c.NullLogger);const Y=q(x)?new m(x):x,G=W(k)?new w(k):k;return c.ConnectionStrategy.is(L)&&(L={connectionStrategy:L}),(0,c.createMessageConnection)(Y,G,T,L)}t.createMessageConnection=V}(Ms)),Ms}var zy,j1;function q1(){return j1||(j1=1,zy=Bs()),zy}var js={};function U1(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 Hf={exports:{}},W1;function By(){return W1||(W1=1,function(t,e){(function(n){{var r=n(U1,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(b){function C(g){return typeof g=="string"}b.is=C})(i||(r.DocumentUri=i={}));var s;(function(b){function C(g){return typeof g=="string"}b.is=C})(s||(r.URI=s={}));var o;(function(b){b.MIN_VALUE=-2147483648,b.MAX_VALUE=2147483647;function C(g){return typeof g=="number"&&b.MIN_VALUE<=g&&g<=b.MAX_VALUE}b.is=C})(o||(r.integer=o={}));var a;(function(b){b.MIN_VALUE=0,b.MAX_VALUE=2147483647;function C(g){return typeof g=="number"&&b.MIN_VALUE<=g&&g<=b.MAX_VALUE}b.is=C})(a||(r.uinteger=a={}));var c;(function(b){function C(R,y){return R===Number.MAX_VALUE&&(R=a.MAX_VALUE),y===Number.MAX_VALUE&&(y=a.MAX_VALUE),{line:R,character:y}}b.create=C;function g(R){var y=R;return O.objectLiteral(y)&&O.uinteger(y.line)&&O.uinteger(y.character)}b.is=g})(c||(r.Position=c={}));var u;(function(b){function C(R,y,_,D){if(O.uinteger(R)&&O.uinteger(y)&&O.uinteger(_)&&O.uinteger(D))return{start:c.create(R,y),end:c.create(_,D)};if(c.is(R)&&c.is(y))return{start:R,end:y};throw new Error("Range#create called with invalid arguments[".concat(R,", ").concat(y,", ").concat(_,", ").concat(D,"]"))}b.create=C;function g(R){var y=R;return O.objectLiteral(y)&&c.is(y.start)&&c.is(y.end)}b.is=g})(u||(r.Range=u={}));var l;(function(b){function C(R,y){return{uri:R,range:y}}b.create=C;function g(R){var y=R;return O.objectLiteral(y)&&u.is(y.range)&&(O.string(y.uri)||O.undefined(y.uri))}b.is=g})(l||(r.Location=l={}));var d;(function(b){function C(R,y,_,D){return{targetUri:R,targetRange:y,targetSelectionRange:_,originSelectionRange:D}}b.create=C;function g(R){var y=R;return O.objectLiteral(y)&&u.is(y.targetRange)&&O.string(y.targetUri)&&u.is(y.targetSelectionRange)&&(u.is(y.originSelectionRange)||O.undefined(y.originSelectionRange))}b.is=g})(d||(r.LocationLink=d={}));var f;(function(b){function C(R,y,_,D){return{red:R,green:y,blue:_,alpha:D}}b.create=C;function g(R){var y=R;return O.objectLiteral(y)&&O.numberRange(y.red,0,1)&&O.numberRange(y.green,0,1)&&O.numberRange(y.blue,0,1)&&O.numberRange(y.alpha,0,1)}b.is=g})(f||(r.Color=f={}));var h;(function(b){function C(R,y){return{range:R,color:y}}b.create=C;function g(R){var y=R;return O.objectLiteral(y)&&u.is(y.range)&&f.is(y.color)}b.is=g})(h||(r.ColorInformation=h={}));var p;(function(b){function C(R,y,_){return{label:R,textEdit:y,additionalTextEdits:_}}b.create=C;function g(R){var y=R;return O.objectLiteral(y)&&O.string(y.label)&&(O.undefined(y.textEdit)||A.is(y))&&(O.undefined(y.additionalTextEdits)||O.typedArray(y.additionalTextEdits,A.is))}b.is=g})(p||(r.ColorPresentation=p={}));var m;(function(b){b.Comment="comment",b.Imports="imports",b.Region="region"})(m||(r.FoldingRangeKind=m={}));var w;(function(b){function C(R,y,_,D,z,J){var ee={startLine:R,endLine:y};return O.defined(_)&&(ee.startCharacter=_),O.defined(D)&&(ee.endCharacter=D),O.defined(z)&&(ee.kind=z),O.defined(J)&&(ee.collapsedText=J),ee}b.create=C;function g(R){var y=R;return O.objectLiteral(y)&&O.uinteger(y.startLine)&&O.uinteger(y.startLine)&&(O.undefined(y.startCharacter)||O.uinteger(y.startCharacter))&&(O.undefined(y.endCharacter)||O.uinteger(y.endCharacter))&&(O.undefined(y.kind)||O.string(y.kind))}b.is=g})(w||(r.FoldingRange=w={}));var v;(function(b){function C(R,y){return{location:R,message:y}}b.create=C;function g(R){var y=R;return O.defined(y)&&l.is(y.location)&&O.string(y.message)}b.is=g})(v||(r.DiagnosticRelatedInformation=v={}));var E;(function(b){b.Error=1,b.Warning=2,b.Information=3,b.Hint=4})(E||(r.DiagnosticSeverity=E={}));var S;(function(b){b.Unnecessary=1,b.Deprecated=2})(S||(r.DiagnosticTag=S={}));var $;(function(b){function C(g){var R=g;return O.objectLiteral(R)&&O.string(R.href)}b.is=C})($||(r.CodeDescription=$={}));var I;(function(b){function C(R,y,_,D,z,J){var ee={range:R,message:y};return O.defined(_)&&(ee.severity=_),O.defined(D)&&(ee.code=D),O.defined(z)&&(ee.source=z),O.defined(J)&&(ee.relatedInformation=J),ee}b.create=C;function g(R){var y,_=R;return O.defined(_)&&u.is(_.range)&&O.string(_.message)&&(O.number(_.severity)||O.undefined(_.severity))&&(O.integer(_.code)||O.string(_.code)||O.undefined(_.code))&&(O.undefined(_.codeDescription)||O.string((y=_.codeDescription)===null||y===void 0?void 0:y.href))&&(O.string(_.source)||O.undefined(_.source))&&(O.undefined(_.relatedInformation)||O.typedArray(_.relatedInformation,v.is))}b.is=g})(I||(r.Diagnostic=I={}));var N;(function(b){function C(R,y){for(var _=[],D=2;D<arguments.length;D++)_[D-2]=arguments[D];var z={title:R,command:y};return O.defined(_)&&_.length>0&&(z.arguments=_),z}b.create=C;function g(R){var y=R;return O.defined(y)&&O.string(y.title)&&O.string(y.command)}b.is=g})(N||(r.Command=N={}));var A;(function(b){function C(_,D){return{range:_,newText:D}}b.replace=C;function g(_,D){return{range:{start:_,end:_},newText:D}}b.insert=g;function R(_){return{range:_,newText:""}}b.del=R;function y(_){var D=_;return O.objectLiteral(D)&&O.string(D.newText)&&u.is(D.range)}b.is=y})(A||(r.TextEdit=A={}));var q;(function(b){function C(R,y,_){var D={label:R};return y!==void 0&&(D.needsConfirmation=y),_!==void 0&&(D.description=_),D}b.create=C;function g(R){var y=R;return O.objectLiteral(y)&&O.string(y.label)&&(O.boolean(y.needsConfirmation)||y.needsConfirmation===void 0)&&(O.string(y.description)||y.description===void 0)}b.is=g})(q||(r.ChangeAnnotation=q={}));var W;(function(b){function C(g){var R=g;return O.string(R)}b.is=C})(W||(r.ChangeAnnotationIdentifier=W={}));var V;(function(b){function C(_,D,z){return{range:_,newText:D,annotationId:z}}b.replace=C;function g(_,D,z){return{range:{start:_,end:_},newText:D,annotationId:z}}b.insert=g;function R(_,D){return{range:_,newText:"",annotationId:D}}b.del=R;function y(_){var D=_;return A.is(D)&&(q.is(D.annotationId)||W.is(D.annotationId))}b.is=y})(V||(r.AnnotatedTextEdit=V={}));var x;(function(b){function C(R,y){return{textDocument:R,edits:y}}b.create=C;function g(R){var y=R;return O.defined(y)&&ye.is(y.textDocument)&&Array.isArray(y.edits)}b.is=g})(x||(r.TextDocumentEdit=x={}));var k;(function(b){function C(R,y,_){var D={kind:"create",uri:R};return y!==void 0&&(y.overwrite!==void 0||y.ignoreIfExists!==void 0)&&(D.options=y),_!==void 0&&(D.annotationId=_),D}b.create=C;function g(R){var y=R;return y&&y.kind==="create"&&O.string(y.uri)&&(y.options===void 0||(y.options.overwrite===void 0||O.boolean(y.options.overwrite))&&(y.options.ignoreIfExists===void 0||O.boolean(y.options.ignoreIfExists)))&&(y.annotationId===void 0||W.is(y.annotationId))}b.is=g})(k||(r.CreateFile=k={}));var T;(function(b){function C(R,y,_,D){var z={kind:"rename",oldUri:R,newUri:y};return _!==void 0&&(_.overwrite!==void 0||_.ignoreIfExists!==void 0)&&(z.options=_),D!==void 0&&(z.annotationId=D),z}b.create=C;function g(R){var y=R;return y&&y.kind==="rename"&&O.string(y.oldUri)&&O.string(y.newUri)&&(y.options===void 0||(y.options.overwrite===void 0||O.boolean(y.options.overwrite))&&(y.options.ignoreIfExists===void 0||O.boolean(y.options.ignoreIfExists)))&&(y.annotationId===void 0||W.is(y.annotationId))}b.is=g})(T||(r.RenameFile=T={}));var L;(function(b){function C(R,y,_){var D={kind:"delete",uri:R};return y!==void 0&&(y.recursive!==void 0||y.ignoreIfNotExists!==void 0)&&(D.options=y),_!==void 0&&(D.annotationId=_),D}b.create=C;function g(R){var y=R;return y&&y.kind==="delete"&&O.string(y.uri)&&(y.options===void 0||(y.options.recursive===void 0||O.boolean(y.options.recursive))&&(y.options.ignoreIfNotExists===void 0||O.boolean(y.options.ignoreIfNotExists)))&&(y.annotationId===void 0||W.is(y.annotationId))}b.is=g})(L||(r.DeleteFile=L={}));var Y;(function(b){function C(g){var R=g;return R&&(R.changes!==void 0||R.documentChanges!==void 0)&&(R.documentChanges===void 0||R.documentChanges.every(function(y){return O.string(y.kind)?k.is(y)||T.is(y)||L.is(y):x.is(y)}))}b.is=C})(Y||(r.WorkspaceEdit=Y={}));var G=function(){function b(C,g){this.edits=C,this.changeAnnotations=g}return b.prototype.insert=function(C,g,R){var y,_;if(R===void 0?y=A.insert(C,g):W.is(R)?(_=R,y=V.insert(C,g,R)):(this.assertChangeAnnotations(this.changeAnnotations),_=this.changeAnnotations.manage(R),y=V.insert(C,g,_)),this.edits.push(y),_!==void 0)return _},b.prototype.replace=function(C,g,R){var y,_;if(R===void 0?y=A.replace(C,g):W.is(R)?(_=R,y=V.replace(C,g,R)):(this.assertChangeAnnotations(this.changeAnnotations),_=this.changeAnnotations.manage(R),y=V.replace(C,g,_)),this.edits.push(y),_!==void 0)return _},b.prototype.delete=function(C,g){var R,y;if(g===void 0?R=A.del(C):W.is(g)?(y=g,R=V.del(C,g)):(this.assertChangeAnnotations(this.changeAnnotations),y=this.changeAnnotations.manage(g),R=V.del(C,y)),this.edits.push(R),y!==void 0)return y},b.prototype.add=function(C){this.edits.push(C)},b.prototype.all=function(){return this.edits},b.prototype.clear=function(){this.edits.splice(0,this.edits.length)},b.prototype.assertChangeAnnotations=function(C){if(C===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},b}(),X=function(){function b(C){this._annotations=C===void 0?Object.create(null):C,this._counter=0,this._size=0}return b.prototype.all=function(){return this._annotations},Object.defineProperty(b.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),b.prototype.manage=function(C,g){var R;if(W.is(C)?R=C:(R=this.nextId(),g=C),this._annotations[R]!==void 0)throw new Error("Id ".concat(R," is already in use."));if(g===void 0)throw new Error("No annotation provided for id ".concat(R));return this._annotations[R]=g,this._size++,R},b.prototype.nextId=function(){return this._counter++,this._counter.toString()},b}(),_e=function(){function b(C){var g=this;this._textEditChanges=Object.create(null),C!==void 0?(this._workspaceEdit=C,C.documentChanges?(this._changeAnnotations=new X(C.changeAnnotations),C.changeAnnotations=this._changeAnnotations.all(),C.documentChanges.forEach(function(R){if(x.is(R)){var y=new G(R.edits,g._changeAnnotations);g._textEditChanges[R.textDocument.uri]=y}})):C.changes&&Object.keys(C.changes).forEach(function(R){var y=new G(C.changes[R]);g._textEditChanges[R]=y})):this._workspaceEdit={}}return Object.defineProperty(b.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}),b.prototype.getTextEditChange=function(C){if(ye.is(C)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var g={uri:C.uri,version:C.version},R=this._textEditChanges[g.uri];if(!R){var y=[],_={textDocument:g,edits:y};this._workspaceEdit.documentChanges.push(_),R=new G(y,this._changeAnnotations),this._textEditChanges[g.uri]=R}return R}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var R=this._textEditChanges[C];if(!R){var y=[];this._workspaceEdit.changes[C]=y,R=new G(y),this._textEditChanges[C]=R}return R}},b.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new X,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},b.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},b.prototype.createFile=function(C,g,R){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var y;q.is(g)||W.is(g)?y=g:R=g;var _,D;if(y===void 0?_=k.create(C,R):(D=W.is(y)?y:this._changeAnnotations.manage(y),_=k.create(C,R,D)),this._workspaceEdit.documentChanges.push(_),D!==void 0)return D},b.prototype.renameFile=function(C,g,R,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var _;q.is(R)||W.is(R)?_=R:y=R;var D,z;if(_===void 0?D=T.create(C,g,y):(z=W.is(_)?_:this._changeAnnotations.manage(_),D=T.create(C,g,y,z)),this._workspaceEdit.documentChanges.push(D),z!==void 0)return z},b.prototype.deleteFile=function(C,g,R){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var y;q.is(g)||W.is(g)?y=g:R=g;var _,D;if(y===void 0?_=L.create(C,R):(D=W.is(y)?y:this._changeAnnotations.manage(y),_=L.create(C,R,D)),this._workspaceEdit.documentChanges.push(_),D!==void 0)return D},b}();r.WorkspaceChange=_e;var te;(function(b){function C(R){return{uri:R}}b.create=C;function g(R){var y=R;return O.defined(y)&&O.string(y.uri)}b.is=g})(te||(r.TextDocumentIdentifier=te={}));var U;(function(b){function C(R,y){return{uri:R,version:y}}b.create=C;function g(R){var y=R;return O.defined(y)&&O.string(y.uri)&&O.integer(y.version)}b.is=g})(U||(r.VersionedTextDocumentIdentifier=U={}));var ye;(function(b){function C(R,y){return{uri:R,version:y}}b.create=C;function g(R){var y=R;return O.defined(y)&&O.string(y.uri)&&(y.version===null||O.integer(y.version))}b.is=g})(ye||(r.OptionalVersionedTextDocumentIdentifier=ye={}));var Et;(function(b){function C(R,y,_,D){return{uri:R,languageId:y,version:_,text:D}}b.create=C;function g(R){var y=R;return O.defined(y)&&O.string(y.uri)&&O.string(y.languageId)&&O.integer(y.version)&&O.string(y.text)}b.is=g})(Et||(r.TextDocumentItem=Et={}));var Ft;(function(b){b.PlainText="plaintext",b.Markdown="markdown";function C(g){var R=g;return R===b.PlainText||R===b.Markdown}b.is=C})(Ft||(r.MarkupKind=Ft={}));var Ue;(function(b){function C(g){var R=g;return O.objectLiteral(g)&&Ft.is(R.kind)&&O.string(R.value)}b.is=C})(Ue||(r.MarkupContent=Ue={}));var Gt;(function(b){b.Text=1,b.Method=2,b.Function=3,b.Constructor=4,b.Field=5,b.Variable=6,b.Class=7,b.Interface=8,b.Module=9,b.Property=10,b.Unit=11,b.Value=12,b.Enum=13,b.Keyword=14,b.Snippet=15,b.Color=16,b.File=17,b.Reference=18,b.Folder=19,b.EnumMember=20,b.Constant=21,b.Struct=22,b.Event=23,b.Operator=24,b.TypeParameter=25})(Gt||(r.CompletionItemKind=Gt={}));var ze;(function(b){b.PlainText=1,b.Snippet=2})(ze||(r.InsertTextFormat=ze={}));var Qe;(function(b){b.Deprecated=1})(Qe||(r.CompletionItemTag=Qe={}));var ft;(function(b){function C(R,y,_){return{newText:R,insert:y,replace:_}}b.create=C;function g(R){var y=R;return y&&O.string(y.newText)&&u.is(y.insert)&&u.is(y.replace)}b.is=g})(ft||(r.InsertReplaceEdit=ft={}));var We;(function(b){b.asIs=1,b.adjustIndentation=2})(We||(r.InsertTextMode=We={}));var oe;(function(b){function C(g){var R=g;return R&&(O.string(R.detail)||R.detail===void 0)&&(O.string(R.description)||R.description===void 0)}b.is=C})(oe||(r.CompletionItemLabelDetails=oe={}));var P;(function(b){function C(g){return{label:g}}b.create=C})(P||(r.CompletionItem=P={}));var j;(function(b){function C(g,R){return{items:g||[],isIncomplete:!!R}}b.create=C})(j||(r.CompletionList=j={}));var se;(function(b){function C(R){return R.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}b.fromPlainText=C;function g(R){var y=R;return O.string(y)||O.objectLiteral(y)&&O.string(y.language)&&O.string(y.value)}b.is=g})(se||(r.MarkedString=se={}));var B;(function(b){function C(g){var R=g;return!!R&&O.objectLiteral(R)&&(Ue.is(R.contents)||se.is(R.contents)||O.typedArray(R.contents,se.is))&&(g.range===void 0||u.is(g.range))}b.is=C})(B||(r.Hover=B={}));var Ne;(function(b){function C(g,R){return R?{label:g,documentation:R}:{label:g}}b.create=C})(Ne||(r.ParameterInformation=Ne={}));var _t;(function(b){function C(g,R){for(var y=[],_=2;_<arguments.length;_++)y[_-2]=arguments[_];var D={label:g};return O.defined(R)&&(D.documentation=R),O.defined(y)?D.parameters=y:D.parameters=[],D}b.create=C})(_t||(r.SignatureInformation=_t={}));var hn;(function(b){b.Text=1,b.Read=2,b.Write=3})(hn||(r.DocumentHighlightKind=hn={}));var er;(function(b){function C(g,R){var y={range:g};return O.number(R)&&(y.kind=R),y}b.create=C})(er||(r.DocumentHighlight=er={}));var tr;(function(b){b.File=1,b.Module=2,b.Namespace=3,b.Package=4,b.Class=5,b.Method=6,b.Property=7,b.Field=8,b.Constructor=9,b.Enum=10,b.Interface=11,b.Function=12,b.Variable=13,b.Constant=14,b.String=15,b.Number=16,b.Boolean=17,b.Array=18,b.Object=19,b.Key=20,b.Null=21,b.EnumMember=22,b.Struct=23,b.Event=24,b.Operator=25,b.TypeParameter=26})(tr||(r.SymbolKind=tr={}));var nr;(function(b){b.Deprecated=1})(nr||(r.SymbolTag=nr={}));var Lt;(function(b){function C(g,R,y,_,D){var z={name:g,kind:R,location:{uri:_,range:y}};return D&&(z.containerName=D),z}b.create=C})(Lt||(r.SymbolInformation=Lt={}));var $n;(function(b){function C(g,R,y,_){return _!==void 0?{name:g,kind:R,location:{uri:y,range:_}}:{name:g,kind:R,location:{uri:y}}}b.create=C})($n||(r.WorkspaceSymbol=$n={}));var Hr;(function(b){function C(R,y,_,D,z,J){var ee={name:R,detail:y,kind:_,range:D,selectionRange:z};return J!==void 0&&(ee.children=J),ee}b.create=C;function g(R){var y=R;return y&&O.string(y.name)&&O.number(y.kind)&&u.is(y.range)&&u.is(y.selectionRange)&&(y.detail===void 0||O.string(y.detail))&&(y.deprecated===void 0||O.boolean(y.deprecated))&&(y.children===void 0||Array.isArray(y.children))&&(y.tags===void 0||Array.isArray(y.tags))}b.is=g})(Hr||(r.DocumentSymbol=Hr={}));var Ln;(function(b){b.Empty="",b.QuickFix="quickfix",b.Refactor="refactor",b.RefactorExtract="refactor.extract",b.RefactorInline="refactor.inline",b.RefactorRewrite="refactor.rewrite",b.Source="source",b.SourceOrganizeImports="source.organizeImports",b.SourceFixAll="source.fixAll"})(Ln||(r.CodeActionKind=Ln={}));var pn;(function(b){b.Invoked=1,b.Automatic=2})(pn||(r.CodeActionTriggerKind=pn={}));var Mn;(function(b){function C(R,y,_){var D={diagnostics:R};return y!=null&&(D.only=y),_!=null&&(D.triggerKind=_),D}b.create=C;function g(R){var y=R;return O.defined(y)&&O.typedArray(y.diagnostics,I.is)&&(y.only===void 0||O.typedArray(y.only,O.string))&&(y.triggerKind===void 0||y.triggerKind===pn.Invoked||y.triggerKind===pn.Automatic)}b.is=g})(Mn||(r.CodeActionContext=Mn={}));var Qt;(function(b){function C(R,y,_){var D={title:R},z=!0;return typeof y=="string"?(z=!1,D.kind=y):N.is(y)?D.command=y:D.edit=y,z&&_!==void 0&&(D.kind=_),D}b.create=C;function g(R){var y=R;return y&&O.string(y.title)&&(y.diagnostics===void 0||O.typedArray(y.diagnostics,I.is))&&(y.kind===void 0||O.string(y.kind))&&(y.edit!==void 0||y.command!==void 0)&&(y.command===void 0||N.is(y.command))&&(y.isPreferred===void 0||O.boolean(y.isPreferred))&&(y.edit===void 0||Y.is(y.edit))}b.is=g})(Qt||(r.CodeAction=Qt={}));var H;(function(b){function C(R,y){var _={range:R};return O.defined(y)&&(_.data=y),_}b.create=C;function g(R){var y=R;return O.defined(y)&&u.is(y.range)&&(O.undefined(y.command)||N.is(y.command))}b.is=g})(H||(r.CodeLens=H={}));var K;(function(b){function C(R,y){return{tabSize:R,insertSpaces:y}}b.create=C;function g(R){var y=R;return O.defined(y)&&O.uinteger(y.tabSize)&&O.boolean(y.insertSpaces)}b.is=g})(K||(r.FormattingOptions=K={}));var re;(function(b){function C(R,y,_){return{range:R,target:y,data:_}}b.create=C;function g(R){var y=R;return O.defined(y)&&u.is(y.range)&&(O.undefined(y.target)||O.string(y.target))}b.is=g})(re||(r.DocumentLink=re={}));var Mt;(function(b){function C(R,y){return{range:R,parent:y}}b.create=C;function g(R){var y=R;return O.objectLiteral(y)&&u.is(y.range)&&(y.parent===void 0||b.is(y.parent))}b.is=g})(Mt||(r.SelectionRange=Mt={}));var Pt;(function(b){b.namespace="namespace",b.type="type",b.class="class",b.enum="enum",b.interface="interface",b.struct="struct",b.typeParameter="typeParameter",b.parameter="parameter",b.variable="variable",b.property="property",b.enumMember="enumMember",b.event="event",b.function="function",b.method="method",b.macro="macro",b.keyword="keyword",b.modifier="modifier",b.comment="comment",b.string="string",b.number="number",b.regexp="regexp",b.operator="operator",b.decorator="decorator"})(Pt||(r.SemanticTokenTypes=Pt={}));var br;(function(b){b.declaration="declaration",b.definition="definition",b.readonly="readonly",b.static="static",b.deprecated="deprecated",b.abstract="abstract",b.async="async",b.modification="modification",b.documentation="documentation",b.defaultLibrary="defaultLibrary"})(br||(r.SemanticTokenModifiers=br={}));var Ri;(function(b){function C(g){var R=g;return O.objectLiteral(R)&&(R.resultId===void 0||typeof R.resultId=="string")&&Array.isArray(R.data)&&(R.data.length===0||typeof R.data[0]=="number")}b.is=C})(Ri||(r.SemanticTokens=Ri={}));var os;(function(b){function C(R,y){return{range:R,text:y}}b.create=C;function g(R){var y=R;return y!=null&&u.is(y.range)&&O.string(y.text)}b.is=g})(os||(r.InlineValueText=os={}));var as;(function(b){function C(R,y,_){return{range:R,variableName:y,caseSensitiveLookup:_}}b.create=C;function g(R){var y=R;return y!=null&&u.is(y.range)&&O.boolean(y.caseSensitiveLookup)&&(O.string(y.variableName)||y.variableName===void 0)}b.is=g})(as||(r.InlineValueVariableLookup=as={}));var cs;(function(b){function C(R,y){return{range:R,expression:y}}b.create=C;function g(R){var y=R;return y!=null&&u.is(y.range)&&(O.string(y.expression)||y.expression===void 0)}b.is=g})(cs||(r.InlineValueEvaluatableExpression=cs={}));var us;(function(b){function C(R,y){return{frameId:R,stoppedLocation:y}}b.create=C;function g(R){var y=R;return O.defined(y)&&u.is(R.stoppedLocation)}b.is=g})(us||(r.InlineValueContext=us={}));var Si;(function(b){b.Type=1,b.Parameter=2;function C(g){return g===1||g===2}b.is=C})(Si||(r.InlayHintKind=Si={}));var ki;(function(b){function C(R){return{value:R}}b.create=C;function g(R){var y=R;return O.objectLiteral(y)&&(y.tooltip===void 0||O.string(y.tooltip)||Ue.is(y.tooltip))&&(y.location===void 0||l.is(y.location))&&(y.command===void 0||N.is(y.command))}b.is=g})(ki||(r.InlayHintLabelPart=ki={}));var gn;(function(b){function C(R,y,_){var D={position:R,label:y};return _!==void 0&&(D.kind=_),D}b.create=C;function g(R){var y=R;return O.objectLiteral(y)&&c.is(y.position)&&(O.string(y.label)||O.typedArray(y.label,ki.is))&&(y.kind===void 0||Si.is(y.kind))&&y.textEdits===void 0||O.typedArray(y.textEdits,A.is)&&(y.tooltip===void 0||O.string(y.tooltip)||Ue.is(y.tooltip))&&(y.paddingLeft===void 0||O.boolean(y.paddingLeft))&&(y.paddingRight===void 0||O.boolean(y.paddingRight))}b.is=g})(gn||(r.InlayHint=gn={}));var ls;(function(b){function C(g){return{kind:"snippet",value:g}}b.createSnippet=C})(ls||(r.StringValue=ls={}));var ds;(function(b){function C(g,R,y,_){return{insertText:g,filterText:R,range:y,command:_}}b.create=C})(ds||(r.InlineCompletionItem=ds={}));var Dr;(function(b){function C(g){return{items:g}}b.create=C})(Dr||(r.InlineCompletionList=Dr={}));var fs;(function(b){b.Invoked=0,b.Automatic=1})(fs||(r.InlineCompletionTriggerKind=fs={}));var Kr;(function(b){function C(g,R){return{range:g,text:R}}b.create=C})(Kr||(r.SelectedCompletionInfo=Kr={}));var hs;(function(b){function C(g,R){return{triggerKind:g,selectedCompletionInfo:R}}b.create=C})(hs||(r.InlineCompletionContext=hs={}));var zn;(function(b){function C(g){var R=g;return O.objectLiteral(R)&&s.is(R.uri)&&O.string(R.name)}b.is=C})(zn||(r.WorkspaceFolder=zn={})),r.EOL=[`
156
- `,`\r
157
- `,"\r"];var rr;(function(b){function C(_,D,z,J){return new go(_,D,z,J)}b.create=C;function g(_){var D=_;return!!(O.defined(D)&&O.string(D.uri)&&(O.undefined(D.languageId)||O.string(D.languageId))&&O.uinteger(D.lineCount)&&O.func(D.getText)&&O.func(D.positionAt)&&O.func(D.offsetAt))}b.is=g;function R(_,D){for(var z=_.getText(),J=y(D,function(be,Ge){var Fe=be.range.start.line-Ge.range.start.line;return Fe===0?be.range.start.character-Ge.range.start.character:Fe}),ee=z.length,Re=J.length-1;Re>=0;Re--){var Ee=J[Re],Oe=_.offsetAt(Ee.range.start),ce=_.offsetAt(Ee.range.end);if(ce<=ee)z=z.substring(0,Oe)+Ee.newText+z.substring(ce,z.length);else throw new Error("Overlapping edit");ee=Oe}return z}b.applyEdits=R;function y(_,D){if(_.length<=1)return _;var z=_.length/2|0,J=_.slice(0,z),ee=_.slice(z);y(J,D),y(ee,D);for(var Re=0,Ee=0,Oe=0;Re<J.length&&Ee<ee.length;){var ce=D(J[Re],ee[Ee]);ce<=0?_[Oe++]=J[Re++]:_[Oe++]=ee[Ee++]}for(;Re<J.length;)_[Oe++]=J[Re++];for(;Ee<ee.length;)_[Oe++]=ee[Ee++];return _}})(rr||(r.TextDocument=rr={}));var go=function(){function b(C,g,R,y){this._uri=C,this._languageId=g,this._version=R,this._content=y,this._lineOffsets=void 0}return Object.defineProperty(b.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),b.prototype.getText=function(C){if(C){var g=this.offsetAt(C.start),R=this.offsetAt(C.end);return this._content.substring(g,R)}return this._content},b.prototype.update=function(C,g){this._content=C.text,this._version=g,this._lineOffsets=void 0},b.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var C=[],g=this._content,R=!0,y=0;y<g.length;y++){R&&(C.push(y),R=!1);var _=g.charAt(y);R=_==="\r"||_===`
158
- `,_==="\r"&&y+1<g.length&&g.charAt(y+1)===`
159
- `&&y++}R&&g.length>0&&C.push(g.length),this._lineOffsets=C}return this._lineOffsets},b.prototype.positionAt=function(C){C=Math.max(Math.min(C,this._content.length),0);var g=this.getLineOffsets(),R=0,y=g.length;if(y===0)return c.create(0,C);for(;R<y;){var _=Math.floor((R+y)/2);g[_]>C?y=_:R=_+1}var D=R-1;return c.create(D,C-g[D])},b.prototype.offsetAt=function(C){var g=this.getLineOffsets();if(C.line>=g.length)return this._content.length;if(C.line<0)return 0;var R=g[C.line],y=C.line+1<g.length?g[C.line+1]:this._content.length;return Math.max(Math.min(R+C.character,y),R)},Object.defineProperty(b.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),b}(),O;(function(b){var C=Object.prototype.toString;function g(ce){return typeof ce<"u"}b.defined=g;function R(ce){return typeof ce>"u"}b.undefined=R;function y(ce){return ce===!0||ce===!1}b.boolean=y;function _(ce){return C.call(ce)==="[object String]"}b.string=_;function D(ce){return C.call(ce)==="[object Number]"}b.number=D;function z(ce,be,Ge){return C.call(ce)==="[object Number]"&&be<=ce&&ce<=Ge}b.numberRange=z;function J(ce){return C.call(ce)==="[object Number]"&&-2147483648<=ce&&ce<=2147483647}b.integer=J;function ee(ce){return C.call(ce)==="[object Number]"&&0<=ce&&ce<=2147483647}b.uinteger=ee;function Re(ce){return C.call(ce)==="[object Function]"}b.func=Re;function Ee(ce){return ce!==null&&typeof ce=="object"}b.objectLiteral=Ee;function Oe(ce,be){return Array.isArray(ce)&&ce.every(be)}b.typedArray=Oe})(O||(O={}))})}(Hf,Hf.exports)),Hf.exports}var cn={},G1;function lt(){if(G1)return cn;G1=1,Object.defineProperty(cn,"__esModule",{value:!0}),cn.ProtocolNotificationType=cn.ProtocolNotificationType0=cn.ProtocolRequestType=cn.ProtocolRequestType0=cn.RegistrationType=cn.MessageDirection=void 0;const t=Bs();var e;(function(a){a.clientToServer="clientToServer",a.serverToClient="serverToClient",a.both="both"})(e||(cn.MessageDirection=e={}));class n{constructor(c){this.method=c}}cn.RegistrationType=n;class r extends t.RequestType0{constructor(c){super(c)}}cn.ProtocolRequestType0=r;class i extends t.RequestType{constructor(c){super(c,t.ParameterStructures.byName)}}cn.ProtocolRequestType=i;class s extends t.NotificationType0{constructor(c){super(c)}}cn.ProtocolNotificationType0=s;class o extends t.NotificationType{constructor(c){super(c,t.ParameterStructures.byName)}}return cn.ProtocolNotificationType=o,cn}var jy={},wt={},H1;function qy(){if(H1)return wt;H1=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.objectLiteral=wt.typedArray=wt.stringArray=wt.array=wt.func=wt.error=wt.number=wt.string=wt.boolean=void 0;function t(u){return u===!0||u===!1}wt.boolean=t;function e(u){return typeof u=="string"||u instanceof String}wt.string=e;function n(u){return typeof u=="number"||u instanceof Number}wt.number=n;function r(u){return u instanceof Error}wt.error=r;function i(u){return typeof u=="function"}wt.func=i;function s(u){return Array.isArray(u)}wt.array=s;function o(u){return s(u)&&u.every(l=>e(l))}wt.stringArray=o;function a(u,l){return Array.isArray(u)&&u.every(l)}wt.typedArray=a;function c(u){return u!==null&&typeof u=="object"}return wt.objectLiteral=c,wt}var Yc={},K1;function xq(){if(K1)return Yc;K1=1,Object.defineProperty(Yc,"__esModule",{value:!0}),Yc.ImplementationRequest=void 0;const t=lt();var e;return function(n){n.method="textDocument/implementation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(Yc.ImplementationRequest=e={})),Yc}var Xc={},V1;function Iq(){if(V1)return Xc;V1=1,Object.defineProperty(Xc,"__esModule",{value:!0}),Xc.TypeDefinitionRequest=void 0;const t=lt();var e;return function(n){n.method="textDocument/typeDefinition",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(Xc.TypeDefinitionRequest=e={})),Xc}var qs={},Y1;function Pq(){if(Y1)return qs;Y1=1,Object.defineProperty(qs,"__esModule",{value:!0}),qs.DidChangeWorkspaceFoldersNotification=qs.WorkspaceFoldersRequest=void 0;const t=lt();var e;(function(r){r.method="workspace/workspaceFolders",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)})(e||(qs.WorkspaceFoldersRequest=e={}));var n;return function(r){r.method="workspace/didChangeWorkspaceFolders",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolNotificationType(r.method)}(n||(qs.DidChangeWorkspaceFoldersNotification=n={})),qs}var Jc={},X1;function Nq(){if(X1)return Jc;X1=1,Object.defineProperty(Jc,"__esModule",{value:!0}),Jc.ConfigurationRequest=void 0;const t=lt();var e;return function(n){n.method="workspace/configuration",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(e||(Jc.ConfigurationRequest=e={})),Jc}var Us={},J1;function Oq(){if(J1)return Us;J1=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.ColorPresentationRequest=Us.DocumentColorRequest=void 0;const t=lt();var e;(function(r){r.method="textDocument/documentColor",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Us.DocumentColorRequest=e={}));var n;return function(r){r.method="textDocument/colorPresentation",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)}(n||(Us.ColorPresentationRequest=n={})),Us}var Ws={},Z1;function Fq(){if(Z1)return Ws;Z1=1,Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.FoldingRangeRefreshRequest=Ws.FoldingRangeRequest=void 0;const t=lt();var e;(function(r){r.method="textDocument/foldingRange",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Ws.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||(Ws.FoldingRangeRefreshRequest=n={})),Ws}var Zc={},Q1;function Lq(){if(Q1)return Zc;Q1=1,Object.defineProperty(Zc,"__esModule",{value:!0}),Zc.DeclarationRequest=void 0;const t=lt();var e;return function(n){n.method="textDocument/declaration",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(Zc.DeclarationRequest=e={})),Zc}var Qc={},ek;function Mq(){if(ek)return Qc;ek=1,Object.defineProperty(Qc,"__esModule",{value:!0}),Qc.SelectionRangeRequest=void 0;const t=lt();var e;return function(n){n.method="textDocument/selectionRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(Qc.SelectionRangeRequest=e={})),Qc}var yi={},tk;function zq(){if(tk)return yi;tk=1,Object.defineProperty(yi,"__esModule",{value:!0}),yi.WorkDoneProgressCancelNotification=yi.WorkDoneProgressCreateRequest=yi.WorkDoneProgress=void 0;const t=Bs(),e=lt();var n;(function(s){s.type=new t.ProgressType;function o(a){return a===s.type}s.is=o})(n||(yi.WorkDoneProgress=n={}));var r;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=e.MessageDirection.serverToClient,s.type=new e.ProtocolRequestType(s.method)})(r||(yi.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||(yi.WorkDoneProgressCancelNotification=i={})),yi}var vi={},nk;function Bq(){if(nk)return vi;nk=1,Object.defineProperty(vi,"__esModule",{value:!0}),vi.CallHierarchyOutgoingCallsRequest=vi.CallHierarchyIncomingCallsRequest=vi.CallHierarchyPrepareRequest=void 0;const t=lt();var e;(function(i){i.method="textDocument/prepareCallHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(vi.CallHierarchyPrepareRequest=e={}));var n;(function(i){i.method="callHierarchy/incomingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(vi.CallHierarchyIncomingCallsRequest=n={}));var r;return function(i){i.method="callHierarchy/outgoingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(vi.CallHierarchyOutgoingCallsRequest=r={})),vi}var un={},rk;function jq(){if(rk)return un;rk=1,Object.defineProperty(un,"__esModule",{value:!0}),un.SemanticTokensRefreshRequest=un.SemanticTokensRangeRequest=un.SemanticTokensDeltaRequest=un.SemanticTokensRequest=un.SemanticTokensRegistrationType=un.TokenFormat=void 0;const t=lt();var e;(function(a){a.Relative="relative"})(e||(un.TokenFormat=e={}));var n;(function(a){a.method="textDocument/semanticTokens",a.type=new t.RegistrationType(a.method)})(n||(un.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||(un.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||(un.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||(un.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||(un.SemanticTokensRefreshRequest=o={})),un}var eu={},ik;function qq(){if(ik)return eu;ik=1,Object.defineProperty(eu,"__esModule",{value:!0}),eu.ShowDocumentRequest=void 0;const t=lt();var e;return function(n){n.method="window/showDocument",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(e||(eu.ShowDocumentRequest=e={})),eu}var tu={},sk;function Uq(){if(sk)return tu;sk=1,Object.defineProperty(tu,"__esModule",{value:!0}),tu.LinkedEditingRangeRequest=void 0;const t=lt();var e;return function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(tu.LinkedEditingRangeRequest=e={})),tu}var Ut={},ok;function Wq(){if(ok)return Ut;ok=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.WillDeleteFilesRequest=Ut.DidDeleteFilesNotification=Ut.DidRenameFilesNotification=Ut.WillRenameFilesRequest=Ut.DidCreateFilesNotification=Ut.WillCreateFilesRequest=Ut.FileOperationPatternKind=void 0;const t=lt();var e;(function(c){c.file="file",c.folder="folder"})(e||(Ut.FileOperationPatternKind=e={}));var n;(function(c){c.method="workspace/willCreateFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(n||(Ut.WillCreateFilesRequest=n={}));var r;(function(c){c.method="workspace/didCreateFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(r||(Ut.DidCreateFilesNotification=r={}));var i;(function(c){c.method="workspace/willRenameFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(i||(Ut.WillRenameFilesRequest=i={}));var s;(function(c){c.method="workspace/didRenameFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(s||(Ut.DidRenameFilesNotification=s={}));var o;(function(c){c.method="workspace/didDeleteFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(o||(Ut.DidDeleteFilesNotification=o={}));var a;return function(c){c.method="workspace/willDeleteFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)}(a||(Ut.WillDeleteFilesRequest=a={})),Ut}var wi={},ak;function Gq(){if(ak)return wi;ak=1,Object.defineProperty(wi,"__esModule",{value:!0}),wi.MonikerRequest=wi.MonikerKind=wi.UniquenessLevel=void 0;const t=lt();var e;(function(i){i.document="document",i.project="project",i.group="group",i.scheme="scheme",i.global="global"})(e||(wi.UniquenessLevel=e={}));var n;(function(i){i.$import="import",i.$export="export",i.local="local"})(n||(wi.MonikerKind=n={}));var r;return function(i){i.method="textDocument/moniker",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(wi.MonikerRequest=r={})),wi}var bi={},ck;function Hq(){if(ck)return bi;ck=1,Object.defineProperty(bi,"__esModule",{value:!0}),bi.TypeHierarchySubtypesRequest=bi.TypeHierarchySupertypesRequest=bi.TypeHierarchyPrepareRequest=void 0;const t=lt();var e;(function(i){i.method="textDocument/prepareTypeHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(bi.TypeHierarchyPrepareRequest=e={}));var n;(function(i){i.method="typeHierarchy/supertypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(bi.TypeHierarchySupertypesRequest=n={}));var r;return function(i){i.method="typeHierarchy/subtypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(bi.TypeHierarchySubtypesRequest=r={})),bi}var Gs={},uk;function Kq(){if(uk)return Gs;uk=1,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.InlineValueRefreshRequest=Gs.InlineValueRequest=void 0;const t=lt();var e;(function(r){r.method="textDocument/inlineValue",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Gs.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||(Gs.InlineValueRefreshRequest=n={})),Gs}var Di={},lk;function Vq(){if(lk)return Di;lk=1,Object.defineProperty(Di,"__esModule",{value:!0}),Di.InlayHintRefreshRequest=Di.InlayHintResolveRequest=Di.InlayHintRequest=void 0;const t=lt();var e;(function(i){i.method="textDocument/inlayHint",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(Di.InlayHintRequest=e={}));var n;(function(i){i.method="inlayHint/resolve",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(Di.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||(Di.InlayHintRefreshRequest=r={})),Di}var Nn={},dk;function Yq(){if(dk)return Nn;dk=1,Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.DiagnosticRefreshRequest=Nn.WorkspaceDiagnosticRequest=Nn.DocumentDiagnosticRequest=Nn.DocumentDiagnosticReportKind=Nn.DiagnosticServerCancellationData=void 0;const t=Bs(),e=qy(),n=lt();var r;(function(c){function u(l){const d=l;return d&&e.boolean(d.retriggerRequest)}c.is=u})(r||(Nn.DiagnosticServerCancellationData=r={}));var i;(function(c){c.Full="full",c.Unchanged="unchanged"})(i||(Nn.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||(Nn.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||(Nn.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||(Nn.DiagnosticRefreshRequest=a={})),Nn}var dt={},fk;function Xq(){if(fk)return dt;fk=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.DidCloseNotebookDocumentNotification=dt.DidSaveNotebookDocumentNotification=dt.DidChangeNotebookDocumentNotification=dt.NotebookCellArrayChange=dt.DidOpenNotebookDocumentNotification=dt.NotebookDocumentSyncRegistrationType=dt.NotebookDocument=dt.NotebookCell=dt.ExecutionSummary=dt.NotebookCellKind=void 0;const t=By(),e=qy(),n=lt();var r;(function(h){h.Markup=1,h.Code=2;function p(m){return m===1||m===2}h.is=p})(r||(dt.NotebookCellKind=r={}));var i;(function(h){function p(v,E){const S={executionOrder:v};return(E===!0||E===!1)&&(S.success=E),S}h.create=p;function m(v){const E=v;return e.objectLiteral(E)&&t.uinteger.is(E.executionOrder)&&(E.success===void 0||e.boolean(E.success))}h.is=m;function w(v,E){return v===E?!0:v==null||E===null||E===void 0?!1:v.executionOrder===E.executionOrder&&v.success===E.success}h.equals=w})(i||(dt.ExecutionSummary=i={}));var s;(function(h){function p(E,S){return{kind:E,document:S}}h.create=p;function m(E){const S=E;return e.objectLiteral(S)&&r.is(S.kind)&&t.DocumentUri.is(S.document)&&(S.metadata===void 0||e.objectLiteral(S.metadata))}h.is=m;function w(E,S){const $=new Set;return E.document!==S.document&&$.add("document"),E.kind!==S.kind&&$.add("kind"),E.executionSummary!==S.executionSummary&&$.add("executionSummary"),(E.metadata!==void 0||S.metadata!==void 0)&&!v(E.metadata,S.metadata)&&$.add("metadata"),(E.executionSummary!==void 0||S.executionSummary!==void 0)&&!i.equals(E.executionSummary,S.executionSummary)&&$.add("executionSummary"),$}h.diff=w;function v(E,S){if(E===S)return!0;if(E==null||S===null||S===void 0||typeof E!=typeof S||typeof E!="object")return!1;const $=Array.isArray(E),I=Array.isArray(S);if($!==I)return!1;if($&&I){if(E.length!==S.length)return!1;for(let N=0;N<E.length;N++)if(!v(E[N],S[N]))return!1}if(e.objectLiteral(E)&&e.objectLiteral(S)){const N=Object.keys(E),A=Object.keys(S);if(N.length!==A.length||(N.sort(),A.sort(),!v(N,A)))return!1;for(let q=0;q<N.length;q++){const W=N[q];if(!v(E[W],S[W]))return!1}}return!0}})(s||(dt.NotebookCell=s={}));var o;(function(h){function p(w,v,E,S){return{uri:w,notebookType:v,version:E,cells:S}}h.create=p;function m(w){const v=w;return e.objectLiteral(v)&&e.string(v.uri)&&t.integer.is(v.version)&&e.typedArray(v.cells,s.is)}h.is=m})(o||(dt.NotebookDocument=o={}));var a;(function(h){h.method="notebookDocument/sync",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.RegistrationType(h.method)})(a||(dt.NotebookDocumentSyncRegistrationType=a={}));var c;(function(h){h.method="notebookDocument/didOpen",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.ProtocolNotificationType(h.method),h.registrationMethod=a.method})(c||(dt.DidOpenNotebookDocumentNotification=c={}));var u;(function(h){function p(w){const v=w;return e.objectLiteral(v)&&t.uinteger.is(v.start)&&t.uinteger.is(v.deleteCount)&&(v.cells===void 0||e.typedArray(v.cells,s.is))}h.is=p;function m(w,v,E){const S={start:w,deleteCount:v};return E!==void 0&&(S.cells=E),S}h.create=m})(u||(dt.NotebookCellArrayChange=u={}));var l;(function(h){h.method="notebookDocument/didChange",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.ProtocolNotificationType(h.method),h.registrationMethod=a.method})(l||(dt.DidChangeNotebookDocumentNotification=l={}));var d;(function(h){h.method="notebookDocument/didSave",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.ProtocolNotificationType(h.method),h.registrationMethod=a.method})(d||(dt.DidSaveNotebookDocumentNotification=d={}));var f;return function(h){h.method="notebookDocument/didClose",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.ProtocolNotificationType(h.method),h.registrationMethod=a.method}(f||(dt.DidCloseNotebookDocumentNotification=f={})),dt}var nu={},hk;function Jq(){if(hk)return nu;hk=1,Object.defineProperty(nu,"__esModule",{value:!0}),nu.InlineCompletionRequest=void 0;const t=lt();var e;return function(n){n.method="textDocument/inlineCompletion",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(nu.InlineCompletionRequest=e={})),nu}var pk;function Zq(){return pk||(pk=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=lt(),n=By(),r=qy(),i=xq();Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const s=Iq();Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return s.TypeDefinitionRequest}});const o=Pq();Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return o.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return o.DidChangeWorkspaceFoldersNotification}});const a=Nq();Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return a.ConfigurationRequest}});const c=Oq();Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return c.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return c.ColorPresentationRequest}});const u=Fq();Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return u.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return u.FoldingRangeRefreshRequest}});const l=Lq();Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return l.DeclarationRequest}});const d=Mq();Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return d.SelectionRangeRequest}});const f=zq();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 h=Bq();Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return h.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return h.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return h.CallHierarchyPrepareRequest}});const p=jq();Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return p.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return p.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return p.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return p.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return p.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return p.SemanticTokensRegistrationType}});const m=qq();Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return m.ShowDocumentRequest}});const w=Uq();Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return w.LinkedEditingRangeRequest}});const v=Wq();Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return v.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return v.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return v.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return v.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return v.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return v.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return v.WillDeleteFilesRequest}});const E=Gq();Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return E.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return E.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return E.MonikerRequest}});const S=Hq();Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return S.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return S.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return S.TypeHierarchySupertypesRequest}});const $=Kq();Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return $.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return $.InlineValueRefreshRequest}});const I=Vq();Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return I.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return I.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return I.InlayHintRefreshRequest}});const N=Yq();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 A=Xq();Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return A.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return A.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return A.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return A.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return A.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return A.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return A.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return A.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return A.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return A.DidCloseNotebookDocumentNotification}});const q=Jq();Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return q.InlineCompletionRequest}});var W;(function(g){function R(y){const _=y;return r.string(_)||r.string(_.language)||r.string(_.scheme)||r.string(_.pattern)}g.is=R})(W||(t.TextDocumentFilter=W={}));var V;(function(g){function R(y){const _=y;return r.objectLiteral(_)&&(r.string(_.notebookType)||r.string(_.scheme)||r.string(_.pattern))}g.is=R})(V||(t.NotebookDocumentFilter=V={}));var x;(function(g){function R(y){const _=y;return r.objectLiteral(_)&&(r.string(_.notebook)||V.is(_.notebook))&&(_.language===void 0||r.string(_.language))}g.is=R})(x||(t.NotebookCellTextDocumentFilter=x={}));var k;(function(g){function R(y){if(!Array.isArray(y))return!1;for(let _ of y)if(!r.string(_)&&!W.is(_)&&!x.is(_))return!1;return!0}g.is=R})(k||(t.DocumentSelector=k={}));var T;(function(g){g.method="client/registerCapability",g.messageDirection=e.MessageDirection.serverToClient,g.type=new e.ProtocolRequestType(g.method)})(T||(t.RegistrationRequest=T={}));var L;(function(g){g.method="client/unregisterCapability",g.messageDirection=e.MessageDirection.serverToClient,g.type=new e.ProtocolRequestType(g.method)})(L||(t.UnregistrationRequest=L={}));var Y;(function(g){g.Create="create",g.Rename="rename",g.Delete="delete"})(Y||(t.ResourceOperationKind=Y={}));var G;(function(g){g.Abort="abort",g.Transactional="transactional",g.TextOnlyTransactional="textOnlyTransactional",g.Undo="undo"})(G||(t.FailureHandlingKind=G={}));var X;(function(g){g.UTF8="utf-8",g.UTF16="utf-16",g.UTF32="utf-32"})(X||(t.PositionEncodingKind=X={}));var _e;(function(g){function R(y){const _=y;return _&&r.string(_.id)&&_.id.length>0}g.hasId=R})(_e||(t.StaticRegistrationOptions=_e={}));var te;(function(g){function R(y){const _=y;return _&&(_.documentSelector===null||k.is(_.documentSelector))}g.is=R})(te||(t.TextDocumentRegistrationOptions=te={}));var U;(function(g){function R(_){const D=_;return r.objectLiteral(D)&&(D.workDoneProgress===void 0||r.boolean(D.workDoneProgress))}g.is=R;function y(_){const D=_;return D&&r.boolean(D.workDoneProgress)}g.hasWorkDoneProgress=y})(U||(t.WorkDoneProgressOptions=U={}));var ye;(function(g){g.method="initialize",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(ye||(t.InitializeRequest=ye={}));var Et;(function(g){g.unknownProtocolVersion=1})(Et||(t.InitializeErrorCodes=Et={}));var Ft;(function(g){g.method="initialized",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolNotificationType(g.method)})(Ft||(t.InitializedNotification=Ft={}));var Ue;(function(g){g.method="shutdown",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType0(g.method)})(Ue||(t.ShutdownRequest=Ue={}));var Gt;(function(g){g.method="exit",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolNotificationType0(g.method)})(Gt||(t.ExitNotification=Gt={}));var ze;(function(g){g.method="workspace/didChangeConfiguration",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolNotificationType(g.method)})(ze||(t.DidChangeConfigurationNotification=ze={}));var Qe;(function(g){g.Error=1,g.Warning=2,g.Info=3,g.Log=4,g.Debug=5})(Qe||(t.MessageType=Qe={}));var ft;(function(g){g.method="window/showMessage",g.messageDirection=e.MessageDirection.serverToClient,g.type=new e.ProtocolNotificationType(g.method)})(ft||(t.ShowMessageNotification=ft={}));var We;(function(g){g.method="window/showMessageRequest",g.messageDirection=e.MessageDirection.serverToClient,g.type=new e.ProtocolRequestType(g.method)})(We||(t.ShowMessageRequest=We={}));var oe;(function(g){g.method="window/logMessage",g.messageDirection=e.MessageDirection.serverToClient,g.type=new e.ProtocolNotificationType(g.method)})(oe||(t.LogMessageNotification=oe={}));var P;(function(g){g.method="telemetry/event",g.messageDirection=e.MessageDirection.serverToClient,g.type=new e.ProtocolNotificationType(g.method)})(P||(t.TelemetryEventNotification=P={}));var j;(function(g){g.None=0,g.Full=1,g.Incremental=2})(j||(t.TextDocumentSyncKind=j={}));var se;(function(g){g.method="textDocument/didOpen",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolNotificationType(g.method)})(se||(t.DidOpenTextDocumentNotification=se={}));var B;(function(g){function R(_){let D=_;return D!=null&&typeof D.text=="string"&&D.range!==void 0&&(D.rangeLength===void 0||typeof D.rangeLength=="number")}g.isIncremental=R;function y(_){let D=_;return D!=null&&typeof D.text=="string"&&D.range===void 0&&D.rangeLength===void 0}g.isFull=y})(B||(t.TextDocumentContentChangeEvent=B={}));var Ne;(function(g){g.method="textDocument/didChange",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolNotificationType(g.method)})(Ne||(t.DidChangeTextDocumentNotification=Ne={}));var _t;(function(g){g.method="textDocument/didClose",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolNotificationType(g.method)})(_t||(t.DidCloseTextDocumentNotification=_t={}));var hn;(function(g){g.method="textDocument/didSave",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolNotificationType(g.method)})(hn||(t.DidSaveTextDocumentNotification=hn={}));var er;(function(g){g.Manual=1,g.AfterDelay=2,g.FocusOut=3})(er||(t.TextDocumentSaveReason=er={}));var tr;(function(g){g.method="textDocument/willSave",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolNotificationType(g.method)})(tr||(t.WillSaveTextDocumentNotification=tr={}));var nr;(function(g){g.method="textDocument/willSaveWaitUntil",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(nr||(t.WillSaveTextDocumentWaitUntilRequest=nr={}));var Lt;(function(g){g.method="workspace/didChangeWatchedFiles",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolNotificationType(g.method)})(Lt||(t.DidChangeWatchedFilesNotification=Lt={}));var $n;(function(g){g.Created=1,g.Changed=2,g.Deleted=3})($n||(t.FileChangeType=$n={}));var Hr;(function(g){function R(y){const _=y;return r.objectLiteral(_)&&(n.URI.is(_.baseUri)||n.WorkspaceFolder.is(_.baseUri))&&r.string(_.pattern)}g.is=R})(Hr||(t.RelativePattern=Hr={}));var Ln;(function(g){g.Create=1,g.Change=2,g.Delete=4})(Ln||(t.WatchKind=Ln={}));var pn;(function(g){g.method="textDocument/publishDiagnostics",g.messageDirection=e.MessageDirection.serverToClient,g.type=new e.ProtocolNotificationType(g.method)})(pn||(t.PublishDiagnosticsNotification=pn={}));var Mn;(function(g){g.Invoked=1,g.TriggerCharacter=2,g.TriggerForIncompleteCompletions=3})(Mn||(t.CompletionTriggerKind=Mn={}));var Qt;(function(g){g.method="textDocument/completion",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(Qt||(t.CompletionRequest=Qt={}));var H;(function(g){g.method="completionItem/resolve",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(H||(t.CompletionResolveRequest=H={}));var K;(function(g){g.method="textDocument/hover",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(K||(t.HoverRequest=K={}));var re;(function(g){g.Invoked=1,g.TriggerCharacter=2,g.ContentChange=3})(re||(t.SignatureHelpTriggerKind=re={}));var Mt;(function(g){g.method="textDocument/signatureHelp",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(Mt||(t.SignatureHelpRequest=Mt={}));var Pt;(function(g){g.method="textDocument/definition",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(Pt||(t.DefinitionRequest=Pt={}));var br;(function(g){g.method="textDocument/references",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(br||(t.ReferencesRequest=br={}));var Ri;(function(g){g.method="textDocument/documentHighlight",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(Ri||(t.DocumentHighlightRequest=Ri={}));var os;(function(g){g.method="textDocument/documentSymbol",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(os||(t.DocumentSymbolRequest=os={}));var as;(function(g){g.method="textDocument/codeAction",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(as||(t.CodeActionRequest=as={}));var cs;(function(g){g.method="codeAction/resolve",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(cs||(t.CodeActionResolveRequest=cs={}));var us;(function(g){g.method="workspace/symbol",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(us||(t.WorkspaceSymbolRequest=us={}));var Si;(function(g){g.method="workspaceSymbol/resolve",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(Si||(t.WorkspaceSymbolResolveRequest=Si={}));var ki;(function(g){g.method="textDocument/codeLens",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(ki||(t.CodeLensRequest=ki={}));var gn;(function(g){g.method="codeLens/resolve",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(gn||(t.CodeLensResolveRequest=gn={}));var ls;(function(g){g.method="workspace/codeLens/refresh",g.messageDirection=e.MessageDirection.serverToClient,g.type=new e.ProtocolRequestType0(g.method)})(ls||(t.CodeLensRefreshRequest=ls={}));var ds;(function(g){g.method="textDocument/documentLink",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(ds||(t.DocumentLinkRequest=ds={}));var Dr;(function(g){g.method="documentLink/resolve",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(Dr||(t.DocumentLinkResolveRequest=Dr={}));var fs;(function(g){g.method="textDocument/formatting",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(fs||(t.DocumentFormattingRequest=fs={}));var Kr;(function(g){g.method="textDocument/rangeFormatting",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(Kr||(t.DocumentRangeFormattingRequest=Kr={}));var hs;(function(g){g.method="textDocument/rangesFormatting",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(hs||(t.DocumentRangesFormattingRequest=hs={}));var zn;(function(g){g.method="textDocument/onTypeFormatting",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(zn||(t.DocumentOnTypeFormattingRequest=zn={}));var rr;(function(g){g.Identifier=1})(rr||(t.PrepareSupportDefaultBehavior=rr={}));var go;(function(g){g.method="textDocument/rename",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(go||(t.RenameRequest=go={}));var O;(function(g){g.method="textDocument/prepareRename",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(O||(t.PrepareRenameRequest=O={}));var b;(function(g){g.method="workspace/executeCommand",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(b||(t.ExecuteCommandRequest=b={}));var C;(function(g){g.method="workspace/applyEdit",g.messageDirection=e.MessageDirection.serverToClient,g.type=new e.ProtocolRequestType("workspace/applyEdit")})(C||(t.ApplyWorkspaceEditRequest=C={}))}(jy)),jy}var ru={},gk;function Qq(){if(gk)return ru;gk=1,Object.defineProperty(ru,"__esModule",{value:!0}),ru.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 ru.createProtocolConnection=e,ru}var mk;function e9(){return mk||(mk=1,function(t){var e=js&&js.__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=js&&js.__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(By(),t),n(lt(),t),n(Zq(),t);var r=Qq();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={}))}(js)),js}var yk;function bt(){return yk||(yk=1,function(t){var e=Ls&&Ls.__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=Ls&&Ls.__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=q1();n(q1(),t),n(e9(),t);function i(s,o,a,c){return(0,r.createMessageConnection)(s,o,a,c)}t.createProtocolConnection=i}(Ls)),Ls}var On={},vk;function wk(){if(vk)return On;vk=1,Object.defineProperty(On,"__esModule",{value:!0}),On.generateUuid=On.parse=On.isUUID=On.v4=On.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"],On.empty=new t("00000000-0000-0000-0000-000000000000");function n(){return new e}On.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)}On.isUUID=i;function s(a){if(!i(a))throw new Error("invalid uuid");return new t(a)}On.parse=s;function o(){return n().asHex()}return On.generateUuid=o,On}var Ei={},bk;function t9(){if(bk)return Ei;bk=1,Object.defineProperty(Ei,"__esModule",{value:!0}),Ei.attachPartialResult=Ei.ProgressFeature=Ei.attachWorkDone=void 0;const t=bt(),e=wk();class n{constructor(f,h){this._connection=f,this._token=h,n.Instances.set(this._token,this)}begin(f,h,p,m){let w={kind:"begin",title:f,percentage:h,message:p,cancellable:m};this._connection.sendProgress(t.WorkDoneProgress.type,this._token,w)}report(f,h){let p={kind:"report"};typeof f=="number"?(p.percentage=f,h!==void 0&&(p.message=h)):p.message=f,this._connection.sendProgress(t.WorkDoneProgress.type,this._token,p)}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,h){super(f,h),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 h=f.workDoneToken;return delete f.workDoneToken,new n(d,h)}Ei.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,h=>{let p=n.Instances.get(h.token);(p instanceof r||p instanceof s)&&p.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)}};Ei.ProgressFeature=a;var c;(function(d){d.type=new t.ProgressType})(c||(c={}));class u{constructor(f,h){this._connection=f,this._token=h}report(f){this._connection.sendProgress(c.type,this._token,f)}}function l(d,f){if(f===void 0||f.partialResultToken===void 0)return;const h=f.partialResultToken;return delete f.partialResultToken,new u(d,h)}return Ei.attachPartialResult=l,Ei}var iu={},Dk;function n9(){if(Dk)return iu;Dk=1,Object.defineProperty(iu,"__esModule",{value:!0}),iu.ConfigurationFeature=void 0;const t=bt(),e=Oy(),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 iu.ConfigurationFeature=n,iu}var su={},Ek;function r9(){if(Ek)return su;Ek=1,Object.defineProperty(su,"__esModule",{value:!0}),su.WorkspaceFoldersFeature=void 0;const t=bt(),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 su.WorkspaceFoldersFeature=e,su}var ou={},Tk;function i9(){if(Tk)return ou;Tk=1,Object.defineProperty(ou,"__esModule",{value:!0}),ou.CallHierarchyFeature=void 0;const t=bt(),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 ou.CallHierarchyFeature=e,ou}var Ti={},Rk;function Sk(){if(Rk)return Ti;Rk=1,Object.defineProperty(Ti,"__esModule",{value:!0}),Ti.SemanticTokensBuilder=Ti.SemanticTokensDiff=Ti.SemanticTokensFeature=void 0;const t=bt(),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)))}}}};Ti.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}]:[]}}Ti.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 Ti.SemanticTokensBuilder=r,Ti}var au={},kk;function s9(){if(kk)return au;kk=1,Object.defineProperty(au,"__esModule",{value:!0}),au.ShowDocumentFeature=void 0;const t=bt(),e=n=>class extends n{showDocument(r){return this.connection.sendRequest(t.ShowDocumentRequest.type,r)}};return au.ShowDocumentFeature=e,au}var cu={},$k;function o9(){if($k)return cu;$k=1,Object.defineProperty(cu,"__esModule",{value:!0}),cu.FileOperationsFeature=void 0;const t=bt(),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 cu.FileOperationsFeature=e,cu}var uu={},Ck;function a9(){if(Ck)return uu;Ck=1,Object.defineProperty(uu,"__esModule",{value:!0}),uu.LinkedEditingRangeFeature=void 0;const t=bt(),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 uu.LinkedEditingRangeFeature=e,uu}var lu={},_k;function c9(){if(_k)return lu;_k=1,Object.defineProperty(lu,"__esModule",{value:!0}),lu.TypeHierarchyFeature=void 0;const t=bt(),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 lu.TypeHierarchyFeature=e,lu}var du={},Ak;function u9(){if(Ak)return du;Ak=1,Object.defineProperty(du,"__esModule",{value:!0}),du.InlineValueFeature=void 0;const t=bt(),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 du.InlineValueFeature=e,du}var fu={},xk;function l9(){if(xk)return fu;xk=1,Object.defineProperty(fu,"__esModule",{value:!0}),fu.FoldingRangeFeature=void 0;const t=bt(),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 fu.FoldingRangeFeature=e,fu}var hu={},Ik;function d9(){if(Ik)return hu;Ik=1,Object.defineProperty(hu,"__esModule",{value:!0}),hu.InlayHintFeature=void 0;const t=bt(),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 hu.InlayHintFeature=e,hu}var pu={},Pk;function f9(){if(Pk)return pu;Pk=1,Object.defineProperty(pu,"__esModule",{value:!0}),pu.DiagnosticFeature=void 0;const t=bt(),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 pu.DiagnosticFeature=e,pu}var Hs={},gu={},Nk;function Ok(){if(Nk)return gu;Nk=1,Object.defineProperty(gu,"__esModule",{value:!0}),gu.TextDocuments=void 0;const t=bt();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 gu.TextDocuments=e,gu}var Fk;function Lk(){if(Fk)return Hs;Fk=1,Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.NotebookDocuments=Hs.NotebookSyncFeature=void 0;const t=bt(),e=Ok(),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)})}}};Hs.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 h=u.change;h.metadata!==void 0&&(f=!0,l.metadata=h.metadata);const p=[],m=[],w=[],v=[];if(h.cells!==void 0){const N=h.cells;if(N.structure!==void 0){const A=N.structure.array;if(l.cells.splice(A.start,A.deleteCount,...A.cells!==void 0?A.cells:[]),N.structure.didOpen!==void 0)for(const q of N.structure.didOpen)a.openTextDocument({textDocument:q}),p.push(q.uri);if(N.structure.didClose)for(const q of N.structure.didClose)a.closeTextDocument({textDocument:q}),m.push(q.uri)}if(N.data!==void 0){const A=new Map(N.data.map(q=>[q.document,q]));for(let q=0;q<=l.cells.length;q++){const W=A.get(l.cells[q].document);if(W!==void 0){const V=l.cells.splice(q,1,W);if(w.push({old:V[0],new:W}),A.delete(W.document),A.size===0)break}}}if(N.textContent!==void 0)for(const A of N.textContent)a.changeTextDocument({textDocument:A.document,contentChanges:A.changes}),v.push(A.document.uri)}this.updateCellMap(l);const E={notebookDocument:l};f&&(E.metadata={old:d,new:l.metadata});const S=[];for(const N of p)S.push(this.getNotebookCell(N));const $=[];for(const N of m)$.push(this.getNotebookCell(N));const I=[];for(const N of v)I.push(this.getNotebookCell(N));(S.length>0||$.length>0||w.length>0||I.length>0)&&(E.cells={added:S,removed:$,changed:{data:w,textContent:I}}),(E.metadata!==void 0||E.cells!==void 0)&&this._onDidChange.fire(E)})),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 Hs.NotebookDocuments=i,Hs}var mu={},Mk;function h9(){if(Mk)return mu;Mk=1,Object.defineProperty(mu,"__esModule",{value:!0}),mu.MonikerFeature=void 0;const t=bt(),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 mu.MonikerFeature=e,mu}var zk;function Bk(){if(zk)return Pe;zk=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.createConnection=Pe.combineFeatures=Pe.combineNotebooksFeatures=Pe.combineLanguagesFeatures=Pe.combineWorkspaceFeatures=Pe.combineWindowFeatures=Pe.combineClientFeatures=Pe.combineTracerFeatures=Pe.combineTelemetryFeatures=Pe.combineConsoleFeatures=Pe._NotebooksImpl=Pe._LanguagesImpl=Pe.BulkUnregistration=Pe.BulkRegistration=Pe.ErrorMessageTracker=void 0;const t=bt(),e=Oy(),n=wk(),r=t9(),i=n9(),s=r9(),o=i9(),a=Sk(),c=s9(),u=o9(),l=a9(),d=c9(),f=u9(),h=l9(),p=d9(),m=f9(),w=Lk(),v=h9();function E(oe){if(oe!==null)return oe}class S{constructor(){this._messages=Object.create(null)}add(P){let j=this._messages[P];j||(j=0),j++,this._messages[P]=j}sendErrors(P){Object.keys(this._messages).forEach(j=>{P.window.showErrorMessage(j)})}}Pe.ErrorMessageTracker=S;class ${constructor(){}rawAttach(P){this._rawConnection=P}attach(P){this._connection=P}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(P){}initialize(P){}error(P){this.send(t.MessageType.Error,P)}warn(P){this.send(t.MessageType.Warning,P)}info(P){this.send(t.MessageType.Info,P)}log(P){this.send(t.MessageType.Log,P)}debug(P){this.send(t.MessageType.Debug,P)}send(P,j){this._rawConnection&&this._rawConnection.sendNotification(t.LogMessageNotification.type,{type:P,message:j}).catch(()=>{(0,t.RAL)().console.error("Sending log message failed")})}}class I{constructor(){}attach(P){this._connection=P}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(P){}fillServerCapabilities(P){}showErrorMessage(P,...j){let se={type:t.MessageType.Error,message:P,actions:j};return this.connection.sendRequest(t.ShowMessageRequest.type,se).then(E)}showWarningMessage(P,...j){let se={type:t.MessageType.Warning,message:P,actions:j};return this.connection.sendRequest(t.ShowMessageRequest.type,se).then(E)}showInformationMessage(P,...j){let se={type:t.MessageType.Info,message:P,actions:j};return this.connection.sendRequest(t.ShowMessageRequest.type,se).then(E)}}const N=(0,c.ShowDocumentFeature)((0,r.ProgressFeature)(I));var A;(function(oe){function P(){return new q}oe.create=P})(A||(Pe.BulkRegistration=A={}));class q{constructor(){this._registrations=[],this._registered=new Set}add(P,j){const se=e.string(P)?P:P.method;if(this._registered.has(se))throw new Error(`${se} is already added to this registration`);const B=n.generateUuid();this._registrations.push({id:B,method:se,registerOptions:j||{}}),this._registered.add(se)}asRegistrationParams(){return{registrations:this._registrations}}}var W;(function(oe){function P(){return new V(void 0,[])}oe.create=P})(W||(Pe.BulkUnregistration=W={}));class V{constructor(P,j){this._connection=P,this._unregistrations=new Map,j.forEach(se=>{this._unregistrations.set(se.method,se)})}get isAttached(){return!!this._connection}attach(P){this._connection=P}add(P){this._unregistrations.set(P.method,P)}dispose(){let P=[];for(let se of this._unregistrations.values())P.push(se);let j={unregisterations:P};this._connection.sendRequest(t.UnregistrationRequest.type,j).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(P){const j=e.string(P)?P:P.method,se=this._unregistrations.get(j);if(!se)return!1;let B={unregisterations:[se]};return this._connection.sendRequest(t.UnregistrationRequest.type,B).then(()=>{this._unregistrations.delete(j)},Ne=>{this._connection.console.info(`Un-registering request handler for ${se.id} failed.`)}),!0}}class x{attach(P){this._connection=P}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(P){}fillServerCapabilities(P){}register(P,j,se){return P instanceof q?this.registerMany(P):P instanceof V?this.registerSingle1(P,j,se):this.registerSingle2(P,j)}registerSingle1(P,j,se){const B=e.string(j)?j:j.method,Ne=n.generateUuid();let _t={registrations:[{id:Ne,method:B,registerOptions:se||{}}]};return P.isAttached||P.attach(this.connection),this.connection.sendRequest(t.RegistrationRequest.type,_t).then(hn=>(P.add({id:Ne,method:B}),P),hn=>(this.connection.console.info(`Registering request handler for ${B} failed.`),Promise.reject(hn)))}registerSingle2(P,j){const se=e.string(P)?P:P.method,B=n.generateUuid();let Ne={registrations:[{id:B,method:se,registerOptions:j||{}}]};return this.connection.sendRequest(t.RegistrationRequest.type,Ne).then(_t=>t.Disposable.create(()=>{this.unregisterSingle(B,se).catch(()=>{this.connection.console.info(`Un-registering capability with id ${B} failed.`)})}),_t=>(this.connection.console.info(`Registering request handler for ${se} failed.`),Promise.reject(_t)))}unregisterSingle(P,j){let se={unregisterations:[{id:P,method:j}]};return this.connection.sendRequest(t.UnregistrationRequest.type,se).catch(()=>{this.connection.console.info(`Un-registering request handler for ${P} failed.`)})}registerMany(P){let j=P.asRegistrationParams();return this.connection.sendRequest(t.RegistrationRequest.type,j).then(()=>new V(this._connection,j.registrations.map(se=>({id:se.id,method:se.method}))),se=>(this.connection.console.info("Bulk registration failed."),Promise.reject(se)))}}class k{constructor(){}attach(P){this._connection=P}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(P){}fillServerCapabilities(P){}applyEdit(P){function j(B){return B&&!!B.edit}let se=j(P)?P:{edit:P};return this.connection.sendRequest(t.ApplyWorkspaceEditRequest.type,se)}}const T=(0,u.FileOperationsFeature)((0,s.WorkspaceFoldersFeature)((0,i.ConfigurationFeature)(k)));class L{constructor(){this._trace=t.Trace.Off}attach(P){this._connection=P}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(P){}fillServerCapabilities(P){}set trace(P){this._trace=P}log(P,j){this._trace!==t.Trace.Off&&this.connection.sendNotification(t.LogTraceNotification.type,{message:P,verbose:this._trace===t.Trace.Verbose?j:void 0}).catch(()=>{})}}class Y{constructor(){}attach(P){this._connection=P}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(P){}fillServerCapabilities(P){}logEvent(P){this.connection.sendNotification(t.TelemetryEventNotification.type,P).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}}class G{constructor(){}attach(P){this._connection=P}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(P){}fillServerCapabilities(P){}attachWorkDoneProgress(P){return(0,r.attachWorkDone)(this.connection,P)}attachPartialResultProgress(P,j){return(0,r.attachPartialResult)(this.connection,j)}}Pe._LanguagesImpl=G;const X=(0,h.FoldingRangeFeature)((0,v.MonikerFeature)((0,m.DiagnosticFeature)((0,p.InlayHintFeature)((0,f.InlineValueFeature)((0,d.TypeHierarchyFeature)((0,l.LinkedEditingRangeFeature)((0,a.SemanticTokensFeature)((0,o.CallHierarchyFeature)(G)))))))));class _e{constructor(){}attach(P){this._connection=P}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(P){}fillServerCapabilities(P){}attachWorkDoneProgress(P){return(0,r.attachWorkDone)(this.connection,P)}attachPartialResultProgress(P,j){return(0,r.attachPartialResult)(this.connection,j)}}Pe._NotebooksImpl=_e;const te=(0,w.NotebookSyncFeature)(_e);function U(oe,P){return function(j){return P(oe(j))}}Pe.combineConsoleFeatures=U;function ye(oe,P){return function(j){return P(oe(j))}}Pe.combineTelemetryFeatures=ye;function Et(oe,P){return function(j){return P(oe(j))}}Pe.combineTracerFeatures=Et;function Ft(oe,P){return function(j){return P(oe(j))}}Pe.combineClientFeatures=Ft;function Ue(oe,P){return function(j){return P(oe(j))}}Pe.combineWindowFeatures=Ue;function Gt(oe,P){return function(j){return P(oe(j))}}Pe.combineWorkspaceFeatures=Gt;function ze(oe,P){return function(j){return P(oe(j))}}Pe.combineLanguagesFeatures=ze;function Qe(oe,P){return function(j){return P(oe(j))}}Pe.combineNotebooksFeatures=Qe;function ft(oe,P){function j(B,Ne,_t){return B&&Ne?_t(B,Ne):B||Ne}return{__brand:"features",console:j(oe.console,P.console,U),tracer:j(oe.tracer,P.tracer,Et),telemetry:j(oe.telemetry,P.telemetry,ye),client:j(oe.client,P.client,Ft),window:j(oe.window,P.window,Ue),workspace:j(oe.workspace,P.workspace,Gt),languages:j(oe.languages,P.languages,ze),notebooks:j(oe.notebooks,P.notebooks,Qe)}}Pe.combineFeatures=ft;function We(oe,P,j){const se=j&&j.console?new(j.console($)):new $,B=oe(se);se.rawAttach(B);const Ne=j&&j.tracer?new(j.tracer(L)):new L,_t=j&&j.telemetry?new(j.telemetry(Y)):new Y,hn=j&&j.client?new(j.client(x)):new x,er=j&&j.window?new(j.window(N)):new N,tr=j&&j.workspace?new(j.workspace(T)):new T,nr=j&&j.languages?new(j.languages(X)):new X,Lt=j&&j.notebooks?new(j.notebooks(te)):new te,$n=[se,Ne,_t,hn,er,tr,nr,Lt];function Hr(H){return H instanceof Promise?H:e.thenable(H)?new Promise((K,re)=>{H.then(Mt=>K(Mt),Mt=>re(Mt))}):Promise.resolve(H)}let Ln,pn,Mn,Qt={listen:()=>B.listen(),sendRequest:(H,...K)=>B.sendRequest(e.string(H)?H:H.method,...K),onRequest:(H,K)=>B.onRequest(H,K),sendNotification:(H,K)=>{const re=e.string(H)?H:H.method;return B.sendNotification(re,K)},onNotification:(H,K)=>B.onNotification(H,K),onProgress:B.onProgress,sendProgress:B.sendProgress,onInitialize:H=>(pn=H,{dispose:()=>{pn=void 0}}),onInitialized:H=>B.onNotification(t.InitializedNotification.type,H),onShutdown:H=>(Ln=H,{dispose:()=>{Ln=void 0}}),onExit:H=>(Mn=H,{dispose:()=>{Mn=void 0}}),get console(){return se},get telemetry(){return _t},get tracer(){return Ne},get client(){return hn},get window(){return er},get workspace(){return tr},get languages(){return nr},get notebooks(){return Lt},onDidChangeConfiguration:H=>B.onNotification(t.DidChangeConfigurationNotification.type,H),onDidChangeWatchedFiles:H=>B.onNotification(t.DidChangeWatchedFilesNotification.type,H),__textDocumentSync:void 0,onDidOpenTextDocument:H=>B.onNotification(t.DidOpenTextDocumentNotification.type,H),onDidChangeTextDocument:H=>B.onNotification(t.DidChangeTextDocumentNotification.type,H),onDidCloseTextDocument:H=>B.onNotification(t.DidCloseTextDocumentNotification.type,H),onWillSaveTextDocument:H=>B.onNotification(t.WillSaveTextDocumentNotification.type,H),onWillSaveTextDocumentWaitUntil:H=>B.onRequest(t.WillSaveTextDocumentWaitUntilRequest.type,H),onDidSaveTextDocument:H=>B.onNotification(t.DidSaveTextDocumentNotification.type,H),sendDiagnostics:H=>B.sendNotification(t.PublishDiagnosticsNotification.type,H),onHover:H=>B.onRequest(t.HoverRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),void 0)),onCompletion:H=>B.onRequest(t.CompletionRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),(0,r.attachPartialResult)(B,K))),onCompletionResolve:H=>B.onRequest(t.CompletionResolveRequest.type,H),onSignatureHelp:H=>B.onRequest(t.SignatureHelpRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),void 0)),onDeclaration:H=>B.onRequest(t.DeclarationRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),(0,r.attachPartialResult)(B,K))),onDefinition:H=>B.onRequest(t.DefinitionRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),(0,r.attachPartialResult)(B,K))),onTypeDefinition:H=>B.onRequest(t.TypeDefinitionRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),(0,r.attachPartialResult)(B,K))),onImplementation:H=>B.onRequest(t.ImplementationRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),(0,r.attachPartialResult)(B,K))),onReferences:H=>B.onRequest(t.ReferencesRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),(0,r.attachPartialResult)(B,K))),onDocumentHighlight:H=>B.onRequest(t.DocumentHighlightRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),(0,r.attachPartialResult)(B,K))),onDocumentSymbol:H=>B.onRequest(t.DocumentSymbolRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),(0,r.attachPartialResult)(B,K))),onWorkspaceSymbol:H=>B.onRequest(t.WorkspaceSymbolRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),(0,r.attachPartialResult)(B,K))),onWorkspaceSymbolResolve:H=>B.onRequest(t.WorkspaceSymbolResolveRequest.type,H),onCodeAction:H=>B.onRequest(t.CodeActionRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),(0,r.attachPartialResult)(B,K))),onCodeActionResolve:H=>B.onRequest(t.CodeActionResolveRequest.type,(K,re)=>H(K,re)),onCodeLens:H=>B.onRequest(t.CodeLensRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),(0,r.attachPartialResult)(B,K))),onCodeLensResolve:H=>B.onRequest(t.CodeLensResolveRequest.type,(K,re)=>H(K,re)),onDocumentFormatting:H=>B.onRequest(t.DocumentFormattingRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),void 0)),onDocumentRangeFormatting:H=>B.onRequest(t.DocumentRangeFormattingRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),void 0)),onDocumentOnTypeFormatting:H=>B.onRequest(t.DocumentOnTypeFormattingRequest.type,(K,re)=>H(K,re)),onRenameRequest:H=>B.onRequest(t.RenameRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),void 0)),onPrepareRename:H=>B.onRequest(t.PrepareRenameRequest.type,(K,re)=>H(K,re)),onDocumentLinks:H=>B.onRequest(t.DocumentLinkRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),(0,r.attachPartialResult)(B,K))),onDocumentLinkResolve:H=>B.onRequest(t.DocumentLinkResolveRequest.type,(K,re)=>H(K,re)),onDocumentColor:H=>B.onRequest(t.DocumentColorRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),(0,r.attachPartialResult)(B,K))),onColorPresentation:H=>B.onRequest(t.ColorPresentationRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),(0,r.attachPartialResult)(B,K))),onFoldingRanges:H=>B.onRequest(t.FoldingRangeRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),(0,r.attachPartialResult)(B,K))),onSelectionRanges:H=>B.onRequest(t.SelectionRangeRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),(0,r.attachPartialResult)(B,K))),onExecuteCommand:H=>B.onRequest(t.ExecuteCommandRequest.type,(K,re)=>H(K,re,(0,r.attachWorkDone)(B,K),void 0)),dispose:()=>B.dispose()};for(let H of $n)H.attach(Qt);return B.onRequest(t.InitializeRequest.type,H=>{P.initialize(H),e.string(H.trace)&&(Ne.trace=t.Trace.fromString(H.trace));for(let K of $n)K.initialize(H.capabilities);if(pn){let K=pn(H,new t.CancellationTokenSource().token,(0,r.attachWorkDone)(B,H),void 0);return Hr(K).then(re=>{if(re instanceof t.ResponseError)return re;let Mt=re;Mt||(Mt={capabilities:{}});let Pt=Mt.capabilities;Pt||(Pt={},Mt.capabilities=Pt),Pt.textDocumentSync===void 0||Pt.textDocumentSync===null?Pt.textDocumentSync=e.number(Qt.__textDocumentSync)?Qt.__textDocumentSync:t.TextDocumentSyncKind.None:!e.number(Pt.textDocumentSync)&&!e.number(Pt.textDocumentSync.change)&&(Pt.textDocumentSync.change=e.number(Qt.__textDocumentSync)?Qt.__textDocumentSync:t.TextDocumentSyncKind.None);for(let br of $n)br.fillServerCapabilities(Pt);return Mt})}else{let K={capabilities:{textDocumentSync:t.TextDocumentSyncKind.None}};for(let re of $n)re.fillServerCapabilities(K.capabilities);return K}}),B.onRequest(t.ShutdownRequest.type,()=>{if(P.shutdownReceived=!0,Ln)return Ln(new t.CancellationTokenSource().token)}),B.onNotification(t.ExitNotification.type,()=>{try{Mn&&Mn()}finally{P.shutdownReceived?P.exit(0):P.exit(1)}}),B.onNotification(t.SetTraceNotification.type,H=>{Ne.trace=t.Trace.fromString(H.value)}),Qt}return Pe.createConnection=We,Pe}var ln={};const p9=si(XP),Kf=si(zP),jk=si(LP);var qk;function g9(){if(qk)return ln;qk=1,Object.defineProperty(ln,"__esModule",{value:!0}),ln.resolveModulePath=ln.FileSystem=ln.resolveGlobalYarnPath=ln.resolveGlobalNodePath=ln.resolve=ln.uriToFilePath=void 0;const t=p9,e=Vc,n=Kf,r=jk;function i(d){let f=t.parse(d);if(f.protocol!=="file:"||!f.path)return;let h=f.path.split("/");for(var p=0,m=h.length;p<m;p++)h[p]=decodeURIComponent(h[p]);if(process.platform==="win32"&&h.length>1){let w=h[0],v=h[1];w.length===0&&v.length>1&&v[1]===":"&&h.shift()}return e.normalize(h.join("/"))}ln.uriToFilePath=i;function s(){return process.platform==="win32"}function o(d,f,h,p){const m="NODE_PATH",w=["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((v,E)=>{let S=process.env,$=Object.create(null);Object.keys(S).forEach(I=>$[I]=S[I]),f&&n.existsSync(f)&&($[m]?$[m]=f+e.delimiter+$[m]:$[m]=f,p&&p(`NODE_PATH value is: ${$[m]}`)),$.ELECTRON_RUN_AS_NODE="1";try{let I=(0,r.fork)("",[],{cwd:h,env:$,execArgv:["-e",w]});if(I.pid===void 0){E(new Error(`Starting process to resolve node module ${d} failed`));return}I.on("error",A=>{E(A)}),I.on("message",A=>{A.c==="r"&&(I.send({c:"e"}),A.s?v(A.r):E(new Error(`Failed to resolve module: ${d}`)))});let N={c:"rs",a:d};I.send(N)}catch(I){E(I)}})}ln.resolve=o;function a(d){let f="npm";const h=Object.create(null);Object.keys(process.env).forEach(w=>h[w]=process.env[w]),h.NO_UPDATE_NOTIFIER="true";const p={encoding:"utf8",env:h};s()&&(f="npm.cmd",p.shell=!0);let m=()=>{};try{process.on("SIGPIPE",m);let w=(0,r.spawnSync)(f,["config","get","prefix"],p).stdout;if(!w){d&&d("'npm config get prefix' didn't return a value.");return}let v=w.trim();return d&&d(`'npm config get prefix' value is: ${v}`),v.length>0?s()?e.join(v,"node_modules"):e.join(v,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",m)}}ln.resolveGlobalNodePath=a;function c(d){let f="yarn",h={encoding:"utf8"};s()&&(f="yarn.cmd",h.shell=!0);let p=()=>{};try{process.on("SIGPIPE",p);let m=(0,r.spawnSync)(f,["global","dir","--json"],h),w=m.stdout;if(!w){d&&(d("'yarn global dir' didn't return a value."),m.stderr&&d(m.stderr));return}let v=w.trim().split(/\r?\n/);for(let E of v)try{let S=JSON.parse(E);if(S.type==="log")return e.join(S.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",p)}}ln.resolveGlobalYarnPath=c;var u;(function(d){let f;function h(){return f!==void 0||(process.platform==="win32"?f=!1:f=!n.existsSync(__filename.toUpperCase())||!n.existsSync(__filename.toLowerCase())),f}d.isCaseSensitive=h;function p(m,w){return h()?e.normalize(w).indexOf(e.normalize(m))===0:e.normalize(w).toLowerCase().indexOf(e.normalize(m).toLowerCase())===0}d.isParent=p})(u||(ln.FileSystem=u={}));function l(d,f,h,p){return h?(e.isAbsolute(h)||(h=e.join(d,h)),o(f,h,h,p).then(m=>u.isParent(h,m)?m:Promise.reject(new Error(`Failed to load ${f} from node path location.`))).then(void 0,m=>o(f,a(p),d,p))):o(f,a(p),d,p)}return ln.resolveModulePath=l,ln}var Uy,Uk;function Wk(){return Uk||(Uk=1,Uy=bt()),Uy}var Ks={},yu={},Gk;function m9(){if(Gk)return yu;Gk=1,Object.defineProperty(yu,"__esModule",{value:!0}),yu.InlineCompletionFeature=void 0;const t=bt(),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 yu.InlineCompletionFeature=e,yu}var Hk;function y9(){return Hk||(Hk=1,function(t){var e=Ks&&Ks.__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=Ks&&Ks.__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=Sk();Object.defineProperty(t,"SemanticTokensBuilder",{enumerable:!0,get:function(){return r.SemanticTokensBuilder}});const i=m9();n(bt(),t);const s=Ok();Object.defineProperty(t,"TextDocuments",{enumerable:!0,get:function(){return s.TextDocuments}});const o=Lk();Object.defineProperty(t,"NotebookDocuments",{enumerable:!0,get:function(){return o.NotebookDocuments}}),n(Bk(),t);var a;(function(c){c.all={__brand:"features",languages:i.InlineCompletionFeature}})(a||(t.ProposedFeatures=a={}))}(Ks)),Ks}var Kk;function v9(){return Kk||(Kk=1,function(t){var e=Fs&&Fs.__createBinding||(Object.create?function(v,E,S,$){$===void 0&&($=S);var I=Object.getOwnPropertyDescriptor(E,S);(!I||("get"in I?!E.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return E[S]}}),Object.defineProperty(v,$,I)}:function(v,E,S,$){$===void 0&&($=S),v[$]=E[S]}),n=Fs&&Fs.__exportStar||function(v,E){for(var S in v)S!=="default"&&!Object.prototype.hasOwnProperty.call(E,S)&&e(E,v,S)};Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.Files=void 0;const r=bq,i=Oy(),s=Bk(),o=g9(),a=Wk();n(Wk(),t),n(y9(),t);var c;(function(v){v.uriToFilePath=o.uriToFilePath,v.resolveGlobalNodePath=o.resolveGlobalNodePath,v.resolveGlobalYarnPath=o.resolveGlobalYarnPath,v.resolve=o.resolve,v.resolveModulePath=o.resolveModulePath})(c||(t.Files=c={}));function u(){}let l=!1,d;function f(){const v="--clientProcessId";function E(S){try{let $=parseInt(S);isNaN($)||(d=setInterval(()=>{try{process.kill($,0)}catch{process.exit(l?0:1)}},3e3))}catch{}}for(let S=2;S<process.argv.length;S++){let $=process.argv[S];if($===v&&S+1<process.argv.length){E(process.argv[S+1]);return}else{let I=$.split("=");I[0]===v&&E(I[1])}}}f();const h={initialize:v=>{const E=v.processId;i.number(E)&&d===void 0&&setInterval(()=>{try{process.kill(E,0)}catch{process.exit(l?0:1)}},3e3)},get shutdownReceived(){return l},set shutdownReceived(v){l=v},exit:v=>{process.exit(v)}};function p(v,E,S,$){let I,N,A,q;return v!==void 0&&v.__brand==="features"&&(I=v,v=E,E=S,S=$),a.ConnectionStrategy.is(v)||a.ConnectionOptions.is(v)?q=v:(N=v,A=E,q=S),m(N,A,q,I)}t.createConnection=p;function m(v,E,S,$){let I=!1;if(!v&&!E&&process.argv.length>2){let W,V,x=process.argv.slice(2);for(let k=0;k<x.length;k++){let T=x[k];if(T==="--node-ipc"){v=new a.IPCMessageReader(process),E=new a.IPCMessageWriter(process);break}else if(T==="--stdio"){I=!0,v=process.stdin,E=process.stdout;break}else if(T==="--socket"){W=parseInt(x[k+1]);break}else if(T==="--pipe"){V=x[k+1];break}else{var N=T.split("=");if(N[0]==="--socket"){W=parseInt(N[1]);break}else if(N[0]==="--pipe"){V=N[1];break}}}if(W){let k=(0,a.createServerSocketTransport)(W);v=k[0],E=k[1]}else if(V){let k=(0,a.createServerPipeTransport)(V);v=k[0],E=k[1]}}var A="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!v)throw new Error("Connection input stream is not set. "+A);if(!E)throw new Error("Connection output stream is not set. "+A);if(i.func(v.read)&&i.func(v.on)){let W=v;W.on("end",()=>{process.exit(l?0:1)}),W.on("close",()=>{process.exit(l?0:1)})}const q=W=>{const V=(0,a.createProtocolConnection)(v,E,W,S);return I&&w(W),V};return(0,s.createConnection)(q,h,$)}function w(v){function E($){return $.map(I=>typeof I=="string"?I:(0,r.inspect)(I)).join(" ")}const S=new Map;console.assert=function(I,...N){if(!I)if(N.length===0)v.error("Assertion failed");else{const[A,...q]=N;v.error(`Assertion failed: ${A} ${E(q)}`)}},console.count=function(I="default"){const N=String(I);let A=S.get(N)??0;A+=1,S.set(N,A),v.log(`${N}: ${N}`)},console.countReset=function(I){I===void 0?S.clear():S.delete(String(I))},console.debug=function(...I){v.log(E(I))},console.dir=function(I,N){v.log((0,r.inspect)(I,N))},console.log=function(...I){v.log(E(I))},console.error=function(...I){v.error(E(I))},console.trace=function(...I){const N=new Error().stack.replace(/(.+\n){2}/,"");let A="Trace";I.length!==0&&(A+=`: ${E(I)}`),v.log(`${A}
160
- ${N}`)},console.warn=function(...I){v.warn(E(I))}}}(Fs)),Fs}var le=v9();function Vk(t,e){const n={stacks:t,tokens:e};return w9(n),n.stacks.flat().forEach(i=>{i.property=void 0}),Xk(n.stacks).map(i=>i[i.length-1])}function Wy(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(Ii(c.$container)){a=c.$container;break}else if(Og(c.$container))c=c.$container;else break;if(HD(c.cardinality)){const u=Zo({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(...Yk({feature:a,type:e.type},u+1,n,r,i)),s.every(l=>Oo(l.feature.cardinality,l.feature)||Oo(n.get(l.feature))||i.has(l.feature))&&s.push(...Wy({next:{feature:a,type:e.type},cardinalities:n,visited:r,plus:i}))}return s}function Gy(t){return ht(t)&&(t={feature:t}),Zo({next:t,cardinalities:new Map,visited:new Set,plus:new Set})}function Zo(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(Ii(c)){if(o.has(c))return[];o.add(c)}if(Ii(c))return Yk(i,0,s,o,a).map(l=>Vf(l,c.cardinality,s));if(Bg(c)||jg(c))return c.elements.flatMap(l=>Zo({next:{feature:l,type:u,property:i.property},cardinalities:s,visited:o,plus:a})).map(l=>Vf(l,c.cardinality,s));if(kr(c)){const l={feature:c.terminal,type:u,property:(e=i.property)!==null&&e!==void 0?e:c.feature};return Zo({next:l,cardinalities:s,visited:o,plus:a}).map(d=>Vf(d,c.cardinality,s))}else{if(Ds(c))return Wy({next:{feature:c,type:gc(c),property:(n=i.property)!==null&&n!==void 0?n:c.feature},cardinalities:s,visited:o,plus:a});if(ti(c)&&Vt(c.rule.ref)){const l=c.rule.ref,d={feature:l.definition,type:l.fragment||l.dataType?void 0:(r=Es(l))!==null&&r!==void 0?r:l.name,property:i.property};return Zo({next:d,cardinalities:s,visited:o,plus:a}).map(f=>Vf(f,c.cardinality,s))}else return[i]}}function Vf(t,e,n){return n.set(t.feature,e),t}function Yk(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(...Zo({next:a,cardinalities:n,visited:r,plus:i})),!!Oo((s=a.feature.cardinality)!==null&&s!==void 0?s:n.get(a.feature),a.feature)););return o}function w9(t){for(const e of t.tokens){const n=Xk(t.stacks,e);t.stacks=n}}function Xk(t,e){const n=[];for(const r of t)n.push(...b9(r,e));return n}function b9(t,e){const n=new Map,r=new Set(t.map(s=>s.feature).filter(D9)),i=[];for(;t.length>0;){const s=t.pop(),o=Wy({next:s,cardinalities:n,plus:r,visited:new Set}).filter(a=>e?Hy(a.feature,e):!0);for(const a of o)i.push([...t,a]);if(!o.every(a=>Oo(a.feature.cardinality,a.feature)||Oo(n.get(a.feature))))break}return i}function D9(t){if(t.cardinality==="+")return!0;const e=yn(t,kr);return!!(e&&e.cardinality==="+")}function Hy(t,e){if($r(t))return t.value===e.image;if(ti(t))return E9(t.rule.ref,e);if(Qa(t)){const n=Jg(t);if(n)return Hy(n,e)}return!1}function E9(t,e){return Vt(t)?Gy(t.definition).some(r=>Hy(r.feature,e)):ei(t)?mc(t).test(e.image):!1}function T9(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 Jk{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=>$r(u.feature)?u.feature.value:u.feature,c=[];for(const u of s)if(await Promise.all(He(u.features).distinct(a).exclude(c).map(l=>this.completionFor(u,l,o))),c.push(...u.features),!this.continueCompletion(i))break;return le.CompletionList.create(this.deduplicateItems(i),!0)}deduplicateItems(e){return He(e).distinct(n=>`${n.kind}_${n.label}_${n.detail}`).toArray()}findFeaturesAt(e,n){const r=e.getText({start:le.Position.create(0,0),end:e.positionAt(n)}),i=this.completionParser.parse(r),s=i.tokens;if(i.tokenIndex===0){const c=Md(this.grammar),u=Gy({feature:c.definition,type:Es(c)});return s.length>0?(s.shift(),Vk(u.map(l=>[l]),s)):u}const o=[...s].splice(i.tokenIndex);return Vk([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[E,S]=l,$=(r=bd(s,E))===null||r===void 0?void 0:r.astNode;yield Object.assign(Object.assign({},u),{node:$,tokenOffset:E,tokenEndOffset:S,features:this.findFeaturesAt(o,E)})}const{nextTokenStart:d,nextTokenEnd:f,previousTokenStart:h,previousTokenEnd:p}=this.backtrackToAnyToken(a,c);let m=d;c<=d&&h!==void 0&&(m=h);const w=(i=bd(s,m))===null||i===void 0?void 0:i.astNode;let v=!0;if(h!==void 0&&p!==void 0&&p===c&&(yield Object.assign(Object.assign({},u),{node:w,tokenOffset:h,tokenEndOffset:p,features:this.findFeaturesAt(o,h)}),v=this.performNextTokenCompletion(e,a.substring(h,p),h,p),v&&(yield Object.assign(Object.assign({},u),{node:w,tokenOffset:p,tokenEndOffset:p,features:this.findFeaturesAt(o,p)}))),w)v&&(yield Object.assign(Object.assign({},u),{node:w,tokenOffset:d,tokenEndOffset:f,features:this.findFeaturesAt(o,d)}));else{const E=Md(this.grammar);if(!E)throw new Error("Missing entry parser rule");yield Object.assign(Object.assign({},u),{tokenOffset:d,tokenEndOffset:f,features:Gy(E.definition)})}}performNextTokenCompletion(e,n,r,i){return new RegExp("\\P{L}$","u").test(n)}findDataTypeRuleStart(e,n){var r,i;let s=xi(e,n,this.grammarConfig.nameRegexp),o=!!(!((r=yn(s?.grammarSource,Vt))===null||r===void 0)&&r.dataType);if(o){for(;o;)s=s?.container,o=!!(!((i=yn(s?.grammarSource,Vt))===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($r(n.feature))return this.completionForKeyword(e,n.feature,r);if(Qa(n.feature)&&e.node)return this.completionForCrossReference(e,n,r)}completionForCrossReference(e,n,r){const i=yn(n.feature,kr);let s=e.node;if(i&&s){n.type&&(s={$type:n.type,$container:s,$containerProperty:n.property},Gg(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 le.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 R9{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=xi(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[le.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=nn(n.astNode);if(n&&r)return{source:e,target:n,targetDocument:r}}}}class Zk{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=xi(i,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(!s)return;const o=this.references.findDeclaration(s);if(o){const a=mt.equals(nn(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 le.DocumentHighlight.create(e.segment.range)}}class S9{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 fc(n)){const s=this.getSymbol(e,i);r.push(...s)}if(r.length>0)return r}}class k9{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=He(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(le.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([Yt.parse(e.document.uri)],[])}didChangeWatchedFiles(e){const n=He(e.changes).filter(i=>i.type!==le.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>Yt.parse(i.uri)).toArray(),r=He(e.changes).filter(i=>i.type===le.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>Yt.parse(i.uri)).toArray();this.fireDocumentUpdate(n,r)}}class $9{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=Cr(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 bD(i))if(this.commentNames.includes(s.tokenType.name)){const o=this.toFoldingRange(e,s,le.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)),le.FoldingRange.create(s.line,o.line,s.character,o.character,r)}includeLastFoldingLine(e,n){if(n===le.FoldingRangeKind.Comment)return!1;const r=e.text,i=r.charAt(r.length-1);return!(i==="}"||i===")"||i==="]")}}class C9{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 Qk<=e&&e<=e$&&_9<=n&&n<=A9||e===t$&&n!==t$}toUpperCharCode(e){return Qk<=e&&e<=e$?e-32:e}}const Qk=97,e$=122,_9=65,A9=90,t$=95;class n${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=xi(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 x9 extends n${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 Yf=bt();const I9={[le.SemanticTokenTypes.class]:0,[le.SemanticTokenTypes.comment]:1,[le.SemanticTokenTypes.enum]:2,[le.SemanticTokenTypes.enumMember]:3,[le.SemanticTokenTypes.event]:4,[le.SemanticTokenTypes.function]:5,[le.SemanticTokenTypes.interface]:6,[le.SemanticTokenTypes.keyword]:7,[le.SemanticTokenTypes.macro]:8,[le.SemanticTokenTypes.method]:9,[le.SemanticTokenTypes.modifier]:10,[le.SemanticTokenTypes.namespace]:11,[le.SemanticTokenTypes.number]:12,[le.SemanticTokenTypes.operator]:13,[le.SemanticTokenTypes.parameter]:14,[le.SemanticTokenTypes.property]:15,[le.SemanticTokenTypes.regexp]:16,[le.SemanticTokenTypes.string]:17,[le.SemanticTokenTypes.struct]:18,[le.SemanticTokenTypes.type]:19,[le.SemanticTokenTypes.typeParameter]:20,[le.SemanticTokenTypes.variable]:21,[le.SemanticTokenTypes.decorator]:22},P9={[le.SemanticTokenModifiers.abstract]:1,[le.SemanticTokenModifiers.async]:2,[le.SemanticTokenModifiers.declaration]:4,[le.SemanticTokenModifiers.defaultLibrary]:8,[le.SemanticTokenModifiers.definition]:16,[le.SemanticTokenModifiers.deprecated]:32,[le.SemanticTokenModifiers.documentation]:64,[le.SemanticTokenModifiers.modification]:128,[le.SemanticTokenModifiers.readonly]:256,[le.SemanticTokenModifiers.static]:512};function N9(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 O9 extends le.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 F9{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 I9}get tokenModifiers(){return P9}get semanticTokensOptions(){return{legend:{tokenTypes:Object.keys(this.tokenTypes),tokenModifiers:Object.keys(this.tokenModifiers)},full:{delta:!0},range:!0}}async semanticHighlight(e,n,r=it.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=it.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=it.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 O9;return this.tokensBuilders.set(e.uri.toString(),r),r}async computeHighlighting(e,n,r){const i=e.parseResult.value,s=ni(i,{range:this.currentRange}).iterator();let o;do if(o=s.next(),!o.done){await Ot(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&&!_g(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 h=d;d=this.currentDocument.textDocument.offsetAt({line:f+1,character:0}),this.currentTokensBuilder.push(f,0,d-h-1,o,a)}this.currentTokensBuilder.push(u,0,r.end.character,o,a)}}highlightProperty(e){const n=[];if(typeof e.index=="number"){const s=Cn(e.node.$cstNode,e.property,e.index);s&&n.push(s)}else n.push(...No(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=pc(n.$cstNode,r,s);c&&a.push(c)}else a.push(...Qg(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 r$;(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}})(r$||(r$={}));function L9(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 M9{constructor(e){this.onInitializeEmitter=new Yf.Emitter,this.onInitializedEmitter=new Yf.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(){Cy(this.services),this.services.ServiceRegistry.all.forEach(e=>Cy(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 U;return(U=te.lsp)===null||U===void 0?void 0:U.Formatter}),l=c.map(te=>{var U,ye;return(ye=(U=te.lsp)===null||U===void 0?void 0:U.Formatter)===null||ye===void 0?void 0:ye.formatOnTypeOptions}).find(te=>!!te),d=this.hasService(te=>{var U;return(U=te.lsp)===null||U===void 0?void 0:U.CodeActionProvider}),f=this.hasService(te=>{var U;return(U=te.lsp)===null||U===void 0?void 0:U.SemanticTokenProvider}),h=N9(c.map(te=>{var U,ye;return(ye=(U=te.lsp)===null||U===void 0?void 0:U.SemanticTokenProvider)===null||ye===void 0?void 0:ye.semanticTokensOptions})),p=(i=(r=this.services.lsp)===null||r===void 0?void 0:r.ExecuteCommandHandler)===null||i===void 0?void 0:i.commands,m=this.hasService(te=>{var U;return(U=te.lsp)===null||U===void 0?void 0:U.DocumentLinkProvider}),w=L9(c.map(te=>{var U,ye;return(ye=(U=te.lsp)===null||U===void 0?void 0:U.SignatureHelp)===null||ye===void 0?void 0:ye.signatureHelpOptions})),v=this.hasService(te=>{var U;return(U=te.lsp)===null||U===void 0?void 0:U.TypeProvider}),E=this.hasService(te=>{var U;return(U=te.lsp)===null||U===void 0?void 0:U.ImplementationProvider}),S=this.hasService(te=>{var U;return(U=te.lsp)===null||U===void 0?void 0:U.CompletionProvider}),$=T9(c.map(te=>{var U,ye;return(ye=(U=te.lsp)===null||U===void 0?void 0:U.CompletionProvider)===null||ye===void 0?void 0:ye.completionOptions})),I=this.hasService(te=>{var U;return(U=te.lsp)===null||U===void 0?void 0:U.ReferencesProvider}),N=this.hasService(te=>{var U;return(U=te.lsp)===null||U===void 0?void 0:U.DocumentSymbolProvider}),A=this.hasService(te=>{var U;return(U=te.lsp)===null||U===void 0?void 0:U.DefinitionProvider}),q=this.hasService(te=>{var U;return(U=te.lsp)===null||U===void 0?void 0:U.DocumentHighlightProvider}),W=this.hasService(te=>{var U;return(U=te.lsp)===null||U===void 0?void 0:U.FoldingRangeProvider}),V=this.hasService(te=>{var U;return(U=te.lsp)===null||U===void 0?void 0:U.HoverProvider}),x=this.hasService(te=>{var U;return(U=te.lsp)===null||U===void 0?void 0:U.RenameProvider}),k=this.hasService(te=>{var U;return(U=te.lsp)===null||U===void 0?void 0:U.CallHierarchyProvider}),T=this.hasService(te=>{var U;return(U=te.lsp)===null||U===void 0?void 0:U.TypeHierarchyProvider}),L=this.hasService(te=>{var U;return(U=te.lsp)===null||U===void 0?void 0:U.CodeLensProvider}),Y=this.hasService(te=>{var U;return(U=te.lsp)===null||U===void 0?void 0:U.DeclarationProvider}),G=this.hasService(te=>{var U;return(U=te.lsp)===null||U===void 0?void 0:U.InlayHintProvider}),X=(s=this.services.lsp)===null||s===void 0?void 0:s.WorkspaceSymbolProvider;return{capabilities:{workspace:{workspaceFolders:{supported:!0},fileOperations:a},executeCommandProvider:p&&{commands:p},textDocumentSync:{change:Yf.TextDocumentSyncKind.Incremental,openClose:!0,save:!!o.didSaveDocument,willSave:!!o.willSaveDocument,willSaveWaitUntil:!!o.willSaveDocumentWaitUntil},completionProvider:S?$:void 0,referencesProvider:I,documentSymbolProvider:N,definitionProvider:A,typeDefinitionProvider:v,documentHighlightProvider:q,codeActionProvider:d,documentFormattingProvider:u,documentRangeFormattingProvider:u,documentOnTypeFormattingProvider:l,foldingRangeProvider:W,hoverProvider:V,renameProvider:x?{prepareProvider:!0}:void 0,semanticTokensProvider:f?h:void 0,signatureHelpProvider:w,implementationProvider:E,callHierarchyProvider:k?{}:void 0,typeHierarchyProvider:T?{}:void 0,documentLinkProvider:m?{resolveProvider:!1}:void 0,codeLensProvider:L?{resolveProvider:!1}:void 0,declarationProvider:Y,inlayHintProvider:G?{resolveProvider:!1}:void 0,workspaceSymbolProvider:X?{resolveProvider:!!X.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(Yf.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 z9{getSymbolKind(e){return le.SymbolKind.Field}getCompletionItemKind(e){return le.CompletionItemKind.Reference}}class B9{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=xi(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(le.Location.create(a.sourceUri.toString(),a.segment.range))})}return i}}class j9{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=xi(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=Tn.replace(d.segment.range,n.newName),h=d.sourceUri.toString();i[h]?i[h].push(f):i[h]=[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=xi(r,i,this.grammarConfig.nameRegexp);if(!s)return;if(this.references.findDeclaration(s)||this.isNameNode(s))return s.range}}isNameNode(e){return e?.astNode&&FS(e.astNode)&&e===this.nameProvider.getNameNode(e.astNode)}}class i${constructor(e){this.indexManager=e.workspace.IndexManager,this.nodeKindProvider=e.lsp.NodeKindProvider,this.fuzzyMatcher=e.lsp.FuzzyMatcher}async getSymbols(e,n=it.CancellationToken.None){const r=[],i=e.query.toLowerCase();for(const s of this.indexManager.allElements())if(await Ot(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 q9{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new le.Emitter,this._onDidOpen=new le.Emitter,this._onDidClose=new le.Emitter,this._onDidSave=new le.Emitter,this._onWillSave=new le.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(mt.normalize(e))}set(e){const n=mt.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=mt.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=le.TextDocumentSyncKind.Incremental;const n=[];return n.push(e.onDidOpenTextDocument(r=>{const i=r.textDocument,s=mt.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=mt.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=mt.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(mt.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(mt.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(mt.normalize(r.textDocument.uri));i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),le.Disposable.create(()=>{n.forEach(r=>r.dispose())})}}function U9(t){return Bf.merge(n1(t),W9(t))}function W9(t){return{lsp:{CompletionProvider:e=>new Jk(e),DocumentSymbolProvider:e=>new S9(e),HoverProvider:e=>new x9(e),FoldingRangeProvider:e=>new $9(e),ReferencesProvider:e=>new B9(e),DefinitionProvider:e=>new R9(e),DocumentHighlightProvider:e=>new Zk(e),RenameProvider:e=>new j9(e)},shared:()=>t.shared}}function G9(t){return Bf.merge(r1(t),H9(t))}function H9(t){return{lsp:{Connection:()=>t.connection,LanguageServer:e=>new M9(e),DocumentUpdateHandler:e=>new k9(e),WorkspaceSymbolProvider:e=>new i$(e),NodeKindProvider:()=>new z9,FuzzyMatcher:()=>new C9},workspace:{TextDocuments:()=>new q9(Mf)}}}class K9{constructor(){this.collector=()=>{}}getNodeFormatter(e){return new V9(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),h=i.get(f),p=(l=u.options.priority)!==null&&l!==void 0?l:0,m=(d=h?.options.priority)!==null&&d!==void 0?d:0;(!h||m<=p)&&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=Cr(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=bs(d),h=this.nodeModeToKey(d,"prepend"),p=n.get(h);if(n.delete(h),p){const v=this.createTextEdit(u,d,p,s);for(const E of v)E&&this.insideRange(E.range,i)&&o.push(E)}const m=this.nodeModeToKey(d,"append"),w=n.get(m);if(n.delete(m),w){const v=SD(d);if(v){const E=this.createTextEdit(d,v,w,s);for(const S of E)S&&this.insideRange(S.range,i)&&o.push(S)}}if(!p&&d.hidden){const v=this.createHiddenTextEdits(u,d,void 0,s);for(const E of v)E&&this.insideRange(E.range,i)&&o.push(E)}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),h=this.getIndentationCharacterCount(i,l)-d;if(h===0)return[];let p="";h>0&&(p=(i.options.insertSpaces?" ":" ").repeat(h));const m=n.text.split(`
161
- `);m[0]=u+m[0];for(let w=0;w<m.length;w++){const v=o+w,E={character:0,line:v};if(h>0)a.push({newText:p,range:{start:E,end:E}});else{const S=m[w];let $=0;for(;$<S.length;$++){const I=S.charAt($);if(I!==" "&&I!==" ")break}a.push({newText:"",range:{start:E,end:{line:v,character:Math.min($,Math.abs(h))}}})}}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)),bs(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 xo(i,s=>this.iterateCst(s,n)):Ao}iterateCst(e,n){if(!Qr(e))return Ao;const r=n.indentation;return new Ct(()=>({index:0}),i=>i.index<e.content.length?{done:!1,value:e.content[i.index++]}:(n.indentation=r,Kt))}}class V9{constructor(e,n){this.astNode=e,this.collector=n}node(e){return new wr(e.$cstNode?[e.$cstNode]:[],this.collector)}nodes(...e){const n=[];for(const r of e)r.$cstNode&&n.push(r.$cstNode);return new wr(n,this.collector)}property(e,n){const r=Cn(this.astNode.$cstNode,e,n);return new wr(r?[r]:[],this.collector)}properties(...e){const n=[];for(const r of e){const i=No(this.astNode.$cstNode,r);n.push(...i)}return new wr(n,this.collector)}keyword(e,n){const r=pc(this.astNode.$cstNode,e,n);return new wr(r?[r]:[],this.collector)}keywords(...e){const n=[];for(const r of e){const i=Qg(this.astNode.$cstNode,r);n.push(...i)}return new wr(n,this.collector)}cst(e){return new wr([...e],this.collector)}interior(e,n){const r=e.nodes,i=n.nodes;if(r.length!==1||i.length!==1)return new wr([],this.collector);let s=r[0],o=i[0];if(s.offset>o.offset){const a=s;s=o,o=a}return new wr(kD(s,o),this.collector)}}class wr{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 wr(this.nodes.slice(e,n),this.collector)}}var Wi;(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,h,p,m,w,v;const E=(f=l.lines)!==null&&f!==void 0?f:0,S=(h=d.lines)!==null&&h!==void 0?h:0,$=(p=l.tabs)!==null&&p!==void 0?p:0,I=(m=d.tabs)!==null&&m!==void 0?m:0,N=(w=l.characters)!==null&&w!==void 0?w:0,A=(v=d.characters)!==null&&v!==void 0?v:0;return E<S?-1:E>S?1:$<I?-1:$>I?1:N<A?-1:N>A?1:0}})(Wi||(Wi={}));class Y9{constructor(){this.encoding="utf-8"}readFile(e){return M0.promises.readFile(e.fsPath,this.encoding)}async readDirectory(e){return(await M0.promises.readdir(e.fsPath,{withFileTypes:!0})).map(r=>({dirent:r,isFile:r.isFile(),isDirectory:r.isDirectory(),uri:mt.joinPath(e,r.name)}))}}const X9={fileSystemProvider:()=>new Y9},qe={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},s$={silent:{level:-1},fatal:{level:qe.fatal},error:{level:qe.error},warn:{level:qe.warn},log:{level:qe.log},info:{level:qe.info},success:{level:qe.success},fail:{level:qe.fail},ready:{level:qe.info},start:{level:qe.info},box:{level:qe.info},debug:{level:qe.debug},trace:{level:qe.trace},verbose:{level:qe.verbose}};function Ky(t){return t!==null&&typeof t=="object"}function Vy(t,e,n=".",r){if(!Ky(e))return Vy(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]]:Ky(o)&&Ky(i[s])?i[s]=Vy(o,i[s],(n?`${n}.`:"")+s.toString()):i[s]=o)}return i}function J9(t){return(...e)=>e.reduce((n,r)=>Vy(n,r,""),{})}const Z9=J9();function Q9(t){return Object.prototype.toString.call(t)==="[object Object]"}function eU(t){return!(!Q9(t)||!t.message&&!t.args||t.stack)}let Yy=!1;const o$=[];let dn=class pP{constructor(e={}){const n=e.types||s$;this.options=Z9({...e,defaults:{...e.defaults},level:Xy(e.level,n),reporters:[...e.reporters||[]]},{types:s$,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=Xy(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 pP({...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>=0)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(){Yy=!0}resumeLogs(){Yy=!1;const e=o$.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(Yy){o$.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:Xy(e.level,this.options.types)};!r&&n.length===1&&eU(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 Xy(t,e={},n=3){return t===void 0?n:typeof t=="number"?t:e[t]&&e[t].level!==void 0?e[t].level:n}dn.prototype.add=dn.prototype.addReporter,dn.prototype.remove=dn.prototype.removeReporter,dn.prototype.clear=dn.prototype.removeReporter,dn.prototype.withScope=dn.prototype.withTag,dn.prototype.mock=dn.prototype.mockTypes,dn.prototype.pause=dn.prototype.pauseLogs,dn.prototype.resume=dn.prototype.resumeLogs;function tU(t={}){return new dn(t)}function a$(t){const e=process.cwd()+DP;return t.split(`
167
- `).splice(1).map(n=>n.trim().replace("file://","").replace(e,""))}function nU(t,e){return(e.__write||e.write).call(e,t)}const Jy=t=>t?`[${t}]`:"";let c$=class{formatStack(e,n){return" "+a$(e).join(`
168
- `)}formatArgs(e,n){const r=e.map(i=>i&&typeof i.stack=="string"?i.message+`
169
- `+this.formatStack(i.stack,n):i);return $P(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"?`
170
- `+[Jy(e.tag),e.title&&e.title,...r.split(`
171
- `)].filter(Boolean).map(i=>" > "+i).join(`
172
- `)+`
173
- `:this.filterAndJoin([Jy(e.type),Jy(e.tag),r])}log(e,n){const r=this.formatLogObj(e,{columns:n.options.stdout.columns||0,...n.options.formatOptions});return nU(r+`
174
- `,e.level<2?n.options.stderr||process.stderr:n.options.stdout||process.stdout)}};const{env:Gi={},argv:u$=[],platform:rU=""}=typeof process>"u"?{}:process,iU="NO_COLOR"in Gi||u$.includes("--no-color"),sU="FORCE_COLOR"in Gi||u$.includes("--color"),oU=rU==="win32",l$=Gi.TERM==="dumb",aU=Up&&Up.isatty&&Up.isatty(1)&&Gi.TERM&&!l$,cU="CI"in Gi&&("GITHUB_ACTIONS"in Gi||"GITLAB_CI"in Gi||"CIRCLECI"in Gi),uU=!iU&&(sU||oU&&!l$||aU||cU);function d$(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:d$(o,s,n,r))}function lU(t,e,n,r,i){return t<0?n+e+r:n+d$(t,e,r,i)+r}function dU(t,e,n=t,r=t.length+1){return i=>i||!(i===""||i===void 0)?lU((""+i).indexOf(e,r),i,t,e,n):""}function we(t,e,n){return dU(`\x1B[${t}m`,`\x1B[${e}m`,n)}const f$={reset:we(0,0),bold:we(1,22,"\x1B[22m\x1B[1m"),dim:we(2,22,"\x1B[22m\x1B[2m"),italic:we(3,23),underline:we(4,24),inverse:we(7,27),hidden:we(8,28),strikethrough:we(9,29),black:we(30,39),red:we(31,39),green:we(32,39),yellow:we(33,39),blue:we(34,39),magenta:we(35,39),cyan:we(36,39),white:we(37,39),gray:we(90,39),bgBlack:we(40,49),bgRed:we(41,49),bgGreen:we(42,49),bgYellow:we(43,49),bgBlue:we(44,49),bgMagenta:we(45,49),bgCyan:we(46,49),bgWhite:we(47,49),blackBright:we(90,39),redBright:we(91,39),greenBright:we(92,39),yellowBright:we(93,39),blueBright:we(94,39),magentaBright:we(95,39),cyanBright:we(96,39),whiteBright:we(97,39),bgBlackBright:we(100,49),bgRedBright:we(101,49),bgGreenBright:we(102,49),bgYellowBright:we(103,49),bgBlueBright:we(104,49),bgMagentaBright:we(105,49),bgCyanBright:we(106,49),bgWhiteBright:we(107,49)};function fU(t=uU){return t?f$:Object.fromEntries(Object.keys(f$).map(e=>[e,String]))}const fn=fU();function hU(t,e="reset"){return fn[t]||fn[e]}const pU=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");function vu(t){return t.replace(new RegExp(pU,"g"),"")}const h$={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"}},gU={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};function mU(t,e={}){const n={...e,style:{...gU,...e.style}},r=t.split(`
175
- `),i=[],s=hU(n.style.borderColor),o={...typeof n.style.borderStyle=="string"?h$[n.style.borderStyle]||h$.solid:n.style.borderStyle};if(s)for(const h in o)o[h]=s(o[h]);const a=n.style.padding%2===0?n.style.padding:n.style.padding+1,c=r.length+a,u=Math.max(...r.map(h=>h.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 h=o.h.repeat(Math.floor((u-vu(n.title).length)/2)),p=o.h.repeat(u-vu(n.title).length-vu(h).length+a);i.push(`${d}${o.tl}${h}${n.title}${p}${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 h=0;h<c;h++)if(h<f||h>=f+r.length)i.push(`${d}${o.v}${" ".repeat(l)}${o.v}`);else{const p=r[h-f],m=" ".repeat(a),w=" ".repeat(u-vu(p).length);i.push(`${d}${o.v}${m}${p}${w}${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(`
176
- `)}const yU=[["APPVEYOR"],["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"],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"]];function vU(t){for(const e of yU){const n=e[1]||e[0];if(t[n])return{name:e[0].toLowerCase(),...e[2]}}return t.SHELL&&t.SHELL==="/bin/jsh"?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}const Xf=typeof process<"u"?process:{},wu=Xf.env||{},p$=vU(wu),wU=typeof process<"u"&&process.env&&process.env.NODE_ENV||"";Xf.platform,p$.name;const bU=bu(wu.CI)||p$.ci!==!1;bu(Xf.stdout&&Xf.stdout.isTTY);const DU=bu(wu.DEBUG),g$=wU==="test"||bu(wu.TEST);bu(wu.MINIMAL);function bu(t){return t?t!=="false":!1}function EU({onlyFirst:t=!1}={}){const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}const TU=EU();function RU(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(TU,"")}function m$(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var y$={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(r){var i=r.charCodeAt(0),s=r.length==2?r.charCodeAt(1):0,o=i;return 55296<=i&&i<=56319&&56320<=s&&s<=57343&&(i&=1023,s&=1023,o=i<<10|s,o+=65536),o==12288||65281<=o&&o<=65376||65504<=o&&o<=65510?"F":o==8361||65377<=o&&o<=65470||65474<=o&&o<=65479||65482<=o&&o<=65487||65490<=o&&o<=65495||65498<=o&&o<=65500||65512<=o&&o<=65518?"H":4352<=o&&o<=4447||4515<=o&&o<=4519||4602<=o&&o<=4607||9001<=o&&o<=9002||11904<=o&&o<=11929||11931<=o&&o<=12019||12032<=o&&o<=12245||12272<=o&&o<=12283||12289<=o&&o<=12350||12353<=o&&o<=12438||12441<=o&&o<=12543||12549<=o&&o<=12589||12593<=o&&o<=12686||12688<=o&&o<=12730||12736<=o&&o<=12771||12784<=o&&o<=12830||12832<=o&&o<=12871||12880<=o&&o<=13054||13056<=o&&o<=19903||19968<=o&&o<=42124||42128<=o&&o<=42182||43360<=o&&o<=43388||44032<=o&&o<=55203||55216<=o&&o<=55238||55243<=o&&o<=55291||63744<=o&&o<=64255||65040<=o&&o<=65049||65072<=o&&o<=65106||65108<=o&&o<=65126||65128<=o&&o<=65131||110592<=o&&o<=110593||127488<=o&&o<=127490||127504<=o&&o<=127546||127552<=o&&o<=127560||127568<=o&&o<=127569||131072<=o&&o<=194367||177984<=o&&o<=196605||196608<=o&&o<=262141?"W":32<=o&&o<=126||162<=o&&o<=163||165<=o&&o<=166||o==172||o==175||10214<=o&&o<=10221||10629<=o&&o<=10630?"Na":o==161||o==164||167<=o&&o<=168||o==170||173<=o&&o<=174||176<=o&&o<=180||182<=o&&o<=186||188<=o&&o<=191||o==198||o==208||215<=o&&o<=216||222<=o&&o<=225||o==230||232<=o&&o<=234||236<=o&&o<=237||o==240||242<=o&&o<=243||247<=o&&o<=250||o==252||o==254||o==257||o==273||o==275||o==283||294<=o&&o<=295||o==299||305<=o&&o<=307||o==312||319<=o&&o<=322||o==324||328<=o&&o<=331||o==333||338<=o&&o<=339||358<=o&&o<=359||o==363||o==462||o==464||o==466||o==468||o==470||o==472||o==474||o==476||o==593||o==609||o==708||o==711||713<=o&&o<=715||o==717||o==720||728<=o&&o<=731||o==733||o==735||768<=o&&o<=879||913<=o&&o<=929||931<=o&&o<=937||945<=o&&o<=961||963<=o&&o<=969||o==1025||1040<=o&&o<=1103||o==1105||o==8208||8211<=o&&o<=8214||8216<=o&&o<=8217||8220<=o&&o<=8221||8224<=o&&o<=8226||8228<=o&&o<=8231||o==8240||8242<=o&&o<=8243||o==8245||o==8251||o==8254||o==8308||o==8319||8321<=o&&o<=8324||o==8364||o==8451||o==8453||o==8457||o==8467||o==8470||8481<=o&&o<=8482||o==8486||o==8491||8531<=o&&o<=8532||8539<=o&&o<=8542||8544<=o&&o<=8555||8560<=o&&o<=8569||o==8585||8592<=o&&o<=8601||8632<=o&&o<=8633||o==8658||o==8660||o==8679||o==8704||8706<=o&&o<=8707||8711<=o&&o<=8712||o==8715||o==8719||o==8721||o==8725||o==8730||8733<=o&&o<=8736||o==8739||o==8741||8743<=o&&o<=8748||o==8750||8756<=o&&o<=8759||8764<=o&&o<=8765||o==8776||o==8780||o==8786||8800<=o&&o<=8801||8804<=o&&o<=8807||8810<=o&&o<=8811||8814<=o&&o<=8815||8834<=o&&o<=8835||8838<=o&&o<=8839||o==8853||o==8857||o==8869||o==8895||o==8978||9312<=o&&o<=9449||9451<=o&&o<=9547||9552<=o&&o<=9587||9600<=o&&o<=9615||9618<=o&&o<=9621||9632<=o&&o<=9633||9635<=o&&o<=9641||9650<=o&&o<=9651||9654<=o&&o<=9655||9660<=o&&o<=9661||9664<=o&&o<=9665||9670<=o&&o<=9672||o==9675||9678<=o&&o<=9681||9698<=o&&o<=9701||o==9711||9733<=o&&o<=9734||o==9737||9742<=o&&o<=9743||9748<=o&&o<=9749||o==9756||o==9758||o==9792||o==9794||9824<=o&&o<=9825||9827<=o&&o<=9829||9831<=o&&o<=9834||9836<=o&&o<=9837||o==9839||9886<=o&&o<=9887||9918<=o&&o<=9919||9924<=o&&o<=9933||9935<=o&&o<=9953||o==9955||9960<=o&&o<=9983||o==10045||o==10071||10102<=o&&o<=10111||11093<=o&&o<=11097||12872<=o&&o<=12879||57344<=o&&o<=63743||65024<=o&&o<=65039||o==65533||127232<=o&&o<=127242||127248<=o&&o<=127277||127280<=o&&o<=127337||127344<=o&&o<=127386||917760<=o&&o<=917999||983040<=o&&o<=1048573||1048576<=o&&o<=1114109?"A":"N"},e.characterLength=function(r){var i=this.eastAsianWidth(r);return i=="F"||i=="W"||i=="A"?2:1};function n(r){return r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(r){for(var i=n(r),s=0,o=0;o<i.length;o++)s=s+this.characterLength(i[o]);return s},e.slice=function(r,i,s){textLen=e.length(r),i=i||0,s=s||1,i<0&&(i=textLen+i),s<0&&(s=textLen+s);for(var o="",a=0,c=n(r),u=0;u<c.length;u++){var l=c[u],d=e.length(l);if(a>=i-(d==2?1:0))if(a+d<=s)o+=l;else break;a+=d}return o}})(y$);var SU=y$.exports;const kU=m$(SU),$U=()=>/[#*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\u26D3\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](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\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]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\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])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\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-\uDDF5\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]|\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(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\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-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\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-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\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-\uDDB3\uDDBC\uDDBD])|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD])|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\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-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\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-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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;function CU(t,e){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,countAnsiEscapeCodes:!1,...e},e.countAnsiEscapeCodes||(t=RU(t)),t.length===0))return 0;const n=e.ambiguousIsNarrow?1:2;let r=0;for(const{segment:i}of new Intl.Segmenter().segment(t)){const s=i.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879)){if($U().test(i)){r+=2;continue}switch(kU.eastAsianWidth(i)){case"F":case"W":{r+=2;break}case"A":{r+=n;break}default:r+=1}}}return r}function v$(){return ke.platform!=="win32"?ke.env.TERM!=="linux":!!ke.env.CI||!!ke.env.WT_SESSION||!!ke.env.TERMINUS_SUBLIME||ke.env.ConEmuTask==="{cmd::Cmder}"||ke.env.TERM_PROGRAM==="Terminus-Sublime"||ke.env.TERM_PROGRAM==="vscode"||ke.env.TERM==="xterm-256color"||ke.env.TERM==="alacritty"||ke.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const _U={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},AU={0:"red",1:"yellow"},xU=v$(),zr=(t,e)=>xU?t:e,w$={error:zr("\u2716","\xD7"),fatal:zr("\u2716","\xD7"),ready:zr("\u2714","\u221A"),warn:zr("\u26A0","\u203C"),info:zr("\u2139","i"),success:zr("\u2714","\u221A"),debug:zr("\u2699","D"),trace:zr("\u2192","\u2192"),fail:zr("\u2716","\xD7"),start:zr("\u25D0","o"),log:""};function b$(t){return Intl.Segmenter?CU(t):vu(t).length}class IU extends c${formatStack(e){return`
177
- `+a$(e).map(n=>" "+n.replace(/^at +/,r=>fn.gray(r)).replace(/\((.+)\)/,(r,i)=>`(${fn.cyan(i)})`)).join(`
178
- `)}formatType(e,n,r){const i=_U[e.type]||AU[e.level]||"gray";if(n)return NU(i)(fn.black(` ${e.type.toUpperCase()} `));const s=typeof w$[e.type]=="string"?w$[e.type]:e.icon||e.type;return s?PU(i)(s):""}formatLogObj(e,n){const[r,...i]=this.formatArgs(e.args,n).split(`
179
- `);if(e.type==="box")return mU(Jf(r+(i.length>0?`
180
- `+i.join(`
181
- `):"")),{title:e.title?Jf(e.title):void 0,style:e.style});const s=this.formatDate(e.date,n),o=s&&fn.gray(s),a=e.badge??e.level<2,c=this.formatType(e,a,n),u=e.tag?fn.gray(e.tag):"";let l;const d=this.filterAndJoin([c,Jf(r)]),f=this.filterAndJoin(n.columns?[u,o]:[u]),h=(n.columns||0)-b$(d)-b$(f)-2;if(l=h>0&&(n.columns||0)>=80?d+" ".repeat(h)+f:(f?`${fn.gray(`[${f}]`)} `:"")+d,l+=Jf(i.length>0?`
182
- `+i.join(`
183
- `):""),e.type==="trace"){const p=new Error("Trace: "+e.message);l+=this.formatStack(p.stack||"")}return a?`
184
- `+l+`
185
- `:l}}function Jf(t){return t.replace(/`([^`]+)`/gm,(e,n)=>fn.cyan(n)).replace(/\s+_([^_]+)_\s+/gm,(e,n)=>` ${fn.underline(n)} `)}function PU(t="white"){return fn[t]||fn.white}function NU(t="bgWhite"){return fn[`bg${t[0].toUpperCase()}${t.slice(1)}`]||fn.bgWhite}function D$(t={}){let e=OU();return process.env.CONSOLA_LEVEL&&(e=Number.parseInt(process.env.CONSOLA_LEVEL)??e),tU({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||g$)?new IU:new c$],...t})}function OU(){return DU?qe.debug:g$?qe.warn:qe.info}D$();function FU(){return qe.debug}const E$=FU(),Ze=D$({level:E$,defaults:{level:E$},formatOptions:{colors:!0,compact:!1,date:!1}});function LU(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 MU(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 zU(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 BU=new TextEncoder,jU=50;function qU(t,e,n){BU.encodeInto(t,e.subarray(n))}function UU(t,e,n){t.length>jU?qU(t,e,n):zU(t,e,n)}var WU=4096;function T$(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>=WU&&(o+=String.fromCharCode.apply(String,s),s.length=0)}return s.length>0&&(o+=String.fromCharCode.apply(String,s)),o}var GU=new TextDecoder,HU=200;function KU(t,e,n){var r=t.subarray(e,e+n);return GU.decode(r)}function VU(t,e,n){return n>HU?KU(t,e,n):T$(t,e,n)}var Zf=function(){function t(e,n){this.type=e,this.data=n}return t}(),YU=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)}}(),Br=function(t){YU(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),Du=4294967295;function XU(t,e,n){var r=n/4294967296,i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function R$(t,e,n){var r=Math.floor(n/4294967296),i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function S$(t,e){var n=t.getInt32(e),r=t.getUint32(e+4);return n*4294967296+r}function JU(t,e){var n=t.getUint32(e),r=t.getUint32(e+4);return n*4294967296+r}var ZU=-1,QU=4294967296-1,e7=17179869184-1;function t7(t){var e=t.sec,n=t.nsec;if(e>=0&&n>=0&&e<=e7)if(n===0&&e<=QU){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),R$(i,4,e),r}}function n7(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 r7(t){if(t instanceof Date){var e=n7(t);return t7(e)}else return null}function i7(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=S$(e,4),r=e.getUint32(0);return{sec:n,nsec:r}}default:throw new Br("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(t.length))}}function s7(t){var e=i7(t);return new Date(e.sec*1e3+e.nsec/1e6)}var o7={type:ZU,encode:r7,decode:s7},k$=function(){function t(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(o7)}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 Zf(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 Zf(o,s)}}}return e instanceof Zf?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 Zf(n,e)},t.defaultCodec=new t,t}();function Qf(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 a7(t){if(t instanceof ArrayBuffer)return new DataView(t);var e=Qf(t);return new DataView(e.buffer,e.byteOffset,e.byteLength)}var c7=100,u7=2048,l7=function(){function t(e){var n,r,i,s,o,a,c,u;this.extensionCodec=(n=e?.extensionCodec)!==null&&n!==void 0?n:k$.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:c7,this.initialBufferSize=(s=e?.initialBufferSize)!==null&&s!==void 0?s:u7,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=MU(e);this.ensureBufferSizeToWrite(n+r),this.writeStringHeader(r),UU(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=Qf(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),XU(this.view,this.pos,e),this.pos+=8},t.prototype.writeI64=function(e){this.ensureBufferSizeToWrite(8),R$(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 d7(t,e){var n=new l7(e);return n.encodeSharedRef(t)}function Zy(t){return"".concat(t<0?"-":"","0x").concat(Math.abs(t).toString(16).padStart(2,"0"))}var f7=16,h7=16,p7=function(){function t(e,n){e===void 0&&(e=f7),n===void 0&&(n=h7),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=T$(e,n,r),o=Uint8Array.prototype.slice.call(e,n,n+r);return this.store(o,s),s},t}(),g7=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())})},Qy=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}}},$$=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)}},Qo=function(t){return this instanceof Qo?(this.v=t,this):new Qo(t)},m7=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(h){return new Promise(function(p,m){s.push([f,h,p,m])>1||a(f,h)})})}function a(f,h){try{c(r[f](h))}catch(p){d(s[0][3],p)}}function c(f){f.value instanceof Qo?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,h){f(h),s.shift(),s.length&&a(s[0][0],s[0][1])}},C$="array",eh="map_key",y7="map_value",v7=function(t){return typeof t=="string"||typeof t=="number"},Eu=-1,ev=new DataView(new ArrayBuffer(0)),w7=new Uint8Array(ev.buffer);try{ev.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 tv=RangeError,_$=new tv("Insufficient data"),b7=new p7,D7=function(){function t(e){var n,r,i,s,o,a,c;this.totalPos=0,this.pos=0,this.view=ev,this.bytes=w7,this.headByte=Eu,this.stack=[],this.extensionCodec=(n=e?.extensionCodec)!==null&&n!==void 0?n:k$.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:Du,this.maxBinLength=(s=e?.maxBinLength)!==null&&s!==void 0?s:Du,this.maxArrayLength=(o=e?.maxArrayLength)!==null&&o!==void 0?o:Du,this.maxMapLength=(a=e?.maxMapLength)!==null&&a!==void 0?a:Du,this.maxExtLength=(c=e?.maxExtLength)!==null&&c!==void 0?c:Du,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:b7}return t.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=Eu,this.stack.length=0},t.prototype.setBuffer=function(e){this.bytes=Qf(e),this.view=a7(this.bytes),this.pos=0},t.prototype.appendBuffer=function(e){if(this.headByte===Eu&&!this.hasRemaining(1))this.setBuffer(e);else{var n=this.bytes.subarray(this.pos),r=Qf(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 Qy(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 g7(this,void 0,void 0,function(){var u,l,d,f,h,p,m,w;return Qy(this,function(v){switch(v.label){case 0:u=!1,v.label=1;case 1:v.trys.push([1,6,7,12]),n=!0,r=$$(e),v.label=2;case 2:return[4,r.next()];case 3:if(i=v.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(E){if(!(E instanceof tv))throw E}this.totalPos+=this.pos}finally{n=!0}v.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return f=v.sent(),o={error:f},[3,12];case 7:return v.trys.push([7,,10,11]),!n&&!s&&(a=r.return)?[4,a.call(r)]:[3,9];case 8:v.sent(),v.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 h=this,p=h.headByte,m=h.pos,w=h.totalPos,new RangeError("Insufficient data in parsing ".concat(Zy(p)," at ").concat(w," (").concat(m," 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 m7(this,arguments,function(){var i,s,o,a,c,u,l,d,f,h,p,m;return Qy(this,function(w){switch(w.label){case 0:i=n,s=-1,w.label=1;case 1:w.trys.push([1,15,16,21]),o=!0,a=$$(e),w.label=2;case 2:return[4,Qo(a.next())];case 3:if(c=w.sent(),f=c.done,!!f)return[3,14];m=c.value,o=!1,w.label=4;case 4:if(w.trys.push([4,,12,13]),u=m,n&&s===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(u),i&&(s=this.readArraySize(),i=!1,this.complete()),w.label=5;case 5:w.trys.push([5,10,,11]),w.label=6;case 6:return[4,Qo(this.doDecodeSync())];case 7:return[4,w.sent()];case 8:return w.sent(),--s===0?[3,9]:[3,6];case 9:return[3,11];case 10:if(l=w.sent(),!(l instanceof tv))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=w.sent(),h={error:d},[3,21];case 16:return w.trys.push([16,,19,20]),!o&&!f&&(p=a.return)?[4,Qo(p.call(a))]:[3,18];case 17:w.sent(),w.label=18;case 18:return[3,20];case 19:if(h)throw h.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 Br("Unrecognized type byte: ".concat(Zy(e)));this.complete();for(var s=this.stack;s.length>0;){var o=s[s.length-1];if(o.type===C$)if(o.array[o.position]=n,o.position++,o.position===o.size)s.pop(),n=o.array;else continue e;else if(o.type===eh){if(!v7(n))throw new Br("The type of key must be string or number but "+typeof n);if(n==="__proto__")throw new Br("The key __proto__ is not allowed");o.key=n,o.type=y7;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=eh;continue e}}return n}},t.prototype.readHeadByte=function(){return this.headByte===Eu&&(this.headByte=this.readU8()),this.headByte},t.prototype.complete=function(){this.headByte=Eu},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 Br("Unrecognized array type byte: ".concat(Zy(e)))}}},t.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new Br("Max length exceeded: map length (".concat(e,") > maxMapLengthLength (").concat(this.maxMapLength,")"));this.stack.push({type:eh,size:e,key:null,readCount:0,map:{}})},t.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new Br("Max length exceeded: array length (".concat(e,") > maxArrayLength (").concat(this.maxArrayLength,")"));this.stack.push({type:C$,size:e,array:new Array(e),position:0})},t.prototype.decodeUtf8String=function(e,n){var r;if(e>this.maxStrLength)throw new Br("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLength<this.pos+n+e)throw _$;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=VU(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===eh}return!1},t.prototype.decodeBinary=function(e,n){if(e>this.maxBinLength)throw new Br("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+n))throw _$;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 Br("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=JU(this.view,this.pos);return this.pos+=8,e},t.prototype.readI64=function(){var e=S$(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 E7(t,e){var n=new D7(e);return n.decode(t)}const T7=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]",R7=(t,e=0,n=t.byteLength-e)=>{if(!T7(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return Kp.from(t,e,n)},A$=(t,e)=>{if(typeof t!="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return e?Kp.from(t,e):Kp.from(t)},S7=/^[A-Za-z0-9+/]*={0,2}$/,k7=t=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!S7.exec(t))throw new TypeError("Invalid base64 string.");const e=A$(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},$7=t=>{const e=A$(t,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT)},C7=t=>{let e;if(typeof t=="string"?e=$7(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 R7(e.buffer,e.byteOffset,e.byteLength).toString("base64")},_7=`likec4lib { icons {
186
- aws:activate
187
- aws:alexa-for-business
188
- aws:amplify
189
- aws:apache-mxnet-on-aws
190
- aws:api-gateway
191
- aws:app-config
192
- aws:app-flow
193
- aws:app-mesh
194
- aws:app-runner
195
- aws:app-stream
196
- aws:app-sync
197
- aws:application-auto-scaling
198
- aws:application-composer
199
- aws:application-cost-profiler
200
- aws:application-discovery-service
201
- aws:application-migration-service
202
- aws:artifact
203
- aws:athena
204
- aws:audit-manager
205
- aws:augmented-ai-a2i
206
- aws:aurora
207
- aws:auto-scaling
208
- aws:backint-agent
209
- aws:backup
210
- aws:batch
211
- aws:billing-conductor
212
- aws:bottlerocket
213
- aws:braket
214
- aws:budgets
215
- aws:certificate-manager
216
- aws:chatbot
217
- aws:chime
218
- aws:chime-sdk
219
- aws:chime-voice-connector
220
- aws:clean-rooms
221
- aws:client-vpn
222
- aws:cloud-control-api
223
- aws:cloud-development-kit
224
- aws:cloud-directory
225
- aws:cloud-formation
226
- aws:cloud-front
227
- aws:cloud-hsm
228
- aws:cloud-map
229
- aws:cloud-search
230
- aws:cloud-shell
231
- aws:cloud-trail
232
- aws:cloud-wan
233
- aws:cloud-watch
234
- aws:cloud9
235
- aws:code-artifact
236
- aws:code-build
237
- aws:code-catalyst
238
- aws:code-commit
239
- aws:code-deploy
240
- aws:code-guru
241
- aws:code-pipeline
242
- aws:code-star
243
- aws:code-whisperer
244
- aws:cognito
245
- aws:command-line-interface
246
- aws:comprehend
247
- aws:comprehend-medical
248
- aws:compute-optimizer
249
- aws:config
250
- aws:connect
251
- aws:console-mobile-application
252
- aws:control-tower
253
- aws:corretto
254
- aws:cost-and-usage-report
255
- aws:cost-explorer
256
- aws:data-exchange
257
- aws:data-pipeline
258
- aws:data-sync
259
- aws:data-zone
260
- aws:database-migration-service
261
- aws:deep-composer
262
- aws:deep-learning-amis
263
- aws:deep-learning-containers
264
- aws:deep-lens
265
- aws:deep-racer
266
- aws:detective
267
- aws:dev-ops-guru
268
- aws:device-farm
269
- aws:direct-connect
270
- aws:directory-service
271
- aws:distro-for-open-telemetry
272
- aws:document-db
273
- aws:dynamo-db
274
- aws:ec2
275
- aws:ec2-auto-scaling
276
- aws:ec2-image-builder
277
- aws:ecs-anywhere
278
- aws:efs
279
- aws:eks-anywhere
280
- aws:eks-cloud
281
- aws:eks-distro
282
- aws:elasti-cache
283
- aws:elastic-beanstalk
284
- aws:elastic-block-store
285
- aws:elastic-container-registry
286
- aws:elastic-container-service
287
- aws:elastic-disaster-recovery
288
- aws:elastic-fabric-adapter
289
- aws:elastic-inference
290
- aws:elastic-kubernetes-service
291
- aws:elastic-load-balancing
292
- aws:elastic-transcoder
293
- aws:elemental-appliances-software
294
- aws:elemental-conductor
295
- aws:elemental-delta
296
- aws:elemental-link
297
- aws:elemental-live
298
- aws:elemental-media-connect
299
- aws:elemental-media-convert
300
- aws:elemental-media-live
301
- aws:elemental-media-package
302
- aws:elemental-media-store
303
- aws:elemental-media-tailor
304
- aws:elemental-server
305
- aws:emr
306
- aws:event-bridge
307
- aws:express-workflows
308
- aws:fargate
309
- aws:fault-injection-simulator
310
- aws:file-cache
311
- aws:fin-space
312
- aws:firewall-manager
313
- aws:forecast
314
- aws:fraud-detector
315
- aws:free-rtos
316
- aws:fsx
317
- aws:fsx-for-lustre
318
- aws:fsx-for-net-app-ontap
319
- aws:fsx-for-open-zfs
320
- aws:fsx-for-wfs
321
- aws:game-kit
322
- aws:game-lift
323
- aws:game-sparks
324
- aws:genomics-cli
325
- aws:global-accelerator
326
- aws:glue
327
- aws:glue-data-brew
328
- aws:glue-elastic-views
329
- aws:ground-station
330
- aws:guard-duty
331
- aws:health-lake
332
- aws:honeycode
333
- aws:iam-identity-center
334
- aws:identity-and-access-management
335
- aws:inspector
336
- aws:interactive-video-service
337
- aws:io-t-1-click
338
- aws:io-t-analytics
339
- aws:io-t-button
340
- aws:io-t-core
341
- aws:io-t-device-defender
342
- aws:io-t-device-management
343
- aws:io-t-edu-kit
344
- aws:io-t-events
345
- aws:io-t-express-link
346
- aws:io-t-fleet-wise
347
- aws:io-t-greengrass
348
- aws:io-t-robo-runner
349
- aws:io-t-site-wise
350
- aws:io-t-things-graph
351
- aws:io-t-twin-maker
352
- aws:iq
353
- aws:kendra
354
- aws:key-management-service
355
- aws:keyspaces
356
- aws:kinesis
357
- aws:kinesis-data-analytics
358
- aws:kinesis-data-streams
359
- aws:kinesis-firehose
360
- aws:kinesis-video-streams
361
- aws:lake-formation
362
- aws:lambda
363
- aws:launch-wizard
364
- aws:lex
365
- aws:license-manager
366
- aws:lightsail
367
- aws:local-zones
368
- aws:location-service
369
- aws:lookout-for-equipment
370
- aws:lookout-for-metrics
371
- aws:lookout-for-vision
372
- aws:lumberyard
373
- aws:macie
374
- aws:mainframe-modernization
375
- aws:managed-blockchain
376
- aws:managed-grafana
377
- aws:managed-service-for-prometheus
378
- aws:managed-services
379
- aws:managed-streaming-for-apache-kafka
380
- aws:managed-workflows-for-apache-airflow
381
- aws:management-console
382
- aws:marketplace-dark
383
- aws:marketplace-light
384
- aws:memory-db-for-redis
385
- aws:migration-evaluator
386
- aws:migration-hub
387
- aws:monitron
388
- aws:mq
389
- aws:neptune
390
- aws:network-firewall
391
- aws:neuron
392
- aws:nice-dcv
393
- aws:nice-engin-frame
394
- aws:nimble-studio
395
- aws:nitro-enclaves
396
- aws:omics
397
- aws:open-3d-engine
398
- aws:open-search-service
399
- aws:ops-works
400
- aws:organizations
401
- aws:outposts-family
402
- aws:outposts-rack
403
- aws:outposts-servers
404
- aws:panorama
405
- aws:parallel-cluster
406
- aws:personal-health-dashboard
407
- aws:personalize
408
- aws:pinpoint
409
- aws:pinpoint-apis
410
- aws:polly
411
- aws:private-5g
412
- aws:private-certificate-authority
413
- aws:private-link
414
- aws:professional-services
415
- aws:proton
416
- aws:quantum-ledger-database
417
- aws:quick-sight
418
- aws:rds
419
- aws:rds-on-vmware
420
- aws:re-post
421
- aws:red-hat-open-shift-service-on-aws
422
- aws:redshift
423
- aws:rekognition
424
- aws:reserved-instance-reporting
425
- aws:resilience-hub
426
- aws:resource-access-manager
427
- aws:resource-explorer
428
- aws:robo-maker
429
- aws:route-53
430
- aws:s3-on-outposts
431
- aws:sage-maker
432
- aws:sage-maker-ground-truth
433
- aws:sage-maker-studio-lab
434
- aws:savings-plans
435
- aws:secrets-manager
436
- aws:security-hub
437
- aws:security-lake
438
- aws:server-migration-service
439
- aws:serverless-application-repository
440
- aws:service-catalog
441
- aws:service-management-connector
442
- aws:shield
443
- aws:signer
444
- aws:sim-space-weaver
445
- aws:simple-email-service
446
- aws:simple-notification-service
447
- aws:simple-queue-service
448
- aws:simple-storage-service
449
- aws:simple-storage-service-glacier
450
- aws:site-to-site-vpn
451
- aws:snowball
452
- aws:snowball-edge
453
- aws:snowcone
454
- aws:snowmobile
455
- aws:step-functions
456
- aws:storage-gateway
457
- aws:sumerian
458
- aws:supply-chain
459
- aws:support
460
- aws:systems-manager
461
- aws:tensor-flow-on-aws
462
- aws:textract
463
- aws:thinkbox-deadline
464
- aws:thinkbox-frost
465
- aws:thinkbox-krakatoa
466
- aws:thinkbox-sequoia
467
- aws:thinkbox-stoke
468
- aws:thinkbox-xmesh
469
- aws:timestream
470
- aws:tools-and-sdks
471
- aws:torch-serve
472
- aws:training-certification
473
- aws:transcribe
474
- aws:transfer-family
475
- aws:transit-gateway
476
- aws:translate
477
- aws:trusted-advisor
478
- aws:verified-access
479
- aws:verified-permissions
480
- aws:virtual-private-cloud
481
- aws:vmware-cloud-on-aws
482
- aws:vpc-lattice
483
- aws:waf
484
- aws:wavelength
485
- aws:well-architected-tool
486
- aws:wickr
487
- aws:work-docs
488
- aws:work-docs-sdk
489
- aws:work-link
490
- aws:work-mail
491
- aws:work-spaces-family
492
- aws:x-ray
493
- azure:abs-member
494
- azure:active-directory-connect-health
495
- azure:activity-log
496
- azure:administrative-units
497
- azure:advisor
498
- azure:ai-studio
499
- azure:aks-automatic
500
- azure:aks-istio
501
- azure:alerts
502
- azure:all-resources
503
- azure:analysis-services
504
- azure:anomaly-detector
505
- azure:api-center
506
- azure:api-connections
507
- azure:api-management-services
508
- azure:api-proxy
509
- azure:app-compliance-automation
510
- azure:app-configuration
511
- azure:app-registrations
512
- azure:app-service-certificates
513
- azure:app-service-domains
514
- azure:app-service-environments
515
- azure:app-service-plans
516
- azure:app-services
517
- azure:app-space
518
- azure:app-space-component
519
- azure:applens
520
- azure:application-gateway-containers
521
- azure:application-gateways
522
- azure:application-group
523
- azure:application-insights
524
- azure:application-security-groups
525
- azure:aquila
526
- azure:arc-data-services
527
- azure:arc-kubernetes
528
- azure:arc-machines
529
- azure:arc-postgre-sql
530
- azure:arc-sql-managed-instance
531
- azure:arc-sql-server
532
- azure:atm-multistack
533
- azure:auto-scale
534
- azure:automanaged-vm
535
- azure:automation-accounts
536
- azure:availability-sets
537
- azure:avs-vm
538
- azure:azure-a
539
- azure:azure-ad-b2c
540
- azure:azure-api-for-fhir
541
- azure:azure-applied-ai-services
542
- azure:azure-arc
543
- azure:azure-attestation
544
- azure:azure-backup-center
545
- azure:azure-blockchain-service
546
- azure:azure-center-for-sap
547
- azure:azure-chaos-studio
548
- azure:azure-cloud-shell
549
- azure:azure-communication-services
550
- azure:azure-communications-gateway
551
- azure:azure-compute-galleries
552
- azure:azure-cosmos-db
553
- azure:azure-data-catalog
554
- azure:azure-data-explorer-clusters
555
- azure:azure-database-maria-db-server
556
- azure:azure-database-migration-services
557
- azure:azure-database-my-sql-server
558
- azure:azure-database-postgre-sql-server
559
- azure:azure-database-postgre-sql-server-group
560
- azure:azure-databox-gateway
561
- azure:azure-databricks
562
- azure:azure-deployment-environments
563
- azure:azure-dev-ops
564
- azure:azure-dev-tunnels
565
- azure:azure-edge-hardware-center
566
- azure:azure-experimentation-studio
567
- azure:azure-fileshares
568
- azure:azure-firewall-manager
569
- azure:azure-firewall-policy
570
- azure:azure-hcp-cache
571
- azure:azure-hpc-workbenches
572
- azure:azure-hybrid-center
573
- azure:azure-information-protection
574
- azure:azure-io-t-operations
575
- azure:azure-lighthouse
576
- azure:azure-load-testing
577
- azure:azure-managed-grafana
578
- azure:azure-maps-accounts
579
- azure:azure-media-service
580
- azure:azure-migrate
581
- azure:azure-monitor-dashboard
582
- azure:azure-monitor-pipeline
583
- azure:azure-monitors-for-sap-solutions
584
- azure:azure-net-app-files
585
- azure:azure-network-function-manager
586
- azure:azure-network-function-manager-functions
587
- azure:azure-object-understanding
588
- azure:azure-open-ai
589
- azure:azure-operator-5g-core
590
- azure:azure-operator-insights
591
- azure:azure-operator-nexus
592
- azure:azure-operator-service-manager
593
- azure:azure-orbital
594
- azure:azure-programmable-connectivity
595
- azure:azure-purview-accounts
596
- azure:azure-quotas
597
- azure:azure-red-hat-open-shift
598
- azure:azure-sentinel
599
- azure:azure-service-bus
600
- azure:azure-sphere
601
- azure:azure-spring-apps
602
- azure:azure-sql
603
- azure:azure-sql-edge
604
- azure:azure-sql-server-stretch-databases
605
- azure:azure-sql-vm
606
- azure:azure-stack
607
- azure:azure-stack-edge
608
- azure:azure-stack-hci-sizer
609
- azure:azure-storage-mover
610
- azure:azure-support-center-blue
611
- azure:azure-sustainability
612
- azure:azure-synapse-analytics
613
- azure:azure-token-service
614
- azure:azure-video-indexer
615
- azure:azure-virtual-desktop
616
- azure:azure-vmware-solution
617
- azure:azure-workbooks
618
- azure:azurite
619
- azure:backlog
620
- azure:backup-vault
621
- azure:bare-metal-infrastructure
622
- azure:bastions
623
- azure:batch-accounts
624
- azure:batch-ai
625
- azure:biz-talk
626
- azure:blob-block
627
- azure:blob-page
628
- azure:blockchain-applications
629
- azure:blueprints
630
- azure:bonsai
631
- azure:bot-services
632
- azure:branch
633
- azure:browser
634
- azure:bug
635
- azure:builds
636
- azure:business-process-tracking
637
- azure:cache
638
- azure:cache-redis
639
- azure:capacity
640
- azure:capacity-reservation-groups
641
- azure:cdn-profiles
642
- azure:central-service-instance-for-sap
643
- azure:ceres
644
- azure:change-analysis
645
- azure:client-apps
646
- azure:cloud-services-classic
647
- azure:cloud-services-extended-support
648
- azure:cloud-test
649
- azure:code
650
- azure:code-optimization
651
- azure:cognitive-search
652
- azure:cognitive-services
653
- azure:cognitive-services-decisions
654
- azure:collaborative-service
655
- azure:commit
656
- azure:community-images
657
- azure:compliance
658
- azure:compliance-center
659
- azure:compute-fleet
660
- azure:computer-vision
661
- azure:conditional-access
662
- azure:confidential-ledgers
663
- azure:connected-cache
664
- azure:connected-vehicle-platform
665
- azure:connections
666
- azure:consortium
667
- azure:container-apps-environments
668
- azure:container-instances
669
- azure:container-registries
670
- azure:container-services-deprecated
671
- azure:content-moderators
672
- azure:content-safety
673
- azure:controls
674
- azure:controls-horizontal
675
- azure:cost-alerts
676
- azure:cost-analysis
677
- azure:cost-budgets
678
- azure:cost-export
679
- azure:cost-management
680
- azure:cost-management-and-billing
681
- azure:counter
682
- azure:cubes
683
- azure:custom-ip-prefix
684
- azure:custom-vision
685
- azure:customer-lockbox-for-microsoft-azure
686
- azure:dashboard
687
- azure:dashboard-hub
688
- azure:data-box
689
- azure:data-collection-rules
690
- azure:data-factories
691
- azure:data-lake-analytics
692
- azure:data-lake-storage-gen1
693
- azure:data-lake-store-gen1
694
- azure:data-share-invitations
695
- azure:data-shares
696
- azure:database-instance-for-sap
697
- azure:ddo-s-protection-plans
698
- azure:dedicated-hsm
699
- azure:defender-cm-local-manager
700
- azure:defender-dcs-controller
701
- azure:defender-distributer-control-system
702
- azure:defender-engineering-station
703
- azure:defender-external-management
704
- azure:defender-freezer-monitor
705
- azure:defender-historian
706
- azure:defender-hmi
707
- azure:defender-industrial-packaging-system
708
- azure:defender-industrial-printer
709
- azure:defender-industrial-robot
710
- azure:defender-industrial-scale-system
711
- azure:defender-marquee
712
- azure:defender-meter
713
- azure:defender-plc
714
- azure:defender-pneumatic-device
715
- azure:defender-programable-board
716
- azure:defender-relay
717
- azure:defender-robot-controller
718
- azure:defender-rtu
719
- azure:defender-sensor
720
- azure:defender-slot
721
- azure:defender-web-guiding-system
722
- azure:detonation
723
- azure:dev-console
724
- azure:dev-ops-starter
725
- azure:dev-test-labs
726
- azure:device-compliance
727
- azure:device-configuration
728
- azure:device-enrollment
729
- azure:device-provisioning-services
730
- azure:device-security-apple
731
- azure:device-security-google
732
- azure:device-security-windows
733
- azure:device-update-io-t-hub
734
- azure:devices
735
- azure:diagnostics-settings
736
- azure:digital-twins
737
- azure:disk-encryption-sets
738
- azure:disk-pool
739
- azure:disks
740
- azure:disks-classic
741
- azure:disks-snapshots
742
- azure:dns-multistack
743
- azure:dns-private-resolver
744
- azure:dns-security-policy
745
- azure:dns-zones
746
- azure:download
747
- azure:e-books
748
- azure:edge-management
749
- azure:education
750
- azure:elastic-job-agents
751
- azure:elastic-san
752
- azure:endpoint-analytics
753
- azure:enterprise-applications
754
- azure:entra-connect
755
- azure:entra-connect-health
756
- azure:entra-connect-sync
757
- azure:entra-domain-services
758
- azure:entra-global-secure-access
759
- azure:entra-id-protection
760
- azure:entra-identity-custom-roles
761
- azure:entra-identity-licenses
762
- azure:entra-identity-risky-signins
763
- azure:entra-identity-risky-users
764
- azure:entra-identity-roles-and-administrators
765
- azure:entra-internet-access
766
- azure:entra-managed-identities
767
- azure:entra-private-access
768
- azure:entra-privleged-identity-management
769
- azure:entra-verified-id
770
- azure:error
771
- azure:event-grid-domains
772
- azure:event-grid-subscriptions
773
- azure:event-grid-topics
774
- azure:event-hub-clusters
775
- azure:event-hubs
776
- azure:exchange-access
777
- azure:exchange-on-premises-access
778
- azure:express-route-circuits
779
- azure:express-route-direct
780
- azure:express-route-traffic-collector
781
- azure:extended-security-updates
782
- azure:extensions
783
- azure:external-identities
784
- azure:face-apis
785
- azure:feature-previews
786
- azure:fhir-service
787
- azure:fiji
788
- azure:file
789
- azure:files
790
- azure:firewalls
791
- azure:folder-blank
792
- azure:folder-website
793
- azure:form-recognizers
794
- azure:free-services
795
- azure:front-door-and-cdn-profiles
796
- azure:ftp
797
- azure:function-apps
798
- azure:gear
799
- azure:genomics
800
- azure:genomics-accounts
801
- azure:globe-error
802
- azure:globe-success
803
- azure:globe-warning
804
- azure:groups
805
- azure:guide
806
- azure:hd-insight-clusters
807
- azure:hdi-aks-cluster
808
- azure:heart
809
- azure:help-and-support
810
- azure:host-groups
811
- azure:host-pools
812
- azure:hosts
813
- azure:ic-m-troubleshooting
814
- azure:identity-governance
815
- azure:identity-multi-factor-authentication
816
- azure:identity-secure-score
817
- azure:image
818
- azure:image-definitions
819
- azure:image-templates
820
- azure:image-versions
821
- azure:images
822
- azure:immersive-readers
823
- azure:import-export-jobs
824
- azure:industrial-io-t
825
- azure:information
826
- azure:infrastructure-backup
827
- azure:input-output
828
- azure:instance-pools
829
- azure:integration-accounts
830
- azure:integration-environments
831
- azure:integration-service-environments
832
- azure:internet-analyzer-profiles
833
- azure:intune
834
- azure:intune-app-protection
835
- azure:intune-for-education
836
- azure:intune-trends
837
- azure:io-t-central-applications
838
- azure:io-t-edge
839
- azure:io-t-hub
840
- azure:ip-address-manager
841
- azure:ip-groups
842
- azure:journey-hub
843
- azure:key-vaults
844
- azure:keys
845
- azure:kubernetes-fleet-manager
846
- azure:kubernetes-services
847
- azure:lab-accounts
848
- azure:lab-services
849
- azure:language
850
- azure:language-understanding
851
- azure:launch-portal
852
- azure:learn
853
- azure:load-balancer-hub
854
- azure:load-balancers
855
- azure:load-test
856
- azure:load-testing
857
- azure:local-network-gateways
858
- azure:location
859
- azure:log-analytics-query-pack
860
- azure:log-analytics-workspaces
861
- azure:log-streaming
862
- azure:logic-apps
863
- azure:logic-apps-custom-connector
864
- azure:machine-learning
865
- azure:machine-learning-studio-classic-web-services
866
- azure:machine-learning-studio-web-service-plans
867
- azure:machine-learning-studio-workspaces
868
- azure:machines-azure-arc
869
- azure:maintenance-configuration
870
- azure:managed-applications-center
871
- azure:managed-database
872
- azure:managed-desktop
873
- azure:managed-dev-ops-pools
874
- azure:managed-file-shares
875
- azure:managed-identities
876
- azure:managed-instance-apache-cassandra
877
- azure:managed-service-fabric
878
- azure:management-groups
879
- azure:management-portal
880
- azure:marketplace
881
- azure:marketplace-management
882
- azure:med-tech-service
883
- azure:media
884
- azure:media-file
885
- azure:mesh-applications
886
- azure:metrics
887
- azure:metrics-advisor
888
- azure:microsoft-defender-easm
889
- azure:microsoft-defender-for-cloud
890
- azure:microsoft-defender-for-io-t
891
- azure:microsoft-dev-box
892
- azure:mindaro
893
- azure:mission-landing-zone
894
- azure:mobile
895
- azure:mobile-engagement
896
- azure:mobile-networks
897
- azure:modular-data-center
898
- azure:module
899
- azure:monitor
900
- azure:monitor-health-models
901
- azure:multi-tenancy
902
- azure:multifactor-authentication
903
- azure:my-customers
904
- azure:nat
905
- azure:network-interfaces
906
- azure:network-managers
907
- azure:network-security-groups
908
- azure:network-security-perimeters
909
- azure:network-watcher
910
- azure:notification-hub-namespaces
911
- azure:notification-hubs
912
- azure:offers
913
- azure:on-premises-data-gateways
914
- azure:open-supply-chain-platform
915
- azure:operation-log-classic
916
- azure:oracle-database
917
- azure:os-images-classic
918
- azure:osconfig
919
- azure:outbound-connection
920
- azure:partner-namespace
921
- azure:partner-registration
922
- azure:partner-topic
923
- azure:peering-service
924
- azure:peerings
925
- azure:personalizers
926
- azure:plans
927
- azure:policy
928
- azure:power
929
- azure:power-bi-embedded
930
- azure:power-platform
931
- azure:power-up
932
- azure:powershell
933
- azure:preview-features
934
- azure:private-endpoints
935
- azure:private-link
936
- azure:private-link-service
937
- azure:private-link-services
938
- azure:process-explorer
939
- azure:production-ready-database
940
- azure:proximity-placement-groups
941
- azure:public-ip-addresses
942
- azure:public-ip-addresses-classic
943
- azure:public-ip-prefixes
944
- azure:qn-a-makers
945
- azure:quickstart-center
946
- azure:recent
947
- azure:recovery-services-vaults
948
- azure:region-management
949
- azure:relays
950
- azure:remote-rendering
951
- azure:reservations
952
- azure:reserved-capacity
953
- azure:reserved-ip-addresses-classic
954
- azure:resource-explorer
955
- azure:resource-graph-explorer
956
- azure:resource-group-list
957
- azure:resource-groups
958
- azure:resource-guard
959
- azure:resource-linked
960
- azure:resource-management-private-link
961
- azure:resource-mover
962
- azure:resources-provider
963
- azure:restore-points
964
- azure:restore-points-collections
965
- azure:route-filters
966
- azure:route-tables
967
- azure:rtos
968
- azure:savings-plans
969
- azure:scheduler
970
- azure:scheduler-job-collections
971
- azure:scvmm-management-servers
972
- azure:search
973
- azure:search-grid
974
- azure:security
975
- azure:security-baselines
976
- azure:send-grid-accounts
977
- azure:server-farm
978
- azure:serverless-search
979
- azure:service-catalog-mad
980
- azure:service-endpoint-policies
981
- azure:service-fabric-clusters
982
- azure:service-health
983
- azure:service-providers
984
- azure:shared-image-galleries
985
- azure:signal-r
986
- azure:software-as-a-service
987
- azure:software-updates
988
- azure:solutions
989
- azure:sonic-dash
990
- azure:spatial-anchor-accounts
991
- azure:speech-services
992
- azure:spot-vm
993
- azure:spot-vmss
994
- azure:sql-data-warehouses
995
- azure:sql-database
996
- azure:sql-elastic-pools
997
- azure:sql-managed-instance
998
- azure:sql-server
999
- azure:sql-server-registries
1000
- azure:ssd
1001
- azure:ssh-keys
1002
- azure:ssis-lift-and-shift-ir
1003
- azure:stack-hci-premium
1004
- azure:static-apps
1005
- azure:stor-simple-data-managers
1006
- azure:stor-simple-device-managers
1007
- azure:storage-accounts
1008
- azure:storage-accounts-classic
1009
- azure:storage-actions
1010
- azure:storage-azure-files
1011
- azure:storage-container
1012
- azure:storage-explorer
1013
- azure:storage-functions
1014
- azure:storage-queue
1015
- azure:storage-sync-services
1016
- azure:stream-analytics-jobs
1017
- azure:subnet
1018
- azure:subscriptions
1019
- azure:system-topic
1020
- azure:table
1021
- azure:tag
1022
- azure:tags
1023
- azure:targets-management
1024
- azure:template-specs
1025
- azure:templates
1026
- azure:tenant-properties
1027
- azure:tenant-status
1028
- azure:test-base
1029
- azure:tfs-vc-repository
1030
- azure:time-series-data-sets
1031
- azure:time-series-insights-access-policies
1032
- azure:time-series-insights-environments
1033
- azure:time-series-insights-event-sources
1034
- azure:toolbox
1035
- azure:traffic-manager-profiles
1036
- azure:translator-text
1037
- azure:troubleshoot
1038
- azure:universal-print
1039
- azure:update-management-center
1040
- azure:updates
1041
- azure:user-privacy
1042
- azure:user-settings
1043
- azure:user-subscriptions
1044
- azure:users
1045
- azure:verifiable-credentials
1046
- azure:verification-as-a-service
1047
- azure:versions
1048
- azure:video-analyzers
1049
- azure:virtual-clusters
1050
- azure:virtual-enclaves
1051
- azure:virtual-instance-for-sap
1052
- azure:virtual-machine
1053
- azure:virtual-machines-classic
1054
- azure:virtual-network-gateways
1055
- azure:virtual-networks
1056
- azure:virtual-networks-classic
1057
- azure:virtual-router
1058
- azure:virtual-visits-builder
1059
- azure:virtual-wan-hub
1060
- azure:virtual-wans
1061
- azure:vm-app-definitions
1062
- azure:vm-app-versions
1063
- azure:vm-image-version
1064
- azure:vm-images-classic
1065
- azure:vm-scale-sets
1066
- azure:wac
1067
- azure:wac-installer
1068
- azure:web-app-database
1069
- azure:web-application-firewall-policies-waf
1070
- azure:web-jobs
1071
- azure:web-slots
1072
- azure:web-test
1073
- azure:website-power
1074
- azure:website-staging
1075
- azure:windows-notification-services
1076
- azure:windows10-core-services
1077
- azure:workbooks
1078
- azure:worker-container-app
1079
- azure:workflow
1080
- azure:workspace-gateway
1081
- azure:workspaces
1082
- gcp:access-context-manager
1083
- gcp:administration
1084
- gcp:advanced-agent-modeling
1085
- gcp:advanced-solutions-lab
1086
- gcp:agent-assist
1087
- gcp:ai-hub
1088
- gcp:ai-platform
1089
- gcp:ai-platform-unified
1090
- gcp:analytics-hub
1091
- gcp:anthos
1092
- gcp:anthos-config-management
1093
- gcp:anthos-service-mesh
1094
- gcp:api
1095
- gcp:api-analytics
1096
- gcp:api-monetization
1097
- gcp:apigee-api-platform
1098
- gcp:apigee-sense
1099
- gcp:app-engine
1100
- gcp:artifact-registry
1101
- gcp:asset-inventory
1102
- gcp:assured-workloads
1103
- gcp:auto-ml
1104
- gcp:auto-ml-natural-language
1105
- gcp:auto-ml-tables
1106
- gcp:auto-ml-translation
1107
- gcp:auto-ml-video-intelligence
1108
- gcp:auto-ml-vision
1109
- gcp:bare-metal-solutions
1110
- gcp:batch
1111
- gcp:beyondcorp
1112
- gcp:big-query
1113
- gcp:bigtable
1114
- gcp:billing
1115
- gcp:binary-authorization
1116
- gcp:catalog
1117
- gcp:certificate-authority-service
1118
- gcp:certificate-manager
1119
- gcp:cloud-api-gateway
1120
- gcp:cloud-apis
1121
- gcp:cloud-armor
1122
- gcp:cloud-asset-inventory
1123
- gcp:cloud-audit-logs
1124
- gcp:cloud-build
1125
- gcp:cloud-cdn
1126
- gcp:cloud-code
1127
- gcp:cloud-composer
1128
- gcp:cloud-data-fusion
1129
- gcp:cloud-deploy
1130
- gcp:cloud-deployment-manager
1131
- gcp:cloud-dns
1132
- gcp:cloud-domains
1133
- gcp:cloud-ekm
1134
- gcp:cloud-endpoints
1135
- gcp:cloud-external-ip-addresses
1136
- gcp:cloud-firewall-rules
1137
- gcp:cloud-for-marketing
1138
- gcp:cloud-functions
1139
- gcp:cloud-generic
1140
- gcp:cloud-gpu
1141
- gcp:cloud-healthcare-api
1142
- gcp:cloud-healthcare-marketplace
1143
- gcp:cloud-hsm
1144
- gcp:cloud-ids
1145
- gcp:cloud-inference-api
1146
- gcp:cloud-interconnect
1147
- gcp:cloud-jobs-api
1148
- gcp:cloud-load-balancing
1149
- gcp:cloud-logging
1150
- gcp:cloud-media-edge
1151
- gcp:cloud-monitoring
1152
- gcp:cloud-nat
1153
- gcp:cloud-natural-language-api
1154
- gcp:cloud-network
1155
- gcp:cloud-ops
1156
- gcp:cloud-optimization-ai
1157
- gcp:cloud-optimization-ai-fleet-routing-api
1158
- gcp:cloud-router
1159
- gcp:cloud-routes
1160
- gcp:cloud-run
1161
- gcp:cloud-run-for-anthos
1162
- gcp:cloud-scheduler
1163
- gcp:cloud-security-scanner
1164
- gcp:cloud-shell
1165
- gcp:cloud-spanner
1166
- gcp:cloud-sql
1167
- gcp:cloud-storage
1168
- gcp:cloud-tasks
1169
- gcp:cloud-test-lab
1170
- gcp:cloud-tpu
1171
- gcp:cloud-translation-api
1172
- gcp:cloud-vision-api
1173
- gcp:cloud-vpn
1174
- gcp:compute-engine
1175
- gcp:configuration-management
1176
- gcp:connectivity-test
1177
- gcp:connectors
1178
- gcp:contact-center-ai
1179
- gcp:container-optimized-os
1180
- gcp:container-registry
1181
- gcp:data-catalog
1182
- gcp:data-labeling
1183
- gcp:data-layers
1184
- gcp:data-loss-prevention-api
1185
- gcp:data-qn-a
1186
- gcp:data-studio
1187
- gcp:data-transfer
1188
- gcp:database-migration-service
1189
- gcp:dataflow
1190
- gcp:datalab
1191
- gcp:dataplex
1192
- gcp:datapol
1193
- gcp:dataprep
1194
- gcp:dataproc
1195
- gcp:dataproc-metastore
1196
- gcp:datashare
1197
- gcp:datastore
1198
- gcp:datastream
1199
- gcp:debugger
1200
- gcp:developer-portal
1201
- gcp:dialogflow
1202
- gcp:dialogflow-cx
1203
- gcp:dialogflow-insights
1204
- gcp:document-ai
1205
- gcp:early-access-center
1206
- gcp:error-reporting
1207
- gcp:eventarc
1208
- gcp:filestore
1209
- gcp:financial-services-marketplace
1210
- gcp:firestore
1211
- gcp:fleet-engine
1212
- gcp:free-trial
1213
- gcp:game-servers
1214
- gcp:gce-systems-management
1215
- gcp:genomics
1216
- gcp:gke-on-prem
1217
- gcp:google-cloud-marketplace
1218
- gcp:google-kubernetes-engine
1219
- gcp:google-maps-platform
1220
- gcp:healthcare-nlp-api
1221
- gcp:home
1222
- gcp:identity-and-access-management
1223
- gcp:identity-aware-proxy
1224
- gcp:identity-platform
1225
- gcp:iot-core
1226
- gcp:iot-edge
1227
- gcp:key-access-justifications
1228
- gcp:key-management-service
1229
- gcp:kuberun
1230
- gcp:launcher
1231
- gcp:local-ssd
1232
- gcp:looker
1233
- gcp:managed-service-for-microsoft-active-directory
1234
- gcp:media-translation-api
1235
- gcp:memorystore
1236
- gcp:migrate-for-anthos
1237
- gcp:migrate-for-compute-engine
1238
- gcp:my-cloud
1239
- gcp:network-connectivity-center
1240
- gcp:network-intelligence-center
1241
- gcp:network-security
1242
- gcp:network-tiers
1243
- gcp:network-topology
1244
- gcp:onboarding
1245
- gcp:os-configuration-management
1246
- gcp:os-inventory-management
1247
- gcp:os-patch-management
1248
- gcp:partner-interconnect
1249
- gcp:partner-portal
1250
- gcp:performance-dashboard
1251
- gcp:permissions
1252
- gcp:persistent-disk
1253
- gcp:phishing-protection
1254
- gcp:policy-analyzer
1255
- gcp:premium-network-tier
1256
- gcp:private-connectivity
1257
- gcp:private-service-connect
1258
- gcp:producer-portal
1259
- gcp:profiler
1260
- gcp:project
1261
- gcp:pub-sub
1262
- gcp:quantum-engine
1263
- gcp:quotas
1264
- gcp:real-world-insights
1265
- gcp:recommendations-ai
1266
- gcp:release-notes
1267
- gcp:retail-api
1268
- gcp:risk-manager
1269
- gcp:runtime-config
1270
- gcp:secret-manager
1271
- gcp:security
1272
- gcp:security-command-center
1273
- gcp:security-health-advisor
1274
- gcp:security-key-enforcement
1275
- gcp:service-discovery
1276
- gcp:speech-to-text
1277
- gcp:stackdriver
1278
- gcp:standard-network-tier
1279
- gcp:stream-suite
1280
- gcp:support
1281
- gcp:tensorflow-enterprise
1282
- gcp:text-to-speech
1283
- gcp:tools-for-powershell
1284
- gcp:trace
1285
- gcp:traffic-director
1286
- gcp:transfer
1287
- gcp:transfer-appliance
1288
- gcp:user-preferences
1289
- gcp:vertex-ai
1290
- gcp:video-intelligence-api
1291
- gcp:virtual-private-cloud
1292
- gcp:visual-inspection
1293
- gcp:vmware-engine
1294
- gcp:web-risk
1295
- gcp:web-security-scanner
1296
- gcp:workflows
1297
- gcp:workload-identity-pool
1298
- tech:aarch64
1299
- tech:adobe-illustrator
1300
- tech:adobe-photoshop
1301
- tech:adobe-premiere-pro
1302
- tech:adobe-xd
1303
- tech:adonis-js
1304
- tech:after-effects
1305
- tech:airflow
1306
- tech:akka
1307
- tech:algolia
1308
- tech:alpine-js
1309
- tech:amazon-web-services
1310
- tech:anaconda
1311
- tech:android
1312
- tech:android-studio
1313
- tech:angular
1314
- tech:angular-js
1315
- tech:ansible
1316
- tech:ant-design
1317
- tech:apache
1318
- tech:apl
1319
- tech:appcelerator
1320
- tech:apple
1321
- tech:apple-safari
1322
- tech:appwrite
1323
- tech:arch-linux
1324
- tech:arduino
1325
- tech:argo-cd
1326
- tech:astro
1327
- tech:atom
1328
- tech:autodesk-maya
1329
- tech:autodesk-shot-grid
1330
- tech:awk
1331
- tech:azios
1332
- tech:azure
1333
- tech:azure-devops
1334
- tech:azure-sql-database
1335
- tech:babel
1336
- tech:backbone-js
1337
- tech:ballerina
1338
- tech:bamboo
1339
- tech:bash
1340
- tech:behance
1341
- tech:bitbucket
1342
- tech:blender
1343
- tech:bootstrap
1344
- tech:bower
1345
- tech:browserstack
1346
- tech:bulma
1347
- tech:bun
1348
- tech:c
1349
- tech:cairo-graphics
1350
- tech:cake-php
1351
- tech:canva
1352
- tech:capacitor
1353
- tech:cassandra
1354
- tech:cent-os
1355
- tech:chrome
1356
- tech:circle-ci
1357
- tech:clarity
1358
- tech:clion
1359
- tech:clojure
1360
- tech:clojure-script
1361
- tech:cloudflare
1362
- tech:cloudflare-workers
1363
- tech:cmake
1364
- tech:code-igniter
1365
- tech:code-pen
1366
- tech:codeac
1367
- tech:codecov
1368
- tech:coffee-script
1369
- tech:composer
1370
- tech:confluence
1371
- tech:consul
1372
- tech:contao
1373
- tech:corejs
1374
- tech:cosmosdb
1375
- tech:couchdb
1376
- tech:cplusplus
1377
- tech:crystal
1378
- tech:csharp
1379
- tech:css3
1380
- tech:cucumber
1381
- tech:cypress
1382
- tech:d3js
1383
- tech:dart
1384
- tech:data-grip
1385
- tech:data-spell
1386
- tech:dbeaver
1387
- tech:debian
1388
- tech:deno
1389
- tech:devicon
1390
- tech:digital-ocean
1391
- tech:discord-js
1392
- tech:django
1393
- tech:django-rest
1394
- tech:docker
1395
- tech:doctrine
1396
- tech:dropwizard
1397
- tech:drupal
1398
- tech:eclipse-ceylon
1399
- tech:eclipse-ide
1400
- tech:eclipse-vert-x
1401
- tech:elasticbeats
1402
- tech:elasticsearch
1403
- tech:electron
1404
- tech:eleventy-11ty
1405
- tech:elixir
1406
- tech:elm
1407
- tech:embedded-c
1408
- tech:ember-js
1409
- tech:envoy
1410
- tech:erlang
1411
- tech:eslint
1412
- tech:express
1413
- tech:facebook
1414
- tech:fast-api
1415
- tech:fastify
1416
- tech:fauna
1417
- tech:feathers
1418
- tech:fedora
1419
- tech:figma
1420
- tech:file-zilla
1421
- tech:firebase
1422
- tech:firefox
1423
- tech:flask
1424
- tech:flutter
1425
- tech:fortran
1426
- tech:foundation
1427
- tech:fsharp
1428
- tech:gatling
1429
- tech:gatsby
1430
- tech:gazebo
1431
- tech:gcc
1432
- tech:gentoo
1433
- tech:ghost
1434
- tech:gimp
1435
- tech:git
1436
- tech:gitbook
1437
- tech:github
1438
- tech:github-actions
1439
- tech:github-codespaces
1440
- tech:gitlab
1441
- tech:gitpod
1442
- tech:gitter
1443
- tech:gnu-emacs
1444
- tech:go
1445
- tech:go-land
1446
- tech:godot-engine
1447
- tech:google
1448
- tech:google-cloud
1449
- tech:gradle
1450
- tech:grafana
1451
- tech:grails
1452
- tech:graphql
1453
- tech:groovy
1454
- tech:grunt-js
1455
- tech:gulp-js
1456
- tech:hadoop
1457
- tech:handlebars
1458
- tech:hardhat
1459
- tech:harvester
1460
- tech:hashicorp-vault
1461
- tech:haskell
1462
- tech:haxe
1463
- tech:helm
1464
- tech:heroku
1465
- tech:hibernate
1466
- tech:homebrew
1467
- tech:html5
1468
- tech:hugo
1469
- tech:ibm-spss-statistics
1470
- tech:ie10
1471
- tech:ifttt
1472
- tech:influxdb
1473
- tech:inkscape
1474
- tech:insomnia
1475
- tech:intellij-idea
1476
- tech:ionic
1477
- tech:jaeger
1478
- tech:jamstack
1479
- tech:jasmine
1480
- tech:java
1481
- tech:javascript
1482
- tech:jeet
1483
- tech:jekyll
1484
- tech:jenkins
1485
- tech:jest
1486
- tech:jetbrains
1487
- tech:jira
1488
- tech:jira-align
1489
- tech:jquery
1490
- tech:json
1491
- tech:jule
1492
- tech:julia
1493
- tech:junit
1494
- tech:jupyter
1495
- tech:k3os
1496
- tech:k3s
1497
- tech:kafka
1498
- tech:kaggle
1499
- tech:karate
1500
- tech:karma
1501
- tech:keras
1502
- tech:kibana
1503
- tech:knex-js
1504
- tech:knockout
1505
- tech:kotlin
1506
- tech:krakenjs
1507
- tech:ktor
1508
- tech:kubernetes
1509
- tech:labview
1510
- tech:laravel
1511
- tech:latex
1512
- tech:less-js
1513
- tech:linkedin
1514
- tech:linux
1515
- tech:liquibase
1516
- tech:livewire
1517
- tech:llvm
1518
- tech:logstash
1519
- tech:lua
1520
- tech:lumen
1521
- tech:magento
1522
- tech:markdown
1523
- tech:material-ui
1524
- tech:materialize
1525
- tech:matlab
1526
- tech:matplotlib
1527
- tech:maven
1528
- tech:meteor-js
1529
- tech:microsoft-sql-server
1530
- tech:minitab
1531
- tech:mob-x
1532
- tech:mocha
1533
- tech:modx
1534
- tech:moleculer
1535
- tech:mongodb
1536
- tech:mongoose-js
1537
- tech:moodle
1538
- tech:ms-dos
1539
- tech:mysql
1540
- tech:nano
1541
- tech:nerog
1542
- tech:nestjs
1543
- tech:net
1544
- tech:net-core
1545
- tech:network-x
1546
- tech:new4j
1547
- tech:nextjs
1548
- tech:nginx
1549
- tech:nhibernate
1550
- tech:nim
1551
- tech:nimble
1552
- tech:nix
1553
- tech:nodejs
1554
- tech:nodemon
1555
- tech:nodewebkit
1556
- tech:npm
1557
- tech:nuget
1558
- tech:num-py
1559
- tech:nuxt-js
1560
- tech:objective-c
1561
- tech:ocaml
1562
- tech:oh-my-zsh
1563
- tech:okta
1564
- tech:open-al
1565
- tech:open-api
1566
- tech:open-cl
1567
- tech:open-cv
1568
- tech:open-gl
1569
- tech:open-stack
1570
- tech:open-suse
1571
- tech:open-telemetry
1572
- tech:opera
1573
- tech:oracle
1574
- tech:p5js
1575
- tech:packer
1576
- tech:pandas
1577
- tech:perl
1578
- tech:pf-sense
1579
- tech:phalcon
1580
- tech:phoenix-framework
1581
- tech:photon-engine
1582
- tech:php
1583
- tech:php-storm
1584
- tech:playwrite
1585
- tech:ploty
1586
- tech:podman
1587
- tech:polygon
1588
- tech:portainer
1589
- tech:postcss
1590
- tech:postgresql
1591
- tech:postman
1592
- tech:powershell
1593
- tech:processing
1594
- tech:prometheus
1595
- tech:protractor
1596
- tech:purescript
1597
- tech:putty
1598
- tech:pycharm
1599
- tech:pyscript
1600
- tech:pytest
1601
- tech:python
1602
- tech:python-poetry
1603
- tech:pytorch
1604
- tech:qodana
1605
- tech:qt
1606
- tech:quarkus
1607
- tech:quasar
1608
- tech:qwik
1609
- tech:r
1610
- tech:rabbitmq
1611
- tech:rancher
1612
- tech:raspberrypi
1613
- tech:reach
1614
- tech:react
1615
- tech:react-bootstrap
1616
- tech:realm
1617
- tech:red-cube-s-epic-compiler-thingy-programming-re-ct
1618
- tech:redhat
1619
- tech:redis
1620
- tech:redux
1621
- tech:ren-py
1622
- tech:rider
1623
- tech:robot-operating-system-ros
1624
- tech:rocksdb
1625
- tech:rollup-js
1626
- tech:rspec
1627
- tech:rstudio
1628
- tech:ruby
1629
- tech:ruby-mine
1630
- tech:ruby-on-rails
1631
- tech:rust
1632
- tech:salesforce
1633
- tech:sanity
1634
- tech:sass
1635
- tech:scala
1636
- tech:scalingo
1637
- tech:sdl
1638
- tech:selenium
1639
- tech:sema-software
1640
- tech:sequelize
1641
- tech:shopware
1642
- tech:sketch
1643
- tech:slack
1644
- tech:socket-io
1645
- tech:solid-js
1646
- tech:solidity
1647
- tech:sonarqube
1648
- tech:sourcetree
1649
- tech:spark
1650
- tech:splunk
1651
- tech:spring
1652
- tech:sql-developer
1653
- tech:sqlalchemy
1654
- tech:sqlite
1655
- tech:ssh
1656
- tech:stackoverflow
1657
- tech:stata
1658
- tech:storybook
1659
- tech:streamlit
1660
- tech:stylus
1661
- tech:subversion
1662
- tech:svelte
1663
- tech:swagger
1664
- tech:swift
1665
- tech:symfony
1666
- tech:tailwind-css
1667
- tech:tauri
1668
- tech:tensorflow
1669
- tech:terraform
1670
- tech:tex
1671
- tech:the-algorithms
1672
- tech:three-js
1673
- tech:titanium-sdk
1674
- tech:tomcat
1675
- tech:tortoise-git
1676
- tech:tower
1677
- tech:traefik-mesh
1678
- tech:traefik-proxy
1679
- tech:travis-ci
1680
- tech:trello
1681
- tech:twitter
1682
- tech:typescript
1683
- tech:typo3
1684
- tech:ubuntu
1685
- tech:uml
1686
- tech:unity
1687
- tech:unix
1688
- tech:unreal-engine
1689
- tech:uwsgi
1690
- tech:v8
1691
- tech:vagrant
1692
- tech:vala
1693
- tech:vercel
1694
- tech:veutify
1695
- tech:vim
1696
- tech:visualstudio
1697
- tech:vite
1698
- tech:vitejs
1699
- tech:vscode
1700
- tech:vsphere
1701
- tech:vue
1702
- tech:vue-storefront
1703
- tech:vyper
1704
- tech:webassembly
1705
- tech:webflow
1706
- tech:weblate
1707
- tech:webpack
1708
- tech:webstorm
1709
- tech:windows8
1710
- tech:windows11
1711
- tech:woo-commerce
1712
- tech:wordpress
1713
- tech:xamarin
1714
- tech:xcode
1715
- tech:xml
1716
- tech:yaml
1717
- tech:yarn
1718
- tech:yii-framework
1719
- tech:yuno-host
1720
- tech:zend-framework
1721
- tech:zig
1722
- }}`,x$="likec4builtin",A7=`${x$}:///likec4/lib/icons.c4`;var Vs=Bs();const x7=new Vs.NotificationType("likec4/onDidChangeModel"),I7=new Vs.RequestType0("likec4/fetchModel"),P7=new Vs.RequestType("likec4/fetchComputedModel"),N7=new Vs.RequestType("likec4/computeView"),O7=new Vs.RequestType("likec4/build"),F7=new Vs.RequestType("likec4/locate"),L7=new Vs.RequestType("likec4/change-view");var nv,I$;function M7(){return I$||(I$=1,nv=t=>{const e=t.match(/^[ \t]*(?=\S)/gm);return e?e.reduce((n,r)=>Math.min(n,r.length),1/0):0}),nv}var z7=M7();function rv(t){const e=z7(t);if(e===0)return t;const n=new RegExp(`^[ \\t]{${e}}`,"gm");return t.replace(n,"")}var iv,P$;function B7(){if(P$)return iv;P$=1;function t(e){for(var n=5381,r=e.length;r;)n=n*33^e.charCodeAt(--r);return n>>>0}return iv=t,iv}var j7=B7(),q7=Object.getOwnPropertyNames,U7=Object.getOwnPropertySymbols,W7=Object.prototype.hasOwnProperty;function N$(t,e){return function(r,i,s){return t(r,i,s)&&e(r,i,s)}}function th(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 O$(t){return q7(t).concat(U7(t))}var F$=Object.hasOwn||function(t,e){return W7.call(t,e)};function ea(t,e){return t||e?t===e:t===e||t!==t&&e!==e}var L$="_owner",M$=Object.getOwnPropertyDescriptor,z$=Object.keys;function G7(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 H7(t,e){return ea(t.getTime(),e.getTime())}function B$(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],h=d[1],p=a.value,m=p[0],w=p[1];!u&&!r[l]&&(u=n.equals(f,m,s,l,t,e,n)&&n.equals(h,w,f,m,t,e,n))&&(r[l]=!0),l++}if(!u)return!1;s++}return!0}function K7(t,e,n){var r=z$(t),i=r.length;if(z$(e).length!==i)return!1;for(var s;i-- >0;)if(s=r[i],s===L$&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!F$(e,s)||!n.equals(t[s],e[s],s,s,t,e,n))return!1;return!0}function Tu(t,e,n){var r=O$(t),i=r.length;if(O$(e).length!==i)return!1;for(var s,o,a;i-- >0;)if(s=r[i],s===L$&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!F$(e,s)||!n.equals(t[s],e[s],s,s,t,e,n)||(o=M$(t,s),a=M$(e,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function V7(t,e){return ea(t.valueOf(),e.valueOf())}function Y7(t,e){return t.source===e.source&&t.flags===e.flags}function j$(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 X7(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 J7="[object Arguments]",Z7="[object Boolean]",Q7="[object Date]",eW="[object Map]",tW="[object Number]",nW="[object Object]",rW="[object RegExp]",iW="[object Set]",sW="[object String]",oW=Array.isArray,q$=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,U$=Object.assign,aW=Object.prototype.toString.call.bind(Object.prototype.toString);function cW(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 h=l.constructor;if(h!==d.constructor)return!1;if(h===Object)return i(l,d,f);if(oW(l))return e(l,d,f);if(q$!=null&&q$(l))return c(l,d,f);if(h===Date)return n(l,d,f);if(h===RegExp)return o(l,d,f);if(h===Map)return r(l,d,f);if(h===Set)return a(l,d,f);var p=aW(l);return p===Q7?n(l,d,f):p===rW?o(l,d,f):p===eW?r(l,d,f):p===iW?a(l,d,f):p===nW?typeof l.then!="function"&&typeof d.then!="function"&&i(l,d,f):p===J7?i(l,d,f):p===Z7||p===tW||p===sW?s(l,d,f):!1}}function uW(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?Tu:G7,areDatesEqual:H7,areMapsEqual:r?N$(B$,Tu):B$,areObjectsEqual:r?Tu:K7,arePrimitiveWrappersEqual:V7,areRegExpsEqual:Y7,areSetsEqual:r?N$(j$,Tu):j$,areTypedArraysEqual:r?Tu:X7};if(n&&(i=U$({},i,n(i))),e){var s=th(i.areArraysEqual),o=th(i.areMapsEqual),a=th(i.areObjectsEqual),c=th(i.areSetsEqual);i=U$({},i,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:a,areSetsEqual:c})}return i}function lW(t){return function(e,n,r,i,s,o,a){return t(e,n,a)}}function dW(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,h=l.meta;return n(c,u,{cache:f,equals:i,meta:h,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 W$=Hi();Hi({strict:!0}),Hi({circular:!0}),Hi({circular:!0,strict:!0}),Hi({createInternalComparator:function(){return ea}}),Hi({strict:!0,createInternalComparator:function(){return ea}}),Hi({circular:!0,createInternalComparator:function(){return ea}}),Hi({circular:!0,createInternalComparator:function(){return ea},strict:!0});function Hi(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=uW(t),c=cW(a),u=r?r(c):lW(c);return dW({circular:n,comparator:c,createState:i,equals:u,strict:o})}var sv,G$;function ov(){if(G$)return sv;G$=1;var t="\0",e="\0",n="";class r{_isDirected=!0;_isMultigraph=!1;_isCompound=!1;_label;_defaultNodeLabelFn=()=>{};_defaultEdgeLabelFn=()=>{};_nodes={};_in={};_preds={};_out={};_sucs={};_edgeObjs={};_edgeLabels={};_nodeCount=0;_edgeCount=0;_parent;_children;constructor(l){l&&(this._isDirected=Object.hasOwn(l,"directed")?l.directed:!0,this._isMultigraph=Object.hasOwn(l,"multigraph")?l.multigraph:!1,this._isCompound=Object.hasOwn(l,"compound")?l.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[e]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(l){return this._label=l,this}graph(){return this._label}setDefaultNodeLabel(l){return this._defaultNodeLabelFn=l,typeof l!="function"&&(this._defaultNodeLabelFn=()=>l),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var l=this;return this.nodes().filter(d=>Object.keys(l._in[d]).length===0)}sinks(){var l=this;return this.nodes().filter(d=>Object.keys(l._out[d]).length===0)}setNodes(l,d){var f=arguments,h=this;return l.forEach(function(p){f.length>1?h.setNode(p,d):h.setNode(p)}),this}setNode(l,d){return Object.hasOwn(this._nodes,l)?(arguments.length>1&&(this._nodes[l]=d),this):(this._nodes[l]=arguments.length>1?d:this._defaultNodeLabelFn(l),this._isCompound&&(this._parent[l]=e,this._children[l]={},this._children[e][l]=!0),this._in[l]={},this._preds[l]={},this._out[l]={},this._sucs[l]={},++this._nodeCount,this)}node(l){return this._nodes[l]}hasNode(l){return Object.hasOwn(this._nodes,l)}removeNode(l){var d=this;if(Object.hasOwn(this._nodes,l)){var f=h=>d.removeEdge(d._edgeObjs[h]);delete this._nodes[l],this._isCompound&&(this._removeFromParentsChildList(l),delete this._parent[l],this.children(l).forEach(function(h){d.setParent(h)}),delete this._children[l]),Object.keys(this._in[l]).forEach(f),delete this._in[l],delete this._preds[l],Object.keys(this._out[l]).forEach(f),delete this._out[l],delete this._sucs[l],--this._nodeCount}return this}setParent(l,d){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(d===void 0)d=e;else{d+="";for(var f=d;f!==void 0;f=this.parent(f))if(f===l)throw new Error("Setting "+d+" as parent of "+l+" would create a cycle");this.setNode(d)}return this.setNode(l),this._removeFromParentsChildList(l),this._parent[l]=d,this._children[d][l]=!0,this}_removeFromParentsChildList(l){delete this._children[this._parent[l]][l]}parent(l){if(this._isCompound){var d=this._parent[l];if(d!==e)return d}}children(l=e){if(this._isCompound){var d=this._children[l];if(d)return Object.keys(d)}else{if(l===e)return this.nodes();if(this.hasNode(l))return[]}}predecessors(l){var d=this._preds[l];if(d)return Object.keys(d)}successors(l){var d=this._sucs[l];if(d)return Object.keys(d)}neighbors(l){var d=this.predecessors(l);if(d){const h=new Set(d);for(var f of this.successors(l))h.add(f);return Array.from(h.values())}}isLeaf(l){var d;return this.isDirected()?d=this.successors(l):d=this.neighbors(l),d.length===0}filterNodes(l){var d=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});d.setGraph(this.graph());var f=this;Object.entries(this._nodes).forEach(function([m,w]){l(m)&&d.setNode(m,w)}),Object.values(this._edgeObjs).forEach(function(m){d.hasNode(m.v)&&d.hasNode(m.w)&&d.setEdge(m,f.edge(m))});var h={};function p(m){var w=f.parent(m);return w===void 0||d.hasNode(w)?(h[m]=w,w):w in h?h[w]:p(w)}return this._isCompound&&d.nodes().forEach(m=>d.setParent(m,p(m))),d}setDefaultEdgeLabel(l){return this._defaultEdgeLabelFn=l,typeof l!="function"&&(this._defaultEdgeLabelFn=()=>l),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(l,d){var f=this,h=arguments;return l.reduce(function(p,m){return h.length>1?f.setEdge(p,m,d):f.setEdge(p,m),m}),this}setEdge(){var l,d,f,h,p=!1,m=arguments[0];typeof m=="object"&&m!==null&&"v"in m?(l=m.v,d=m.w,f=m.name,arguments.length===2&&(h=arguments[1],p=!0)):(l=m,d=arguments[1],f=arguments[3],arguments.length>2&&(h=arguments[2],p=!0)),l=""+l,d=""+d,f!==void 0&&(f=""+f);var w=o(this._isDirected,l,d,f);if(Object.hasOwn(this._edgeLabels,w))return p&&(this._edgeLabels[w]=h),this;if(f!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(l),this.setNode(d),this._edgeLabels[w]=p?h:this._defaultEdgeLabelFn(l,d,f);var v=a(this._isDirected,l,d,f);return l=v.v,d=v.w,Object.freeze(v),this._edgeObjs[w]=v,i(this._preds[d],l),i(this._sucs[l],d),this._in[d][w]=v,this._out[l][w]=v,this._edgeCount++,this}edge(l,d,f){var h=arguments.length===1?c(this._isDirected,arguments[0]):o(this._isDirected,l,d,f);return this._edgeLabels[h]}edgeAsObj(){const l=this.edge(...arguments);return typeof l!="object"?{label:l}:l}hasEdge(l,d,f){var h=arguments.length===1?c(this._isDirected,arguments[0]):o(this._isDirected,l,d,f);return Object.hasOwn(this._edgeLabels,h)}removeEdge(l,d,f){var h=arguments.length===1?c(this._isDirected,arguments[0]):o(this._isDirected,l,d,f),p=this._edgeObjs[h];return p&&(l=p.v,d=p.w,delete this._edgeLabels[h],delete this._edgeObjs[h],s(this._preds[d],l),s(this._sucs[l],d),delete this._in[d][h],delete this._out[l][h],this._edgeCount--),this}inEdges(l,d){var f=this._in[l];if(f){var h=Object.values(f);return d?h.filter(p=>p.v===d):h}}outEdges(l,d){var f=this._out[l];if(f){var h=Object.values(f);return d?h.filter(p=>p.w===d):h}}nodeEdges(l,d){var f=this.inEdges(l,d);if(f)return f.concat(this.outEdges(l,d))}}function i(u,l){u[l]?u[l]++:u[l]=1}function s(u,l){--u[l]||delete u[l]}function o(u,l,d,f){var h=""+l,p=""+d;if(!u&&h>p){var m=h;h=p,p=m}return h+n+p+n+(f===void 0?t:f)}function a(u,l,d,f){var h=""+l,p=""+d;if(!u&&h>p){var m=h;h=p,p=m}var w={v:h,w:p};return f&&(w.name=f),w}function c(u,l){return o(u,l.v,l.w,l.name)}return sv=r,sv}var av,H$;function fW(){return H$||(H$=1,av="2.2.4"),av}var cv,K$;function hW(){return K$||(K$=1,cv={Graph:ov(),version:fW()}),cv}var uv,V$;function pW(){if(V$)return uv;V$=1;var t=ov();uv={write:e,read:i};function e(s){var o={options:{directed:s.isDirected(),multigraph:s.isMultigraph(),compound:s.isCompound()},nodes:n(s),edges:r(s)};return s.graph()!==void 0&&(o.value=structuredClone(s.graph())),o}function n(s){return s.nodes().map(function(o){var a=s.node(o),c=s.parent(o),u={v:o};return a!==void 0&&(u.value=a),c!==void 0&&(u.parent=c),u})}function r(s){return s.edges().map(function(o){var a=s.edge(o),c={v:o.v,w:o.w};return o.name!==void 0&&(c.name=o.name),a!==void 0&&(c.value=a),c})}function i(s){var o=new t(s.options).setGraph(s.value);return s.nodes.forEach(function(a){o.setNode(a.v,a.value),a.parent&&o.setParent(a.v,a.parent)}),s.edges.forEach(function(a){o.setEdge({v:a.v,w:a.w,name:a.name},a.value)}),o}return uv}var lv,Y$;function gW(){if(Y$)return lv;Y$=1,lv=t;function t(e){var n={},r=[],i;function s(o){Object.hasOwn(n,o)||(n[o]=!0,i.push(o),e.successors(o).forEach(s),e.predecessors(o).forEach(s))}return e.nodes().forEach(function(o){i=[],s(o),i.length&&r.push(i)}),r}return lv}var dv,X$;function J$(){if(X$)return dv;X$=1;class t{_arr=[];_keyIndices={};size(){return this._arr.length}keys(){return this._arr.map(function(n){return n.key})}has(n){return Object.hasOwn(this._keyIndices,n)}priority(n){var r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(n,r){var i=this._keyIndices;if(n=String(n),!Object.hasOwn(i,n)){var s=this._arr,o=s.length;return i[n]=o,s.push({key:n,priority:r}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key}decrease(n,r){var i=this._keyIndices[n];if(r>this._arr[i].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[i].priority+" New: "+r);this._arr[i].priority=r,this._decrease(i)}_heapify(n){var r=this._arr,i=2*n,s=i+1,o=n;i<r.length&&(o=r[i].priority<r[o].priority?i:o,s<r.length&&(o=r[s].priority<r[o].priority?s:o),o!==n&&(this._swap(n,o),this._heapify(o)))}_decrease(n){for(var r=this._arr,i=r[n].priority,s;n!==0&&(s=n>>1,!(r[s].priority<i));)this._swap(n,s),n=s}_swap(n,r){var i=this._arr,s=this._keyIndices,o=i[n],a=i[r];i[n]=a,i[r]=o,s[a.key]=n,s[o.key]=r}}return dv=t,dv}var fv,Z$;function Q$(){if(Z$)return fv;Z$=1;var t=J$();fv=n;var e=()=>1;function n(i,s,o,a){return r(i,String(s),o||e,a||function(c){return i.outEdges(c)})}function r(i,s,o,a){var c={},u=new t,l,d,f=function(h){var p=h.v!==l?h.v:h.w,m=c[p],w=o(h),v=d.distance+w;if(w<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+h+" Weight: "+w);v<m.distance&&(m.distance=v,m.predecessor=l,u.decrease(p,v))};for(i.nodes().forEach(function(h){var p=h===s?0:Number.POSITIVE_INFINITY;c[h]={distance:p},u.add(h,p)});u.size()>0&&(l=u.removeMin(),d=c[l],d.distance!==Number.POSITIVE_INFINITY);)a(l).forEach(f);return c}return fv}var hv,eC;function mW(){if(eC)return hv;eC=1;var t=Q$();hv=e;function e(n,r,i){return n.nodes().reduce(function(s,o){return s[o]=t(n,o,r,i),s},{})}return hv}var pv,tC;function nC(){if(tC)return pv;tC=1,pv=t;function t(e){var n=0,r=[],i={},s=[];function o(a){var c=i[a]={onStack:!0,lowlink:n,index:n++};if(r.push(a),e.successors(a).forEach(function(d){Object.hasOwn(i,d)?i[d].onStack&&(c.lowlink=Math.min(c.lowlink,i[d].index)):(o(d),c.lowlink=Math.min(c.lowlink,i[d].lowlink))}),c.lowlink===c.index){var u=[],l;do l=r.pop(),i[l].onStack=!1,u.push(l);while(a!==l);s.push(u)}}return e.nodes().forEach(function(a){Object.hasOwn(i,a)||o(a)}),s}return pv}var gv,rC;function yW(){if(rC)return gv;rC=1;var t=nC();gv=e;function e(n){return t(n).filter(function(r){return r.length>1||r.length===1&&n.hasEdge(r[0],r[0])})}return gv}var mv,iC;function vW(){if(iC)return mv;iC=1,mv=e;var t=()=>1;function e(r,i,s){return n(r,i||t,s||function(o){return r.outEdges(o)})}function n(r,i,s){var o={},a=r.nodes();return a.forEach(function(c){o[c]={},o[c][c]={distance:0},a.forEach(function(u){c!==u&&(o[c][u]={distance:Number.POSITIVE_INFINITY})}),s(c).forEach(function(u){var l=u.v===c?u.w:u.v,d=i(u);o[c][l]={distance:d,predecessor:c}})}),a.forEach(function(c){var u=o[c];a.forEach(function(l){var d=o[l];a.forEach(function(f){var h=d[c],p=u[f],m=d[f],w=h.distance+p.distance;w<m.distance&&(m.distance=w,m.predecessor=p.predecessor)})})}),o}return mv}var yv,sC;function oC(){if(sC)return yv;sC=1;function t(n){var r={},i={},s=[];function o(a){if(Object.hasOwn(i,a))throw new e;Object.hasOwn(r,a)||(i[a]=!0,r[a]=!0,n.predecessors(a).forEach(o),delete i[a],s.push(a))}if(n.sinks().forEach(o),Object.keys(r).length!==n.nodeCount())throw new e;return s}class e extends Error{constructor(){super(...arguments)}}return yv=t,t.CycleException=e,yv}var vv,aC;function wW(){if(aC)return vv;aC=1;var t=oC();vv=e;function e(n){try{t(n)}catch(r){if(r instanceof t.CycleException)return!1;throw r}return!0}return vv}var wv,cC;function uC(){if(cC)return wv;cC=1,wv=t;function t(i,s,o){Array.isArray(s)||(s=[s]);var a=i.isDirected()?d=>i.successors(d):d=>i.neighbors(d),c=o==="post"?e:n,u=[],l={};return s.forEach(d=>{if(!i.hasNode(d))throw new Error("Graph does not have node: "+d);c(d,a,l,u)}),u}function e(i,s,o,a){for(var c=[[i,!1]];c.length>0;){var u=c.pop();u[1]?a.push(u[0]):Object.hasOwn(o,u[0])||(o[u[0]]=!0,c.push([u[0],!0]),r(s(u[0]),l=>c.push([l,!1])))}}function n(i,s,o,a){for(var c=[i];c.length>0;){var u=c.pop();Object.hasOwn(o,u)||(o[u]=!0,a.push(u),r(s(u),l=>c.push(l)))}}function r(i,s){for(var o=i.length;o--;)s(i[o],o,i);return i}return wv}var bv,lC;function bW(){if(lC)return bv;lC=1;var t=uC();bv=e;function e(n,r){return t(n,r,"post")}return bv}var Dv,dC;function DW(){if(dC)return Dv;dC=1;var t=uC();Dv=e;function e(n,r){return t(n,r,"pre")}return Dv}var Ev,fC;function EW(){if(fC)return Ev;fC=1;var t=ov(),e=J$();Ev=n;function n(r,i){var s=new t,o={},a=new e,c;function u(d){var f=d.v===c?d.w:d.v,h=a.priority(f);if(h!==void 0){var p=i(d);p<h&&(o[f]=c,a.decrease(f,p))}}if(r.nodeCount()===0)return s;r.nodes().forEach(function(d){a.add(d,Number.POSITIVE_INFINITY),s.setNode(d)}),a.decrease(r.nodes()[0],0);for(var l=!1;a.size()>0;){if(c=a.removeMin(),Object.hasOwn(o,c))s.setEdge(c,o[c]);else{if(l)throw new Error("Input graph is not connected: "+r);l=!0}r.nodeEdges(c).forEach(u)}return s}return Ev}var Tv,hC;function TW(){return hC||(hC=1,Tv={components:gW(),dijkstra:Q$(),dijkstraAll:mW(),findCycles:yW(),floydWarshall:vW(),isAcyclic:wW(),postorder:bW(),preorder:DW(),prim:EW(),tarjan:nC(),topsort:oC()}),Tv}var Rv,pC;function RW(){if(pC)return Rv;pC=1;var t=hW();return Rv={Graph:t.Graph,json:pW(),alg:TW(),version:t.version},Rv}var Ru=RW(),nh={exports:{}},gC;function SW(){return gC||(gC=1,function(t,e){var n=z1;e=t.exports=r;function r(d,f){return f=o(d,f),c(d,f)}e.sha1=function(d){return r(d)},e.keys=function(d){return r(d,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},e.MD5=function(d){return r(d,{algorithm:"md5",encoding:"hex"})},e.keysMD5=function(d){return r(d,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var i=n.getHashes?n.getHashes().slice():["sha1","md5"];i.push("passthrough");var s=["buffer","hex","binary","base64"];function o(d,f){f=f||{};var h={};if(h.algorithm=f.algorithm||"sha1",h.encoding=f.encoding||"hex",h.excludeValues=!!f.excludeValues,h.algorithm=h.algorithm.toLowerCase(),h.encoding=h.encoding.toLowerCase(),h.ignoreUnknown=f.ignoreUnknown===!0,h.respectType=f.respectType!==!1,h.respectFunctionNames=f.respectFunctionNames!==!1,h.respectFunctionProperties=f.respectFunctionProperties!==!1,h.unorderedArrays=f.unorderedArrays===!0,h.unorderedSets=f.unorderedSets!==!1,h.unorderedObjects=f.unorderedObjects!==!1,h.replacer=f.replacer||void 0,h.excludeKeys=f.excludeKeys||void 0,typeof d>"u")throw new Error("Object argument required.");for(var p=0;p<i.length;++p)i[p].toLowerCase()===h.algorithm.toLowerCase()&&(h.algorithm=i[p]);if(i.indexOf(h.algorithm)===-1)throw new Error('Algorithm "'+h.algorithm+'" not supported. supported values: '+i.join(", "));if(s.indexOf(h.encoding)===-1&&h.algorithm!=="passthrough")throw new Error('Encoding "'+h.encoding+'" not supported. supported values: '+s.join(", "));return h}function a(d){if(typeof d!="function")return!1;var f=/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i;return f.exec(Function.prototype.toString.call(d))!=null}function c(d,f){var h;f.algorithm!=="passthrough"?h=n.createHash(f.algorithm):h=new l,typeof h.write>"u"&&(h.write=h.update,h.end=h.update);var p=u(f,h);if(p.dispatch(d),h.update||h.end(""),h.digest)return h.digest(f.encoding==="buffer"?void 0:f.encoding);var m=h.read();return f.encoding==="buffer"?m:m.toString(f.encoding)}e.writeToStream=function(d,f,h){return typeof h>"u"&&(h=f,f={}),f=o(d,f),u(f,h).dispatch(d)};function u(d,f,h){h=h||[];var p=function(m){return f.update?f.update(m,"utf8"):f.write(m,"utf8")};return{dispatch:function(m){d.replacer&&(m=d.replacer(m));var w=typeof m;return m===null&&(w="null"),this["_"+w](m)},_object:function(m){var w=/\[object (.*)\]/i,v=Object.prototype.toString.call(m),E=w.exec(v);E?E=E[1]:E="unknown:["+v+"]",E=E.toLowerCase();var S=null;if((S=h.indexOf(m))>=0)return this.dispatch("[CIRCULAR:"+S+"]");if(h.push(m),typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(m))return p("buffer:"),p(m);if(E!=="object"&&E!=="function"&&E!=="asyncfunction")if(this["_"+E])this["_"+E](m);else{if(d.ignoreUnknown)return p("["+E+"]");throw new Error('Unknown object type "'+E+'"')}else{var $=Object.keys(m);d.unorderedObjects&&($=$.sort()),d.respectType!==!1&&!a(m)&&$.splice(0,0,"prototype","__proto__","constructor"),d.excludeKeys&&($=$.filter(function(N){return!d.excludeKeys(N)})),p("object:"+$.length+":");var I=this;return $.forEach(function(N){I.dispatch(N),p(":"),d.excludeValues||I.dispatch(m[N]),p(",")})}},_array:function(m,w){w=typeof w<"u"?w:d.unorderedArrays!==!1;var v=this;if(p("array:"+m.length+":"),!w||m.length<=1)return m.forEach(function($){return v.dispatch($)});var E=[],S=m.map(function($){var I=new l,N=h.slice(),A=u(d,I,N);return A.dispatch($),E=E.concat(N.slice(h.length)),I.read().toString()});return h=h.concat(E),S.sort(),this._array(S,!1)},_date:function(m){return p("date:"+m.toJSON())},_symbol:function(m){return p("symbol:"+m.toString())},_error:function(m){return p("error:"+m.toString())},_boolean:function(m){return p("bool:"+m.toString())},_string:function(m){p("string:"+m.length+":"),p(m.toString())},_function:function(m){p("fn:"),a(m)?this.dispatch("[native]"):this.dispatch(m.toString()),d.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(m.name)),d.respectFunctionProperties&&this._object(m)},_number:function(m){return p("number:"+m.toString())},_xml:function(m){return p("xml:"+m.toString())},_null:function(){return p("Null")},_undefined:function(){return p("Undefined")},_regexp:function(m){return p("regex:"+m.toString())},_uint8array:function(m){return p("uint8array:"),this.dispatch(Array.prototype.slice.call(m))},_uint8clampedarray:function(m){return p("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(m))},_int8array:function(m){return p("int8array:"),this.dispatch(Array.prototype.slice.call(m))},_uint16array:function(m){return p("uint16array:"),this.dispatch(Array.prototype.slice.call(m))},_int16array:function(m){return p("int16array:"),this.dispatch(Array.prototype.slice.call(m))},_uint32array:function(m){return p("uint32array:"),this.dispatch(Array.prototype.slice.call(m))},_int32array:function(m){return p("int32array:"),this.dispatch(Array.prototype.slice.call(m))},_float32array:function(m){return p("float32array:"),this.dispatch(Array.prototype.slice.call(m))},_float64array:function(m){return p("float64array:"),this.dispatch(Array.prototype.slice.call(m))},_arraybuffer:function(m){return p("arraybuffer:"),this.dispatch(new Uint8Array(m))},_url:function(m){return p("url:"+m.toString())},_map:function(m){p("map:");var w=Array.from(m);return this._array(w,d.unorderedSets!==!1)},_set:function(m){p("set:");var w=Array.from(m);return this._array(w,d.unorderedSets!==!1)},_file:function(m){return p("file:"),this.dispatch([m.name,m.size,m.type,m.lastModfied])},_blob:function(){if(d.ignoreUnknown)return p("[blob]");throw Error(`Hashing Blob objects is currently not supported
1723
- (see https://github.com/puleos/object-hash/issues/26)
1724
- Use "options.replacer" or "options.ignoreUnknown"
1725
- `)},_domwindow:function(){return p("domwindow")},_bigint:function(m){return p("bigint:"+m.toString())},_process:function(){return p("process")},_timer:function(){return p("timer")},_pipe:function(){return p("pipe")},_tcp:function(){return p("tcp")},_udp:function(){return p("udp")},_tty:function(){return p("tty")},_statwatcher:function(){return p("statwatcher")},_securecontext:function(){return p("securecontext")},_connection:function(){return p("connection")},_zlib:function(){return p("zlib")},_context:function(){return p("context")},_nodescript:function(){return p("nodescript")},_httpparser:function(){return p("httpparser")},_dataview:function(){return p("dataview")},_signal:function(){return p("signal")},_fsevent:function(){return p("fsevent")},_tlswrap:function(){return p("tlswrap")}}}function l(){return{buf:"",write:function(d){this.buf+=d},end:function(d){this.buf+=d},read:function(){return this.buf}}}}(nh,nh.exports)),nh.exports}var kW=SW();function mC(t){const e={id:t.id,__:t.__??"element",autoLayout:t.autoLayout,nodes:Ye(t.nodes,ut(m1(["id","title","description","technology","shape","icon","children"])),hi(({id:n,icon:r,...i})=>[n,{...i,icon:ne(r)?"Y":"N"}])),edges:Ye(t.edges,ut(m1(["source","target","label","description","technology","dir","head","tail","line"])),hi(({source:n,target:r,...i})=>[`${n}:${r}`,i]))};return t.hash=kW(e,{ignoreUnknown:!0,respectType:!1}),t}function Sn(t){if(de.isElementWhere(t)){const e=Sn(t.where.expr),n=vo(t.where.condition);return r=>e(r)&&n(r)}if(de.isWildcard(t))return()=>!0;if(de.isElementKindExpr(t))return t.isEqual?e=>e.kind===t.elementKind:e=>e.kind!==t.elementKind;if(de.isElementTagExpr(t))return t.isEqual?({tags:e})=>!!e&&e.includes(t.elementTag):({tags:e})=>$t(e)||!e.includes(t.elementTag);if(de.isExpandedElementExpr(t))return e=>e.id===t.expanded||St(e.id)===t.expanded;if(de.isElementRef(t)){const{element:e,isDescedants:n}=t;return n?r=>r.id.startsWith(e+"."):r=>r.id===e}if(de.isCustomElement(t))return Sn(t.custom.expr);Ae(t)}function yC(t,e){const n=t.flatMap(i=>"include"in i?i.include.filter(de.isCustomElement):[]);if(n.length===0)return e;const r=[...e];for(const{custom:{expr:i,...s}}of n){const{border:o,opacity:a,...c}=g1(s,$t),u=!qi(c),l=Sn(i);r.forEach((d,f)=>{if(!l(d))return;u&&(d={...d,isCustomized:!0,...c});let h;o!==void 0&&(h={border:o}),a!==void 0&&(h={...h,opacity:a}),h&&(d={...d,isCustomized:!0,style:{...d.style,...h}}),r[f]=d})}return r}function vC(t){switch(!0){case de.isRelationWhere(t):return vC(t.where.expr);case de.isRelation(t):{const e=Sn(t.source),n=Sn(t.target);return r=>e(r.source)&&n(r.target)||!!t.isBidirectional&&e(r.target)&&n(r.source)}case de.isInOut(t):{const e=Sn(t.inout);return n=>e(n.source)||e(n.target)}case de.isIncoming(t):{const e=Sn(t.incoming);return n=>e(n.target)}case de.isOutgoing(t):{const e=Sn(t.outgoing);return n=>e(n.source)}default:Ae(t)}}function $W(t,e,n){const r=t.flatMap(s=>"include"in s?s.include.filter(de.isCustomRelationExpr):[]),i=Array.from(n);if(r.length===0||i.length===0)return i;for(const{customRelation:{relation:s,title:o,...a}}of r){const c=g1(a,$t),u=vC(s);i.forEach((l,d)=>{const f=e.find(p=>p.id===l.source),h=e.find(p=>p.id===l.target);!f||!h||u({source:f,target:h})&&(i[d]={...l,label:o??l.label,isCustomized:!0,...c})})}return i}function wC(t,e){const n=t.filter(pN);if(n.length===0)return e;for(const r of n){const i=[];for(const s of r.targets){if(de.isWildcard(s)){i.push(()=>!0);break}i.push(Sn(s))}Je(e,dq(i)).forEach(s=>{s.shape=r.style.shape??s.shape,s.color=r.style.color??s.color,yt(r.style.icon)&&(s.icon=r.style.icon),yt(r.notation)&&(s.notation=r.notation);let o;yt(r.style.border)&&(o={border:r.style.border}),yt(r.style.opacity)&&(o={...o,opacity:r.style.opacity}),o&&(s.style={...s.style,...o})})}return e}function CW(t,e){let n;for(;t.parent&&(n=e.get(t.parent));){const r=n.depth??1;if(n.depth=Math.max(r,(t.depth??0)+1),n.depth===r)break;t=n}}function bC(t){return Array.from(t).sort(Rg).reduce((e,{id:n,color:r,shape:i,style:s,...o})=>{let a=St(n),c=0;for(;a;){const l=e.get(a);if(l){l.children.length==0&&(l.depth=1,CW(l,e)),l.children.push(n),c=l.level+1;break}a=St(a)}const u={...o,id:n,parent:a,level:c,color:r??ed,shape:i??J0,children:[],inEdges:[],outEdges:[],style:{...s}};return e.set(n,u),e},new Map)}function DC(t){return Ye(t,Wf(Lr("notation")),Bi(xy(Wf(Lr("shape")),Bi(xy(Wf(Lr("color")),Bi(xy(ut(Lr("kind")),Or())),Jo(),ut(([e,n])=>({kinds:n,color:e})))),Jo(),Ui(([e,n])=>n.map(({color:r,kinds:i})=>({shape:e,color:r,kinds:i}))))),Jo(),Ui(([e,n])=>n.map(({shape:r,color:i,kinds:s})=>({title:e,shape:r,color:i,kinds:s}))),Cj(Lr("shape"),Lr("title"),[e=>e.kinds.length,"desc"]))}const EC=Ru.alg.postorder,_W=Ru.alg.findCycles,AW=Ru.alg.isAcyclic;function xW(t){t.forEach(e=>{e.children.length>0&&(e.children=t.flatMap(n=>n.parent===e.id?n.id:[]))})}function IW({nodes:t,edges:e}){if(e.length===0)return t;const n=new Ru.Graph({compound:!1,directed:!0,multigraph:!1}),r=a=>et(t.find(c=>c.id===a),"Edge not found"),i=a=>et(e.find(c=>c.id===a),"Edge not found");for(const a of[...e].sort(xa))n.setEdge(a.source,a.target);for(const a of t)n.setNode(a.id),a.children.length>0&&a.inEdges.forEach(c=>{const u=i(c);u.target!==a.id&&r(u.source).children.length===0&&n.setEdge(u.source,a.id)}),a.parent&&n.setEdge(a.parent,a.id);let s=n.sources();s.length===0&&(s=Ye(t,qc(Rg),Je(a=>a.inEdges.length===0||a.parent===null),ut(a=>a.id)));const o=EC(n,s).reverse().map(r);if(o.length<t.length){const a=cq(t,o);o.push(...a)}return ge(o.length===t.length,"Not all nodes were processed by graphlib"),xW(o),o}function PW(t){const e=Ye(t,Ui(n=>n.tags??[]),Or(),qc(fd));return Eg(e,1)?e:null}const pr=()=>!0,Sv=t=>t,kv=t=>t===pr?Sv:Je(t),NW=t=>t===pr?Sv:e=>t(e)?e:null;function OW(t,e=pr){const n=[...this.resolvedElements],r=kv(e)(t.isDescedants===!0?this.graph.childrenOrElement(t.element):[this.graph.element(t.element)]);if(r.length!==0&&(this.addElement(...r),r.length>1&&this.addEdges(this.graph.edgesWithin(r)),n.length>0&&r.length>0))for(const i of r)this.addEdges(this.graph.anyEdgesBetween(i,n))}function FW(t,e=pr){const n=[...this.resolvedElements].filter(E1([Sn(t),e]));this.excludeElement(...n)}function LW(t,e=pr){const n=this.root;if(!n){const u=this.graph.rootElements.filter(e);if(u.length<=0)return;const l=[...this.resolvedElements];if(this.addElement(...u),this.addEdges(this.graph.edgesWithin(u)),l.length>0)for(const d of u)this.addEdges(this.graph.anyEdgesBetween(d,l));return}const r=[...this.resolvedElements],i=NW(e)(this.graph.element(n));i&&this.addElement(i);const s=kv(e),o=s(this.graph.children(n)),a=o.length>0;a?(this.addElement(...o),this.addEdges(this.graph.edgesWithin(o))):i&&o.push(i);const c=[...r,...s([...this.graph.siblings(n),...this.graph.ancestors(n).flatMap(u=>this.graph.siblings(u.id))])];for(const u of o)this.addEdges(this.graph.anyEdgesBetween(u,c));if(!a&&i&&this.graph.anyEdgesBetween(i,this.graph.siblings(n)).length===0){const u=St(n),l=u&&this.graph.element(u);l&&e(l)&&this.addElement(l)}}function MW(t,e=pr){if(e!==pr){const r=[...this.resolvedElements].filter(e);this.excludeElement(...r);return}const n=this.root;n?(this.excludeElement(this.graph.element(n),...this.graph.children(n)),this.excludeRelation(...this.graph.connectedRelations(n))):this.reset()}function zW(t,e=pr){const n=kv(e),r=[...this.resolvedElements],i=this.graph.element(t.expanded);if(e(i)){this.addElement(i);const o=this.graph.anyEdgesBetween(i,r);this.addEdges(o)}const s=[];for(const o of n(this.graph.children(t.expanded))){this.addImplicit(o);const a=this.graph.anyEdgesBetween(o,r);a.length>0&&(this.addEdges(a),s.push(o))}s.length>1&&this.addEdges(this.graph.edgesWithin(s))}function BW(t,e=pr){const n=[...this.resolvedElements].filter(E1([Sn(t),e]));this.excludeElement(...n)}const TC=t=>t.isEqual?de.isElementKindExpr(t)?e=>e.kind===t.elementKind:({tags:e})=>!!e&&e.includes(t.elementTag):de.isElementKindExpr(t)?e=>e.kind!==t.elementKind:({tags:e})=>$t(e)||e.length===0||!e.includes(t.elementTag);function jW(t,e=pr){const n=this.graph.elements.filter(TC(t)).filter(e);if(n.length>0){const r=[...this.resolvedElements];this.addElement(...n),this.addEdges(this.graph.edgesWithin(n));for(const i of n)this.addEdges(this.graph.anyEdgesBetween(i,r))}}function qW(t,e=pr){const n=[...this.resolvedElements].filter(TC(t)).filter(e);n.length>0&&this.excludeElement(...n)}function Su(t){return de.isElementRef(t)?this.graph.ascendingSiblings(t.element):this.root?this.graph.ascendingSiblings(this.root):this.graph.rootElements}function rh(t){return de.isWildcard(t)?this.root?[...this.graph.children(this.root),this.graph.element(this.root)]:this.graph.rootElements:de.isElementKindExpr(t)?this.graph.elements.filter(e=>t.isEqual?e.kind===t.elementKind:e.kind!==t.elementKind):de.isElementTagExpr(t)?this.graph.elements.filter(e=>{const n=e.tags;return t.isEqual?!!n&&n.includes(t.elementTag):$t(n)||n.length===0||!n.includes(t.elementTag)}):de.isExpandedElementExpr(t)?[this.graph.element(t.expanded)]:de.isElementRef(t)?this.root===t.element&&t.isDescedants!==!0?[...this.graph.children(this.root),this.graph.element(this.root)]:t.isDescedants?this.graph.childrenOrElement(t.element):[this.graph.element(t.element)]:Ae(t)}function RC(t){if(de.isWildcard(t)){if(!this.root)return[];const r=this.graph.ascendingSiblings(this.root),i=[...this.graph.children(this.root),this.graph.element(this.root)];return this.graph.edgesBetween(r,i)}const e=rh.call(this,t);if(e.length===0)return[];let n=[...this.resolvedElements];if(de.isElementRef(t)||de.isExpandedElementExpr(t)){const r=t.element??t.expanded,i=t.isDescedants??!1;n=n.filter(s=>!Rr(r,s.id)||i&&St(s.id)===r)}return n.length===0&&(n=Su.call(this,t)),this.graph.edgesBetween(n,e)}const ku=(t,e)=>e?Ye(t,ut(n=>({...n,relations:n.relations.filter(e)})),Je(n=>n.relations.length>0)):t,$v=(t,e)=>Ye(t,Ui(n=>n.relations),e?Je(e):Sv,Or());function UW(t,e){const n=ku(RC.call(this,t.incoming),e);n.length!==0&&(this.addEdges(n),this.addImplicit(...n.map(r=>r.target)))}function WW(t,e){let n=$v(RC.call(this,t.incoming),e);this.excludeRelation(...n)}function SC(t){if(de.isWildcard(t)){if(!this.root)return[];const r=this.graph.ascendingSiblings(this.root),i=[...this.graph.children(this.root),this.graph.element(this.root)];return this.graph.edgesBetween(i,r)}const e=rh.call(this,t);if(e.length===0)return[];let n=[...this.resolvedElements];if(de.isElementRef(t)||de.isExpandedElementExpr(t)){const r=t.element??t.expanded,i=t.isDescedants??!1;n=n.filter(s=>!Rr(r,s.id)||i&&St(s.id)===r)}return n.length===0&&(n=Su.call(this,t)),this.graph.edgesBetween(e,n)}function GW(t,e){const n=ku(SC.call(this,t.outgoing),e);n.length!==0&&(this.addEdges(n),this.addImplicit(...n.map(r=>r.source)))}function HW(t,e){const n=$v(SC.call(this,t.outgoing),e);this.excludeRelation(...n)}var ih;(t=>{t.Empty={implicits:[],edges:[]}})(ih||(ih={}));function kC({inout:t},e){if(de.isWildcard(t)){if(!this.root)return ih.Empty;const i=this.graph.ascendingSiblings(this.root);return{edges:ku(this.graph.anyEdgesBetween(this.graph.element(this.root),i),e),implicits:[]}}const n=rh.call(this,t);if(n.length===0)return ih.Empty;let r=[...this.resolvedElements];if(de.isElementRef(t)||de.isExpandedElementExpr(t)){const i=t.element??t.expanded,s=t.isDescedants??!1;r=r.filter(o=>!Rr(i,o.id)||s&&St(o.id)===i)}return r.length===0&&(r=Su.call(this,t)),n.reduce((i,s)=>{const o=ku(this.graph.anyEdgesBetween(s,r),e);return o.length>0&&(i.implicits.push(s),i.edges.push(...o)),i},{implicits:[],edges:[]})}function KW(t,e){const{implicits:n,edges:r}=kC.call(this,t,e);this.addEdges(r),this.addImplicit(...n)}function VW(t,e){const{edges:n}=kC.call(this,t,e);this.excludeRelation(...n.flatMap(r=>r.relations))}function sh(t){return de.isElementRef(t)&&this.root===t.element&&t.isDescedants!==!0?[...this.graph.children(t.element),this.graph.element(t.element)]:de.isExpandedElementExpr(t)&&this.root===t.expanded?[...this.graph.children(t.expanded),this.graph.element(t.expanded)]:rh.call(this,t)}function YW(t,e){let n,r;de.isWildcard(t.source)&&!de.isWildcard(t.target)?(n=Su.call(this,t.target),r=sh.call(this,t.target)):!de.isWildcard(t.source)&&de.isWildcard(t.target)?(n=sh.call(this,t.source),r=Su.call(this,t.source)):(n=sh.call(this,t.source),r=sh.call(this,t.target));const i=this.graph.edgesBetween(n,r);t.isBidirectional===!0&&i.push(...this.graph.edgesBetween(r,n)),this.addEdges(ku(i,e))}function XW(t,e){const n=Sn(t.source),r=Sn(t.target),i=a=>{let c=n(a.source)&&r(a.target);return!c&&t.isBidirectional&&(c=n(a.target)&&r(a.source)),c},s=this.edges.filter(i),o=$v(s,e);this.excludeRelation(...o)}function JW(t,e){return xa({source:t.source.id,target:t.target.id},{source:e.source.id,target:e.target.id})}let ZW=class gP{constructor(e,n){this.view=e,this.graph=n}explicits=new Set;implicits=new Set;ctxEdges=[];static elementView(e,n){return new gP(e,n).compute()}compute(){this.reset();const{docUri:e,rules:n,...r}=this.view,i=n.filter(hN);this.root&&i.length==0&&this.addElement(this.graph.element(this.root)),this.processPredicates(i),this.removeRedundantImplicitEdges();const s=[...this.includedElements],o=bC(s),a=new Map,c=this.computeEdges();for(const p of c){a.set(p.id,p);const m=o.get(p.source),w=o.get(p.target);for(ge(m,`Source node ${p.source} not found`),ge(w,`Target node ${p.target} not found`);p.parent&&!o.has(p.parent);)p.parent=St(p.parent);m.outEdges.push(p.id),w.inEdges.push(p.id);for(const v of or(p.source)){if(v===p.parent)break;o.get(v)?.outEdges.push(p.id)}for(const v of or(p.target)){if(v===p.parent)break;o.get(v)?.inEdges.push(p.id)}}const u=s.flatMap(p=>o.get(p.id)??[]),l=yC(n,wC(n,IW({nodes:u,edges:c}))),d=new Set([...l.flatMap(p=>p.children.length===0?p.outEdges.flatMap(m=>a.get(m)??[]):[]),...c]),f=this.view.rules.findLast(db),h=DC(l);return mC({...r,autoLayout:{direction:f?.direction??"TB",...f?.nodeSep&&{nodeSep:f.nodeSep},...f?.rankSep&&{rankSep:f.rankSep}},nodes:ut(l,y1(["notation"])),edges:$W(n,l,d),...h.length>0&&{notation:{elements:h}}})}get root(){return hb(this.view)?this.view.viewOf:null}computeEdges(){return this.ctxEdges.map(e=>{ge(Fr(e.relations,1),"Edge must have at least one relation");const n=qc(e.relations,xa),r=e.source.id,i=e.target.id,s={id:`${r}:${i}`,parent:ws(r,i),source:r,target:i,label:null,relations:n.map(c=>c.id)};let o;if(o=Rn(n)??Ye(n,Je(c=>c.source===r&&c.target===i),Rn()),!o){const c=Ye(n,h1((u,l)=>(ne(l.title)&&!u.title.includes(l.title)&&u.title.push(l.title),ne(l.description)&&!u.description.includes(l.description)&&u.description.push(l.description),ne(l.technology)&&!u.technology.includes(l.technology)&&u.technology.push(l.technology),ne(l.kind)&&!u.kind.includes(l.kind)&&u.kind.push(l.kind),ne(l.color)&&!u.color.includes(l.color)&&u.color.push(l.color),ne(l.line)&&!u.line.includes(l.line)&&u.line.push(l.line),ne(l.head)&&!u.head.includes(l.head)&&u.head.push(l.head),ne(l.tail)&&!u.tail.includes(l.tail)&&u.tail.push(l.tail),ne(l.navigateTo)&&!u.navigateTo.includes(l.navigateTo)&&u.navigateTo.push(l.navigateTo),u),{title:[],description:[],technology:[],kind:[],head:[],tail:[],color:[],line:[],navigateTo:[]}));o={title:Rn(c.title)??"[...]",description:Rn(c.description),technology:Rn(c.technology),kind:Rn(c.kind),head:Rn(c.head),tail:Rn(c.tail),color:Rn(c.color),line:Rn(c.line),navigateTo:Rn(c.navigateTo)}}const a=PW(n);return Object.assign(s,this.getEdgeLabel(o),ne(o.description)&&{description:o.description},ne(o.technology)&&{technology:o.technology},ne(o.kind)&&{kind:o.kind},o.color&&{color:o.color},o.line&&{line:o.line},o.head&&{head:o.head},o.tail&&{tail:o.tail},o.navigateTo&&{navigateTo:o.navigateTo},a&&{tags:a})})}get includedElements(){return new Set([...this.explicits,...this.ctxEdges.flatMap(e=>[e.source,e.target])])}get resolvedElements(){return new Set([...this.explicits,...this.implicits,...this.ctxEdges.flatMap(e=>[e.source,e.target])])}get edges(){return this.ctxEdges}addEdges(e){for(const n of e){if(!Fr(n.relations,1))continue;const r=this.ctxEdges.find(i=>i.source.id===n.source.id&&i.target.id===n.target.id);if(r){r.relations=Or([...r.relations,...n.relations]);continue}this.ctxEdges.push(n)}}addElement(...e){for(const n of e)this.explicits.add(n),this.implicits.add(n)}addImplicit(...e){for(const n of e)this.implicits.add(n)}excludeElement(...e){for(const n of e)this.ctxEdges=this.ctxEdges.filter(r=>r.source.id!==n.id&&r.target.id!==n.id),this.explicits.delete(n),this.implicits.delete(n)}excludeRelation(...e){if(e.length===0)return;const n=new Set,r=Ye(this.ctxEdges,ut(s=>{const o=s.relations.filter(a=>!e.includes(a));return o.length===0?(n.add(s.source),n.add(s.target),null):o.length!==s.relations.length?{...s,relations:o}:s}),Je(qj));if(n.size===0)return;this.ctxEdges=r;const i=this.includedElements;if(i.size===0){this.implicits.clear();return}for(const s of n)i.has(s)||this.implicits.delete(s)}reset(){this.explicits.clear(),this.implicits.clear(),this.ctxEdges=[]}removeRedundantImplicitEdges(){const e=new Set,n=s=>s.reduce((o,a)=>(e.has(a)||(o.push(a),e.add(a)),o),[]),r=s=>{const{source:o,target:a}=s;return c=>{const u=o.id===c.source.id,l=a.id===c.target.id;if(u&&l)return!0;const d=Rr(o.id,c.source.id),f=Rr(a.id,c.target.id);return d&&f||u&&f||l&&d}},i=[...this.ctxEdges].sort(JW).reverse();this.ctxEdges=i.reduce((s,o)=>{const a=n(o.relations);return a.length===0||s.length>0&&s.some(r(o))||s.push({source:o.source,target:o.target,relations:a}),s},[])}processPredicates(e){for(const n of e){const r="include"in n,i=n.include??n.exclude;for(const s of i){if(de.isElementPredicateExpr(s)){this.processElementPredicate(s,r);continue}if(de.isRelationPredicateExpr(s)){this.processRelationPredicate(s,r);continue}Ae(s)}}return this}processElementPredicate(e,n,r){if(de.isCustomElement(e))return n&&this.processElementPredicate(e.custom.expr,n),this;if(de.isElementWhere(e)){const i=vo(e.where.condition);return this.processElementPredicate(e.where.expr,n,i),this}if(de.isExpandedElementExpr(e))return n?zW.call(this,e,r):BW.call(this,e,r),this;if(de.isElementKindExpr(e)||de.isElementTagExpr(e))return n?jW.call(this,e,r):qW.call(this,e,r),this;if(de.isElementRef(e))return n?OW.call(this,e,r):FW.call(this,e,r),this;if(de.isWildcard(e))return n?LW.call(this,e,r):MW.call(this,e,r),this;Ae(e)}processRelationPredicate(e,n,r){if(de.isCustomRelationExpr(e))return n&&this.processRelationPredicate(e.customRelation.relation,n),this;if(de.isRelationWhere(e)){const i=vo(e.where.condition);return this.processRelationPredicate(e.where.expr,n,i),this}if(de.isIncoming(e))return n?UW.call(this,e,r):WW.call(this,e,r),this;if(de.isOutgoing(e))return n?GW.call(this,e,r):HW.call(this,e,r),this;if(de.isInOut(e))return n?KW.call(this,e,r):VW.call(this,e,r),this;if(de.isRelation(e))return n?YW.call(this,e,r):XW.call(this,e,r),this;Ae(e)}getEdgeLabel(e){const n=[];return ne(e.title)&&n.push(e.title),ne(e.technology)&&n.push(`[${e.technology}]`),n.length>0?{label:n.join(`
1726
- `)}:{}}};function QW(t,e){return ZW.elementView(t,e)}function $C(t,e){try{return{isSuccess:!0,view:QW(t,e)}}catch(n){return{isSuccess:!1,error:n instanceof Error?n:new Error(`Unknown error: ${n}`),view:void 0}}}let eG=class mP{constructor(e,n){this.view=e,this.graph=n}explicits=new Set;steps=[];static compute(e,n){return new mP(e,n).compute()}addStep({source:e,target:n,title:r,isBackward:i,navigateTo:s,...o},a,c){const u=c?pb(c,a):pb(a),l=this.graph.element(e),d=this.graph.element(n);this.explicits.add(l),this.explicits.add(d);const{title:f,relations:h,tags:p,navigateTo:m}=this.findRelations(l,d),w=ne(s)&&s!==this.view.id?s:m;this.steps.push({id:u,...o,source:l,target:d,title:r??f,relations:h??[],isBackward:i??!1,...w?{navigateTo:w}:{},...p?{tags:p}:{}})}compute(){const{docUri:e,rules:n,steps:r,...i}=this.view;let s=1;for(const f of r){if(yN(f)){if(f.__parallel.length===0)continue;f.__parallel.length===1?this.addStep(f.__parallel[0],s):f.__parallel.forEach((h,p)=>this.addStep(h,p+1,s))}else this.addStep(f,s);s++}for(const f of n)if(mN(f))for(const h of f.include){const p=Sn(h);this.graph.elements.filter(p).forEach(m=>this.explicits.add(m))}const o=[...this.explicits],a=bC(o),c=this.steps.map(({source:f,target:h,relations:p,title:m,isBackward:w,...v})=>{const E=et(a.get(f.id),`Source node ${f.id} not found`),S=et(a.get(h.id),`Target node ${h.id} not found`),$={parent:ws(f.id,h.id),source:f.id,target:h.id,label:m,relations:p,color:ms,line:X0,head:yo,...v};for(w&&($.dir="back");$.parent&&!a.has($.parent);)$.parent=St($.parent);E.outEdges.push($.id),S.inEdges.push($.id);for(const I of or($.source)){if(I===$.parent)break;a.get(I)?.outEdges.push($.id)}for(const I of or($.target)){if(I===$.parent)break;a.get(I)?.inEdges.push($.id)}return $}),u=yC(n,wC(n,o.map(f=>et(a.get(f.id))))),l=n.findLast(db),d=DC(u);return mC({...i,autoLayout:{direction:l?.direction??"LR",...l?.nodeSep&&{nodeSep:l.nodeSep},...l?.rankSep&&{rankSep:l.rankSep}},nodes:ut(u,y1(["notation"])),edges:c,...d.length>0&&{notation:{elements:d}}})}findRelations(e,n){const r=Or(this.graph.edgesBetween(e,n).flatMap(l=>l.relations));if(r.length===0)return{title:null,tags:null,relations:null,navigateTo:null};const i=Ye(r,Ui(l=>l.tags),Je(ne),Or()),s=Fr(i,1)?i:null,o=Fr(r,1)?ut(r,l=>l.id):null,a=Rn(r)||r.find(l=>l.source===e.id&&l.target===n.id),c=ne(a?.title)?a.title:Ye(r,ut(l=>l.title),Je(ne),Or(),Rn()),u=a?.navigateTo&&a.navigateTo!==this.view.id?a.navigateTo:Ye(r,ut(l=>l.navigateTo),Je(ne),Je(l=>l!==this.view.id),Or(),Rn());return{title:c??null,tags:s,relations:o,navigateTo:u??null}}};function CC(t,e){try{return{isSuccess:!0,view:eG.compute(t,e)}}catch(n){return{isSuccess:!1,error:n instanceof Error?n:new Error(`Unknown error: ${n}`),view:void 0}}}const Cv=Set,_v=Map;function Av(t,e){return t.size===0||e.size===0?new Set:new Set([...t].filter(n=>e.has(n)))}let _C=class{#e=new Map;#t=new Map;#n=new Map;#r=new Set;#s=new Map;#i=new _v;#o=new _v;#a=new _v;#c=new Map;constructor({elements:e,relations:n}){for(const r of Object.values(e))this.addElement(r);for(const r of Object.values(n))this.addRelation(r)}get rootElements(){return[...this.#r]}get elements(){return[...this.#e.values()]}element(e){const n=this.#e.get(e);return ge(n,`Element ${e} not found`),n}connectedRelations(e){return[...this._incomingTo(e),...this._outgoingFrom(e),...this._internalOf(e)]}children(e){return this._childrenOf(e).slice()}childrenOrElement(e){const n=this.children(e);return n.length>0?n:[this.element(e)]}siblings(e){const n=ji(e)?e:e.id,r=St(n);return(r?this._childrenOf(r):this.rootElements).filter(i=>i.id!==n)}ancestors(e){let n=ji(e)?e:e.id;const r=[];let i;for(;i=this.#t.get(n);)r.push(i),n=i.id;return r}ascendingSiblings(e){const n=ji(e)?e:e.id;let r=this.#c.get(n);return r||(r=[...this.siblings(n),...this.ancestors(n).flatMap(i=>this.siblings(i.id))],this.#c.set(n,r)),r.slice()}anyEdgesBetween(e,n){if(n.length===0)return[];const r=ji(e)?this.element(e):e,i=this._incomingTo(r.id),s=this._outgoingFrom(r.id);if(i.size===0&&s.size===0)return[];const o=[];for(const a of n){const c=ji(a)?this.element(a):a;if(!pd(r,c)){if(s.size>0){const u=Av(this._incomingTo(c.id),s);u.size>0&&o.push({source:r,target:c,relations:[...u]})}if(i.size>0){const u=Av(this._outgoingFrom(c.id),i);u.size>0&&o.push({source:c,target:r,relations:[...u]})}}}return o}edgesWithin(e){return e.length<2?[]:e.reduce((n,r,i,s)=>(i===s.length-1||n.push(...this.anyEdgesBetween(r,s.slice(i+1))),n),[])}edgesBetween(e,n){const r=w1(e)?e:[e],i=w1(n)?n:[n];if(r.length===0||i.length===0)return[];const s=[];for(const o of r){const a=ji(o)?this.element(o):o,c=this._outgoingFrom(a.id);if(c.size!==0)for(const u of i){const l=ji(u)?this.element(u):u;if(pd(a,l))continue;const d=this._incomingTo(l.id),f=Av(c,d);f.size>0&&s.push({source:a,target:l,relations:[...f]})}}return s}addElement(e){if(this.#e.has(e.id))throw new Error(`Element ${e.id} already exists`);this.#e.set(e.id,e);const n=St(e.id);n?(this.#t.set(e.id,this.element(n)),this._childrenOf(n).push(e)):this.#r.add(e)}addRelation(e){if(this.#s.has(e.id))throw new Error(`Relation ${e.id} already exists`);this.#s.set(e.id,e),this._incomingTo(e.target).add(e),this._outgoingFrom(e.source).add(e);const n=ws(e.source,e.target);if(n)for(const r of[n,...or(n)])this._internalOf(r).add(e);for(const r of or(e.source)){if(r===n)break;this._outgoingFrom(r).add(e)}for(const r of or(e.target)){if(r===n)break;this._incomingTo(r).add(e)}}_childrenOf(e){let n=this.#n.get(e);return n||(n=[],this.#n.set(e,n)),n}_incomingTo(e){let n=this.#i.get(e);return n||(n=new Cv,this.#i.set(e,n)),n}_outgoingFrom(e){let n=this.#o.get(e);return n||(n=new Cv,this.#o.set(e,n)),n}_internalOf(e){let n=this.#a.get(e);return n||(n=new Cv,this.#a.set(e,n)),n}};const tG=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,nG=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,rG=/^([/\\]\s*){2,}[^/\\]/;function AC(t){return["./","../"].some(e=>t.startsWith(e))}function xv(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?tG.test(t):nG.test(t)||(e.acceptRelative?rG.test(t):!1)}function iG(t="",e){return t.endsWith("/")}function sG(t="",e){return(iG(t)?t.slice(0,-1):t)||"/"}function oG(t="",e){return t.endsWith("/")?t:t+"/"}function oh(t=""){return t.startsWith("/")}function xC(t=""){return(oh(t)?t.slice(1):t)||"/"}function aG(t=""){return oh(t)?t:"/"+t}function cG(t,e){if(uG(e))return t;const n=sG(e);if(!t.startsWith(n))return t;const r=t.slice(n.length);return r[0]==="/"?r:"/"+r}function uG(t){return!t||t==="/"}function ah(t=""){const[e="",n="",r=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:n,hash:r}}const ch="DynamicViewRule";function Iv(t){return Z.isInstance(t,ch)}const uh="ElementExpression";function Pv(t){return Z.isInstance(t,uh)}const lh="ElementPredicate";function lG(t){return Z.isInstance(t,lh)}const dh="ElementPredicateOrWhere";function dG(t){return Z.isInstance(t,dh)}const Ys="ElementProperty";function fG(t){return Z.isInstance(t,Ys)}const Xs="LikeC4View";function Nv(t){return Z.isInstance(t,Xs)}const fh="MetadataProperty";function IC(t){return Z.isInstance(t,fh)}const PC="Predicate",hh="RelationExpression";function Ov(t){return Z.isInstance(t,hh)}const ph="RelationPredicate";function hG(t){return Z.isInstance(t,ph)}const gh="RelationPredicateOrWhere";function pG(t){return Z.isInstance(t,gh)}const ta="RelationProperty";function gG(t){return Z.isInstance(t,ta)}const mh="RelationshipStyleProperty";function mG(t){return Z.isInstance(t,mh)}const na="StringProperty";function yG(t){return Z.isInstance(t,na)}const $u="StyleProperty";function Fv(t){return Z.isInstance(t,$u)}const yh="ViewProperty";function vG(t){return Z.isInstance(t,yh)}const vh="ViewRule";function wG(t){return Z.isInstance(t,vh)}const wh="ViewRulePredicate";function Lv(t){return Z.isInstance(t,wh)}const Cu="WhereElement";function NC(t){return Z.isInstance(t,Cu)}const _u="WhereElementExpression";function bG(t){return Z.isInstance(t,_u)}const OC="WhereExpression",bh="WhereKindEqual";function DG(t){return Z.isInstance(t,bh)}const Au="WhereRelation";function FC(t){return Z.isInstance(t,Au)}const xu="WhereRelationExpression";function EG(t){return Z.isInstance(t,xu)}const Dh="WhereTagEqual";function TG(t){return Z.isInstance(t,Dh)}const Iu="ArrowProperty";function Pu(t){return Z.isInstance(t,Iu)}const Nu="BorderProperty";function Eh(t){return Z.isInstance(t,Nu)}const Ou="ColorProperty";function Js(t){return Z.isInstance(t,Ou)}const Zs="CustomColor",Th="CustomElementProperties";function RG(t){return Z.isInstance(t,Th)}const Rh="CustomRelationProperties";function SG(t){return Z.isInstance(t,Rh)}const Fu="DirectedRelationExpression";function Mv(t){return Z.isInstance(t,Fu)}const ra="DynamicView";function kG(t){return Z.isInstance(t,ra)}const Sh="DynamicViewBody";function LC(t){return Z.isInstance(t,Sh)}const Lu="DynamicViewIncludePredicate";function $G(t){return Z.isInstance(t,Lu)}const kh="DynamicViewParallelSteps";function zv(t){return Z.isInstance(t,kh)}const $h="DynamicViewPredicateIterator";function MC(t){return Z.isInstance(t,$h)}const Bv="DynamicViewRef",Ch="DynamicViewStep";function jv(t){return Z.isInstance(t,Ch)}const jr="Element";function qr(t){return Z.isInstance(t,jr)}const _h="ElementBody";function ia(t){return Z.isInstance(t,_h)}const Mu="ElementDescedantsExpression";function qv(t){return Z.isInstance(t,Mu)}const Ah="ElementExpressionsIterator";function CG(t){return Z.isInstance(t,Ah)}const Ki="ElementKind";function _G(t){return Z.isInstance(t,Ki)}const zu="ElementKindExpression";function xh(t){return Z.isInstance(t,zu)}const Bu="ElementPredicateWhere";function Uv(t){return Z.isInstance(t,Bu)}const ju="ElementPredicateWith";function Ih(t){return Z.isInstance(t,ju)}const qu="ElementRef";function Uu(t){return Z.isInstance(t,qu)}const Wu="ElementStringProperty";function Wv(t){return Z.isInstance(t,Wu)}const Gu="ElementStyleProperty";function Hu(t){return Z.isInstance(t,Gu)}const Ku="ElementTagExpression";function Ph(t){return Z.isInstance(t,Ku)}const sa="ElementView";function Nh(t){return Z.isInstance(t,sa)}const Oh="ElementViewBody";function Gv(t){return Z.isInstance(t,Oh)}const Hv="ElementViewRef",Vu="ExcludePredicate";function Fh(t){return Z.isInstance(t,Vu)}const Yu="ExpandElementExpression";function zC(t){return Z.isInstance(t,Yu)}const oa="ExtendElement";function aa(t){return Z.isInstance(t,oa)}const Lh="ExtendElementBody";function Kv(t){return Z.isInstance(t,Lh)}const Mh="FqnElementRef";function BC(t){return Z.isInstance(t,Mh)}const Xu="IconProperty";function Vi(t){return Z.isInstance(t,Xu)}const Ju="IncludePredicate";function Vv(t){return Z.isInstance(t,Ju)}const Zu="IncomingRelationExpression";function jC(t){return Z.isInstance(t,Zu)}const Qu="InOutRelationExpression";function Yv(t){return Z.isInstance(t,Qu)}const Qs="LibIcon";function AG(t){return Z.isInstance(t,Qs)}const Xv="LikeC4Grammar",zh="LikeC4Lib";function qC(t){return Z.isInstance(t,zh)}const el="LineProperty";function tl(t){return Z.isInstance(t,el)}const nl="LinkProperty";function Bh(t){return Z.isInstance(t,nl)}const rl="MetadataAttribute";function xG(t){return Z.isInstance(t,rl)}const il="MetadataBody";function IG(t){return Z.isInstance(t,il)}const ca="Model";function Jv(t){return Z.isInstance(t,ca)}const ua="ModelViews";function Zv(t){return Z.isInstance(t,ua)}const jh="NavigateToProperty";function Qv(t){return Z.isInstance(t,jh)}const sl="NotationProperty";function la(t){return Z.isInstance(t,sl)}const ol="NotesProperty";function UC(t){return Z.isInstance(t,ol)}const al="OpacityProperty";function qh(t){return Z.isInstance(t,al)}const cl="OutgoingRelationExpression";function ew(t){return Z.isInstance(t,cl)}const Uh="Predicates";function WC(t){return Z.isInstance(t,Uh)}const Wh="Relation";function Yi(t){return Z.isInstance(t,Wh)}const Gh="RelationBody";function GC(t){return Z.isInstance(t,Gh)}const ul="RelationNavigateToProperty";function Hh(t){return Z.isInstance(t,ul)}const ll="RelationPredicateWhere";function HC(t){return Z.isInstance(t,ll)}const dl="RelationPredicateWith";function tw(t){return Z.isInstance(t,dl)}const Xi="RelationshipKind";function PG(t){return Z.isInstance(t,Xi)}const fl="RelationStringProperty";function Kh(t){return Z.isInstance(t,fl)}const hl="RelationStyleProperty";function nw(t){return Z.isInstance(t,hl)}const pl="ShapeProperty";function Vh(t){return Z.isInstance(t,pl)}const Yh="SpecificationColor";function Xh(t){return Z.isInstance(t,Yh)}const da="SpecificationElementKind";function fa(t){return Z.isInstance(t,da)}const gl="SpecificationElementStringProperty";function KC(t){return Z.isInstance(t,gl)}const ha="SpecificationRelationshipKind";function pa(t){return Z.isInstance(t,ha)}const ml="SpecificationRelationshipStringProperty";function VC(t){return Z.isInstance(t,ml)}const ga="SpecificationRule";function rw(t){return Z.isInstance(t,ga)}const ma="SpecificationTag";function Jh(t){return Z.isInstance(t,ma)}const Ji="Tag";function YC(t){return Z.isInstance(t,Ji)}const Zh="Tags";function iw(t){return Z.isInstance(t,Zh)}const sw="ViewRef",yl="ViewRuleAutoLayout";function Qh(t){return Z.isInstance(t,yl)}const vl="ViewRuleStyle";function ya(t){return Z.isInstance(t,vl)}const wl="ViewStringProperty";function NG(t){return Z.isInstance(t,wl)}const bl="WhereBinaryExpression";function OG(t){return Z.isInstance(t,bl)}const Dl="WhereElementKind";function FG(t){return Z.isInstance(t,Dl)}const El="WhereElementNegation";function XC(t){return Z.isInstance(t,El)}const Tl="WhereElementTag";function LG(t){return Z.isInstance(t,Tl)}const Rl="WhereRelationKind";function JC(t){return Z.isInstance(t,Rl)}const Sl="WhereRelationNegation";function ZC(t){return Z.isInstance(t,Sl)}const kl="WhereRelationTag";function MG(t){return Z.isInstance(t,kl)}const $l="WildcardExpression";function va(t){return Z.isInstance(t,$l)}class QC extends vD{getAllTypes(){return[Iu,Nu,Ou,Zs,Th,Rh,Fu,ra,Sh,Lu,kh,$h,Bv,ch,Ch,jr,_h,Mu,uh,Ah,Ki,zu,lh,dh,Bu,ju,Ys,qu,Wu,Gu,Ku,sa,Oh,Hv,Vu,Yu,oa,Lh,Mh,Xu,Qu,Ju,Zu,Qs,Xv,zh,Xs,el,nl,rl,il,fh,ca,ua,jh,sl,ol,al,cl,PC,Uh,Wh,Gh,hh,ul,ph,gh,ll,dl,ta,fl,hl,Xi,mh,pl,Yh,da,gl,ha,ml,ga,ma,na,$u,Ji,Zh,yh,sw,vh,yl,wh,vl,wl,bl,Cu,_u,Dl,El,Tl,OC,bh,Au,xu,Rl,Sl,kl,Dh,$l]}computeIsSubtype(e,n){switch(e){case Iu:case el:return this.isSubtype(mh,n);case Nu:case al:case pl:return this.isSubtype($u,n);case Ou:return this.isSubtype(mh,n)||this.isSubtype($u,n);case Fu:case Zu:case Qu:case cl:return this.isSubtype(hh,n);case ra:case sa:return this.isSubtype(Xs,n);case Lu:return this.isSubtype(ch,n);case Mu:case zu:case qu:case Ku:case Yu:case $l:return this.isSubtype(uh,n);case uh:case Bu:return this.isSubtype(dh,n);case lh:case ph:return this.isSubtype(PC,n);case dh:case ju:return this.isSubtype(lh,n);case Wu:return this.isSubtype(Ys,n)||this.isSubtype(na,n);case Gu:return this.isSubtype(Ys,n);case Vu:case Ju:return this.isSubtype(wh,n);case Xu:return this.isSubtype(Ys,n)||this.isSubtype($u,n);case nl:return this.isSubtype(Ys,n)||this.isSubtype(ta,n)||this.isSubtype(yh,n);case rl:case sl:case ol:case gl:case ml:return this.isSubtype(na,n);case il:return this.isSubtype(fh,n);case fh:return this.isSubtype(Ys,n)||this.isSubtype(ta,n);case hh:case ll:return this.isSubtype(gh,n);case ul:case hl:return this.isSubtype(ta,n);case gh:case dl:return this.isSubtype(ph,n);case fl:return this.isSubtype(ta,n)||this.isSubtype(na,n);case yl:case vl:return this.isSubtype(ch,n)||this.isSubtype(vh,n);case wh:return this.isSubtype(vh,n);case wl:return this.isSubtype(na,n)||this.isSubtype(yh,n);case bl:return this.isSubtype(_u,n)||this.isSubtype(xu,n);case Cu:case El:return this.isSubtype(_u,n);case _u:case xu:return this.isSubtype(OC,n);case Dl:return this.isSubtype(Cu,n)||this.isSubtype(bh,n);case Tl:return this.isSubtype(Cu,n)||this.isSubtype(Dh,n);case Au:case Sl:return this.isSubtype(xu,n);case Rl:return this.isSubtype(bh,n)||this.isSubtype(Au,n);case kl:return this.isSubtype(Au,n)||this.isSubtype(Dh,n);default:return!1}}getReferenceType(e){const n=`${e.container.$type}:${e.property}`;switch(n){case"ColorProperty:customColor":return Zs;case"DynamicViewRef:view":return ra;case"DynamicViewStep:kind":case"OutgoingRelationExpression:kind":case"Relation:kind":case"WhereRelationKind:value":return Xi;case"Element:kind":case"ElementKindExpression:kind":case"WhereElementKind:value":return Ki;case"ElementRef:el":case"FqnElementRef:el":return jr;case"ElementTagExpression:tag":case"Tags:values":case"WhereElementTag:value":case"WhereRelationTag:value":return Ji;case"ElementViewRef:view":return sa;case"IconProperty:libicon":return Qs;case"ViewRef:view":return Xs;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case Iu:return{name:Iu,properties:[{name:"key"},{name:"value"}]};case Nu:return{name:Nu,properties:[{name:"key"},{name:"value"}]};case Ou:return{name:Ou,properties:[{name:"customColor"},{name:"key"},{name:"themeColor"}]};case Zs:return{name:Zs,properties:[{name:"name"}]};case Th:return{name:Th,properties:[{name:"props",defaultValue:[]}]};case Rh:return{name:Rh,properties:[{name:"props",defaultValue:[]}]};case Fu:return{name:Fu,properties:[{name:"source"},{name:"target"}]};case ra:return{name:ra,properties:[{name:"body"},{name:"name"}]};case Sh:return{name:Sh,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"steps",defaultValue:[]},{name:"tags"}]};case Lu:return{name:Lu,properties:[{name:"predicates"}]};case kh:return{name:kh,properties:[{name:"steps",defaultValue:[]}]};case $h:return{name:$h,properties:[{name:"prev"},{name:"value"}]};case Bv:return{name:Bv,properties:[{name:"view"}]};case Ch:return{name:Ch,properties:[{name:"custom"},{name:"isBackward",defaultValue:!1},{name:"kind"},{name:"source"},{name:"target"},{name:"title"}]};case jr:return{name:jr,properties:[{name:"body"},{name:"kind"},{name:"name"},{name:"props",defaultValue:[]}]};case _h:return{name:_h,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case Mu:return{name:Mu,properties:[{name:"parent"}]};case Ah:return{name:Ah,properties:[{name:"prev"},{name:"value"}]};case Ki:return{name:Ki,properties:[{name:"name"}]};case zu:return{name:zu,properties:[{name:"isEqual",defaultValue:!1},{name:"kind"}]};case Bu:return{name:Bu,properties:[{name:"subject"},{name:"where"}]};case ju:return{name:ju,properties:[{name:"custom"},{name:"subject"}]};case qu:return{name:qu,properties:[{name:"el"},{name:"parent"}]};case Wu:return{name:Wu,properties:[{name:"key"},{name:"value"}]};case Gu:return{name:Gu,properties:[{name:"key"},{name:"props",defaultValue:[]}]};case Ku:return{name:Ku,properties:[{name:"isEqual",defaultValue:!1},{name:"tag"}]};case sa:return{name:sa,properties:[{name:"body"},{name:"extends"},{name:"name"},{name:"viewOf"}]};case Oh:return{name:Oh,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"tags"}]};case Hv:return{name:Hv,properties:[{name:"view"}]};case Vu:return{name:Vu,properties:[{name:"predicates"}]};case Yu:return{name:Yu,properties:[{name:"expand"}]};case oa:return{name:oa,properties:[{name:"body"},{name:"element"}]};case Lh:return{name:Lh,properties:[{name:"elements",defaultValue:[]}]};case Mh:return{name:Mh,properties:[{name:"el"},{name:"parent"}]};case Xu:return{name:Xu,properties:[{name:"key"},{name:"libicon"},{name:"value"}]};case Ju:return{name:Ju,properties:[{name:"predicates"}]};case Zu:return{name:Zu,properties:[{name:"to"}]};case Qu:return{name:Qu,properties:[{name:"inout"}]};case Qs:return{name:Qs,properties:[{name:"name"}]};case Xv:return{name:Xv,properties:[{name:"likec4lib",defaultValue:[]},{name:"models",defaultValue:[]},{name:"specifications",defaultValue:[]},{name:"views",defaultValue:[]}]};case zh:return{name:zh,properties:[{name:"icons",defaultValue:[]}]};case el:return{name:el,properties:[{name:"key"},{name:"value"}]};case nl:return{name:nl,properties:[{name:"key"},{name:"title"},{name:"value"}]};case rl:return{name:rl,properties:[{name:"key"},{name:"value"}]};case il:return{name:il,properties:[{name:"props",defaultValue:[]}]};case ca:return{name:ca,properties:[{name:"elements",defaultValue:[]},{name:"name"}]};case ua:return{name:ua,properties:[{name:"name"},{name:"views",defaultValue:[]}]};case jh:return{name:jh,properties:[{name:"key"},{name:"value"}]};case sl:return{name:sl,properties:[{name:"key"},{name:"value"}]};case ol:return{name:ol,properties:[{name:"key"},{name:"value"}]};case al:return{name:al,properties:[{name:"key"},{name:"value"}]};case cl:return{name:cl,properties:[{name:"from"},{name:"isBidirectional",defaultValue:!1},{name:"kind"}]};case Uh:return{name:Uh,properties:[{name:"prev"},{name:"value"}]};case Wh:return{name:Wh,properties:[{name:"body"},{name:"kind"},{name:"source"},{name:"tags"},{name:"target"},{name:"technology"},{name:"title"}]};case Gh:return{name:Gh,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case ul:return{name:ul,properties:[{name:"key"},{name:"value"}]};case ll:return{name:ll,properties:[{name:"subject"},{name:"where"}]};case dl:return{name:dl,properties:[{name:"custom"},{name:"subject"}]};case Xi:return{name:Xi,properties:[{name:"name"}]};case fl:return{name:fl,properties:[{name:"key"},{name:"value"}]};case hl:return{name:hl,properties:[{name:"key"},{name:"props",defaultValue:[]}]};case pl:return{name:pl,properties:[{name:"key"},{name:"value"}]};case Yh:return{name:Yh,properties:[{name:"color"},{name:"name"}]};case da:return{name:da,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case gl:return{name:gl,properties:[{name:"key"},{name:"value"}]};case ha:return{name:ha,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case ml:return{name:ml,properties:[{name:"key"},{name:"value"}]};case ga:return{name:ga,properties:[{name:"colors",defaultValue:[]},{name:"elements",defaultValue:[]},{name:"name"},{name:"relationships",defaultValue:[]},{name:"tags",defaultValue:[]}]};case ma:return{name:ma,properties:[{name:"tag"}]};case Ji:return{name:Ji,properties:[{name:"name"}]};case Zh:return{name:Zh,properties:[{name:"prev"},{name:"values",defaultValue:[]}]};case sw:return{name:sw,properties:[{name:"view"}]};case yl:return{name:yl,properties:[{name:"direction"},{name:"nodeSep"},{name:"rankSep"}]};case vl:return{name:vl,properties:[{name:"props",defaultValue:[]},{name:"target"}]};case wl:return{name:wl,properties:[{name:"key"},{name:"value"}]};case bl:return{name:bl,properties:[{name:"left"},{name:"operator"},{name:"right"}]};case Dl:return{name:Dl,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case El:return{name:El,properties:[{name:"value"}]};case Tl:return{name:Tl,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Rl:return{name:Rl,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Sl:return{name:Sl,properties:[{name:"value"}]};case kl:return{name:kl,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case $l:return{name:$l,properties:[{name:"isWildcard",defaultValue:!1}]};default:return{name:e,properties:[]}}}}const Z=new QC;let e_;const zG=()=>e_??(e_=pj(`{"$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@7"},"arguments":[]}},{"$type":"Assignment","feature":"models","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"views","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"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@105"},"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@110"},"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@110"},"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@110"},"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@109"},"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@8"},"arguments":[]}},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"relationships","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"colors","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@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@96"},"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@128"},"arguments":[]}},{"$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@104"},"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@99"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"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@128"},"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@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":true},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"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@110"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@126"},"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@128"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"arguments":[]}},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}],"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"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@23"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"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@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@96"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@91"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"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@128"},"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@21"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"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@24"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":true},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"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@15"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FqnElementRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@123"},"arguments":[]},{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@15"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"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@15"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@123"},"arguments":[]},{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@15"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"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@107"},"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@107"},"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@24/parameters@0"}},"elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}]},{"$type":"Group","guardCondition":{"$type":"Negation","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@24/parameters@0"}}},"elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},"cardinality":"?"}]}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@108"},"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@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"arguments":[]}},{"$type":"Assignment","feature":"technology","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"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@23"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"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@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@87"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"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@128"},"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@99"},"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@30"},"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@31"},"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@129"},"arguments":[]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"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":"Assignment","feature":"views","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":"LikeC4ViewRule","returnType":{"$ref":"#/types@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"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@110"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"extends"},{"$type":"Assignment","feature":"extends","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"of"},{"$type":"Assignment","feature":"viewOf","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}]}],"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"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@110"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"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@34"},"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@35"},"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@23"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"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@23"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]},"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"steps","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]}]}},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"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@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"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@128"},"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@48"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@80"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@81"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@78"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@80"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@81"},"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@47"},"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@22"},"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@108"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@85"},"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@49"},"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@49"},"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@50"},"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@50"},"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@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicate","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"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@53"},"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@84"},"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@60"},"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@54"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementExpression","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"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@56"},"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@56"},"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@57"},"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@57"},"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@54"},"arguments":[]},{"$type":"Keyword","value":")"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"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@54"},"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@111"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@107"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereElementKind"}},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"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@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"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@112"},"arguments":[]},{"$type":"Assignment","feature":"tag","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@107"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementKindExpression"}},{"$type":"Keyword","value":"element.kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@112"},"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@22"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ExpandElementExpression"},"feature":"expand","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@120"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementDescedantsExpression"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@121"},"arguments":[]}]}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicate","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"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@65"},"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@85"},"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@72"},"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@66"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationExpression","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@67"},"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@68"},"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@68"},"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@69"},"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@69"},"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@66"},"arguments":[]},{"$type":"Keyword","value":")"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@70"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@71"},"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@66"},"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@111"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@107"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationKind"}},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"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@73"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@75"},"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@74"},"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@60"},"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@76"},"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@60"},"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@60"},"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"},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@108"},"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@60"},"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@60"},"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@79"},"arguments":[]}}]},"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@51"},"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@51"},"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@77"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@95"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@82"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"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@43"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"rankSep","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@130"},"arguments":[]}},{"$type":"Assignment","feature":"nodeSep","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@130"},"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@128"},"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@128"},"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@86"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@82"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@95"},"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@87"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@82"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@83"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@99"},"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@36"},"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@38"},"arguments":[]}}]},"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@106"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"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@102"},"arguments":[]}},{"$type":"Assignment","feature":"customColor","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@6"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@109"},"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@127"},"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@105"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@106"},"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@103"},"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@100"},"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@93"},"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@89"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@92"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@94"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@90"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@91"},"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@95"},"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@100"},"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@101"},"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@89"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@97"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@98"},"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@122"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@131"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@130"},"arguments":[]}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IconId","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"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@118"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@119"},"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@122"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"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@124"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"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@129"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@103"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@101"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@100"},"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@129"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@103"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@102"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@101"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@100"},"arguments":[]},{"$type":"Keyword","value":"element"},{"$type":"Keyword","value":"model"}]},"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@126"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@125"},"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@126"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@125"},"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\\\\._/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DotWildcard","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\.\\\\*/"},"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@34"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@35"}}]}},{"$type":"Type","name":"StringProperty","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@18"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@42"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@27"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@31"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@9"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@13"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@82"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@83"}}]}},{"$type":"Type","name":"WhereTagEqual","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@59/definition/elements@0/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@71/definition/elements@0/elements@0/inferredType"}}]}},{"$type":"Type","name":"WhereKindEqual","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@59/definition/elements@1/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@71/definition/elements@1/elements@0/inferredType"}}]}},{"$type":"Type","name":"WhereExpression","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@54"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@66"}}]}}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"interfaces":[],"usedGrammars":[]}`)),t_={languageId:"likec4",fileExtensions:[".c4",".likec4",".like-c4"],caseInsensitive:!1},BG={skipValidations:!0,recoveryEnabled:!0,nodeLocationTracking:"full"},jG={AstReflection:()=>new QC},qG={Grammar:()=>zG(),LanguageMetaData:()=>t_,parser:{ParserConfig:()=>BG}},$e=Ze.withTag("lsp");function Xt(t){$e.error(t)}function Dt(t){if(t instanceof Error){$e.warn(t.stack??t.message);return}$e.warn(t)}function UG(t){$e.level=qe[t]}function WG(t){const e={log:({level:n,...r},i)=>{if(n!==qe.error&&n!==qe.fatal)return;const s=r.tag||"",o=r.args.map(c=>Iy(c)?c.stack??c.message:typeof c=="string"?c:""+c);s&&o.unshift(`[${s}]`);const a=o.join(" ");t.telemetry.logEvent({eventName:"error",error:a})}};Ze.addReporter(e),$e.setReporters(Ze.options.reporters)}function GG(t){const e={log:({level:n,...r},i)=>{const s=r.tag||"",o=r.args.map(c=>Iy(c)?c.stack??c.message:typeof c=="string"?c:""+c);s&&o.unshift(`[${s}]`);const a=o.join(" ");switch(!0){case n>=qe.debug:{t.console.debug(a);break}case n>=qe.log:{t.console.info(a);break}case n>=qe.warn:{t.console.warn(a);break}case n>=qe.fatal:{t.console.error(a);break}default:t.console.log(a)}}};Ze.setReporters([e]),$e.setReporters(Ze.options.reporters)}function kn(t){return t.el.ref}function ep(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 Cl=Symbol.for("idattr"),ow={writeId(t,e){return t[Cl]=e,t},readId(t){return t[Cl]}},n_={writeId(t,e){return $t(e)?t[Cl]=void 0:t[Cl]=e,t},readId(t){return t[Cl]}};function HG(t){return Object.assign(t,{c4Specification:{tags:new Set,elements:{},relationships:{},colors:{}},c4Elements:[],c4Relations:[],c4Views:[]})}function tp(t){return t.textDocument.languageId===t_.languageId}function r_(t){return tp(t)&&t.state>=je.IndexedContent&&!!t.c4fqnIndex}function _l(t){return tp(t)&&t.state==je.Validated&&!!t.c4Specification&&!!t.c4Elements&&!!t.c4Relations&&!!t.c4Views&&!!t.c4fqnIndex}function KG(t){return e=>t.some(n=>n(e))}const VG=KG([MC,Ih,tw,Pv,Ov,zv,jv,vG,Fv,iw,wG,Iv,Gv,LC,Nv,gG,GC,Yi,fG,ia,qr,Kv,aa,fa,pa,Jh,Xh,rw,Zv,Jv]),YG=t=>{let e=t;for(;e;){if(VG(e))return e;e=e.$container}};function XG(t){const e=t.diagnostics?.filter(r=>r.severity===Fc.Error)??[],n=new WeakSet(e.flatMap(r=>YG(r.node)??[]));return{isValid:r=>!n.has(r),invalidNodes:n}}function*JG(t,e){const n=t.parseResult.value.models.flatMap(s=>s.elements),r=[];let i;for(;i=n.shift();)if(e(i)){if(Yi(i)){r.push(i);continue}if(aa(i)){i.body&&i.body.elements.length>0&&n.push(...i.body.elements);continue}i.body&&i.body.elements.length>0&&n.push(...i.body.elements),yield i}for(const s of r)yield s}function ZG(t){const e=kn(t.target);if(!e)throw new Error("RelationRefError: Invalid reference to target");if(yt(t.source)){const n=kn(t.source);if(!n)throw new Error("RelationRefError: Invalid reference to source");return{source:n,target:e}}if(!ia(t.$container))throw new Error("RelationRefError: Invalid container for sourceless relation");return{source:t.$container.$container,target:e}}function i_({value:t}){const e=parseFloat(t);return isNaN(e)?100:T1(e,{min:0,max:100})}function np(t,e){const n={};if(!t||t.length===0)return n;for(const r of t)if(e(r))switch(!0){case Eh(r):{ne(r.value)&&(n.border=r.value);break}case Js(r):{const i=Al(r);ne(i)&&(n.color=i);break}case Vh(r):{ne(r.value)&&(n.shape=r.value);break}case Vi(r):{const i=r.libicon?.ref?.name??r.value;ne(i)&&(n.icon=i);break}case qh(r):{n.opacity=i_(r);break}default:Ae(r.$type)}return n}function QG(t){const e={};if(!t||t.length===0)return e;for(const n of t){if(Js(n)){const r=Al(n);ne(r)&&(e.color=r);continue}if(tl(n)){e.line=n.value;continue}if(Pu(n)){switch(n.key){case"head":{e.head=n.value;break}case"tail":{e.tail=n.value;break}default:Ae(n)}continue}Ae(n)}return e}function s_(t){const{color:e,line:n,head:r,tail:i}=QG(t?.filter(mG));return{...e&&e!==ms?{color:e}:{},...n&&n!==X0?{line:n}:{},...r&&r!==yo?{head:r}:{},...i?{tail:i}:{}}}function Al(t){return t?.themeColor??t?.customColor?.$refText}function o_(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:Ae(t.direction)}return{direction:r,...n&&{nodeSep:n},...e&&{rankSep:e}}}function eH(t){switch(t){case"TB":return"TopBottom";case"BT":return"BottomTop";case"LR":return"LeftRight";case"RL":return"RightLeft";default:Ae(t)}}function a_(t){if(Pv(t))return t;if(Uv(t))return t.subject;if(Ih(t))return a_(t.subject);Ae(t)}class tH{constructor(e){this.services=e}async provideCodeLens(e,n,r){return e.state!==je.Validated&&($e.debug(`Waiting for document ${e.uri.path} to be validated`),await this.services.shared.workspace.DocumentBuilder.waitUntil(je.Validated,e.uri,r),$e.debug(`Document ${e.uri.path} is validated`)),_l(e)?e.parseResult.value.views.flatMap(i=>i.views).flatMap(i=>{const s=ow.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 nH extends Jk{completionOptions={triggerCharacters:["."]};completionForKeyword(e,n,r){if(this.filterKeyword(e,n)){if(["views","specification","model"].includes(n.value))return r(e,{label:n.value,detail:`Insert ${n} block`,kind:Yn.Module,insertTextFormat:Af.Snippet,insertText:`${n} {
1727
- $0
1728
- }`});if(n.value==="dynamic")return r(e,{label:n.value,detail:"Insert dynamic view",kind:Yn.Class,insertTextFormat:Af.Snippet,insertText:["dynamic view ${1:view_${TM_FILENAME_BASE}_${CURRENT_SECOND}} {"," title '${2:Untitled}'"," "," $0","}"].join(`
1729
- `)});r(e,{label:n.value,kind:this.getKeywordCompletionItemKind(n),detail:"Keyword",sortText:"1"})}}}class rH extends Zk{createDocumentHighlight(e){return le.DocumentHighlight.create(e.segment.range,le.DocumentHighlightKind.Read)}}class iH{constructor(e){this.services=e}getDocumentLinks(e,n){return _l(e)?Cr(e.parseResult.value).filter(Bh).map(r=>{try{const i=Cn(r.$cstNode,"value")?.range,s=this.resolveLink(e,r.value);if(i&&xv(s))return{range:i,target:s}}catch(i){Dt(i)}return null}).nonNullable().toArray():[]}resolveLink(e,n){if(xv(n)||oh(n))return n;const r=AC(n)?new URL(e.uri.toString(!0)):this.services.shared.workspace.WorkspaceManager.workspaceURL;return new URL(n,r).toString()}relativeLink(e,n){if(oh(n))return xC(n);if(AC(n)){const r=new URL(e.uri.toString(!0)),i=new URL(n,r).toString();return xC(cG(i,this.services.shared.workspace.WorkspaceManager.workspaceURL.toString()))}return null}}class sH{constructor(e){this.services=e,this.nodeKindProvider=e.shared.lsp.NodeKindProvider}nodeKindProvider;getSymbols({parseResult:{value:{specifications:e,models:n,views:r,likec4lib:i}}}){return[...i.map(s=>()=>this.getLikec4LibSymbol(s)),...e.map(s=>()=>this.getSpecSymbol(s)),...n.map(s=>()=>this.getModelSymbol(s)),...r.map(s=>()=>this.getModelViewsSymbol(s))].flatMap(s=>{try{return s()??[]}catch(o){return Xt(o),[]}})}getLikec4LibSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=e.icons.map(i=>this.getLibIconSymbol(i)).filter(ne);return r.length===0?[]:[{kind:fr.Namespace,name:"icons",range:n.range,selectionRange:pc(n,"icons")?.range??n.range,children:r}]}getSpecSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=Cn(n,"name");if(!r)return[];const i=Ye([...e.elements,...e.tags,...e.relationships],ut(s=>{try{if(fa(s)||pa(s))return this.getKindSymbol(s);if(Jh(s))return this.getTagSymbol(s)}catch(o){return Xt(o),null}Ae(s)}),Je(ne));return i.length===0?[]:[{kind:fr.Namespace,name:e.name,range:n.range,selectionRange:r.range,children:i}]}getModelSymbol(e){const n=e.$cstNode;if(!n)return[];const r=Cn(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))}]:[]}getElementsSymbol(e){try{if(aa(e))return this.getExtendElementSymbol(e);if(qr(e))return this.getElementSymbol(e)}catch(n){Xt(n)}return[]}getExtendElementSymbol(e){const n=e.$cstNode,r=e.element.$cstNode,i=e.body;return!n||!r?[]:[{kind:this.symbolKind(e),name:ep(e.element),range:n.range,selectionRange:r.range,children:i.elements.flatMap(s=>this.getElementsSymbol(s))}]}getElementSymbol(e){const n=e.$cstNode,r=Cn(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=Cn(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||qi(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||qi(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||qi(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?Cn(n,"name"):null;return r?[{kind:this.symbolKind(e),name:r.text,range:n.range,selectionRange:r.range,children:[]}]:[]}symbolKind(e){return this.nodeKindProvider.getSymbolKind(e)}}class oH extends n${locator;constructor(e){super(e),this.locator=e.likec4.ModelLocator}getAstNodeHoverContent(e){if(YC(e))return{contents:{kind:"markdown",value:rv(`
1730
- tag: \`${e.name}\`
1731
- `)}};if(qr(e)){const n=this.locator.getParsedElement(e);return n?{contents:{kind:"markdown",value:[n.id,`### ${n.title}`,"`"+n.kind+"` "].join(`
1732
- `)}}:void 0}}}class aH extends F9{highlightElement(e,n){if(PG(e))return n({node:e,property:"name",type:Me.function});if(AG(e))return n({node:e,property:"name",type:Me.type,modifier:[ct.definition]}),"prune";if(ew(e)&&"kind"in e){n({node:e,property:"kind",type:Me.function});return}if(Yi(e)&&"kind"in e&&n({node:e,property:"kind",type:Me.function}),Qv(e)||Hh(e))return n({node:e,property:"key",type:Me.property}),n({node:e,property:"value",type:Me.variable,modifier:[ct.definition,ct.readonly]}),"prune";if((qv(e)||va(e))&&e.$cstNode){n({cst:e.$cstNode,type:Me.variable,modifier:[ct.definition,ct.readonly]});return}if(JC(e)&&ne(e.value)){n({node:e,property:"value",type:Me.function});return}if((NC(e)||FC(e))&&ne(e.value)){n({node:e,property:"value",type:Me.type,modifier:[ct.definition,ct.readonly]});return}if(xh(e)&&ne(e.kind)&&n({node:e,property:"kind",type:Me.type,modifier:[ct.definition]}),Ph(e)&&ne(e.tag)&&n({node:e,property:"tag",type:Me.type,modifier:[ct.definition]}),Uu(e)||BC(e))return n({node:e,property:"el",type:e.parent?Me.property:Me.variable,modifier:[ct.definition,ct.readonly]}),e.parent?void 0:"prune";if(Xh(e)){n({node:e,keyword:"color",type:Me.keyword}),n({node:e,property:"name",type:Me.type,modifier:[ct.declaration,ct.readonly]});return}if((fa(e)||pa(e))&&n({node:e,property:"kind",type:Me.type,modifier:[ct.declaration,ct.readonly]}),iw(e))return n({node:e,property:"values",type:Me.interface});if(YC(e))return n({node:e,property:"name",type:Me.type,modifier:[ct.definition]});if((nw(e)||Hu(e)&&ia(e.$container))&&n({node:e,property:"key",type:Me.property}),qh(e))return n({node:e,property:"key",type:Me.property}),n({node:e,property:"value",type:Me.number}),"prune";if(Bh(e)||Vi(e)||yG(e))return n({node:e,property:"key",type:Me.property}),"value"in e&&e.value&&n({node:e,property:"value",type:Me.string}),Vi(e)&&e.libicon&&n({node:e,property:"libicon",type:Me.enum,modifier:[ct.defaultLibrary]}),"prune";if(Js(e)||Vh(e)||Pu(e)||tl(e)||Eh(e))return n({node:e,property:"key",type:Me.property}),"value"in e&&n({node:e,property:"value",type:Me.enum}),"prune";if(qr(e))return this.highlightAstElement(e,n);if(Nv(e))return this.highlightView(e,n)}highlightAstElement(e,n){n({node:e,property:"name",type:Me.variable,modifier:[ct.declaration,ct.readonly]}),n({node:e,property:"kind",type:Me.keyword,modifier:[]})}highlightView(e,n){e.name&&n({node:e,property:"name",type:Me.variable,modifier:[ct.declaration,ct.readonly,"local"]})}}const{findNodeForProperty:cH}=Bd,{toDocumentSegment:c_}=jO;function uH(t,e,n){const r=cH(e.$cstNode,"name");return{documentUri:n.uri,name:e.name,...e.$cstNode&&{selectionSegment:c_(e.$cstNode)},...r&&{nameSegment:c_(r)},path:t.getAstNodePath(e),type:jr}}function lH(t,e){const n=t.c4fqnIndex=new Nr,r=t.parseResult.value.models.flatMap(a=>a.elements);if(r.length===0)return;const i=e.workspace.AstNodeLocator,s=r.map(a=>[a,null]);let o;for(;o=s.shift();)try{const[a,c]=o;if(Yi(a))continue;if(aa(a)){if(yt(a.body)&&!qi(a.body.elements)){const u=ep(a.element);for(const l of a.body.elements)s.push([l,u])}continue}if(qr(a)){const u=iN(a.name,c);if(n.add(u,{...uH(i,a,t),fqn:u}),n_.writeId(a,u),yt(a.body)&&!qi(a.body.elements))for(const l of a.body.elements)s.push([l,u]);continue}Ae(a)}catch(a){Xt(a)}}class dH{constructor(e){this.services=e,this.langiumDocuments=e.shared.workspace.LangiumDocuments,e.shared.workspace.DocumentBuilder.onBuildPhase(je.IndexedContent,async(n,r)=>{for(const i of n)if(tp(i)){delete i.c4fqnIndex,delete i.c4Elements,delete i.c4Specification,delete i.c4Relations,delete i.c4Views;try{lH(i,e)}catch(s){Dt(s)}}return await Promise.resolve()}),$e.debug("[FqnIndex] Created")}langiumDocuments;get documents(){return this.langiumDocuments.all.filter(r_)}entries(e){return this.documents.flatMap(n=>n.c4fqnIndex.keys().filter(e).flatMap(r=>n.c4fqnIndex.get(r)))}getFqn(e){return n_.readId(e)??null}byFqn(e){return this.documents.flatMap(n=>n.c4fqnIndex.get(e))}directChildrenOf(e){return He([e]).flatMap(n=>{const r=this.entries(i=>St(i)===n).map(i=>[i.name,i]).toArray();return r.length===0?[]:new Nr(r).entriesGroupedByKey().flatMap(([i,s])=>s.length===1?s:[]).iterator()})}uniqueDescedants(e){return new Ct(()=>{const n=`${e}.`,r=new Set,i=[],s=new Nr;if(this.entries(o=>o.startsWith(n)).forEach(o=>{const a=_a(o.fqn),c={...o,name:a};St(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():Kt)}}function fH(t){const e=new Map;for(const n of t)if(vN(n)&&n.viewOf&&$t(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){if(i.navigateTo)continue;const s=D1(e.get(i.id)??[],o=>o!==n);s&&(i.navigateTo=s)}return t}function hH(t){const e=new Ru.Graph({directed:!0,multigraph:!1,compound:!1});for(const n of Uf(t))e.setNode(n.id),fb(n)&&e.setEdge(n.id,n.extends);if(e.edgeCount()===0)return t;for(;!AW(e);){const n=Wc(_W(e));if(!n)break;const r=Uc(n);if(!r)break;e.removeNode(r)}return EC(e,e.sources()).reduce((n,r)=>{const i=t[r];if(!i)return n;if(fb(i)){const s=n[i.extends];return s?Object.assign(n,{[i.id]:{...s,...i,rules:[...s.rules,...i.rules]}}):(Ze.debug(`View "${i.id}" extends from "${i.extends}" which does not exist`),n)}return Object.assign(n,{[i.id]:i})},{})}function pH(t,e="/"){const n=Ye(t,ut(c=>c.docUri),Je(ne),Or());if(n.length===0)return"";if(n.length===1){const c=ah(n[0]).pathname.split(e);return c.length<=1?e:(c.pop(),c.join(e)+e)}ge(Fr(n,2),"Expected at least 2 unique URIs");const[r,...i]=n,s=ah(r).pathname.split(e);let o=s.length;for(const c of i){if(c===r)continue;const u=ah(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 gH(t){const e="/",n=pH(t,e);return t.map(r=>{if(!r.docUri)return{view:r,parts:[]};let i=ah(r.docUri).pathname;return n.length>0?(ge(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=fd(r.parts[s],i.parts[s]);if(o!==0)return o}return fd(r.view.title??r.view.id,i.view.title??i.view.id)}).map(({parts:r,view:i})=>({...i,relativePath:r.join(e)}))}function mH(t,e){const n={tags:new Set,elements:{},relationships:{},colors:{}};Vj(ut(e,Lr("c4Specification")),f=>{f.tags.forEach(h=>n.tags.add(h)),Object.assign(n.elements,f.elements),Object.assign(n.relationships,f.relationships),Object.assign(n.colors,f.colors)});function r(f,h){return ut(h,p=>{try{const m=t.lsp.DocumentLinkProvider.relativeLink(f,p.url);if(m&&m!==p.url)return{...p,relative:m}}catch(m){Dt(m)}return p})}const i=Bi(n.colors,f=>kO(f.color));function s(f){return({tags:h,links:p,style:{color:m,shape:w,icon:v,opacity:E,border:S},id:$,kind:I,title:N,description:A,technology:q,metadata:W})=>{try{const V=n.elements[I];if(!V)return $e.warn(`No kind '${I}' found for ${$}`),null;const x=p?r(f,p):null;return m??=V.style.color,w??=V.style.shape,v??=V.style.icon,E??=V.style.opacity,S??=V.style.border,q??=V.technology,{...m&&{color:m},...w&&{shape:w},...v&&{icon:v},...W&&!qi(W)&&{metadata:W},...V.notation&&{notation:V.notation},style:{...S&&{border:S},...v1(E)&&{opacity:E}},links:x,tags:h??null,technology:q??null,description:A??null,title:N,kind:I,id:$}}catch(V){Dt(V)}return null}}const o=Ye(e,Ui(f=>ut(f.c4Elements,s(f))),Je(ne),NO,h1((f,h)=>{const p=St(h.id);return p&&$t(f[p])?(Dt(`No parent found for ${h.id}`),f):(f[h.id]=h,f)},{}));function a(f){return({astPath:h,source:p,target:m,kind:w,links:v,id:E,...S})=>{if($t(o[p])||$t(o[m]))return $e.warn(`Invalid relation ${E}, source: ${p}(${!!o[p]}), target: ${m}(${!!o[m]})`),null;const $=v?r(f,v):null;return Mr(w)&&w in n.relationships?{...n.relationships[w],...S,...$&&{links:$},source:p,target:m,kind:w,id:E}:{...$&&{links:$},...S,source:p,target:m,id:E}}}const c=Ye(e,Ui(f=>ut(f.c4Relations,a(f))),Je(ne),qc(xa),p1(),Py(Lr("id")));function u(f){const h=f.uri.toString();return p=>{let{id:m,title:w,description:v,tags:E,links:S,astPath:$,...I}=p;p.__==="element"&&$t(w)&&"viewOf"in p&&(w=o[p.viewOf]?.title??null),$t(w)&&m==="index"&&(w="Landscape view");const N=S?r(f,S):null;return{...I,tags:E,links:N,docUri:h,description:v,title:w,id:m,customColorDefinitions:i}}}const l=e.flatMap(f=>ut(f.c4Views,u(f)));l.some(f=>f.id==="index")||l.unshift({__:"element",id:"index",title:"Landscape view",description:null,tags:null,links:null,customColorDefinitions:i,rules:[{include:[{wildcard:!0}]}]});const d=Ye(l,gH,Py(Lr("id")),hH);return{specification:{tags:Array.from(n.tags),elements:n.elements,relationships:n.relationships},elements:o,relations:c,views:d}}const aw="ParsedLikeC4Model",cw="ComputedLikeC4Model";class yH{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(je.Validated,async(r,i)=>{let s=[];try{$e.debug(`[ModelBuilder] onValidated (${r.length} docs)`);for(const o of n.parse(r))s.push(o.uri)}catch(o){Dt(o)}return s.length>0&&this.notifyListeners(s),await Promise.resolve()}),$e.debug("[ModelBuilder] Created")}langiumDocuments;listeners=[];unsafeSyncBuildModel(){return this.services.WorkspaceCache.get(aw,()=>{const e=this.documents();return e.length===0?($e.debug("[ModelBuilder] No documents to build model from"),null):($e.debug(`[ModelBuilder] onValidated (${e.length} docs)`),mH(this.services,e))})}async buildModel(e){const n=this.services.WorkspaceCache;return n.has(aw)?n.get(aw):await this.services.shared.workspace.WorkspaceLock.read(async()=>(e&&await Ot(e),this.unsafeSyncBuildModel()))}previousViews={};unsafeSyncBuildComputedModel(e){const n=this.services.WorkspaceCache,r=this.services.WorkspaceCache;return n.get(cw,()=>{const i=new _C(e),s=[];for(const a of Uf(e.views)){const c=nd(a)?$C(a,i):CC(a,i);if(!c.isSuccess){Dt(c.error);continue}s.push(c.view)}fH(s);const o=hi(s,a=>{const c=this.previousViews[a.id],u=c&&W$(a,c)?c:a;return r.set(u_(a.id),u),[a.id,u]});return this.previousViews={...o},{specification:e.specification,elements:e.elements,relations:e.relations,views:o}})}async buildComputedModel(e){const n=this.services.WorkspaceCache;return n.has(cw)?n.get(cw):await this.services.shared.workspace.WorkspaceLock.read(async()=>{e&&await Ot(e);const r=this.unsafeSyncBuildModel();return r?this.unsafeSyncBuildComputedModel(r):null})}async computeView(e,n){const r=this.services.WorkspaceCache,i=u_(e);return r.has(i)?r.get(i):await this.services.shared.workspace.WorkspaceLock.read(async()=>(n&&await Ot(n),r.get(i,()=>{const s=this.unsafeSyncBuildModel(),o=s?.views[e];if(!o)return $e.warn(`[ModelBuilder] Cannot find view ${e}`),null;const a=new _C(s),c=nd(o)?$C(o,a):CC(o,a);if(!c.isSuccess)return Xt(c.error),null;let u=c.view;const l=Ye(s.views,Uf(),Je(hb),Je(f=>f.id!==e),Wf(f=>f.viewOf));for(const f of u.nodes)if(!f.navigateTo){const h=l[f.id];h&&(f.navigateTo=h[0].id)}const d=this.previousViews[e];return u=d&&W$(u,d)?d:u,this.previousViews[e]=u,u})))}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(_l).toArray()}notifyListeners(e){for(const n of this.listeners)try{n(e)}catch(r){Xt(r)}}}function u_(t){return`computed-view-${t}`}const{findNodeForKeyword:vH,findNodeForProperty:rp}=Bd,{getDocument:wH}=Id;class bH{constructor(e){this.services=e,this.fqnIndex=e.likec4.FqnIndex,this.langiumDocuments=e.shared.workspace.LangiumDocuments}fqnIndex;langiumDocuments;documents(){return this.langiumDocuments.all.filter(_l)}getParsedElement(e){const n=this.fqnIndex.getFqn(e);if(!n)return null;const r=wH(e);return _l(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}}locateRelation(e){for(const n of this.documents()){const r=n.c4Relations.find(o=>o.id===e);if(!r)continue;const i=this.services.workspace.AstNodeLocator.getAstNode(n.parseResult.value,r.astPath);if(!Yi(i))continue;let s=i.title?rp(i.$cstNode,"title"):void 0;if(s??=i.kind?rp(i.$cstNode,"kind"):void 0,s??=rp(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(Nv(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?rp(r.$cstNode,"name"):void 0;return i??=vH(r.$cstNode,"view"),i??=r.$cstNode,i?{uri:n.doc.uri.toString(),range:i.range}:null}}function uw(...t){var e=t.length>1?t.join(":::"):t[0];return j7(e).toString(36)}function DH({nodes:t,edges:e,...n}){return{...n,nodes:Bi(t,({x:r,y:i,width:s,height:o,isCompound:a,...c})=>({...c,b:[r,i,s,o],c:a})),edges:Bi(e,({points:r,controlPoints:i,labelBBox:s,dotpos:o,...a})=>({...!!i&&{cp:i},...!!s&&{l:s},...!!o&&{dp:o},...a,p:r}))}}function EH({nodes:t,edges:e,autoLayout:n,...r}){return{...r,autoLayout:gN(n)?{direction:n}:n,nodes:Bi(t,({b:i,c:s,...o})=>({x:i[0],y:i[1],width:i[2],height:i[3],isCompound:s,...o})),edges:Bi(e,({p:i,cp:s,l:o,dp:a,...c})=>({...!!s&&{controlPoints:s},...!!o&&{labelBBox:o},...!!a&&{dotpos:a},...c,points:i}))}}const l_=500;function TH(t){const e=d7(DH(t)),n=C7(e),r=[];let i=0;for(;i<n.length;)r.push(" * "+n.slice(i,Math.min(i+l_,n.length))),i+=l_;return r.unshift("/**"," * @likec4-generated(v1)"),r.push(" */"),r.join(`
1733
- `)}function d_(t){return t.includes("@likec4-generated")}function RH(t){if(!d_(t))throw new Error(`Not a likec4-generated comment: ${t}`);const e=t.trim().split(`
1734
- `).filter(r=>!r.includes("**")&&!r.includes("@likec4-")&&!r.includes("*/")).map(r=>r.replaceAll("*","").trim()).join(""),n=k7(e);return EH(E7(n))}const f_=({operator:t,not:e},n)=>t.startsWith("!=")?{neq:n}:t.startsWith("=")?{eq:n}:e?{neq:n}:{eq:n};function xl(t){switch(!0){case TG(t):{const e=t.value?.ref?.name;return ge(e,"Expected tag name"),{tag:f_(t,e)}}case DG(t):{const e=t.value?.ref?.name;return ge(e,"Expected kind name"),{kind:f_(t,e)}}case(XC(t)||ZC(t)):return{not:xl(t.value)};case OG(t):{const e=xl(t.left),n=xl(t.right),r=t.operator.toLowerCase();switch(r){case"and":{const i=[Xp(e)?e.and:e,Xp(n)?n.and:n].flat();return ge(vs(i),"Expected non-empty array"),{and:i}}case"or":{const i=[Jp(e)?e.or:e,Jp(n)?n.or:n].flat();return ge(vs(i),"Expected non-empty array"),{or:i}}default:Ae(r)}}default:Ae(t)}}const{getDocument:lw}=Id;function eo(t){return Mr(t)?Wt(t).split(`
1735
- `).join(" "):void 0}function Wt(t){return Mr(t)?rv(t).trim():void 0}class SH{constructor(e){this.services=e,this.fqnIndex=e.likec4.FqnIndex,$e.debug("[ModelParser] Created")}fqnIndex;parse(e){const n=Array.isArray(e)?e:[e],r=[];for(const i of n){if(!r_(i)){$e.warn(`Not a FqnIndexedDocument: ${i.uri.toString(!0)}`);continue}try{r.push(this.parseLikeC4Document(i))}catch(s){Xt(new Error(`Error parsing document ${i.uri.toString()}`,{cause:s}))}}return r}parseLikeC4Document(e){const n=HG(e),{isValid:r}=XG(n);return this.parseSpecification(n,r),this.parseModel(n,r),this.parseViews(n,r),n}parseSpecification(e,n){const{parseResult:r,c4Specification:i}=e,s=r.value.specifications.filter(n),o=s.flatMap(l=>l.elements.filter(n));for(const{kind:l,props:d}of o)try{const f=l.name;if(!ne(f))continue;if(f in i.elements){$e.warn(`Element kind "${f}" is already defined`);continue}const h=d.find(Hu),p=hi(d.filter(KC).filter(m=>Mr(m.value))??[],m=>[m.key,Wt(m.value)]);i.elements[f]={...p,style:{...np(h?.props,n)}}}catch(f){Dt(f)}const a=s.flatMap(l=>l.relationships.filter(n));for(const{kind:l,props:d}of a)try{const f=l.name;if(!ne(f))continue;if(f in i.relationships){$e.warn(`Relationship kind "${f}" is already defined`);continue}const h=hi(d.filter(VC).filter(p=>Mr(p.value))??[],p=>[p.key,Wt(p.value)]);i.relationships[f]={...h,...s_(d)}}catch(f){Dt(f)}const c=s.flatMap(l=>l.tags.filter(n));for(const l of c){const d=l.tag.name;ne(d)&&i.tags.add(d)}const u=s.flatMap(l=>l.colors.filter(n));for(const{name:l,color:d}of u)try{const f=l.name;if(f in i.colors){$e.warn(`Custom color "${f}" is already defined`);continue}i.colors[f]={color:d}}catch(f){Dt(f)}}parseModel(e,n){for(const r of JG(e,n)){if(qr(r)){try{e.c4Elements.push(this.parseElement(r,n))}catch(i){Dt(i)}continue}if(Yi(r)){try{e.c4Relations.push(this.parseRelation(r))}catch(i){Dt(i)}continue}Ae(r)}}parseElement(e,n){const r=this.resolveFqn(e),i=e.kind.$refText,s=this.convertTags(e.body),o=e.body?.props.find(Hu)?.props,a=np(o,n),c=this.getMetadata(e.body?.props.find(IC)),u=this.getAstNodePath(e);let[l,d,f]=e.props??[];const h=hi(e.body?.props.filter(Wv)??[],w=>[w.key,w.value||void 0]);l=eo(l??h.title),d=Wt(h.description??d),f=eo(h.technology??f);const p=this.convertLinks(e.body),m=e.body?.props.find(Vi);if(m){const w=m.libicon?.ref?.name??m.value;ne(w)&&(a.icon=w)}return{id:r,kind:i,astPath:u,title:l??e.name,...c&&{metadata:c},...s&&{tags:s},...p&&vs(p)&&{links:p},...ne(f)&&{technology:f},...ne(d)&&{description:d},style:a}}parseRelation(e){const n=ZG(e),r=this.resolveFqn(n.target),i=this.resolveFqn(n.source),s=this.convertTags(e)??this.convertTags(e.body),o=this.convertLinks(e.body),a=e.kind?.ref?.name,c=this.getMetadata(e.body?.props.find(IC)),u=this.getAstNodePath(e),l=hi(e.body?.props.filter(Kh).filter(w=>Mr(w.value))??[],w=>[w.key,w.value]),d=Ye(e.body?.props??[],Je(Hh),ut(w=>w.value.view.ref?.name),Je(ne),Wc()),f=Wt(e.title??l.title)??"",h=Wt(l.description),p=Wt(e.technology)??eo(l.technology),m=e.body?.props.find(nw);return{id:uw(u,i,r),astPath:u,source:i,target:r,title:f,...c&&{metadata:c},...ne(p)&&{technology:p},...ne(h)&&{description:h},...a&&{kind:a},...s&&{tags:s},...vs(o)&&{links:o},...s_(m?.props),...d&&{navigateTo:d}}}parseViews(e,n){const r=e.parseResult.value.views.flatMap(i=>n(i)?i.views:[]);for(const i of r)try{if(!n(i))continue;e.c4Views.push(Nh(i)?this.parseElementView(i,n):this.parseDynamicElementView(i,n))}catch(s){Dt(s)}}parseViewRulePredicate(e,n){const r=[];let i=e.predicates;for(;i;){try{ne(i.value)&&n(i.value)&&r.unshift(this.parsePredicate(i.value,n))}catch(s){Dt(s)}i=i.prev}return Vv(e)?{include:r}:{exclude:r}}parsePredicate(e,n){if(lG(e))return this.parseElementPredicate(e,n);if(hG(e))return this.parseRelationPredicate(e,n);Ae(e)}parseElementExpressionsIterator(e){const n=[];let r=e;for(;r;){try{n.unshift(this.parseElementExpr(r.value))}catch(i){Dt(i)}r=r.prev}return n}parseElementPredicate(e,n){if(Ih(e))return this.parseElementPredicateWith(e,n);if(Uv(e))return this.parseElementPredicateWhere(e);if(Pv(e))return this.parseElementExpr(e);Ae(e)}parseElementExpr(e){if(va(e))return{wildcard:!0};if(xh(e))return ge(e.kind,"ElementKindExpr kind is not resolved: "+e.$cstNode?.text),{elementKind:e.kind.$refText,isEqual:e.isEqual};if(Ph(e)){ge(e.tag,"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(zC(e)){const n=kn(e.expand);return ge(n,"Element not found "+e.expand.$cstNode?.text),{expanded:this.resolveFqn(n)}}if(qv(e)){const n=kn(e.parent);return ge(n,"Element not found "+e.parent.$cstNode?.text),{element:this.resolveFqn(n),isDescedants:!0}}if(Uu(e)){const n=kn(e);return ge(n,"Element not found "+e.$cstNode?.text),{element:this.resolveFqn(n)}}Ae(e)}parseElementPredicateWith(e,n){const r=this.parseElementPredicate(e.subject,n);return(e.custom?.props??[]).reduce((i,s)=>{if(Qv(s)){const o=s.value.view.$refText;return ne(o)&&(i.custom.navigateTo=o),i}if(Wv(s)){if(yt(s.value)){let o=s.key==="description"?Wt(s.value):eo(s.value);i.custom[s.key]=o||""}return i}if(Vi(s)){const o=s.libicon?.ref?.name??s.value;return yt(o)&&(i.custom[s.key]=o),i}if(Js(s)){const o=Al(s);return yt(o)&&(i.custom[s.key]=o),i}if(Vh(s)||Eh(s))return yt(s.value)&&(i.custom[s.key]=s.value),i;if(qh(s))return yt(s.value)&&(i.custom[s.key]=i_(s)),i;if(la(s))return ne(s.value)&&(i.custom[s.key]=Wt(s.value)),i;Ae(s)},{custom:{expr:r}})}parseElementPredicateWhere(e){return{where:{expr:this.parseElementExpr(e.subject),condition:e.where?xl(e.where):{kind:{neq:"--always-true--"}}}}}parseRelationPredicate(e,n){if(tw(e)){const r=HC(e.subject)?e.subject.subject:e.subject;return this.parseRelationPredicateWith(e,r)}if(HC(e))return this.parseRelationPredicateWhere(e);if(Ov(e))return this.parseRelationExpr(e);Ae(e)}parseRelationPredicateWhere(e){return{where:{expr:this.parseRelationExpr(e.subject),condition:e.where?xl(e.where):{kind:{neq:"--always-true--"}}}}}parseRelationPredicateWith(e,n){const r=this.parseRelationExpr(n);return(e.custom?.props??[]).reduce((i,s)=>{if(Kh(s)||la(s)||UC(s))return yt(s.value)&&(i.customRelation[s.key]=Wt(s.value)??""),i;if(Pu(s))return ne(s.value)&&(i.customRelation[s.key]=s.value),i;if(Js(s)){const o=Al(s);return ne(o)&&(i.customRelation[s.key]=o),i}if(tl(s))return ne(s.value)&&(i.customRelation[s.key]=s.value),i;if(Hh(s)){const o=s.value.view.ref?.name;return ne(o)&&(i.customRelation.navigateTo=o),i}Ae(s)},{customRelation:{relation:r}})}parseRelationExpr(e){if(Mv(e))return{source:this.parseElementExpr(e.source.from),target:this.parseElementExpr(e.target),isBidirectional:e.source.isBidirectional};if(Yv(e))return{inout:this.parseElementExpr(e.inout.to)};if(ew(e))return{outgoing:this.parseElementExpr(e.from)};if(jC(e))return{incoming:this.parseElementExpr(e.to)};Ae(e)}parseViewRule(e,n){if(Lv(e))return this.parseViewRulePredicate(e,n);if(ya(e)){const r=np(e.props.filter(Fv),n),i=Wt(e.props.find(la)?.value);return{targets:this.parseElementExpressionsIterator(e.target),...i&&{notation:i},style:{...r}}}if(Qh(e))return o_(e);Ae(e)}parseViewManualLaout(e){const n=wd(e.$cstNode,["BLOCK_COMMENT"]);if(!(!n||!d_(n.text)))try{return RH(n.text)}catch(r){const i=lw(e);$e.warn(r),$e.warn(`Ignoring manual layout of "${e.name??"unnamed"}" at ${i.uri.fsPath}:${1+(n.range.start.line||0)}`);return}}parseDynamicParallelSteps(e){return{__parallel:e.steps.map(n=>this.parseDynamicStep(n))}}parseDynamicStep(e){const n=kn(e.source);if(!n)throw new Error("Invalid reference to source");const r=kn(e.target);if(!r)throw new Error("Invalid reference to target");let i=this.resolveFqn(n),s=this.resolveFqn(r);const o=Wt(e.title)??null;let a={source:i,target:s,title:o};if(e.isBackward&&(a={source:s,target:i,title:o,isBackward:!0}),Array.isArray(e.custom?.props))for(const c of e.custom.props)try{if(Kh(c)||la(c)||UC(c)){yt(c.value)&&(a[c.key]=Wt(c.value)??"");continue}if(Pu(c)){yt(c.value)&&(a[c.key]=c.value);continue}if(Js(c)){const u=Al(c);yt(u)&&(a[c.key]=u);continue}if(tl(c)){yt(c.value)&&(a[c.key]=c.value);continue}if(Hh(c)){const u=c.value.view.ref?.name;ne(u)&&(a.navigateTo=u);continue}Ae(c)}catch(u){Dt(u)}return a}parseElementView(e,n){const r=e.body;ge(r,"ElementView body is not defined");const i=this.getAstNodePath(e);let s=null;if("viewOf"in e){const h=kn(e.viewOf),p=h&&this.resolveFqn(h);p?s=p:$e.warn("viewOf is not resolved: "+e.$cstNode?.text)}let o=e.name;o||(o="view_"+uw(lw(e).uri.toString(),i,s??""));const a=eo(r.props.find(h=>h.key==="title")?.value)??null,c=Wt(r.props.find(h=>h.key==="description")?.value)??null,u=this.convertTags(r),l=this.convertLinks(r),d=this.parseViewManualLaout(e),f={__:"element",id:o,astPath:i,title:a,description:c,tags:u,links:vs(l)?l:null,rules:r.rules.flatMap(h=>{try{return n(h)?this.parseViewRule(h,n):[]}catch(p){return Dt(p),[]}}),...s&&{viewOf:s},...d&&{manualLayout:d}};if(ow.writeId(e,f.id),"extends"in e){const h=e.extends.view.ref;return ge(h?.name,"view extends is not resolved: "+e.$cstNode?.text),Object.assign(f,{extends:h.name})}return f}parseDynamicElementView(e,n){const r=e.body;ge(r,"DynamicElementView body is not defined");const i=r.props.filter(n),s=this.getAstNodePath(e);let o=e.name;o||(o="dynamic_"+uw(lw(e).uri.toString(),s));const a=eo(i.find(f=>f.key==="title")?.value)??null,c=Wt(i.find(f=>f.key==="description")?.value)??null,u=this.convertTags(r),l=this.convertLinks(r);ow.writeId(e,o);const d=this.parseViewManualLaout(e);return{__:"dynamic",id:o,astPath:s,title:a,description:c,tags:u,links:vs(l)?l:null,rules:r.rules.reduce((f,h)=>{if(!n(h))return f;try{if($G(h)){const p=[];let m=h.predicates;for(;m;){try{if(n(m.value)){const w=this.parseElementPredicate(m.value,n);p.unshift(w)}}catch(w){Dt(w)}m=m.prev}return p.length>0&&f.push({include:p}),f}if(ya(h)){const p=np(h.props.filter(Fv),n),m=Wt(h.props.find(la)?.value),w=this.parseElementExpressionsIterator(h.target);return w.length>0&&f.push({targets:w,...m&&{notation:m},style:{...p}}),f}if(Qh(h))return f.push(o_(h)),f;Ae(h)}catch(p){return Dt(p),f}},[]),steps:r.steps.reduce((f,h)=>{try{n(h)&&(zv(h)?f.push(this.parseDynamicParallelSteps(h)):f.push(this.parseDynamicStep(h)))}catch(p){Dt(p)}return f},[]),...d&&{manualLayout:d}}}resolveFqn(e){if(aa(e))return ep(e.element);const n=this.fqnIndex.getFqn(e);return ge(n,`Not indexed element: ${this.getAstNodePath(e)}`),n}getAstNodePath(e){return this.services.workspace.AstNodeLocator.getAstNodePath(e)}getMetadata(e){return e?.props!=null?hi(e.props,n=>[n.key,Wt(n.value)]):void 0}convertTags(e){let n=e?.tags;if(!n)return null;const r=[];for(;n;){try{const i=n.values.map(s=>s.ref?.name).filter(ne);i.length>0&&r.unshift(...i)}catch{}n=n.prev}return vs(r)?r:null}convertLinks(e){if(!(!e?.props||e.props.length===0))return Ye(e.props,Je(Bh),Ui(n=>{const r=n.value;if(ne(r)){const i=ne(n.title)?eo(n.title):void 0;return i?{url:r,title:i}:{url:r}}return[]}))}}const{findNodeForKeyword:kH,findNodeForProperty:Kie}=Bd,$H=(t,e,n=0)=>{const r=n>0?" ".repeat(n):"";return[r+`style ${t} {`,...Jo(e).map(([i,s])=>r+` ${i} ${i==="opacity"?s.toString()+"%":s}`),r+"}"]},CH=(t,e)=>n=>{if(!ya(n))return!1;const r=n.target.value;if(!r||ne(n.target.prev)||!Uu(r))return!1;const i=r.el.ref;return(i?e.getFqn(i):null)===t};function _H(t,{view:e,viewAst:n,targets:r,style:i}){ge(n.body,`View ${e.id} has no body`);const s=n.$cstNode;ge(s,"viewCstNode");const o=Uc(n.body.rules)?.$cstNode?.range.end??n.body.$cstNode?.range.end;ge(o,"insertPos is not defined");const a=s.range.start.character+2,c=t.likec4.FqnIndex,u=Je(n.body.rules,ya),l=e.__==="element"?e.viewOf:null,d=[],f=[];r.forEach(w=>{const v=nq(u,CH(w,c)),E=l&&Rr(l,w)?w.substring(l.length+1):w;v?d.push({fqn:E,rule:v}):f.push({fqn:E})});const h={start:o,end:o},p=w=>{w.start.line<=h.start.line&&(w.start.line==h.start.line?h.start.character=Math.min(w.start.character,h.start.character):h.start=w.start),w.end.line>=h.end.line&&(w.end.line==h.end.line?h.end.character=Math.max(w.end.character,h.end.character):h.end=w.end)},m=[];if(f.length>0){const w=f.flatMap(({fqn:v})=>$H(v,i,a));m.push(Tn.insert(o,`
1736
- `+w.join(`
1737
- `))),h.start={line:o.line+1,character:a},h.end={line:o.line+w.length,character:Uc(w)?.length??0}}if(d.length>0)for(const{rule:w}of d){const v=w.$cstNode;ge(v,"RuleCstNode not found");for(const[E,S]of Jo(i)){const $=E==="opacity"?S.toString()+"%":S,I=w.props.find(W=>W.key===E);if(I&&I.$cstNode){const{range:{start:W,end:V}}=I.$cstNode;p({start:W,end:V}),m.push(Tn.replace({start:W,end:V},E+" "+$));continue}const N=kH(v,"{")?.range.end;ge(N,"Opening brace not found");const A=" ".repeat(2+v.range.start.character),q=A+E+" "+$;m.push(Tn.insert(N,`
1738
- `+q)),p({start:{line:N.line+1,character:A.length},end:{line:N.line+1,character:q.length}})}}return{modifiedRange:h,edits:m}}const{findNodeForProperty:Vie,findNodeForKeyword:AH}=Bd;function xH(t,{view:e,viewAst:n,layout:r}){ge(n.body,`View ${e.id} has no body`);const i=n.$cstNode;ge(i,"viewCstNode");const s=eH(r.direction),o=n.body.rules.findLast(Qh);let a=`autoLayout ${s}`;if(yt(r.rankSep)&&(a+=` ${r.rankSep}`,yt(r.nodeSep)&&(a+=` ${r.nodeSep}`)),o&&o.$cstNode)return Tn.replace(o.$cstNode.range,a);const c=AH(n.body.$cstNode,"}")?.range.start;ge(c,"Closing brace not found");const u=` ${a}
1739
- `;return Tn.insert(c,u)}function IH(t,{viewAst:e,layout:n}){ge(e.$cstNode,"invalid view.$cstNode");const r=wd(e.$cstNode,["BLOCK_COMMENT"]);let i=TH(n);return e.$cstNode.range.start.character>0&&(i=LU(i,e.$cstNode.range.start.character)),r?Tn.replace(r.range,i.trimStart()):Tn.insert({line:e.$cstNode.range.start.line,character:0},i+`
1740
- `)}class PH{constructor(e){this.services=e,this.locator=e.likec4.ModelLocator}locator;async applyChange(e){const n=this.services.shared.lsp.Connection;ge(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){Ze.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,..._H(this.services,{...r,targets:n.targets,style:n.style})};case"change-autolayout":{const s=xH(this.services,{...r,layout:n.layout});return{doc:r.doc,modifiedRange:s.range,edits:[s]}}case"save-manual-layout":const i=IH(this.services,{...r,layout:n.layout});return{doc:r.doc,modifiedRange:i.range,edits:[i]};default:Ae(n)}}}class NH extends MS{async computeExports(e,n){const r=[];try{const{specifications:i,models:s,views:o,likec4lib:a}=e.parseResult.value;this.exportLibrary(a,r,e),this.exportSpecification(i,r,e),this.exportModel(s,r,e),this.exportViews(o,r,e)}catch(i){Xt(i)}return r}exportViews(e,n,r){if(!($t(e)||e.length===0))for(const i of e.flatMap(s=>s.views))try{ne(i.name)&&n.push(this.descriptions.createDescription(i,i.name,r))}catch(s){Xt(s)}}exportModel(e,n,r){if(!($t(e)||e.length===0))for(const i of e.flatMap(s=>s.elements))try{qr(i)&&ne(i.name)&&n.push(this.descriptions.createDescription(i,i.name,r))}catch(s){Xt(s)}}exportLibrary(e,n,r){if(!$t(e))try{for(const i of e.flatMap(s=>s.icons))n.push(this.descriptions.createDescription(i,i.name,r))}catch(i){Xt(i)}}exportSpecification(e,n,r){if(!($t(e)||e.length===0))for(const i of e.flatMap(s=>[...s.elements,...s.relationships,...s.tags,...s.colors]))try{switch(!0){case fa(i):{ne(i.kind.name)&&n.push(this.descriptions.createDescription(i.kind,i.kind.name,r));continue}case Jh(i):{ne(i.tag.name)&&n.push(this.descriptions.createDescription(i.tag,"#"+i.tag.name,r));continue}case pa(i):{ne(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 Xh(i):{ne(i.name.name)&&n.push(this.descriptions.createDescription(i.name,i.name.name,r));continue}default:Ae(i)}}catch(s){Xt(s)}}computeLocalScopes(e,n){return new Promise(r=>{const i=e.parseResult.value,s=new Nr;for(const o of i.models)try{const a=this.processContainer(o,s,e);s.addAll(i,a.values())}catch(a){Xt(a)}r(s)})}processContainer(e,n,r){const i=new Nr,s=new Nr;for(const o of e.elements){if(Yi(o))continue;let a;if(qr(o)?(ne(o.name)&&i.add(o.name,this.descriptions.createDescription(o,o.name,r)),a=o.body):aa(o)&&(a=o.body),a&&a.elements.length>0)try{const c=this.processContainer(a,n,r);for(const[u,l]of c)s.add(u,l)}catch(c){Xt(c)}}if(s.size>0)for(const[o,a]of s.entriesGroupedByKey())!i.has(o)&&a.length===1&&i.add(o,a[0]);return n.addAll(e,i.values()),i}}const{getDocument:OH}=Id;class FH extends US{fqnIndex;constructor(e){super(e),this.fqnIndex=e.likec4.FqnIndex}directChildrenOf(e){return this.fqnIndex.directChildrenOf(e)}uniqueDescedants(e){return new Ct(()=>{const n=e(),r=n&&this.fqnIndex.getFqn(n);return r?this.fqnIndex.uniqueDescedants(r).iterator():null},n=>n?n.next():Kt)}scopeElementRef(e){return this.uniqueDescedants(()=>e.el.ref)}scopeExtendElement({element:e}){return He([e.el.$nodeDescription]).nonNullable().concat(this.uniqueDescedants(()=>kn(e)))}scopeElementView({viewOf:e,extends:n}){return e?He([e.el.$nodeDescription]).nonNullable().concat(this.uniqueDescedants(()=>kn(e))):n?He([n]).flatMap(r=>{const i=r.view.ref;return i?this.scopeElementView(i):Ao}):Ao}getScope(e){try{const n=this.reflection.getReferenceType(e);if(n!==jr)return this.getGlobalScope(n);try{const r=e.container;if(BC(r)&&e.property==="el"){const i=r.parent;return i?new Bc(this.directChildrenOf(ep(i))):this.getGlobalScope(n)}if(Uu(r)&&e.property==="el"){const i=r.parent;if(i)return new Bc(this.scopeElementRef(i));if(e.reference.$refText==="this"||e.reference.$refText==="it"){const s=yn(r,qr);return s?new zS([this.descriptions.createDescription(s,e.reference.$refText)]):BS}}return this.computeScope(e)}catch(r){return $e.warn(r),this.getGlobalScope(n)}}catch(n){return $e.warn(n),BS}}computeScope(e){const n=this.reflection.getReferenceType(e);ge(n===jr,"Invalid reference type");const r=[],i=OH(e.container).precomputedScopes;if(i){const s=a=>this.reflection.isSubtype(a.type,n);let o=e.container;for(;o;){const a=i.get(o).filter(s);a.length>0&&r.push(He(a)),Kv(o)&&r.push(this.scopeExtendElement(o.$container)),Gv(o)&&r.push(this.scopeElementView(o.$container)),o=o.$container}}return r.reduceRight((s,o)=>this.createScope(o,s),this.getGlobalScope(n))}getGlobalScope(e){return new Bc(this.indexManager.allElements(e))}}class LH{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.shared.lsp.Connection;if(!i){$e.info("[ServerRpc] no connection, not initializing");return}$e.info("[ServerRpc] init");const s=this.services.shared.workspace.LangiumDocuments,o=this.services.shared.workspace.DocumentBuilder,a=aq(()=>{i.sendNotification(x7,"").catch(u=>($e.error(`[ServerRpc] error sending onDidChangeModel: ${u}`),Promise.resolve()))},{timing:"both",waitMs:300,maxWaitMs:600});let c=!0;this.disposables.push(Os.create(()=>{a.cancel()}),e.onModelParsed(()=>a.call()),i.onRequest(P7,async({cleanCaches:u},l)=>(u&&this.services.WorkspaceCache.clear(),{model:await e.buildComputedModel(l)})),i.onRequest(I7,async u=>({model:await e.buildModel(u)})),i.onRequest(N7,async({viewId:u},l)=>({view:await e.computeView(u,l)})),i.onRequest(O7,async({docs:u},l)=>{const d=u.map(p=>Yt.parse(p)),f=p=>d.every(m=>!mt.equals(m,p)),h=s.all.filter(p=>tp(p)&&f(p.uri)&&p.uri.scheme!==x$).map(p=>p.uri).toArray();$e.debug(`[ServerRpc] received request to build:
1741
- changed (total ${d.length}):${u.map(p=>`
1742
- - `+p).join("")}
1743
- deleted (total ${h.length}):${h.map(p=>`
1744
- - `+p.toString()).join(`
1745
- `)}`),!c&&d.length+h.length>0&&(await Promise.allSettled([...d,...h].map(async p=>{const m=p.toString();$e.debug(`clear diagnostics for ${m}`);try{await i.sendDiagnostics({uri:m,diagnostics:[]})}catch(w){$e.warn(`error clearing diagnostics for ${m}: ${w}`)}})),await Ot(l)),c=!1,await o.update(d,h,l)}),i.onRequest(F7,u=>{if("element"in u)return n.locateElement(u.element,u.property??"name");if("relation"in u)return n.locateRelation(u.relation);if("view"in u)return n.locateView(u.view);Ae(u)}),i.onRequest(L7,async(u,l)=>await r.applyChange(u)))}dispose(){let e;for(;e=this.disposables.pop();)try{e.dispose()}catch(n){Xt(n)}}}class MH{constructor(e){this.services=e}getSymbolKind(e){const n=ht(e)?e.$type:e.type,r=(...i)=>i.some(s=>this.services.AstReflection.isSubtype(n,s));switch(!0){case r(jr,oa):return fr.Constructor;case r(ca,ua,ga):return fr.Namespace;case r(Xs):return fr.Class;case r(Ji,Qs,Zs,ma):return fr.EnumMember;case r(Xi,ha):return fr.Event;case r(Ki,da):return fr.TypeParameter}return fr.Field}getCompletionItemKind(e){const n=ht(e)?e.$type:e.type,r=(...i)=>i.some(s=>this.services.AstReflection.isSubtype(n,s));switch(!0){case r(Zs):return Yn.Color;case r(jr,oa):return Yn.Constructor;case r(ca,ua,ga):return Yn.Module;case r(Xs):return Yn.Class;case r(Ji,Qs,Zs,ma):return Yn.EnumMember;case r(Xi,ha):return Yn.Event;case r(Ki,da):return Yn.TypeParameter;default:return Yn.Reference}}}class zH extends GS{documentFactory;constructor(e){super(e),this.documentFactory=e.workspace.LangiumDocumentFactory}async loadAdditionalDocuments(e,n){n(this.documentFactory.fromString(_7,Yt.parse(A7))),await super.loadAdditionalDocuments(e,n)}workspace(){return this.folders&&Eg(this.folders,1)?this.folders[0]:null}get workspaceUri(){const e=this.workspace();return ge(e,"Workspace not initialized"),Yt.parse(e.uri)}get workspaceURL(){const e=this.workspace();return ge(e,"Workspace not initialized"),new URL(e.uri)}}class BH extends i${}const jH=t=>(e,n)=>{const r=a_(e.value);switch(!0){case xh(r):case Ph(r):case va(r):{n("warning","Predicate is ignored, as not supported in dynamic views",{node:e});return}}},qH=t=>{const e=t.likec4.FqnIndex;return(n,r)=>{try{const i=kn(n.source),s=i&&e.getFqn(i);s||r("error","Source not found (not parsed/indexed yet)",{node:n,property:"source"});const o=kn(n.target),a=o&&e.getFqn(o);a||r("error","Target not found (not parsed/indexed yet)",{node:n,property:"target"}),s&&a&&(Rr(s,a)||Rr(a,s))&&r("error","Invalid parent-child relationship",{node:n})}catch(i){Xt(i)}}},ip=["this","it","self","super","likec4lib"];function sp(t){return async(e,n,r)=>{r&&await Ot(r);try{await t(e,n,r)}catch(i){Dt(i)}}}const{getDocument:UH}=Id,WH=t=>{const e=t.likec4.FqnIndex,n=t.workspace.AstNodeLocator;return sp((r,i)=>{const s=e.getFqn(r);if(!s){i("error","Not indexed element",{node:r,property:"name"});return}ip.includes(r.name)&&i("error",`Reserved word: ${r.name}`,{node:r,property:"name"});const o=UH(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"}]}})}})},GH=t=>(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"})},HH=t=>(e,n)=>{const r=e.$container;r.props.some(i=>Vi(i)&&i!==e)&&n("error","Icon must be defined once",{node:e}),Hu(r)&&ia(r.$container)&&r.$container.props.some(i=>Vi(i))&&n("warning","Redundant as icon defined on element",{node:e})},KH=t=>(e,n)=>{Ug(e,jv)||n("error","Notes can be defined only inside dynamic view",{node:e})},VH=t=>{const e=t.likec4.FqnIndex;return sp((n,r)=>{const i=kn(n.target),s=i&&e.getFqn(i);s||r("error","Target not resolved",{node:n,property:"target"});let o;if(yt(n.source)){if(o=kn(n.source),!o)return r("error","Source not resolved",{node:n,property:"source"})}else{if(!ia(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&&pd(a,s)&&r("error","Invalid parent-child relationship",{node:n})})},YH=t=>sp((e,n)=>{e.$container.tags?.values&&e.tags?.values&&n("error","Relation cannot have tags in both header and body",{node:e.tags})}),XH=t=>(e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one specification per document",{node:e,property:"name"})},JH=t=>(e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one model per document",{node:e,property:"name"})},ZH=t=>(e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one views block per document",{node:e,property:"name"})},QH=t=>{const e=t.shared.workspace.IndexManager;return sp((n,r)=>{ip.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=e.allElements(Ki).filter(s=>s.name===n.name&&s.node!==n).head();if(i){const s=i.documentUri!==nn(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"}]}})}})},eK=t=>{const e=t.shared.workspace.IndexManager;return(n,r)=>{const i="#"+n.name,s=e.allElements(Ji).filter(o=>o.name===i&&o.node!==n).head();if(s){const o=s.documentUri!==nn(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"}]}})}}},tK=t=>{const e=t.shared.workspace.IndexManager;return(n,r)=>{ip.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"}),e.allElements(Xi).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate RelationshipKind '${n.name}'`,{node:n,property:"name"})}},nK=t=>{const e=t.shared.workspace.IndexManager;return(n,r)=>{n.name&&(ip.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"}),e.allElements(Xs).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate view '${n.name}'`,{node:n,property:"name"}))}},rK=t=>(e,n)=>{const r=yn(e,Lv);Fh(r)&&n("error",'Invalid usage inside "exclude"',{node:e});const i=Uv(e.subject)?e.subject.subject:e.subject;switch(!0){case Uu(i):case qv(i):case zC(i):case va(i):return;case xh(i):case Ph(i):n("error","Invalid target (expect reference to specific element)",{node:e,property:"subject"});return;default:Ae(i)}},iK=t=>(e,n)=>{Ug(e,Ov)&&n("warning","Redundant usage, expand predicate resolves parent element only when used in relations",{node:e})},sK=t=>(e,n)=>{if(va(e.to)&&!Yv(e.$container)){const r=yn(e,Nh);$t(r?.viewOf)&&n("warning","Predicate is ignored as it concerns all relationships",{node:e})}},oK=t=>(e,n)=>{if(va(e.from)&&!Mv(e.$container)){const r=yn(e,Nh);$t(r?.viewOf)&&n("warning","Predicate is ignored as it concerns all relationships",{node:e})}},aK=t=>(e,n)=>{const r=yn(e,Lv);Fh(r)&&n("error",'Invalid usage inside "exclude"',{node:e})};function cK(t){$e.info("registerValidationChecks"),t.validation.ValidationRegistry.register({NotesProperty:KH(),OpacityProperty:GH(),IconProperty:HH(),SpecificationRule:XH(),Model:JH(),ModelViews:ZH(),DynamicViewStep:qH(t),LikeC4View:nK(t),Element:WH(t),ElementKind:QH(t),Relation:VH(t),RelationBody:YH(),Tag:eK(t),DynamicViewPredicateIterator:jH(),ElementPredicateWith:rK(),RelationPredicateWith:aK(),ExpandElementExpression:iK(),RelationshipKind:tK(t),IncomingRelationExpression:sK(),OutgoingRelationExpression:oK()});const e=t.shared.lsp.Connection;e&&t.shared.workspace.DocumentBuilder.onUpdate((n,r)=>{for(const i of r)$e.debug(`clear diagnostics for deleted ${i.path}`),e.sendDiagnostics({uri:i.toString(),diagnostics:[]})})}function uK(t,e){return[t,e]=h_(t,e)>0?[e,t]:[t,e],lK(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 lK(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 p_(t){return t.range.start.line!=t.range.end.line}const ie={newLine:Wi.newLine({allowMore:!0}),oneSpace:Wi.oneSpace(),noSpace:Wi.noSpace(),indent:Wi.indent({allowMore:!0}),noIndent:Wi.noIndent()};class dK extends K9{format(e){this.removeIndentFromTopLevelStatements(e),this.indentContentInBraces(e),this.formatSpecificationRule(e),this.formatElementDeclaration(e),this.formatRelation(e),this.formatView(e),this.formatViewRuleStyle(e),this.formatIncludeExcludeExpressions(e),this.formatWhereExpression(e),this.formatWithPredicate(e),this.formatLeafProperty(e),this.formatMetadataProperty(e),this.formatAutolayoutProperty(e),this.formatLinkProperty(e),this.formatNavigateToProperty(e),this.formatTags(e)}formatTags(e){this.on(e,iw,(n,r)=>{r.cst(No(n.$cstNode,"values").slice(1)).prepend(ie.oneSpace),r.keywords(",").prepend(ie.noSpace).append(ie.oneSpace)})}formatRelation(e){this.on(e,Yi,(n,r)=>{const i=n?.source?.$cstNode?[n?.source?.$cstNode]:[];r.cst(i).append(ie.oneSpace),r.keywords("]->").prepend(ie.noSpace),r.keywords("-[").append(ie.noSpace),r.properties("target","title","technology","tags").prepend(ie.oneSpace)}),this.on(e,jv,(n,r)=>{r.keywords("->","<-").surround(ie.oneSpace);const i=r.property("kind");i.nodes[0]?.text.startsWith(".")&&i.surround(ie.oneSpace),r.keywords("]->").prepend(ie.noSpace).append(ie.oneSpace),r.keywords("-[").prepend(ie.oneSpace).append(ie.noSpace),r.properties("title").prepend(ie.oneSpace)}),this.on(e,Mv)?.property("target").prepend(ie.oneSpace),this.on(e,ew,(n,r)=>{r.property("from").append(ie.oneSpace),r.keywords("]->").prepend(ie.noSpace),r.keywords("-[").append(ie.noSpace)}),this.on(e,jC)?.keywords("->").append(ie.oneSpace),this.on(e,Yv)?.keyword("->").prepend(ie.oneSpace)}removeIndentFromTopLevelStatements(e){(Jv(e)||rw(e)||Zv(e)||qC(e))&&this.getNodeFormatter(e).keywords("specification","model","views","likec4lib").prepend(ie.noIndent)}indentContentInBraces(e){if(qC(e)||rw(e)||fa(e)||pa(e)||Jv(e)||ia(e)||Kv(e)||GC(e)||nw(e)||IG(e)||Zv(e)||Gv(e)||LC(e)||ya(e)||RG(e)||SG(e)||Hu(e)||zv(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||!uK(o,a))&&n.cst([a]).prepend(ie.indent),o=a;r.prepend(ie.noIndent).prepend(ie.oneSpace),i.prepend(ie.noIndent).prepend(Wi.newLine({allowMore:!0}))}}appendKeywordsWithSpace(e){this.on(e,_G)?.keywords("element").append(ie.oneSpace)}formatView(e){this.on(e,Nh,(n,r)=>{(n.extends||n.viewOf||n.name)&&r.keywords("view").append(ie.oneSpace),r.keywords("of","extends").surround(ie.oneSpace)}),this.on(e,kG)?.keywords("dynamic","view").append(ie.oneSpace)}formatLeafProperty(e){if(Wv(e)||Kh(e)||NG(e)||la(e)||KC(e)||VC(e)||Js(e)||tl(e)||Pu(e)||Vi(e)||Vh(e)||Eh(e)||qh(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(ie.oneSpace):r.prepend(ie.noSpace).append(ie.oneSpace),n.keyword(";").prepend(ie.noSpace).append(ie.newLine)}}formatLinkProperty(e){this.on(e,Bh,(n,r)=>{r.keyword("link").append(ie.oneSpace),r.property("value").append(ie.oneSpace),r.keyword(":").prepend(ie.noSpace).append(ie.oneSpace),r.keyword(";").prepend(ie.noSpace).append(ie.newLine)})}formatNavigateToProperty(e){this.on(e,Qv)?.property("key").append(ie.oneSpace)}formatAutolayoutProperty(e){this.on(e,Qh,(n,r)=>{r.keyword("autoLayout").append(ie.oneSpace),r.property("rankSep").prepend(ie.oneSpace),r.property("nodeSep").prepend(ie.oneSpace)})}formatMetadataProperty(e){this.on(e,xG,(n,r)=>{r.property("key").append(ie.oneSpace),r.keyword(":").prepend(ie.noSpace).append(ie.oneSpace),r.keyword(";").prepend(ie.noSpace).append(ie.newLine)})}formatElementDeclaration(e){this.on(e,qr,(n,r)=>{const i=Cn(n.$cstNode,"kind"),s=Cn(n.$cstNode,"name");s&&i&&(h_(s,i)>0?r.cst([i]).append(ie.oneSpace):(r.cst([s]).append(ie.oneSpace),r.cst([i]).prepend(ie.oneSpace))),r.properties("props").prepend(ie.oneSpace)})}formatSpecificationRule(e){if((fa(e)||pa(e)||Jh(e))&&this.getNodeFormatter(e).keywords("element","relationship","tag").append(ie.oneSpace),Xh(e)){const n=this.getNodeFormatter(e);n.keyword("color").append(ie.oneSpace),n.property("name").append(ie.oneSpace)}}formatWithPredicate(e){const n=this.getNodeFormatter(e);(Ih(e)||tw(e))&&n.keyword("with").prepend(ie.oneSpace)}formatViewRuleStyle(e){this.on(e,ya)?.keyword("style").append(ie.oneSpace),this.on(e,CG)?.keyword(",").prepend(ie.noSpace).append(ie.oneSpace)}formatWhereExpression(e){if((pG(e)||dG(e))&&this.getNodeFormatter(e).keyword("where").append(ie.oneSpace),(EG(e)||bG(e))&&this.getNodeFormatter(e).property("operator").surround(ie.oneSpace),(XC(e)||ZC(e))&&this.getNodeFormatter(e).keyword("not").append(ie.oneSpace),NC(e)||LG(e)||FG(e)||FC(e)||MG(e)||JC(e)){const n=this.getNodeFormatter(e);n.property("operator").surround(ie.oneSpace),n.property("not").surround(ie.oneSpace)}}formatIncludeExcludeExpressions(e){if(Iv(e)||Vv(e)||Fh(e)){const n=this.getNodeFormatter(e);(!e.$cstNode||!p_(e.$cstNode))&&n.keywords("include","exclude").append(ie.oneSpace)}if(MC(e)||WC(e)||WC(e)){const n=this.getNodeFormatter(e),r=this.findPredicateExpressionRoot(e),i=r?.$cstNode&&p_(r?.$cstNode);i&&n.property("value").prepend(ie.indent),n.keyword(",").prepend(ie.noSpace).append(i?ie.newLine:ie.oneSpace)}}findPredicateExpressionRoot(e){let n=e.$container;for(;;){if(!n||Iv(n)||Vv(n)||Fh(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}}const fK={lsp:{NodeKindProvider:t=>new MH(t),WorkspaceSymbolProvider:t=>new BH(t)},workspace:{WorkspaceManager:t=>new zH(t)}};function Jt(t){return e=>new t(e)}const hK={WorkspaceCache:t=>new qS(t.shared),Rpc:Jt(LH),likec4:{ModelChanges:Jt(PH),FqnIndex:Jt(dH),ModelParser:Jt(SH),ModelBuilder:Jt(yH),ModelLocator:Jt(bH)},lsp:{CompletionProvider:Jt(nH),DocumentHighlightProvider:Jt(rH),DocumentSymbolProvider:Jt(sH),SemanticTokenProvider:Jt(aH),HoverProvider:Jt(oH),CodeLensProvider:Jt(tH),DocumentLinkProvider:Jt(iH),Formatter:Jt(dK)},references:{ScopeComputation:Jt(NH),ScopeProvider:Jt(FH)}};function pK(t,e,n,r){const i=gK(t),s=[U9({shared:i}),qG,hK,e,n,r].reduce(g_,{}),o=jf(s);return i.ServiceRegistry.register(o),cK(o),t.connection?o.Rpc.init():i.workspace.ConfigurationProvider.initialized({}),{shared:i,likec4:o}}function gK(t={}){const e={...c1,...t};return t.connection&&(GG(t.connection),WG(t.connection)),jf(G9(e),jG,fK)}function g_(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]=g_(i,r):t[n]=r}}return t}function m_(t){return typeof t=="object"&&t!==null&&typeof t.id=="string"}function dw(t){return typeof t=="object"&&t!==null&&t.$$type==="Node"&&typeof t.id=="string"}function y_(t){return dw(t)||m_(t)}function Il(t){return typeof t=="string"||y_(t)}function mK(t){return Array.isArray(t)&&t.every(Il)}function yK(t){return["n","ne","e","se","s","sw","w","nw","c"].includes(t)}function v_(t){if(y_(t))return t;const[e,n,r]=t.split(":");return yK(r)?{id:e,port:n,compass:r}:{id:e,port:n}}function vK(t){if(t.length<2&&(Il(t[0])&&Il(t[1]))===!1)throw Error("EdgeTargets must have at least 2 elements.");return t.map(e=>v_(e))}const op=Object.seal({Graph:null,Digraph:null,Subgraph:null,Node:null,Edge:null});function wK(t){return Object.assign(Object.seal(Object.assign({},op)),t)}function bK(...t){const[e,...n]=t;return(...r)=>n.reduce((i,s)=>s(i),e(...r))}function Xn(t,...e){return bK(t,...e)}const DK=t=>(...e)=>n=>t(n,...e),EK=t=>({[Symbol.iterator]:t}),gr=DK((t,e)=>Array.from(EK(function*(){for(const n of t)yield e(n)})));class w_{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 Le=w_.prototype.createElement.bind(new w_),TK=/\r?\n/;function mr(t){return e=>e.join(t)}function RK(t){return e=>t+e+t}function Zi(t,e){return n=>t+n+e}function ap(t){return e=>t+e}const b_=t=>t.replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/"/g,'\\"'),cp=t=>t.split(TK),Pl=(t,e,n)=>Xn(cp,gr(ap(t==="space"?" ".repeat(e):`
1746
- `)),mr(n)),to=t=>{switch(t){case"crlf":return`\r
1747
- `;case"lf":return`
1748
- `}},SK={match(t){return t.type==="AttributeList"},print(t,e){if(e.children.length===0)return`${e.kind.toLocaleLowerCase()} [];`;const n=to(t.endOfLine);return Xn(gr(t.print),mr(n),Pl(t.indentStyle,t.indentSize,n),Zi(`${e.kind.toLocaleLowerCase()} [${n}`,`${n}];`))(e.children)}},kK={match(t){return t.type==="Attribute"},print(t,e){return`${t.print(e.key)} = ${t.print(e.value)};`}},$K={match(t){return t.type==="Comment"},print(t,e){const n=to(t.endOfLine);switch(e.kind){case"Block":return Xn(cp,gr(ap(" * ")),mr(n),Zi(`/**${n}`,`${n} */`))(e.value);case"Macro":return Xn(cp,gr(ap("# ")),mr(n))(e.value);case"Slash":default:return Xn(cp,gr(ap("// ")),mr(n))(e.value)}}},CK={match(t){return t.type==="Dot"},print(t,e){return e.children.map(t.print).join(to(t.endOfLine))}},_K={match(t){return t.type==="Edge"},print(t,e){const n=Xn(gr(t.print),mr(t.directed?" -> ":" -- "))(e.targets);if(e.children.length===0)return`${n};`;const r=to(t.endOfLine),i=Xn(gr(t.print),mr(r),Pl(t.indentStyle,t.indentSize,r),Zi(`[${r}`,`${r}];`))(e.children);return`${n} ${i}`}},AK={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=to(t.endOfLine),i=Xn(gr(t.print),mr(r),Pl(t.indentStyle,t.indentSize,r),Zi(`{${r}`,`${r}}`))(e.children);return`${n.join(" ")} ${i}`}},xK=Xn(b_,RK('"')),IK=Zi("<",">"),PK={match(t){return t.type==="Literal"},print(t,e){switch(e.quoted){case"html":return IK(e.value);case!0:return xK(e.value);case!1:default:return b_(e.value)}}},NK={match(t){return t.type==="Node"},print(t,e){const n=t.print(e.id);if(e.children.length===0)return`${n};`;const r=to(t.endOfLine),i=Xn(gr(t.print),mr(r),Pl(t.indentStyle,t.indentSize,r),Zi(`[${r}`,`${r}];`))(e.children);return`${n} ${i}`}},OK={match(t){return t.type==="NodeRefGroup"},print(t,e){return Xn(gr(t.print),mr(" "),Zi("{","}"))(e.children)}},FK={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(":")}},LK={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=to(t.endOfLine),i=Xn(gr(t.print),mr(r),Pl(t.indentStyle,t.indentSize,r),Zi(`{${r}`,`${r}}`))(e.children);return`${n.join(" ")} ${i}`}},MK=[SK,kK,$K,CK,_K,AK,PK,NK,OK,FK,LK];class zK{options;#e=[...MK];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 BK(t,e){const n=new zK(e).print(t);if(!n)throw new Error;return n}function up(t,e){if(typeof e=="string"){const n=e.trim();return/^<.+>$/ms.test(n)?Le("Attribute",{key:Le("Literal",{value:t,quoted:!1},[]),value:Le("Literal",{value:n.slice(1,n.length-1),quoted:"html"},[])},[]):Le("Attribute",{key:Le("Literal",{value:t,quoted:!1},[]),value:Le("Literal",{value:e,quoted:!0},[])},[])}return Le("Attribute",{key:Le("Literal",{value:t,quoted:!1},[]),value:Le("Literal",{value:String(e),quoted:!1},[])},[])}function no(t,e){return Le("Comment",{kind:e,value:t},[])}function D_(t,e){return Array.from(function*(){for(const[n,r]of e.values)yield up(n,r);for(const n of Object.values(e.attributes))n.size>0&&(n.comment&&(yield no(n.comment,t.commentKind)),yield t.convert(n));for(const n of e.nodes)n.comment&&(yield no(n.comment,t.commentKind)),yield t.convert(n);for(const n of e.subgraphs)n.comment&&(yield no(n.comment,t.commentKind)),yield t.convert(n);for(const n of e.edges)n.comment&&(yield no(n.comment,t.commentKind)),yield t.convert(n)}())}const jK={match(t){return t.$$type==="AttributeList"},convert(t,e){return Le("AttributeList",{kind:e.$$kind},e.values.map(([n,r])=>up(n,r)))}},qK={match(t){return t.$$type==="Edge"},convert(t,e){return Le("Edge",{targets:e.targets.map(n=>dw(n)?Le("NodeRef",{id:Le("Literal",{value:n.id,quoted:!0},[])},[]):m_(n)?Le("NodeRef",{id:Le("Literal",{value:n.id,quoted:!0},[]),port:n.port?Le("Literal",{value:n.port,quoted:!0},[]):void 0,compass:n.compass?Le("Literal",{value:n.compass,quoted:!0},[]):void 0},[]):Le("NodeRefGroup",{},n.map(r=>dw(r)?Le("NodeRef",{id:Le("Literal",{value:r.id,quoted:!0},[])},[]):Le("NodeRef",{id:Le("Literal",{value:r.id,quoted:!0},[]),port:r.port?Le("Literal",{value:r.port,quoted:!0},[]):void 0,compass:r.compass?Le("Literal",{value:r.compass,quoted:!0},[]):void 0},[]))))},[...e.attributes.comment?[no(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([n,r])=>up(n,r))])}},UK={match(t){return t.$$type==="Graph"},convert(t,e){return Le("Dot",{},[...e.comment?[no(e.comment,t.commentKind)]:[],Le("Graph",{directed:e.directed,strict:e.strict,id:e.id?Le("Literal",{value:e.id,quoted:!0},[]):void 0},D_(t,e))])}},WK={match(t){return t.$$type==="Node"},convert(t,e){return Le("Node",{id:Le("Literal",{value:e.id,quoted:!0},[])},[...e.attributes.comment?[no(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([n,r])=>up(n,r))])}},GK={match(t){return t.$$type==="Subgraph"},convert(t,e){return Le("Subgraph",{id:e.id?Le("Literal",{value:e.id,quoted:!0},[]):void 0},D_(t,e))}},HK=[jK,qK,WK,UK,GK];class KK{options;#e=[...HK];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 VK(t,e){return new KK(e).convert(t)}const M=new Proxy(Object.freeze({}),{get:(t,e)=>e});class fw{}class hw extends fw{#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 pw extends hw{$$kind;get $$type(){return"AttributeList"}comment;constructor(e,n){super(n),this.$$kind=e}}class E_ extends hw{#e=op;id;comment;attributes=Object.freeze({graph:new pw("Graph"),edge:new pw("Edge"),node:new pw("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=wK(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=>mK(s)?vK(s):v_(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 T_ extends E_{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 YK extends T_{get directed(){return!0}}class XK extends T_{get directed(){return!1}}class JK extends E_{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 R_ extends hw{comment}let ZK=class extends fw{id;get $$type(){return"Node"}comment;attributes;constructor(e,n){super(),this.id=e,this.attributes=new R_(n)}port(e){return typeof e=="string"?{id:this.id,port:e}:{id:this.id,...e}}};class QK extends fw{targets;get $$type(){return"Edge"}comment;attributes;constructor(e,n){if(super(),this.targets=e,e.length<2&&(Il(e[0])&&Il(e[1]))===!1)throw Error("The element of Edge target is missing or not satisfied as Edge target.");this.attributes=new R_(n)}}Object.assign(op,{Graph:XK,Digraph:YK,Subgraph:JK,Node:ZK,Edge:QK});function S_(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 k_(t,e=op){return Object.freeze({digraph:S_.call(e,!0,t),graph:S_.call(e,!1,t)})}const $_=k_(!1),eV=$_.digraph;$_.graph;const tV=k_(!0);function C_(t,e){const n=VK(t,e?.convert);return BK(n,e?.print)}var gw,__;function nV(){if(__)return gw;__=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(`
1749
- `).map(o=>t(o)).join(`
1750
- `)}gw=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||`
1751
- `+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(h){return h.slice(-1)===`
1752
- `&&(h=h.slice(0,h.length-1)),c(h)}).join(a);return i.trim===!0&&(f=e(f)),f};function n(r){return r}return gw}var rV=nV();const lp={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 lp.hue2rgb(s,i,t+1/3)*255;case"g":return lp.hue2rgb(s,i,t)*255;case"b":return lp.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}}},iV={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},sV={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},De={channel:lp,lang:iV,unit:sV},Qi={};for(let t=0;t<=255;t++)Qi[t]=De.unit.dec2hex(t);const Zt={ALL:0,RGB:1,HSL:2};class oV{constructor(){this.type=Zt.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=Zt.ALL}is(e){return this.type===e}}class aV{constructor(e,n){this.color=n,this.changed=!1,this.data=e,this.type=new oV}set(e,n){return this.color=n,this.changed=!1,this.data=e,this.type.type=Zt.ALL,this}_ensureHSL(){const e=this.data,{h:n,s:r,l:i}=e;n===void 0&&(e.h=De.channel.rgb2hsl(e,"h")),r===void 0&&(e.s=De.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=De.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r:n,g:r,b:i}=e;n===void 0&&(e.r=De.channel.hsl2rgb(e,"r")),r===void 0&&(e.g=De.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=De.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,n=e.r;return!this.type.is(Zt.HSL)&&n!==void 0?n:(this._ensureHSL(),De.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,n=e.g;return!this.type.is(Zt.HSL)&&n!==void 0?n:(this._ensureHSL(),De.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,n=e.b;return!this.type.is(Zt.HSL)&&n!==void 0?n:(this._ensureHSL(),De.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,n=e.h;return!this.type.is(Zt.RGB)&&n!==void 0?n:(this._ensureRGB(),De.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,n=e.s;return!this.type.is(Zt.RGB)&&n!==void 0?n:(this._ensureRGB(),De.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,n=e.l;return!this.type.is(Zt.RGB)&&n!==void 0?n:(this._ensureRGB(),De.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(Zt.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(Zt.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(Zt.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(Zt.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(Zt.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(Zt.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const mw=new aV({r:0,g:0,b:0,a:0},"transparent"),wa={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(wa.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 mw.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?`#${Qi[Math.round(e)]}${Qi[Math.round(n)]}${Qi[Math.round(r)]}${Qi[Math.round(i*255)]}`:`#${Qi[Math.round(e)]}${Qi[Math.round(n)]}${Qi[Math.round(r)]}`}},ro={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(ro.hueRe);if(e){const[,n,r]=e;switch(r){case"grad":return De.channel.clamp.h(parseFloat(n)*.9);case"rad":return De.channel.clamp.h(parseFloat(n)*180/Math.PI);case"turn":return De.channel.clamp.h(parseFloat(n)*360)}}return De.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const n=t.match(ro.re);if(!n)return;const[,r,i,s,o,a]=n;return mw.set({h:ro._hue2deg(r),s:De.channel.clamp.s(parseFloat(i)),l:De.channel.clamp.l(parseFloat(s)),a:o?De.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(${De.lang.round(e)}, ${De.lang.round(n)}%, ${De.lang.round(r)}%, ${i})`:`hsl(${De.lang.round(e)}, ${De.lang.round(n)}%, ${De.lang.round(r)}%)`}},Nl={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=Nl.colors[t];if(e)return wa.parse(e)},stringify:t=>{const e=wa.stringify(t);for(const n in Nl.colors)if(Nl.colors[n]===e)return n}},Ol={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(Ol.re);if(!n)return;const[,r,i,s,o,a,c,u,l]=n;return mw.set({r:De.channel.clamp.r(i?parseFloat(r)*2.55:parseFloat(r)),g:De.channel.clamp.g(o?parseFloat(s)*2.55:parseFloat(s)),b:De.channel.clamp.b(c?parseFloat(a)*2.55:parseFloat(a)),a:u?De.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(${De.lang.round(e)}, ${De.lang.round(n)}, ${De.lang.round(r)}, ${De.lang.round(i)})`:`rgb(${De.lang.round(e)}, ${De.lang.round(n)}, ${De.lang.round(r)})`}},es={format:{keyword:Nl,hex:wa,rgb:Ol,rgba:Ol,hsl:ro,hsla:ro},parse:t=>{if(typeof t!="string")return t;const e=wa.parse(t)||Ol.parse(t)||ro.parse(t)||Nl.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(Zt.HSL)||t.data.r===void 0?ro.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?Ol.stringify(t):wa.stringify(t)},cV=(t,e)=>{const n=es.parse(t);for(const r in e)n[r]=De.channel.clamp[r](e[r]);return es.stringify(n)},A_=t=>es.format.hex.stringify(es.parse(t)),uV=(t,e,n)=>{const r=es.parse(t),i=r[e],s=De.channel.clamp[e](i+n);return i!==s&&(r[e]=s),es.stringify(r)},lV=(t,e)=>uV(t,"a",-e),dV=(t,e)=>{const n=es.parse(t),r={};for(const i in e)e[i]&&(r[i]=n[i]+e[i]);return cV(t,r)},fV=(t,e)=>{const n=es.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],De.channel.max[s]);return dV(t,r)};class hV{value;next;constructor(e){this.value=e}}class pV{#e;#t;#n;constructor(){this.clear()}enqueue(e){const n=new hV(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 dp(t){x_(t);const e=new pV;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){x_(c),t=c,queueMicrotask(()=>{for(;n<t&&e.size>0;)r()})}}}),a}function x_(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 gV=Object.getOwnPropertyNames,mV=Object.getOwnPropertySymbols,yV=Object.prototype.hasOwnProperty;function I_(t,e){return function(n,r,i){return t(n,r,i)&&e(n,r,i)}}function fp(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 P_(t){return gV(t).concat(mV(t))}var N_=Object.hasOwn||function(t,e){return yV.call(t,e)};function ba(t,e){return t||e?t===e:t===e||t!==t&&e!==e}var O_="_owner",F_=Object.getOwnPropertyDescriptor,L_=Object.keys;function vV(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 wV(t,e){return ba(t.getTime(),e.getTime())}function M_(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],h=d[1],p=a.value,m=p[0],w=p[1];!u&&!r[l]&&(u=n.equals(f,m,s,l,t,e,n)&&n.equals(h,w,f,m,t,e,n))&&(r[l]=!0),l++}if(!u)return!1;s++}return!0}function bV(t,e,n){var r=L_(t),i=r.length;if(L_(e).length!==i)return!1;for(var s;i-- >0;)if(s=r[i],s===O_&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!N_(e,s)||!n.equals(t[s],e[s],s,s,t,e,n))return!1;return!0}function Fl(t,e,n){var r=P_(t),i=r.length;if(P_(e).length!==i)return!1;for(var s,o,a;i-- >0;)if(s=r[i],s===O_&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!N_(e,s)||!n.equals(t[s],e[s],s,s,t,e,n)||(o=F_(t,s),a=F_(e,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function DV(t,e){return ba(t.valueOf(),e.valueOf())}function EV(t,e){return t.source===e.source&&t.flags===e.flags}function z_(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 TV(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 RV="[object Arguments]",SV="[object Boolean]",kV="[object Date]",$V="[object Map]",CV="[object Number]",_V="[object Object]",AV="[object RegExp]",xV="[object Set]",IV="[object String]",PV=Array.isArray,B_=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,j_=Object.assign,NV=Object.prototype.toString.call.bind(Object.prototype.toString);function OV(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(PV(u))return e(u,l,d);if(B_!=null&&B_(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 h=NV(u);return h===kV?n(u,l,d):h===AV?o(u,l,d):h===$V?r(u,l,d):h===xV?a(u,l,d):h===_V?typeof u.then!="function"&&typeof l.then!="function"&&i(u,l,d):h===RV?i(u,l,d):h===SV||h===CV||h===IV?s(u,l,d):!1}}function FV(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?Fl:vV,areDatesEqual:wV,areMapsEqual:r?I_(M_,Fl):M_,areObjectsEqual:r?Fl:bV,arePrimitiveWrappersEqual:DV,areRegExpsEqual:EV,areSetsEqual:r?I_(z_,Fl):z_,areTypedArraysEqual:r?Fl:TV};if(n&&(i=j_({},i,n(i))),e){var s=fp(i.areArraysEqual),o=fp(i.areMapsEqual),a=fp(i.areObjectsEqual),c=fp(i.areSetsEqual);i=j_({},i,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:a,areSetsEqual:c})}return i}function LV(t){return function(e,n,r,i,s,o,a){return t(e,n,a)}}function MV(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=ts();ts({strict:!0}),ts({circular:!0}),ts({circular:!0,strict:!0}),ts({createInternalComparator:function(){return ba}}),ts({strict:!0,createInternalComparator:function(){return ba}}),ts({circular:!0,createInternalComparator:function(){return ba}}),ts({circular:!0,createInternalComparator:function(){return ba},strict:!0});function ts(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=FV(t),c=OV(a),u=r?r(c):LV(c);return MV({circular:n,comparator:c,createState:i,equals:u,strict:o})}function q_(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 U_=(t,e)=>t.width>e.width+10||t.height>e.height+10;function BV(t,e){if(t.hash===e.hash)return{diagram:q_(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||U_(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:q_(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||U_(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:Jo(e.edges).flatMap(([r,i])=>i.dotpos?{id:r,dotpos:i.dotpos}:[])}}}function Fn(t){return t.children.length>0}function Jn(t){switch(t){case"open":return"vee";default:return t}}function Ur(t){return Array.isArray(t)?[Ur(t[0]),Ur(t[1])]:(ge(isFinite(t),`Invalid not finite point value ${t}`),Math.round(t))}const W_=t=>(ge(isFinite(t),`Invalid not finite inch value ${t}`),Math.floor(t*72)),ot=t=>Math.ceil(t/72*1e3)/1e3,Zn=t=>Math.ceil(t);Zn(40).toString();function G_(t,e){return A_(fV(t,{l:-35-5*e,s:-15-5*e}))}function jV(t){return A_(lV(t,.3))}function qV(t){return t.trim().replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function yw(t,e){return rV(t,{width:e,indent:"",escape:qV}).split(`
1753
- `)}function ns({text:t,maxchars:e,fontsize:n,bold:r,color:i}){let s=yw(t,e).map(a=>qi(a)?" ":a).join("<BR/>");r&&(s=`<B>${s}</B>`);const o=i?` COLOR="${i}"`:"";return`<FONT POINT-SIZE="${Zn(n)}"${o}>${s}</FONT>`}function UV(t,e){const n=ne(t.icon),r=[ns({text:t.title,fontsize:19,maxchars:35})];if(ne(t.technology)&&r.push(ns({text:t.technology,fontsize:12,maxchars:n?35:45,color:e.loContrast})),ne(t.description)&&r.push(ns({text:t.description,fontsize:14,maxchars:n?35:45,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}" FIXEDSIZE="TRUE"> </TD>${c}`,c=`${c}<TD${u} WIDTH="16" FIXEDSIZE="TRUE"> </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 WV(t,e){const n=ns({text:t.title.toUpperCase(),maxchars:50,fontsize:11,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 Da=35;function GV({label:t,description:e,technology:n}){const r=[];if(ne(t)&&r.push(ns({text:t,maxchars:Da,fontsize:14,bold:t==="[...]"})),ne(e)&&r.push(ns({text:e,maxchars:Da,fontsize:14})),ne(n)&&r.push(ns({text:n,fontsize:12,maxchars:Da})),r.length===0)return null;const i=r.map(s=>`<TR><TD ALIGN="TEXT" BALIGN="LEFT">${s}</TD></TR>`).join("");return`<<TABLE BORDER="0" CELLPADDING="3" CELLSPACING="0" ${vw}>${i}</TABLE>>`}const vw=`BGCOLOR="${qn.relationships[ms].labelBgColor}A0"`;function HV(t,e){const n=`<TABLE BORDER="0" CELLPADDING="6" ${vw}><TR><TD FIXEDSIZE="TRUE" WIDTH="20" HEIGHT="20"><FONT POINT-SIZE="${Zn(14)}"><B>${t}</B></FONT></TD></TR></TABLE>`;return ne(e)?`<${['<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">',"<TR>",`<TD>${n}</TD>`,`<TD ${vw} CELLPADDING="2">`,ns({text:e,maxchars:Da,fontsize:14}),"</TD>","</TR>","</TABLE>"].join("")}>`:`<${n}>`}const H_="dashed",ww=qn.font;class K_{constructor(e){this.view=e,this.compoundIds=new Set(e.nodes.filter(Fn).map(r=>r.id)),this.edgesWithCompounds=new Set(this.compoundIds.size>0?e.edges.filter(r=>this.compoundIds.has(r.source)||this.compoundIds.has(r.target)).map(r=>r.id):[]);const n=this.graphvizModel=this.createGraph();this.applyNodeAttributes(n.attributes.node),this.applyEdgeAttributes(n.attributes.edge),this.buildGraphvizModel(n)}ids=new Set;subgraphs=new Map;nodes=new Map;edges=new Map;compoundIds;edgesWithCompounds;graphvizModel;get hasEdgesWithCompounds(){return this.edgesWithCompounds.size>0}buildGraphvizModel(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 this.view.nodes.filter(u=>Fn(u)&&u.parent===i.id))n(c,a)},r=[];for(const i of this.view.nodes)Fn(i)?$t(i.parent)&&n(i,e):r.push(i);for(const i of r){const s=i.parent?this.getSubgraph(i.parent):e;ge(s,"parent graph should be defined");const o=this.nodeId(i),a=this.elementToNode(i,s.node(o));this.nodes.set(i.id,a)}for(const i of this.view.edges){const s=this.addEdge(i,e);s&&this.edges.set(i.id,s)}}print(){return C_(this.graphvizModel,{print:{indentStyle:"space",indentSize:2}})}createGraph(){const e=this.view.autoLayout,n=eV({[M.bgcolor]:"transparent",[M.layout]:"dot",[M.compound]:!0,[M.rankdir]:e.direction,[M.TBbalance]:"min",[M.splines]:"spline",[M.outputorder]:"nodesfirst",[M.nodesep]:ot(e.nodeSep??110),[M.ranksep]:ot(e.rankSep??120),[M.pack]:Zn(e.rankSep??120),[M.packmode]:"array_3",[M.pad]:ot(15),[M.forcelabels]:!0,[M.fontname]:ww});return n.attributes.graph.apply({[M.fontsize]:Zn(15),[M.labeljust]:e.direction==="RL"?"r":"l",[M.labelloc]:e.direction==="BT"?"b":"t",[M.margin]:50.1}),n}applyNodeAttributes(e){e.apply({[M.fontname]:ww,[M.nojustify]:!0,[M.shape]:"rect",[M.width]:ot(320),[M.height]:ot(180),[M.style]:"filled",[M.penwidth]:0})}applyEdgeAttributes(e){e.apply({[M.nojustify]:!0,[M.arrowsize]:.75,[M.fontname]:ww,[M.fontsize]:Zn(14),[M.penwidth]:Zn(2),[M.color]:qn.relationships[ms].lineColor,[M.fontcolor]:qn.relationships[ms].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=Fn(e);let r=_a(e.id).toLowerCase(),i=this.checkNodeId(r,n);if(i!==null)return i;let s=e.id,o;for(;o=St(s);){if(r=_a(o).toLowerCase()+"_"+r,i=this.checkNodeId(r,n),i!==null)return i;s=o}r=_a(e.id).toLowerCase();let a=1;do i=this.checkNodeId(r+"_"+a++,n);while(i===null);return i}elementToSubgraph(e,n){ge(Fn(e),"node should be compound"),ge(v1(e.depth),"node.depth should be defined");const r=this.getElementColorValues(e.color),i=jV(r.loContrast);return n.apply({[M.likec4_id]:e.id,[M.likec4_level]:e.level,[M.likec4_depth]:e.depth,[M.fillcolor]:G_(r.fill,e.depth),[M.color]:G_(r.stroke,e.depth),[M.style]:"filled",[M.margin]:Zn(e.children.length>1?40:32),[M.label]:WV(e,i)}),n}elementToNode(e,n){ge(!Fn(e),"node should not be compound");const r=ne(e.icon),i=this.getElementColorValues(e.color);switch(n.attributes.apply({[M.likec4_id]:e.id,[M.likec4_level]:e.level,[M.fillcolor]:i.fill,[M.fontcolor]:i.hiContrast,[M.color]:i.stroke,[M.margin]:`${ot(r?10:26)},${ot(26)}`}),e.shape){case"cylinder":case"storage":{n.attributes.apply({[M.margin]:`${ot(r?10:26)},${ot(0)}`,[M.penwidth]:Zn(2),[M.shape]:"cylinder"});break}case"browser":{n.attributes.apply({[M.margin]:`${ot(r?10:30)},${ot(32)}`});break}case"mobile":{n.attributes.apply({[M.margin]:`${ot(r?10:30)},${ot(26)}`});break}case"queue":{n.attributes.apply({[M.width]:ot(320),[M.height]:ot(165),[M.margin]:`${ot(r?10:30)},${ot(26)}`});break}}return n.attributes.set(M.label,UV(e,i)),n}leafElements(e){if(e===null)return this.view.nodes.filter(r=>!Fn(r));const n=e+".";return this.view.nodes.filter(r=>!Fn(r)&&r.id.startsWith(n))}viewElement(e){return et(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||(ge(Fn(r),"endpoint node should be compound"),s=this.getSubgraph(e)?.id,ge(s,`subgraph ${e} not found`),r=et(n(this.leafElements(e)),`leaf element in ${e} not found`),i=et(this.getGraphNode(r.id),`source graphviz node ${r.id} not found`)),[r,i,s]}hasInternalEdges(e){return e===null?this.view.edges.length>0:this.view.edges.some(mD(e))}findInternalEdges(e){return e===null?this.view.edges.slice():this.view.edges.filter(mD(e))}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=Ye(this.view.nodes,Je(Fn),ut(r=>r.id),qc(_o),p1(),ut(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}}),Je(({edges:r})=>r.length>1&&r.length<8),Dj(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=et(this.getGraphNode(s.source),`Graphviz Node not found for ${s.source}`),a=et(this.getGraphNode(s.target),`Graphviz Node not found for ${s.target}`);n.add(s.source),n.add(s.target),o.attributes.set(M.group,r.id),a.attributes.set(M.group,r.id)}catch(o){Ze.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=ot(a.center.x)+r,l=ot(e-a.center.y);a.fixedsize?c.attributes.apply({[M.pos]:`${u},${l}!`,[M.pin]:!0,[M.width]:ot(a.fixedsize.width),[M.height]:ot(a.fixedsize.height),[M.fixedsize]:!0}):c.attributes.set(M.pos,`${u},${l}`)}for(const[o,a]of this.edges.entries()){a.attributes.delete(M.weight),a.attributes.delete(M.minlen),a.attributes.delete(M.constraint);const c=n.edges.find(u=>u.id===o)?.dotpos;c&&!s&&a.attributes.set(M.pos,c)}return this.graphvizModel.apply({[M.layout]:"fdp",[M.overlap]:"vpsc",[M.sep]:"+50,50",[M.esep]:"+10,10",[M.start]:"random2",[M.splines]:"compound"}),this.graphvizModel.delete(M.compound),this.graphvizModel.delete(M.rankdir),this.graphvizModel.delete(M.nodesep),this.graphvizModel.delete(M.ranksep),this.graphvizModel.delete(M.pack),this.graphvizModel.delete(M.pad),this.graphvizModel.delete(M.packmode),this.graphvizModel.attributes.graph.delete(M.margin),this}getRelationshipColorValues(e){return lb(e)?qn.relationships[e]:this.view.customColorDefinitions[e]?.relationships??qn.relationships[ed]}getElementColorValues(e){return lb(e)?qn.elements[e]:this.view.customColorDefinitions[e]?.elements??qn.elements[ed]}}class O0 extends K_{static toDot(e){return new O0(e).print()}createGraph(){const e=super.createGraph();return e.set(M.TBbalance,"max"),e}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,S=>Uc(S)),[u,l,d]=this.edgeEndpoint(s,Wc),f=n.edge([a,l],{[M.likec4_id]:e.id,[M.style]:e.line??H_});if(d&&f.attributes.set(M.lhead,d),c&&f.attributes.set(M.ltail,c),e.color&&e.color!==ms){const S=this.getRelationshipColorValues(e.color);f.attributes.apply({[M.color]:S.lineColor,[M.fontcolor]:S.labelColor})}const h=Mr(d)||Mr(c),p=mb(e.id),m=HV(p,e.label?.trim());if(f.attributes.set(M.label,m),!h){const S=new Set([...o.outEdges,...u.inEdges,...Wj(u.outEdges,o.inEdges)].filter($=>!this.edgesWithCompounds.has($)));f.attributes.set(M.weight,S.size)}const w=r.findIndex(S=>S.id===i);r.findIndex(S=>S.id===s)<w&&e.dir!=="back"&&f.attributes.apply({[M.constraint]:!1});let[v,E]=[e.head??yo,e.tail??"none"];return e.dir==="back"?(f.attributes.apply({[M.arrowtail]:Jn(v),[M.minlen]:0,[M.dir]:"back"}),E!=="none"&&f.attributes.apply({[M.arrowhead]:Jn(E),[M.dir]:"both"}),f):v==="none"&&E==="none"||v!=="none"&&E!=="none"?(f.attributes.apply({[M.arrowhead]:Jn(v),[M.arrowtail]:Jn(E),[M.dir]:"both"}),f):v==="none"?(f.attributes.delete(M.arrowhead),f.attributes.apply({[M.arrowtail]:Jn(E),[M.minlen]:0,[M.dir]:"back"}),f):(v!==yo&&f.attributes.set(M.arrowhead,Jn(v)),f)}}class F0 extends K_{static toDot(e){return new F0(e).print()}buildGraphvizModel(e){super.buildGraphvizModel(e),this.assignGroups();const n=new Set,r=this.view.nodes.reduce((i,s)=>(Fn(s)&&(n.add(s.id),i.push(s)),i),[]);for(const i of r){const s=Ye(i.children,Je(u=>!this.compoundIds.has(u)),ut(u=>this.viewElement(u)),Je(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=et(this.getSubgraph(i.id),`Subgraph not found for ${i.id}`);let c=null;hq(s,o).forEach(u=>{const l=u.length>1?a.createSubgraph({[M.rank]:"same"}):null;u.forEach((d,f)=>{const h=this.getGraphNode(d.id);h&&(l?.node(h.id),f===0&&(c&&a.edge([c,h],{[M.style]:"invis"}),c=h))})})}}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,S=>Uc(S)),[u,l,d]=this.edgeEndpoint(s,Wc),f=e.parent,h=(f===null?n:et(this.getSubgraph(f),`Parent not found for edge ${e.id}`)).edge([a,l],{[M.likec4_id]:e.id,[M.style]:e.line??H_});d&&h.attributes.set(M.lhead,d),c&&h.attributes.set(M.ltail,c);const p=Mr(d)||Mr(c);if(!p){const S=new Set([...o.inEdges,...o.outEdges,...u.inEdges,...u.outEdges].filter($=>!this.edgesWithCompounds.has($)));h.attributes.set(M.weight,S.size)}const m=GV(e);if(m&&(p?h.attributes.set(M.xlabel,m):h.attributes.set(M.label,m)),e.color){const S=this.getRelationshipColorValues(e.color);h.attributes.apply({[M.color]:S.lineColor,[M.fontcolor]:S.labelColor})}let[w,v]=[e.head??yo,e.tail??"none"];if(e.dir==="back")return h.attributes.apply({[M.arrowtail]:Jn(w),[M.dir]:"back"}),v!=="none"&&h.attributes.apply({[M.arrowhead]:Jn(v),[M.dir]:"both",[M.minlen]:0}),h;if(w==="none"&&v==="none")return h.attributes.apply({[M.arrowtail]:"none",[M.arrowhead]:"none",[M.dir]:"none",[M.minlen]:0,[M.constraint]:!1}),h;if(w!=="none"&&v!=="none")return h.attributes.apply({[M.arrowhead]:Jn(w),[M.arrowtail]:Jn(v),[M.dir]:"both",[M.minlen]:0}),h;if(w!==yo&&h.attributes.set(M.arrowhead,Jn(w)),v!=="none"&&h.attributes.set(M.arrowtail,Jn(v)),r.length===1)return h;let E;return f===null&&o.parent==null&&u.parent==null?E=r.filter(S=>{if(S.id===e.id||S.parent!==null||S.source===e.source&&S.target===e.target||S.source===e.target&&S.target===e.source)return!1;const $=this.viewElement(S.source),I=this.viewElement(S.target);return Fn($)||Fn(I)?!1:$.parent==null&&I.parent==null}):E=this.findInternalEdges(f).filter(S=>!(S.id===e.id||S.source===e.source&&S.target===e.target||S.source===e.target&&S.target===e.source)),E.length===0&&(f===null||this.leafElements(f).length<=3)&&h.attributes.set(M.minlen,0),h}}function hp(t){const[e,n,r,i]=t?t.split(",").map(a=>Ur(+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 KV(t){try{const[e,n]=t.split(",");return{x:Ur(parseFloat(e)),y:Ur(parseFloat(n))}}catch(e){throw Ze.error(`failed on parsing pos: ${t}`,e),e}}function V_({pos:t,width:e,height:n}){const{x:r,y:i}=KV(t),s=W_(+e),o=W_(+n);return{x:r-Math.round(s/2),y:i-Math.round(o/2),width:s,height:o}}function Y_(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=Ur(u.size);continue}if(u.op==="T"){let l=Ur(u.pt[0])-e,d=Ur(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=Ur(u.pt[1])-n;i=Math.min(i,Math.round(f-a)),o=Math.max(o,f)}}}catch(u){return Ze.error(`Failed on parsing label draw ops: ${u}
1754
- ${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 X_({_draw_:t,likec4_id:e="???"},n="<unknown view>"){try{const r=t.filter(s=>s.op.toLowerCase()==="b");ge(Fr(r,1),`view ${n} edge ${e} should have at least one bezier draw op`),r.length>1&&Ze.warn(`view ${n} edge ${e} has more than one bezier draw op, using the first one only`);const i=r[0].points.map(s=>Ur(s));return ge(Fr(i,2),`view ${n} edge ${e} should have at least two points`),i}catch(r){throw Ze.error(`failed on parsing view ${n} edge ${e} _draw_:
1755
- ${JSON.stringify(t,null,2)}`),r}}function VV(t,{id:e,source:n,target:r,dir:i,label:s,description:o,...a},c){const u=Y_(t._ldraw_??t._tldraw_??t._hldraw_),l=t.dir==="back"||i==="back";return s=s?yw(s,Da).join(`
1756
- `):null,o=o?yw(o,Da).join(`
1757
- `):void 0,{id:e,source:n,target:r,label:s,...ne(o)&&{description:o},...ne(t.pos)&&{dotpos:t.pos},points:X_(t,c),labelBBox:u,...l?{dir:"back"}:{},...a}}function J_(t,e){const n=JSON.parse(t),r=hp(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(E=>E.likec4_id===d.id);ge(f,`View ${a.id} element ${d.id} not found in graphviz output`);const{x:h,y:p,width:m,height:w}="bb"in f?hp(f.bb):V_(f),v=[h,p];c.nodes.push({...d,position:v,width:m,height:w,labelBBox:et(Y_(f._ldraw_,v),`View ${a.id} Node ${d.id} label bbox not found`)})}const l=n.edges??[];for(const d of s){const f=l.find(h=>h.likec4_id===d.id);if(!f){Ze.warn(`View ${a.id} edge ${d.id} not found in graphviz output, skipping`);continue}c.edges.push(VV(f,d,a.id))}return c}const pp=t=>String(t+1).padStart(2,"0");function YV(t){const e=JSON.parse(t),n=hp(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=pp(o._gvid),c=o.likec4_path??"",u=i.get(o._gvid),{x:l,y:d,width:f,height:h}="bb"in o?hp(o.bb):V_(o),p={x:l,y:d};if(o.likec4_type==="view")ge(o.likec4_id,`View ${o} has no likec4_id`),r.nodes.push({id:a,type:"view",parentId:u?.id??null,height:h,width:f,position:p,label:o.label??"",viewId:o.likec4_id});else{const m={id:a,type:o.likec4_type,parentId:u?.id??null,height:h,width:f,position:p,path:c,label:o.label??""},w=[..."subgraphs"in o?o.subgraphs:[],..."nodes"in o?o.nodes:[]];for(const v of w)i.set(v,m);r.nodes.push(m)}}for(const o of e.edges??[])try{const a=pp(o.tail),c=pp(o.head);r.edges.push({id:`link${pp(o._gvid)}`,source:a,target:c,points:X_(o)})}catch(a){Ze.warn(a)}return r}const Z_=qn.font,gp="/";class L0{static toDot(e){return new L0(e).print()}subgraphs=new Map;graphvizModel;constructor(e){const n=this.graphvizModel=tV.graph({[M.layout]:"osage",[M.pack]:Zn(100),[M.packmode]:"array_ltc",[M.pad]:ot(15),[M.fontname]:Z_,[M.splines]:"polyline",[M.esep]:"+20"});n.attributes.graph.apply({[M.fontsize]:Zn(20),[M.labeljust]:"l",[M.labelloc]:"t"}),n.attributes.node.apply({[M.fontname]:Z_,[M.shape]:"rect",[M.width]:ot(400),[M.height]:ot(300),[M.fixedsize]:!0,[M.fontsize]:10}),n.attributes.edge.apply({[M.penwidth]:Zn(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(gp)??[""],d=u.relativePath?.split(gp)??[""];l.push(c.title??"Untitled"),d.push(u.title??"Untitled");const f=l.length,h=d.length;switch(i=Math.max(i,f,h),!0){case f>h:return-1;case f<h:return 1;default:{for(let p=0;p<f;p++){const m=l[p].localeCompare(d[p]);if(m!==0)return m}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(gp)?e.slice(0,e.lastIndexOf(gp)):"";r=this.getParentForPath(s).subgraph("cluster"+String(this.subgraphs.size+1),{[M.likec4_type]:i?"file":"folder",[M.likec4_path]:e,[M.sortv]:this.subgraphs.size,[M.label]:ne(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,{[M.likec4_type]:"view",[M.likec4_id]:e.id,[M.sortv]:n,[M.label]:e.title||"Untitled"})}print(){return C_(this.graphvizModel,{print:{indentStyle:"space",indentSize:2}})}}const Q_=t=>Zp(t)?new O0(t):new F0(t);class XV{constructor(e){this.graphviz=e}get port(){return this.graphviz}changePort(e){this.graphviz=e}async layout(e){let n=await this.dot(e);const r=await this.graphviz.layoutJson(n);let i=J_(r,e);if(e.manualLayout){const s=BV(i,e.manualLayout);if(s.diagram)i=s.diagram;else{if(s.relayout.nodes.length>0){const o=Q_(e);if(o.hasEdgesWithCompounds)Ze.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=J_(a,e)}}i.hasLayoutDrift=!0}}return n=n.split(`
1758
- `).filter(s=>!(s.includes("margin")&&s.includes("50.1"))).join(`
1759
- `),{dot:n,diagram:i}}async svg(e){let n=await this.dot(e);return n=n.split(`
1760
- `).filter(r=>!(r.includes("margin")&&r.includes("50.1"))).join(`
1761
- `),{svg:await this.graphviz.svg(n),dot:n}}async dot(e){let n=Q_(e).print();if(Zp(e))return n;try{return await this.graphviz.unflatten(n)}catch(r){return Ze.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=L0.toDot(e),r=await this.graphviz.layoutJson(n);return YV(r)}}const JV=dp(1);let ZV=class zp{static _graphviz=null;graphviz(){return Promise.resolve().then(()=>zp._graphviz??=qp.load())}async attempt(e,n){return await JV(async()=>{const r=Ze.withTag("graphviz-wasm");try{return await n()}catch(i){r.error(`FAILED GraphvizWasmAdapter: ${e}`,i),qp.unload(),zp._graphviz=null}r.warn("Retrying..."),await yD(50,300);try{return await n()}finally{qp.unload(),zp._graphviz=null}})}async unflatten(e){return await this.attempt(`unflatten
1762
- ${e}`,async()=>(await this.graphviz()).unflatten(e,1,!1,3).replaceAll(/\t\[/g," [").replaceAll(/\t/g," "))}async acyclic(e){return await this.attempt(`acyclic
1763
- ${e}`,async()=>{const n=(await this.graphviz()).acyclic(e,!0);return n.acyclic&&n.outFile||e})}async layoutJson(e){return await this.attempt(`dot
1764
- ${e}`,async()=>(await this.graphviz()).layout(e,"json",void 0,{yInvert:!0}))}async svg(e){return await this.attempt(`svg
1765
- ${e}`,async()=>(await this.graphviz()).layout(e,"svg"))}};function Qn(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 bw=(t,e)=>{const n=eA(t);if(typeof n!="string")throw new TypeError(`${e} must be a string or a file URL: ${n}.`);return n},eA=t=>t instanceof URL?jp(t):t,tA=(t,e=[],n={})=>{const r=bw(t,"First argument"),[i,s]=Qn(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(!Qn(s))throw new TypeError(`Last argument must be an options object: ${s}`);return[r,o,s]},{toString:nA}=Object.prototype,QV=t=>nA.call(t)==="[object ArrayBuffer]",yr=t=>nA.call(t)==="[object Uint8Array]",Ll=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),eY=new TextEncoder,rA=t=>eY.encode(t),tY=new TextDecoder,iA=t=>tY.decode(t),nY=(t,e)=>rY(t,e).join(""),rY=(t,e)=>{if(e==="utf8"&&t.every(s=>typeof s=="string"))return t;const n=new G0(e),r=t.map(s=>typeof s=="string"?rA(s):s).map(s=>n.write(s)),i=n.end();return i===""?r:[...r,i]},Dw=t=>t.length===1&&yr(t[0])?t[0]:sA(iY(t)),iY=t=>t.map(e=>typeof e=="string"?rA(e):e),sA=t=>{const e=new Uint8Array(sY(t));let n=0;for(const r of t)e.set(r,n),n+=r.length;return e},sY=t=>{let e=0;for(const n of t)e+=n.length;return e},oY=t=>Array.isArray(t)&&Array.isArray(t.raw),aY=(t,e)=>{let n=[];for(const[s,o]of t.entries())n=cY({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,{}]},cY=({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}=uY(i,t.raw[r]),c=aA(n,s,o);if(r===e.length)return c;const u=e[r],l=Array.isArray(u)?u.map(d=>cA(d)):[cA(u)];return aA(c,l,a)},uY=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};const n=[];let r=0;const i=oA.has(e[0]);for(let o=0,a=0;o<t.length;o+=1,a+=1){const c=e[a];if(oA.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+=lY[u]??1}}const s=r===t.length;return s||n.push(t.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:s}},oA=new Set([" "," ","\r",`
1766
- `]),lY={x:3,u:5},aA=(t,e,n)=>n||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],cA=t=>{const e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(Qn(t)&&("stdout"in t||"isMaxBuffer"in t))return dY(t);throw t instanceof W0||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`)},dY=({stdout:t})=>{if(typeof t=="string")return t;if(yr(t))return iA(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`)},io=t=>Ew.includes(t),Ew=[ke.stdin,ke.stdout,ke.stderr],Wr=["stdin","stdout","stderr"],uA=t=>Wr[t]??`stdio[${t}]`,fY=t=>{const e={...t};for(const n of hA)e[n]=lA(t,n);return e},lA=(t,e)=>{const n=Array.from({length:hY(t)+1}),r=pY(t[e],n,e);return wY(r,e)},hY=({stdio:t})=>Array.isArray(t)?Math.max(t.length,Wr.length):Wr.length,pY=(t,e,n)=>Qn(t)?gY(t,e,n):e.fill(t),gY=(t,e,n)=>{for(const r of Object.keys(t).sort(mY))for(const i of yY(r,n,e))e[i]=t[r];return e},mY=(t,e)=>dA(t)<dA(e)?1:-1,dA=t=>t==="stdout"||t==="stderr"?0:t==="all"?2:1,yY=(t,e,n)=>{if(t==="ipc")return[n.length-1];const r=fA(t);if(r===void 0||r===0)throw new TypeError(`"${e}.${t}" is invalid.
1767
- 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.
1768
- Please set the "stdio" option to ensure that file descriptor exists.`);return r==="all"?[1,2]:[r]},fA=t=>{if(t==="all")return t;if(Wr.includes(t))return Wr.indexOf(t);const e=vY.exec(t);if(e!==null)return Number(e[1])},vY=/^fd(\d+)$/,wY=(t,e)=>t.map(n=>n===void 0?DY[e]:n),bY=CP("execa").enabled?"full":"none",DY={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:bY,stripFinalNewline:!0},hA=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Ml=(t,e)=>e==="ipc"?t.at(-1):t[e],Tw=({verbose:t},e)=>Sw(t,e)!=="none",Rw=({verbose:t},e)=>!["none","short"].includes(Sw(t,e)),EY=({verbose:t},e)=>{const n=Sw(t,e);return kw(n)?n:void 0},Sw=(t,e)=>e===void 0?TY(t):Ml(t,e),TY=t=>t.find(e=>kw(e))??$w.findLast(e=>t.includes(e)),kw=t=>typeof t=="function",$w=["none","short","full"],RY=(t,e)=>{const n=[t,...e],r=n.join(" "),i=n.map(s=>AY(pA(s))).join(" ");return{command:r,escapedCommand:i}},Cw=t=>_P(t).split(`
1769
- `).map(e=>pA(e)).join(`
1770
- `),pA=t=>t.replaceAll($Y,e=>SY(e)),SY=t=>{const e=CY[t];if(e!==void 0)return e;const n=t.codePointAt(0),r=n.toString(16);return n<=_Y?`\\u${r.padStart(4,"0")}`:`\\U${r}`},kY=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},$Y=kY(),CY={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},_Y=65535,AY=t=>xY.test(t)?t:IP==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,xY=/^[\w./-]+$/;function IY(){return ke.platform!=="win32"?ke.env.TERM!=="linux":!!ke.env.WT_SESSION||!!ke.env.TERMINUS_SUBLIME||ke.env.ConEmuTask==="{cmd::Cmder}"||ke.env.TERM_PROGRAM==="Terminus-Sublime"||ke.env.TERM_PROGRAM==="vscode"||ke.env.TERM==="xterm-256color"||ke.env.TERM==="alacritty"||ke.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const gA={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"},PY={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"},NY={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"},OY={...gA,...PY},FY={...gA,...NY},LY=IY(),_w=LY?OY:FY,MY=U0.WriteStream.prototype.hasColors(),mp=(t,e)=>{if(!MY)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}},zY=mp(1,22),Aw=mp(90,39),BY=mp(91,39),jY=mp(93,39),qY=({type:t,message:e,timestamp:n,piped:r,commandId:i,result:{failed:s=!1}={},options:{reject:o=!0}})=>{const a=UY(n),c=WY[t]({failed:s,reject:o,piped:r}),u=GY[t]({reject:o});return`${Aw(`[${a}]`)} ${Aw(`[${i}]`)} ${u(c)} ${u(e)}`},UY=t=>`${yp(t.getHours(),2)}:${yp(t.getMinutes(),2)}:${yp(t.getSeconds(),2)}.${yp(t.getMilliseconds(),3)}`,yp=(t,e)=>String(t).padStart(e,"0"),mA=({failed:t,reject:e})=>t?e?_w.cross:_w.warning:_w.tick,WY={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:mA,duration:mA},yA=t=>t,GY={command:()=>zY,output:()=>yA,ipc:()=>yA,error:({reject:t})=>t?BY:jY,duration:()=>Aw},HY=(t,e,n)=>{const r=EY(e,n);return t.map(({verboseLine:i,verboseObject:s})=>KY(i,s,r)).filter(i=>i!==void 0).map(i=>VY(i)).join("")},KY=(t,e,n)=>{if(n===void 0)return t;const r=n(t,e);if(typeof r=="string")return r},VY=t=>t.endsWith(`
1771
- `)?t:`${t}
1772
- `,zl=({type:t,verboseMessage:e,fdNumber:n,verboseInfo:r,result:i})=>{const s=YY({type:t,result:i,verboseInfo:r}),o=XY(e,s),a=HY(o,r,n);z0(ZY,a)},YY=({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}),XY=(t,e)=>t.split(`
1773
- `).map(n=>JY({...e,message:n})),JY=t=>({verboseLine:qY(t),verboseObject:t}),ZY=2,vA=t=>{const e=typeof t=="string"?t:q0(t);return Cw(e).replaceAll(" "," ".repeat(QY))},QY=2,eX=(t,e)=>{Tw(e)&&zl({type:"command",verboseMessage:t,verboseInfo:e})},tX=(t,e,n)=>{iX(t);const r=nX(t);return{verbose:t,escapedCommand:e,commandId:r,rawOptions:n}},nX=t=>Tw({verbose:t})?rX++:void 0;let rX=0n;const iX=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(!$w.includes(e)&&!kw(e)){const n=$w.map(r=>`'${r}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${n} or a function.`)}}},wA=()=>Xl.bigint(),bA=t=>Number(Xl.bigint()-t)/1e6,DA=(t,e,n)=>{const r=wA(),{command:i,escapedCommand:s}=RY(t,e),o=lA(n,"verbose"),a=tX(o,s,{...n});return eX(s,a),{command:i,escapedCommand:s,startTime:r,verboseInfo:a}};var so={exports:{}},xw,EA;function sX(){if(EA)return xw;EA=1,xw=r,r.sync=i;var t=Kf;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 xw}var Iw,TA;function oX(){if(TA)return Iw;TA=1,Iw=e,e.sync=n;var t=Kf;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),h=parseInt("010",8),p=parseInt("001",8),m=f|h,w=a&p||a&h&&u===d||a&f&&c===l||a&m&&l===0;return w}return Iw}var Pw,RA;function aX(){if(RA)return Pw;RA=1;var t;process.platform==="win32"||PL.TESTING_WINDOWS?t=sX():t=oX(),Pw=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 Pw}var Nw,SA;function cX(){if(SA)return Nw;SA=1;const t=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",e=Vc,n=t?";":":",r=aX(),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":"",h=t?f.split(l):[""];return t&&c.indexOf(".")!==-1&&h[0]!==""&&h.unshift(""),{pathEnv:d,pathExt:h,pathExtExe:f}},o=(c,u,l)=>{typeof u=="function"&&(l=u,u={}),u||(u={});const{pathEnv:d,pathExt:f,pathExtExe:h}=s(c,u),p=[],m=v=>new Promise((E,S)=>{if(v===d.length)return u.all&&p.length?E(p):S(i(c));const $=d[v],I=/^".*"$/.test($)?$.slice(1,-1):$,N=e.join(I,c),A=!I&&/^\.[\\\/]/.test(c)?c.slice(0,2)+N:N;E(w(A,v,0))}),w=(v,E,S)=>new Promise(($,I)=>{if(S===f.length)return $(m(E+1));const N=f[S];r(v+N,{pathExt:h},(A,q)=>{if(!A&&q)if(u.all)p.push(v+N);else return $(v+N);return $(w(v,E,S+1))})});return l?m(0).then(v=>l(null,v),l):m(0)},a=(c,u)=>{u=u||{};const{pathEnv:l,pathExt:d,pathExtExe:f}=s(c,u),h=[];for(let p=0;p<l.length;p++){const m=l[p],w=/^".*"$/.test(m)?m.slice(1,-1):m,v=e.join(w,c),E=!w&&/^\.[\\\/]/.test(c)?c.slice(0,2)+v:v;for(let S=0;S<d.length;S++){const $=E+d[S];try{if(r.sync($,{pathExt:f}))if(u.all)h.push($);else return $}catch{}}}if(u.all&&h.length)return h;if(u.nothrow)return null;throw i(c)};return Nw=o,o.sync=a,Nw}var vp={exports:{}},kA;function uX(){if(kA)return vp.exports;kA=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 vp.exports=t,vp.exports.default=t,vp.exports}var Ow,$A;function lX(){if($A)return Ow;$A=1;const t=Vc,e=cX(),n=uX();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 Ow=i,Ow}var wp={},CA;function dX(){if(CA)return wp;CA=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 wp.command=e,wp.argument=n,wp}var Fw,_A;function fX(){return _A||(_A=1,Fw=/^#!(.*)/),Fw}var Lw,AA;function hX(){if(AA)return Lw;AA=1;const t=fX();return Lw=(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},Lw}var Mw,xA;function pX(){if(xA)return Mw;xA=1;const t=Kf,e=hX();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 Mw=n,Mw}var zw,IA;function gX(){if(IA)return zw;IA=1;const t=Vc,e=lX(),n=dX(),r=pX(),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 h=o.test(d);l.command=t.normalize(l.command),l.command=n.command(l.command),l.args=l.args.map(m=>n.argument(m,h));const p=[l.command].concat(l.args).join(" ");l.args=["/d","/s","/c",`"${p}"`],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 h={command:l,args:d,options:f,file:void 0,original:{command:l,args:d}};return f.shell?h:c(h)}return zw=u,zw}var Bw,PA;function mX(){if(PA)return Bw;PA=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 Bw={hookChildProcess:n,verifyENOENT:r,verifyENOENTSync:i,notFoundError:e},Bw}var NA;function yX(){if(NA)return so.exports;NA=1;const t=jk,e=gX(),n=mX();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 so.exports=r,so.exports.spawn=r,so.exports.sync=i,so.exports._parse=e,so.exports._enoent=n,so.exports}var vX=yX();function OA(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 wX=({cwd:t=ke.cwd(),path:e=ke.env[OA()],preferLocal:n=!0,execPath:r=ke.execPath,addExecPath:i=!0}={})=>{const s=t instanceof URL?jp(t):t,o=Vr.resolve(s),a=[];return n&&bX(a,o),i&&DX(a,r,o),[...a,e].join(Vr.delimiter)},bX=(t,e)=>{let n;for(;n!==e;)t.push(Vr.join(e,"node_modules/.bin")),n=e,e=Vr.resolve(e,"..")},DX=(t,e,n)=>{const r=e instanceof URL?jp(e):e;t.push(Vr.resolve(n,r,".."))},EX=({env:t=ke.env,...e}={})=>{t={...t};const n=OA({env:t});return e.path=t[n],t[n]=wX(e),t},TX=(t,e,n)=>{const r=n?Uw:qw,i=t instanceof Bl?{}:{cause:t};return new r(e,i)};class Bl extends Error{}const FA=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,LA,{value:!0,writable:!1,enumerable:!1,configurable:!1})},RX=t=>jw(t)&&LA in t,LA=Symbol("isExecaError"),jw=t=>Object.prototype.toString.call(t)==="[object Error]";class qw extends Error{}FA(qw,qw.name);class Uw extends Error{}FA(Uw,Uw.name);const SX=()=>{const t=zA-MA+1;return Array.from({length:t},kX)},kX=(t,e)=>({name:`SIGRT${e+1}`,number:MA+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),MA=34,zA=64,$X=[{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"}],BA=()=>{const t=SX();return[...$X,...t].map(CX)},CX=({name:t,number:e,description:n,action:r,forced:i=!1,standard:s})=>{const{signals:{[t]:o}}=ps,a=o!==void 0;return{name:t,number:a?o:e,description:n,supported:a,action:r,forced:i,standard:s}},_X=()=>{const t=BA();return Object.fromEntries(t.map(AX))},AX=({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}],xX=_X(),IX=()=>{const t=BA(),e=zA+1,n=Array.from({length:e},(r,i)=>PX(i,t));return Object.assign({},...n)},PX=(t,e)=>{const n=NX(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}}},NX=(t,e)=>{const n=e.find(({name:r})=>ps.signals[r]===t);return n!==void 0?n:e.find(r=>r.number===t)};IX();const OX=t=>{const e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return jA(t,e)},FX=t=>t===0?t:jA(t,"`subprocess.kill()`'s argument"),jA=(t,e)=>{if(Number.isInteger(t))return LX(t,e);if(typeof t=="string")return zX(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer.
1774
- ${Ww()}`)},LX=(t,e)=>{if(qA.has(t))return qA.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist.
1775
- ${Ww()}`)},MX=()=>new Map(Object.entries(ps.signals).reverse().map(([t,e])=>[e,t])),qA=MX(),zX=(t,e)=>{if(t in ps.signals)return t;throw t.toUpperCase()in ps.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist.
1776
- ${Ww()}`)},Ww=()=>`Available signal names: ${BX()}.
1777
- Available signal numbers: ${jX()}.`,BX=()=>Object.keys(ps.signals).sort().map(t=>`'${t}'`).join(", "),jX=()=>[...new Set(Object.values(ps.signals).sort((t,e)=>t-e))].join(", "),UA=t=>xX[t].description,qX=t=>{if(t===!1)return t;if(t===!0)return UX;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},UX=1e3*5,WX=({kill:t,options:{forceKillAfterDelay:e,killSignal:n},onInternalError:r,context:i,controller:s},o,a)=>{const{signal:c,error:u}=GX(o,a,n);HX(u,r);const l=t(c);return KX({kill:t,signal:c,forceKillAfterDelay:e,killSignal:n,killResult:l,context:i,controller:s}),l},GX=(t,e,n)=>{const[r=n,i]=jw(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&&!jw(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:FX(r),error:i}},HX=(t,e)=>{t!==void 0&&e.reject(t)},KX=async({kill:t,signal:e,forceKillAfterDelay:n,killSignal:r,killResult:i,context:s,controller:o})=>{e===r&&i&&WA({kill:t,forceKillAfterDelay:n,context:s,controllerSignal:o.signal})},WA=async({kill:t,forceKillAfterDelay:e,context:n,controllerSignal:r})=>{if(e!==!1)try{await H0(e,void 0,{signal:r}),t("SIGKILL")&&(n.isForcefullyTerminated??=!0)}catch{}},GA=async(t,e)=>{t.aborted||await mn(t,"abort",{signal:e})},VX=({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)}`)},YX=({subprocess:t,cancelSignal:e,gracefulCancel:n,context:r,controller:i})=>e===void 0||n?[]:[XX(t,e,r,i)],XX=async(t,e,n,{signal:r})=>{throw await GA(e,r),n.terminationReason??="cancel",t.kill(),e.reason},Gw=({methodName:t,isSubprocess:e,ipc:n,isConnected:r})=>{JX(t,e,n),HA(t,e,r)},JX=(t,e,n)=>{if(!n)throw new Error(`${vr(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},HA=(t,e,n)=>{if(!n)throw new Error(`${vr(t,e)} cannot be used: the ${rs(e)} has already exited or disconnected.`)},ZX=t=>{throw new Error(`${vr("getOneMessage",t)} could not complete: the ${rs(t)} exited or disconnected.`)},QX=t=>{throw new Error(`${vr("sendMessage",t)} failed: the ${rs(t)} is sending a message too, instead of listening to incoming messages.
1778
- This can be fixed by both sending a message and listening to incoming messages at the same time:
1779
-
1780
- const [receivedMessage] = await Promise.all([
1781
- ${vr("getOneMessage",t)},
1782
- ${vr("sendMessage",t,"message, {strict: true}")},
1783
- ]);`)},KA=(t,e)=>new Error(`${vr("sendMessage",e)} failed when sending an acknowledgment response to the ${rs(e)}.`,{cause:t}),eJ=t=>{throw new Error(`${vr("sendMessage",t)} failed: the ${rs(t)} is not listening to incoming messages.`)},tJ=t=>{throw new Error(`${vr("sendMessage",t)} failed: the ${rs(t)} exited without listening to incoming messages.`)},nJ=()=>new Error(`\`cancelSignal\` aborted: the ${rs(!0)} disconnected.`),rJ=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},iJ=({error:t,methodName:e,isSubprocess:n})=>{if(t.code==="EPIPE")throw new Error(`${vr(e,n)} cannot be used: the ${rs(n)} is disconnecting.`,{cause:t})},sJ=({error:t,methodName:e,isSubprocess:n,message:r})=>{if(oJ(t))throw new Error(`${vr(e,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:t})},oJ=({code:t,message:e})=>aJ.has(t)||cJ.some(n=>e.includes(n)),aJ=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),cJ=["could not be cloned","circular structure","call stack size exceeded"],vr=(t,e,n="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${uJ(e)}${t}(${n})`,uJ=t=>t?"":"subprocess.",rs=t=>t?"parent process":"subprocess",Hw=t=>{t.connected&&t.disconnect()},jl=()=>{const t={},e=new Promise((n,r)=>{Object.assign(t,{resolve:n,reject:r})});return Object.assign(e,t)},VA=(t,e="stdin")=>{const{options:r,fileDescriptors:i}=oo.get(t),s=YA(i,e,!0),o=t.stdio[s];if(o===null)throw new TypeError(XA(s,e,r,!0));return o},Kw=(t,e="stdout")=>{const{options:r,fileDescriptors:i}=oo.get(t),s=YA(i,e,!1),o=s==="all"?t.all:t.stdio[s];if(o==null)throw new TypeError(XA(s,e,r,!1));return o},oo=new WeakMap,YA=(t,e,n)=>{const r=lJ(e,n);return dJ(r,e,n,t),r},lJ=(t,e)=>{const n=fA(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(`"${ql(e)}" must not be "${t}".
1784
- It must be ${r} or "fd3", "fd4" (and so on).
1785
- It is optional and defaults to "${i}".`)},dJ=(t,e,n,r)=>{const i=r[JA(t)];if(i===void 0)throw new TypeError(`"${ql(n)}" must not be ${e}. That file descriptor does not exist.
1786
- Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!n)throw new TypeError(`"${ql(n)}" must not be ${e}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&n)throw new TypeError(`"${ql(n)}" must not be ${e}. It must be a writable stream, not readable.`)},XA=(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}=fJ(t,n);return`The "${i}: ${Vw(s)}" option is incompatible with using "${ql(r)}: ${Vw(e)}".
1787
- Please set this option with "pipe" instead.`},fJ=(t,{stdin:e,stdout:n,stderr:r,stdio:i})=>{const s=JA(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]}},JA=t=>t==="all"?1:t,ql=t=>t?"to":"from",Vw=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream",bp=(t,e,n)=>{const r=t.getMaxListeners();r===0||r===Number.POSITIVE_INFINITY||(t.setMaxListeners(r+e),V0(n,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))},ZA=(t,e)=>{e&&Yw(t)},Yw=t=>{t.refCounted()},QA=(t,e)=>{e&&Xw(t)},Xw=t=>{t.unrefCounted()},hJ=(t,e)=>{e&&(Xw(t),Xw(t))},pJ=(t,e)=>{e&&(Yw(t),Yw(t))},gJ=async({anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r},i)=>{if(EJ(i)||NJ(i))return;Dp.has(t)||Dp.set(t,[]);const s=Dp.get(t);if(s.push(i),!(s.length>1))for(;s.length>0;){await $J(t,r,i),await K0.yield();const o=await DJ({wrappedMessage:s[0],anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r});s.shift(),r.emit("message",o),r.emit("message:done")}},mJ=async({anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{ox();const s=Dp.get(t);for(;s?.length>0;)await mn(r,"message:done");t.removeListener("message",i),pJ(e,n),r.connected=!1,r.emit("disconnect")},Dp=new WeakMap,Ep=(t,e,n)=>{if(Tp.has(t))return Tp.get(t);const r=new jP;return r.connected=!0,Tp.set(t,r),yJ({ipcEmitter:r,anyProcess:t,channel:e,isSubprocess:n}),r},Tp=new WeakMap,yJ=({ipcEmitter:t,anyProcess:e,channel:n,isSubprocess:r})=>{const i=gJ.bind(void 0,{anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:t});e.on("message",i),e.once("disconnect",mJ.bind(void 0,{anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:t,boundOnMessage:i})),hJ(n,r)},ex=t=>{const e=Tp.get(t);return e===void 0?t.channel!==null:e.connected},vJ=({anyProcess:t,channel:e,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;const s=Ep(t,e,n),o=Jw(t,s);return{id:wJ++,type:Sp,message:r,hasListeners:o}};let wJ=0n;const bJ=(t,e)=>{if(!(e?.type!==Sp||e.hasListeners))for(const{id:n}of t)n!==void 0&&Rp[n].resolve({isDeadlock:!0,hasListeners:!1})},DJ=async({wrappedMessage:t,anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(t?.type!==Sp||!e.connected)return t;const{id:s,message:o}=t,a={id:s,type:tx,message:Jw(e,i)};try{await nx({anyProcess:e,channel:n,isSubprocess:r,ipc:!0},a)}catch(c){i.emit("strict:error",c)}return o},EJ=t=>{if(t?.type!==tx)return!1;const{id:e,message:n}=t;return Rp[e]?.resolve({isDeadlock:!1,hasListeners:n}),!0},TJ=async(t,e,n)=>{if(t?.type!==Sp)return;const r=jl();Rp[t.id]=r;const i=new AbortController;try{const{isDeadlock:s,hasListeners:o}=await Promise.race([r,RJ(e,n,i)]);s&&QX(n),o||eJ(n)}finally{i.abort(),delete Rp[t.id]}},Rp={},RJ=async(t,e,{signal:n})=>{bp(t,1,n),await mn(t,"disconnect",{signal:n}),tJ(e)},Sp="execa:ipc:request",tx="execa:ipc:response",SJ=(t,e,n)=>{Ul.has(t)||Ul.set(t,new Set);const r=Ul.get(t),i=jl(),s=n?e.id:void 0,o={onMessageSent:i,id:s};return r.add(o),{outgoingMessages:r,outgoingMessage:o}},kJ=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},$J=async(t,e,n)=>{for(;!Jw(t,e)&&Ul.get(t)?.size>0;){const r=[...Ul.get(t)];bJ(r,n),await Promise.all(r.map(({onMessageSent:i})=>i))}},Ul=new WeakMap,Jw=(t,e)=>e.listenerCount("message")>CJ(t),CJ=t=>oo.has(t)&&!Ml(oo.get(t).options.buffer,"ipc")?1:0,nx=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},i,{strict:s=!1}={})=>{const o="sendMessage";return Gw({methodName:o,isSubprocess:n,ipc:r,isConnected:t.connected}),_J({anyProcess:t,channel:e,methodName:o,isSubprocess:n,message:i,strict:s})},_J=async({anyProcess:t,channel:e,methodName:n,isSubprocess:r,message:i,strict:s})=>{const o=vJ({anyProcess:t,channel:e,isSubprocess:r,message:i,strict:s}),a=SJ(t,o,s);try{await rx({anyProcess:t,methodName:n,isSubprocess:r,wrappedMessage:o,message:i})}catch(c){throw Hw(t),c}finally{kJ(a)}},rx=async({anyProcess:t,methodName:e,isSubprocess:n,wrappedMessage:r,message:i})=>{const s=AJ(t);try{await Promise.all([TJ(r,t,n),s(r)])}catch(o){throw iJ({error:o,methodName:e,isSubprocess:n}),sJ({error:o,methodName:e,isSubprocess:n,message:i}),o}},AJ=t=>{if(Zw.has(t))return Zw.get(t);const e=AP(t.send.bind(t));return Zw.set(t,e),e},Zw=new WeakMap,xJ=(t,e)=>{const n="cancelSignal";return HA(n,!1,t.connected),rx({anyProcess:t,methodName:n,isSubprocess:!1,wrappedMessage:{type:sx,message:e},message:e})},IJ=async({anyProcess:t,channel:e,isSubprocess:n,ipc:r})=>(await PJ({anyProcess:t,channel:e,isSubprocess:n,ipc:r}),Qw.signal),PJ=async({anyProcess:t,channel:e,isSubprocess:n,ipc:r})=>{if(!ix){if(ix=!0,!r){rJ();return}if(e===null){ox();return}Ep(t,e,n),await K0.yield()}};let ix=!1;const NJ=t=>t?.type!==sx?!1:(Qw.abort(t.message),!0),sx="execa:ipc:cancel",ox=()=>{Qw.abort(nJ())},Qw=new AbortController,OJ=({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.")}},FJ=({subprocess:t,cancelSignal:e,gracefulCancel:n,forceKillAfterDelay:r,context:i,controller:s})=>n?[LJ({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:i,controller:s})]:[],LJ=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:r,controller:{signal:i}})=>{await GA(e,i);const s=MJ(e);throw await xJ(t,s),WA({kill:t.kill,forceKillAfterDelay:n,context:r,controllerSignal:i}),r.terminationReason??="gracefulCancel",e.reason},MJ=({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},zJ=({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})`)},BJ=(t,e,n,r)=>e===0||e===void 0?[]:[jJ(t,e,n,r)],jJ=async(t,e,n,{signal:r})=>{throw await H0(e,void 0,{signal:r}),n.terminationReason??="timeout",t.kill(),new Bl},qJ=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},UJ=(t,e,{node:n=!1,nodePath:r=PP,nodeOptions:i=NP.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=bw(r,'The "nodePath" option'),u=Vr.resolve(s,c),l={...a,nodePath:u,node:n,cwd:s};if(!n)return[t,e,l];if(Vr.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}]},WJ=({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`.");KJ[n](t)}},GJ=t=>{try{UP(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},HJ=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},KJ={advanced:GJ,json:HJ},VJ=async(t,e)=>{e!==void 0&&await t.sendMessage(e)},YJ=({encoding:t})=>{if(e0.has(t))return;const e=JJ(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${kp(t)}\`.
1788
- Please rename it to ${kp(e)}.`);const n=[...e0].map(r=>kp(r)).join(", ");throw new TypeError(`Invalid option \`encoding: ${kp(t)}\`.
1789
- Please rename it to one of: ${n}.`)},XJ=new Set(["utf8","utf16le"]),ao=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),e0=new Set([...XJ,...ao]),JJ=t=>{if(t===null)return"buffer";if(typeof t!="string")return;const e=t.toLowerCase();if(e in ax)return ax[e];if(e0.has(e))return e},ax={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},kp=t=>typeof t=="string"?`"${t}"`:String(t),ZJ=(t=cx())=>{const e=bw(t,'The "cwd" option');return Vr.resolve(e)},cx=()=>{try{return ke.cwd()}catch(t){throw t.message=`The current directory does not exist.
1790
- ${t.message}`,t}},QJ=(t,e)=>{if(e===cx())return t;let n;try{n=vP(e)}catch(r){return`The "cwd" option is invalid: ${e}.
1791
- ${r.message}
1792
- ${t}`}return n.isDirectory()?t:`The "cwd" option is not a directory: ${e}.
1793
- ${t}`},ux=(t,e,n)=>{n.cwd=ZJ(n.cwd);const[r,i,s]=UJ(t,e,n),{command:o,args:a,options:c}=vX._parse(r,i,s),u=fY(c),l=eZ(u);return zJ(l),YJ(l),WJ(l),VX(l),OJ(l),l.shell=eA(l.shell),l.env=tZ(l),l.killSignal=OX(l.killSignal),l.forceKillAfterDelay=qX(l.forceKillAfterDelay),l.lines=l.lines.map((d,f)=>d&&!ao.has(l.encoding)&&l.buffer[f]),ke.platform==="win32"&&Vr.basename(o,".exe")==="cmd"&&a.unshift("/q"),{file:o,commandArguments:a,options:l}},eZ=({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:h=f!==void 0||d,serialization:p="advanced",...m})=>({...m,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:h,serialization:p}),tZ=({env:t,extendEnv:e,preferLocal:n,node:r,localDirectory:i,nodePath:s})=>{const o=e?{...ke.env,...t}:t;return n||r?EX({env:o,cwd:i,execPath:s,preferLocal:n,addExecPath:r}):o};function t0(t){if(typeof t=="string")return nZ(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return rZ(t)}const nZ=t=>t.at(-1)===lx?t.slice(0,t.at(-2)===dx?-2:-1):t,rZ=t=>t.at(-1)===iZ?t.subarray(0,t.at(-2)===sZ?-2:-1):t,lx=`
1794
- `,iZ=lx.codePointAt(0),dx="\r",sZ=dx.codePointAt(0);function co(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 fx(t,{checkOpen:e=!0}={}){return co(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 $p(t,{checkOpen:e=!0}={}){return co(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 hx(t,e){return fx(t,e)&&$p(t,e)}const oZ=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);let aZ=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 n0=Symbol();function px(){return this[n0].next()}Object.defineProperty(px,"name",{value:"next"});function gx(t){return this[n0].return(t)}Object.defineProperty(gx,"name",{value:"return"});const cZ=Object.create(oZ,{next:{enumerable:!0,configurable:!0,writable:!0,value:px},return:{enumerable:!0,configurable:!0,writable:!0,value:gx}});function uZ({preventCancel:t=!1}={}){const e=this.getReader(),n=new aZ(e,t),r=Object.create(cZ);return r[n0]=n,r}const lZ=t=>{if($p(t,{checkOpen:!1})&&r0.on!==void 0)return fZ(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(dZ.call(t)==="[object ReadableStream]")return uZ.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:dZ}=Object.prototype,fZ=async function*(t){const e=new AbortController,n={};hZ(t,e,n);try{for await(const[r]of r0.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()}},hZ=async(t,e,n)=>{try{await r0.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(r){n.error=r}finally{e.abort()}},r0={},i0=async(t,{init:e,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:o,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{const u=lZ(t),l=e();l.length=0;try{for await(const d of u){const f=gZ(d),h=n[f](d,l);mx({convertedChunk:h,state:l,getSize:r,truncateChunk:i,addChunk:s,maxBuffer:c})}return pZ({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}},pZ=({state:t,getSize:e,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:s})=>{const o=i(t);o!==void 0&&mx({convertedChunk:o,state:t,getSize:e,truncateChunk:n,addChunk:r,maxBuffer:s})},mx=({convertedChunk:t,state:e,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:s})=>{const o=n(t),a=e.length+o;if(a<=s){yx(t,e,i,a);return}const c=r(t,s-e.length);throw c!==void 0&&yx(c,e,i,s),new Cp},yx=(t,e,n,r)=>{e.contents=n(t,e,r),e.length=r},gZ=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=vx.call(t);return n==="[object ArrayBuffer]"?"arrayBuffer":n==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&vx.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:vx}=Object.prototype;class Cp extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const uo=t=>t,s0=()=>{},wx=({contents:t})=>t,bx=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},Dx=t=>t.length;async function mZ(t,e){return i0(t,bZ,e)}const yZ=()=>({contents:[]}),vZ=()=>1,wZ=(t,{contents:e})=>(e.push(t),e),bZ={init:yZ,convertChunk:{string:uo,buffer:uo,arrayBuffer:uo,dataView:uo,typedArray:uo,others:uo},getSize:vZ,truncateChunk:s0,addChunk:wZ,getFinalChunk:s0,finalize:wx};async function DZ(t,e){return i0(t,AZ,e)}const EZ=()=>({contents:new ArrayBuffer(0)}),TZ=t=>RZ.encode(t),RZ=new TextEncoder,Ex=t=>new Uint8Array(t),Tx=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),SZ=(t,e)=>t.slice(0,e),kZ=(t,{contents:e,length:n},r)=>{const i=kx()?CZ(e,r):$Z(e,r);return new Uint8Array(i).set(t,n),i},$Z=(t,e)=>{if(e<=t.byteLength)return t;const n=new ArrayBuffer(Rx(e));return new Uint8Array(n).set(new Uint8Array(t),0),n},CZ=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;const n=new ArrayBuffer(e,{maxByteLength:Rx(e)});return new Uint8Array(n).set(new Uint8Array(t),0),n},Rx=t=>Sx**Math.ceil(Math.log(t)/Math.log(Sx)),Sx=2,_Z=({contents:t,length:e})=>kx()?t:t.slice(0,e),kx=()=>"resize"in ArrayBuffer.prototype,AZ={init:EZ,convertChunk:{string:TZ,buffer:Ex,arrayBuffer:Ex,dataView:Tx,typedArray:Tx,others:bx},getSize:Dx,truncateChunk:SZ,addChunk:kZ,getFinalChunk:s0,finalize:_Z};async function xZ(t,e){return i0(t,FZ,e)}const IZ=()=>({contents:"",textDecoder:new TextDecoder}),_p=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),PZ=(t,{contents:e})=>e+t,NZ=(t,e)=>t.slice(0,e),OZ=({textDecoder:t})=>{const e=t.decode();return e===""?void 0:e},FZ={init:IZ,convertChunk:{string:uo,buffer:_p,arrayBuffer:_p,dataView:_p,typedArray:_p,others:bx},getSize:Dx,truncateChunk:NZ,addChunk:PZ,getFinalChunk:OZ,finalize:wx},LZ=({error:t,stream:e,readableObjectMode:n,lines:r,encoding:i,fdNumber:s})=>{if(!(t instanceof Cp))throw t;if(s==="all")return t;const o=MZ(n,r,i);throw t.maxBufferInfo={fdNumber:s,unit:o},e.destroy(),t},MZ=(t,e,n)=>t?"objects":e?"lines":n==="buffer"?"bytes":"characters",zZ=(t,e,n)=>{if(e.length!==n)return;const r=new Cp;throw r.maxBufferInfo={fdNumber:"ipc"},r},BZ=(t,e)=>{const{streamName:n,threshold:r,unit:i}=jZ(t,e);return`Command's ${n} was larger than ${r} ${i}`},jZ=(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=Ml(e,n);return n==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:uA(n),threshold:i,unit:r}},qZ=(t,e,n)=>t?.code==="ENOBUFS"&&e!==null&&e.some(r=>r!==null&&r.length>o0(n)),UZ=(t,e,n)=>{if(!e)return t;const r=o0(n);return t.length>r?t.slice(0,r):t},o0=([,t])=>t,WZ=({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:h,killSignal:p,maxBuffer:m,timeout:w,cwd:v})=>{const E=r?.code,S=GZ({originalError:r,timedOut:c,timeout:w,isMaxBuffer:d,maxBuffer:m,errorCode:E,signal:i,signalDescription:s,exitCode:o,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:f,forceKillAfterDelay:h,killSignal:p}),$=KZ(r,v),I=$===void 0?"":`
1795
- ${$}`,N=`${S}: ${a}${I}`,A=e===void 0?[t[2],t[1]]:[e],q=[N,...A,...t.slice(3),n.map(W=>VZ(W)).join(`
1796
- `)].map(W=>Cw(t0(YZ(W)))).filter(Boolean).join(`
1797
-
1798
- `);return{originalMessage:$,shortMessage:N,message:q}},GZ=({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:h})=>{const p=HZ(d,f);return e?`Command timed out after ${n} milliseconds${p}`:l?o===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${p}`:`Command was gracefully canceled with ${o} (${a})`:u?`Command was canceled${p}`:r?`${BZ(t,i)}${p}`:s!==void 0?`Command failed with ${s}${p}`:d?`Command was killed with ${h} (${UA(h)})${p}`:o!==void 0?`Command was killed with ${o} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},HZ=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",KZ=(t,e)=>{if(t instanceof Bl)return;const n=RX(t)?t.originalMessage:String(t?.message??t),r=Cw(QJ(n,e));return r===""?void 0:r},VZ=t=>typeof t=="string"?t:q0(t),YZ=t=>Array.isArray(t)?t.map(e=>t0($x(e))).filter(Boolean).join(`
1799
- `):$x(t),$x=t=>typeof t=="string"?t:yr(t)?iA(t):"",Cx=({command:t,escapedCommand:e,stdio:n,all:r,ipcOutput:i,options:{cwd:s},startTime:o})=>_x({command:t,escapedCommand:e,cwd:s,durationMs:bA(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:[]}),a0=({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:o})=>c0({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}),c0=({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:h,options:{timeoutDuration:p,timeout:m=p,forceKillAfterDelay:w,killSignal:v,cwd:E,maxBuffer:S},isSync:$})=>{const{exitCode:I,signal:N,signalDescription:A}=JZ(u,l),{originalMessage:q,shortMessage:W,message:V}=WZ({stdio:d,all:f,ipcOutput:h,originalError:t,signal:N,signalDescription:A,exitCode:I,escapedCommand:n,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:w,killSignal:v,maxBuffer:S,timeout:m,cwd:E}),x=TX(t,V,$);return Object.assign(x,XZ({error:x,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:I,signal:N,signalDescription:A,stdio:d,all:f,ipcOutput:h,cwd:E,originalMessage:q,shortMessage:W})),x},XZ=({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:h,ipcOutput:p,cwd:m,originalMessage:w,shortMessage:v})=>_x({shortMessage:v,originalMessage:w,command:e,escapedCommand:n,cwd:m,durationMs:bA(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:h,stdio:f,ipcOutput:p,pipedFrom:[]}),_x=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),JZ=(t,e)=>{const n=t===null?void 0:t,r=e===null?void 0:e,i=r===void 0?void 0:UA(e);return{exitCode:n,signal:r,signalDescription:i}},Ax=t=>Number.isFinite(t)?t:0;function ZZ(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(Ax(t*1e3)%1e3),nanoseconds:Math.trunc(Ax(t*1e6)%1e3)}}function QZ(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 eQ(t){switch(typeof t){case"number":{if(Number.isFinite(t))return ZZ(t);break}case"bigint":return QZ(t)}throw new TypeError("Expected a finite number or bigint")}const tQ=t=>t===0||t===0n,nQ=(t,e)=>e===1||e===1n?t:`${t}s`,rQ=1e-7,iQ=24n*60n*60n*1000n;function xx(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+rQ);return(Math.round(f)/10**d).toFixed(d)},o=(l,d,f,h)=>{if(!((i.length===0||!e.colonNotation)&&tQ(l)&&!(e.colonNotation&&f==="m"))){if(h??=String(l),e.colonNotation){const p=h.includes(".")?h.split(".")[0].length:h.length,m=i.length>0?2:1;h="0".repeat(Math.max(0,m-p))+h}else h+=e.verbose?" "+nQ(d,l):f;i.push(h)}},a=eQ(t),c=BigInt(a.days);if(o(c/365n,"year","y"),o(c%365n,"day","d"),o(Number(a.hours),"hour","h"),o(Number(a.minutes),"minute","m"),e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3){const l=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),h=Number(a.nanoseconds);if(o(l,"second","s"),e.formatSubMilliseconds)o(d,"millisecond","ms"),o(f,"microsecond","\xB5s"),o(h,"nanosecond","ns");else{const p=d+f/1e3+h/1e6,m=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,w=p>=1?Math.round(p):Math.ceil(p),v=m?p.toFixed(m):w;o(Number.parseFloat(v),"millisecond","ms",v)}}else{const l=(n?Number(t%iQ):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=s(l,d),h=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");o(Number.parseFloat(h),"second","s",h)}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 sQ=(t,e)=>{t.failed&&zl({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})},oQ=(t,e)=>{Tw(e)&&(sQ(t,e),aQ(t,e))},aQ=(t,e)=>{const n=`(done in ${xx(t.durationMs)})`;zl({type:"duration",verboseMessage:n,verboseInfo:e,result:t})},u0=(t,e,{reject:n})=>{if(oQ(t,e),t.failed&&n)throw t;return t},cQ=(t,e)=>Ea(t)?"asyncGenerator":Fx(t)?"generator":d0(t)?"fileUrl":pQ(t)?"filePath":yQ(t)?"webStream":co(t,{checkOpen:!1})?"native":yr(t)?"uint8Array":vQ(t)?"asyncIterable":wQ(t)?"iterable":h0(t)?Ix({transform:t},e):fQ(t)?uQ(t,e):"native",uQ=(t,e)=>hx(t.transform,{checkOpen:!1})?lQ(t,e):h0(t.transform)?Ix(t,e):dQ(t,e),lQ=(t,e)=>(Px(t,e,"Duplex stream"),"duplex"),Ix=(t,e)=>(Px(t,e,"web TransformStream"),"webTransform"),Px=({final:t,binary:e,objectMode:n},r,i)=>{Nx(t,`${r}.final`,i),Nx(e,`${r}.binary`,i),l0(n,`${r}.objectMode`)},Nx=(t,e,n)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${n}.`)},dQ=({transform:t,final:e,binary:n,objectMode:r},i)=>{if(t!==void 0&&!Ox(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(hx(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(h0(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!Ox(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return l0(n,`${i}.binary`),l0(r,`${i}.objectMode`),Ea(t)||Ea(e)?"asyncGenerator":"generator"},l0=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},Ox=t=>Ea(t)||Fx(t),Ea=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",Fx=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",fQ=t=>Qn(t)&&(t.transform!==void 0||t.final!==void 0),d0=t=>Object.prototype.toString.call(t)==="[object URL]",hQ=t=>d0(t)&&t.protocol!=="file:",pQ=t=>Qn(t)&&Object.keys(t).length===1&&Lx(t.file),Lx=t=>typeof t=="string",gQ=(t,e)=>t==="native"&&typeof e=="string"&&!mQ.has(e),mQ=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Mx=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",f0=t=>Object.prototype.toString.call(t)==="[object WritableStream]",yQ=t=>Mx(t)||f0(t),h0=t=>Mx(t?.readable)&&f0(t?.writable),vQ=t=>zx(t)&&typeof t[Symbol.asyncIterator]=="function",wQ=t=>zx(t)&&typeof t[Symbol.iterator]=="function",zx=t=>typeof t=="object"&&t!==null,lo=new Set(["generator","asyncGenerator","duplex","webTransform"]),Bx=new Set(["fileUrl","filePath","fileNumber"]),jx=new Set(["fileUrl","filePath"]),bQ=new Set([...jx,"webStream","nodeStream"]),DQ=new Set(["webTransform","duplex"]),Ap={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"},qx=(t,e,n,r)=>r==="output"?EQ(t,e,n):TQ(t,e,n),EQ=(t,e,n)=>{const r=e!==0&&n[e-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:t??r}},TQ=(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}},RQ=(t,e)=>{const n=t.findLast(({type:r})=>lo.has(r));return n===void 0?!1:e==="input"?n.value.writableObjectMode:n.value.readableObjectMode},SQ=(t,e,n,r)=>[...t.filter(({type:i})=>!lo.has(i)),...kQ(t,e,n,r)],kQ=(t,e,n,{encoding:r})=>{const i=t.filter(({type:o})=>lo.has(o)),s=Array.from({length:i.length});for(const[o,a]of Object.entries(i))s[o]=$Q({stdioItem:a,index:Number(o),newTransforms:s,optionName:e,direction:n,encoding:r});return xQ(s,n)},$Q=({stdioItem:t,stdioItem:{type:e},index:n,newTransforms:r,optionName:i,direction:s,encoding:o})=>e==="duplex"?CQ({stdioItem:t,optionName:i}):e==="webTransform"?_Q({stdioItem:t,index:n,newTransforms:r,direction:s}):AQ({stdioItem:t,index:n,newTransforms:r,direction:s,encoding:o}),CQ=({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}}},_Q=({stdioItem:t,stdioItem:{value:e},index:n,newTransforms:r,direction:i})=>{const{transform:s,objectMode:o}=Qn(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=qx(o,n,r,i);return{...t,value:{transform:s,writableObjectMode:a,readableObjectMode:c}}},AQ=({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}=Qn(e)?e:{transform:e},d=c||ao.has(s),{writableObjectMode:f,readableObjectMode:h}=qx(l,n,r,i);return{...t,value:{transform:o,final:a,binary:d,preserveNewlines:u,writableObjectMode:f,readableObjectMode:h}}},xQ=(t,e)=>e==="input"?t.reverse():t,IQ=(t,e,n)=>{const r=t.map(i=>PQ(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)??FQ},PQ=({type:t,value:e},n)=>NQ[n]??Ux[t](e),NQ=["input","output","output"],Ta=()=>{},p0=()=>"input",Ux={generator:Ta,asyncGenerator:Ta,fileUrl:Ta,filePath:Ta,iterable:p0,asyncIterable:p0,uint8Array:p0,webStream:t=>f0(t)?"output":"input",nodeStream(t){return $p(t,{checkOpen:!1})?fx(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Ta,duplex:Ta,native(t){const e=OQ(t);if(e!==void 0)return e;if(co(t,{checkOpen:!1}))return Ux.nodeStream(t)}},OQ=t=>{if([0,ke.stdin].includes(t))return"input";if([1,2,ke.stdout,ke.stderr].includes(t))return"output"},FQ="output",LQ=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t,MQ=({stdio:t,ipc:e,buffer:n,...r},i,s)=>{const o=zQ(t,r).map((a,c)=>Wx(a,c));return s?jQ(o,n,i):LQ(o,e)},zQ=(t,e)=>{if(t===void 0)return Wr.map(r=>e[r]);if(BQ(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Wr.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,Wr.length);return Array.from({length:n},(r,i)=>t[i])},BQ=t=>Wr.some(e=>t[e]!==void 0),Wx=(t,e)=>Array.isArray(t)?t.map(n=>Wx(n,e)):t??(e>=Wr.length?"ignore":"pipe"),jQ=(t,e,n)=>t.map((r,i)=>!e[i]&&i!==0&&!Rw(n,i)&&qQ(r)?"ignore":r),qQ=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe"),UQ=({stdioItem:t,stdioItem:{type:e},isStdioArray:n,fdNumber:r,direction:i,isSync:s})=>!n||e!=="native"?t:s?WQ({stdioItem:t,fdNumber:r,direction:i}):KQ({stdioItem:t,fdNumber:r}),WQ=({stdioItem:t,stdioItem:{value:e,optionName:n},fdNumber:r,direction:i})=>{const s=GQ({value:e,optionName:n,fdNumber:r,direction:i});if(s!==void 0)return s;if(co(e,{checkOpen:!1}))throw new TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},GQ=({value:t,optionName:e,fdNumber:n,direction:r})=>{const i=HQ(t,n);if(i!==void 0){if(r==="output")return{type:"fileNumber",value:i,optionName:e};if(U0.isatty(i))throw new TypeError(`The \`${e}: ${Vw(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Ll(Bp(i)),optionName:e}}},HQ=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;const n=Ew.indexOf(t);if(n!==-1)return n},KQ=({stdioItem:t,stdioItem:{value:e,optionName:n},fdNumber:r})=>e==="inherit"?{type:"nodeStream",value:Gx(r,e,n),optionName:n}:typeof e=="number"?{type:"nodeStream",value:Gx(e,e,n),optionName:n}:co(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:n}:t,Gx=(t,e,n)=>{const r=Ew[t];if(r===void 0)throw new TypeError(`The \`${n}: ${e}\` option is invalid: no such standard stream.`);return r},VQ=({input:t,inputFile:e},n)=>n===0?[...YQ(t),...JQ(e)]:[],YQ=t=>t===void 0?[]:[{type:XQ(t),value:t,optionName:"input"}],XQ=t=>{if($p(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(yr(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},JQ=t=>t===void 0?[]:[{...ZQ(t),optionName:"inputFile"}],ZQ=t=>{if(d0(t))return{type:"fileUrl",value:t};if(Lx(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")},QQ=t=>t.filter((e,n)=>t.every((r,i)=>e.value!==r.value||n>=i||e.type==="generator"||e.type==="asyncGenerator")),eee=({stdioItem:{type:t,value:e,optionName:n},direction:r,fileDescriptors:i,isSync:s})=>{const o=tee(i,t);if(o.length!==0){if(s){nee({otherStdioItems:o,type:t,value:e,optionName:n,direction:r});return}if(bQ.has(t))return Hx({otherStdioItems:o,type:t,value:e,optionName:n,direction:r});DQ.has(t)&&iee({otherStdioItems:o,type:t,value:e,optionName:n})}},tee=(t,e)=>t.flatMap(({direction:n,stdioItems:r})=>r.filter(i=>i.type===e).map(i=>({...i,direction:n}))),nee=({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})=>{jx.has(e)&&Hx({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})},Hx=({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})=>{const s=t.filter(a=>ree(a,n));if(s.length===0)return;const o=s.find(a=>a.direction!==i);return Kx(o,r,e),i==="output"?s[0].stream:void 0},ree=({type:t,value:e},n)=>t==="filePath"?e.file===n.file:t==="fileUrl"?e.href===n.href:e===n,iee=({otherStdioItems:t,type:e,value:n,optionName:r})=>{const i=t.find(({value:{transform:s}})=>s===n.transform);Kx(i,r,e)},Kx=(t,e,n)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${Ap[n]} that is the same.`)},Vx=(t,e,n,r)=>{const s=MQ(e,n,r).map((a,c)=>see({stdioOption:a,fdNumber:c,options:e,isSync:r})),o=hee({initialFileDescriptors:s,addProperties:t,options:e,isSync:r});return e.stdio=o.map(({stdioItems:a})=>mee(a)),o},see=({stdioOption:t,fdNumber:e,options:n,isSync:r})=>{const i=uA(e),{stdioItems:s,isStdioArray:o}=oee({stdioOption:t,fdNumber:e,options:n,optionName:i}),a=IQ(s,e,i),c=s.map(d=>UQ({stdioItem:d,isStdioArray:o,fdNumber:e,direction:a,isSync:r})),u=SQ(c,i,a,n),l=RQ(u,a);return fee(u,l),{direction:a,objectMode:l,stdioItems:u}},oee=({stdioOption:t,fdNumber:e,options:n,optionName:r})=>{const s=[...(Array.isArray(t)?t:[t]).map(c=>aee(c,r)),...VQ(n,e)],o=QQ(s),a=o.length>1;return cee(o,a,r),lee(o),{stdioItems:o,isStdioArray:a}},aee=(t,e)=>({type:cQ(t,e),value:t,optionName:e}),cee=(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(uee.has(r))throw new Error(`The \`${i}\` option must not include \`${r}\`.`)}},uee=new Set(["ignore","ipc"]),lee=t=>{for(const e of t)dee(e)},dee=({type:t,value:e,optionName:n})=>{if(hQ(e))throw new TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
1800
- For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(gQ(t,e))throw new TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},fee=(t,e)=>{if(!e)return;const n=t.find(({type:r})=>Bx.has(r));if(n!==void 0)throw new TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},hee=({initialFileDescriptors:t,addProperties:e,options:n,isSync:r})=>{const i=[];try{for(const s of t)i.push(pee({fileDescriptor:s,fileDescriptors:i,addProperties:e,options:n,isSync:r}));return i}catch(s){throw Yx(i),s}},pee=({fileDescriptor:{direction:t,objectMode:e,stdioItems:n},fileDescriptors:r,addProperties:i,options:s,isSync:o})=>{const a=n.map(c=>gee({stdioItem:c,addProperties:i,direction:t,options:s,fileDescriptors:r,isSync:o}));return{direction:t,objectMode:e,stdioItems:a}},gee=({stdioItem:t,addProperties:e,direction:n,options:r,fileDescriptors:i,isSync:s})=>{const o=eee({stdioItem:t,direction:n,fileDescriptors:i,isSync:s});return o!==void 0?{...t,stream:o}:{...t,...e[n][t.type](t,r)}},Yx=t=>{for(const{stdioItems:e}of t)for(const{stream:n}of e)n!==void 0&&!io(n)&&n.destroy()},mee=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"},yee=(t,e)=>Vx(wee,t,e,!0),Gr=({type:t,optionName:e})=>{Xx(e,Ap[t])},vee=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&Xx(t,`"${e}"`),{}),Xx=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},Jx={generator(){},asyncGenerator:Gr,webStream:Gr,nodeStream:Gr,webTransform:Gr,duplex:Gr,asyncIterable:Gr,native:vee},wee={input:{...Jx,fileUrl:({value:t})=>({contents:[Ll(Bp(t))]}),filePath:({value:{file:t}})=>({contents:[Ll(Bp(t))]}),fileNumber:Gr,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...Jx,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t}})=>({path:t}),fileNumber:({value:t})=>({path:t}),iterable:Gr,string:Gr,uint8Array:Gr}},Ra=(t,{stripFinalNewline:e},n)=>Zx(e,n)&&t!==void 0&&!Array.isArray(t)?t0(t):t,Zx=(t,e)=>e==="all"?t[1]||t[2]:t[e],Qx=(t,e,n,r)=>t||n?void 0:nI(e,r),eI=(t,e,n)=>n?t.flatMap(r=>tI(r,e)):tI(t,e),tI=(t,e)=>{const{transform:n,final:r}=nI(e,{});return[...n(t),...r()]},nI=(t,e)=>(e.previousChunks="",{transform:bee.bind(void 0,e,t),final:Eee.bind(void 0,e)}),bee=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]===`
1801
- `){const o=Dee(n,s,e,t);let a=n.slice(i+1,s+1-o);r.length>0&&(a=g0(r,a),r=""),yield a,i=s}i!==n.length-1&&(r=g0(r,n.slice(i+1))),t.previousChunks=r},Dee=(t,e,n,r)=>n?0:(r.isWindowsNewline=e!==0&&t[e-1]==="\r",r.isWindowsNewline?2:1),Eee=function*({previousChunks:t}){t.length>0&&(yield t)},Tee=({binary:t,preserveNewlines:e,readableObjectMode:n,state:r})=>t||e||n?void 0:{transform:Ree.bind(void 0,r)},Ree=function*({isWindowsNewline:t=!1},e){const{unixNewline:n,windowsNewline:r,LF:i,concatBytes:s}=typeof e=="string"?See:$ee;if(e.at(-1)===i){yield e;return}yield s(e,t?r:n)},g0=(t,e)=>`${t}${e}`,See={windowsNewline:`\r
1802
- `,unixNewline:`
1803
- `,LF:`
1804
- `,concatBytes:g0},kee=(t,e)=>{const n=new Uint8Array(t.length+e.length);return n.set(t,0),n.set(e,t.length),n},$ee={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:kee},Cee=(t,e)=>t?void 0:_ee.bind(void 0,e),_ee=function*(t,e){if(typeof e!="string"&&!yr(e)&&!Hp.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},Aee=(t,e)=>t?xee.bind(void 0,e):Iee.bind(void 0,e),xee=function*(t,e){rI(t,e),yield e},Iee=function*(t,e){if(rI(t,e),typeof e!="string"&&!yr(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},rI=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
1805
- Instead, \`yield\` should either be called with a value, or not be called at all. For example:
1806
- if (condition) { yield value; }`)},iI=(t,e,n)=>{if(n)return;if(t)return{transform:Pee.bind(void 0,new TextEncoder)};const r=new G0(e);return{transform:Nee.bind(void 0,r),final:Oee.bind(void 0,r)}},Pee=function*(t,e){Hp.isBuffer(e)?yield Ll(e):typeof e=="string"?yield t.encode(e):yield e},Nee=function*(t,e){yield yr(e)?t.write(e):e},Oee=function*(t){const e=t.end();e!==""&&(yield e)},sI=mo(async(t,e,n,r)=>{e.currentIterable=t(...n);try{for await(const i of e.currentIterable)r.push(i)}finally{delete e.currentIterable}}),m0=async function*(t,e,n){if(n===e.length){yield t;return}const{transform:r=zee}=e[n];for await(const i of r(t))yield*m0(i,e,n+1)},Fee=async function*(t){for(const[e,{final:n}]of Object.entries(t))yield*Lee(n,Number(e),t)},Lee=async function*(t,e,n){if(t!==void 0)for await(const r of t())yield*m0(r,n,e+1)},Mee=mo(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),zee=function*(t){yield t},oI=(t,e,n,r)=>{try{for(const i of t(...e))n.push(i);r()}catch(i){r(i)}},Bee=(t,e)=>[...e.flatMap(n=>[...Wl(n,t,0)]),...y0(t)],Wl=function*(t,e,n){if(n===e.length){yield t;return}const{transform:r=qee}=e[n];for(const i of r(t))yield*Wl(i,e,n+1)},y0=function*(t){for(const[e,{final:n}]of Object.entries(t))yield*jee(n,Number(e),t)},jee=function*(t,e,n){if(t!==void 0)for(const r of t())yield*Wl(r,n,e+1)},qee=function*(t){yield t},aI=({value:t,value:{transform:e,final:n,writableObjectMode:r,readableObjectMode:i},optionName:s},{encoding:o})=>{const a={},c=uI(t,o,s),u=Ea(e),l=Ea(n),d=u?sI.bind(void 0,m0,a):oI.bind(void 0,Wl),f=u||l?sI.bind(void 0,Fee,a):oI.bind(void 0,y0),h=u||l?Mee.bind(void 0,a):void 0;return{stream:new WP({writableObjectMode:r,writableHighWaterMark:Zl(r),readableObjectMode:i,readableHighWaterMark:Zl(i),transform(m,w,v){d([m,c,0],this,v)},flush(m){f([c],this,m)},destroy:h})}},cI=(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=uI(o,n,a);t=Bee(c,t)}return t},uI=({transform:t,final:e,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:s},o,a)=>{const c={};return[{transform:Cee(r,a)},iI(n,o,r),Qx(n,s,r,c),{transform:t,final:e},{transform:Aee(i,a)},Tee({binary:n,preserveNewlines:s,readableObjectMode:i,state:c})].filter(Boolean)},Uee=(t,e)=>{for(const n of Wee(t))Gee(t,n,e)},Wee=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),Gee=(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 ${Ap[a]} with synchronous methods.`)}const o=i.map(({contents:a})=>a).map(a=>Hee(a,r));n.input=Dw(o)},Hee=(t,e)=>{const n=cI(t,e,"utf8",!0);return Kee(n),Dw(n)},Kee=t=>{const e=t.find(n=>typeof n!="string"&&!yr(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}.`)},lI=({stdioItems:t,encoding:e,verboseInfo:n,fdNumber:r})=>r!=="all"&&Rw(n,r)&&!ao.has(e)&&Vee(r)&&(t.some(({type:i,value:s})=>i==="native"&&Yee.has(s))||t.every(({type:i})=>lo.has(i))),Vee=t=>t===1||t===2,Yee=new Set(["pipe","overlapped"]),Xee=async(t,e,n,r)=>{for await(const i of t)Zee(e)||dI(i,n,r)},Jee=(t,e,n)=>{for(const r of t)dI(r,e,n)},Zee=t=>t._readableState.pipes.length>0,dI=(t,e,n)=>{const r=vA(t);zl({type:"output",verboseMessage:r,fdNumber:e,verboseInfo:n})},Qee=({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)=>ete({result:c,fileDescriptors:t,fdNumber:u,state:s,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n)),...s}},ete=({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=UZ(t,s,d),h=Ll(f),{stdioItems:p,objectMode:m}=e[n],w=tte([h],p,c,r),{serializedResult:v,finalResult:E=v}=nte({chunks:w,objectMode:m,encoding:c,lines:u,stripFinalNewline:l,fdNumber:n});rte({serializedResult:v,fdNumber:n,state:r,verboseInfo:o,encoding:c,stdioItems:p,objectMode:m});const S=a[n]?E:void 0;try{return r.error===void 0&&ite(v,p,i),S}catch($){return r.error=$,S}},tte=(t,e,n,r)=>{try{return cI(t,e,n,!1)}catch(i){return r.error=i,t}},nte=({chunks:t,objectMode:e,encoding:n,lines:r,stripFinalNewline:i,fdNumber:s})=>{if(e)return{serializedResult:t};if(n==="buffer")return{serializedResult:Dw(t)};const o=nY(t,n);return r[s]?{serializedResult:o,finalResult:eI(o,!i[s],e)}:{serializedResult:o}},rte=({serializedResult:t,fdNumber:e,state:n,verboseInfo:r,encoding:i,stdioItems:s,objectMode:o})=>{if(!lI({stdioItems:s,encoding:i,verboseInfo:r,fdNumber:e}))return;const a=eI(t,!1,o);try{Jee(a,e,r)}catch(c){n.error??=c}},ite=(t,e,n)=>{for(const{path:r}of e.filter(({type:i})=>Bx.has(i))){const i=typeof r=="string"?r:r.toString();n.has(i)?wP(r,t):(n.add(i),z0(r,t))}},ste=([,t,e],n)=>{if(n.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,Ra(e,n,"all")]:Array.isArray(e)?[Ra(t,n,"all"),...e]:yr(t)&&yr(e)?sA([t,e]):`${t}${e}`},ote=async(t,e)=>{const[n,r]=await ate(t);return e.isForcefullyTerminated??=!1,[n,r]},ate=async t=>{const[e,n]=await Promise.allSettled([mn(t,"spawn"),mn(t,"exit")]);return e.status==="rejected"?[]:n.status==="rejected"?fI(t):n.value},fI=async t=>{try{return await mn(t,"exit")}catch{return fI(t)}},cte=async t=>{const[e,n]=await t;if(!ute(e,n)&&hI(e,n))throw new Bl;return[e,n]},ute=(t,e)=>t===void 0&&e===void 0,hI=(t,e)=>t!==0||e!==null,lte=({error:t,status:e,signal:n,output:r},{maxBuffer:i})=>{const s=dte(t,e,n),o=s?.code==="ETIMEDOUT",a=qZ(s,r,i);return{resultError:s,exitCode:e,signal:n,timedOut:o,isMaxBuffer:a}},dte=(t,e,n)=>t!==void 0?t:hI(e,n)?new Bl:void 0,fte=(t,e,n)=>{const{file:r,commandArguments:i,command:s,escapedCommand:o,startTime:a,verboseInfo:c,options:u,fileDescriptors:l}=hte(t,e,n),d=mte({file:r,commandArguments:i,options:u,command:s,escapedCommand:o,verboseInfo:c,fileDescriptors:l,startTime:a});return u0(d,c,u)},hte=(t,e,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:o}=DA(t,e,n),a=pte(n),{file:c,commandArguments:u,options:l}=ux(t,e,a);gte(l);const d=yee(l,o);return{file:c,commandArguments:u,command:r,escapedCommand:i,startTime:s,verboseInfo:o,options:l,fileDescriptors:d}},pte=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,gte=({ipc:t,ipcInput:e,detached:n,cancelSignal:r})=>{e&&xp("ipcInput"),t&&xp("ipc: true"),n&&xp("detached: true"),r&&xp("cancelSignal")},xp=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},mte=({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,verboseInfo:s,fileDescriptors:o,startTime:a})=>{const c=yte({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:h}=lte(c,n),{output:p,error:m=u}=Qee({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:h,verboseInfo:s}),w=p.map((E,S)=>Ra(E,n,S)),v=Ra(ste(p,n),n,"all");return wte({error:m,exitCode:l,signal:d,timedOut:f,isMaxBuffer:h,stdio:w,all:v,options:n,command:r,escapedCommand:i,startTime:a})},yte=({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,fileDescriptors:s,startTime:o})=>{try{Uee(s,n);const a=vte(n);return OP(t,e,a)}catch(a){return a0({error:a,command:r,escapedCommand:i,fileDescriptors:s,options:n,startTime:o,isSync:!0})}},vte=({encoding:t,maxBuffer:e,...n})=>({...n,encoding:"buffer",maxBuffer:o0(e)}),wte=({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?Cx({command:c,escapedCommand:u,stdio:s,all:o,ipcOutput:[],options:a,startTime:l}):c0({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}),bte=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},{reference:i=!0,filter:s}={})=>(Gw({methodName:"getOneMessage",isSubprocess:n,ipc:r,isConnected:ex(t)}),Dte({anyProcess:t,channel:e,isSubprocess:n,filter:s,reference:i})),Dte=async({anyProcess:t,channel:e,isSubprocess:n,filter:r,reference:i})=>{ZA(e,i);const s=Ep(t,e,n),o=new AbortController;try{return await Promise.race([Ete(s,r,o),Tte(s,n,o),Rte(s,n,o)])}catch(a){throw Hw(t),a}finally{o.abort(),QA(e,i)}},Ete=async(t,e,{signal:n})=>{if(e===void 0){const[r]=await mn(t,"message",{signal:n});return r}for await(const[r]of Jl(t,"message",{signal:n}))if(e(r))return r},Tte=async(t,e,{signal:n})=>{await mn(t,"disconnect",{signal:n}),ZX(e)},Rte=async(t,e,{signal:n})=>{const[r]=await mn(t,"strict:error",{signal:n});throw KA(r,e)},Ste=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},{reference:i=!0}={})=>pI({anyProcess:t,channel:e,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),pI=({anyProcess:t,channel:e,isSubprocess:n,ipc:r,shouldAwait:i,reference:s})=>{Gw({methodName:"getEachMessage",isSubprocess:n,ipc:r,isConnected:ex(t)}),ZA(e,s);const o=Ep(t,e,n),a=new AbortController,c={};return kte(t,o,a),$te({ipcEmitter:o,isSubprocess:n,controller:a,state:c}),Cte({anyProcess:t,channel:e,ipcEmitter:o,isSubprocess:n,shouldAwait:i,controller:a,state:c,reference:s})},kte=async(t,e,n)=>{try{await mn(e,"disconnect",{signal:n.signal}),n.abort()}catch{}},$te=async({ipcEmitter:t,isSubprocess:e,controller:n,state:r})=>{try{const[i]=await mn(t,"strict:error",{signal:n.signal});r.error=KA(i,e),n.abort()}catch{}},Cte=async function*({anyProcess:t,channel:e,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:s,state:o,reference:a}){try{for await(const[c]of Jl(n,"message",{signal:s.signal}))gI(o),yield c}catch{gI(o)}finally{s.abort(),QA(e,a),r||Hw(t),i&&await t}},gI=({error:t})=>{if(t)throw t},_te=(t,{ipc:e})=>{Object.assign(t,mI(t,!1,e))},Ate=()=>{const t=ke,e=!0,n=ke.channel!==void 0;return{...mI(t,e,n),getCancelSignal:IJ.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n})}},mI=(t,e,n)=>({sendMessage:nx.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n}),getOneMessage:bte.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n}),getEachMessage:Ste.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n})}),xte=({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,verboseInfo:o})=>{Yx(r);const a=new W0;Ite(a,r),Object.assign(a,{readable:Pte,writable:Nte,duplex:Ote});const c=a0({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:!1}),u=Fte(c,o,i);return{subprocess:a,promise:u}},Ite=(t,e)=>{const n=Gl(),r=Gl(),i=Gl(),s=Array.from({length:e.length-3},Gl),o=Gl(),a=[n,r,i,...s];Object.assign(t,{stdin:n,stdout:r,stderr:i,all:o,stdio:a})},Gl=()=>{const t=new Y0;return t.end(),t},Pte=()=>new gs({read(){}}),Nte=()=>new Wp({write(){}}),Ote=()=>new Gp({read(){},write(){}}),Fte=async(t,e,n)=>u0(t,e,n),Lte=(t,e)=>Vx(Mte,t,e,!1),Hl=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${Ap[t]}.`)},yI={fileNumber:Hl,generator:aI,asyncGenerator:aI,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:n}}){const r=e||n;return{stream:Gp.fromWeb(t,{objectMode:r})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},Mte={input:{...yI,fileUrl:({value:t})=>({stream:B0(t)}),filePath:({value:{file:t}})=>({stream:B0(t)}),webStream:({value:t})=>({stream:gs.fromWeb(t)}),iterable:({value:t})=>({stream:gs.from(t)}),asyncIterable:({value:t})=>({stream:gs.from(t)}),string:({value:t})=>({stream:gs.from(t)}),uint8Array:({value:t})=>({stream:gs.from(Hp.from(t))})},output:{...yI,fileUrl:({value:t})=>({stream:j0(t)}),filePath:({value:{file:t}})=>({stream:j0(t)}),webStream:({value:t})=>({stream:Wp.fromWeb(t)}),iterable:Hl,asyncIterable:Hl,string:Hl,uint8Array:Hl}};function v0(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(const i of t)w0(i);const e=t.some(({readableObjectMode:i})=>i),n=zte(t,e),r=new Bte({objectMode:e,writableHighWaterMark:n,readableHighWaterMark:n});for(const i of t)r.add(i);return r}const zte=(t,e)=>{if(t.length===0)return Zl(e);const n=t.filter(({readableObjectMode:r})=>r===e).map(({readableHighWaterMark:r})=>r);return Math.max(...n)};class Bte extends Y0{#e=new Set([]);#t=new Set([]);#n=new Set([]);#r;#s=Symbol("unpipe");#i=new WeakMap;add(e){if(w0(e),this.#e.has(e))return;this.#e.add(e),this.#r??=jte(this,this.#e,this.#s);const n=Wte({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(w0(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 jte=async(t,e,n)=>{Ip(t,DI);const r=new AbortController;try{await Promise.race([qte(t,r),Ute(t,e,n,r)])}finally{r.abort(),Ip(t,-DI)}},qte=async(t,{signal:e})=>{try{await $i(t,{signal:e,cleanup:!0})}catch(n){throw vI(t,n),n}},Ute=async(t,e,n,{signal:r})=>{for await(const[i]of Jl(t,"unpipe",{signal:r}))e.has(i)&&i.emit(n)},w0=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},Wte=async({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,onFinished:s,unpipeEvent:o})=>{Ip(t,EI);const a=new AbortController;try{await Promise.race([Gte(s,e,a),Hte({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,controller:a}),Kte({stream:e,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:a})])}finally{a.abort(),Ip(t,-EI)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?b0(t):Vte(t))},Gte=async(t,e,{signal:n})=>{try{await t,n.aborted||b0(e)}catch(r){n.aborted||vI(e,r)}},Hte=async({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,controller:{signal:s}})=>{try{await $i(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),n.has(e)&&r.add(e)}catch(o){if(s.aborted||!n.has(e))return;wI(o)?i.add(e):bI(t,o)}},Kte=async({stream:t,streams:e,ended:n,aborted:r,unpipeEvent:i,controller:{signal:s}})=>{if(await mn(t,i,{signal:s}),!t.readable)return mn(s,"abort",{signal:s});e.delete(t),n.delete(t),r.delete(t)},Vte=t=>{t.writable&&t.end()},vI=(t,e)=>{wI(e)?b0(t):bI(t,e)},wI=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",b0=t=>{(t.readable||t.writable)&&t.destroy()},bI=(t,e)=>{t.destroyed||(t.once("error",Yte),t.destroy(e))},Yte=()=>{},Ip=(t,e)=>{const n=t.getMaxListeners();n!==0&&n!==Number.POSITIVE_INFINITY&&t.setMaxListeners(n+e)},DI=2,EI=1,Pp=(t,e)=>{t.pipe(e),Xte(t,e),Jte(t,e)},Xte=async(t,e)=>{if(!(io(t)||io(e))){try{await $i(t,{cleanup:!0,readable:!0,writable:!1})}catch{}TI(e)}},TI=t=>{t.writable&&t.end()},Jte=async(t,e)=>{if(!(io(t)||io(e))){try{await $i(e,{cleanup:!0,readable:!1,writable:!0})}catch{}RI(t)}},RI=t=>{t.readable&&t.destroy()},Zte=(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})=>lo.has(c)))Qte(t,a,o,i);for(const{stream:a}of s.filter(({type:c})=>!lo.has(c)))tne({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]:v0(s);Pp(o,i)}},Qte=(t,e,n,r)=>{n==="output"?Pp(t.stdio[r],e):Pp(e,t.stdio[r]);const i=ene[r];i!==void 0&&(t[i]=e),t.stdio[r]=e},ene=["stdin","stdout","stderr"],tne=({subprocess:t,stream:e,direction:n,fdNumber:r,pipeGroups:i,controller:s})=>{if(e===void 0)return;nne(e,s);const[o,a]=n==="output"?[e,t.stdio[r]]:[t.stdio[r],e],c=i.get(o)??[];i.set(o,[...c,a])},nne=(t,{signal:e})=>{io(t)&&bp(t,rne,e)},rne=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 Np=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",D0=Symbol.for("signal-exit emitter"),E0=globalThis,ine=Object.defineProperty.bind(Object);class sne{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(E0[D0])return E0[D0];ine(E0,D0,{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 SI{}const one=t=>({onExit(e,n){return t.onExit(e,n)},load(){return t.load()},unload(){return t.unload()}});class ane extends SI{onExit(){return()=>{}}load(){}unload(){}}class cne extends SI{#e=T0.platform==="win32"?"SIGINT":"SIGHUP";#t=new sne;#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(!Np(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 Np(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"&&Np(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 T0=globalThis.process,{onExit:une,load:Jie,unload:Zie}=one(Np(T0)?new cne(T0):new ane),lne=(t,{cleanup:e,detached:n},{signal:r})=>{if(!e||n)return;const i=une(()=>{t.kill()});V0(r,()=>{i()})},dne=({source:t,sourcePromise:e,boundOptions:n,createNested:r},...i)=>{const s=wA(),{destination:o,destinationStream:a,destinationError:c,from:u,unpipeSignal:l}=fne(n,r,i),{sourceStream:d,sourceError:f}=pne(t,u),{options:h,fileDescriptors:p}=oo.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:h,sourceError:f,destination:o,destinationStream:a,destinationError:c,unpipeSignal:l,fileDescriptors:p,startTime:s}},fne=(t,e,n)=>{try{const{destination:r,pipeOptions:{from:i,to:s,unpipeSignal:o}={}}=hne(t,e,...n),a=VA(r,s);return{destination:r,destinationStream:a,from:i,unpipeSignal:o}}catch(r){return{destinationError:r}}},hne=(t,e,n,...r)=>{if(Array.isArray(n))return{destination:e(kI,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]=tA(n,...r);return{destination:e(kI)(i,s,o),pipeOptions:o}}if(oo.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}`)},kI=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),pne=(t,e)=>{try{return{sourceStream:Kw(t,e)}}catch(n){return{sourceError:n}}},gne=({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:s,startTime:o})=>{const a=mne({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r});if(a!==void 0)throw $I({error:a,fileDescriptors:i,sourceOptions:s,startTime:o})},mne=({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r})=>{if(e!==void 0&&r!==void 0)return r;if(r!==void 0)return RI(t),r;if(e!==void 0)return TI(n),e},$I=({error:t,fileDescriptors:e,sourceOptions:n,startTime:r})=>a0({error:t,command:CI,escapedCommand:CI,fileDescriptors:e,options:n,startTime:r,isSync:!1}),CI="source.pipe(destination)",yne=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},vne=(t,e,n)=>{const r=Op.has(e)?bne(t,e):wne(t,e);return bp(t,Ene,n.signal),bp(e,Tne,n.signal),Dne(e),r},wne=(t,e)=>{const n=v0([t]);return Pp(n,e),Op.set(e,n),n},bne=(t,e)=>{const n=Op.get(e);return n.add(t),n},Dne=async t=>{try{await $i(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Op.delete(t)},Op=new WeakMap,Ene=2,Tne=1,Rne=(t,e)=>t===void 0?[]:[Sne(t,e)],Sne=async(t,{sourceStream:e,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:s})=>{await xP(t,e),await n.remove(e);const o=new Error("Pipe canceled by `unpipeSignal` option.");throw $I({error:o,fileDescriptors:r,sourceOptions:i,startTime:s})},R0=(t,...e)=>{if(Qn(e[0]))return R0.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});const{destination:n,...r}=dne(t,...e),i=kne({...r,destination:n});return i.pipe=R0.bind(void 0,{...t,source:n,sourcePromise:i,boundOptions:{}}),i},kne=async({sourcePromise:t,sourceStream:e,sourceOptions:n,sourceError:r,destination:i,destinationStream:s,destinationError:o,unpipeSignal:a,fileDescriptors:c,startTime:u})=>{const l=$ne(t,i);gne({sourceStream:e,sourceError:r,destinationStream:s,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:u});const d=new AbortController;try{const f=vne(e,s,d);return await Promise.race([yne(l),...Rne(a,{sourceStream:e,mergedStream:f,sourceOptions:n,fileDescriptors:c,startTime:u})])}finally{d.abort()}},$ne=(t,e)=>Promise.allSettled([t,e]),_I=({subprocessStdout:t,subprocess:e,binary:n,shouldEncode:r,encoding:i,preserveNewlines:s})=>{const o=new AbortController;return Cne(e,o),xI({stream:t,controller:o,binary:n,shouldEncode:!t.readableObjectMode&&r,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},Cne=async(t,e)=>{try{await t}catch{}finally{e.abort()}},AI=({stream:t,onStreamEnd:e,lines:n,encoding:r,stripFinalNewline:i,allMixed:s})=>{const o=new AbortController;_ne(e,o,t);const a=t.readableObjectMode&&!s;return xI({stream:t,controller:o,binary:r==="buffer",shouldEncode:!a,encoding:r,shouldSplit:!a&&n,preserveNewlines:!i})},_ne=async(t,e,n)=>{try{await t}catch{n.destroy()}finally{e.abort()}},xI=({stream:t,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o})=>{const a=Jl(t,"data",{signal:e.signal,highWaterMark:PI,highWatermark:PI});return Ane({onStdoutChunk:a,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o})},II=Zl(!0),PI=II,Ane=async function*({onStdoutChunk:t,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o}){const a=xne({binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o});try{for await(const[c]of t)yield*Wl(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*y0(a)}},xne=({binary:t,shouldEncode:e,encoding:n,shouldSplit:r,preserveNewlines:i})=>[iI(t,n,!e),Qx(t,i,!r,{})].filter(Boolean),Ine=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=Pne({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,allMixed:a,verboseInfo:u,streamInfo:l});if(!i){await Promise.all([Nne(t),d]);return}const f=Zx(c,n),h=AI({stream:t,onStreamEnd:e,lines:o,encoding:r,stripFinalNewline:f,allMixed:a}),[p]=await Promise.all([One({stream:t,iterable:h,fdNumber:n,encoding:r,maxBuffer:s,lines:o}),d]);return p},Pne=async({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,allMixed:i,verboseInfo:s,streamInfo:{fileDescriptors:o}})=>{if(!lI({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:s,fdNumber:n}))return;const a=AI({stream:t,onStreamEnd:e,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i});await Xee(a,t,n,s)},Nne=async t=>{await BP(),t.readableFlowing===null&&t.resume()},One=async({stream:t,stream:{readableObjectMode:e},iterable:n,fdNumber:r,encoding:i,maxBuffer:s,lines:o})=>{try{return e||o?await mZ(n,{maxBuffer:s}):i==="buffer"?new Uint8Array(await DZ(n,{maxBuffer:s})):await xZ(n,{maxBuffer:s})}catch(a){return OI(LZ({error:a,stream:t,readableObjectMode:e,lines:o,encoding:i,fdNumber:r}))}},NI=async t=>{try{return await t}catch(e){return OI(e)}},OI=({bufferedData:t})=>QV(t)?new Uint8Array(t):t,S0=async(t,e,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{const s=Fne(t,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],$i(t,{cleanup:!0,signal:o.signal})])}catch(a){s.stdinCleanedUp||zne(a,e,n,r)}finally{o.abort()}},Fne=(t,{originalStreams:[e],subprocess:n})=>{const r={stdinCleanedUp:!1};return t===e&&Lne(t,n,r),r},Lne=(t,e,n)=>{const{_destroy:r}=t;t._destroy=(...i)=>{Mne(e,n),r.call(t,...i)}},Mne=({exitCode:t,signalCode:e},n)=>{(t!==null||e!==null)&&(n.stdinCleanedUp=!0)},zne=(t,e,n,r)=>{if(!Bne(t,e,n,r))throw t},Bne=(t,e,n,r=!0)=>n.propagating?LI(t)||k0(t):(n.propagating=!0,FI(n,e)===r?LI(t):k0(t)),FI=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",k0=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",LI=t=>t?.code==="EPIPE",jne=({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>t.stdio.map((c,u)=>MI({stream:c,fdNumber:u,encoding:e,buffer:n[u],maxBuffer:r[u],lines:i[u],allMixed:!1,stripFinalNewline:s,verboseInfo:o,streamInfo:a})),MI=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=S0(t,e,u);if(FI(u,e)){await l;return}const[d]=await Promise.all([Ine({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},qne=({stdout:t,stderr:e},{all:n})=>n&&(t||e)?v0([t,e].filter(Boolean)):void 0,Une=({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>MI({...Wne(t,n),fdNumber:"all",encoding:e,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:Gne(t),stripFinalNewline:s,verboseInfo:o,streamInfo:a}),Wne=({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}},Gne=({all:t,stdout:e,stderr:n})=>t&&e&&n&&e.readableObjectMode!==n.readableObjectMode,Hne=t=>Rw(t,"ipc"),Kne=(t,e)=>{const n=vA(t);zl({type:"ipc",verboseMessage:n,fdNumber:"ipc",verboseInfo:e})},Vne=async({subprocess:t,buffer:e,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:s})=>{if(!r)return i;const o=Hne(s),a=Ml(e,"ipc"),c=Ml(n,"ipc");for await(const u of pI({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))a&&(zZ(t,i,c),i.push(u)),o&&Kne(u,s);return i},Yne=async(t,e)=>(await Promise.allSettled([t]),e),Xne=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:h,fileDescriptors:p,originalStreams:m,onInternalError:w,controller:v})=>{const E=ote(t,f),S={originalStreams:m,fileDescriptors:p,subprocess:t,exitPromise:E,propagating:!1},$=jne({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:u,verboseInfo:h,streamInfo:S}),I=Une({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:u,verboseInfo:h,streamInfo:S}),N=[],A=Vne({subprocess:t,buffer:n,maxBuffer:r,ipc:l,ipcOutput:N,verboseInfo:h}),q=Jne(m,t,S),W=Zne(p,S);try{return await Promise.race([Promise.all([{},cte(E),Promise.all($),I,A,VJ(t,d),...q,...W]),w,Qne(t,v),...BJ(t,s,f,v),...YX({subprocess:t,cancelSignal:o,gracefulCancel:a,context:f,controller:v}),...FJ({subprocess:t,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:v})])}catch(V){return f.terminationReason??="other",Promise.all([{error:V},E,Promise.all($.map(x=>NI(x))),NI(I),Yne(A,N),Promise.allSettled(q),Promise.allSettled(W)])}},Jne=(t,e,n)=>t.map((r,i)=>r===e.stdio[i]?void 0:S0(r,i,n)),Zne=(t,e)=>t.flatMap(({stdioItems:n},r)=>n.filter(({value:i,stream:s=i})=>co(s,{checkOpen:!1})&&!io(s)).map(({type:i,value:s,stream:o=s})=>S0(o,r,e,{isSameDirection:lo.has(i),stopOnExit:i==="native"}))),Qne=async(t,{signal:e})=>{const[n]=await mn(t,"error",{signal:e});throw n},ere=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),$0=(t,e,n)=>{const r=t[n];r.has(e)||r.set(e,[]);const i=r.get(e),s=jl();return i.push(s),{resolve:s.resolve.bind(s),promises:i}},Fp=async({resolve:t,promises:e},n)=>{t();const[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...e])]);return!r},zI=async t=>{if(t!==void 0)try{await BI(t)}catch{}},tre=async t=>{if(t!==void 0)try{await jI(t)}catch{}},BI=async t=>{await $i(t,{cleanup:!0,readable:!1,writable:!0})},jI=async t=>{await $i(t,{cleanup:!0,readable:!0,writable:!1})},qI=async(t,e)=>{if(await t,e)throw e},UI=(t,e,n)=>{n&&!k0(n)?t.destroy(n):e&&t.destroy()},nre=({subprocess:t,concurrentStreams:e,encoding:n},{from:r,binary:i=!0,preserveNewlines:s=!0}={})=>{const o=i||ao.has(n),{subprocessStdout:a,waitReadableDestroy:c}=WI(t,r,e),{readableEncoding:u,readableObjectMode:l,readableHighWaterMark:d}=GI(a,o),{read:f,onStdoutDataDone:h}=HI({subprocessStdout:a,subprocess:t,binary:o,encoding:n,preserveNewlines:s}),p=new gs({read:f,destroy:mo(VI.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:l,encoding:u});return KI({subprocessStdout:a,onStdoutDataDone:h,readable:p,subprocess:t}),p},WI=(t,e,n)=>{const r=Kw(t,e),i=$0(n,r,"readableDestroy");return{subprocessStdout:r,waitReadableDestroy:i}},GI=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:n},r)=>r?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:n}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:II},HI=({subprocessStdout:t,subprocess:e,binary:n,encoding:r,preserveNewlines:i})=>{const s=jl(),o=_I({subprocessStdout:t,subprocess:e,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){rre(this,o,s)},onStdoutDataDone:s}},rre=async(t,e,n)=>{try{const{value:r,done:i}=await e.next();i?n.resolve():t.push(r)}catch{}},KI=async({subprocessStdout:t,onStdoutDataDone:e,readable:n,subprocess:r,subprocessStdin:i})=>{try{await jI(t),await r,await zI(i),await e,n.readable&&n.push(null)}catch(s){await zI(i),YI(n,s)}},VI=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:n},r)=>{await Fp(n,e)&&(YI(t,r),await qI(e,r))},YI=(t,e)=>{UI(t,t.readable,e)},ire=({subprocess:t,concurrentStreams:e},{to:n}={})=>{const{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}=XI(t,n,e),o=new Wp({...JI(r,t,i),destroy:mo(QI.bind(void 0,{subprocessStdin:r,subprocess:t,waitWritableFinal:i,waitWritableDestroy:s})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return ZI(r,o),o},XI=(t,e,n)=>{const r=VA(t,e),i=$0(n,r,"writableFinal"),s=$0(n,r,"writableDestroy");return{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}},JI=(t,e,n)=>({write:sre.bind(void 0,t),final:mo(ore.bind(void 0,t,e,n))}),sre=(t,e,n,r)=>{t.write(e,n)?r():t.once("drain",r)},ore=async(t,e,n)=>{await Fp(n,e)&&(t.writable&&t.end(),await e)},ZI=async(t,e,n)=>{try{await BI(t),e.writable&&e.end()}catch(r){await tre(n),eP(e,r)}},QI=async({subprocessStdin:t,subprocess:e,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await Fp(n,e),await Fp(r,e)&&(eP(t,i),await qI(e,i))},eP=(t,e)=>{UI(t,t.writable,e)},are=({subprocess:t,concurrentStreams:e,encoding:n},{from:r,to:i,binary:s=!0,preserveNewlines:o=!0}={})=>{const a=s||ao.has(n),{subprocessStdout:c,waitReadableDestroy:u}=WI(t,r,e),{subprocessStdin:l,waitWritableFinal:d,waitWritableDestroy:f}=XI(t,i,e),{readableEncoding:h,readableObjectMode:p,readableHighWaterMark:m}=GI(c,a),{read:w,onStdoutDataDone:v}=HI({subprocessStdout:c,subprocess:t,binary:a,encoding:n,preserveNewlines:o}),E=new Gp({read:w,...JI(l,t,d),destroy:mo(cre.bind(void 0,{subprocessStdout:c,subprocessStdin:l,subprocess:t,waitReadableDestroy:u,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:m,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:p,writableObjectMode:l.writableObjectMode,encoding:h});return KI({subprocessStdout:c,onStdoutDataDone:v,readable:E,subprocess:t,subprocessStdin:l}),ZI(l,E,c),E},cre=async({subprocessStdout:t,subprocessStdin:e,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:s},o)=>{await Promise.all([VI({subprocessStdout:t,subprocess:n,waitReadableDestroy:r},o),QI({subprocessStdin:e,subprocess:n,waitWritableFinal:i,waitWritableDestroy:s},o)])},tP=(t,e,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{const s=r||ao.has(e),o=Kw(t,n),a=_I({subprocessStdout:o,subprocess:t,binary:s,shouldEncode:!0,encoding:e,preserveNewlines:i});return ure(a,o,t)},ure=async function*(t,e,n){try{yield*t}finally{e.readable&&e.destroy(),await n}},lre=(t,{encoding:e})=>{const n=ere();t.readable=nre.bind(void 0,{subprocess:t,concurrentStreams:n,encoding:e}),t.writable=ire.bind(void 0,{subprocess:t,concurrentStreams:n}),t.duplex=are.bind(void 0,{subprocess:t,concurrentStreams:n,encoding:e}),t.iterable=tP.bind(void 0,t,e),t[Symbol.asyncIterator]=tP.bind(void 0,t,e,{})},dre=(t,e)=>{for(const[n,r]of hre){const i=r.value.bind(e);Reflect.defineProperty(t,n,{...r,value:i})}},fre=(async()=>{})().constructor.prototype,hre=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(fre,t)]),pre=(t,e,n,r)=>{const{file:i,commandArguments:s,command:o,escapedCommand:a,startTime:c,verboseInfo:u,options:l,fileDescriptors:d}=gre(t,e,n),{subprocess:f,promise:h}=yre({file:i,commandArguments:s,options:l,startTime:c,verboseInfo:u,command:o,escapedCommand:a,fileDescriptors:d});return f.pipe=R0.bind(void 0,{source:f,sourcePromise:h,boundOptions:{},createNested:r}),dre(f,h),oo.set(f,{options:l,fileDescriptors:d}),f},gre=(t,e,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:o}=DA(t,e,n),{file:a,commandArguments:c,options:u}=ux(t,e,n),l=mre(u),d=Lte(l,o);return{file:a,commandArguments:c,command:r,escapedCommand:i,startTime:s,verboseInfo:o,options:l,fileDescriptors:d}},mre=({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}},yre=({file:t,commandArguments:e,options:n,startTime:r,verboseInfo:i,command:s,escapedCommand:o,fileDescriptors:a})=>{let c;try{c=FP(t,e,n)}catch(p){return xte({error:p,command:s,escapedCommand:o,fileDescriptors:a,options:n,startTime:r,verboseInfo:i})}const u=new AbortController;qP(Number.POSITIVE_INFINITY,u.signal);const l=[...c.stdio];Zte(c,a,u),lne(c,n,u);const d={},f=jl();c.kill=WX.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:f,context:d,controller:u}),c.all=qne(c,n),lre(c,n),_te(c,n);const h=vre({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:h}},vre=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,h],p,m,w]=await Xne({subprocess:t,options:e,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:s,onInternalError:u,controller:l});l.abort(),u.resolve();const v=p.map(($,I)=>Ra($,e,I)),E=Ra(m,e,"all"),S=wre({errorInfo:d,exitCode:f,signal:h,stdio:v,all:E,ipcOutput:w,context:c,options:e,command:o,escapedCommand:a,startTime:n});return u0(S,r,e)},wre=({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?c0({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 Cp,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:e,signal:n,stdio:r,all:i,ipcOutput:s,options:a,startTime:l,isSync:!1}):Cx({command:c,escapedCommand:u,stdio:r,all:i,ipcOutput:s,options:a,startTime:l}),C0=(t,e)=>{const n=Object.fromEntries(Object.entries(e).map(([r,i])=>[r,bre(r,t[r],i)]));return{...t,...n}},bre=(t,e,n)=>Dre.has(t)&&Qn(e)&&Qn(n)?{...e,...n}:n,Dre=new Set(["env",...hA]),fo=(t,e,n,r)=>{const i=(o,a,c)=>fo(o,a,n,c),s=(...o)=>Ere({mapArguments:t,deepOptions:n,boundOptions:e,setBoundExeca:r,createNested:i},...o);return r!==void 0&&r(s,i,e),s},Ere=({mapArguments:t,deepOptions:e={},boundOptions:n={},setBoundExeca:r,createNested:i},s,...o)=>{if(Qn(s))return i(t,C0(n,s),r);const{file:a,commandArguments:c,options:u,isSync:l}=Tre({mapArguments:t,firstArgument:s,nextArguments:o,deepOptions:e,boundOptions:n});return l?fte(a,c,u):pre(a,c,u,i)},Tre=({mapArguments:t,firstArgument:e,nextArguments:n,deepOptions:r,boundOptions:i})=>{const s=oY(e)?aY(e,n):[e,...n],[o,a,c]=tA(...s),u=C0(C0(r,i),c),{file:l=o,commandArguments:d=a,options:f=u,isSync:h=!1}=t({file:o,commandArguments:a,options:u});return{file:l,commandArguments:d,options:f,isSync:h}},Rre=({file:t,commandArguments:e})=>nP(t,e),Sre=({file:t,commandArguments:e})=>({...nP(t,e),isSync:!0}),nP=(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]=kre(t);return{file:n,commandArguments:r}},kre=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($re)){const i=n.at(-1);i&&i.endsWith("\\")?n[n.length-1]=`${i.slice(0,-1)} ${r}`:n.push(r)}return n},$re=/ +/g,Cre=(t,e,n)=>{t.sync=e(Are,n),t.s=t.sync},_re=({options:t})=>rP(t),Are=({options:t})=>({...rP(t),isSync:!0}),rP=t=>({options:{...xre(t),...t}}),xre=({input:t,inputFile:e,stdio:n})=>t===void 0&&e===void 0&&n===void 0?{stdin:"inherit"}:{},Ire={preferLocal:!0},_0=fo(()=>({}));fo(()=>({isSync:!0})),fo(Rre),fo(Sre),fo(qJ),fo(_re,{},Ire,Cre),Ate();const A0=dp(2);class Pre{constructor(e="dot"){this.path=e}async unflatten(e){return await A0(async()=>{const n=await _0("unflatten",["-l 1","-c 3"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});return n instanceof Error&&(n.stdout?Ze.warn(`[BinaryGraphvizLayouter.layout] '${n.command}' failed: ${n.stderr}
1807
-
1808
- but returned
1809
- ${n.stdout}`):Ze.error(`[BinaryGraphvizLayouter.layout] '${n.command}' failed: ${n.stderr}
1810
-
1811
- nothing returned, ignoring...`)),n.stdout&&(e=n.stdout.replaceAll(/\t\[/g," [").replaceAll(/\t/g," ")),e})}async layoutJson(e){return await A0(async()=>{const n=await _0(this.path,["-Tjson","-y"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});if(n instanceof Error){if(!n.stdout)throw Ze.error(`[BinaryGraphvizLayouter.layout] '${n.command}' nothing returned and failed: "${n.stderr}"`),n;Ze.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 A0(async()=>{const n=await _0(this.path,["-Tsvg","-y"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});if(n instanceof Error){if(!n.stdout)throw Ze.error(`[BinaryGraphvizLayouter.layout] '${n.command}' nothing returned and failed: ${n.stderr}`),n;Ze.warn(`[BinaryGraphvizLayouter.layout] '${n.command}' returned result but also failed ${n.stderr}`)}return n.stdout})}}const Nre="likec4",Ore="1.12.2",Fre="MIT",Lre="https://likec4.dev",Mre="Denis Davydkov <denis@davydkov.com>",zre={url:"https://github.com/sponsors/davydkov"},Bre={type:"git",url:"https://github.com/likec4/likec4.git",directory:"packages/likec4"},jre={node:">=20.17.0"},qre="https://github.com/likec4/likec4/issues",Ure="module",Wre="./bin/likec4.mjs",Gre={".":"./src/index.ts","./react":{types:"./app/react/components/index.ts",default:"./react/index.mjs"},"./react/style.css":"./react/style.css","./icons/all":{types:"./icons/all.d.ts",default:"./icons/all.js"},"./icons/*":{types:"./icons/icon.d.ts",default:"./icons/*"}},Hre={registry:"https://registry.npmjs.org",access:"public",exports:{".":{types:"./dist/index.d.ts",default:"./dist/index.mjs"},"./react":{types:"./react/index.d.ts",default:"./react/index.mjs"},"./react/style.css":"./react/style.css","./icons/all":{types:"./icons/all.d.ts",default:"./icons/all.js"},"./icons/*":{types:"./icons/icon.d.ts",default:"./icons/*"}}},Kre={"turbo-build":"turbo run build --log-prefix=none --log-order=grouped",package:"yarn pack","typecheck:app":"tsc --noEmit -p ./app/tsconfig.json","typecheck:cli":"tsc --noEmit -p ./tsconfig.cli.json",typecheck:"run-p --print-label 'typecheck:*'","build-cli":"unbuild","build-app":"run-p --print-label 'bundle:*'","bundle:app":"tsx scripts/bundle-app.ts","bundle:react":"tsx scripts/bundle-react.ts","bundle:react-dts":"tsx scripts/dts-react.ts","bundle:webcomponent":"tsx scripts/bundle-webcomponent.ts",generate:"tsx scripts/generate.ts",prepack:"turbo run build --log-prefix=none --log-order=grouped",lint:"run -T eslint src/ --fix",clean:"rm -r -f dist app/dist dev/.export dev/dist node_modules/.vite",dev:"tsx watch src/cli/index.ts serve dev","dev:docs:bigbank":"tsx watch src/cli/index.ts serve ../../apps/docs/src/components/bigbank","dev:docs:dynamic-view":"tsx watch src/cli/index.ts serve ../../apps/docs/src/components/dynamic-view","dev:docs:index-page":"tsx watch src/cli/index.ts serve ../../apps/docs/src/components/index-page","dev:docs:theme":"tsx watch src/cli/index.ts serve ../../apps/docs/src/components/likec4-theme","dev:template":"tsx watch src/cli/index.ts serve ../create-likec4/template","dev:example-cloud":"tsx watch src/cli/index.ts serve ../../examples/cloud-system","dev:failed":"tsx watch src/cli/index.ts serve ../../examples/failed","dev:example-dev":"tsx watch src/cli/index.ts serve ../../examples/diagrams-dev/likec4",cli:"tsx src/cli/index.ts","cli:serve":"tsx watch src/cli/index.ts serve dev","cli:build":"tsx src/cli/index.ts build -o dev/dist dev","cli:preview":"tsx src/cli/index.ts preview -o dev/dist dev","cli:export":"tsx src/cli/index.ts export png -o dev/export dev","cli:export:json":"tsx src/cli/index.ts export json -o dev/export/likec4.json dev",test:"vitest run --no-isolate","vitest:ui":"vitest --no-isolate --ui","test:watch":"vitest"},Vre={"@hpcc-js/wasm-graphviz":"1.6.1","@vitejs/plugin-react-swc":"3.7.1",playwright:"1.47.2",react:"^18.3.1","react-dom":"^18.3.1","type-fest":"4.26.1",vite:"5.4.8"},Yre={"@fontsource/ibm-plex-sans":"^5.1.0","@likec4/core":"workspace:*","@likec4/diagram":"workspace:*","@likec4/generators":"workspace:*","@likec4/icons":"workspace:*","@likec4/language-server":"workspace:*","@likec4/layouts":"workspace:*","@likec4/log":"workspace:*","@likec4/tsconfig":"workspace:*","@mantine/core":"7.13.2","@mantine/hooks":"7.13.2","@mantine/vanilla-extract":"7.13.2","@nanostores/react":"0.8.0","@react-hookz/web":"^24.0.4","@tabler/icons-react":"3.17.0","@tanstack/react-router":"1.45.13","@tanstack/router-cli":"1.45.13","@tanstack/router-vite-plugin":"1.45.13","@types/node":"^20.16.5","@types/prop-types":"^15.7.13","@types/react":"18.3.4","@types/react-dom":"18.3.0","@types/string-hash":"^1.1.3","@types/yargs":"^17.0.33","@vanilla-extract/css":"^1.16.0","@vanilla-extract/dynamic":"^2.1.2","@vanilla-extract/vite-plugin":"^4.0.16","@xyflow/react":"12.3.1","@xyflow/system":"0.0.43",autoprefixer:"^10.4.20",classnames:"^2.5.1",clsx:"^2.1.1",defu:"^6.1.4","dts-bundle-generator":"^9.5.1",esbuild:"^0.24.0","esbuild-node-externals":"^1.15.0",execa:"^9.3.1","fast-equals":"^5.0.1",fdir:"^6.4.0","framer-motion":"^11.11.1","get-port":"^7.1.0",glob:"^11.0.0","html-to-image":"^1.11.11",json5:"^2.2.3",langium:"3.2.0",mkdirp:"^3.0.1",nanostores:"0.11.3","npm-run-all2":"^6.2.2","p-limit":"^6.1.0","package-up":"^5.0.0",postcss:"^8.4.47","postcss-preset-mantine":"^1.17.0","pretty-ms":"^9.1.0","react-error-boundary":"^4.0.13","react-resizable-panels":"^2.1.4","react-shadow":"^20.5.0",remeda:"^2.14.0","std-env":"^3.7.0","string-hash":"^1.1.3","strip-indent":"^4.0.0",terser:"^5.33.0",tinyrainbow:"^1.2.0",tsx:"~4.9.3",turbo:"^2.1.3",typescript:"^5.6.2",ufo:"^1.5.4",unbuild:"^3.0.0-rc.11","vite-plugin-css-injected-by-js":"^3.5.2","vite-plugin-shadow-style":"^1.1.1",vitest:"^2.1.2",yargs:"17.7.2"},Xre="yarn@4.5.0",iP={name:Nre,version:Ore,license:Fre,homepage:Lre,author:Mre,sponsor:zre,repository:Bre,engines:jre,bugs:qre,type:Ure,bin:Wre,exports:Gre,publishConfig:Hre,scripts:Kre,dependencies:Vre,devDependencies:Yre,packageManager:Xre},Lp=Object.create(null),Kl=t=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?Lp:globalThis),is=new Proxy(Lp,{get(t,e){return Kl()[e]??Lp[e]},has(t,e){const n=Kl();return e in n||e in Lp},set(t,e,n){const r=Kl(!0);return r[e]=n,!0},deleteProperty(t,e){if(!e)return!1;const n=Kl(!0);return delete n[e],!0},ownKeys(){const t=Kl(!0);return Object.keys(t)}}),Jre=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",Zre=[["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"]];function Qre(){if(globalThis.process?.env)for(const t of Zre){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 sP=Qre();sP.name;function ho(t){return t?t!=="false":!1}const eie=globalThis.process?.platform||"",Mp=ho(is.CI)||sP.ci!==!1,oP=ho(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY);ho(is.DEBUG);const tie=Jre==="test"||ho(is.TEST);ho(is.MINIMAL);const nie=/^win/i.test(eie);!ho(is.NO_COLOR)&&(ho(is.FORCE_COLOR)||(oP||nie)&&is.TERM);const rie=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(rie?.split(".")[0]);const iie=globalThis.process||Object.create(null),aP={versions:{}};new Proxy(iie,{get(t,e){if(e==="env")return is;if(e in t)return t[e];if(e in aP)return aP[e]}});const sie=globalThis.process?.release?.name==="node",oie=!!globalThis.Bun||!!globalThis.process?.versions?.bun,aie=!!globalThis.Deno,cie=!!globalThis.fastly,uie=!!globalThis.Netlify,lie=!!globalThis.EdgeRuntime,die=globalThis.navigator?.userAgent==="Cloudflare-Workers",fie=!!globalThis.__lagon__,hie=[[uie,"netlify"],[lie,"edge-light"],[die,"workerd"],[cie,"fastly"],[aie,"deno"],[oie,"bun"],[sie,"node"],[fie,"lagon"]];function pie(){const t=hie.find(e=>e[0]);if(t)return{name:t[1]}}const gie=pie();gie?.name;const cP=st.bold(st.bgRed(st.white("ERROR"))),mie=st.bold(st.yellow("WARN")),yie=st.bold(st.green("INFO"));function uP(t){const e=GP("info",{prefix:t,allowClearScreen:!Mp}),n=!Mp;return{...e,info(r,i){e.info(`${yie} ${r}`,{timestamp:n,...i})},warn(r,i){e.warn(`${mie} ${r}`,{timestamp:n,...i})},error(r,i){if(r instanceof Error){e.error(`${cP} ${st.red(r.stack??r.name+" "+r.message)}`,{timestamp:n,error:r,...i});return}e.error(`${cP} ${r}`,{timestamp:n,...i})}}}const x0=()=>{},vie={info:x0,warn:x0,error:x0},wie=1e6;function lP(t){const[e,n]=Xl(t),r=e*1e3+n/wie;return{ms:r,pretty:xx(r)}}function bie(t){const e=Xl();return{stopAndLog(n="done in "){n=st.green(`${n}${lP(e).pretty}`),t?t.info(n):Ze.success(n)}}}class Die{constructor(e){this.services=e,this.layouter=e.likec4.Layouter}cache=new WeakMap;layouter;previousAction=Promise.resolve();limit=dp(2);inflightRequest;async computedViews(){try{this.inflightRequest??=Promise.resolve().then(async()=>await this.services.likec4.ModelBuilder.buildComputedModel());const e=await Promise.resolve(this.inflightRequest);return Object.values(e?.views??{})}finally{this.inflightRequest=void 0}}async layoutViews(){const e=this.services.logger,n=this.previousAction.then(async()=>{const r=(await this.computedViews()).map(i=>this.limit(async()=>{try{let s=this.cache.get(i);return s||(s=await this.layouter.layout(i),this.cache.set(i,s)),s}catch(s){return e.error(s),null}}));return(await Promise.all(r)).filter(ne)});return this.previousAction=n.catch(r=>(e.error(r),Promise.resolve([]))),await n}async diagrams(){return(await this.layoutViews()).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(s=>this.limit(async()=>{const{dot:o,svg:a}=await this.layouter.svg(s);return{id:s.id,dot:o,svg:a}})),i=await Promise.all(r);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}}class Eie{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(`${st.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(`${st.dim("workspace:")} found ${s.length} source files`),await i.build(s,{validation:!0});const o=await n.buildComputedModel(),a=Uf(o?.views??{}).length;if(a===0){e.warn(`${st.dim("workspace:")} no views found`);return}e.info(`${st.dim("workspace:")} ${st.green(`\u2713 computed ${a} views`)}`);const c=await this.services.likec4.Views.diagrams();c.length===a?e.info(`${st.dim("workspace:")} ${st.green("\u2713 all views layouted")}`):e.warn(`${st.dim("workspace:")} ${st.yellow(`\u2717 layouted ${c.length} views`)}`)}}function dP(t){return e=>new t(e)}const Tie={logger:()=>{throw new Error("Logger must be provided")},likec4:{Layouter:()=>{throw new Error("Layouter must be provided")},Views:dP(Die)},cli:{Workspace:dP(Eie)}};function fP(t){const e=$g(t,{useFileSystem:!0,logger:"default",graphviz:"wasm"});let n;switch(e.logger){case!1:n=vie;break;case"vite":n=uP("c4:lsp ");break;case"default":n=Ze.withTag("lsp");break;default:n=e.logger}const r=e.graphviz==="binary";n.info(`${st.dim("version")} ${iP.version}`),n.info(`${st.dim("layout")} ${r?"binary":"wasm"}`);const i={logger:()=>n,likec4:{Layouter:()=>new XV(r===!0?new Pre:new ZV)}};return UG(e.logger===!1?"silent":"info"),e.logger!==!1&&e.logger!=="default"&&$e.setReporters([{log:({level:s,...o},a)=>{const c=o.tag||"",u=o.args.map(d=>Iy(d)?d.stack??d.message:typeof d=="string"?d:String(d));c&&u.unshift(`[${c}]`);const l=u.join(" ");switch(!0){case s>=qe.debug:break;case s>=qe.info:{n.info(l);break}case s>=qe.log:{n.info(l);break}case s>=qe.warn:{n.warn(l);break}case s>=qe.fatal:{n.error(l);break}}}}]),pK(e.useFileSystem?X9:{},Tie,i).likec4}const hP=t=>new Error(`Invalid model:
1812
- ${t.getErrors().map(e=>` ${e.sourceFsPath}:${e.line} ${e.message.slice(0,200)}`).join(`
1813
- `)}`);class ss{constructor(e,n,r){this.workspace=e,this.langium=n,this.isPrintErrorEnabled=r,this.logger=n.logger,this.langiumDocuments=n.shared.workspace.LangiumDocuments,this.views=n.likec4.Views,this.isPrintErrorEnabled&&this.printErrors()}static async fromSource(e,n){const r=fP($g(n,{useFileSystem:!1,logger:!1,graphviz:"wasm"})),i=Yt.from({scheme:"virtual",path:"/workspace"});await r.cli.Workspace.initWorkspace({uri:i.toString(),name:"virtual"});const s=mt.joinPath(i,"source.likec4");r.shared.workspace.LangiumDocuments.createDocument(s,e),await r.cli.Workspace.init();const o=new ss(i.path,r,n?.printErrors??!0);return n?.throwIfInvalid===!0&&o.hasErrors()?(o.dispose(),Promise.reject(hP(o))):o}static likec4Instances=new Map;static async fromWorkspace(e="",n){const r=EP(e);if(!bP(r))throw new Error(`Workspace not found: ${r}`);let i=ss.likec4Instances.get(r);if(!i){const s=fP($g(n,{useFileSystem:!0,logger:"default",graphviz:"wasm"}));await s.cli.Workspace.initWorkspace({uri:RP(r).toString(),name:TP(r)}),await s.cli.Workspace.init(),i=new ss(r,s,n?.printErrors??!0),ss.likec4Instances.set(r,i)}return n?.throwIfInvalid===!0&&i.hasErrors()?(i.dispose(),Promise.reject(hP(i))):i}modelComputedRef;modelLayoutedRef;logger;langiumDocuments;views;async diagrams(){return await this.langium.likec4.Views.diagrams()}model(){return this.computedModel()}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=Aa.computed(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.views.diagrams();e=Aa.layouted({__:"layouted",...n,views:Py(r,Lr("id"))}),this.modelLayoutedRef=new WeakRef(e)}return e}getErrors(){return this.langiumDocuments.all.toArray().flatMap(e=>(e.diagnostics??[]).filter(n=>n.severity===Fc.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===Fc.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(`
1814
- `);return a.length>10&&(a.length=10,a.push("...")),a.map((c,u)=>u===0?" "+st.dim(`Line ${o}: `)+st.red(c):" ".repeat(10)+st.red(c))}).join(`
1815
- `);this.logger.error(`Invalid ${n.uri.fsPath}
1816
- ${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?[Yt.file(e)]:[],n?[Yt.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 ss.likec4Instances)n===this&&ss.likec4Instances.delete(e)}}export{bie as $,Je as A,ne as B,Eg as C,ji as D,st as E,dp as F,Ze as G,sN as H,hi as I,oN as J,D1 as K,or as L,uP as M,zD as N,ws as O,et as P,Ca as Q,oG as R,pd as S,xa as T,xv as U,aG as V,Wc as W,T1 as X,lP as Y,Aa as Z,_o as _,gd as a,rv as a0,fd as a1,Fr as a2,yD as a3,qe as a4,iP as a5,ge as b,_a as c,hD as d,ss as e,Zp as f,m$ as g,PO as h,v$ as i,Rg as j,fn as k,mb as l,U1 as m,uD as n,nn as o,No as p,Ae as q,qn as r,xo as s,ht as t,Rr as u,$t as v,St as w,gb as x,Ye as y,Or as z};