likec4 1.9.0 → 1.10.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.
- package/dist/__app__/react/likec4.tsx +64 -12
- package/dist/__app__/src/chunks/{-index-overview-BAmvrzHU.js → -index-overview-DZ3H7kDb.js} +2 -2
- package/dist/__app__/src/chunks/{main-BZtdykGF.js → main-KEhBGhZ8.js} +1055 -820
- package/dist/__app__/src/chunks/{mantine-Bhi3pgTf.js → mantine-BnwtT_Nz.js} +54 -53
- package/dist/__app__/src/main.js +1 -1
- package/dist/__app__/src/style.css +1 -1
- package/dist/__app__/webcomponent/webcomponent.js +594 -389
- package/dist/cli/index.mjs +115 -74
- package/dist/index.d.mts +92 -61
- package/dist/index.mjs +1 -1
- package/dist/shared/likec4.BaYahRry.mjs +1221 -0
- package/package.json +13 -10
- package/react/index.d.ts +1064 -9
- package/react/index.mjs +902 -603
- package/react/style.css +1 -0
- package/dist/shared/likec4.D4BZc04H.mjs +0 -1219
- package/react/LikeC4Browser.css.d.ts +0 -4
- package/react/LikeC4Browser.d.ts +0 -31
- package/react/LikeC4ViewElement.d.ts +0 -56
- package/react/ShadowRoot.d.ts +0 -6
- package/react/ShadowRootMantineProvider.d.ts +0 -7
- package/react/styles.css.d.ts +0 -4
- package/react/styles.d.ts +0 -4
- package/react/types-filter.d.ts +0 -33
- package/react/types.d.ts +0 -76
|
@@ -1,1219 +0,0 @@
|
|
|
1
|
-
import Nr,{sep as Ox,basename as Dx,resolve as Lx}from"node:path";import{isatty as Mx}from"tty";import Fx,{formatWithOptions as jx,debuglog as Ux,stripVTControlCharacters as Bx,inspect as eb,promisify as qx,callbackify as Zs,aborted as Wx}from"node:util";import{fileURLToPath as sp,pathToFileURL as Gx}from"node:url";import{ChildProcess as tb,spawnSync as zx,spawn as Hx}from"node:child_process";import{StringDecoder as nb}from"node:string_decoder";import We,{platform as Vx,hrtime as Jl,execPath as Kx,execArgv as Yx}from"node:process";import*as rb from"node:fs";import{writeFileSync as ib,statSync as Xx,readFileSync as op,appendFileSync as Jx,createReadStream as sb,createWriteStream as ob}from"node:fs";import ab from"node:tty";import cb from"child_process";import da from"path";import Ql from"fs";import{setTimeout as lb,scheduler as ub,setImmediate as Qx}from"node:timers/promises";import{constants as fs}from"node:os";import{once as nn,addAbortListener as db,EventEmitter as Zx,on as Zl,setMaxListeners as eN}from"node:events";import{serialize as tN}from"node:v8";import{Transform as nN,getDefaultHighWaterMark as eu,PassThrough as fb,Readable as hs,Writable as ap,Duplex as cp}from"node:stream";import{Buffer as lp}from"node:buffer";import{finished as vi}from"node:stream/promises";import"node:worker_threads";import{createLogger as rN}from"vite";import iN from"util";import sN from"os";import hb from"crypto";import oN from"net";import aN from"url";import{Buffer as up}from"buffer";import{Graphviz as dp}from"@hpcc-js/wasm-graphviz";function rt(t,e){if(typeof t>"u"||t==null)throw new Error(e??`Expected defined value, but received ${t}`);return t}function ae(t,e){if(!t)throw new Error(e??"Invariant failed")}function Re(t){throw new Error(`NonExhaustive value: ${t}`)}function cN(t,e,n){let r=i=>t(i,...e);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:e})}function tu(t,e,n){let r=t.length-e.length;if(r===0)return t(...e);if(r===1)return cN(t,e,n);throw new Error("Wrong number of arguments")}function lN(t){return e=>!t(e)}function fa(t){return t==null}function uN(...t){return tu(dN,t)}var dN=(t,e)=>e.every(n=>n(t));function fN(...t){return tu(hN,t)}var hN=(t,e)=>e.some(n=>n(t));function pN(t,e){return e?e+"."+t:t}const gN=["solid","dashed","dotted","none"],mN=["rectangle","person","browser","mobile","cylinder","storage","queue"],nu="primary",pb="rectangle";function gb(t){return"element"in t}function mb(t){return"expanded"in t}function yb(t){return"custom"in t&&(ru(t.custom.expr)||fp(t.custom.expr))}function vb(t){return"wildcard"in t}function wb(t){return"elementKind"in t&&"isEqual"in t}function bb(t){return"elementTag"in t&&"isEqual"in t}function ru(t){return gb(t)||vb(t)||wb(t)||bb(t)||mb(t)}function fp(t){return"where"in t&&ru(t.where.expr)}function yN(t){return ru(t)||fp(t)||yb(t)}function Tb(t){return"source"in t&&"target"in t}function Eb(t){return"inout"in t}function Rb(t){return"incoming"in t}function Sb(t){return"outgoing"in t}function hp(t){return Tb(t)||Eb(t)||Rb(t)||Sb(t)}function $b(t){return"where"in t&&hp(t.where.expr)}function kb(t){return"customRelation"in t}function vN(t){return hp(t)||$b(t)||kb(t)}const ne={__proto__:null,isCustomElement:yb,isCustomRelationExpr:kb,isElement:ru,isElementKindExpr:wb,isElementPredicateExpr:yN,isElementRef:gb,isElementTagExpr:bb,isElementWhere:fp,isExpandedElementExpr:mb,isInOut:Eb,isIncoming:Rb,isOutgoing:Sb,isRelation:Tb,isRelationExpression:hp,isRelationPredicateExpr:vN,isRelationWhere:$b,isWildcard:vb},wN=t=>"tag"in t,bN=t=>"kind"in t,TN=t=>"not"in t,pp=t=>"and"in t,gp=t=>"or"in t;function eo(t){switch(!0){case wN(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 bN(t):{if("eq"in t.kind){const n=t.kind.eq;return r=>r.kind===n}const e=t.kind.neq;return n=>fa(n.kind)||n.kind!==e}case TN(t):{const e=eo(t.not);return lN(e)}case pp(t):{const e=t.and.map(eo);return uN(e)}case gp(t):{const e=t.or.map(eo);return fN(e)}default:Re(t)}}const _b="dashed",to="normal",no="gray",EN=["amber","blue","gray","slate","green","indigo","muted","primary","red","secondary","sky"];function Cb(t){return t in EN}function RN(t){return"include"in t&&Array.isArray(t.include)||"exclude"in t&&Array.isArray(t.exclude)}function SN(t){return"style"in t&&"targets"in t}function Ab(t){return"autoLayout"in t}function $N(t){return"include"in t&&Array.isArray(t.include)}function kN(t){return t.__==="dynamic"}function iu(t){return fa(t.__)||t.__==="element"}function Ib(t){return iu(t)&&"extends"in t}function Pb(t){return iu(t)&&"viewOf"in t}function _N(t){return`step-${String(t).padStart(3,"0")}`}function xb(t){return t.startsWith("step-")}function Nb(t){if(!xb(t))throw new Error(`Invalid step edge id: ${t}`);return Number(t.slice(5))}function mp(t){return t.__==="dynamic"}function CN(t){return fa(t.__)||t.__==="element"}const ps=(t,e=0,n=1)=>vp(wp(e,t),n),yp=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]=ps(t[e],0,255)):e===3&&(t[e]=ps(t[e],0,1));return t},Ob={};for(let t of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])Ob[`[object ${t}]`]=t.toLowerCase();function me(t){return Ob[Object.prototype.toString.call(t)]||"object"}const de=(t,e=null)=>t.length>=3?Array.prototype.slice.call(t):me(t[0])=="object"&&e?e.split("").filter(n=>t[0][n]!==void 0).map(n=>t[0][n]):t[0].slice(0),ro=t=>{if(t.length<2)return null;const e=t.length-1;return me(t[e])=="string"?t[e].toLowerCase():null},{PI:su,min:vp,max:wp}=Math,$n=t=>Math.round(t*100)/100,bp=t=>Math.round(t*100)/100,Or=su*2,Tp=su/3,AN=su/180,IN=180/su,ue={format:{},autodetect:[]};let V=class{constructor(...e){const n=this;if(me(e[0])==="object"&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];let r=ro(e),i=!1;if(!r){i=!0,ue.sorted||(ue.autodetect=ue.autodetect.sort((s,o)=>o.p-s.p),ue.sorted=!0);for(let s of ue.autodetect)if(r=s.test(...e),r)break}if(ue.format[r]){const s=ue.format[r].apply(null,i?e:e.slice(0,-1));n._rgb=yp(s)}else throw new Error("unknown format: "+e);n._rgb.length===3&&n._rgb.push(1)}toString(){return me(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}};const PN="3.0.0",we=(...t)=>new V(...t);we.version=PN;const io={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"},xN=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,NN=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,Db=t=>{if(t.match(xN)){(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(NN)){(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:ou}=Math,Lb=(...t)=>{let[e,n,r,i]=de(t,"rgba"),s=ro(t)||"auto";i===void 0&&(i=1),s==="auto"&&(s=i<1?"rgba":"rgb"),e=ou(e),n=ou(n),r=ou(r);let o="000000"+(e<<16|n<<8|r).toString(16);o=o.substr(o.length-6);let a="0"+ou(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}`}};V.prototype.name=function(){const t=Lb(this._rgb,"rgb");for(let e of Object.keys(io))if(io[e]===t)return e.toLowerCase();return t},ue.format.named=t=>{if(t=t.toLowerCase(),io[t])return Db(io[t]);throw new Error("unknown color name: "+t)},ue.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&me(t)==="string"&&io[t.toLowerCase()])return"named"}}),V.prototype.alpha=function(t,e=!1){return t!==void 0&&me(t)==="number"?e?(this._rgb[3]=t,this):new V([this._rgb[0],this._rgb[1],this._rgb[2],t],"rgb"):this._rgb[3]},V.prototype.clipped=function(){return this._rgb._clipped||!1};const cr={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}},ON=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 Dr(t){const e=ON.get(String(t).toLowerCase());if(!e)throw new Error("unknown Lab illuminant "+t);cr.labWhitePoint=t,cr.Xn=e[0],cr.Zn=e[1]}function ha(){return cr.labWhitePoint}const Ep=(...t)=>{t=de(t,"lab");const[e,n,r]=t,[i,s,o]=DN(e,n,r),[a,c,l]=Mb(i,s,o);return[a,c,l,t.length>3?t[3]:1]},DN=(t,e,n)=>{const{kE:r,kK:i,kKE:s,Xn:o,Yn:a,Zn:c}=cr,l=(t+16)/116,u=.002*e+l,d=l-.005*n,f=u*u*u,h=d*d*d,p=f>r?f:(116*u-16)/i,y=t>s?Math.pow((t+16)/116,3):t/i,$=h>r?h:(116*d-16)/i,T=p*o,w=y*a,b=$*c;return[T,w,b]},Rp=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},Mb=(t,e,n)=>{const{MtxAdaptMa:r,MtxAdaptMaI:i,MtxXYZ2RGB:s,RefWhiteRGB:o,Xn:a,Yn:c,Zn:l}=cr,u=a*r.m00+c*r.m10+l*r.m20,d=a*r.m01+c*r.m11+l*r.m21,f=a*r.m02+c*r.m12+l*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,y=o.X*r.m02+o.Y*r.m12+o.Z*r.m22,$=(t*r.m00+e*r.m10+n*r.m20)*(h/u),T=(t*r.m01+e*r.m11+n*r.m21)*(p/d),w=(t*r.m02+e*r.m12+n*r.m22)*(y/f),b=$*i.m00+T*i.m10+w*i.m20,_=$*i.m01+T*i.m11+w*i.m21,x=$*i.m02+T*i.m12+w*i.m22,F=Rp(b*s.m00+_*s.m10+x*s.m20),P=Rp(b*s.m01+_*s.m11+x*s.m21),G=Rp(b*s.m02+_*s.m12+x*s.m22);return[F*255,P*255,G*255]},Sp=(...t)=>{const[e,n,r,...i]=de(t,"rgb"),[s,o,a]=Fb(e,n,r),[c,l,u]=LN(s,o,a);return[c,l,u,...i.length>0&&i[0]<1?[i[0]]:[]]};function LN(t,e,n){const{Xn:r,Yn:i,Zn:s,kE:o,kK:a}=cr,c=t/r,l=e/i,u=n/s,d=c>o?Math.pow(c,1/3):(a*c+16)/116,f=l>o?Math.pow(l,1/3):(a*l+16)/116,h=u>o?Math.pow(u,1/3):(a*u+16)/116;return[116*f-16,500*(d-f),200*(f-h)]}function $p(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 Fb=(t,e,n)=>{t=$p(t/255),e=$p(e/255),n=$p(n/255);const{MtxRGB2XYZ:r,MtxAdaptMa:i,MtxAdaptMaI:s,Xn:o,Yn:a,Zn:c,As:l,Bs:u,Cs:d}=cr;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 y=o*i.m00+a*i.m10+c*i.m20,$=o*i.m01+a*i.m11+c*i.m21,T=o*i.m02+a*i.m12+c*i.m22;let w=f*i.m00+h*i.m10+p*i.m20,b=f*i.m01+h*i.m11+p*i.m21,_=f*i.m02+h*i.m12+p*i.m22;return w*=y/l,b*=$/u,_*=T/d,f=w*s.m00+b*s.m10+_*s.m20,h=w*s.m01+b*s.m11+_*s.m21,p=w*s.m02+b*s.m12+_*s.m22,[f,h,p]};V.prototype.lab=function(){return Sp(this._rgb)};const MN=(...t)=>new V(...t,"lab");Object.assign(we,{lab:MN,getLabWhitePoint:ha,setLabWhitePoint:Dr}),ue.format.lab=Ep,ue.autodetect.push({p:2,test:(...t)=>{if(t=de(t,"lab"),me(t)==="array"&&t.length===3)return"lab"}}),V.prototype.darken=function(t=1){const e=this,n=e.lab();return n[0]-=cr.Kn*t,new V(n,"lab").alpha(e.alpha(),!0)},V.prototype.brighten=function(t=1){return this.darken(-t)},V.prototype.darker=V.prototype.darken,V.prototype.brighter=V.prototype.brighten,V.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:FN}=Math,jN=1e-7,UN=20;V.prototype.luminance=function(t,e="rgb"){if(t!==void 0&&me(t)==="number"){if(t===0)return new V([0,0,0,this._rgb[3]],"rgb");if(t===1)return new V([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),r=UN;const i=(o,a)=>{const c=o.interpolate(a,.5,e),l=c.luminance();return Math.abs(t-l)<jN||!r--?c:l>t?i(o,c):i(c,a)},s=(n>t?i(new V([0,0,0]),this):i(this,new V([255,255,255]))).rgb();return new V([...s,this._rgb[3]])}return BN(...this._rgb.slice(0,3))};const BN=(t,e,n)=>(t=kp(t),e=kp(e),n=kp(n),.2126*t+.7152*e+.0722*n),kp=t=>(t/=255,t<=.03928?t/12.92:FN((t+.055)/1.055,2.4)),Lt={},pa=(t,e,n=.5,...r)=>{let i=r[0]||"lrgb";if(!Lt[i]&&!r.length&&(i=Object.keys(Lt)[0]),!Lt[i])throw new Error(`interpolation mode ${i} is not defined`);return me(t)!=="object"&&(t=new V(t)),me(e)!=="object"&&(e=new V(e)),Lt[i](t,e,n).alpha(t.alpha()+n*(e.alpha()-t.alpha()))};V.prototype.mix=V.prototype.interpolate=function(t,e=.5,...n){return pa(this,t,e,...n)},V.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 V([e[0]*n,e[1]*n,e[2]*n,n],"rgb")};const{sin:qN,cos:WN}=Math,jb=(...t)=>{let[e,n,r]=de(t,"lch");return isNaN(r)&&(r=0),r=r*AN,[e,WN(r)*n,qN(r)*n]},_p=(...t)=>{t=de(t,"lch");const[e,n,r]=t,[i,s,o]=jb(e,n,r),[a,c,l]=Ep(i,s,o);return[a,c,l,t.length>3?t[3]:1]},GN=(...t)=>{const e=de(t,"hcl").reverse();return _p(...e)},{sqrt:zN,atan2:HN,round:VN}=Math,Ub=(...t)=>{const[e,n,r]=de(t,"lab"),i=zN(n*n+r*r);let s=(HN(r,n)*IN+360)%360;return VN(i*1e4)===0&&(s=Number.NaN),[e,i,s]},Cp=(...t)=>{const[e,n,r,...i]=de(t,"rgb"),[s,o,a]=Sp(e,n,r),[c,l,u]=Ub(s,o,a);return[c,l,u,...i.length>0&&i[0]<1?[i[0]]:[]]};V.prototype.lch=function(){return Cp(this._rgb)},V.prototype.hcl=function(){return Cp(this._rgb).reverse()};const KN=(...t)=>new V(...t,"lch"),YN=(...t)=>new V(...t,"hcl");Object.assign(we,{lch:KN,hcl:YN}),ue.format.lch=_p,ue.format.hcl=GN,["lch","hcl"].forEach(t=>ue.autodetect.push({p:2,test:(...e)=>{if(e=de(e,t),me(e)==="array"&&e.length===3)return t}})),V.prototype.saturate=function(t=1){const e=this,n=e.lch();return n[1]+=cr.Kn*t,n[1]<0&&(n[1]=0),new V(n,"lch").alpha(e.alpha(),!0)},V.prototype.desaturate=function(t=1){return this.saturate(-t)},V.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(me(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(me(e)==="number")s[o]=e;else throw new Error("unsupported value for Color.set");const a=new V(s,r);return n?(this._rgb=a._rgb,this):a}throw new Error(`unknown channel ${i} in mode ${r}`)}else return s},V.prototype.tint=function(t=.5,...e){return pa(this,"white",t,...e)},V.prototype.shade=function(t=.5,...e){return pa(this,"black",t,...e)};const XN=(t,e,n)=>{const r=t._rgb,i=e._rgb;return new V(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"rgb")};Lt.rgb=XN;const{sqrt:Ap,pow:so}=Math,JN=(t,e,n)=>{const[r,i,s]=t._rgb,[o,a,c]=e._rgb;return new V(Ap(so(r,2)*(1-n)+so(o,2)*n),Ap(so(i,2)*(1-n)+so(a,2)*n),Ap(so(s,2)*(1-n)+so(c,2)*n),"rgb")};Lt.lrgb=JN;const QN=(t,e,n)=>{const r=t.lab(),i=e.lab();return new V(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"lab")};Lt.lab=QN;const oo=(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,l,u,d;(r.substr(0,1)==="h"||r==="oklch")&&([o,c,u]=i,[a,l,d]=s);let f,h,p,y;return!isNaN(o)&&!isNaN(a)?(a>o&&a-o>180?y=a-(o+360):a<o&&o-a>180?y=a+360-o:y=a-o,h=o+n*y):isNaN(o)?isNaN(a)?h=Number.NaN:(h=a,(u==1||u==0)&&r!="hsv"&&(f=l)):(h=o,(d==1||d==0)&&r!="hsv"&&(f=c)),f===void 0&&(f=c+n*(l-c)),p=u+n*(d-u),r==="oklch"?new V([p,f,h],r):new V([h,f,p],r)},Bb=(t,e,n)=>oo(t,e,n,"lch");Lt.lch=Bb,Lt.hcl=Bb;const ZN=t=>{if(me(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)},eO=(...t)=>{const[e,n,r]=de(t,"rgb");return(e<<16)+(n<<8)+r};V.prototype.num=function(){return eO(this._rgb)};const tO=(...t)=>new V(...t,"num");Object.assign(we,{num:tO}),ue.format.num=ZN,ue.autodetect.push({p:5,test:(...t)=>{if(t.length===1&&me(t[0])==="number"&&t[0]>=0&&t[0]<=16777215)return"num"}});const nO=(t,e,n)=>{const r=t.num(),i=e.num();return new V(r+n*(i-r),"num")};Lt.num=nO;const{floor:rO}=Math,iO=(...t)=>{t=de(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=rO(e),l=e-c,u=r*(1-n),d=u+a*(1-l),f=u+a*l,h=u+a;switch(c){case 0:[i,s,o]=[h,f,u];break;case 1:[i,s,o]=[d,h,u];break;case 2:[i,s,o]=[u,h,f];break;case 3:[i,s,o]=[u,d,h];break;case 4:[i,s,o]=[f,u,h];break;case 5:[i,s,o]=[h,u,d];break}}return[i,s,o,t.length>3?t[3]:1]},sO=(...t)=>{const[e,n,r]=de(t,"rgb"),i=vp(e,n,r),s=wp(e,n,r),o=s-i,a=o*100/255,c=i/(255-o)*100;let l;return o===0?l=Number.NaN:(e===s&&(l=(n-r)/o),n===s&&(l=2+(r-e)/o),r===s&&(l=4+(e-n)/o),l*=60,l<0&&(l+=360)),[l,a,c]};V.prototype.hcg=function(){return sO(this._rgb)};const oO=(...t)=>new V(...t,"hcg");we.hcg=oO,ue.format.hcg=iO,ue.autodetect.push({p:1,test:(...t)=>{if(t=de(t,"hcg"),me(t)==="array"&&t.length===3)return"hcg"}});const aO=(t,e,n)=>oo(t,e,n,"hcg");Lt.hcg=aO;const{cos:ao}=Math,cO=(...t)=>{t=de(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*ao(Or*e)/ao(Tp-Or*e))/3,s=1-(o+i)):e<2/3?(e-=1/3,i=(1-n)/3,s=(1+n*ao(Or*e)/ao(Tp-Or*e))/3,o=1-(i+s)):(e-=2/3,s=(1-n)/3,o=(1+n*ao(Or*e)/ao(Tp-Or*e))/3,i=1-(s+o)),i=ps(r*i*3),s=ps(r*s*3),o=ps(r*o*3),[i*255,s*255,o*255,t.length>3?t[3]:1]},{min:lO,sqrt:uO,acos:dO}=Math,fO=(...t)=>{let[e,n,r]=de(t,"rgb");e/=255,n/=255,r/=255;let i;const s=lO(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/=uO((e-n)*(e-n)+(e-r)*(n-r)),i=dO(i),r>n&&(i=Or-i),i/=Or),[i*360,a,o]};V.prototype.hsi=function(){return fO(this._rgb)};const hO=(...t)=>new V(...t,"hsi");we.hsi=hO,ue.format.hsi=cO,ue.autodetect.push({p:2,test:(...t)=>{if(t=de(t,"hsi"),me(t)==="array"&&t.length===3)return"hsi"}});const pO=(t,e,n)=>oo(t,e,n,"hsi");Lt.hsi=pO;const Ip=(...t)=>{t=de(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],l=r<.5?r*(1+n):r+n-r*n,u=2*r-l,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]=u+(l-u)*6*a[f]:2*a[f]<1?c[f]=l:3*a[f]<2?c[f]=u+(l-u)*(2/3-a[f])*6:c[f]=u;[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]},qb=(...t)=>{t=de(t,"rgba");let[e,n,r]=t;e/=255,n/=255,r/=255;const i=vp(e,n,r),s=wp(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]};V.prototype.hsl=function(){return qb(this._rgb)};const gO=(...t)=>new V(...t,"hsl");we.hsl=gO,ue.format.hsl=Ip,ue.autodetect.push({p:2,test:(...t)=>{if(t=de(t,"hsl"),me(t)==="array"&&t.length===3)return"hsl"}});const mO=(t,e,n)=>oo(t,e,n,"hsl");Lt.hsl=mO;const{floor:yO}=Math,vO=(...t)=>{t=de(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=yO(e),c=e-a,l=r*(1-n),u=r*(1-n*c),d=r*(1-n*(1-c));switch(a){case 0:[i,s,o]=[r,d,l];break;case 1:[i,s,o]=[u,r,l];break;case 2:[i,s,o]=[l,r,d];break;case 3:[i,s,o]=[l,u,r];break;case 4:[i,s,o]=[d,l,r];break;case 5:[i,s,o]=[r,l,u];break}}return[i,s,o,t.length>3?t[3]:1]},{min:wO,max:bO}=Math,TO=(...t)=>{t=de(t,"rgb");let[e,n,r]=t;const i=wO(e,n,r),s=bO(e,n,r),o=s-i;let a,c,l;return l=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,l]};V.prototype.hsv=function(){return TO(this._rgb)};const EO=(...t)=>new V(...t,"hsv");we.hsv=EO,ue.format.hsv=vO,ue.autodetect.push({p:2,test:(...t)=>{if(t=de(t,"hsv"),me(t)==="array"&&t.length===3)return"hsv"}});const RO=(t,e,n)=>oo(t,e,n,"hsv");Lt.hsv=RO;function au(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,l,u)=>c+l*(a[u]||0),0):a.reduce((c,l)=>c+l*o,0)));return n===1&&(s=s[0]),r===1?s.map(o=>o[0]):s}const Pp=(...t)=>{t=de(t,"lab");const[e,n,r,...i]=t,[s,o,a]=SO([e,n,r]),[c,l,u]=Mb(s,o,a);return[c,l,u,...i.length>0&&i[0]<1?[i[0]]:[]]};function SO(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=au(n,t);return au(e,r.map(i=>i**3))}const xp=(...t)=>{const[e,n,r,...i]=de(t,"rgb"),s=Fb(e,n,r);return[...$O(s),...i.length>0&&i[0]<1?[i[0]]:[]]};function $O(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=au(e,t);return au(n,r.map(i=>Math.cbrt(i)))}V.prototype.oklab=function(){return xp(this._rgb)};const kO=(...t)=>new V(...t,"oklab");Object.assign(we,{oklab:kO}),ue.format.oklab=Pp,ue.autodetect.push({p:2,test:(...t)=>{if(t=de(t,"oklab"),me(t)==="array"&&t.length===3)return"oklab"}});const _O=(t,e,n)=>{const r=t.oklab(),i=e.oklab();return new V(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"oklab")};Lt.oklab=_O;const CO=(t,e,n)=>oo(t,e,n,"oklch");Lt.oklch=CO;const{pow:Np,sqrt:Op,PI:Dp,cos:Wb,sin:Gb,atan2:AO}=Math,IO=(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 V(d)),e==="lrgb")return PO(t,n);const s=t.shift(),o=s.get(e),a=[];let c=0,l=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*Dp;c+=Wb(f)*n[0],l+=Gb(f)*n[0]}let u=s.alpha()*n[0];t.forEach((d,f)=>{const h=d.get(e);u+=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 y=h[p]/180*Dp;c+=Wb(y)*n[f+1],l+=Gb(y)*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=AO(l/a[d],c/a[d])/Dp*180;for(;f<0;)f+=360;for(;f>=360;)f-=360;o[d]=f}else o[d]=o[d]/a[d];return u/=r,new V(o,e).alpha(u>.99999?1:u,!0)},PO=(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]+=Np(a[0],2)*o,r[1]+=Np(a[1],2)*o,r[2]+=Np(a[2],2)*o,r[3]+=a[3]*o}return r[0]=Op(r[0]),r[1]=Op(r[1]),r[2]=Op(r[2]),r[3]>.9999999&&(r[3]=1),new V(yp(r))},{pow:xO}=Math;function cu(t){let e="rgb",n=we("#ccc"),r=0,i=[0,1],s=[],o=[0,0],a=!1,c=[],l=!1,u=0,d=1,f=!1,h={},p=!0,y=1;const $=function(P){if(P=P||["#fff","#000"],P&&me(P)==="string"&&we.brewer&&we.brewer[P.toLowerCase()]&&(P=we.brewer[P.toLowerCase()]),me(P)==="array"){P.length===1&&(P=[P[0],P[0]]),P=P.slice(0);for(let G=0;G<P.length;G++)P[G]=we(P[G]);s.length=0;for(let G=0;G<P.length;G++)s.push(G/(P.length-1))}return x(),c=P},T=function(P){if(a!=null){const G=a.length-1;let B=0;for(;B<G&&P>=a[B];)B++;return B-1}return 0};let w=P=>P,b=P=>P;const _=function(P,G){let B,W;if(G==null&&(G=!1),isNaN(P)||P===null)return n;G?W=P:a&&a.length>2?W=T(P)/(a.length-2):d!==u?W=(P-u)/(d-u):W=1,W=b(W),G||(W=w(W)),y!==1&&(W=xO(W,y)),W=o[0]+W*(1-o[0]-o[1]),W=ps(W,0,1);const I=Math.floor(W*1e4);if(p&&h[I])B=h[I];else{if(me(c)==="array")for(let k=0;k<s.length;k++){const R=s[k];if(W<=R){B=c[k];break}if(W>=R&&k===s.length-1){B=c[k];break}if(W>R&&W<s[k+1]){W=(W-R)/(s[k+1]-R),B=we.interpolate(c[k],c[k+1],W,e);break}}else me(c)==="function"&&(B=c(W));p&&(h[I]=B)}return B};var x=()=>h={};$(t);const F=function(P){const G=we(_(P));return l&&G[l]?G[l]():G};return F.classes=function(P){if(P!=null){if(me(P)==="array")a=P,i=[P[0],P[P.length-1]];else{const G=we.analyze(i);P===0?a=[G.min,G.max]:a=we.limits(G,"e",P)}return F}return a},F.domain=function(P){if(!arguments.length)return i;u=P[0],d=P[P.length-1],s=[];const G=c.length;if(P.length===G&&u!==d)for(let B of Array.from(P))s.push((B-u)/(d-u));else{for(let B=0;B<G;B++)s.push(B/(G-1));if(P.length>2){const B=P.map((I,k)=>k/(P.length-1)),W=P.map(I=>(I-u)/(d-u));W.every((I,k)=>B[k]===I)||(b=I=>{if(I<=0||I>=1)return I;let k=0;for(;I>=W[k+1];)k++;const R=(I-W[k])/(W[k+1]-W[k]);return B[k]+R*(B[k+1]-B[k])})}}return i=[u,d],F},F.mode=function(P){return arguments.length?(e=P,x(),F):e},F.range=function(P,G){return $(P),F},F.out=function(P){return l=P,F},F.spread=function(P){return arguments.length?(r=P,F):r},F.correctLightness=function(P){return P==null&&(P=!0),f=P,x(),f?w=function(G){const B=_(0,!0).lab()[0],W=_(1,!0).lab()[0],I=B>W;let k=_(G,!0).lab()[0];const R=B+(W-B)*G;let M=k-R,q=0,j=1,z=20;for(;Math.abs(M)>.01&&z-- >0;)(function(){return I&&(M*=-1),M<0?(q=G,G+=(j-G)*.5):(j=G,G+=(q-G)*.5),k=_(G,!0).lab()[0],M=k-R})();return G}:w=G=>G,F},F.padding=function(P){return P!=null?(me(P)==="number"&&(P=[P,P]),o=P,F):o},F.colors=function(P,G){arguments.length<2&&(G="hex");let B=[];if(arguments.length===0)B=c.slice(0);else if(P===1)B=[F(.5)];else if(P>1){const W=i[0],I=i[1]-W;B=NO(0,P).map(k=>F(W+k/(P-1)*I))}else{t=[];let W=[];if(a&&a.length>2)for(let I=1,k=a.length,R=1<=k;R?I<k:I>k;R?I++:I--)W.push((a[I-1]+a[I])*.5);else W=i;B=W.map(I=>F(I))}return we[G]&&(B=B.map(W=>W[G]())),B},F.cache=function(P){return P!=null?(p=P,F):p},F.gamma=function(P){return P!=null?(y=P,F):y},F.nodata=function(P){return P!=null?(n=we(P),F):n},F}function NO(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 OO=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},DO=function(t){let e,n,r,i;if(t=t.map(s=>new V(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 V(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 V(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 V(a,"lab")}}else if(t.length>=5){let s,o,a;s=t.map(c=>c.lab()),a=t.length-1,o=OO(a),e=function(c){const l=1-c,u=[0,1,2].map(d=>s.reduce((f,h,p)=>f+o[p]*l**(a-p)*c**p*h[d],0));return new V(u,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return e},LO=t=>{const e=DO(t);return e.scale=()=>cu(e),e},{round:zb}=Math;V.prototype.rgb=function(t=!0){return t===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(zb)},V.prototype.rgba=function(t=!0){return this._rgb.slice(0,4).map((e,n)=>n<3?t===!1?e:zb(e):e)};const MO=(...t)=>new V(...t,"rgb");Object.assign(we,{rgb:MO}),ue.format.rgb=(...t)=>{const e=de(t,"rgba");return e[3]===void 0&&(e[3]=1),e},ue.autodetect.push({p:3,test:(...t)=>{if(t=de(t,"rgba"),me(t)==="array"&&(t.length===3||t.length===4&&me(t[3])=="number"&&t[3]>=0&&t[3]<=1))return"rgb"}});const zn=(t,e,n)=>{if(!zn[n])throw new Error("unknown blend mode "+n);return zn[n](t,e)},wi=t=>(e,n)=>{const r=we(n).rgb(),i=we(e).rgb();return we.rgb(t(r,i))},bi=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},FO=t=>t,jO=(t,e)=>t*e/255,UO=(t,e)=>t>e?e:t,BO=(t,e)=>t>e?t:e,qO=(t,e)=>255*(1-(1-t/255)*(1-e/255)),WO=(t,e)=>e<128?2*t*e/255:255*(1-2*(1-t/255)*(1-e/255)),GO=(t,e)=>255*(1-(1-e/255)/(t/255)),zO=(t,e)=>t===255?255:(t=255*(e/255)/(1-t/255),t>255?255:t);zn.normal=wi(bi(FO)),zn.multiply=wi(bi(jO)),zn.screen=wi(bi(qO)),zn.overlay=wi(bi(WO)),zn.darken=wi(bi(UO)),zn.lighten=wi(bi(BO)),zn.dodge=wi(bi(zO)),zn.burn=wi(bi(GO));const{pow:HO,sin:VO,cos:KO}=Math;function YO(t=300,e=-1.5,n=1,r=1,i=[0,1]){let s=0,o;me(i)==="array"?o=i[1]-i[0]:(o=0,i=[i,i]);const a=function(c){const l=Or*((t+120)/360+e*c),u=HO(i[0]+o*c,r),d=(s!==0?n[0]+c*s:n)*u*(1-u)/2,f=KO(l),h=VO(l),p=u+d*(-.14861*f+1.78277*h),y=u+d*(-.29227*f-.90649*h),$=u+d*(1.97294*f);return we(yp([p*255,y*255,$*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,me(n)==="array"?(s=n[1]-n[0],s===0&&(n=n[1])):s=0,a)},a.lightness=function(c){return c==null?i:(me(c)==="array"?(i=c,o=c[1]-c[0]):(i=[c,c],o=0),a)},a.scale=()=>we.scale(a),a.hue(n),a}const XO="0123456789abcdef",{floor:JO,random:QO}=Math,ZO=()=>{let t="#";for(let e=0;e<6;e++)t+=XO.charAt(JO(QO()*16));return new V(t,"hex")},{log:Hb,pow:eD,floor:tD,abs:nD}=Math;function Vb(t,e=null){const n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return me(t)==="object"&&(t=Object.values(t)),t.forEach(r=>{e&&me(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)=>Kb(n,r,i),n}function Kb(t,e="equal",n=7){me(t)=="array"&&(t=Vb(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*Hb(r),c=Math.LOG10E*Hb(i);o.push(r);for(let l=1;l<n;l++)o.push(eD(10,a+l/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,l=tD(c);if(l===c)o.push(s[l]);else{const u=c-l;o.push(s[l]*(1-u)+s[l+1]*u)}}o.push(i)}else if(e.substr(0,1)==="k"){let a;const c=s.length,l=new Array(c),u=new Array(n);let d=!0,f=0,h=null;h=[],h.push(r);for(let $=1;$<n;$++)h.push(r+$/n*(i-r));for(h.push(i);d;){for(let T=0;T<n;T++)u[T]=0;for(let T=0;T<c;T++){const w=s[T];let b=Number.MAX_VALUE,_;for(let x=0;x<n;x++){const F=nD(h[x]-w);F<b&&(b=F,_=x),u[_]++,l[T]=_}}const $=new Array(n);for(let T=0;T<n;T++)$[T]=null;for(let T=0;T<c;T++)a=l[T],$[a]===null?$[a]=s[T]:$[a]+=s[T];for(let T=0;T<n;T++)$[T]*=1/u[T];d=!1;for(let T=0;T<n;T++)if($[T]!==h[T]){d=!0;break}h=$,f++,f>200&&(d=!1)}const p={};for(let $=0;$<n;$++)p[$]=[];for(let $=0;$<c;$++)a=l[$],p[a].push(s[$]);let y=[];for(let $=0;$<n;$++)y.push(p[$][0]),y.push(p[$][p[$].length-1]);y=y.sort(($,T)=>$-T),o.push(y[0]);for(let $=1;$<y.length;$+=2){const T=y[$];!isNaN(T)&&o.indexOf(T)===-1&&o.push(T)}}return o}const rD=(t,e)=>{t=new V(t),e=new V(e);const n=t.luminance(),r=e.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},{sqrt:Lr,pow:ht,min:iD,max:sD,atan2:Yb,abs:Xb,cos:lu,sin:Jb,exp:oD,PI:Qb}=Math;function aD(t,e,n=1,r=1,i=1){var s=function(It){return 360*It/(2*Qb)},o=function(It){return 2*Qb*It/360};t=new V(t),e=new V(e);const[a,c,l]=Array.from(t.lab()),[u,d,f]=Array.from(e.lab()),h=(a+u)/2,p=Lr(ht(c,2)+ht(l,2)),y=Lr(ht(d,2)+ht(f,2)),$=(p+y)/2,T=.5*(1-Lr(ht($,7)/(ht($,7)+ht(25,7)))),w=c*(1+T),b=d*(1+T),_=Lr(ht(w,2)+ht(l,2)),x=Lr(ht(b,2)+ht(f,2)),F=(_+x)/2,P=s(Yb(l,w)),G=s(Yb(f,b)),B=P>=0?P:P+360,W=G>=0?G:G+360,I=Xb(B-W)>180?(B+W+360)/2:(B+W)/2,k=1-.17*lu(o(I-30))+.24*lu(o(2*I))+.32*lu(o(3*I+6))-.2*lu(o(4*I-63));let R=W-B;R=Xb(R)<=180?R:W<=B?R+360:R-360,R=2*Lr(_*x)*Jb(o(R)/2);const M=u-a,q=x-_,j=1+.015*ht(h-50,2)/Lr(20+ht(h-50,2)),z=1+.045*F,J=1+.015*F*k,U=30*oD(-ht((I-275)/25,2)),ce=-(2*Lr(ht(F,7)/(ht(F,7)+ht(25,7))))*Jb(2*o(U)),Qe=Lr(ht(M/(n*j),2)+ht(q/(r*z),2)+ht(R/(i*J),2)+ce*(q/(r*z))*(R/(i*J)));return sD(0,iD(100,Qe))}function cD(t,e,n="lab"){t=new V(t),e=new V(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 lD=(...t)=>{try{return new V(...t),!0}catch{return!1}},uD={cool(){return cu([we.hsl(180,1,.9),we.hsl(250,.7,.4)])},hot(){return cu(["#000","#f00","#ff0","#fff"]).mode("rgb")}},uu={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"]};for(let t of Object.keys(uu))uu[t.toLowerCase()]=uu[t];const dD=(...t)=>{t=de(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:Zb}=Math,fD=(...t)=>{let[e,n,r]=de(t,"rgb");e=e/255,n=n/255,r=r/255;const i=1-Zb(e,Zb(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]};V.prototype.cmyk=function(){return fD(this._rgb)};const hD=(...t)=>new V(...t,"cmyk");Object.assign(we,{cmyk:hD}),ue.format.cmyk=dD,ue.autodetect.push({p:2,test:(...t)=>{if(t=de(t,"cmyk"),me(t)==="array"&&t.length===4)return"cmyk"}});const pD=(...t)=>{const e=de(t,"hsla");let n=ro(t)||"lsa";return e[0]=$n(e[0]||0)+"deg",e[1]=$n(e[1]*100)+"%",e[2]=$n(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(" ")})`},gD=(...t)=>{const e=de(t,"lab");let n=ro(t)||"lab";return e[0]=$n(e[0])+"%",e[1]=$n(e[1]),e[2]=$n(e[2]),n==="laba"||e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`lab(${e.join(" ")})`},mD=(...t)=>{const e=de(t,"lch");let n=ro(t)||"lab";return e[0]=$n(e[0])+"%",e[1]=$n(e[1]),e[2]=$n(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(" ")})`},yD=(...t)=>{const e=de(t,"lab");return e[0]=$n(e[0]*100)+"%",e[1]=bp(e[1]),e[2]=bp(e[2]),e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`oklab(${e.join(" ")})`},e0=(...t)=>{const[e,n,r,...i]=de(t,"rgb"),[s,o,a]=xp(e,n,r),[c,l,u]=Ub(s,o,a);return[c,l,u,...i.length>0&&i[0]<1?[i[0]]:[]]},vD=(...t)=>{const e=de(t,"lab");return e[0]=$n(e[0]*100)+"%",e[1]=bp(e[1]),e[2]=$n(e[2])+"deg",e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`oklch(${e.join(" ")})`},{round:Lp}=Math,wD=(...t)=>{const e=de(t,"rgba");let n=ro(t)||"rgb";if(n.substr(0,3)==="hsl")return pD(qb(e),n);if(n.substr(0,3)==="lab"){const r=ha();Dr("d50");const i=gD(Sp(e),n);return Dr(r),i}if(n.substr(0,3)==="lch"){const r=ha();Dr("d50");const i=mD(Cp(e),n);return Dr(r),i}return n.substr(0,5)==="oklab"?yD(xp(e)):n.substr(0,5)==="oklch"?vD(e0(e)):(e[0]=Lp(e[0]),e[1]=Lp(e[1]),e[2]=Lp(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(" ")})`)},t0=(...t)=>{t=de(t,"lch");const[e,n,r,...i]=t,[s,o,a]=jb(e,n,r),[c,l,u]=Pp(s,o,a);return[c,l,u,...i.length>0&&i[0]<1?[i[0]]:[]]},n0=/^rgb\(\s*(-?\d+) \s*(-?\d+)\s* \s*(-?\d+)\s*\)$/,r0=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,i0=/^rgba?\(\s*(-?\d+) \s*(-?\d+)\s* \s*(-?\d+)\s*\/\s*([01]|[01]?\.\d+)\)$/,s0=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,o0=/^rgb\(\s*(-?\d+(?:\.\d+)?)% \s*(-?\d+(?:\.\d+)?)%\s* \s*(-?\d+(?:\.\d+)?)%\s*\)$/,a0=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,c0=/^rgba?\(\s*(-?\d+(?:\.\d+)?)% \s*(-?\d+(?:\.\d+)?)%\s* \s*(-?\d+(?:\.\d+)?)%\s*\/\s*([01]|[01]?\.\d+)\)$/,l0=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,u0=/^hsl\(\s*(-?\d+(?:\.\d+)?)deg \s*(-?\d+(?:\.\d+)?)%\s* \s*(-?\d+(?:\.\d+)?)%\s*\)$/,d0=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,f0=/^hsla?\(\s*(-?\d+(?:\.\d+)?)deg \s*(-?\d+(?:\.\d+)?)%\s* \s*(-?\d+(?:\.\d+)?)%\s*\/\s*([01]|[01]?\.\d+)\)$/,h0=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,p0=/^lab\(\s*(-?\d+(?:\.\d+)?%?) \s*(-?\d+(?:\.\d+)?%?) \s*(-?\d+(?:\.\d+)?%?)\s*(?:\/\s*(\d+(?:\.\d+)?))?\)?$/,g0=/^lch\(\s*(-?\d+(?:\.\d+)?%?) \s*((?:-?\d+(?:\.\d+)?%?)|none) \s*(-?\d+(?:\.\d+)?(?:deg)?|none)\s*(?:\/\s*(\d+(?:\.\d+)?))?\)?$/,m0=/^oklab\(\s*(-?\d+(?:\.\d+)?%?) \s*(-?\d+(?:\.\d+)?%?) \s*(-?\d+(?:\.\d+)?%?)\s*(?:\/\s*(\d+(?:\.\d+)?))?\)?$/,y0=/^oklch\(\s*(-?\d+(?:\.\d+)?%?) \s*(?:(-?\d+(?:\.\d+)?%?)|none) \s*(-?\d+(?:\.\d+)?(?:deg)?|none)\s*(?:\/\s*(\d+(?:\.\d+)?))?\)?$/,{round:ga}=Math,du=t=>t.map((e,n)=>n<=2?ps(ga(e),0,255):e),lr=(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),fu=(t,e)=>t==="none"?e:t,Mp=t=>{t=t.toLowerCase().trim();let e;if(ue.format.named)try{return ue.format.named(t)}catch{}if((e=t.match(n0))||(e=t.match(r0))){const n=e.slice(1,4);for(let r=0;r<3;r++)n[r]=+n[r];return n[3]=1,n}if((e=t.match(i0))||(e=t.match(s0))){const n=e.slice(1,5);for(let r=0;r<4;r++)n[r]=+n[r];return n}if((e=t.match(o0))||(e=t.match(a0))){const n=e.slice(1,4);for(let r=0;r<3;r++)n[r]=ga(n[r]*2.55);return n[3]=1,n}if((e=t.match(c0))||(e=t.match(l0))){const n=e.slice(1,5);for(let r=0;r<3;r++)n[r]=ga(n[r]*2.55);return n[3]=+n[3],n}if((e=t.match(u0))||(e=t.match(d0))){const n=e.slice(1,4);n[1]*=.01,n[2]*=.01;const r=Ip(n);for(let i=0;i<3;i++)r[i]=ga(r[i]);return r[3]=1,r}if((e=t.match(f0))||(e=t.match(h0))){const n=e.slice(1,4);n[1]*=.01,n[2]*=.01;const r=Ip(n);for(let i=0;i<3;i++)r[i]=ga(r[i]);return r[3]=+e[4],r}if(e=t.match(p0)){const n=e.slice(1,4);n[0]=lr(n[0],0,100),n[1]=lr(n[1],-125,125,!0),n[2]=lr(n[2],-125,125,!0);const r=ha();Dr("d50");const i=du(Ep(n));return Dr(r),i[3]=e[4]!==void 0?+e[4]:1,i}if(e=t.match(g0)){const n=e.slice(1,4);n[0]=lr(n[0],0,100),n[1]=lr(fu(n[1],0),0,150,!1),n[2]=+fu(n[2].replace("deg",""),0);const r=ha();Dr("d50");const i=du(_p(n));return Dr(r),i[3]=e[4]!==void 0?+e[4]:1,i}if(e=t.match(m0)){const n=e.slice(1,4);n[0]=lr(n[0],0,1),n[1]=lr(n[1],-.4,.4,!0),n[2]=lr(n[2],-.4,.4,!0);const r=du(Pp(n));return r[3]=e[4]!==void 0?+e[4]:1,r}if(e=t.match(y0)){const n=e.slice(1,4);n[0]=lr(n[0],0,1),n[1]=lr(fu(n[1],0),0,.4,!1),n[2]=+fu(n[2].replace("deg",""),0);const r=du(t0(n));return r[3]=e[4]!==void 0?+e[4]:1,r}};Mp.test=t=>n0.test(t)||i0.test(t)||o0.test(t)||c0.test(t)||u0.test(t)||f0.test(t)||p0.test(t)||g0.test(t)||m0.test(t)||y0.test(t)||r0.test(t)||s0.test(t)||a0.test(t)||l0.test(t)||d0.test(t)||h0.test(t),V.prototype.css=function(t){return wD(this._rgb,t)};const bD=(...t)=>new V(...t,"css");we.css=bD,ue.format.css=Mp,ue.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&me(t)==="string"&&Mp.test(t))return"css"}}),ue.format.gl=(...t)=>{const e=de(t,"rgba");return e[0]*=255,e[1]*=255,e[2]*=255,e};const TD=(...t)=>new V(...t,"gl");we.gl=TD,V.prototype.gl=function(){const t=this._rgb;return[t[0]/255,t[1]/255,t[2]/255,t[3]]},V.prototype.hex=function(t){return Lb(this._rgb,t)};const ED=(...t)=>new V(...t,"hex");we.hex=ED,ue.format.hex=Db,ue.autodetect.push({p:4,test:(t,...e)=>{if(!e.length&&me(t)==="string"&&[3,4,5,6,7,8,9].indexOf(t.length)>=0)return"hex"}});const{log:hu}=Math,v0=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*hu(r),i=e<20?0:-254.76935184120902+.8274096064007395*(i=e-10)+115.67994401066147*hu(i)):(n=351.97690566805693+.114206453784165*(n=e-55)-40.25366309332127*hu(n),r=325.4494125711974+.07943456536662342*(r=e-50)-28.0852963507957*hu(r),i=255),[n,r,i,1]},{round:RD}=Math,SD=(...t)=>{const e=de(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=v0(a);c[2]/c[0]>=r/n?s=a:i=a}return RD(a)};V.prototype.temp=V.prototype.kelvin=V.prototype.temperature=function(){return SD(this._rgb)};const Fp=(...t)=>new V(...t,"temp");Object.assign(we,{temp:Fp,kelvin:Fp,temperature:Fp}),ue.format.temp=ue.format.kelvin=ue.format.temperature=v0,V.prototype.oklch=function(){return e0(this._rgb)};const $D=(...t)=>new V(...t,"oklch");Object.assign(we,{oklch:$D}),ue.format.oklch=t0,ue.autodetect.push({p:2,test:(...t)=>{if(t=de(t,"oklch"),me(t)==="array"&&t.length===3)return"oklch"}}),Object.assign(we,{analyze:Vb,average:IO,bezier:LO,blend:zn,brewer:uu,Color:V,colors:io,contrast:rD,cubehelix:YO,deltaE:aD,distance:cD,input:ue,interpolate:pa,limits:Kb,mix:pa,random:ZO,scale:cu,scales:uD,valid:lD});const jp=[.96,.907,.805,.697,.605,.547,.518,.445,.395,.34],w0=[.32,.16,.08,.04,0,0,.04,.08,.16,.32];function kD(t){const e=t.get("hsl.l");return jp.reduce((n,r)=>Math.abs(r-e)<Math.abs(n-e)?r:n)}function _D(t){const e=we(t),n=kD(e),r=jp.findIndex(s=>s===n),i=jp.map(s=>e.set("hsl.l",s)).map(s=>we(s)).map((s,o)=>{const a=w0[o]-w0[r];return a>=0?s.saturate(a):s.desaturate(a*-1)});return{baseColorIndex:r,colors:i}}function CD(t){return _D(t).colors.map(e=>e.hex())}const b0={fill:"#3b82f6",stroke:"#2563eb",hiContrast:"#eff6ff",loContrast:"#bfdbfe"},T0={fill:"#0284c7",stroke:"#0369a1",hiContrast:"#f0f9ff",loContrast:"#B6ECF7"},E0={fill:"#64748b",stroke:"#475569",hiContrast:"#f8fafc",loContrast:"#cbd5e1"},R0={primary:b0,blue:b0,secondary:T0,sky:T0,muted:E0,slate:E0,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"}},AD={lineColor:"#6E6E6E",labelBgColor:"#18191b",labelColor:"#C6C6C6"},S0={lineColor:"#64748b",labelBgColor:"#0f172a",labelColor:"#cbd5e1"},$0={lineColor:"#3b82f6",labelBgColor:"#172554",labelColor:"#60a5fa"},k0={lineColor:"#0ea5e9",labelBgColor:"#082f49",labelColor:"#38bdf8"},_0={amber:{lineColor:"#b45309",labelBgColor:"#78350f",labelColor:"#FFE0C2"},blue:$0,gray:AD,green:{lineColor:"#15803d",labelBgColor:"#052e16",labelColor:"#22c55e"},indigo:{lineColor:"#6366f1",labelBgColor:"#1e1b4b",labelColor:"#818cf8"},muted:S0,primary:$0,red:{lineColor:"#AC4D39",labelBgColor:"#b91c1c",labelColor:"#f5b2a3"},secondary:k0,sky:k0,slate:S0},kn={elements:R0,relationships:_0,font:"Arial",shadow:"#0a0a0a"};function ID(t){if(t.match(/^#([0-9a-f]{3}){1,2}$/i)){const e=CD(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:kn.elements.primary,relationships:kn.relationships.primary}}function Up(...t){return tu(Object.values,t)}function C0(...t){return tu(PD,t)}var PD=(t,e)=>t.length>=e;function Rt(t){return typeof t=="string"}function A0(t){return!!t}function pu(t){return t!=null&&typeof t=="string"}function gs(t){return!!t&&Array.isArray(t)&&t.length>0}function ma(t){const e=t.lastIndexOf(".");return e>0?t.slice(e+1):t}function ur(...t){const e=pu(t[0])?t[0]:t[0].id;return(pu(t[1])?t[1]:t[1].id).startsWith(e+".")}function gu(t,e){const n=pu(t)?t:t.id,r=pu(e)?e:e.id;return n===r||r.startsWith(n+".")||n.startsWith(r+".")}function I0(t){const e=t.flatMap(n=>[r=>r.id===n.id,r=>ur(n,r)]);return n=>e.some(r=>r(n))}function xD(t){const e=I0(t);return n=>!e(n)}function ms(t,e){const n=pt(t),r=pt(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 pt(t){const e=t.lastIndexOf(".");return e>0?t.slice(0,e):null}function P0(t){const e=t+".";return n=>!!n.parent&&(n.parent===t||n.parent.startsWith(e))}function Hn(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 co(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 mu(t,e){return co(t.id,e.id)}let yu=class Yw{constructor(e,n){this.view=e,this.model=n;for(const r of e.nodes){const i=new Yw.Element(r,this);this.#t.set(r.id,i),fa(r.parent)&&this.#e.add(i)}this.#n=new Map(e.edges.map(r=>[r.id,new Yw.Connection(r,this)]))}#e=new Set;#t=new Map;#n;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.#e]}elements(){return[...this.#t.values()]}element(e){return rt(this.#t.get(e),`LikeC4ViewModel.Element ${e} in view ${this.view.id} not found`)}hasElement(e){return this.#t.has(e)}connections(){return[...this.#n.values()]}connection(e){return rt(this.#n.get(e),`Connection ${e} in view ${this.view.id} not found`)}findConnections(e,n,r="direct"){const i=Rt(e)?e:e.id,s=Rt(n)?n:n.id;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(Rt(e)?e:e.id);return n.node.parent?this.element(n.node.parent):null}children(e){return this.element(Rt(e)?e:e.id).node.children.map(n=>this.element(n))}siblings(e){const n=Rt(e)?e:e.id,r=this.parent(n);return(r?this.children(r):this.roots()).filter(i=>i.id!==n)}ancestors(e){let n=Rt(e)?e:e.id;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(Rt(e)?e:e.id),i=r.node.inEdges.map(s=>rt(this.#n.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(Rt(e)?e:e.id),i=r.node.outEdges.map(s=>rt(this.#n.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 fa(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=>rt(this.viewmodel.model.relationship(i)))}}t.Connection=n})(yu||(yu={}));const Bp=Set,qp=Map;let vu=class np{constructor(e){this.computed=e;for(const n of Up(e.elements))this.addElement(n);for(const n of Up(e.relations))this.addRelation(n);this.#l=new Map(Up(e.views).map(n=>[n.id,new yu(n,this)]))}#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=new Map;#s=new qp;#o=new qp;#a=new qp;#c=new Map;#l;static from(e){return new np(e)}roots(){return[...this.#r]}elements(){return[...this.#e.values()]}element(e){return rt(this.#e.get(e),`Element ${e} not found`)}relationships(){return[...this.#i.values()]}relationship(e){return rt(this.#i.get(e),`Relation ${e} not found`)}views(){return[...this.#l.values()]}view(e){return rt(this.#l.get(e),`View ${e} not found`)}parent(e){const n=Rt(e)?e:e.id;return this.#t.get(n)||null}children(e){const n=Rt(e)?e:e.id;return this._childrenOf(n)}siblings(e){const n=Rt(e)?e:e.id,r=this.#t.get(n);return(r?this._childrenOf(r.id):this.roots()).filter(i=>i.id!==n)}ancestors(e){let n=Rt(e)?e:e.id;const r=[];let i;for(;i=this.#t.get(n);)r.push(i),n=i.id;return r}descendants(e){const n=Rt(e)?e:e.id;return this._childrenOf(n).flatMap(r=>[r,...this.descendants(r.id)])}incoming(e,n="all"){const r=Rt(e)?e:e.id,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=Rt(e)?e:e.id,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=Rt(e)?e:e.id;return Array.from(this._internalOf(n))}ascendingSiblings(e){const n=Rt(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()}viewsWithElement(e){const n=Rt(e)?e:e.id;return[...this.#l.values()].filter(r=>r.hasElement(n))}addElement(e){if(this.#e.has(e.id))throw new Error(`Element ${e.id} already exists`);const n=new np.Element(e,this);this.#e.set(n.id,n);const r=pt(n.id);r?(this.#t.set(n.id,this.element(r)),this._childrenOf(r).push(n)):this.#r.add(n)}addRelation(e){if(this.#i.has(e.id))throw new Error(`Relation ${e.id} already exists`);const n=new np.Relationship(e,this);this.#i.set(n.id,n),this._incomingTo(e.target).add(n),this._outgoingFrom(e.source).add(n);const r=ms(e.source,e.target);if(r)for(const i of[r,...Hn(r)])this._internalOf(i).add(n);for(const i of Hn(e.source)){if(i===r)break;this._outgoingFrom(i).add(n)}for(const i of Hn(e.target)){if(i===r)break;this._incomingTo(i).add(n)}}_childrenOf(e){let n=this.#n.get(e);return n||(n=[],this.#n.set(e,n)),n}_incomingTo(e){let n=this.#s.get(e);return n||(n=new Bp,this.#s.set(e,n)),n}_outgoingFrom(e){let n=this.#o.get(e);return n||(n=new Bp,this.#o.set(e,n)),n}_internalOf(e){let n=this.#a.get(e);return n||(n=new Bp,this.#a.set(e,n)),n}};(t=>{class e{constructor(i,s){this.element=i,this.model=s}get id(){return this.element.id}get title(){return this.element.title}get kind(){return this.element.kind}get isRoot(){return pt(this.element.id)===null}get hasNested(){return this.model.children(this).length>0}get shape(){return this.element.shape??pb}get color(){return this.element.color??nu}get tags(){return this.element.tags??[]}parent(){return this.model.parent(this)}metadata(i,s){return this.element.metadata?.[i]??s}hasMetadata(i){return A0(this.element.metadata?.[i])}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(i){return this.model.incoming(this,i)}incomers(i){return this.model.incomers(this,i)}outgoing(i){return this.model.outgoing(this,i)}outgoers(i){return this.model.outgoers(this,i)}internal(){return this.model.internal(this)}}t.Element=e;class n{constructor(i,s){this.relationship=i,this.model=s}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(i,s){return this.relationship.metadata?.[i]??s}hasMetadata(i){return A0(this.relationship.metadata?.[i])}}t.Relationship=n})(vu||(vu={}));const ND="LIKEC4_DELAY";function x0(t=100){return new Promise(e=>{setTimeout(()=>{e(ND)},t)})}const ya=(t,e)=>{const n=ms(t.source,t.target),r=ms(e.source,e.target);if(n&&!r)return 1;if(!n&&r)return-1;const i=n&&r?co(n,r):0;if(i===0){const s=co(t.source,e.source);return s!==0?s:co(t.target,e.target)}return i};function it(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function _n(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}function OD(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function wu(t){return typeof t=="object"&&t!==null&&it(t.container)&&_n(t.reference)&&typeof t.message=="string"}class N0{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,n){return it(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 Ti(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function va(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function O0(t){return Ti(t)&&typeof t.fullText=="string"}class Et{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 Et(()=>({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 Wt})}join(e=","){const n=this.iterator();let r="",i,s=!1;do i=n.next(),i.done||(s&&(r+=e),r+=DD(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 Et(this.startFn,n=>{const{done:r,value:i}=this.nextFn(n);return r?Wt:{done:!1,value:e(i)}})}filter(e){return new Et(this.startFn,n=>{let r;do if(r=this.nextFn(n),!r.done&&e(r.value))return r;while(!r.done);return Wt})}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 Et(()=>({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(bu(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(n.iterator);return Wt})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const n=e>1?this.flat(e-1):this;return new Et(()=>({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(bu(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(r.iterator);return Wt})}head(){const n=this.iterator().next();if(!n.done)return n.value}tail(e=1){return new Et(()=>{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 Et(()=>({size:0,state:this.startFn()}),n=>(n.size++,n.size>e?Wt:this.nextFn(n.state)))}distinct(e){return new Et(()=>({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 Wt})}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 DD(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function bu(t){return!!t&&typeof t[Symbol.iterator]=="function"}const Tu=new Et(()=>{},()=>Wt),Wt=Object.freeze({done:!0,value:void 0});function De(...t){if(t.length===1){const e=t[0];if(e instanceof Et)return e;if(bu(e))return new Et(()=>e[Symbol.iterator](),n=>n.next());if(typeof e.length=="number")return new Et(()=>({index:0}),n=>n.index<e.length?{done:!1,value:e[n.index++]}:Wt)}return t.length>1?new Et(()=>({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++];bu(n)?e.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(e.array=n)}}while(e.iterator||e.array||e.collIndex<t.length);return Wt}):Tu}class wa extends Et{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 Wt})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Wp;(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})(Wp||(Wp={}));function ba(t){return new wa(t,e=>Ti(e)?e.content:[],{includeRoot:!0})}function D0(t){return ba(t).filter(va)}function L0(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function Eu(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function Ta(t){if(!t)return;const{offset:e,end:n,range:r}=t;return{range:r,offset:e,end:n,length:n-e}}var dr;(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"})(dr||(dr={}));function M0(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return dr.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return dr.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?dr.Inside:n?dr.OverlapBack:r?dr.OverlapFront:dr.Outside}function Gp(t,e){return M0(t,e)>dr.After}const zp=/^[\w\p{L}]$/u;function Ei(t,e,n=zp){if(t){if(e>0){const r=e-t.offset,i=t.text.charAt(r);n.test(i)||e--}return Vp(t,e)}}function Ru(t,e){if(t){const n=j0(t,!0);if(n&&Hp(n,e))return n;if(O0(t)){const r=t.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){const s=t.content[i];if(Hp(s,e))return s}}}}function Hp(t,e){return va(t)&&e.includes(t.tokenType.name)}function Vp(t,e){if(va(t))return t;if(Ti(t)){const n=F0(t,e,!1);if(n)return Vp(n,e)}}function Su(t,e){if(va(t))return t;if(Ti(t)){const n=F0(t,e,!0);if(n)return Su(n,e)}}function F0(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 j0(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 LD(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 MD(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 FD(t,e){const n=jD(t,e);return n?n.parent.content.slice(n.a+1,n.b):[]}function jD(t,e){const n=U0(t),r=U0(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 U0(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 UD={__proto__:null,DefaultNameRegexp:zp,get RangeComparison(){return dr},compareRange:M0,findCommentNode:Ru,findDeclarationNodeAtOffset:Ei,findLeafNodeAtOffset:Vp,findLeafNodeBeforeOffset:Su,flattenCst:D0,getInteriorNodes:FD,getNextNode:LD,getPreviousNode:j0,getStartlineNode:MD,inRange:Gp,isChildNode:L0,isCommentNode:Hp,streamCst:ba,toDocumentSegment:Ta,tokenToRange:Eu};class B0 extends Error{constructor(e,n){super(e?`${n} at ${e.range.start.line}:${e.range.start.character}`:n)}}function $u(t){throw new Error("Error! The input value was not handled.")}const ku="AbstractRule",_u="AbstractType",Kp="Condition",q0="TypeDefinition",Yp="ValueLiteral",Ea="AbstractElement";function Xp(t){return Se.isInstance(t,Ea)}const Cu="ArrayLiteral",Ra="ArrayType";function BD(t){return Se.isInstance(t,Ra)}const Sa="BooleanLiteral";function qD(t){return Se.isInstance(t,Sa)}const $a="Conjunction";function WD(t){return Se.isInstance(t,$a)}const ka="Disjunction";function GD(t){return Se.isInstance(t,ka)}const Au="Grammar",Jp="GrammarImport",_a="InferredType";function W0(t){return Se.isInstance(t,_a)}const Ca="Interface";function G0(t){return Se.isInstance(t,Ca)}const Qp="NamedArgument",Aa="Negation";function zD(t){return Se.isInstance(t,Aa)}const Iu="NumberLiteral",Pu="Parameter",Ia="ParameterReference";function HD(t){return Se.isInstance(t,Ia)}const Pa="ParserRule";function Mt(t){return Se.isInstance(t,Pa)}const xa="ReferenceType";function VD(t){return Se.isInstance(t,xa)}const xu="ReturnType";function KD(t){return Se.isInstance(t,xu)}const Na="SimpleType";function z0(t){return Se.isInstance(t,Na)}const Nu="StringLiteral",lo="TerminalRule";function Mr(t){return Se.isInstance(t,lo)}const Oa="Type";function Zp(t){return Se.isInstance(t,Oa)}const eg="TypeAttribute",Da="UnionType";function YD(t){return Se.isInstance(t,Da)}const La="Action";function ys(t){return Se.isInstance(t,La)}const Ma="Alternatives";function tg(t){return Se.isInstance(t,Ma)}const Fa="Assignment";function fr(t){return Se.isInstance(t,Fa)}const ja="CharacterRange";function XD(t){return Se.isInstance(t,ja)}const Ua="CrossReference";function Ba(t){return Se.isInstance(t,Ua)}const qa="EndOfFile";function JD(t){return Se.isInstance(t,qa)}const Wa="Group";function Ri(t){return Se.isInstance(t,Wa)}const Ga="Keyword";function hr(t){return Se.isInstance(t,Ga)}const za="NegatedToken";function QD(t){return Se.isInstance(t,za)}const Ha="RegexToken";function ZD(t){return Se.isInstance(t,Ha)}const Va="RuleCall";function Fr(t){return Se.isInstance(t,Va)}const Ka="TerminalAlternatives";function eL(t){return Se.isInstance(t,Ka)}const Ya="TerminalGroup";function tL(t){return Se.isInstance(t,Ya)}const Xa="TerminalRuleCall";function H0(t){return Se.isInstance(t,Xa)}const Ja="UnorderedGroup";function ng(t){return Se.isInstance(t,Ja)}const Qa="UntilToken";function nL(t){return Se.isInstance(t,Qa)}const Za="Wildcard";function rL(t){return Se.isInstance(t,Za)}class V0 extends N0{getAllTypes(){return[Ea,ku,_u,La,Ma,Cu,Ra,Fa,Sa,ja,Kp,$a,Ua,ka,qa,Au,Jp,Wa,_a,Ca,Ga,Qp,za,Aa,Iu,Pu,Ia,Pa,xa,Ha,xu,Va,Na,Nu,Ka,Ya,lo,Xa,Oa,eg,q0,Da,Ja,Qa,Yp,Za]}computeIsSubtype(e,n){switch(e){case La:case Ma:case Fa:case ja:case Ua:case qa:case Wa:case Ga:case za:case Ha:case Va:case Ka:case Ya:case Xa:case Ja:case Qa:case Za:return this.isSubtype(Ea,n);case Cu:case Iu:case Nu:return this.isSubtype(Yp,n);case Ra:case xa:case Na:case Da:return this.isSubtype(q0,n);case Sa:return this.isSubtype(Kp,n)||this.isSubtype(Yp,n);case $a:case ka:case Aa:case Ia:return this.isSubtype(Kp,n);case _a:case Ca:case Oa:return this.isSubtype(_u,n);case Pa:return this.isSubtype(ku,n)||this.isSubtype(_u,n);case lo:return this.isSubtype(ku,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 _u;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return ku;case"Grammar:usedGrammars":return Au;case"NamedArgument:parameter":case"ParameterReference:parameter":return Pu;case"TerminalRuleCall:rule":return lo;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case Ea:return{name:Ea,properties:[{name:"cardinality"},{name:"lookahead"}]};case Cu:return{name:Cu,properties:[{name:"elements",defaultValue:[]}]};case Ra:return{name:Ra,properties:[{name:"elementType"}]};case Sa:return{name:Sa,properties:[{name:"true",defaultValue:!1}]};case $a:return{name:$a,properties:[{name:"left"},{name:"right"}]};case ka:return{name:ka,properties:[{name:"left"},{name:"right"}]};case Au:return{name:Au,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 Jp:return{name:Jp,properties:[{name:"path"}]};case _a:return{name:_a,properties:[{name:"name"}]};case Ca:return{name:Ca,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case Qp:return{name:Qp,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case Aa:return{name:Aa,properties:[{name:"value"}]};case Iu:return{name:Iu,properties:[{name:"value"}]};case Pu:return{name:Pu,properties:[{name:"name"}]};case Ia:return{name:Ia,properties:[{name:"parameter"}]};case Pa:return{name:Pa,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 xa:return{name:xa,properties:[{name:"referenceType"}]};case xu:return{name:xu,properties:[{name:"name"}]};case Na:return{name:Na,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case Nu:return{name:Nu,properties:[{name:"value"}]};case lo:return{name:lo,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case Oa:return{name:Oa,properties:[{name:"name"},{name:"type"}]};case eg:return{name:eg,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case Da:return{name:Da,properties:[{name:"types",defaultValue:[]}]};case La:return{name:La,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case Ma:return{name:Ma,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Fa:return{name:Fa,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 Ua:return{name:Ua,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case qa:return{name:qa,properties:[{name:"cardinality"},{name:"lookahead"}]};case Wa:return{name:Wa,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case Ga:return{name:Ga,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case za:return{name:za,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case Ha:return{name:Ha,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case Va:return{name:Va,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case Ka:return{name:Ka,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Ya:return{name:Ya,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Xa:return{name:Xa,properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case Ja:return{name:Ja,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Qa:return{name:Qa,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case Za:return{name:Za,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const Se=new V0;function rg(t){for(const[e,n]of Object.entries(t))e.startsWith("$")||(Array.isArray(n)?n.forEach((r,i)=>{it(r)&&(r.$container=t,r.$containerProperty=e,r.$containerIndex=i)}):it(n)&&(n.$container=t,n.$containerProperty=e))}function rn(t,e){let n=t;for(;n;){if(e(n))return n;n=n.$container}}function K0(t,e){let n=t;for(;n;){if(e(n))return!0;n=n.$container}return!1}function St(t){const n=Y0(t).$document;if(!n)throw new Error("AST node has no document.");return n}function Y0(t){for(;t.$container;)t=t.$container;return t}function ec(t,e){if(!t)throw new Error("Node must be an AstNode.");const n=e?.range;return new Et(()=>({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(it(s)){if(r.keyIndex++,ig(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(it(a)&&ig(a,n))return{done:!1,value:a}}r.arrayIndex=0}}r.keyIndex++}return Wt})}function jr(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new wa(t,n=>ec(n,e))}function Ur(t,e){if(t){if(e?.range&&!ig(t,e.range))return new wa(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new wa(t,n=>ec(n,e),{includeRoot:!0})}function ig(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)===null||n===void 0?void 0:n.range;return r?Gp(r,e):!1}function Ou(t){return new Et(()=>({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(_n(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(_n(s))return{done:!1,value:{reference:s,container:t,property:n,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Wt})}function iL(t,e=St(t).parseResult.value){const n=[];return Ur(e).forEach(r=>{Ou(r).forEach(i=>{i.reference.ref===t&&n.push(i.reference)})}),De(n)}function sg(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]=X0(i.defaultValue))}function X0(t){return Array.isArray(t)?[...t.map(X0)]:t}function og(t,e){const n={$type:t.$type};for(const[r,i]of Object.entries(t))if(!r.startsWith("$"))if(it(i))n[r]=og(i,e);else if(_n(i))n[r]=e(n,r,i.$refNode,i.$refText);else if(Array.isArray(i)){const s=[];for(const o of i)it(o)?s.push(og(o,e)):_n(o)?s.push(e(n,r,o.$refNode,o.$refText)):s.push(o);n[r]=s}else n[r]=i;return rg(n),n}const Du={__proto__:null,assignMandatoryProperties:sg,copyAstNode:og,findLocalReferences:iL,findRootNode:Y0,getContainerOfType:rn,getDocument:St,hasContainerOfType:K0,linkContentToContainer:rg,streamAllContents:jr,streamAst:Ur,streamContents:ec,streamReferences:Ou};function oe(t){return t.charCodeAt(0)}function ag(t,e){Array.isArray(t)?t.forEach(function(n){e.push(n)}):e.push(t)}function tc(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function uo(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function sL(){throw Error("Internal Error - Should never get here!")}function J0(t){return t.type==="Character"}const Lu=[];for(let t=oe("0");t<=oe("9");t++)Lu.push(t);const Mu=[oe("_")].concat(Lu);for(let t=oe("a");t<=oe("z");t++)Mu.push(t);for(let t=oe("A");t<=oe("Z");t++)Mu.push(t);const Q0=[oe(" "),oe("\f"),oe(`
|
|
2
|
-
`),oe("\r"),oe(" "),oe("\v"),oe(" "),oe("\xA0"),oe("\u1680"),oe("\u2000"),oe("\u2001"),oe("\u2002"),oe("\u2003"),oe("\u2004"),oe("\u2005"),oe("\u2006"),oe("\u2007"),oe("\u2008"),oe("\u2009"),oe("\u200A"),oe("\u2028"),oe("\u2029"),oe("\u202F"),oe("\u205F"),oe("\u3000"),oe("\uFEFF")],oL=/[0-9a-fA-F]/,Fu=/[0-9]/,aL=/[1-9]/;class Z0{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":tc(r,"global");break;case"i":tc(r,"ignoreCase");break;case"m":tc(r,"multiLine");break;case"u":tc(r,"unicode");break;case"y":tc(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}uo(n);const r=this.disjunction();return this.consumeChar(")"),{type:n,value:r,loc:this.loc(e)}}return sL()}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;uo(n);break}if(!(e===!0&&n===void 0)&&uo(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()),uo(e))return e.loc=this.loc(n),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[oe(`
|
|
3
|
-
`),oe("\r"),oe("\u2028"),oe("\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=Lu;break;case"D":e=Lu,n=!0;break;case"s":e=Q0;break;case"S":e=Q0,n=!0;break;case"w":e=Mu;break;case"W":e=Mu,n=!0;break}if(uo(e))return{type:"Set",value:e,complement:n}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=oe("\f");break;case"n":e=oe(`
|
|
4
|
-
`);break;case"r":e=oe("\r");break;case"t":e=oe(" ");break;case"v":e=oe("\v");break}if(uo(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:oe("\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:oe(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:oe(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,J0(r)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,J0(i)){if(i.value<r.value)throw Error("Range out of order in character class");e.push({from:r.value,to:i.value})}else ag(r.value,e),e.push(oe("-")),ag(i.value,e)}else ag(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:oe("\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(aL.test(e)===!1)throw Error("Expecting a positive integer");for(;Fu.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Fu.test(e)===!1)throw Error("Expecting an integer");for(;Fu.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:oe(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 Fu.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(oL.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 ju{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 eT=/\r?\n/gm,cL=new Z0;class lL extends ju{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=Uu(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 cg=new lL;function uL(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),cg.reset(t),cg.visit(cL.pattern(t)),cg.multiline}catch{return!1}}const dL=`\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 lg(t){const e=typeof t=="string"?new RegExp(t):t;return dL.some(n=>e.test(n))}function Uu(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fL(t){return Array.prototype.map.call(t,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:Uu(e)).join("")}function hL(t,e){const n=pL(t),r=e.match(n);return!!r&&r[0].length>0}function pL(t){typeof t=="string"&&(t=new RegExp(t));const e=t,n=t.source;let r=0;function i(){let s="",o;function a(l){s+=n.substr(r,l),r+=l}function c(l){s+="(?:"+n.substr(r,l)+"|$)",r+=l}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 Bu(t){return t.rules.find(e=>Mt(e)&&e.entry)}function tT(t){return t.rules.filter(e=>Mr(e)&&e.hidden)}function ug(t,e){const n=new Set,r=Bu(t);if(!r)return new Set(t.rules);const i=[r].concat(tT(t));for(const o of i)nT(o,n,e);const s=new Set;for(const o of t.rules)(n.has(o.name)||Mr(o)&&o.hidden)&&s.add(o);return s}function nT(t,e,n){e.add(t.name),jr(t).forEach(r=>{if(Fr(r)||n&&H0(r)){const i=r.rule.ref;i&&!e.has(i.name)&&nT(i,e,n)}})}function dg(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=pg(t.type.ref);return e?.terminal}}function rT(t){return t.hidden&&!lg(rc(t))}function qu(t,e){return!t||!e?[]:fg(t,e,t.astNode,!0)}function pr(t,e,n){if(!t||!e)return;const r=fg(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 fg(t,e,n,r){if(!r){const i=rn(t.grammarSource,fr);if(i&&i.feature===e)return[t]}return Ti(t)&&t.astNode===n?t.content.flatMap(i=>fg(i,e,n,!1)):[]}function iT(t,e){return t?hg(t,e,t?.astNode):[]}function Wu(t,e,n){if(!t)return;const r=hg(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 hg(t,e,n){if(t.astNode!==n)return[];if(hr(t.grammarSource)&&t.grammarSource.value===e)return[t];const r=ba(t).iterator();let i;const s=[];do if(i=r.next(),!i.done){const o=i.value;o.astNode===n?hr(o.grammarSource)&&o.grammarSource.value===e&&s.push(o):r.prune()}while(!i.done);return s}function sT(t){var e;const n=t.astNode;for(;n===((e=t.container)===null||e===void 0?void 0:e.astNode);){const r=rn(t.grammarSource,fr);if(r)return r;t=t.container}}function pg(t){let e=t;return W0(e)&&(ys(e.$container)?e=e.$container.$container:Mt(e.$container)?e=e.$container:$u(e.$container)),oT(t,e,new Map)}function oT(t,e,n){var r;function i(s,o){let a;return rn(s,fr)||(a=oT(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 jr(e)){if(fr(s)&&s.feature.toLowerCase()==="name")return n.set(t,s),s;if(Fr(s)&&Mt(s.rule.ref))return i(s,s.rule.ref);if(z0(s)&&(!((r=s.typeRef)===null||r===void 0)&&r.ref))return i(s,s.typeRef.ref)}}function aT(t){const e=t.$container;if(Ri(e)){const n=e.elements,r=n.indexOf(t);for(let i=r-1;i>=0;i--){const s=n[i];if(ys(s))return s;{const o=jr(n[i]).find(ys);if(o)return o}}}if(Xp(e))return aT(e)}function fo(t,e){return t==="?"||t==="*"||Ri(e)&&!!e.guardCondition}function cT(t){return t==="*"||t==="+"}function gL(t){return t==="+="}function Gu(t){return lT(t,new Set)}function lT(t,e){if(e.has(t))return!0;e.add(t);for(const n of jr(t))if(Fr(n)){if(!n.rule.ref||Mt(n.rule.ref)&&!lT(n.rule.ref,e))return!1}else{if(fr(n))return!1;if(ys(n))return!1}return!!t.definition}function mL(t){return gg(t.type,new Set)}function gg(t,e){if(e.has(t))return!0;if(e.add(t),BD(t))return!1;if(VD(t))return!1;if(YD(t))return t.types.every(n=>gg(n,e));if(z0(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 Zp(n)?gg(n.type,e):!1}else return!1}else return!1}function vs(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(Mt(e))return e.name;if(G0(e)||Zp(e))return e.name}}}function nc(t){var e;if(Mt(t))return Gu(t)?t.name:(e=vs(t))!==null&&e!==void 0?e:t.name;if(G0(t)||Zp(t)||KD(t))return t.name;if(ys(t)){const n=uT(t);if(n)return n}else if(W0(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function uT(t){var e;if(t.inferredType)return t.inferredType.name;if(!((e=t.type)===null||e===void 0)&&e.ref)return nc(t.type.ref)}function yL(t){var e,n,r;return Mr(t)?(n=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:"string":Gu(t)?t.name:(r=vs(t))!==null&&r!==void 0?r:t.name}function dT(t){var e,n,r;return Mr(t)?(n=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:"string":(r=vs(t))!==null&&r!==void 0?r:t.name}function rc(t){const e={s:!1,i:!1,u:!1},n=ho(t.definition,e),r=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(n,r)}const mg=/[\s\S]/.source;function ho(t,e){if(eL(t))return vL(t);if(tL(t))return wL(t);if(XD(t))return EL(t);if(H0(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Br(ho(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}else{if(QD(t))return TL(t);if(nL(t))return bL(t);if(ZD(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")),Br(r,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}else{if(rL(t))return Br(mg,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${t?.$type}`)}}}function vL(t){return Br(t.elements.map(e=>ho(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function wL(t){return Br(t.elements.map(e=>ho(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function bL(t){return Br(`${mg}*?${ho(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function TL(t){return Br(`(?!${ho(t.terminal)})${mg}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function EL(t){return t.right?Br(`[${yg(t.left)}-${yg(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):Br(yg(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function yg(t){return Uu(t.value)}function Br(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 zu={__proto__:null,findAssignment:sT,findNameAssignment:pg,findNodeForKeyword:Wu,findNodeForProperty:pr,findNodesForKeyword:iT,findNodesForKeywordInternal:hg,findNodesForProperty:qu,getActionAtElement:aT,getActionType:uT,getAllReachableRules:ug,getCrossReferenceTerminal:dg,getEntryRule:Bu,getExplicitRuleType:vs,getHiddenRules:tT,getRuleType:dT,getRuleTypeName:yL,getTypeName:nc,isArrayCardinality:cT,isArrayOperator:gL,isCommentTerminal:rT,isDataType:mL,isDataTypeRule:Gu,isOptionalCardinality:fo,terminalRegex:rc};function RL(t){const e=[],n=t.Grammar;for(const r of n.rules)Mr(r)&&rT(r)&&uL(rc(r))&&e.push(r.name);return{multilineCommentRules:e,nameRegexp:zp}}var fT=typeof global=="object"&&global&&global.Object===Object&&global,SL=typeof self=="object"&&self&&self.Object===Object&&self,gr=fT||SL||Function("return this")(),Cn=gr.Symbol,hT=Object.prototype,$L=hT.hasOwnProperty,kL=hT.toString,ic=Cn?Cn.toStringTag:void 0;function _L(t){var e=$L.call(t,ic),n=t[ic];try{t[ic]=void 0;var r=!0}catch{}var i=kL.call(t);return r&&(e?t[ic]=n:delete t[ic]),i}var CL=Object.prototype,AL=CL.toString;function IL(t){return AL.call(t)}var PL="[object Null]",xL="[object Undefined]",pT=Cn?Cn.toStringTag:void 0;function Si(t){return t==null?t===void 0?xL:PL:pT&&pT in Object(t)?_L(t):IL(t)}function Vn(t){return t!=null&&typeof t=="object"}var NL="[object Symbol]";function sc(t){return typeof t=="symbol"||Vn(t)&&Si(t)==NL}function Hu(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 $e=Array.isArray,OL=1/0,gT=Cn?Cn.prototype:void 0,mT=gT?gT.toString:void 0;function yT(t){if(typeof t=="string")return t;if($e(t))return Hu(t,yT)+"";if(sc(t))return mT?mT.call(t):"";var e=t+"";return e=="0"&&1/t==-OL?"-0":e}var DL=/\s/;function LL(t){for(var e=t.length;e--&&DL.test(t.charAt(e)););return e}var ML=/^\s+/;function FL(t){return t&&t.slice(0,LL(t)+1).replace(ML,"")}function An(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var vT=NaN,jL=/^[-+]0x[0-9a-f]+$/i,UL=/^0b[01]+$/i,BL=/^0o[0-7]+$/i,qL=parseInt;function WL(t){if(typeof t=="number")return t;if(sc(t))return vT;if(An(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=An(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=FL(t);var n=UL.test(t);return n||BL.test(t)?qL(t.slice(2),n?2:8):jL.test(t)?vT:+t}var wT=1/0,GL=17976931348623157e292;function zL(t){if(!t)return t===0?t:0;if(t=WL(t),t===wT||t===-wT){var e=t<0?-1:1;return e*GL}return t===t?t:0}function Vu(t){var e=zL(t),n=e%1;return e===e?n?e-n:e:0}function ws(t){return t}var HL="[object AsyncFunction]",VL="[object Function]",KL="[object GeneratorFunction]",YL="[object Proxy]";function qr(t){if(!An(t))return!1;var e=Si(t);return e==VL||e==KL||e==HL||e==YL}var vg=gr["__core-js_shared__"],bT=function(){var t=/[^.]+$/.exec(vg&&vg.keys&&vg.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function XL(t){return!!bT&&bT in t}var JL=Function.prototype,QL=JL.toString;function bs(t){if(t!=null){try{return QL.call(t)}catch{}try{return t+""}catch{}}return""}var ZL=/[\\^$.*+?()[\]{}|]/g,eM=/^\[object .+?Constructor\]$/,tM=Function.prototype,nM=Object.prototype,rM=tM.toString,iM=nM.hasOwnProperty,sM=RegExp("^"+rM.call(iM).replace(ZL,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function oM(t){if(!An(t)||XL(t))return!1;var e=qr(t)?sM:eM;return e.test(bs(t))}function aM(t,e){return t?.[e]}function Ts(t,e){var n=aM(t,e);return oM(n)?n:void 0}var wg=Ts(gr,"WeakMap"),TT=Object.create,cM=function(){function t(){}return function(e){if(!An(e))return{};if(TT)return TT(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function lM(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 bt(){}function uM(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var dM=800,fM=16,hM=Date.now;function pM(t){var e=0,n=0;return function(){var r=hM(),i=fM-(r-n);if(n=r,i>0){if(++e>=dM)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function gM(t){return function(){return t}}var Ku=function(){try{var t=Ts(Object,"defineProperty");return t({},"",{}),t}catch{}}(),mM=Ku?function(t,e){return Ku(t,"toString",{configurable:!0,enumerable:!1,value:gM(e),writable:!0})}:ws,yM=pM(mM);function ET(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function RT(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 vM(t){return t!==t}function wM(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function bg(t,e,n){return e===e?wM(t,e,n):RT(t,vM,n)}function ST(t,e){var n=t==null?0:t.length;return!!n&&bg(t,e,0)>-1}var bM=9007199254740991,TM=/^(?:0|[1-9]\d*)$/;function Yu(t,e){var n=typeof t;return e=e??bM,!!e&&(n=="number"||n!="symbol"&&TM.test(t))&&t>-1&&t%1==0&&t<e}function Tg(t,e,n){e=="__proto__"&&Ku?Ku(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function oc(t,e){return t===e||t!==t&&e!==e}var EM=Object.prototype,RM=EM.hasOwnProperty;function Xu(t,e,n){var r=t[e];(!(RM.call(t,e)&&oc(r,n))||n===void 0&&!(e in t))&&Tg(t,e,n)}function Eg(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?Tg(n,a,c):Xu(n,a,c)}return n}var $T=Math.max;function SM(t,e,n){return e=$T(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=$T(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),lM(t,this,a)}}function Rg(t,e){return yM(SM(t,e,ws),t+"")}var $M=9007199254740991;function Sg(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=$M}function mr(t){return t!=null&&Sg(t.length)&&!qr(t)}function kT(t,e,n){if(!An(n))return!1;var r=typeof e;return(r=="number"?mr(n)&&Yu(e,n.length):r=="string"&&e in n)?oc(n[e],t):!1}function kM(t){return Rg(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&&kT(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 _M=Object.prototype;function ac(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||_M;return t===n}function CM(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var AM="[object Arguments]";function _T(t){return Vn(t)&&Si(t)==AM}var CT=Object.prototype,IM=CT.hasOwnProperty,PM=CT.propertyIsEnumerable,Ju=_T(function(){return arguments}())?_T:function(t){return Vn(t)&&IM.call(t,"callee")&&!PM.call(t,"callee")},ut=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function po(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function xM(){return!1}var AT=typeof exports=="object"&&exports&&!exports.nodeType&&exports,IT=AT&&typeof module=="object"&&module&&!module.nodeType&&module,NM=IT&&IT.exports===AT,PT=NM?gr.Buffer:void 0,OM=PT?PT.isBuffer:void 0,cc=OM||xM,DM="[object Arguments]",LM="[object Array]",MM="[object Boolean]",FM="[object Date]",jM="[object Error]",UM="[object Function]",BM="[object Map]",qM="[object Number]",WM="[object Object]",GM="[object RegExp]",zM="[object Set]",HM="[object String]",VM="[object WeakMap]",KM="[object ArrayBuffer]",YM="[object DataView]",XM="[object Float32Array]",JM="[object Float64Array]",QM="[object Int8Array]",ZM="[object Int16Array]",e2="[object Int32Array]",t2="[object Uint8Array]",n2="[object Uint8ClampedArray]",r2="[object Uint16Array]",i2="[object Uint32Array]",Ge={};Ge[XM]=Ge[JM]=Ge[QM]=Ge[ZM]=Ge[e2]=Ge[t2]=Ge[n2]=Ge[r2]=Ge[i2]=!0,Ge[DM]=Ge[LM]=Ge[KM]=Ge[MM]=Ge[YM]=Ge[FM]=Ge[jM]=Ge[UM]=Ge[BM]=Ge[qM]=Ge[WM]=Ge[GM]=Ge[zM]=Ge[HM]=Ge[VM]=!1;function s2(t){return Vn(t)&&Sg(t.length)&&!!Ge[Si(t)]}function Qu(t){return function(e){return t(e)}}var xT=typeof exports=="object"&&exports&&!exports.nodeType&&exports,lc=xT&&typeof module=="object"&&module&&!module.nodeType&&module,o2=lc&&lc.exports===xT,$g=o2&&fT.process,$i=function(){try{var t=lc&&lc.require&&lc.require("util").types;return t||$g&&$g.binding&&$g.binding("util")}catch{}}(),NT=$i&&$i.isTypedArray,kg=NT?Qu(NT):s2,a2=Object.prototype,c2=a2.hasOwnProperty;function OT(t,e){var n=$e(t),r=!n&&Ju(t),i=!n&&!r&&cc(t),s=!n&&!r&&!i&&kg(t),o=n||r||i||s,a=o?CM(t.length,String):[],c=a.length;for(var l in t)(e||c2.call(t,l))&&!(o&&(l=="length"||i&&(l=="offset"||l=="parent")||s&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Yu(l,c)))&&a.push(l);return a}function DT(t,e){return function(n){return t(e(n))}}var l2=DT(Object.keys,Object),u2=Object.prototype,d2=u2.hasOwnProperty;function LT(t){if(!ac(t))return l2(t);var e=[];for(var n in Object(t))d2.call(t,n)&&n!="constructor"&&e.push(n);return e}function In(t){return mr(t)?OT(t):LT(t)}var f2=Object.prototype,h2=f2.hasOwnProperty,mn=kM(function(t,e){if(ac(e)||mr(e)){Eg(e,In(e),t);return}for(var n in e)h2.call(e,n)&&Xu(t,n,e[n])});function p2(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var g2=Object.prototype,m2=g2.hasOwnProperty;function y2(t){if(!An(t))return p2(t);var e=ac(t),n=[];for(var r in t)r=="constructor"&&(e||!m2.call(t,r))||n.push(r);return n}function MT(t){return mr(t)?OT(t,!0):y2(t)}var v2=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,w2=/^\w*$/;function _g(t,e){if($e(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||sc(t)?!0:w2.test(t)||!v2.test(t)||e!=null&&t in Object(e)}var uc=Ts(Object,"create");function b2(){this.__data__=uc?uc(null):{},this.size=0}function T2(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var E2="__lodash_hash_undefined__",R2=Object.prototype,S2=R2.hasOwnProperty;function $2(t){var e=this.__data__;if(uc){var n=e[t];return n===E2?void 0:n}return S2.call(e,t)?e[t]:void 0}var k2=Object.prototype,_2=k2.hasOwnProperty;function C2(t){var e=this.__data__;return uc?e[t]!==void 0:_2.call(e,t)}var A2="__lodash_hash_undefined__";function I2(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=uc&&e===void 0?A2:e,this}function Es(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])}}Es.prototype.clear=b2,Es.prototype.delete=T2,Es.prototype.get=$2,Es.prototype.has=C2,Es.prototype.set=I2;function P2(){this.__data__=[],this.size=0}function Zu(t,e){for(var n=t.length;n--;)if(oc(t[n][0],e))return n;return-1}var x2=Array.prototype,N2=x2.splice;function O2(t){var e=this.__data__,n=Zu(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():N2.call(e,n,1),--this.size,!0}function D2(t){var e=this.__data__,n=Zu(e,t);return n<0?void 0:e[n][1]}function L2(t){return Zu(this.__data__,t)>-1}function M2(t,e){var n=this.__data__,r=Zu(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Wr(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])}}Wr.prototype.clear=P2,Wr.prototype.delete=O2,Wr.prototype.get=D2,Wr.prototype.has=L2,Wr.prototype.set=M2;var dc=Ts(gr,"Map");function F2(){this.size=0,this.__data__={hash:new Es,map:new(dc||Wr),string:new Es}}function j2(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ed(t,e){var n=t.__data__;return j2(e)?n[typeof e=="string"?"string":"hash"]:n.map}function U2(t){var e=ed(this,t).delete(t);return this.size-=e?1:0,e}function B2(t){return ed(this,t).get(t)}function q2(t){return ed(this,t).has(t)}function W2(t,e){var n=ed(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function Gr(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])}}Gr.prototype.clear=F2,Gr.prototype.delete=U2,Gr.prototype.get=B2,Gr.prototype.has=q2,Gr.prototype.set=W2;var G2="Expected a function";function Cg(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(G2);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(Cg.Cache||Gr),n}Cg.Cache=Gr;var z2=500;function H2(t){var e=Cg(t,function(r){return n.size===z2&&n.clear(),r}),n=e.cache;return e}var V2=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,K2=/\\(\\)?/g,Y2=H2(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(V2,function(n,r,i,s){e.push(i?s.replace(K2,"$1"):r||n)}),e});function X2(t){return t==null?"":yT(t)}function td(t,e){return $e(t)?t:_g(t,e)?[t]:Y2(X2(t))}var J2=1/0;function fc(t){if(typeof t=="string"||sc(t))return t;var e=t+"";return e=="0"&&1/t==-J2?"-0":e}function Ag(t,e){e=td(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[fc(e[n++])];return n&&n==r?t:void 0}function Q2(t,e,n){var r=t==null?void 0:Ag(t,e);return r===void 0?n:r}function Ig(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var FT=Cn?Cn.isConcatSpreadable:void 0;function Z2(t){return $e(t)||Ju(t)||!!(FT&&t&&t[FT])}function Pg(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=Z2),i||(i=[]);++s<o;){var a=t[s];n(a)?Ig(i,a):r||(i[i.length]=a)}return i}function Pn(t){var e=t==null?0:t.length;return e?Pg(t):[]}var jT=DT(Object.getPrototypeOf,Object);function UT(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 eF(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 tF(){this.__data__=new Wr,this.size=0}function nF(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function rF(t){return this.__data__.get(t)}function iF(t){return this.__data__.has(t)}var sF=200;function oF(t,e){var n=this.__data__;if(n instanceof Wr){var r=n.__data__;if(!dc||r.length<sF-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Gr(r)}return n.set(t,e),this.size=n.size,this}function yr(t){var e=this.__data__=new Wr(t);this.size=e.size}yr.prototype.clear=tF,yr.prototype.delete=nF,yr.prototype.get=rF,yr.prototype.has=iF,yr.prototype.set=oF;function aF(t,e){return t&&Eg(e,In(e),t)}var BT=typeof exports=="object"&&exports&&!exports.nodeType&&exports,qT=BT&&typeof module=="object"&&module&&!module.nodeType&&module,cF=qT&&qT.exports===BT,WT=cF?gr.Buffer:void 0,GT=WT?WT.allocUnsafe:void 0;function lF(t,e){var n=t.length,r=GT?GT(n):new t.constructor(n);return t.copy(r),r}function xg(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 zT(){return[]}var uF=Object.prototype,dF=uF.propertyIsEnumerable,HT=Object.getOwnPropertySymbols,Ng=HT?function(t){return t==null?[]:(t=Object(t),xg(HT(t),function(e){return dF.call(t,e)}))}:zT;function fF(t,e){return Eg(t,Ng(t),e)}var hF=Object.getOwnPropertySymbols,pF=hF?function(t){for(var e=[];t;)Ig(e,Ng(t)),t=jT(t);return e}:zT;function VT(t,e,n){var r=e(t);return $e(t)?r:Ig(r,n(t))}function Og(t){return VT(t,In,Ng)}function gF(t){return VT(t,MT,pF)}var Dg=Ts(gr,"DataView"),Lg=Ts(gr,"Promise"),go=Ts(gr,"Set"),KT="[object Map]",mF="[object Object]",YT="[object Promise]",XT="[object Set]",JT="[object WeakMap]",QT="[object DataView]",yF=bs(Dg),vF=bs(dc),wF=bs(Lg),bF=bs(go),TF=bs(wg),xn=Si;(Dg&&xn(new Dg(new ArrayBuffer(1)))!=QT||dc&&xn(new dc)!=KT||Lg&&xn(Lg.resolve())!=YT||go&&xn(new go)!=XT||wg&&xn(new wg)!=JT)&&(xn=function(t){var e=Si(t),n=e==mF?t.constructor:void 0,r=n?bs(n):"";if(r)switch(r){case yF:return QT;case vF:return KT;case wF:return YT;case bF:return XT;case TF:return JT}return e});var EF=Object.prototype,RF=EF.hasOwnProperty;function SF(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&RF.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var nd=gr.Uint8Array;function $F(t){var e=new t.constructor(t.byteLength);return new nd(e).set(new nd(t)),e}function kF(t,e){var n=t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var _F=/\w*$/;function CF(t){var e=new t.constructor(t.source,_F.exec(t));return e.lastIndex=t.lastIndex,e}var ZT=Cn?Cn.prototype:void 0,eE=ZT?ZT.valueOf:void 0;function AF(t){return eE?Object(eE.call(t)):{}}function IF(t,e){var n=t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var PF="[object Boolean]",xF="[object Date]",NF="[object Map]",OF="[object Number]",DF="[object RegExp]",LF="[object Set]",MF="[object String]",FF="[object Symbol]",jF="[object ArrayBuffer]",UF="[object DataView]",BF="[object Float32Array]",qF="[object Float64Array]",WF="[object Int8Array]",GF="[object Int16Array]",zF="[object Int32Array]",HF="[object Uint8Array]",VF="[object Uint8ClampedArray]",KF="[object Uint16Array]",YF="[object Uint32Array]";function XF(t,e,n){var r=t.constructor;switch(e){case jF:return $F(t);case PF:case xF:return new r(+t);case UF:return kF(t);case BF:case qF:case WF:case GF:case zF:case HF:case VF:case KF:case YF:return IF(t);case NF:return new r;case OF:case MF:return new r(t);case DF:return CF(t);case LF:return new r;case FF:return AF(t)}}function JF(t){return typeof t.constructor=="function"&&!ac(t)?cM(jT(t)):{}}var QF="[object Map]";function ZF(t){return Vn(t)&&xn(t)==QF}var tE=$i&&$i.isMap,e3=tE?Qu(tE):ZF,t3="[object Set]";function n3(t){return Vn(t)&&xn(t)==t3}var nE=$i&&$i.isSet,r3=nE?Qu(nE):n3,rE="[object Arguments]",i3="[object Array]",s3="[object Boolean]",o3="[object Date]",a3="[object Error]",iE="[object Function]",c3="[object GeneratorFunction]",l3="[object Map]",u3="[object Number]",sE="[object Object]",d3="[object RegExp]",f3="[object Set]",h3="[object String]",p3="[object Symbol]",g3="[object WeakMap]",m3="[object ArrayBuffer]",y3="[object DataView]",v3="[object Float32Array]",w3="[object Float64Array]",b3="[object Int8Array]",T3="[object Int16Array]",E3="[object Int32Array]",R3="[object Uint8Array]",S3="[object Uint8ClampedArray]",$3="[object Uint16Array]",k3="[object Uint32Array]",qe={};qe[rE]=qe[i3]=qe[m3]=qe[y3]=qe[s3]=qe[o3]=qe[v3]=qe[w3]=qe[b3]=qe[T3]=qe[E3]=qe[l3]=qe[u3]=qe[sE]=qe[d3]=qe[f3]=qe[h3]=qe[p3]=qe[R3]=qe[S3]=qe[$3]=qe[k3]=!0,qe[a3]=qe[iE]=qe[g3]=!1;function rd(t,e,n,r,i,s){var o;if(o!==void 0)return o;if(!An(t))return t;var a=$e(t);if(a)return o=SF(t),uM(t,o);var c=xn(t),l=c==iE||c==c3;if(cc(t))return lF(t);if(c==sE||c==rE||l&&!i)return o=l?{}:JF(t),fF(t,aF(o,t));if(!qe[c])return i?t:{};o=XF(t,c),s||(s=new yr);var u=s.get(t);if(u)return u;s.set(t,o),r3(t)?t.forEach(function(h){o.add(rd(h,e,n,h,t,s))}):e3(t)&&t.forEach(function(h,p){o.set(p,rd(h,e,n,p,t,s))});var d=Og,f=a?void 0:d(t);return ET(f||t,function(h,p){f&&(p=h,h=t[p]),Xu(o,p,rd(h,e,n,p,t,s))}),o}var _3=4;function xt(t){return rd(t,_3)}function hc(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 C3="__lodash_hash_undefined__";function A3(t){return this.__data__.set(t,C3),this}function I3(t){return this.__data__.has(t)}function mo(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Gr;++e<n;)this.add(t[e])}mo.prototype.add=mo.prototype.push=A3,mo.prototype.has=I3;function oE(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 Mg(t,e){return t.has(e)}var P3=1,x3=2;function aE(t,e,n,r,i,s){var o=n&P3,a=t.length,c=e.length;if(a!=c&&!(o&&c>a))return!1;var l=s.get(t),u=s.get(e);if(l&&u)return l==e&&u==t;var d=-1,f=!0,h=n&x3?new mo:void 0;for(s.set(t,e),s.set(e,t);++d<a;){var p=t[d],y=e[d];if(r)var $=o?r(y,p,d,e,t,s):r(p,y,d,t,e,s);if($!==void 0){if($)continue;f=!1;break}if(h){if(!oE(e,function(T,w){if(!Mg(h,w)&&(p===T||i(p,T,n,r,s)))return h.push(w)})){f=!1;break}}else if(!(p===y||i(p,y,n,r,s))){f=!1;break}}return s.delete(t),s.delete(e),f}function N3(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function Fg(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var O3=1,D3=2,L3="[object Boolean]",M3="[object Date]",F3="[object Error]",j3="[object Map]",U3="[object Number]",B3="[object RegExp]",q3="[object Set]",W3="[object String]",G3="[object Symbol]",z3="[object ArrayBuffer]",H3="[object DataView]",cE=Cn?Cn.prototype:void 0,jg=cE?cE.valueOf:void 0;function V3(t,e,n,r,i,s,o){switch(n){case H3:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case z3:return!(t.byteLength!=e.byteLength||!s(new nd(t),new nd(e)));case L3:case M3:case U3:return oc(+t,+e);case F3:return t.name==e.name&&t.message==e.message;case B3:case W3:return t==e+"";case j3:var a=N3;case q3:var c=r&O3;if(a||(a=Fg),t.size!=e.size&&!c)return!1;var l=o.get(t);if(l)return l==e;r|=D3,o.set(t,e);var u=aE(a(t),a(e),r,i,s,o);return o.delete(t),u;case G3:if(jg)return jg.call(t)==jg.call(e)}return!1}var K3=1,Y3=Object.prototype,X3=Y3.hasOwnProperty;function J3(t,e,n,r,i,s){var o=n&K3,a=Og(t),c=a.length,l=Og(e),u=l.length;if(c!=u&&!o)return!1;for(var d=c;d--;){var f=a[d];if(!(o?f in e:X3.call(e,f)))return!1}var h=s.get(t),p=s.get(e);if(h&&p)return h==e&&p==t;var y=!0;s.set(t,e),s.set(e,t);for(var $=o;++d<c;){f=a[d];var T=t[f],w=e[f];if(r)var b=o?r(w,T,f,e,t,s):r(T,w,f,t,e,s);if(!(b===void 0?T===w||i(T,w,n,r,s):b)){y=!1;break}$||($=f=="constructor")}if(y&&!$){var _=t.constructor,x=e.constructor;_!=x&&"constructor"in t&&"constructor"in e&&!(typeof _=="function"&&_ instanceof _&&typeof x=="function"&&x instanceof x)&&(y=!1)}return s.delete(t),s.delete(e),y}var Q3=1,lE="[object Arguments]",uE="[object Array]",id="[object Object]",Z3=Object.prototype,dE=Z3.hasOwnProperty;function ej(t,e,n,r,i,s){var o=$e(t),a=$e(e),c=o?uE:xn(t),l=a?uE:xn(e);c=c==lE?id:c,l=l==lE?id:l;var u=c==id,d=l==id,f=c==l;if(f&&cc(t)){if(!cc(e))return!1;o=!0,u=!1}if(f&&!u)return s||(s=new yr),o||kg(t)?aE(t,e,n,r,i,s):V3(t,e,c,n,r,i,s);if(!(n&Q3)){var h=u&&dE.call(t,"__wrapped__"),p=d&&dE.call(e,"__wrapped__");if(h||p){var y=h?t.value():t,$=p?e.value():e;return s||(s=new yr),i(y,$,n,r,s)}}return f?(s||(s=new yr),J3(t,e,n,r,i,s)):!1}function Ug(t,e,n,r,i){return t===e?!0:t==null||e==null||!Vn(t)&&!Vn(e)?t!==t&&e!==e:ej(t,e,n,r,Ug,i)}var tj=1,nj=2;function rj(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],l=o[1];if(o[2]){if(c===void 0&&!(a in t))return!1}else{var u=new yr,d;if(!(d===void 0?Ug(l,c,tj|nj,r,u):d))return!1}}return!0}function fE(t){return t===t&&!An(t)}function ij(t){for(var e=In(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,fE(i)]}return e}function hE(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function sj(t){var e=ij(t);return e.length==1&&e[0][2]?hE(e[0][0],e[0][1]):function(n){return n===t||rj(n,t,e)}}function oj(t,e){return t!=null&&e in Object(t)}function pE(t,e,n){e=td(e,t);for(var r=-1,i=e.length,s=!1;++r<i;){var o=fc(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&&Sg(i)&&Yu(o,i)&&($e(t)||Ju(t)))}function aj(t,e){return t!=null&&pE(t,e,oj)}var cj=1,lj=2;function uj(t,e){return _g(t)&&fE(e)?hE(fc(t),e):function(n){var r=Q2(n,t);return r===void 0&&r===e?aj(n,t):Ug(e,r,cj|lj)}}function dj(t){return function(e){return e?.[t]}}function fj(t){return function(e){return Ag(e,t)}}function hj(t){return _g(t)?dj(fc(t)):fj(t)}function Kn(t){return typeof t=="function"?t:t==null?ws:typeof t=="object"?$e(t)?uj(t[0],t[1]):sj(t):hj(t)}function pj(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 gj(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 mj=gj();function yj(t,e){return t&&mj(t,e,In)}function vj(t,e){return function(n,r){if(n==null)return n;if(!mr(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 Rs=vj(yj);function wj(t,e,n,r){return Rs(t,function(i,s,o){e(r,i,n(i),o)}),r}function bj(t,e){return function(n,r){var i=$e(n)?pj:wj,s=e?e():{};return i(n,t,Kn(r),s)}}var gE=Object.prototype,Tj=gE.hasOwnProperty,Bg=Rg(function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&kT(e[0],e[1],i)&&(r=1);++n<r;)for(var s=e[n],o=MT(s),a=-1,c=o.length;++a<c;){var l=o[a],u=t[l];(u===void 0||oc(u,gE[l])&&!Tj.call(t,l))&&(t[l]=s[l])}return t});function mE(t){return Vn(t)&&mr(t)}var Ej=200;function Rj(t,e,n,r){var i=-1,s=ST,o=!0,a=t.length,c=[],l=e.length;if(!a)return c;e.length>=Ej&&(s=Mg,o=!1,e=new mo(e));e:for(;++i<a;){var u=t[i],d=u;if(u=u!==0?u:0,o&&d===d){for(var f=l;f--;)if(e[f]===d)continue e;c.push(u)}else s(e,d,r)||c.push(u)}return c}var sd=Rg(function(t,e){return mE(t)?Rj(t,Pg(e,1,mE,!0)):[]});function yo(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Nt(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:Vu(e),UT(t,e<0?0:e,r)):[]}function pc(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:Vu(e),e=r-e,UT(t,0,e<0?0:e)):[]}function Sj(t){return typeof t=="function"?t:ws}function re(t,e){var n=$e(t)?ET:Rs;return n(t,Sj(e))}function $j(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 kj(t,e){var n=!0;return Rs(t,function(r,i,s){return n=!!e(r,i,s),n}),n}function Yn(t,e,n){var r=$e(t)?$j:kj;return r(t,Kn(e))}function yE(t,e){var n=[];return Rs(t,function(r,i,s){e(r,i,s)&&n.push(r)}),n}function yn(t,e){var n=$e(t)?xg:yE;return n(t,Kn(e))}function _j(t){return function(e,n,r){var i=Object(e);if(!mr(e)){var s=Kn(n);e=In(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 Cj=Math.max;function Aj(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:Vu(n);return i<0&&(i=Cj(r+i,0)),RT(t,Kn(e),i)}var vo=_j(Aj);function Xn(t){return t&&t.length?t[0]:void 0}function Ij(t,e){var n=-1,r=mr(t)?Array(t.length):[];return Rs(t,function(i,s,o){r[++n]=e(i,s,o)}),r}function Z(t,e){var n=$e(t)?Hu:Ij;return n(t,Kn(e))}function vn(t,e){return Pg(Z(t,e))}var Pj=Object.prototype,xj=Pj.hasOwnProperty,Nj=bj(function(t,e,n){xj.call(t,n)?t[n].push(e):Tg(t,n,[e])}),Oj=Object.prototype,Dj=Oj.hasOwnProperty;function Lj(t,e){return t!=null&&Dj.call(t,e)}function se(t,e){return t!=null&&pE(t,e,Lj)}var Mj="[object String]";function sn(t){return typeof t=="string"||!$e(t)&&Vn(t)&&Si(t)==Mj}function Fj(t,e){return Hu(e,function(n){return t[n]})}function Tt(t){return t==null?[]:Fj(t,In(t))}var jj=Math.max;function Gt(t,e,n,r){t=mr(t)?t:Tt(t),n=n&&!r?Vu(n):0;var i=t.length;return n<0&&(n=jj(i+n,0)),sn(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&bg(t,e,n)>-1}function vE(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=0;return bg(t,e,i)}var Uj="[object Map]",Bj="[object Set]",qj=Object.prototype,Wj=qj.hasOwnProperty;function Ue(t){if(t==null)return!0;if(mr(t)&&($e(t)||typeof t=="string"||typeof t.splice=="function"||cc(t)||kg(t)||Ju(t)))return!t.length;var e=xn(t);if(e==Uj||e==Bj)return!t.size;if(ac(t))return!LT(t).length;for(var n in t)if(Wj.call(t,n))return!1;return!0}var Gj="[object RegExp]";function zj(t){return Vn(t)&&Si(t)==Gj}var wE=$i&&$i.isRegExp,zr=wE?Qu(wE):zj;function Hr(t){return t===void 0}function Hj(t,e){return t<e}function Vj(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&&!sc(o):n(o,a)))var a=o,c=s}return c}function Kj(t){return t&&t.length?Vj(t,ws,Hj):void 0}var Yj="Expected a function";function Xj(t){if(typeof t!="function")throw new TypeError(Yj);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 Jj(t,e,n,r){if(!An(t))return t;e=td(e,t);for(var i=-1,s=e.length,o=s-1,a=t;a!=null&&++i<s;){var c=fc(e[i]),l=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(i!=o){var u=a[c];l=void 0,l===void 0&&(l=An(u)?u:Yu(e[i+1])?[]:{})}Xu(a,c,l),a=a[c]}return t}function Qj(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],a=Ag(t,o);n(a,o)&&Jj(s,td(o,t),a)}return s}function Jn(t,e){if(t==null)return{};var n=Hu(gF(t),function(r){return[r]});return e=Kn(e),Qj(t,n,function(r,i){return e(r,i[0])})}function Zj(t,e,n,r,i){return i(t,function(s,o,a){n=r?(r=!1,s):e(n,s,o,a)}),n}function zt(t,e,n){var r=$e(t)?eF:Zj,i=arguments.length<3;return r(t,Kn(e),n,i,Rs)}function od(t,e){var n=$e(t)?xg:yE;return n(t,Xj(Kn(e)))}function eU(t,e){var n;return Rs(t,function(r,i,s){return n=e(r,i,s),!n}),!!n}function bE(t,e,n){var r=$e(t)?oE:eU;return r(t,Kn(e))}var tU=1/0,nU=go&&1/Fg(new go([,-0]))[1]==tU?function(t){return new go(t)}:bt,rU=200;function TE(t,e,n){var r=-1,i=ST,s=t.length,o=!0,a=[],c=a;if(s>=rU){var l=e?null:nU(t);if(l)return Fg(l);o=!1,i=Mg,c=new mo}else c=e?[]:a;e:for(;++r<s;){var u=t[r],d=e?e(u):u;if(u=u!==0?u:0,o&&d===d){for(var f=c.length;f--;)if(c[f]===d)continue e;e&&c.push(d),a.push(u)}else i(c,d,n)||(c!==a&&c.push(d),a.push(u))}return a}function qg(t){return t&&t.length?TE(t):[]}function iU(t,e){return t&&t.length?TE(t,Kn(e)):[]}function Wg(t){console&&console.error&&console.error(`Error: ${t}`)}function EE(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function RE(t){const e=new Date().getTime(),n=t();return{time:new Date().getTime()-e,value:n}}function SE(t){function e(){}e.prototype=t;const n=new e;function r(){return typeof n.bar}return r(),r(),t}function sU(t){return oU(t)?t.LABEL:t.name}function oU(t){return sn(t.LABEL)&&t.LABEL!==""}class vr{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),re(this.definition,n=>{n.accept(e)})}}class Ht extends vr{constructor(e){super([]),this.idx=1,mn(this,Jn(e,n=>n!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class wo extends vr{constructor(e){super(e.definition),this.orgText="",mn(this,Jn(e,n=>n!==void 0))}}class on extends vr{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,mn(this,Jn(e,n=>n!==void 0))}}class Ot extends vr{constructor(e){super(e.definition),this.idx=1,mn(this,Jn(e,n=>n!==void 0))}}class wn extends vr{constructor(e){super(e.definition),this.idx=1,mn(this,Jn(e,n=>n!==void 0))}}class bn extends vr{constructor(e){super(e.definition),this.idx=1,mn(this,Jn(e,n=>n!==void 0))}}class st extends vr{constructor(e){super(e.definition),this.idx=1,mn(this,Jn(e,n=>n!==void 0))}}class an extends vr{constructor(e){super(e.definition),this.idx=1,mn(this,Jn(e,n=>n!==void 0))}}class cn extends vr{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,mn(this,Jn(e,n=>n!==void 0))}}class ze{constructor(e){this.idx=1,mn(this,Jn(e,n=>n!==void 0))}accept(e){e.visit(this)}}function aU(t){return Z(t,ad)}function ad(t){function e(n){return Z(n,ad)}if(t instanceof Ht){const n={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return sn(t.label)&&(n.label=t.label),n}else{if(t instanceof on)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Ot)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof wn)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof bn)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:ad(new ze({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof an)return{type:"RepetitionWithSeparator",idx:t.idx,separator:ad(new ze({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof st)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof cn)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof ze){const n={type:"Terminal",name:t.terminalType.name,label:sU(t.terminalType),idx:t.idx};sn(t.label)&&(n.terminalLabel=t.label);const r=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(n.pattern=zr(r)?r.source:r),n}else{if(t instanceof wo)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}class bo{visit(e){const n=e;switch(n.constructor){case Ht:return this.visitNonTerminal(n);case on:return this.visitAlternative(n);case Ot:return this.visitOption(n);case wn:return this.visitRepetitionMandatory(n);case bn:return this.visitRepetitionMandatoryWithSeparator(n);case an:return this.visitRepetitionWithSeparator(n);case st:return this.visitRepetition(n);case cn:return this.visitAlternation(n);case ze:return this.visitTerminal(n);case wo: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 cU(t){return t instanceof on||t instanceof Ot||t instanceof st||t instanceof wn||t instanceof bn||t instanceof an||t instanceof ze||t instanceof wo}function cd(t,e=[]){return t instanceof Ot||t instanceof st||t instanceof an?!0:t instanceof cn?bE(t.definition,r=>cd(r,e)):t instanceof Ht&&Gt(e,t)?!1:t instanceof vr?(t instanceof Ht&&e.push(t),Yn(t.definition,r=>cd(r,e))):!1}function lU(t){return t instanceof cn}function wr(t){if(t instanceof Ht)return"SUBRULE";if(t instanceof Ot)return"OPTION";if(t instanceof cn)return"OR";if(t instanceof wn)return"AT_LEAST_ONE";if(t instanceof bn)return"AT_LEAST_ONE_SEP";if(t instanceof an)return"MANY_SEP";if(t instanceof st)return"MANY";if(t instanceof ze)return"CONSUME";throw Error("non exhaustive match")}class ld{walk(e,n=[]){re(e.definition,(r,i)=>{const s=Nt(e.definition,i+1);if(r instanceof Ht)this.walkProdRef(r,s,n);else if(r instanceof ze)this.walkTerminal(r,s,n);else if(r instanceof on)this.walkFlat(r,s,n);else if(r instanceof Ot)this.walkOption(r,s,n);else if(r instanceof wn)this.walkAtLeastOne(r,s,n);else if(r instanceof bn)this.walkAtLeastOneSep(r,s,n);else if(r instanceof an)this.walkManySep(r,s,n);else if(r instanceof st)this.walkMany(r,s,n);else if(r instanceof cn)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 Ot({definition:e.definition})].concat(n,r);this.walk(e,i)}walkAtLeastOneSep(e,n,r){const i=$E(e,n,r);this.walk(e,i)}walkMany(e,n,r){const i=[new Ot({definition:e.definition})].concat(n,r);this.walk(e,i)}walkManySep(e,n,r){const i=$E(e,n,r);this.walk(e,i)}walkOr(e,n,r){const i=n.concat(r);re(e.definition,s=>{const o=new on({definition:[s]});this.walk(o,i)})}}function $E(t,e,n){return[new Ot({definition:[new ze({terminalType:t.separator})].concat(t.definition)})].concat(e,n)}function gc(t){if(t instanceof Ht)return gc(t.referencedRule);if(t instanceof ze)return fU(t);if(cU(t))return uU(t);if(lU(t))return dU(t);throw Error("non exhaustive match")}function uU(t){let e=[];const n=t.definition;let r=0,i=n.length>r,s,o=!0;for(;i&&o;)s=n[r],o=cd(s),e=e.concat(gc(s)),r=r+1,i=n.length>r;return qg(e)}function dU(t){const e=Z(t.definition,n=>gc(n));return qg(Pn(e))}function fU(t){return[t.terminalType]}const kE="_~IN~_";class hU extends ld{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=gU(e.referencedRule,e.idx)+this.topProd.name,s=n.concat(r),o=new on({definition:s}),a=gc(o);this.follows[i]=a}}function pU(t){const e={};return re(t,n=>{const r=new hU(n).startWalking();mn(e,r)}),e}function gU(t,e){return t.name+e+kE}let ud={};const mU=new Z0;function dd(t){const e=t.toString();if(ud.hasOwnProperty(e))return ud[e];{const n=mU.pattern(e);return ud[e]=n,n}}function yU(){ud={}}const _E="Complement Sets are not supported for first char optimization",fd=`Unable to use "first char" lexer optimizations:
|
|
13
|
-
`;function vU(t,e=!1){try{const n=dd(t);return Gg(n.value,{},n.flags.ignoreCase)}catch(n){if(n.message===_E)e&&EE(`${fd} 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.`),Wg(`${fd}
|
|
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 Gg(t,e,n){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)Gg(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":hd(o.value,e,n);break;case"Set":if(o.complement===!0)throw Error(_E);re(o.value,c=>{if(typeof c=="number")hd(c,e,n);else{const l=c;if(n===!0)for(let u=l.from;u<=l.to;u++)hd(u,e,n);else{for(let u=l.from;u<=l.to&&u<yc;u++)hd(u,e,n);if(l.to>=yc){const u=l.from>=yc?l.from:yc,d=l.to,f=ki(u),h=ki(d);for(let p=f;p<=h;p++)e[p]=p}}}});break;case"Group":Gg(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"&&zg(o)===!1||o.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return Tt(e)}function hd(t,e,n){const r=ki(t);e[r]=r,n===!0&&wU(t,e)}function wU(t,e){const n=String.fromCharCode(t),r=n.toUpperCase();if(r!==n){const i=ki(r.charCodeAt(0));e[i]=i}else{const i=n.toLowerCase();if(i!==n){const s=ki(i.charCodeAt(0));e[s]=s}}}function CE(t,e){return vo(t.value,n=>{if(typeof n=="number")return Gt(e,n);{const r=n;return vo(e,i=>r.from<=i&&i<=r.to)!==void 0}})}function zg(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?$e(t.value)?Yn(t.value,zg):zg(t.value):!1}class bU extends ju{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){Gt(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?CE(e,this.targetCharCodes)===void 0&&(this.found=!0):CE(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function Hg(t,e){if(e instanceof RegExp){const n=dd(e),r=new bU(t);return r.visit(n),r.found}else return vo(e,n=>Gt(t,n.charCodeAt(0)))!==void 0}const Ss="PATTERN",mc="defaultMode",pd="modes";let AE=typeof new RegExp("(?:)").sticky=="boolean";function TU(t,e){e=Bg(e,{useSticky:AE,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
22
|
-
`],tracer:(w,b)=>b()});const n=e.tracer;n("initCharCodeToOptimizedIndexMap",()=>{GU()});let r;n("Reject Lexer.NA",()=>{r=od(t,w=>w[Ss]===ln.NA)});let i=!1,s;n("Transform Patterns",()=>{i=!1,s=Z(r,w=>{const b=w[Ss];if(zr(b)){const _=b.source;return _.length===1&&_!=="^"&&_!=="$"&&_!=="."&&!b.ignoreCase?_:_.length===2&&_[0]==="\\"&&!Gt(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],_[1])?_[1]:e.useSticky?PE(b):IE(b)}else{if(qr(b))return i=!0,{exec:b};if(typeof b=="object")return i=!0,b;if(typeof b=="string"){if(b.length===1)return b;{const _=b.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),x=new RegExp(_);return e.useSticky?PE(x):IE(x)}}else throw Error("non exhaustive match")}})});let o,a,c,l,u;n("misc mapping",()=>{o=Z(r,w=>w.tokenTypeIdx),a=Z(r,w=>{const b=w.GROUP;if(b!==ln.SKIPPED){if(sn(b))return b;if(Hr(b))return!1;throw Error("non exhaustive match")}}),c=Z(r,w=>{const b=w.LONGER_ALT;if(b)return $e(b)?Z(b,x=>vE(r,x)):[vE(r,b)]}),l=Z(r,w=>w.PUSH_MODE),u=Z(r,w=>se(w,"POP_MODE"))});let d;n("Line Terminator Handling",()=>{const w=OE(e.lineTerminatorCharacters);d=Z(r,b=>!1),e.positionTracking!=="onlyOffset"&&(d=Z(r,b=>se(b,"LINE_BREAKS")?!!b.LINE_BREAKS:NE(b,w)===!1&&Hg(w,b.PATTERN)))});let f,h,p,y;n("Misc Mapping #2",()=>{f=Z(r,xE),h=Z(s,BU),p=zt(r,(w,b)=>{const _=b.GROUP;return sn(_)&&_!==ln.SKIPPED&&(w[_]=[]),w},{}),y=Z(s,(w,b)=>({pattern:s[b],longerAlt:c[b],canLineTerminator:d[b],isCustom:f[b],short:h[b],group:a[b],push:l[b],pop:u[b],tokenTypeIdx:o[b],tokenType:r[b]}))});let $=!0,T=[];return e.safeMode||n("First Char Optimization",()=>{T=zt(r,(w,b,_)=>{if(typeof b.PATTERN=="string"){const x=b.PATTERN.charCodeAt(0),F=ki(x);Vg(w,F,y[_])}else if($e(b.START_CHARS_HINT)){let x;re(b.START_CHARS_HINT,F=>{const P=typeof F=="string"?F.charCodeAt(0):F,G=ki(P);x!==G&&(x=G,Vg(w,G,y[_]))})}else if(zr(b.PATTERN))if(b.PATTERN.unicode)$=!1,e.ensureOptimizations&&Wg(`${fd} Unable to analyze < ${b.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 x=vU(b.PATTERN,e.ensureOptimizations);Ue(x)&&($=!1),re(x,F=>{Vg(w,F,y[_])})}else e.ensureOptimizations&&Wg(`${fd} TokenType: <${b.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`),$=!1;return w},[])}),{emptyGroups:p,patternIdxToConfig:y,charCodeToPatternIdxToConfig:T,hasCustom:i,canBeOptimized:$}}function EU(t,e){let n=[];const r=SU(t);n=n.concat(r.errors);const i=$U(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(RU(s)),n=n.concat(NU(s)),n=n.concat(OU(s,e)),n=n.concat(DU(s)),n}function RU(t){let e=[];const n=yn(t,r=>zr(r[Ss]));return e=e.concat(_U(n)),e=e.concat(IU(n)),e=e.concat(PU(n)),e=e.concat(xU(n)),e=e.concat(CU(n)),e}function SU(t){const e=yn(t,i=>!se(i,Ss)),n=Z(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:ot.MISSING_PATTERN,tokenTypes:[i]})),r=sd(t,e);return{errors:n,valid:r}}function $U(t){const e=yn(t,i=>{const s=i[Ss];return!zr(s)&&!qr(s)&&!se(s,"exec")&&!sn(s)}),n=Z(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:ot.INVALID_PATTERN,tokenTypes:[i]})),r=sd(t,e);return{errors:n,valid:r}}const kU=/[^\\][$]/;function _U(t){class e extends ju{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}const n=yn(t,i=>{const s=i.PATTERN;try{const o=dd(s),a=new e;return a.visit(o),a.found}catch{return kU.test(s.source)}});return Z(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:ot.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function CU(t){const e=yn(t,r=>r.PATTERN.test(""));return Z(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:ot.EMPTY_MATCH_PATTERN,tokenTypes:[r]}))}const AU=/[^\\[][\^]|^\^/;function IU(t){class e extends ju{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}const n=yn(t,i=>{const s=i.PATTERN;try{const o=dd(s),a=new e;return a.visit(o),a.found}catch{return AU.test(s.source)}});return Z(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:ot.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function PU(t){const e=yn(t,r=>{const i=r[Ss];return i instanceof RegExp&&(i.multiline||i.global)});return Z(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:ot.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}))}function xU(t){const e=[];let n=Z(t,s=>zt(t,(o,a)=>(s.PATTERN.source===a.PATTERN.source&&!Gt(e,a)&&a.PATTERN!==ln.NA&&(e.push(a),o.push(a)),o),[]));n=hc(n);const r=yn(n,s=>s.length>1);return Z(r,s=>{const o=Z(s,c=>c.name);return{message:`The same RegExp pattern ->${Xn(s).PATTERN}<-has been used in all of the following Token Types: ${o.join(", ")} <-`,type:ot.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}function NU(t){const e=yn(t,r=>{if(!se(r,"GROUP"))return!1;const i=r.GROUP;return i!==ln.SKIPPED&&i!==ln.NA&&!sn(i)});return Z(e,r=>({message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:ot.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}))}function OU(t,e){const n=yn(t,i=>i.PUSH_MODE!==void 0&&!Gt(e,i.PUSH_MODE));return Z(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:ot.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function DU(t){const e=[],n=zt(t,(r,i,s)=>{const o=i.PATTERN;return o===ln.NA||(sn(o)?r.push({str:o,idx:s,tokenType:i}):zr(o)&&MU(o)&&r.push({str:o.source,idx:s,tokenType:i})),r},[]);return re(t,(r,i)=>{re(n,({str:s,idx:o,tokenType:a})=>{if(i<o&&LU(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:ot.UNREACHABLE_PATTERN,tokenTypes:[r,a]})}})}),e}function LU(t,e){if(zr(e)){const n=e.exec(t);return n!==null&&n.index===0}else{if(qr(e))return e(t,0,[],{});if(se(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function MU(t){return vo([".","\\","[","]","|","^","$","(",")","?","*","+","{"],n=>t.source.indexOf(n)!==-1)===void 0}function IE(t){const e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function PE(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function FU(t,e,n){const r=[];return se(t,mc)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+mc+`> property in its definition
|
|
34
|
-
`,type:ot.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),se(t,pd)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+pd+`> property in its definition
|
|
35
|
-
`,type:ot.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),se(t,pd)&&se(t,mc)&&!se(t.modes,t.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${mc}: <${t.defaultMode}>which does not exist
|
|
36
|
-
`,type:ot.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),se(t,pd)&&re(t.modes,(i,s)=>{re(i,(o,a)=>{if(Hr(o))r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${a}>
|
|
37
|
-
`,type:ot.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(se(o,"LONGER_ALT")){const c=$e(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT];re(c,l=>{!Hr(l)&&!Gt(i,l)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${l.name}> on token <${o.name}> outside of mode <${s}>
|
|
38
|
-
`,type:ot.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),r}function jU(t,e,n){const r=[];let i=!1;const s=hc(Pn(Tt(t.modes))),o=od(s,c=>c[Ss]===ln.NA),a=OE(n);return e&&re(o,c=>{const l=NE(c,a);if(l!==!1){const d={message:WU(c,l),type:l.issue,tokenType:c};r.push(d)}else se(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(i=!0):Hg(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:ot.NO_LINE_BREAKS_FLAGS}),r}function UU(t){const e={},n=In(t);return re(n,r=>{const i=t[r];if($e(i))e[r]=[];else throw Error("non exhaustive match")}),e}function xE(t){const e=t.PATTERN;if(zr(e))return!1;if(qr(e))return!0;if(se(e,"exec"))return!0;if(sn(e))return!1;throw Error("non exhaustive match")}function BU(t){return sn(t)&&t.length===1?t.charCodeAt(0):!1}const qU={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 NE(t,e){if(se(t,"LINE_BREAKS"))return!1;if(zr(t.PATTERN)){try{Hg(e,t.PATTERN)}catch(n){return{issue:ot.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}else{if(sn(t.PATTERN))return!1;if(xE(t))return{issue:ot.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function WU(t,e){if(e.issue===ot.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===ot.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 OE(t){return Z(t,n=>sn(n)?n.charCodeAt(0):n)}function Vg(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}const yc=256;let gd=[];function ki(t){return t<yc?t:gd[t]}function GU(){if(Ue(gd)){gd=new Array(65536);for(let t=0;t<65536;t++)gd[t]=t>255?255+~~(t/255):t}}function vc(t,e){const n=t.tokenTypeIdx;return n===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[n]===!0}function md(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let DE=1;const LE={};function wc(t){const e=zU(t);HU(e),KU(e),VU(e),re(e,n=>{n.isParent=n.categoryMatches.length>0})}function zU(t){let e=xt(t),n=t,r=!0;for(;r;){n=hc(Pn(Z(n,s=>s.CATEGORIES)));const i=sd(n,e);e=e.concat(i),Ue(i)?r=!1:n=i}return e}function HU(t){re(t,e=>{FE(e)||(LE[DE]=e,e.tokenTypeIdx=DE++),jE(e)&&!$e(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),jE(e)||(e.CATEGORIES=[]),YU(e)||(e.categoryMatches=[]),XU(e)||(e.categoryMatchesMap={})})}function VU(t){re(t,e=>{e.categoryMatches=[],re(e.categoryMatchesMap,(n,r)=>{e.categoryMatches.push(LE[r].tokenTypeIdx)})})}function KU(t){re(t,e=>{ME([],e)})}function ME(t,e){re(t,n=>{e.categoryMatchesMap[n.tokenTypeIdx]=!0}),re(e.CATEGORIES,n=>{const r=t.concat(e);Gt(r,n)||ME(r,n)})}function FE(t){return se(t,"tokenTypeIdx")}function jE(t){return se(t,"CATEGORIES")}function YU(t){return se(t,"categoryMatches")}function XU(t){return se(t,"categoryMatchesMap")}function JU(t){return se(t,"tokenTypeIdx")}const QU={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 ot;(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"})(ot||(ot={}));const bc={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
48
|
-
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:QU,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(bc);class ln{constructor(e,n=bc){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}=RE(s),l=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&l(`${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=mn({},bc,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===bc.lineTerminatorsPattern)this.config.lineTerminatorsPattern=qU;else if(this.config.lineTerminatorCharacters===bc.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),$e(e)?i={modes:{defaultMode:xt(e)},defaultMode:mc}:(s=!1,i=xt(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(FU(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(jU(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},re(i.modes,(a,c)=>{i.modes[c]=od(a,l=>Hr(l))});const o=In(i.modes);if(re(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(EU(a,o))}),Ue(this.lexerDefinitionErrors)){wc(a);let l;this.TRACE_INIT("analyzeTokenTypes",()=>{l=TU(a,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:n.positionTracking,ensureOptimizations:n.ensureOptimizations,safeMode:n.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[c]=l.patternIdxToConfig,this.charCodeToPatternIdxToConfig[c]=l.charCodeToPatternIdxToConfig,this.emptyGroups=mn({},this.emptyGroups,l.emptyGroups),this.hasCustom=l.hasCustom||this.hasCustom,this.canModeBeOptimized[c]=l.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Ue(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const c=Z(this.lexerDefinitionErrors,l=>l.message).join(`-----------------------
|
|
51
|
-
`);throw new Error(`Errors detected in definition of Lexer:
|
|
52
|
-
`+c)}re(this.lexerDefinitionWarning,a=>{EE(a.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(AE?(this.chopInput=ws,this.match=this.matchWithTest):(this.updateLastIndex=bt,this.match=this.matchWithExec),s&&(this.handleModes=bt),this.trackStartLines===!1&&(this.computeNewColumn=ws),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=bt),/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=zt(this.canModeBeOptimized,(c,l,u)=>(l===!1&&c.push(u),c),[]);if(n.ensureOptimizations&&!Ue(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",()=>{yU()}),this.TRACE_INIT("toFastProperties",()=>{SE(this)})})}tokenize(e,n=this.defaultMode){if(!Ue(this.lexerDefinitionErrors)){const i=Z(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,l,u,d,f,h,p,y,$,T;const w=e,b=w.length;let _=0,x=0;const F=this.hasCustom?0:Math.floor(e.length/10),P=new Array(F),G=[];let B=this.trackStartLines?1:void 0,W=this.trackStartLines?1:void 0;const I=UU(this.emptyGroups),k=this.trackStartLines,R=this.config.lineTerminatorsPattern;let M=0,q=[],j=[];const z=[],J=[];Object.freeze(J);let U;function ce(){return q}function Qe(Fe){const nt=ki(Fe),dt=j[nt];return dt===void 0?J:dt}const It=Fe=>{if(z.length===1&&Fe.tokenType.PUSH_MODE===void 0){const nt=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Fe);G.push({offset:Fe.startOffset,line:Fe.startLine,column:Fe.startColumn,length:Fe.image.length,message:nt})}else{z.pop();const nt=yo(z);q=this.patternIdxToConfig[nt],j=this.charCodeToPatternIdxToConfig[nt],M=q.length;const dt=this.canModeBeOptimized[nt]&&this.config.safeMode===!1;j&&dt?U=Qe:U=ce}};function Zt(Fe){z.push(Fe),j=this.charCodeToPatternIdxToConfig[Fe],q=this.patternIdxToConfig[Fe],M=q.length,M=q.length;const nt=this.canModeBeOptimized[Fe]&&this.config.safeMode===!1;j&&nt?U=Qe:U=ce}Zt.call(this,n);let Be;const gn=this.config.recoveryEnabled;for(;_<b;){c=null;const Fe=w.charCodeAt(_),nt=U(Fe),dt=nt.length;for(r=0;r<dt;r++){Be=nt[r];const je=Be.pattern;l=null;const ft=Be.short;if(ft!==!1?Fe===ft&&(c=je):Be.isCustom===!0?(T=je.exec(w,_,P,I),T!==null?(c=T[0],T.payload!==void 0&&(l=T.payload)):c=null):(this.updateLastIndex(je,_),c=this.match(je,e,_)),c!==null){if(a=Be.longerAlt,a!==void 0){const Ke=a.length;for(s=0;s<Ke;s++){const fe=q[a[s]],Ze=fe.pattern;if(u=null,fe.isCustom===!0?(T=Ze.exec(w,_,P,I),T!==null?(o=T[0],T.payload!==void 0&&(u=T.payload)):o=null):(this.updateLastIndex(Ze,_),o=this.match(Ze,e,_)),o&&o.length>c.length){c=o,l=u,Be=fe;break}}}break}}if(c!==null){if(d=c.length,f=Be.group,f!==void 0&&(h=Be.tokenTypeIdx,p=this.createTokenInstance(c,_,h,Be.tokenType,B,W,d),this.handlePayload(p,l),f===!1?x=this.addToken(P,x,p):I[f].push(p)),e=this.chopInput(e,d),_=_+d,W=this.computeNewColumn(W,d),k===!0&&Be.canLineTerminator===!0){let je=0,ft,Ke;R.lastIndex=0;do ft=R.test(c),ft===!0&&(Ke=R.lastIndex-1,je++);while(ft===!0);je!==0&&(B=B+je,W=d-Ke,this.updateTokenEndLineColumnLocation(p,f,Ke,je,B,W,d))}this.handleModes(Be,It,Zt,p)}else{const je=_,ft=B,Ke=W;let fe=gn===!1;for(;fe===!1&&_<b;)for(e=this.chopInput(e,1),_++,i=0;i<M;i++){const Ze=q[i],Ne=Ze.pattern,Pt=Ze.short;if(Pt!==!1?w.charCodeAt(_)===Pt&&(fe=!0):Ze.isCustom===!0?fe=Ne.exec(w,_,P,I)!==null:(this.updateLastIndex(Ne,_),fe=Ne.exec(e)!==null),fe===!0)break}if(y=_-je,W=this.computeNewColumn(W,y),$=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(w,je,y,ft,Ke),G.push({offset:je,line:ft,column:Ke,length:y,message:$}),gn===!1)break}}return this.hasCustom||(P.length=x),{tokens:P,groups:I,errors:G}}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,l;n!==void 0&&(c=r===a-1,l=c?-1:0,i===1&&c===!0||(e.endLine=s+l,e.endColumn=o-1+-l))}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}}ln.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.",ln.NA=/NOT_APPLICABLE/;function To(t){return UE(t)?t.LABEL:t.name}function UE(t){return sn(t.LABEL)&&t.LABEL!==""}const ZU="parent",BE="categories",qE="label",WE="group",GE="push_mode",zE="pop_mode",HE="longer_alt",VE="line_breaks",KE="start_chars_hint";function YE(t){return eB(t)}function eB(t){const e=t.pattern,n={};if(n.name=t.name,Hr(e)||(n.PATTERN=e),se(t,ZU))throw`The parent property is no longer supported.
|
|
57
|
-
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return se(t,BE)&&(n.CATEGORIES=t[BE]),wc([n]),se(t,qE)&&(n.LABEL=t[qE]),se(t,WE)&&(n.GROUP=t[WE]),se(t,zE)&&(n.POP_MODE=t[zE]),se(t,GE)&&(n.PUSH_MODE=t[GE]),se(t,HE)&&(n.LONGER_ALT=t[HE]),se(t,VE)&&(n.LINE_BREAKS=t[VE]),se(t,KE)&&(n.START_CHARS_HINT=t[KE]),n}const _i=YE({name:"EOF",pattern:ln.NA});wc([_i]);function Kg(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 XE(t,e){return vc(t,e)}const Eo={buildMismatchTokenMessage({expected:t,actual:e,previous:n,ruleName:r}){return`Expecting ${UE(t)?`--> ${To(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: '`+Xn(e).image+"'";if(r)return s+r+a;{const c=zt(t,(f,h)=>f.concat(h),[]),l=Z(c,f=>`[${Z(f,h=>To(h)).join(", ")}]`),d=`one of these possible Token sequences:
|
|
59
|
-
${Z(l,(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: '`+Xn(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
|
-
<${Z(t,l=>`[${Z(l,u=>To(u)).join(",")}]`).join(" ,")}>`;return i+c+o}}};Object.freeze(Eo);const tB={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(u){return u instanceof ze?u.terminalType.name:u instanceof Ht?u.nonTerminalName:""}const r=t.name,i=Xn(e),s=i.idx,o=wr(i),a=n(i),c=s>0;let l=`->${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 l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,`
|
|
67
|
-
`),l},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=Z(t.prefixPath,i=>To(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=Z(t.prefixPath,i=>To(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=wr(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=Z(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 wo?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function nB(t,e){const n=new rB(t,e);return n.resolveRefs(),n.errors}class rB extends bo{constructor(e,n){super(),this.nameToTopRule=e,this.errMsgProvider=n,this.errors=[]}resolveRefs(){re(Tt(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:Vt.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class iB extends ld{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=xt(this.path.ruleStack).reverse(),this.occurrenceStack=xt(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(){Ue(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class sB extends iB{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 on({definition:i});this.possibleTokTypes=gc(s),this.found=!0}}}class yd extends ld{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 oB extends yd{walkMany(e,n,r){if(e.idx===this.occurrence){const i=Xn(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof ze&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,n,r)}}class JE extends yd{walkManySep(e,n,r){if(e.idx===this.occurrence){const i=Xn(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof ze&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,n,r)}}class aB extends yd{walkAtLeastOne(e,n,r){if(e.idx===this.occurrence){const i=Xn(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof ze&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,n,r)}}class QE extends yd{walkAtLeastOneSep(e,n,r){if(e.idx===this.occurrence){const i=Xn(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof ze&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,n,r)}}function Yg(t,e,n=[]){n=xt(n);let r=[],i=0;function s(a){return a.concat(Nt(t,i+1))}function o(a){const c=Yg(s(a),e,n);return r.concat(c)}for(;n.length<e&&i<t.length;){const a=t[i];if(a instanceof on)return o(a.definition);if(a instanceof Ht)return o(a.definition);if(a instanceof Ot)r=o(a.definition);else if(a instanceof wn){const c=a.definition.concat([new st({definition:a.definition})]);return o(c)}else if(a instanceof bn){const c=[new on({definition:a.definition}),new st({definition:[new ze({terminalType:a.separator})].concat(a.definition)})];return o(c)}else if(a instanceof an){const c=a.definition.concat([new st({definition:[new ze({terminalType:a.separator})].concat(a.definition)})]);r=o(c)}else if(a instanceof st){const c=a.definition.concat([new st({definition:a.definition})]);r=o(c)}else{if(a instanceof cn)return re(a.definition,c=>{Ue(c.definition)===!1&&(r=o(c.definition))}),r;if(a instanceof ze)n.push(a.terminalType);else throw Error("non exhaustive match")}i++}return r.push({partialPath:n,suffixDef:Nt(t,i)}),r}function ZE(t,e,n,r){const i="EXIT_NONE_TERMINAL",s=[i],o="EXIT_ALTERNATIVE";let a=!1;const c=e.length,l=c-r-1,u=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Ue(d);){const f=d.pop();if(f===o){a&&yo(d).idx<=l&&d.pop();continue}const h=f.def,p=f.idx,y=f.ruleStack,$=f.occurrenceStack;if(Ue(h))continue;const T=h[0];if(T===i){const w={idx:p,def:Nt(h),ruleStack:pc(y),occurrenceStack:pc($)};d.push(w)}else if(T instanceof ze)if(p<c-1){const w=p+1,b=e[w];if(n(b,T.terminalType)){const _={idx:w,def:Nt(h),ruleStack:y,occurrenceStack:$};d.push(_)}}else if(p===c-1)u.push({nextTokenType:T.terminalType,nextTokenOccurrence:T.idx,ruleStack:y,occurrenceStack:$}),a=!0;else throw Error("non exhaustive match");else if(T instanceof Ht){const w=xt(y);w.push(T.nonTerminalName);const b=xt($);b.push(T.idx);const _={idx:p,def:T.definition.concat(s,Nt(h)),ruleStack:w,occurrenceStack:b};d.push(_)}else if(T instanceof Ot){const w={idx:p,def:Nt(h),ruleStack:y,occurrenceStack:$};d.push(w),d.push(o);const b={idx:p,def:T.definition.concat(Nt(h)),ruleStack:y,occurrenceStack:$};d.push(b)}else if(T instanceof wn){const w=new st({definition:T.definition,idx:T.idx}),b=T.definition.concat([w],Nt(h)),_={idx:p,def:b,ruleStack:y,occurrenceStack:$};d.push(_)}else if(T instanceof bn){const w=new ze({terminalType:T.separator}),b=new st({definition:[w].concat(T.definition),idx:T.idx}),_=T.definition.concat([b],Nt(h)),x={idx:p,def:_,ruleStack:y,occurrenceStack:$};d.push(x)}else if(T instanceof an){const w={idx:p,def:Nt(h),ruleStack:y,occurrenceStack:$};d.push(w),d.push(o);const b=new ze({terminalType:T.separator}),_=new st({definition:[b].concat(T.definition),idx:T.idx}),x=T.definition.concat([_],Nt(h)),F={idx:p,def:x,ruleStack:y,occurrenceStack:$};d.push(F)}else if(T instanceof st){const w={idx:p,def:Nt(h),ruleStack:y,occurrenceStack:$};d.push(w),d.push(o);const b=new st({definition:T.definition,idx:T.idx}),_=T.definition.concat([b],Nt(h)),x={idx:p,def:_,ruleStack:y,occurrenceStack:$};d.push(x)}else if(T instanceof cn)for(let w=T.definition.length-1;w>=0;w--){const b=T.definition[w],_={idx:p,def:b.definition.concat(Nt(h)),ruleStack:y,occurrenceStack:$};d.push(_),d.push(o)}else if(T instanceof on)d.push({idx:p,def:T.definition.concat(Nt(h)),ruleStack:y,occurrenceStack:$});else if(T instanceof wo)d.push(cB(T,p,y,$));else throw Error("non exhaustive match")}return u}function cB(t,e,n,r){const i=xt(n);i.push(t.name);const s=xt(r);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}var et;(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"})(et||(et={}));function Xg(t){if(t instanceof Ot||t==="Option")return et.OPTION;if(t instanceof st||t==="Repetition")return et.REPETITION;if(t instanceof wn||t==="RepetitionMandatory")return et.REPETITION_MANDATORY;if(t instanceof bn||t==="RepetitionMandatoryWithSeparator")return et.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof an||t==="RepetitionWithSeparator")return et.REPETITION_WITH_SEPARATOR;if(t instanceof cn||t==="Alternation")return et.ALTERNATION;throw Error("non exhaustive match")}function eR(t){const{occurrence:e,rule:n,prodType:r,maxLookahead:i}=t,s=Xg(r);return s===et.ALTERNATION?vd(e,n,i):wd(e,n,s,i)}function lB(t,e,n,r,i,s){const o=vd(t,e,n),a=iR(o)?md:vc;return s(o,r,a,i)}function uB(t,e,n,r,i,s){const o=wd(t,e,i,n),a=iR(o)?md:vc;return s(o[0],a,r)}function dB(t,e,n,r){const i=t.length,s=Yn(t,o=>Yn(o,a=>a.length===1));if(e)return function(o){const a=Z(o,c=>c.GATE);for(let c=0;c<i;c++){const l=t[c],u=l.length,d=a[c];if(!(d!==void 0&&d.call(this)===!1))e:for(let f=0;f<u;f++){const h=l[f],p=h.length;for(let y=0;y<p;y++){const $=this.LA(y+1);if(n($,h[y])===!1)continue e}return c}}};if(s&&!r){const o=Z(t,c=>Pn(c)),a=zt(o,(c,l,u)=>(re(l,d=>{se(c,d.tokenTypeIdx)||(c[d.tokenTypeIdx]=u),re(d.categoryMatches,f=>{se(c,f)||(c[f]=u)})}),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 l=0;l<c;l++){const u=a[l],d=u.length;for(let f=0;f<d;f++){const h=this.LA(f+1);if(n(h,u[f])===!1)continue e}return o}}}}function fB(t,e,n){const r=Yn(t,s=>s.length===1),i=t.length;if(r&&!n){const s=Pn(t);if(s.length===1&&Ue(s[0].categoryMatches)){const a=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}else{const o=zt(s,(a,c,l)=>(a[c.tokenTypeIdx]=!0,re(c.categoryMatches,u=>{a[u]=!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 l=this.LA(c+1);if(e(l,o[c])===!1)continue e}return!0}return!1}}class hB extends ld{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,et.OPTION,n,r)||super.walkOption(e,n,r)}walkAtLeastOne(e,n,r){this.checkIsTarget(e,et.REPETITION_MANDATORY,n,r)||super.walkOption(e,n,r)}walkAtLeastOneSep(e,n,r){this.checkIsTarget(e,et.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}walkMany(e,n,r){this.checkIsTarget(e,et.REPETITION,n,r)||super.walkOption(e,n,r)}walkManySep(e,n,r){this.checkIsTarget(e,et.REPETITION_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}}class tR extends bo{constructor(e,n,r){super(),this.targetOccurrence=e,this.targetProdType=n,this.targetRef=r,this.result=[]}checkIsTarget(e,n){e.idx===this.targetOccurrence&&this.targetProdType===n&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,et.OPTION)}visitRepetition(e){this.checkIsTarget(e,et.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,et.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,et.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,et.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,et.ALTERNATION)}}function nR(t){const e=new Array(t);for(let n=0;n<t;n++)e[n]=[];return e}function Jg(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 pB(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 rR(t,e){const n=Z(t,o=>Yg([o],1)),r=nR(n.length),i=Z(n,o=>{const a={};return re(o,c=>{const l=Jg(c.partialPath);re(l,u=>{a[u]=!0})}),a});let s=n;for(let o=1;o<=e;o++){const a=s;s=nR(a.length);for(let c=0;c<a.length;c++){const l=a[c];for(let u=0;u<l.length;u++){const d=l[u].partialPath,f=l[u].suffixDef,h=Jg(d);if(pB(i,h,c)||Ue(f)||d.length===e){const y=r[c];if(Qg(y,d)===!1){y.push(d);for(let $=0;$<h.length;$++){const T=h[$];i[c][T]=!0}}}else{const y=Yg(f,o+1,d);s[c]=s[c].concat(y),re(y,$=>{const T=Jg($.partialPath);re(T,w=>{i[c][w]=!0})})}}}}return r}function vd(t,e,n,r){const i=new tR(t,et.ALTERNATION,r);return e.accept(i),rR(i.result,n)}function wd(t,e,n,r){const i=new tR(t,n);e.accept(i);const s=i.result,a=new hB(e,t,n).startWalking(),c=new on({definition:s}),l=new on({definition:a});return rR([c,l],r)}function Qg(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 gB(t,e){return t.length<e.length&&Yn(t,(n,r)=>{const i=e[r];return n===i||i.categoryMatchesMap[n.tokenTypeIdx]})}function iR(t){return Yn(t,e=>Yn(e,n=>Yn(n,r=>Ue(r.categoryMatches))))}function mB(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return Z(e,n=>Object.assign({type:Vt.CUSTOM_LOOKAHEAD_VALIDATION},n))}function yB(t,e,n,r){const i=vn(t,c=>vB(c,n)),s=IB(t,e,n),o=vn(t,c=>kB(c,n)),a=vn(t,c=>TB(c,t,r,n));return i.concat(s,o,a)}function vB(t,e){const n=new bB;t.accept(n);const r=n.allProductions,i=Nj(r,wB),s=Jn(i,a=>a.length>1);return Z(Tt(s),a=>{const c=Xn(a),l=e.buildDuplicateFoundError(t,a),u=wr(c),d={message:l,type:Vt.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:u,occurrence:c.idx},f=sR(c);return f&&(d.parameter=f),d})}function wB(t){return`${wr(t)}_#_${t.idx}_#_${sR(t)}`}function sR(t){return t instanceof ze?t.terminalType.name:t instanceof Ht?t.nonTerminalName:""}class bB extends bo{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function TB(t,e,n,r){const i=[];if(zt(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:Vt.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function EB(t,e,n){const r=[];let i;return Gt(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:Vt.INVALID_RULE_OVERRIDE,ruleName:t})),r}function oR(t,e,n,r=[]){const i=[],s=bd(e.definition);if(Ue(s))return[];{const o=t.name;Gt(s,t)&&i.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:r}),type:Vt.LEFT_RECURSION,ruleName:o});const c=sd(s,r.concat([t])),l=vn(c,u=>{const d=xt(r);return d.push(u),oR(t,u,n,d)});return i.concat(l)}}function bd(t){let e=[];if(Ue(t))return e;const n=Xn(t);if(n instanceof Ht)e.push(n.referencedRule);else if(n instanceof on||n instanceof Ot||n instanceof wn||n instanceof bn||n instanceof an||n instanceof st)e=e.concat(bd(n.definition));else if(n instanceof cn)e=Pn(Z(n.definition,s=>bd(s.definition)));else if(!(n instanceof ze))throw Error("non exhaustive match");const r=cd(n),i=t.length>1;if(r&&i){const s=Nt(t);return e.concat(bd(s))}else return e}class Zg extends bo{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function RB(t,e){const n=new Zg;t.accept(n);const r=n.alternations;return vn(r,s=>{const o=pc(s.definition);return vn(o,(a,c)=>{const l=ZE([a],[],vc,1);return Ue(l)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:c}),type:Vt.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:c+1}]:[]})})}function SB(t,e,n){const r=new Zg;t.accept(r);let i=r.alternations;return i=od(i,o=>o.ignoreAmbiguities===!0),vn(i,o=>{const a=o.idx,c=o.maxLookahead||e,l=vd(a,t,c,o),u=CB(l,o,t,n),d=AB(l,o,t,n);return u.concat(d)})}class $B extends bo{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}function kB(t,e){const n=new Zg;t.accept(n);const r=n.alternations;return vn(r,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:Vt.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}function _B(t,e,n){const r=[];return re(t,i=>{const s=new $B;i.accept(s);const o=s.allProductions;re(o,a=>{const c=Xg(a),l=a.maxLookahead||e,u=a.idx,f=wd(u,i,c,l)[0];if(Ue(Pn(f))){const h=n.buildEmptyRepetitionError({topLevelRule:i,repetition:a});r.push({message:h,type:Vt.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),r}function CB(t,e,n,r){const i=[],s=zt(t,(a,c,l)=>(e.definition[l].ignoreAmbiguities===!0||re(c,u=>{const d=[l];re(t,(f,h)=>{l!==h&&Qg(f,u)&&e.definition[h].ignoreAmbiguities!==!0&&d.push(h)}),d.length>1&&!Qg(i,u)&&(i.push(u),a.push({alts:d,path:u}))}),a),[]);return Z(s,a=>{const c=Z(a.alts,u=>u+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:c,prefixPath:a.path}),type:Vt.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:e.idx,alternatives:a.alts}})}function AB(t,e,n,r){const i=zt(t,(o,a,c)=>{const l=Z(a,u=>({idx:c,path:u}));return o.concat(l)},[]);return hc(vn(i,o=>{if(e.definition[o.idx].ignoreAmbiguities===!0)return[];const c=o.idx,l=o.path,u=yn(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx<c&&gB(f.path,l));return Z(u,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:Vt.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:p,alternatives:h}})}))}function IB(t,e,n){const r=[],i=Z(e,s=>s.name);return re(t,s=>{const o=s.name;if(Gt(i,o)){const a=n.buildNamespaceConflictError(s);r.push({message:a,type:Vt.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:o})}}),r}function PB(t){const e=Bg(t,{errMsgProvider:tB}),n={};return re(t.rules,r=>{n[r.name]=r}),nB(n,e.errMsgProvider)}function xB(t){return t=Bg(t,{errMsgProvider:$s}),yB(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}const aR="MismatchedTokenException",cR="NoViableAltException",lR="EarlyExitException",uR="NotAllInputParsedException",dR=[aR,cR,lR,uR];Object.freeze(dR);function Td(t){return Gt(dR,t.name)}class Ed 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 fR extends Ed{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=aR}}class NB extends Ed{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=cR}}class OB extends Ed{constructor(e,n){super(e,n),this.name=uR}}class DB extends Ed{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=lR}}const em={},hR="InRuleRecoveryException";class LB extends Error{constructor(e){super(e),this.name=hR}}class MB{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=se(e,"recoveryEnabled")?e.recoveryEnabled:Vr.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=FB)}getTokenToInsert(e){const n=Kg(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 l=this.LA(1);let u=this.LA(1);const d=()=>{const f=this.LA(0),h=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:l,previous:f,ruleName:this.getCurrRuleFullName()}),p=new fR(h,l,this.LA(0));p.resyncedTokens=pc(a),this.SAVE_ERROR(p)};for(;!c;)if(this.tokenMatcher(u,i)){d();return}else if(r.call(this)){d(),e.apply(this,n);return}else this.tokenMatcher(u,s)?c=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,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 LB("sad sad panda")}canPerformInRuleRecovery(e,n){return this.canRecoverWithSingleTokenInsertion(e,n)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,n){if(!this.canTokenTypeBeInsertedInRecovery(e)||Ue(n))return!1;const r=this.LA(1);return vo(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 Gt(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let n=this.LA(1),r=2;for(;;){const i=vo(e,s=>XE(n,s));if(i!==void 0)return i;n=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return em;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 Z(e,(r,i)=>i===0?em:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:n[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=Z(this.buildFullFollowKeyStack(),n=>this.getFollowSetFromFollowKey(n));return Pn(e)}getFollowSetFromFollowKey(e){if(e===em)return[_i];const n=e.ruleName+e.idxInCallingRule+kE+e.inRule;return this.resyncFollows[n]}addToResyncTokens(e,n){return this.tokenMatcher(e,_i)||n.push(e),n}reSyncTo(e){const n=[];let r=this.LA(1);for(;this.tokenMatcher(r,e)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,n);return pc(n)}attemptInRepetitionRecovery(e,n,r,i,s,o,a){}getCurrentGrammarPath(e,n){const r=this.getHumanReadableRuleStack(),i=xt(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:i,lastTok:e,lastTokOccurrence:n}}getHumanReadableRuleStack(){return Z(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function FB(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 l=c.token,u=c.occurrence;const d=c.isEndOfRule;this.RULE_STACK.length===1&&d&&l===void 0&&(l=_i,u=1),!(l===void 0||u===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,u,o)&&this.tryInRepetitionRecovery(t,e,n,l)}const jB=4,Ci=8,pR=1<<Ci,gR=2<<Ci,tm=3<<Ci,nm=4<<Ci,rm=5<<Ci,Rd=6<<Ci;function im(t,e,n){return n|e|t}class sm{constructor(e){var n;this.maxLookahead=(n=e?.maxLookahead)!==null&&n!==void 0?n:Vr.maxLookahead}validate(e){const n=this.validateNoLeftRecursion(e.rules);if(Ue(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 vn(e,n=>oR(n,n,$s))}validateEmptyOrAlternatives(e){return vn(e,n=>RB(n,$s))}validateAmbiguousAlternationAlternatives(e,n){return vn(e,r=>SB(r,n,$s))}validateSomeNonEmptyLookaheadPath(e,n){return _B(e,n,$s)}buildLookaheadForAlternation(e){return lB(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,dB)}buildLookaheadForOptional(e){return uB(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Xg(e.prodType),fB)}}class UB{initLooksAhead(e){this.dynamicTokensEnabled=se(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Vr.dynamicTokensEnabled,this.maxLookahead=se(e,"maxLookahead")?e.maxLookahead:Vr.maxLookahead,this.lookaheadStrategy=se(e,"lookaheadStrategy")?e.lookaheadStrategy:new sm({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){re(e,n=>{this.TRACE_INIT(`${n.name} Rule Lookahead`,()=>{const{alternation:r,repetition:i,option:s,repetitionMandatory:o,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:c}=qB(n);re(r,l=>{const u=l.idx===0?"":l.idx;this.TRACE_INIT(`${wr(l)}${u}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:n,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=im(this.fullRuleNameToShort[n.name],pR,l.idx);this.setLaFuncCache(f,d)})}),re(i,l=>{this.computeLookaheadFunc(n,l.idx,tm,"Repetition",l.maxLookahead,wr(l))}),re(s,l=>{this.computeLookaheadFunc(n,l.idx,gR,"Option",l.maxLookahead,wr(l))}),re(o,l=>{this.computeLookaheadFunc(n,l.idx,nm,"RepetitionMandatory",l.maxLookahead,wr(l))}),re(a,l=>{this.computeLookaheadFunc(n,l.idx,Rd,"RepetitionMandatoryWithSeparator",l.maxLookahead,wr(l))}),re(c,l=>{this.computeLookaheadFunc(n,l.idx,rm,"RepetitionWithSeparator",l.maxLookahead,wr(l))})})})}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=im(this.fullRuleNameToShort[e.name],r,n);this.setLaFuncCache(c,a)})}getKeyForAutomaticLookahead(e,n){const r=this.getLastExplicitRuleShortName();return im(r,e,n)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,n){this.lookAheadFuncsCache.set(e,n)}}class BB extends bo{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}}const Sd=new BB;function qB(t){Sd.reset(),t.accept(Sd);const e=Sd.dslMethods;return Sd.reset(),e}function mR(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function yR(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 WB(t,e,n){t.children[n]===void 0?t.children[n]=[e]:t.children[n].push(e)}function GB(t,e,n){t.children[e]===void 0?t.children[e]=[n]:t.children[e].push(n)}const zB="name";function vR(t,e){Object.defineProperty(t,zB,{enumerable:!1,configurable:!0,writable:!1,value:e})}function HB(t,e){const n=In(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 l=o[c];l.tokenTypeIdx===void 0&&this[l.name](l.children,e)}}}function VB(t,e){const n=function(){};vR(n,t+"BaseSemantics");const r={visit:function(i,s){if($e(i)&&(i=i[0]),!Hr(i))return this[i.name](i.children,s)},validateVisitor:function(){const i=YB(this,e);if(!Ue(i)){const s=Z(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 KB(t,e,n){const r=function(){};vR(r,t+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return re(e,s=>{i[s]=HB}),r.prototype=i,r.prototype.constructor=r,r}var om;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(om||(om={}));function YB(t,e){return XB(t,e)}function XB(t,e){const n=yn(e,i=>qr(t[i])===!1),r=Z(n,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:om.MISSING_METHOD,methodName:i}));return hc(r)}class JB{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=se(e,"nodeLocationTracking")?e.nodeLocationTracking:Vr.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=bt,this.cstFinallyStateUpdate=bt,this.cstPostTerminal=bt,this.cstPostNonTerminal=bt,this.cstPostRule=bt;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=yR,this.setNodeLocationFromNode=yR,this.cstPostRule=bt,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=bt,this.setNodeLocationFromNode=bt,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=mR,this.setNodeLocationFromNode=mR,this.cstPostRule=bt,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=bt,this.setNodeLocationFromNode=bt,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=bt,this.setNodeLocationFromNode=bt,this.cstPostRule=bt,this.setInitialNodeLocation=bt;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];WB(r,n,e),this.setNodeLocationFromToken(r.location,n)}cstPostNonTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];GB(r,n,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(Hr(this.baseCstVisitorConstructor)){const e=VB(this.className,In(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Hr(this.baseCstVisitorWithDefaultsConstructor)){const e=KB(this.className,In(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 QB{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)):_d}LA(e){const n=this.currIdx+e;return n<0||this.tokVectorLength<=n?_d: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 ZB{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=Cd){if(Gt(this.definedRulesNames,e)){const o={message:$s.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Vt.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=Cd){const i=EB(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(Td(i))return!1;throw i}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return aU(Tt(this.gastProductionsCache))}}class e4{initRecognizerEngine(e,n){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=md,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},se(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($e(e)){if(Ue(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($e(e))this.tokensMap=zt(e,(s,o)=>(s[o.name]=o,s),{});else if(se(e,"modes")&&Yn(Pn(Tt(e.modes)),JU)){const s=Pn(Tt(e.modes)),o=qg(s);this.tokensMap=zt(o,(a,c)=>(a[c.name]=c,a),{})}else if(An(e))this.tokensMap=xt(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=_i;const r=se(e,"modes")?Pn(Tt(e.modes)):Tt(e),i=Yn(r,s=>Ue(s.categoryMatches));this.tokenMatcher=i?md:vc,wc(Tt(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=se(r,"resyncEnabled")?r.resyncEnabled:Cd.resyncEnabled,s=se(r,"recoveryValueFunc")?r.recoveryValueFunc:Cd.recoveryValueFunc,o=this.ruleShortNameIdx<<jB+Ci;this.ruleShortNameIdx++,this.shortRuleNameToFull[o]=e,this.fullRuleNameToShort[e]=o;let a;return this.outputCst===!0?a=function(...u){try{this.ruleInvocationStateUpdate(o,e,this.subruleIdx),n.apply(this,u);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(...u){try{return this.ruleInvocationStateUpdate(o,e,this.subruleIdx),n.apply(this,u)}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(Td(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(gR,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(nm,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,et.REPETITION_MANDATORY,n.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,n],i,nm,e,aB)}atLeastOneSepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(Rd,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,QE],a,Rd,e,QE)}else throw this.raiseEarlyExitException(e,et.REPETITION_MANDATORY_WITH_SEPARATOR,n.ERR_MSG)}manyInternal(e,n){const r=this.getKeyForAutomaticLookahead(tm,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,tm,e,oB,o)}manySepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(rm,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,JE],a,rm,e,JE)}}repetitionSepSecondInternal(e,n,r,i,s){for(;r();)this.CONSUME(n),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,n,r,i,s],r,Rd,e,s)}doSingleRepetition(e){const n=this.getLexerPosition();return e.call(this),this.getLexerPosition()>n}orInternal(e,n){const r=this.getKeyForAutomaticLookahead(pR,n),i=$e(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 OB(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 Td(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 fR(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===hR?r:s}}else throw r}saveRecogState(){const e=this.errors,n=xt(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),_i)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class t4{initErrorHandler(e){this._errors=[],this.errorMessageProvider=se(e,"errorMessageProvider")?e.errorMessageProvider:Vr.errorMessageProvider}SAVE_ERROR(e){if(Td(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:xt(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return xt(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,n,r){const i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],a=wd(e,s,n,this.maxLookahead)[0],c=[];for(let u=1;u<=this.maxLookahead;u++)c.push(this.LA(u));const l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:c,previous:this.LA(0),customUserDescription:r,ruleName:i});throw this.SAVE_ERROR(new DB(l,this.LA(1),this.LA(0)))}raiseNoAltException(e,n){const r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],s=vd(e,i,this.maxLookahead),o=[];for(let l=1;l<=this.maxLookahead;l++)o.push(this.LA(l));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 NB(c,this.LA(1),a))}}class n4{initContentAssist(){}computeContentAssist(e,n){const r=this.gastProductionsCache[e];if(Hr(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return ZE([r],n,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const n=Xn(e.ruleStack),i=this.getGAstProductions()[n];return new sB(i,e).startWalking()}}const $d={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze($d);const wR=!0,bR=Math.pow(2,Ci)-1,TR=YE({name:"RECORDING_PHASE_TOKEN",pattern:ln.NA});wc([TR]);const ER=Kg(TR,`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(ER);const r4={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 i4{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 _d}topLevelRuleRecord(e,n){try{const r=new wo({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 Tc.call(this,Ot,e,n)}atLeastOneInternalRecord(e,n){Tc.call(this,wn,n,e)}atLeastOneSepFirstInternalRecord(e,n){Tc.call(this,bn,n,e,wR)}manyInternalRecord(e,n){Tc.call(this,st,n,e)}manySepFirstInternalRecord(e,n){Tc.call(this,an,n,e,wR)}orInternalRecord(e,n){return s4.call(this,e,n)}subruleInternalRecord(e,n,r){if(kd(n),!e||se(e,"ruleName")===!1){const a=new Error(`<SUBRULE${RR(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=yo(this.recordingProdStack),s=e.ruleName,o=new Ht({idx:n,nonTerminalName:s,label:r?.LABEL,referencedRule:void 0});return i.definition.push(o),this.outputCst?r4:$d}consumeInternalRecord(e,n,r){if(kd(n),!FE(e)){const o=new Error(`<CONSUME${RR(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=yo(this.recordingProdStack),s=new ze({idx:n,terminalType:e,label:r?.LABEL});return i.definition.push(s),ER}}function Tc(t,e,n,r=!1){kd(n);const i=yo(this.recordingProdStack),s=qr(e)?e:e.DEF,o=new t({definition:[],idx:n});return r&&(o.separator=e.SEP),se(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),i.definition.push(o),this.recordingProdStack.pop(),$d}function s4(t,e){kd(e);const n=yo(this.recordingProdStack),r=$e(t)===!1,i=r===!1?t:t.DEF,s=new cn({definition:[],idx:e,ignoreAmbiguities:r&&t.IGNORE_AMBIGUITIES===!0});se(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);const o=bE(i,a=>qr(a.GATE));return s.hasPredicates=o,n.definition.push(s),re(i,a=>{const c=new on({definition:[]});s.definition.push(c),se(a,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:se(a,"GATE")&&(c.ignoreAmbiguities=!0),this.recordingProdStack.push(c),a.ALT.call(this),this.recordingProdStack.pop()}),$d}function RR(t){return t===0?"":`${t}`}function kd(t){if(t<0||t>bR){const e=new Error(`Invalid DSL Method idx value: <${t}>
|
|
105
|
-
Idx value must be a none negative value smaller than ${bR+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class o4{initPerformanceTracer(e){if(se(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=Vr.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}=RE(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 a4(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 _d=Kg(_i,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(_d);const Vr=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Eo,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Cd=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var Vt;(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"})(Vt||(Vt={}));function SR(t=void 0){return function(){return t}}class Yl{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",()=>{SE(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),re(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=PB({rules:Tt(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT("Grammar Validations",()=>{if(Ue(r)&&this.skipValidations===!1){const i=xB({rules:Tt(this.gastProductionsCache),tokenTypes:Tt(this.tokensMap),errMsgProvider:$s,grammarName:n}),s=mB({lookaheadStrategy:this.lookaheadStrategy,rules:Tt(this.gastProductionsCache),tokenTypes:Tt(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(i,s)}}),Ue(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=pU(Tt(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:Tt(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Tt(this.gastProductionsCache))})),!Yl.DEFER_DEFINITION_ERRORS_HANDLING&&!Ue(this.definitionErrors))throw e=Z(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),se(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=se(n,"skipValidations")?n.skipValidations:Vr.skipValidations}}Yl.DEFER_DEFINITION_ERRORS_HANDLING=!1,a4(Yl,[MB,UB,JB,QB,e4,ZB,t4,n4,i4,o4]);class c4 extends Yl{constructor(e,n=Vr){const r=xt(n);r.outputCst=!1,super(e,r)}}function Ro(t,e,n){return`${t.name}_${e}_${n}`}const Ai=1,l4=2,$R=4,kR=5,Ec=7,u4=8,d4=9,f4=10,h4=11,_R=12;class am{constructor(e){this.target=e}isEpsilon(){return!1}}class cm extends am{constructor(e,n){super(e),this.tokenType=n}}class CR extends am{constructor(e){super(e)}isEpsilon(){return!0}}class lm extends am{constructor(e,n,r){super(e),this.rule=n,this.followState=r}isEpsilon(){return!0}}function p4(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};g4(e,t);const n=t.length;for(let r=0;r<n;r++){const i=t[r],s=ks(e,i,i);s!==void 0&&k4(e,i,s)}return e}function g4(t,e){const n=e.length;for(let r=0;r<n;r++){const i=e[r],s=$t(t,i,void 0,{type:l4}),o=$t(t,i,void 0,{type:Ec});s.stop=o,t.ruleToStartState.set(i,s),t.ruleToStopState.set(i,o)}}function AR(t,e,n){return n instanceof ze?um(t,e,n.terminalType,n):n instanceof Ht?$4(t,e,n):n instanceof cn?b4(t,e,n):n instanceof Ot?T4(t,e,n):n instanceof st?m4(t,e,n):n instanceof an?y4(t,e,n):n instanceof wn?v4(t,e,n):n instanceof bn?w4(t,e,n):ks(t,e,n)}function m4(t,e,n){const r=$t(t,e,n,{type:kR});Ii(t,r);const i=So(t,e,r,n,ks(t,e,n));return PR(t,e,n,i)}function y4(t,e,n){const r=$t(t,e,n,{type:kR});Ii(t,r);const i=So(t,e,r,n,ks(t,e,n)),s=um(t,e,n.separator,n);return PR(t,e,n,i,s)}function v4(t,e,n){const r=$t(t,e,n,{type:$R});Ii(t,r);const i=So(t,e,r,n,ks(t,e,n));return IR(t,e,n,i)}function w4(t,e,n){const r=$t(t,e,n,{type:$R});Ii(t,r);const i=So(t,e,r,n,ks(t,e,n)),s=um(t,e,n.separator,n);return IR(t,e,n,i,s)}function b4(t,e,n){const r=$t(t,e,n,{type:Ai});Ii(t,r);const i=Z(n.definition,o=>AR(t,e,o));return So(t,e,r,n,...i)}function T4(t,e,n){const r=$t(t,e,n,{type:Ai});Ii(t,r);const i=So(t,e,r,n,ks(t,e,n));return E4(t,e,n,i)}function ks(t,e,n){const r=yn(Z(n.definition,i=>AR(t,e,i)),i=>i!==void 0);return r.length===1?r[0]:r.length===0?void 0:S4(t,r)}function IR(t,e,n,r,i){const s=r.left,o=r.right,a=$t(t,e,n,{type:h4});Ii(t,a);const c=$t(t,e,n,{type:_R});return s.loopback=a,c.loopback=a,t.decisionMap[Ro(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",n.idx)]=a,gt(o,a),i===void 0?(gt(a,s),gt(a,c)):(gt(a,c),gt(a,i.left),gt(i.right,s)),{left:s,right:c}}function PR(t,e,n,r,i){const s=r.left,o=r.right,a=$t(t,e,n,{type:f4});Ii(t,a);const c=$t(t,e,n,{type:_R}),l=$t(t,e,n,{type:d4});return a.loopback=l,c.loopback=l,gt(a,s),gt(a,c),gt(o,l),i!==void 0?(gt(l,c),gt(l,i.left),gt(i.right,s)):gt(l,a),t.decisionMap[Ro(e,i?"RepetitionWithSeparator":"Repetition",n.idx)]=a,{left:a,right:c}}function E4(t,e,n,r){const i=r.left,s=r.right;return gt(i,s),t.decisionMap[Ro(e,"Option",n.idx)]=i,r}function Ii(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function So(t,e,n,r,...i){const s=$t(t,e,r,{type:u4,start:n});n.end=s;for(const a of i)a!==void 0?(gt(n,a.left),gt(a.right,s)):gt(n,s);const o={left:n,right:s};return t.decisionMap[Ro(e,R4(r),r.idx)]=n,o}function R4(t){if(t instanceof cn)return"Alternation";if(t instanceof Ot)return"Option";if(t instanceof st)return"Repetition";if(t instanceof an)return"RepetitionWithSeparator";if(t instanceof wn)return"RepetitionMandatory";if(t instanceof bn)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function S4(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 lm,l=a,u=e[s+1].left;o.left.type===Ai&&o.right.type===Ai&&a!==void 0&&(c&&l.followState===o.right||a.target===o.right)?(c?l.followState=u:a.target=u,_4(t,o.right)):gt(o.right,u)}const r=e[0],i=e[n-1];return{left:r.left,right:i.right}}function um(t,e,n,r){const i=$t(t,e,r,{type:Ai}),s=$t(t,e,r,{type:Ai});return dm(i,new cm(s,n)),{left:i,right:s}}function $4(t,e,n){const r=n.referencedRule,i=t.ruleToStartState.get(r),s=$t(t,e,n,{type:Ai}),o=$t(t,e,n,{type:Ai}),a=new lm(i,r,o);return dm(s,a),{left:s,right:o}}function k4(t,e,n){const r=t.ruleToStartState.get(e);gt(r,n.left);const i=t.ruleToStopState.get(e);return gt(n.right,i),{left:r,right:i}}function gt(t,e){const n=new CR(e);dm(t,n)}function $t(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 dm(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function _4(t,e){t.states.splice(t.states.indexOf(e),1)}const Ad={};class fm{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const n=xR(e);n in this.map||(this.map[n]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return Z(this.configs,e=>e.alt)}get key(){let e="";for(const n in this.map)e+=n+":";return e}}function xR(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(n=>n.stateNumber.toString()).join("_")}`}function C4(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 NR{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 OR=new NR;class A4 extends sm{constructor(e){var n;super(),this.logging=(n=e?.logging)!==null&&n!==void 0?n:r=>console.log(r)}initialize(e){this.atn=p4(e.rules),this.dfas=I4(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=Ro(r,"Alternation",n),u=this.atn.decisionMap[c].decision,d=Z(eR({maxLookahead:1,occurrence:n,prodType:"Alternation",rule:r}),f=>Z(f,h=>h[0]));if(DR(d,!1)&&!s){const f=zt(d,(h,p,y)=>(re(p,$=>{$&&(h[$.tokenTypeIdx]=y,re($.categoryMatches,T=>{h[T]=y}))}),h),{});return i?function(h){var p;const y=this.LA(1),$=f[y.tokenTypeIdx];if(h!==void 0&&$!==void 0){const T=(p=h[$])===null||p===void 0?void 0:p.GATE;if(T!==void 0&&T.call(this)===!1)return}return $}:function(){const h=this.LA(1);return f[h.tokenTypeIdx]}}else return i?function(f){const h=new NR,p=f===void 0?0:f.length;for(let $=0;$<p;$++){const T=f?.[$].GATE;h.set($,T===void 0||T.call(this))}const y=hm.call(this,o,u,h,a);return typeof y=="number"?y:void 0}:function(){const f=hm.call(this,o,u,OR,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=Ro(r,i,n),u=this.atn.decisionMap[c].decision,d=Z(eR({maxLookahead:1,occurrence:n,prodType:i,rule:r}),f=>Z(f,h=>h[0]));if(DR(d)&&d[0][0]&&!s){const f=d[0],h=Pn(f);if(h.length===1&&Ue(h[0].categoryMatches)){const y=h[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===y}}else{const p=zt(h,(y,$)=>($!==void 0&&(y[$.tokenTypeIdx]=!0,re($.categoryMatches,T=>{y[T]=!0})),y),{});return function(){const y=this.LA(1);return p[y.tokenTypeIdx]===!0}}}return function(){const f=hm.call(this,o,u,OR,a);return typeof f=="object"?!1:f===0}}}function DR(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 I4(t){const e=t.decisionStates.length,n=Array(e);for(let r=0;r<e;r++)n[r]=C4(t.decisionStates[r],r);return n}function hm(t,e,n,r){const i=t[e](n);let s=i.start;if(s===void 0){const a=B4(i.atnStartState);s=FR(i,LR(a)),i.start=s}return P4.apply(this,[i,s,n,r])}function P4(t,e,n,r){let i=e,s=1;const o=[];let a=this.LA(s++);for(;;){let c=M4(i,a);if(c===void 0&&(c=x4.apply(this,[t,i,a,s,n,r])),c===Ad)return L4(o,i,a);if(c.isAcceptState===!0)return c.prediction;i=c,o.push(a),a=this.LA(s++)}}function x4(t,e,n,r,i,s){const o=F4(e.configs,n,i);if(o.size===0)return MR(t,e,n,Ad),Ad;let a=LR(o);const c=U4(o,i);if(c!==void 0)a.isAcceptState=!0,a.prediction=c,a.configs.uniqueAlt=c;else if(z4(o)){const l=Kj(o.alts);a.isAcceptState=!0,a.prediction=l,a.configs.uniqueAlt=l,N4.apply(this,[t,r,o.alts,s])}return a=MR(t,e,n,a),a}function N4(t,e,n,r){const i=[];for(let l=1;l<=e;l++)i.push(this.LA(l).tokenType);const s=t.atnStartState,o=s.rule,a=s.production,c=O4({topLevelRule:o,ambiguityIndices:n,production:a,prefixPath:i});r(c)}function O4(t){const e=Z(t.prefixPath,i=>To(i)).join(", "),n=t.production.idx===0?"":t.production.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${D4(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 D4(t){if(t instanceof Ht)return"SUBRULE";if(t instanceof Ot)return"OPTION";if(t instanceof cn)return"OR";if(t instanceof wn)return"AT_LEAST_ONE";if(t instanceof bn)return"AT_LEAST_ONE_SEP";if(t instanceof an)return"MANY_SEP";if(t instanceof st)return"MANY";if(t instanceof ze)return"CONSUME";throw Error("non exhaustive match")}function L4(t,e,n){const r=vn(e.configs.elements,s=>s.state.transitions),i=iU(r.filter(s=>s instanceof cm).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:n,possibleTokenTypes:i,tokenPath:t}}function M4(t,e){return t.edges[e.tokenTypeIdx]}function F4(t,e,n){const r=new fm,i=[];for(const o of t.elements){if(n.is(o.alt)===!1)continue;if(o.state.type===Ec){i.push(o);continue}const a=o.state.transitions.length;for(let c=0;c<a;c++){const l=o.state.transitions[c],u=j4(l,e);u!==void 0&&r.add({state:u,alt:o.alt,stack:o.stack})}}let s;if(i.length===0&&r.size===1&&(s=r),s===void 0){s=new fm;for(const o of r.elements)Id(o,s)}if(i.length>0&&!W4(s))for(const o of i)s.add(o);return s}function j4(t,e){if(t instanceof cm&&XE(e,t.tokenType))return t.target}function U4(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 LR(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function MR(t,e,n,r){return r=FR(t,r),e.edges[n.tokenTypeIdx]=r,r}function FR(t,e){if(e===Ad)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 B4(t){const e=new fm,n=t.transitions.length;for(let r=0;r<n;r++){const s={state:t.transitions[r].target,alt:r,stack:[]};Id(s,e)}return e}function Id(t,e){const n=t.state;if(n.type===Ec){if(t.stack.length>0){const i=[...t.stack],o={state:i.pop(),alt:t.alt,stack:i};Id(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=q4(t,s);o!==void 0&&Id(o,e)}}function q4(t,e){if(e instanceof CR)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof lm){const n=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:n}}}function W4(t){for(const e of t.elements)if(e.state.type===Ec)return!0;return!1}function G4(t){for(const e of t.elements)if(e.state.type!==Ec)return!1;return!0}function z4(t){if(G4(t))return!0;const e=H4(t.elements);return V4(e)&&!K4(e)}function H4(t){const e=new Map;for(const n of t){const r=xR(n,!1);let i=e.get(r);i===void 0&&(i={},e.set(r,i)),i[n.alt]=!0}return e}function V4(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function K4(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var jR;(function(t){function e(n){return typeof n=="string"}t.is=e})(jR||(jR={}));var pm;(function(t){function e(n){return typeof n=="string"}t.is=e})(pm||(pm={}));var UR;(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})(UR||(UR={}));var Pd;(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})(Pd||(Pd={}));var Pe;(function(t){function e(r,i){return r===Number.MAX_VALUE&&(r=Pd.MAX_VALUE),i===Number.MAX_VALUE&&(i=Pd.MAX_VALUE),{line:r,character:i}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&O.uinteger(i.line)&&O.uinteger(i.character)}t.is=n})(Pe||(Pe={}));var Ee;(function(t){function e(r,i,s,o){if(O.uinteger(r)&&O.uinteger(i)&&O.uinteger(s)&&O.uinteger(o))return{start:Pe.create(r,i),end:Pe.create(s,o)};if(Pe.is(r)&&Pe.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 O.objectLiteral(i)&&Pe.is(i.start)&&Pe.is(i.end)}t.is=n})(Ee||(Ee={}));var xd;(function(t){function e(r,i){return{uri:r,range:i}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&Ee.is(i.range)&&(O.string(i.uri)||O.undefined(i.uri))}t.is=n})(xd||(xd={}));var BR;(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 O.objectLiteral(i)&&Ee.is(i.targetRange)&&O.string(i.targetUri)&&Ee.is(i.targetSelectionRange)&&(Ee.is(i.originSelectionRange)||O.undefined(i.originSelectionRange))}t.is=n})(BR||(BR={}));var gm;(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 O.objectLiteral(i)&&O.numberRange(i.red,0,1)&&O.numberRange(i.green,0,1)&&O.numberRange(i.blue,0,1)&&O.numberRange(i.alpha,0,1)}t.is=n})(gm||(gm={}));var qR;(function(t){function e(r,i){return{range:r,color:i}}t.create=e;function n(r){const i=r;return O.objectLiteral(i)&&Ee.is(i.range)&&gm.is(i.color)}t.is=n})(qR||(qR={}));var WR;(function(t){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}t.create=e;function n(r){const i=r;return O.objectLiteral(i)&&O.string(i.label)&&(O.undefined(i.textEdit)||Kt.is(i))&&(O.undefined(i.additionalTextEdits)||O.typedArray(i.additionalTextEdits,Kt.is))}t.is=n})(WR||(WR={}));var GR;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(GR||(GR={}));var zR;(function(t){function e(r,i,s,o,a,c){const l={startLine:r,endLine:i};return O.defined(s)&&(l.startCharacter=s),O.defined(o)&&(l.endCharacter=o),O.defined(a)&&(l.kind=a),O.defined(c)&&(l.collapsedText=c),l}t.create=e;function n(r){const i=r;return O.objectLiteral(i)&&O.uinteger(i.startLine)&&O.uinteger(i.startLine)&&(O.undefined(i.startCharacter)||O.uinteger(i.startCharacter))&&(O.undefined(i.endCharacter)||O.uinteger(i.endCharacter))&&(O.undefined(i.kind)||O.string(i.kind))}t.is=n})(zR||(zR={}));var mm;(function(t){function e(r,i){return{location:r,message:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&xd.is(i.location)&&O.string(i.message)}t.is=n})(mm||(mm={}));var Rc;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Rc||(Rc={}));var HR;(function(t){t.Unnecessary=1,t.Deprecated=2})(HR||(HR={}));var VR;(function(t){function e(n){const r=n;return O.objectLiteral(r)&&O.string(r.href)}t.is=e})(VR||(VR={}));var Nd;(function(t){function e(r,i,s,o,a,c){let l={range:r,message:i};return O.defined(s)&&(l.severity=s),O.defined(o)&&(l.code=o),O.defined(a)&&(l.source=a),O.defined(c)&&(l.relatedInformation=c),l}t.create=e;function n(r){var i;let s=r;return O.defined(s)&&Ee.is(s.range)&&O.string(s.message)&&(O.number(s.severity)||O.undefined(s.severity))&&(O.integer(s.code)||O.string(s.code)||O.undefined(s.code))&&(O.undefined(s.codeDescription)||O.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(O.string(s.source)||O.undefined(s.source))&&(O.undefined(s.relatedInformation)||O.typedArray(s.relatedInformation,mm.is))}t.is=n})(Nd||(Nd={}));var $o;(function(t){function e(r,i,...s){let o={title:r,command:i};return O.defined(s)&&s.length>0&&(o.arguments=s),o}t.create=e;function n(r){let i=r;return O.defined(i)&&O.string(i.title)&&O.string(i.command)}t.is=n})($o||($o={}));var Kt;(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 O.objectLiteral(o)&&O.string(o.newText)&&Ee.is(o.range)}t.is=i})(Kt||(Kt={}));var ym;(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 O.objectLiteral(i)&&O.string(i.label)&&(O.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(O.string(i.description)||i.description===void 0)}t.is=n})(ym||(ym={}));var ko;(function(t){function e(n){const r=n;return O.string(r)}t.is=e})(ko||(ko={}));var KR;(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 Kt.is(o)&&(ym.is(o.annotationId)||ko.is(o.annotationId))}t.is=i})(KR||(KR={}));var vm;(function(t){function e(r,i){return{textDocument:r,edits:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&Rm.is(i.textDocument)&&Array.isArray(i.edits)}t.is=n})(vm||(vm={}));var wm;(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"&&O.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||O.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||O.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||ko.is(i.annotationId))}t.is=n})(wm||(wm={}));var bm;(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"&&O.string(i.oldUri)&&O.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||O.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||O.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||ko.is(i.annotationId))}t.is=n})(bm||(bm={}));var Tm;(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"&&O.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||O.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||O.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||ko.is(i.annotationId))}t.is=n})(Tm||(Tm={}));var Em;(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=>O.string(i.kind)?wm.is(i)||bm.is(i)||Tm.is(i):vm.is(i)))}t.is=e})(Em||(Em={}));var YR;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let i=r;return O.defined(i)&&O.string(i.uri)}t.is=n})(YR||(YR={}));var XR;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&O.string(i.uri)&&O.integer(i.version)}t.is=n})(XR||(XR={}));var Rm;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&O.string(i.uri)&&(i.version===null||O.integer(i.version))}t.is=n})(Rm||(Rm={}));var JR;(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 O.defined(i)&&O.string(i.uri)&&O.string(i.languageId)&&O.integer(i.version)&&O.string(i.text)}t.is=n})(JR||(JR={}));var Sm;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){const r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(Sm||(Sm={}));var Sc;(function(t){function e(n){const r=n;return O.objectLiteral(n)&&Sm.is(r.kind)&&O.string(r.value)}t.is=e})(Sc||(Sc={}));var br;(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})(br||(br={}));var QR;(function(t){t.PlainText=1,t.Snippet=2})(QR||(QR={}));var ZR;(function(t){t.Deprecated=1})(ZR||(ZR={}));var eS;(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&&O.string(i.newText)&&Ee.is(i.insert)&&Ee.is(i.replace)}t.is=n})(eS||(eS={}));var tS;(function(t){t.asIs=1,t.adjustIndentation=2})(tS||(tS={}));var nS;(function(t){function e(n){const r=n;return r&&(O.string(r.detail)||r.detail===void 0)&&(O.string(r.description)||r.description===void 0)}t.is=e})(nS||(nS={}));var rS;(function(t){function e(n){return{label:n}}t.create=e})(rS||(rS={}));var iS;(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(iS||(iS={}));var Od;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){const i=r;return O.string(i)||O.objectLiteral(i)&&O.string(i.language)&&O.string(i.value)}t.is=n})(Od||(Od={}));var sS;(function(t){function e(n){let r=n;return!!r&&O.objectLiteral(r)&&(Sc.is(r.contents)||Od.is(r.contents)||O.typedArray(r.contents,Od.is))&&(n.range===void 0||Ee.is(n.range))}t.is=e})(sS||(sS={}));var oS;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(oS||(oS={}));var aS;(function(t){function e(n,r,...i){let s={label:n};return O.defined(r)&&(s.documentation=r),O.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(aS||(aS={}));var cS;(function(t){t.Text=1,t.Read=2,t.Write=3})(cS||(cS={}));var lS;(function(t){function e(n,r){let i={range:n};return O.number(r)&&(i.kind=r),i}t.create=e})(lS||(lS={}));var Qn;(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})(Qn||(Qn={}));var uS;(function(t){t.Deprecated=1})(uS||(uS={}));var dS;(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})(dS||(dS={}));var fS;(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})(fS||(fS={}));var hS;(function(t){function e(r,i,s,o,a,c){let l={name:r,detail:i,kind:s,range:o,selectionRange:a};return c!==void 0&&(l.children=c),l}t.create=e;function n(r){let i=r;return i&&O.string(i.name)&&O.number(i.kind)&&Ee.is(i.range)&&Ee.is(i.selectionRange)&&(i.detail===void 0||O.string(i.detail))&&(i.deprecated===void 0||O.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=n})(hS||(hS={}));var pS;(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"})(pS||(pS={}));var Dd;(function(t){t.Invoked=1,t.Automatic=2})(Dd||(Dd={}));var gS;(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 O.defined(i)&&O.typedArray(i.diagnostics,Nd.is)&&(i.only===void 0||O.typedArray(i.only,O.string))&&(i.triggerKind===void 0||i.triggerKind===Dd.Invoked||i.triggerKind===Dd.Automatic)}t.is=n})(gS||(gS={}));var mS;(function(t){function e(r,i,s){let o={title:r},a=!0;return typeof i=="string"?(a=!1,o.kind=i):$o.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&&O.string(i.title)&&(i.diagnostics===void 0||O.typedArray(i.diagnostics,Nd.is))&&(i.kind===void 0||O.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||$o.is(i.command))&&(i.isPreferred===void 0||O.boolean(i.isPreferred))&&(i.edit===void 0||Em.is(i.edit))}t.is=n})(mS||(mS={}));var yS;(function(t){function e(r,i){let s={range:r};return O.defined(i)&&(s.data=i),s}t.create=e;function n(r){let i=r;return O.defined(i)&&Ee.is(i.range)&&(O.undefined(i.command)||$o.is(i.command))}t.is=n})(yS||(yS={}));var vS;(function(t){function e(r,i){return{tabSize:r,insertSpaces:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&O.uinteger(i.tabSize)&&O.boolean(i.insertSpaces)}t.is=n})(vS||(vS={}));var wS;(function(t){function e(r,i,s){return{range:r,target:i,data:s}}t.create=e;function n(r){let i=r;return O.defined(i)&&Ee.is(i.range)&&(O.undefined(i.target)||O.string(i.target))}t.is=n})(wS||(wS={}));var bS;(function(t){function e(r,i){return{range:r,parent:i}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&Ee.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=n})(bS||(bS={}));var Ie;(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"})(Ie||(Ie={}));var tt;(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"})(tt||(tt={}));var TS;(function(t){function e(n){const r=n;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")}t.is=e})(TS||(TS={}));var ES;(function(t){function e(r,i){return{range:r,text:i}}t.create=e;function n(r){const i=r;return i!=null&&Ee.is(i.range)&&O.string(i.text)}t.is=n})(ES||(ES={}));var RS;(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&&Ee.is(i.range)&&O.boolean(i.caseSensitiveLookup)&&(O.string(i.variableName)||i.variableName===void 0)}t.is=n})(RS||(RS={}));var SS;(function(t){function e(r,i){return{range:r,expression:i}}t.create=e;function n(r){const i=r;return i!=null&&Ee.is(i.range)&&(O.string(i.expression)||i.expression===void 0)}t.is=n})(SS||(SS={}));var $S;(function(t){function e(r,i){return{frameId:r,stoppedLocation:i}}t.create=e;function n(r){const i=r;return O.defined(i)&&Ee.is(r.stoppedLocation)}t.is=n})($S||($S={}));var $m;(function(t){t.Type=1,t.Parameter=2;function e(n){return n===1||n===2}t.is=e})($m||($m={}));var km;(function(t){function e(r){return{value:r}}t.create=e;function n(r){const i=r;return O.objectLiteral(i)&&(i.tooltip===void 0||O.string(i.tooltip)||Sc.is(i.tooltip))&&(i.location===void 0||xd.is(i.location))&&(i.command===void 0||$o.is(i.command))}t.is=n})(km||(km={}));var kS;(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 O.objectLiteral(i)&&Pe.is(i.position)&&(O.string(i.label)||O.typedArray(i.label,km.is))&&(i.kind===void 0||$m.is(i.kind))&&i.textEdits===void 0||O.typedArray(i.textEdits,Kt.is)&&(i.tooltip===void 0||O.string(i.tooltip)||Sc.is(i.tooltip))&&(i.paddingLeft===void 0||O.boolean(i.paddingLeft))&&(i.paddingRight===void 0||O.boolean(i.paddingRight))}t.is=n})(kS||(kS={}));var _S;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(_S||(_S={}));var CS;(function(t){function e(n,r,i,s){return{insertText:n,filterText:r,range:i,command:s}}t.create=e})(CS||(CS={}));var AS;(function(t){function e(n){return{items:n}}t.create=e})(AS||(AS={}));var IS;(function(t){t.Invoked=0,t.Automatic=1})(IS||(IS={}));var PS;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(PS||(PS={}));var xS;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(xS||(xS={}));var NS;(function(t){function e(n){const r=n;return O.objectLiteral(r)&&pm.is(r.uri)&&O.string(r.name)}t.is=e})(NS||(NS={}));var OS;(function(t){function e(s,o,a,c){return new Y4(s,o,a,c)}t.create=e;function n(s){let o=s;return!!(O.defined(o)&&O.string(o.uri)&&(O.undefined(o.languageId)||O.string(o.languageId))&&O.uinteger(o.lineCount)&&O.func(o.getText)&&O.func(o.positionAt)&&O.func(o.offsetAt))}t.is=n;function r(s,o){let a=s.getText(),c=i(o,(u,d)=>{let f=u.range.start.line-d.range.start.line;return f===0?u.range.start.character-d.range.start.character:f}),l=a.length;for(let u=c.length-1;u>=0;u--){let d=c[u],f=s.offsetAt(d.range.start),h=s.offsetAt(d.range.end);if(h<=l)a=a.substring(0,f)+d.newText+a.substring(h,a.length);else throw new Error("Overlapping edit");l=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),l=s.slice(a);i(c,o),i(l,o);let u=0,d=0,f=0;for(;u<c.length&&d<l.length;)o(c[u],l[d])<=0?s[f++]=c[u++]:s[f++]=l[d++];for(;u<c.length;)s[f++]=c[u++];for(;d<l.length;)s[f++]=l[d++];return s}})(OS||(OS={}));let Y4=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 Pe.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 Pe.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 O;(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,y){return e.call(h)==="[object Number]"&&p<=h&&h<=y}t.numberRange=a;function c(h){return e.call(h)==="[object Number]"&&-2147483648<=h&&h<=2147483647}t.integer=c;function l(h){return e.call(h)==="[object Number]"&&0<=h&&h<=2147483647}t.uinteger=l;function u(h){return e.call(h)==="[object Function]"}t.func=u;function d(h){return h!==null&&typeof h=="object"}t.objectLiteral=d;function f(h,p){return Array.isArray(h)&&h.every(p)}t.typedArray=f})(O||(O={}));class X4{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]}buildRootNode(e){return this.rootNode=new LS(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const n=new Cm;return n.grammarSource=e,n.root=this.rootNode,this.current.content.push(n),this.nodeStack.push(n),n}buildLeafNode(e,n){const r=new _m(e.startOffset,e.image.length,Eu(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 _m(n.startOffset,n.image.length,Eu(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(Ti(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 DS{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 _m extends DS{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 Cm extends DS{constructor(){super(...arguments),this.content=new Xw(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:Pe.create(0,0),end:Pe.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 Xw extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,Xw.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 LS extends Cm{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const Am=Symbol("Datatype");function Im(t){return t.$type===Am}const MS="\u200B",FS=t=>t.endsWith(MS)?t:t+MS;class jS{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const n=this.lexer.definition;this.wrapper=new t5(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 J4 extends jS{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new X4,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(FS(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(Gu(e))return Am;{const n=vs(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,parserErrors:this.wrapper.errors}}startImplementation(e,n){return r=>{if(!this.isRecording()){const s={$type:e};this.stack.push(s),e===Am&&(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 l=hr(r)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,l,s,a)}else if(Im(c)){let l=i.image;hr(r)||(l=this.converter.convert(l,s).toString()),c.value+=l}}}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(Im(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 l=c;this.stack.pop(),this.stack.push(l)}}}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 rg(e),this.nodeBuilder.construct(e),this.stack.pop(),Im(e)?this.converter.convert(e.value,e.$cstNode):(sg(this.astReflection,e),e)}getAssignment(e){if(!this.assignmentMap.has(e)){const n=rn(e,fr);this.assignmentMap.set(e,{assignment:n,isCrossRef:n?Ba(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 Q4{buildMismatchTokenMessage(e){return Eo.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Eo.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Eo.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Eo.buildEarlyExitMessage(e)}}class US extends Q4{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 Z4 extends jS{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);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(FS(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 e5={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new US};class t5 extends c4{constructor(e,n){const r=n&&"maxLookahead"in n;super(e,Object.assign(Object.assign(Object.assign({},e5),{lookaheadStrategy:r?new sm({maxLookahead:n.maxLookahead}):new A4}),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 BS(t,e,n){return n5({parser:e,tokens:n,ruleNames:new Map},t),e}function n5(t,e){const n=ug(e,!1),r=De(e.rules).filter(Mt).filter(i=>n.has(i));for(const i of r){const s=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});t.parser.rule(i,_s(s,i.definition))}}function _s(t,e,n=!1){let r;if(hr(e))r=l5(t,e);else if(ys(e))r=r5(t,e);else if(fr(e))r=_s(t,e.terminal);else if(Ba(e))r=qS(t,e);else if(Fr(e))r=i5(t,e);else if(tg(e))r=o5(t,e);else if(ng(e))r=a5(t,e);else if(Ri(e))r=c5(t,e);else if(JD(e)){const i=t.consume++;r=()=>t.parser.consume(i,_i,e)}else throw new B0(e.$cstNode,`Unexpected element type: ${e.$type}`);return WS(t,n?void 0:Ld(e),r,e.cardinality)}function r5(t,e){const n=nc(e);return()=>t.parser.action(n,e)}function i5(t,e){const n=e.rule.ref;if(Mt(n)){const r=t.subrule++,i=e.arguments.length>0?s5(n,e.arguments):()=>({});return s=>t.parser.subrule(r,GS(t,n),e,i(s))}else if(Mr(n)){const r=t.consume++,i=Pm(t,n.name);return()=>t.parser.consume(r,i,e)}else if(n)$u();else throw new B0(e.$cstNode,`Undefined rule type: ${e.$type}`)}function s5(t,e){const n=e.map(r=>Kr(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 Kr(t){if(GD(t)){const e=Kr(t.left),n=Kr(t.right);return r=>e(r)||n(r)}else if(WD(t)){const e=Kr(t.left),n=Kr(t.right);return r=>e(r)&&n(r)}else if(zD(t)){const e=Kr(t.value);return n=>!e(n)}else if(HD(t)){const e=t.parameter.ref.name;return n=>n!==void 0&&n[e]===!0}else if(qD(t)){const e=!!t.true;return()=>e}$u()}function o5(t,e){if(e.elements.length===1)return _s(t,e.elements[0]);{const n=[];for(const i of e.elements){const s={ALT:_s(t,i,!0)},o=Ld(i);o&&(s.GATE=Kr(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 a5(t,e){if(e.elements.length===1)return _s(t,e.elements[0]);const n=[];for(const a of e.elements){const c={ALT:_s(t,a,!0)},l=Ld(a);l&&(c.GATE=Kr(l)),n.push(c)}const r=t.or++,i=(a,c)=>{const l=c.getRuleStack().join("-");return`uGroup_${a}_${l}`},s=a=>t.parser.alternatives(r,n.map((c,l)=>{const u={ALT:()=>!0},d=t.parser;u.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?.[l]>"u"&&(p[l]=!0)}};const f=c.GATE;return f?u.GATE=()=>f(a):u.GATE=()=>{const h=d.unorderedGroups.get(i(r,d));return!h?.[l]},u})),o=WS(t,Ld(e),s,"*");return a=>{o(a),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(r,t.parser))}}function c5(t,e){const n=e.elements.map(r=>_s(t,r));return r=>n.forEach(i=>i(r))}function Ld(t){if(Ri(t))return t.guardCondition}function qS(t,e,n=e.terminal){if(n)if(Fr(n)&&Mt(n.rule.ref)){const r=t.subrule++;return i=>t.parser.subrule(r,GS(t,n.rule.ref),e,i)}else if(Fr(n)&&Mr(n.rule.ref)){const r=t.consume++,i=Pm(t,n.rule.ref.name);return()=>t.parser.consume(r,i,e)}else if(hr(n)){const r=t.consume++,i=Pm(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=pg(e.type.ref),i=r?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+nc(e.type.ref));return qS(t,e,i)}}function l5(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 WS(t,e,n,r){const i=e&&Kr(e);if(!r)if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:()=>n(o),GATE:()=>i(o)},{ALT:SR(),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:SR(),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 $u()}function GS(t,e){const n=u5(t,e),r=t.parser.getRule(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function u5(t,e){if(Mt(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let n=e,r=n.$container,i=e.$type;for(;!Mt(r);)(Ri(r)||tg(r)||ng(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 Pm(t,e){const n=t.tokens[e];if(!n)throw new Error(`Token "${e}" not found."`);return n}function d5(t){const e=t.Grammar,n=t.parser.Lexer,r=new Z4(t);return BS(e,r,n.definition),r.finalize(),r}function f5(t){const e=h5(t);return e.finalize(),e}function h5(t){const e=t.Grammar,n=t.parser.Lexer,r=new J4(t);return BS(e,r,n.definition)}class p5{buildTokens(e,n){const r=De(ug(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&&lg(a)?s.unshift(o):s.push(o)}),s}buildTerminalTokens(e){return e.filter(Mr).filter(n=>!n.fragment).map(n=>this.buildTerminalToken(n)).toArray()}buildTerminalToken(e){const n=rc(e),r=this.requiresCustomPattern(n)?this.regexPatternFunction(n):n,i={name:e.name,PATTERN:r,LINE_BREAKS:!0};return e.hidden&&(i.GROUP=lg(n)?ln.SKIPPED:"hidden"),i}requiresCustomPattern(e){return e.flags.includes("u")?!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(Mt).flatMap(i=>jr(i).filter(hr)).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(fL(e.value)):e.value}findLongerAlt(e,n){return n.reduce((r,i)=>{const s=i?.PATTERN;return s?.source&&hL("^"+s.source+"$",e.value)&&r.push(i),r},[])}}class g5{convert(e,n){let r=n.grammarSource;if(Ba(r)&&(r=dg(r)),Fr(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 Yr.convertInt(n);case"STRING":return Yr.convertString(n);case"ID":return Yr.convertID(n)}switch((i=dT(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return Yr.convertNumber(n);case"boolean":return Yr.convertBoolean(n);case"bigint":return Yr.convertBigint(n);case"date":return Yr.convertDate(n);default:return n}}}var Yr;(function(t){function e(l){let u="";for(let d=1;d<l.length-1;d++){const f=l.charAt(d);if(f==="\\"){const h=l.charAt(++d);u+=n(h)}else u+=f}return u}t.convertString=e;function n(l){switch(l){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 l}}function r(l){return l.charAt(0)==="^"?l.substring(1):l}t.convertID=r;function i(l){return parseInt(l)}t.convertInt=i;function s(l){return BigInt(l)}t.convertBigint=s;function o(l){return new Date(l)}t.convertDate=o;function a(l){return Number(l)}t.convertNumber=a;function c(l){return l.toLowerCase()==="true"}t.convertBoolean=c})(Yr||(Yr={}));var Pi={},Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});let xm;function Nm(){if(xm===void 0)throw new Error("No runtime abstraction layer installed");return xm}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");xm=n}t.install=e})(Nm||(Nm={})),Xr.default=Nm;var mt={};Object.defineProperty(mt,"__esModule",{value:!0}),mt.stringArray=mt.array=mt.func=mt.error=mt.number=mt.string=mt.boolean=void 0;function m5(t){return t===!0||t===!1}mt.boolean=m5;function zS(t){return typeof t=="string"||t instanceof String}mt.string=zS;function y5(t){return typeof t=="number"||t instanceof Number}mt.number=y5;function v5(t){return t instanceof Error}mt.error=v5;function w5(t){return typeof t=="function"}mt.func=w5;function HS(t){return Array.isArray(t)}mt.array=HS;function b5(t){return HS(t)&&t.every(e=>zS(e))}mt.stringArray=b5;var Tr={};Object.defineProperty(Tr,"__esModule",{value:!0});var VS=Tr.Emitter=Tr.Event=void 0;const T5=Xr;var KS;(function(t){const e={dispose(){}};t.None=function(){return e}})(KS||(Tr.Event=KS={}));class E5{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];const n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,o=r.length;s<o;s++)try{n.push(r[s].apply(i[s],e))}catch(a){(0,T5.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}let YS=class Ax{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new E5),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);const i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),i.dispose=Ax._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};VS=Tr.Emitter=YS,YS._noop=function(){};var Ye;Object.defineProperty(Pi,"__esModule",{value:!0});var Om=Pi.CancellationTokenSource=Ye=Pi.CancellationToken=void 0;const R5=Xr,S5=mt,Dm=Tr;var Md;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Dm.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Dm.Event.None});function e(n){const r=n;return r&&(r===t.None||r===t.Cancelled||S5.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(Md||(Ye=Pi.CancellationToken=Md={}));const $5=Object.freeze(function(t,e){const n=(0,R5.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}});class XS{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?$5:(this._emitter||(this._emitter=new Dm.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class k5{get token(){return this._token||(this._token=new XS),this._token}cancel(){this._token?this._token.cancel():this._token=Md.Cancelled}dispose(){this._token?this._token instanceof XS&&this._token.dispose():this._token=Md.None}}Om=Pi.CancellationTokenSource=k5;function _5(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let JS=0,C5=10;const Fd=Symbol("OperationCancelled");function jd(t){return t===Fd}async function kt(t){if(t===Ye.None)return;const e=Date.now();if(e-JS>=C5&&(JS=e,await _5()),t.isCancellationRequested)throw Fd}class Lm{constructor(){this.promise=new Promise((e,n)=>{this.resolve=r=>(e(r),this),this.reject=r=>(n(r),this)})}}class Xl{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(Xl.isIncremental(r)){const i=ZS(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 l=this._lineOffsets;const u=QS(r.text,!1,s);if(c-a===u.length)for(let f=0,h=u.length;f<h;f++)l[f+a+1]=u[f];else u.length<1e4?l.splice(a+1,c-a,...u):this._lineOffsets=l=l.slice(0,a+1).concat(u,l.slice(c+1));const d=r.text.length-(o-s);if(d!==0)for(let f=a+1+u.length,h=l.length;f<h;f++)l[f]=l[f]+d}else if(Xl.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=QS(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 Ud;(function(t){function e(i,s,o,a){return new Xl(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof Xl)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=Mm(s.map(A5),(u,d)=>{let f=u.range.start.line-d.range.start.line;return f===0?u.range.start.character-d.range.start.character:f}),c=0;const l=[];for(const u of a){let d=i.offsetAt(u.range.start);if(d<c)throw new Error("Overlapping edit");d>c&&l.push(o.substring(c,d)),u.newText.length&&l.push(u.newText),c=i.offsetAt(u.range.end)}return l.push(o.substr(c)),l.join("")}t.applyEdits=r})(Ud||(Ud={}));function Mm(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);Mm(r,e),Mm(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 QS(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 ZS(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 A5(t){const e=ZS(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var e$;(()=>{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,l){for(var u,d="",f=0,h=-1,p=0,y=0;y<=c.length;++y){if(y<c.length)u=c.charCodeAt(y);else{if(u===47)break;u=47}if(u===47){if(!(h===y-1||p===1))if(h!==y-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 $=d.lastIndexOf("/");if($!==d.length-1){$===-1?(d="",f=0):f=(d=d.slice(0,$)).length-1-d.lastIndexOf("/"),h=y,p=0;continue}}else if(d.length===2||d.length===1){d="",f=0,h=y,p=0;continue}}l&&(d.length>0?d+="/..":d="..",f=2)}else d.length>0?d+="/"+c.slice(h+1,y):d=c.slice(h+1,y),f=y-h-1;h=y,p=0}else u===46&&p!==-1?++p:p=-1}return d}var a={resolve:function(){for(var c,l="",u=!1,d=arguments.length-1;d>=-1&&!u;d--){var f;d>=0?f=arguments[d]:(c===void 0&&(c=process.cwd()),f=c),s(f),f.length!==0&&(l=f+"/"+l,u=f.charCodeAt(0)===47)}return l=o(l,!u),u?l.length>0?"/"+l:"/":l.length>0?l:"."},normalize:function(c){if(s(c),c.length===0)return".";var l=c.charCodeAt(0)===47,u=c.charCodeAt(c.length-1)===47;return(c=o(c,!l)).length!==0||l||(c="."),c.length>0&&u&&(c+="/"),l?"/"+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,l=0;l<arguments.length;++l){var u=arguments[l];s(u),u.length>0&&(c===void 0?c=u:c+="/"+u)}return c===void 0?".":a.normalize(c)},relative:function(c,l){if(s(c),s(l),c===l||(c=a.resolve(c))===(l=a.resolve(l)))return"";for(var u=1;u<c.length&&c.charCodeAt(u)===47;++u);for(var d=c.length,f=d-u,h=1;h<l.length&&l.charCodeAt(h)===47;++h);for(var p=l.length-h,y=f<p?f:p,$=-1,T=0;T<=y;++T){if(T===y){if(p>y){if(l.charCodeAt(h+T)===47)return l.slice(h+T+1);if(T===0)return l.slice(h+T)}else f>y&&(c.charCodeAt(u+T)===47?$=T:T===0&&($=0));break}var w=c.charCodeAt(u+T);if(w!==l.charCodeAt(h+T))break;w===47&&($=T)}var b="";for(T=u+$+1;T<=d;++T)T!==d&&c.charCodeAt(T)!==47||(b.length===0?b+="..":b+="/..");return b.length>0?b+l.slice(h+$):(h+=$,l.charCodeAt(h)===47&&++h,l.slice(h))},_makeLong:function(c){return c},dirname:function(c){if(s(c),c.length===0)return".";for(var l=c.charCodeAt(0),u=l===47,d=-1,f=!0,h=c.length-1;h>=1;--h)if((l=c.charCodeAt(h))===47){if(!f){d=h;break}}else f=!1;return d===-1?u?"/":".":u&&d===1?"//":c.slice(0,d)},basename:function(c,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');s(c);var u,d=0,f=-1,h=!0;if(l!==void 0&&l.length>0&&l.length<=c.length){if(l.length===c.length&&l===c)return"";var p=l.length-1,y=-1;for(u=c.length-1;u>=0;--u){var $=c.charCodeAt(u);if($===47){if(!h){d=u+1;break}}else y===-1&&(h=!1,y=u+1),p>=0&&($===l.charCodeAt(p)?--p==-1&&(f=u):(p=-1,f=y))}return d===f?f=y:f===-1&&(f=c.length),c.slice(d,f)}for(u=c.length-1;u>=0;--u)if(c.charCodeAt(u)===47){if(!h){d=u+1;break}}else f===-1&&(h=!1,f=u+1);return f===-1?"":c.slice(d,f)},extname:function(c){s(c);for(var l=-1,u=0,d=-1,f=!0,h=0,p=c.length-1;p>=0;--p){var y=c.charCodeAt(p);if(y!==47)d===-1&&(f=!1,d=p+1),y===46?l===-1?l=p:h!==1&&(h=1):l!==-1&&(h=-1);else if(!f){u=p+1;break}}return l===-1||d===-1||h===0||h===1&&l===d-1&&l===u+1?"":c.slice(l,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(l,u){var d=u.dir||u.root,f=u.base||(u.name||"")+(u.ext||"");return d?d===u.root?d+f:d+"/"+f:f}(0,c)},parse:function(c){s(c);var l={root:"",dir:"",base:"",ext:"",name:""};if(c.length===0)return l;var u,d=c.charCodeAt(0),f=d===47;f?(l.root="/",u=1):u=0;for(var h=-1,p=0,y=-1,$=!0,T=c.length-1,w=0;T>=u;--T)if((d=c.charCodeAt(T))!==47)y===-1&&($=!1,y=T+1),d===46?h===-1?h=T:w!==1&&(w=1):h!==-1&&(w=-1);else if(!$){p=T+1;break}return h===-1||y===-1||w===0||w===1&&h===y-1&&h===p+1?y!==-1&&(l.base=l.name=p===0&&f?c.slice(1,y):c.slice(p,y)):(p===0&&f?(l.name=c.slice(1,h),l.base=c.slice(1,y)):(l.name=c.slice(p,h),l.base=c.slice(p,y)),l.ext=c.slice(h,y)),p>0?l.dir=c.slice(0,p-1):f&&(l.dir="/"),l},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:()=>W}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,o=/^\//,a=/^\/\//;function c(I,k){if(!I.scheme&&k)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${I.authority}", path: "${I.path}", query: "${I.query}", fragment: "${I.fragment}"}`);if(I.scheme&&!s.test(I.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(I.path){if(I.authority){if(!o.test(I.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(a.test(I.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const l="",u="/",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,R,M,q,j,z=!1){typeof k=="object"?(this.scheme=k.scheme||l,this.authority=k.authority||l,this.path=k.path||l,this.query=k.query||l,this.fragment=k.fragment||l):(this.scheme=function(J,U){return J||U?J:"file"}(k,z),this.authority=R||l,this.path=function(J,U){switch(J){case"https":case"http":case"file":U?U[0]!==u&&(U=u+U):U=u}return U}(this.scheme,M||l),this.query=q||l,this.fragment=j||l,c(this,z))}get fsPath(){return w(this)}with(k){if(!k)return this;let{scheme:R,authority:M,path:q,query:j,fragment:z}=k;return R===void 0?R=this.scheme:R===null&&(R=l),M===void 0?M=this.authority:M===null&&(M=l),q===void 0?q=this.path:q===null&&(q=l),j===void 0?j=this.query:j===null&&(j=l),z===void 0?z=this.fragment:z===null&&(z=l),R===this.scheme&&M===this.authority&&q===this.path&&j===this.query&&z===this.fragment?this:new p(R,M,q,j,z)}static parse(k,R=!1){const M=d.exec(k);return M?new p(M[2]||l,F(M[4]||l),F(M[5]||l),F(M[7]||l),F(M[9]||l),R):new p(l,l,l,l,l)}static file(k){let R=l;if(i&&(k=k.replace(/\\/g,u)),k[0]===u&&k[1]===u){const M=k.indexOf(u,2);M===-1?(R=k.substring(2),k=u):(R=k.substring(2,M),k=k.substring(M)||u)}return new p("file",R,k,l,l)}static from(k){const R=new p(k.scheme,k.authority,k.path,k.query,k.fragment);return c(R,!0),R}toString(k=!1){return b(this,k)}toJSON(){return this}static revive(k){if(k){if(k instanceof f)return k;{const R=new p(k);return R._formatted=k.external,R._fsPath=k._sep===h?k.fsPath:null,R}}return k}}const h=i?1:void 0;class p extends f{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=w(this)),this._fsPath}toString(k=!1){return k?b(this,!0):(this._formatted||(this._formatted=b(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 y={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function $(I,k,R){let M,q=-1;for(let j=0;j<I.length;j++){const z=I.charCodeAt(j);if(z>=97&&z<=122||z>=65&&z<=90||z>=48&&z<=57||z===45||z===46||z===95||z===126||k&&z===47||R&&z===91||R&&z===93||R&&z===58)q!==-1&&(M+=encodeURIComponent(I.substring(q,j)),q=-1),M!==void 0&&(M+=I.charAt(j));else{M===void 0&&(M=I.substr(0,j));const J=y[z];J!==void 0?(q!==-1&&(M+=encodeURIComponent(I.substring(q,j)),q=-1),M+=J):q===-1&&(q=j)}}return q!==-1&&(M+=encodeURIComponent(I.substring(q))),M!==void 0?M:I}function T(I){let k;for(let R=0;R<I.length;R++){const M=I.charCodeAt(R);M===35||M===63?(k===void 0&&(k=I.substr(0,R)),k+=y[M]):k!==void 0&&(k+=I[R])}return k!==void 0?k:I}function w(I,k){let R;return R=I.authority&&I.path.length>1&&I.scheme==="file"?`//${I.authority}${I.path}`:I.path.charCodeAt(0)===47&&(I.path.charCodeAt(1)>=65&&I.path.charCodeAt(1)<=90||I.path.charCodeAt(1)>=97&&I.path.charCodeAt(1)<=122)&&I.path.charCodeAt(2)===58?I.path[1].toLowerCase()+I.path.substr(2):I.path,i&&(R=R.replace(/\//g,"\\")),R}function b(I,k){const R=k?T:$;let M="",{scheme:q,authority:j,path:z,query:J,fragment:U}=I;if(q&&(M+=q,M+=":"),(j||q==="file")&&(M+=u,M+=u),j){let ce=j.indexOf("@");if(ce!==-1){const Qe=j.substr(0,ce);j=j.substr(ce+1),ce=Qe.lastIndexOf(":"),ce===-1?M+=R(Qe,!1,!1):(M+=R(Qe.substr(0,ce),!1,!1),M+=":",M+=R(Qe.substr(ce+1),!1,!0)),M+="@"}j=j.toLowerCase(),ce=j.lastIndexOf(":"),ce===-1?M+=R(j,!1,!0):(M+=R(j.substr(0,ce),!1,!0),M+=j.substr(ce))}if(z){if(z.length>=3&&z.charCodeAt(0)===47&&z.charCodeAt(2)===58){const ce=z.charCodeAt(1);ce>=65&&ce<=90&&(z=`/${String.fromCharCode(ce+32)}:${z.substr(3)}`)}else if(z.length>=2&&z.charCodeAt(1)===58){const ce=z.charCodeAt(0);ce>=65&&ce<=90&&(z=`${String.fromCharCode(ce+32)}:${z.substr(2)}`)}M+=R(z,!0,!1)}return J&&(M+="?",M+=R(J,!1,!1)),U&&(M+="#",M+=k?U:$(U,!1,!1)),M}function _(I){try{return decodeURIComponent(I)}catch{return I.length>3?I.substr(0,3)+_(I.substr(3)):I}}const x=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function F(I){return I.match(x)?I.replace(x,k=>_(k)):I}var P=n(470);const G=P.posix||P,B="/";var W;(function(I){I.joinPath=function(k,...R){return k.with({path:G.join(k.path,...R)})},I.resolvePath=function(k,...R){let M=k.path,q=!1;M[0]!==B&&(M=B+M,q=!0);let j=G.resolve(M,...R);return q&&j[0]===B&&!k.authority&&(j=j.substring(1)),k.with({path:j})},I.dirname=function(k){if(k.path.length===0||k.path===B)return k;let R=G.dirname(k.path);return R.length===1&&R.charCodeAt(0)===46&&(R=""),k.with({path:R})},I.basename=function(k){return G.basename(k.path)},I.extname=function(k){return G.extname(k.path)}})(W||(W={}))})(),e$=r})();const{URI:Yt,Utils:$c}=e$;var Nn;(function(t){t.basename=$c.basename,t.dirname=$c.dirname,t.extname=$c.extname,t.joinPath=$c.joinPath,t.resolvePath=$c.resolvePath;function e(r,i){return r?.toString()===i?.toString()}t.equals=e;function n(r,i){const s=typeof r=="string"?r:r.path,o=typeof i=="string"?i:i.path,a=s.split("/").filter(f=>f.length>0),c=o.split("/").filter(f=>f.length>0);let l=0;for(;l<a.length&&a[l]===c[l];l++);const u="../".repeat(a.length-l),d=c.slice(l).join("/");return u+d}t.relative=n})(Nn||(Nn={}));var xe;(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"})(xe||(xe={}));class I5{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,n=Ye.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),Ye.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromString(e,n,r){return Ye.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:xe.Parsed,references:[],textDocument:r};else{const o=this.createTextDocumentGetter(n,i);s={parseResult:e,uri:n,state:xe.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=xe.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=Ud.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,n??""))}}class P5{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return De(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=xe.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=xe.Changed,this.documentMap.delete(n)),r}}class x5{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=Ye.None){for(const r of Ur(e.parseResult.value))await kt(n),Ou(r).forEach(i=>this.doLink(i,e))}doLink(e,n){const r=e.reference;if(r._ref===void 0){try{const i=this.getCandidate(e);if(wu(i))r._ref=i;else if(r._nodeDescription=i,this.langiumDocuments().hasDocument(i.documentUri)){const s=this.loadAstNode(i);r._ref=s??this.createLinkingError(e,i)}}catch(i){r._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${r.$refText}': ${i}`})}n.references.push(r)}}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(it(this._ref))return this._ref;if(OD(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){const c=s.getLinkedNode({reference:o,container:e,property:n});if(c.error&&St(e).state<xe.ComputedScopes)return;this._ref=(a=c.node)!==null&&a!==void 0?a:c.error,this._nodeDescription=c.descr,St(e).references.push(this)}return it(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return wu(this._ref)?this._ref:void 0}};return o}getLinkedNode(e){try{const n=this.getCandidate(e);if(wu(n))return{error:n};const r=this.loadAstNode(n);return r?{node:r,descr:n}:{descr:n,error:this.createLinkingError(e,n)}}catch(n){return{error:Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`})}}}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=St(e.container);r.state<xe.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 t$(t){return typeof t.name=="string"}class N5{getName(e){if(t$(e))return e.name}getNameNode(e){return pr(e.$cstNode,"name")}}class O5{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){const n=sT(e),r=e.astNode;if(n&&r){const i=r[n.feature];if(_n(i))return i.ref;if(Array.isArray(i)){for(const s of i)if(_n(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||L0(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=>Nn.equals(s.sourceUri,n.documentUri))),r.push(...i),De(r)}getReferenceToSelf(e){const n=this.nameProvider.getNameNode(e);if(n){const r=St(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:r.uri,sourcePath:i,targetUri:r.uri,targetPath:i,segment:Ta(n),local:!0}}}}class Er{constructor(e){if(this.map=new Map,e)for(const[n,r]of e)this.add(n,r)}get size(){return Wp.sum(De(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 De(this.map.entries()).flatMap(([e,n])=>n.map(r=>[e,r]))}keys(){return De(this.map.keys())}values(){return De(this.map.values()).flat()}entriesGroupedByKey(){return De(this.map.entries())}}class n${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 r${constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,n=Ye.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,n)}async computeExportsForNode(e,n,r=ec,i=Ye.None){const s=[];this.exportNode(e,s,n);for(const o of r(e))await kt(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=Ye.None){const r=e.parseResult.value,i=new Er;for(const s of jr(r))await kt(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 kc{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 i${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=De(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}const s$={getElement(){},getAllElements(){return Tu}};class o${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 D5 extends o${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 L5 extends o${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 a$ extends D5{constructor(e){super(),this.onDispose(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}class c${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 a$(e.shared)}getScope(e){const n=[],r=this.reflection.getReferenceType(e),i=St(e.container).precomputedScopes;if(i){let o=e.container;do{const a=i.get(o);a.length>0&&n.push(De(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 kc(De(e),n,r)}createScopeForNodes(e,n,r){const i=De(e).map(s=>{const o=this.nameProvider.getName(s);if(o)return this.descriptions.createDescription(s,o)}).nonNullable();return new kc(i,n,r)}getGlobalScope(e,n){return this.globalScopeCache.get(e,()=>new i$(this.indexManager.allElements(e)))}}function M5(t){return typeof t.$comment=="string"}function l$(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class F5{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?.replacer,i=(o,a)=>this.replacer(o,a,n),s=r?(o,a)=>r(o,a,i):i;try{return this.currentDocument=St(e),JSON.stringify(e,s,n?.space)}finally{this.currentDocument=void 0}}deserialize(e,n={}){const r=JSON.parse(e);return this.linkNode(r,r,n),r}replacer(e,n,{refText:r,sourceText:i,textRegions:s,comments:o,uriConverter:a}){var c,l,u,d;if(!this.ignoreProperties.has(e))if(_n(n)){const f=n.ref,h=r?n.$refText:void 0;if(f){const p=St(f);let y="";this.currentDocument&&this.currentDocument!==p&&(a?y=a(p.uri,n):y=p.uri.toString());const $=this.astNodeLocator.getAstNodePath(f);return{$ref:`${y}#${$}`,$refText:h}}else return{$error:(l=(c=n.error)===null||c===void 0?void 0:c.message)!==null&&l!==void 0?l:"Could not resolve reference",$refText:h}}else if(it(n)){let f;if(s&&(f=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},n)),(!e||n.$document)&&f?.$textRegion&&(f.$textRegion.documentURI=(u=this.currentDocument)===null||u===void 0?void 0:u.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=qu(e.$cstNode,s).map(n);o.length!==0&&(i[s]=o)}),e}}linkNode(e,n,r,i,s,o){for(const[c,l]of Object.entries(e))if(Array.isArray(l))for(let u=0;u<l.length;u++){const d=l[u];l$(d)?l[u]=this.reviveReference(e,c,n,d,r):it(d)&&this.linkNode(d,n,r,e,c,u)}else l$(l)?e[c]=this.reviveReference(e,c,n,l,r):it(l)&&this.linkNode(l,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(it(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),l=this.langiumDocuments.getDocument(c);return l?l.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 j5{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.toString()))===null||r===void 0?void 0:r.languageId;if(i!==void 0){const a=this.languageIdMap.get(i);if(a)return a}const s=Nn.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 u$(t){return{code:t}}var Bd;(function(t){t.all=["fast","slow","built-in"]})(Bd||(Bd={}));class U5{constructor(e){this.entries=new Er,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(jd(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=De(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 B5{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,n={},r=Ye.None){const i=e.parseResult,s=[];if(await kt(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)===xi.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)===xi.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)===xi.LinkingError}))))return s;try{s.push(...await this.validateAst(i.value,n,r))}catch(o){if(jd(o))throw o;console.error("An error occurred during validation:",o)}return await kt(r),s}processLexingErrors(e,n,r){for(const i of e.lexerErrors){const s={severity:Fm("error"),range:{start:{line:i.line-1,character:i.column-1},end:{line:i.line-1,character:i.column+i.length-1}},message:i.message,data:u$(xi.LexingError),source:this.getSource()};n.push(s)}}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=Eu(i.token);if(s){const o={severity:Fm("error"),range:s,message:i.message,data:u$(xi.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:xi.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=Ye.None){const i=[],s=(o,a,c)=>{i.push(this.toDiagnostic(o,a,c))};return await Promise.all(Ur(e).map(async o=>{await kt(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:q5(r),severity:Fm(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 q5(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=pr(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=Wu(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 Fm(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)}}var xi;(function(t){t.LexingError="lexing-error",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(xi||(xi={}));class W5{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,n,r=St(e)){n??(n=this.nameProvider.getName(e));const i=this.astNodeLocator.getAstNodePath(e);if(!n)throw new Error(`Node at path ${i} has no name.`);let s;const o=()=>{var a;return s??(s=Ta((a=this.nameProvider.getNameNode(e))!==null&&a!==void 0?a:e.$cstNode))};return{node:e,name:n,get nameSegment(){return o()},selectionSegment:Ta(e.$cstNode),type:e.$type,documentUri:r.uri,path:i}}}class G5{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,n=Ye.None){const r=[],i=e.parseResult.value;for(const s of Ur(i))await kt(n),Ou(s).filter(o=>!wu(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=St(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:n.documentUri,targetPath:n.path,segment:Ta(r),local:Nn.equals(n.documentUri,i)}}}class z5{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)),l=i[a];return l?.[c]}return i[s]},e)}}class H5{constructor(e){this._ready=new Lm,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new VS,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 Cs;(function(t){function e(n){return{dispose:async()=>await n()}}t.create=e})(Cs||(Cs={}));class V5{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Er,this.documentPhaseListeners=new Er,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=xe.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=Ye.None){var i,s;for(const o of e){const a=o.uri.toString();if(o.state===xe.Validated){if(typeof n.validation=="boolean"&&n.validation)o.state=xe.IndexedReferences,o.diagnostics=void 0,this.buildState.delete(a);else if(typeof n.validation=="object"){const c=this.buildState.get(a),l=(i=c?.result)===null||i===void 0?void 0:i.validationChecks;if(l){const d=((s=n.validation.categories)!==null&&s!==void 0?s:Bd.all).filter(f=>!l.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=xe.IndexedReferences)}}}else this.buildState.delete(a)}this.currentState=xe.Changed,await this.emitUpdate(e.map(o=>o.uri),[]),await this.buildDocuments(e,n,r)}async update(e,n,r=Ye.None){this.currentState=xe.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=xe.Changed,this.langiumDocuments.addDocument(c)}this.buildState.delete(o.toString())}const i=De(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,xe.ComputedScopes),o.diagnostics=void 0}),await this.emitUpdate(e,n),await kt(r);const s=this.sortDocuments(this.langiumDocuments.all.filter(o=>{var a;return o.state<xe.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){var n;const r=new Map;for(const i of e)r.set(i,!!(!((n=this.textDocuments)===null||n===void 0)&&n.get(i.uri.toString())));return e.sort((i,s)=>{const o=r.get(i),a=r.get(s);return o&&!a?-1:!o&&a?1:0})}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),Cs.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,xe.Parsed,r,s=>this.langiumDocumentFactory.update(s,r)),await this.runCancelable(e,xe.IndexedContent,r,s=>this.indexManager.updateContent(s,r)),await this.runCancelable(e,xe.ComputedScopes,r,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.precomputedScopes=await o.computeLocalScopes(s,r)}),await this.runCancelable(e,xe.Linked,r,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,r)),await this.runCancelable(e,xe.IndexedReferences,r,s=>this.indexManager.updateReferences(s,r));const i=e.filter(s=>this.shouldValidate(s));await this.runCancelable(i,xe.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 kt(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),Cs.create(()=>{this.buildPhaseListeners.delete(e,n)})}onDocumentPhase(e,n){return this.documentPhaseListeners.add(e,n),Cs.create(()=>{this.documentPhaseListeners.delete(e,n)})}waitUntil(e,n,r){let i;if(n&&"path"in n?i=n:r=n,r??(r=Ye.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(Fd):new Promise((s,o)=>{const a=this.onBuildPhase(e,()=>{if(a.dispose(),c.dispose(),i){const l=this.langiumDocuments.getDocument(i);s(l?.uri)}else s(void 0)}),c=r.onCancellationRequested(()=>{a.dispose(),c.dispose(),o(Fd)})})}async notifyDocumentPhase(e,n,r){const i=this.documentPhaseListeners.get(n);for(const s of i)try{await s(e,r)}catch(o){if(!jd(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 kt(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 l=this.buildState.get(e.uri.toString());if(l){(r=l.result)!==null&&r!==void 0||(l.result={});const u=(i=a?.categories)!==null&&i!==void 0?i:Bd.all;l.result.validationChecks?l.result.validationChecks.push(...u):l.result.validationChecks=[...u]}}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 K5{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new L5,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,n){const r=St(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(o=>{Nn.equals(o.targetUri,r)&&o.targetPath===n&&i.push(o)})}),De(i)}allElements(e,n){let r=De(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=Ye.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=Ye.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 d${constructor(e){this.initialBuildOptions={},this._ready=new Lm,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=Ye.None){const r=await this.performStartup(e);await kt(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=Nn.basename(n.uri);if(i.startsWith("."))return!1;if(n.isDirectory)return i!=="node_modules"&&i!=="out";if(n.isFile){const s=Nn.extname(n.uri);return r.includes(s)}return!1}}class Y5{constructor(e){const n=e.parser.TokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(n);const r=h$(n)?Object.values(n):n;this.chevrotainLexer=new ln(r,{positionTracking:"full"})}get definition(){return this.tokenTypes}tokenize(e){var n;const r=this.chevrotainLexer.tokenize(e);return{tokens:r.tokens,errors:r.errors,hidden:(n=r.groups.hidden)!==null&&n!==void 0?n:[]}}toTokenTypeDictionary(e){if(h$(e))return e;const n=f$(e)?Object.values(e.modes).flat():e,r={};return n.forEach(i=>r[i.name]=i),r}}function X5(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function f$(t){return t&&"modes"in t&&"defaultMode"in t}function h$(t){return!X5(t)&&!f$(t)}function J5(t,e,n){let r,i;typeof t=="string"?(i=e,r=n):(i=t.range.start,r=e),i||(i=Pe.create(0,0));const s=p$(t),o=Um(r),a=eq({lines:s,position:i,options:o});return sq({index:0,tokens:a,position:i})}function Q5(t,e){const n=Um(e),r=p$(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 p$(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(eT)}const g$=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,Z5=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function eq(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,l=a===t.lines.length-1;let u=t.lines[a],d=0;if(c&&t.options.start){const h=(e=t.options.start)===null||e===void 0?void 0:e.exec(u);h&&(d=h.index+h[0].length)}else{const h=(n=t.options.line)===null||n===void 0?void 0:n.exec(u);h&&(d=h.index+h[0].length)}if(l){const h=(r=t.options.end)===null||r===void 0?void 0:r.exec(u);h&&(u=u.substring(0,h.index))}if(u=u.substring(0,iq(u)),jm(u,d)>=u.length){if(i.length>0){const h=Pe.create(s,o);i.push({type:"break",content:"",range:Ee.create(h,h)})}}else{g$.lastIndex=d;const h=g$.exec(u);if(h){const p=h[0],y=h[1],$=Pe.create(s,o+d),T=Pe.create(s,o+d+p.length);i.push({type:"tag",content:y,range:Ee.create($,T)}),d+=p.length,d=jm(u,d)}if(d<u.length){const p=u.substring(d),y=Array.from(p.matchAll(Z5));i.push(...tq(y,p,s,o+d))}}s++,o=0}return i.length>0&&i[i.length-1].type==="break"?i.slice(0,-1):i}function tq(t,e,n,r){const i=[];if(t.length===0){const s=Pe.create(n,r),o=Pe.create(n,r+e.length);i.push({type:"text",content:e,range:Ee.create(s,o)})}else{let s=0;for(const a of t){const c=a.index,l=e.substring(s,c);l.length>0&&i.push({type:"text",content:e.substring(s,c),range:Ee.create(Pe.create(n,s+r),Pe.create(n,c+r))});let u=l.length+1;const d=a[1];if(i.push({type:"inline-tag",content:d,range:Ee.create(Pe.create(n,s+u+r),Pe.create(n,s+u+d.length+r))}),u+=d.length,a.length===4){u+=a[2].length;const f=a[3];i.push({type:"text",content:f,range:Ee.create(Pe.create(n,s+u+r),Pe.create(n,s+u+f.length+r))})}else i.push({type:"text",content:"",range:Ee.create(Pe.create(n,s+u+r),Pe.create(n,s+u+r))});s=c+a[0].length}const o=e.substring(s);o.length>0&&i.push({type:"text",content:o,range:Ee.create(Pe.create(n,s+r),Pe.create(n,s+r+o.length))})}return i}const nq=/\S/,rq=/\s*$/;function jm(t,e){const n=t.substring(e).match(nq);return n?e+n.index:t.length}function iq(t){const e=t.match(rq);if(e&&typeof e.index=="number")return e.index}function sq(t){var e,n,r,i;const s=Pe.create(t.position.line,t.position.character);if(t.tokens.length===0)return new w$([],Ee.create(s,s));const o=[];for(;t.index<t.tokens.length;){const l=oq(t,o[o.length-1]);l&&o.push(l)}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 w$(o,Ee.create(a,c))}function oq(t,e){const n=t.tokens[t.index];if(n.type==="tag")return y$(t,!1);if(n.type==="text"||n.type==="inline-tag")return m$(t);aq(n,e),t.index++}function aq(t,e){if(e){const n=new b$("",t.range);"inlines"in e?e.inlines.push(n):e.content.inlines.push(n)}}function m$(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(cq(t)),r=e,e=t.tokens[t.index];return new Wm(i,Ee.create(n.range.start,r.range.end))}function cq(t){return t.tokens[t.index].type==="inline-tag"?y$(t,!0):v$(t)}function y$(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=v$(t);return new qm(r,new Wm([s],s.range),e,Ee.create(n.range.start,s.range.end))}else{const s=m$(t);return new qm(r,s,e,Ee.create(n.range.start,s.range.end))}else{const s=n.range;return new qm(r,new Wm([],s),e,s)}}function v$(t){const e=t.tokens[t.index++];return new b$(e.content,e.range)}function Um(t){if(!t)return Um({start:"/**",end:"*/",line:"*"});const{start:e,end:n,line:r}=t;return{start:Bm(e,!0),end:Bm(n,!1),line:Bm(r,!0)}}function Bm(t,e){if(typeof t=="string"||typeof t=="object"){const n=typeof t=="string"?Uu(t):t.source;return e?new RegExp(`^\\s*${n}`):new RegExp(`\\s*${n}\\s*$`)}else return t}class w${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+=T$(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+=T$(n)+i}return n.trim()}}class qm{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=lq(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 lq(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=jm(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:uq(e,o)}}function uq(t,e){try{return Yt.parse(t,!0),`[${e}](${t})`}catch{return t}}class Wm{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 b${constructor(e,n){this.text=e,this.range=n}toString(){return this.text}toMarkdown(){return this.text}}function T$(t){return t.endsWith(`
|
|
122
|
-
`)?`
|
|
123
|
-
`:`
|
|
124
|
-
|
|
125
|
-
`}class dq{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const n=this.commentProvider.getComment(e);if(n&&Q5(n))return J5(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=St(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 fq{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var n;return M5(e)?e.$comment:(n=Ru(e.$cstNode,this.grammarConfig().multilineCommentRules))===null||n===void 0?void 0:n.text}}class hq{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e){return Promise.resolve(this.syncParser.parse(e))}}class pq{constructor(){this.previousTokenSource=new Om,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const n=new Om;return this.previousTokenSource=n,this.enqueue(this.writeQueue,e,n.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,n,r){const i=new Lm,s={action:n,deferred:i,cancellationToken:r??Ye.None};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){jd(s)?r.resolve(void 0):r.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class gq{constructor(e){this.grammarElementIdMap=new n$,this.tokenTypeIdMap=new n$,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors.map(n=>Object.assign(Object.assign({},n),{message:n.message})),parserErrors:e.parserErrors.map(n=>Object.assign(Object.assign({},n),{message:n.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}createDehyrationContext(e){const n=new Map,r=new Map;for(const i of Ur(e))n.set(i,{});if(e.$cstNode)for(const i of ba(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)it(a)?o.push(this.dehydrateAstNode(a,n)):_n(a)?o.push(this.dehydrateReference(a,n)):o.push(a)}else it(s)?r[i]=this.dehydrateAstNode(s,n):_n(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 O0(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=n.astNodes.get(e.astNode),Ti(e)?r.content=e.content.map(i=>this.dehydrateCstNode(i,n)):va(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,parserErrors:e.parserErrors,value:this.hydrateAstNode(n,r)}}createHydrationContext(e){const n=new Map,r=new Map;for(const s of Ur(e))n.set(s,{});let i;if(e.$cstNode)for(const s of ba(e.$cstNode)){let o;"fullText"in s?(o=new LS(s.fullText),i=o):"content"in s?o=new Cm:"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)it(a)?o.push(this.setParent(this.hydrateAstNode(a,n),r)):_n(a)?o.push(this.hydrateReference(a,r,i,n)):o.push(a)}else it(s)?r[i]=this.setParent(this.hydrateAstNode(s,n),r):_n(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),Ti(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,l=e.hidden;return new _m(r,i,{start:{line:s,character:o},end:{line:a,character:c}},n,l)}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 Ur(this.grammar))Xp(n)&&this.grammarElementIdMap.set(n,e++)}}function E$(t){return{documentation:{CommentProvider:e=>new fq(e),DocumentationProvider:e=>new dq(e)},parser:{AsyncParser:e=>new hq(e),GrammarConfig:e=>RL(e),LangiumParser:e=>f5(e),CompletionParser:e=>d5(e),ValueConverter:()=>new g5,TokenBuilder:()=>new p5,Lexer:e=>new Y5(e),ParserErrorMessageProvider:()=>new US},workspace:{AstNodeLocator:()=>new z5,AstNodeDescriptionProvider:e=>new W5(e),ReferenceDescriptionProvider:e=>new G5(e)},references:{Linker:e=>new x5(e),NameProvider:()=>new N5,ScopeProvider:e=>new c$(e),ScopeComputation:e=>new r$(e),References:e=>new O5(e)},serializer:{Hydrator:e=>new gq(e),JsonSerializer:e=>new F5(e)},validation:{DocumentValidator:e=>new B5(e),ValidationRegistry:e=>new U5(e)},shared:()=>t.shared}}function R$(t){return{ServiceRegistry:e=>new j5(e),workspace:{LangiumDocuments:e=>new P5(e),LangiumDocumentFactory:e=>new I5(e),DocumentBuilder:e=>new V5(e),IndexManager:e=>new K5(e),WorkspaceManager:e=>new d$(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new pq,ConfigurationProvider:e=>new H5(e)}}}var qd;(function(t){t.merge=(e,n)=>Gd(Gd({},e),n)})(qd||(qd={}));function Wd(t,e,n,r,i,s,o,a,c){const l=[t,e,n,r,i,s,o,a,c].reduce(Gd,{});return S$(l)}const Gm=Symbol("isProxy");function zm(t){if(t&&t[Gm])for(const e of Object.values(t))zm(e);return t}function S$(t,e){const n=new Proxy({},{deleteProperty:()=>!1,get:(r,i)=>k$(r,i,t,e||n),getOwnPropertyDescriptor:(r,i)=>(k$(r,i,t,e||n),Object.getOwnPropertyDescriptor(r,i)),has:(r,i)=>i in t,ownKeys:()=>[...Reflect.ownKeys(t),Gm]});return n[Gm]=!0,n}const $$=Symbol();function k$(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]===$$)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]=$$;try{t[e]=typeof i=="function"?i(r):S$(i,r)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}function Gd(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]=Gd(i,r):t[n]=r}}return t}class mq{readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}}const _$={fileSystemProvider:()=>new mq},yq={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},vq={AstReflection:()=>new V0};function wq(){const t=Wd(R$(_$),vq),e=Wd(E$({shared:t}),yq);return t.ServiceRegistry.register(e),e}function bq(t){var e;const n=wq(),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 Tq={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]},Eq=Object.entries(Tq);function Hm(t){return String(t)}Hm.open="",Hm.close="";function Rq(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 Sq(t=!1){let e=Rq(t),n=(o,a,c,l)=>{let u="",d=0;do u+=o.substring(d,l)+c,d=l+a.length,l=o.indexOf(a,d);while(~l);return u+o.substring(d)},r=(o,a,c=o)=>{let l=u=>{let d=String(u),f=d.indexOf(a,o.length);return~f?o+n(d,a,c,f)+a:o+d+a};return l.open=o,l.close=a,l},i={isColorSupported:e},s=o=>`\x1B[${o}m`;for(let[o,a]of Eq)i[o]=e?r(s(a[0]),s(a[1]),a[2]):Hm;return i}var Xe=Sq(Mx(1)),ie={},at={};Object.defineProperty(at,"__esModule",{value:!0}),at.thenable=at.typedArray=at.stringArray=at.array=at.func=at.error=at.number=at.string=at.boolean=void 0;function $q(t){return t===!0||t===!1}at.boolean=$q;function C$(t){return typeof t=="string"||t instanceof String}at.string=C$;function kq(t){return typeof t=="number"||t instanceof Number}at.number=kq;function _q(t){return t instanceof Error}at.error=_q;function A$(t){return typeof t=="function"}at.func=A$;function I$(t){return Array.isArray(t)}at.array=I$;function Cq(t){return I$(t)&&t.every(e=>C$(e))}at.stringArray=Cq;function Aq(t,e){return Array.isArray(t)&&t.every(e)}at.typedArray=Aq;function Iq(t){return t&&A$(t.then)}at.thenable=Iq;var ke={},He={},un={},Vm={},Km={},te={},P$;function x$(){if(P$)return te;P$=1,Object.defineProperty(te,"__esModule",{value:!0}),te.Message=te.NotificationType9=te.NotificationType8=te.NotificationType7=te.NotificationType6=te.NotificationType5=te.NotificationType4=te.NotificationType3=te.NotificationType2=te.NotificationType1=te.NotificationType0=te.NotificationType=te.RequestType9=te.RequestType8=te.RequestType7=te.RequestType6=te.RequestType5=te.RequestType4=te.RequestType3=te.RequestType2=te.RequestType1=te.RequestType=te.RequestType0=te.AbstractMessageSignature=te.ParameterStructures=te.ResponseError=te.ErrorCodes=void 0;const t=mt;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||(te.ErrorCodes=e={}));class n extends Error{constructor(R,M,q){super(M),this.code=t.number(R)?R:e.UnknownErrorCode,this.data=q,Object.setPrototypeOf(this,n.prototype)}toJson(){const R={code:this.code,message:this.message};return this.data!==void 0&&(R.data=this.data),R}}te.ResponseError=n;class r{constructor(R){this.kind=R}static is(R){return R===r.auto||R===r.byName||R===r.byPosition}toString(){return this.kind}}te.ParameterStructures=r,r.auto=new r("auto"),r.byPosition=new r("byPosition"),r.byName=new r("byName");class i{constructor(R,M){this.method=R,this.numberOfParams=M}get parameterStructures(){return r.auto}}te.AbstractMessageSignature=i;class s extends i{constructor(R){super(R,0)}}te.RequestType0=s;class o extends i{constructor(R,M=r.auto){super(R,1),this._parameterStructures=M}get parameterStructures(){return this._parameterStructures}}te.RequestType=o;class a extends i{constructor(R,M=r.auto){super(R,1),this._parameterStructures=M}get parameterStructures(){return this._parameterStructures}}te.RequestType1=a;class c extends i{constructor(R){super(R,2)}}te.RequestType2=c;class l extends i{constructor(R){super(R,3)}}te.RequestType3=l;class u extends i{constructor(R){super(R,4)}}te.RequestType4=u;class d extends i{constructor(R){super(R,5)}}te.RequestType5=d;class f extends i{constructor(R){super(R,6)}}te.RequestType6=f;class h extends i{constructor(R){super(R,7)}}te.RequestType7=h;class p extends i{constructor(R){super(R,8)}}te.RequestType8=p;class y extends i{constructor(R){super(R,9)}}te.RequestType9=y;class $ extends i{constructor(R,M=r.auto){super(R,1),this._parameterStructures=M}get parameterStructures(){return this._parameterStructures}}te.NotificationType=$;class T extends i{constructor(R){super(R,0)}}te.NotificationType0=T;class w extends i{constructor(R,M=r.auto){super(R,1),this._parameterStructures=M}get parameterStructures(){return this._parameterStructures}}te.NotificationType1=w;class b extends i{constructor(R){super(R,2)}}te.NotificationType2=b;class _ extends i{constructor(R){super(R,3)}}te.NotificationType3=_;class x extends i{constructor(R){super(R,4)}}te.NotificationType4=x;class F extends i{constructor(R){super(R,5)}}te.NotificationType5=F;class P extends i{constructor(R){super(R,6)}}te.NotificationType6=P;class G extends i{constructor(R){super(R,7)}}te.NotificationType7=G;class B extends i{constructor(R){super(R,8)}}te.NotificationType8=B;class W extends i{constructor(R){super(R,9)}}te.NotificationType9=W;var I;return function(k){function R(j){const z=j;return z&&t.string(z.method)&&(t.string(z.id)||t.number(z.id))}k.isRequest=R;function M(j){const z=j;return z&&t.string(z.method)&&j.id===void 0}k.isNotification=M;function q(j){const z=j;return z&&(z.result!==void 0||!!z.error)&&(t.string(z.id)||t.number(z.id)||z.id===null)}k.isResponse=q}(I||(te.Message=I={})),te}var Jr={},N$;function O$(){if(N$)return Jr;N$=1;var t;Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.LRUCache=Jr.LinkedMap=Jr.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||(Jr.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)}}Jr.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 Jr.LRUCache=r,Jr}var _c={},D$;function Pq(){if(D$)return _c;D$=1,Object.defineProperty(_c,"__esModule",{value:!0}),_c.Disposable=void 0;var t;return function(e){function n(r){return{dispose:r}}e.create=n}(t||(_c.Disposable=t={})),_c}var As={},L$;function xq(){if(L$)return As;L$=1,Object.defineProperty(As,"__esModule",{value:!0}),As.SharedArrayReceiverStrategy=As.SharedArraySenderStrategy=void 0;const t=Pi;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),l=new Int32Array(c,0,1);l[0]=e.Continue,this.buffers.set(a.id,c),a.$cancellationData=c}async sendCancellation(a,c){const l=this.buffers.get(c);if(l===void 0)return;const u=new Int32Array(l,0,1);Atomics.store(u,0,e.Cancelled)}cleanup(a){this.buffers.delete(a)}dispose(){this.buffers.clear()}}As.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 As.SharedArrayReceiverStrategy=s,As}var Qr={},Cc={},M$;function F$(){if(M$)return Cc;M$=1,Object.defineProperty(Cc,"__esModule",{value:!0}),Cc.Semaphore=void 0;const t=Xr;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 Cc.Semaphore=e,Cc}var j$;function Nq(){if(j$)return Qr;j$=1,Object.defineProperty(Qr,"__esModule",{value:!0}),Qr.ReadableStreamMessageReader=Qr.AbstractMessageReader=Qr.MessageReader=void 0;const t=Xr,e=mt,n=Tr,r=F$();var i;(function(c){function l(u){let d=u;return d&&e.func(d.listen)&&e.func(d.dispose)&&e.func(d.onError)&&e.func(d.onClose)&&e.func(d.onPartialMessage)}c.is=l})(i||(Qr.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(l){this.errorEmitter.fire(this.asError(l))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(l){this.partialMessageEmitter.fire(l)}asError(l){return l instanceof Error?l:new Error(`Reader received error. Reason: ${e.string(l.message)?l.message:"unknown"}`)}}Qr.AbstractMessageReader=s;var o;(function(c){function l(u){let d,f;const h=new Map;let p;const y=new Map;if(u===void 0||typeof u=="string")d=u??"utf-8";else{if(d=u.charset??"utf-8",u.contentDecoder!==void 0&&(f=u.contentDecoder,h.set(f.name,f)),u.contentDecoders!==void 0)for(const $ of u.contentDecoders)h.set($.name,$);if(u.contentTypeDecoder!==void 0&&(p=u.contentTypeDecoder,y.set(p.name,p)),u.contentTypeDecoders!==void 0)for(const $ of u.contentTypeDecoders)y.set($.name,$)}return p===void 0&&(p=(0,t.default)().applicationJson.decoder,y.set(p.name,p)),{charset:d,contentDecoder:f,contentDecoders:h,contentTypeDecoder:p,contentTypeDecoders:y}}c.fromOptions=l})(o||(o={}));class a extends s{constructor(l,u){super(),this.readable=l,this.options=o.fromOptions(u),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(l){this._partialMessageTimeout=l}get partialMessageTimeout(){return this._partialMessageTimeout}listen(l){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=l;const u=this.readable.onData(d=>{this.onData(d)});return this.readable.onError(d=>this.fireError(d)),this.readable.onClose(()=>this.fireClose()),u}onData(l){try{for(this.buffer.append(l);;){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 u=this.buffer.tryReadBody(this.nextMessageLength);if(u===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const d=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(u):u,f=await this.options.contentTypeDecoder.decode(d,this.options);this.callback(f)}).catch(d=>{this.fireError(d)})}}catch(u){this.fireError(u)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((l,u)=>{this.partialMessageTimer=void 0,l===this.messageToken&&(this.firePartialMessage({messageToken:l,waitingTime:u}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}return Qr.ReadableStreamMessageReader=a,Qr}var Zr={},U$;function Oq(){if(U$)return Zr;U$=1,Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.WriteableStreamMessageWriter=Zr.AbstractMessageWriter=Zr.MessageWriter=void 0;const t=Xr,e=mt,n=F$(),r=Tr,i="Content-Length: ",s=`\r
|
|
127
|
-
`;var o;(function(u){function d(f){let h=f;return h&&e.func(h.dispose)&&e.func(h.onClose)&&e.func(h.onError)&&e.func(h.write)}u.is=d})(o||(Zr.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"}`)}}Zr.AbstractMessageWriter=a;var c;(function(u){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}}u.fromOptions=d})(c||(c={}));class l 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 Zr.WriteableStreamMessageWriter=l,Zr}var Ac={},B$;function Dq(){if(B$)return Ac;B$=1,Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.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,l=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++}l+=h.byteLength,a++}if(o!==4)return;const u=this._read(l+c),d=new Map,f=this.toString(u,"ascii").split(n);if(f.length<2)return d;for(let h=0;h<f.length-2;h++){const p=f[h],y=p.indexOf(":");if(y===-1)throw new Error(`Message header must separate key and value using ':'
|
|
129
|
-
${p}`);const $=p.substr(0,y),T=p.substr(y+1).trim();d.set(s?$.toLowerCase():$,T)}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 l=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(l)}if(this._chunks[0].byteLength>s){const l=this._chunks[0],u=this.asNative(l,s);return this._chunks[0]=l.slice(s),this._totalLength-=s,u}const o=this.allocNative(s);let a=0,c=0;for(;s>0;){const l=this._chunks[c];if(l.byteLength>s){const u=l.slice(0,s);o.set(u,a),a+=s,this._chunks[c]=l.slice(s),this._totalLength-=s,s-=s}else o.set(l,a),a+=l.byteLength,this._chunks.shift(),this._totalLength-=l.byteLength,s-=l.byteLength}return o}}return Ac.AbstractMessageBuffer=r,Ac}var Ym={},q$;function Lq(){return q$||(q$=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;const e=Xr,n=mt,r=x$(),i=O$(),s=Tr,o=Pi;var a;(function(R){R.type=new r.NotificationType("$/cancelRequest")})(a||(a={}));var c;(function(R){function M(q){return typeof q=="string"||typeof q=="number"}R.is=M})(c||(t.ProgressToken=c={}));var l;(function(R){R.type=new r.NotificationType("$/progress")})(l||(l={}));class u{constructor(){}}t.ProgressType=u;var d;(function(R){function M(q){return n.func(q)}R.is=M})(d||(d={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var f;(function(R){R[R.Off=0]="Off",R[R.Messages=1]="Messages",R[R.Compact=2]="Compact",R[R.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var h;(function(R){R.Off="off",R.Messages="messages",R.Compact="compact",R.Verbose="verbose"})(h||(t.TraceValues=h={})),function(R){function M(j){if(!n.string(j))return R.Off;switch(j=j.toLowerCase(),j){case"off":return R.Off;case"messages":return R.Messages;case"compact":return R.Compact;case"verbose":return R.Verbose;default:return R.Off}}R.fromString=M;function q(j){switch(j){case R.Off:return"off";case R.Messages:return"messages";case R.Compact:return"compact";case R.Verbose:return"verbose";default:return"off"}}R.toString=q}(f||(t.Trace=f={}));var p;(function(R){R.Text="text",R.JSON="json"})(p||(t.TraceFormat=p={})),function(R){function M(q){return n.string(q)?(q=q.toLowerCase(),q==="json"?R.JSON:R.Text):R.Text}R.fromString=M}(p||(t.TraceFormat=p={}));var y;(function(R){R.type=new r.NotificationType("$/setTrace")})(y||(t.SetTraceNotification=y={}));var $;(function(R){R.type=new r.NotificationType("$/logTrace")})($||(t.LogTraceNotification=$={}));var T;(function(R){R[R.Closed=1]="Closed",R[R.Disposed=2]="Disposed",R[R.AlreadyListening=3]="AlreadyListening"})(T||(t.ConnectionErrors=T={}));class w extends Error{constructor(M,q){super(q),this.code=M,Object.setPrototypeOf(this,w.prototype)}}t.ConnectionError=w;var b;(function(R){function M(q){const j=q;return j&&n.func(j.cancelUndispatched)}R.is=M})(b||(t.ConnectionStrategy=b={}));var _;(function(R){function M(q){const j=q;return j&&(j.kind===void 0||j.kind==="id")&&n.func(j.createCancellationTokenSource)&&(j.dispose===void 0||n.func(j.dispose))}R.is=M})(_||(t.IdCancellationReceiverStrategy=_={}));var x;(function(R){function M(q){const j=q;return j&&j.kind==="request"&&n.func(j.createCancellationTokenSource)&&(j.dispose===void 0||n.func(j.dispose))}R.is=M})(x||(t.RequestCancellationReceiverStrategy=x={}));var F;(function(R){R.Message=Object.freeze({createCancellationTokenSource(q){return new o.CancellationTokenSource}});function M(q){return _.is(q)||x.is(q)}R.is=M})(F||(t.CancellationReceiverStrategy=F={}));var P;(function(R){R.Message=Object.freeze({sendCancellation(q,j){return q.sendNotification(a.type,{id:j})},cleanup(q){}});function M(q){const j=q;return j&&n.func(j.sendCancellation)&&n.func(j.cleanup)}R.is=M})(P||(t.CancellationSenderStrategy=P={}));var G;(function(R){R.Message=Object.freeze({receiver:F.Message,sender:P.Message});function M(q){const j=q;return j&&F.is(j.receiver)&&P.is(j.sender)}R.is=M})(G||(t.CancellationStrategy=G={}));var B;(function(R){function M(q){const j=q;return j&&n.func(j.handleMessage)}R.is=M})(B||(t.MessageStrategy=B={}));var W;(function(R){function M(q){const j=q;return j&&(G.is(j.cancellationStrategy)||b.is(j.connectionStrategy)||B.is(j.messageStrategy))}R.is=M})(W||(t.ConnectionOptions=W={}));var I;(function(R){R[R.New=1]="New",R[R.Listening=2]="Listening",R[R.Closed=3]="Closed",R[R.Disposed=4]="Disposed"})(I||(I={}));function k(R,M,q,j){const z=q!==void 0?q:t.NullLogger;let J=0,U=0,ce=0;const Qe="2.0";let It;const Zt=new Map;let Be;const gn=new Map,Fe=new Map;let nt,dt=new i.LinkedMap,je=new Map,ft=new Set,Ke=new Map,fe=f.Off,Ze=p.Text,Ne,Pt=I.New;const Ir=new s.Emitter,oi=new s.Emitter,ai=new s.Emitter,ci=new s.Emitter,li=new s.Emitter,en=j&&j.cancellationStrategy?j.cancellationStrategy:G.Message;function ui(E){if(E===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+E.toString()}function Zi(E){return E===null?"res-unknown-"+(++ce).toString():"res-"+E.toString()}function es(){return"not-"+(++U).toString()}function Pr(E,L){r.Message.isRequest(L)?E.set(ui(L.id),L):r.Message.isResponse(L)?E.set(Zi(L.id),L):E.set(es(),L)}function ts(E){}function di(){return Pt===I.Listening}function fi(){return Pt===I.Closed}function Rn(){return Pt===I.Disposed}function hi(){(Pt===I.New||Pt===I.Listening)&&(Pt=I.Closed,oi.fire(void 0))}function ns(E){Ir.fire([E,void 0,void 0])}function rs(E){Ir.fire(E)}R.onClose(hi),R.onError(ns),M.onClose(hi),M.onError(rs);function pi(){nt||dt.size===0||(nt=(0,e.default)().timer.setImmediate(()=>{nt=void 0,is()}))}function gi(E){r.Message.isRequest(E)?os(E):r.Message.isNotification(E)?mi(E):r.Message.isResponse(E)?as(E):yi(E)}function is(){if(dt.size===0)return;const E=dt.shift();try{const L=j?.messageStrategy;B.is(L)?L.handleMessage(E,gi):gi(E)}finally{pi()}}const ss=E=>{try{if(r.Message.isNotification(E)&&E.method===a.type.method){const L=E.params.id,H=ui(L),K=dt.get(H);if(r.Message.isRequest(K)){const ge=j?.connectionStrategy,_e=ge&&ge.cancelUndispatched?ge.cancelUndispatched(K,ts):void 0;if(_e&&(_e.error!==void 0||_e.result!==void 0)){dt.delete(H),Ke.delete(L),_e.id=K.id,or(_e,E.method,Date.now()),M.write(_e).catch(()=>z.error("Sending response for canceled message failed."));return}}const ve=Ke.get(L);if(ve!==void 0){ve.cancel(),xr(E);return}else ft.add(L)}Pr(dt,E)}finally{pi()}};function os(E){if(Rn())return;function L(he,Oe,Ce){const wt={jsonrpc:Qe,id:E.id};he instanceof r.ResponseError?wt.error=he.toJson():wt.result=he===void 0?null:he,or(wt,Oe,Ce),M.write(wt).catch(()=>z.error("Sending response failed."))}function H(he,Oe,Ce){const wt={jsonrpc:Qe,id:E.id,error:he.toJson()};or(wt,Oe,Ce),M.write(wt).catch(()=>z.error("Sending response failed."))}function K(he,Oe,Ce){he===void 0&&(he=null);const wt={jsonrpc:Qe,id:E.id,result:he};or(wt,Oe,Ce),M.write(wt).catch(()=>z.error("Sending response failed."))}us(E);const ve=Zt.get(E.method);let ge,_e;ve&&(ge=ve.type,_e=ve.handler);const ee=Date.now();if(_e||It){const he=E.id??String(Date.now()),Oe=_.is(en.receiver)?en.receiver.createCancellationTokenSource(he):en.receiver.createCancellationTokenSource(E);E.id!==null&&ft.has(E.id)&&Oe.cancel(),E.id!==null&&Ke.set(he,Oe);try{let Ce;if(_e)if(E.params===void 0){if(ge!==void 0&&ge.numberOfParams!==0){H(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${E.method} defines ${ge.numberOfParams} params but received none.`),E.method,ee);return}Ce=_e(Oe.token)}else if(Array.isArray(E.params)){if(ge!==void 0&&ge.parameterStructures===r.ParameterStructures.byName){H(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${E.method} defines parameters by name but received parameters by position`),E.method,ee);return}Ce=_e(...E.params,Oe.token)}else{if(ge!==void 0&&ge.parameterStructures===r.ParameterStructures.byPosition){H(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${E.method} defines parameters by position but received parameters by name`),E.method,ee);return}Ce=_e(E.params,Oe.token)}else It&&(Ce=It(E.method,E.params,Oe.token));const wt=Ce;Ce?wt.then?wt.then(qt=>{Ke.delete(he),L(qt,E.method,ee)},qt=>{Ke.delete(he),qt instanceof r.ResponseError?H(qt,E.method,ee):qt&&n.string(qt.message)?H(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${E.method} failed with message: ${qt.message}`),E.method,ee):H(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${E.method} failed unexpectedly without providing any details.`),E.method,ee)}):(Ke.delete(he),L(Ce,E.method,ee)):(Ke.delete(he),K(Ce,E.method,ee))}catch(Ce){Ke.delete(he),Ce instanceof r.ResponseError?L(Ce,E.method,ee):Ce&&n.string(Ce.message)?H(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${E.method} failed with message: ${Ce.message}`),E.method,ee):H(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${E.method} failed unexpectedly without providing any details.`),E.method,ee)}}else H(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${E.method}`),E.method,ee)}function as(E){if(!Rn())if(E.id===null)E.error?z.error(`Received response message without id: Error is:
|
|
130
|
-
${JSON.stringify(E.error,void 0,4)}`):z.error("Received response message without id. No further error information provided.");else{const L=E.id,H=je.get(L);if(ds(E,H),H!==void 0){je.delete(L);try{if(E.error){const K=E.error;H.reject(new r.ResponseError(K.code,K.message,K.data))}else if(E.result!==void 0)H.resolve(E.result);else throw new Error("Should never happen.")}catch(K){K.message?z.error(`Response handler '${H.method}' failed with message: ${K.message}`):z.error(`Response handler '${H.method}' failed unexpectedly.`)}}}}function mi(E){if(Rn())return;let L,H;if(E.method===a.type.method){const K=E.params.id;ft.delete(K),xr(E);return}else{const K=gn.get(E.method);K&&(H=K.handler,L=K.type)}if(H||Be)try{if(xr(E),H)if(E.params===void 0)L!==void 0&&L.numberOfParams!==0&&L.parameterStructures!==r.ParameterStructures.byName&&z.error(`Notification ${E.method} defines ${L.numberOfParams} params but received none.`),H();else if(Array.isArray(E.params)){const K=E.params;E.method===l.type.method&&K.length===2&&c.is(K[0])?H({token:K[0],value:K[1]}):(L!==void 0&&(L.parameterStructures===r.ParameterStructures.byName&&z.error(`Notification ${E.method} defines parameters by name but received parameters by position`),L.numberOfParams!==E.params.length&&z.error(`Notification ${E.method} defines ${L.numberOfParams} params but received ${K.length} arguments`)),H(...K))}else L!==void 0&&L.parameterStructures===r.ParameterStructures.byPosition&&z.error(`Notification ${E.method} defines parameters by position but received parameters by name`),H(E.params);else Be&&Be(E.method,E.params)}catch(K){K.message?z.error(`Notification handler '${E.method}' failed with message: ${K.message}`):z.error(`Notification handler '${E.method}' failed unexpectedly.`)}else ai.fire(E)}function yi(E){if(!E){z.error("Received empty message.");return}z.error(`Received message which is neither a response nor a notification message:
|
|
131
|
-
${JSON.stringify(E,null,4)}`);const L=E;if(n.string(L.id)||n.number(L.id)){const H=L.id,K=je.get(H);K&&K.reject(new Error("The received response has neither a result nor an error property."))}}function tn(E){if(E!=null)switch(fe){case f.Verbose:return JSON.stringify(E,null,4);case f.Compact:return JSON.stringify(E);default:return}}function cs(E){if(!(fe===f.Off||!Ne))if(Ze===p.Text){let L;(fe===f.Verbose||fe===f.Compact)&&E.params&&(L=`Params: ${tn(E.params)}
|
|
132
|
-
|
|
133
|
-
`),Ne.log(`Sending request '${E.method} - (${E.id})'.`,L)}else Sn("send-request",E)}function ls(E){if(!(fe===f.Off||!Ne))if(Ze===p.Text){let L;(fe===f.Verbose||fe===f.Compact)&&(E.params?L=`Params: ${tn(E.params)}
|
|
134
|
-
|
|
135
|
-
`:L=`No parameters provided.
|
|
136
|
-
|
|
137
|
-
`),Ne.log(`Sending notification '${E.method}'.`,L)}else Sn("send-notification",E)}function or(E,L,H){if(!(fe===f.Off||!Ne))if(Ze===p.Text){let K;(fe===f.Verbose||fe===f.Compact)&&(E.error&&E.error.data?K=`Error data: ${tn(E.error.data)}
|
|
138
|
-
|
|
139
|
-
`:E.result?K=`Result: ${tn(E.result)}
|
|
140
|
-
|
|
141
|
-
`:E.error===void 0&&(K=`No result returned.
|
|
142
|
-
|
|
143
|
-
`)),Ne.log(`Sending response '${L} - (${E.id})'. Processing request took ${Date.now()-H}ms`,K)}else Sn("send-response",E)}function us(E){if(!(fe===f.Off||!Ne))if(Ze===p.Text){let L;(fe===f.Verbose||fe===f.Compact)&&E.params&&(L=`Params: ${tn(E.params)}
|
|
144
|
-
|
|
145
|
-
`),Ne.log(`Received request '${E.method} - (${E.id})'.`,L)}else Sn("receive-request",E)}function xr(E){if(!(fe===f.Off||!Ne||E.method===$.type.method))if(Ze===p.Text){let L;(fe===f.Verbose||fe===f.Compact)&&(E.params?L=`Params: ${tn(E.params)}
|
|
146
|
-
|
|
147
|
-
`:L=`No parameters provided.
|
|
148
|
-
|
|
149
|
-
`),Ne.log(`Received notification '${E.method}'.`,L)}else Sn("receive-notification",E)}function ds(E,L){if(!(fe===f.Off||!Ne))if(Ze===p.Text){let H;if((fe===f.Verbose||fe===f.Compact)&&(E.error&&E.error.data?H=`Error data: ${tn(E.error.data)}
|
|
150
|
-
|
|
151
|
-
`:E.result?H=`Result: ${tn(E.result)}
|
|
152
|
-
|
|
153
|
-
`:E.error===void 0&&(H=`No result returned.
|
|
154
|
-
|
|
155
|
-
`)),L){const K=E.error?` Request failed: ${E.error.message} (${E.error.code}).`:"";Ne.log(`Received response '${L.method} - (${E.id})' in ${Date.now()-L.timerStart}ms.${K}`,H)}else Ne.log(`Received response ${E.id} without active response promise.`,H)}else Sn("receive-response",E)}function Sn(E,L){if(!Ne||fe===f.Off)return;const H={isLSPMessage:!0,type:E,message:L,timestamp:Date.now()};Ne.log(H)}function Gn(){if(fi())throw new w(T.Closed,"Connection is closed.");if(Rn())throw new w(T.Disposed,"Connection is disposed.")}function Qs(){if(di())throw new w(T.AlreadyListening,"Connection is already listening")}function N(){if(!di())throw new Error("Call listen() first.")}function v(E){return E===void 0?null:E}function C(E){if(E!==null)return E}function g(E){return E!=null&&!Array.isArray(E)&&typeof E=="object"}function S(E,L){switch(E){case r.ParameterStructures.auto:return g(L)?C(L):[v(L)];case r.ParameterStructures.byName:if(!g(L))throw new Error("Received parameters by name but param is not an object literal.");return C(L);case r.ParameterStructures.byPosition:return[v(L)];default:throw new Error(`Unknown parameter structure ${E.toString()}`)}}function m(E,L){let H;const K=E.numberOfParams;switch(K){case 0:H=void 0;break;case 1:H=S(E.parameterStructures,L[0]);break;default:H=[];for(let ve=0;ve<L.length&&ve<K;ve++)H.push(v(L[ve]));if(L.length<K)for(let ve=L.length;ve<K;ve++)H.push(null);break}return H}const A={sendNotification:(E,...L)=>{Gn();let H,K;if(n.string(E)){H=E;const ge=L[0];let _e=0,ee=r.ParameterStructures.auto;r.ParameterStructures.is(ge)&&(_e=1,ee=ge);let he=L.length;const Oe=he-_e;switch(Oe){case 0:K=void 0;break;case 1:K=S(ee,L[_e]);break;default:if(ee===r.ParameterStructures.byName)throw new Error(`Received ${Oe} parameters for 'by Name' notification parameter structure.`);K=L.slice(_e,he).map(Ce=>v(Ce));break}}else{const ge=L;H=E.method,K=m(E,ge)}const ve={jsonrpc:Qe,method:H,params:K};return ls(ve),M.write(ve).catch(ge=>{throw z.error("Sending notification failed."),ge})},onNotification:(E,L)=>{Gn();let H;return n.func(E)?Be=E:L&&(n.string(E)?(H=E,gn.set(E,{type:void 0,handler:L})):(H=E.method,gn.set(E.method,{type:E,handler:L}))),{dispose:()=>{H!==void 0?gn.delete(H):Be=void 0}}},onProgress:(E,L,H)=>{if(Fe.has(L))throw new Error(`Progress handler for token ${L} already registered`);return Fe.set(L,H),{dispose:()=>{Fe.delete(L)}}},sendProgress:(E,L,H)=>A.sendNotification(l.type,{token:L,value:H}),onUnhandledProgress:ci.event,sendRequest:(E,...L)=>{Gn(),N();let H,K,ve;if(n.string(E)){H=E;const he=L[0],Oe=L[L.length-1];let Ce=0,wt=r.ParameterStructures.auto;r.ParameterStructures.is(he)&&(Ce=1,wt=he);let qt=L.length;o.CancellationToken.is(Oe)&&(qt=qt-1,ve=Oe);const ar=qt-Ce;switch(ar){case 0:K=void 0;break;case 1:K=S(wt,L[Ce]);break;default:if(wt===r.ParameterStructures.byName)throw new Error(`Received ${ar} parameters for 'by Name' request parameter structure.`);K=L.slice(Ce,qt).map(Nx=>v(Nx));break}}else{const he=L;H=E.method,K=m(E,he);const Oe=E.numberOfParams;ve=o.CancellationToken.is(he[Oe])?he[Oe]:void 0}const ge=J++;let _e;ve&&(_e=ve.onCancellationRequested(()=>{const he=en.sender.sendCancellation(A,ge);return he===void 0?(z.log(`Received no promise from cancellation strategy when cancelling id ${ge}`),Promise.resolve()):he.catch(()=>{z.log(`Sending cancellation messages for id ${ge} failed`)})}));const ee={jsonrpc:Qe,id:ge,method:H,params:K};return cs(ee),typeof en.sender.enableCancellation=="function"&&en.sender.enableCancellation(ee),new Promise(async(he,Oe)=>{const Ce=ar=>{he(ar),en.sender.cleanup(ge),_e?.dispose()},wt=ar=>{Oe(ar),en.sender.cleanup(ge),_e?.dispose()},qt={method:H,timerStart:Date.now(),resolve:Ce,reject:wt};try{await M.write(ee),je.set(ge,qt)}catch(ar){throw z.error("Sending request failed."),qt.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,ar.message?ar.message:"Unknown reason")),ar}})},onRequest:(E,L)=>{Gn();let H=null;return d.is(E)?(H=void 0,It=E):n.string(E)?(H=null,L!==void 0&&(H=E,Zt.set(E,{handler:L,type:void 0}))):L!==void 0&&(H=E.method,Zt.set(E.method,{type:E,handler:L})),{dispose:()=>{H!==null&&(H!==void 0?Zt.delete(H):It=void 0)}}},hasPendingResponse:()=>je.size>0,trace:async(E,L,H)=>{let K=!1,ve=p.Text;H!==void 0&&(n.boolean(H)?K=H:(K=H.sendNotification||!1,ve=H.traceFormat||p.Text)),fe=E,Ze=ve,fe===f.Off?Ne=void 0:Ne=L,K&&!fi()&&!Rn()&&await A.sendNotification(y.type,{value:f.toString(E)})},onError:Ir.event,onClose:oi.event,onUnhandledNotification:ai.event,onDispose:li.event,end:()=>{M.end()},dispose:()=>{if(Rn())return;Pt=I.Disposed,li.fire(void 0);const E=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const L of je.values())L.reject(E);je=new Map,Ke=new Map,ft=new Set,dt=new i.LinkedMap,n.func(M.dispose)&&M.dispose(),n.func(R.dispose)&&R.dispose()},listen:()=>{Gn(),Qs(),Pt=I.Listening,R.listen(ss)},inspect:()=>{(0,e.default)().console.log("inspect")}};return A.onNotification($.type,E=>{if(fe===f.Off||!Ne)return;const L=fe===f.Verbose||fe===f.Compact;Ne.log(E.message,L?E.verbose:void 0)}),A.onNotification(l.type,E=>{const L=Fe.get(E.token);L?L(E.value):ci.fire(E)}),A}t.createMessageConnection=k}(Ym)),Ym}var W$;function Xm(){return W$||(W$=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=x$();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=O$();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=Pq();Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=Tr;Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const s=Pi;Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return s.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return s.CancellationToken}});const o=xq();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return o.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return o.SharedArrayReceiverStrategy}});const a=Nq();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=Oq();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 l=Dq();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return l.AbstractMessageBuffer}});const u=Lq();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return u.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return u.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return u.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return u.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return u.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return u.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return u.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return u.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return u.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return u.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return u.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return u.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return u.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return u.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return u.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return u.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:function(){return u.MessageStrategy}});const d=Xr;t.RAL=d.default}(Km)),Km}Object.defineProperty(Vm,"__esModule",{value:!0});const G$=iN,ei=Xm();class ip extends ei.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return ip.emptyBuffer}fromString(e,n){return Buffer.from(e,n)}toString(e,n){return e instanceof Buffer?e.toString(n):new G$.TextDecoder(n).decode(e)}asNative(e,n){return n===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,n):Buffer.from(e,0,n)}allocNative(e){return Buffer.allocUnsafe(e)}}ip.emptyBuffer=Buffer.allocUnsafe(0);class Mq{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ei.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ei.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ei.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),ei.Disposable.create(()=>this.stream.off("data",e))}}class Fq{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ei.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ei.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ei.Disposable.create(()=>this.stream.off("end",e))}write(e,n){return new Promise((r,i)=>{const s=o=>{o==null?r():i(o)};typeof e=="string"?this.stream.write(e,n,s):this.stream.write(e,s)})}end(){this.stream.end()}}const z$=Object.freeze({messageBuffer:Object.freeze({create:t=>new ip(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(n){return Promise.reject(n)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new G$.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new Mq(t),asWritableStream:t=>new Fq(t)}),console,timer:Object.freeze({setTimeout(t,e,...n){const r=setTimeout(t,e,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(t,...e){const n=setImmediate(t,...e);return{dispose:()=>clearImmediate(n)}},setInterval(t,e,...n){const r=setInterval(t,e,...n);return{dispose:()=>clearInterval(r)}}})});function Jm(){return z$}(function(t){function e(){ei.RAL.install(z$)}t.install=e})(Jm||(Jm={})),Vm.default=Jm,function(t){var e=ut&&ut.__createBinding||(Object.create?function(I,k,R,M){M===void 0&&(M=R);var q=Object.getOwnPropertyDescriptor(k,R);(!q||("get"in q?!k.__esModule:q.writable||q.configurable))&&(q={enumerable:!0,get:function(){return k[R]}}),Object.defineProperty(I,M,q)}:function(I,k,R,M){M===void 0&&(M=R),I[M]=k[R]}),n=ut&&ut.__exportStar||function(I,k){for(var R in I)R!=="default"&&!Object.prototype.hasOwnProperty.call(k,R)&&e(k,I,R)};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=Vm;r.default.install();const i=da,s=sN,o=hb,a=oN,c=Xm();n(Xm(),t);class l extends c.AbstractMessageReader{constructor(k){super(),this.process=k;let R=this.process;R.on("error",M=>this.fireError(M)),R.on("close",()=>this.fireClose())}listen(k){return this.process.on("message",k),c.Disposable.create(()=>this.process.off("message",k))}}t.IPCMessageReader=l;class u extends c.AbstractMessageWriter{constructor(k){super(),this.process=k,this.errorCount=0;const R=this.process;R.on("error",M=>this.fireError(M)),R.on("close",()=>this.fireClose)}write(k){try{return typeof this.process.send=="function"&&this.process.send(k,void 0,void 0,R=>{R?(this.errorCount++,this.handleError(R,k)):this.errorCount=0}),Promise.resolve()}catch(R){return this.handleError(R,k),Promise.reject(R)}}handleError(k,R){this.errorCount++,this.fireError(k,R,this.errorCount)}end(){}}t.IPCMessageWriter=u;class d extends c.AbstractMessageReader{constructor(k){super(),this.onData=new c.Emitter,k.on("close",()=>this.fireClose),k.on("error",R=>this.fireError(R)),k.on("message",R=>{this.onData.fire(R)})}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",R=>this.fireError(R))}write(k){try{return this.port.postMessage(k),Promise.resolve()}catch(R){return this.handleError(R,k),Promise.reject(R)}}handleError(k,R){this.errorCount++,this.fireError(k,R,this.errorCount)}end(){}}t.PortMessageWriter=f;class h extends c.ReadableStreamMessageReader{constructor(k,R="utf-8"){super((0,r.default)().stream.asReadableStream(k),R)}}t.SocketMessageReader=h;class p extends c.WriteableStreamMessageWriter{constructor(k,R){super((0,r.default)().stream.asWritableStream(k),R),this.socket=k}dispose(){super.dispose(),this.socket.destroy()}}t.SocketMessageWriter=p;class y extends c.ReadableStreamMessageReader{constructor(k,R){super((0,r.default)().stream.asReadableStream(k),R)}}t.StreamMessageReader=y;class $ extends c.WriteableStreamMessageWriter{constructor(k,R){super((0,r.default)().stream.asWritableStream(k),R)}}t.StreamMessageWriter=$;const T=process.env.XDG_RUNTIME_DIR,w=new Map([["linux",107],["darwin",103]]);function b(){const I=(0,o.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${I}-sock`;let k;T?k=i.join(T,`vscode-ipc-${I}.sock`):k=i.join(s.tmpdir(),`vscode-${I}.sock`);const R=w.get(process.platform);return R!==void 0&&k.length>R&&(0,r.default)().console.warn(`WARNING: IPC handle "${k}" is longer than ${R} characters.`),k}t.generateRandomPipeName=b;function _(I,k="utf-8"){let R;const M=new Promise((q,j)=>{R=q});return new Promise((q,j)=>{let z=(0,a.createServer)(J=>{z.close(),R([new h(J,k),new p(J,k)])});z.on("error",j),z.listen(I,()=>{z.removeListener("error",j),q({onConnected:()=>M})})})}t.createClientPipeTransport=_;function x(I,k="utf-8"){const R=(0,a.createConnection)(I);return[new h(R,k),new p(R,k)]}t.createServerPipeTransport=x;function F(I,k="utf-8"){let R;const M=new Promise((q,j)=>{R=q});return new Promise((q,j)=>{const z=(0,a.createServer)(J=>{z.close(),R([new h(J,k),new p(J,k)])});z.on("error",j),z.listen(I,"127.0.0.1",()=>{z.removeListener("error",j),q({onConnected:()=>M})})})}t.createClientSocketTransport=F;function P(I,k="utf-8"){const R=(0,a.createConnection)(I,"127.0.0.1");return[new h(R,k),new p(R,k)]}t.createServerSocketTransport=P;function G(I){const k=I;return k.read!==void 0&&k.addListener!==void 0}function B(I){const k=I;return k.write!==void 0&&k.addListener!==void 0}function W(I,k,R,M){R||(R=c.NullLogger);const q=G(I)?new y(I):I,j=B(k)?new $(k):k;return c.ConnectionStrategy.is(M)&&(M={connectionStrategy:M}),(0,c.createMessageConnection)(q,j,R,M)}t.createMessageConnection=W}(un);var H$=un,V$={};function jq(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 Qm={exports:{}};(function(t,e){(function(n){{var r=n(jq,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(v){function C(g){return typeof g=="string"}v.is=C})(i||(r.DocumentUri=i={}));var s;(function(v){function C(g){return typeof g=="string"}v.is=C})(s||(r.URI=s={}));var o;(function(v){v.MIN_VALUE=-2147483648,v.MAX_VALUE=2147483647;function C(g){return typeof g=="number"&&v.MIN_VALUE<=g&&g<=v.MAX_VALUE}v.is=C})(o||(r.integer=o={}));var a;(function(v){v.MIN_VALUE=0,v.MAX_VALUE=2147483647;function C(g){return typeof g=="number"&&v.MIN_VALUE<=g&&g<=v.MAX_VALUE}v.is=C})(a||(r.uinteger=a={}));var c;(function(v){function C(S,m){return S===Number.MAX_VALUE&&(S=a.MAX_VALUE),m===Number.MAX_VALUE&&(m=a.MAX_VALUE),{line:S,character:m}}v.create=C;function g(S){var m=S;return N.objectLiteral(m)&&N.uinteger(m.line)&&N.uinteger(m.character)}v.is=g})(c||(r.Position=c={}));var l;(function(v){function C(S,m,A,E){if(N.uinteger(S)&&N.uinteger(m)&&N.uinteger(A)&&N.uinteger(E))return{start:c.create(S,m),end:c.create(A,E)};if(c.is(S)&&c.is(m))return{start:S,end:m};throw new Error("Range#create called with invalid arguments[".concat(S,", ").concat(m,", ").concat(A,", ").concat(E,"]"))}v.create=C;function g(S){var m=S;return N.objectLiteral(m)&&c.is(m.start)&&c.is(m.end)}v.is=g})(l||(r.Range=l={}));var u;(function(v){function C(S,m){return{uri:S,range:m}}v.create=C;function g(S){var m=S;return N.objectLiteral(m)&&l.is(m.range)&&(N.string(m.uri)||N.undefined(m.uri))}v.is=g})(u||(r.Location=u={}));var d;(function(v){function C(S,m,A,E){return{targetUri:S,targetRange:m,targetSelectionRange:A,originSelectionRange:E}}v.create=C;function g(S){var m=S;return N.objectLiteral(m)&&l.is(m.targetRange)&&N.string(m.targetUri)&&l.is(m.targetSelectionRange)&&(l.is(m.originSelectionRange)||N.undefined(m.originSelectionRange))}v.is=g})(d||(r.LocationLink=d={}));var f;(function(v){function C(S,m,A,E){return{red:S,green:m,blue:A,alpha:E}}v.create=C;function g(S){var m=S;return N.objectLiteral(m)&&N.numberRange(m.red,0,1)&&N.numberRange(m.green,0,1)&&N.numberRange(m.blue,0,1)&&N.numberRange(m.alpha,0,1)}v.is=g})(f||(r.Color=f={}));var h;(function(v){function C(S,m){return{range:S,color:m}}v.create=C;function g(S){var m=S;return N.objectLiteral(m)&&l.is(m.range)&&f.is(m.color)}v.is=g})(h||(r.ColorInformation=h={}));var p;(function(v){function C(S,m,A){return{label:S,textEdit:m,additionalTextEdits:A}}v.create=C;function g(S){var m=S;return N.objectLiteral(m)&&N.string(m.label)&&(N.undefined(m.textEdit)||P.is(m))&&(N.undefined(m.additionalTextEdits)||N.typedArray(m.additionalTextEdits,P.is))}v.is=g})(p||(r.ColorPresentation=p={}));var y;(function(v){v.Comment="comment",v.Imports="imports",v.Region="region"})(y||(r.FoldingRangeKind=y={}));var $;(function(v){function C(S,m,A,E,L,H){var K={startLine:S,endLine:m};return N.defined(A)&&(K.startCharacter=A),N.defined(E)&&(K.endCharacter=E),N.defined(L)&&(K.kind=L),N.defined(H)&&(K.collapsedText=H),K}v.create=C;function g(S){var m=S;return N.objectLiteral(m)&&N.uinteger(m.startLine)&&N.uinteger(m.startLine)&&(N.undefined(m.startCharacter)||N.uinteger(m.startCharacter))&&(N.undefined(m.endCharacter)||N.uinteger(m.endCharacter))&&(N.undefined(m.kind)||N.string(m.kind))}v.is=g})($||(r.FoldingRange=$={}));var T;(function(v){function C(S,m){return{location:S,message:m}}v.create=C;function g(S){var m=S;return N.defined(m)&&u.is(m.location)&&N.string(m.message)}v.is=g})(T||(r.DiagnosticRelatedInformation=T={}));var w;(function(v){v.Error=1,v.Warning=2,v.Information=3,v.Hint=4})(w||(r.DiagnosticSeverity=w={}));var b;(function(v){v.Unnecessary=1,v.Deprecated=2})(b||(r.DiagnosticTag=b={}));var _;(function(v){function C(g){var S=g;return N.objectLiteral(S)&&N.string(S.href)}v.is=C})(_||(r.CodeDescription=_={}));var x;(function(v){function C(S,m,A,E,L,H){var K={range:S,message:m};return N.defined(A)&&(K.severity=A),N.defined(E)&&(K.code=E),N.defined(L)&&(K.source=L),N.defined(H)&&(K.relatedInformation=H),K}v.create=C;function g(S){var m,A=S;return N.defined(A)&&l.is(A.range)&&N.string(A.message)&&(N.number(A.severity)||N.undefined(A.severity))&&(N.integer(A.code)||N.string(A.code)||N.undefined(A.code))&&(N.undefined(A.codeDescription)||N.string((m=A.codeDescription)===null||m===void 0?void 0:m.href))&&(N.string(A.source)||N.undefined(A.source))&&(N.undefined(A.relatedInformation)||N.typedArray(A.relatedInformation,T.is))}v.is=g})(x||(r.Diagnostic=x={}));var F;(function(v){function C(S,m){for(var A=[],E=2;E<arguments.length;E++)A[E-2]=arguments[E];var L={title:S,command:m};return N.defined(A)&&A.length>0&&(L.arguments=A),L}v.create=C;function g(S){var m=S;return N.defined(m)&&N.string(m.title)&&N.string(m.command)}v.is=g})(F||(r.Command=F={}));var P;(function(v){function C(A,E){return{range:A,newText:E}}v.replace=C;function g(A,E){return{range:{start:A,end:A},newText:E}}v.insert=g;function S(A){return{range:A,newText:""}}v.del=S;function m(A){var E=A;return N.objectLiteral(E)&&N.string(E.newText)&&l.is(E.range)}v.is=m})(P||(r.TextEdit=P={}));var G;(function(v){function C(S,m,A){var E={label:S};return m!==void 0&&(E.needsConfirmation=m),A!==void 0&&(E.description=A),E}v.create=C;function g(S){var m=S;return N.objectLiteral(m)&&N.string(m.label)&&(N.boolean(m.needsConfirmation)||m.needsConfirmation===void 0)&&(N.string(m.description)||m.description===void 0)}v.is=g})(G||(r.ChangeAnnotation=G={}));var B;(function(v){function C(g){var S=g;return N.string(S)}v.is=C})(B||(r.ChangeAnnotationIdentifier=B={}));var W;(function(v){function C(A,E,L){return{range:A,newText:E,annotationId:L}}v.replace=C;function g(A,E,L){return{range:{start:A,end:A},newText:E,annotationId:L}}v.insert=g;function S(A,E){return{range:A,newText:"",annotationId:E}}v.del=S;function m(A){var E=A;return P.is(E)&&(G.is(E.annotationId)||B.is(E.annotationId))}v.is=m})(W||(r.AnnotatedTextEdit=W={}));var I;(function(v){function C(S,m){return{textDocument:S,edits:m}}v.create=C;function g(S){var m=S;return N.defined(m)&&Qe.is(m.textDocument)&&Array.isArray(m.edits)}v.is=g})(I||(r.TextDocumentEdit=I={}));var k;(function(v){function C(S,m,A){var E={kind:"create",uri:S};return m!==void 0&&(m.overwrite!==void 0||m.ignoreIfExists!==void 0)&&(E.options=m),A!==void 0&&(E.annotationId=A),E}v.create=C;function g(S){var m=S;return m&&m.kind==="create"&&N.string(m.uri)&&(m.options===void 0||(m.options.overwrite===void 0||N.boolean(m.options.overwrite))&&(m.options.ignoreIfExists===void 0||N.boolean(m.options.ignoreIfExists)))&&(m.annotationId===void 0||B.is(m.annotationId))}v.is=g})(k||(r.CreateFile=k={}));var R;(function(v){function C(S,m,A,E){var L={kind:"rename",oldUri:S,newUri:m};return A!==void 0&&(A.overwrite!==void 0||A.ignoreIfExists!==void 0)&&(L.options=A),E!==void 0&&(L.annotationId=E),L}v.create=C;function g(S){var m=S;return m&&m.kind==="rename"&&N.string(m.oldUri)&&N.string(m.newUri)&&(m.options===void 0||(m.options.overwrite===void 0||N.boolean(m.options.overwrite))&&(m.options.ignoreIfExists===void 0||N.boolean(m.options.ignoreIfExists)))&&(m.annotationId===void 0||B.is(m.annotationId))}v.is=g})(R||(r.RenameFile=R={}));var M;(function(v){function C(S,m,A){var E={kind:"delete",uri:S};return m!==void 0&&(m.recursive!==void 0||m.ignoreIfNotExists!==void 0)&&(E.options=m),A!==void 0&&(E.annotationId=A),E}v.create=C;function g(S){var m=S;return m&&m.kind==="delete"&&N.string(m.uri)&&(m.options===void 0||(m.options.recursive===void 0||N.boolean(m.options.recursive))&&(m.options.ignoreIfNotExists===void 0||N.boolean(m.options.ignoreIfNotExists)))&&(m.annotationId===void 0||B.is(m.annotationId))}v.is=g})(M||(r.DeleteFile=M={}));var q;(function(v){function C(g){var S=g;return S&&(S.changes!==void 0||S.documentChanges!==void 0)&&(S.documentChanges===void 0||S.documentChanges.every(function(m){return N.string(m.kind)?k.is(m)||R.is(m)||M.is(m):I.is(m)}))}v.is=C})(q||(r.WorkspaceEdit=q={}));var j=function(){function v(C,g){this.edits=C,this.changeAnnotations=g}return v.prototype.insert=function(C,g,S){var m,A;if(S===void 0?m=P.insert(C,g):B.is(S)?(A=S,m=W.insert(C,g,S)):(this.assertChangeAnnotations(this.changeAnnotations),A=this.changeAnnotations.manage(S),m=W.insert(C,g,A)),this.edits.push(m),A!==void 0)return A},v.prototype.replace=function(C,g,S){var m,A;if(S===void 0?m=P.replace(C,g):B.is(S)?(A=S,m=W.replace(C,g,S)):(this.assertChangeAnnotations(this.changeAnnotations),A=this.changeAnnotations.manage(S),m=W.replace(C,g,A)),this.edits.push(m),A!==void 0)return A},v.prototype.delete=function(C,g){var S,m;if(g===void 0?S=P.del(C):B.is(g)?(m=g,S=W.del(C,g)):(this.assertChangeAnnotations(this.changeAnnotations),m=this.changeAnnotations.manage(g),S=W.del(C,m)),this.edits.push(S),m!==void 0)return m},v.prototype.add=function(C){this.edits.push(C)},v.prototype.all=function(){return this.edits},v.prototype.clear=function(){this.edits.splice(0,this.edits.length)},v.prototype.assertChangeAnnotations=function(C){if(C===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},v}(),z=function(){function v(C){this._annotations=C===void 0?Object.create(null):C,this._counter=0,this._size=0}return v.prototype.all=function(){return this._annotations},Object.defineProperty(v.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),v.prototype.manage=function(C,g){var S;if(B.is(C)?S=C:(S=this.nextId(),g=C),this._annotations[S]!==void 0)throw new Error("Id ".concat(S," is already in use."));if(g===void 0)throw new Error("No annotation provided for id ".concat(S));return this._annotations[S]=g,this._size++,S},v.prototype.nextId=function(){return this._counter++,this._counter.toString()},v}(),J=function(){function v(C){var g=this;this._textEditChanges=Object.create(null),C!==void 0?(this._workspaceEdit=C,C.documentChanges?(this._changeAnnotations=new z(C.changeAnnotations),C.changeAnnotations=this._changeAnnotations.all(),C.documentChanges.forEach(function(S){if(I.is(S)){var m=new j(S.edits,g._changeAnnotations);g._textEditChanges[S.textDocument.uri]=m}})):C.changes&&Object.keys(C.changes).forEach(function(S){var m=new j(C.changes[S]);g._textEditChanges[S]=m})):this._workspaceEdit={}}return Object.defineProperty(v.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}),v.prototype.getTextEditChange=function(C){if(Qe.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},S=this._textEditChanges[g.uri];if(!S){var m=[],A={textDocument:g,edits:m};this._workspaceEdit.documentChanges.push(A),S=new j(m,this._changeAnnotations),this._textEditChanges[g.uri]=S}return S}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var S=this._textEditChanges[C];if(!S){var m=[];this._workspaceEdit.changes[C]=m,S=new j(m),this._textEditChanges[C]=S}return S}},v.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new z,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},v.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},v.prototype.createFile=function(C,g,S){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;G.is(g)||B.is(g)?m=g:S=g;var A,E;if(m===void 0?A=k.create(C,S):(E=B.is(m)?m:this._changeAnnotations.manage(m),A=k.create(C,S,E)),this._workspaceEdit.documentChanges.push(A),E!==void 0)return E},v.prototype.renameFile=function(C,g,S,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var A;G.is(S)||B.is(S)?A=S:m=S;var E,L;if(A===void 0?E=R.create(C,g,m):(L=B.is(A)?A:this._changeAnnotations.manage(A),E=R.create(C,g,m,L)),this._workspaceEdit.documentChanges.push(E),L!==void 0)return L},v.prototype.deleteFile=function(C,g,S){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;G.is(g)||B.is(g)?m=g:S=g;var A,E;if(m===void 0?A=M.create(C,S):(E=B.is(m)?m:this._changeAnnotations.manage(m),A=M.create(C,S,E)),this._workspaceEdit.documentChanges.push(A),E!==void 0)return E},v}();r.WorkspaceChange=J;var U;(function(v){function C(S){return{uri:S}}v.create=C;function g(S){var m=S;return N.defined(m)&&N.string(m.uri)}v.is=g})(U||(r.TextDocumentIdentifier=U={}));var ce;(function(v){function C(S,m){return{uri:S,version:m}}v.create=C;function g(S){var m=S;return N.defined(m)&&N.string(m.uri)&&N.integer(m.version)}v.is=g})(ce||(r.VersionedTextDocumentIdentifier=ce={}));var Qe;(function(v){function C(S,m){return{uri:S,version:m}}v.create=C;function g(S){var m=S;return N.defined(m)&&N.string(m.uri)&&(m.version===null||N.integer(m.version))}v.is=g})(Qe||(r.OptionalVersionedTextDocumentIdentifier=Qe={}));var It;(function(v){function C(S,m,A,E){return{uri:S,languageId:m,version:A,text:E}}v.create=C;function g(S){var m=S;return N.defined(m)&&N.string(m.uri)&&N.string(m.languageId)&&N.integer(m.version)&&N.string(m.text)}v.is=g})(It||(r.TextDocumentItem=It={}));var Zt;(function(v){v.PlainText="plaintext",v.Markdown="markdown";function C(g){var S=g;return S===v.PlainText||S===v.Markdown}v.is=C})(Zt||(r.MarkupKind=Zt={}));var Be;(function(v){function C(g){var S=g;return N.objectLiteral(g)&&Zt.is(S.kind)&&N.string(S.value)}v.is=C})(Be||(r.MarkupContent=Be={}));var gn;(function(v){v.Text=1,v.Method=2,v.Function=3,v.Constructor=4,v.Field=5,v.Variable=6,v.Class=7,v.Interface=8,v.Module=9,v.Property=10,v.Unit=11,v.Value=12,v.Enum=13,v.Keyword=14,v.Snippet=15,v.Color=16,v.File=17,v.Reference=18,v.Folder=19,v.EnumMember=20,v.Constant=21,v.Struct=22,v.Event=23,v.Operator=24,v.TypeParameter=25})(gn||(r.CompletionItemKind=gn={}));var Fe;(function(v){v.PlainText=1,v.Snippet=2})(Fe||(r.InsertTextFormat=Fe={}));var nt;(function(v){v.Deprecated=1})(nt||(r.CompletionItemTag=nt={}));var dt;(function(v){function C(S,m,A){return{newText:S,insert:m,replace:A}}v.create=C;function g(S){var m=S;return m&&N.string(m.newText)&&l.is(m.insert)&&l.is(m.replace)}v.is=g})(dt||(r.InsertReplaceEdit=dt={}));var je;(function(v){v.asIs=1,v.adjustIndentation=2})(je||(r.InsertTextMode=je={}));var ft;(function(v){function C(g){var S=g;return S&&(N.string(S.detail)||S.detail===void 0)&&(N.string(S.description)||S.description===void 0)}v.is=C})(ft||(r.CompletionItemLabelDetails=ft={}));var Ke;(function(v){function C(g){return{label:g}}v.create=C})(Ke||(r.CompletionItem=Ke={}));var fe;(function(v){function C(g,S){return{items:g||[],isIncomplete:!!S}}v.create=C})(fe||(r.CompletionList=fe={}));var Ze;(function(v){function C(S){return S.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}v.fromPlainText=C;function g(S){var m=S;return N.string(m)||N.objectLiteral(m)&&N.string(m.language)&&N.string(m.value)}v.is=g})(Ze||(r.MarkedString=Ze={}));var Ne;(function(v){function C(g){var S=g;return!!S&&N.objectLiteral(S)&&(Be.is(S.contents)||Ze.is(S.contents)||N.typedArray(S.contents,Ze.is))&&(g.range===void 0||l.is(g.range))}v.is=C})(Ne||(r.Hover=Ne={}));var Pt;(function(v){function C(g,S){return S?{label:g,documentation:S}:{label:g}}v.create=C})(Pt||(r.ParameterInformation=Pt={}));var Ir;(function(v){function C(g,S){for(var m=[],A=2;A<arguments.length;A++)m[A-2]=arguments[A];var E={label:g};return N.defined(S)&&(E.documentation=S),N.defined(m)?E.parameters=m:E.parameters=[],E}v.create=C})(Ir||(r.SignatureInformation=Ir={}));var oi;(function(v){v.Text=1,v.Read=2,v.Write=3})(oi||(r.DocumentHighlightKind=oi={}));var ai;(function(v){function C(g,S){var m={range:g};return N.number(S)&&(m.kind=S),m}v.create=C})(ai||(r.DocumentHighlight=ai={}));var ci;(function(v){v.File=1,v.Module=2,v.Namespace=3,v.Package=4,v.Class=5,v.Method=6,v.Property=7,v.Field=8,v.Constructor=9,v.Enum=10,v.Interface=11,v.Function=12,v.Variable=13,v.Constant=14,v.String=15,v.Number=16,v.Boolean=17,v.Array=18,v.Object=19,v.Key=20,v.Null=21,v.EnumMember=22,v.Struct=23,v.Event=24,v.Operator=25,v.TypeParameter=26})(ci||(r.SymbolKind=ci={}));var li;(function(v){v.Deprecated=1})(li||(r.SymbolTag=li={}));var en;(function(v){function C(g,S,m,A,E){var L={name:g,kind:S,location:{uri:A,range:m}};return E&&(L.containerName=E),L}v.create=C})(en||(r.SymbolInformation=en={}));var ui;(function(v){function C(g,S,m,A){return A!==void 0?{name:g,kind:S,location:{uri:m,range:A}}:{name:g,kind:S,location:{uri:m}}}v.create=C})(ui||(r.WorkspaceSymbol=ui={}));var Zi;(function(v){function C(S,m,A,E,L,H){var K={name:S,detail:m,kind:A,range:E,selectionRange:L};return H!==void 0&&(K.children=H),K}v.create=C;function g(S){var m=S;return m&&N.string(m.name)&&N.number(m.kind)&&l.is(m.range)&&l.is(m.selectionRange)&&(m.detail===void 0||N.string(m.detail))&&(m.deprecated===void 0||N.boolean(m.deprecated))&&(m.children===void 0||Array.isArray(m.children))&&(m.tags===void 0||Array.isArray(m.tags))}v.is=g})(Zi||(r.DocumentSymbol=Zi={}));var es;(function(v){v.Empty="",v.QuickFix="quickfix",v.Refactor="refactor",v.RefactorExtract="refactor.extract",v.RefactorInline="refactor.inline",v.RefactorRewrite="refactor.rewrite",v.Source="source",v.SourceOrganizeImports="source.organizeImports",v.SourceFixAll="source.fixAll"})(es||(r.CodeActionKind=es={}));var Pr;(function(v){v.Invoked=1,v.Automatic=2})(Pr||(r.CodeActionTriggerKind=Pr={}));var ts;(function(v){function C(S,m,A){var E={diagnostics:S};return m!=null&&(E.only=m),A!=null&&(E.triggerKind=A),E}v.create=C;function g(S){var m=S;return N.defined(m)&&N.typedArray(m.diagnostics,x.is)&&(m.only===void 0||N.typedArray(m.only,N.string))&&(m.triggerKind===void 0||m.triggerKind===Pr.Invoked||m.triggerKind===Pr.Automatic)}v.is=g})(ts||(r.CodeActionContext=ts={}));var di;(function(v){function C(S,m,A){var E={title:S},L=!0;return typeof m=="string"?(L=!1,E.kind=m):F.is(m)?E.command=m:E.edit=m,L&&A!==void 0&&(E.kind=A),E}v.create=C;function g(S){var m=S;return m&&N.string(m.title)&&(m.diagnostics===void 0||N.typedArray(m.diagnostics,x.is))&&(m.kind===void 0||N.string(m.kind))&&(m.edit!==void 0||m.command!==void 0)&&(m.command===void 0||F.is(m.command))&&(m.isPreferred===void 0||N.boolean(m.isPreferred))&&(m.edit===void 0||q.is(m.edit))}v.is=g})(di||(r.CodeAction=di={}));var fi;(function(v){function C(S,m){var A={range:S};return N.defined(m)&&(A.data=m),A}v.create=C;function g(S){var m=S;return N.defined(m)&&l.is(m.range)&&(N.undefined(m.command)||F.is(m.command))}v.is=g})(fi||(r.CodeLens=fi={}));var Rn;(function(v){function C(S,m){return{tabSize:S,insertSpaces:m}}v.create=C;function g(S){var m=S;return N.defined(m)&&N.uinteger(m.tabSize)&&N.boolean(m.insertSpaces)}v.is=g})(Rn||(r.FormattingOptions=Rn={}));var hi;(function(v){function C(S,m,A){return{range:S,target:m,data:A}}v.create=C;function g(S){var m=S;return N.defined(m)&&l.is(m.range)&&(N.undefined(m.target)||N.string(m.target))}v.is=g})(hi||(r.DocumentLink=hi={}));var ns;(function(v){function C(S,m){return{range:S,parent:m}}v.create=C;function g(S){var m=S;return N.objectLiteral(m)&&l.is(m.range)&&(m.parent===void 0||v.is(m.parent))}v.is=g})(ns||(r.SelectionRange=ns={}));var rs;(function(v){v.namespace="namespace",v.type="type",v.class="class",v.enum="enum",v.interface="interface",v.struct="struct",v.typeParameter="typeParameter",v.parameter="parameter",v.variable="variable",v.property="property",v.enumMember="enumMember",v.event="event",v.function="function",v.method="method",v.macro="macro",v.keyword="keyword",v.modifier="modifier",v.comment="comment",v.string="string",v.number="number",v.regexp="regexp",v.operator="operator",v.decorator="decorator"})(rs||(r.SemanticTokenTypes=rs={}));var pi;(function(v){v.declaration="declaration",v.definition="definition",v.readonly="readonly",v.static="static",v.deprecated="deprecated",v.abstract="abstract",v.async="async",v.modification="modification",v.documentation="documentation",v.defaultLibrary="defaultLibrary"})(pi||(r.SemanticTokenModifiers=pi={}));var gi;(function(v){function C(g){var S=g;return N.objectLiteral(S)&&(S.resultId===void 0||typeof S.resultId=="string")&&Array.isArray(S.data)&&(S.data.length===0||typeof S.data[0]=="number")}v.is=C})(gi||(r.SemanticTokens=gi={}));var is;(function(v){function C(S,m){return{range:S,text:m}}v.create=C;function g(S){var m=S;return m!=null&&l.is(m.range)&&N.string(m.text)}v.is=g})(is||(r.InlineValueText=is={}));var ss;(function(v){function C(S,m,A){return{range:S,variableName:m,caseSensitiveLookup:A}}v.create=C;function g(S){var m=S;return m!=null&&l.is(m.range)&&N.boolean(m.caseSensitiveLookup)&&(N.string(m.variableName)||m.variableName===void 0)}v.is=g})(ss||(r.InlineValueVariableLookup=ss={}));var os;(function(v){function C(S,m){return{range:S,expression:m}}v.create=C;function g(S){var m=S;return m!=null&&l.is(m.range)&&(N.string(m.expression)||m.expression===void 0)}v.is=g})(os||(r.InlineValueEvaluatableExpression=os={}));var as;(function(v){function C(S,m){return{frameId:S,stoppedLocation:m}}v.create=C;function g(S){var m=S;return N.defined(m)&&l.is(S.stoppedLocation)}v.is=g})(as||(r.InlineValueContext=as={}));var mi;(function(v){v.Type=1,v.Parameter=2;function C(g){return g===1||g===2}v.is=C})(mi||(r.InlayHintKind=mi={}));var yi;(function(v){function C(S){return{value:S}}v.create=C;function g(S){var m=S;return N.objectLiteral(m)&&(m.tooltip===void 0||N.string(m.tooltip)||Be.is(m.tooltip))&&(m.location===void 0||u.is(m.location))&&(m.command===void 0||F.is(m.command))}v.is=g})(yi||(r.InlayHintLabelPart=yi={}));var tn;(function(v){function C(S,m,A){var E={position:S,label:m};return A!==void 0&&(E.kind=A),E}v.create=C;function g(S){var m=S;return N.objectLiteral(m)&&c.is(m.position)&&(N.string(m.label)||N.typedArray(m.label,yi.is))&&(m.kind===void 0||mi.is(m.kind))&&m.textEdits===void 0||N.typedArray(m.textEdits,P.is)&&(m.tooltip===void 0||N.string(m.tooltip)||Be.is(m.tooltip))&&(m.paddingLeft===void 0||N.boolean(m.paddingLeft))&&(m.paddingRight===void 0||N.boolean(m.paddingRight))}v.is=g})(tn||(r.InlayHint=tn={}));var cs;(function(v){function C(g){return{kind:"snippet",value:g}}v.createSnippet=C})(cs||(r.StringValue=cs={}));var ls;(function(v){function C(g,S,m,A){return{insertText:g,filterText:S,range:m,command:A}}v.create=C})(ls||(r.InlineCompletionItem=ls={}));var or;(function(v){function C(g){return{items:g}}v.create=C})(or||(r.InlineCompletionList=or={}));var us;(function(v){v.Invoked=0,v.Automatic=1})(us||(r.InlineCompletionTriggerKind=us={}));var xr;(function(v){function C(g,S){return{range:g,text:S}}v.create=C})(xr||(r.SelectedCompletionInfo=xr={}));var ds;(function(v){function C(g,S){return{triggerKind:g,selectedCompletionInfo:S}}v.create=C})(ds||(r.InlineCompletionContext=ds={}));var Sn;(function(v){function C(g){var S=g;return N.objectLiteral(S)&&s.is(S.uri)&&N.string(S.name)}v.is=C})(Sn||(r.WorkspaceFolder=Sn={})),r.EOL=[`
|
|
156
|
-
`,`\r
|
|
157
|
-
`,"\r"];var Gn;(function(v){function C(A,E,L,H){return new Qs(A,E,L,H)}v.create=C;function g(A){var E=A;return!!(N.defined(E)&&N.string(E.uri)&&(N.undefined(E.languageId)||N.string(E.languageId))&&N.uinteger(E.lineCount)&&N.func(E.getText)&&N.func(E.positionAt)&&N.func(E.offsetAt))}v.is=g;function S(A,E){for(var L=A.getText(),H=m(E,function(he,Oe){var Ce=he.range.start.line-Oe.range.start.line;return Ce===0?he.range.start.character-Oe.range.start.character:Ce}),K=L.length,ve=H.length-1;ve>=0;ve--){var ge=H[ve],_e=A.offsetAt(ge.range.start),ee=A.offsetAt(ge.range.end);if(ee<=K)L=L.substring(0,_e)+ge.newText+L.substring(ee,L.length);else throw new Error("Overlapping edit");K=_e}return L}v.applyEdits=S;function m(A,E){if(A.length<=1)return A;var L=A.length/2|0,H=A.slice(0,L),K=A.slice(L);m(H,E),m(K,E);for(var ve=0,ge=0,_e=0;ve<H.length&&ge<K.length;){var ee=E(H[ve],K[ge]);ee<=0?A[_e++]=H[ve++]:A[_e++]=K[ge++]}for(;ve<H.length;)A[_e++]=H[ve++];for(;ge<K.length;)A[_e++]=K[ge++];return A}})(Gn||(r.TextDocument=Gn={}));var Qs=function(){function v(C,g,S,m){this._uri=C,this._languageId=g,this._version=S,this._content=m,this._lineOffsets=void 0}return Object.defineProperty(v.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),v.prototype.getText=function(C){if(C){var g=this.offsetAt(C.start),S=this.offsetAt(C.end);return this._content.substring(g,S)}return this._content},v.prototype.update=function(C,g){this._content=C.text,this._version=g,this._lineOffsets=void 0},v.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var C=[],g=this._content,S=!0,m=0;m<g.length;m++){S&&(C.push(m),S=!1);var A=g.charAt(m);S=A==="\r"||A===`
|
|
158
|
-
`,A==="\r"&&m+1<g.length&&g.charAt(m+1)===`
|
|
159
|
-
`&&m++}S&&g.length>0&&C.push(g.length),this._lineOffsets=C}return this._lineOffsets},v.prototype.positionAt=function(C){C=Math.max(Math.min(C,this._content.length),0);var g=this.getLineOffsets(),S=0,m=g.length;if(m===0)return c.create(0,C);for(;S<m;){var A=Math.floor((S+m)/2);g[A]>C?m=A:S=A+1}var E=S-1;return c.create(E,C-g[E])},v.prototype.offsetAt=function(C){var g=this.getLineOffsets();if(C.line>=g.length)return this._content.length;if(C.line<0)return 0;var S=g[C.line],m=C.line+1<g.length?g[C.line+1]:this._content.length;return Math.max(Math.min(S+C.character,m),S)},Object.defineProperty(v.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),v}(),N;(function(v){var C=Object.prototype.toString;function g(ee){return typeof ee<"u"}v.defined=g;function S(ee){return typeof ee>"u"}v.undefined=S;function m(ee){return ee===!0||ee===!1}v.boolean=m;function A(ee){return C.call(ee)==="[object String]"}v.string=A;function E(ee){return C.call(ee)==="[object Number]"}v.number=E;function L(ee,he,Oe){return C.call(ee)==="[object Number]"&&he<=ee&&ee<=Oe}v.numberRange=L;function H(ee){return C.call(ee)==="[object Number]"&&-2147483648<=ee&&ee<=2147483647}v.integer=H;function K(ee){return C.call(ee)==="[object Number]"&&0<=ee&&ee<=2147483647}v.uinteger=K;function ve(ee){return C.call(ee)==="[object Function]"}v.func=ve;function ge(ee){return ee!==null&&typeof ee=="object"}v.objectLiteral=ge;function _e(ee,he){return Array.isArray(ee)&&ee.every(he)}v.typedArray=_e})(N||(N={}))})})(Qm,Qm.exports);var Zm=Qm.exports,be={};Object.defineProperty(be,"__esModule",{value:!0}),be.ProtocolNotificationType=be.ProtocolNotificationType0=be.ProtocolRequestType=be.ProtocolRequestType0=be.RegistrationType=be.MessageDirection=void 0;const _o=un;var K$;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(K$||(be.MessageDirection=K$={}));class Uq{constructor(e){this.method=e}}be.RegistrationType=Uq;class Bq extends _o.RequestType0{constructor(e){super(e)}}be.ProtocolRequestType0=Bq;class qq extends _o.RequestType{constructor(e){super(e,_o.ParameterStructures.byName)}}be.ProtocolRequestType=qq;class Wq extends _o.NotificationType0{constructor(e){super(e)}}be.ProtocolNotificationType0=Wq;class Gq extends _o.NotificationType{constructor(e){super(e,_o.ParameterStructures.byName)}}be.ProtocolNotificationType=Gq;var Y$={},ct={};Object.defineProperty(ct,"__esModule",{value:!0}),ct.objectLiteral=ct.typedArray=ct.stringArray=ct.array=ct.func=ct.error=ct.number=ct.string=ct.boolean=void 0;function zq(t){return t===!0||t===!1}ct.boolean=zq;function X$(t){return typeof t=="string"||t instanceof String}ct.string=X$;function Hq(t){return typeof t=="number"||t instanceof Number}ct.number=Hq;function Vq(t){return t instanceof Error}ct.error=Vq;function Kq(t){return typeof t=="function"}ct.func=Kq;function J$(t){return Array.isArray(t)}ct.array=J$;function Yq(t){return J$(t)&&t.every(e=>X$(e))}ct.stringArray=Yq;function Xq(t,e){return Array.isArray(t)&&t.every(e)}ct.typedArray=Xq;function Jq(t){return t!==null&&typeof t=="object"}ct.objectLiteral=Jq;var zd={};Object.defineProperty(zd,"__esModule",{value:!0}),zd.ImplementationRequest=void 0;const Q$=be;var Z$;(function(t){t.method="textDocument/implementation",t.messageDirection=Q$.MessageDirection.clientToServer,t.type=new Q$.ProtocolRequestType(t.method)})(Z$||(zd.ImplementationRequest=Z$={}));var Hd={};Object.defineProperty(Hd,"__esModule",{value:!0}),Hd.TypeDefinitionRequest=void 0;const ek=be;var tk;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=ek.MessageDirection.clientToServer,t.type=new ek.ProtocolRequestType(t.method)})(tk||(Hd.TypeDefinitionRequest=tk={}));var Co={};Object.defineProperty(Co,"__esModule",{value:!0}),Co.DidChangeWorkspaceFoldersNotification=Co.WorkspaceFoldersRequest=void 0;const Vd=be;var nk;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Vd.MessageDirection.serverToClient,t.type=new Vd.ProtocolRequestType0(t.method)})(nk||(Co.WorkspaceFoldersRequest=nk={}));var rk;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Vd.MessageDirection.clientToServer,t.type=new Vd.ProtocolNotificationType(t.method)})(rk||(Co.DidChangeWorkspaceFoldersNotification=rk={}));var Kd={};Object.defineProperty(Kd,"__esModule",{value:!0}),Kd.ConfigurationRequest=void 0;const ik=be;var sk;(function(t){t.method="workspace/configuration",t.messageDirection=ik.MessageDirection.serverToClient,t.type=new ik.ProtocolRequestType(t.method)})(sk||(Kd.ConfigurationRequest=sk={}));var Ao={};Object.defineProperty(Ao,"__esModule",{value:!0}),Ao.ColorPresentationRequest=Ao.DocumentColorRequest=void 0;const Yd=be;var ok;(function(t){t.method="textDocument/documentColor",t.messageDirection=Yd.MessageDirection.clientToServer,t.type=new Yd.ProtocolRequestType(t.method)})(ok||(Ao.DocumentColorRequest=ok={}));var ak;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Yd.MessageDirection.clientToServer,t.type=new Yd.ProtocolRequestType(t.method)})(ak||(Ao.ColorPresentationRequest=ak={}));var Io={};Object.defineProperty(Io,"__esModule",{value:!0}),Io.FoldingRangeRefreshRequest=Io.FoldingRangeRequest=void 0;const Xd=be;var ck;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Xd.MessageDirection.clientToServer,t.type=new Xd.ProtocolRequestType(t.method)})(ck||(Io.FoldingRangeRequest=ck={}));var lk;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Xd.MessageDirection.serverToClient,t.type=new Xd.ProtocolRequestType0(t.method)})(lk||(Io.FoldingRangeRefreshRequest=lk={}));var Jd={};Object.defineProperty(Jd,"__esModule",{value:!0}),Jd.DeclarationRequest=void 0;const uk=be;var dk;(function(t){t.method="textDocument/declaration",t.messageDirection=uk.MessageDirection.clientToServer,t.type=new uk.ProtocolRequestType(t.method)})(dk||(Jd.DeclarationRequest=dk={}));var Qd={};Object.defineProperty(Qd,"__esModule",{value:!0}),Qd.SelectionRangeRequest=void 0;const fk=be;var hk;(function(t){t.method="textDocument/selectionRange",t.messageDirection=fk.MessageDirection.clientToServer,t.type=new fk.ProtocolRequestType(t.method)})(hk||(Qd.SelectionRangeRequest=hk={}));var Ni={};Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.WorkDoneProgressCancelNotification=Ni.WorkDoneProgressCreateRequest=Ni.WorkDoneProgress=void 0;const Qq=un,Zd=be;var pk;(function(t){t.type=new Qq.ProgressType;function e(n){return n===t.type}t.is=e})(pk||(Ni.WorkDoneProgress=pk={}));var gk;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Zd.MessageDirection.serverToClient,t.type=new Zd.ProtocolRequestType(t.method)})(gk||(Ni.WorkDoneProgressCreateRequest=gk={}));var mk;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Zd.MessageDirection.clientToServer,t.type=new Zd.ProtocolNotificationType(t.method)})(mk||(Ni.WorkDoneProgressCancelNotification=mk={}));var Oi={};Object.defineProperty(Oi,"__esModule",{value:!0}),Oi.CallHierarchyOutgoingCallsRequest=Oi.CallHierarchyIncomingCallsRequest=Oi.CallHierarchyPrepareRequest=void 0;const Po=be;var yk;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Po.MessageDirection.clientToServer,t.type=new Po.ProtocolRequestType(t.method)})(yk||(Oi.CallHierarchyPrepareRequest=yk={}));var vk;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Po.MessageDirection.clientToServer,t.type=new Po.ProtocolRequestType(t.method)})(vk||(Oi.CallHierarchyIncomingCallsRequest=vk={}));var wk;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Po.MessageDirection.clientToServer,t.type=new Po.ProtocolRequestType(t.method)})(wk||(Oi.CallHierarchyOutgoingCallsRequest=wk={}));var dn={};Object.defineProperty(dn,"__esModule",{value:!0}),dn.SemanticTokensRefreshRequest=dn.SemanticTokensRangeRequest=dn.SemanticTokensDeltaRequest=dn.SemanticTokensRequest=dn.SemanticTokensRegistrationType=dn.TokenFormat=void 0;const ti=be;var bk;(function(t){t.Relative="relative"})(bk||(dn.TokenFormat=bk={}));var Ic;(function(t){t.method="textDocument/semanticTokens",t.type=new ti.RegistrationType(t.method)})(Ic||(dn.SemanticTokensRegistrationType=Ic={}));var Tk;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=ti.MessageDirection.clientToServer,t.type=new ti.ProtocolRequestType(t.method),t.registrationMethod=Ic.method})(Tk||(dn.SemanticTokensRequest=Tk={}));var Ek;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=ti.MessageDirection.clientToServer,t.type=new ti.ProtocolRequestType(t.method),t.registrationMethod=Ic.method})(Ek||(dn.SemanticTokensDeltaRequest=Ek={}));var Rk;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=ti.MessageDirection.clientToServer,t.type=new ti.ProtocolRequestType(t.method),t.registrationMethod=Ic.method})(Rk||(dn.SemanticTokensRangeRequest=Rk={}));var Sk;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=ti.MessageDirection.serverToClient,t.type=new ti.ProtocolRequestType0(t.method)})(Sk||(dn.SemanticTokensRefreshRequest=Sk={}));var ef={};Object.defineProperty(ef,"__esModule",{value:!0}),ef.ShowDocumentRequest=void 0;const $k=be;var kk;(function(t){t.method="window/showDocument",t.messageDirection=$k.MessageDirection.serverToClient,t.type=new $k.ProtocolRequestType(t.method)})(kk||(ef.ShowDocumentRequest=kk={}));var tf={};Object.defineProperty(tf,"__esModule",{value:!0}),tf.LinkedEditingRangeRequest=void 0;const _k=be;var Ck;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=_k.MessageDirection.clientToServer,t.type=new _k.ProtocolRequestType(t.method)})(Ck||(tf.LinkedEditingRangeRequest=Ck={}));var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.WillDeleteFilesRequest=Ft.DidDeleteFilesNotification=Ft.DidRenameFilesNotification=Ft.WillRenameFilesRequest=Ft.DidCreateFilesNotification=Ft.WillCreateFilesRequest=Ft.FileOperationPatternKind=void 0;const On=be;var Ak;(function(t){t.file="file",t.folder="folder"})(Ak||(Ft.FileOperationPatternKind=Ak={}));var Ik;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=On.MessageDirection.clientToServer,t.type=new On.ProtocolRequestType(t.method)})(Ik||(Ft.WillCreateFilesRequest=Ik={}));var Pk;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=On.MessageDirection.clientToServer,t.type=new On.ProtocolNotificationType(t.method)})(Pk||(Ft.DidCreateFilesNotification=Pk={}));var xk;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=On.MessageDirection.clientToServer,t.type=new On.ProtocolRequestType(t.method)})(xk||(Ft.WillRenameFilesRequest=xk={}));var Nk;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=On.MessageDirection.clientToServer,t.type=new On.ProtocolNotificationType(t.method)})(Nk||(Ft.DidRenameFilesNotification=Nk={}));var Ok;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=On.MessageDirection.clientToServer,t.type=new On.ProtocolNotificationType(t.method)})(Ok||(Ft.DidDeleteFilesNotification=Ok={}));var Dk;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=On.MessageDirection.clientToServer,t.type=new On.ProtocolRequestType(t.method)})(Dk||(Ft.WillDeleteFilesRequest=Dk={}));var Di={};Object.defineProperty(Di,"__esModule",{value:!0}),Di.MonikerRequest=Di.MonikerKind=Di.UniquenessLevel=void 0;const Lk=be;var Mk;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(Mk||(Di.UniquenessLevel=Mk={}));var Fk;(function(t){t.$import="import",t.$export="export",t.local="local"})(Fk||(Di.MonikerKind=Fk={}));var jk;(function(t){t.method="textDocument/moniker",t.messageDirection=Lk.MessageDirection.clientToServer,t.type=new Lk.ProtocolRequestType(t.method)})(jk||(Di.MonikerRequest=jk={}));var Li={};Object.defineProperty(Li,"__esModule",{value:!0}),Li.TypeHierarchySubtypesRequest=Li.TypeHierarchySupertypesRequest=Li.TypeHierarchyPrepareRequest=void 0;const xo=be;var Uk;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=xo.MessageDirection.clientToServer,t.type=new xo.ProtocolRequestType(t.method)})(Uk||(Li.TypeHierarchyPrepareRequest=Uk={}));var Bk;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=xo.MessageDirection.clientToServer,t.type=new xo.ProtocolRequestType(t.method)})(Bk||(Li.TypeHierarchySupertypesRequest=Bk={}));var qk;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=xo.MessageDirection.clientToServer,t.type=new xo.ProtocolRequestType(t.method)})(qk||(Li.TypeHierarchySubtypesRequest=qk={}));var No={};Object.defineProperty(No,"__esModule",{value:!0}),No.InlineValueRefreshRequest=No.InlineValueRequest=void 0;const nf=be;var Wk;(function(t){t.method="textDocument/inlineValue",t.messageDirection=nf.MessageDirection.clientToServer,t.type=new nf.ProtocolRequestType(t.method)})(Wk||(No.InlineValueRequest=Wk={}));var Gk;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=nf.MessageDirection.serverToClient,t.type=new nf.ProtocolRequestType0(t.method)})(Gk||(No.InlineValueRefreshRequest=Gk={}));var Mi={};Object.defineProperty(Mi,"__esModule",{value:!0}),Mi.InlayHintRefreshRequest=Mi.InlayHintResolveRequest=Mi.InlayHintRequest=void 0;const Oo=be;var zk;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Oo.MessageDirection.clientToServer,t.type=new Oo.ProtocolRequestType(t.method)})(zk||(Mi.InlayHintRequest=zk={}));var Hk;(function(t){t.method="inlayHint/resolve",t.messageDirection=Oo.MessageDirection.clientToServer,t.type=new Oo.ProtocolRequestType(t.method)})(Hk||(Mi.InlayHintResolveRequest=Hk={}));var Vk;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Oo.MessageDirection.serverToClient,t.type=new Oo.ProtocolRequestType0(t.method)})(Vk||(Mi.InlayHintRefreshRequest=Vk={}));var Dn={};Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.DiagnosticRefreshRequest=Dn.WorkspaceDiagnosticRequest=Dn.DocumentDiagnosticRequest=Dn.DocumentDiagnosticReportKind=Dn.DiagnosticServerCancellationData=void 0;const Kk=un,Zq=ct,Do=be;var Yk;(function(t){function e(n){const r=n;return r&&Zq.boolean(r.retriggerRequest)}t.is=e})(Yk||(Dn.DiagnosticServerCancellationData=Yk={}));var Xk;(function(t){t.Full="full",t.Unchanged="unchanged"})(Xk||(Dn.DocumentDiagnosticReportKind=Xk={}));var Jk;(function(t){t.method="textDocument/diagnostic",t.messageDirection=Do.MessageDirection.clientToServer,t.type=new Do.ProtocolRequestType(t.method),t.partialResult=new Kk.ProgressType})(Jk||(Dn.DocumentDiagnosticRequest=Jk={}));var Qk;(function(t){t.method="workspace/diagnostic",t.messageDirection=Do.MessageDirection.clientToServer,t.type=new Do.ProtocolRequestType(t.method),t.partialResult=new Kk.ProgressType})(Qk||(Dn.WorkspaceDiagnosticRequest=Qk={}));var Zk;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=Do.MessageDirection.serverToClient,t.type=new Do.ProtocolRequestType0(t.method)})(Zk||(Dn.DiagnosticRefreshRequest=Zk={}));var lt={};Object.defineProperty(lt,"__esModule",{value:!0}),lt.DidCloseNotebookDocumentNotification=lt.DidSaveNotebookDocumentNotification=lt.DidChangeNotebookDocumentNotification=lt.NotebookCellArrayChange=lt.DidOpenNotebookDocumentNotification=lt.NotebookDocumentSyncRegistrationType=lt.NotebookDocument=lt.NotebookCell=lt.ExecutionSummary=lt.NotebookCellKind=void 0;const Pc=Zm,Zn=ct,Rr=be;var ey;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(ey||(lt.NotebookCellKind=ey={}));var ty;(function(t){function e(i,s){const o={executionOrder:i};return(s===!0||s===!1)&&(o.success=s),o}t.create=e;function n(i){const s=i;return Zn.objectLiteral(s)&&Pc.uinteger.is(s.executionOrder)&&(s.success===void 0||Zn.boolean(s.success))}t.is=n;function r(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=r})(ty||(lt.ExecutionSummary=ty={}));var rf;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function n(s){const o=s;return Zn.objectLiteral(o)&&ey.is(o.kind)&&Pc.DocumentUri.is(o.document)&&(o.metadata===void 0||Zn.objectLiteral(o.metadata))}t.is=n;function r(s,o){const a=new Set;return s.document!==o.document&&a.add("document"),s.kind!==o.kind&&a.add("kind"),s.executionSummary!==o.executionSummary&&a.add("executionSummary"),(s.metadata!==void 0||o.metadata!==void 0)&&!i(s.metadata,o.metadata)&&a.add("metadata"),(s.executionSummary!==void 0||o.executionSummary!==void 0)&&!ty.equals(s.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}t.diff=r;function i(s,o){if(s===o)return!0;if(s==null||o===null||o===void 0||typeof s!=typeof o||typeof s!="object")return!1;const a=Array.isArray(s),c=Array.isArray(o);if(a!==c)return!1;if(a&&c){if(s.length!==o.length)return!1;for(let l=0;l<s.length;l++)if(!i(s[l],o[l]))return!1}if(Zn.objectLiteral(s)&&Zn.objectLiteral(o)){const l=Object.keys(s),u=Object.keys(o);if(l.length!==u.length||(l.sort(),u.sort(),!i(l,u)))return!1;for(let d=0;d<l.length;d++){const f=l[d];if(!i(s[f],o[f]))return!1}}return!0}})(rf||(lt.NotebookCell=rf={}));var e1;(function(t){function e(r,i,s,o){return{uri:r,notebookType:i,version:s,cells:o}}t.create=e;function n(r){const i=r;return Zn.objectLiteral(i)&&Zn.string(i.uri)&&Pc.integer.is(i.version)&&Zn.typedArray(i.cells,rf.is)}t.is=n})(e1||(lt.NotebookDocument=e1={}));var Lo;(function(t){t.method="notebookDocument/sync",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.RegistrationType(t.method)})(Lo||(lt.NotebookDocumentSyncRegistrationType=Lo={}));var t1;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method),t.registrationMethod=Lo.method})(t1||(lt.DidOpenNotebookDocumentNotification=t1={}));var n1;(function(t){function e(r){const i=r;return Zn.objectLiteral(i)&&Pc.uinteger.is(i.start)&&Pc.uinteger.is(i.deleteCount)&&(i.cells===void 0||Zn.typedArray(i.cells,rf.is))}t.is=e;function n(r,i,s){const o={start:r,deleteCount:i};return s!==void 0&&(o.cells=s),o}t.create=n})(n1||(lt.NotebookCellArrayChange=n1={}));var r1;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method),t.registrationMethod=Lo.method})(r1||(lt.DidChangeNotebookDocumentNotification=r1={}));var i1;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method),t.registrationMethod=Lo.method})(i1||(lt.DidSaveNotebookDocumentNotification=i1={}));var s1;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method),t.registrationMethod=Lo.method})(s1||(lt.DidCloseNotebookDocumentNotification=s1={}));var sf={};Object.defineProperty(sf,"__esModule",{value:!0}),sf.InlineCompletionRequest=void 0;const o1=be;var a1;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=o1.MessageDirection.clientToServer,t.type=new o1.ProtocolRequestType(t.method)})(a1||(sf.InlineCompletionRequest=a1={})),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=be,n=Zm,r=ct,i=zd;Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const s=Hd;Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return s.TypeDefinitionRequest}});const o=Co;Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return o.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return o.DidChangeWorkspaceFoldersNotification}});const a=Kd;Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return a.ConfigurationRequest}});const c=Ao;Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return c.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return c.ColorPresentationRequest}});const l=Io;Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return l.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return l.FoldingRangeRefreshRequest}});const u=Jd;Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return u.DeclarationRequest}});const d=Qd;Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return d.SelectionRangeRequest}});const f=Ni;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=Oi;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=dn;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 y=ef;Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return y.ShowDocumentRequest}});const $=tf;Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return $.LinkedEditingRangeRequest}});const T=Ft;Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return T.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return T.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return T.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return T.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return T.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return T.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return T.WillDeleteFilesRequest}});const w=Di;Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return w.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return w.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return w.MonikerRequest}});const b=Li;Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return b.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return b.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return b.TypeHierarchySupertypesRequest}});const _=No;Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return _.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return _.InlineValueRefreshRequest}});const x=Mi;Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return x.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return x.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return x.InlayHintRefreshRequest}});const F=Dn;Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return F.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return F.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return F.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return F.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return F.DiagnosticRefreshRequest}});const P=lt;Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return P.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return P.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return P.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return P.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return P.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return P.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return P.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return P.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return P.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return P.DidCloseNotebookDocumentNotification}});const G=sf;Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return G.InlineCompletionRequest}});var B;(function(g){function S(m){const A=m;return r.string(A)||r.string(A.language)||r.string(A.scheme)||r.string(A.pattern)}g.is=S})(B||(t.TextDocumentFilter=B={}));var W;(function(g){function S(m){const A=m;return r.objectLiteral(A)&&(r.string(A.notebookType)||r.string(A.scheme)||r.string(A.pattern))}g.is=S})(W||(t.NotebookDocumentFilter=W={}));var I;(function(g){function S(m){const A=m;return r.objectLiteral(A)&&(r.string(A.notebook)||W.is(A.notebook))&&(A.language===void 0||r.string(A.language))}g.is=S})(I||(t.NotebookCellTextDocumentFilter=I={}));var k;(function(g){function S(m){if(!Array.isArray(m))return!1;for(let A of m)if(!r.string(A)&&!B.is(A)&&!I.is(A))return!1;return!0}g.is=S})(k||(t.DocumentSelector=k={}));var R;(function(g){g.method="client/registerCapability",g.messageDirection=e.MessageDirection.serverToClient,g.type=new e.ProtocolRequestType(g.method)})(R||(t.RegistrationRequest=R={}));var M;(function(g){g.method="client/unregisterCapability",g.messageDirection=e.MessageDirection.serverToClient,g.type=new e.ProtocolRequestType(g.method)})(M||(t.UnregistrationRequest=M={}));var q;(function(g){g.Create="create",g.Rename="rename",g.Delete="delete"})(q||(t.ResourceOperationKind=q={}));var j;(function(g){g.Abort="abort",g.Transactional="transactional",g.TextOnlyTransactional="textOnlyTransactional",g.Undo="undo"})(j||(t.FailureHandlingKind=j={}));var z;(function(g){g.UTF8="utf-8",g.UTF16="utf-16",g.UTF32="utf-32"})(z||(t.PositionEncodingKind=z={}));var J;(function(g){function S(m){const A=m;return A&&r.string(A.id)&&A.id.length>0}g.hasId=S})(J||(t.StaticRegistrationOptions=J={}));var U;(function(g){function S(m){const A=m;return A&&(A.documentSelector===null||k.is(A.documentSelector))}g.is=S})(U||(t.TextDocumentRegistrationOptions=U={}));var ce;(function(g){function S(A){const E=A;return r.objectLiteral(E)&&(E.workDoneProgress===void 0||r.boolean(E.workDoneProgress))}g.is=S;function m(A){const E=A;return E&&r.boolean(E.workDoneProgress)}g.hasWorkDoneProgress=m})(ce||(t.WorkDoneProgressOptions=ce={}));var Qe;(function(g){g.method="initialize",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(Qe||(t.InitializeRequest=Qe={}));var It;(function(g){g.unknownProtocolVersion=1})(It||(t.InitializeErrorCodes=It={}));var Zt;(function(g){g.method="initialized",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolNotificationType(g.method)})(Zt||(t.InitializedNotification=Zt={}));var Be;(function(g){g.method="shutdown",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType0(g.method)})(Be||(t.ShutdownRequest=Be={}));var gn;(function(g){g.method="exit",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolNotificationType0(g.method)})(gn||(t.ExitNotification=gn={}));var Fe;(function(g){g.method="workspace/didChangeConfiguration",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolNotificationType(g.method)})(Fe||(t.DidChangeConfigurationNotification=Fe={}));var nt;(function(g){g.Error=1,g.Warning=2,g.Info=3,g.Log=4,g.Debug=5})(nt||(t.MessageType=nt={}));var dt;(function(g){g.method="window/showMessage",g.messageDirection=e.MessageDirection.serverToClient,g.type=new e.ProtocolNotificationType(g.method)})(dt||(t.ShowMessageNotification=dt={}));var je;(function(g){g.method="window/showMessageRequest",g.messageDirection=e.MessageDirection.serverToClient,g.type=new e.ProtocolRequestType(g.method)})(je||(t.ShowMessageRequest=je={}));var ft;(function(g){g.method="window/logMessage",g.messageDirection=e.MessageDirection.serverToClient,g.type=new e.ProtocolNotificationType(g.method)})(ft||(t.LogMessageNotification=ft={}));var Ke;(function(g){g.method="telemetry/event",g.messageDirection=e.MessageDirection.serverToClient,g.type=new e.ProtocolNotificationType(g.method)})(Ke||(t.TelemetryEventNotification=Ke={}));var fe;(function(g){g.None=0,g.Full=1,g.Incremental=2})(fe||(t.TextDocumentSyncKind=fe={}));var Ze;(function(g){g.method="textDocument/didOpen",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolNotificationType(g.method)})(Ze||(t.DidOpenTextDocumentNotification=Ze={}));var Ne;(function(g){function S(A){let E=A;return E!=null&&typeof E.text=="string"&&E.range!==void 0&&(E.rangeLength===void 0||typeof E.rangeLength=="number")}g.isIncremental=S;function m(A){let E=A;return E!=null&&typeof E.text=="string"&&E.range===void 0&&E.rangeLength===void 0}g.isFull=m})(Ne||(t.TextDocumentContentChangeEvent=Ne={}));var Pt;(function(g){g.method="textDocument/didChange",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolNotificationType(g.method)})(Pt||(t.DidChangeTextDocumentNotification=Pt={}));var Ir;(function(g){g.method="textDocument/didClose",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolNotificationType(g.method)})(Ir||(t.DidCloseTextDocumentNotification=Ir={}));var oi;(function(g){g.method="textDocument/didSave",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolNotificationType(g.method)})(oi||(t.DidSaveTextDocumentNotification=oi={}));var ai;(function(g){g.Manual=1,g.AfterDelay=2,g.FocusOut=3})(ai||(t.TextDocumentSaveReason=ai={}));var ci;(function(g){g.method="textDocument/willSave",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolNotificationType(g.method)})(ci||(t.WillSaveTextDocumentNotification=ci={}));var li;(function(g){g.method="textDocument/willSaveWaitUntil",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(li||(t.WillSaveTextDocumentWaitUntilRequest=li={}));var en;(function(g){g.method="workspace/didChangeWatchedFiles",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolNotificationType(g.method)})(en||(t.DidChangeWatchedFilesNotification=en={}));var ui;(function(g){g.Created=1,g.Changed=2,g.Deleted=3})(ui||(t.FileChangeType=ui={}));var Zi;(function(g){function S(m){const A=m;return r.objectLiteral(A)&&(n.URI.is(A.baseUri)||n.WorkspaceFolder.is(A.baseUri))&&r.string(A.pattern)}g.is=S})(Zi||(t.RelativePattern=Zi={}));var es;(function(g){g.Create=1,g.Change=2,g.Delete=4})(es||(t.WatchKind=es={}));var Pr;(function(g){g.method="textDocument/publishDiagnostics",g.messageDirection=e.MessageDirection.serverToClient,g.type=new e.ProtocolNotificationType(g.method)})(Pr||(t.PublishDiagnosticsNotification=Pr={}));var ts;(function(g){g.Invoked=1,g.TriggerCharacter=2,g.TriggerForIncompleteCompletions=3})(ts||(t.CompletionTriggerKind=ts={}));var di;(function(g){g.method="textDocument/completion",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(di||(t.CompletionRequest=di={}));var fi;(function(g){g.method="completionItem/resolve",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(fi||(t.CompletionResolveRequest=fi={}));var Rn;(function(g){g.method="textDocument/hover",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(Rn||(t.HoverRequest=Rn={}));var hi;(function(g){g.Invoked=1,g.TriggerCharacter=2,g.ContentChange=3})(hi||(t.SignatureHelpTriggerKind=hi={}));var ns;(function(g){g.method="textDocument/signatureHelp",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(ns||(t.SignatureHelpRequest=ns={}));var rs;(function(g){g.method="textDocument/definition",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(rs||(t.DefinitionRequest=rs={}));var pi;(function(g){g.method="textDocument/references",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(pi||(t.ReferencesRequest=pi={}));var gi;(function(g){g.method="textDocument/documentHighlight",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(gi||(t.DocumentHighlightRequest=gi={}));var is;(function(g){g.method="textDocument/documentSymbol",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(is||(t.DocumentSymbolRequest=is={}));var ss;(function(g){g.method="textDocument/codeAction",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(ss||(t.CodeActionRequest=ss={}));var os;(function(g){g.method="codeAction/resolve",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(os||(t.CodeActionResolveRequest=os={}));var as;(function(g){g.method="workspace/symbol",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(as||(t.WorkspaceSymbolRequest=as={}));var mi;(function(g){g.method="workspaceSymbol/resolve",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(mi||(t.WorkspaceSymbolResolveRequest=mi={}));var yi;(function(g){g.method="textDocument/codeLens",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(yi||(t.CodeLensRequest=yi={}));var tn;(function(g){g.method="codeLens/resolve",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(tn||(t.CodeLensResolveRequest=tn={}));var cs;(function(g){g.method="workspace/codeLens/refresh",g.messageDirection=e.MessageDirection.serverToClient,g.type=new e.ProtocolRequestType0(g.method)})(cs||(t.CodeLensRefreshRequest=cs={}));var ls;(function(g){g.method="textDocument/documentLink",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(ls||(t.DocumentLinkRequest=ls={}));var or;(function(g){g.method="documentLink/resolve",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(or||(t.DocumentLinkResolveRequest=or={}));var us;(function(g){g.method="textDocument/formatting",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(us||(t.DocumentFormattingRequest=us={}));var xr;(function(g){g.method="textDocument/rangeFormatting",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(xr||(t.DocumentRangeFormattingRequest=xr={}));var ds;(function(g){g.method="textDocument/rangesFormatting",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(ds||(t.DocumentRangesFormattingRequest=ds={}));var Sn;(function(g){g.method="textDocument/onTypeFormatting",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(Sn||(t.DocumentOnTypeFormattingRequest=Sn={}));var Gn;(function(g){g.Identifier=1})(Gn||(t.PrepareSupportDefaultBehavior=Gn={}));var Qs;(function(g){g.method="textDocument/rename",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(Qs||(t.RenameRequest=Qs={}));var N;(function(g){g.method="textDocument/prepareRename",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(N||(t.PrepareRenameRequest=N={}));var v;(function(g){g.method="workspace/executeCommand",g.messageDirection=e.MessageDirection.clientToServer,g.type=new e.ProtocolRequestType(g.method)})(v||(t.ExecuteCommandRequest=v={}));var C;(function(g){g.method="workspace/applyEdit",g.messageDirection=e.MessageDirection.serverToClient,g.type=new e.ProtocolRequestType("workspace/applyEdit")})(C||(t.ApplyWorkspaceEditRequest=C={}))}(Y$);var of={};Object.defineProperty(of,"__esModule",{value:!0}),of.createProtocolConnection=void 0;const c1=un;function e6(t,e,n,r){return c1.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,c1.createMessageConnection)(t,e,n,r)}of.createProtocolConnection=e6,function(t){var e=ut&&ut.__createBinding||(Object.create?function(s,o,a,c){c===void 0&&(c=a);var l=Object.getOwnPropertyDescriptor(o,a);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(s,c,l)}:function(s,o,a,c){c===void 0&&(c=a),s[c]=o[a]}),n=ut&&ut.__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(un,t),n(Zm,t),n(be,t),n(Y$,t);var r=of;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={}))}(V$),function(t){var e=ut&&ut.__createBinding||(Object.create?function(s,o,a,c){c===void 0&&(c=a);var l=Object.getOwnPropertyDescriptor(o,a);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(s,c,l)}:function(s,o,a,c){c===void 0&&(c=a),s[c]=o[a]}),n=ut&&ut.__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=H$;n(H$,t),n(V$,t);function i(s,o,a,c){return(0,r.createMessageConnection)(s,o,a,c)}t.createProtocolConnection=i}(He);var Tn={};Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.generateUuid=Tn.parse=Tn.isUUID=Tn.v4=Tn.empty=void 0;class ny{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class ye extends ny{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return ye._oneOf(ye._chars)}constructor(){super([ye._randomHex(),ye._randomHex(),ye._randomHex(),ye._randomHex(),ye._randomHex(),ye._randomHex(),ye._randomHex(),ye._randomHex(),"-",ye._randomHex(),ye._randomHex(),ye._randomHex(),ye._randomHex(),"-","4",ye._randomHex(),ye._randomHex(),ye._randomHex(),"-",ye._oneOf(ye._timeHighBits),ye._randomHex(),ye._randomHex(),ye._randomHex(),"-",ye._randomHex(),ye._randomHex(),ye._randomHex(),ye._randomHex(),ye._randomHex(),ye._randomHex(),ye._randomHex(),ye._randomHex(),ye._randomHex(),ye._randomHex(),ye._randomHex(),ye._randomHex()].join(""))}}ye._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"],ye._timeHighBits=["8","9","a","b"],Tn.empty=new ny("00000000-0000-0000-0000-000000000000");function l1(){return new ye}Tn.v4=l1;const t6=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function u1(t){return t6.test(t)}Tn.isUUID=u1;function n6(t){if(!u1(t))throw new Error("invalid uuid");return new ny(t)}Tn.parse=n6;function r6(){return l1().asHex()}Tn.generateUuid=r6;var Fi={};Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.attachPartialResult=Fi.ProgressFeature=Fi.attachWorkDone=void 0;const ji=He,i6=Tn;class Qi{constructor(e,n){this._connection=e,this._token=n,Qi.Instances.set(this._token,this)}begin(e,n,r,i){let s={kind:"begin",title:e,percentage:n,message:r,cancellable:i};this._connection.sendProgress(ji.WorkDoneProgress.type,this._token,s)}report(e,n){let r={kind:"report"};typeof e=="number"?(r.percentage=e,n!==void 0&&(r.message=n)):r.message=e,this._connection.sendProgress(ji.WorkDoneProgress.type,this._token,r)}done(){Qi.Instances.delete(this._token),this._connection.sendProgress(ji.WorkDoneProgress.type,this._token,{kind:"end"})}}Qi.Instances=new Map;class d1 extends Qi{constructor(e,n){super(e,n),this._source=new ji.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}}class ry{constructor(){}begin(){}report(){}done(){}}class f1 extends ry{constructor(){super(),this._source=new ji.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}}function s6(t,e){if(e===void 0||e.workDoneToken===void 0)return new ry;const n=e.workDoneToken;return delete e.workDoneToken,new Qi(t,n)}Fi.attachWorkDone=s6;const o6=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(ji.WorkDoneProgressCancelNotification.type,n=>{let r=Qi.Instances.get(n.token);(r instanceof d1||r instanceof f1)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new ry:new Qi(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){const e=(0,i6.generateUuid)();return this.connection.sendRequest(ji.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new d1(this.connection,e))}else return Promise.resolve(new f1)}};Fi.ProgressFeature=o6;var iy;(function(t){t.type=new ji.ProgressType})(iy||(iy={}));class a6{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(iy.type,this._token,e)}}function c6(t,e){if(e===void 0||e.partialResultToken===void 0)return;const n=e.partialResultToken;return delete e.partialResultToken,new a6(t,n)}Fi.attachPartialResult=c6;var af={};Object.defineProperty(af,"__esModule",{value:!0}),af.ConfigurationFeature=void 0;const l6=He,u6=at,d6=t=>class extends t{getConfiguration(e){return e?u6.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let n={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(l6.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};af.ConfigurationFeature=d6;var cf={};Object.defineProperty(cf,"__esModule",{value:!0}),cf.WorkspaceFoldersFeature=void 0;const lf=He,f6=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new lf.Emitter,this.connection.onNotification(lf.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);const n=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=n===!0||typeof n=="string"}getWorkspaceFolders(){return this.connection.sendRequest(lf.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(lf.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};cf.WorkspaceFoldersFeature=f6;var uf={};Object.defineProperty(uf,"__esModule",{value:!0}),uf.CallHierarchyFeature=void 0;const sy=He,h6=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(sy.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{const n=sy.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{const n=sy.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};uf.CallHierarchyFeature=h6;var ni={};Object.defineProperty(ni,"__esModule",{value:!0}),ni.SemanticTokensBuilder=ni.SemanticTokensDiff=ni.SemanticTokensFeature=void 0;const df=He,p6=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(df.SemanticTokensRefreshRequest.type),on:e=>{const n=df.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{const n=df.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{const n=df.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};ni.SemanticTokensFeature=p6;class h1{constructor(e,n){this.originalSequence=e,this.modifiedSequence=n}computeDiff(){const e=this.originalSequence.length,n=this.modifiedSequence.length;let r=0;for(;r<n&&r<e&&this.originalSequence[r]===this.modifiedSequence[r];)r++;if(r<n&&r<e){let i=e-1,s=n-1;for(;i>=r&&s>=r&&this.originalSequence[i]===this.modifiedSequence[s];)i--,s--;(i<r||s<r)&&(i++,s++);const o=i-r+1,a=this.modifiedSequence.slice(r,s+1);return a.length===1&&a[0]===this.originalSequence[i]?[{start:r,deleteCount:o-1}]:[{start:r,deleteCount:o,data:a}]}else return r<n?[{start:r,deleteCount:0,data:this.modifiedSequence.slice(r)}]:r<e?[{start:r,deleteCount:e-r}]:[]}}ni.SemanticTokensDiff=h1;let g6=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,n,r,i,s){let o=e,a=n;this._dataLen>0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=n}get id(){return this._id.toString()}previousResult(e){this.id===e&&(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 h1(this._prevData,this._data).computeDiff()}:this.build()}};ni.SemanticTokensBuilder=g6;var ff={};Object.defineProperty(ff,"__esModule",{value:!0}),ff.ShowDocumentFeature=void 0;const m6=He,y6=t=>class extends t{showDocument(e){return this.connection.sendRequest(m6.ShowDocumentRequest.type,e)}};ff.ShowDocumentFeature=y6;var hf={};Object.defineProperty(hf,"__esModule",{value:!0}),hf.FileOperationsFeature=void 0;const Mo=He,v6=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Mo.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(Mo.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(Mo.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(Mo.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(Mo.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(Mo.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};hf.FileOperationsFeature=v6;var pf={};Object.defineProperty(pf,"__esModule",{value:!0}),pf.LinkedEditingRangeFeature=void 0;const w6=He,b6=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(w6.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};pf.LinkedEditingRangeFeature=b6;var gf={};Object.defineProperty(gf,"__esModule",{value:!0}),gf.TypeHierarchyFeature=void 0;const oy=He,T6=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(oy.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{const n=oy.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{const n=oy.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};gf.TypeHierarchyFeature=T6;var mf={};Object.defineProperty(mf,"__esModule",{value:!0}),mf.InlineValueFeature=void 0;const p1=He,E6=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(p1.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(p1.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};mf.InlineValueFeature=E6;var yf={};Object.defineProperty(yf,"__esModule",{value:!0}),yf.FoldingRangeFeature=void 0;const g1=He,R6=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(g1.FoldingRangeRefreshRequest.type),on:e=>{const n=g1.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};yf.FoldingRangeFeature=R6;var vf={};Object.defineProperty(vf,"__esModule",{value:!0}),vf.InlayHintFeature=void 0;const ay=He,S6=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(ay.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(ay.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(ay.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};vf.InlayHintFeature=S6;var wf={};Object.defineProperty(wf,"__esModule",{value:!0}),wf.DiagnosticFeature=void 0;const xc=He,$6=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(xc.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(xc.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(xc.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(xc.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(xc.WorkspaceDiagnosticRequest.partialResult,n)))}}};wf.DiagnosticFeature=$6;var Is={},Nc={};Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.TextDocuments=void 0;const Ps=He;class k6{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Ps.Emitter,this._onDidOpen=new Ps.Emitter,this._onDidClose=new Ps.Emitter,this._onDidSave=new Ps.Emitter,this._onWillSave=new Ps.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(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=Ps.TextDocumentSyncKind.Incremental;const n=[];return n.push(e.onDidOpenTextDocument(r=>{const i=r.textDocument,s=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,s);const o=Object.freeze({document:s});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),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`);let a=this._syncedDocuments.get(i.uri);a!==void 0&&(a=this._configuration.update(a,s,o),this._syncedDocuments.set(i.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),n.push(e.onDidCloseTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(r.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),n.push(e.onWillSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,i)=>{let s=this._syncedDocuments.get(r.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:r.reason}),i):[]})),n.push(e.onDidSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),Ps.Disposable.create(()=>{n.forEach(r=>r.dispose())})}}Nc.TextDocuments=k6,Object.defineProperty(Is,"__esModule",{value:!0}),Is.NotebookDocuments=Is.NotebookSyncFeature=void 0;const Ln=He,m1=Nc,_6=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Ln.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Ln.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Ln.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Ln.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};Is.NotebookSyncFeature=_6;class ua{onDidOpenTextDocument(e){return this.openHandler=e,Ln.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Ln.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Ln.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return ua.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return ua.NULL_DISPOSE}onDidSaveTextDocument(){return ua.NULL_DISPOSE}}ua.NULL_DISPOSE=Object.freeze({dispose:()=>{}});class C6{constructor(e){e instanceof m1.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new m1.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Ln.Emitter,this._onDidChange=new Ln.Emitter,this._onDidSave=new Ln.Emitter,this._onDidClose=new Ln.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){const n=this.notebookCellMap.get(e);return n&&n[0]}findNotebookDocumentForCell(e){const n=typeof e=="string"?e:e.document,r=this.notebookCellMap.get(n);return r&&r[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(e){const n=new ua,r=[];return r.push(this.cellTextDocuments.listen(n)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(const s of i.cellTextDocuments)n.openTextDocument({textDocument:s});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),r.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{const s=this.notebookDocuments.get(i.notebookDocument.uri);if(s===void 0)return;s.version=i.notebookDocument.version;const o=s.metadata;let a=!1;const c=i.change;c.metadata!==void 0&&(a=!0,s.metadata=c.metadata);const l=[],u=[],d=[],f=[];if(c.cells!==void 0){const T=c.cells;if(T.structure!==void 0){const w=T.structure.array;if(s.cells.splice(w.start,w.deleteCount,...w.cells!==void 0?w.cells:[]),T.structure.didOpen!==void 0)for(const b of T.structure.didOpen)n.openTextDocument({textDocument:b}),l.push(b.uri);if(T.structure.didClose)for(const b of T.structure.didClose)n.closeTextDocument({textDocument:b}),u.push(b.uri)}if(T.data!==void 0){const w=new Map(T.data.map(b=>[b.document,b]));for(let b=0;b<=s.cells.length;b++){const _=w.get(s.cells[b].document);if(_!==void 0){const x=s.cells.splice(b,1,_);if(d.push({old:x[0],new:_}),w.delete(_.document),w.size===0)break}}}if(T.textContent!==void 0)for(const w of T.textContent)n.changeTextDocument({textDocument:w.document,contentChanges:w.changes}),f.push(w.document.uri)}this.updateCellMap(s);const h={notebookDocument:s};a&&(h.metadata={old:o,new:s.metadata});const p=[];for(const T of l)p.push(this.getNotebookCell(T));const y=[];for(const T of u)y.push(this.getNotebookCell(T));const $=[];for(const T of f)$.push(this.getNotebookCell(T));(p.length>0||y.length>0||d.length>0||$.length>0)&&(h.cells={added:p,removed:y,changed:{data:d,textContent:$}}),(h.metadata!==void 0||h.cells!==void 0)&&this._onDidChange.fire(h)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{const s=this.notebookDocuments.get(i.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),r.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{const s=this.notebookDocuments.get(i.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(const o of i.cellTextDocuments)n.closeTextDocument({textDocument:o});this.notebookDocuments.delete(i.notebookDocument.uri);for(const o of s.cells)this.notebookCellMap.delete(o.document)}})),Ln.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(const n of e.cells)this.notebookCellMap.set(n.document,[n,e])}}Is.NotebookDocuments=C6;var bf={};Object.defineProperty(bf,"__esModule",{value:!0}),bf.MonikerFeature=void 0;const A6=He,I6=t=>class extends t{get moniker(){return{on:e=>{const n=A6.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};bf.MonikerFeature=I6,Object.defineProperty(ke,"__esModule",{value:!0}),ke.createConnection=ke.combineFeatures=ke.combineNotebooksFeatures=ke.combineLanguagesFeatures=ke.combineWorkspaceFeatures=ke.combineWindowFeatures=ke.combineClientFeatures=ke.combineTracerFeatures=ke.combineTelemetryFeatures=ke.combineConsoleFeatures=ke._NotebooksImpl=ke._LanguagesImpl=ke.BulkUnregistration=ke.BulkRegistration=ke.ErrorMessageTracker=void 0;const X=He,Mn=at,cy=Tn,le=Fi,P6=af,x6=cf,N6=uf,O6=ni,D6=ff,L6=hf,M6=pf,F6=gf,j6=mf,U6=yf,B6=vf,q6=wf,W6=Is,G6=bf;function ly(t){if(t!==null)return t}class z6{constructor(){this._messages=Object.create(null)}add(e){let n=this._messages[e];n||(n=0),n++,this._messages[e]=n}sendErrors(e){Object.keys(this._messages).forEach(n=>{e.window.showErrorMessage(n)})}}ke.ErrorMessageTracker=z6;class y1{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(X.MessageType.Error,e)}warn(e){this.send(X.MessageType.Warning,e)}info(e){this.send(X.MessageType.Info,e)}log(e){this.send(X.MessageType.Log,e)}debug(e){this.send(X.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(X.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,X.RAL)().console.error("Sending log message failed")})}}class H6{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...n){let r={type:X.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(X.ShowMessageRequest.type,r).then(ly)}showWarningMessage(e,...n){let r={type:X.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(X.ShowMessageRequest.type,r).then(ly)}showInformationMessage(e,...n){let r={type:X.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(X.ShowMessageRequest.type,r).then(ly)}}const v1=(0,D6.ShowDocumentFeature)((0,le.ProgressFeature)(H6));var w1;(function(t){function e(){return new b1}t.create=e})(w1||(ke.BulkRegistration=w1={}));class b1{constructor(){this._registrations=[],this._registered=new Set}add(e,n){const r=Mn.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);const i=cy.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}}var T1;(function(t){function e(){return new uy(void 0,[])}t.create=e})(T1||(ke.BulkUnregistration=T1={}));class uy{constructor(e,n){this._connection=e,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let n={unregisterations:e};this._connection.sendRequest(X.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){const n=Mn.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(X.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},s=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}}class E1{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,n,r){return e instanceof b1?this.registerMany(e):e instanceof uy?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){const i=Mn.string(n)?n:n.method,s=cy.generateUuid();let o={registrations:[{id:s,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(X.RegistrationRequest.type,o).then(a=>(e.add({id:s,method:i}),e),a=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(a)))}registerSingle2(e,n){const r=Mn.string(e)?e:e.method,i=cy.generateUuid();let s={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(X.RegistrationRequest.type,s).then(o=>X.Disposable.create(()=>{this.unregisterSingle(i,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(o)))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(X.UnregistrationRequest.type,r).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(X.RegistrationRequest.type,n).then(()=>new uy(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}}class V6{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function n(i){return i&&!!i.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(X.ApplyWorkspaceEditRequest.type,r)}}const R1=(0,L6.FileOperationsFeature)((0,x6.WorkspaceFoldersFeature)((0,P6.ConfigurationFeature)(V6)));class S1{constructor(){this._trace=X.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,n){this._trace!==X.Trace.Off&&this.connection.sendNotification(X.LogTraceNotification.type,{message:e,verbose:this._trace===X.Trace.Verbose?n:void 0}).catch(()=>{})}}class $1{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(X.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}}class k1{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,le.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,le.attachPartialResult)(this.connection,n)}}ke._LanguagesImpl=k1;const _1=(0,U6.FoldingRangeFeature)((0,G6.MonikerFeature)((0,q6.DiagnosticFeature)((0,B6.InlayHintFeature)((0,j6.InlineValueFeature)((0,F6.TypeHierarchyFeature)((0,M6.LinkedEditingRangeFeature)((0,O6.SemanticTokensFeature)((0,N6.CallHierarchyFeature)(k1)))))))));class C1{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,le.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,le.attachPartialResult)(this.connection,n)}}ke._NotebooksImpl=C1;const A1=(0,W6.NotebookSyncFeature)(C1);function I1(t,e){return function(n){return e(t(n))}}ke.combineConsoleFeatures=I1;function P1(t,e){return function(n){return e(t(n))}}ke.combineTelemetryFeatures=P1;function x1(t,e){return function(n){return e(t(n))}}ke.combineTracerFeatures=x1;function N1(t,e){return function(n){return e(t(n))}}ke.combineClientFeatures=N1;function O1(t,e){return function(n){return e(t(n))}}ke.combineWindowFeatures=O1;function D1(t,e){return function(n){return e(t(n))}}ke.combineWorkspaceFeatures=D1;function L1(t,e){return function(n){return e(t(n))}}ke.combineLanguagesFeatures=L1;function M1(t,e){return function(n){return e(t(n))}}ke.combineNotebooksFeatures=M1;function K6(t,e){function n(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:n(t.console,e.console,I1),tracer:n(t.tracer,e.tracer,x1),telemetry:n(t.telemetry,e.telemetry,P1),client:n(t.client,e.client,N1),window:n(t.window,e.window,O1),workspace:n(t.workspace,e.workspace,D1),languages:n(t.languages,e.languages,L1),notebooks:n(t.notebooks,e.notebooks,M1)}}ke.combineFeatures=K6;function Y6(t,e,n){const r=n&&n.console?new(n.console(y1)):new y1,i=t(r);r.rawAttach(i);const s=n&&n.tracer?new(n.tracer(S1)):new S1,o=n&&n.telemetry?new(n.telemetry($1)):new $1,a=n&&n.client?new(n.client(E1)):new E1,c=n&&n.window?new(n.window(v1)):new v1,l=n&&n.workspace?new(n.workspace(R1)):new R1,u=n&&n.languages?new(n.languages(_1)):new _1,d=n&&n.notebooks?new(n.notebooks(A1)):new A1,f=[r,s,o,a,c,l,u,d];function h(w){return w instanceof Promise?w:Mn.thenable(w)?new Promise((b,_)=>{w.then(x=>b(x),x=>_(x))}):Promise.resolve(w)}let p,y,$,T={listen:()=>i.listen(),sendRequest:(w,...b)=>i.sendRequest(Mn.string(w)?w:w.method,...b),onRequest:(w,b)=>i.onRequest(w,b),sendNotification:(w,b)=>{const _=Mn.string(w)?w:w.method;return i.sendNotification(_,b)},onNotification:(w,b)=>i.onNotification(w,b),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:w=>(y=w,{dispose:()=>{y=void 0}}),onInitialized:w=>i.onNotification(X.InitializedNotification.type,w),onShutdown:w=>(p=w,{dispose:()=>{p=void 0}}),onExit:w=>($=w,{dispose:()=>{$=void 0}}),get console(){return r},get telemetry(){return o},get tracer(){return s},get client(){return a},get window(){return c},get workspace(){return l},get languages(){return u},get notebooks(){return d},onDidChangeConfiguration:w=>i.onNotification(X.DidChangeConfigurationNotification.type,w),onDidChangeWatchedFiles:w=>i.onNotification(X.DidChangeWatchedFilesNotification.type,w),__textDocumentSync:void 0,onDidOpenTextDocument:w=>i.onNotification(X.DidOpenTextDocumentNotification.type,w),onDidChangeTextDocument:w=>i.onNotification(X.DidChangeTextDocumentNotification.type,w),onDidCloseTextDocument:w=>i.onNotification(X.DidCloseTextDocumentNotification.type,w),onWillSaveTextDocument:w=>i.onNotification(X.WillSaveTextDocumentNotification.type,w),onWillSaveTextDocumentWaitUntil:w=>i.onRequest(X.WillSaveTextDocumentWaitUntilRequest.type,w),onDidSaveTextDocument:w=>i.onNotification(X.DidSaveTextDocumentNotification.type,w),sendDiagnostics:w=>i.sendNotification(X.PublishDiagnosticsNotification.type,w),onHover:w=>i.onRequest(X.HoverRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),void 0)),onCompletion:w=>i.onRequest(X.CompletionRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),(0,le.attachPartialResult)(i,b))),onCompletionResolve:w=>i.onRequest(X.CompletionResolveRequest.type,w),onSignatureHelp:w=>i.onRequest(X.SignatureHelpRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),void 0)),onDeclaration:w=>i.onRequest(X.DeclarationRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),(0,le.attachPartialResult)(i,b))),onDefinition:w=>i.onRequest(X.DefinitionRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),(0,le.attachPartialResult)(i,b))),onTypeDefinition:w=>i.onRequest(X.TypeDefinitionRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),(0,le.attachPartialResult)(i,b))),onImplementation:w=>i.onRequest(X.ImplementationRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),(0,le.attachPartialResult)(i,b))),onReferences:w=>i.onRequest(X.ReferencesRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),(0,le.attachPartialResult)(i,b))),onDocumentHighlight:w=>i.onRequest(X.DocumentHighlightRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),(0,le.attachPartialResult)(i,b))),onDocumentSymbol:w=>i.onRequest(X.DocumentSymbolRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),(0,le.attachPartialResult)(i,b))),onWorkspaceSymbol:w=>i.onRequest(X.WorkspaceSymbolRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),(0,le.attachPartialResult)(i,b))),onWorkspaceSymbolResolve:w=>i.onRequest(X.WorkspaceSymbolResolveRequest.type,w),onCodeAction:w=>i.onRequest(X.CodeActionRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),(0,le.attachPartialResult)(i,b))),onCodeActionResolve:w=>i.onRequest(X.CodeActionResolveRequest.type,(b,_)=>w(b,_)),onCodeLens:w=>i.onRequest(X.CodeLensRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),(0,le.attachPartialResult)(i,b))),onCodeLensResolve:w=>i.onRequest(X.CodeLensResolveRequest.type,(b,_)=>w(b,_)),onDocumentFormatting:w=>i.onRequest(X.DocumentFormattingRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),void 0)),onDocumentRangeFormatting:w=>i.onRequest(X.DocumentRangeFormattingRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),void 0)),onDocumentOnTypeFormatting:w=>i.onRequest(X.DocumentOnTypeFormattingRequest.type,(b,_)=>w(b,_)),onRenameRequest:w=>i.onRequest(X.RenameRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),void 0)),onPrepareRename:w=>i.onRequest(X.PrepareRenameRequest.type,(b,_)=>w(b,_)),onDocumentLinks:w=>i.onRequest(X.DocumentLinkRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),(0,le.attachPartialResult)(i,b))),onDocumentLinkResolve:w=>i.onRequest(X.DocumentLinkResolveRequest.type,(b,_)=>w(b,_)),onDocumentColor:w=>i.onRequest(X.DocumentColorRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),(0,le.attachPartialResult)(i,b))),onColorPresentation:w=>i.onRequest(X.ColorPresentationRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),(0,le.attachPartialResult)(i,b))),onFoldingRanges:w=>i.onRequest(X.FoldingRangeRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),(0,le.attachPartialResult)(i,b))),onSelectionRanges:w=>i.onRequest(X.SelectionRangeRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),(0,le.attachPartialResult)(i,b))),onExecuteCommand:w=>i.onRequest(X.ExecuteCommandRequest.type,(b,_)=>w(b,_,(0,le.attachWorkDone)(i,b),void 0)),dispose:()=>i.dispose()};for(let w of f)w.attach(T);return i.onRequest(X.InitializeRequest.type,w=>{e.initialize(w),Mn.string(w.trace)&&(s.trace=X.Trace.fromString(w.trace));for(let b of f)b.initialize(w.capabilities);if(y){let b=y(w,new X.CancellationTokenSource().token,(0,le.attachWorkDone)(i,w),void 0);return h(b).then(_=>{if(_ instanceof X.ResponseError)return _;let x=_;x||(x={capabilities:{}});let F=x.capabilities;F||(F={},x.capabilities=F),F.textDocumentSync===void 0||F.textDocumentSync===null?F.textDocumentSync=Mn.number(T.__textDocumentSync)?T.__textDocumentSync:X.TextDocumentSyncKind.None:!Mn.number(F.textDocumentSync)&&!Mn.number(F.textDocumentSync.change)&&(F.textDocumentSync.change=Mn.number(T.__textDocumentSync)?T.__textDocumentSync:X.TextDocumentSyncKind.None);for(let P of f)P.fillServerCapabilities(F);return x})}else{let b={capabilities:{textDocumentSync:X.TextDocumentSyncKind.None}};for(let _ of f)_.fillServerCapabilities(b.capabilities);return b}}),i.onRequest(X.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,p)return p(new X.CancellationTokenSource().token)}),i.onNotification(X.ExitNotification.type,()=>{try{$&&$()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(X.SetTraceNotification.type,w=>{s.trace=X.Trace.fromString(w.value)}),T}ke.createConnection=Y6;var fn={};Object.defineProperty(fn,"__esModule",{value:!0}),fn.resolveModulePath=fn.FileSystem=fn.resolveGlobalYarnPath=fn.resolveGlobalNodePath=fn.resolve=fn.uriToFilePath=void 0;const X6=aN,er=da,dy=Ql,fy=cb;function J6(t){let e=X6.parse(t);if(e.protocol!=="file:"||!e.path)return;let n=e.path.split("/");for(var r=0,i=n.length;r<i;r++)n[r]=decodeURIComponent(n[r]);if(process.platform==="win32"&&n.length>1){let s=n[0],o=n[1];s.length===0&&o.length>1&&o[1]===":"&&n.shift()}return er.normalize(n.join("/"))}fn.uriToFilePath=J6;function hy(){return process.platform==="win32"}function Tf(t,e,n,r){const i="NODE_PATH",s=["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((o,a)=>{let c=process.env,l=Object.create(null);Object.keys(c).forEach(u=>l[u]=c[u]),e&&dy.existsSync(e)&&(l[i]?l[i]=e+er.delimiter+l[i]:l[i]=e,r&&r(`NODE_PATH value is: ${l[i]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0,fy.fork)("",[],{cwd:n,env:l,execArgv:["-e",s]});if(u.pid===void 0){a(new Error(`Starting process to resolve node module ${t} failed`));return}u.on("error",f=>{a(f)}),u.on("message",f=>{f.c==="r"&&(u.send({c:"e"}),f.s?o(f.r):a(new Error(`Failed to resolve module: ${t}`)))});let d={c:"rs",a:t};u.send(d)}catch(u){a(u)}})}fn.resolve=Tf;function py(t){let e="npm";const n=Object.create(null);Object.keys(process.env).forEach(s=>n[s]=process.env[s]),n.NO_UPDATE_NOTIFIER="true";const r={encoding:"utf8",env:n};hy()&&(e="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,fy.spawnSync)(e,["config","get","prefix"],r).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let o=s.trim();return t&&t(`'npm config get prefix' value is: ${o}`),o.length>0?hy()?er.join(o,"node_modules"):er.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}fn.resolveGlobalNodePath=py;function Q6(t){let e="yarn",n={encoding:"utf8"};hy()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,fy.spawnSync)(e,["global","dir","--json"],n),s=i.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),i.stderr&&t(i.stderr));return}let o=s.trim().split(/\r?\n/);for(let a of o)try{let c=JSON.parse(a);if(c.type==="log")return er.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}fn.resolveGlobalYarnPath=Q6;var gy;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!dy.existsSync(__filename.toUpperCase())||!dy.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(i,s){return n()?er.normalize(s).indexOf(er.normalize(i))===0:er.normalize(s).toLowerCase().indexOf(er.normalize(i).toLowerCase())===0}t.isParent=r})(gy||(fn.FileSystem=gy={}));function Z6(t,e,n,r){return n?(er.isAbsolute(n)||(n=er.join(t,n)),Tf(e,n,n,r).then(i=>gy.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>Tf(e,py(r),t,r))):Tf(e,py(r),t,r)}fn.resolveModulePath=Z6;var F1=He,j1={},Ef={};Object.defineProperty(Ef,"__esModule",{value:!0}),Ef.InlineCompletionFeature=void 0;const e8=He,t8=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(e8.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};Ef.InlineCompletionFeature=t8,function(t){var e=ut&&ut.__createBinding||(Object.create?function(c,l,u,d){d===void 0&&(d=u);var f=Object.getOwnPropertyDescriptor(l,u);(!f||("get"in f?!l.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return l[u]}}),Object.defineProperty(c,d,f)}:function(c,l,u,d){d===void 0&&(d=u),c[d]=l[u]}),n=ut&&ut.__exportStar||function(c,l){for(var u in c)u!=="default"&&!Object.prototype.hasOwnProperty.call(l,u)&&e(l,c,u)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProposedFeatures=t.NotebookDocuments=t.TextDocuments=t.SemanticTokensBuilder=void 0;const r=ni;Object.defineProperty(t,"SemanticTokensBuilder",{enumerable:!0,get:function(){return r.SemanticTokensBuilder}});const i=Ef;n(He,t);const s=Nc;Object.defineProperty(t,"TextDocuments",{enumerable:!0,get:function(){return s.TextDocuments}});const o=Is;Object.defineProperty(t,"NotebookDocuments",{enumerable:!0,get:function(){return o.NotebookDocuments}}),n(ke,t);var a;(function(c){c.all={__brand:"features",languages:i.InlineCompletionFeature}})(a||(t.ProposedFeatures=a={}))}(j1),function(t){var e=ut&&ut.__createBinding||(Object.create?function(T,w,b,_){_===void 0&&(_=b);var x=Object.getOwnPropertyDescriptor(w,b);(!x||("get"in x?!w.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return w[b]}}),Object.defineProperty(T,_,x)}:function(T,w,b,_){_===void 0&&(_=b),T[_]=w[b]}),n=ut&&ut.__exportStar||function(T,w){for(var b in T)b!=="default"&&!Object.prototype.hasOwnProperty.call(w,b)&&e(w,T,b)};Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.Files=void 0;const r=Fx,i=at,s=ke,o=fn,a=F1;n(F1,t),n(j1,t);var c;(function(T){T.uriToFilePath=o.uriToFilePath,T.resolveGlobalNodePath=o.resolveGlobalNodePath,T.resolveGlobalYarnPath=o.resolveGlobalYarnPath,T.resolve=o.resolve,T.resolveModulePath=o.resolveModulePath})(c||(t.Files=c={}));function l(){}let u=!1,d;function f(){const T="--clientProcessId";function w(b){try{let _=parseInt(b);isNaN(_)||(d=setInterval(()=>{try{process.kill(_,0)}catch{process.exit(u?0:1)}},3e3))}catch{}}for(let b=2;b<process.argv.length;b++){let _=process.argv[b];if(_===T&&b+1<process.argv.length){w(process.argv[b+1]);return}else{let x=_.split("=");x[0]===T&&w(x[1])}}}f();const h={initialize:T=>{const w=T.processId;i.number(w)&&d===void 0&&setInterval(()=>{try{process.kill(w,0)}catch{process.exit(u?0:1)}},3e3)},get shutdownReceived(){return u},set shutdownReceived(T){u=T},exit:T=>{process.exit(T)}};function p(T,w,b,_){let x,F,P,G;return T!==void 0&&T.__brand==="features"&&(x=T,T=w,w=b,b=_),a.ConnectionStrategy.is(T)||a.ConnectionOptions.is(T)?G=T:(F=T,P=w,G=b),y(F,P,G,x)}t.createConnection=p;function y(T,w,b,_){let x=!1;if(!T&&!w&&process.argv.length>2){let B,W,I=process.argv.slice(2);for(let k=0;k<I.length;k++){let R=I[k];if(R==="--node-ipc"){T=new a.IPCMessageReader(process),w=new a.IPCMessageWriter(process);break}else if(R==="--stdio"){x=!0,T=process.stdin,w=process.stdout;break}else if(R==="--socket"){B=parseInt(I[k+1]);break}else if(R==="--pipe"){W=I[k+1];break}else{var F=R.split("=");if(F[0]==="--socket"){B=parseInt(F[1]);break}else if(F[0]==="--pipe"){W=F[1];break}}}if(B){let k=(0,a.createServerSocketTransport)(B);T=k[0],w=k[1]}else if(W){let k=(0,a.createServerPipeTransport)(W);T=k[0],w=k[1]}}var P="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!T)throw new Error("Connection input stream is not set. "+P);if(!w)throw new Error("Connection output stream is not set. "+P);if(i.func(T.read)&&i.func(T.on)){let B=T;B.on("end",()=>{process.exit(u?0:1)}),B.on("close",()=>{process.exit(u?0:1)})}const G=B=>{const W=(0,a.createProtocolConnection)(T,w,B,b);return x&&$(B),W};return(0,s.createConnection)(G,h,_)}function $(T){function w(_){return _.map(x=>typeof x=="string"?x:(0,r.inspect)(x)).join(" ")}const b=new Map;console.assert=function(x,...F){if(!x)if(F.length===0)T.error("Assertion failed");else{const[P,...G]=F;T.error(`Assertion failed: ${P} ${w(G)}`)}},console.count=function(x="default"){const F=String(x);let P=b.get(F)??0;P+=1,b.set(F,P),T.log(`${F}: ${F}`)},console.countReset=function(x){x===void 0?b.clear():b.delete(String(x))},console.debug=function(...x){T.log(w(x))},console.dir=function(x,F){T.log((0,r.inspect)(x,F))},console.log=function(...x){T.log(w(x))},console.error=function(...x){T.error(w(x))},console.trace=function(...x){const F=new Error().stack.replace(/(.+\n){2}/,"");let P="Trace";x.length!==0&&(P+=`: ${w(x)}`),T.log(`${P}
|
|
160
|
-
${F}`)},console.warn=function(...x){T.warn(w(x))}}}(ie);function U1(t,e){const n={stacks:t,tokens:e};return n8(n),n.stacks.flat().forEach(i=>{i.property=void 0}),q1(n.stacks).map(i=>i[i.length-1])}function my(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(Ri(c.$container)){a=c.$container;break}else if(Xp(c.$container))c=c.$container;else break;if(cT(c.cardinality)){const l=Fo({next:{feature:c,type:e.type},cardinalities:n,visited:r,plus:i});for(const u of l)i.add(u.feature);s.push(...l)}if(a){const l=a.elements.indexOf(c);l!==void 0&&l<a.elements.length-1&&s.push(...B1({feature:a,type:e.type},l+1,n,r,i)),s.every(u=>fo(u.feature.cardinality,u.feature)||fo(n.get(u.feature))||i.has(u.feature))&&s.push(...my({next:{feature:a,type:e.type},cardinalities:n,visited:r,plus:i}))}return s}function yy(t){return it(t)&&(t={feature:t}),Fo({next:t,cardinalities:new Map,visited:new Set,plus:new Set})}function Fo(t){var e,n,r;const{next:i,cardinalities:s,visited:o,plus:a}=t;if(i===void 0)return[];const{feature:c,type:l}=i;if(Ri(c)){if(o.has(c))return[];o.add(c)}if(Ri(c))return B1(i,0,s,o,a).map(u=>Rf(u,c.cardinality,s));if(tg(c)||ng(c))return c.elements.flatMap(u=>Fo({next:{feature:u,type:l,property:i.property},cardinalities:s,visited:o,plus:a})).map(u=>Rf(u,c.cardinality,s));if(fr(c)){const u={feature:c.terminal,type:l,property:(e=i.property)!==null&&e!==void 0?e:c.feature};return Fo({next:u,cardinalities:s,visited:o,plus:a}).map(d=>Rf(d,c.cardinality,s))}else{if(ys(c))return my({next:{feature:c,type:nc(c),property:(n=i.property)!==null&&n!==void 0?n:c.feature},cardinalities:s,visited:o,plus:a});if(Fr(c)&&Mt(c.rule.ref)){const u=c.rule.ref,d={feature:u.definition,type:u.fragment||u.dataType?void 0:(r=vs(u))!==null&&r!==void 0?r:u.name,property:i.property};return Fo({next:d,cardinalities:s,visited:o,plus:a}).map(f=>Rf(f,c.cardinality,s))}else return[i]}}function Rf(t,e,n){return n.set(t.feature,e),t}function B1(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(...Fo({next:a,cardinalities:n,visited:r,plus:i})),!!fo((s=a.feature.cardinality)!==null&&s!==void 0?s:n.get(a.feature),a.feature)););return o}function n8(t){for(const e of t.tokens){const n=q1(t.stacks,e);t.stacks=n}}function q1(t,e){const n=[];for(const r of t)n.push(...r8(r,e));return n}function r8(t,e){const n=new Map,r=new Set(t.map(s=>s.feature).filter(i8)),i=[];for(;t.length>0;){const s=t.pop(),o=my({next:s,cardinalities:n,plus:r,visited:new Set}).filter(a=>e?vy(a.feature,e):!0);for(const a of o)i.push([...t,a]);if(!o.every(a=>fo(a.feature.cardinality,a.feature)||fo(n.get(a.feature))))break}return i}function i8(t){if(t.cardinality==="+")return!0;const e=rn(t,fr);return!!(e&&e.cardinality==="+")}function vy(t,e){if(hr(t))return t.value===e.image;if(Fr(t))return s8(t.rule.ref,e);if(Ba(t)){const n=dg(t);if(n)return vy(n,e)}return!1}function s8(t,e){return Mt(t)?yy(t.definition).some(r=>vy(r.feature,e)):Mr(t)?rc(t).test(e.image):!1}function o8(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 W1{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){const r=[],i=this.buildContexts(e,n.position),s=(c,l)=>{const u=this.fillCompletionItem(c,l);u&&r.push(u)},o=c=>hr(c.feature)?c.feature.value:c.feature,a=[];for(const c of i)if(await Promise.all(De(c.features).distinct(o).exclude(a).map(l=>this.completionFor(c,l,s))),a.push(...c.features),!this.continueCompletion(r))break;return ie.CompletionList.create(this.deduplicateItems(r),!0)}deduplicateItems(e){return De(e).distinct(n=>`${n.kind}_${n.label}_${n.detail}`).toArray()}findFeaturesAt(e,n){const r=e.getText({start:ie.Position.create(0,0),end:e.positionAt(n)}),i=this.completionParser.parse(r),s=i.tokens;if(i.tokenIndex===0){const c=Bu(this.grammar),l=yy({feature:c.definition,type:vs(c)});return s.length>0?(s.shift(),U1(l.map(u=>[u]),s)):l}const o=[...s].splice(i.tokenIndex);return U1([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),l={document:e,textDocument:o,offset:c,position:n},u=this.findDataTypeRuleStart(s,c);if(u){const[w,b]=u,_=(r=Su(s,w))===null||r===void 0?void 0:r.astNode;yield Object.assign(Object.assign({},l),{node:_,tokenOffset:w,tokenEndOffset:b,features:this.findFeaturesAt(o,w)})}const{nextTokenStart:d,nextTokenEnd:f,previousTokenStart:h,previousTokenEnd:p}=this.backtrackToAnyToken(a,c);let y=d;c<=d&&h!==void 0&&(y=h);const $=(i=Su(s,y))===null||i===void 0?void 0:i.astNode;let T=!0;if(h!==void 0&&p!==void 0&&p===c&&(yield Object.assign(Object.assign({},l),{node:$,tokenOffset:h,tokenEndOffset:p,features:this.findFeaturesAt(o,h)}),T=this.performNextTokenCompletion(e,a.substring(h,p),h,p),T&&(yield Object.assign(Object.assign({},l),{node:$,tokenOffset:p,tokenEndOffset:p,features:this.findFeaturesAt(o,p)}))),$)T&&(yield Object.assign(Object.assign({},l),{node:$,tokenOffset:d,tokenEndOffset:f,features:this.findFeaturesAt(o,d)}));else{const w=Bu(this.grammar);if(!w)throw new Error("Missing entry parser rule");yield Object.assign(Object.assign({},l),{tokenOffset:d,tokenEndOffset:f,features:yy(w.definition)})}}performNextTokenCompletion(e,n,r,i){return/\P{L}$/u.test(n)}findDataTypeRuleStart(e,n){var r,i;let s=Ei(e,n,this.grammarConfig.nameRegexp),o=!!(!((r=rn(s?.grammarSource,Mt))===null||r===void 0)&&r.dataType);if(o){for(;o;)s=s?.container,o=!!(!((i=rn(s?.grammarSource,Mt))===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(hr(n.feature))return this.completionForKeyword(e,n.feature,r);if(Ba(n.feature)&&e.node)return this.completionForCrossReference(e,n,r)}completionForCrossReference(e,n,r){const i=rn(n.feature,fr);let s=e.node;if(i&&s){n.type&&(s={$type:n.type,$container:s,$containerProperty:n.property},sg(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 ie.CompletionItemKind.Keyword}filterKeyword(e,n){return/\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 l=this.nameProvider.getName(n.node);if(!l)return;s=l}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 a8{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getDefinition(e,n){const r=e.parseResult.value;if(r.$cstNode){const i=r.$cstNode,s=Ei(i,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(s)return this.collectLocationLinks(s,n)}}collectLocationLinks(e,n){var r;const i=this.findLink(e);if(i)return[ie.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=St(n.astNode);if(n&&r)return{source:e,target:n,targetDocument:r}}}}class G1{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}getDocumentHighlight(e,n){const r=e.parseResult.value.$cstNode;if(!r)return;const i=Ei(r,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(!i)return;const s=this.references.findDeclaration(i);if(s){const o=Nn.equals(St(s).uri,e.uri),a={documentUri:e.uri,includeDeclaration:o};return this.references.findReferences(s,a).map(l=>this.createDocumentHighlight(l)).toArray()}}createDocumentHighlight(e){return ie.DocumentHighlight.create(e.segment.range)}}class c8{constructor(e){this.nameProvider=e.references.NameProvider,this.nodeKindProvider=e.shared.lsp.NodeKindProvider}getSymbols(e){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 ec(n)){const s=this.getSymbol(e,i);r.push(...s)}if(r.length>0)return r}}class l8{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=De(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(ie.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=De(e.changes).filter(i=>i.type!==ie.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>Yt.parse(i.uri)).toArray(),r=De(e.changes).filter(i=>i.type===ie.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>Yt.parse(i.uri)).toArray();this.fireDocumentUpdate(n,r)}}class u8{constructor(e){this.commentNames=e.parser.GrammarConfig.multilineCommentRules}getFoldingRanges(e){const n=[],r=i=>n.push(i);return this.collectFolding(e,r),n}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=jr(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 D0(i))if(this.commentNames.includes(s.tokenType.name)){const o=this.toFoldingRange(e,s,ie.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)),ie.FoldingRange.create(s.line,o.line,s.character,o.character,r)}includeLastFoldingLine(e,n){if(n===ie.FoldingRangeKind.Comment)return!1;const r=e.text,i=r.charAt(r.length-1);return!(i==="}"||i===")"||i==="]")}}class d8{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),l=e.charCodeAt(s);if((c===l||this.toUpperCharCode(c)===this.toUpperCharCode(l))&&(r||(r=i===void 0||this.isWordTransition(i,c)),r&&s++,s===e.length))return!0;i=c}return!1}isWordTransition(e,n){return z1<=e&&e<=H1&&f8<=n&&n<=h8||e===V1&&n!==V1}toUpperCharCode(e){return z1<=e&&e<=H1?e-32:e}}const z1=97,H1=122,f8=65,h8=90,V1=95;class K1{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=Ei(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 p8 extends K1{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}}}}const wy={[ie.SemanticTokenTypes.class]:0,[ie.SemanticTokenTypes.comment]:1,[ie.SemanticTokenTypes.enum]:2,[ie.SemanticTokenTypes.enumMember]:3,[ie.SemanticTokenTypes.event]:4,[ie.SemanticTokenTypes.function]:5,[ie.SemanticTokenTypes.interface]:6,[ie.SemanticTokenTypes.keyword]:7,[ie.SemanticTokenTypes.macro]:8,[ie.SemanticTokenTypes.method]:9,[ie.SemanticTokenTypes.modifier]:10,[ie.SemanticTokenTypes.namespace]:11,[ie.SemanticTokenTypes.number]:12,[ie.SemanticTokenTypes.operator]:13,[ie.SemanticTokenTypes.parameter]:14,[ie.SemanticTokenTypes.property]:15,[ie.SemanticTokenTypes.regexp]:16,[ie.SemanticTokenTypes.string]:17,[ie.SemanticTokenTypes.struct]:18,[ie.SemanticTokenTypes.type]:19,[ie.SemanticTokenTypes.typeParameter]:20,[ie.SemanticTokenTypes.variable]:21,[ie.SemanticTokenTypes.decorator]:22},Y1={[ie.SemanticTokenModifiers.abstract]:1,[ie.SemanticTokenModifiers.async]:2,[ie.SemanticTokenModifiers.declaration]:4,[ie.SemanticTokenModifiers.defaultLibrary]:8,[ie.SemanticTokenModifiers.definition]:16,[ie.SemanticTokenModifiers.deprecated]:32,[ie.SemanticTokenModifiers.documentation]:64,[ie.SemanticTokenModifiers.modification]:128,[ie.SemanticTokenModifiers.readonly]:256,[ie.SemanticTokenModifiers.static]:512},g8={legend:{tokenTypes:Object.keys(wy),tokenModifiers:Object.keys(Y1)},full:{delta:!0},range:!0};class m8 extends ie.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 y8{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}async semanticHighlight(e,n,r=Ye.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=Ye.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=Ye.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 m8;return this.tokensBuilders.set(e.uri.toString(),r),r}async computeHighlighting(e,n,r){const i=e.parseResult.value,s=Ur(i,{range:this.currentRange}).iterator();let o;do if(o=s.next(),!o.done){await kt(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&&!Gp(r,this.currentRange)||!this.currentDocument||!this.currentTokensBuilder)return;const o=wy[i];let a=0;if(s!==void 0){typeof s=="string"&&(s=[s]);for(const u of s){const d=Y1[u];a|=d}}const c=r.start.line,l=r.end.line;if(c===l){const u=r.start.character,d=r.end.character-u;this.currentTokensBuilder.push(c,u,d,o,a)}else if(!((n=this.clientCapabilities)===null||n===void 0)&&n.multilineTokenSupport){const u=r.start.character,d=this.currentDocument.textDocument.offsetAt(r.start),f=this.currentDocument.textDocument.offsetAt(r.end);this.currentTokensBuilder.push(c,u,f-d,o,a)}else{const u=r.start;let d=this.currentDocument.textDocument.offsetAt({line:c+1,character:0});this.currentTokensBuilder.push(u.line,u.character,d-u.character-1,o,a);for(let f=c+1;f<l;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(l,0,r.end.character,o,a)}}highlightProperty(e){const n=[];if(typeof e.index=="number"){const s=pr(e.node.$cstNode,e.property,e.index);s&&n.push(s)}else n.push(...qu(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=Wu(n.$cstNode,r,s);c&&a.push(c)}else a.push(...iT(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 X1;(function(t){function e(r,i){const s=new Map;Object.entries(wy).forEach(([c,l])=>s.set(l,c));let o=0,a=0;return n(r.data,5).map(c=>{o+=c[0],c[0]!==0&&(a=0),a+=c[1];const l=c[2];return{offset:i.textDocument.offsetAt({line:o,character:a}),tokenType:s.get(c[3]),tokenModifiers:c[4],text:i.textDocument.getText({start:{line:o,character:a},end:{line:o,character:a+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}})(X1||(X1={}));function v8(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 w8{constructor(e){this.onInitializeEmitter=new He.Emitter,this.onInitializedEmitter=new He.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(){zm(this.services),this.services.ServiceRegistry.all.forEach(e=>zm(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,l=this.hasService(J=>{var U;return(U=J.lsp)===null||U===void 0?void 0:U.Formatter}),u=c.map(J=>{var U,ce;return(ce=(U=J.lsp)===null||U===void 0?void 0:U.Formatter)===null||ce===void 0?void 0:ce.formatOnTypeOptions}).find(J=>!!J),d=this.hasService(J=>{var U;return(U=J.lsp)===null||U===void 0?void 0:U.CodeActionProvider}),f=this.hasService(J=>{var U;return(U=J.lsp)===null||U===void 0?void 0:U.SemanticTokenProvider}),h=(i=(r=this.services.lsp)===null||r===void 0?void 0:r.ExecuteCommandHandler)===null||i===void 0?void 0:i.commands,p=this.hasService(J=>{var U;return(U=J.lsp)===null||U===void 0?void 0:U.DocumentLinkProvider}),y=v8(c.map(J=>{var U,ce;return(ce=(U=J.lsp)===null||U===void 0?void 0:U.SignatureHelp)===null||ce===void 0?void 0:ce.signatureHelpOptions})),$=this.hasService(J=>{var U;return(U=J.lsp)===null||U===void 0?void 0:U.TypeProvider}),T=this.hasService(J=>{var U;return(U=J.lsp)===null||U===void 0?void 0:U.ImplementationProvider}),w=this.hasService(J=>{var U;return(U=J.lsp)===null||U===void 0?void 0:U.CompletionProvider}),b=o8(c.map(J=>{var U,ce;return(ce=(U=J.lsp)===null||U===void 0?void 0:U.CompletionProvider)===null||ce===void 0?void 0:ce.completionOptions})),_=this.hasService(J=>{var U;return(U=J.lsp)===null||U===void 0?void 0:U.ReferencesProvider}),x=this.hasService(J=>{var U;return(U=J.lsp)===null||U===void 0?void 0:U.DocumentSymbolProvider}),F=this.hasService(J=>{var U;return(U=J.lsp)===null||U===void 0?void 0:U.DefinitionProvider}),P=this.hasService(J=>{var U;return(U=J.lsp)===null||U===void 0?void 0:U.DocumentHighlightProvider}),G=this.hasService(J=>{var U;return(U=J.lsp)===null||U===void 0?void 0:U.FoldingRangeProvider}),B=this.hasService(J=>{var U;return(U=J.lsp)===null||U===void 0?void 0:U.HoverProvider}),W=this.hasService(J=>{var U;return(U=J.lsp)===null||U===void 0?void 0:U.RenameProvider}),I=this.hasService(J=>{var U;return(U=J.lsp)===null||U===void 0?void 0:U.CallHierarchyProvider}),k=this.hasService(J=>{var U;return(U=J.lsp)===null||U===void 0?void 0:U.TypeHierarchyProvider}),R=this.hasService(J=>{var U;return(U=J.lsp)===null||U===void 0?void 0:U.CodeLensProvider}),M=this.hasService(J=>{var U;return(U=J.lsp)===null||U===void 0?void 0:U.DeclarationProvider}),q=this.hasService(J=>{var U;return(U=J.lsp)===null||U===void 0?void 0:U.InlayHintProvider}),j=(s=this.services.lsp)===null||s===void 0?void 0:s.WorkspaceSymbolProvider;return{capabilities:{workspace:{workspaceFolders:{supported:!0},fileOperations:a},executeCommandProvider:h&&{commands:h},textDocumentSync:{change:He.TextDocumentSyncKind.Incremental,openClose:!0,save:!!o.didSaveDocument,willSave:!!o.willSaveDocument,willSaveWaitUntil:!!o.willSaveDocumentWaitUntil},completionProvider:w?b:void 0,referencesProvider:_,documentSymbolProvider:x,definitionProvider:F,typeDefinitionProvider:$,documentHighlightProvider:P,codeActionProvider:d,documentFormattingProvider:l,documentRangeFormattingProvider:l,documentOnTypeFormattingProvider:u,foldingRangeProvider:G,hoverProvider:B,renameProvider:W?{prepareProvider:!0}:void 0,semanticTokensProvider:f?g8:void 0,signatureHelpProvider:y,implementationProvider:T,callHierarchyProvider:I?{}:void 0,typeHierarchyProvider:k?{}:void 0,documentLinkProvider:p?{resolveProvider:!1}:void 0,codeLensProvider:R?{resolveProvider:!1}:void 0,declarationProvider:M,inlayHintProvider:q?{resolveProvider:!1}:void 0,workspaceSymbolProvider:j?{resolveProvider:!!j.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(He.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 b8{getSymbolKind(e){return ie.SymbolKind.Field}getCompletionItemKind(e){return ie.CompletionItemKind.Reference}}class T8{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}findReferences(e,n){const r=e.parseResult.value.$cstNode;if(!r)return[];const i=Ei(r,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);return i?this.getReferences(i,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(ie.Location.create(a.sourceUri.toString(),a.segment.range))})}return i}}class J1{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}async rename(e,n){const r={},i=e.parseResult.value.$cstNode;if(!i)return;const s=e.textDocument.offsetAt(n.position),o=Ei(i,s,this.grammarConfig.nameRegexp);if(!o)return;const a=this.references.findDeclaration(o);if(!a)return;const c={onlyLocal:!1,includeDeclaration:!0};return this.references.findReferences(a,c).forEach(u=>{const d=Kt.replace(u.segment.range,n.newName),f=u.sourceUri.toString();r[f]?r[f].push(d):r[f]=[d]}),{changes:r}}prepareRename(e,n){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=Ei(r,i,this.grammarConfig.nameRegexp);if(!s)return;if(this.references.findDeclaration(s)||this.isNameNode(s))return s.range}}isNameNode(e){return e?.astNode&&t$(e.astNode)&&e===this.nameProvider.getNameNode(e.astNode)}}class Q1{constructor(e){this.indexManager=e.workspace.IndexManager,this.nodeKindProvider=e.lsp.NodeKindProvider,this.fuzzyMatcher=e.lsp.FuzzyMatcher}async getSymbols(e,n=Ye.None){const r=[],i=e.query.toLowerCase();for(const s of this.indexManager.allElements())if(await kt(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()}}}}function E8(t){return qd.merge(E$(t),R8(t))}function R8(t){return{lsp:{CompletionProvider:e=>new W1(e),DocumentSymbolProvider:e=>new c8(e),HoverProvider:e=>new p8(e),FoldingRangeProvider:e=>new u8(e),ReferencesProvider:e=>new T8(e),DefinitionProvider:e=>new a8(e),DocumentHighlightProvider:e=>new G1(e),RenameProvider:e=>new J1(e)},shared:()=>t.shared}}function S8(t){return qd.merge(R$(t),$8(t))}function $8(t){return{lsp:{Connection:()=>t.connection,LanguageServer:e=>new w8(e),DocumentUpdateHandler:e=>new l8(e),WorkspaceSymbolProvider:e=>new Q1(e),NodeKindProvider:()=>new b8,FuzzyMatcher:()=>new d8},workspace:{TextDocuments:()=>new ie.TextDocuments(Ud)}}}var Z1;(function(t){function e(...u){return{options:{},moves:u.flatMap(d=>d.moves).sort(l)}}t.fit=e;function n(u){return i(0,u)}t.noSpace=n;function r(u){return i(1,u)}t.oneSpace=r;function i(u,d){return{options:d??{},moves:[{characters:u}]}}t.spaces=i;function s(u){return o(1,u)}t.newLine=s;function o(u,d){return{options:d??{},moves:[{lines:u}]}}t.newLines=o;function a(u){return{options:u??{},moves:[{tabs:1,lines:1}]}}t.indent=a;function c(u){return{options:u??{},moves:[{tabs:0}]}}t.noIndent=c;function l(u,d){var f,h,p,y,$,T;const w=(f=u.lines)!==null&&f!==void 0?f:0,b=(h=d.lines)!==null&&h!==void 0?h:0,_=(p=u.tabs)!==null&&p!==void 0?p:0,x=(y=d.tabs)!==null&&y!==void 0?y:0,F=($=u.characters)!==null&&$!==void 0?$:0,P=(T=d.characters)!==null&&T!==void 0?T:0;return w<b?-1:w>b?1:_<x?-1:_>x?1:F<P?-1:F>P?1:0}})(Z1||(Z1={}));const Ve={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},e_={silent:{level:-1},fatal:{level:Ve.fatal},error:{level:Ve.error},warn:{level:Ve.warn},log:{level:Ve.log},info:{level:Ve.info},success:{level:Ve.success},fail:{level:Ve.fail},ready:{level:Ve.info},start:{level:Ve.info},box:{level:Ve.info},debug:{level:Ve.debug},trace:{level:Ve.trace},verbose:{level:Ve.verbose}};function by(t){return t!==null&&typeof t=="object"}function Ty(t,e,n=".",r){if(!by(e))return Ty(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]]:by(o)&&by(i[s])?i[s]=Ty(o,i[s],(n?`${n}.`:"")+s.toString()):i[s]=o)}return i}function k8(t){return(...e)=>e.reduce((n,r)=>Ty(n,r,""),{})}const _8=k8();function C8(t){return Object.prototype.toString.call(t)==="[object Object]"}function A8(t){return!(!C8(t)||!t.message&&!t.args||t.stack)}let Ey=!1;const t_=[];let Xt=class Ix{constructor(e={}){const n=e.types||e_;this.options=_8({...e,defaults:{...e.defaults},level:Ry(e.level,n),reporters:[...e.reporters||[]]},{types:e_,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=Ry(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 Ix({...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(){Ey=!0}resumeLogs(){Ey=!1;const e=t_.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(Ey){t_.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:Ry(e.level,this.options.types)};!r&&n.length===1&&A8(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(`
|
|
161
|
-
`)),i.args.push(`
|
|
162
|
-
`+i.additional.join(`
|
|
163
|
-
`)),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 l=[...this._lastLog.object.args];c>1&&l.push(`(repeated ${c} times)`),this._log({...this._lastLog.object,args:l}),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 Ry(t,e={},n=3){return t===void 0?n:typeof t=="number"?t:e[t]&&e[t].level!==void 0?e[t].level:n}Xt.prototype.add=Xt.prototype.addReporter,Xt.prototype.remove=Xt.prototype.removeReporter,Xt.prototype.clear=Xt.prototype.removeReporter,Xt.prototype.withScope=Xt.prototype.withTag,Xt.prototype.mock=Xt.prototype.mockTypes,Xt.prototype.pause=Xt.prototype.pauseLogs,Xt.prototype.resume=Xt.prototype.resumeLogs;function I8(t={}){return new Xt(t)}function P8(t){const e=process.cwd()+Ox;return t.split(`
|
|
164
|
-
`).splice(1).map(n=>n.trim().replace("file://","").replace(e,""))}function x8(t,e){return(e.__write||e.write).call(e,t)}const Sy=t=>t?`[${t}]`:"";class N8{formatStack(e,n){return" "+P8(e).join(`
|
|
165
|
-
`)}formatArgs(e,n){const r=e.map(i=>i&&typeof i.stack=="string"?i.message+`
|
|
166
|
-
`+this.formatStack(i.stack,n):i);return jx(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"?`
|
|
167
|
-
`+[Sy(e.tag),e.title&&e.title,...r.split(`
|
|
168
|
-
`)].filter(Boolean).map(i=>" > "+i).join(`
|
|
169
|
-
`)+`
|
|
170
|
-
`:this.filterAndJoin([Sy(e.type),Sy(e.tag),r])}log(e,n){const r=this.formatLogObj(e,{columns:n.options.stdout.columns||0,...n.options.formatOptions});return x8(r+`
|
|
171
|
-
`,e.level<2?n.options.stderr||process.stderr:n.options.stdout||process.stdout)}}function n_(t={}){let e=Ve.info;return process.env.CONSOLA_LEVEL&&(e=Number.parseInt(process.env.CONSOLA_LEVEL)??e),I8({level:e,defaults:{level:e},stdout:process.stdout,stderr:process.stderr,reporters:t.reporters||[new N8],...t})}n_();const Le=n_({level:Ve.debug,formatOptions:{colors:!0,date:!1}});var O8={done:!0,hasNext:!1},jo={done:!1,hasNext:!1},r_=()=>O8,D8=t=>({hasNext:!0,next:t,done:!1});function _t(t,...e){let n=t,r=e.map(s=>"lazy"in s?L8(s):void 0),i=0;for(;i<e.length;){if(r[i]===void 0||!M8(n)){let c=e[i];n=c(n),i+=1;continue}let s=[];for(let c=i;c<e.length;c++){let l=r[c];if(l===void 0||(s.push(l),l.isSingle))break}let o=[];for(let c of n)if(i_(c,o,s))break;let{isSingle:a}=s.at(-1);n=a?o[0]:o,i+=s.length}return n}function i_(t,e,n){if(n.length===0)return e.push(t),!1;let r=t,i=jo,s=!1;for(let[o,a]of n.entries()){let{index:c,items:l}=a;if(l.push(r),i=a(r,c,l),a.index+=1,i.hasNext){if(i.hasMany??!1){for(let u of i.next)if(i_(u,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 L8(t){let{lazy:e,lazyArgs:n}=t,r=e(...n);return Object.assign(r,{isSingle:e.single??!1,index:0,items:[]})}function M8(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 _t(r,{lazy:t,lazyArgs:i})}if(n===0){let r={lazy:t,lazyArgs:e};return Object.assign(i=>_t(i,r),r)}throw new Error("Wrong number of arguments")}function F8(t,e,n){let r=i=>t(i,...e);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:e})}function Me(t,e,n){let r=t.length-e.length;if(r===0)return t(...e);if(r===1)return F8(t,e,n);throw new Error("Wrong number of arguments")}function Sf(...t){return Me(Object.values,t)}function j8(...t){return Me(U8,t,B8)}var U8=(t,e)=>t.length<e.length?t.map((n,r)=>[n,e[r]]):e.map((n,r)=>[t[r],n]),B8=t=>(e,n)=>({hasNext:!0,next:[e,t[n]],done:n>=t.length-1});function Ui(...t){return $y(q8,t)}function q8(){let t=new Set;return e=>t.has(e)?jo:(t.add(e),{done:!1,hasNext:!0,next:e})}function W8(...t){return Me(G8,t,z8)}var G8=(t,e)=>e<0?[]:t.slice(0,e);function z8(t){if(t<=0)return r_;let e=t;return n=>(e-=1,{done:e<=0,hasNext:!0,next:n})}function Fn(...t){return Me(H8,t)}var H8=(t,e)=>t.length>=e,s_={asc:(t,e)=>t>e,desc:(t,e)=>t<e};function V8(t,e){let[n,...r]=e;if(!K8(n)){let s=ky(...r);return t(n,s)}let i=ky(n,...r);return s=>t(s,i)}function ky(t,e,...n){let r=typeof t=="function"?t:t[0],i=typeof t=="function"?"asc":t[1],{[i]:s}=s_,o=e===void 0?void 0:ky(e,...n);return(a,c)=>{let l=r(a),u=r(c);return s(l,u)?1:s(u,l)?-1:o?.(a,c)??0}}function K8(t){if(o_(t))return!0;if(typeof t!="object"||!Array.isArray(t))return!1;let[e,n,...r]=t;return o_(e)&&typeof n=="string"&&n in s_&&r.length===0}var o_=t=>typeof t=="function"&&t.length===1;function $f(...t){return Me(Y8,t)}function Y8(t,e){let n=[...t];return n.sort(e),n}function X8(...t){return V8(J8,t)}var J8=(t,e)=>[...t].sort(e);function Q8(...t){return Me(Z8,t)}var Z8=(t,e,n)=>t.reduce(e,n);function a_(...t){return Me(eW,t)}function eW(t){return[...t].reverse()}function _y(...t){return e=>_t(e,...t)}function ri(...t){return Me(tW,t)}var tW=(t,e)=>t[e];function c_(...t){return Me(nW,t)}function nW(t,e){let n={...t};for(let[r,i]of Object.entries(n))e(i,r,t)&&delete n[r];return n}function l_(...t){return Me(rW,t)}function rW(t,e){let n={};for(let r of e)r in t&&(n[r]=t[r]);return n}function u_(...t){return Me(iW,t)}function iW(t,e){if(!Fn(e,1))return{...t};if(!Fn(e,2)){let{[e[0]]:r,...i}=t;return i}let n={...t};for(let r of e)delete n[r];return n}function Oc(...t){return Me(sW,t)}var sW=t=>t.at(-1);function Ct(...t){return Me(oW,t,aW)}var oW=(t,e)=>t.map(e),aW=t=>(e,n,r)=>({done:!1,hasNext:!0,next:t(e,n,r)});function ii(...t){return Me(cW,t)}function cW(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 Me(lW,t)}function lW(t,e){let n={};for(let[r,i]of Object.entries(t)){let s=e(i,r,t);n[r]=s}return n}function qi(t){return typeof t=="string"}function Q(t){return!!t}function Sr(t){return t!=null}function yt(t){return t==null}function d_(t){return typeof t=="number"&&!Number.isNaN(t)}function f_(t){return Array.isArray(t)}function Jt(t){return t!==void 0}function xs(t){return t===void 0?!0:typeof t=="string"||Array.isArray(t)?t.length===0:Object.keys(t).length===0}function h_(...t){return Me(uW,t)}function uW(t,e){let n={};for(let[r,i]of t.entries()){let s=e(i,r,t);n[s]=i}return n}function dW(...t){return $y(fW,t)}function fW(t){if(t.length===0)return r_;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?jo:(r===1?e.delete(n):e.set(n,r-1),{hasNext:!0,next:n,done:e.size===0})}}function Qt(...t){return Me(hW,t,pW)}var hW=(t,e)=>t.flatMap(e),pW=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 gW(...t){return Me(mW,t,yW)}function mW(t,e){return t.forEach(e),t}var yW=t=>(e,n,r)=>(t(e,n,r),{done:!1,hasNext:!0,next:e});function Cy(...t){return Me(vW,t)}var vW=(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 jt(...t){return Me(wW,t,bW)}var wW=(t,e)=>t.filter(e),bW=t=>(e,n,r)=>t(e,n,r)?{done:!1,hasNext:!0,next:e}:jo,p_=t=>Object.assign(t,{single:!0});function Ay(...t){return Me(TW,t,p_(EW))}var TW=(t,e)=>t.find(e),EW=t=>(e,n,r)=>t(e,n,r)?{done:!0,hasNext:!0,next:e}:jo;function RW(...t){return Me(SW,t)}var SW=(t,e)=>{for(let n=t.length-1;n>=0;n--){let r=t[n];if(e(r,n,t))return r}};function jn(...t){return Me($W,t,p_(kW))}var $W=([t])=>t,kW=()=>_W,_W=t=>({hasNext:!0,next:t,done:!0});function Uo(...t){return Me(Object.entries,t)}function CW(t,{waitMs:e,timing:n="trailing",maxWaitMs:r}){if(r!==void 0&&e!==void 0&&r<e)throw new Error(`debounce: maxWaitMs (${r}) cannot be less than waitMs (${e})`);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)},l=()=>{if(i===void 0)return;let d=i;i=void 0,clearTimeout(d),o!==void 0&&c()},u=d=>{o=d,r!==void 0&&s===void 0&&(s=setTimeout(c,r))};return{call:(...d)=>{if(i===void 0)n==="trailing"?u(d):a=t(...d);else{n!=="leading"&&u(d);let f=i;i=void 0,clearTimeout(f)}return i=setTimeout(l,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:()=>(l(),a),get isPending(){return i!==void 0},get cachedValue(){return a}}}function AW(...t){return $y(IW,t)}function IW(t){if(t.length===0)return D8;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),jo)}}function g_(...t){return Me(PW,t)}var PW=(t,e)=>e.every(n=>n(t));function xW(...t){return Me(NW,t)}var NW=(t,e)=>e.some(n=>n(t));function OW(...t){return Me(DW,t)}function DW(t,e){if(e<1)throw new RangeError(`chunk: A chunk size of '${e}' 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 m_(...t){return Me(LW,t)}var LW=(t,{min:e,max:n})=>e!==void 0&&t<e?e:n!==void 0&&t>n?n:t;function MW(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 FW(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 jW(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 UW=new TextEncoder,BW=50;function qW(t,e,n){UW.encodeInto(t,e.subarray(n))}function WW(t,e,n){t.length>BW?qW(t,e,n):jW(t,e,n)}var GW=4096;function y_(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,l=t[r++]&63;s.push((a&31)<<12|c<<6|l)}else if((a&248)===240){var c=t[r++]&63,l=t[r++]&63,u=t[r++]&63,d=(a&7)<<18|c<<12|l<<6|u;d>65535&&(d-=65536,s.push(d>>>10&1023|55296),d=56320|d&1023),s.push(d)}else s.push(a);s.length>=GW&&(o+=String.fromCharCode.apply(String,s),s.length=0)}return s.length>0&&(o+=String.fromCharCode.apply(String,s)),o}var zW=new TextDecoder,HW=200;function VW(t,e,n){var r=t.subarray(e,e+n);return zW.decode(r)}function KW(t,e,n){return n>HW?VW(t,e,n):y_(t,e,n)}var kf=function(){function t(e,n){this.type=e,this.data=n}return t}(),YW=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)}}(),$r=function(t){YW(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),Dc=4294967295;function XW(t,e,n){var r=n/4294967296,i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function v_(t,e,n){var r=Math.floor(n/4294967296),i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function w_(t,e){var n=t.getInt32(e),r=t.getUint32(e+4);return n*4294967296+r}function JW(t,e){var n=t.getUint32(e),r=t.getUint32(e+4);return n*4294967296+r}var QW=-1,ZW=4294967296-1,eG=17179869184-1;function tG(t){var e=t.sec,n=t.nsec;if(e>=0&&n>=0&&e<=eG)if(n===0&&e<=ZW){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),v_(i,4,e),r}}function nG(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 rG(t){if(t instanceof Date){var e=nG(t);return tG(e)}else return null}function iG(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=w_(e,4),r=e.getUint32(0);return{sec:n,nsec:r}}default:throw new $r("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(t.length))}}function sG(t){var e=iG(t);return new Date(e.sec*1e3+e.nsec/1e6)}var oG={type:QW,encode:rG,decode:sG},b_=function(){function t(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(oG)}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 kf(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 kf(o,s)}}}return e instanceof kf?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 kf(n,e)},t.defaultCodec=new t,t}();function _f(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 aG(t){if(t instanceof ArrayBuffer)return new DataView(t);var e=_f(t);return new DataView(e.buffer,e.byteOffset,e.byteLength)}var cG=100,lG=2048,uG=function(){function t(e){var n,r,i,s,o,a,c,l;this.extensionCodec=(n=e?.extensionCodec)!==null&&n!==void 0?n:b_.defaultCodec,this.context=e?.context,this.useBigInt64=(r=e?.useBigInt64)!==null&&r!==void 0?r:!1,this.maxDepth=(i=e?.maxDepth)!==null&&i!==void 0?i:cG,this.initialBufferSize=(s=e?.initialBufferSize)!==null&&s!==void 0?s:lG,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=(l=e?.forceIntegerToFloat)!==null&&l!==void 0?l:!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=FW(e);this.ensureBufferSizeToWrite(n+r),this.writeStringHeader(r),WW(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=_f(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),XW(this.view,this.pos,e),this.pos+=8},t.prototype.writeI64=function(e){this.ensureBufferSizeToWrite(8),v_(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 dG(t,e){var n=new uG(e);return n.encodeSharedRef(t)}function Iy(t){return"".concat(t<0?"-":"","0x").concat(Math.abs(t).toString(16).padStart(2,"0"))}var fG=16,hG=16,pG=function(){function t(e,n){e===void 0&&(e=fG),n===void 0&&(n=hG),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,l=0;l<r;l++)if(c[l]!==e[n+l])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=y_(e,n,r),o=Uint8Array.prototype.slice.call(e,n,n+r);return this.store(o,s),s},t}(),gG=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(u){try{l(r.next(u))}catch(d){o(d)}}function c(u){try{l(r.throw(u))}catch(d){o(d)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((r=r.apply(t,e||[])).next())})},Py=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(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){n.label=l[1];break}if(l[0]===6&&n.label<s[1]){n.label=s[1],s=l;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(l);break}s[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(u){l=[6,u],i=0}finally{r=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},T_=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(l){s({value:l,done:a})},o)}},Bo=function(t){return this instanceof Bo?(this.v=t,this):new Bo(t)},mG=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,y){s.push([f,h,p,y])>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 Bo?Promise.resolve(f.value.v).then(l,u):d(s[0][2],f)}function l(f){a("next",f)}function u(f){a("throw",f)}function d(f,h){f(h),s.shift(),s.length&&a(s[0][0],s[0][1])}},E_="array",Cf="map_key",yG="map_value",vG=function(t){return typeof t=="string"||typeof t=="number"},Lc=-1,xy=new DataView(new ArrayBuffer(0)),wG=new Uint8Array(xy.buffer);try{xy.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 Ny=RangeError,R_=new Ny("Insufficient data"),bG=new pG,TG=function(){function t(e){var n,r,i,s,o,a,c;this.totalPos=0,this.pos=0,this.view=xy,this.bytes=wG,this.headByte=Lc,this.stack=[],this.extensionCodec=(n=e?.extensionCodec)!==null&&n!==void 0?n:b_.defaultCodec,this.context=e?.context,this.useBigInt64=(r=e?.useBigInt64)!==null&&r!==void 0?r:!1,this.maxStrLength=(i=e?.maxStrLength)!==null&&i!==void 0?i:Dc,this.maxBinLength=(s=e?.maxBinLength)!==null&&s!==void 0?s:Dc,this.maxArrayLength=(o=e?.maxArrayLength)!==null&&o!==void 0?o:Dc,this.maxMapLength=(a=e?.maxMapLength)!==null&&a!==void 0?a:Dc,this.maxExtLength=(c=e?.maxExtLength)!==null&&c!==void 0?c:Dc,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:bG}return t.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=Lc,this.stack.length=0},t.prototype.setBuffer=function(e){this.bytes=_f(e),this.view=aG(this.bytes),this.pos=0},t.prototype.appendBuffer=function(e){if(this.headByte===Lc&&!this.hasRemaining(1))this.setBuffer(e);else{var n=this.bytes.subarray(this.pos),r=_f(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 Py(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 gG(this,void 0,void 0,function(){var l,u,d,f,h,p,y,$;return Py(this,function(T){switch(T.label){case 0:l=!1,T.label=1;case 1:T.trys.push([1,6,7,12]),n=!0,r=T_(e),T.label=2;case 2:return[4,r.next()];case 3:if(i=T.sent(),s=i.done,!!s)return[3,5];c=i.value,n=!1;try{if(d=c,l)throw this.createExtraByteError(this.totalPos);this.appendBuffer(d);try{u=this.doDecodeSync(),l=!0}catch(w){if(!(w instanceof Ny))throw w}this.totalPos+=this.pos}finally{n=!0}T.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return f=T.sent(),o={error:f},[3,12];case 7:return T.trys.push([7,,10,11]),!n&&!s&&(a=r.return)?[4,a.call(r)]:[3,9];case 8:T.sent(),T.label=9;case 9:return[3,11];case 10:if(o)throw o.error;return[7];case 11:return[7];case 12:if(l){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,u]}throw h=this,p=h.headByte,y=h.pos,$=h.totalPos,new RangeError("Insufficient data in parsing ".concat(Iy(p)," at ").concat($," (").concat(y," 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 mG(this,arguments,function(){var i,s,o,a,c,l,u,d,f,h,p,y;return Py(this,function($){switch($.label){case 0:i=n,s=-1,$.label=1;case 1:$.trys.push([1,15,16,21]),o=!0,a=T_(e),$.label=2;case 2:return[4,Bo(a.next())];case 3:if(c=$.sent(),f=c.done,!!f)return[3,14];y=c.value,o=!1,$.label=4;case 4:if($.trys.push([4,,12,13]),l=y,n&&s===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(l),i&&(s=this.readArraySize(),i=!1,this.complete()),$.label=5;case 5:$.trys.push([5,10,,11]),$.label=6;case 6:return[4,Bo(this.doDecodeSync())];case 7:return[4,$.sent()];case 8:return $.sent(),--s===0?[3,9]:[3,6];case 9:return[3,11];case 10:if(u=$.sent(),!(u instanceof Ny))throw u;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=$.sent(),h={error:d},[3,21];case 16:return $.trys.push([16,,19,20]),!o&&!f&&(p=a.return)?[4,Bo(p.call(a))]:[3,18];case 17:$.sent(),$.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 $r("Unrecognized type byte: ".concat(Iy(e)));this.complete();for(var s=this.stack;s.length>0;){var o=s[s.length-1];if(o.type===E_)if(o.array[o.position]=n,o.position++,o.position===o.size)s.pop(),n=o.array;else continue e;else if(o.type===Cf){if(!vG(n))throw new $r("The type of key must be string or number but "+typeof n);if(n==="__proto__")throw new $r("The key __proto__ is not allowed");o.key=n,o.type=yG;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=Cf;continue e}}return n}},t.prototype.readHeadByte=function(){return this.headByte===Lc&&(this.headByte=this.readU8()),this.headByte},t.prototype.complete=function(){this.headByte=Lc},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 $r("Unrecognized array type byte: ".concat(Iy(e)))}}},t.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new $r("Max length exceeded: map length (".concat(e,") > maxMapLengthLength (").concat(this.maxMapLength,")"));this.stack.push({type:Cf,size:e,key:null,readCount:0,map:{}})},t.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new $r("Max length exceeded: array length (".concat(e,") > maxArrayLength (").concat(this.maxArrayLength,")"));this.stack.push({type:E_,size:e,array:new Array(e),position:0})},t.prototype.decodeUtf8String=function(e,n){var r;if(e>this.maxStrLength)throw new $r("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLength<this.pos+n+e)throw R_;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=KW(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===Cf}return!1},t.prototype.decodeBinary=function(e,n){if(e>this.maxBinLength)throw new $r("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+n))throw R_;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 $r("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=JW(this.view,this.pos);return this.pos+=8,e},t.prototype.readI64=function(){var e=w_(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 EG(t,e){var n=new TG(e);return n.decode(t)}const RG=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]",SG=(t,e=0,n=t.byteLength-e)=>{if(!RG(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return up.from(t,e,n)},S_=(t,e)=>{if(typeof t!="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return e?up.from(t,e):up.from(t)},$G=/^[A-Za-z0-9+/]*={0,2}$/,kG=t=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!$G.exec(t))throw new TypeError("Invalid base64 string.");const e=S_(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},_G=t=>{const e=S_(t,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT)},CG=t=>{let e;if(typeof t=="string"?e=_G(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 SG(e.buffer,e.byteOffset,e.byteLength).toString("base64")},AG=`likec4lib {
|
|
172
|
-
icons {
|
|
173
|
-
aws:activate
|
|
174
|
-
aws:alexa-for-business
|
|
175
|
-
aws:amplify
|
|
176
|
-
aws:apache-mxnet-on-aws
|
|
177
|
-
aws:api-gateway
|
|
178
|
-
aws:app-config
|
|
179
|
-
aws:app-flow
|
|
180
|
-
aws:app-mesh
|
|
181
|
-
aws:app-runner
|
|
182
|
-
aws:app-stream
|
|
183
|
-
aws:app-sync
|
|
184
|
-
aws:application-auto-scaling
|
|
185
|
-
aws:application-composer
|
|
186
|
-
aws:application-cost-profiler
|
|
187
|
-
aws:application-discovery-service
|
|
188
|
-
aws:application-migration-service
|
|
189
|
-
aws:artifact
|
|
190
|
-
aws:athena
|
|
191
|
-
aws:audit-manager
|
|
192
|
-
aws:augmented-ai-a2i
|
|
193
|
-
aws:aurora
|
|
194
|
-
aws:auto-scaling
|
|
195
|
-
aws:backint-agent
|
|
196
|
-
aws:backup
|
|
197
|
-
aws:batch
|
|
198
|
-
aws:billing-conductor
|
|
199
|
-
aws:bottlerocket
|
|
200
|
-
aws:braket
|
|
201
|
-
aws:budgets
|
|
202
|
-
aws:certificate-manager
|
|
203
|
-
aws:chatbot
|
|
204
|
-
aws:chime
|
|
205
|
-
aws:chime-sdk
|
|
206
|
-
aws:chime-voice-connector
|
|
207
|
-
aws:clean-rooms
|
|
208
|
-
aws:client-vpn
|
|
209
|
-
aws:cloud-control-api
|
|
210
|
-
aws:cloud-development-kit
|
|
211
|
-
aws:cloud-directory
|
|
212
|
-
aws:cloud-formation
|
|
213
|
-
aws:cloud-front
|
|
214
|
-
aws:cloud-hsm
|
|
215
|
-
aws:cloud-map
|
|
216
|
-
aws:cloud-search
|
|
217
|
-
aws:cloud-shell
|
|
218
|
-
aws:cloud-trail
|
|
219
|
-
aws:cloud-wan
|
|
220
|
-
aws:cloud-watch
|
|
221
|
-
aws:cloud9
|
|
222
|
-
aws:code-artifact
|
|
223
|
-
aws:code-build
|
|
224
|
-
aws:code-catalyst
|
|
225
|
-
aws:code-commit
|
|
226
|
-
aws:code-deploy
|
|
227
|
-
aws:code-guru
|
|
228
|
-
aws:code-pipeline
|
|
229
|
-
aws:code-star
|
|
230
|
-
aws:code-whisperer
|
|
231
|
-
aws:cognito
|
|
232
|
-
aws:command-line-interface
|
|
233
|
-
aws:comprehend
|
|
234
|
-
aws:comprehend-medical
|
|
235
|
-
aws:compute-optimizer
|
|
236
|
-
aws:config
|
|
237
|
-
aws:connect
|
|
238
|
-
aws:console-mobile-application
|
|
239
|
-
aws:control-tower
|
|
240
|
-
aws:corretto
|
|
241
|
-
aws:cost-and-usage-report
|
|
242
|
-
aws:cost-explorer
|
|
243
|
-
aws:data-exchange
|
|
244
|
-
aws:data-pipeline
|
|
245
|
-
aws:data-sync
|
|
246
|
-
aws:data-zone
|
|
247
|
-
aws:database-migration-service
|
|
248
|
-
aws:deep-composer
|
|
249
|
-
aws:deep-learning-amis
|
|
250
|
-
aws:deep-learning-containers
|
|
251
|
-
aws:deep-lens
|
|
252
|
-
aws:deep-racer
|
|
253
|
-
aws:detective
|
|
254
|
-
aws:dev-ops-guru
|
|
255
|
-
aws:device-farm
|
|
256
|
-
aws:direct-connect
|
|
257
|
-
aws:directory-service
|
|
258
|
-
aws:distro-for-open-telemetry
|
|
259
|
-
aws:document-db
|
|
260
|
-
aws:dynamo-db
|
|
261
|
-
aws:ec2
|
|
262
|
-
aws:ec2-auto-scaling
|
|
263
|
-
aws:ec2-image-builder
|
|
264
|
-
aws:ecs-anywhere
|
|
265
|
-
aws:efs
|
|
266
|
-
aws:eks-anywhere
|
|
267
|
-
aws:eks-cloud
|
|
268
|
-
aws:eks-distro
|
|
269
|
-
aws:elasti-cache
|
|
270
|
-
aws:elastic-beanstalk
|
|
271
|
-
aws:elastic-block-store
|
|
272
|
-
aws:elastic-container-registry
|
|
273
|
-
aws:elastic-container-service
|
|
274
|
-
aws:elastic-disaster-recovery
|
|
275
|
-
aws:elastic-fabric-adapter
|
|
276
|
-
aws:elastic-inference
|
|
277
|
-
aws:elastic-kubernetes-service
|
|
278
|
-
aws:elastic-load-balancing
|
|
279
|
-
aws:elastic-transcoder
|
|
280
|
-
aws:elemental-appliances-software
|
|
281
|
-
aws:elemental-conductor
|
|
282
|
-
aws:elemental-delta
|
|
283
|
-
aws:elemental-link
|
|
284
|
-
aws:elemental-live
|
|
285
|
-
aws:elemental-media-connect
|
|
286
|
-
aws:elemental-media-convert
|
|
287
|
-
aws:elemental-media-live
|
|
288
|
-
aws:elemental-media-package
|
|
289
|
-
aws:elemental-media-store
|
|
290
|
-
aws:elemental-media-tailor
|
|
291
|
-
aws:elemental-server
|
|
292
|
-
aws:emr
|
|
293
|
-
aws:event-bridge
|
|
294
|
-
aws:express-workflows
|
|
295
|
-
aws:fargate
|
|
296
|
-
aws:fault-injection-simulator
|
|
297
|
-
aws:file-cache
|
|
298
|
-
aws:fin-space
|
|
299
|
-
aws:firewall-manager
|
|
300
|
-
aws:forecast
|
|
301
|
-
aws:fraud-detector
|
|
302
|
-
aws:free-rtos
|
|
303
|
-
aws:fsx
|
|
304
|
-
aws:fsx-for-lustre
|
|
305
|
-
aws:fsx-for-net-app-ontap
|
|
306
|
-
aws:fsx-for-open-zfs
|
|
307
|
-
aws:fsx-for-wfs
|
|
308
|
-
aws:game-kit
|
|
309
|
-
aws:game-lift
|
|
310
|
-
aws:game-sparks
|
|
311
|
-
aws:genomics-cli
|
|
312
|
-
aws:global-accelerator
|
|
313
|
-
aws:glue
|
|
314
|
-
aws:glue-data-brew
|
|
315
|
-
aws:glue-elastic-views
|
|
316
|
-
aws:ground-station
|
|
317
|
-
aws:guard-duty
|
|
318
|
-
aws:health-lake
|
|
319
|
-
aws:honeycode
|
|
320
|
-
aws:iam-identity-center
|
|
321
|
-
aws:identity-and-access-management
|
|
322
|
-
aws:inspector
|
|
323
|
-
aws:interactive-video-service
|
|
324
|
-
aws:io-t-1-click
|
|
325
|
-
aws:io-t-analytics
|
|
326
|
-
aws:io-t-button
|
|
327
|
-
aws:io-t-core
|
|
328
|
-
aws:io-t-device-defender
|
|
329
|
-
aws:io-t-device-management
|
|
330
|
-
aws:io-t-edu-kit
|
|
331
|
-
aws:io-t-events
|
|
332
|
-
aws:io-t-express-link
|
|
333
|
-
aws:io-t-fleet-wise
|
|
334
|
-
aws:io-t-greengrass
|
|
335
|
-
aws:io-t-robo-runner
|
|
336
|
-
aws:io-t-site-wise
|
|
337
|
-
aws:io-t-things-graph
|
|
338
|
-
aws:io-t-twin-maker
|
|
339
|
-
aws:iq
|
|
340
|
-
aws:kendra
|
|
341
|
-
aws:key-management-service
|
|
342
|
-
aws:keyspaces
|
|
343
|
-
aws:kinesis
|
|
344
|
-
aws:kinesis-data-analytics
|
|
345
|
-
aws:kinesis-data-streams
|
|
346
|
-
aws:kinesis-firehose
|
|
347
|
-
aws:kinesis-video-streams
|
|
348
|
-
aws:lake-formation
|
|
349
|
-
aws:lambda
|
|
350
|
-
aws:launch-wizard
|
|
351
|
-
aws:lex
|
|
352
|
-
aws:license-manager
|
|
353
|
-
aws:lightsail
|
|
354
|
-
aws:local-zones
|
|
355
|
-
aws:location-service
|
|
356
|
-
aws:lookout-for-equipment
|
|
357
|
-
aws:lookout-for-metrics
|
|
358
|
-
aws:lookout-for-vision
|
|
359
|
-
aws:lumberyard
|
|
360
|
-
aws:macie
|
|
361
|
-
aws:mainframe-modernization
|
|
362
|
-
aws:managed-blockchain
|
|
363
|
-
aws:managed-grafana
|
|
364
|
-
aws:managed-service-for-prometheus
|
|
365
|
-
aws:managed-services
|
|
366
|
-
aws:managed-streaming-for-apache-kafka
|
|
367
|
-
aws:managed-workflows-for-apache-airflow
|
|
368
|
-
aws:management-console
|
|
369
|
-
aws:marketplace-dark
|
|
370
|
-
aws:marketplace-light
|
|
371
|
-
aws:memory-db-for-redis
|
|
372
|
-
aws:migration-evaluator
|
|
373
|
-
aws:migration-hub
|
|
374
|
-
aws:monitron
|
|
375
|
-
aws:mq
|
|
376
|
-
aws:neptune
|
|
377
|
-
aws:network-firewall
|
|
378
|
-
aws:neuron
|
|
379
|
-
aws:nice-dcv
|
|
380
|
-
aws:nice-engin-frame
|
|
381
|
-
aws:nimble-studio
|
|
382
|
-
aws:nitro-enclaves
|
|
383
|
-
aws:omics
|
|
384
|
-
aws:open-3d-engine
|
|
385
|
-
aws:open-search-service
|
|
386
|
-
aws:ops-works
|
|
387
|
-
aws:organizations
|
|
388
|
-
aws:outposts-family
|
|
389
|
-
aws:outposts-rack
|
|
390
|
-
aws:outposts-servers
|
|
391
|
-
aws:panorama
|
|
392
|
-
aws:parallel-cluster
|
|
393
|
-
aws:personal-health-dashboard
|
|
394
|
-
aws:personalize
|
|
395
|
-
aws:pinpoint
|
|
396
|
-
aws:pinpoint-apis
|
|
397
|
-
aws:polly
|
|
398
|
-
aws:private-5g
|
|
399
|
-
aws:private-certificate-authority
|
|
400
|
-
aws:private-link
|
|
401
|
-
aws:professional-services
|
|
402
|
-
aws:proton
|
|
403
|
-
aws:quantum-ledger-database
|
|
404
|
-
aws:quick-sight
|
|
405
|
-
aws:rds
|
|
406
|
-
aws:rds-on-vmware
|
|
407
|
-
aws:re-post
|
|
408
|
-
aws:red-hat-open-shift-service-on-aws
|
|
409
|
-
aws:redshift
|
|
410
|
-
aws:rekognition
|
|
411
|
-
aws:reserved-instance-reporting
|
|
412
|
-
aws:resilience-hub
|
|
413
|
-
aws:resource-access-manager
|
|
414
|
-
aws:resource-explorer
|
|
415
|
-
aws:robo-maker
|
|
416
|
-
aws:route-53
|
|
417
|
-
aws:s3-on-outposts
|
|
418
|
-
aws:sage-maker
|
|
419
|
-
aws:sage-maker-ground-truth
|
|
420
|
-
aws:sage-maker-studio-lab
|
|
421
|
-
aws:savings-plans
|
|
422
|
-
aws:secrets-manager
|
|
423
|
-
aws:security-hub
|
|
424
|
-
aws:security-lake
|
|
425
|
-
aws:server-migration-service
|
|
426
|
-
aws:serverless-application-repository
|
|
427
|
-
aws:service-catalog
|
|
428
|
-
aws:service-management-connector
|
|
429
|
-
aws:shield
|
|
430
|
-
aws:signer
|
|
431
|
-
aws:sim-space-weaver
|
|
432
|
-
aws:simple-email-service
|
|
433
|
-
aws:simple-notification-service
|
|
434
|
-
aws:simple-queue-service
|
|
435
|
-
aws:simple-storage-service
|
|
436
|
-
aws:simple-storage-service-glacier
|
|
437
|
-
aws:site-to-site-vpn
|
|
438
|
-
aws:snowball
|
|
439
|
-
aws:snowball-edge
|
|
440
|
-
aws:snowcone
|
|
441
|
-
aws:snowmobile
|
|
442
|
-
aws:step-functions
|
|
443
|
-
aws:storage-gateway
|
|
444
|
-
aws:sumerian
|
|
445
|
-
aws:supply-chain
|
|
446
|
-
aws:support
|
|
447
|
-
aws:systems-manager
|
|
448
|
-
aws:tensor-flow-on-aws
|
|
449
|
-
aws:textract
|
|
450
|
-
aws:thinkbox-deadline
|
|
451
|
-
aws:thinkbox-frost
|
|
452
|
-
aws:thinkbox-krakatoa
|
|
453
|
-
aws:thinkbox-sequoia
|
|
454
|
-
aws:thinkbox-stoke
|
|
455
|
-
aws:thinkbox-xmesh
|
|
456
|
-
aws:timestream
|
|
457
|
-
aws:tools-and-sdks
|
|
458
|
-
aws:torch-serve
|
|
459
|
-
aws:training-certification
|
|
460
|
-
aws:transcribe
|
|
461
|
-
aws:transfer-family
|
|
462
|
-
aws:transit-gateway
|
|
463
|
-
aws:translate
|
|
464
|
-
aws:trusted-advisor
|
|
465
|
-
aws:verified-access
|
|
466
|
-
aws:verified-permissions
|
|
467
|
-
aws:virtual-private-cloud
|
|
468
|
-
aws:vmware-cloud-on-aws
|
|
469
|
-
aws:vpc-lattice
|
|
470
|
-
aws:waf
|
|
471
|
-
aws:wavelength
|
|
472
|
-
aws:well-architected-tool
|
|
473
|
-
aws:wickr
|
|
474
|
-
aws:work-docs
|
|
475
|
-
aws:work-docs-sdk
|
|
476
|
-
aws:work-link
|
|
477
|
-
aws:work-mail
|
|
478
|
-
aws:work-spaces-family
|
|
479
|
-
aws:x-ray
|
|
480
|
-
gcp:access-context-manager
|
|
481
|
-
gcp:administration
|
|
482
|
-
gcp:advanced-agent-modeling
|
|
483
|
-
gcp:advanced-solutions-lab
|
|
484
|
-
gcp:agent-assist
|
|
485
|
-
gcp:ai-hub
|
|
486
|
-
gcp:ai-platform
|
|
487
|
-
gcp:ai-platform-unified
|
|
488
|
-
gcp:analytics-hub
|
|
489
|
-
gcp:anthos
|
|
490
|
-
gcp:anthos-config-management
|
|
491
|
-
gcp:anthos-service-mesh
|
|
492
|
-
gcp:api
|
|
493
|
-
gcp:api-analytics
|
|
494
|
-
gcp:api-monetization
|
|
495
|
-
gcp:apigee-api-platform
|
|
496
|
-
gcp:apigee-sense
|
|
497
|
-
gcp:app-engine
|
|
498
|
-
gcp:artifact-registry
|
|
499
|
-
gcp:asset-inventory
|
|
500
|
-
gcp:assured-workloads
|
|
501
|
-
gcp:auto-ml
|
|
502
|
-
gcp:auto-ml-natural-language
|
|
503
|
-
gcp:auto-ml-tables
|
|
504
|
-
gcp:auto-ml-translation
|
|
505
|
-
gcp:auto-ml-video-intelligence
|
|
506
|
-
gcp:auto-ml-vision
|
|
507
|
-
gcp:bare-metal-solutions
|
|
508
|
-
gcp:batch
|
|
509
|
-
gcp:beyondcorp
|
|
510
|
-
gcp:big-query
|
|
511
|
-
gcp:bigtable
|
|
512
|
-
gcp:billing
|
|
513
|
-
gcp:binary-authorization
|
|
514
|
-
gcp:catalog
|
|
515
|
-
gcp:certificate-authority-service
|
|
516
|
-
gcp:certificate-manager
|
|
517
|
-
gcp:cloud-api-gateway
|
|
518
|
-
gcp:cloud-apis
|
|
519
|
-
gcp:cloud-armor
|
|
520
|
-
gcp:cloud-asset-inventory
|
|
521
|
-
gcp:cloud-audit-logs
|
|
522
|
-
gcp:cloud-build
|
|
523
|
-
gcp:cloud-cdn
|
|
524
|
-
gcp:cloud-code
|
|
525
|
-
gcp:cloud-composer
|
|
526
|
-
gcp:cloud-data-fusion
|
|
527
|
-
gcp:cloud-deploy
|
|
528
|
-
gcp:cloud-deployment-manager
|
|
529
|
-
gcp:cloud-dns
|
|
530
|
-
gcp:cloud-domains
|
|
531
|
-
gcp:cloud-ekm
|
|
532
|
-
gcp:cloud-endpoints
|
|
533
|
-
gcp:cloud-external-ip-addresses
|
|
534
|
-
gcp:cloud-firewall-rules
|
|
535
|
-
gcp:cloud-for-marketing
|
|
536
|
-
gcp:cloud-functions
|
|
537
|
-
gcp:cloud-generic
|
|
538
|
-
gcp:cloud-gpu
|
|
539
|
-
gcp:cloud-healthcare-api
|
|
540
|
-
gcp:cloud-healthcare-marketplace
|
|
541
|
-
gcp:cloud-hsm
|
|
542
|
-
gcp:cloud-ids
|
|
543
|
-
gcp:cloud-inference-api
|
|
544
|
-
gcp:cloud-interconnect
|
|
545
|
-
gcp:cloud-jobs-api
|
|
546
|
-
gcp:cloud-load-balancing
|
|
547
|
-
gcp:cloud-logging
|
|
548
|
-
gcp:cloud-media-edge
|
|
549
|
-
gcp:cloud-monitoring
|
|
550
|
-
gcp:cloud-nat
|
|
551
|
-
gcp:cloud-natural-language-api
|
|
552
|
-
gcp:cloud-network
|
|
553
|
-
gcp:cloud-ops
|
|
554
|
-
gcp:cloud-optimization-ai
|
|
555
|
-
gcp:cloud-optimization-ai-fleet-routing-api
|
|
556
|
-
gcp:cloud-router
|
|
557
|
-
gcp:cloud-routes
|
|
558
|
-
gcp:cloud-run
|
|
559
|
-
gcp:cloud-run-for-anthos
|
|
560
|
-
gcp:cloud-scheduler
|
|
561
|
-
gcp:cloud-security-scanner
|
|
562
|
-
gcp:cloud-shell
|
|
563
|
-
gcp:cloud-spanner
|
|
564
|
-
gcp:cloud-sql
|
|
565
|
-
gcp:cloud-storage
|
|
566
|
-
gcp:cloud-tasks
|
|
567
|
-
gcp:cloud-test-lab
|
|
568
|
-
gcp:cloud-tpu
|
|
569
|
-
gcp:cloud-translation-api
|
|
570
|
-
gcp:cloud-vision-api
|
|
571
|
-
gcp:cloud-vpn
|
|
572
|
-
gcp:compute-engine
|
|
573
|
-
gcp:configuration-management
|
|
574
|
-
gcp:connectivity-test
|
|
575
|
-
gcp:connectors
|
|
576
|
-
gcp:contact-center-ai
|
|
577
|
-
gcp:container-optimized-os
|
|
578
|
-
gcp:container-registry
|
|
579
|
-
gcp:data-catalog
|
|
580
|
-
gcp:data-labeling
|
|
581
|
-
gcp:data-layers
|
|
582
|
-
gcp:data-loss-prevention-api
|
|
583
|
-
gcp:data-qn-a
|
|
584
|
-
gcp:data-studio
|
|
585
|
-
gcp:data-transfer
|
|
586
|
-
gcp:database-migration-service
|
|
587
|
-
gcp:dataflow
|
|
588
|
-
gcp:datalab
|
|
589
|
-
gcp:dataplex
|
|
590
|
-
gcp:datapol
|
|
591
|
-
gcp:dataprep
|
|
592
|
-
gcp:dataproc
|
|
593
|
-
gcp:dataproc-metastore
|
|
594
|
-
gcp:datashare
|
|
595
|
-
gcp:datastore
|
|
596
|
-
gcp:datastream
|
|
597
|
-
gcp:debugger
|
|
598
|
-
gcp:developer-portal
|
|
599
|
-
gcp:dialogflow
|
|
600
|
-
gcp:dialogflow-cx
|
|
601
|
-
gcp:dialogflow-insights
|
|
602
|
-
gcp:document-ai
|
|
603
|
-
gcp:early-access-center
|
|
604
|
-
gcp:error-reporting
|
|
605
|
-
gcp:eventarc
|
|
606
|
-
gcp:filestore
|
|
607
|
-
gcp:financial-services-marketplace
|
|
608
|
-
gcp:firestore
|
|
609
|
-
gcp:fleet-engine
|
|
610
|
-
gcp:free-trial
|
|
611
|
-
gcp:game-servers
|
|
612
|
-
gcp:gce-systems-management
|
|
613
|
-
gcp:genomics
|
|
614
|
-
gcp:gke-on-prem
|
|
615
|
-
gcp:google-cloud-marketplace
|
|
616
|
-
gcp:google-kubernetes-engine
|
|
617
|
-
gcp:google-maps-platform
|
|
618
|
-
gcp:healthcare-nlp-api
|
|
619
|
-
gcp:home
|
|
620
|
-
gcp:identity-and-access-management
|
|
621
|
-
gcp:identity-aware-proxy
|
|
622
|
-
gcp:identity-platform
|
|
623
|
-
gcp:iot-core
|
|
624
|
-
gcp:iot-edge
|
|
625
|
-
gcp:key-access-justifications
|
|
626
|
-
gcp:key-management-service
|
|
627
|
-
gcp:kuberun
|
|
628
|
-
gcp:launcher
|
|
629
|
-
gcp:local-ssd
|
|
630
|
-
gcp:looker
|
|
631
|
-
gcp:managed-service-for-microsoft-active-directory
|
|
632
|
-
gcp:media-translation-api
|
|
633
|
-
gcp:memorystore
|
|
634
|
-
gcp:migrate-for-anthos
|
|
635
|
-
gcp:migrate-for-compute-engine
|
|
636
|
-
gcp:my-cloud
|
|
637
|
-
gcp:network-connectivity-center
|
|
638
|
-
gcp:network-intelligence-center
|
|
639
|
-
gcp:network-security
|
|
640
|
-
gcp:network-tiers
|
|
641
|
-
gcp:network-topology
|
|
642
|
-
gcp:onboarding
|
|
643
|
-
gcp:os-configuration-management
|
|
644
|
-
gcp:os-inventory-management
|
|
645
|
-
gcp:os-patch-management
|
|
646
|
-
gcp:partner-interconnect
|
|
647
|
-
gcp:partner-portal
|
|
648
|
-
gcp:performance-dashboard
|
|
649
|
-
gcp:permissions
|
|
650
|
-
gcp:persistent-disk
|
|
651
|
-
gcp:phishing-protection
|
|
652
|
-
gcp:policy-analyzer
|
|
653
|
-
gcp:premium-network-tier
|
|
654
|
-
gcp:private-connectivity
|
|
655
|
-
gcp:private-service-connect
|
|
656
|
-
gcp:producer-portal
|
|
657
|
-
gcp:profiler
|
|
658
|
-
gcp:project
|
|
659
|
-
gcp:pub-sub
|
|
660
|
-
gcp:quantum-engine
|
|
661
|
-
gcp:quotas
|
|
662
|
-
gcp:real-world-insights
|
|
663
|
-
gcp:recommendations-ai
|
|
664
|
-
gcp:release-notes
|
|
665
|
-
gcp:retail-api
|
|
666
|
-
gcp:risk-manager
|
|
667
|
-
gcp:runtime-config
|
|
668
|
-
gcp:secret-manager
|
|
669
|
-
gcp:security
|
|
670
|
-
gcp:security-command-center
|
|
671
|
-
gcp:security-health-advisor
|
|
672
|
-
gcp:security-key-enforcement
|
|
673
|
-
gcp:service-discovery
|
|
674
|
-
gcp:speech-to-text
|
|
675
|
-
gcp:stackdriver
|
|
676
|
-
gcp:standard-network-tier
|
|
677
|
-
gcp:stream-suite
|
|
678
|
-
gcp:support
|
|
679
|
-
gcp:tensorflow-enterprise
|
|
680
|
-
gcp:text-to-speech
|
|
681
|
-
gcp:tools-for-powershell
|
|
682
|
-
gcp:trace
|
|
683
|
-
gcp:traffic-director
|
|
684
|
-
gcp:transfer
|
|
685
|
-
gcp:transfer-appliance
|
|
686
|
-
gcp:user-preferences
|
|
687
|
-
gcp:vertex-ai
|
|
688
|
-
gcp:video-intelligence-api
|
|
689
|
-
gcp:virtual-private-cloud
|
|
690
|
-
gcp:visual-inspection
|
|
691
|
-
gcp:vmware-engine
|
|
692
|
-
gcp:web-risk
|
|
693
|
-
gcp:web-security-scanner
|
|
694
|
-
gcp:workflows
|
|
695
|
-
gcp:workload-identity-pool
|
|
696
|
-
tech:aarch64
|
|
697
|
-
tech:adobe-illustrator
|
|
698
|
-
tech:adobe-photoshop
|
|
699
|
-
tech:adobe-premiere-pro
|
|
700
|
-
tech:adobe-xd
|
|
701
|
-
tech:adonis-js
|
|
702
|
-
tech:after-effects
|
|
703
|
-
tech:airflow
|
|
704
|
-
tech:akka
|
|
705
|
-
tech:algolia
|
|
706
|
-
tech:alpine-js
|
|
707
|
-
tech:amazon-web-services
|
|
708
|
-
tech:anaconda
|
|
709
|
-
tech:android
|
|
710
|
-
tech:android-studio
|
|
711
|
-
tech:angular
|
|
712
|
-
tech:angular-js
|
|
713
|
-
tech:ansible
|
|
714
|
-
tech:ant-design
|
|
715
|
-
tech:apache
|
|
716
|
-
tech:apl
|
|
717
|
-
tech:appcelerator
|
|
718
|
-
tech:apple
|
|
719
|
-
tech:apple-safari
|
|
720
|
-
tech:appwrite
|
|
721
|
-
tech:arch-linux
|
|
722
|
-
tech:arduino
|
|
723
|
-
tech:argo-cd
|
|
724
|
-
tech:astro
|
|
725
|
-
tech:atom
|
|
726
|
-
tech:autodesk-maya
|
|
727
|
-
tech:autodesk-shot-grid
|
|
728
|
-
tech:awk
|
|
729
|
-
tech:azios
|
|
730
|
-
tech:azure
|
|
731
|
-
tech:azure-devops
|
|
732
|
-
tech:azure-sql-database
|
|
733
|
-
tech:babel
|
|
734
|
-
tech:backbone-js
|
|
735
|
-
tech:ballerina
|
|
736
|
-
tech:bamboo
|
|
737
|
-
tech:bash
|
|
738
|
-
tech:behance
|
|
739
|
-
tech:bitbucket
|
|
740
|
-
tech:blender
|
|
741
|
-
tech:bootstrap
|
|
742
|
-
tech:bower
|
|
743
|
-
tech:browserstack
|
|
744
|
-
tech:bulma
|
|
745
|
-
tech:bun
|
|
746
|
-
tech:c
|
|
747
|
-
tech:cairo-graphics
|
|
748
|
-
tech:cake-php
|
|
749
|
-
tech:canva
|
|
750
|
-
tech:capacitor
|
|
751
|
-
tech:cassandra
|
|
752
|
-
tech:cent-os
|
|
753
|
-
tech:chrome
|
|
754
|
-
tech:circle-ci
|
|
755
|
-
tech:clarity
|
|
756
|
-
tech:clion
|
|
757
|
-
tech:clojure
|
|
758
|
-
tech:clojure-script
|
|
759
|
-
tech:cloudflare
|
|
760
|
-
tech:cloudflare-workers
|
|
761
|
-
tech:cmake
|
|
762
|
-
tech:code-igniter
|
|
763
|
-
tech:code-pen
|
|
764
|
-
tech:codeac
|
|
765
|
-
tech:codecov
|
|
766
|
-
tech:coffee-script
|
|
767
|
-
tech:composer
|
|
768
|
-
tech:confluence
|
|
769
|
-
tech:consul
|
|
770
|
-
tech:contao
|
|
771
|
-
tech:corejs
|
|
772
|
-
tech:cosmosdb
|
|
773
|
-
tech:couchdb
|
|
774
|
-
tech:cplusplus
|
|
775
|
-
tech:crystal
|
|
776
|
-
tech:csharp
|
|
777
|
-
tech:css3
|
|
778
|
-
tech:cucumber
|
|
779
|
-
tech:cypress
|
|
780
|
-
tech:d3js
|
|
781
|
-
tech:dart
|
|
782
|
-
tech:data-grip
|
|
783
|
-
tech:data-spell
|
|
784
|
-
tech:dbeaver
|
|
785
|
-
tech:debian
|
|
786
|
-
tech:deno
|
|
787
|
-
tech:devicon
|
|
788
|
-
tech:digital-ocean
|
|
789
|
-
tech:discord-js
|
|
790
|
-
tech:django
|
|
791
|
-
tech:django-rest
|
|
792
|
-
tech:docker
|
|
793
|
-
tech:doctrine
|
|
794
|
-
tech:dropwizard
|
|
795
|
-
tech:drupal
|
|
796
|
-
tech:eclipse-ceylon
|
|
797
|
-
tech:eclipse-ide
|
|
798
|
-
tech:eclipse-vert-x
|
|
799
|
-
tech:elasticbeats
|
|
800
|
-
tech:elasticsearch
|
|
801
|
-
tech:electron
|
|
802
|
-
tech:eleventy-11ty
|
|
803
|
-
tech:elixir
|
|
804
|
-
tech:elm
|
|
805
|
-
tech:embedded-c
|
|
806
|
-
tech:ember-js
|
|
807
|
-
tech:envoy
|
|
808
|
-
tech:erlang
|
|
809
|
-
tech:eslint
|
|
810
|
-
tech:express
|
|
811
|
-
tech:facebook
|
|
812
|
-
tech:fast-api
|
|
813
|
-
tech:fastify
|
|
814
|
-
tech:fauna
|
|
815
|
-
tech:feathers
|
|
816
|
-
tech:fedora
|
|
817
|
-
tech:figma
|
|
818
|
-
tech:file-zilla
|
|
819
|
-
tech:firebase
|
|
820
|
-
tech:firefox
|
|
821
|
-
tech:flask
|
|
822
|
-
tech:flutter
|
|
823
|
-
tech:fortran
|
|
824
|
-
tech:foundation
|
|
825
|
-
tech:fsharp
|
|
826
|
-
tech:gatling
|
|
827
|
-
tech:gatsby
|
|
828
|
-
tech:gazebo
|
|
829
|
-
tech:gcc
|
|
830
|
-
tech:gentoo
|
|
831
|
-
tech:ghost
|
|
832
|
-
tech:gimp
|
|
833
|
-
tech:git
|
|
834
|
-
tech:gitbook
|
|
835
|
-
tech:github
|
|
836
|
-
tech:github-actions
|
|
837
|
-
tech:github-codespaces
|
|
838
|
-
tech:gitlab
|
|
839
|
-
tech:gitpod
|
|
840
|
-
tech:gitter
|
|
841
|
-
tech:gnu-emacs
|
|
842
|
-
tech:go
|
|
843
|
-
tech:go-land
|
|
844
|
-
tech:godot-engine
|
|
845
|
-
tech:google
|
|
846
|
-
tech:google-cloud
|
|
847
|
-
tech:gradle
|
|
848
|
-
tech:grafana
|
|
849
|
-
tech:grails
|
|
850
|
-
tech:graphql
|
|
851
|
-
tech:groovy
|
|
852
|
-
tech:grunt-js
|
|
853
|
-
tech:gulp-js
|
|
854
|
-
tech:hadoop
|
|
855
|
-
tech:handlebars
|
|
856
|
-
tech:hardhat
|
|
857
|
-
tech:harvester
|
|
858
|
-
tech:hashicorp-vault
|
|
859
|
-
tech:haskell
|
|
860
|
-
tech:haxe
|
|
861
|
-
tech:helm
|
|
862
|
-
tech:heroku
|
|
863
|
-
tech:hibernate
|
|
864
|
-
tech:homebrew
|
|
865
|
-
tech:html5
|
|
866
|
-
tech:hugo
|
|
867
|
-
tech:ibm-spss-statistics
|
|
868
|
-
tech:ie10
|
|
869
|
-
tech:ifttt
|
|
870
|
-
tech:influxdb
|
|
871
|
-
tech:inkscape
|
|
872
|
-
tech:insomnia
|
|
873
|
-
tech:intellij-idea
|
|
874
|
-
tech:ionic
|
|
875
|
-
tech:jaeger
|
|
876
|
-
tech:jamstack
|
|
877
|
-
tech:jasmine
|
|
878
|
-
tech:java
|
|
879
|
-
tech:javascript
|
|
880
|
-
tech:jeet
|
|
881
|
-
tech:jekyll
|
|
882
|
-
tech:jenkins
|
|
883
|
-
tech:jest
|
|
884
|
-
tech:jetbrains
|
|
885
|
-
tech:jira
|
|
886
|
-
tech:jira-align
|
|
887
|
-
tech:jquery
|
|
888
|
-
tech:json
|
|
889
|
-
tech:jule
|
|
890
|
-
tech:julia
|
|
891
|
-
tech:junit
|
|
892
|
-
tech:jupyter
|
|
893
|
-
tech:k3os
|
|
894
|
-
tech:k3s
|
|
895
|
-
tech:kafka
|
|
896
|
-
tech:kaggle
|
|
897
|
-
tech:karate
|
|
898
|
-
tech:karma
|
|
899
|
-
tech:keras
|
|
900
|
-
tech:kibana
|
|
901
|
-
tech:knex-js
|
|
902
|
-
tech:knockout
|
|
903
|
-
tech:kotlin
|
|
904
|
-
tech:krakenjs
|
|
905
|
-
tech:ktor
|
|
906
|
-
tech:kubernetes
|
|
907
|
-
tech:labview
|
|
908
|
-
tech:laravel
|
|
909
|
-
tech:latex
|
|
910
|
-
tech:less-js
|
|
911
|
-
tech:linkedin
|
|
912
|
-
tech:linux
|
|
913
|
-
tech:liquibase
|
|
914
|
-
tech:livewire
|
|
915
|
-
tech:llvm
|
|
916
|
-
tech:logstash
|
|
917
|
-
tech:lua
|
|
918
|
-
tech:lumen
|
|
919
|
-
tech:magento
|
|
920
|
-
tech:markdown
|
|
921
|
-
tech:material-ui
|
|
922
|
-
tech:materialize
|
|
923
|
-
tech:matlab
|
|
924
|
-
tech:matplotlib
|
|
925
|
-
tech:maven
|
|
926
|
-
tech:meteor-js
|
|
927
|
-
tech:microsoft-sql-server
|
|
928
|
-
tech:minitab
|
|
929
|
-
tech:mob-x
|
|
930
|
-
tech:mocha
|
|
931
|
-
tech:modx
|
|
932
|
-
tech:moleculer
|
|
933
|
-
tech:mongodb
|
|
934
|
-
tech:mongoose-js
|
|
935
|
-
tech:moodle
|
|
936
|
-
tech:ms-dos
|
|
937
|
-
tech:mysql
|
|
938
|
-
tech:nano
|
|
939
|
-
tech:nerog
|
|
940
|
-
tech:nestjs
|
|
941
|
-
tech:net
|
|
942
|
-
tech:net-core
|
|
943
|
-
tech:network-x
|
|
944
|
-
tech:new4j
|
|
945
|
-
tech:nextjs
|
|
946
|
-
tech:nginx
|
|
947
|
-
tech:nhibernate
|
|
948
|
-
tech:nim
|
|
949
|
-
tech:nimble
|
|
950
|
-
tech:nix
|
|
951
|
-
tech:nodejs
|
|
952
|
-
tech:nodemon
|
|
953
|
-
tech:nodewebkit
|
|
954
|
-
tech:npm
|
|
955
|
-
tech:nuget
|
|
956
|
-
tech:num-py
|
|
957
|
-
tech:nuxt-js
|
|
958
|
-
tech:objective-c
|
|
959
|
-
tech:ocaml
|
|
960
|
-
tech:oh-my-zsh
|
|
961
|
-
tech:okta
|
|
962
|
-
tech:open-al
|
|
963
|
-
tech:open-api
|
|
964
|
-
tech:open-cl
|
|
965
|
-
tech:open-cv
|
|
966
|
-
tech:open-gl
|
|
967
|
-
tech:open-stack
|
|
968
|
-
tech:open-suse
|
|
969
|
-
tech:open-telemetry
|
|
970
|
-
tech:opera
|
|
971
|
-
tech:oracle
|
|
972
|
-
tech:p5js
|
|
973
|
-
tech:packer
|
|
974
|
-
tech:pandas
|
|
975
|
-
tech:perl
|
|
976
|
-
tech:pf-sense
|
|
977
|
-
tech:phalcon
|
|
978
|
-
tech:phoenix-framework
|
|
979
|
-
tech:photon-engine
|
|
980
|
-
tech:php
|
|
981
|
-
tech:php-storm
|
|
982
|
-
tech:playwrite
|
|
983
|
-
tech:ploty
|
|
984
|
-
tech:podman
|
|
985
|
-
tech:polygon
|
|
986
|
-
tech:portainer
|
|
987
|
-
tech:postcss
|
|
988
|
-
tech:postgresql
|
|
989
|
-
tech:postman
|
|
990
|
-
tech:powershell
|
|
991
|
-
tech:processing
|
|
992
|
-
tech:prometheus
|
|
993
|
-
tech:protractor
|
|
994
|
-
tech:purescript
|
|
995
|
-
tech:putty
|
|
996
|
-
tech:pycharm
|
|
997
|
-
tech:pyscript
|
|
998
|
-
tech:pytest
|
|
999
|
-
tech:python
|
|
1000
|
-
tech:python-poetry
|
|
1001
|
-
tech:pytorch
|
|
1002
|
-
tech:qodana
|
|
1003
|
-
tech:qt
|
|
1004
|
-
tech:quarkus
|
|
1005
|
-
tech:quasar
|
|
1006
|
-
tech:qwik
|
|
1007
|
-
tech:r
|
|
1008
|
-
tech:rabbitmq
|
|
1009
|
-
tech:rancher
|
|
1010
|
-
tech:raspberrypi
|
|
1011
|
-
tech:reach
|
|
1012
|
-
tech:react
|
|
1013
|
-
tech:react-bootstrap
|
|
1014
|
-
tech:realm
|
|
1015
|
-
tech:red-cube-s-epic-compiler-thingy-programming-re-ct
|
|
1016
|
-
tech:redhat
|
|
1017
|
-
tech:redis
|
|
1018
|
-
tech:redux
|
|
1019
|
-
tech:ren-py
|
|
1020
|
-
tech:rider
|
|
1021
|
-
tech:robot-operating-system-ros
|
|
1022
|
-
tech:rocksdb
|
|
1023
|
-
tech:rollup-js
|
|
1024
|
-
tech:rspec
|
|
1025
|
-
tech:rstudio
|
|
1026
|
-
tech:ruby
|
|
1027
|
-
tech:ruby-mine
|
|
1028
|
-
tech:ruby-on-rails
|
|
1029
|
-
tech:rust
|
|
1030
|
-
tech:salesforce
|
|
1031
|
-
tech:sanity
|
|
1032
|
-
tech:sass
|
|
1033
|
-
tech:scala
|
|
1034
|
-
tech:scalingo
|
|
1035
|
-
tech:sdl
|
|
1036
|
-
tech:selenium
|
|
1037
|
-
tech:sema-software
|
|
1038
|
-
tech:sequelize
|
|
1039
|
-
tech:shopware
|
|
1040
|
-
tech:sketch
|
|
1041
|
-
tech:slack
|
|
1042
|
-
tech:socket-io
|
|
1043
|
-
tech:solid-js
|
|
1044
|
-
tech:solidity
|
|
1045
|
-
tech:sonarqube
|
|
1046
|
-
tech:sourcetree
|
|
1047
|
-
tech:spark
|
|
1048
|
-
tech:splunk
|
|
1049
|
-
tech:spring
|
|
1050
|
-
tech:sql-developer
|
|
1051
|
-
tech:sqlalchemy
|
|
1052
|
-
tech:sqlite
|
|
1053
|
-
tech:ssh
|
|
1054
|
-
tech:stackoverflow
|
|
1055
|
-
tech:stata
|
|
1056
|
-
tech:storybook
|
|
1057
|
-
tech:streamlit
|
|
1058
|
-
tech:stylus
|
|
1059
|
-
tech:subversion
|
|
1060
|
-
tech:svelte
|
|
1061
|
-
tech:swagger
|
|
1062
|
-
tech:swift
|
|
1063
|
-
tech:symfony
|
|
1064
|
-
tech:tailwind-css
|
|
1065
|
-
tech:tauri
|
|
1066
|
-
tech:tensorflow
|
|
1067
|
-
tech:terraform
|
|
1068
|
-
tech:tex
|
|
1069
|
-
tech:the-algorithms
|
|
1070
|
-
tech:three-js
|
|
1071
|
-
tech:titanium-sdk
|
|
1072
|
-
tech:tomcat
|
|
1073
|
-
tech:tortoise-git
|
|
1074
|
-
tech:tower
|
|
1075
|
-
tech:traefik-mesh
|
|
1076
|
-
tech:traefik-proxy
|
|
1077
|
-
tech:travis-ci
|
|
1078
|
-
tech:trello
|
|
1079
|
-
tech:twitter
|
|
1080
|
-
tech:typescript
|
|
1081
|
-
tech:typo3
|
|
1082
|
-
tech:ubuntu
|
|
1083
|
-
tech:uml
|
|
1084
|
-
tech:unity
|
|
1085
|
-
tech:unix
|
|
1086
|
-
tech:unreal-engine
|
|
1087
|
-
tech:uwsgi
|
|
1088
|
-
tech:v8
|
|
1089
|
-
tech:vagrant
|
|
1090
|
-
tech:vala
|
|
1091
|
-
tech:vercel
|
|
1092
|
-
tech:veutify
|
|
1093
|
-
tech:vim
|
|
1094
|
-
tech:visualstudio
|
|
1095
|
-
tech:vite
|
|
1096
|
-
tech:vitejs
|
|
1097
|
-
tech:vscode
|
|
1098
|
-
tech:vsphere
|
|
1099
|
-
tech:vue
|
|
1100
|
-
tech:vue-storefront
|
|
1101
|
-
tech:vyper
|
|
1102
|
-
tech:webassembly
|
|
1103
|
-
tech:webflow
|
|
1104
|
-
tech:weblate
|
|
1105
|
-
tech:webpack
|
|
1106
|
-
tech:webstorm
|
|
1107
|
-
tech:windows11
|
|
1108
|
-
tech:windows8
|
|
1109
|
-
tech:woo-commerce
|
|
1110
|
-
tech:wordpress
|
|
1111
|
-
tech:xamarin
|
|
1112
|
-
tech:xcode
|
|
1113
|
-
tech:xml
|
|
1114
|
-
tech:yaml
|
|
1115
|
-
tech:yarn
|
|
1116
|
-
tech:yii-framework
|
|
1117
|
-
tech:yuno-host
|
|
1118
|
-
tech:zend-framework
|
|
1119
|
-
tech:zig
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
`,$_="likec4builtin",IG=`${$_}:///likec4/lib/icons.c4`,PG=new un.NotificationType("likec4/onDidChangeModel"),xG=new un.RequestType0("likec4/fetchModel"),NG=new un.RequestType0("likec4/fetchComputedModel"),OG=new un.RequestType("likec4/computeView"),DG=new un.RequestType("likec4/build"),LG=new un.RequestType("likec4/locate"),MG=new un.RequestType("likec4/change-view");var FG=t=>{const e=t.match(/^[ \t]*(?=\S)/gm);return e?e.reduce((n,r)=>Math.min(n,r.length),1/0):0};const jG=po(FG);function Oy(t){const e=jG(t);if(e===0)return t;const n=new RegExp(`^[ \\t]{${e}}`,"gm");return t.replace(n,"")}function UG(t){for(var e=5381,n=t.length;n;)e=e*33^t.charCodeAt(--n);return e>>>0}var BG=UG;const qG=po(BG);var WG=Object.getOwnPropertyNames,GG=Object.getOwnPropertySymbols,zG=Object.prototype.hasOwnProperty;function k_(t,e){return function(r,i,s){return t(r,i,s)&&e(r,i,s)}}function Af(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 __(t){return WG(t).concat(GG(t))}var C_=Object.hasOwn||function(t,e){return zG.call(t,e)};function qo(t,e){return t||e?t===e:t===e||t!==t&&e!==e}var A_="_owner",I_=Object.getOwnPropertyDescriptor,P_=Object.keys;function HG(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 VG(t,e){return qo(t.getTime(),e.getTime())}function x_(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(),l=!1,u=0;(a=c.next())&&!a.done;){var d=o.value,f=d[0],h=d[1],p=a.value,y=p[0],$=p[1];!l&&!r[u]&&(l=n.equals(f,y,s,u,t,e,n)&&n.equals(h,$,f,y,t,e,n))&&(r[u]=!0),u++}if(!l)return!1;s++}return!0}function KG(t,e,n){var r=P_(t),i=r.length;if(P_(e).length!==i)return!1;for(var s;i-- >0;)if(s=r[i],s===A_&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!C_(e,s)||!n.equals(t[s],e[s],s,s,t,e,n))return!1;return!0}function Mc(t,e,n){var r=__(t),i=r.length;if(__(e).length!==i)return!1;for(var s,o,a;i-- >0;)if(s=r[i],s===A_&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!C_(e,s)||!n.equals(t[s],e[s],s,s,t,e,n)||(o=I_(t,s),a=I_(e,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function YG(t,e){return qo(t.valueOf(),e.valueOf())}function XG(t,e){return t.source===e.source&&t.flags===e.flags}function N_(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,l=0;(o=a.next())&&!o.done;)!c&&!r[l]&&(c=n.equals(s.value,o.value,s.value,o.value,t,e,n))&&(r[l]=!0),l++;if(!c)return!1}return!0}function JG(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 QG="[object Arguments]",ZG="[object Boolean]",ez="[object Date]",tz="[object Map]",nz="[object Number]",rz="[object Object]",iz="[object RegExp]",sz="[object Set]",oz="[object String]",az=Array.isArray,O_=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,D_=Object.assign,cz=Object.prototype.toString.call.bind(Object.prototype.toString);function lz(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,d,f){if(u===d)return!0;if(u==null||d==null||typeof u!="object"||typeof d!="object")return u!==u&&d!==d;var h=u.constructor;if(h!==d.constructor)return!1;if(h===Object)return i(u,d,f);if(az(u))return e(u,d,f);if(O_!=null&&O_(u))return c(u,d,f);if(h===Date)return n(u,d,f);if(h===RegExp)return o(u,d,f);if(h===Map)return r(u,d,f);if(h===Set)return a(u,d,f);var p=cz(u);return p===ez?n(u,d,f):p===iz?o(u,d,f):p===tz?r(u,d,f):p===sz?a(u,d,f):p===rz?typeof u.then!="function"&&typeof d.then!="function"&&i(u,d,f):p===QG?i(u,d,f):p===ZG||p===nz||p===oz?s(u,d,f):!1}}function uz(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?Mc:HG,areDatesEqual:VG,areMapsEqual:r?k_(x_,Mc):x_,areObjectsEqual:r?Mc:KG,arePrimitiveWrappersEqual:YG,areRegExpsEqual:XG,areSetsEqual:r?k_(N_,Mc):N_,areTypedArraysEqual:r?Mc:JG};if(n&&(i=D_({},i,n(i))),e){var s=Af(i.areArraysEqual),o=Af(i.areMapsEqual),a=Af(i.areObjectsEqual),c=Af(i.areSetsEqual);i=D_({},i,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:a,areSetsEqual:c})}return i}function dz(t){return function(e,n,r,i,s,o,a){return t(e,n,a)}}function fz(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,s=t.strict;if(r)return function(c,l){var u=r(),d=u.cache,f=d===void 0?e?new WeakMap:void 0:d,h=u.meta;return n(c,l,{cache:f,equals:i,meta:h,strict:s})};if(e)return function(c,l){return n(c,l,{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,l){return n(c,l,o)}}var L_=Wi();Wi({strict:!0}),Wi({circular:!0}),Wi({circular:!0,strict:!0}),Wi({createInternalComparator:function(){return qo}}),Wi({strict:!0,createInternalComparator:function(){return qo}}),Wi({circular:!0,createInternalComparator:function(){return qo}}),Wi({circular:!0,createInternalComparator:function(){return qo},strict:!0});function Wi(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=uz(t),c=lz(a),l=r?r(c):dz(c);return fz({circular:n,comparator:c,createState:i,equals:l,strict:o})}var hz="\0",Ns="\0",M_="";let pz=class{_isDirected=!0;_isMultigraph=!1;_isCompound=!1;_label;_defaultNodeLabelFn=()=>{};_defaultEdgeLabelFn=()=>{};_nodes={};_in={};_preds={};_out={};_sucs={};_edgeObjs={};_edgeLabels={};_nodeCount=0;_edgeCount=0;_parent;_children;constructor(e){e&&(this._isDirected=Object.hasOwn(e,"directed")?e.directed:!0,this._isMultigraph=Object.hasOwn(e,"multigraph")?e.multigraph:!1,this._isCompound=Object.hasOwn(e,"compound")?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[Ns]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,typeof e!="function"&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter(n=>Object.keys(e._in[n]).length===0)}sinks(){var e=this;return this.nodes().filter(n=>Object.keys(e._out[n]).length===0)}setNodes(e,n){var r=arguments,i=this;return e.forEach(function(s){r.length>1?i.setNode(s,n):i.setNode(s)}),this}setNode(e,n){return Object.hasOwn(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=n),this):(this._nodes[e]=arguments.length>1?n:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=Ns,this._children[e]={},this._children[Ns][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){var n=this;if(Object.hasOwn(this._nodes,e)){var r=i=>n.removeEdge(n._edgeObjs[i]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(function(i){n.setParent(i)}),delete this._children[e]),Object.keys(this._in[e]).forEach(r),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,n){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n===void 0)n=Ns;else{n+="";for(var r=n;r!==void 0;r=this.parent(r))if(r===e)throw new Error("Setting "+n+" as parent of "+e+" would create a cycle");this.setNode(n)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=n,this._children[n][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var n=this._parent[e];if(n!==Ns)return n}}children(e=Ns){if(this._isCompound){var n=this._children[e];if(n)return Object.keys(n)}else{if(e===Ns)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var n=this._preds[e];if(n)return Object.keys(n)}successors(e){var n=this._sucs[e];if(n)return Object.keys(n)}neighbors(e){var n=this.predecessors(e);if(n){const i=new Set(n);for(var r of this.successors(e))i.add(r);return Array.from(i.values())}}isLeaf(e){var n;return this.isDirected()?n=this.successors(e):n=this.neighbors(e),n.length===0}filterNodes(e){var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph());var r=this;Object.entries(this._nodes).forEach(function([o,a]){e(o)&&n.setNode(o,a)}),Object.values(this._edgeObjs).forEach(function(o){n.hasNode(o.v)&&n.hasNode(o.w)&&n.setEdge(o,r.edge(o))});var i={};function s(o){var a=r.parent(o);return a===void 0||n.hasNode(a)?(i[o]=a,a):a in i?i[a]:s(a)}return this._isCompound&&n.nodes().forEach(o=>n.setParent(o,s(o))),n}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,typeof e!="function"&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,n){var r=this,i=arguments;return e.reduce(function(s,o){return i.length>1?r.setEdge(s,o,n):r.setEdge(s,o),o}),this}setEdge(){var e,n,r,i,s=!1,o=arguments[0];typeof o=="object"&&o!==null&&"v"in o?(e=o.v,n=o.w,r=o.name,arguments.length===2&&(i=arguments[1],s=!0)):(e=o,n=arguments[1],r=arguments[3],arguments.length>2&&(i=arguments[2],s=!0)),e=""+e,n=""+n,r!==void 0&&(r=""+r);var a=Fc(this._isDirected,e,n,r);if(Object.hasOwn(this._edgeLabels,a))return s&&(this._edgeLabels[a]=i),this;if(r!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(n),this._edgeLabels[a]=s?i:this._defaultEdgeLabelFn(e,n,r);var c=gz(this._isDirected,e,n,r);return e=c.v,n=c.w,Object.freeze(c),this._edgeObjs[a]=c,F_(this._preds[n],e),F_(this._sucs[e],n),this._in[n][a]=c,this._out[e][a]=c,this._edgeCount++,this}edge(e,n,r){var i=arguments.length===1?Dy(this._isDirected,arguments[0]):Fc(this._isDirected,e,n,r);return this._edgeLabels[i]}edgeAsObj(){const e=this.edge(...arguments);return typeof e!="object"?{label:e}:e}hasEdge(e,n,r){var i=arguments.length===1?Dy(this._isDirected,arguments[0]):Fc(this._isDirected,e,n,r);return Object.hasOwn(this._edgeLabels,i)}removeEdge(e,n,r){var i=arguments.length===1?Dy(this._isDirected,arguments[0]):Fc(this._isDirected,e,n,r),s=this._edgeObjs[i];return s&&(e=s.v,n=s.w,delete this._edgeLabels[i],delete this._edgeObjs[i],j_(this._preds[n],e),j_(this._sucs[e],n),delete this._in[n][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,n){var r=this._in[e];if(r){var i=Object.values(r);return n?i.filter(s=>s.v===n):i}}outEdges(e,n){var r=this._out[e];if(r){var i=Object.values(r);return n?i.filter(s=>s.w===n):i}}nodeEdges(e,n){var r=this.inEdges(e,n);if(r)return r.concat(this.outEdges(e,n))}};function F_(t,e){t[e]?t[e]++:t[e]=1}function j_(t,e){--t[e]||delete t[e]}function Fc(t,e,n,r){var i=""+e,s=""+n;if(!t&&i>s){var o=i;i=s,s=o}return i+M_+s+M_+(r===void 0?hz:r)}function gz(t,e,n,r){var i=""+e,s=""+n;if(!t&&i>s){var o=i;i=s,s=o}var a={v:i,w:s};return r&&(a.name=r),a}function Dy(t,e){return Fc(t,e.v,e.w,e.name)}var Ly=pz,mz="2.2.4",yz={Graph:Ly,version:mz},vz=Ly,wz={write:bz,read:Rz};function bz(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Tz(t),edges:Ez(t)};return t.graph()!==void 0&&(e.value=structuredClone(t.graph())),e}function Tz(t){return t.nodes().map(function(e){var n=t.node(e),r=t.parent(e),i={v:e};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function Ez(t){return t.edges().map(function(e){var n=t.edge(e),r={v:e.v,w:e.w};return e.name!==void 0&&(r.name=e.name),n!==void 0&&(r.value=n),r})}function Rz(t){var e=new vz(t.options).setGraph(t.value);return t.nodes.forEach(function(n){e.setNode(n.v,n.value),n.parent&&e.setParent(n.v,n.parent)}),t.edges.forEach(function(n){e.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),e}var Sz=$z;function $z(t){var e={},n=[],r;function i(s){Object.hasOwn(e,s)||(e[s]=!0,r.push(s),t.successors(s).forEach(i),t.predecessors(s).forEach(i))}return t.nodes().forEach(function(s){r=[],i(s),r.length&&n.push(r)}),n}let kz=class{_arr=[];_keyIndices={};size(){return this._arr.length}keys(){return this._arr.map(function(e){return e.key})}has(e){return Object.hasOwn(this._keyIndices,e)}priority(e){var n=this._keyIndices[e];if(n!==void 0)return this._arr[n].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,n){var r=this._keyIndices;if(e=String(e),!Object.hasOwn(r,e)){var i=this._arr,s=i.length;return r[e]=s,i.push({key:e,priority:n}),this._decrease(s),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,n){var r=this._keyIndices[e];if(n>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[r].priority+" New: "+n);this._arr[r].priority=n,this._decrease(r)}_heapify(e){var n=this._arr,r=2*e,i=r+1,s=e;r<n.length&&(s=n[r].priority<n[s].priority?r:s,i<n.length&&(s=n[i].priority<n[s].priority?i:s),s!==e&&(this._swap(e,s),this._heapify(s)))}_decrease(e){for(var n=this._arr,r=n[e].priority,i;e!==0&&(i=e>>1,!(n[i].priority<r));)this._swap(e,i),e=i}_swap(e,n){var r=this._arr,i=this._keyIndices,s=r[e],o=r[n];r[e]=o,r[n]=s,i[o.key]=e,i[s.key]=n}};var U_=kz,_z=U_,B_=Az,Cz=()=>1;function Az(t,e,n,r){return Iz(t,String(e),n||Cz,r||function(i){return t.outEdges(i)})}function Iz(t,e,n,r){var i={},s=new _z,o,a,c=function(l){var u=l.v!==o?l.v:l.w,d=i[u],f=n(l),h=a.distance+f;if(f<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+l+" Weight: "+f);h<d.distance&&(d.distance=h,d.predecessor=o,s.decrease(u,h))};for(t.nodes().forEach(function(l){var u=l===e?0:Number.POSITIVE_INFINITY;i[l]={distance:u},s.add(l,u)});s.size()>0&&(o=s.removeMin(),a=i[o],a.distance!==Number.POSITIVE_INFINITY);)r(o).forEach(c);return i}var Pz=B_,xz=Nz;function Nz(t,e,n){return t.nodes().reduce(function(r,i){return r[i]=Pz(t,i,e,n),r},{})}var q_=Oz;function Oz(t){var e=0,n=[],r={},i=[];function s(o){var a=r[o]={onStack:!0,lowlink:e,index:e++};if(n.push(o),t.successors(o).forEach(function(u){Object.hasOwn(r,u)?r[u].onStack&&(a.lowlink=Math.min(a.lowlink,r[u].index)):(s(u),a.lowlink=Math.min(a.lowlink,r[u].lowlink))}),a.lowlink===a.index){var c=[],l;do l=n.pop(),r[l].onStack=!1,c.push(l);while(o!==l);i.push(c)}}return t.nodes().forEach(function(o){Object.hasOwn(r,o)||s(o)}),i}var Dz=q_,Lz=Mz;function Mz(t){return Dz(t).filter(function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])})}var Fz=Uz,jz=()=>1;function Uz(t,e,n){return Bz(t,e||jz,n||function(r){return t.outEdges(r)})}function Bz(t,e,n){var r={},i=t.nodes();return i.forEach(function(s){r[s]={},r[s][s]={distance:0},i.forEach(function(o){s!==o&&(r[s][o]={distance:Number.POSITIVE_INFINITY})}),n(s).forEach(function(o){var a=o.v===s?o.w:o.v,c=e(o);r[s][a]={distance:c,predecessor:s}})}),i.forEach(function(s){var o=r[s];i.forEach(function(a){var c=r[a];i.forEach(function(l){var u=c[s],d=o[l],f=c[l],h=u.distance+d.distance;h<f.distance&&(f.distance=h,f.predecessor=d.predecessor)})})}),r}function W_(t){var e={},n={},r=[];function i(s){if(Object.hasOwn(n,s))throw new My;Object.hasOwn(e,s)||(n[s]=!0,e[s]=!0,t.predecessors(s).forEach(i),delete n[s],r.push(s))}if(t.sinks().forEach(i),Object.keys(e).length!==t.nodeCount())throw new My;return r}class My extends Error{constructor(){super(...arguments)}}var G_=W_;W_.CycleException=My;var z_=G_,qz=Wz;function Wz(t){try{z_(t)}catch(e){if(e instanceof z_.CycleException)return!1;throw e}return!0}var H_=Gz;function Gz(t,e,n){Array.isArray(e)||(e=[e]);var r=t.isDirected()?a=>t.successors(a):a=>t.neighbors(a),i=n==="post"?zz:Hz,s=[],o={};return e.forEach(a=>{if(!t.hasNode(a))throw new Error("Graph does not have node: "+a);i(a,r,o,s)}),s}function zz(t,e,n,r){for(var i=[[t,!1]];i.length>0;){var s=i.pop();s[1]?r.push(s[0]):Object.hasOwn(n,s[0])||(n[s[0]]=!0,i.push([s[0],!0]),V_(e(s[0]),o=>i.push([o,!1])))}}function Hz(t,e,n,r){for(var i=[t];i.length>0;){var s=i.pop();Object.hasOwn(n,s)||(n[s]=!0,r.push(s),V_(e(s),o=>i.push(o)))}}function V_(t,e){for(var n=t.length;n--;)e(t[n],n,t);return t}var Vz=H_,Kz=Yz;function Yz(t,e){return Vz(t,e,"post")}var Xz=H_,Jz=Qz;function Qz(t,e){return Xz(t,e,"pre")}var Zz=Ly,e9=U_,t9=n9;function n9(t,e){var n=new Zz,r={},i=new e9,s;function o(c){var l=c.v===s?c.w:c.v,u=i.priority(l);if(u!==void 0){var d=e(c);d<u&&(r[l]=s,i.decrease(l,d))}}if(t.nodeCount()===0)return n;t.nodes().forEach(function(c){i.add(c,Number.POSITIVE_INFINITY),n.setNode(c)}),i.decrease(t.nodes()[0],0);for(var a=!1;i.size()>0;){if(s=i.removeMin(),Object.hasOwn(r,s))n.setEdge(s,r[s]);else{if(a)throw new Error("Input graph is not connected: "+t);a=!0}t.nodeEdges(s).forEach(o)}return n}var r9={components:Sz,dijkstra:B_,dijkstraAll:xz,findCycles:Lz,floydWarshall:Fz,isAcyclic:qz,postorder:Kz,preorder:Jz,prim:t9,tarjan:q_,topsort:G_},K_=yz,Fy={Graph:K_.Graph,json:wz,alg:r9,version:K_.version};const jy=po(Fy);var Uy={exports:{}};(function(t,e){var n=hb;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 u,typeof h.write>"u"&&(h.write=h.update,h.end=h.update);var p=l(f,h);if(p.dispatch(d),h.update||h.end(""),h.digest)return h.digest(f.encoding==="buffer"?void 0:f.encoding);var y=h.read();return f.encoding==="buffer"?y:y.toString(f.encoding)}e.writeToStream=function(d,f,h){return typeof h>"u"&&(h=f,f={}),f=o(d,f),l(f,h).dispatch(d)};function l(d,f,h){h=h||[];var p=function(y){return f.update?f.update(y,"utf8"):f.write(y,"utf8")};return{dispatch:function(y){d.replacer&&(y=d.replacer(y));var $=typeof y;return y===null&&($="null"),this["_"+$](y)},_object:function(y){var $=/\[object (.*)\]/i,T=Object.prototype.toString.call(y),w=$.exec(T);w?w=w[1]:w="unknown:["+T+"]",w=w.toLowerCase();var b=null;if((b=h.indexOf(y))>=0)return this.dispatch("[CIRCULAR:"+b+"]");if(h.push(y),typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(y))return p("buffer:"),p(y);if(w!=="object"&&w!=="function"&&w!=="asyncfunction")if(this["_"+w])this["_"+w](y);else{if(d.ignoreUnknown)return p("["+w+"]");throw new Error('Unknown object type "'+w+'"')}else{var _=Object.keys(y);d.unorderedObjects&&(_=_.sort()),d.respectType!==!1&&!a(y)&&_.splice(0,0,"prototype","__proto__","constructor"),d.excludeKeys&&(_=_.filter(function(F){return!d.excludeKeys(F)})),p("object:"+_.length+":");var x=this;return _.forEach(function(F){x.dispatch(F),p(":"),d.excludeValues||x.dispatch(y[F]),p(",")})}},_array:function(y,$){$=typeof $<"u"?$:d.unorderedArrays!==!1;var T=this;if(p("array:"+y.length+":"),!$||y.length<=1)return y.forEach(function(_){return T.dispatch(_)});var w=[],b=y.map(function(_){var x=new u,F=h.slice(),P=l(d,x,F);return P.dispatch(_),w=w.concat(F.slice(h.length)),x.read().toString()});return h=h.concat(w),b.sort(),this._array(b,!1)},_date:function(y){return p("date:"+y.toJSON())},_symbol:function(y){return p("symbol:"+y.toString())},_error:function(y){return p("error:"+y.toString())},_boolean:function(y){return p("bool:"+y.toString())},_string:function(y){p("string:"+y.length+":"),p(y.toString())},_function:function(y){p("fn:"),a(y)?this.dispatch("[native]"):this.dispatch(y.toString()),d.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(y.name)),d.respectFunctionProperties&&this._object(y)},_number:function(y){return p("number:"+y.toString())},_xml:function(y){return p("xml:"+y.toString())},_null:function(){return p("Null")},_undefined:function(){return p("Undefined")},_regexp:function(y){return p("regex:"+y.toString())},_uint8array:function(y){return p("uint8array:"),this.dispatch(Array.prototype.slice.call(y))},_uint8clampedarray:function(y){return p("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(y))},_int8array:function(y){return p("int8array:"),this.dispatch(Array.prototype.slice.call(y))},_uint16array:function(y){return p("uint16array:"),this.dispatch(Array.prototype.slice.call(y))},_int16array:function(y){return p("int16array:"),this.dispatch(Array.prototype.slice.call(y))},_uint32array:function(y){return p("uint32array:"),this.dispatch(Array.prototype.slice.call(y))},_int32array:function(y){return p("int32array:"),this.dispatch(Array.prototype.slice.call(y))},_float32array:function(y){return p("float32array:"),this.dispatch(Array.prototype.slice.call(y))},_float64array:function(y){return p("float64array:"),this.dispatch(Array.prototype.slice.call(y))},_arraybuffer:function(y){return p("arraybuffer:"),this.dispatch(new Uint8Array(y))},_url:function(y){return p("url:"+y.toString())},_map:function(y){p("map:");var $=Array.from(y);return this._array($,d.unorderedSets!==!1)},_set:function(y){p("set:");var $=Array.from(y);return this._array($,d.unorderedSets!==!1)},_file:function(y){return p("file:"),this.dispatch([y.name,y.size,y.type,y.lastModfied])},_blob:function(){if(d.ignoreUnknown)return p("[blob]");throw Error(`Hashing Blob objects is currently not supported
|
|
1123
|
-
(see https://github.com/puleos/object-hash/issues/26)
|
|
1124
|
-
Use "options.replacer" or "options.ignoreUnknown"
|
|
1125
|
-
`)},_domwindow:function(){return p("domwindow")},_bigint:function(y){return p("bigint:"+y.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 u(){return{buf:"",write:function(d){this.buf+=d},end:function(d){this.buf+=d},read:function(){return this.buf}}}})(Uy,Uy.exports);var i9=Uy.exports;const s9=po(i9);function Y_(t){const e={id:t.id,__:t.__??"element",autoLayout:t.autoLayout,nodes:_t(t.nodes,Ct(l_(["id","title","description","technology","shape","icon","children"])),ii(({id:n,icon:r,...i})=>[n,{...i,icon:Q(r)?"Y":"N"}])),edges:_t(t.edges,Ct(l_(["source","target","label","description","technology","dir","head","tail","line"])),ii(({source:n,target:r,...i})=>[`${n}:${r}`,i]))};return t.hash=s9(e,{ignoreUnknown:!0,respectType:!1}),t}function hn(t){if(ne.isElementWhere(t)){const e=hn(t.where.expr),n=eo(t.where.condition);return r=>e(r)&&n(r)}if(ne.isWildcard(t))return()=>!0;if(ne.isElementKindExpr(t))return t.isEqual?e=>e.kind===t.elementKind:e=>e.kind!==t.elementKind;if(ne.isElementTagExpr(t))return t.isEqual?({tags:e})=>!!e&&e.includes(t.elementTag):({tags:e})=>yt(e)||!e.includes(t.elementTag);if(ne.isExpandedElementExpr(t))return e=>e.id===t.expanded||pt(e.id)===t.expanded;if(ne.isElementRef(t)){const{element:e,isDescedants:n}=t;return n?r=>r.id.startsWith(e+"."):r=>r.id===e}if(ne.isCustomElement(t))return hn(t.custom.expr);Re(t)}function X_(t,e){const n=t.flatMap(i=>"include"in i?i.include.filter(ne.isCustomElement):[]);if(n.length===0)return e;const r=[...e];for(const{custom:{expr:i,...s}}of n){const{border:o,opacity:a,...c}=c_(s,yt),l=!xs(c),u=hn(i);r.forEach((d,f)=>{if(!u(d))return;l&&(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 J_(t){switch(!0){case ne.isRelationWhere(t):return J_(t.where.expr);case ne.isRelation(t):{const e=hn(t.source),n=hn(t.target);return r=>e(r.source)&&n(r.target)||!!t.isBidirectional&&e(r.target)&&n(r.source)}case ne.isInOut(t):{const e=hn(t.inout);return n=>e(n.source)||e(n.target)}case ne.isIncoming(t):{const e=hn(t.incoming);return n=>e(n.target)}case ne.isOutgoing(t):{const e=hn(t.outgoing);return n=>e(n.source)}default:Re(t)}}function o9(t,e,n){const r=t.flatMap(s=>"include"in s?s.include.filter(ne.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=c_(a,yt),l=J_(s);i.forEach((u,d)=>{const f=e.find(p=>p.id===u.source),h=e.find(p=>p.id===u.target);!f||!h||l({source:f,target:h})&&(i[d]={...u,label:o??u.label,isCustomized:!0,...c})})}return i}function Q_(t,e){const n=t.filter(SN);if(n.length===0)return e;for(const r of n){const i=[];for(const s of r.targets){if(ne.isWildcard(s)){i.push(()=>!0);break}i.push(hn(s))}jt(e,xW(i)).forEach(s=>{s.shape=r.style.shape??s.shape,s.color=r.style.color??s.color,Jt(r.style.icon)&&(s.icon=r.style.icon),Jt(r.notation)&&(s.notation=r.notation);let o;Jt(r.style.border)&&(o={border:r.style.border}),Jt(r.style.opacity)&&(o={...o,opacity:r.style.opacity}),o&&(s.style={...s.style,...o})})}return e}function a9(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 Z_(t){return Array.from(t).sort(mu).reduce((e,{id:n,color:r,shape:i,style:s,...o})=>{let a=pt(n),c=0;for(;a;){const u=e.get(a);if(u){u.children.length==0&&(u.depth=1,a9(u,e)),u.children.push(n),c=u.level+1;break}a=pt(a)}const l={...o,id:n,parent:a,level:c,color:r??nu,shape:i??pb,children:[],inEdges:[],outEdges:[],style:{...s}};return e.set(n,l),e},new Map)}function eC(t){return _t(t,Cy(ri("notation")),Bi(_y(Cy(ri("shape")),Bi(_y(Cy(ri("color")),Bi(_y(Ct(ri("kind")),Ui())),Uo(),Ct(([e,n])=>({kinds:n,color:e})))),Uo(),Qt(([e,n])=>n.map(({color:r,kinds:i})=>({shape:e,color:r,kinds:i}))))),Uo(),Qt(([e,n])=>n.map(({shape:r,color:i,kinds:s})=>({title:e,shape:r,color:i,kinds:s}))),X8(ri("title"),ri("shape"),[e=>e.kinds.length,"desc"]))}const tC=jy.alg.postorder,c9=jy.alg.findCycles,l9=jy.alg.isAcyclic;function u9(t){t.forEach(e=>{e.children.length>0&&(e.children=t.flatMap(n=>n.parent===e.id?n.id:[]))})}function d9({nodes:t,edges:e}){if(e.length===0)return t;const n=new Fy.Graph({compound:!1,directed:!0,multigraph:!1}),r=a=>rt(t.find(c=>c.id===a),"Edge not found"),i=a=>rt(e.find(c=>c.id===a),"Edge not found");for(const a of[...e].sort(ya))n.setEdge(a.source,a.target);for(const a of t)n.setNode(a.id),a.children.length>0&&a.inEdges.forEach(c=>{const l=i(c);l.target!==a.id&&r(l.source).children.length===0&&n.setEdge(l.source,a.id)}),a.parent&&n.setEdge(a.parent,a.id);let s=n.sources();s.length===0&&(s=_t(t,$f(mu),jt(a=>a.inEdges.length===0||a.parent===null),Ct(a=>a.id)));const o=tC(n,s).reverse().map(r);if(o.length<t.length){const a=AW(t,o);o.push(...a)}return ae(o.length===t.length,"Not all nodes were processed by graphlib"),u9(o),o}const tr=()=>!0,nC=t=>t,By=t=>t===tr?nC:jt(t),f9=t=>t===tr?nC:e=>t(e)?e:null;function h9(t,e=tr){const n=[...this.resolvedElements],r=By(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 p9(t,e=tr){const n=[...this.resolvedElements].filter(g_([hn(t),e]));this.excludeElement(...n)}function g9(t,e=tr){const n=this.root;if(!n){const l=this.graph.rootElements.filter(e);if(l.length<=0)return;const u=[...this.resolvedElements];if(this.addElement(...l),this.addEdges(this.graph.edgesWithin(l)),u.length>0)for(const d of l)this.addEdges(this.graph.anyEdgesBetween(d,u));return}const r=[...this.resolvedElements],i=f9(e)(this.graph.element(n));i&&this.addElement(i);const s=By(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(l=>this.graph.siblings(l.id))])];for(const l of o)this.addEdges(this.graph.anyEdgesBetween(l,c));if(!a&&i&&this.graph.anyEdgesBetween(i,this.graph.siblings(n)).length===0){const l=pt(n),u=l&&this.graph.element(l);u&&e(u)&&this.addElement(u)}}function m9(t,e=tr){if(e!==tr){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 y9(t,e=tr){const n=By(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 v9(t,e=tr){const n=[...this.resolvedElements].filter(g_([hn(t),e]));this.excludeElement(...n)}const rC=t=>t.isEqual?ne.isElementKindExpr(t)?e=>e.kind===t.elementKind:({tags:e})=>!!e&&e.includes(t.elementTag):ne.isElementKindExpr(t)?e=>e.kind!==t.elementKind:({tags:e})=>yt(e)||e.length===0||!e.includes(t.elementTag);function w9(t,e=tr){const n=this.graph.elements.filter(rC(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 b9(t,e=tr){const n=[...this.resolvedElements].filter(rC(t)).filter(e);n.length>0&&this.excludeElement(...n)}function jc(t){return ne.isElementRef(t)?this.graph.ascendingSiblings(t.element):this.root?this.graph.ascendingSiblings(this.root):this.graph.rootElements}function If(t){return ne.isWildcard(t)?this.root?[...this.graph.children(this.root),this.graph.element(this.root)]:this.graph.rootElements:ne.isElementKindExpr(t)?this.graph.elements.filter(e=>t.isEqual?e.kind===t.elementKind:e.kind!==t.elementKind):ne.isElementTagExpr(t)?this.graph.elements.filter(e=>{const n=e.tags;return t.isEqual?!!n&&n.includes(t.elementTag):yt(n)||n.length===0||!n.includes(t.elementTag)}):ne.isExpandedElementExpr(t)?[this.graph.element(t.expanded)]:ne.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)]:Re(t)}function iC(t){if(ne.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=If.call(this,t);if(e.length===0)return[];let n=[...this.resolvedElements];if(ne.isElementRef(t)||ne.isExpandedElementExpr(t)){const r=t.element??t.expanded,i=t.isDescedants??!1;n=n.filter(s=>!ur(r,s.id)||i&&pt(s.id)===r)}return n.length===0&&(n=jc.call(this,t)),this.graph.edgesBetween(n,e)}const Uc=(t,e)=>e?_t(t,Ct(n=>({...n,relations:n.relations.filter(e)})),jt(n=>n.relations.length>0)):t,qy=(t,e)=>e?_t(t,Qt(n=>n.relations),jt(e)):t.flatMap(n=>n.relations);function T9(t,e){const n=Uc(iC.call(this,t.incoming),e);n.length!==0&&(this.addEdges(n),this.addImplicit(...n.map(r=>r.target)))}function E9(t,e){let n=qy(iC.call(this,t.incoming),e);this.excludeRelation(...n)}function sC(t){if(ne.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=If.call(this,t);if(e.length===0)return[];let n=[...this.resolvedElements];if(ne.isElementRef(t)||ne.isExpandedElementExpr(t)){const r=t.element??t.expanded,i=t.isDescedants??!1;n=n.filter(s=>!ur(r,s.id)||i&&pt(s.id)===r)}return n.length===0&&(n=jc.call(this,t)),this.graph.edgesBetween(e,n)}function R9(t,e){const n=Uc(sC.call(this,t.outgoing),e);n.length!==0&&(this.addEdges(n),this.addImplicit(...n.map(r=>r.source)))}function S9(t,e){const n=qy(sC.call(this,t.outgoing),e);this.excludeRelation(...n)}var Pf;(t=>{t.Empty={implicits:[],edges:[]}})(Pf||(Pf={}));function oC({inout:t},e){if(ne.isWildcard(t)){if(!this.root)return Pf.Empty;const i=this.graph.ascendingSiblings(this.root);return{edges:Uc(this.graph.anyEdgesBetween(this.graph.element(this.root),i),e),implicits:[]}}const n=If.call(this,t);if(n.length===0)return Pf.Empty;let r=[...this.resolvedElements];if(ne.isElementRef(t)||ne.isExpandedElementExpr(t)){const i=t.element??t.expanded,s=t.isDescedants??!1;r=r.filter(o=>!ur(i,o.id)||s&&pt(o.id)===i)}return r.length===0&&(r=jc.call(this,t)),n.reduce((i,s)=>{const o=Uc(this.graph.anyEdgesBetween(s,r),e);return o.length>0&&(i.implicits.push(s),i.edges.push(...o)),i},{implicits:[],edges:[]})}function $9(t,e){const{implicits:n,edges:r}=oC.call(this,t,e);this.addEdges(r),this.addImplicit(...n)}function k9(t,e){const{edges:n}=oC.call(this,t,e);this.excludeRelation(...n.flatMap(r=>r.relations))}function xf(t){return ne.isElementRef(t)&&this.root===t.element&&t.isDescedants!==!0?[...this.graph.children(t.element),this.graph.element(t.element)]:ne.isExpandedElementExpr(t)&&this.root===t.expanded?[...this.graph.children(t.expanded),this.graph.element(t.expanded)]:If.call(this,t)}function _9(t,e){let n,r;ne.isWildcard(t.source)&&!ne.isWildcard(t.target)?(n=jc.call(this,t.target),r=xf.call(this,t.target)):!ne.isWildcard(t.source)&&ne.isWildcard(t.target)?(n=xf.call(this,t.source),r=jc.call(this,t.source)):(n=xf.call(this,t.source),r=xf.call(this,t.target));const i=this.graph.edgesBetween(n,r);t.isBidirectional===!0&&i.push(...this.graph.edgesBetween(r,n)),this.addEdges(Uc(i,e))}function C9(t,e){const n=hn(t.source),r=hn(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=qy(s,e);this.excludeRelation(...o)}function A9(t,e){return ya({source:t.source.id,target:t.target.id},{source:e.source.id,target:e.target.id})}let I9=class Px{constructor(e,n){this.view=e,this.graph=n}explicits=new Set;implicits=new Set;ctxEdges=[];static elementView(e,n){return new Px(e,n).compute()}compute(){this.reset();const{docUri:e,rules:n,...r}=this.view,i=n.filter(RN);this.root&&i.length==0&&this.addElement(this.graph.element(this.root)),this.processPredicates(i),this.removeRedundantImplicitEdges();const s=[...this.includedElements],o=Z_(s),a=new Map,c=this.computeEdges();for(const p of c){a.set(p.id,p);const y=o.get(p.source),$=o.get(p.target);for(ae(y,`Source node ${p.source} not found`),ae($,`Target node ${p.target} not found`);p.parent&&!o.has(p.parent);)p.parent=pt(p.parent);y.outEdges.push(p.id),$.inEdges.push(p.id);for(const T of Hn(p.source)){if(T===p.parent)break;o.get(T)?.outEdges.push(p.id)}for(const T of Hn(p.target)){if(T===p.parent)break;o.get(T)?.inEdges.push(p.id)}}const l=s.flatMap(p=>o.get(p.id)??[]),u=X_(n,Q_(n,d9({nodes:l,edges:c}))),d=new Set([...u.flatMap(p=>p.children.length===0?p.outEdges.flatMap(y=>a.get(y)??[]):[]),...c]),f=this.view.rules.findLast(Ab),h=eC(u);return Y_({...r,autoLayout:f?.autoLayout??"TB",nodes:Ct(u,u_(["notation"])),edges:o9(n,u,d),...h.length>0&&{notation:{elements:h}}})}get root(){return Pb(this.view)?this.view.viewOf:null}computeEdges(){return this.ctxEdges.map(e=>{ae(Fn(e.relations,1),"Edge must have at least one relation");const n=e.relations.toSorted(ya),r=e.source.id,i=e.target.id,s={id:`${r}:${i}`,parent:ms(r,i),source:r,target:i,label:null,relations:n.map(c=>c.id)};let o;n.length===1?o=n[0]:o=n.find(c=>c.source===r&&c.target===i),o||(o=n.reduce((c,l)=>(l.color&&c.color!==l.color&&(c.color=void 0),l.kind&&c.kind!==l.kind&&(c.kind=void 0),l.head&&c.head!==l.head&&(c.head=void 0),l.tail&&c.tail!==l.tail&&(c.tail=void 0),l.line&&c.line!==l.line&&(c.line=void 0),l.description&&c.description!==l.description&&(c.description=void 0),l.technology&&c.technology!==l.technology&&(c.technology=void 0),Q(l.title)&&c.title!==l.title&&(c.title="[...]"),c),{title:jn(Qt(n,c=>Q(c.title)?c.title:[]))??"[...]",description:jn(Qt(n,c=>Q(c.description)?c.description:[])),technology:jn(Qt(n,c=>Q(c.technology)?c.technology:[])),kind:jn(Qt(n,c=>Q(c.kind)?c.kind:[])),head:jn(Qt(n,c=>Q(c.head)?c.head:[])),tail:jn(Qt(n,c=>Q(c.tail)?c.tail:[])),color:jn(Qt(n,c=>Q(c.color)?c.color:[])),line:jn(Qt(n,c=>Q(c.line)?c.line:[]))}));const a=Ui(Qt(n,c=>c.tags??[]));return Object.assign(s,this.getEdgeLabel(o),Q(o.description)&&{description:o.description},Q(o.technology)&&{technology:o.technology},Q(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},Fn(a,1)&&{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(!Fn(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=Ui([...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)}excludeImplicit(...e){for(const n of e)this.implicits.delete(n)}excludeRelation(...e){const n=new Set;for(const i of e){let s;for(;s=this.ctxEdges.find(o=>o.relations.includes(i));){if(s.relations.length===1){n.add(s.source),n.add(s.target),this.ctxEdges.splice(this.ctxEdges.indexOf(s),1);continue}s.relations=s.relations.filter(o=>o!==i)}}if(n.size===0)return;const r=this.includedElements;if(r.size===0){this.implicits.clear();return}for(const i of n)r.has(i)||this.implicits.delete(i)}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 l=o.id===c.source.id,u=a.id===c.target.id;if(l&&u)return!0;const d=ur(o.id,c.source.id),f=ur(a.id,c.target.id);return d&&f||l&&f||u&&d}},i=[...this.ctxEdges].sort(A9).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(ne.isElementPredicateExpr(s)){this.processElementPredicate(s,r);continue}if(ne.isRelationPredicateExpr(s)){this.processRelationPredicate(s,r);continue}Re(s)}}return this}processElementPredicate(e,n,r){if(ne.isCustomElement(e))return n&&this.processElementPredicate(e.custom.expr,n),this;if(ne.isElementWhere(e)){const i=eo(e.where.condition);return this.processElementPredicate(e.where.expr,n,i),this}if(ne.isExpandedElementExpr(e))return n?y9.call(this,e,r):v9.call(this,e,r),this;if(ne.isElementKindExpr(e)||ne.isElementTagExpr(e))return n?w9.call(this,e,r):b9.call(this,e,r),this;if(ne.isElementRef(e))return n?h9.call(this,e,r):p9.call(this,e,r),this;if(ne.isWildcard(e))return n?g9.call(this,e,r):m9.call(this,e,r),this;Re(e)}processRelationPredicate(e,n,r){if(ne.isCustomRelationExpr(e))return n&&this.processRelationPredicate(e.customRelation.relation,n),this;if(ne.isRelationWhere(e)){const i=eo(e.where.condition);return this.processRelationPredicate(e.where.expr,n,i),this}if(ne.isIncoming(e))return n?T9.call(this,e,r):E9.call(this,e,r),this;if(ne.isOutgoing(e))return n?R9.call(this,e,r):S9.call(this,e,r),this;if(ne.isInOut(e))return n?$9.call(this,e,r):k9.call(this,e,r),this;if(ne.isRelation(e))return n?_9.call(this,e,r):C9.call(this,e,r),this;Re(e)}getEdgeLabel(e){const n=[];return Q(e.title)&&n.push(e.title),Q(e.technology)&&n.push(`[${e.technology}]`),n.length>0&&{label:n.join(`
|
|
1126
|
-
`)}}};function P9(t,e){return I9.elementView(t,e)}function aC(t,e){try{return{isSuccess:!0,view:P9(t,e)}}catch(n){return{isSuccess:!1,error:n instanceof Error?n:new Error(`Unknown error: ${n}`),view:void 0}}}let x9=class xx{constructor(e,n){this.view=e,this.graph=n}explicits=new Set;steps=[];static compute(e,n){return new xx(e,n).compute()}compute(){const{docUri:e,rules:n,steps:r,...i}=this.view;for(let{source:d,target:f,title:h,isBackward:p,...y}of r){const $=this.graph.element(d),T=this.graph.element(f);this.explicits.add($),this.explicits.add(T);const{title:w,relations:b,tags:_}=this.findRelations($,T);this.steps.push({...y,source:$,target:T,title:Q(h)?h:w,relations:b??[],isBackward:p??!1,..._?{tags:_}:{}})}for(const d of n)if($N(d))for(const f of d.include){const h=hn(f);this.graph.elements.filter(h).forEach(p=>this.explicits.add(p))}const s=[...this.explicits],o=Z_(s),a=this.steps.map(({source:d,target:f,relations:h,title:p,isBackward:y,...$},T)=>{const w=rt(o.get(d.id),`Source node ${d.id} not found`),b=rt(o.get(f.id),`Target node ${f.id} not found`),_=T+1,x={id:_N(_),parent:ms(d.id,f.id),source:d.id,target:f.id,label:p,relations:h,color:no,line:_b,head:to,...$};for(y&&(x.dir="back");x.parent&&!o.has(x.parent);)x.parent=pt(x.parent);w.outEdges.push(x.id),b.inEdges.push(x.id);for(const F of Hn(x.source)){if(F===x.parent)break;o.get(F)?.outEdges.push(x.id)}for(const F of Hn(x.target)){if(F===x.parent)break;o.get(F)?.inEdges.push(x.id)}return x}),c=X_(n,Q_(n,s.map(d=>rt(o.get(d.id))))),l=n.findLast(Ab),u=eC(c);return Y_({...i,autoLayout:l?.autoLayout??"LR",nodes:Ct(c,u_(["notation"])),edges:a,...u.length>0&&{notation:{elements:u}}})}findRelations(e,n){const r=Ui(this.graph.edgesBetween(e,n).flatMap(l=>l.relations)),i=Ui(r.flatMap(l=>l.tags??[])),s=Fn(i,1)?i:null,o=Fn(r,1)?Ct(r,l=>l.id):null;if(r.length===0)return{title:null,tags:s,relations:o};let a;if(r.length===1?a=r[0]:a=r.find(l=>l.source===e.id&&l.target===n.id),a&&Q(a.title))return{title:a.title,tags:s,relations:o};const c=Ui(r.flatMap(l=>Q(l.title)?l.title:[]));return c.length===1?{title:c[0],tags:s,relations:o}:{title:null,tags:s,relations:o}}};function cC(t,e){try{return{isSuccess:!0,view:x9.compute(t,e)}}catch(n){return{isSuccess:!1,error:n instanceof Error?n:new Error(`Unknown error: ${n}`),view:void 0}}}const Wy=Set,Gy=Map;function zy(t,e){return t.size===0||e.size===0?new Set:new Set([...t].filter(n=>e.has(n)))}let lC=class{#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=new Map;#s=new Gy;#o=new Gy;#a=new Gy;#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 ae(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=qi(e)?e:e.id,r=pt(n);return(r?this._childrenOf(r):this.rootElements).filter(i=>i.id!==n)}ancestors(e){let n=qi(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=qi(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=qi(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=qi(a)?this.element(a):a;if(!gu(r,c)){if(s.size>0){const l=zy(this._incomingTo(c.id),s);l.size>0&&o.push({source:r,target:c,relations:[...l]})}if(i.size>0){const l=zy(this._outgoingFrom(c.id),i);l.size>0&&o.push({source:c,target:r,relations:[...l]})}}}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=f_(e)?e:[e],i=f_(n)?n:[n];if(r.length===0||i.length===0)return[];const s=[];for(const o of r){const a=qi(o)?this.element(o):o,c=this._outgoingFrom(a.id);if(c.size!==0)for(const l of i){const u=qi(l)?this.element(l):l;if(gu(a,u))continue;const d=this._incomingTo(u.id),f=zy(c,d);f.size>0&&s.push({source:a,target:u,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=pt(e.id);n?(this.#t.set(e.id,this.element(n)),this._childrenOf(n).push(e)):this.#r.add(e)}addRelation(e){if(this.#i.has(e.id))throw new Error(`Relation ${e.id} already exists`);this.#i.set(e.id,e),this._incomingTo(e.target).add(e),this._outgoingFrom(e.source).add(e);const n=ms(e.source,e.target);if(n)for(const r of[n,...Hn(n)])this._internalOf(r).add(e);for(const r of Hn(e.source)){if(r===n)break;this._outgoingFrom(r).add(e)}for(const r of Hn(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.#s.get(e);return n||(n=new Wy,this.#s.set(e,n)),n}_outgoingFrom(e){let n=this.#o.get(e);return n||(n=new Wy,this.#o.set(e,n)),n}_internalOf(e){let n=this.#a.get(e);return n||(n=new Wy,this.#a.set(e,n)),n}};const N9=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,O9=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,D9=/^([/\\]\s*){2,}[^/\\]/,L9=/^\.?\//;function M9(t){return["./","../"].some(e=>t.startsWith(e))}function Hy(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?N9.test(t):O9.test(t)||(e.acceptRelative?D9.test(t):!1)}function F9(t="",e){return t.endsWith("/")}function j9(t="",e){return(F9(t)?t.slice(0,-1):t)||"/"}function uC(t="",e){return t.endsWith("/")?t:t+"/"}function U9(t=""){return t.startsWith("/")}function B9(t=""){return U9(t)?t:"/"+t}function q9(t,e){if(W9(e)||Hy(t))return t;const n=j9(e);return t.startsWith(n)?t:z9(n,t)}function W9(t){return!t||t==="/"}function G9(t){return t&&t!=="/"}function z9(t,...e){let n=t||"";for(const r of e.filter(i=>G9(i)))if(n){const i=r.replace(L9,"");n=uC(n)+i}else n=r;return n}function Nf(t=""){const[e="",n="",r=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:n,hash:r}}const Te=Le.withTag("lsp");function Dt(t){Te.error(t)}function vt(t){if(t instanceof Error){Te.warn(t.stack??t.message);return}Te.warn(t)}function H9(t){Te.level=Ve[t]}function V9(t){const e={log:({level:n,...r},i)=>{if(n!==Ve.error&&n!==Ve.fatal)return;const s=r.tag||"",o=r.args.map(c=>c&&typeof c.stack=="string"?c.message+`
|
|
1127
|
-
`+c.stack:typeof c=="string"?c:String(c));s&&o.unshift(`[${s}]`);const a=o.join(" ");t.telemetry.logEvent({eventName:"error",error:a})}};Le.addReporter(e),Te.setReporters(Le.options.reporters)}function K9(t){const e={log:({level:n,...r},i)=>{const s=r.tag||"",o=r.args.map(c=>c&&typeof c.stack=="string"?c.message+`
|
|
1128
|
-
`+c.stack:typeof c=="string"?c:String(c));s&&o.unshift(`[${s}]`);const a=o.join(" ");switch(!0){case n>=Ve.trace:{t.tracer.log(a);break}case n>=Ve.debug:{t.console.debug(a);break}case n>=Ve.info:{t.console.info(a);break}case n>=Ve.log:{t.console.log(a);break}case n>=Ve.warn:{t.console.warn(a);break}case n>=Ve.fatal:{t.console.error(a);break}}}};Le.addReporter(e),Te.setReporters(Le.options.reporters)}const Of="DynamicViewRule";function Y9(t){return Y.isInstance(t,Of)}const Df="ElementExpression";function Vy(t){return Y.isInstance(t,Df)}const Lf="ElementPredicate";function X9(t){return Y.isInstance(t,Lf)}const Ky="ElementPredicateOrWhere",Os="ElementProperty";function J9(t){return Y.isInstance(t,Os)}const Ds="LikeC4View";function Yy(t){return Y.isInstance(t,Ds)}const Mf="MetadataProperty";function dC(t){return Y.isInstance(t,Mf)}const fC="Predicate",Ff="RelationExpression";function Xy(t){return Y.isInstance(t,Ff)}const jf="RelationPredicate";function Q9(t){return Y.isInstance(t,jf)}const Jy="RelationPredicateOrWhere",Wo="RelationProperty";function Z9(t){return Y.isInstance(t,Wo)}const Uf="RelationshipStyleProperty";function eH(t){return Y.isInstance(t,Uf)}const Go="StringProperty";function tH(t){return Y.isInstance(t,Go)}const Bc="StyleProperty";function Qy(t){return Y.isInstance(t,Bc)}const Bf="ViewProperty";function nH(t){return Y.isInstance(t,Bf)}const qf="ViewRule";function rH(t){return Y.isInstance(t,qf)}const Wf="ViewRulePredicate";function Zy(t){return Y.isInstance(t,Wf)}const qc="WhereElement";function iH(t){return Y.isInstance(t,qc)}const Gf="WhereElementExpression",hC="WhereExpression",zf="WhereKindEqual";function sH(t){return Y.isInstance(t,zf)}const Wc="WhereRelation";function oH(t){return Y.isInstance(t,Wc)}const Hf="WhereRelationExpression",Vf="WhereTagEqual";function aH(t){return Y.isInstance(t,Vf)}const Gc="ArrowProperty";function Kf(t){return Y.isInstance(t,Gc)}const zc="BorderProperty";function ev(t){return Y.isInstance(t,zc)}const Hc="ColorProperty";function zo(t){return Y.isInstance(t,Hc)}const Ls="CustomColor",tv="CustomElementProperties",nv="CustomRelationProperties",Vc="DirectedRelationExpression";function pC(t){return Y.isInstance(t,Vc)}const Yf="DynamicView",Xf="DynamicViewBody";function cH(t){return Y.isInstance(t,Xf)}const Kc="DynamicViewIncludePredicate";function lH(t){return Y.isInstance(t,Kc)}const Jf="DynamicViewPredicateIterator";function uH(t){return Y.isInstance(t,Jf)}const Qf="DynamicViewStep";function dH(t){return Y.isInstance(t,Qf)}const kr="Element";function si(t){return Y.isInstance(t,kr)}const Zf="ElementBody";function Yc(t){return Y.isInstance(t,Zf)}const Xc="ElementDescedantsExpression";function rv(t){return Y.isInstance(t,Xc)}const iv="ElementExpressionsIterator",Ms="ElementKind",Jc="ElementKindExpression";function eh(t){return Y.isInstance(t,Jc)}const Qc="ElementPredicateWhere";function sv(t){return Y.isInstance(t,Qc)}const Zc="ElementPredicateWith";function ov(t){return Y.isInstance(t,Zc)}const el="ElementRef";function tl(t){return Y.isInstance(t,el)}const nl="ElementStringProperty";function gC(t){return Y.isInstance(t,nl)}const rl="ElementStyleProperty";function th(t){return Y.isInstance(t,rl)}const il="ElementTagExpression";function nh(t){return Y.isInstance(t,il)}const Ho="ElementView";function av(t){return Y.isInstance(t,Ho)}const rh="ElementViewBody";function mC(t){return Y.isInstance(t,rh)}const cv="ElementViewRef",sl="ExcludePredicate";function yC(t){return Y.isInstance(t,sl)}const ol="ExpandElementExpression";function vC(t){return Y.isInstance(t,ol)}const Vo="ExtendElement";function Ko(t){return Y.isInstance(t,Vo)}const ih="ExtendElementBody";function wC(t){return Y.isInstance(t,ih)}const sh="FqnElementRef";function bC(t){return Y.isInstance(t,sh)}const al="IconProperty";function Fs(t){return Y.isInstance(t,al)}const cl="IncludePredicate";function fH(t){return Y.isInstance(t,cl)}const ll="IncomingRelationExpression";function hH(t){return Y.isInstance(t,ll)}const ul="InOutRelationExpression";function TC(t){return Y.isInstance(t,ul)}const js="LibIcon";function pH(t){return Y.isInstance(t,js)}const lv="LikeC4Grammar",uv="LikeC4Lib",dl="LineProperty";function oh(t){return Y.isInstance(t,dl)}const fl="LinkProperty";function dv(t){return Y.isInstance(t,fl)}const ah="MetadataAttribute",ch="MetadataBody",Yo="Model";function gH(t){return Y.isInstance(t,Yo)}const Xo="ModelViews";function mH(t){return Y.isInstance(t,Xo)}const lh="NavigateToProperty";function EC(t){return Y.isInstance(t,lh)}const hl="NotationProperty";function pl(t){return Y.isInstance(t,hl)}const gl="OpacityProperty";function fv(t){return Y.isInstance(t,gl)}const ml="OutgoingRelationExpression";function RC(t){return Y.isInstance(t,ml)}const hv="Predicates",uh="Relation";function Us(t){return Y.isInstance(t,uh)}const dh="RelationBody";function yH(t){return Y.isInstance(t,dh)}const yl="RelationPredicateWhere";function SC(t){return Y.isInstance(t,yl)}const vl="RelationPredicateWith";function $C(t){return Y.isInstance(t,vl)}const Gi="RelationshipKind";function vH(t){return Y.isInstance(t,Gi)}const wl="RelationStringProperty";function pv(t){return Y.isInstance(t,wl)}const bl="RelationStyleProperty";function kC(t){return Y.isInstance(t,bl)}const Tl="ShapeProperty";function gv(t){return Y.isInstance(t,Tl)}const fh="SpecificationColor";function mv(t){return Y.isInstance(t,fh)}const Jo="SpecificationElementKind";function hh(t){return Y.isInstance(t,Jo)}const El="SpecificationElementStringProperty";function wH(t){return Y.isInstance(t,El)}const Qo="SpecificationRelationshipKind";function ph(t){return Y.isInstance(t,Qo)}const Rl="SpecificationRelationshipStringProperty";function bH(t){return Y.isInstance(t,Rl)}const Zo="SpecificationRule";function TH(t){return Y.isInstance(t,Zo)}const ea="SpecificationTag";function yv(t){return Y.isInstance(t,ea)}const zi="Tag";function _C(t){return Y.isInstance(t,zi)}const gh="Tags";function CC(t){return Y.isInstance(t,gh)}const vv="ViewRef",Sl="ViewRuleAutoLayout";function wv(t){return Y.isInstance(t,Sl)}const $l="ViewRuleStyle";function mh(t){return Y.isInstance(t,$l)}const yh="ViewStringProperty",kl="WhereBinaryExpression";function EH(t){return Y.isInstance(t,kl)}const vh="WhereElementKind",_l="WhereElementNegation";function RH(t){return Y.isInstance(t,_l)}const wh="WhereElementTag",Cl="WhereRelationKind";function SH(t){return Y.isInstance(t,Cl)}const Al="WhereRelationNegation";function $H(t){return Y.isInstance(t,Al)}const bh="WhereRelationTag",Il="WildcardExpression";function ta(t){return Y.isInstance(t,Il)}class AC extends N0{getAllTypes(){return[Gc,zc,Hc,Ls,tv,nv,Vc,Yf,Xf,Kc,Jf,Of,Qf,kr,Zf,Xc,Df,iv,Ms,Jc,Lf,Ky,Qc,Zc,Os,el,nl,rl,il,Ho,rh,cv,sl,ol,Vo,ih,sh,al,ul,cl,ll,js,lv,uv,Ds,dl,fl,ah,ch,Mf,Yo,Xo,lh,hl,gl,ml,fC,hv,uh,dh,Ff,jf,Jy,yl,vl,Wo,wl,bl,Gi,Uf,Tl,fh,Jo,El,Qo,Rl,Zo,ea,Go,Bc,zi,gh,Bf,vv,qf,Sl,Wf,$l,yh,kl,qc,Gf,vh,_l,wh,hC,zf,Wc,Hf,Cl,Al,bh,Vf,Il]}computeIsSubtype(e,n){switch(e){case Gc:case dl:return this.isSubtype(Uf,n);case zc:case gl:case Tl:return this.isSubtype(Bc,n);case Hc:return this.isSubtype(Uf,n)||this.isSubtype(Bc,n);case Vc:case ll:case ul:case ml:return this.isSubtype(Ff,n);case Yf:case Ho:return this.isSubtype(Ds,n);case Kc:return this.isSubtype(Of,n);case Xc:case Jc:case el:case il:case ol:case Il:return this.isSubtype(Df,n);case Df:case Qc:return this.isSubtype(Ky,n);case Lf:case jf:return this.isSubtype(fC,n);case Ky:case Zc:return this.isSubtype(Lf,n);case nl:return this.isSubtype(Os,n)||this.isSubtype(Go,n);case rl:return this.isSubtype(Os,n);case sl:case cl:return this.isSubtype(Wf,n);case al:return this.isSubtype(Os,n)||this.isSubtype(Bc,n);case fl:return this.isSubtype(Os,n)||this.isSubtype(Wo,n)||this.isSubtype(Bf,n);case ah:case hl:case El:case Rl:return this.isSubtype(Go,n);case ch:return this.isSubtype(Mf,n);case Mf:return this.isSubtype(Os,n)||this.isSubtype(Wo,n);case Ff:case yl:return this.isSubtype(Jy,n);case Jy:case vl:return this.isSubtype(jf,n);case wl:return this.isSubtype(Wo,n)||this.isSubtype(Go,n);case bl:return this.isSubtype(Wo,n);case Sl:case $l:return this.isSubtype(Of,n)||this.isSubtype(qf,n);case Wf:return this.isSubtype(qf,n);case yh:return this.isSubtype(Go,n)||this.isSubtype(Bf,n);case kl:return this.isSubtype(Gf,n)||this.isSubtype(Hf,n);case qc:case _l:return this.isSubtype(Gf,n);case Gf:case Hf:return this.isSubtype(hC,n);case vh:return this.isSubtype(qc,n)||this.isSubtype(zf,n);case wh:return this.isSubtype(qc,n)||this.isSubtype(Vf,n);case Wc:case Al:return this.isSubtype(Hf,n);case Cl:return this.isSubtype(zf,n)||this.isSubtype(Wc,n);case bh:return this.isSubtype(Wc,n)||this.isSubtype(Vf,n);default:return!1}}getReferenceType(e){const n=`${e.container.$type}:${e.property}`;switch(n){case"ColorProperty:customColor":return Ls;case"DynamicViewStep:kind":case"OutgoingRelationExpression:kind":case"Relation:kind":case"WhereRelationKind:value":return Gi;case"Element:kind":case"ElementKindExpression:kind":case"WhereElementKind:value":return Ms;case"ElementRef:el":case"FqnElementRef:el":return kr;case"ElementTagExpression:tag":case"Tags:values":case"WhereElementTag:value":case"WhereRelationTag:value":return zi;case"ElementViewRef:view":return Ho;case"IconProperty:libicon":return js;case"ViewRef:view":return Ds;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case Gc:return{name:Gc,properties:[{name:"key"},{name:"value"}]};case zc:return{name:zc,properties:[{name:"key"},{name:"value"}]};case Hc:return{name:Hc,properties:[{name:"customColor"},{name:"key"},{name:"themeColor"}]};case Ls:return{name:Ls,properties:[{name:"name"}]};case tv:return{name:tv,properties:[{name:"props",defaultValue:[]}]};case nv:return{name:nv,properties:[{name:"props",defaultValue:[]}]};case Vc:return{name:Vc,properties:[{name:"source"},{name:"target"}]};case Yf:return{name:Yf,properties:[{name:"body"},{name:"name"}]};case Xf:return{name:Xf,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"steps",defaultValue:[]},{name:"tags"}]};case Kc:return{name:Kc,properties:[{name:"predicates"}]};case Jf:return{name:Jf,properties:[{name:"prev"},{name:"value"}]};case Qf:return{name:Qf,properties:[{name:"custom"},{name:"isBackward",defaultValue:!1},{name:"kind"},{name:"source"},{name:"target"},{name:"title"}]};case kr:return{name:kr,properties:[{name:"body"},{name:"kind"},{name:"name"},{name:"props",defaultValue:[]}]};case Zf:return{name:Zf,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case Xc:return{name:Xc,properties:[{name:"parent"}]};case iv:return{name:iv,properties:[{name:"prev"},{name:"value"}]};case Ms:return{name:Ms,properties:[{name:"name"}]};case Jc:return{name:Jc,properties:[{name:"isEqual",defaultValue:!1},{name:"kind"}]};case Qc:return{name:Qc,properties:[{name:"subject"},{name:"where"}]};case Zc:return{name:Zc,properties:[{name:"custom"},{name:"subject"}]};case el:return{name:el,properties:[{name:"el"},{name:"parent"}]};case nl:return{name:nl,properties:[{name:"key"},{name:"value"}]};case rl:return{name:rl,properties:[{name:"key"},{name:"props",defaultValue:[]}]};case il:return{name:il,properties:[{name:"isEqual",defaultValue:!1},{name:"tag"}]};case Ho:return{name:Ho,properties:[{name:"body"},{name:"extends"},{name:"name"},{name:"viewOf"}]};case rh:return{name:rh,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"tags"}]};case cv:return{name:cv,properties:[{name:"view"}]};case sl:return{name:sl,properties:[{name:"predicates"}]};case ol:return{name:ol,properties:[{name:"expand"}]};case Vo:return{name:Vo,properties:[{name:"body"},{name:"element"}]};case ih:return{name:ih,properties:[{name:"elements",defaultValue:[]}]};case sh:return{name:sh,properties:[{name:"el"},{name:"parent"}]};case al:return{name:al,properties:[{name:"key"},{name:"libicon"},{name:"value"}]};case cl:return{name:cl,properties:[{name:"predicates"}]};case ll:return{name:ll,properties:[{name:"to"}]};case ul:return{name:ul,properties:[{name:"inout"}]};case js:return{name:js,properties:[{name:"name"}]};case lv:return{name:lv,properties:[{name:"likec4lib",defaultValue:[]},{name:"models",defaultValue:[]},{name:"specifications",defaultValue:[]},{name:"views",defaultValue:[]}]};case uv:return{name:uv,properties:[{name:"icons",defaultValue:[]}]};case dl:return{name:dl,properties:[{name:"key"},{name:"value"}]};case fl:return{name:fl,properties:[{name:"key"},{name:"title"},{name:"value"}]};case ah:return{name:ah,properties:[{name:"key"},{name:"value"}]};case ch:return{name:ch,properties:[{name:"props",defaultValue:[]}]};case Yo:return{name:Yo,properties:[{name:"elements",defaultValue:[]},{name:"name"}]};case Xo:return{name:Xo,properties:[{name:"name"},{name:"views",defaultValue:[]}]};case lh:return{name:lh,properties:[{name:"key"},{name:"value"}]};case hl:return{name:hl,properties:[{name:"key"},{name:"value"}]};case gl:return{name:gl,properties:[{name:"key"},{name:"value"}]};case ml:return{name:ml,properties:[{name:"from"},{name:"isBidirectional",defaultValue:!1},{name:"kind"}]};case hv:return{name:hv,properties:[{name:"prev"},{name:"value"}]};case uh:return{name:uh,properties:[{name:"body"},{name:"kind"},{name:"source"},{name:"tags"},{name:"target"},{name:"technology"},{name:"title"}]};case dh:return{name:dh,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case yl:return{name:yl,properties:[{name:"subject"},{name:"where"}]};case vl:return{name:vl,properties:[{name:"custom"},{name:"subject"}]};case Gi:return{name:Gi,properties:[{name:"name"}]};case wl:return{name:wl,properties:[{name:"key"},{name:"value"}]};case bl:return{name:bl,properties:[{name:"key"},{name:"props",defaultValue:[]}]};case Tl:return{name:Tl,properties:[{name:"key"},{name:"value"}]};case fh:return{name:fh,properties:[{name:"color"},{name:"name"}]};case Jo:return{name:Jo,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case El:return{name:El,properties:[{name:"key"},{name:"value"}]};case Qo:return{name:Qo,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case Rl:return{name:Rl,properties:[{name:"key"},{name:"value"}]};case Zo:return{name:Zo,properties:[{name:"colors",defaultValue:[]},{name:"elements",defaultValue:[]},{name:"name"},{name:"relationships",defaultValue:[]},{name:"tags",defaultValue:[]}]};case ea:return{name:ea,properties:[{name:"tag"}]};case zi:return{name:zi,properties:[{name:"name"}]};case gh:return{name:gh,properties:[{name:"prev"},{name:"values",defaultValue:[]}]};case vv:return{name:vv,properties:[{name:"view"}]};case Sl:return{name:Sl,properties:[{name:"direction"}]};case $l:return{name:$l,properties:[{name:"props",defaultValue:[]},{name:"target"}]};case yh:return{name:yh,properties:[{name:"key"},{name:"value"}]};case kl:return{name:kl,properties:[{name:"left"},{name:"operator"},{name:"right"}]};case vh:return{name:vh,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case _l:return{name:_l,properties:[{name:"value"}]};case wh:return{name:wh,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Cl:return{name:Cl,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Al:return{name:Al,properties:[{name:"value"}]};case bh:return{name:bh,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Il:return{name:Il,properties:[{name:"isWildcard",defaultValue:!1}]};default:return{name:e,properties:[]}}}}const Y=new AC;let IC;const kH=()=>IC??(IC=bq(`{"$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@101"},"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@106"},"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@106"},"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@106"},"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@105"},"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@92"},"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@123"},"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@100"},"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@95"},"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@123"},"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@106"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@106"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@121"},"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@123"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@123"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@123"},"arguments":[]}},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@123"},"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@92"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@84"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@87"},"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@123"},"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@106"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FqnElementRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@118"},"arguments":[]},{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@15"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@106"},"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@106"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@118"},"arguments":[]},{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@15"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@106"},"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@103"},"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@103"},"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@104"},"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@123"},"arguments":[]}},{"$type":"Assignment","feature":"technology","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@123"},"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@28"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@84"},"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@123"},"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@95"},"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@124"},"arguments":[]}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@123"},"arguments":[]}}]},"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@106"},"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@38"},"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@106"},"arguments":[]}},{"$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":"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":"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@40"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"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@40"},"arguments":[]},"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"steps","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$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":"ViewProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@84"},"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@123"},"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@46"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@78"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@79"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@76"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@78"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@79"},"arguments":[]}]},"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@104"},"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@123"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@82"},"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@47"},"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@47"},"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@48"},"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@48"},"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@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicate","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"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@51"},"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@81"},"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@58"},"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@52"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementExpression","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"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@54"},"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@54"},"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@55"},"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@55"},"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@52"},"arguments":[]},{"$type":"Keyword","value":")"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@56"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@57"},"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@52"},"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@107"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@103"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereElementKind"}},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@107"},"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@59"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"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@108"},"arguments":[]},{"$type":"Assignment","feature":"tag","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@103"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementKindExpression"}},{"$type":"Keyword","value":"element.kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@108"},"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@115"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementDescedantsExpression"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@116"},"arguments":[]}]}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicate","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"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@63"},"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@82"},"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@70"},"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@64"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationExpression","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"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@66"},"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@66"},"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@67"},"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@67"},"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@64"},"arguments":[]},{"$type":"Keyword","value":")"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@68"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@69"},"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@64"},"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@107"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@103"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationKind"}},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@107"},"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@71"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@73"},"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@72"},"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@58"},"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@74"},"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@58"},"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@58"},"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@104"},"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@58"},"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@58"},"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@77"},"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@49"},"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@49"},"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@75"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@91"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@80"},"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@42"},"arguments":[]}}]},"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@123"},"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@83"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@80"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@91"},"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@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@80"},"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":"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":"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@102"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@123"},"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@98"},"arguments":[]}},{"$type":"Assignment","feature":"customColor","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@6"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@105"},"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@122"},"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@101"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@102"},"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@99"},"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@96"},"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@89"},"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@85"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@90"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@86"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@87"},"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@91"},"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@96"},"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@97"},"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@85"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@93"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@94"},"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@117"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@106"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@125"},"arguments":[]}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IconId","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@112"},"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@113"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@114"},"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@117"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@106"},"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@119"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@106"},"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@124"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@99"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@97"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@96"},"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@124"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@99"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@98"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@97"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@96"},"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@121"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@120"},"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@121"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@120"},"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":"/\\\\s+/"},"fragment":false},{"$type":"TerminalRule","name":"LIB_ICON","definition":{"$type":"RegexToken","regex":"/(aws|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":"Hex","definition":{"$type":"RegexToken","regex":"/[a-zA-Z0-9]+/"},"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@41"}},{"$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@80"}}]}},{"$type":"Type","name":"WhereTagEqual","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@57/definition/elements@0/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@69/definition/elements@0/elements@0/inferredType"}}]}},{"$type":"Type","name":"WhereKindEqual","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@57/definition/elements@1/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@69/definition/elements@1/elements@0/inferredType"}}]}},{"$type":"Type","name":"WhereExpression","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@52"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@64"}}]}}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"interfaces":[],"usedGrammars":[]}`)),PC={languageId:"likec4",fileExtensions:[".c4",".likec4",".like-c4"],caseInsensitive:!1},_H={skipValidations:!0,recoveryEnabled:!0,nodeLocationTracking:"full"},CH={AstReflection:()=>new AC},AH={Grammar:()=>kH(),LanguageMetaData:()=>PC,parser:{ParserConfig:()=>_H}};function pn(t){return t.el.ref}function Th(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 Pl=Symbol.for("idattr"),bv={writeId(t,e){return t[Pl]=e,t},readId(t){return t[Pl]}},xC={writeId(t,e){return yt(e)?t[Pl]=void 0:t[Pl]=e,t},readId(t){return t[Pl]}};function IH(t){return Object.assign(t,{c4Specification:{tags:new Set,elements:{},relationships:{},colors:{}},c4Elements:[],c4Relations:[],c4Views:[]})}function NC(t){return Eh(t)&&t.state>=xe.IndexedContent&&!!t.c4fqnIndex}function Eh(t){return t.textDocument.languageId===PC.languageId}function xl(t){return Eh(t)&&t.state==xe.Validated&&!!t.c4Specification&&!!t.c4Elements&&!!t.c4Relations&&!!t.c4Views&&!!t.c4fqnIndex}function PH(t){return e=>t.some(n=>n(e))}const xH=PH([uH,ov,$C,Vy,Xy,dH,nH,Qy,CC,rH,Y9,mC,cH,Yy,Z9,yH,Us,J9,Yc,si,wC,Ko,hh,ph,yv,mv,TH,mH,gH]),NH=t=>{let e=t;for(;e;){if(xH(e))return e;e=e.$container}};function OH(t){const e=t.diagnostics?.filter(r=>r.severity===Rc.Error)??[],n=new WeakSet(e.flatMap(r=>NH(r.node)??[]));return{isValid:r=>!n.has(r),invalidNodes:n}}function*DH(t,e){const n=t.parseResult.value.models.flatMap(s=>e(s)?s.elements:[]),r=[];let i;for(;i=n.shift();)if(e(i)){if(Us(i)){r.push(i);continue}if(Ko(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 LH(t){const e=pn(t.target);if(!e)throw new Error("RelationRefError: Invalid reference to target");if(Jt(t.source)){const n=pn(t.source);if(!n)throw new Error("RelationRefError: Invalid reference to source");return{source:n,target:e}}if(!Yc(t.$container))throw new Error("RelationRefError: Invalid container for sourceless relation");return{source:t.$container.$container,target:e}}function OC({value:t}){const e=parseFloat(t);return isNaN(e)?100:m_(e,{min:0,max:100})}function Rh(t,e){const n={};if(!t||t.length===0)return n;for(const r of t)if(e(r))switch(!0){case ev(r):{Q(r.value)&&(n.border=r.value);break}case zo(r):{const i=Nl(r);Q(i)&&(n.color=i);break}case gv(r):{Q(r.value)&&(n.shape=r.value);break}case Fs(r):{const i=r.libicon?.ref?.name??r.value;Q(i)&&(n.icon=i);break}case fv(r):{n.opacity=OC(r);break}default:Re(r.$type)}return n}function MH(t){const e={};if(!t||t.length===0)return e;for(const n of t){if(zo(n)){const r=Nl(n);Q(r)&&(e.color=r);continue}if(oh(n)){e.line=n.value;continue}if(Kf(n)){switch(n.key){case"head":{e.head=n.value;break}case"tail":{e.tail=n.value;break}default:Re(n)}continue}Re(n)}return e}function DC(t){const{color:e,line:n,head:r,tail:i}=MH(t?.filter(eH));return{...e&&e!==no?{color:e}:{},...n&&n!==_b?{line:n}:{},...r&&r!==to?{head:r}:{},...i?{tail:i}:{}}}function Nl(t){return t?.themeColor??t?.customColor?.$refText}function LC(t){switch(t){case"TopBottom":return"TB";case"BottomTop":return"BT";case"LeftRight":return"LR";case"RightLeft":return"RL";default:Re(t)}}function FH(t){switch(t){case"TB":return"TopBottom";case"BT":return"BottomTop";case"LR":return"LeftRight";case"RL":return"RightLeft";default:Re(t)}}function MC(t){if(Vy(t))return t;if(sv(t))return t.subject;if(ov(t))return MC(t.subject);Re(t)}class jH{constructor(e){this.services=e}async provideCodeLens(e,n,r){return e.state!==xe.Validated&&(Te.debug(`Waiting for document ${e.uri.path} to be validated`),await this.services.shared.workspace.DocumentBuilder.waitUntil(xe.Validated,e.uri,r),Te.debug(`Document ${e.uri.path} is validated`)),xl(e)?e.parseResult.value.views.flatMap(i=>i.views).flatMap(i=>{const s=bv.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 UH extends W1{completionOptions={triggerCharacters:["."]}}class BH extends G1{createDocumentHighlight(e){return ie.DocumentHighlight.create(e.segment.range,ie.DocumentHighlightKind.Read)}}class qH{constructor(e){this.services=e}getDocumentLinks(e,n){return xl(e)?jr(e.parseResult.value).filter(dv).flatMap(r=>{try{const i=pr(r.$cstNode,"value")?.range;if(!i)return[];const s=this.resolveLink(e,r.value);return{range:i,target:s}}catch(i){return Dt(i),[]}}).toArray():[]}resolveLink(e,n){if(Hy(n))return n;if(M9(n)){const i=new URL(e.uri.toString(!0));return new URL(n,i).toString()}const r=this.services.shared.workspace.WorkspaceManager.workspaceURL;return q9(n,r.toString())}}class WH{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 Dt(o),[]}})}getLikec4LibSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=e.icons.map(i=>this.getLibIconSymbol(i)).filter(Q);return r.length===0?[]:[{kind:Qn.Namespace,name:"icons",range:n.range,selectionRange:Wu(n,"icons")?.range??n.range,children:r}]}getSpecSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=pr(n,"name");if(!r)return[];const i=_t([...e.elements,...e.tags,...e.relationships],Ct(s=>{try{if(hh(s)||ph(s))return this.getKindSymbol(s);if(yv(s))return this.getTagSymbol(s)}catch(o){return Dt(o),null}Re(s)}),jt(Q));return i.length===0?[]:[{kind:Qn.Namespace,name:e.name,range:n.range,selectionRange:r.range,children:i}]}getModelSymbol(e){const n=e.$cstNode;if(!n)return[];const r=pr(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(Ko(e))return this.getExtendElementSymbol(e);if(si(e))return this.getElementSymbol(e)}catch(n){Dt(n)}return[]}getExtendElementSymbol(e){const n=e.$cstNode,r=e.element.$cstNode,i=e.body;return!n||!r?[]:[{kind:this.symbolKind(e),name:Th(e.element),range:n.range,selectionRange:r.range,children:i.elements.flatMap(s=>this.getElementsSymbol(s))}]}getElementSymbol(e){const n=e.$cstNode,r=pr(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=pr(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||xs(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||xs(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||xs(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?pr(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 GH extends K1{locator;constructor(e){super(e),this.locator=e.likec4.ModelLocator}getAstNodeHoverContent(e){if(_C(e))return{contents:{kind:"markdown",value:Oy(`
|
|
1129
|
-
tag: \`${e.name}\`
|
|
1130
|
-
`)}};if(si(e)){const n=this.locator.getParsedElement(e);return n?{contents:{kind:"markdown",value:[n.id,`### ${n.title}`,"`"+n.kind+"` "].join(`
|
|
1131
|
-
`)}}:void 0}}}class zH extends J1{constructor(e){super(e)}}class HH extends y8{highlightElement(e,n){if(vH(e))return n({node:e,property:"name",type:Ie.function});if(pH(e))return n({node:e,property:"name",type:Ie.type,modifier:[tt.definition]}),"prune";if(RC(e)&&"kind"in e){n({node:e,property:"kind",type:Ie.function});return}if(Us(e)&&"kind"in e&&n({node:e,property:"kind",type:Ie.function}),EC(e))return n({node:e,property:"key",type:Ie.property}),n({node:e,property:"value",type:Ie.variable,modifier:[tt.definition,tt.readonly]}),"prune";if((rv(e)||ta(e))&&e.$cstNode){n({cst:e.$cstNode,type:Ie.variable,modifier:[tt.definition,tt.readonly]});return}if(SH(e)&&Q(e.value)){n({node:e,property:"value",type:Ie.function});return}if((iH(e)||oH(e))&&Q(e.value)){n({node:e,property:"value",type:Ie.type,modifier:[tt.definition,tt.readonly]});return}if(eh(e)&&Q(e.kind)&&n({node:e,property:"kind",type:Ie.type,modifier:[tt.definition]}),nh(e)&&Q(e.tag)&&n({node:e,property:"tag",type:Ie.type,modifier:[tt.definition]}),tl(e)||bC(e))return n({node:e,property:"el",type:e.parent?Ie.property:Ie.variable,modifier:[tt.definition,tt.readonly]}),e.parent?void 0:"prune";if(mv(e)){n({node:e,keyword:"color",type:Ie.keyword}),n({node:e,property:"name",type:Ie.type,modifier:[tt.declaration,tt.readonly]});return}if((hh(e)||ph(e))&&n({node:e,property:"kind",type:Ie.type,modifier:[tt.declaration,tt.readonly]}),CC(e))return n({node:e,property:"values",type:Ie.interface});if(_C(e))return n({node:e,property:"name",type:Ie.type,modifier:[tt.definition]});if((kC(e)||th(e)&&Yc(e.$container))&&n({node:e,property:"key",type:Ie.property}),fv(e))return n({node:e,property:"key",type:Ie.property}),n({node:e,property:"value",type:Ie.number}),"prune";if(dv(e)||Fs(e)||tH(e))return n({node:e,property:"key",type:Ie.property}),"value"in e&&e.value&&n({node:e,property:"value",type:Ie.string}),Fs(e)&&e.libicon&&n({node:e,property:"libicon",type:Ie.enum,modifier:[tt.defaultLibrary]}),"prune";if(zo(e)||gv(e)||Kf(e)||oh(e)||ev(e))return n({node:e,property:"key",type:Ie.property}),"value"in e&&n({node:e,property:"value",type:Ie.enum}),"prune";if(si(e))return this.highlightAstElement(e,n);if(Yy(e))return this.highlightView(e,n)}highlightAstElement(e,n){n({node:e,property:"name",type:Ie.variable,modifier:[tt.declaration,tt.readonly]}),n({node:e,property:"kind",type:Ie.keyword,modifier:[]})}highlightView(e,n){e.name&&n({node:e,property:"name",type:Ie.variable,modifier:[tt.declaration,tt.readonly,"local"]})}}const{findNodeForProperty:VH}=zu,{toDocumentSegment:FC}=UD;function KH(t,e,n){const r=VH(e.$cstNode,"name");return{documentUri:n.uri,name:e.name,...e.$cstNode&&{selectionSegment:FC(e.$cstNode)},...r&&{nameSegment:FC(r)},path:t.getAstNodePath(e),type:kr}}function YH(t,e){const n=t.c4fqnIndex=new Er,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(Us(a))continue;if(Ko(a)){if(Jt(a.body)&&!xs(a.body.elements)){const l=Th(a.element);for(const u of a.body.elements)s.push([u,l])}continue}if(si(a)){const l=pN(a.name,c);if(n.add(l,{...KH(i,a,t),fqn:l}),xC.writeId(a,l),Jt(a.body)&&!xs(a.body.elements))for(const u of a.body.elements)s.push([u,l]);continue}Re(a)}catch(a){Dt(a)}}const Tv=t=>t.map(e=>" - "+e.uri.toString(!0)).join(`
|
|
1132
|
-
`);class XH{constructor(e){this.services=e,this.langiumDocuments=e.shared.workspace.LangiumDocuments,e.shared.workspace.DocumentBuilder.onBuildPhase(xe.IndexedContent,async(n,r)=>{Te.debug(`[FqnIndex] onIndexedContent ${n.length}:
|
|
1133
|
-
`+Tv(n));for(const i of n)if(Eh(i)){delete i.c4fqnIndex,delete i.c4Elements,delete i.c4Specification,delete i.c4Relations,delete i.c4Views;try{YH(i,e)}catch(s){vt(s)}}return await Promise.resolve()}),Te.debug("[FqnIndex] Created")}langiumDocuments;get documents(){return this.langiumDocuments.all.filter(NC)}entries(e){return this.documents.flatMap(n=>n.c4fqnIndex.keys().filter(e).flatMap(r=>n.c4fqnIndex.get(r)))}getFqn(e){return xC.readId(e)??null}byFqn(e){return this.documents.flatMap(n=>n.c4fqnIndex.get(e))}directChildrenOf(e){return De([e]).flatMap(n=>{const r=this.entries(i=>pt(i)===n).map(i=>[i.name,i]).toArray();return r.length===0?[]:new Er(r).entriesGroupedByKey().flatMap(([i,s])=>s.length===1?s:[]).iterator()})}uniqueDescedants(e){return new Et(()=>{const n=`${e}.`,r=new Set,i=[],s=new Er;if(this.entries(o=>o.startsWith(n)).forEach(o=>{const a=ma(o.fqn),c={...o,name:a};pt(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():Wt)}}function JH(t){const e=new Map;for(const n of t)if(CN(n)&&n.viewOf&&yt(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=Ay(e.get(i.id)??[],o=>o!==n);s&&(i.navigateTo=s)}return t}function QH(t){const e=new Fy.Graph({directed:!0,multigraph:!1,compound:!1});for(const n of Sf(t))e.setNode(n.id),Ib(n)&&e.setEdge(n.id,n.extends);if(e.edgeCount()===0)return t;for(;!l9(e);){const n=jn(c9(e));if(!n)break;const r=Oc(n);if(!r)break;e.removeNode(r)}return tC(e,e.sources()).reduce((n,r)=>{const i=t[r];if(!i)return n;if(Ib(i)){const s=n[i.extends];return s?Object.assign(n,{[i.id]:{...s,...i,rules:[...s.rules,...i.rules]}}):(Le.debug(`View "${i.id}" extends from "${i.extends}" which does not exist`),n)}return Object.assign(n,{[i.id]:i})},{})}function ZH(t,e="/"){const n=_t(t,Ct(c=>c.docUri),jt(Q),Ui());if(n.length===0)return"";if(Fn(n,1)&&n.length===1){const c=Nf(n[0]).pathname.split(e);return c.length<=1?e:(c.pop(),c.join(e)+e)}ae(Fn(n,2),"Expected at least 2 unique URIs");const[r,...i]=n,s=Nf(r).pathname.split(e);let o=s.length;for(const c of i){if(c===r)continue;const l=Nf(c).pathname.split(e);for(let u=0;u<o;u++)l[u]!==s[u]&&(o=u);if(o===0)return""}const a=s.slice(0,o).join(e);return a.endsWith(e)?a:a+e}function e7(t){const e="/",n=ZH(t,e);return t.map(r=>{if(!r.docUri)return{...r,parts:[]};let i=Nf(r.docUri).pathname;return n.length>0?(ae(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,{...r,parts:i.split(e)}}).sort((r,i)=>{if(r.parts.length===i.parts.length){if(r.parts.length===0)return 0;for(const[s,o]of j8(r.parts,i.parts)){const a=s.localeCompare(o);if(a!==0)return a}return 0}return r.parts.length-i.parts.length}).map(({parts:r,...i})=>({...i,relativePath:r.join(e)}))}function t7(t,e){const n={tags:new Set,elements:{},relationships:{},colors:{}};gW(Ct(e,ri("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)});const r=(f,h)=>{try{return h.map(p=>({...p,url:t.lsp.DocumentLinkProvider.resolveLink(f,p.url)}))}catch(p){return vt(p),null}},i=Bi(n.colors,f=>ID(f.color)),s=f=>({tags:h,links:p,style:{color:y,shape:$,icon:T,opacity:w,border:b},id:_,kind:x,title:F,description:P,technology:G,metadata:B})=>{try{const W=n.elements[x];if(!W)return Te.warn(`No kind '${x}' found for ${_}`),null;const I=p?r(f,p):null;return y??=W.style.color,$??=W.style.shape,T??=W.style.icon,w??=W.style.opacity,b??=W.style.border,G??=W.technology,{...y&&{color:y},...$&&{shape:$},...T&&{icon:T},...B&&{metadata:B},...W.notation&&{notation:W.notation},style:{...b&&{border:b},...d_(w)&&{opacity:w}},links:I,tags:h??null,technology:G??null,description:P??null,title:F,kind:x,id:_}}catch(W){vt(W)}return null},o=_t(e,Qt(f=>Ct(f.c4Elements,s(f))),jt(Q),$f(mu),Q8((f,h)=>{const p=pt(h.id);return p&&yt(f[p])?(vt(`No parent found for ${h.id}`),f):(f[h.id]=h,f)},{})),a=f=>({astPath:h,source:p,target:y,kind:$,links:T,id:w,...b})=>{if(yt(o[p])||yt(o[y]))return Te.warn(`Invalid relation ${w}, source: ${p}(${!!o[p]}), target: ${y}(${!!o[y]})`),null;const _=T?r(f,T):null;return Sr($)&&$ in n.relationships?{...n.relationships[$],...b,..._&&{links:_},source:p,target:y,kind:$,id:w}:{..._&&{links:_},...b,source:p,target:y,id:w}},c=_t(e,Qt(f=>Ct(f.c4Relations,a(f))),jt(Q),$f(ya),a_(),h_(ri("id"))),l=f=>{const h=f.uri.toString();return p=>{let{id:y,title:$,description:T,tags:w,links:b,astPath:_,...x}=p;p.__==="element"&&yt($)&&"viewOf"in p&&($=o[p.viewOf]?.title??null),yt($)&&y==="index"&&($="Landscape view");const F=b?r(f,b):null;return{...x,tags:w,links:F,docUri:h,description:T,title:$,id:y,customColorDefinitions:i}}},u=e.flatMap(f=>Ct(f.c4Views,l(f)));u.some(f=>f.id==="index")||u.unshift({__:"element",id:"index",title:"Landscape view",description:null,tags:null,links:null,customColorDefinitions:i,rules:[{include:[{wildcard:!0}]}]});const d=_t(u,e7,h_(ri("id")),QH);return{specification:{tags:Array.from(n.tags),elements:n.elements,relationships:n.relationships},elements:o,relations:c,views:d}}const Ev="ParsedLikeC4Model",Rv="ComputedLikeC4Model";class n7{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(xe.Validated,async(r,i)=>{let s=[];try{Te.debug(`[ModelBuilder] onValidated (${r.length} docs)
|
|
1134
|
-
${Tv(r)}`);for(const o of n.parse(r))s.push(o.uri)}catch(o){vt(o)}return s.length>0&&this.notifyListeners(s),await Promise.resolve()}),Te.debug("[ModelBuilder] Created")}langiumDocuments;listeners=[];unsafeSyncBuildModel(){return this.services.WorkspaceCache.get(Ev,()=>{const e=this.documents();return e.length===0?(Te.debug("[ModelBuilder] No documents to build model from"),null):(Te.debug(`[ModelBuilder] buildModel from ${e.length} docs:
|
|
1135
|
-
${Tv(e)}`),t7(this.services,e))})}async buildModel(e){const n=this.services.WorkspaceCache;return n.has(Ev)?n.get(Ev):await this.services.shared.workspace.WorkspaceLock.read(async()=>(e&&await kt(e),this.unsafeSyncBuildModel()))}previousViews={};unsafeSyncBuildComputedModel(e){const n=this.services.WorkspaceCache,r=this.services.WorkspaceCache;return n.get(Rv,()=>{const i=new lC(e),s=[];for(const a of Sf(e.views)){const c=iu(a)?aC(a,i):cC(a,i);if(!c.isSuccess){vt(c.error);continue}s.push(c.view)}JH(s);const o=ii(s,a=>{const c=this.previousViews[a.id],l=c&&L_(a,c)?c:a;return r.set(jC(a.id),l),[a.id,l]});return this.previousViews={...o},{specification:e.specification,elements:e.elements,relations:e.relations,views:o}})}async buildComputedModel(e){const n=this.services.WorkspaceCache;if(n.has(Rv))return n.get(Rv);const r=await this.buildModel(e);return r?await this.services.shared.workspace.WorkspaceLock.read(async()=>(e&&await kt(e),this.unsafeSyncBuildComputedModel(r))):null}async computeView(e,n){const r=this.services.WorkspaceCache,i=jC(e);if(r.has(i))return r.get(i);const s=await this.buildModel(n),o=s?.views[e];return o?await this.services.shared.workspace.WorkspaceLock.read(async()=>(n&&await kt(n),r.get(i,()=>{const a=new lC(s),c=iu(o)?aC(o,a):cC(o,a);if(!c.isSuccess)return Dt(c.error),null;let l=c.view;const u=Sf(s.views).filter(f=>Pb(f)&&f.id!==e);l.nodes.forEach(f=>{if(!f.navigateTo){const h=Ay(u,p=>p.viewOf===f.id);h&&(f.navigateTo=h.id)}});const d=this.previousViews[e];return l=d&&L_(l,d)?d:l,this.previousViews[e]=l,l}))):(Te.warn(`[ModelBuilder] Cannot find view ${e}`),null)}onModelParsed(e){return this.listeners.push(e),Cs.create(()=>{const n=this.listeners.indexOf(e);n>=0&&this.listeners.splice(n,1)})}documents(){return this.langiumDocuments.all.filter(xl).toArray()}notifyListeners(e){for(const n of this.listeners)try{n(e)}catch(r){Dt(r)}}}function jC(t){return`computed-view-${t}`}const{findNodeForKeyword:r7,findNodeForProperty:Sh}=zu,{getDocument:i7}=Du;class s7{constructor(e){this.services=e,this.fqnIndex=e.likec4.FqnIndex,this.langiumDocuments=e.shared.workspace.LangiumDocuments}fqnIndex;langiumDocuments;documents(){return this.langiumDocuments.all.filter(xl)}getParsedElement(e){const n=this.fqnIndex.getFqn(e);if(!n)return null;const r=i7(e);return xl(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(!Us(i))continue;let s=i.title?Sh(i.$cstNode,"title"):void 0;if(s??=i.kind?Sh(i.$cstNode,"kind"):void 0,s??=Sh(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(Yy(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?Sh(r.$cstNode,"name"):void 0;return i??=r7(r.$cstNode,"view"),i??=r.$cstNode,i?{uri:n.doc.uri.toString(),range:i.range}:null}}function Sv(...t){var e=t.length>1?t.join(":::"):t[0];return qG(e).toString(36)}function o7({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 a7({nodes:t,edges:e,...n}){return{...n,nodes:Bi(t,({b:r,c:i,...s})=>({x:r[0],y:r[1],width:r[2],height:r[3],isCompound:i,...s})),edges:Bi(e,({p:r,cp:i,l:s,dp:o,...a})=>({...!!i&&{controlPoints:i},...!!s&&{labelBBox:s},...!!o&&{dotpos:o},...a,points:r}))}}function c7(t){const e=dG(o7(t)),n=CG(e),r=[];let i=0;const s=200;for(;i<n.length;)r.push(" * "+n.slice(i,Math.min(i+s,n.length))),i+=s;return r.unshift("/**"," * @likec4-generated(v1)"),r.push(" */"),r.join(`
|
|
1136
|
-
`)}function UC(t){return t.includes("@likec4-generated")}function l7(t){if(!UC(t))throw new Error(`Not a likec4-generated comment: ${t}`);const e=t.trim().split(`
|
|
1137
|
-
`).filter(r=>!r.includes("**")&&!r.includes("@likec4-")&&!r.includes("*/")).map(r=>r.replaceAll("*","").trim()).join(""),n=kG(e);return a7(EG(n))}const BC=({operator:t,not:e},n)=>t.startsWith("!=")?{neq:n}:t.startsWith("=")?{eq:n}:e?{neq:n}:{eq:n};function Ol(t){switch(!0){case aH(t):{const e=t.value?.ref?.name;return ae(e,"Expected tag name"),{tag:BC(t,e)}}case sH(t):{const e=t.value?.ref?.name;return ae(e,"Expected kind name"),{kind:BC(t,e)}}case(RH(t)||$H(t)):return{not:Ol(t.value)};case EH(t):{const e=Ol(t.left),n=Ol(t.right),r=t.operator.toLowerCase();switch(r){case"and":{const i=[pp(e)?e.and:e,pp(n)?n.and:n].flat();return ae(gs(i),"Expected non-empty array"),{and:i}}case"or":{const i=[gp(e)?e.or:e,gp(n)?n.or:n].flat();return ae(gs(i),"Expected non-empty array"),{or:i}}default:Re(r)}}default:Re(t)}}const{getDocument:$v}=Du;function Bs(t){return Sr(t)?At(t).split(`
|
|
1138
|
-
`).join(" "):void 0}function At(t){return Sr(t)?Oy(t).trim():void 0}class u7{constructor(e){this.services=e,this.fqnIndex=e.likec4.FqnIndex,Te.debug("[ModelParser] Created")}fqnIndex;parse(e){const n=Array.isArray(e)?e:[e],r=[];for(const i of n){if(!NC(i)){Te.warn(`Not a FqnIndexedDocument: ${i.uri.toString(!0)}`);continue}try{r.push(this.parseLikeC4Document(i))}catch(s){Dt(new Error(`Error parsing document ${i.uri.toString()}`,{cause:s}))}}return r}parseLikeC4Document(e){const n=IH(e),{isValid:r}=OH(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(u=>u.elements.filter(n));for(const{kind:u,props:d}of o)try{const f=u.name;if(!Q(f))continue;if(f in i.elements){Te.warn(`Element kind "${f}" is already defined`);continue}const h=d.find(th),p=ii(d.filter(wH).filter(y=>Sr(y.value))??[],y=>[y.key,At(y.value)]);i.elements[f]={...p,style:{...Rh(h?.props,n)}}}catch(f){vt(f)}const a=s.flatMap(u=>u.relationships.filter(n));for(const{kind:u,props:d}of a)try{const f=u.name;if(!Q(f))continue;if(f in i.relationships){Te.warn(`Relationship kind "${f}" is already defined`);continue}const h=ii(d.filter(bH).filter(p=>Sr(p.value))??[],p=>[p.key,At(p.value)]);i.relationships[f]={...h,...DC(d)}}catch(f){vt(f)}const c=s.flatMap(u=>u.tags.filter(n));for(const u of c){const d=u.tag.name;Q(d)&&i.tags.add(d)}const l=s.flatMap(u=>u.colors.filter(n));for(const{name:u,color:d}of l)try{const f=u.name;if(f in i.colors){Te.warn(`Custom color "${f}" is already defined`);continue}i.colors[f]={color:d}}catch(f){vt(f)}}parseModel(e,n){for(const r of DH(e,n)){if(si(r)){try{e.c4Elements.push(this.parseElement(r,n))}catch(i){vt(i)}continue}if(Us(r)){try{e.c4Relations.push(this.parseRelation(r))}catch(i){vt(i)}continue}Re(r)}}parseElement(e,n){const r=this.resolveFqn(e),i=e.kind.$refText,s=this.convertTags(e.body),o=e.body?.props.find(th)?.props,a=Rh(o,n),c=this.getMetadata(e.body?.props.find(dC)),l=this.getAstNodePath(e);let[u,d,f]=e.props??[];const h=ii(e.body?.props.filter(gC)??[],$=>[$.key,$.value||void 0]);u=Bs(u??h.title),d=At(h.description??d),f=Bs(h.technology??f);const p=this.convertLinks(e.body),y=e.body?.props.find(Fs);if(y){const $=y.libicon?.ref?.name??y.value;Q($)&&(a.icon=$)}return{id:r,kind:i,astPath:l,title:u??e.name,...c&&{metadata:c},...s&&{tags:s},...p&&gs(p)&&{links:p},...Q(f)&&{technology:f},...Q(d)&&{description:d},style:a}}parseRelation(e){const n=LH(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(dC)),l=this.getAstNodePath(e),u=ii(e.body?.props.filter(pv).filter(y=>Sr(y.value))??[],y=>[y.key,y.value]),d=At(e.title??u.title)??"",f=At(u.description),h=At(e.technology)??Bs(u.technology),p=e.body?.props.find(kC);return{id:Sv(l,i,r),astPath:l,source:i,target:r,title:d,...c&&{metadata:c},...Q(h)&&{technology:h},...Q(f)&&{description:f},...a&&{kind:a},...s&&{tags:s},...gs(o)&&{links:o},...DC(p?.props)}}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(av(i)?this.parseElementView(i,n):this.parseDynamicElementView(i,n))}catch(s){vt(s)}}parseViewRulePredicate(e,n){const r=[];let i=e.predicates;for(;i;){try{Q(i.value)&&n(i.value)&&r.unshift(this.parsePredicate(i.value,n))}catch(s){vt(s)}i=i.prev}return fH(e)?{include:r}:{exclude:r}}parsePredicate(e,n){if(X9(e))return this.parseElementPredicate(e,n);if(Q9(e))return this.parseRelationPredicate(e,n);Re(e)}parseElementExpressionsIterator(e){const n=[];let r=e;for(;r;){try{n.unshift(this.parseElementExpr(r.value))}catch(i){vt(i)}r=r.prev}return n}parseElementPredicate(e,n){if(ov(e))return this.parseElementPredicateWith(e,n);if(sv(e))return this.parseElementPredicateWhere(e);if(Vy(e))return this.parseElementExpr(e);Re(e)}parseElementExpr(e){if(ta(e))return{wildcard:!0};if(eh(e))return ae(e.kind,"ElementKindExpr kind is not resolved: "+e.$cstNode?.text),{elementKind:e.kind.$refText,isEqual:e.isEqual};if(nh(e)){ae(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(vC(e)){const n=pn(e.expand);return ae(n,"Element not found "+e.expand.$cstNode?.text),{expanded:this.resolveFqn(n)}}if(rv(e)){const n=pn(e.parent);return ae(n,"Element not found "+e.parent.$cstNode?.text),{element:this.resolveFqn(n),isDescedants:!0}}if(tl(e)){const n=pn(e);return ae(n,"Element not found "+e.$cstNode?.text),{element:this.resolveFqn(n)}}Re(e)}parseElementPredicateWith(e,n){const r=this.parseElementPredicate(e.subject,n);return(e.custom?.props??[]).reduce((i,s)=>{if(EC(s)){const o=s.value.view.$refText;return Q(o)&&(i.custom.navigateTo=o),i}if(gC(s)){if(Jt(s.value)){let o=s.key==="description"?At(s.value):Bs(s.value);i.custom[s.key]=o||""}return i}if(Fs(s)){const o=s.libicon?.ref?.name??s.value;return Jt(o)&&(i.custom[s.key]=o),i}if(zo(s)){const o=Nl(s);return Jt(o)&&(i.custom[s.key]=o),i}if(gv(s)||ev(s))return Jt(s.value)&&(i.custom[s.key]=s.value),i;if(fv(s))return Jt(s.value)&&(i.custom[s.key]=OC(s)),i;if(pl(s))return Q(s.value)&&(i.custom[s.key]=At(s.value)),i;Re(s)},{custom:{expr:r}})}parseElementPredicateWhere(e){return{where:{expr:this.parseElementExpr(e.subject),condition:e.where?Ol(e.where):{kind:{neq:"--always-true--"}}}}}parseRelationPredicate(e,n){if($C(e)){const r=SC(e.subject)?e.subject.subject:e.subject;return this.parseRelationPredicateWith(e,r)}if(SC(e))return this.parseRelationPredicateWhere(e);if(Xy(e))return this.parseRelationExpr(e);Re(e)}parseRelationPredicateWhere(e){return{where:{expr:this.parseRelationExpr(e.subject),condition:e.where?Ol(e.where):{kind:{neq:"--always-true--"}}}}}parseRelationPredicateWith(e,n){const r=this.parseRelationExpr(n);return(e.custom?.props??[]).reduce((i,s)=>{if(pv(s))return Jt(s.value)&&(i.customRelation[s.key]=At(s.value)??""),i;if(Kf(s))return Q(s.value)&&(i.customRelation[s.key]=s.value),i;if(zo(s)){const o=Nl(s);return Q(o)&&(i.customRelation[s.key]=o),i}if(oh(s))return Q(s.value)&&(i.customRelation[s.key]=s.value),i;if(pl(s))return Q(s.value)&&(i.customRelation[s.key]=At(s.value)),i;Re(s)},{customRelation:{relation:r}})}parseRelationExpr(e){if(pC(e))return{source:this.parseElementExpr(e.source.from),target:this.parseElementExpr(e.target),isBidirectional:e.source.isBidirectional};if(TC(e))return{inout:this.parseElementExpr(e.inout.to)};if(RC(e))return{outgoing:this.parseElementExpr(e.from)};if(hH(e))return{incoming:this.parseElementExpr(e.to)};Re(e)}parseViewRule(e,n){if(Zy(e))return this.parseViewRulePredicate(e,n);if(mh(e)){const r=Rh(e.props.filter(Qy),n),i=At(e.props.find(pl)?.value);return{targets:this.parseElementExpressionsIterator(e.target),...i&&{notation:i},style:{...r}}}if(wv(e))return{autoLayout:LC(e.direction)};Re(e)}parseViewManualLaout(e){const n=Ru(e.$cstNode,["BLOCK_COMMENT"]);if(!(!n||!UC(n.text)))try{return l7(n.text)}catch(r){const i=$v(e);Te.warn(r),Te.warn(`Ignoring manual layout of "${e.name??"unnamed"}" at ${i.uri.fsPath}:${1+(n.range.start.line||0)}`);return}}parseDynamicStep(e){const n=pn(e.source);if(!n)throw new Error("Invalid reference to source");const r=pn(e.target);if(!r)throw new Error("Invalid reference to target");let i=this.resolveFqn(n),s=this.resolveFqn(r);const o=At(e.title??e.custom?.props.find(c=>c.key==="title")?.value)??"";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(pv(c)){const l=At(c.value);Q(l)&&c.key!=="title"&&(a[c.key]=l);continue}if(Kf(c)){a[c.key]=c.value;continue}if(zo(c)){const l=Nl(c);Q(l)&&(a[c.key]=l);continue}if(oh(c)){a[c.key]=c.value;continue}if(pl(c)){Q(c.value)&&(a[c.key]=c.value);continue}Re(c)}catch(l){vt(l)}return a}parseElementView(e,n){const r=e.body;ae(r,"ElementView body is not defined");const i=this.getAstNodePath(e);let s=null;if("viewOf"in e){const h=pn(e.viewOf),p=h&&this.resolveFqn(h);p?s=p:Te.warn("viewOf is not resolved: "+e.$cstNode?.text)}let o=e.name;o||(o="view_"+Sv($v(e).uri.toString(),i,s??""));const a=Bs(r.props.find(h=>h.key==="title")?.value)??null,c=At(r.props.find(h=>h.key==="description")?.value)??null,l=this.convertTags(r),u=this.convertLinks(r),d=this.parseViewManualLaout(e),f={__:"element",id:o,astPath:i,title:a,description:c,tags:l,links:gs(u)?u:null,rules:r.rules.flatMap(h=>{try{return n(h)?this.parseViewRule(h,n):[]}catch(p){return vt(p),[]}}),...s&&{viewOf:s},...d&&{manualLayout:d}};if(bv.writeId(e,f.id),"extends"in e){const h=e.extends.view.ref;return ae(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;ae(r,"DynamicElementView body is not defined");const i=r.props.filter(n),s=this.getAstNodePath(e);let o=e.name;o||(o="dynamic_"+Sv($v(e).uri.toString(),s));const a=Bs(i.find(f=>f.key==="title")?.value)??null,c=At(i.find(f=>f.key==="description")?.value)??null,l=this.convertTags(r),u=this.convertLinks(r);bv.writeId(e,o);const d=this.parseViewManualLaout(e);return{__:"dynamic",id:o,astPath:s,title:a,description:c,tags:l,links:gs(u)?u:null,rules:r.rules.reduce((f,h)=>{if(!n(h))return f;try{if(lH(h)){const p=[];let y=h.predicates;for(;y;){try{if(n(y.value)){const $=this.parseElementPredicate(y.value,n);p.unshift($)}}catch($){vt($)}y=y.prev}return p.length>0&&f.push({include:p}),f}if(mh(h)){const p=Rh(h.props.filter(Qy),n),y=At(h.props.find(pl)?.value),$=this.parseElementExpressionsIterator(h.target);return $.length>0&&f.push({targets:$,...y&&{notation:y},style:{...p}}),f}if(wv(h))return f.push({autoLayout:LC(h.direction)}),f;Re(h)}catch(p){return vt(p),f}},[]),steps:r.steps.reduce((f,h)=>{try{n(h)&&f.push(this.parseDynamicStep(h))}catch(p){vt(p)}return f},[]),...d&&{manualLayout:d}}}resolveFqn(e){if(Ko(e))return Th(e.element);const n=this.fqnIndex.getFqn(e);return ae(n,`Not indexed element: ${this.getAstNodePath(e)}`),n}getAstNodePath(e){return this.services.workspace.AstNodeLocator.getAstNodePath(e)}getMetadata(e){return e?.props!=null?ii(e.props,n=>[n.key,At(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(Q);i.length>0&&r.unshift(...i)}catch{}n=n.prev}return gs(r)?r:null}convertLinks(e){if(!(!e?.props||e.props.length===0))return _t(e.props,jt(dv),Qt(n=>{const r=n.value;if(Q(r)){const i=Q(n.title)?Bs(n.title):void 0;return i?{url:r,title:i}:{url:r}}return[]}))}}const{findNodeForKeyword:d7,findNodeForProperty:Sie}=zu,f7=(t,e,n=0)=>{const r=n>0?" ".repeat(n):"";return[r+`style ${t} {`,...Uo(e).map(([i,s])=>r+` ${i} ${i==="opacity"?s.toString()+"%":s}`),r+"}"]},h7=(t,e)=>n=>{if(!mh(n))return!1;const r=n.target.value;if(!r||Q(n.target.prev)||!tl(r))return!1;const i=r.el.ref;return(i?e.getFqn(i):null)===t};function p7(t,{view:e,viewAst:n,targets:r,style:i}){ae(n.body,`View ${e.id} has no body`);const s=n.$cstNode;ae(s,"viewCstNode");const o=Oc(n.body.rules)?.$cstNode?.range.end??n.body.$cstNode?.range.end;ae(o,"insertPos is not defined");const a=s.range.start.character+2,c=t.likec4.FqnIndex,l=jt(n.body.rules,mh),u=e.__==="element"?e.viewOf:null,d=[],f=[];r.forEach($=>{const T=RW(l,h7($,c)),w=u&&ur(u,$)?$.substring(u.length+1):$;T?d.push({fqn:w,rule:T}):f.push({fqn:w})});const h={start:o,end:o},p=$=>{$.start.line<=h.start.line&&($.start.line==h.start.line?h.start.character=Math.min($.start.character,h.start.character):h.start=$.start),$.end.line>=h.end.line&&($.end.line==h.end.line?h.end.character=Math.max($.end.character,h.end.character):h.end=$.end)},y=[];if(f.length>0){const $=f.flatMap(({fqn:T})=>f7(T,i,a));y.push(Kt.insert(o,`
|
|
1139
|
-
`+$.join(`
|
|
1140
|
-
`))),h.start={line:o.line+1,character:a},h.end={line:o.line+$.length,character:Oc($)?.length??0}}if(d.length>0)for(const{rule:$}of d){const T=$.$cstNode;ae(T,"RuleCstNode not found");for(const[w,b]of Uo(i)){const _=w==="opacity"?b.toString()+"%":b,x=$.props.find(B=>B.key===w);if(x&&x.$cstNode){const{range:{start:B,end:W}}=x.$cstNode;p({start:B,end:W}),y.push(Kt.replace({start:B,end:W},w+" "+_));continue}const F=d7(T,"{")?.range.end;ae(F,"Opening brace not found");const P=" ".repeat(2+T.range.start.character),G=P+w+" "+_;y.push(Kt.insert(F,`
|
|
1141
|
-
`+G)),p({start:{line:F.line+1,character:P.length},end:{line:F.line+1,character:G.length}})}}return{modifiedRange:h,edits:y}}const{findNodeForProperty:g7,findNodeForKeyword:m7}=zu;function y7(t,{view:e,viewAst:n,layout:r}){ae(n.body,`View ${e.id} has no body`);const i=n.$cstNode;ae(i,"viewCstNode");const s=FH(r),o=n.body.rules.findLast(wv);if(o&&o.$cstNode){const l=g7(o.$cstNode,"direction");return l?Kt.replace(l.range,s):Kt.replace(o.$cstNode.range,`autoLayout ${s}`)}const a=m7(n.body.$cstNode,"}")?.range.start;ae(a,"Closing brace not found");const c=` autoLayout ${s}
|
|
1142
|
-
`+" ".repeat(a.character);return Kt.insert(a,c)}function v7(t,{viewAst:e,layout:n}){ae(e.$cstNode,"invalid view.$cstNode");const r=Ru(e.$cstNode,["BLOCK_COMMENT"]);let i=c7(n);return e.$cstNode.range.start.character>0&&(i=MW(i,e.$cstNode.range.start.character)),r?Kt.replace(r.range,i.trimStart()):Kt.insert({line:e.$cstNode.range.start.line,character:0},i+`
|
|
1143
|
-
`)}class w7{constructor(e){this.services=e,this.locator=e.likec4.ModelLocator}locator;async applyChange(e){const n=this.services.shared.lsp.Connection;ae(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){Le.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,...p7(this.services,{...r,targets:n.targets,style:n.style})};case"change-autolayout":{const s=y7(this.services,{...r,layout:n.layout});return{doc:r.doc,modifiedRange:s.range,edits:[s]}}case"save-manual-layout":const i=v7(this.services,{...r,layout:n.layout});return{doc:r.doc,modifiedRange:i.range,edits:[i]};default:Re(n)}}}class b7 extends r${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){Dt(i)}return r}exportViews(e,n,r){if(!(yt(e)||e.length===0))for(const i of e.flatMap(s=>s.views))try{Q(i.name)&&n.push(this.descriptions.createDescription(i,i.name,r))}catch(s){Dt(s)}}exportModel(e,n,r){if(!(yt(e)||e.length===0))for(const i of e.flatMap(s=>s.elements))try{si(i)&&Q(i.name)&&n.push(this.descriptions.createDescription(i,i.name,r))}catch(s){Dt(s)}}exportLibrary(e,n,r){if(!yt(e))try{for(const i of e.flatMap(s=>s.icons))n.push(this.descriptions.createDescription(i,i.name,r))}catch(i){Dt(i)}}exportSpecification(e,n,r){if(!(yt(e)||e.length===0))for(const i of e.flatMap(s=>[...s.elements,...s.relationships,...s.tags,...s.colors]))try{switch(!0){case hh(i):{Q(i.kind.name)&&n.push(this.descriptions.createDescription(i.kind,i.kind.name,r));continue}case yv(i):{Q(i.tag.name)&&n.push(this.descriptions.createDescription(i.tag,"#"+i.tag.name,r));continue}case ph(i):{Q(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 mv(i):{Q(i.name.name)&&n.push(this.descriptions.createDescription(i.name,i.name.name,r));continue}default:Re(i)}}catch(s){Dt(s)}}computeLocalScopes(e,n){return new Promise(r=>{const i=e.parseResult.value,s=new Er;for(const o of i.models)try{const a=this.processContainer(o,s,e);s.addAll(i,a.values())}catch(a){Dt(a)}r(s)})}processContainer(e,n,r){const i=new Er,s=new Er;for(const o of e.elements){if(Us(o))continue;let a;if(si(o)?(Q(o.name)&&i.add(o.name,this.descriptions.createDescription(o,o.name,r)),a=o.body):Ko(o)&&(a=o.body),a&&a.elements.length>0)try{const c=this.processContainer(a,n,r);for(const[l,u]of c)s.add(l,u)}catch(c){Dt(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:T7}=Du;class E7 extends c${fqnIndex;constructor(e){super(e),this.fqnIndex=e.likec4.FqnIndex}directChildrenOf(e){return this.fqnIndex.directChildrenOf(e)}uniqueDescedants(e){return new Et(()=>{const n=e(),r=n&&this.fqnIndex.getFqn(n);return r?this.fqnIndex.uniqueDescedants(r).iterator():null},n=>n?n.next():Wt)}scopeElementRef(e){return this.uniqueDescedants(()=>e.el.ref)}scopeExtendElement({element:e}){return De([e.el.$nodeDescription]).nonNullable().concat(this.uniqueDescedants(()=>pn(e)))}scopeElementView({viewOf:e,extends:n}){return e?De([e.el.$nodeDescription]).nonNullable().concat(this.uniqueDescedants(()=>pn(e))):n?De([n]).flatMap(r=>{const i=r.view.ref;return i?this.scopeElementView(i):Tu}):Tu}getScope(e){try{const n=this.reflection.getReferenceType(e);if(n!==kr)return this.getGlobalScope(n);try{const r=e.container;if(bC(r)&&e.property==="el"){const i=r.parent;return i?new kc(this.directChildrenOf(Th(i))):this.getGlobalScope(n)}if(tl(r)&&e.property==="el"){const i=r.parent;if(i)return new kc(this.scopeElementRef(i));if(e.reference.$refText==="this"||e.reference.$refText==="it"){const s=rn(r,si);return s?new i$([this.descriptions.createDescription(s,e.reference.$refText)]):s$}}return this.computeScope(e)}catch(r){return Te.warn(r),this.getGlobalScope(n)}}catch(n){return Te.warn(n),s$}}computeScope(e){const n=this.reflection.getReferenceType(e);ae(n===kr,"Invalid reference type");const r=[],i=T7(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(De(a)),wC(o)&&r.push(this.scopeExtendElement(o.$container)),mC(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 kc(this.indexManager.allElements(e))}}class R7{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){Te.info("[ServerRpc] no connection, not initializing");return}Te.info("[ServerRpc] init");const s=this.services.shared.workspace.LangiumDocuments,o=this.services.shared.workspace.DocumentBuilder,a=CW(()=>void i.sendNotification(PG,"").catch(l=>(Te.error(`[ServerRpc] error sending onDidChangeModel: ${l}`),Promise.resolve())),{timing:"both",waitMs:350,maxWaitMs:1e3});let c=!0;this.disposables.push(Cs.create(()=>{a.cancel()}),e.onModelParsed(()=>a.call()),i.onRequest(NG,async l=>({model:await e.buildComputedModel(l)})),i.onRequest(xG,async l=>({model:await e.buildModel(l)})),i.onRequest(OG,async({viewId:l},u)=>({view:await e.computeView(l,u)})),i.onRequest(DG,async({docs:l},u)=>{const d=l.map(p=>Yt.parse(p)),f=p=>d.every(y=>!Nn.equals(y,p)),h=s.all.filter(p=>Eh(p)&&f(p.uri)&&p.uri.scheme!==$_).map(p=>p.uri).toArray();Te.debug(`[ServerRpc] received request to build:
|
|
1144
|
-
changed (total ${d.length}):${l.map(p=>`
|
|
1145
|
-
- `+p).join("")}
|
|
1146
|
-
deleted (total ${h.length}):${h.map(p=>`
|
|
1147
|
-
- `+p.toString()).join(`
|
|
1148
|
-
`)}`),!c&&d.length+h.length>0&&(await Promise.allSettled([...d,...h].map(async p=>{const y=p.toString();Te.debug(`clear diagnostics for ${y}`);try{await i.sendDiagnostics({uri:y,diagnostics:[]})}catch($){Te.warn(`error clearing diagnostics for ${y}: ${$}`)}})),await kt(u)),c=!1,await o.update(d,h,u)}),i.onRequest(LG,l=>{if("element"in l)return n.locateElement(l.element,l.property??"name");if("relation"in l)return n.locateRelation(l.relation);if("view"in l)return n.locateView(l.view);Re(l)}),i.onRequest(MG,async(l,u)=>await r.applyChange(l)))}dispose(){let e;for(;e=this.disposables.pop();)try{e.dispose()}catch(n){Dt(n)}}}class S7{constructor(e){this.services=e}getSymbolKind(e){const n=it(e)?e.$type:e.type,r=(...i)=>i.some(s=>this.services.AstReflection.isSubtype(n,s));switch(!0){case r(kr,Vo):return Qn.Constructor;case r(Yo,Xo,Zo):return Qn.Namespace;case r(Ds):return Qn.Class;case r(zi,js,Ls,ea):return Qn.EnumMember;case r(Gi,Qo):return Qn.Event;case r(Ms,Jo):return Qn.TypeParameter}return Qn.Field}getCompletionItemKind(e){const n=it(e)?e.$type:e.type,r=(...i)=>i.some(s=>this.services.AstReflection.isSubtype(n,s));switch(!0){case r(Ls):return br.Color;case r(kr,Vo):return br.Constructor;case r(Yo,Xo,Zo):return br.Module;case r(Ds):return br.Class;case r(zi,js,Ls,ea):return br.EnumMember;case r(Gi,Qo):return br.Event;case r(Ms,Jo):return br.TypeParameter;default:return br.Reference}}}class $7 extends d${documentFactory;constructor(e){super(e),this.documentFactory=e.workspace.LangiumDocumentFactory}async loadAdditionalDocuments(e,n){await super.loadAdditionalDocuments(e,n),n(this.documentFactory.fromString(AG,Yt.parse(IG)))}workspace(){return this.folders&&C0(this.folders,1)?this.folders[0]:null}get workspaceUri(){const e=this.workspace();return ae(e,"Workspace not initialized"),Yt.parse(e.uri)}get workspaceURL(){const e=this.workspace();return ae(e,"Workspace not initialized"),new URL(e.uri)}}class k7 extends Q1{}const _7=t=>(e,n)=>{const r=MC(e.value);switch(!0){case eh(r):case nh(r):case ta(r):{n("warning","Predicate is ignored, as not supported in dynamic views",{node:e});return}}},C7=t=>{const e=t.likec4.FqnIndex;return(n,r)=>{try{const i=pn(n.source),s=i&&e.getFqn(i);s||r("error","Source not found (not parsed/indexed yet)",{node:n,property:"source"});const o=pn(n.target),a=o&&e.getFqn(o);a||r("error","Target not found (not parsed/indexed yet)",{node:n,property:"target"}),s&&a&&(ur(s,a)||ur(a,s))&&r("error","Invalid parent-child relationship",{node:n})}catch(i){Dt(i)}}},$h=["this","it","self","super","likec4lib"];function kh(t){return async(e,n,r)=>{r&&await kt(r);try{await t(e,n,r)}catch(i){vt(i)}}}const{getDocument:A7}=Du,I7=t=>{const e=t.likec4.FqnIndex,n=t.workspace.AstNodeLocator;return kh((r,i)=>{const s=e.getFqn(r);if(!s){i("error","Not indexed element",{node:r,property:"name"});return}$h.includes(r.name)&&i("error",`Reserved word: ${r.name}`,{node:r,property:"name"});const o=A7(r).uri,a=n.getAstNodePath(r),c=e.byFqn(s).filter(l=>l.documentUri!==o||l.path!==a).head();if(c){const l=c.documentUri!==o;i("error",`Duplicate element name ${r.name!==s?r.name+" ("+s+")":r.name}`,{node:r,property:"name",...l&&{relatedInformation:[{location:{range:c.nameSegment?.range??c.selectionSegment?.range,uri:c.documentUri.toString()},message:"conflicting element"}]}})}})},P7=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"})},x7=t=>(e,n)=>{const r=e.$container;r.props.some(i=>Fs(i)&&i!==e)&&n("error","Icon must be defined once",{node:e}),th(r)&&Yc(r.$container)&&r.$container.props.some(i=>Fs(i))&&n("warning","Redundant as icon defined on element",{node:e})},N7=t=>{const e=t.likec4.FqnIndex;return kh((n,r)=>{const i=pn(n.target),s=i&&e.getFqn(i);s||r("error","Target not resolved",{node:n,property:"target"});let o;if(Jt(n.source)){if(o=pn(n.source),!o)return r("error","Source not resolved",{node:n,property:"source"})}else{if(!Yc(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&&gu(a,s)&&r("error","Invalid parent-child relationship",{node:n})})},O7=t=>kh((e,n)=>{e.$container.tags?.values&&e.tags?.values&&n("error","Relation cannot have tags in both header and body",{node:e.tags})}),D7=t=>(e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("error","Only one specification per document is allowed",{node:e,property:"name"})},L7=t=>(e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("error","Only one model per document is allowed",{node:e,property:"name"})},M7=t=>(e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("error","Only one views block per document is allowed",{node:e,property:"name"})},F7=t=>{const e=t.shared.workspace.IndexManager;return kh((n,r)=>{$h.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=e.allElements(Ms).filter(s=>s.name===n.name&&s.node!==n).head();if(i){const s=i.documentUri!==St(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"}]}})}})},j7=t=>{const e=t.shared.workspace.IndexManager;return(n,r)=>{const i="#"+n.name,s=e.allElements(zi).filter(o=>o.name===i&&o.node!==n).head();if(s){const o=s.documentUri!==St(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"}]}})}}},U7=t=>{const e=t.shared.workspace.IndexManager;return(n,r)=>{$h.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"}),e.allElements(Gi).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate RelationshipKind '${n.name}'`,{node:n,property:"name"})}},B7=t=>{const e=t.shared.workspace.IndexManager;return(n,r)=>{n.name&&($h.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"}),e.allElements(Ds).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate view '${n.name}'`,{node:n,property:"name"}))}},q7=t=>(e,n)=>{const r=rn(e,Zy);yC(r)&&n("error",'Invalid usage inside "exclude"',{node:e});const i=sv(e.subject)?e.subject.subject:e.subject;switch(!0){case tl(i):case rv(i):case vC(i):case ta(i):return;case eh(i):case nh(i):n("error","Invalid target (expect reference to specific element)",{node:e,property:"subject"});return;default:Re(i)}},W7=t=>(e,n)=>{K0(e,Xy)&&n("warning","Redundant usage, expand predicate resolves parent element only when used in relations",{node:e})},G7=t=>(e,n)=>{if(ta(e.to)&&!TC(e.$container)){const r=rn(e,av);yt(r?.viewOf)&&n("warning","Predicate is ignored as it concerns all relationships",{node:e})}},z7=t=>(e,n)=>{if(ta(e.from)&&!pC(e.$container)){const r=rn(e,av);yt(r?.viewOf)&&n("warning","Predicate is ignored as it concerns all relationships",{node:e})}},H7=t=>(e,n)=>{const r=rn(e,Zy);yC(r)&&n("error",'Invalid usage inside "exclude"',{node:e})};function V7(t){Te.info("registerValidationChecks"),t.validation.ValidationRegistry.register({OpacityProperty:P7(),IconProperty:x7(),SpecificationRule:D7(),Model:L7(),ModelViews:M7(),DynamicViewStep:C7(t),LikeC4View:B7(t),Element:I7(t),ElementKind:F7(t),Relation:N7(t),RelationBody:O7(),Tag:j7(t),DynamicViewPredicateIterator:_7(),ElementPredicateWith:q7(),RelationPredicateWith:H7(),ExpandElementExpression:W7(),RelationshipKind:U7(t),IncomingRelationExpression:G7(),OutgoingRelationExpression:z7()});const e=t.shared.lsp.Connection;e&&t.shared.workspace.DocumentBuilder.onUpdate((n,r)=>{for(const i of r)Te.debug(`clear diagnostics for deleted ${i.path}`),e.sendDiagnostics({uri:i.toString(),diagnostics:[]})})}const K7={lsp:{NodeKindProvider:t=>new S7(t),WorkspaceSymbolProvider:t=>new k7(t)},workspace:{WorkspaceManager:t=>new $7(t)}};function Ut(t){return e=>new t(e)}const Y7={WorkspaceCache:t=>new a$(t.shared),Rpc:Ut(R7),likec4:{ModelChanges:Ut(w7),FqnIndex:Ut(XH),ModelParser:Ut(u7),ModelBuilder:Ut(n7),ModelLocator:Ut(s7)},lsp:{RenameProvider:Ut(zH),CompletionProvider:Ut(UH),DocumentHighlightProvider:Ut(BH),DocumentSymbolProvider:Ut(WH),SemanticTokenProvider:Ut(HH),HoverProvider:Ut(GH),CodeLensProvider:Ut(jH),DocumentLinkProvider:Ut(qH)},references:{ScopeComputation:Ut(b7),ScopeProvider:Ut(E7)}};function X7(t,e,n,r){const i=J7(t),s=[E8({shared:i}),AH,Y7,e,n,r].reduce(qC,{}),o=Wd(s);return i.ServiceRegistry.register(o),V7(o),t.connection?o.Rpc.init():i.workspace.ConfigurationProvider.initialized({}),{shared:i,likec4:o}}function J7(t={}){const e={..._$,...t};return t.connection&&(K9(t.connection),V9(t.connection)),Wd(S8(e),CH,K7)}function qC(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]=qC(i,r):t[n]=r}}return t}function WC(t){return typeof t=="object"&&t!==null&&typeof t.id=="string"}function kv(t){return typeof t=="object"&&t!==null&&t.$$type==="Node"&&typeof t.id=="string"}function GC(t){return kv(t)||WC(t)}function Dl(t){return typeof t=="string"||GC(t)}function Q7(t){return Array.isArray(t)&&t.every(Dl)}function Z7(t){return["n","ne","e","se","s","sw","w","nw","c"].includes(t)}function zC(t){if(GC(t))return t;const[e,n,r]=t.split(":");return Z7(r)?{id:e,port:n,compass:r}:{id:e,port:n}}function eV(t){if(t.length<2&&(Dl(t[0])&&Dl(t[1]))===!1)throw Error("EdgeTargets must have at least 2 elements.");return t.map(e=>zC(e))}const _h=Object.seal({Graph:null,Digraph:null,Subgraph:null,Node:null,Edge:null});function tV(t){return Object.assign(Object.seal(Object.assign({},_h)),t)}function nV(...t){const[e,...n]=t;return(...r)=>n.reduce((i,s)=>s(i),e(...r))}function Un(t,...e){return nV(t,...e)}const rV=t=>(...e)=>n=>t(n,...e),iV=t=>({[Symbol.iterator]:t}),nr=rV((t,e)=>Array.from(iV(function*(){for(const n of t)yield e(n)})));class HC{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 Ae=HC.prototype.createElement.bind(new HC),sV=/\r?\n/;function rr(t){return e=>e.join(t)}function oV(t){return e=>t+e+t}function Hi(t,e){return n=>t+n+e}function Ch(t){return e=>t+e}const VC=t=>t.replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/"/g,'\\"'),Ah=t=>t.split(sV),Ll=(t,e,n)=>Un(Ah,nr(Ch(t==="space"?" ".repeat(e):`
|
|
1149
|
-
`)),rr(n)),qs=t=>{switch(t){case"crlf":return`\r
|
|
1150
|
-
`;case"lf":return`
|
|
1151
|
-
`}},aV={match(t){return t.type==="AttributeList"},print(t,e){if(e.children.length===0)return`${e.kind.toLocaleLowerCase()} [];`;const n=qs(t.endOfLine);return Un(nr(t.print),rr(n),Ll(t.indentStyle,t.indentSize,n),Hi(`${e.kind.toLocaleLowerCase()} [${n}`,`${n}];`))(e.children)}},cV={match(t){return t.type==="Attribute"},print(t,e){return`${t.print(e.key)} = ${t.print(e.value)};`}},lV={match(t){return t.type==="Comment"},print(t,e){const n=qs(t.endOfLine);switch(e.kind){case"Block":return Un(Ah,nr(Ch(" * ")),rr(n),Hi(`/**${n}`,`${n} */`))(e.value);case"Macro":return Un(Ah,nr(Ch("# ")),rr(n))(e.value);case"Slash":default:return Un(Ah,nr(Ch("// ")),rr(n))(e.value)}}},uV={match(t){return t.type==="Dot"},print(t,e){return e.children.map(t.print).join(qs(t.endOfLine))}},dV={match(t){return t.type==="Edge"},print(t,e){const n=Un(nr(t.print),rr(t.directed?" -> ":" -- "))(e.targets);if(e.children.length===0)return`${n};`;const r=qs(t.endOfLine),i=Un(nr(t.print),rr(r),Ll(t.indentStyle,t.indentSize,r),Hi(`[${r}`,`${r}];`))(e.children);return`${n} ${i}`}},fV={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=qs(t.endOfLine),i=Un(nr(t.print),rr(r),Ll(t.indentStyle,t.indentSize,r),Hi(`{${r}`,`${r}}`))(e.children);return`${n.join(" ")} ${i}`}},hV=Un(VC,oV('"')),pV=Hi("<",">"),gV={match(t){return t.type==="Literal"},print(t,e){switch(e.quoted){case"html":return pV(e.value);case!0:return hV(e.value);case!1:default:return VC(e.value)}}},mV={match(t){return t.type==="Node"},print(t,e){const n=t.print(e.id);if(e.children.length===0)return`${n};`;const r=qs(t.endOfLine),i=Un(nr(t.print),rr(r),Ll(t.indentStyle,t.indentSize,r),Hi(`[${r}`,`${r}];`))(e.children);return`${n} ${i}`}},yV={match(t){return t.type==="NodeRefGroup"},print(t,e){return Un(nr(t.print),rr(" "),Hi("{","}"))(e.children)}},vV={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(":")}},wV={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=qs(t.endOfLine),i=Un(nr(t.print),rr(r),Ll(t.indentStyle,t.indentSize,r),Hi(`{${r}`,`${r}}`))(e.children);return`${n.join(" ")} ${i}`}},bV=[aV,cV,lV,uV,dV,fV,gV,mV,yV,vV,wV];class TV{options;#e=[...bV];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 EV(t,e){const n=new TV(e).print(t);if(!n)throw new Error;return n}function Ih(t,e){if(typeof e=="string"){const n=e.trim();return/^<.+>$/ms.test(n)?Ae("Attribute",{key:Ae("Literal",{value:t,quoted:!1},[]),value:Ae("Literal",{value:n.slice(1,n.length-1),quoted:"html"},[])},[]):Ae("Attribute",{key:Ae("Literal",{value:t,quoted:!1},[]),value:Ae("Literal",{value:e,quoted:!0},[])},[])}return Ae("Attribute",{key:Ae("Literal",{value:t,quoted:!1},[]),value:Ae("Literal",{value:String(e),quoted:!1},[])},[])}function Ws(t,e){return Ae("Comment",{kind:e,value:t},[])}function KC(t,e){return Array.from(function*(){for(const[n,r]of e.values)yield Ih(n,r);for(const n of Object.values(e.attributes))n.size>0&&(n.comment&&(yield Ws(n.comment,t.commentKind)),yield t.convert(n));for(const n of e.nodes)n.comment&&(yield Ws(n.comment,t.commentKind)),yield t.convert(n);for(const n of e.subgraphs)n.comment&&(yield Ws(n.comment,t.commentKind)),yield t.convert(n);for(const n of e.edges)n.comment&&(yield Ws(n.comment,t.commentKind)),yield t.convert(n)}())}const RV={match(t){return t.$$type==="AttributeList"},convert(t,e){return Ae("AttributeList",{kind:e.$$kind},e.values.map(([n,r])=>Ih(n,r)))}},SV={match(t){return t.$$type==="Edge"},convert(t,e){return Ae("Edge",{targets:e.targets.map(n=>kv(n)?Ae("NodeRef",{id:Ae("Literal",{value:n.id,quoted:!0},[])},[]):WC(n)?Ae("NodeRef",{id:Ae("Literal",{value:n.id,quoted:!0},[]),port:n.port?Ae("Literal",{value:n.port,quoted:!0},[]):void 0,compass:n.compass?Ae("Literal",{value:n.compass,quoted:!0},[]):void 0},[]):Ae("NodeRefGroup",{},n.map(r=>kv(r)?Ae("NodeRef",{id:Ae("Literal",{value:r.id,quoted:!0},[])},[]):Ae("NodeRef",{id:Ae("Literal",{value:r.id,quoted:!0},[]),port:r.port?Ae("Literal",{value:r.port,quoted:!0},[]):void 0,compass:r.compass?Ae("Literal",{value:r.compass,quoted:!0},[]):void 0},[]))))},[...e.attributes.comment?[Ws(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([n,r])=>Ih(n,r))])}},$V={match(t){return t.$$type==="Graph"},convert(t,e){return Ae("Dot",{},[...e.comment?[Ws(e.comment,t.commentKind)]:[],Ae("Graph",{directed:e.directed,strict:e.strict,id:e.id?Ae("Literal",{value:e.id,quoted:!0},[]):void 0},KC(t,e))])}},kV={match(t){return t.$$type==="Node"},convert(t,e){return Ae("Node",{id:Ae("Literal",{value:e.id,quoted:!0},[])},[...e.attributes.comment?[Ws(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([n,r])=>Ih(n,r))])}},_V={match(t){return t.$$type==="Subgraph"},convert(t,e){return Ae("Subgraph",{id:e.id?Ae("Literal",{value:e.id,quoted:!0},[]):void 0},KC(t,e))}},CV=[RV,SV,kV,$V,_V];class AV{options;#e=[...CV];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 IV(t,e){return new AV(e).convert(t)}const D=new Proxy(Object.freeze({}),{get:(t,e)=>e});class _v{}class Cv extends _v{#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 Av extends Cv{$$kind;get $$type(){return"AttributeList"}comment;constructor(e,n){super(n),this.$$kind=e}}class YC extends Cv{#e=_h;id;comment;attributes=Object.freeze({graph:new Av("Graph"),edge:new Av("Edge"),node:new Av("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=tV(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=>Q7(s)?eV(s):zC(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 XC extends YC{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 PV extends XC{get directed(){return!0}}class xV extends XC{get directed(){return!1}}class NV extends YC{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 JC extends Cv{comment}let OV=class extends _v{id;get $$type(){return"Node"}comment;attributes;constructor(e,n){super(),this.id=e,this.attributes=new JC(n)}port(e){return typeof e=="string"?{id:this.id,port:e}:{id:this.id,...e}}};class DV extends _v{targets;get $$type(){return"Edge"}comment;attributes;constructor(e,n){if(super(),this.targets=e,e.length<2&&(Dl(e[0])&&Dl(e[1]))===!1)throw Error("The element of Edge target is missing or not satisfied as Edge target.");this.attributes=new JC(n)}}Object.assign(_h,{Graph:xV,Digraph:PV,Subgraph:NV,Node:OV,Edge:DV});function QC(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 ZC(t,e=_h){return Object.freeze({digraph:QC.call(e,!0,t),graph:QC.call(e,!1,t)})}const eA=ZC(!1),LV=eA.digraph;eA.graph;const MV=ZC(!0);function tA(t,e){const n=IV(t,e?.convert);return EV(n,e?.print)}function FV(t){let e=t.length-1,n=t[e];for(;n===" "||n===" ";)n=t[--e];return t.substring(0,e+1)}function jV(t){return t.split(`
|
|
1152
|
-
`).map(r=>FV(r)).join(`
|
|
1153
|
-
`)}var UV=function(t,e){if(e=e||{},t==null)return t;var n=e.width||50,r=typeof e.indent=="string"?e.indent:" ",i=e.newline||`
|
|
1154
|
-
`+r,s=typeof e.escape=="function"?e.escape:BV,o=".{1,"+n+"}";e.cut!==!0&&(o+="([\\s\u200B]+|$)|[^\\s\u200B]+?([\\s\u200B]+|$)");var a=new RegExp(o,"g"),c=t.match(a)||[],l=r+c.map(function(u){return u.slice(-1)===`
|
|
1155
|
-
`&&(u=u.slice(0,u.length-1)),s(u)}).join(i);return e.trim===!0&&(l=jV(l)),l};function BV(t){return t}const qV=po(UV),Ph={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 Ph.hue2rgb(s,i,t+1/3)*255;case"g":return Ph.hue2rgb(s,i,t)*255;case"b":return Ph.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}}},WV={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},GV={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},pe={channel:Ph,lang:WV,unit:GV},Vi={};for(let t=0;t<=255;t++)Vi[t]=pe.unit.dec2hex(t);const Bt={ALL:0,RGB:1,HSL:2};class zV{constructor(){this.type=Bt.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=Bt.ALL}is(e){return this.type===e}}class HV{constructor(e,n){this.color=n,this.changed=!1,this.data=e,this.type=new zV}set(e,n){return this.color=n,this.changed=!1,this.data=e,this.type.type=Bt.ALL,this}_ensureHSL(){const e=this.data,{h:n,s:r,l:i}=e;n===void 0&&(e.h=pe.channel.rgb2hsl(e,"h")),r===void 0&&(e.s=pe.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=pe.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r:n,g:r,b:i}=e;n===void 0&&(e.r=pe.channel.hsl2rgb(e,"r")),r===void 0&&(e.g=pe.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=pe.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,n=e.r;return!this.type.is(Bt.HSL)&&n!==void 0?n:(this._ensureHSL(),pe.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,n=e.g;return!this.type.is(Bt.HSL)&&n!==void 0?n:(this._ensureHSL(),pe.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,n=e.b;return!this.type.is(Bt.HSL)&&n!==void 0?n:(this._ensureHSL(),pe.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,n=e.h;return!this.type.is(Bt.RGB)&&n!==void 0?n:(this._ensureRGB(),pe.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,n=e.s;return!this.type.is(Bt.RGB)&&n!==void 0?n:(this._ensureRGB(),pe.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,n=e.l;return!this.type.is(Bt.RGB)&&n!==void 0?n:(this._ensureRGB(),pe.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(Bt.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(Bt.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(Bt.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(Bt.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(Bt.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(Bt.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const Iv=new HV({r:0,g:0,b:0,a:0},"transparent"),na={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(na.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,l=s?0:-1,u=o?255:15;return Iv.set({r:(r>>c*(l+3)&u)*a,g:(r>>c*(l+2)&u)*a,b:(r>>c*(l+1)&u)*a,a:s?(r&u)*a/255:1},t)},stringify:t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`#${Vi[Math.round(e)]}${Vi[Math.round(n)]}${Vi[Math.round(r)]}${Vi[Math.round(i*255)]}`:`#${Vi[Math.round(e)]}${Vi[Math.round(n)]}${Vi[Math.round(r)]}`}},Gs={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(Gs.hueRe);if(e){const[,n,r]=e;switch(r){case"grad":return pe.channel.clamp.h(parseFloat(n)*.9);case"rad":return pe.channel.clamp.h(parseFloat(n)*180/Math.PI);case"turn":return pe.channel.clamp.h(parseFloat(n)*360)}}return pe.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const n=t.match(Gs.re);if(!n)return;const[,r,i,s,o,a]=n;return Iv.set({h:Gs._hue2deg(r),s:pe.channel.clamp.s(parseFloat(i)),l:pe.channel.clamp.l(parseFloat(s)),a:o?pe.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(${pe.lang.round(e)}, ${pe.lang.round(n)}%, ${pe.lang.round(r)}%, ${i})`:`hsl(${pe.lang.round(e)}, ${pe.lang.round(n)}%, ${pe.lang.round(r)}%)`}},Ml={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=Ml.colors[t];if(e)return na.parse(e)},stringify:t=>{const e=na.stringify(t);for(const n in Ml.colors)if(Ml.colors[n]===e)return n}},Fl={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(Fl.re);if(!n)return;const[,r,i,s,o,a,c,l,u]=n;return Iv.set({r:pe.channel.clamp.r(i?parseFloat(r)*2.55:parseFloat(r)),g:pe.channel.clamp.g(o?parseFloat(s)*2.55:parseFloat(s)),b:pe.channel.clamp.b(c?parseFloat(a)*2.55:parseFloat(a)),a:l?pe.channel.clamp.a(u?parseFloat(l)/100:parseFloat(l)):1},t)},stringify:t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`rgba(${pe.lang.round(e)}, ${pe.lang.round(n)}, ${pe.lang.round(r)}, ${pe.lang.round(i)})`:`rgb(${pe.lang.round(e)}, ${pe.lang.round(n)}, ${pe.lang.round(r)})`}},Ki={format:{keyword:Ml,hex:na,rgb:Fl,rgba:Fl,hsl:Gs,hsla:Gs},parse:t=>{if(typeof t!="string")return t;const e=na.parse(t)||Fl.parse(t)||Gs.parse(t)||Ml.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(Bt.HSL)||t.data.r===void 0?Gs.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?Fl.stringify(t):na.stringify(t)},VV=(t,e)=>{const n=Ki.parse(t);for(const r in e)n[r]=pe.channel.clamp[r](e[r]);return Ki.stringify(n)},nA=t=>Ki.format.hex.stringify(Ki.parse(t)),KV=(t,e,n)=>{const r=Ki.parse(t),i=r[e],s=pe.channel.clamp[e](i+n);return i!==s&&(r[e]=s),Ki.stringify(r)},YV=(t,e)=>KV(t,"a",-e),XV=(t,e)=>{const n=Ki.parse(t),r={};for(const i in e)e[i]&&(r[i]=n[i]+e[i]);return VV(t,r)},JV=(t,e)=>{const n=Ki.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],pe.channel.max[s]);return XV(t,r)};class QV{value;next;constructor(e){this.value=e}}class ZV{#e;#t;#n;constructor(){this.clear()}enqueue(e){const n=new QV(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 xh(t){rA(t);const e=new ZV;let n=0;const r=()=>{n<t&&e.size>0&&(e.dequeue()(),n++)},i=()=>{n--,r()},s=async(c,l,u)=>{const d=(async()=>c(...u))();l(d);try{await d}catch{}i()},o=(c,l,u)=>{new Promise(d=>{e.enqueue(d)}).then(s.bind(void 0,c,l,u)),(async()=>(await Promise.resolve(),n<t&&r()))()},a=(c,...l)=>new Promise(u=>{o(c,u,l)});return Object.defineProperties(a,{activeCount:{get:()=>n},pendingCount:{get:()=>e.size},clearQueue:{value(){e.clear()}},concurrency:{get:()=>t,set(c){rA(c),t=c,queueMicrotask(()=>{for(;n<t&&e.size>0;)r()})}}}),a}function rA(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}const eK=xh(1);let tK=class rp{static _graphviz=null;graphviz(){return Promise.resolve().then(()=>rp._graphviz??=dp.load())}async attempt(e,n){return await eK(async()=>{try{return await n()}catch(r){Le.error(r),Le.error(`FAILED GraphvizWasmAdapter: ${e}`),dp.unload(),rp._graphviz=null}Le.warn("Retrying..."),await x0(50);try{return await n()}finally{dp.unload(),rp._graphviz=null}})}async unflatten(e){return await this.attempt(`unflatten
|
|
1156
|
-
${e}`,async()=>(await this.graphviz()).unflatten(e,1,!1,3).replaceAll(/\t\[/g," [").replaceAll(/\t/g," "))}async acyclic(e){return await this.attempt(`acyclic
|
|
1157
|
-
${e}`,async()=>{const n=(await this.graphviz()).acyclic(e,!0);return n.acyclic&&n.outFile||e})}async layoutJson(e){return await this.attempt(`dot
|
|
1158
|
-
${e}`,async()=>(await this.graphviz()).layout(e,"json",void 0,{yInvert:!0}))}async svg(e){return await this.attempt(`svg
|
|
1159
|
-
${e}`,async()=>(await this.graphviz()).layout(e,"svg"))}};function iA(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:l}=s;return{...i,width:c,height:l,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 sA=(t,e)=>t.width>e.width+10||t.height>e.height+10;function nK(t,e){if(t.hash===e.hash)return{diagram:iA(t,e)};if(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||sA(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:iA(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||sA(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:Uo(e.edges).flatMap(([r,i])=>i.dotpos?{id:r,dotpos:i.dotpos}:[])}}}function En(t){return t.children.length>0}function Bn(t){switch(t){case"open":return"vee";default:return t}}function _r(t){return Array.isArray(t)?[_r(t[0]),_r(t[1])]:(ae(isFinite(t),`Invalid not finite point value ${t}`),Math.round(t))}const oA=t=>(ae(isFinite(t),`Invalid not finite inch value ${t}`),Math.floor(t*72)),Je=t=>Math.ceil(t/72*1e3)/1e3,qn=t=>Math.ceil(t);qn(40).toString();function aA(t,e){return nA(JV(t,{l:-35-5*e,s:-15-5*e}))}function rK(t){return nA(YV(t,.3))}function iK(t){return t.trim().replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")}function Pv(t,e){return qV(t,{width:e,indent:"",escape:iK}).split(`
|
|
1160
|
-
`)}function Yi({text:t,maxchars:e,fontsize:n,bold:r,color:i}){let s=Pv(t,e).map(a=>xs(a)?" ":a).join("<BR/>");r&&(s=`<B>${s}</B>`);const o=i?` COLOR="${i}"`:"";return`<FONT POINT-SIZE="${qn(n)}"${o}>${s}</FONT>`}function sK(t,e){const n=Q(t.icon),r=[Yi({text:t.title,fontsize:19,maxchars:35})];if(Q(t.technology)&&r.push(Yi({text:t.technology,fontsize:12,maxchars:n?35:45,color:e.loContrast})),Q(t.description)&&r.push(Yi({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 l=a.length>1?` ROWSPAN="${a.length}"`:"";let u=76;(t.shape==="queue"||t.shape==="mobile")&&(u+=20),c=`<TD${l} WIDTH="${u}" FIXEDSIZE="TRUE"> </TD>${c}`,c=`${c}<TD${l} 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 oK(t,e){const n=Yi({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 ra=35;function aK({label:t,description:e,technology:n}){const r=[];if(Q(t)&&r.push(Yi({text:t,maxchars:ra,fontsize:14,bold:t==="[...]"})),Q(e)&&r.push(Yi({text:e,maxchars:ra,fontsize:14})),Q(n)&&r.push(Yi({text:n,fontsize:12,maxchars:ra})),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" ${xv}>${i}</TABLE>>`}const xv=`BGCOLOR="${kn.relationships[no].labelBgColor}A0"`;function cK(t,e){const n=`<TABLE FIXEDSIZE="TRUE" BORDER="0" CELLPADDING="6" ${xv}><TR><TD WIDTH="20" HEIGHT="20"><FONT POINT-SIZE="${qn(14)}"><B>${t}</B></FONT></TD></TR></TABLE>`;return Q(e)?`<${['<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">',"<TR>",`<TD>${n}</TD>`,`<TD ${xv} CELLPADDING="2">`,Yi({text:e,maxchars:ra,fontsize:14}),"</TD>","</TR>","</TABLE>"].join("")}>`:`<${n}>`}const cA="dashed",Nv=kn.font;class lA{constructor(e){this.view=e,this.compoundIds=new Set(e.nodes.filter(En).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(l=>En(l)&&l.parent===i.id))n(c,a)},r=[];for(const i of this.view.nodes)En(i)?yt(i.parent)&&n(i,e):r.push(i);for(const i of r){const s=i.parent?this.getSubgraph(i.parent):e;ae(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 tA(this.graphvizModel,{print:{indentStyle:"space",indentSize:2}})}createGraph(){this.view.autoLayout==="TB"||this.view.autoLayout;const e=LV({[D.bgcolor]:"transparent",[D.layout]:"dot",[D.compound]:!0,[D.rankdir]:this.view.autoLayout,[D.TBbalance]:"min",[D.splines]:"spline",[D.outputorder]:"nodesfirst",[D.nodesep]:Je(100),[D.ranksep]:Je(110),[D.pack]:qn(100),[D.packmode]:"array_3",[D.pad]:Je(15),[D.forcelabels]:!0,[D.fontname]:Nv});return e.attributes.graph.apply({[D.fontsize]:qn(15),[D.labeljust]:this.view.autoLayout==="RL"?"r":"l",[D.labelloc]:this.view.autoLayout==="BT"?"b":"t",[D.margin]:50.1}),e}applyNodeAttributes(e){e.apply({[D.fontname]:Nv,[D.nojustify]:!0,[D.shape]:"rect",[D.width]:Je(320),[D.height]:Je(180),[D.style]:"filled",[D.penwidth]:0})}applyEdgeAttributes(e){e.apply({[D.nojustify]:!0,[D.arrowsize]:.75,[D.fontname]:Nv,[D.fontsize]:qn(14),[D.penwidth]:qn(2),[D.color]:kn.relationships[no].lineColor,[D.fontcolor]:kn.relationships[no].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=En(e);let r=ma(e.id).toLowerCase(),i=this.checkNodeId(r,n);if(i!==null)return i;let s=e.id,o;for(;o=pt(s);){if(r=ma(o).toLowerCase()+"_"+r,i=this.checkNodeId(r,n),i!==null)return i;s=o}r=ma(e.id).toLowerCase();let a=1;do i=this.checkNodeId(r+"_"+a++,n);while(i===null);return i}elementToSubgraph(e,n){ae(En(e),"node should be compound"),ae(d_(e.depth),"node.depth should be defined");const r=this.getElementColorValues(e.color),i=rK(r.loContrast);return n.apply({[D.likec4_id]:e.id,[D.likec4_level]:e.level,[D.likec4_depth]:e.depth,[D.fillcolor]:aA(r.fill,e.depth),[D.color]:aA(r.stroke,e.depth),[D.style]:"filled",[D.margin]:qn(32),[D.label]:oK(e,i)}),n}elementToNode(e,n){ae(!En(e),"node should not be compound");const r=Q(e.icon),i=this.getElementColorValues(e.color);switch(n.attributes.apply({[D.likec4_id]:e.id,[D.likec4_level]:e.level,[D.fillcolor]:i.fill,[D.fontcolor]:i.hiContrast,[D.color]:i.stroke,[D.margin]:`${Je(r?10:26)},${Je(26)}`}),e.shape){case"cylinder":case"storage":{n.attributes.apply({[D.margin]:`${Je(r?10:26)},${Je(0)}`,[D.penwidth]:qn(2),[D.shape]:"cylinder"});break}case"browser":{n.attributes.apply({[D.margin]:`${Je(r?10:30)},${Je(32)}`});break}case"mobile":{n.attributes.apply({[D.margin]:`${Je(r?10:30)},${Je(26)}`});break}case"queue":{n.attributes.apply({[D.width]:Je(320),[D.height]:Je(165),[D.margin]:`${Je(r?10:30)},${Je(26)}`});break}}return n.attributes.set(D.label,sK(e,i)),n}leafElements(e){if(e===null)return this.view.nodes.filter(r=>!En(r));const n=e+".";return this.view.nodes.filter(r=>!En(r)&&r.id.startsWith(n))}viewElement(e){return rt(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||(ae(En(r),"endpoint node should be compound"),s=this.getSubgraph(e)?.id,ae(s,`subgraph ${e} not found`),r=rt(n(this.leafElements(e)),`leaf element in ${e} not found`),i=rt(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(P0(e))}findInternalEdges(e){return e===null?this.view.edges.slice():this.view.edges.filter(P0(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=_t(this.view.nodes,jt(En),Ct(r=>r.id),$f(co),a_(),Ct(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}}),jt(({edges:r})=>r.length>1&&r.length<8),W8(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=rt(this.getGraphNode(s.source),`Graphviz Node not found for ${s.source}`),a=rt(this.getGraphNode(s.target),`Graphviz Node not found for ${s.target}`);n.add(s.source),n.add(s.target),o.attributes.set(D.group,r.id),a.attributes.set(D.group,r.id)}catch(o){Le.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 l=Je(a.center.x)+r,u=Je(e-a.center.y);a.fixedsize?c.attributes.apply({[D.pos]:`${l},${u}!`,[D.pin]:!0,[D.width]:Je(a.fixedsize.width),[D.height]:Je(a.fixedsize.height),[D.fixedsize]:!0}):c.attributes.set(D.pos,`${l},${u}`)}for(const[o,a]of this.edges.entries()){a.attributes.delete(D.weight),a.attributes.delete(D.minlen),a.attributes.delete(D.constraint);const c=n.edges.find(l=>l.id===o)?.dotpos;c&&!s&&a.attributes.set(D.pos,c)}return this.graphvizModel.apply({[D.layout]:"fdp",[D.overlap]:"vpsc",[D.sep]:"+50,50",[D.esep]:"+10,10",[D.start]:"random2",[D.splines]:"compound"}),this.graphvizModel.delete(D.compound),this.graphvizModel.delete(D.rankdir),this.graphvizModel.delete(D.nodesep),this.graphvizModel.delete(D.ranksep),this.graphvizModel.delete(D.pack),this.graphvizModel.delete(D.pad),this.graphvizModel.delete(D.packmode),this.graphvizModel.attributes.graph.delete(D.margin),this}getRelationshipColorValues(e){return Cb(e)?kn.relationships[e]:this.view.customColorDefinitions[e]?.relationships??kn.relationships[nu]}getElementColorValues(e){return Cb(e)?kn.elements[e]:this.view.customColorDefinitions[e]?.elements??kn.elements[nu]}}class Jw extends lA{static toDot(e){return new Jw(e).print()}createGraph(){const e=super.createGraph();return e.set(D.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,b=>Oc(b)),[l,u,d]=this.edgeEndpoint(s,jn),f=n.edge([a,u],{[D.likec4_id]:e.id,[D.style]:e.line??cA});if(d&&f.attributes.set(D.lhead,d),c&&f.attributes.set(D.ltail,c),e.color&&e.color!==no){const b=this.getRelationshipColorValues(e.color);f.attributes.apply({[D.color]:b.lineColor,[D.fontcolor]:b.labelColor})}const h=Sr(d)||Sr(c),p=Nb(e.id),y=cK(p,e.label?.trim());if(f.attributes.set(D.label,y),!h){const b=new Set([...o.outEdges,...l.inEdges,...dW(l.outEdges,o.inEdges)].filter(_=>!this.edgesWithCompounds.has(_)));f.attributes.set(D.weight,b.size)}const $=r.findIndex(b=>b.id===i);r.findIndex(b=>b.id===s)<$&&e.dir!=="back"&&f.attributes.apply({[D.constraint]:!1});let[T,w]=[e.head??to,e.tail??"none"];return e.dir==="back"?(f.attributes.apply({[D.arrowtail]:Bn(T),[D.minlen]:0,[D.dir]:"back"}),w!=="none"&&f.attributes.apply({[D.arrowhead]:Bn(w),[D.dir]:"both"}),f):T==="none"&&w==="none"||T!=="none"&&w!=="none"?(f.attributes.apply({[D.arrowhead]:Bn(T),[D.arrowtail]:Bn(w),[D.dir]:"both"}),f):T==="none"?(f.attributes.delete(D.arrowhead),f.attributes.apply({[D.arrowtail]:Bn(w),[D.minlen]:0,[D.dir]:"back"}),f):(T!==to&&f.attributes.set(D.arrowhead,Bn(T)),f)}}class Qw extends lA{static toDot(e){return new Qw(e).print()}buildGraphvizModel(e){super.buildGraphvizModel(e),this.assignGroups();const n=new Set,r=this.view.nodes.reduce((i,s)=>(En(s)&&(n.add(s.id),i.push(s)),i),[]);for(const i of r){const s=_t(i.children,jt(l=>!this.compoundIds.has(l)),Ct(l=>this.viewElement(l)),jt(l=>l.inEdges.length===0&&l.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=rt(this.getSubgraph(i.id),`Subgraph not found for ${i.id}`);let c=null;OW(s,o).forEach(l=>{const u=l.length>1?a.createSubgraph({[D.rank]:"same"}):null;l.forEach((d,f)=>{const h=this.getGraphNode(d.id);h&&(u?.node(h.id),f===0&&(c&&a.edge([c,h],{[D.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,b=>Oc(b)),[l,u,d]=this.edgeEndpoint(s,jn),f=e.parent,h=(f===null?n:rt(this.getSubgraph(f),`Parent not found for edge ${e.id}`)).edge([a,u],{[D.likec4_id]:e.id,[D.style]:e.line??cA});d&&h.attributes.set(D.lhead,d),c&&h.attributes.set(D.ltail,c);const p=Sr(d)||Sr(c);if(!p){const b=new Set([...o.inEdges,...o.outEdges,...l.inEdges,...l.outEdges].filter(_=>!this.edgesWithCompounds.has(_)));h.attributes.set(D.weight,b.size)}const y=aK(e);if(y&&(p?h.attributes.set(D.xlabel,y):h.attributes.set(D.label,y)),e.color){const b=this.getRelationshipColorValues(e.color);h.attributes.apply({[D.color]:b.lineColor,[D.fontcolor]:b.labelColor})}let[$,T]=[e.head??to,e.tail??"none"];if(e.dir==="back")return h.attributes.apply({[D.arrowtail]:Bn($),[D.dir]:"back"}),T!=="none"&&h.attributes.apply({[D.arrowhead]:Bn(T),[D.dir]:"both",[D.minlen]:0}),h;if($==="none"&&T==="none")return h.attributes.apply({[D.arrowtail]:"none",[D.arrowhead]:"none",[D.dir]:"none",[D.minlen]:0,[D.constraint]:!1}),h;if($!=="none"&&T!=="none")return h.attributes.apply({[D.arrowhead]:Bn($),[D.arrowtail]:Bn(T),[D.dir]:"both",[D.minlen]:0}),h;if($!==to&&h.attributes.set(D.arrowhead,Bn($)),T!=="none"&&h.attributes.set(D.arrowtail,Bn(T)),r.length===1)return h;let w;return f===null&&o.parent==null&&l.parent==null?w=r.filter(b=>{if(b.id===e.id||b.parent!==null||b.source===e.source&&b.target===e.target||b.source===e.target&&b.target===e.source)return!1;const _=this.viewElement(b.source),x=this.viewElement(b.target);return En(_)||En(x)?!1:_.parent==null&&x.parent==null}):w=this.findInternalEdges(f).filter(b=>!(b.id===e.id||b.source===e.source&&b.target===e.target||b.source===e.target&&b.target===e.source)),w.length===0&&(f===null||this.leafElements(f).length<=3)&&h.attributes.set(D.minlen,0),h}}function Nh(t){const[e,n,r,i]=t?t.split(",").map(a=>_r(+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 lK(t){try{const[e,n]=t.split(",");return{x:_r(parseFloat(e)),y:_r(parseFloat(n))}}catch(e){throw Le.error(`failed on parsing pos: ${t}`,e),e}}function uA({pos:t,width:e,height:n}){const{x:r,y:i}=lK(t),s=oA(+e),o=oA(+n);return{x:r-Math.round(s/2),y:i-Math.round(o/2),width:s,height:o}}function dA(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 l of t){if(l.op==="F"){a=_r(l.size);continue}if(l.op==="T"){let u=_r(l.pt[0])-e,d=_r(l.width);switch(l.align){case"r":u-=d;break;case"c":u-=Math.round(d/2);break}r=Math.min(r,u),s=Math.max(s,u+d);let f=_r(l.pt[1])-n;i=Math.min(i,Math.round(f-a)),o=Math.max(o,f)}}}catch(l){return Le.error(`Failed on parsing label draw ops: ${l}
|
|
1161
|
-
${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 fA({_draw_:t,likec4_id:e="???"},n="<unknown view>"){try{const r=t.filter(s=>s.op.toLowerCase()==="b");ae(Fn(r,1),`view ${n} edge ${e} should have at least one bezier draw op`),r.length>1&&Le.warn(`view ${n} edge ${e} has more than one bezier draw op, using the first one only`);const i=r[0].points.map(s=>_r(s));return ae(Fn(i,2),`view ${n} edge ${e} should have at least two points`),i}catch(r){throw Le.error(`failed on parsing view ${n} edge ${e} _draw_:
|
|
1162
|
-
${JSON.stringify(t,null,2)}`),r}}function uK(t,{id:e,source:n,target:r,dir:i,label:s,description:o,...a},c){const l=dA(t._ldraw_??t._tldraw_??t._hldraw_),u=t.dir==="back"||i==="back";return s=s?Pv(s,ra).join(`
|
|
1163
|
-
`):null,o=o?Pv(o,ra).join(`
|
|
1164
|
-
`):void 0,{id:e,source:n,target:r,label:s,...Q(o)&&{description:o},...Q(t.pos)&&{dotpos:t.pos},points:fA(t,c),labelBBox:l,...u?{dir:"back"}:{},...a}}function hA(t,e){const n=JSON.parse(t),r=Nh(n.bb),{nodes:i,edges:s,manualLayout:o,...a}=e,c={...a,bounds:r,nodes:[],edges:[]},l=n.objects??[];for(const d of i){const f=l.find(w=>w.likec4_id===d.id);ae(f,`View ${a.id} element ${d.id} not found in graphviz output`);const{x:h,y:p,width:y,height:$}="bb"in f?Nh(f.bb):uA(f),T=[h,p];c.nodes.push({...d,position:T,width:y,height:$,labelBBox:rt(dA(f._ldraw_,T),`View ${a.id} Node ${d.id} label bbox not found`)})}const u=n.edges??[];for(const d of s){const f=u.find(h=>h.likec4_id===d.id);if(!f){Le.warn(`View ${a.id} edge ${d.id} not found in graphviz output, skipping`);continue}c.edges.push(uK(f,d,a.id))}return c}const Oh=t=>String(t+1).padStart(2,"0");function dK(t){const e=JSON.parse(t),n=Nh(e.bb),r={nodes:[],edges:[],bounds:n},i=new Map,s=e.objects??[];for(const o of s){if(!o.likec4_type)continue;const a=Oh(o._gvid),c=o.likec4_path??"",l=i.get(o._gvid),{x:u,y:d,width:f,height:h}="bb"in o?Nh(o.bb):uA(o),p={x:u,y:d};if(o.likec4_type==="view")ae(o.likec4_id,`View ${o} has no likec4_id`),r.nodes.push({id:a,type:"view",parentId:l?.id??null,height:h,width:f,position:p,label:o.label??"",viewId:o.likec4_id});else{const y={id:a,type:o.likec4_type,parentId:l?.id??null,height:h,width:f,position:p,path:c,label:o.label??""},$=[..."subgraphs"in o?o.subgraphs:[],..."nodes"in o?o.nodes:[]];for(const T of $)i.set(T,y);r.nodes.push(y)}}for(const o of e.edges??[])try{const a=Oh(o.tail),c=Oh(o.head);r.edges.push({id:`link${Oh(o._gvid)}`,source:a,target:c,points:fA(o)})}catch(a){Le.warn(a)}return r}const pA=kn.font,Dh="/";class Zw{static toDot(e){return new Zw(e).print()}subgraphs=new Map;graphvizModel;constructor(e){const n=this.graphvizModel=MV.graph({[D.layout]:"osage",[D.pack]:qn(100),[D.packmode]:"array_ltc",[D.pad]:Je(15),[D.fontname]:pA,[D.splines]:"polyline",[D.esep]:"+20"});n.attributes.graph.apply({[D.fontsize]:qn(20),[D.labeljust]:"l",[D.labelloc]:"t"}),n.attributes.node.apply({[D.fontname]:pA,[D.shape]:"rect",[D.width]:Je(400),[D.height]:Je(300),[D.fixedsize]:!0,[D.fontsize]:10}),n.attributes.edge.apply({[D.penwidth]:qn(2)});const r=new Set(e.map(c=>c.relativePath??""));let i=0,s=[...e];const o=r.size>1;o&&s.sort((c,l)=>{const u=c.relativePath?.split(Dh)??[""],d=l.relativePath?.split(Dh)??[""];u.push(c.title??"Untitled"),d.push(l.title??"Untitled");const f=u.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 y=u[p].localeCompare(d[p]);if(y!==0)return y}return 0}}});const a=new Map;s.forEach((c,l)=>{this.addView(o?c:{...c,relativePath:""},l+i);const u=c.nodes.reduce((d,f)=>(f.navigateTo&&d.add(f.navigateTo),d),new Set);u.size>0&&a.set(c.id,u)});for(const[c,l]of a)for(const u of l)n.edge([c,u])}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(Dh)?e.slice(0,e.lastIndexOf(Dh)):"";r=this.getParentForPath(s).subgraph("cluster"+String(this.subgraphs.size+1),{[D.likec4_type]:i?"file":"folder",[D.likec4_path]:e,[D.sortv]:this.subgraphs.size,[D.label]:Q(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,{[D.likec4_type]:"view",[D.likec4_id]:e.id,[D.sortv]:n,[D.label]:e.title||"Untitled"})}print(){return tA(this.graphvizModel,{print:{indentStyle:"space",indentSize:2}})}}const gA=t=>mp(t)?new Jw(t):new Qw(t);class fK{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=hA(r,e);if(e.manualLayout){const s=nK(i,e.manualLayout);if(s.diagram)i=s.diagram;else{if(s.relayout.nodes.length>0){const o=gA(e);if(o.hasEdgesWithCompounds)Le.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=hA(a,e)}}i.hasLayoutDrift=!0}}return n=n.split(`
|
|
1165
|
-
`).filter(s=>!(s.includes("margin")&&s.includes("50.1"))).join(`
|
|
1166
|
-
`),{dot:n,diagram:i}}async svg(e){let n=await this.dot(e);return n=n.split(`
|
|
1167
|
-
`).filter(r=>!(r.includes("margin")&&r.includes("50.1"))).join(`
|
|
1168
|
-
`),{svg:await this.graphviz.svg(n),dot:n}}async dot(e){let n=gA(e).print();if(mp(e))return n;try{return await this.graphviz.unflatten(n)}catch(r){return Le.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=Zw.toDot(e),r=await this.graphviz.layoutJson(n);return dK(r)}}function Wn(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 Ov=(t,e)=>{const n=mA(t);if(typeof n!="string")throw new TypeError(`${e} must be a string or a file URL: ${n}.`);return n},mA=t=>t instanceof URL?sp(t):t,yA=(t,e=[],n={})=>{const r=Ov(t,"First argument"),[i,s]=Wn(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(!Wn(s))throw new TypeError(`Last argument must be an options object: ${s}`);return[r,o,s]},{toString:vA}=Object.prototype,hK=t=>vA.call(t)==="[object ArrayBuffer]",ir=t=>vA.call(t)==="[object Uint8Array]",jl=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),pK=new TextEncoder,wA=t=>pK.encode(t),gK=new TextDecoder,bA=t=>gK.decode(t),mK=(t,e)=>yK(t,e).join(""),yK=(t,e)=>{if(e==="utf8"&&t.every(s=>typeof s=="string"))return t;const n=new nb(e),r=t.map(s=>typeof s=="string"?wA(s):s).map(s=>n.write(s)),i=n.end();return i===""?r:[...r,i]},Dv=t=>t.length===1&&ir(t[0])?t[0]:TA(vK(t)),vK=t=>t.map(e=>typeof e=="string"?wA(e):e),TA=t=>{const e=new Uint8Array(wK(t));let n=0;for(const r of t)e.set(r,n),n+=r.length;return e},wK=t=>{let e=0;for(const n of t)e+=n.length;return e},bK=t=>Array.isArray(t)&&Array.isArray(t.raw),TK=(t,e)=>{let n=[];for(const[s,o]of t.entries())n=EK({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,{}]},EK=({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}=RK(i,t.raw[r]),c=RA(n,s,o);if(r===e.length)return c;const l=e[r],u=Array.isArray(l)?l.map(d=>SA(d)):[SA(l)];return RA(c,u,a)},RK=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};const n=[];let r=0;const i=EA.has(e[0]);for(let o=0,a=0;o<t.length;o+=1,a+=1){const c=e[a];if(EA.has(c))r!==o&&n.push(t.slice(r,o)),r=o+1;else if(c==="\\"){const l=e[a+1];l==="u"&&e[a+2]==="{"?a=e.indexOf("}",a+3):a+=SK[l]??1}}const s=r===t.length;return s||n.push(t.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:s}},EA=new Set([" "," ","\r",`
|
|
1169
|
-
`]),SK={x:3,u:5},RA=(t,e,n)=>n||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],SA=t=>{const e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(Wn(t)&&("stdout"in t||"isMaxBuffer"in t))return $K(t);throw t instanceof tb||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`)},$K=({stdout:t})=>{if(typeof t=="string")return t;if(ir(t))return bA(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`)},zs=t=>Lv.includes(t),Lv=[We.stdin,We.stdout,We.stderr],Cr=["stdin","stdout","stderr"],$A=t=>Cr[t]??`stdio[${t}]`,kK=t=>{const e={...t};for(const n of AA)e[n]=kA(t,n);return e},kA=(t,e)=>{const n=Array.from({length:_K(t)+1}),r=CK(t[e],n,e);return NK(r,e)},_K=({stdio:t})=>Array.isArray(t)?Math.max(t.length,Cr.length):Cr.length,CK=(t,e,n)=>Wn(t)?AK(t,e,n):e.fill(t),AK=(t,e,n)=>{for(const r of Object.keys(t).sort(IK))for(const i of PK(r,n,e))e[i]=t[r];return e},IK=(t,e)=>_A(t)<_A(e)?1:-1,_A=t=>t==="stdout"||t==="stderr"?0:t==="all"?2:1,PK=(t,e,n)=>{if(t==="ipc")return[n.length-1];const r=CA(t);if(r===void 0||r===0)throw new TypeError(`"${e}.${t}" is invalid.
|
|
1170
|
-
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.
|
|
1171
|
-
Please set the "stdio" option to ensure that file descriptor exists.`);return r==="all"?[1,2]:[r]},CA=t=>{if(t==="all")return t;if(Cr.includes(t))return Cr.indexOf(t);const e=xK.exec(t);if(e!==null)return Number(e[1])},xK=/^fd(\d+)$/,NK=(t,e)=>t.map(n=>n===void 0?DK[e]:n),OK=Ux("execa").enabled?"full":"none",DK={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:OK,stripFinalNewline:!0},AA=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Ul=(t,e)=>e==="ipc"?t.at(-1):t[e],Mv=({verbose:t},e)=>jv(t,e)!=="none",Fv=({verbose:t},e)=>!["none","short"].includes(jv(t,e)),LK=({verbose:t},e)=>{const n=jv(t,e);return Uv(n)?n:void 0},jv=(t,e)=>e===void 0?MK(t):Ul(t,e),MK=t=>t.find(e=>Uv(e))??Bv.findLast(e=>t.includes(e)),Uv=t=>typeof t=="function",Bv=["none","short","full"],FK=(t,e)=>{const n=[t,...e],r=n.join(" "),i=n.map(s=>GK(IA(s))).join(" ");return{command:r,escapedCommand:i}},qv=t=>Bx(t).split(`
|
|
1172
|
-
`).map(e=>IA(e)).join(`
|
|
1173
|
-
`),IA=t=>t.replaceAll(BK,e=>jK(e)),jK=t=>{const e=qK[t];if(e!==void 0)return e;const n=t.codePointAt(0),r=n.toString(16);return n<=WK?`\\u${r.padStart(4,"0")}`:`\\U${r}`},UK=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},BK=UK(),qK={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},WK=65535,GK=t=>zK.test(t)?t:Vx==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,zK=/^[\w./-]+$/;function HK(){return We.platform!=="win32"?We.env.TERM!=="linux":!!We.env.WT_SESSION||!!We.env.TERMINUS_SUBLIME||We.env.ConEmuTask==="{cmd::Cmder}"||We.env.TERM_PROGRAM==="Terminus-Sublime"||We.env.TERM_PROGRAM==="vscode"||We.env.TERM==="xterm-256color"||We.env.TERM==="alacritty"||We.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const PA={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"},VK={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"},KK={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"},YK={...PA,...VK},XK={...PA,...KK},JK=HK(),Wv=JK?YK:XK,QK=ab.WriteStream.prototype.hasColors(),Lh=(t,e)=>{if(!QK)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}},ZK=Lh(1,22),Gv=Lh(90,39),eY=Lh(91,39),tY=Lh(93,39),nY=({type:t,message:e,timestamp:n,piped:r,commandId:i,result:{failed:s=!1}={},options:{reject:o=!0}})=>{const a=rY(n),c=iY[t]({failed:s,reject:o,piped:r}),l=sY[t]({reject:o});return`${Gv(`[${a}]`)} ${Gv(`[${i}]`)} ${l(c)} ${l(e)}`},rY=t=>`${Mh(t.getHours(),2)}:${Mh(t.getMinutes(),2)}:${Mh(t.getSeconds(),2)}.${Mh(t.getMilliseconds(),3)}`,Mh=(t,e)=>String(t).padStart(e,"0"),xA=({failed:t,reject:e})=>t?e?Wv.cross:Wv.warning:Wv.tick,iY={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:xA,duration:xA},NA=t=>t,sY={command:()=>ZK,output:()=>NA,ipc:()=>NA,error:({reject:t})=>t?eY:tY,duration:()=>Gv},oY=(t,e,n)=>{const r=LK(e,n);return t.map(({verboseLine:i,verboseObject:s})=>aY(i,s,r)).filter(i=>i!==void 0).map(i=>cY(i)).join("")},aY=(t,e,n)=>{if(n===void 0)return t;const r=n(t,e);if(typeof r=="string")return r},cY=t=>t.endsWith(`
|
|
1174
|
-
`)?t:`${t}
|
|
1175
|
-
`,Bl=({type:t,verboseMessage:e,fdNumber:n,verboseInfo:r,result:i})=>{const s=lY({type:t,result:i,verboseInfo:r}),o=uY(e,s),a=oY(o,r,n);ib(fY,a)},lY=({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}),uY=(t,e)=>t.split(`
|
|
1176
|
-
`).map(n=>dY({...e,message:n})),dY=t=>({verboseLine:nY(t),verboseObject:t}),fY=2,OA=t=>{const e=typeof t=="string"?t:eb(t);return qv(e).replaceAll(" "," ".repeat(hY))},hY=2,pY=(t,e)=>{Mv(e)&&Bl({type:"command",verboseMessage:t,verboseInfo:e})},gY=(t,e,n)=>{vY(t);const r=mY(t);return{verbose:t,escapedCommand:e,commandId:r,rawOptions:n}},mY=t=>Mv({verbose:t})?yY++:void 0;let yY=0n;const vY=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(!Bv.includes(e)&&!Uv(e)){const n=Bv.map(r=>`'${r}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${n} or a function.`)}}},DA=()=>Jl.bigint(),LA=t=>Number(Jl.bigint()-t)/1e6,MA=(t,e,n)=>{const r=DA(),{command:i,escapedCommand:s}=FK(t,e),o=kA(n,"verbose"),a=gY(o,s,{...n});return pY(s,a),{command:i,escapedCommand:s,startTime:r,verboseInfo:a}};var ia={exports:{}},zv,FA;function wY(){if(FA)return zv;FA=1,zv=r,r.sync=i;var t=Ql;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 l=a[c].toLowerCase();if(l&&s.substr(-l.length).toLowerCase()===l)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,l){a(c,c?!1:n(l,s,o))})}function i(s,o){return n(t.statSync(s),s,o)}return zv}var Hv,jA;function bY(){if(jA)return Hv;jA=1,Hv=e,e.sync=n;var t=Ql;function e(s,o,a){t.stat(s,function(c,l){a(c,c?!1:r(l,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,l=s.gid,u=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),y=f|h,$=a&p||a&h&&l===d||a&f&&c===u||a&y&&u===0;return $}return Hv}var Fh;process.platform==="win32"||ut.TESTING_WINDOWS?Fh=wY():Fh=bY();var TY=Vv;Vv.sync=EY;function Vv(t,e,n){if(typeof e=="function"&&(n=e,e={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,i){Vv(t,e||{},function(s,o){s?i(s):r(o)})})}Fh(t,e||{},function(r,i){r&&(r.code==="EACCES"||e&&e.ignoreErrors)&&(r=null,i=!1),n(r,i)})}function EY(t,e){try{return Fh.sync(t,e||{})}catch(n){if(e&&e.ignoreErrors||n.code==="EACCES")return!1;throw n}}const sa=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",UA=da,RY=sa?";":":",BA=TY,qA=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),WA=(t,e)=>{const n=e.colon||RY,r=t.match(/\//)||sa&&t.match(/\\/)?[""]:[...sa?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(n)],i=sa?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=sa?i.split(n):[""];return sa&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:r,pathExt:s,pathExtExe:i}},GA=(t,e,n)=>{typeof e=="function"&&(n=e,e={}),e||(e={});const{pathEnv:r,pathExt:i,pathExtExe:s}=WA(t,e),o=[],a=l=>new Promise((u,d)=>{if(l===r.length)return e.all&&o.length?u(o):d(qA(t));const f=r[l],h=/^".*"$/.test(f)?f.slice(1,-1):f,p=UA.join(h,t),y=!h&&/^\.[\\\/]/.test(t)?t.slice(0,2)+p:p;u(c(y,l,0))}),c=(l,u,d)=>new Promise((f,h)=>{if(d===i.length)return f(a(u+1));const p=i[d];BA(l+p,{pathExt:s},(y,$)=>{if(!y&&$)if(e.all)o.push(l+p);else return f(l+p);return f(c(l,u,d+1))})});return n?a(0).then(l=>n(null,l),n):a(0)},SY=(t,e)=>{e=e||{};const{pathEnv:n,pathExt:r,pathExtExe:i}=WA(t,e),s=[];for(let o=0;o<n.length;o++){const a=n[o],c=/^".*"$/.test(a)?a.slice(1,-1):a,l=UA.join(c,t),u=!c&&/^\.[\\\/]/.test(t)?t.slice(0,2)+l:l;for(let d=0;d<r.length;d++){const f=u+r[d];try{if(BA.sync(f,{pathExt:i}))if(e.all)s.push(f);else return f}catch{}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw qA(t)};var $Y=GA;GA.sync=SY;var Kv={exports:{}};const zA=(t={})=>{const e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};Kv.exports=zA,Kv.exports.default=zA;var kY=Kv.exports;const HA=da,_Y=$Y,CY=kY;function VA(t,e){const n=t.options.env||process.env,r=process.cwd(),i=t.options.cwd!=null,s=i&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let o;try{o=_Y.sync(t.command,{path:n[CY({env:n})],pathExt:e?HA.delimiter:void 0})}catch{}finally{s&&process.chdir(r)}return o&&(o=HA.resolve(i?t.options.cwd:"",o)),o}function AY(t){return VA(t)||VA(t,!0)}var IY=AY,Yv={};const Xv=/([()\][%!^"`<>&|;, *?])/g;function PY(t){return t=t.replace(Xv,"^$1"),t}function xY(t,e){return t=`${t}`,t=t.replace(/(\\*)"/g,'$1$1\\"'),t=t.replace(/(\\*)$/,"$1$1"),t=`"${t}"`,t=t.replace(Xv,"^$1"),e&&(t=t.replace(Xv,"^$1")),t}Yv.command=PY,Yv.argument=xY;var NY=/^#!(.*)/;const OY=NY;var DY=(t="")=>{const e=t.match(OY);if(!e)return null;const[n,r]=e[0].replace(/#! ?/,"").split(" "),i=n.split("/").pop();return i==="env"?r:r?`${i} ${r}`:i};const Jv=Ql,LY=DY;function MY(t){const n=Buffer.alloc(150);let r;try{r=Jv.openSync(t,"r"),Jv.readSync(r,n,0,150,0),Jv.closeSync(r)}catch{}return LY(n.toString())}var FY=MY;const jY=da,KA=IY,YA=Yv,UY=FY,BY=process.platform==="win32",qY=/\.(?:com|exe)$/i,WY=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function GY(t){t.file=KA(t);const e=t.file&&UY(t.file);return e?(t.args.unshift(t.file),t.command=e,KA(t)):t.file}function zY(t){if(!BY)return t;const e=GY(t),n=!qY.test(e);if(t.options.forceShell||n){const r=WY.test(e);t.command=jY.normalize(t.command),t.command=YA.command(t.command),t.args=t.args.map(s=>YA.argument(s,r));const i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function HY(t,e,n){e&&!Array.isArray(e)&&(n=e,e=null),e=e?e.slice(0):[],n=Object.assign({},n);const r={command:t,args:e,options:n,file:void 0,original:{command:t,args:e}};return n.shell?r:zY(r)}var VY=HY;const Qv=process.platform==="win32";function Zv(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function KY(t,e){if(!Qv)return;const n=t.emit;t.emit=function(r,i){if(r==="exit"){const s=XA(i,e);if(s)return n.call(t,"error",s)}return n.apply(t,arguments)}}function XA(t,e){return Qv&&t===1&&!e.file?Zv(e.original,"spawn"):null}function YY(t,e){return Qv&&t===1&&!e.file?Zv(e.original,"spawnSync"):null}var XY={hookChildProcess:KY,verifyENOENT:XA,verifyENOENTSync:YY,notFoundError:Zv};const JA=cb,ew=VY,tw=XY;function QA(t,e,n){const r=ew(t,e,n),i=JA.spawn(r.command,r.args,r.options);return tw.hookChildProcess(i,r),i}function JY(t,e,n){const r=ew(t,e,n),i=JA.spawnSync(r.command,r.args,r.options);return i.error=i.error||tw.verifyENOENTSync(i.status,r),i}ia.exports=QA,ia.exports.spawn=QA,ia.exports.sync=JY,ia.exports._parse=ew,ia.exports._enoent=tw;var QY=ia.exports;const ZY=po(QY);function ZA(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 eX=({cwd:t=We.cwd(),path:e=We.env[ZA()],preferLocal:n=!0,execPath:r=We.execPath,addExecPath:i=!0}={})=>{const s=t instanceof URL?sp(t):t,o=Nr.resolve(s),a=[];return n&&tX(a,o),i&&nX(a,r,o),[...a,e].join(Nr.delimiter)},tX=(t,e)=>{let n;for(;n!==e;)t.push(Nr.join(e,"node_modules/.bin")),n=e,e=Nr.resolve(e,"..")},nX=(t,e,n)=>{const r=e instanceof URL?sp(e):e;t.push(Nr.resolve(n,r,".."))},rX=({env:t=We.env,...e}={})=>{t={...t};const n=ZA({env:t});return e.path=t[n],t[n]=eX(e),t},iX=(t,e,n)=>{const r=n?iw:rw,i=t instanceof ql?{}:{cause:t};return new r(e,i)};class ql extends Error{}const eI=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,tI,{value:!0,writable:!1,enumerable:!1,configurable:!1})},sX=t=>nw(t)&&tI in t,tI=Symbol("isExecaError"),nw=t=>Object.prototype.toString.call(t)==="[object Error]";class rw extends Error{}eI(rw,rw.name);class iw extends Error{}eI(iw,iw.name);const oX=()=>{const t=rI-nI+1;return Array.from({length:t},aX)},aX=(t,e)=>({name:`SIGRT${e+1}`,number:nI+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),nI=34,rI=64,cX=[{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"}],iI=()=>{const t=oX();return[...cX,...t].map(lX)},lX=({name:t,number:e,description:n,action:r,forced:i=!1,standard:s})=>{const{signals:{[t]:o}}=fs,a=o!==void 0;return{name:t,number:a?o:e,description:n,supported:a,action:r,forced:i,standard:s}},uX=()=>{const t=iI();return Object.fromEntries(t.map(dX))},dX=({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}],fX=uX(),hX=()=>{const t=iI(),e=rI+1,n=Array.from({length:e},(r,i)=>pX(i,t));return Object.assign({},...n)},pX=(t,e)=>{const n=gX(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}}},gX=(t,e)=>{const n=e.find(({name:r})=>fs.signals[r]===t);return n!==void 0?n:e.find(r=>r.number===t)};hX();const mX=t=>{const e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return sI(t,e)},yX=t=>t===0?t:sI(t,"`subprocess.kill()`'s argument"),sI=(t,e)=>{if(Number.isInteger(t))return vX(t,e);if(typeof t=="string")return bX(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer.
|
|
1177
|
-
${sw()}`)},vX=(t,e)=>{if(oI.has(t))return oI.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist.
|
|
1178
|
-
${sw()}`)},wX=()=>new Map(Object.entries(fs.signals).reverse().map(([t,e])=>[e,t])),oI=wX(),bX=(t,e)=>{if(t in fs.signals)return t;throw t.toUpperCase()in fs.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist.
|
|
1179
|
-
${sw()}`)},sw=()=>`Available signal names: ${TX()}.
|
|
1180
|
-
Available signal numbers: ${EX()}.`,TX=()=>Object.keys(fs.signals).sort().map(t=>`'${t}'`).join(", "),EX=()=>[...new Set(Object.values(fs.signals).sort((t,e)=>t-e))].join(", "),aI=t=>fX[t].description,RX=t=>{if(t===!1)return t;if(t===!0)return SX;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},SX=1e3*5,$X=({kill:t,options:{forceKillAfterDelay:e,killSignal:n},onInternalError:r,context:i,controller:s},o,a)=>{const{signal:c,error:l}=kX(o,a,n);_X(l,r);const u=t(c);return CX({kill:t,signal:c,forceKillAfterDelay:e,killSignal:n,killResult:u,context:i,controller:s}),u},kX=(t,e,n)=>{const[r=n,i]=nw(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&&!nw(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:yX(r),error:i}},_X=(t,e)=>{t!==void 0&&e.reject(t)},CX=async({kill:t,signal:e,forceKillAfterDelay:n,killSignal:r,killResult:i,context:s,controller:o})=>{e===r&&i&&cI({kill:t,forceKillAfterDelay:n,context:s,controllerSignal:o.signal})},cI=async({kill:t,forceKillAfterDelay:e,context:n,controllerSignal:r})=>{if(e!==!1)try{await lb(e,void 0,{signal:r}),t("SIGKILL")&&(n.isForcefullyTerminated??=!0)}catch{}},lI=async(t,e)=>{t.aborted||await nn(t,"abort",{signal:e})},AX=({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)}`)},IX=({subprocess:t,cancelSignal:e,gracefulCancel:n,context:r,controller:i})=>e===void 0||n?[]:[PX(t,e,r,i)],PX=async(t,e,n,{signal:r})=>{throw await lI(e,r),n.terminationReason??="cancel",t.kill(),e.reason},ow=({methodName:t,isSubprocess:e,ipc:n,isConnected:r})=>{xX(t,e,n),uI(t,e,r)},xX=(t,e,n)=>{if(!n)throw new Error(`${sr(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},uI=(t,e,n)=>{if(!n)throw new Error(`${sr(t,e)} cannot be used: the ${Xi(e)} has already exited or disconnected.`)},NX=t=>{throw new Error(`${sr("getOneMessage",t)} could not complete: the ${Xi(t)} exited or disconnected.`)},OX=t=>{throw new Error(`${sr("sendMessage",t)} failed: the ${Xi(t)} is sending a message too, instead of listening to incoming messages.
|
|
1181
|
-
This can be fixed by both sending a message and listening to incoming messages at the same time:
|
|
1182
|
-
|
|
1183
|
-
const [receivedMessage] = await Promise.all([
|
|
1184
|
-
${sr("getOneMessage",t)},
|
|
1185
|
-
${sr("sendMessage",t,"message, {strict: true}")},
|
|
1186
|
-
]);`)},dI=(t,e)=>new Error(`${sr("sendMessage",e)} failed when sending an acknowledgment response to the ${Xi(e)}.`,{cause:t}),DX=t=>{throw new Error(`${sr("sendMessage",t)} failed: the ${Xi(t)} is not listening to incoming messages.`)},LX=t=>{throw new Error(`${sr("sendMessage",t)} failed: the ${Xi(t)} exited without listening to incoming messages.`)},MX=()=>new Error(`\`cancelSignal\` aborted: the ${Xi(!0)} disconnected.`),FX=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},jX=({error:t,methodName:e,isSubprocess:n})=>{if(t.code==="EPIPE")throw new Error(`${sr(e,n)} cannot be used: the ${Xi(n)} is disconnecting.`,{cause:t})},UX=({error:t,methodName:e,isSubprocess:n,message:r})=>{if(BX(t))throw new Error(`${sr(e,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:t})},BX=({code:t,message:e})=>qX.has(t)||WX.some(n=>e.includes(n)),qX=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),WX=["could not be cloned","circular structure","call stack size exceeded"],sr=(t,e,n="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${GX(e)}${t}(${n})`,GX=t=>t?"":"subprocess.",Xi=t=>t?"parent process":"subprocess",aw=t=>{t.connected&&t.disconnect()},Wl=()=>{const t={},e=new Promise((n,r)=>{Object.assign(t,{resolve:n,reject:r})});return Object.assign(e,t)},fI=(t,e="stdin")=>{const{options:r,fileDescriptors:i}=Hs.get(t),s=hI(i,e,!0),o=t.stdio[s];if(o===null)throw new TypeError(pI(s,e,r,!0));return o},cw=(t,e="stdout")=>{const{options:r,fileDescriptors:i}=Hs.get(t),s=hI(i,e,!1),o=s==="all"?t.all:t.stdio[s];if(o==null)throw new TypeError(pI(s,e,r,!1));return o},Hs=new WeakMap,hI=(t,e,n)=>{const r=zX(e,n);return HX(r,e,n,t),r},zX=(t,e)=>{const n=CA(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(`"${Gl(e)}" must not be "${t}".
|
|
1187
|
-
It must be ${r} or "fd3", "fd4" (and so on).
|
|
1188
|
-
It is optional and defaults to "${i}".`)},HX=(t,e,n,r)=>{const i=r[gI(t)];if(i===void 0)throw new TypeError(`"${Gl(n)}" must not be ${e}. That file descriptor does not exist.
|
|
1189
|
-
Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!n)throw new TypeError(`"${Gl(n)}" must not be ${e}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&n)throw new TypeError(`"${Gl(n)}" must not be ${e}. It must be a writable stream, not readable.`)},pI=(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}=VX(t,n);return`The "${i}: ${lw(s)}" option is incompatible with using "${Gl(r)}: ${lw(e)}".
|
|
1190
|
-
Please set this option with "pipe" instead.`},VX=(t,{stdin:e,stdout:n,stderr:r,stdio:i})=>{const s=gI(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]}},gI=t=>t==="all"?1:t,Gl=t=>t?"to":"from",lw=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream",jh=(t,e,n)=>{const r=t.getMaxListeners();r===0||r===Number.POSITIVE_INFINITY||(t.setMaxListeners(r+e),db(n,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))},mI=(t,e)=>{e&&uw(t)},uw=t=>{t.refCounted()},yI=(t,e)=>{e&&dw(t)},dw=t=>{t.unrefCounted()},KX=(t,e)=>{e&&(dw(t),dw(t))},YX=(t,e)=>{e&&(uw(t),uw(t))},XX=async({anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r},i)=>{if(rJ(i)||gJ(i))return;Uh.has(t)||Uh.set(t,[]);const s=Uh.get(t);if(s.push(i),!(s.length>1))for(;s.length>0;){await cJ(t,r,i),await ub.yield();const o=await nJ({wrappedMessage:s[0],anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r});s.shift(),r.emit("message",o),r.emit("message:done")}},JX=async({anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{SI();const s=Uh.get(t);for(;s?.length>0;)await nn(r,"message:done");t.removeListener("message",i),YX(e,n),r.connected=!1,r.emit("disconnect")},Uh=new WeakMap,Bh=(t,e,n)=>{if(qh.has(t))return qh.get(t);const r=new Zx;return r.connected=!0,qh.set(t,r),QX({ipcEmitter:r,anyProcess:t,channel:e,isSubprocess:n}),r},qh=new WeakMap,QX=({ipcEmitter:t,anyProcess:e,channel:n,isSubprocess:r})=>{const i=XX.bind(void 0,{anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:t});e.on("message",i),e.once("disconnect",JX.bind(void 0,{anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:t,boundOnMessage:i})),KX(n,r)},vI=t=>{const e=qh.get(t);return e===void 0?t.channel!==null:e.connected},ZX=({anyProcess:t,channel:e,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;const s=Bh(t,e,n),o=fw(t,s);return{id:eJ++,type:Gh,message:r,hasListeners:o}};let eJ=0n;const tJ=(t,e)=>{if(!(e?.type!==Gh||e.hasListeners))for(const{id:n}of t)n!==void 0&&Wh[n].resolve({isDeadlock:!0,hasListeners:!1})},nJ=async({wrappedMessage:t,anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(t?.type!==Gh||!e.connected)return t;const{id:s,message:o}=t,a={id:s,type:wI,message:fw(e,i)};try{await bI({anyProcess:e,channel:n,isSubprocess:r,ipc:!0},a)}catch(c){i.emit("strict:error",c)}return o},rJ=t=>{if(t?.type!==wI)return!1;const{id:e,message:n}=t;return Wh[e]?.resolve({isDeadlock:!1,hasListeners:n}),!0},iJ=async(t,e,n)=>{if(t?.type!==Gh)return;const r=Wl();Wh[t.id]=r;const i=new AbortController;try{const{isDeadlock:s,hasListeners:o}=await Promise.race([r,sJ(e,n,i)]);s&&OX(n),o||DX(n)}finally{i.abort(),delete Wh[t.id]}},Wh={},sJ=async(t,e,{signal:n})=>{jh(t,1,n),await nn(t,"disconnect",{signal:n}),LX(e)},Gh="execa:ipc:request",wI="execa:ipc:response",oJ=(t,e,n)=>{zl.has(t)||zl.set(t,new Set);const r=zl.get(t),i=Wl(),s=n?e.id:void 0,o={onMessageSent:i,id:s};return r.add(o),{outgoingMessages:r,outgoingMessage:o}},aJ=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},cJ=async(t,e,n)=>{for(;!fw(t,e)&&zl.get(t)?.size>0;){const r=[...zl.get(t)];tJ(r,n),await Promise.all(r.map(({onMessageSent:i})=>i))}},zl=new WeakMap,fw=(t,e)=>e.listenerCount("message")>lJ(t),lJ=t=>Hs.has(t)&&!Ul(Hs.get(t).options.buffer,"ipc")?1:0,bI=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},i,{strict:s=!1}={})=>{const o="sendMessage";return ow({methodName:o,isSubprocess:n,ipc:r,isConnected:t.connected}),uJ({anyProcess:t,channel:e,methodName:o,isSubprocess:n,message:i,strict:s})},uJ=async({anyProcess:t,channel:e,methodName:n,isSubprocess:r,message:i,strict:s})=>{const o=ZX({anyProcess:t,channel:e,isSubprocess:r,message:i,strict:s}),a=oJ(t,o,s);try{await TI({anyProcess:t,methodName:n,isSubprocess:r,wrappedMessage:o,message:i})}catch(c){throw aw(t),c}finally{aJ(a)}},TI=async({anyProcess:t,methodName:e,isSubprocess:n,wrappedMessage:r,message:i})=>{const s=dJ(t);try{await Promise.all([iJ(r,t,n),s(r)])}catch(o){throw jX({error:o,methodName:e,isSubprocess:n}),UX({error:o,methodName:e,isSubprocess:n,message:i}),o}},dJ=t=>{if(hw.has(t))return hw.get(t);const e=qx(t.send.bind(t));return hw.set(t,e),e},hw=new WeakMap,fJ=(t,e)=>{const n="cancelSignal";return uI(n,!1,t.connected),TI({anyProcess:t,methodName:n,isSubprocess:!1,wrappedMessage:{type:RI,message:e},message:e})},hJ=async({anyProcess:t,channel:e,isSubprocess:n,ipc:r})=>(await pJ({anyProcess:t,channel:e,isSubprocess:n,ipc:r}),pw.signal),pJ=async({anyProcess:t,channel:e,isSubprocess:n,ipc:r})=>{if(!EI){if(EI=!0,!r){FX();return}if(e===null){SI();return}Bh(t,e,n),await ub.yield()}};let EI=!1;const gJ=t=>t?.type!==RI?!1:(pw.abort(t.message),!0),RI="execa:ipc:cancel",SI=()=>{pw.abort(MX())},pw=new AbortController,mJ=({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.")}},yJ=({subprocess:t,cancelSignal:e,gracefulCancel:n,forceKillAfterDelay:r,context:i,controller:s})=>n?[vJ({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:i,controller:s})]:[],vJ=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:r,controller:{signal:i}})=>{await lI(e,i);const s=wJ(e);throw await fJ(t,s),cI({kill:t.kill,forceKillAfterDelay:n,context:r,controllerSignal:i}),r.terminationReason??="gracefulCancel",e.reason},wJ=({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},bJ=({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})`)},TJ=(t,e,n,r)=>e===0||e===void 0?[]:[EJ(t,e,n,r)],EJ=async(t,e,n,{signal:r})=>{throw await lb(e,void 0,{signal:r}),n.terminationReason??="timeout",t.kill(),new ql},RJ=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},SJ=(t,e,{node:n=!1,nodePath:r=Kx,nodeOptions:i=Yx.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=Ov(r,'The "nodePath" option'),l=Nr.resolve(s,c),u={...a,nodePath:l,node:n,cwd:s};if(!n)return[t,e,u];if(Nr.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[l,[...i,t,...e],{ipc:!0,...u,shell:!1}]},$J=({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`.");CJ[n](t)}},kJ=t=>{try{tN(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},_J=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},CJ={advanced:kJ,json:_J},AJ=async(t,e)=>{e!==void 0&&await t.sendMessage(e)},IJ=({encoding:t})=>{if(gw.has(t))return;const e=xJ(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${zh(t)}\`.
|
|
1191
|
-
Please rename it to ${zh(e)}.`);const n=[...gw].map(r=>zh(r)).join(", ");throw new TypeError(`Invalid option \`encoding: ${zh(t)}\`.
|
|
1192
|
-
Please rename it to one of: ${n}.`)},PJ=new Set(["utf8","utf16le"]),Vs=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),gw=new Set([...PJ,...Vs]),xJ=t=>{if(t===null)return"buffer";if(typeof t!="string")return;const e=t.toLowerCase();if(e in $I)return $I[e];if(gw.has(e))return e},$I={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},zh=t=>typeof t=="string"?`"${t}"`:String(t),NJ=(t=kI())=>{const e=Ov(t,'The "cwd" option');return Nr.resolve(e)},kI=()=>{try{return We.cwd()}catch(t){throw t.message=`The current directory does not exist.
|
|
1193
|
-
${t.message}`,t}},OJ=(t,e)=>{if(e===kI())return t;let n;try{n=Xx(e)}catch(r){return`The "cwd" option is invalid: ${e}.
|
|
1194
|
-
${r.message}
|
|
1195
|
-
${t}`}return n.isDirectory()?t:`The "cwd" option is not a directory: ${e}.
|
|
1196
|
-
${t}`},_I=(t,e,n)=>{n.cwd=NJ(n.cwd);const[r,i,s]=SJ(t,e,n),{command:o,args:a,options:c}=ZY._parse(r,i,s),l=kK(c),u=DJ(l);return bJ(u),IJ(u),$J(u),AX(u),mJ(u),u.shell=mA(u.shell),u.env=LJ(u),u.killSignal=mX(u.killSignal),u.forceKillAfterDelay=RX(u.forceKillAfterDelay),u.lines=u.lines.map((d,f)=>d&&!Vs.has(u.encoding)&&u.buffer[f]),We.platform==="win32"&&Nr.basename(o,".exe")==="cmd"&&a.unshift("/q"),{file:o,commandArguments:a,options:u}},DJ=({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:l="SIGTERM",forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:h=f!==void 0||d,serialization:p="advanced",...y})=>({...y,extendEnv:t,preferLocal:e,cwd:n,localDirectory:r,encoding:i,reject:s,cleanup:o,all:a,windowsHide:c,killSignal:l,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:h,serialization:p}),LJ=({env:t,extendEnv:e,preferLocal:n,node:r,localDirectory:i,nodePath:s})=>{const o=e?{...We.env,...t}:t;return n||r?rX({env:o,cwd:i,execPath:s,preferLocal:n,addExecPath:r}):o};function mw(t){if(typeof t=="string")return MJ(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return FJ(t)}const MJ=t=>t.at(-1)===CI?t.slice(0,t.at(-2)===AI?-2:-1):t,FJ=t=>t.at(-1)===jJ?t.subarray(0,t.at(-2)===UJ?-2:-1):t,CI=`
|
|
1197
|
-
`,jJ=CI.codePointAt(0),AI="\r",UJ=AI.codePointAt(0);function Ks(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 II(t,{checkOpen:e=!0}={}){return Ks(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 Hh(t,{checkOpen:e=!0}={}){return Ks(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 PI(t,e){return II(t,e)&&Hh(t,e)}const BJ=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class qJ{#e;#t;#n=!1;#r=void 0;constructor(e,n){this.#e=e,this.#t=n}next(){const e=()=>this.#i();return this.#r=this.#r?this.#r.then(e,e):e(),this.#r}return(e){const n=()=>this.#s(e);return this.#r?this.#r.then(n,n):n()}async#i(){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#s(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 yw=Symbol();function xI(){return this[yw].next()}Object.defineProperty(xI,"name",{value:"next"});function NI(t){return this[yw].return(t)}Object.defineProperty(NI,"name",{value:"return"});const WJ=Object.create(BJ,{next:{enumerable:!0,configurable:!0,writable:!0,value:xI},return:{enumerable:!0,configurable:!0,writable:!0,value:NI}});function GJ({preventCancel:t=!1}={}){const e=this.getReader(),n=new qJ(e,t),r=Object.create(WJ);return r[yw]=n,r}const zJ=t=>{if(Hh(t,{checkOpen:!1})&&vw.on!==void 0)return VJ(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(HJ.call(t)==="[object ReadableStream]")return GJ.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:HJ}=Object.prototype,VJ=async function*(t){const e=new AbortController,n={};KJ(t,e,n);try{for await(const[r]of vw.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()}},KJ=async(t,e,n)=>{try{await vw.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(r){n.error=r}finally{e.abort()}},vw={},ww=async(t,{init:e,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:o,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{const l=zJ(t),u=e();u.length=0;try{for await(const d of l){const f=XJ(d),h=n[f](d,u);OI({convertedChunk:h,state:u,getSize:r,truncateChunk:i,addChunk:s,maxBuffer:c})}return YJ({state:u,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:o,maxBuffer:c}),a(u)}catch(d){const f=typeof d=="object"&&d!==null?d:new Error(d);throw f.bufferedData=a(u),f}},YJ=({state:t,getSize:e,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:s})=>{const o=i(t);o!==void 0&&OI({convertedChunk:o,state:t,getSize:e,truncateChunk:n,addChunk:r,maxBuffer:s})},OI=({convertedChunk:t,state:e,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:s})=>{const o=n(t),a=e.length+o;if(a<=s){DI(t,e,i,a);return}const c=r(t,s-e.length);throw c!==void 0&&DI(c,e,i,s),new Vh},DI=(t,e,n,r)=>{e.contents=n(t,e,r),e.length=r},XJ=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=LI.call(t);return n==="[object ArrayBuffer]"?"arrayBuffer":n==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&LI.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:LI}=Object.prototype;class Vh extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const Ys=t=>t,bw=()=>{},MI=({contents:t})=>t,FI=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},jI=t=>t.length;async function JJ(t,e){return ww(t,tQ,e)}const QJ=()=>({contents:[]}),ZJ=()=>1,eQ=(t,{contents:e})=>(e.push(t),e),tQ={init:QJ,convertChunk:{string:Ys,buffer:Ys,arrayBuffer:Ys,dataView:Ys,typedArray:Ys,others:Ys},getSize:ZJ,truncateChunk:bw,addChunk:eQ,getFinalChunk:bw,finalize:MI};async function nQ(t,e){return ww(t,dQ,e)}const rQ=()=>({contents:new ArrayBuffer(0)}),iQ=t=>sQ.encode(t),sQ=new TextEncoder,UI=t=>new Uint8Array(t),BI=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),oQ=(t,e)=>t.slice(0,e),aQ=(t,{contents:e,length:n},r)=>{const i=GI()?lQ(e,r):cQ(e,r);return new Uint8Array(i).set(t,n),i},cQ=(t,e)=>{if(e<=t.byteLength)return t;const n=new ArrayBuffer(qI(e));return new Uint8Array(n).set(new Uint8Array(t),0),n},lQ=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;const n=new ArrayBuffer(e,{maxByteLength:qI(e)});return new Uint8Array(n).set(new Uint8Array(t),0),n},qI=t=>WI**Math.ceil(Math.log(t)/Math.log(WI)),WI=2,uQ=({contents:t,length:e})=>GI()?t:t.slice(0,e),GI=()=>"resize"in ArrayBuffer.prototype,dQ={init:rQ,convertChunk:{string:iQ,buffer:UI,arrayBuffer:UI,dataView:BI,typedArray:BI,others:FI},getSize:jI,truncateChunk:oQ,addChunk:aQ,getFinalChunk:bw,finalize:uQ};async function fQ(t,e){return ww(t,yQ,e)}const hQ=()=>({contents:"",textDecoder:new TextDecoder}),Kh=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),pQ=(t,{contents:e})=>e+t,gQ=(t,e)=>t.slice(0,e),mQ=({textDecoder:t})=>{const e=t.decode();return e===""?void 0:e},yQ={init:hQ,convertChunk:{string:Ys,buffer:Kh,arrayBuffer:Kh,dataView:Kh,typedArray:Kh,others:FI},getSize:jI,truncateChunk:gQ,addChunk:pQ,getFinalChunk:mQ,finalize:MI},vQ=({error:t,stream:e,readableObjectMode:n,lines:r,encoding:i,fdNumber:s})=>{if(!(t instanceof Vh))throw t;if(s==="all")return t;const o=wQ(n,r,i);throw t.maxBufferInfo={fdNumber:s,unit:o},e.destroy(),t},wQ=(t,e,n)=>t?"objects":e?"lines":n==="buffer"?"bytes":"characters",bQ=(t,e,n)=>{if(e.length!==n)return;const r=new Vh;throw r.maxBufferInfo={fdNumber:"ipc"},r},TQ=(t,e)=>{const{streamName:n,threshold:r,unit:i}=EQ(t,e);return`Command's ${n} was larger than ${r} ${i}`},EQ=(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=Ul(e,n);return n==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:$A(n),threshold:i,unit:r}},RQ=(t,e,n)=>t?.code==="ENOBUFS"&&e!==null&&e.some(r=>r!==null&&r.length>Tw(n)),SQ=(t,e,n)=>{if(!e)return t;const r=Tw(n);return t.length>r?t.slice(0,r):t},Tw=([,t])=>t,$Q=({stdio:t,all:e,ipcOutput:n,originalError:r,signal:i,signalDescription:s,exitCode:o,escapedCommand:a,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:h,killSignal:p,maxBuffer:y,timeout:$,cwd:T})=>{const w=r?.code,b=kQ({originalError:r,timedOut:c,timeout:$,isMaxBuffer:d,maxBuffer:y,errorCode:w,signal:i,signalDescription:s,exitCode:o,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:h,killSignal:p}),_=CQ(r,T),x=_===void 0?"":`
|
|
1198
|
-
${_}`,F=`${b}: ${a}${x}`,P=e===void 0?[t[2],t[1]]:[e],G=[F,...P,...t.slice(3),n.map(B=>AQ(B)).join(`
|
|
1199
|
-
`)].map(B=>qv(mw(IQ(B)))).filter(Boolean).join(`
|
|
1200
|
-
|
|
1201
|
-
`);return{originalMessage:_,shortMessage:F,message:G}},kQ=({originalError:t,timedOut:e,timeout:n,isMaxBuffer:r,maxBuffer:i,errorCode:s,signal:o,signalDescription:a,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:h})=>{const p=_Q(d,f);return e?`Command timed out after ${n} milliseconds${p}`:u?o===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${p}`:`Command was gracefully canceled with ${o} (${a})`:l?`Command was canceled${p}`:r?`${TQ(t,i)}${p}`:s!==void 0?`Command failed with ${s}${p}`:d?`Command was killed with ${h} (${aI(h)})${p}`:o!==void 0?`Command was killed with ${o} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},_Q=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",CQ=(t,e)=>{if(t instanceof ql)return;const n=sX(t)?t.originalMessage:String(t?.message??t),r=qv(OJ(n,e));return r===""?void 0:r},AQ=t=>typeof t=="string"?t:eb(t),IQ=t=>Array.isArray(t)?t.map(e=>mw(zI(e))).filter(Boolean).join(`
|
|
1202
|
-
`):zI(t),zI=t=>typeof t=="string"?t:ir(t)?bA(t):"",HI=({command:t,escapedCommand:e,stdio:n,all:r,ipcOutput:i,options:{cwd:s},startTime:o})=>VI({command:t,escapedCommand:e,cwd:s,durationMs:LA(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:[]}),Ew=({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:o})=>Rw({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}),Rw=({error:t,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:h,options:{timeoutDuration:p,timeout:y=p,forceKillAfterDelay:$,killSignal:T,cwd:w,maxBuffer:b},isSync:_})=>{const{exitCode:x,signal:F,signalDescription:P}=xQ(l,u),{originalMessage:G,shortMessage:B,message:W}=$Q({stdio:d,all:f,ipcOutput:h,originalError:t,signal:F,signalDescription:P,exitCode:x,escapedCommand:n,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:$,killSignal:T,maxBuffer:b,timeout:y,cwd:w}),I=iX(t,W,_);return Object.assign(I,PQ({error:I,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:x,signal:F,signalDescription:P,stdio:d,all:f,ipcOutput:h,cwd:w,originalMessage:G,shortMessage:B})),I},PQ=({error:t,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:h,ipcOutput:p,cwd:y,originalMessage:$,shortMessage:T})=>VI({shortMessage:T,originalMessage:$,command:e,escapedCommand:n,cwd:y,durationMs:LA(r),failed:!0,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isTerminated:u!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:h,stdio:f,ipcOutput:p,pipedFrom:[]}),VI=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),xQ=(t,e)=>{const n=t===null?void 0:t,r=e===null?void 0:e,i=r===void 0?void 0:aI(e);return{exitCode:n,signal:r,signalDescription:i}},KI=t=>Number.isFinite(t)?t:0;function NQ(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(KI(t*1e3)%1e3),nanoseconds:Math.trunc(KI(t*1e6)%1e3)}}function OQ(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 DQ(t){switch(typeof t){case"number":{if(Number.isFinite(t))return NQ(t);break}case"bigint":return OQ(t)}throw new TypeError("Expected a finite number or bigint")}const LQ=t=>t===0||t===0n,MQ=(t,e)=>e===1||e===1n?t:`${t}s`,FQ=1e-7,jQ=24n*60n*60n*1000n;function YI(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=(u,d)=>{const f=Math.floor(u*10**d+FQ);return(Math.round(f)/10**d).toFixed(d)},o=(u,d,f,h)=>{if(!((i.length===0||!e.colonNotation)&&LQ(u)&&!(e.colonNotation&&f==="m"))){if(h??=String(u),e.colonNotation){const p=h.includes(".")?h.split(".")[0].length:h.length,y=i.length>0?2:1;h="0".repeat(Math.max(0,y-p))+h}else h+=e.verbose?" "+MQ(d,u):f;i.push(h)}},a=DQ(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 u=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),h=Number(a.nanoseconds);if(o(u,"second","s"),e.formatSubMilliseconds)o(d,"millisecond","ms"),o(f,"microsecond","\xB5s"),o(h,"nanosecond","ns");else{const p=d+f/1e3+h/1e6,y=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,$=p>=1?Math.round(p):Math.ceil(p),T=y?p.toFixed(y):$;o(Number.parseFloat(T),"millisecond","ms",T)}}else{const u=(n?Number(t%jQ):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=s(u,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 l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),r+i.join(l)}const UQ=(t,e)=>{t.failed&&Bl({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})},BQ=(t,e)=>{Mv(e)&&(UQ(t,e),qQ(t,e))},qQ=(t,e)=>{const n=`(done in ${YI(t.durationMs)})`;Bl({type:"duration",verboseMessage:n,verboseInfo:e,result:t})},Sw=(t,e,{reject:n})=>{if(BQ(t,e),t.failed&&n)throw t;return t},WQ=(t,e)=>oa(t)?"asyncGenerator":eP(t)?"generator":kw(t)?"fileUrl":YQ(t)?"filePath":QQ(t)?"webStream":Ks(t,{checkOpen:!1})?"native":ir(t)?"uint8Array":ZQ(t)?"asyncIterable":eZ(t)?"iterable":Cw(t)?XI({transform:t},e):VQ(t)?GQ(t,e):"native",GQ=(t,e)=>PI(t.transform,{checkOpen:!1})?zQ(t,e):Cw(t.transform)?XI(t,e):HQ(t,e),zQ=(t,e)=>(JI(t,e,"Duplex stream"),"duplex"),XI=(t,e)=>(JI(t,e,"web TransformStream"),"webTransform"),JI=({final:t,binary:e,objectMode:n},r,i)=>{QI(t,`${r}.final`,i),QI(e,`${r}.binary`,i),$w(n,`${r}.objectMode`)},QI=(t,e,n)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${n}.`)},HQ=({transform:t,final:e,binary:n,objectMode:r},i)=>{if(t!==void 0&&!ZI(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(PI(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(Cw(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!ZI(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return $w(n,`${i}.binary`),$w(r,`${i}.objectMode`),oa(t)||oa(e)?"asyncGenerator":"generator"},$w=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},ZI=t=>oa(t)||eP(t),oa=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",eP=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",VQ=t=>Wn(t)&&(t.transform!==void 0||t.final!==void 0),kw=t=>Object.prototype.toString.call(t)==="[object URL]",KQ=t=>kw(t)&&t.protocol!=="file:",YQ=t=>Wn(t)&&Object.keys(t).length===1&&tP(t.file),tP=t=>typeof t=="string",XQ=(t,e)=>t==="native"&&typeof e=="string"&&!JQ.has(e),JQ=new Set(["ipc","ignore","inherit","overlapped","pipe"]),nP=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",_w=t=>Object.prototype.toString.call(t)==="[object WritableStream]",QQ=t=>nP(t)||_w(t),Cw=t=>nP(t?.readable)&&_w(t?.writable),ZQ=t=>rP(t)&&typeof t[Symbol.asyncIterator]=="function",eZ=t=>rP(t)&&typeof t[Symbol.iterator]=="function",rP=t=>typeof t=="object"&&t!==null,Xs=new Set(["generator","asyncGenerator","duplex","webTransform"]),iP=new Set(["fileUrl","filePath","fileNumber"]),sP=new Set(["fileUrl","filePath"]),tZ=new Set([...sP,"webStream","nodeStream"]),nZ=new Set(["webTransform","duplex"]),Yh={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"},oP=(t,e,n,r)=>r==="output"?rZ(t,e,n):iZ(t,e,n),rZ=(t,e,n)=>{const r=e!==0&&n[e-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:t??r}},iZ=(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}},sZ=(t,e)=>{const n=t.findLast(({type:r})=>Xs.has(r));return n===void 0?!1:e==="input"?n.value.writableObjectMode:n.value.readableObjectMode},oZ=(t,e,n,r)=>[...t.filter(({type:i})=>!Xs.has(i)),...aZ(t,e,n,r)],aZ=(t,e,n,{encoding:r})=>{const i=t.filter(({type:o})=>Xs.has(o)),s=Array.from({length:i.length});for(const[o,a]of Object.entries(i))s[o]=cZ({stdioItem:a,index:Number(o),newTransforms:s,optionName:e,direction:n,encoding:r});return fZ(s,n)},cZ=({stdioItem:t,stdioItem:{type:e},index:n,newTransforms:r,optionName:i,direction:s,encoding:o})=>e==="duplex"?lZ({stdioItem:t,optionName:i}):e==="webTransform"?uZ({stdioItem:t,index:n,newTransforms:r,direction:s}):dZ({stdioItem:t,index:n,newTransforms:r,direction:s,encoding:o}),lZ=({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}}},uZ=({stdioItem:t,stdioItem:{value:e},index:n,newTransforms:r,direction:i})=>{const{transform:s,objectMode:o}=Wn(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=oP(o,n,r,i);return{...t,value:{transform:s,writableObjectMode:a,readableObjectMode:c}}},dZ=({stdioItem:t,stdioItem:{value:e},index:n,newTransforms:r,direction:i,encoding:s})=>{const{transform:o,final:a,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=Wn(e)?e:{transform:e},d=c||Vs.has(s),{writableObjectMode:f,readableObjectMode:h}=oP(u,n,r,i);return{...t,value:{transform:o,final:a,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:h}}},fZ=(t,e)=>e==="input"?t.reverse():t,hZ=(t,e,n)=>{const r=t.map(i=>pZ(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)??yZ},pZ=({type:t,value:e},n)=>gZ[n]??aP[t](e),gZ=["input","output","output"],aa=()=>{},Aw=()=>"input",aP={generator:aa,asyncGenerator:aa,fileUrl:aa,filePath:aa,iterable:Aw,asyncIterable:Aw,uint8Array:Aw,webStream:t=>_w(t)?"output":"input",nodeStream(t){return Hh(t,{checkOpen:!1})?II(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:aa,duplex:aa,native(t){const e=mZ(t);if(e!==void 0)return e;if(Ks(t,{checkOpen:!1}))return aP.nodeStream(t)}},mZ=t=>{if([0,We.stdin].includes(t))return"input";if([1,2,We.stdout,We.stderr].includes(t))return"output"},yZ="output",vZ=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t,wZ=({stdio:t,ipc:e,buffer:n,...r},i,s)=>{const o=bZ(t,r).map((a,c)=>cP(a,c));return s?EZ(o,n,i):vZ(o,e)},bZ=(t,e)=>{if(t===void 0)return Cr.map(r=>e[r]);if(TZ(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Cr.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,Cr.length);return Array.from({length:n},(r,i)=>t[i])},TZ=t=>Cr.some(e=>t[e]!==void 0),cP=(t,e)=>Array.isArray(t)?t.map(n=>cP(n,e)):t??(e>=Cr.length?"ignore":"pipe"),EZ=(t,e,n)=>t.map((r,i)=>!e[i]&&i!==0&&!Fv(n,i)&&RZ(r)?"ignore":r),RZ=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe"),SZ=({stdioItem:t,stdioItem:{type:e},isStdioArray:n,fdNumber:r,direction:i,isSync:s})=>!n||e!=="native"?t:s?$Z({stdioItem:t,fdNumber:r,direction:i}):CZ({stdioItem:t,fdNumber:r}),$Z=({stdioItem:t,stdioItem:{value:e,optionName:n},fdNumber:r,direction:i})=>{const s=kZ({value:e,optionName:n,fdNumber:r,direction:i});if(s!==void 0)return s;if(Ks(e,{checkOpen:!1}))throw new TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},kZ=({value:t,optionName:e,fdNumber:n,direction:r})=>{const i=_Z(t,n);if(i!==void 0){if(r==="output")return{type:"fileNumber",value:i,optionName:e};if(ab.isatty(i))throw new TypeError(`The \`${e}: ${lw(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:jl(op(i)),optionName:e}}},_Z=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;const n=Lv.indexOf(t);if(n!==-1)return n},CZ=({stdioItem:t,stdioItem:{value:e,optionName:n},fdNumber:r})=>e==="inherit"?{type:"nodeStream",value:lP(r,e,n),optionName:n}:typeof e=="number"?{type:"nodeStream",value:lP(e,e,n),optionName:n}:Ks(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:n}:t,lP=(t,e,n)=>{const r=Lv[t];if(r===void 0)throw new TypeError(`The \`${n}: ${e}\` option is invalid: no such standard stream.`);return r},AZ=({input:t,inputFile:e},n)=>n===0?[...IZ(t),...xZ(e)]:[],IZ=t=>t===void 0?[]:[{type:PZ(t),value:t,optionName:"input"}],PZ=t=>{if(Hh(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(ir(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},xZ=t=>t===void 0?[]:[{...NZ(t),optionName:"inputFile"}],NZ=t=>{if(kw(t))return{type:"fileUrl",value:t};if(tP(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")},OZ=t=>t.filter((e,n)=>t.every((r,i)=>e.value!==r.value||n>=i||e.type==="generator"||e.type==="asyncGenerator")),DZ=({stdioItem:{type:t,value:e,optionName:n},direction:r,fileDescriptors:i,isSync:s})=>{const o=LZ(i,t);if(o.length!==0){if(s){MZ({otherStdioItems:o,type:t,value:e,optionName:n,direction:r});return}if(tZ.has(t))return uP({otherStdioItems:o,type:t,value:e,optionName:n,direction:r});nZ.has(t)&&jZ({otherStdioItems:o,type:t,value:e,optionName:n})}},LZ=(t,e)=>t.flatMap(({direction:n,stdioItems:r})=>r.filter(i=>i.type===e).map(i=>({...i,direction:n}))),MZ=({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})=>{sP.has(e)&&uP({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})},uP=({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})=>{const s=t.filter(a=>FZ(a,n));if(s.length===0)return;const o=s.find(a=>a.direction!==i);return dP(o,r,e),i==="output"?s[0].stream:void 0},FZ=({type:t,value:e},n)=>t==="filePath"?e.file===n.file:t==="fileUrl"?e.href===n.href:e===n,jZ=({otherStdioItems:t,type:e,value:n,optionName:r})=>{const i=t.find(({value:{transform:s}})=>s===n.transform);dP(i,r,e)},dP=(t,e,n)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${Yh[n]} that is the same.`)},fP=(t,e,n,r)=>{const s=wZ(e,n,r).map((a,c)=>UZ({stdioOption:a,fdNumber:c,options:e,isSync:r})),o=KZ({initialFileDescriptors:s,addProperties:t,options:e,isSync:r});return e.stdio=o.map(({stdioItems:a})=>JZ(a)),o},UZ=({stdioOption:t,fdNumber:e,options:n,isSync:r})=>{const i=$A(e),{stdioItems:s,isStdioArray:o}=BZ({stdioOption:t,fdNumber:e,options:n,optionName:i}),a=hZ(s,e,i),c=s.map(d=>SZ({stdioItem:d,isStdioArray:o,fdNumber:e,direction:a,isSync:r})),l=oZ(c,i,a,n),u=sZ(l,a);return VZ(l,u),{direction:a,objectMode:u,stdioItems:l}},BZ=({stdioOption:t,fdNumber:e,options:n,optionName:r})=>{const s=[...(Array.isArray(t)?t:[t]).map(c=>qZ(c,r)),...AZ(n,e)],o=OZ(s),a=o.length>1;return WZ(o,a,r),zZ(o),{stdioItems:o,isStdioArray:a}},qZ=(t,e)=>({type:WQ(t,e),value:t,optionName:e}),WZ=(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(GZ.has(r))throw new Error(`The \`${i}\` option must not include \`${r}\`.`)}},GZ=new Set(["ignore","ipc"]),zZ=t=>{for(const e of t)HZ(e)},HZ=({type:t,value:e,optionName:n})=>{if(KQ(e))throw new TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
|
|
1203
|
-
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(XQ(t,e))throw new TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},VZ=(t,e)=>{if(!e)return;const n=t.find(({type:r})=>iP.has(r));if(n!==void 0)throw new TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},KZ=({initialFileDescriptors:t,addProperties:e,options:n,isSync:r})=>{const i=[];try{for(const s of t)i.push(YZ({fileDescriptor:s,fileDescriptors:i,addProperties:e,options:n,isSync:r}));return i}catch(s){throw hP(i),s}},YZ=({fileDescriptor:{direction:t,objectMode:e,stdioItems:n},fileDescriptors:r,addProperties:i,options:s,isSync:o})=>{const a=n.map(c=>XZ({stdioItem:c,addProperties:i,direction:t,options:s,fileDescriptors:r,isSync:o}));return{direction:t,objectMode:e,stdioItems:a}},XZ=({stdioItem:t,addProperties:e,direction:n,options:r,fileDescriptors:i,isSync:s})=>{const o=DZ({stdioItem:t,direction:n,fileDescriptors:i,isSync:s});return o!==void 0?{...t,stream:o}:{...t,...e[n][t.type](t,r)}},hP=t=>{for(const{stdioItems:e}of t)for(const{stream:n}of e)n!==void 0&&!zs(n)&&n.destroy()},JZ=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"},QZ=(t,e)=>fP(eee,t,e,!0),Ar=({type:t,optionName:e})=>{pP(e,Yh[t])},ZZ=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&pP(t,`"${e}"`),{}),pP=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},gP={generator(){},asyncGenerator:Ar,webStream:Ar,nodeStream:Ar,webTransform:Ar,duplex:Ar,asyncIterable:Ar,native:ZZ},eee={input:{...gP,fileUrl:({value:t})=>({contents:[jl(op(t))]}),filePath:({value:{file:t}})=>({contents:[jl(op(t))]}),fileNumber:Ar,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...gP,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t}})=>({path:t}),fileNumber:({value:t})=>({path:t}),iterable:Ar,string:Ar,uint8Array:Ar}},ca=(t,{stripFinalNewline:e},n)=>mP(e,n)&&t!==void 0&&!Array.isArray(t)?mw(t):t,mP=(t,e)=>e==="all"?t[1]||t[2]:t[e],yP=(t,e,n,r)=>t||n?void 0:bP(e,r),vP=(t,e,n)=>n?t.flatMap(r=>wP(r,e)):wP(t,e),wP=(t,e)=>{const{transform:n,final:r}=bP(e,{});return[...n(t),...r()]},bP=(t,e)=>(e.previousChunks="",{transform:tee.bind(void 0,e,t),final:ree.bind(void 0,e)}),tee=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]===`
|
|
1204
|
-
`){const o=nee(n,s,e,t);let a=n.slice(i+1,s+1-o);r.length>0&&(a=Iw(r,a),r=""),yield a,i=s}i!==n.length-1&&(r=Iw(r,n.slice(i+1))),t.previousChunks=r},nee=(t,e,n,r)=>n?0:(r.isWindowsNewline=e!==0&&t[e-1]==="\r",r.isWindowsNewline?2:1),ree=function*({previousChunks:t}){t.length>0&&(yield t)},iee=({binary:t,preserveNewlines:e,readableObjectMode:n,state:r})=>t||e||n?void 0:{transform:see.bind(void 0,r)},see=function*({isWindowsNewline:t=!1},e){const{unixNewline:n,windowsNewline:r,LF:i,concatBytes:s}=typeof e=="string"?oee:cee;if(e.at(-1)===i){yield e;return}yield s(e,t?r:n)},Iw=(t,e)=>`${t}${e}`,oee={windowsNewline:`\r
|
|
1205
|
-
`,unixNewline:`
|
|
1206
|
-
`,LF:`
|
|
1207
|
-
`,concatBytes:Iw},aee=(t,e)=>{const n=new Uint8Array(t.length+e.length);return n.set(t,0),n.set(e,t.length),n},cee={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:aee},lee=(t,e)=>t?void 0:uee.bind(void 0,e),uee=function*(t,e){if(typeof e!="string"&&!ir(e)&&!lp.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},dee=(t,e)=>t?fee.bind(void 0,e):hee.bind(void 0,e),fee=function*(t,e){TP(t,e),yield e},hee=function*(t,e){if(TP(t,e),typeof e!="string"&&!ir(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},TP=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
|
|
1208
|
-
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
1209
|
-
if (condition) { yield value; }`)},EP=(t,e,n)=>{if(n)return;if(t)return{transform:pee.bind(void 0,new TextEncoder)};const r=new nb(e);return{transform:gee.bind(void 0,r),final:mee.bind(void 0,r)}},pee=function*(t,e){lp.isBuffer(e)?yield jl(e):typeof e=="string"?yield t.encode(e):yield e},gee=function*(t,e){yield ir(e)?t.write(e):e},mee=function*(t){const e=t.end();e!==""&&(yield e)},RP=Zs(async(t,e,n,r)=>{e.currentIterable=t(...n);try{for await(const i of e.currentIterable)r.push(i)}finally{delete e.currentIterable}}),Pw=async function*(t,e,n){if(n===e.length){yield t;return}const{transform:r=bee}=e[n];for await(const i of r(t))yield*Pw(i,e,n+1)},yee=async function*(t){for(const[e,{final:n}]of Object.entries(t))yield*vee(n,Number(e),t)},vee=async function*(t,e,n){if(t!==void 0)for await(const r of t())yield*Pw(r,n,e+1)},wee=Zs(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),bee=function*(t){yield t},SP=(t,e,n,r)=>{try{for(const i of t(...e))n.push(i);r()}catch(i){r(i)}},Tee=(t,e)=>[...e.flatMap(n=>[...Hl(n,t,0)]),...xw(t)],Hl=function*(t,e,n){if(n===e.length){yield t;return}const{transform:r=Ree}=e[n];for(const i of r(t))yield*Hl(i,e,n+1)},xw=function*(t){for(const[e,{final:n}]of Object.entries(t))yield*Eee(n,Number(e),t)},Eee=function*(t,e,n){if(t!==void 0)for(const r of t())yield*Hl(r,n,e+1)},Ree=function*(t){yield t},$P=({value:t,value:{transform:e,final:n,writableObjectMode:r,readableObjectMode:i},optionName:s},{encoding:o})=>{const a={},c=_P(t,o,s),l=oa(e),u=oa(n),d=l?RP.bind(void 0,Pw,a):SP.bind(void 0,Hl),f=l||u?RP.bind(void 0,yee,a):SP.bind(void 0,xw),h=l||u?wee.bind(void 0,a):void 0;return{stream:new nN({writableObjectMode:r,writableHighWaterMark:eu(r),readableObjectMode:i,readableHighWaterMark:eu(i),transform(y,$,T){d([y,c,0],this,T)},flush(y){f([c],this,y)},destroy:h})}},kP=(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=_P(o,n,a);t=Tee(c,t)}return t},_P=({transform:t,final:e,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:s},o,a)=>{const c={};return[{transform:lee(r,a)},EP(n,o,r),yP(n,s,r,c),{transform:t,final:e},{transform:dee(i,a)},iee({binary:n,preserveNewlines:s,readableObjectMode:i,state:c})].filter(Boolean)},See=(t,e)=>{for(const n of $ee(t))kee(t,n,e)},$ee=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),kee=(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 ${Yh[a]} with synchronous methods.`)}const o=i.map(({contents:a})=>a).map(a=>_ee(a,r));n.input=Dv(o)},_ee=(t,e)=>{const n=kP(t,e,"utf8",!0);return Cee(n),Dv(n)},Cee=t=>{const e=t.find(n=>typeof n!="string"&&!ir(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}.`)},CP=({stdioItems:t,encoding:e,verboseInfo:n,fdNumber:r})=>r!=="all"&&Fv(n,r)&&!Vs.has(e)&&Aee(r)&&(t.some(({type:i,value:s})=>i==="native"&&Iee.has(s))||t.every(({type:i})=>Xs.has(i))),Aee=t=>t===1||t===2,Iee=new Set(["pipe","overlapped"]),Pee=async(t,e,n,r)=>{for await(const i of t)Nee(e)||AP(i,n,r)},xee=(t,e,n)=>{for(const r of t)AP(r,e,n)},Nee=t=>t._readableState.pipes.length>0,AP=(t,e,n)=>{const r=OA(t);Bl({type:"output",verboseMessage:r,fdNumber:e,verboseInfo:n})},Oee=({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,l)=>Dee({result:c,fileDescriptors:t,fdNumber:l,state:s,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n)),...s}},Dee=({result:t,fileDescriptors:e,fdNumber:n,state:r,outputFiles:i,isMaxBuffer:s,verboseInfo:o},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;const f=SQ(t,s,d),h=jl(f),{stdioItems:p,objectMode:y}=e[n],$=Lee([h],p,c,r),{serializedResult:T,finalResult:w=T}=Mee({chunks:$,objectMode:y,encoding:c,lines:l,stripFinalNewline:u,fdNumber:n});Fee({serializedResult:T,fdNumber:n,state:r,verboseInfo:o,encoding:c,stdioItems:p,objectMode:y});const b=a[n]?w:void 0;try{return r.error===void 0&&jee(T,p,i),b}catch(_){return r.error=_,b}},Lee=(t,e,n,r)=>{try{return kP(t,e,n,!1)}catch(i){return r.error=i,t}},Mee=({chunks:t,objectMode:e,encoding:n,lines:r,stripFinalNewline:i,fdNumber:s})=>{if(e)return{serializedResult:t};if(n==="buffer")return{serializedResult:Dv(t)};const o=mK(t,n);return r[s]?{serializedResult:o,finalResult:vP(o,!i[s],e)}:{serializedResult:o}},Fee=({serializedResult:t,fdNumber:e,state:n,verboseInfo:r,encoding:i,stdioItems:s,objectMode:o})=>{if(!CP({stdioItems:s,encoding:i,verboseInfo:r,fdNumber:e}))return;const a=vP(t,!1,o);try{xee(a,e,r)}catch(c){n.error??=c}},jee=(t,e,n)=>{for(const{path:r}of e.filter(({type:i})=>iP.has(i))){const i=typeof r=="string"?r:r.toString();n.has(i)?Jx(r,t):(n.add(i),ib(r,t))}},Uee=([,t,e],n)=>{if(n.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,ca(e,n,"all")]:Array.isArray(e)?[ca(t,n,"all"),...e]:ir(t)&&ir(e)?TA([t,e]):`${t}${e}`},Bee=async(t,e)=>{const[n,r]=await qee(t);return e.isForcefullyTerminated??=!1,[n,r]},qee=async t=>{const[e,n]=await Promise.allSettled([nn(t,"spawn"),nn(t,"exit")]);return e.status==="rejected"?[]:n.status==="rejected"?IP(t):n.value},IP=async t=>{try{return await nn(t,"exit")}catch{return IP(t)}},Wee=async t=>{const[e,n]=await t;if(!Gee(e,n)&&PP(e,n))throw new ql;return[e,n]},Gee=(t,e)=>t===void 0&&e===void 0,PP=(t,e)=>t!==0||e!==null,zee=({error:t,status:e,signal:n,output:r},{maxBuffer:i})=>{const s=Hee(t,e,n),o=s?.code==="ETIMEDOUT",a=RQ(s,r,i);return{resultError:s,exitCode:e,signal:n,timedOut:o,isMaxBuffer:a}},Hee=(t,e,n)=>t!==void 0?t:PP(e,n)?new ql:void 0,Vee=(t,e,n)=>{const{file:r,commandArguments:i,command:s,escapedCommand:o,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=Kee(t,e,n),d=Jee({file:r,commandArguments:i,options:l,command:s,escapedCommand:o,verboseInfo:c,fileDescriptors:u,startTime:a});return Sw(d,c,l)},Kee=(t,e,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:o}=MA(t,e,n),a=Yee(n),{file:c,commandArguments:l,options:u}=_I(t,e,a);Xee(u);const d=QZ(u,o);return{file:c,commandArguments:l,command:r,escapedCommand:i,startTime:s,verboseInfo:o,options:u,fileDescriptors:d}},Yee=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,Xee=({ipc:t,ipcInput:e,detached:n,cancelSignal:r})=>{e&&Xh("ipcInput"),t&&Xh("ipc: true"),n&&Xh("detached: true"),r&&Xh("cancelSignal")},Xh=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},Jee=({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,verboseInfo:s,fileDescriptors:o,startTime:a})=>{const c=Qee({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,fileDescriptors:o,startTime:a});if(c.failed)return c;const{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:h}=zee(c,n),{output:p,error:y=l}=Oee({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:h,verboseInfo:s}),$=p.map((w,b)=>ca(w,n,b)),T=ca(Uee(p,n),n,"all");return ete({error:y,exitCode:u,signal:d,timedOut:f,isMaxBuffer:h,stdio:$,all:T,options:n,command:r,escapedCommand:i,startTime:a})},Qee=({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,fileDescriptors:s,startTime:o})=>{try{See(s,n);const a=Zee(n);return zx(t,e,a)}catch(a){return Ew({error:a,command:r,escapedCommand:i,fileDescriptors:s,options:n,startTime:o,isSync:!0})}},Zee=({encoding:t,maxBuffer:e,...n})=>({...n,encoding:"buffer",maxBuffer:Tw(e)}),ete=({error:t,exitCode:e,signal:n,timedOut:r,isMaxBuffer:i,stdio:s,all:o,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?HI({command:c,escapedCommand:l,stdio:s,all:o,ipcOutput:[],options:a,startTime:u}):Rw({error:t,command:c,escapedCommand:l,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:n,stdio:s,all:o,ipcOutput:[],options:a,startTime:u,isSync:!0}),tte=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},{reference:i=!0,filter:s}={})=>(ow({methodName:"getOneMessage",isSubprocess:n,ipc:r,isConnected:vI(t)}),nte({anyProcess:t,channel:e,isSubprocess:n,filter:s,reference:i})),nte=async({anyProcess:t,channel:e,isSubprocess:n,filter:r,reference:i})=>{mI(e,i);const s=Bh(t,e,n),o=new AbortController;try{return await Promise.race([rte(s,r,o),ite(s,n,o),ste(s,n,o)])}catch(a){throw aw(t),a}finally{o.abort(),yI(e,i)}},rte=async(t,e,{signal:n})=>{if(e===void 0){const[r]=await nn(t,"message",{signal:n});return r}for await(const[r]of Zl(t,"message",{signal:n}))if(e(r))return r},ite=async(t,e,{signal:n})=>{await nn(t,"disconnect",{signal:n}),NX(e)},ste=async(t,e,{signal:n})=>{const[r]=await nn(t,"strict:error",{signal:n});throw dI(r,e)},ote=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},{reference:i=!0}={})=>xP({anyProcess:t,channel:e,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),xP=({anyProcess:t,channel:e,isSubprocess:n,ipc:r,shouldAwait:i,reference:s})=>{ow({methodName:"getEachMessage",isSubprocess:n,ipc:r,isConnected:vI(t)}),mI(e,s);const o=Bh(t,e,n),a=new AbortController,c={};return ate(t,o,a),cte({ipcEmitter:o,isSubprocess:n,controller:a,state:c}),lte({anyProcess:t,channel:e,ipcEmitter:o,isSubprocess:n,shouldAwait:i,controller:a,state:c,reference:s})},ate=async(t,e,n)=>{try{await nn(e,"disconnect",{signal:n.signal}),n.abort()}catch{}},cte=async({ipcEmitter:t,isSubprocess:e,controller:n,state:r})=>{try{const[i]=await nn(t,"strict:error",{signal:n.signal});r.error=dI(i,e),n.abort()}catch{}},lte=async function*({anyProcess:t,channel:e,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:s,state:o,reference:a}){try{for await(const[c]of Zl(n,"message",{signal:s.signal}))NP(o),yield c}catch{NP(o)}finally{s.abort(),yI(e,a),r||aw(t),i&&await t}},NP=({error:t})=>{if(t)throw t},ute=(t,{ipc:e})=>{Object.assign(t,OP(t,!1,e))},dte=()=>{const t=We,e=!0,n=We.channel!==void 0;return{...OP(t,e,n),getCancelSignal:hJ.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n})}},OP=(t,e,n)=>({sendMessage:bI.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n}),getOneMessage:tte.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n}),getEachMessage:ote.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n})}),fte=({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,verboseInfo:o})=>{hP(r);const a=new tb;hte(a,r),Object.assign(a,{readable:pte,writable:gte,duplex:mte});const c=Ew({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:!1}),l=yte(c,o,i);return{subprocess:a,promise:l}},hte=(t,e)=>{const n=Vl(),r=Vl(),i=Vl(),s=Array.from({length:e.length-3},Vl),o=Vl(),a=[n,r,i,...s];Object.assign(t,{stdin:n,stdout:r,stderr:i,all:o,stdio:a})},Vl=()=>{const t=new fb;return t.end(),t},pte=()=>new hs({read(){}}),gte=()=>new ap({write(){}}),mte=()=>new cp({read(){},write(){}}),yte=async(t,e,n)=>Sw(t,e,n),vte=(t,e)=>fP(wte,t,e,!1),Kl=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${Yh[t]}.`)},DP={fileNumber:Kl,generator:$P,asyncGenerator:$P,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:n}}){const r=e||n;return{stream:cp.fromWeb(t,{objectMode:r})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},wte={input:{...DP,fileUrl:({value:t})=>({stream:sb(t)}),filePath:({value:{file:t}})=>({stream:sb(t)}),webStream:({value:t})=>({stream:hs.fromWeb(t)}),iterable:({value:t})=>({stream:hs.from(t)}),asyncIterable:({value:t})=>({stream:hs.from(t)}),string:({value:t})=>({stream:hs.from(t)}),uint8Array:({value:t})=>({stream:hs.from(lp.from(t))})},output:{...DP,fileUrl:({value:t})=>({stream:ob(t)}),filePath:({value:{file:t}})=>({stream:ob(t)}),webStream:({value:t})=>({stream:ap.fromWeb(t)}),iterable:Kl,asyncIterable:Kl,string:Kl,uint8Array:Kl}};function Nw(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(const i of t)Ow(i);const e=t.some(({readableObjectMode:i})=>i),n=bte(t,e),r=new Tte({objectMode:e,writableHighWaterMark:n,readableHighWaterMark:n});for(const i of t)r.add(i);return r}const bte=(t,e)=>{if(t.length===0)return eu(e);const n=t.filter(({readableObjectMode:r})=>r===e).map(({readableHighWaterMark:r})=>r);return Math.max(...n)};class Tte extends fb{#e=new Set([]);#t=new Set([]);#n=new Set([]);#r;#i=Symbol("unpipe");#s=new WeakMap;add(e){if(Ow(e),this.#e.has(e))return;this.#e.add(e),this.#r??=Ete(this,this.#e,this.#i);const n=$te({passThroughStream:this,stream:e,streams:this.#e,ended:this.#t,aborted:this.#n,onFinished:this.#r,unpipeEvent:this.#i});this.#s.set(e,n),e.pipe(this,{end:!1})}async remove(e){if(Ow(e),!this.#e.has(e))return!1;const n=this.#s.get(e);return n===void 0?!1:(this.#s.delete(e),e.unpipe(this),await n,!0)}}const Ete=async(t,e,n)=>{Jh(t,jP);const r=new AbortController;try{await Promise.race([Rte(t,r),Ste(t,e,n,r)])}finally{r.abort(),Jh(t,-jP)}},Rte=async(t,{signal:e})=>{try{await vi(t,{signal:e,cleanup:!0})}catch(n){throw LP(t,n),n}},Ste=async(t,e,n,{signal:r})=>{for await(const[i]of Zl(t,"unpipe",{signal:r}))e.has(i)&&i.emit(n)},Ow=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},$te=async({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,onFinished:s,unpipeEvent:o})=>{Jh(t,UP);const a=new AbortController;try{await Promise.race([kte(s,e,a),_te({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,controller:a}),Cte({stream:e,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:a})])}finally{a.abort(),Jh(t,-UP)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?Dw(t):Ate(t))},kte=async(t,e,{signal:n})=>{try{await t,n.aborted||Dw(e)}catch(r){n.aborted||LP(e,r)}},_te=async({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,controller:{signal:s}})=>{try{await vi(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),n.has(e)&&r.add(e)}catch(o){if(s.aborted||!n.has(e))return;MP(o)?i.add(e):FP(t,o)}},Cte=async({stream:t,streams:e,ended:n,aborted:r,unpipeEvent:i,controller:{signal:s}})=>{if(await nn(t,i,{signal:s}),!t.readable)return nn(s,"abort",{signal:s});e.delete(t),n.delete(t),r.delete(t)},Ate=t=>{t.writable&&t.end()},LP=(t,e)=>{MP(e)?Dw(t):FP(t,e)},MP=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",Dw=t=>{(t.readable||t.writable)&&t.destroy()},FP=(t,e)=>{t.destroyed||(t.once("error",Ite),t.destroy(e))},Ite=()=>{},Jh=(t,e)=>{const n=t.getMaxListeners();n!==0&&n!==Number.POSITIVE_INFINITY&&t.setMaxListeners(n+e)},jP=2,UP=1,Qh=(t,e)=>{t.pipe(e),Pte(t,e),xte(t,e)},Pte=async(t,e)=>{if(!(zs(t)||zs(e))){try{await vi(t,{cleanup:!0,readable:!0,writable:!1})}catch{}BP(e)}},BP=t=>{t.writable&&t.end()},xte=async(t,e)=>{if(!(zs(t)||zs(e))){try{await vi(e,{cleanup:!0,readable:!1,writable:!0})}catch{}qP(t)}},qP=t=>{t.readable&&t.destroy()},Nte=(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})=>Xs.has(c)))Ote(t,a,o,i);for(const{stream:a}of s.filter(({type:c})=>!Xs.has(c)))Lte({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]:Nw(s);Qh(o,i)}},Ote=(t,e,n,r)=>{n==="output"?Qh(t.stdio[r],e):Qh(e,t.stdio[r]);const i=Dte[r];i!==void 0&&(t[i]=e),t.stdio[r]=e},Dte=["stdin","stdout","stderr"],Lte=({subprocess:t,stream:e,direction:n,fdNumber:r,pipeGroups:i,controller:s})=>{if(e===void 0)return;Mte(e,s);const[o,a]=n==="output"?[e,t.stdio[r]]:[t.stdio[r],e],c=i.get(o)??[];i.set(o,[...c,a])},Mte=(t,{signal:e})=>{zs(t)&&jh(t,Fte,e)},Fte=2,la=[];la.push("SIGHUP","SIGINT","SIGTERM"),process.platform!=="win32"&&la.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&la.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const Zh=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",Lw=Symbol.for("signal-exit emitter"),Mw=globalThis,jte=Object.defineProperty.bind(Object);class Ute{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Mw[Lw])return Mw[Lw];jte(Mw,Lw,{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 WP{}const Bte=t=>({onExit(e,n){return t.onExit(e,n)},load(){return t.load()},unload(){return t.unload()}});class qte extends WP{onExit(){return()=>{}}load(){}unload(){}}class Wte extends WP{#e=Fw.platform==="win32"?"SIGINT":"SIGHUP";#t=new Ute;#n;#r;#i;#s={};#o=!1;constructor(e){super(),this.#n=e,this.#s={};for(const n of la)this.#s[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.#i=e.reallyExit,this.#r=e.emit}onExit(e,n){if(!Zh(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 la)try{const n=this.#s[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,la.forEach(e=>{const n=this.#s[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.#i,this.#t.count-=1)}#a(e){return Zh(this.#n)?(this.#n.exitCode=e||0,this.#t.emit("exit",this.#n.exitCode,null),this.#i.call(this.#n,this.#n.exitCode)):0}#c(e,...n){const r=this.#r;if(e==="exit"&&Zh(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 Fw=globalThis.process,{onExit:Gte,load:kie,unload:_ie}=Bte(Zh(Fw)?new Wte(Fw):new qte),zte=(t,{cleanup:e,detached:n},{signal:r})=>{if(!e||n)return;const i=Gte(()=>{t.kill()});db(r,()=>{i()})},Hte=({source:t,sourcePromise:e,boundOptions:n,createNested:r},...i)=>{const s=DA(),{destination:o,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=Vte(n,r,i),{sourceStream:d,sourceError:f}=Yte(t,l),{options:h,fileDescriptors:p}=Hs.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:h,sourceError:f,destination:o,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:p,startTime:s}},Vte=(t,e,n)=>{try{const{destination:r,pipeOptions:{from:i,to:s,unpipeSignal:o}={}}=Kte(t,e,...n),a=fI(r,s);return{destination:r,destinationStream:a,from:i,unpipeSignal:o}}catch(r){return{destinationError:r}}},Kte=(t,e,n,...r)=>{if(Array.isArray(n))return{destination:e(GP,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]=yA(n,...r);return{destination:e(GP)(i,s,o),pipeOptions:o}}if(Hs.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}`)},GP=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),Yte=(t,e)=>{try{return{sourceStream:cw(t,e)}}catch(n){return{sourceError:n}}},Xte=({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:s,startTime:o})=>{const a=Jte({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r});if(a!==void 0)throw zP({error:a,fileDescriptors:i,sourceOptions:s,startTime:o})},Jte=({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r})=>{if(e!==void 0&&r!==void 0)return r;if(r!==void 0)return qP(t),r;if(e!==void 0)return BP(n),e},zP=({error:t,fileDescriptors:e,sourceOptions:n,startTime:r})=>Ew({error:t,command:HP,escapedCommand:HP,fileDescriptors:e,options:n,startTime:r,isSync:!1}),HP="source.pipe(destination)",Qte=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},Zte=(t,e,n)=>{const r=ep.has(e)?tne(t,e):ene(t,e);return jh(t,rne,n.signal),jh(e,ine,n.signal),nne(e),r},ene=(t,e)=>{const n=Nw([t]);return Qh(n,e),ep.set(e,n),n},tne=(t,e)=>{const n=ep.get(e);return n.add(t),n},nne=async t=>{try{await vi(t,{cleanup:!0,readable:!1,writable:!0})}catch{}ep.delete(t)},ep=new WeakMap,rne=2,ine=1,sne=(t,e)=>t===void 0?[]:[one(t,e)],one=async(t,{sourceStream:e,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:s})=>{await Wx(t,e),await n.remove(e);const o=new Error("Pipe canceled by `unpipeSignal` option.");throw zP({error:o,fileDescriptors:r,sourceOptions:i,startTime:s})},jw=(t,...e)=>{if(Wn(e[0]))return jw.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});const{destination:n,...r}=Hte(t,...e),i=ane({...r,destination:n});return i.pipe=jw.bind(void 0,{...t,source:n,sourcePromise:i,boundOptions:{}}),i},ane=async({sourcePromise:t,sourceStream:e,sourceOptions:n,sourceError:r,destination:i,destinationStream:s,destinationError:o,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{const u=cne(t,i);Xte({sourceStream:e,sourceError:r,destinationStream:s,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:l});const d=new AbortController;try{const f=Zte(e,s,d);return await Promise.race([Qte(u),...sne(a,{sourceStream:e,mergedStream:f,sourceOptions:n,fileDescriptors:c,startTime:l})])}finally{d.abort()}},cne=(t,e)=>Promise.allSettled([t,e]),VP=({subprocessStdout:t,subprocess:e,binary:n,shouldEncode:r,encoding:i,preserveNewlines:s})=>{const o=new AbortController;return lne(e,o),YP({stream:t,controller:o,binary:n,shouldEncode:!t.readableObjectMode&&r,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},lne=async(t,e)=>{try{await t}catch{}finally{e.abort()}},KP=({stream:t,onStreamEnd:e,lines:n,encoding:r,stripFinalNewline:i,allMixed:s})=>{const o=new AbortController;une(e,o,t);const a=t.readableObjectMode&&!s;return YP({stream:t,controller:o,binary:r==="buffer",shouldEncode:!a,encoding:r,shouldSplit:!a&&n,preserveNewlines:!i})},une=async(t,e,n)=>{try{await t}catch{n.destroy()}finally{e.abort()}},YP=({stream:t,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o})=>{const a=Zl(t,"data",{signal:e.signal,highWaterMark:JP,highWatermark:JP});return dne({onStdoutChunk:a,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o})},XP=eu(!0),JP=XP,dne=async function*({onStdoutChunk:t,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o}){const a=fne({binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o});try{for await(const[c]of t)yield*Hl(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*xw(a)}},fne=({binary:t,shouldEncode:e,encoding:n,shouldSplit:r,preserveNewlines:i})=>[EP(t,n,!e),yP(t,i,!r,{})].filter(Boolean),hne=async({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,buffer:i,maxBuffer:s,lines:o,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{const d=pne({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([gne(t),d]);return}const f=mP(c,n),h=KP({stream:t,onStreamEnd:e,lines:o,encoding:r,stripFinalNewline:f,allMixed:a}),[p]=await Promise.all([mne({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(!CP({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:s,fdNumber:n}))return;const a=KP({stream:t,onStreamEnd:e,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i});await Pee(a,t,n,s)},gne=async t=>{await Qx(),t.readableFlowing===null&&t.resume()},mne=async({stream:t,stream:{readableObjectMode:e},iterable:n,fdNumber:r,encoding:i,maxBuffer:s,lines:o})=>{try{return e||o?await JJ(n,{maxBuffer:s}):i==="buffer"?new Uint8Array(await nQ(n,{maxBuffer:s})):await fQ(n,{maxBuffer:s})}catch(a){return ZP(vQ({error:a,stream:t,readableObjectMode:e,lines:o,encoding:i,fdNumber:r}))}},QP=async t=>{try{return await t}catch(e){return ZP(e)}},ZP=({bufferedData:t})=>hK(t)?new Uint8Array(t):t,Uw=async(t,e,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{const s=yne(t,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],vi(t,{cleanup:!0,signal:o.signal})])}catch(a){s.stdinCleanedUp||bne(a,e,n,r)}finally{o.abort()}},yne=(t,{originalStreams:[e],subprocess:n})=>{const r={stdinCleanedUp:!1};return t===e&&vne(t,n,r),r},vne=(t,e,n)=>{const{_destroy:r}=t;t._destroy=(...i)=>{wne(e,n),r.call(t,...i)}},wne=({exitCode:t,signalCode:e},n)=>{(t!==null||e!==null)&&(n.stdinCleanedUp=!0)},bne=(t,e,n,r)=>{if(!Tne(t,e,n,r))throw t},Tne=(t,e,n,r=!0)=>n.propagating?tx(t)||Bw(t):(n.propagating=!0,ex(n,e)===r?tx(t):Bw(t)),ex=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",Bw=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",tx=t=>t?.code==="EPIPE",Ene=({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>t.stdio.map((c,l)=>nx({stream:c,fdNumber:l,encoding:e,buffer:n[l],maxBuffer:r[l],lines:i[l],allMixed:!1,stripFinalNewline:s,verboseInfo:o,streamInfo:a})),nx=async({stream:t,fdNumber:e,encoding:n,buffer:r,maxBuffer:i,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;const u=Uw(t,e,l);if(ex(l,e)){await u;return}const[d]=await Promise.all([hne({stream:t,onStreamEnd:u,fdNumber:e,encoding:n,buffer:r,maxBuffer:i,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d},Rne=({stdout:t,stderr:e},{all:n})=>n&&(t||e)?Nw([t,e].filter(Boolean)):void 0,Sne=({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>nx({...$ne(t,n),fdNumber:"all",encoding:e,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:kne(t),stripFinalNewline:s,verboseInfo:o,streamInfo:a}),$ne=({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}},kne=({all:t,stdout:e,stderr:n})=>t&&e&&n&&e.readableObjectMode!==n.readableObjectMode,_ne=t=>Fv(t,"ipc"),Cne=(t,e)=>{const n=OA(t);Bl({type:"ipc",verboseMessage:n,fdNumber:"ipc",verboseInfo:e})},Ane=async({subprocess:t,buffer:e,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:s})=>{if(!r)return i;const o=_ne(s),a=Ul(e,"ipc"),c=Ul(n,"ipc");for await(const l of xP({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))a&&(bQ(t,i,c),i.push(l)),o&&Cne(l,s);return i},Ine=async(t,e)=>(await Promise.allSettled([t]),e),Pne=async({subprocess:t,options:{encoding:e,buffer:n,maxBuffer:r,lines:i,timeoutDuration:s,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:h,fileDescriptors:p,originalStreams:y,onInternalError:$,controller:T})=>{const w=Bee(t,f),b={originalStreams:y,fileDescriptors:p,subprocess:t,exitPromise:w,propagating:!1},_=Ene({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:h,streamInfo:b}),x=Sne({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:h,streamInfo:b}),F=[],P=Ane({subprocess:t,buffer:n,maxBuffer:r,ipc:u,ipcOutput:F,verboseInfo:h}),G=xne(y,t,b),B=Nne(p,b);try{return await Promise.race([Promise.all([{},Wee(w),Promise.all(_),x,P,AJ(t,d),...G,...B]),$,One(t,T),...TJ(t,s,f,T),...IX({subprocess:t,cancelSignal:o,gracefulCancel:a,context:f,controller:T}),...yJ({subprocess:t,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:T})])}catch(W){return f.terminationReason??="other",Promise.all([{error:W},w,Promise.all(_.map(I=>QP(I))),QP(x),Ine(P,F),Promise.allSettled(G),Promise.allSettled(B)])}},xne=(t,e,n)=>t.map((r,i)=>r===e.stdio[i]?void 0:Uw(r,i,n)),Nne=(t,e)=>t.flatMap(({stdioItems:n},r)=>n.filter(({value:i,stream:s=i})=>Ks(s,{checkOpen:!1})&&!zs(s)).map(({type:i,value:s,stream:o=s})=>Uw(o,r,e,{isSameDirection:Xs.has(i),stopOnExit:i==="native"}))),One=async(t,{signal:e})=>{const[n]=await nn(t,"error",{signal:e});throw n},Dne=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),qw=(t,e,n)=>{const r=t[n];r.has(e)||r.set(e,[]);const i=r.get(e),s=Wl();return i.push(s),{resolve:s.resolve.bind(s),promises:i}},tp=async({resolve:t,promises:e},n)=>{t();const[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...e])]);return!r},rx=async t=>{if(t!==void 0)try{await ix(t)}catch{}},Lne=async t=>{if(t!==void 0)try{await sx(t)}catch{}},ix=async t=>{await vi(t,{cleanup:!0,readable:!1,writable:!0})},sx=async t=>{await vi(t,{cleanup:!0,readable:!0,writable:!1})},ox=async(t,e)=>{if(await t,e)throw e},ax=(t,e,n)=>{n&&!Bw(n)?t.destroy(n):e&&t.destroy()},Mne=({subprocess:t,concurrentStreams:e,encoding:n},{from:r,binary:i=!0,preserveNewlines:s=!0}={})=>{const o=i||Vs.has(n),{subprocessStdout:a,waitReadableDestroy:c}=cx(t,r,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=lx(a,o),{read:f,onStdoutDataDone:h}=ux({subprocessStdout:a,subprocess:t,binary:o,encoding:n,preserveNewlines:s}),p=new hs({read:f,destroy:Zs(fx.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return dx({subprocessStdout:a,onStdoutDataDone:h,readable:p,subprocess:t}),p},cx=(t,e,n)=>{const r=cw(t,e),i=qw(n,r,"readableDestroy");return{subprocessStdout:r,waitReadableDestroy:i}},lx=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:n},r)=>r?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:n}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:XP},ux=({subprocessStdout:t,subprocess:e,binary:n,encoding:r,preserveNewlines:i})=>{const s=Wl(),o=VP({subprocessStdout:t,subprocess:e,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){Fne(this,o,s)},onStdoutDataDone:s}},Fne=async(t,e,n)=>{try{const{value:r,done:i}=await e.next();i?n.resolve():t.push(r)}catch{}},dx=async({subprocessStdout:t,onStdoutDataDone:e,readable:n,subprocess:r,subprocessStdin:i})=>{try{await sx(t),await r,await rx(i),await e,n.readable&&n.push(null)}catch(s){await rx(i),hx(n,s)}},fx=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:n},r)=>{await tp(n,e)&&(hx(t,r),await ox(e,r))},hx=(t,e)=>{ax(t,t.readable,e)},jne=({subprocess:t,concurrentStreams:e},{to:n}={})=>{const{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}=px(t,n,e),o=new ap({...gx(r,t,i),destroy:Zs(yx.bind(void 0,{subprocessStdin:r,subprocess:t,waitWritableFinal:i,waitWritableDestroy:s})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return mx(r,o),o},px=(t,e,n)=>{const r=fI(t,e),i=qw(n,r,"writableFinal"),s=qw(n,r,"writableDestroy");return{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}},gx=(t,e,n)=>({write:Une.bind(void 0,t),final:Zs(Bne.bind(void 0,t,e,n))}),Une=(t,e,n,r)=>{t.write(e,n)?r():t.once("drain",r)},Bne=async(t,e,n)=>{await tp(n,e)&&(t.writable&&t.end(),await e)},mx=async(t,e,n)=>{try{await ix(t),e.writable&&e.end()}catch(r){await Lne(n),vx(e,r)}},yx=async({subprocessStdin:t,subprocess:e,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await tp(n,e),await tp(r,e)&&(vx(t,i),await ox(e,i))},vx=(t,e)=>{ax(t,t.writable,e)},qne=({subprocess:t,concurrentStreams:e,encoding:n},{from:r,to:i,binary:s=!0,preserveNewlines:o=!0}={})=>{const a=s||Vs.has(n),{subprocessStdout:c,waitReadableDestroy:l}=cx(t,r,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=px(t,i,e),{readableEncoding:h,readableObjectMode:p,readableHighWaterMark:y}=lx(c,a),{read:$,onStdoutDataDone:T}=ux({subprocessStdout:c,subprocess:t,binary:a,encoding:n,preserveNewlines:o}),w=new cp({read:$,...gx(u,t,d),destroy:Zs(Wne.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:y,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:p,writableObjectMode:u.writableObjectMode,encoding:h});return dx({subprocessStdout:c,onStdoutDataDone:T,readable:w,subprocess:t,subprocessStdin:u}),mx(u,w,c),w},Wne=async({subprocessStdout:t,subprocessStdin:e,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:s},o)=>{await Promise.all([fx({subprocessStdout:t,subprocess:n,waitReadableDestroy:r},o),yx({subprocessStdin:e,subprocess:n,waitWritableFinal:i,waitWritableDestroy:s},o)])},wx=(t,e,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{const s=r||Vs.has(e),o=cw(t,n),a=VP({subprocessStdout:o,subprocess:t,binary:s,shouldEncode:!0,encoding:e,preserveNewlines:i});return Gne(a,o,t)},Gne=async function*(t,e,n){try{yield*t}finally{e.readable&&e.destroy(),await n}},zne=(t,{encoding:e})=>{const n=Dne();t.readable=Mne.bind(void 0,{subprocess:t,concurrentStreams:n,encoding:e}),t.writable=jne.bind(void 0,{subprocess:t,concurrentStreams:n}),t.duplex=qne.bind(void 0,{subprocess:t,concurrentStreams:n,encoding:e}),t.iterable=wx.bind(void 0,t,e),t[Symbol.asyncIterator]=wx.bind(void 0,t,e,{})},Hne=(t,e)=>{for(const[n,r]of Kne){const i=r.value.bind(e);Reflect.defineProperty(t,n,{...r,value:i})}},Vne=(async()=>{})().constructor.prototype,Kne=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(Vne,t)]),Yne=(t,e,n,r)=>{const{file:i,commandArguments:s,command:o,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=Xne(t,e,n),{subprocess:f,promise:h}=Qne({file:i,commandArguments:s,options:u,startTime:c,verboseInfo:l,command:o,escapedCommand:a,fileDescriptors:d});return f.pipe=jw.bind(void 0,{source:f,sourcePromise:h,boundOptions:{},createNested:r}),Hne(f,h),Hs.set(f,{options:u,fileDescriptors:d}),f},Xne=(t,e,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:o}=MA(t,e,n),{file:a,commandArguments:c,options:l}=_I(t,e,n),u=Jne(l),d=vte(u,o);return{file:a,commandArguments:c,command:r,escapedCommand:i,startTime:s,verboseInfo:o,options:u,fileDescriptors:d}},Jne=({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}},Qne=({file:t,commandArguments:e,options:n,startTime:r,verboseInfo:i,command:s,escapedCommand:o,fileDescriptors:a})=>{let c;try{c=Hx(t,e,n)}catch(p){return fte({error:p,command:s,escapedCommand:o,fileDescriptors:a,options:n,startTime:r,verboseInfo:i})}const l=new AbortController;eN(Number.POSITIVE_INFINITY,l.signal);const u=[...c.stdio];Nte(c,a,l),zte(c,n,l);const d={},f=Wl();c.kill=$X.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:f,context:d,controller:l}),c.all=Rne(c,n),zne(c,n),ute(c,n);const h=Zne({subprocess:c,options:n,startTime:r,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:s,escapedCommand:o,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:h}},Zne=async({subprocess:t,options:e,startTime:n,verboseInfo:r,fileDescriptors:i,originalStreams:s,command:o,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{const[d,[f,h],p,y,$]=await Pne({subprocess:t,options:e,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:s,onInternalError:l,controller:u});u.abort(),l.resolve();const T=p.map((_,x)=>ca(_,e,x)),w=ca(y,e,"all"),b=ere({errorInfo:d,exitCode:f,signal:h,stdio:T,all:w,ipcOutput:$,context:c,options:e,command:o,escapedCommand:a,startTime:n});return Sw(b,r,e)},ere=({errorInfo:t,exitCode:e,signal:n,stdio:r,all:i,ipcOutput:s,context:o,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?Rw({error:t.error,command:c,escapedCommand:l,timedOut:o.terminationReason==="timeout",isCanceled:o.terminationReason==="cancel"||o.terminationReason==="gracefulCancel",isGracefullyCanceled:o.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Vh,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:e,signal:n,stdio:r,all:i,ipcOutput:s,options:a,startTime:u,isSync:!1}):HI({command:c,escapedCommand:l,stdio:r,all:i,ipcOutput:s,options:a,startTime:u}),Ww=(t,e)=>{const n=Object.fromEntries(Object.entries(e).map(([r,i])=>[r,tre(r,t[r],i)]));return{...t,...n}},tre=(t,e,n)=>nre.has(t)&&Wn(e)&&Wn(n)?{...e,...n}:n,nre=new Set(["env",...AA]),Js=(t,e,n,r)=>{const i=(o,a,c)=>Js(o,a,n,c),s=(...o)=>rre({mapArguments:t,deepOptions:n,boundOptions:e,setBoundExeca:r,createNested:i},...o);return r!==void 0&&r(s,i,e),s},rre=({mapArguments:t,deepOptions:e={},boundOptions:n={},setBoundExeca:r,createNested:i},s,...o)=>{if(Wn(s))return i(t,Ww(n,s),r);const{file:a,commandArguments:c,options:l,isSync:u}=ire({mapArguments:t,firstArgument:s,nextArguments:o,deepOptions:e,boundOptions:n});return u?Vee(a,c,l):Yne(a,c,l,i)},ire=({mapArguments:t,firstArgument:e,nextArguments:n,deepOptions:r,boundOptions:i})=>{const s=bK(e)?TK(e,n):[e,...n],[o,a,c]=yA(...s),l=Ww(Ww(r,i),c),{file:u=o,commandArguments:d=a,options:f=l,isSync:h=!1}=t({file:o,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:h}},sre=({file:t,commandArguments:e})=>bx(t,e),ore=({file:t,commandArguments:e})=>({...bx(t,e),isSync:!0}),bx=(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]=are(t);return{file:n,commandArguments:r}},are=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(cre)){const i=n.at(-1);i&&i.endsWith("\\")?n[n.length-1]=`${i.slice(0,-1)} ${r}`:n.push(r)}return n},cre=/ +/g,lre=(t,e,n)=>{t.sync=e(dre,n),t.s=t.sync},ure=({options:t})=>Tx(t),dre=({options:t})=>({...Tx(t),isSync:!0}),Tx=t=>({options:{...fre(t),...t}}),fre=({input:t,inputFile:e,stdio:n})=>t===void 0&&e===void 0&&n===void 0?{stdin:"inherit"}:{},hre={preferLocal:!0},Gw=Js(()=>({}));Js(()=>({isSync:!0})),Js(sre),Js(ore),Js(RJ),Js(ure,{},hre,lre),dte();const zw=xh(2);class pre{constructor(e="dot"){this.path=e}async unflatten(e){return await zw(async()=>{const n=await Gw("unflatten",["-l 1","-c 3"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});return n instanceof Error&&(n.stdout?Le.warn(`[BinaryGraphvizLayouter.layout] '${n.command}' failed: ${n.stderr}
|
|
1210
|
-
|
|
1211
|
-
but returned
|
|
1212
|
-
${n.stdout}`):Le.error(`[BinaryGraphvizLayouter.layout] '${n.command}' failed: ${n.stderr}
|
|
1213
|
-
|
|
1214
|
-
nothing returned, ignoring...`)),n.stdout&&(e=n.stdout.replaceAll(/\t\[/g," [").replaceAll(/\t/g," ")),e})}async layoutJson(e){return await zw(async()=>{const n=await Gw(this.path,["-Tjson","-y"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});if(n instanceof Error){if(!n.stdout)throw Le.error(`[BinaryGraphvizLayouter.layout] '${n.command}' nothing returned and failed: "${n.stderr}"`),n;Le.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 zw(async()=>{const n=await Gw(this.path,["-Tsvg","-y"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});if(n instanceof Error){if(!n.stdout)throw Le.error(`[BinaryGraphvizLayouter.layout] '${n.command}' nothing returned and failed: ${n.stderr}`),n;Le.warn(`[BinaryGraphvizLayouter.layout] '${n.command}' returned result but also failed ${n.stderr}`)}return n.stdout})}}function Hw(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 Vw(t,e,n=".",r){if(!Hw(e))return Vw(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]]:Hw(o)&&Hw(i[s])?i[s]=Vw(o,i[s],(n?`${n}.`:"")+s.toString(),r):i[s]=o))}return i}function gre(t){return(...e)=>e.reduce((n,r)=>Vw(n,r,"",t),{})}const mre=gre();class yre{constructor(){this.encoding="utf-8"}readFile(e){return rb.promises.readFile(e.fsPath,this.encoding)}async readDirectory(e){return(await rb.promises.readdir(e.fsPath,{withFileTypes:!0})).map(r=>({dirent:r,isFile:r.isFile(),isDirectory:r.isDirectory(),uri:Nn.joinPath(e,r.name)}))}}const vre={fileSystemProvider:()=>new yre},wre="likec4",bre="1.9.0",Tre="MIT",Ere="https://likec4.dev",Rre="Denis Davydkov <denis@davydkov.com>",Sre={url:"https://github.com/sponsors/davydkov"},$re={type:"git",url:"https://github.com/likec4/likec4.git",directory:"packages/likec4"},kre={node:">=20.0.0"},_re="https://github.com/likec4/likec4/issues",Cre="module",Are="./bin/likec4.mjs",Ire={".":"./src/index.ts","./react":{types:"./app/react/components/index.ts",default:"./dist/__app__/react/components.mjs"},"./icons/all":{types:"./icons/all.d.ts",default:"./icons/all.js"},"./icons/*":{types:"./icons/icon.d.ts",default:"./icons/*"}},Pre={registry:"https://registry.npmjs.org",access:"public",exports:{".":{types:"./dist/index.d.mts",default:"./dist/index.mjs"},"./react":{types:"./react/index.d.ts",default:"./react/index.mjs"},"./icons/all":{types:"./icons/all.d.ts",default:"./icons/all.js"},"./icons/*":{types:"./icons/icon.d.ts",default:"./icons/*"}}},xre={"turbo-build":"turbo run build --log-prefix=none --log-order=grouped","typecheck:app":"tsc --noEmit -p ./app/tsconfig.json","typecheck:cli":"tsc --noEmit -p ./tsconfig.cli.json",typecheck:"run-p --print-label 'typecheck:*'",prebuild:"tsx scripts/prebuild.ts","build:cli":"unbuild","build:app":"tsx scripts/bundle-app.ts","build:react":"tsx scripts/bundle-react.ts","build:webcomponent":"tsx scripts/bundle-webcomponent.ts",build:"run prebuild && run-p --print-label 'build:*'",generate:"tsx scripts/generate.ts",prepack:"tsx scripts/prepack.ts",postpack:"tsx scripts/postpack.ts",lint:"run -T eslint src/ --fix",clean:"run -T rimraf 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"},Nre={"@hpcc-js/wasm-graphviz":"1.3.0","@nanostores/react":"0.7.3","@vitejs/plugin-react":"4.3.1","esm-env":"^1.0.0",nanostores:"0.11.3",playwright:"1.46.1",react:"^18.3.1","react-dom":"^18.3.1",vite:"5.3.4",yargs:"17.7.2"},Ore={"@fontsource/ibm-plex-sans":"^5.0.21","@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.12.2","@mantine/hooks":"7.12.2","@mantine/vanilla-extract":"7.12.2","@react-hookz/web":"^24.0.4","@tabler/icons-react":"^3.14.0","@tanstack/react-router":"1.45.13","@tanstack/router-cli":"1.45.13","@tanstack/router-vite-plugin":"1.45.13","@types/node":"^20.16.1","@types/prop-types":"^15.7.11","@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.15.5","@vanilla-extract/dynamic":"^2.1.2","@vanilla-extract/vite-plugin":"^4.0.15","@xyflow/react":"12.1.1","@xyflow/system":"0.0.39",autoprefixer:"^10.4.20","ci-info":"^3.9.0",classnames:"^2.5.1",clsx:"^2.1.1",defu:"^6.1.4",esbuild:"^0.23.1","esbuild-node-externals":"^1.14.0",execa:"^9.3.1","fast-equals":"^5.0.1","framer-motion":"^11.3.30","get-port":"^7.1.0",glob:"^11.0.0","html-to-image":"^1.11.11",json5:"^2.2.3",langium:"3.1.3",mkdirp:"^3.0.1","npm-run-all2":"^6.2.2","p-limit":"^6.1.0","package-up":"^5.0.0",postcss:"^8.4.41","postcss-preset-mantine":"^1.17.0","pretty-ms":"^9.1.0","react-error-boundary":"^4.0.13","react-resizable-panels":"^2.1.2","react-shadow":"^20.5.0",remeda:"^2.11.0","string-hash":"^1.1.3","strip-indent":"^4.0.0",terser:"^5.31.6",tinyrainbow:"^1.2.0",tsx:"~4.9.3",turbo:"^2.1.1","type-fest":"^4.26.0",typescript:"^5.5.4",ufo:"^1.5.4",unbuild:"^3.0.0-rc.7","vite-plugin-css-injected-by-js":"^3.5.1","vite-plugin-shadow-style":"^1.1.1",vitest:"~2.0.5"},Dre="yarn@4.3.1",Ex={name:wre,version:bre,license:Tre,homepage:Ere,author:Rre,sponsor:Sre,repository:$re,engines:kre,bugs:_re,type:Cre,bin:Are,exports:Ire,publishConfig:Pre,scripts:xre,dependencies:Nre,devDependencies:Ore,packageManager:Dre};var Kw={},Lre=[{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Shippable",constant:"SHIPPABLE",env:"SHIPPABLE",pr:{IS_PULL_REQUEST:"true"}},{name:"Solano CI",constant:"SOLANO",env:"TDDIUM",pr:"TDDIUM_PR_ID"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}];(function(t){const e=Lre,n=process.env;Object.defineProperty(t,"_vendors",{value:e.map(function(i){return i.constant})}),t.name=null,t.isPR=null,e.forEach(function(i){const o=(Array.isArray(i.env)?i.env:[i.env]).every(function(a){return r(a)});if(t[i.constant]=o,!!o)switch(t.name=i.name,typeof i.pr){case"string":t.isPR=!!n[i.pr];break;case"object":"env"in i.pr?t.isPR=i.pr.env in n&&n[i.pr.env]!==i.pr.ne:"any"in i.pr?t.isPR=i.pr.any.some(function(a){return!!n[a]}):t.isPR=r(i.pr);break;default:t.isPR=null}}),t.isCI=!!(n.CI!=="false"&&(n.BUILD_ID||n.BUILD_NUMBER||n.CI||n.CI_APP_ID||n.CI_BUILD_ID||n.CI_BUILD_NUMBER||n.CI_NAME||n.CONTINUOUS_INTEGRATION||n.RUN_ID||t.name));function r(i){return typeof i=="string"?!!n[i]:"env"in i?n[i.env]&&n[i.env].includes(i.includes):"any"in i?i.any.some(function(s){return!!n[s]}):Object.keys(i).every(function(s){return n[s]===i[s]})}})(Kw);const Rx=Xe.bold(Xe.bgRed(Xe.white("ERROR"))),Mre=Xe.bold(Xe.yellow("WARN")),Fre=Xe.bold(Xe.green("INFO"));function Sx(t){const e=rN("info",{prefix:t,allowClearScreen:!Kw.isCI}),n=!Kw.isCI;return{...e,info(r,i){e.info(`${Fre} ${r}`,{timestamp:n,...i})},warn(r,i){e.warn(`${Mre} ${r}`,{timestamp:n,...i})},error(r,i){if(r instanceof Error){e.error(`${Rx} ${Xe.red(r.stack??r.name+" "+r.message)}`,{timestamp:n,error:r,...i});return}e.error(`${Rx} ${r}`,{timestamp:n,...i})}}}const jre=1e6;function $x(t){const[e,n]=Jl(t),r=e*1e3+n/jre;return{ms:r,pretty:YI(r)}}function Ure(t){const e=Jl();return{stopAndLog(n="done in "){n=Xe.green(`${n}${$x(e).pretty}`),t?t.info(n):Le.success(n)}}}class Bre{constructor(e){this.services=e,this.layouter=e.likec4.Layouter}cache=new WeakMap;layouter;previousAction=Promise.resolve();limit=xh(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(Q)});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 qre{constructor(e){this.services=e}isInitialized=!1;async initForWorkspace(e){if(this.isInitialized)throw new Error("Workspace already initialized");const n=this.services.logger,r=this.services.shared.workspace.WorkspaceManager;return n.info(`${Xe.dim("workspace:")} ${e}`),await r.initializeWorkspace([{name:Dx(e),uri:Gx(e).toString()}]),await this.init()}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(`${Xe.dim("workspace:")} found ${s.length} source files`),await i.build(s,{validation:!0});const o=await n.buildComputedModel(),a=Sf(o?.views??{}).length;if(a===0){e.warn(`${Xe.dim("workspace:")} no views found`);return}e.info(`${Xe.dim("workspace:")} ${Xe.green(`\u2713 computed ${a} views`)}`);const c=await this.services.likec4.Views.diagrams();c.length===a?e.info(`${Xe.dim("workspace:")} ${Xe.green("\u2713 all views layouted")}`):e.warn(`${Xe.dim("workspace:")} ${Xe.yellow(`\u2717 layouted ${c.length} views`)}`)}}function kx(t){return e=>new t(e)}const Wre={logger:()=>{throw new Error("Logger must be provided")},likec4:{Layouter:()=>{throw new Error("Layouter must be provided")},Views:kx(Bre)},cli:{Workspace:kx(qre)}};function _x(t){const e=mre(t,{useFileSystem:!0,logger:"default",graphviz:"wasm"});let n;switch(e.logger){case"vite":n=Sx("c4:lsp ");break;case"default":n=Le;break;default:n=e.logger}const r=e.graphviz==="binary";n.info(`${Xe.dim("version")} ${Ex.version}`),n.info(`${Xe.dim("layout")} ${r?"binary":"wasm"}`);const i={logger:()=>n,likec4:{Layouter:()=>new fK(r===!0?new pre:new tK)}};return H9("warn"),X7(e.useFileSystem?vre:{},Wre,i).likec4}const Cx=t=>new Error(`Invalid model:
|
|
1215
|
-
${t.getErrors().map(e=>` ${e.sourceFsPath}:${e.line} ${e.message.slice(0,200)}`).join(`
|
|
1216
|
-
`)}`);class Ji{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=_x({useFileSystem:!1,...n}),i=Yt.from({scheme:"virtual",path:"/workspace"}),s={name:"virtual",uri:i.toString()};await r.shared.workspace.WorkspaceManager.initializeWorkspace([s]),Object.assign(r.shared.workspace.WorkspaceManager,{folders:[s]});const o=Nn.joinPath(i,"source.likec4");r.shared.workspace.LangiumDocuments.createDocument(o,e),await r.cli.Workspace.init();const a=new Ji(i.path,r,n?.printErrors??!0);return n?.throwIfInvalid===!0&&a.hasErrors()?Promise.reject(Cx(a)):a}static likec4Instances=new Map;static async fromWorkspace(e,n){const r=Lx(e);let i=Ji.likec4Instances.get(r);if(!i){const s=_x({useFileSystem:!0,...n});await s.cli.Workspace.initForWorkspace(r),i=new Ji(r,s,n?.printErrors??!0),Ji.likec4Instances.set(r,i)}return n?.throwIfInvalid===!0&&i.hasErrors()?Promise.reject(Cx(i)):i}cachedModel;logger;langiumDocuments;views;async computed(){return await this.langium.likec4.ModelBuilder.buildComputedModel()}model(){if(!this.cachedModel){const e=this.langium.likec4.ModelBuilder.unsafeSyncBuildModel();if(!e)throw new Error("Failed to build model");const n=this.langium.likec4.ModelBuilder.unsafeSyncBuildComputedModel(e);this.cachedModel=vu.from(n)}return this.cachedModel}async diagrams(){return await this.views.diagrams()}getErrors(){return this.langiumDocuments.all.toArray().flatMap(e=>(e.diagnostics??[]).filter(n=>n.severity===Rc.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===Rc.Error))}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(`
|
|
1217
|
-
`);return a.length>10&&(a.length=10),a.map((c,l)=>l===0?" "+Xe.dim(`Line ${o}: `)+Xe.red(c):" ".repeat(10)+Xe.red(c))}).join(`
|
|
1218
|
-
`);this.logger.error(`Invalid ${n.uri.fsPath}
|
|
1219
|
-
${i}`)}}return e}async notifyUpdate({changed:e,removed:n}){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 Ji.likec4Instances)n===this&&Ji.likec4Instances.delete(e)}}export{x0 as $,Xe as A,xh as B,Le as C,ii as D,Hn as E,R0 as F,Ay as G,yu as H,xb as I,I0 as J,Sx as K,Ji as L,uC as M,eT as N,Hy as O,B9 as P,jn as Q,m_ as R,$x as S,rt as T,ur as U,_0 as V,kn as W,Ure as X,Oy as Y,Fn as Z,ms as _,co as a,Ve as a0,Ex as a1,Nb as b,ae as c,mu as d,mp as e,gu as f,ya as g,vu as h,Re as i,mN as j,xD as k,ma as l,pt as m,St as n,C0 as o,qu as p,wa as q,it as r,yt as s,kN as t,Ui as u,jt as v,Q as w,_t as x,qi as y,gN as z};
|