@freik/pedroviz 0.1.3 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -19
- package/dist/entry.js +172 -0
- package/dist/frontend.js +156 -0
- package/dist/frontend.js.map +7 -0
- package/dist/index.html +4 -3
- package/dist/styles.css +115 -0
- package/package.json +19 -17
- package/dist/index-1wdsy1g5.css +0 -1
- package/dist/index-fh6bm18e.js +0 -134
- package/dist/main.js +0 -156
- /package/dist/{logo-nspswy0y.png → logo.png} +0 -0
package/dist/entry.js
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
"use strict";var dx=Object.create;var Vu=Object.defineProperty;var mx=Object.getOwnPropertyDescriptor;var hx=Object.getOwnPropertyNames;var gx=Object.getPrototypeOf,Ex=Object.prototype.hasOwnProperty;var _=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var yx=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of hx(t))!Ex.call(e,o)&&o!==r&&Vu(e,o,{get:()=>t[o],enumerable:!(n=mx(t,o))||n.enumerable});return e};var jt=(e,t,r)=>(r=e!=null?dx(gx(e)):{},yx(t||!e||!e.__esModule?Vu(r,"default",{value:e,enumerable:!0}):r,e));var yg=_((IZ,Eg)=>{var yv=typeof global=="object"&&global&&global.Object===Object&&global;Eg.exports=yv});var Tg=_((vZ,Sg)=>{var Sv=yg(),Tv=typeof self=="object"&&self&&self.Object===Object&&self,xv=Sv||Tv||Function("return this")();Sg.exports=xv});var ps=_((PZ,xg)=>{var Rv=Tg(),Ov=Rv.Symbol;xg.exports=Ov});var Og=_((MZ,Rg)=>{function Lv(e,t){for(var r=-1,n=e==null?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}Rg.exports=Lv});var Ag=_((wZ,Lg)=>{var Av=Array.isArray;Lg.exports=Av});var Cg=_((kZ,Ng)=>{var Ug=ps(),bg=Object.prototype,Uv=bg.hasOwnProperty,bv=bg.toString,Ei=Ug?Ug.toStringTag:void 0;function Nv(e){var t=Uv.call(e,Ei),r=e[Ei];try{e[Ei]=void 0;var n=!0}catch{}var o=bv.call(e);return n&&(t?e[Ei]=r:delete e[Ei]),o}Ng.exports=Nv});var vg=_((_Z,Ig)=>{var Cv=Object.prototype,Iv=Cv.toString;function vv(e){return Iv.call(e)}Ig.exports=vv});var kg=_((BZ,wg)=>{var Pg=ps(),Pv=Cg(),Mv=vg(),wv="[object Null]",kv="[object Undefined]",Mg=Pg?Pg.toStringTag:void 0;function _v(e){return e==null?e===void 0?kv:wv:Mg&&Mg in Object(e)?Pv(e):Mv(e)}wg.exports=_v});var Bg=_((FZ,_g)=>{function Bv(e){return e!=null&&typeof e=="object"}_g.exports=Bv});var Dg=_((DZ,Fg)=>{var Fv=kg(),Dv=Bg(),jv="[object Symbol]";function Gv(e){return typeof e=="symbol"||Dv(e)&&Fv(e)==jv}Fg.exports=Gv});var Vg=_((jZ,Wg)=>{var jg=ps(),Hv=Og(),Kv=Ag(),Wv=Dg(),Vv=1/0,Gg=jg?jg.prototype:void 0,Hg=Gg?Gg.toString:void 0;function Kg(e){if(typeof e=="string")return e;if(Kv(e))return Hv(e,Kg)+"";if(Wv(e))return Hg?Hg.call(e):"";var t=e+"";return t=="0"&&1/e==-Vv?"-0":t}Wg.exports=Kg});var yi=_((GZ,qg)=>{var qv=Vg();function Yv(e){return e==null?"":qv(e)}qg.exports=Yv});var zg=_((HZ,Yg)=>{function zv(e,t,r){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),r=r>o?o:r,r<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(o);++n<o;)i[n]=e[n+t];return i}Yg.exports=zv});var Jg=_((KZ,Xg)=>{var Xv=zg();function Jv(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:Xv(e,t,r)}Xg.exports=Jv});var kf=_((WZ,Qg)=>{var Qv="\\ud800-\\udfff",Zv="\\u0300-\\u036f",$v="\\ufe20-\\ufe2f",eP="\\u20d0-\\u20ff",tP=Zv+$v+eP,rP="\\ufe0e\\ufe0f",nP="\\u200d",oP=RegExp("["+nP+Qv+tP+rP+"]");function iP(e){return oP.test(e)}Qg.exports=iP});var $g=_((VZ,Zg)=>{function aP(e){return e.split("")}Zg.exports=aP});var sE=_((qZ,aE)=>{var eE="\\ud800-\\udfff",sP="\\u0300-\\u036f",cP="\\ufe20-\\ufe2f",fP="\\u20d0-\\u20ff",uP=sP+cP+fP,lP="\\ufe0e\\ufe0f",pP="["+eE+"]",_f="["+uP+"]",Bf="\\ud83c[\\udffb-\\udfff]",dP="(?:"+_f+"|"+Bf+")",tE="[^"+eE+"]",rE="(?:\\ud83c[\\udde6-\\uddff]){2}",nE="[\\ud800-\\udbff][\\udc00-\\udfff]",mP="\\u200d",oE=dP+"?",iE="["+lP+"]?",hP="(?:"+mP+"(?:"+[tE,rE,nE].join("|")+")"+iE+oE+")*",gP=iE+oE+hP,EP="(?:"+[tE+_f+"?",_f,rE,nE,pP].join("|")+")",yP=RegExp(Bf+"(?="+Bf+")|"+EP+gP,"g");function SP(e){return e.match(yP)||[]}aE.exports=SP});var fE=_((YZ,cE)=>{var TP=$g(),xP=kf(),RP=sE();function OP(e){return xP(e)?RP(e):TP(e)}cE.exports=OP});var lE=_((zZ,uE)=>{var LP=Jg(),AP=kf(),UP=fE(),bP=yi();function NP(e){return function(t){t=bP(t);var r=AP(t)?UP(t):void 0,n=r?r[0]:t.charAt(0),o=r?LP(r,1).join(""):t.slice(1);return n[e]()+o}}uE.exports=NP});var dE=_((XZ,pE)=>{var CP=lE(),IP=CP("toUpperCase");pE.exports=IP});var hE=_((JZ,mE)=>{var vP=yi(),PP=dE();function MP(e){return PP(vP(e).toLowerCase())}mE.exports=MP});var EE=_((QZ,gE)=>{function wP(e,t,r,n){var o=-1,i=e==null?0:e.length;for(n&&i&&(r=e[++o]);++o<i;)r=t(r,e[o],o,e);return r}gE.exports=wP});var SE=_((ZZ,yE)=>{function kP(e){return function(t){return e?.[t]}}yE.exports=kP});var xE=_(($Z,TE)=>{var _P=SE(),BP={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},FP=_P(BP);TE.exports=FP});var OE=_((e$,RE)=>{var DP=xE(),jP=yi(),GP=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,HP="\\u0300-\\u036f",KP="\\ufe20-\\ufe2f",WP="\\u20d0-\\u20ff",VP=HP+KP+WP,qP="["+VP+"]",YP=RegExp(qP,"g");function zP(e){return e=jP(e),e&&e.replace(GP,DP).replace(YP,"")}RE.exports=zP});var AE=_((t$,LE)=>{var XP=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function JP(e){return e.match(XP)||[]}LE.exports=JP});var bE=_((r$,UE)=>{var QP=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function ZP(e){return QP.test(e)}UE.exports=ZP});var qE=_((n$,VE)=>{var PE="\\ud800-\\udfff",$P="\\u0300-\\u036f",e4="\\ufe20-\\ufe2f",t4="\\u20d0-\\u20ff",r4=$P+e4+t4,ME="\\u2700-\\u27bf",wE="a-z\\xdf-\\xf6\\xf8-\\xff",n4="\\xac\\xb1\\xd7\\xf7",o4="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",i4="\\u2000-\\u206f",a4=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",kE="A-Z\\xc0-\\xd6\\xd8-\\xde",s4="\\ufe0e\\ufe0f",_E=n4+o4+i4+a4,BE="['\u2019]",NE="["+_E+"]",c4="["+r4+"]",FE="\\d+",f4="["+ME+"]",DE="["+wE+"]",jE="[^"+PE+_E+FE+ME+wE+kE+"]",u4="\\ud83c[\\udffb-\\udfff]",l4="(?:"+c4+"|"+u4+")",p4="[^"+PE+"]",GE="(?:\\ud83c[\\udde6-\\uddff]){2}",HE="[\\ud800-\\udbff][\\udc00-\\udfff]",mo="["+kE+"]",d4="\\u200d",CE="(?:"+DE+"|"+jE+")",m4="(?:"+mo+"|"+jE+")",IE="(?:"+BE+"(?:d|ll|m|re|s|t|ve))?",vE="(?:"+BE+"(?:D|LL|M|RE|S|T|VE))?",KE=l4+"?",WE="["+s4+"]?",h4="(?:"+d4+"(?:"+[p4,GE,HE].join("|")+")"+WE+KE+")*",g4="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",E4="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",y4=WE+KE+h4,S4="(?:"+[f4,GE,HE].join("|")+")"+y4,T4=RegExp([mo+"?"+DE+"+"+IE+"(?="+[NE,mo,"$"].join("|")+")",m4+"+"+vE+"(?="+[NE,mo+CE,"$"].join("|")+")",mo+"?"+CE+"+"+IE,mo+"+"+vE,E4,g4,FE,S4].join("|"),"g");function x4(e){return e.match(T4)||[]}VE.exports=x4});var zE=_((o$,YE)=>{var R4=AE(),O4=bE(),L4=yi(),A4=qE();function U4(e,t,r){return e=L4(e),t=r?void 0:t,t===void 0?O4(e)?A4(e):R4(e):e.match(t)||[]}YE.exports=U4});var JE=_((i$,XE)=>{var b4=EE(),N4=OE(),C4=zE(),I4="['\u2019]",v4=RegExp(I4,"g");function P4(e){return function(t){return b4(C4(N4(t).replace(v4,"")),e,"")}}XE.exports=P4});var ZE=_((a$,QE)=>{var M4=hE(),w4=JE(),k4=w4(function(e,t,r){return t=t.toLowerCase(),e+(r?M4(t):t)});QE.exports=k4});var ux=jt(require("node:path"),1),cc=jt(require("node:process"),1);var pc=Symbol.for("freik.typetag");function A(e){return e===void 0}function I(e){return!A(e)}function Go(e){return e===null}function Sx(e){return e==null}function Tx(e){return!Sx(e)}function xx(e,...t){return t.some(r=>r(e))}function _e(...e){return t=>xx(t,...e)}function Rx(e,...t){return t.every(r=>r(e))}function dt(e){return Rx(e,Ox,Tx)}function Ox(e){return typeof e=="object"}function dr(e){return Array.isArray(e)}function w(e){return typeof e=="string"}function An(e){return typeof e=="number"&&!isNaN(e-0)}var J_=_e(w,An);function mc(e){return typeof e=="boolean"}function Lx(e){return e instanceof Date}function Ax(e){return typeof e=="bigint"}function lr(e){return typeof e=="function"}function Ux(e){return e instanceof RegExp}function Yu(e){return e instanceof Map}function bx(e){return e instanceof Set}function Bi(e,t){if(!dr(e))return!1;for(let r of e)if(!t(r))return!1;return!0}function Gt(e){return t=>Bi(t,e)}function Nx(e,...t){return dr(e)&&e.length===t.length&&t.every((r,n)=>r(e[n]))}function Cx(...e){return t=>Nx(t,...e)}function Ix(e,t,r){if(!Yu(e))return!1;for(let[n,o]of e)if(!t(n)||!r(o))return!1;return!0}function Fi(e,t){return r=>Ix(r,e,t)}function vx(e,t){if(!dt(e))return!1;for(let r of[...Object.keys(e),...Object.getOwnPropertySymbols(e)])if(!it(e,r,t))return!1;return!0}function Di(e){return typeof e=="symbol"}function oe(e,t){return dt(e)&&t in e}function mr(e,t,r){return oe(e,t)&&r(e[t])}function hc(e,t){return r=>it(r,e,t)}var it=mr;function jo(e,t){return it(e,t,w)}function Px(e){return oe(e,Symbol.iterator)}function dc(e){return e===null||w(e)||An(e)||mc(e)||Bi(e,dc)||dt(e)&&Bi(Object.keys(e),_e(w,An))&&vx(e,dc)}function zu(e,t,r,n){if(!dt(t))return!1;let o=Object.keys(r).length,i=Object.keys(t),a=i.length;for(let s of i){if(!oe(t,s))continue;let c=t[s];if(A(c)||t[s]===null){delete t[s],a--;continue}if(it(n,s,lr)){let f=n[s];if(!f(c))return!1;a--}else if(it(r,s,lr)){let f=r[s];if(!f(c))return!1;o--,a--}}return o===0&&(a===0||!e)}function Mx(e,t={}){return r=>zu(!1,r,e,t)}function ie(e,t={}){return r=>zu(!0,r,e,t)}function wx(e,t,r){if(!dt(e))return!1;let n=Object.keys(e),o=n.length;for(let i of n){if(!oe(e,i))continue;let a=e[i];if(!t(i)||!r(a))return!1;o--}return o===0}function Xu(e,t){return r=>wx(r,e,t)}var Ju=Function("try {return this===global;}catch(e){ return false;}"),Qu=Function("try {return this===window;}catch(e){ return false;}");function gc(){return typeof globalThis<"u"}function kx(e){return jo(e,"@dataType")&&it(e,"@dataValue",dc)}function _x(e,t){return{"@dataType":e,"@dataValue":t}}function Bx(e){return[e["@dataType"],e["@dataValue"]]}var Ec=Symbol.for("freik.Set"),yc=Symbol.for("freik.Map"),Sc=Symbol.for("freik.Symbol"),Tc=Symbol.for("freik.RegExp"),xc=Symbol.for("freik.Date"),Rc=Symbol.for("freik.BigInt");function Fx(e){return[...e.entries()]}function Dx(e){return Bi(e,Cx(I,I))?new Map(e):void 0}function jx(e){return[...e]}function Gx(e){return dr(e)?new Set(e):void 0}function Hx(e){let t=Symbol.keyFor(e);if(t===void 0)throw Error("Unable to get a key for a symbol for pickling");return t}function Kx(e){return w(e)?Symbol.for(e):void 0}function Wx(e){return{source:e.source,flags:e.flags}}function Vx(e){if(jo(e,"source")&&jo(e,"flags"))return new RegExp(e.source,e.flags)}function qx(e){return e.toJSON()}function Yx(e){try{return w(e)?new Date(e):void 0}catch{return}}function zx(e){return e.toString()}function Xx(e){try{return w(e)?BigInt(e):void 0}catch{return}}var Jx=[[Yu,yc],[bx,Ec],[Di,Sc],[Ux,Tc],[Lx,xc],[Ax,Rc]],Qx=new Map([[yc,Fx],[Ec,jx],[Sc,Hx],[Tc,Wx],[xc,qx],[Rc,zx]]),Zx=new Map([[yc,Dx],[Ec,Gx],[Sc,Kx],[Tc,Vx],[xc,Yx],[Rc,Xx]]),$x;(e=>{e[e.Success=0]="Success",e[e.Already=1]="Already",e[e.Fail=2]="Fail",e[e.DetectionFailure=3]="DetectionFailure"})($x||={});var ne=pc;function lc(e){return oe(e,ne)?it(e,ne,Mx({to:Fi(_e(Di,w),lr),from:Fi(_e(Di,w),lr)}))?1:2:(e[ne]={to:Qx,from:Zx},0)}function eR(){return gc()?lc(globalThis):Qu()?lc(window):Ju()?lc(global):3}switch(eR()){case 2:throw Error(`Invalid <global>[${String(ne)}] object`);case 3:throw Error("Unable to determine environment for pickling");default:break}function tR(){if(gc()&&dt(globalThis)&&oe(globalThis,ne)&&oe(globalThis[ne],"to"))return globalThis[ne].to;if(Ju()&&dt(global)&&oe(global,ne)&&oe(global[ne],"to"))return global[ne].to;if(Qu()&&dt(window)&&oe(window,ne)&&oe(window[ne],"to"))return window[ne].to;throw Error("Pickling not registered!")}function qu(e){return tR().get(e)}function rR(){if(gc()&&dt(globalThis)&&oe(globalThis,ne)&&oe(globalThis[ne],"from"))return globalThis[ne].from;if(dt(process)&&!oe(process,"browser")&&oe(global,ne)&&oe(global[ne],"from"))return global[ne].from;if(!dt(process)&&!oe(process,"browser")&&oe(window,ne)&&oe(window[ne],"from"))return window[ne].from;throw Error("Unpickling not registered!")}function nR(e){return rR().get(e)}function oR(e){if(it(e,pc,Di)){let t=e[pc],r=qu(t);if(r)return[t,r];if(it(e,"toJSON",lr))return[t,n=>it(n,"toJSON",lr)?n.toJSON():"ERROR"]}for(let[t,r]of Jx)if(t(e)){let n=qu(r);if(n)return[r,n]}}function iR(e){return nR(Symbol.for(e))}function aR(e,t){let r=this[e],n=oR(r);if(n){let[o,i]=n,a=Symbol.keyFor(o);return a?_x(a,i(r)):t}else if(Px(r))return[...r];return t}function sR(e,t){if(kx(t)){let[r,n]=Bx(t),o=iR(r);if(o){let i=o(n);if(i!==void 0)return i}}return t}function Oc(e){return JSON.stringify(e,aR)}function cR(e){return JSON.parse(e,sR)}function fR(e){return cR(e)}function Zu(e,t){let r=fR(e);return t(r)?r:void 0}var pr=ie({errors:lr,[Symbol.toPrimitive]:lr});function Ho(e,t){let r=[];return r.push(...w(e)?[e]:pr(e)?e.errors():e),I(t)&&r.push(...w(t)?[t]:pr(t)?t.errors():t),{errors:()=>r,[Symbol.toPrimitive]:n=>n==="string"?r.join(`
|
|
3
|
+
`):null}}var St=jt(require("node:fs"),1),Ve=jt(require("node:path"),1);var Ko=Symbol.for("freik.typetag");function nl(e){return e===void 0}function $u(e){return!nl(e)}function Gi(e){return e==null}function Hi(e){return!Gi(e)}function uR(e,...t){return t.some(r=>r(e))}function Ac(...e){return t=>uR(t,...e)}function lR(e,...t){return t.every(r=>r(e))}function hr(e){return lR(e,pR,Hi)}function pR(e){return typeof e=="object"}function Uc(e){return Array.isArray(e)}function gr(e){return typeof e=="string"}function dR(e){return typeof e=="number"&&!isNaN(e-0)}var Z_=Ac(gr,dR);function Wo(e){return typeof e=="function"}function mR(e){return e instanceof Map}function Ki(e,t){if(!Uc(e))return!1;for(let r of e)if(!t(r))return!1;return!0}function ol(e){return t=>Ki(t,e)}function hR(e,...t){return Uc(e)&&e.length===t.length&&t.every((r,n)=>r(e[n]))}function bc(...e){return t=>hR(t,...e)}function gR(e,t,r){if(!mR(e))return!1;for(let[n,o]of e)if(!t(n)||!r(o))return!1;return!0}function el(e,t){return r=>gR(r,e,t)}function tl(e){return typeof e=="symbol"}function Se(e,t){return hr(e)&&t in e}function ER(e,t,r){return Se(e,t)&&r(e[t])}var ji=ER;function rl(e,t){return ji(e,t,gr)}function il(e,t){return Se(e,Ko)&&e[Ko]===t}function yR(e,t,r,n){if(!hr(t))return!1;let o=Object.keys(r).length,i=Object.keys(t),a=i.length;for(let s of i){if(!Se(t,s))continue;let c=t[s];if(nl(c)||t[s]===null){delete t[s],a--;continue}if(ji(n,s,Wo)){let f=n[s];if(!f(c))return!1;a--}else if(ji(r,s,Wo)){let f=r[s];if(!f(c))return!1;o--,a--}}return o===0&&(a===0||!e)}function SR(e,t={}){return r=>yR(!1,r,e,t)}var al=Function("try {return this===global;}catch(e){ return false;}"),sl=Function("try {return this===window;}catch(e){ return false;}");function Nc(){return typeof globalThis<"u"}var cl=Symbol.for("freik.Set"),fl=Symbol.for("freik.Map"),ul=Symbol.for("freik.Symbol"),ll=Symbol.for("freik.RegExp"),pl=Symbol.for("freik.Date"),dl=Symbol.for("freik.BigInt");function TR(e){return[...e.entries()]}function xR(e){return Ki(e,bc($u,$u))?new Map(e):void 0}function RR(e){return[...e]}function OR(e){return Uc(e)?new Set(e):void 0}function LR(e){let t=Symbol.keyFor(e);if(t===void 0)throw Error("Unable to get a key for a symbol for pickling");return t}function AR(e){return gr(e)?Symbol.for(e):void 0}function UR(e){return{source:e.source,flags:e.flags}}function bR(e){if(rl(e,"source")&&rl(e,"flags"))return new RegExp(e.source,e.flags)}function NR(e){return e.toJSON()}function CR(e){try{return gr(e)?new Date(e):void 0}catch{return}}function IR(e){return e.toString()}function vR(e){try{return gr(e)?BigInt(e):void 0}catch{return}}var PR=new Map([[fl,TR],[cl,RR],[ul,LR],[ll,UR],[pl,NR],[dl,IR]]),MR=new Map([[fl,xR],[cl,OR],[ul,AR],[ll,bR],[pl,CR],[dl,vR]]),wR;(e=>{e[e.Success=0]="Success",e[e.Already=1]="Already",e[e.Fail=2]="Fail",e[e.DetectionFailure=3]="DetectionFailure"})(wR||={});var ae=Ko;function Lc(e){return Se(e,ae)?ji(e,ae,SR({to:el(Ac(tl,gr),Wo),from:el(Ac(tl,gr),Wo)}))?1:2:(e[ae]={to:PR,from:MR},0)}function kR(){return Nc()?Lc(globalThis):sl()?Lc(window):al()?Lc(global):3}switch(kR()){case 2:throw Error(`Invalid <global>[${String(ae)}] object`);case 3:throw Error("Unable to determine environment for pickling");default:break}function _R(){if(Nc()&&hr(globalThis)&&Se(globalThis,ae)&&Se(globalThis[ae],"to"))return globalThis[ae].to;if(al()&&hr(global)&&Se(global,ae)&&Se(global[ae],"to"))return global[ae].to;if(sl()&&hr(window)&&Se(window,ae)&&Se(window[ae],"to"))return window[ae].to;throw Error("Pickling not registered!")}function BR(e,t){_R().set(e,t)}function FR(){if(Nc()&&hr(globalThis)&&Se(globalThis,ae)&&Se(globalThis[ae],"from"))return globalThis[ae].from;if(hr(process)&&!Se(process,"browser")&&Se(global,ae)&&Se(global[ae],"from"))return global[ae].from;if(!hr(process)&&!Se(process,"browser")&&Se(window,ae)&&Se(window[ae],"from"))return window[ae].from;throw Error("Unpickling not registered!")}function DR(e,t){FR().set(e,t)}function ml(e,t,r){r&&BR(e,r),DR(e,t)}var jR=Symbol.for("freik.typetag");function Sl(e){return e===void 0}function hl(e){return!Sl(e)}function GR(e){return e==null}function HR(e){return!GR(e)}function KR(e,...t){return t.some(r=>r(e))}function Ic(...e){return t=>KR(t,...e)}function WR(e,...t){return t.every(r=>r(e))}function vc(e){return WR(e,VR,HR)}function VR(e){return typeof e=="object"}function Yi(e){return Array.isArray(e)}function Er(e){return typeof e=="string"}function Tl(e){return typeof e=="number"&&!isNaN(e-0)}var e8=Ic(Er,Tl);function Vi(e){return typeof e=="function"}function xl(e){return e instanceof Map}function qR(e,t){if(!Yi(e))return!1;for(let r of e)if(!t(r))return!1;return!0}function YR(e,...t){return Yi(e)&&e.length===t.length&&t.every((r,n)=>r(e[n]))}function zR(...e){return t=>YR(t,...e)}function XR(e,t,r){if(!xl(e))return!1;for(let[n,o]of e)if(!t(n)||!r(o))return!1;return!0}function gl(e,t){return r=>XR(r,e,t)}function El(e){return typeof e=="symbol"}function Pc(e,t){return vc(e)&&t in e}function JR(e,t,r){return Pc(e,t)&&r(e[t])}var qi=JR;function yl(e,t){return qi(e,t,Er)}function QR(e,t,r,n){if(!vc(t))return!1;let o=Object.keys(r).length,i=Object.keys(t),a=i.length;for(let s of i){if(!Pc(t,s))continue;let c=t[s];if(Sl(c)||t[s]===null){delete t[s],a--;continue}if(qi(n,s,Vi)){let f=n[s];if(!f(c))return!1;a--}else if(qi(r,s,Vi)){let f=r[s];if(!f(c))return!1;o--,a--}}return o===0&&(a===0||!e)}function ZR(e,t={}){return r=>QR(!1,r,e,t)}var $R=Function("try {return this===global;}catch(e){ return false;}"),eO=Function("try {return this===window;}catch(e){ return false;}");function tO(){return typeof globalThis<"u"}var Rl=Symbol.for("freik.Set"),Ol=Symbol.for("freik.Map"),Ll=Symbol.for("freik.Symbol"),Al=Symbol.for("freik.RegExp"),Ul=Symbol.for("freik.Date"),bl=Symbol.for("freik.BigInt");function rO(e){return[...e.entries()]}function nO(e){return qR(e,zR(hl,hl))?new Map(e):void 0}function oO(e){return[...e]}function iO(e){return Yi(e)?new Set(e):void 0}function aO(e){let t=Symbol.keyFor(e);if(t===void 0)throw Error("Unable to get a key for a symbol for pickling");return t}function sO(e){return Er(e)?Symbol.for(e):void 0}function cO(e){return{source:e.source,flags:e.flags}}function fO(e){if(yl(e,"source")&&yl(e,"flags"))return new RegExp(e.source,e.flags)}function uO(e){return e.toJSON()}function lO(e){try{return Er(e)?new Date(e):void 0}catch{return}}function pO(e){return e.toString()}function dO(e){try{return Er(e)?BigInt(e):void 0}catch{return}}var mO=new Map([[Ol,rO],[Rl,oO],[Ll,aO],[Al,cO],[Ul,uO],[bl,pO]]),hO=new Map([[Ol,nO],[Rl,iO],[Ll,sO],[Al,fO],[Ul,lO],[bl,dO]]),gO;(e=>{e[e.Success=0]="Success",e[e.Already=1]="Already",e[e.Fail=2]="Fail",e[e.DetectionFailure=3]="DetectionFailure"})(gO||={});var Wi=jR;function Cc(e){return Pc(e,Wi)?qi(e,Wi,ZR({to:gl(Ic(El,Er),Vi),from:gl(Ic(El,Er),Vi)}))?1:2:(e[Wi]={to:mO,from:hO},0)}function EO(){return tO()?Cc(globalThis):eO()?Cc(window):$R()?Cc(global):3}switch(EO()){case 2:throw Error(`Invalid <global>[${String(Wi)}] object`);case 3:throw Error("Unable to determine environment for pickling");default:break}function zi(e,t){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}var Mc=Symbol.for("freik.MultiMapTypeTag");function Ht(e){let t=e?new Map([...e].map(([d,g])=>[d,new Set(g)])):new Map,r=()=>t.clear(),n=d=>t.delete(d),o=(d,g)=>{let h=c(d);if(h!==void 0){let x=h.delete(g);return h.size===0&&t.delete(d),x}return!1},i=()=>t.keys(),a=(d,g)=>t.forEach((h,x)=>d(h,x,S),g),s=async(d,g)=>{for(let[h,x]of t)g?await d.apply(g,[x,h,S]):await d(x,h,S)},c=d=>t.get(d),f=d=>t.has(d);function u(d,g){let h=t.get(d);return h===void 0?t.set(d,new Set([g])):h.add(g),S}function l(d,g){let h=t.get(d);if(h===void 0)t.set(d,new Set(g));else for(let x of g)h.add(x);return S}function*p(){for(let[d,g]of t)yield[d,g.values()]}let m=()=>t.size;function E(d){if(m()!==d.size())return!1;for(let[g,h]of t){let x=d.get(g);if(!x||!zi(new Set(h),new Set(x)))return!1}return!0}function y(){return[...S]}let S={clear:r,delete:n,remove:o,keys:i,forEach:a,forEachAwaitable:s,get:c,has:f,set:u,add:l,size:m,[Symbol.iterator]:p,[Ko]:Mc,toJSON:y,valueEqual:E};return S}function yO(e){if(Ki(e,bc(Hi,ol(Hi))))return Ht(e)}ml(Mc,yO);function SO(e){return il(e,Mc)}function TO(e,t,r){if(!SO(e))return!1;for(let[n,o]of e){if(!t(n))return!1;for(let i of o)if(!r(i))return!1}return!0}function wc(e,t){return r=>TO(r,e,t)}var Un=Object.freeze({Line:"line",Curve:"curve"}),he=Object.freeze({Reversed:"reversed",Tangent:"tangent",Constant:"constant",Linear:"linear",Point:"point",Piecewise:"piecewise"});var kc={name:"",fullName:"",imports:[],container:{fileName:""},children:{},values:[],poses:[],beziers:[],pathChains:[],pathChainHelpers:[]},Nl=w,xO=w,RO=ie({int:An}),OO=ie({double:An}),_c=_e(RO,OO),on=_e(xO,_c),Ji=ie({radians:on}),LO=ie({name:w,value:_e(on,Ji)}),Xi=_e(on,Ji),AO=w,Cl=ie({x:on,y:on},{heading:Xi}),UO=ie({name:w,pose:Cl}),Il=_e(AO,Cl);function bO(e){return e===Un.Line||e===Un.Curve}var NO=w,vl=ie({type:bO,points:Gt(Il)}),CO=ie({name:w,points:vl}),IO=_e(NO,vl);function vO(e){return e===he.Tangent}function PO(e){return e===he.Constant}function MO(e){return e===he.Linear}function wO(e){return e===he.Point}function kO(e){return e===he.Reversed}function _O(e){return e===he.Piecewise}var Pl=ie({type:vO}),Ml=ie({type:PO,heading:Xi}),wl=ie({type:MO,start:Xi,end:Xi}),kl=ie({type:wO,point:Il}),_l=_e(Pl,Ml,wl,kl),BO=ie({start:on,end:on}),Bl=ie({type:kO,facing:_l}),FO=_e(_l,Bl),DO=ie({timing:BO,heading:FO}),jO=ie({type:_O,pieces:Gt(DO)}),GO=e=>_e(Pl,Ml,wl,kl,jO,Bl)(e),HO=ie({name:w,paths:Gt(IO),heading:GO}),KO=ie({name:w,staticType:w}),WO=_e(hc("fileName",w),hc("className",w));function Bc(e){let t=jo(e,"name");return t=t&&mr(e,"container",WO),t=t&&mr(e,"values",Gt(LO)),t=t&&mr(e,"poses",Gt(UO)),t=t&&mr(e,"beziers",Gt(CO)),t=t&&mr(e,"pathChains",Gt(HO)),t=t&&mr(e,"pathChainHelpers",Gt(KO)),t=t&&it(e,"children",Xu(w,Bc)),t}function bn(e,t){return`${e}*${t}`}function Dl(e){return e.split("*").pop()||""}function Fc(e){return w(e)?e.split("*").length===2:!1}function Dc(e,t){return`${e};${t}`}function jl(e){return e.split(";").pop()||""}function Fl(e){if(!w(e))return!1;let t=e.split(";");return t.length===2&&Fc(t[0])}var Gl=ie({HasFieldImage:mc,TeamPaths:wc(w,Fc),PathClasses:wc(Fc,Fl),ParsedClasses:Fi(Fl,Bc)}),t5=Object.freeze({HasFieldImage:!1,TeamPaths:Ht(),PathClasses:Ht(),ParsedClasses:new Map});var Hl=jt(require("node:path"),1),Kl=jt(require("node:url"),1);var Nn={},Vo=I(__dirname)?__dirname:Hl.default.dirname(Kl.default.fileURLToPath(Nn.url));function Wl(e){Vo=e}function Cn(){return Vo}console.log("global_dirname:",Vo);var o5=VO();function VO(){try{if(I(Nn)&&I(Nn.env)&&I(Nn.dir)){let e=Nn.env.NODE_ENV==="production"||Nn.dir.includes("node_modules");return console.log("WE ARE HERE",e),e}}catch{}return console.log("Nah:WE ARE HERE:",Vo),process.env.NODE_ENV==="production"||Vo.endsWith("/dist")}var Vl=require("node:fs");async function jc(e){try{return(await Vl.promises.stat(e)).isDirectory()}catch{return!1}}var Kt=null,ql=[];function Yl(e){ql=e}async function qO(e){return await zO(e)?(Kt=e,!0):!1}function Gc(){if(Go(Kt))throw new Error("Unable to find FtcRobotController/TeamCode home");return Kt}async function YO(e,t=8){let r="",n=w(e)?[e]:e;for(let o of n){let i=t;for(;o!=r&&i>0;){if(await qO(o))return console.log("Found directory",o),o;r=o,o=Ve.default.dirname(o),i--}}return console.error("Unable to find any potential repositories:",e),null}async function zO(e){return await St.promises.exists(Ve.default.join(e,"settings.gradle"))&&await St.promises.exists(Ve.default.join(e,"build.gradle"))&&await St.promises.exists(Ve.default.join(e,"FtcRobotController"))&&await jc(Ve.default.join(e,"FtcRobotController"))}async function zl(){if(Go(Kt)&&await YO([...ql,process.cwd(),Cn()]),Go(Kt))throw new Error("Unable to find repository root");let e=await $O(),t=Ht();for(let r of e){let o=(await JO(Kt,r)).map(i=>bn(r,i));t.add(r,o)}return t}var XO=/[^\/\\]*(Path|Pose)[^\/\\]*\.java$/;async function JO(e,t){let r=Ve.default.join(e,t,Hc,t.toLocaleLowerCase()),n=[],o=[r];for(;o.length>0;){let i=o.pop(),a=await St.promises.readdir(i,{withFileTypes:!0});for(let s of a){let c=Ve.default.join(i,s.name);s.isDirectory()?o.push(c):await ZO(s)&&n.push(Ve.default.relative(r,c))}}return n}var QO=[/^\s*import\s+com\.pedropathing\.follower\.Follower\s*;/,/^\s*import\s+com\.pedropathing\.geometry\.(Bezier[A-Za-z]+|Pose)\s*;/,/^\s*import\s+com\.pedropathing\.paths\.(HeadingInterpolator|PathChain)\s*;/,/^\s*import\s+com\.bylazar\.configurables\.annotations\.Configurable\s*;/];async function ZO(e){return!e.isFile()||!XO.test(e.name)?!1:(await St.promises.readFile(Ve.default.join(e.parentPath,e.name),"utf-8")).split(`
|
|
4
|
+
`).filter(n=>{for(let o of QO)if(o.test(n.trim()))return!0;return!1}).length!==0}async function $O(){if(Go(Kt))throw new Error("Unknonw repository location");return(await St.promises.readdir(Kt,{withFileTypes:!0})).filter(r=>eL(Kt,r)).map(r=>r.name)}function eL(e,t){if(!t.isDirectory())return!1;let r=t.name;if(r[0]==="."||r==="FtcRobotController")return!1;let n=Ve.default.join(e,t.name,"build.gradle");if(!St.default.existsSync(n))return!1;let o=Ve.default.join(e,t.name,Hc,t.name.toLocaleLowerCase());return!(!St.default.existsSync(o)||!jc(o))}function Xl(e,t){return Ve.default.join(Gc(),e,Hc,e.toLocaleLowerCase(),t)}var Hc=Ve.default.join("src","main","java","org","firstinspires","ftc");var Vc=Symbol.for("freik.typetag");function ep(e){return e===void 0}function Jl(e){return!ep(e)}function Zi(e){return e==null}function $i(e){return!Zi(e)}function tL(e,...t){return t.some(r=>r(e))}function Wc(...e){return t=>tL(t,...e)}function rL(e,...t){return t.every(r=>r(e))}function yr(e){return rL(e,nL,$i)}function nL(e){return typeof e=="object"}function qc(e){return Array.isArray(e)}function Sr(e){return typeof e=="string"}function oL(e){return typeof e=="number"&&!isNaN(e-0)}var d5=Wc(Sr,oL);function qo(e){return typeof e=="function"}function iL(e){return e instanceof Map}function ea(e,t){if(!qc(e))return!1;for(let r of e)if(!t(r))return!1;return!0}function tp(e){return t=>ea(t,e)}function aL(e,...t){return qc(e)&&e.length===t.length&&t.every((r,n)=>r(e[n]))}function Yc(...e){return t=>aL(t,...e)}function sL(e,t,r){if(!iL(e))return!1;for(let[n,o]of e)if(!t(n)||!r(o))return!1;return!0}function Ql(e,t){return r=>sL(r,e,t)}function Zl(e){return typeof e=="symbol"}function Ue(e,t){return yr(e)&&t in e}function cL(e,t,r){return Ue(e,t)&&r(e[t])}var Qi=cL;function $l(e,t){return Qi(e,t,Sr)}function fL(e,t,r,n){if(!yr(t))return!1;let o=Object.keys(r).length,i=Object.keys(t),a=i.length;for(let s of i){if(!Ue(t,s))continue;let c=t[s];if(ep(c)||t[s]===null){delete t[s],a--;continue}if(Qi(n,s,qo)){let f=n[s];if(!f(c))return!1;a--}else if(Qi(r,s,qo)){let f=r[s];if(!f(c))return!1;o--,a--}}return o===0&&(a===0||!e)}function uL(e,t={}){return r=>fL(!1,r,e,t)}var rp=Function("try {return this===global;}catch(e){ return false;}"),np=Function("try {return this===window;}catch(e){ return false;}");function zc(){return typeof globalThis<"u"}var op=Symbol.for("freik.Set"),ip=Symbol.for("freik.Map"),ap=Symbol.for("freik.Symbol"),sp=Symbol.for("freik.RegExp"),cp=Symbol.for("freik.Date"),fp=Symbol.for("freik.BigInt");function lL(e){return[...e.entries()]}function pL(e){return ea(e,Yc(Jl,Jl))?new Map(e):void 0}function dL(e){return[...e]}function mL(e){return qc(e)?new Set(e):void 0}function hL(e){let t=Symbol.keyFor(e);if(t===void 0)throw Error("Unable to get a key for a symbol for pickling");return t}function gL(e){return Sr(e)?Symbol.for(e):void 0}function EL(e){return{source:e.source,flags:e.flags}}function yL(e){if($l(e,"source")&&$l(e,"flags"))return new RegExp(e.source,e.flags)}function SL(e){return e.toJSON()}function TL(e){try{return Sr(e)?new Date(e):void 0}catch{return}}function xL(e){return e.toString()}function RL(e){try{return Sr(e)?BigInt(e):void 0}catch{return}}var OL=new Map([[ip,lL],[op,dL],[ap,hL],[sp,EL],[cp,SL],[fp,xL]]),LL=new Map([[ip,pL],[op,mL],[ap,gL],[sp,yL],[cp,TL],[fp,RL]]),AL;(e=>{e[e.Success=0]="Success",e[e.Already=1]="Already",e[e.Fail=2]="Fail",e[e.DetectionFailure=3]="DetectionFailure"})(AL||={});var se=Vc;function Kc(e){return Ue(e,se)?Qi(e,se,uL({to:Ql(Wc(Zl,Sr),qo),from:Ql(Wc(Zl,Sr),qo)}))?1:2:(e[se]={to:OL,from:LL},0)}function UL(){return zc()?Kc(globalThis):np()?Kc(window):rp()?Kc(global):3}switch(UL()){case 2:throw Error(`Invalid <global>[${String(se)}] object`);case 3:throw Error("Unable to determine environment for pickling");default:break}function bL(){if(zc()&&yr(globalThis)&&Ue(globalThis,se)&&Ue(globalThis[se],"to"))return globalThis[se].to;if(rp()&&yr(global)&&Ue(global,se)&&Ue(global[se],"to"))return global[se].to;if(np()&&yr(window)&&Ue(window,se)&&Ue(window[se],"to"))return window[se].to;throw Error("Pickling not registered!")}function NL(e,t){bL().set(e,t)}function CL(){if(zc()&&yr(globalThis)&&Ue(globalThis,se)&&Ue(globalThis[se],"from"))return globalThis[se].from;if(yr(process)&&!Ue(process,"browser")&&Ue(global,se)&&Ue(global[se],"from"))return global[se].from;if(!yr(process)&&!Ue(process,"browser")&&Ue(window,se)&&Ue(window[se],"from"))return window[se].from;throw Error("Unpickling not registered!")}function IL(e,t){CL().set(e,t)}function up(e,t,r){r&&NL(e,r),IL(e,t)}var lp=Symbol.for("freik.MultiMapTypeTag");function vL(e){let t=e?new Map([...e].map(([d,g])=>[d,new Set(g)])):new Map,r=()=>t.clear(),n=d=>t.delete(d),o=(d,g)=>{let h=c(d);if(h!==void 0){let x=h.delete(g);return h.size===0&&t.delete(d),x}return!1},i=()=>t.keys(),a=(d,g)=>t.forEach((h,x)=>d(h,x,S),g),s=async(d,g)=>{for(let[h,x]of t)g?await d.apply(g,[x,h,S]):await d(x,h,S)},c=d=>t.get(d),f=d=>t.has(d);function u(d,g){let h=t.get(d);return h===void 0?t.set(d,new Set([g])):h.add(g),S}function l(d,g){let h=t.get(d);if(h===void 0)t.set(d,new Set(g));else for(let x of g)h.add(x);return S}function*p(){for(let[d,g]of t)yield[d,g.values()]}let m=()=>t.size;function E(d){if(m()!==d.size())return!1;for(let[g,h]of t){let x=d.get(g);if(!x||!zi(new Set(h),new Set(x)))return!1}return!0}function y(){return[...S]}let S={clear:r,delete:n,remove:o,keys:i,forEach:a,forEachAwaitable:s,get:c,has:f,set:u,add:l,size:m,[Symbol.iterator]:p,[Vc]:lp,toJSON:y,valueEqual:E};return S}function PL(e){if(ea(e,Yc($i,tp($i))))return vL(e)}up(lp,PL);function pp(e){return new Promise(t=>setTimeout(t,Math.max(0,e)))}var dp=require("node:fs"),In=jt(require("node:path"),1);var Tt=new Map;async function mp(){Tt.clear();let e=Gc(),t=await dp.promises.readdir(e,{withFileTypes:!0});for(let r of t){let n=In.extname(r.name).toLocaleLowerCase();if(n===".png"||n===".jpg"||n===".jpeg"){let o=In.basename(r.name.toLocaleLowerCase(),n);(o==="field"||o==="field-light"||o==="field-dark")&&Tt.set(o+n,In.join(e,r.name))}}return Tt.size>0}function ML(){return Tt.size!==0}function hp(e){if(ML())return Tt.get(`field-${e}.png`)||Tt.get(`field-${e}.jpg`)||Tt.get(`field-${e}.jpeg`)||Tt.get("field.png")||Tt.get("field.jpg")||Tt.get("field.jpeg")}var wL="#ccc",kL="#333",_L=`<svg viewBox="5 5 1130 1130" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
+
<!--
|
|
6
|
+
Copyright (C) 2026 Kevin Frei
|
|
7
|
+
Licensed under the GNU Affero General Public License v3.0 or later.
|
|
8
|
+
See https://www.gnu.org/licenses/agpl-3.0.html
|
|
9
|
+
-->
|
|
10
|
+
<defs>
|
|
11
|
+
<clipPath id="bounds">
|
|
12
|
+
<rect x="5" y="5" width="1130" height="1130"/>
|
|
13
|
+
</clipPath>
|
|
14
|
+
<path id="ln" fill="none" stroke="%%%FG%%%" stroke-width="0.8" stroke-linejoin="round" d="M0,4L5,8L7,8L5,0L17,0L15,8L27,8L25,0L37,0L35,8L47,8L45,0L57,0L55,8L67,8L65,0L77,0L75,8L87,8L85,0L93,0L94.25,4"/>
|
|
15
|
+
<g id="corner">
|
|
16
|
+
<use href="#ln" x="4" y="0"/>
|
|
17
|
+
<use href="#ln" x="-192.5" y="-8" transform="rotate(180)"/>
|
|
18
|
+
<use href="#ln" x="4" y="-8" transform="rotate(90)"/>
|
|
19
|
+
<use href="#ln" x="-192.5" y="0" transform="rotate(-90)"/>
|
|
20
|
+
</g>
|
|
21
|
+
<g id="row">
|
|
22
|
+
<use href="#corner" x="0"/>
|
|
23
|
+
<use href="#corner" x="188.5"/>
|
|
24
|
+
<use href="#corner" x="377"/>
|
|
25
|
+
<use href="#corner" x="565.5"/>
|
|
26
|
+
<use href="#corner" x="754"/>
|
|
27
|
+
<use href="#corner" x="942.5"/>
|
|
28
|
+
<use href="#corner" x="1131"/>
|
|
29
|
+
</g>
|
|
30
|
+
</defs>
|
|
31
|
+
<g clipPath="url(#bounds)">
|
|
32
|
+
<use href="#row"/>
|
|
33
|
+
<use href="#row" y="188.5"/>
|
|
34
|
+
<use href="#row" y="377"/>
|
|
35
|
+
<use href="#row" y="565.5"/>
|
|
36
|
+
<use href="#row" y="754"/>
|
|
37
|
+
<use href="#row" y="942.5"/>
|
|
38
|
+
<use href="#row" y="1131"/>
|
|
39
|
+
</g>
|
|
40
|
+
</svg>`;function Xc(e){return _L.replace("%%%FG%%%",e==="light"?kL:wL)}var kS=require("node:fs");var BL=typeof global=="object"&&global&&global.Object===Object&&global,ta=BL;var FL=typeof self=="object"&&self&&self.Object===Object&&self,DL=ta||FL||Function("return this")(),ue=DL;var jL=ue.Symbol,Te=jL;var gp=Object.prototype,GL=gp.hasOwnProperty,HL=gp.toString,Yo=Te?Te.toStringTag:void 0;function KL(e){var t=GL.call(e,Yo),r=e[Yo];try{e[Yo]=void 0;var n=!0}catch{}var o=HL.call(e);return n&&(t?e[Yo]=r:delete e[Yo]),o}var Ep=KL;var WL=Object.prototype,VL=WL.toString;function qL(e){return VL.call(e)}var yp=qL;var YL="[object Null]",zL="[object Undefined]",Sp=Te?Te.toStringTag:void 0;function XL(e){return e==null?e===void 0?zL:YL:Sp&&Sp in Object(e)?Ep(e):yp(e)}var Be=XL;function JL(e){return e!=null&&typeof e=="object"}var ce=JL;var QL="[object Symbol]";function ZL(e){return typeof e=="symbol"||ce(e)&&Be(e)==QL}var Tr=ZL;function $L(e,t){for(var r=-1,n=e==null?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}var xt=$L;var eA=Array.isArray,b=eA;var tA=1/0,Tp=Te?Te.prototype:void 0,xp=Tp?Tp.toString:void 0;function Rp(e){if(typeof e=="string")return e;if(b(e))return xt(e,Rp)+"";if(Tr(e))return xp?xp.call(e):"";var t=e+"";return t=="0"&&1/e==-tA?"-0":t}var Op=Rp;var rA=/\s/;function nA(e){for(var t=e.length;t--&&rA.test(e.charAt(t)););return t}var Lp=nA;var oA=/^\s+/;function iA(e){return e&&e.slice(0,Lp(e)+1).replace(oA,"")}var Ap=iA;function aA(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var te=aA;var Up=NaN,sA=/^[-+]0x[0-9a-f]+$/i,cA=/^0b[01]+$/i,fA=/^0o[0-7]+$/i,uA=parseInt;function lA(e){if(typeof e=="number")return e;if(Tr(e))return Up;if(te(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=te(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Ap(e);var r=cA.test(e);return r||fA.test(e)?uA(e.slice(2),r?2:8):sA.test(e)?Up:+e}var bp=lA;var Np=1/0,pA=17976931348623157e292;function dA(e){if(!e)return e===0?e:0;if(e=bp(e),e===Np||e===-Np){var t=e<0?-1:1;return t*pA}return e===e?e:0}var Cp=dA;function mA(e){var t=Cp(e),r=t%1;return t===t?r?t-r:t:0}var Rt=mA;function hA(e){return e}var at=hA;var gA="[object AsyncFunction]",EA="[object Function]",yA="[object GeneratorFunction]",SA="[object Proxy]";function TA(e){if(!te(e))return!1;var t=Be(e);return t==EA||t==yA||t==gA||t==SA}var Fe=TA;var xA=ue["__core-js_shared__"],ra=xA;var Ip=(function(){var e=/[^.]+$/.exec(ra&&ra.keys&&ra.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function RA(e){return!!Ip&&Ip in e}var vp=RA;var OA=Function.prototype,LA=OA.toString;function AA(e){if(e!=null){try{return LA.call(e)}catch{}try{return e+""}catch{}}return""}var Wt=AA;var UA=/[\\^$.*+?()[\]{}|]/g,bA=/^\[object .+?Constructor\]$/,NA=Function.prototype,CA=Object.prototype,IA=NA.toString,vA=CA.hasOwnProperty,PA=RegExp("^"+IA.call(vA).replace(UA,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function MA(e){if(!te(e)||vp(e))return!1;var t=Fe(e)?PA:bA;return t.test(Wt(e))}var Pp=MA;function wA(e,t){return e?.[t]}var Mp=wA;function kA(e,t){var r=Mp(e,t);return Pp(r)?r:void 0}var qe=kA;var _A=qe(ue,"WeakMap"),na=_A;var wp=Object.create,BA=(function(){function e(){}return function(t){if(!te(t))return{};if(wp)return wp(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})(),kp=BA;function FA(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var _p=FA;function DA(){}var re=DA;function jA(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var Bp=jA;var GA=800,HA=16,KA=Date.now;function WA(e){var t=0,r=0;return function(){var n=KA(),o=HA-(n-r);if(r=n,o>0){if(++t>=GA)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Fp=WA;function VA(e){return function(){return e}}var Dp=VA;var qA=(function(){try{var e=qe(Object,"defineProperty");return e({},"",{}),e}catch{}})(),vn=qA;var YA=vn?function(e,t){return vn(e,"toString",{configurable:!0,enumerable:!1,value:Dp(t),writable:!0})}:at,jp=YA;var zA=Fp(jp),Gp=zA;function XA(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var oa=XA;function JA(e,t,r,n){for(var o=e.length,i=r+(n?1:-1);n?i--:++i<o;)if(t(e[i],i,e))return i;return-1}var ia=JA;function QA(e){return e!==e}var Hp=QA;function ZA(e,t,r){for(var n=r-1,o=e.length;++n<o;)if(e[n]===t)return n;return-1}var Kp=ZA;function $A(e,t,r){return t===t?Kp(e,t,r):ia(e,Hp,r)}var Pn=$A;function e0(e,t){var r=e==null?0:e.length;return!!r&&Pn(e,t,0)>-1}var aa=e0;var t0=9007199254740991,r0=/^(?:0|[1-9]\d*)$/;function n0(e,t){var r=typeof e;return t=t??t0,!!t&&(r=="number"||r!="symbol"&&r0.test(e))&&e>-1&&e%1==0&&e<t}var xr=n0;function o0(e,t,r){t=="__proto__"&&vn?vn(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Mn=o0;function i0(e,t){return e===t||e!==e&&t!==t}var Ot=i0;var a0=Object.prototype,s0=a0.hasOwnProperty;function c0(e,t,r){var n=e[t];(!(s0.call(e,t)&&Ot(n,r))||r===void 0&&!(t in e))&&Mn(e,t,r)}var Rr=c0;function f0(e,t,r,n){var o=!r;r||(r={});for(var i=-1,a=t.length;++i<a;){var s=t[i],c=n?n(r[s],e[s],s,r,e):void 0;c===void 0&&(c=e[s]),o?Mn(r,s,c):Rr(r,s,c)}return r}var Lt=f0;var Wp=Math.max;function u0(e,t,r){return t=Wp(t===void 0?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=Wp(n.length-t,0),a=Array(i);++o<i;)a[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(a),_p(e,this,s)}}var Vp=u0;function l0(e,t){return Gp(Vp(e,t,at),e+"")}var wn=l0;var p0=9007199254740991;function d0(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=p0}var kn=d0;function m0(e){return e!=null&&kn(e.length)&&!Fe(e)}var le=m0;function h0(e,t,r){if(!te(r))return!1;var n=typeof t;return(n=="number"?le(r)&&xr(t,r.length):n=="string"&&t in r)?Ot(r[t],e):!1}var Or=h0;function g0(e){return wn(function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(i=e.length>3&&typeof i=="function"?(o--,i):void 0,a&&Or(r[0],r[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var s=r[n];s&&e(t,s,n,i)}return t})}var qp=g0;var E0=Object.prototype;function y0(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||E0;return e===r}var At=y0;function S0(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var Yp=S0;var T0="[object Arguments]";function x0(e){return ce(e)&&Be(e)==T0}var Jc=x0;var zp=Object.prototype,R0=zp.hasOwnProperty,O0=zp.propertyIsEnumerable,L0=Jc((function(){return arguments})())?Jc:function(e){return ce(e)&&R0.call(e,"callee")&&!O0.call(e,"callee")},Lr=L0;function A0(){return!1}var Xp=A0;var Zp=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Jp=Zp&&typeof module=="object"&&module&&!module.nodeType&&module,U0=Jp&&Jp.exports===Zp,Qp=U0?ue.Buffer:void 0,b0=Qp?Qp.isBuffer:void 0,N0=b0||Xp,Vt=N0;var C0="[object Arguments]",I0="[object Array]",v0="[object Boolean]",P0="[object Date]",M0="[object Error]",w0="[object Function]",k0="[object Map]",_0="[object Number]",B0="[object Object]",F0="[object RegExp]",D0="[object Set]",j0="[object String]",G0="[object WeakMap]",H0="[object ArrayBuffer]",K0="[object DataView]",W0="[object Float32Array]",V0="[object Float64Array]",q0="[object Int8Array]",Y0="[object Int16Array]",z0="[object Int32Array]",X0="[object Uint8Array]",J0="[object Uint8ClampedArray]",Q0="[object Uint16Array]",Z0="[object Uint32Array]",J={};J[W0]=J[V0]=J[q0]=J[Y0]=J[z0]=J[X0]=J[J0]=J[Q0]=J[Z0]=!0;J[C0]=J[I0]=J[H0]=J[v0]=J[K0]=J[P0]=J[M0]=J[w0]=J[k0]=J[_0]=J[B0]=J[F0]=J[D0]=J[j0]=J[G0]=!1;function $0(e){return ce(e)&&kn(e.length)&&!!J[Be(e)]}var $p=$0;function eU(e){return function(t){return e(t)}}var Ut=eU;var ed=typeof exports=="object"&&exports&&!exports.nodeType&&exports,zo=ed&&typeof module=="object"&&module&&!module.nodeType&&module,tU=zo&&zo.exports===ed,Qc=tU&&ta.process,rU=(function(){try{var e=zo&&zo.require&&zo.require("util").types;return e||Qc&&Qc.binding&&Qc.binding("util")}catch{}})(),st=rU;var td=st&&st.isTypedArray,nU=td?Ut(td):$p,_n=nU;var oU=Object.prototype,iU=oU.hasOwnProperty;function aU(e,t){var r=b(e),n=!r&&Lr(e),o=!r&&!n&&Vt(e),i=!r&&!n&&!o&&_n(e),a=r||n||o||i,s=a?Yp(e.length,String):[],c=s.length;for(var f in e)(t||iU.call(e,f))&&!(a&&(f=="length"||o&&(f=="offset"||f=="parent")||i&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||xr(f,c)))&&s.push(f);return s}var sa=aU;function sU(e,t){return function(r){return e(t(r))}}var ca=sU;var cU=ca(Object.keys,Object),rd=cU;var fU=Object.prototype,uU=fU.hasOwnProperty;function lU(e){if(!At(e))return rd(e);var t=[];for(var r in Object(e))uU.call(e,r)&&r!="constructor"&&t.push(r);return t}var fa=lU;function pU(e){return le(e)?sa(e):fa(e)}var W=pU;var dU=Object.prototype,mU=dU.hasOwnProperty,hU=qp(function(e,t){if(At(t)||le(t)){Lt(t,W(t),e);return}for(var r in t)mU.call(t,r)&&Rr(e,r,t[r])}),be=hU;function gU(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var nd=gU;var EU=Object.prototype,yU=EU.hasOwnProperty;function SU(e){if(!te(e))return nd(e);var t=At(e),r=[];for(var n in e)n=="constructor"&&(t||!yU.call(e,n))||r.push(n);return r}var od=SU;function TU(e){return le(e)?sa(e,!0):od(e)}var Ar=TU;var xU=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,RU=/^\w*$/;function OU(e,t){if(b(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Tr(e)?!0:RU.test(e)||!xU.test(e)||t!=null&&e in Object(t)}var Bn=OU;var LU=qe(Object,"create"),qt=LU;function AU(){this.__data__=qt?qt(null):{},this.size=0}var id=AU;function UU(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var ad=UU;var bU="__lodash_hash_undefined__",NU=Object.prototype,CU=NU.hasOwnProperty;function IU(e){var t=this.__data__;if(qt){var r=t[e];return r===bU?void 0:r}return CU.call(t,e)?t[e]:void 0}var sd=IU;var vU=Object.prototype,PU=vU.hasOwnProperty;function MU(e){var t=this.__data__;return qt?t[e]!==void 0:PU.call(t,e)}var cd=MU;var wU="__lodash_hash_undefined__";function kU(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=qt&&t===void 0?wU:t,this}var fd=kU;function Fn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Fn.prototype.clear=id;Fn.prototype.delete=ad;Fn.prototype.get=sd;Fn.prototype.has=cd;Fn.prototype.set=fd;var Zc=Fn;function _U(){this.__data__=[],this.size=0}var ud=_U;function BU(e,t){for(var r=e.length;r--;)if(Ot(e[r][0],t))return r;return-1}var Ur=BU;var FU=Array.prototype,DU=FU.splice;function jU(e){var t=this.__data__,r=Ur(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():DU.call(t,r,1),--this.size,!0}var ld=jU;function GU(e){var t=this.__data__,r=Ur(t,e);return r<0?void 0:t[r][1]}var pd=GU;function HU(e){return Ur(this.__data__,e)>-1}var dd=HU;function KU(e,t){var r=this.__data__,n=Ur(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var md=KU;function Dn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Dn.prototype.clear=ud;Dn.prototype.delete=ld;Dn.prototype.get=pd;Dn.prototype.has=dd;Dn.prototype.set=md;var br=Dn;var WU=qe(ue,"Map"),Nr=WU;function VU(){this.size=0,this.__data__={hash:new Zc,map:new(Nr||br),string:new Zc}}var hd=VU;function qU(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var gd=qU;function YU(e,t){var r=e.__data__;return gd(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Cr=YU;function zU(e){var t=Cr(this,e).delete(e);return this.size-=t?1:0,t}var Ed=zU;function XU(e){return Cr(this,e).get(e)}var yd=XU;function JU(e){return Cr(this,e).has(e)}var Sd=JU;function QU(e,t){var r=Cr(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var Td=QU;function jn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}jn.prototype.clear=hd;jn.prototype.delete=Ed;jn.prototype.get=yd;jn.prototype.has=Sd;jn.prototype.set=Td;var an=jn;var ZU="Expected a function";function $c(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(ZU);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new($c.Cache||an),r}$c.Cache=an;var xd=$c;var $U=500;function e2(e){var t=xd(e,function(n){return r.size===$U&&r.clear(),n}),r=t.cache;return t}var Rd=e2;var t2=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r2=/\\(\\)?/g,n2=Rd(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(t2,function(r,n,o,i){t.push(o?i.replace(r2,"$1"):n||r)}),t}),Od=n2;function o2(e){return e==null?"":Op(e)}var Ld=o2;function i2(e,t){return b(e)?e:Bn(e,t)?[e]:Od(Ld(e))}var Ir=i2;var a2=1/0;function s2(e){if(typeof e=="string"||Tr(e))return e;var t=e+"";return t=="0"&&1/e==-a2?"-0":t}var bt=s2;function c2(e,t){t=Ir(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[bt(t[r++])];return r&&r==n?e:void 0}var Gn=c2;function f2(e,t,r){var n=e==null?void 0:Gn(e,t);return n===void 0?r:n}var Ad=f2;function u2(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}var Hn=u2;var Ud=Te?Te.isConcatSpreadable:void 0;function l2(e){return b(e)||Lr(e)||!!(Ud&&e&&e[Ud])}var bd=l2;function Nd(e,t,r,n,o){var i=-1,a=e.length;for(r||(r=bd),o||(o=[]);++i<a;){var s=e[i];t>0&&r(s)?t>1?Nd(s,t-1,r,n,o):Hn(o,s):n||(o[o.length]=s)}return o}var Kn=Nd;function p2(e){var t=e==null?0:e.length;return t?Kn(e,1):[]}var ge=p2;var d2=ca(Object.getPrototypeOf,Object),ua=d2;function m2(e,t,r){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),r=r>o?o:r,r<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(o);++n<o;)i[n]=e[n+t];return i}var la=m2;function h2(e,t,r,n){var o=-1,i=e==null?0:e.length;for(n&&i&&(r=e[++o]);++o<i;)r=t(r,e[o],o,e);return r}var Cd=h2;function g2(){this.__data__=new br,this.size=0}var Id=g2;function E2(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var vd=E2;function y2(e){return this.__data__.get(e)}var Pd=y2;function S2(e){return this.__data__.has(e)}var Md=S2;var T2=200;function x2(e,t){var r=this.__data__;if(r instanceof br){var n=r.__data__;if(!Nr||n.length<T2-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new an(n)}return r.set(e,t),this.size=r.size,this}var wd=x2;function Wn(e){var t=this.__data__=new br(e);this.size=t.size}Wn.prototype.clear=Id;Wn.prototype.delete=vd;Wn.prototype.get=Pd;Wn.prototype.has=Md;Wn.prototype.set=wd;var vr=Wn;function R2(e,t){return e&&Lt(t,W(t),e)}var kd=R2;function O2(e,t){return e&&Lt(t,Ar(t),e)}var _d=O2;var jd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Bd=jd&&typeof module=="object"&&module&&!module.nodeType&&module,L2=Bd&&Bd.exports===jd,Fd=L2?ue.Buffer:void 0,Dd=Fd?Fd.allocUnsafe:void 0;function A2(e,t){if(t)return e.slice();var r=e.length,n=Dd?Dd(r):new e.constructor(r);return e.copy(n),n}var Gd=A2;function U2(e,t){for(var r=-1,n=e==null?0:e.length,o=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[o++]=a)}return i}var Vn=U2;function b2(){return[]}var pa=b2;var N2=Object.prototype,C2=N2.propertyIsEnumerable,Hd=Object.getOwnPropertySymbols,I2=Hd?function(e){return e==null?[]:(e=Object(e),Vn(Hd(e),function(t){return C2.call(e,t)}))}:pa,qn=I2;function v2(e,t){return Lt(e,qn(e),t)}var Kd=v2;var P2=Object.getOwnPropertySymbols,M2=P2?function(e){for(var t=[];e;)Hn(t,qn(e)),e=ua(e);return t}:pa,da=M2;function w2(e,t){return Lt(e,da(e),t)}var Wd=w2;function k2(e,t,r){var n=t(e);return b(e)?n:Hn(n,r(e))}var ma=k2;function _2(e){return ma(e,W,qn)}var Xo=_2;function B2(e){return ma(e,Ar,da)}var ha=B2;var F2=qe(ue,"DataView"),ga=F2;var D2=qe(ue,"Promise"),Ea=D2;var j2=qe(ue,"Set"),Pr=j2;var Vd="[object Map]",G2="[object Object]",qd="[object Promise]",Yd="[object Set]",zd="[object WeakMap]",Xd="[object DataView]",H2=Wt(ga),K2=Wt(Nr),W2=Wt(Ea),V2=Wt(Pr),q2=Wt(na),sn=Be;(ga&&sn(new ga(new ArrayBuffer(1)))!=Xd||Nr&&sn(new Nr)!=Vd||Ea&&sn(Ea.resolve())!=qd||Pr&&sn(new Pr)!=Yd||na&&sn(new na)!=zd)&&(sn=function(e){var t=Be(e),r=t==G2?e.constructor:void 0,n=r?Wt(r):"";if(n)switch(n){case H2:return Xd;case K2:return Vd;case W2:return qd;case V2:return Yd;case q2:return zd}return t});var mt=sn;var Y2=Object.prototype,z2=Y2.hasOwnProperty;function X2(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&z2.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var Jd=X2;var J2=ue.Uint8Array,Yn=J2;function Q2(e){var t=new e.constructor(e.byteLength);return new Yn(t).set(new Yn(e)),t}var zn=Q2;function Z2(e,t){var r=t?zn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var Qd=Z2;var $2=/\w*$/;function eb(e){var t=new e.constructor(e.source,$2.exec(e));return t.lastIndex=e.lastIndex,t}var Zd=eb;var $d=Te?Te.prototype:void 0,em=$d?$d.valueOf:void 0;function tb(e){return em?Object(em.call(e)):{}}var tm=tb;function rb(e,t){var r=t?zn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var rm=rb;var nb="[object Boolean]",ob="[object Date]",ib="[object Map]",ab="[object Number]",sb="[object RegExp]",cb="[object Set]",fb="[object String]",ub="[object Symbol]",lb="[object ArrayBuffer]",pb="[object DataView]",db="[object Float32Array]",mb="[object Float64Array]",hb="[object Int8Array]",gb="[object Int16Array]",Eb="[object Int32Array]",yb="[object Uint8Array]",Sb="[object Uint8ClampedArray]",Tb="[object Uint16Array]",xb="[object Uint32Array]";function Rb(e,t,r){var n=e.constructor;switch(t){case lb:return zn(e);case nb:case ob:return new n(+e);case pb:return Qd(e,r);case db:case mb:case hb:case gb:case Eb:case yb:case Sb:case Tb:case xb:return rm(e,r);case ib:return new n;case ab:case fb:return new n(e);case sb:return Zd(e);case cb:return new n;case ub:return tm(e)}}var nm=Rb;function Ob(e){return typeof e.constructor=="function"&&!At(e)?kp(ua(e)):{}}var om=Ob;var Lb="[object Map]";function Ab(e){return ce(e)&&mt(e)==Lb}var im=Ab;var am=st&&st.isMap,Ub=am?Ut(am):im,sm=Ub;var bb="[object Set]";function Nb(e){return ce(e)&&mt(e)==bb}var cm=Nb;var fm=st&&st.isSet,Cb=fm?Ut(fm):cm,um=Cb;var Ib=1,vb=2,Pb=4,lm="[object Arguments]",Mb="[object Array]",wb="[object Boolean]",kb="[object Date]",_b="[object Error]",pm="[object Function]",Bb="[object GeneratorFunction]",Fb="[object Map]",Db="[object Number]",dm="[object Object]",jb="[object RegExp]",Gb="[object Set]",Hb="[object String]",Kb="[object Symbol]",Wb="[object WeakMap]",Vb="[object ArrayBuffer]",qb="[object DataView]",Yb="[object Float32Array]",zb="[object Float64Array]",Xb="[object Int8Array]",Jb="[object Int16Array]",Qb="[object Int32Array]",Zb="[object Uint8Array]",$b="[object Uint8ClampedArray]",eN="[object Uint16Array]",tN="[object Uint32Array]",V={};V[lm]=V[Mb]=V[Vb]=V[qb]=V[wb]=V[kb]=V[Yb]=V[zb]=V[Xb]=V[Jb]=V[Qb]=V[Fb]=V[Db]=V[dm]=V[jb]=V[Gb]=V[Hb]=V[Kb]=V[Zb]=V[$b]=V[eN]=V[tN]=!0;V[_b]=V[pm]=V[Wb]=!1;function ya(e,t,r,n,o,i){var a,s=t&Ib,c=t&vb,f=t&Pb;if(r&&(a=o?r(e,n,o,i):r(e)),a!==void 0)return a;if(!te(e))return e;var u=b(e);if(u){if(a=Jd(e),!s)return Bp(e,a)}else{var l=mt(e),p=l==pm||l==Bb;if(Vt(e))return Gd(e,s);if(l==dm||l==lm||p&&!o){if(a=c||p?{}:om(e),!s)return c?Wd(e,_d(a,e)):Kd(e,kd(a,e))}else{if(!V[l])return o?e:{};a=nm(e,l,s)}}i||(i=new vr);var m=i.get(e);if(m)return m;i.set(e,a),um(e)?e.forEach(function(S){a.add(ya(S,t,r,S,e,i))}):sm(e)&&e.forEach(function(S,d){a.set(d,ya(S,t,r,d,e,i))});var E=f?c?ha:Xo:c?Ar:W,y=u?void 0:E(e);return oa(y||e,function(S,d){y&&(d=S,S=e[d]),Rr(a,d,ya(S,t,r,d,e,i))}),a}var mm=ya;var rN=4;function nN(e){return mm(e,rN)}var q=nN;function oN(e){for(var t=-1,r=e==null?0:e.length,n=0,o=[];++t<r;){var i=e[t];i&&(o[n++]=i)}return o}var Nt=oN;var iN="__lodash_hash_undefined__";function aN(e){return this.__data__.set(e,iN),this}var hm=aN;function sN(e){return this.__data__.has(e)}var gm=sN;function Sa(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new an;++t<r;)this.add(e[t])}Sa.prototype.add=Sa.prototype.push=hm;Sa.prototype.has=gm;var Xn=Sa;function cN(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var Ta=cN;function fN(e,t){return e.has(t)}var Jn=fN;var uN=1,lN=2;function pN(e,t,r,n,o,i){var a=r&uN,s=e.length,c=t.length;if(s!=c&&!(a&&c>s))return!1;var f=i.get(e),u=i.get(t);if(f&&u)return f==t&&u==e;var l=-1,p=!0,m=r&lN?new Xn:void 0;for(i.set(e,t),i.set(t,e);++l<s;){var E=e[l],y=t[l];if(n)var S=a?n(y,E,l,t,e,i):n(E,y,l,e,t,i);if(S!==void 0){if(S)continue;p=!1;break}if(m){if(!Ta(t,function(d,g){if(!Jn(m,g)&&(E===d||o(E,d,r,n,i)))return m.push(g)})){p=!1;break}}else if(!(E===y||o(E,y,r,n,i))){p=!1;break}}return i.delete(e),i.delete(t),p}var xa=pN;function dN(e){var t=-1,r=Array(e.size);return e.forEach(function(n,o){r[++t]=[o,n]}),r}var Em=dN;function mN(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Qn=mN;var hN=1,gN=2,EN="[object Boolean]",yN="[object Date]",SN="[object Error]",TN="[object Map]",xN="[object Number]",RN="[object RegExp]",ON="[object Set]",LN="[object String]",AN="[object Symbol]",UN="[object ArrayBuffer]",bN="[object DataView]",ym=Te?Te.prototype:void 0,ef=ym?ym.valueOf:void 0;function NN(e,t,r,n,o,i,a){switch(r){case bN:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case UN:return!(e.byteLength!=t.byteLength||!i(new Yn(e),new Yn(t)));case EN:case yN:case xN:return Ot(+e,+t);case SN:return e.name==t.name&&e.message==t.message;case RN:case LN:return e==t+"";case TN:var s=Em;case ON:var c=n&hN;if(s||(s=Qn),e.size!=t.size&&!c)return!1;var f=a.get(e);if(f)return f==t;n|=gN,a.set(e,t);var u=xa(s(e),s(t),n,o,i,a);return a.delete(e),u;case AN:if(ef)return ef.call(e)==ef.call(t)}return!1}var Sm=NN;var CN=1,IN=Object.prototype,vN=IN.hasOwnProperty;function PN(e,t,r,n,o,i){var a=r&CN,s=Xo(e),c=s.length,f=Xo(t),u=f.length;if(c!=u&&!a)return!1;for(var l=c;l--;){var p=s[l];if(!(a?p in t:vN.call(t,p)))return!1}var m=i.get(e),E=i.get(t);if(m&&E)return m==t&&E==e;var y=!0;i.set(e,t),i.set(t,e);for(var S=a;++l<c;){p=s[l];var d=e[p],g=t[p];if(n)var h=a?n(g,d,p,t,e,i):n(d,g,p,e,t,i);if(!(h===void 0?d===g||o(d,g,r,n,i):h)){y=!1;break}S||(S=p=="constructor")}if(y&&!S){var x=e.constructor,N=t.constructor;x!=N&&"constructor"in e&&"constructor"in t&&!(typeof x=="function"&&x instanceof x&&typeof N=="function"&&N instanceof N)&&(y=!1)}return i.delete(e),i.delete(t),y}var Tm=PN;var MN=1,xm="[object Arguments]",Rm="[object Array]",Ra="[object Object]",wN=Object.prototype,Om=wN.hasOwnProperty;function kN(e,t,r,n,o,i){var a=b(e),s=b(t),c=a?Rm:mt(e),f=s?Rm:mt(t);c=c==xm?Ra:c,f=f==xm?Ra:f;var u=c==Ra,l=f==Ra,p=c==f;if(p&&Vt(e)){if(!Vt(t))return!1;a=!0,u=!1}if(p&&!u)return i||(i=new vr),a||_n(e)?xa(e,t,r,n,o,i):Sm(e,t,c,r,n,o,i);if(!(r&MN)){var m=u&&Om.call(e,"__wrapped__"),E=l&&Om.call(t,"__wrapped__");if(m||E){var y=m?e.value():e,S=E?t.value():t;return i||(i=new vr),o(y,S,r,n,i)}}return p?(i||(i=new vr),Tm(e,t,r,n,o,i)):!1}var Lm=kN;function Am(e,t,r,n,o){return e===t?!0:e==null||t==null||!ce(e)&&!ce(t)?e!==e&&t!==t:Lm(e,t,r,n,Am,o)}var Oa=Am;var _N=1,BN=2;function FN(e,t,r,n){var o=r.length,i=o,a=!n;if(e==null)return!i;for(e=Object(e);o--;){var s=r[o];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<i;){s=r[o];var c=s[0],f=e[c],u=s[1];if(a&&s[2]){if(f===void 0&&!(c in e))return!1}else{var l=new vr;if(n)var p=n(f,u,c,e,t,l);if(!(p===void 0?Oa(u,f,_N|BN,n,l):p))return!1}}return!0}var Um=FN;function DN(e){return e===e&&!te(e)}var La=DN;function jN(e){for(var t=W(e),r=t.length;r--;){var n=t[r],o=e[n];t[r]=[n,o,La(o)]}return t}var bm=jN;function GN(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var Aa=GN;function HN(e){var t=bm(e);return t.length==1&&t[0][2]?Aa(t[0][0],t[0][1]):function(r){return r===e||Um(r,e,t)}}var Nm=HN;function KN(e,t){return e!=null&&t in Object(e)}var Cm=KN;function WN(e,t,r){t=Ir(t,e);for(var n=-1,o=t.length,i=!1;++n<o;){var a=bt(t[n]);if(!(i=e!=null&&r(e,a)))break;e=e[a]}return i||++n!=o?i:(o=e==null?0:e.length,!!o&&kn(o)&&xr(a,o)&&(b(e)||Lr(e)))}var Ua=WN;function VN(e,t){return e!=null&&Ua(e,t,Cm)}var Im=VN;var qN=1,YN=2;function zN(e,t){return Bn(e)&&La(t)?Aa(bt(e),t):function(r){var n=Ad(r,e);return n===void 0&&n===t?Im(r,e):Oa(t,n,qN|YN)}}var vm=zN;function XN(e){return function(t){return t?.[e]}}var Pm=XN;function JN(e){return function(t){return Gn(t,e)}}var Mm=JN;function QN(e){return Bn(e)?Pm(bt(e)):Mm(e)}var wm=QN;function ZN(e){return typeof e=="function"?e:e==null?at:typeof e=="object"?b(e)?vm(e[0],e[1]):Nm(e):wm(e)}var pe=ZN;function $N(e,t,r,n){for(var o=-1,i=e==null?0:e.length;++o<i;){var a=e[o];t(n,a,r(a),e)}return n}var km=$N;function eC(e){return function(t,r,n){for(var o=-1,i=Object(t),a=n(t),s=a.length;s--;){var c=a[e?s:++o];if(r(i[c],c,i)===!1)break}return t}}var _m=eC;var tC=_m(),Bm=tC;function rC(e,t){return e&&Bm(e,t,W)}var Fm=rC;function nC(e,t){return function(r,n){if(r==null)return r;if(!le(r))return e(r,n);for(var o=r.length,i=t?o:-1,a=Object(r);(t?i--:++i<o)&&n(a[i],i,a)!==!1;);return r}}var Dm=nC;var oC=Dm(Fm),Ye=oC;function iC(e,t,r,n){return Ye(e,function(o,i,a){t(n,o,r(o),a)}),n}var jm=iC;function aC(e,t){return function(r,n){var o=b(r)?km:jm,i=t?t():{};return o(r,e,pe(n,2),i)}}var Gm=aC;var Hm=Object.prototype,sC=Hm.hasOwnProperty,cC=wn(function(e,t){e=Object(e);var r=-1,n=t.length,o=n>2?t[2]:void 0;for(o&&Or(t[0],t[1],o)&&(n=1);++r<n;)for(var i=t[r],a=Ar(i),s=-1,c=a.length;++s<c;){var f=a[s],u=e[f];(u===void 0||Ot(u,Hm[f])&&!sC.call(e,f))&&(e[f]=i[f])}return e}),Zn=cC;function fC(e){return ce(e)&&le(e)}var tf=fC;function uC(e,t,r){for(var n=-1,o=e==null?0:e.length;++n<o;)if(r(t,e[n]))return!0;return!1}var ba=uC;var lC=200;function pC(e,t,r,n){var o=-1,i=aa,a=!0,s=e.length,c=[],f=t.length;if(!s)return c;r&&(t=xt(t,Ut(r))),n?(i=ba,a=!1):t.length>=lC&&(i=Jn,a=!1,t=new Xn(t));e:for(;++o<s;){var u=e[o],l=r==null?u:r(u);if(u=n||u!==0?u:0,a&&l===l){for(var p=f;p--;)if(t[p]===l)continue e;c.push(u)}else i(t,l,n)||c.push(u)}return c}var Km=pC;var dC=wn(function(e,t){return tf(e)?Km(e,Kn(t,1,tf,!0)):[]}),Mr=dC;function mC(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Ct=mC;function hC(e,t,r){var n=e==null?0:e.length;return n?(t=r||t===void 0?1:Rt(t),la(e,t<0?0:t,n)):[]}var fe=hC;function gC(e,t,r){var n=e==null?0:e.length;return n?(t=r||t===void 0?1:Rt(t),t=n-t,la(e,0,t<0?0:t)):[]}var Yt=gC;function EC(e){return typeof e=="function"?e:at}var Wm=EC;function yC(e,t){var r=b(e)?oa:Ye;return r(e,Wm(t))}var L=yC;function SC(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}var Vm=SC;function TC(e,t){var r=!0;return Ye(e,function(n,o,i){return r=!!t(n,o,i),r}),r}var qm=TC;function xC(e,t,r){var n=b(e)?Vm:qm;return r&&Or(e,t,r)&&(t=void 0),n(e,pe(t,3))}var ve=xC;function RC(e,t){var r=[];return Ye(e,function(n,o,i){t(n,o,i)&&r.push(n)}),r}var Na=RC;function OC(e,t){var r=b(e)?Vn:Na;return r(e,pe(t,3))}var Pe=OC;function LC(e){return function(t,r,n){var o=Object(t);if(!le(t)){var i=pe(r,3);t=W(t),r=function(s){return i(o[s],s,o)}}var a=e(t,r,n);return a>-1?o[i?t[a]:a]:void 0}}var Ym=LC;var AC=Math.max;function UC(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var o=r==null?0:Rt(r);return o<0&&(o=AC(n+o,0)),ia(e,pe(t,3),o)}var zm=UC;var bC=Ym(zm),It=bC;function NC(e){return e&&e.length?e[0]:void 0}var xe=NC;function CC(e,t){var r=-1,n=le(e)?Array(e.length):[];return Ye(e,function(o,i,a){n[++r]=t(o,i,a)}),n}var Xm=CC;function IC(e,t){var r=b(e)?xt:Xm;return r(e,pe(t,3))}var O=IC;function vC(e,t){return Kn(O(e,t),1)}var De=vC;var PC=Object.prototype,MC=PC.hasOwnProperty,wC=Gm(function(e,t,r){MC.call(e,r)?e[r].push(t):Mn(e,r,[t])}),rf=wC;var kC=Object.prototype,_C=kC.hasOwnProperty;function BC(e,t){return e!=null&&_C.call(e,t)}var Jm=BC;function FC(e,t){return e!=null&&Ua(e,t,Jm)}var U=FC;var DC="[object String]";function jC(e){return typeof e=="string"||!b(e)&&ce(e)&&Be(e)==DC}var Ee=jC;function GC(e,t){return xt(t,function(r){return e[r]})}var Qm=GC;function HC(e){return e==null?[]:Qm(e,W(e))}var G=HC;var KC=Math.max;function WC(e,t,r,n){e=le(e)?e:G(e),r=r&&!n?Rt(r):0;var o=e.length;return r<0&&(r=KC(o+r,0)),Ee(e)?r<=o&&e.indexOf(t,r)>-1:!!o&&Pn(e,t,r)>-1}var Z=WC;var VC=Math.max;function qC(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var o=r==null?0:Rt(r);return o<0&&(o=VC(n+o,0)),Pn(e,t,o)}var Ca=qC;var YC="[object Map]",zC="[object Set]",XC=Object.prototype,JC=XC.hasOwnProperty;function QC(e){if(e==null)return!0;if(le(e)&&(b(e)||typeof e=="string"||typeof e.splice=="function"||Vt(e)||_n(e)||Lr(e)))return!e.length;var t=mt(e);if(t==YC||t==zC)return!e.size;if(At(e))return!fa(e).length;for(var r in e)if(JC.call(e,r))return!1;return!0}var M=QC;var ZC="[object RegExp]";function $C(e){return ce(e)&&Be(e)==ZC}var Zm=$C;var $m=st&&st.isRegExp,eI=$m?Ut($m):Zm,ct=eI;function tI(e){return e===void 0}var Me=tI;var rI="Expected a function";function nI(e){if(typeof e!="function")throw new TypeError(rI);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}var eh=nI;function oI(e,t,r,n){if(!te(e))return e;t=Ir(t,e);for(var o=-1,i=t.length,a=i-1,s=e;s!=null&&++o<i;){var c=bt(t[o]),f=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(o!=a){var u=s[c];f=n?n(u,c,s):void 0,f===void 0&&(f=te(u)?u:xr(t[o+1])?[]:{})}Rr(s,c,f),s=s[c]}return e}var th=oI;function iI(e,t,r){for(var n=-1,o=t.length,i={};++n<o;){var a=t[n],s=Gn(e,a);r(s,a)&&th(i,Ir(a,e),s)}return i}var rh=iI;function aI(e,t){if(e==null)return{};var r=xt(ha(e),function(n){return[n]});return t=pe(t),rh(e,r,function(n,o){return t(n,o[0])})}var ze=aI;function sI(e,t,r,n,o){return o(e,function(i,a,s){r=n?(n=!1,i):t(r,i,a,s)}),r}var nh=sI;function cI(e,t,r){var n=b(e)?Cd:nh,o=arguments.length<3;return n(e,pe(t,4),r,o,Ye)}var de=cI;function fI(e,t){var r=b(e)?Vn:Na;return r(e,eh(pe(t,3)))}var wr=fI;function uI(e,t){var r;return Ye(e,function(n,o,i){return r=t(n,o,i),!r}),!!r}var oh=uI;function lI(e,t,r){var n=b(e)?Ta:oh;return r&&Or(e,t,r)&&(t=void 0),n(e,pe(t,3))}var Jo=lI;var pI=1/0,dI=Pr&&1/Qn(new Pr([,-0]))[1]==pI?function(e){return new Pr(e)}:re,ih=dI;var mI=200;function hI(e,t,r){var n=-1,o=aa,i=e.length,a=!0,s=[],c=s;if(r)a=!1,o=ba;else if(i>=mI){var f=t?null:ih(e);if(f)return Qn(f);a=!1,o=Jn,c=new Xn}else c=t?[]:s;e:for(;++n<i;){var u=e[n],l=t?t(u):u;if(u=r||u!==0?u:0,a&&l===l){for(var p=c.length;p--;)if(c[p]===l)continue e;t&&c.push(l),s.push(u)}else o(c,l,r)||(c!==s&&c.push(l),s.push(u))}return s}var ah=hI;function gI(e){return e&&e.length?ah(e):[]}var $n=gI;function eo(e){console&&console.error&&console.error(`Error: ${e}`)}function Qo(e){console&&console.warn&&console.warn(`Warning: ${e}`)}function Zo(e){let t=new Date().getTime(),r=e();return{time:new Date().getTime()-t,value:r}}function $o(e){function t(){}t.prototype=e;let r=new t;function n(){return typeof r.bar}return n(),n(),e;(0,eval)(e)}function EI(e){return yI(e)?e.LABEL:e.name}function yI(e){return Ee(e.LABEL)&&e.LABEL!==""}var Ze=class{get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){this._definition=t}accept(t){t.visit(this),L(this.definition,r=>{r.accept(t)})}},B=class extends Ze{constructor(t){super([]),this.idx=1,be(this,ze(t,r=>r!==void 0))}set definition(t){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(t){t.visit(this)}},je=class extends Ze{constructor(t){super(t.definition),this.orgText="",be(this,ze(t,r=>r!==void 0))}},Y=class extends Ze{constructor(t){super(t.definition),this.ignoreAmbiguities=!1,be(this,ze(t,r=>r!==void 0))}},F=class extends Ze{constructor(t){super(t.definition),this.idx=1,be(this,ze(t,r=>r!==void 0))}},z=class extends Ze{constructor(t){super(t.definition),this.idx=1,be(this,ze(t,r=>r!==void 0))}},X=class extends Ze{constructor(t){super(t.definition),this.idx=1,be(this,ze(t,r=>r!==void 0))}},k=class extends Ze{constructor(t){super(t.definition),this.idx=1,be(this,ze(t,r=>r!==void 0))}},H=class extends Ze{constructor(t){super(t.definition),this.idx=1,be(this,ze(t,r=>r!==void 0))}},K=class extends Ze{get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){super(t.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,be(this,ze(t,r=>r!==void 0))}},P=class{constructor(t){this.idx=1,be(this,ze(t,r=>r!==void 0))}accept(t){t.visit(this)}};function Ia(e){return O(e,to)}function to(e){function t(r){return O(r,to)}if(e instanceof B){let r={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return Ee(e.label)&&(r.label=e.label),r}else{if(e instanceof Y)return{type:"Alternative",definition:t(e.definition)};if(e instanceof F)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof z)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof X)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:to(new P({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof H)return{type:"RepetitionWithSeparator",idx:e.idx,separator:to(new P({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof k)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof K)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof P){let r={type:"Terminal",name:e.terminalType.name,label:EI(e.terminalType),idx:e.idx};Ee(e.label)&&(r.terminalLabel=e.label);let n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(r.pattern=ct(n)?n.source:n),r}else{if(e instanceof je)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}}}var Ge=class{visit(t){let r=t;switch(r.constructor){case B:return this.visitNonTerminal(r);case Y:return this.visitAlternative(r);case F:return this.visitOption(r);case z:return this.visitRepetitionMandatory(r);case X:return this.visitRepetitionMandatoryWithSeparator(r);case H:return this.visitRepetitionWithSeparator(r);case k:return this.visitRepetition(r);case K:return this.visitAlternation(r);case P:return this.visitTerminal(r);case je:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(t){}visitAlternative(t){}visitOption(t){}visitRepetition(t){}visitRepetitionMandatory(t){}visitRepetitionMandatoryWithSeparator(t){}visitRepetitionWithSeparator(t){}visitAlternation(t){}visitTerminal(t){}visitRule(t){}};function nf(e){return e instanceof Y||e instanceof F||e instanceof k||e instanceof z||e instanceof X||e instanceof H||e instanceof P||e instanceof je}function cn(e,t=[]){return e instanceof F||e instanceof k||e instanceof H?!0:e instanceof K?Jo(e.definition,n=>cn(n,t)):e instanceof B&&Z(t,e)?!1:e instanceof Ze?(e instanceof B&&t.push(e),ve(e.definition,n=>cn(n,t))):!1}function of(e){return e instanceof K}function Xe(e){if(e instanceof B)return"SUBRULE";if(e instanceof F)return"OPTION";if(e instanceof K)return"OR";if(e instanceof z)return"AT_LEAST_ONE";if(e instanceof X)return"AT_LEAST_ONE_SEP";if(e instanceof H)return"MANY_SEP";if(e instanceof k)return"MANY";if(e instanceof P)return"CONSUME";throw Error("non exhaustive match")}var zt=class{walk(t,r=[]){L(t.definition,(n,o)=>{let i=fe(t.definition,o+1);if(n instanceof B)this.walkProdRef(n,i,r);else if(n instanceof P)this.walkTerminal(n,i,r);else if(n instanceof Y)this.walkFlat(n,i,r);else if(n instanceof F)this.walkOption(n,i,r);else if(n instanceof z)this.walkAtLeastOne(n,i,r);else if(n instanceof X)this.walkAtLeastOneSep(n,i,r);else if(n instanceof H)this.walkManySep(n,i,r);else if(n instanceof k)this.walkMany(n,i,r);else if(n instanceof K)this.walkOr(n,i,r);else throw Error("non exhaustive match")})}walkTerminal(t,r,n){}walkProdRef(t,r,n){}walkFlat(t,r,n){let o=r.concat(n);this.walk(t,o)}walkOption(t,r,n){let o=r.concat(n);this.walk(t,o)}walkAtLeastOne(t,r,n){let o=[new F({definition:t.definition})].concat(r,n);this.walk(t,o)}walkAtLeastOneSep(t,r,n){let o=sh(t,r,n);this.walk(t,o)}walkMany(t,r,n){let o=[new F({definition:t.definition})].concat(r,n);this.walk(t,o)}walkManySep(t,r,n){let o=sh(t,r,n);this.walk(t,o)}walkOr(t,r,n){let o=r.concat(n);L(t.definition,i=>{let a=new Y({definition:[i]});this.walk(a,o)})}};function sh(e,t,r){return[new F({definition:[new P({terminalType:e.separator})].concat(e.definition)})].concat(t,r)}function fn(e){if(e instanceof B)return fn(e.referencedRule);if(e instanceof P)return xI(e);if(nf(e))return SI(e);if(of(e))return TI(e);throw Error("non exhaustive match")}function SI(e){let t=[],r=e.definition,n=0,o=r.length>n,i,a=!0;for(;o&&a;)i=r[n],a=cn(i),t=t.concat(fn(i)),n=n+1,o=r.length>n;return $n(t)}function TI(e){let t=O(e.definition,r=>fn(r));return $n(ge(t))}function xI(e){return[e.terminalType]}var va="_~IN~_";var af=class extends zt{constructor(t){super(),this.topProd=t,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(t,r,n){}walkProdRef(t,r,n){let o=RI(t.referencedRule,t.idx)+this.topProd.name,i=r.concat(n),a=new Y({definition:i}),s=fn(a);this.follows[o]=s}};function ch(e){let t={};return L(e,r=>{let n=new af(r).startWalking();be(t,n)}),t}function RI(e,t){return e.name+t+va}function C(e){return e.charCodeAt(0)}function Pa(e,t){Array.isArray(e)?e.forEach(function(r){t.push(r)}):t.push(e)}function ro(e,t){if(e[t]===!0)throw"duplicate flag "+t;let r=e[t];e[t]=!0}function un(e){if(e===void 0)throw Error("Internal Error - Should never get here!");return!0}function ei(){throw Error("Internal Error - Should never get here!")}function sf(e){return e.type==="Character"}var ti=[];for(let e=C("0");e<=C("9");e++)ti.push(e);var ri=[C("_")].concat(ti);for(let e=C("a");e<=C("z");e++)ri.push(e);for(let e=C("A");e<=C("Z");e++)ri.push(e);var cf=[C(" "),C("\f"),C(`
|
|
41
|
+
`),C("\r"),C(" "),C("\v"),C(" "),C("\xA0"),C("\u1680"),C("\u2000"),C("\u2001"),C("\u2002"),C("\u2003"),C("\u2004"),C("\u2005"),C("\u2006"),C("\u2007"),C("\u2008"),C("\u2009"),C("\u200A"),C("\u2028"),C("\u2029"),C("\u202F"),C("\u205F"),C("\u3000"),C("\uFEFF")];var OI=/[0-9a-fA-F]/,Ma=/[0-9]/,LI=/[1-9]/,ni=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(t){this.idx=t.idx,this.input=t.input,this.groupIdx=t.groupIdx}pattern(t){this.idx=0,this.input=t,this.groupIdx=0,this.consumeChar("/");let r=this.disjunction();this.consumeChar("/");let n={type:"Flags",loc:{begin:this.idx,end:t.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":ro(n,"global");break;case"i":ro(n,"ignoreCase");break;case"m":ro(n,"multiLine");break;case"u":ro(n,"unicode");break;case"y":ro(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){let t=[],r=this.idx;for(t.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),t.push(this.alternative());return{type:"Disjunction",value:t,loc:this.loc(r)}}alternative(){let t=[],r=this.idx;for(;this.isTerm();)t.push(this.term());return{type:"Alternative",value:t,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let t=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(t)};case"$":return{type:"EndAnchor",loc:this.loc(t)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(t)};case"B":return{type:"NonWordBoundary",loc:this.loc(t)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break}un(r);let n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(t)}}return ei()}quantifier(t=!1){let r,n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":let o=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:o,atMost:o};break;case",":let i;this.isDigit()?(i=this.integerIncludingZero(),r={atLeast:o,atMost:i}):r={atLeast:o,atMost:1/0},this.consumeChar("}");break}if(t===!0&&r===void 0)return;un(r);break}if(!(t===!0&&r===void 0)&&un(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let t,r=this.idx;switch(this.peekChar()){case".":t=this.dotAll();break;case"\\":t=this.atomEscape();break;case"[":t=this.characterClass();break;case"(":t=this.group();break}return t===void 0&&this.isPatternCharacter()&&(t=this.patternCharacter()),un(t)?(t.loc=this.loc(r),this.isQuantifier()&&(t.quantifier=this.quantifier()),t):ei()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[C(`
|
|
42
|
+
`),C("\r"),C("\u2028"),C("\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 t,r=!1;switch(this.popChar()){case"d":t=ti;break;case"D":t=ti,r=!0;break;case"s":t=cf;break;case"S":t=cf,r=!0;break;case"w":t=ri;break;case"W":t=ri,r=!0;break}return un(t)?{type:"Set",value:t,complement:r}:ei()}controlEscapeAtom(){let t;switch(this.popChar()){case"f":t=C("\f");break;case"n":t=C(`
|
|
43
|
+
`);break;case"r":t=C("\r");break;case"t":t=C(" ");break;case"v":t=C("\v");break}return un(t)?{type:"Character",value:t}:ei()}controlLetterEscapeAtom(){this.consumeChar("c");let t=this.popChar();if(/[a-zA-Z]/.test(t)===!1)throw Error("Invalid ");return{type:"Character",value:t.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:C("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){let t=this.popChar();return{type:"Character",value:C(t)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
44
|
+
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let t=this.popChar();return{type:"Character",value:C(t)}}}characterClass(){let t=[],r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){let n=this.classAtom(),o=n.type==="Character";if(sf(n)&&this.isRangeDash()){this.consumeChar("-");let i=this.classAtom(),a=i.type==="Character";if(sf(i)){if(i.value<n.value)throw Error("Range out of order in character class");t.push({from:n.value,to:i.value})}else Pa(n.value,t),t.push(C("-")),Pa(i.value,t)}else Pa(n.value,t)}return this.consumeChar("]"),{type:"Set",complement:r,value:t}}classAtom(){switch(this.peekChar()){case"]":case`
|
|
45
|
+
`: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:C("\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 t=!0;this.consumeChar("("),this.peekChar(0)==="?"?(this.consumeChar("?"),this.consumeChar(":"),t=!1):this.groupIdx++;let r=this.disjunction();this.consumeChar(")");let n={type:"Group",capturing:t,value:r};return t&&(n.idx=this.groupIdx),n}positiveInteger(){let t=this.popChar();if(LI.test(t)===!1)throw Error("Expecting a positive integer");for(;Ma.test(this.peekChar(0));)t+=this.popChar();return parseInt(t,10)}integerIncludingZero(){let t=this.popChar();if(Ma.test(t)===!1)throw Error("Expecting an integer");for(;Ma.test(this.peekChar(0));)t+=this.popChar();return parseInt(t,10)}patternCharacter(){let t=this.popChar();switch(t){case`
|
|
46
|
+
`: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:C(t)}}}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 Ma.test(this.peekChar(0))}isClassAtom(t=0){switch(this.peekChar(t)){case"]":case`
|
|
47
|
+
`: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(){let t=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(t)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
|
|
48
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(t){let r="";for(let o=0;o<t;o++){let i=this.popChar();if(OI.test(i)===!1)throw Error("Expecting a HexDecimal digits");r+=i}return{type:"Character",value:parseInt(r,16)}}peekChar(t=0){return this.input[this.idx+t]}popChar(){let t=this.peekChar(0);return this.consumeChar(void 0),t}consumeChar(t){if(t!==void 0&&this.input[this.idx]!==t)throw Error("Expected: '"+t+"' 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(t){return{begin:t,end:this.idx}}};var kr=class{visitChildren(t){for(let r in t){let n=t[r];t.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(o=>{this.visit(o)},this))}}visit(t){switch(t.type){case"Pattern":this.visitPattern(t);break;case"Flags":this.visitFlags(t);break;case"Disjunction":this.visitDisjunction(t);break;case"Alternative":this.visitAlternative(t);break;case"StartAnchor":this.visitStartAnchor(t);break;case"EndAnchor":this.visitEndAnchor(t);break;case"WordBoundary":this.visitWordBoundary(t);break;case"NonWordBoundary":this.visitNonWordBoundary(t);break;case"Lookahead":this.visitLookahead(t);break;case"NegativeLookahead":this.visitNegativeLookahead(t);break;case"Character":this.visitCharacter(t);break;case"Set":this.visitSet(t);break;case"Group":this.visitGroup(t);break;case"GroupBackReference":this.visitGroupBackReference(t);break;case"Quantifier":this.visitQuantifier(t);break}this.visitChildren(t)}visitPattern(t){}visitFlags(t){}visitDisjunction(t){}visitAlternative(t){}visitStartAnchor(t){}visitEndAnchor(t){}visitWordBoundary(t){}visitNonWordBoundary(t){}visitLookahead(t){}visitNegativeLookahead(t){}visitCharacter(t){}visitSet(t){}visitGroup(t){}visitGroupBackReference(t){}visitQuantifier(t){}};var wa={},AI=new ni;function no(e){let t=e.toString();if(wa.hasOwnProperty(t))return wa[t];{let r=AI.pattern(t);return wa[t]=r,r}}function fh(){wa={}}var lh="Complement Sets are not supported for first char optimization",oi=`Unable to use "first char" lexer optimizations:
|
|
49
|
+
`;function ph(e,t=!1){try{let r=no(e);return ff(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===lh)t&&Qo(`${oi} Unable to optimize: < ${e.toString()} >
|
|
50
|
+
Complement Sets cannot be automatically optimized.
|
|
51
|
+
This will disable the lexer's first char optimizations.
|
|
52
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n=`
|
|
53
|
+
This will disable the lexer's first char optimizations.
|
|
54
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),eo(`${oi}
|
|
55
|
+
Failed parsing: < ${e.toString()} >
|
|
56
|
+
Using the @chevrotain/regexp-to-ast library
|
|
57
|
+
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function ff(e,t,r){switch(e.type){case"Disjunction":for(let o=0;o<e.value.length;o++)ff(e.value[o],t,r);break;case"Alternative":let n=e.value;for(let o=0;o<n.length;o++){let i=n[o];switch(i.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}let a=i;switch(a.type){case"Character":ka(a.value,t,r);break;case"Set":if(a.complement===!0)throw Error(lh);L(a.value,c=>{if(typeof c=="number")ka(c,t,r);else{let f=c;if(r===!0)for(let u=f.from;u<=f.to;u++)ka(u,t,r);else{for(let u=f.from;u<=f.to&&u<oo;u++)ka(u,t,r);if(f.to>=oo){let u=f.from>=oo?f.from:oo,l=f.to,p=vt(u),m=vt(l);for(let E=p;E<=m;E++)t[E]=E}}}});break;case"Group":ff(a.value,t,r);break;default:throw Error("Non Exhaustive Match")}let s=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type==="Group"&&uf(a)===!1||a.type!=="Group"&&s===!1)break}break;default:throw Error("non exhaustive match!")}return G(t)}function ka(e,t,r){let n=vt(e);t[n]=n,r===!0&&UI(e,t)}function UI(e,t){let r=String.fromCharCode(e),n=r.toUpperCase();if(n!==r){let o=vt(n.charCodeAt(0));t[o]=o}else{let o=r.toLowerCase();if(o!==r){let i=vt(o.charCodeAt(0));t[i]=i}}}function uh(e,t){return It(e.value,r=>{if(typeof r=="number")return Z(t,r);{let n=r;return It(t,o=>n.from<=o&&o<=n.to)!==void 0}})}function uf(e){let t=e.quantifier;return t&&t.atLeast===0?!0:e.value?b(e.value)?ve(e.value,uf):uf(e.value):!1}var lf=class extends kr{constructor(t){super(),this.targetCharCodes=t,this.found=!1}visitChildren(t){if(this.found!==!0){switch(t.type){case"Lookahead":this.visitLookahead(t);return;case"NegativeLookahead":this.visitNegativeLookahead(t);return}super.visitChildren(t)}}visitCharacter(t){Z(this.targetCharCodes,t.value)&&(this.found=!0)}visitSet(t){t.complement?uh(t,this.targetCharCodes)===void 0&&(this.found=!0):uh(t,this.targetCharCodes)!==void 0&&(this.found=!0)}};function _a(e,t){if(t instanceof RegExp){let r=no(t),n=new lf(e);return n.visit(r),n.found}else return It(t,r=>Z(e,r.charCodeAt(0)))!==void 0}var ln="PATTERN",io="defaultMode",Ba="modes",df=typeof new RegExp("(?:)").sticky=="boolean";function hh(e,t){t=Zn(t,{useSticky:df,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
58
|
+
`],tracer:(g,h)=>h()});let r=t.tracer;r("initCharCodeToOptimizedIndexMap",()=>{WI()});let n;r("Reject Lexer.NA",()=>{n=wr(e,g=>g[ln]===D.NA)});let o=!1,i;r("Transform Patterns",()=>{o=!1,i=O(n,g=>{let h=g[ln];if(ct(h)){let x=h.source;return x.length===1&&x!=="^"&&x!=="$"&&x!=="."&&!h.ignoreCase?x:x.length===2&&x[0]==="\\"&&!Z(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],x[1])?x[1]:t.useSticky?mh(h):dh(h)}else{if(Fe(h))return o=!0,{exec:h};if(typeof h=="object")return o=!0,h;if(typeof h=="string"){if(h.length===1)return h;{let x=h.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),N=new RegExp(x);return t.useSticky?mh(N):dh(N)}}else throw Error("non exhaustive match")}})});let a,s,c,f,u;r("misc mapping",()=>{a=O(n,g=>g.tokenTypeIdx),s=O(n,g=>{let h=g.GROUP;if(h!==D.SKIPPED){if(Ee(h))return h;if(Me(h))return!1;throw Error("non exhaustive match")}}),c=O(n,g=>{let h=g.LONGER_ALT;if(h)return b(h)?O(h,N=>Ca(n,N)):[Ca(n,h)]}),f=O(n,g=>g.PUSH_MODE),u=O(n,g=>U(g,"POP_MODE"))});let l;r("Line Terminator Handling",()=>{let g=Oh(t.lineTerminatorCharacters);l=O(n,h=>!1),t.positionTracking!=="onlyOffset"&&(l=O(n,h=>U(h,"LINE_BREAKS")?!!h.LINE_BREAKS:Rh(h,g)===!1&&_a(g,h.PATTERN)))});let p,m,E,y;r("Misc Mapping #2",()=>{p=O(n,Th),m=O(i,HI),E=de(n,(g,h)=>{let x=h.GROUP;return Ee(x)&&x!==D.SKIPPED&&(g[x]=[]),g},{}),y=O(i,(g,h)=>({pattern:i[h],longerAlt:c[h],canLineTerminator:l[h],isCustom:p[h],short:m[h],group:s[h],push:f[h],pop:u[h],tokenTypeIdx:a[h],tokenType:n[h]}))});let S=!0,d=[];return t.safeMode||r("First Char Optimization",()=>{d=de(n,(g,h,x)=>{if(typeof h.PATTERN=="string"){let N=h.PATTERN.charCodeAt(0),Ce=vt(N);pf(g,Ce,y[x])}else if(b(h.START_CHARS_HINT)){let N;L(h.START_CHARS_HINT,Ce=>{let _t=typeof Ce=="string"?Ce.charCodeAt(0):Ce,Je=vt(_t);N!==Je&&(N=Je,pf(g,Je,y[x]))})}else if(ct(h.PATTERN))if(h.PATTERN.unicode)S=!1,t.ensureOptimizations&&eo(`${oi} Unable to analyze < ${h.PATTERN.toString()} > pattern.
|
|
59
|
+
The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
|
60
|
+
This will disable the lexer's first char optimizations.
|
|
61
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let N=ph(h.PATTERN,t.ensureOptimizations);M(N)&&(S=!1),L(N,Ce=>{pf(g,Ce,y[x])})}else t.ensureOptimizations&&eo(`${oi} TokenType: <${h.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
|
|
62
|
+
This will disable the lexer's first char optimizations.
|
|
63
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),S=!1;return g},[])}),{emptyGroups:E,patternIdxToConfig:y,charCodeToPatternIdxToConfig:d,hasCustom:o,canBeOptimized:S}}function gh(e,t){let r=[],n=NI(e);r=r.concat(n.errors);let o=CI(n.valid),i=o.valid;return r=r.concat(o.errors),r=r.concat(bI(i)),r=r.concat(BI(i)),r=r.concat(FI(i,t)),r=r.concat(DI(i)),r}function bI(e){let t=[],r=Pe(e,n=>ct(n[ln]));return t=t.concat(vI(r)),t=t.concat(wI(r)),t=t.concat(kI(r)),t=t.concat(_I(r)),t=t.concat(PI(r)),t}function NI(e){let t=Pe(e,o=>!U(o,ln)),r=O(t,o=>({message:"Token Type: ->"+o.name+"<- missing static 'PATTERN' property",type:$.MISSING_PATTERN,tokenTypes:[o]})),n=Mr(e,t);return{errors:r,valid:n}}function CI(e){let t=Pe(e,o=>{let i=o[ln];return!ct(i)&&!Fe(i)&&!U(i,"exec")&&!Ee(i)}),r=O(t,o=>({message:"Token Type: ->"+o.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:$.INVALID_PATTERN,tokenTypes:[o]})),n=Mr(e,t);return{errors:r,valid:n}}var II=/[^\\][$]/;function vI(e){class t extends kr{constructor(){super(...arguments),this.found=!1}visitEndAnchor(i){this.found=!0}}let r=Pe(e,o=>{let i=o.PATTERN;try{let a=no(i),s=new t;return s.visit(a),s.found}catch{return II.test(i.source)}});return O(r,o=>({message:`Unexpected RegExp Anchor Error:
|
|
64
|
+
Token Type: ->`+o.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
65
|
+
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:$.EOI_ANCHOR_FOUND,tokenTypes:[o]}))}function PI(e){let t=Pe(e,n=>n.PATTERN.test(""));return O(t,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:$.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}var MI=/[^\\[][\^]|^\^/;function wI(e){class t extends kr{constructor(){super(...arguments),this.found=!1}visitStartAnchor(i){this.found=!0}}let r=Pe(e,o=>{let i=o.PATTERN;try{let a=no(i),s=new t;return s.visit(a),s.found}catch{return MI.test(i.source)}});return O(r,o=>({message:`Unexpected RegExp Anchor Error:
|
|
66
|
+
Token Type: ->`+o.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
67
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:$.SOI_ANCHOR_FOUND,tokenTypes:[o]}))}function kI(e){let t=Pe(e,n=>{let o=n[ln];return o instanceof RegExp&&(o.multiline||o.global)});return O(t,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:$.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function _I(e){let t=[],r=O(e,i=>de(e,(a,s)=>(i.PATTERN.source===s.PATTERN.source&&!Z(t,s)&&s.PATTERN!==D.NA&&(t.push(s),a.push(s)),a),[]));r=Nt(r);let n=Pe(r,i=>i.length>1);return O(n,i=>{let a=O(i,c=>c.name);return{message:`The same RegExp pattern ->${xe(i).PATTERN}<-has been used in all of the following Token Types: ${a.join(", ")} <-`,type:$.DUPLICATE_PATTERNS_FOUND,tokenTypes:i}})}function BI(e){let t=Pe(e,n=>{if(!U(n,"GROUP"))return!1;let o=n.GROUP;return o!==D.SKIPPED&&o!==D.NA&&!Ee(o)});return O(t,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:$.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function FI(e,t){let r=Pe(e,o=>o.PUSH_MODE!==void 0&&!Z(t,o.PUSH_MODE));return O(r,o=>({message:`Token Type: ->${o.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${o.PUSH_MODE}<-which does not exist`,type:$.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[o]}))}function DI(e){let t=[],r=de(e,(n,o,i)=>{let a=o.PATTERN;return a===D.NA||(Ee(a)?n.push({str:a,idx:i,tokenType:o}):ct(a)&&GI(a)&&n.push({str:a.source,idx:i,tokenType:o})),n},[]);return L(e,(n,o)=>{L(r,({str:i,idx:a,tokenType:s})=>{if(o<a&&jI(i,n.PATTERN)){let c=`Token: ->${s.name}<- can never be matched.
|
|
68
|
+
Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition.
|
|
69
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:c,type:$.UNREACHABLE_PATTERN,tokenTypes:[n,s]})}})}),t}function jI(e,t){if(ct(t)){let r=t.exec(e);return r!==null&&r.index===0}else{if(Fe(t))return t(e,0,[],{});if(U(t,"exec"))return t.exec(e,0,[],{});if(typeof t=="string")return t===e;throw Error("non exhaustive match")}}function GI(e){return It([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>e.source.indexOf(r)!==-1)===void 0}function dh(e){let t=e.ignoreCase?"i":"";return new RegExp(`^(?:${e.source})`,t)}function mh(e){let t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function Eh(e,t,r){let n=[];return U(e,io)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+io+`> property in its definition
|
|
70
|
+
`,type:$.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),U(e,Ba)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ba+`> property in its definition
|
|
71
|
+
`,type:$.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),U(e,Ba)&&U(e,io)&&!U(e.modes,e.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${io}: <${e.defaultMode}>which does not exist
|
|
72
|
+
`,type:$.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),U(e,Ba)&&L(e.modes,(o,i)=>{L(o,(a,s)=>{if(Me(a))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${i}> at index: <${s}>
|
|
73
|
+
`,type:$.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(U(a,"LONGER_ALT")){let c=b(a.LONGER_ALT)?a.LONGER_ALT:[a.LONGER_ALT];L(c,f=>{!Me(f)&&!Z(o,f)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${f.name}> on token <${a.name}> outside of mode <${i}>
|
|
74
|
+
`,type:$.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function yh(e,t,r){let n=[],o=!1,i=Nt(ge(G(e.modes))),a=wr(i,c=>c[ln]===D.NA),s=Oh(r);return t&&L(a,c=>{let f=Rh(c,s);if(f!==!1){let l={message:KI(c,f),type:f.issue,tokenType:c};n.push(l)}else U(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(o=!0):_a(s,c.PATTERN)&&(o=!0)}),t&&!o&&n.push({message:`Warning: No LINE_BREAKS Found.
|
|
75
|
+
This Lexer has been defined to track line and column information,
|
|
76
|
+
But none of the Token Types can be identified as matching a line terminator.
|
|
77
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
78
|
+
for details.`,type:$.NO_LINE_BREAKS_FLAGS}),n}function Sh(e){let t={},r=W(e);return L(r,n=>{let o=e[n];if(b(o))t[n]=[];else throw Error("non exhaustive match")}),t}function Th(e){let t=e.PATTERN;if(ct(t))return!1;if(Fe(t))return!0;if(U(t,"exec"))return!0;if(Ee(t))return!1;throw Error("non exhaustive match")}function HI(e){return Ee(e)&&e.length===1?e.charCodeAt(0):!1}var xh={test:function(e){let t=e.length;for(let r=this.lastIndex;r<t;r++){let n=e.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return e.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function Rh(e,t){if(U(e,"LINE_BREAKS"))return!1;if(ct(e.PATTERN)){try{_a(t,e.PATTERN)}catch(r){return{issue:$.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(Ee(e.PATTERN))return!1;if(Th(e))return{issue:$.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function KI(e,t){if(t.issue===$.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|
79
|
+
The problem is in the <${e.name}> Token Type
|
|
80
|
+
Root cause: ${t.errMsg}.
|
|
81
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===$.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
82
|
+
The problem is in the <${e.name}> Token Type
|
|
83
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function Oh(e){return O(e,r=>Ee(r)?r.charCodeAt(0):r)}function pf(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}var oo=256,Fa=[];function vt(e){return e<oo?e:Fa[e]}function WI(){if(M(Fa)){Fa=new Array(65536);for(let e=0;e<65536;e++)Fa[e]=e>255?255+~~(e/255):e}}function Xt(e,t){let r=e.tokenTypeIdx;return r===t.tokenTypeIdx?!0:t.isParent===!0&&t.categoryMatchesMap[r]===!0}function ao(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}var Lh=1,Uh={};function Jt(e){let t=VI(e);qI(t),zI(t),YI(t),L(t,r=>{r.isParent=r.categoryMatches.length>0})}function VI(e){let t=q(e),r=e,n=!0;for(;n;){r=Nt(ge(O(r,i=>i.CATEGORIES)));let o=Mr(r,t);t=t.concat(o),M(o)?n=!1:r=o}return t}function qI(e){L(e,t=>{mf(t)||(Uh[Lh]=t,t.tokenTypeIdx=Lh++),Ah(t)&&!b(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),Ah(t)||(t.CATEGORIES=[]),XI(t)||(t.categoryMatches=[]),JI(t)||(t.categoryMatchesMap={})})}function YI(e){L(e,t=>{t.categoryMatches=[],L(t.categoryMatchesMap,(r,n)=>{t.categoryMatches.push(Uh[n].tokenTypeIdx)})})}function zI(e){L(e,t=>{bh([],t)})}function bh(e,t){L(e,r=>{t.categoryMatchesMap[r.tokenTypeIdx]=!0}),L(t.CATEGORIES,r=>{let n=e.concat(t);Z(n,r)||bh(n,r)})}function mf(e){return U(e,"tokenTypeIdx")}function Ah(e){return U(e,"CATEGORIES")}function XI(e){return U(e,"categoryMatches")}function JI(e){return U(e,"categoryMatchesMap")}function Nh(e){return U(e,"tokenTypeIdx")}var hf={buildUnableToPopLexerModeMessage(e){return`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(e,t,r,n,o){return`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${r} characters.`}};var $;(function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})($||($={}));var ii={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
84
|
+
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:hf,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(ii);var D=class{constructor(t,r=ii){if(this.lexerDefinition=t,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=(o,i)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let a=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${a}--> <${o}>`);let{time:s,value:c}=Zo(i),f=s>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&f(`${a}<-- <${o}> time: ${s}ms`),this.traceInitIndent--,c}else return i()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
85
|
+
a boolean 2nd argument is no longer supported`);this.config=be({},ii,r);let n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let o,i=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===ii.lineTerminatorsPattern)this.config.lineTerminatorsPattern=xh;else if(this.config.lineTerminatorCharacters===ii.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
86
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),b(t)?o={modes:{defaultMode:q(t)},defaultMode:io}:(i=!1,o=q(t))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Eh(o,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(yh(o,this.trackStartLines,this.config.lineTerminatorCharacters))})),o.modes=o.modes?o.modes:{},L(o.modes,(s,c)=>{o.modes[c]=wr(s,f=>Me(f))});let a=W(o.modes);if(L(o.modes,(s,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(gh(s,a))}),M(this.lexerDefinitionErrors)){Jt(s);let f;this.TRACE_INIT("analyzeTokenTypes",()=>{f=hh(s,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[c]=f.patternIdxToConfig,this.charCodeToPatternIdxToConfig[c]=f.charCodeToPatternIdxToConfig,this.emptyGroups=be({},this.emptyGroups,f.emptyGroups),this.hasCustom=f.hasCustom||this.hasCustom,this.canModeBeOptimized[c]=f.canBeOptimized}})}),this.defaultMode=o.defaultMode,!M(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let c=O(this.lexerDefinitionErrors,f=>f.message).join(`-----------------------
|
|
87
|
+
`);throw new Error(`Errors detected in definition of Lexer:
|
|
88
|
+
`+c)}L(this.lexerDefinitionWarning,s=>{Qo(s.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(df?(this.chopInput=at,this.match=this.matchWithTest):(this.updateLastIndex=re,this.match=this.matchWithExec),i&&(this.handleModes=re),this.trackStartLines===!1&&(this.computeNewColumn=at),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=re),/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",()=>{let s=de(this.canModeBeOptimized,(c,f,u)=>(f===!1&&c.push(u),c),[]);if(r.ensureOptimizations&&!M(s))throw Error(`Lexer Modes: < ${s.join(", ")} > cannot be optimized.
|
|
89
|
+
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
90
|
+
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{fh()}),this.TRACE_INIT("toFastProperties",()=>{$o(this)})})}tokenize(t,r=this.defaultMode){if(!M(this.lexerDefinitionErrors)){let o=O(this.lexerDefinitionErrors,i=>i.message).join(`-----------------------
|
|
91
|
+
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
92
|
+
`+o)}return this.tokenizeInternal(t,r)}tokenizeInternal(t,r){let n,o,i,a,s,c,f,u,l,p,m,E,y,S,d,g,h=t,x=h.length,N=0,Ce=0,_t=this.hasCustom?0:Math.floor(t.length/10),Je=new Array(_t),cr=[],Bt=this.trackStartLines?1:void 0,ke=this.trackStartLines?1:void 0,On=Sh(this.emptyGroups),lx=this.trackStartLines,fc=this.config.lineTerminatorsPattern,ki=0,fr=[],Fo=[],_i=[],Du=[];Object.freeze(Du);let Do;function ju(){return fr}function Gu(Ie){let ot=vt(Ie),Ln=Fo[ot];return Ln===void 0?Du:Ln}let px=Ie=>{if(_i.length===1&&Ie.tokenType.PUSH_MODE===void 0){let ot=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Ie);cr.push({offset:Ie.startOffset,line:Ie.startLine,column:Ie.startColumn,length:Ie.image.length,message:ot})}else{_i.pop();let ot=Ct(_i);fr=this.patternIdxToConfig[ot],Fo=this.charCodeToPatternIdxToConfig[ot],ki=fr.length;let Ln=this.canModeBeOptimized[ot]&&this.config.safeMode===!1;Fo&&Ln?Do=Gu:Do=ju}};function Hu(Ie){_i.push(Ie),Fo=this.charCodeToPatternIdxToConfig[Ie],fr=this.patternIdxToConfig[Ie],ki=fr.length,ki=fr.length;let ot=this.canModeBeOptimized[Ie]&&this.config.safeMode===!1;Fo&&ot?Do=Gu:Do=ju}Hu.call(this,r);let pt,Ku=this.config.recoveryEnabled;for(;N<x;){c=null;let Ie=h.charCodeAt(N),ot=Do(Ie),Ln=ot.length;for(n=0;n<Ln;n++){pt=ot[n];let Qe=pt.pattern;f=null;let Ft=pt.short;if(Ft!==!1?Ie===Ft&&(c=Qe):pt.isCustom===!0?(g=Qe.exec(h,N,Je,On),g!==null?(c=g[0],g.payload!==void 0&&(f=g.payload)):c=null):(this.updateLastIndex(Qe,N),c=this.match(Qe,t,N)),c!==null){if(s=pt.longerAlt,s!==void 0){let ur=s.length;for(i=0;i<ur;i++){let Dt=fr[s[i]],nn=Dt.pattern;if(u=null,Dt.isCustom===!0?(g=nn.exec(h,N,Je,On),g!==null?(a=g[0],g.payload!==void 0&&(u=g.payload)):a=null):(this.updateLastIndex(nn,N),a=this.match(nn,t,N)),a&&a.length>c.length){c=a,f=u,pt=Dt;break}}}break}}if(c!==null){if(l=c.length,p=pt.group,p!==void 0&&(m=pt.tokenTypeIdx,E=this.createTokenInstance(c,N,m,pt.tokenType,Bt,ke,l),this.handlePayload(E,f),p===!1?Ce=this.addToken(Je,Ce,E):On[p].push(E)),t=this.chopInput(t,l),N=N+l,ke=this.computeNewColumn(ke,l),lx===!0&&pt.canLineTerminator===!0){let Qe=0,Ft,ur;fc.lastIndex=0;do Ft=fc.test(c),Ft===!0&&(ur=fc.lastIndex-1,Qe++);while(Ft===!0);Qe!==0&&(Bt=Bt+Qe,ke=l-ur,this.updateTokenEndLineColumnLocation(E,p,ur,Qe,Bt,ke,l))}this.handleModes(pt,px,Hu,E)}else{let Qe=N,Ft=Bt,ur=ke,Dt=Ku===!1;for(;Dt===!1&&N<x;)for(t=this.chopInput(t,1),N++,o=0;o<ki;o++){let nn=fr[o],uc=nn.pattern,Wu=nn.short;if(Wu!==!1?h.charCodeAt(N)===Wu&&(Dt=!0):nn.isCustom===!0?Dt=uc.exec(h,N,Je,On)!==null:(this.updateLastIndex(uc,N),Dt=uc.exec(t)!==null),Dt===!0)break}if(y=N-Qe,ke=this.computeNewColumn(ke,y),d=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(h,Qe,y,Ft,ur),cr.push({offset:Qe,line:Ft,column:ur,length:y,message:d}),Ku===!1)break}}return this.hasCustom||(Je.length=Ce),{tokens:Je,groups:On,errors:cr}}handleModes(t,r,n,o){if(t.pop===!0){let i=t.push;r(o),i!==void 0&&n.call(this,i)}else t.push!==void 0&&n.call(this,t.push)}chopInput(t,r){return t.substring(r)}updateLastIndex(t,r){t.lastIndex=r}updateTokenEndLineColumnLocation(t,r,n,o,i,a,s){let c,f;r!==void 0&&(c=n===s-1,f=c?-1:0,o===1&&c===!0||(t.endLine=i+f,t.endColumn=a-1+-f))}computeNewColumn(t,r){return t+r}createOffsetOnlyToken(t,r,n,o){return{image:t,startOffset:r,tokenTypeIdx:n,tokenType:o}}createStartOnlyToken(t,r,n,o,i,a){return{image:t,startOffset:r,startLine:i,startColumn:a,tokenTypeIdx:n,tokenType:o}}createFullToken(t,r,n,o,i,a,s){return{image:t,startOffset:r,endOffset:r+s-1,startLine:i,endLine:i,startColumn:a,endColumn:a+s-1,tokenTypeIdx:n,tokenType:o}}addTokenUsingPush(t,r,n){return t.push(n),r}addTokenUsingMemberAccess(t,r,n){return t[r]=n,r++,r}handlePayloadNoCustom(t,r){}handlePayloadWithCustom(t,r){r!==null&&(t.payload=r)}matchWithTest(t,r,n){return t.test(r)===!0?r.substring(n,t.lastIndex):null}matchWithExec(t,r){let n=t.exec(r);return n!==null?n[0]:null}};D.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.";D.NA=/NOT_APPLICABLE/;function Qt(e){return gf(e)?e.LABEL:e.name}function gf(e){return Ee(e.LABEL)&&e.LABEL!==""}var QI="parent",Ch="categories",Ih="label",vh="group",Ph="push_mode",Mh="pop_mode",wh="longer_alt",kh="line_breaks",_h="start_chars_hint";function pn(e){return ZI(e)}function ZI(e){let t=e.pattern,r={};if(r.name=e.name,Me(t)||(r.PATTERN=t),U(e,QI))throw`The parent property is no longer supported.
|
|
93
|
+
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return U(e,Ch)&&(r.CATEGORIES=e[Ch]),Jt([r]),U(e,Ih)&&(r.LABEL=e[Ih]),U(e,vh)&&(r.GROUP=e[vh]),U(e,Mh)&&(r.POP_MODE=e[Mh]),U(e,Ph)&&(r.PUSH_MODE=e[Ph]),U(e,wh)&&(r.LONGER_ALT=e[wh]),U(e,kh)&&(r.LINE_BREAKS=e[kh]),U(e,_h)&&(r.START_CHARS_HINT=e[_h]),r}var $e=pn({name:"EOF",pattern:D.NA});Jt([$e]);function dn(e,t,r,n,o,i,a,s){return{image:t,startOffset:r,endOffset:n,startLine:o,endLine:i,startColumn:a,endColumn:s,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}function v(e,t){return Xt(e,t)}var Da={buildMismatchTokenMessage({expected:e,actual:t,previous:r,ruleName:n}){return`Expecting ${gf(e)?`--> ${Qt(e)} <--`:`token of type --> ${e.name} <--`} but found --> '${t.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:e,ruleName:t}){return"Redundant input, expecting EOF but found: "+e.image},buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:r,customUserDescription:n,ruleName:o}){let i="Expecting: ",s=`
|
|
94
|
+
but found: '`+xe(t).image+"'";if(n)return i+n+s;{let c=de(e,(p,m)=>p.concat(m),[]),f=O(c,p=>`[${O(p,m=>Qt(m)).join(", ")}]`),l=`one of these possible Token sequences:
|
|
95
|
+
${O(f,(p,m)=>` ${m+1}. ${p}`).join(`
|
|
96
|
+
`)}`;return i+l+s}},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:r,ruleName:n}){let o="Expecting: ",a=`
|
|
97
|
+
but found: '`+xe(t).image+"'";if(r)return o+r+a;{let c=`expecting at least one iteration which starts with one of these possible Token sequences::
|
|
98
|
+
<${O(e,f=>`[${O(f,u=>Qt(u)).join(",")}]`).join(" ,")}>`;return o+c+a}}};Object.freeze(Da);var Bh={buildRuleNotFoundError(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+`<-
|
|
99
|
+
inside top level rule: ->`+e.name+"<-"}},ht={buildDuplicateFoundError(e,t){function r(u){return u instanceof P?u.terminalType.name:u instanceof B?u.nonTerminalName:""}let n=e.name,o=xe(t),i=o.idx,a=Xe(o),s=r(o),c=i>0,f=`->${a}${c?i:""}<- ${s?`with argument: ->${s}<-`:""}
|
|
100
|
+
appears more than once (${t.length} times) in the top level rule: ->${n}<-.
|
|
101
|
+
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
102
|
+
`;return f=f.replace(/[ \t]+/g," "),f=f.replace(/\s\s+/g,`
|
|
103
|
+
`),f},buildNamespaceConflictError(e){return`Namespace conflict found in grammar.
|
|
104
|
+
The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.
|
|
105
|
+
To resolve this make sure each Terminal and Non-Terminal names are unique
|
|
106
|
+
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
|
|
107
|
+
and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(e){let t=O(e.prefixPath,o=>Qt(o)).join(", "),r=e.alternation.idx===0?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix
|
|
108
|
+
in <OR${r}> inside <${e.topLevelRule.name}> Rule,
|
|
109
|
+
<${t}> may appears as a prefix path in all these alternatives.
|
|
110
|
+
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
|
|
111
|
+
For Further details.`},buildAlternationAmbiguityError(e){let t=O(e.prefixPath,o=>Qt(o)).join(", "),r=e.alternation.idx===0?"":e.alternation.idx,n=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in <OR${r}> inside <${e.topLevelRule.name}> Rule,
|
|
112
|
+
<${t}> may appears as a prefix path in all these alternatives.
|
|
113
|
+
`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
114
|
+
For Further details.`,n},buildEmptyRepetitionError(e){let t=Xe(e.repetition);return e.repetition.idx!==0&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.
|
|
115
|
+
This could lead to an infinite loop.`},buildTokenNameError(e){return"deprecated"},buildEmptyAlternationError(e){return`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in <OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.
|
|
116
|
+
Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(e){return`An Alternation cannot have more than 256 alternatives:
|
|
117
|
+
<OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.
|
|
118
|
+
has ${e.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(e){let t=e.topLevelRule.name,r=O(e.leftRecursionPath,i=>i.name),n=`${t} --> ${r.concat([t]).join(" --> ")}`;return`Left Recursion found in grammar.
|
|
119
|
+
rule: <${t}> can be invoked from itself (directly or indirectly)
|
|
120
|
+
without consuming any Tokens. The grammar path that causes this is:
|
|
121
|
+
${n}
|
|
122
|
+
To fix this refactor your grammar to remove the left recursion.
|
|
123
|
+
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(e){return"deprecated"},buildDuplicateRuleNameError(e){let t;return e.topLevelRule instanceof je?t=e.topLevelRule.name:t=e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};function Fh(e,t){let r=new Ef(e,t);return r.resolveRefs(),r.errors}var Ef=class extends Ge{constructor(t,r){super(),this.nameToTopRule=t,this.errMsgProvider=r,this.errors=[]}resolveRefs(){L(G(this.nameToTopRule),t=>{this.currTopLevel=t,t.accept(this)})}visitNonTerminal(t){let r=this.nameToTopRule[t.nonTerminalName];if(r)t.referencedRule=r;else{let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:n,type:ye.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}}};var yf=class extends zt{constructor(t,r){super(),this.topProd=t,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=q(this.path.ruleStack).reverse(),this.occurrenceStack=q(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(t,r=[]){this.found||super.walk(t,r)}walkProdRef(t,r,n){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){let o=r.concat(n);this.updateExpectedNext(),this.walk(t.referencedRule,o)}}updateExpectedNext(){M(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},ja=class extends yf{constructor(t,r){super(t,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(t,r,n){if(this.isAtEndOfPath&&t.terminalType.name===this.nextTerminalName&&t.idx===this.nextTerminalOccurrence&&!this.found){let o=r.concat(n),i=new Y({definition:o});this.possibleTokTypes=fn(i),this.found=!0}}},so=class extends zt{constructor(t,r){super(),this.topRule=t,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},Ga=class extends so{walkMany(t,r,n){if(t.idx===this.occurrence){let o=xe(r.concat(n));this.result.isEndOfRule=o===void 0,o instanceof P&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else super.walkMany(t,r,n)}},ai=class extends so{walkManySep(t,r,n){if(t.idx===this.occurrence){let o=xe(r.concat(n));this.result.isEndOfRule=o===void 0,o instanceof P&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else super.walkManySep(t,r,n)}},Ha=class extends so{walkAtLeastOne(t,r,n){if(t.idx===this.occurrence){let o=xe(r.concat(n));this.result.isEndOfRule=o===void 0,o instanceof P&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else super.walkAtLeastOne(t,r,n)}},si=class extends so{walkAtLeastOneSep(t,r,n){if(t.idx===this.occurrence){let o=xe(r.concat(n));this.result.isEndOfRule=o===void 0,o instanceof P&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else super.walkAtLeastOneSep(t,r,n)}};function Ka(e,t,r=[]){r=q(r);let n=[],o=0;function i(s){return s.concat(fe(e,o+1))}function a(s){let c=Ka(i(s),t,r);return n.concat(c)}for(;r.length<t&&o<e.length;){let s=e[o];if(s instanceof Y)return a(s.definition);if(s instanceof B)return a(s.definition);if(s instanceof F)n=a(s.definition);else if(s instanceof z){let c=s.definition.concat([new k({definition:s.definition})]);return a(c)}else if(s instanceof X){let c=[new Y({definition:s.definition}),new k({definition:[new P({terminalType:s.separator})].concat(s.definition)})];return a(c)}else if(s instanceof H){let c=s.definition.concat([new k({definition:[new P({terminalType:s.separator})].concat(s.definition)})]);n=a(c)}else if(s instanceof k){let c=s.definition.concat([new k({definition:s.definition})]);n=a(c)}else{if(s instanceof K)return L(s.definition,c=>{M(c.definition)===!1&&(n=a(c.definition))}),n;if(s instanceof P)r.push(s.terminalType);else throw Error("non exhaustive match")}o++}return n.push({partialPath:r,suffixDef:fe(e,o)}),n}function Wa(e,t,r,n){let o="EXIT_NONE_TERMINAL",i=[o],a="EXIT_ALTERNATIVE",s=!1,c=t.length,f=c-n-1,u=[],l=[];for(l.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!M(l);){let p=l.pop();if(p===a){s&&Ct(l).idx<=f&&l.pop();continue}let m=p.def,E=p.idx,y=p.ruleStack,S=p.occurrenceStack;if(M(m))continue;let d=m[0];if(d===o){let g={idx:E,def:fe(m),ruleStack:Yt(y),occurrenceStack:Yt(S)};l.push(g)}else if(d instanceof P)if(E<c-1){let g=E+1,h=t[g];if(r(h,d.terminalType)){let x={idx:g,def:fe(m),ruleStack:y,occurrenceStack:S};l.push(x)}}else if(E===c-1)u.push({nextTokenType:d.terminalType,nextTokenOccurrence:d.idx,ruleStack:y,occurrenceStack:S}),s=!0;else throw Error("non exhaustive match");else if(d instanceof B){let g=q(y);g.push(d.nonTerminalName);let h=q(S);h.push(d.idx);let x={idx:E,def:d.definition.concat(i,fe(m)),ruleStack:g,occurrenceStack:h};l.push(x)}else if(d instanceof F){let g={idx:E,def:fe(m),ruleStack:y,occurrenceStack:S};l.push(g),l.push(a);let h={idx:E,def:d.definition.concat(fe(m)),ruleStack:y,occurrenceStack:S};l.push(h)}else if(d instanceof z){let g=new k({definition:d.definition,idx:d.idx}),h=d.definition.concat([g],fe(m)),x={idx:E,def:h,ruleStack:y,occurrenceStack:S};l.push(x)}else if(d instanceof X){let g=new P({terminalType:d.separator}),h=new k({definition:[g].concat(d.definition),idx:d.idx}),x=d.definition.concat([h],fe(m)),N={idx:E,def:x,ruleStack:y,occurrenceStack:S};l.push(N)}else if(d instanceof H){let g={idx:E,def:fe(m),ruleStack:y,occurrenceStack:S};l.push(g),l.push(a);let h=new P({terminalType:d.separator}),x=new k({definition:[h].concat(d.definition),idx:d.idx}),N=d.definition.concat([x],fe(m)),Ce={idx:E,def:N,ruleStack:y,occurrenceStack:S};l.push(Ce)}else if(d instanceof k){let g={idx:E,def:fe(m),ruleStack:y,occurrenceStack:S};l.push(g),l.push(a);let h=new k({definition:d.definition,idx:d.idx}),x=d.definition.concat([h],fe(m)),N={idx:E,def:x,ruleStack:y,occurrenceStack:S};l.push(N)}else if(d instanceof K)for(let g=d.definition.length-1;g>=0;g--){let h=d.definition[g],x={idx:E,def:h.definition.concat(fe(m)),ruleStack:y,occurrenceStack:S};l.push(x),l.push(a)}else if(d instanceof Y)l.push({idx:E,def:d.definition.concat(fe(m)),ruleStack:y,occurrenceStack:S});else if(d instanceof je)l.push($I(d,E,y,S));else throw Error("non exhaustive match")}return u}function $I(e,t,r,n){let o=q(r);o.push(e.name);let i=q(n);return i.push(1),{idx:t,def:e.definition,ruleStack:o,occurrenceStack:i}}var ee;(function(e){e[e.OPTION=0]="OPTION",e[e.REPETITION=1]="REPETITION",e[e.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",e[e.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",e[e.ALTERNATION=5]="ALTERNATION"})(ee||(ee={}));function ci(e){if(e instanceof F||e==="Option")return ee.OPTION;if(e instanceof k||e==="Repetition")return ee.REPETITION;if(e instanceof z||e==="RepetitionMandatory")return ee.REPETITION_MANDATORY;if(e instanceof X||e==="RepetitionMandatoryWithSeparator")return ee.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof H||e==="RepetitionWithSeparator")return ee.REPETITION_WITH_SEPARATOR;if(e instanceof K||e==="Alternation")return ee.ALTERNATION;throw Error("non exhaustive match")}function qa(e){let{occurrence:t,rule:r,prodType:n,maxLookahead:o}=e,i=ci(n);return i===ee.ALTERNATION?co(t,r,o):fo(t,r,i,o)}function jh(e,t,r,n,o,i){let a=co(e,t,r),s=qh(a)?ao:Xt;return i(a,n,s,o)}function Gh(e,t,r,n,o,i){let a=fo(e,t,o,r),s=qh(a)?ao:Xt;return i(a[0],s,n)}function Hh(e,t,r,n){let o=e.length,i=ve(e,a=>ve(a,s=>s.length===1));if(t)return function(a){let s=O(a,c=>c.GATE);for(let c=0;c<o;c++){let f=e[c],u=f.length,l=s[c];if(!(l!==void 0&&l.call(this)===!1))e:for(let p=0;p<u;p++){let m=f[p],E=m.length;for(let y=0;y<E;y++){let S=this.LA(y+1);if(r(S,m[y])===!1)continue e}return c}}};if(i&&!n){let a=O(e,c=>ge(c)),s=de(a,(c,f,u)=>(L(f,l=>{U(c,l.tokenTypeIdx)||(c[l.tokenTypeIdx]=u),L(l.categoryMatches,p=>{U(c,p)||(c[p]=u)})}),c),{});return function(){let c=this.LA(1);return s[c.tokenTypeIdx]}}else return function(){for(let a=0;a<o;a++){let s=e[a],c=s.length;e:for(let f=0;f<c;f++){let u=s[f],l=u.length;for(let p=0;p<l;p++){let m=this.LA(p+1);if(r(m,u[p])===!1)continue e}return a}}}}function Kh(e,t,r){let n=ve(e,i=>i.length===1),o=e.length;if(n&&!r){let i=ge(e);if(i.length===1&&M(i[0].categoryMatches)){let s=i[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===s}}else{let a=de(i,(s,c,f)=>(s[c.tokenTypeIdx]=!0,L(c.categoryMatches,u=>{s[u]=!0}),s),[]);return function(){let s=this.LA(1);return a[s.tokenTypeIdx]===!0}}}else return function(){e:for(let i=0;i<o;i++){let a=e[i],s=a.length;for(let c=0;c<s;c++){let f=this.LA(c+1);if(t(f,a[c])===!1)continue e}return!0}return!1}}var Tf=class extends zt{constructor(t,r,n){super(),this.topProd=t,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(t,r,n,o){return t.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(o),!0):!1}walkOption(t,r,n){this.checkIsTarget(t,ee.OPTION,r,n)||super.walkOption(t,r,n)}walkAtLeastOne(t,r,n){this.checkIsTarget(t,ee.REPETITION_MANDATORY,r,n)||super.walkOption(t,r,n)}walkAtLeastOneSep(t,r,n){this.checkIsTarget(t,ee.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(t,r,n)}walkMany(t,r,n){this.checkIsTarget(t,ee.REPETITION,r,n)||super.walkOption(t,r,n)}walkManySep(t,r,n){this.checkIsTarget(t,ee.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(t,r,n)}},Va=class extends Ge{constructor(t,r,n){super(),this.targetOccurrence=t,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(t,r){t.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||t===this.targetRef)&&(this.result=t.definition)}visitOption(t){this.checkIsTarget(t,ee.OPTION)}visitRepetition(t){this.checkIsTarget(t,ee.REPETITION)}visitRepetitionMandatory(t){this.checkIsTarget(t,ee.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(t){this.checkIsTarget(t,ee.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(t){this.checkIsTarget(t,ee.REPETITION_WITH_SEPARATOR)}visitAlternation(t){this.checkIsTarget(t,ee.ALTERNATION)}};function Dh(e){let t=new Array(e);for(let r=0;r<e;r++)t[r]=[];return t}function Sf(e){let t=[""];for(let r=0;r<e.length;r++){let n=e[r],o=[];for(let i=0;i<t.length;i++){let a=t[i];o.push(a+"_"+n.tokenTypeIdx);for(let s=0;s<n.categoryMatches.length;s++){let c="_"+n.categoryMatches[s];o.push(a+c)}}t=o}return t}function ev(e,t,r){for(let n=0;n<e.length;n++){if(n===r)continue;let o=e[n];for(let i=0;i<t.length;i++){let a=t[i];if(o[a]===!0)return!1}}return!0}function Wh(e,t){let r=O(e,a=>Ka([a],1)),n=Dh(r.length),o=O(r,a=>{let s={};return L(a,c=>{let f=Sf(c.partialPath);L(f,u=>{s[u]=!0})}),s}),i=r;for(let a=1;a<=t;a++){let s=i;i=Dh(s.length);for(let c=0;c<s.length;c++){let f=s[c];for(let u=0;u<f.length;u++){let l=f[u].partialPath,p=f[u].suffixDef,m=Sf(l);if(ev(o,m,c)||M(p)||l.length===t){let y=n[c];if(Ya(y,l)===!1){y.push(l);for(let S=0;S<m.length;S++){let d=m[S];o[c][d]=!0}}}else{let y=Ka(p,a+1,l);i[c]=i[c].concat(y),L(y,S=>{let d=Sf(S.partialPath);L(d,g=>{o[c][g]=!0})})}}}}return n}function co(e,t,r,n){let o=new Va(e,ee.ALTERNATION,n);return t.accept(o),Wh(o.result,r)}function fo(e,t,r,n){let o=new Va(e,r);t.accept(o);let i=o.result,s=new Tf(t,e,r).startWalking(),c=new Y({definition:i}),f=new Y({definition:s});return Wh([c,f],n)}function Ya(e,t){e:for(let r=0;r<e.length;r++){let n=e[r];if(n.length===t.length){for(let o=0;o<n.length;o++){let i=t[o],a=n[o];if((i===a||a.categoryMatchesMap[i.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function Vh(e,t){return e.length<t.length&&ve(e,(r,n)=>{let o=t[n];return r===o||o.categoryMatchesMap[r.tokenTypeIdx]})}function qh(e){return ve(e,t=>ve(t,r=>ve(r,n=>M(n.categoryMatches))))}function Yh(e){let t=e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName});return O(t,r=>Object.assign({type:ye.CUSTOM_LOOKAHEAD_VALIDATION},r))}function zh(e,t,r,n){let o=De(e,c=>tv(c,r)),i=sv(e,t,r),a=De(e,c=>ov(c,r)),s=De(e,c=>nv(c,e,n,r));return o.concat(i,a,s)}function tv(e,t){let r=new xf;e.accept(r);let n=r.allProductions,o=rf(n,rv),i=ze(o,s=>s.length>1);return O(G(i),s=>{let c=xe(s),f=t.buildDuplicateFoundError(e,s),u=Xe(c),l={message:f,type:ye.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:u,occurrence:c.idx},p=Xh(c);return p&&(l.parameter=p),l})}function rv(e){return`${Xe(e)}_#_${e.idx}_#_${Xh(e)}`}function Xh(e){return e instanceof P?e.terminalType.name:e instanceof B?e.nonTerminalName:""}var xf=class extends Ge{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(t){this.allProductions.push(t)}visitOption(t){this.allProductions.push(t)}visitRepetitionWithSeparator(t){this.allProductions.push(t)}visitRepetitionMandatory(t){this.allProductions.push(t)}visitRepetitionMandatoryWithSeparator(t){this.allProductions.push(t)}visitRepetition(t){this.allProductions.push(t)}visitAlternation(t){this.allProductions.push(t)}visitTerminal(t){this.allProductions.push(t)}};function nv(e,t,r,n){let o=[];if(de(t,(a,s)=>s.name===e.name?a+1:a,0)>1){let a=n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:r});o.push({message:a,type:ye.DUPLICATE_RULE_NAME,ruleName:e.name})}return o}function Jh(e,t,r){let n=[],o;return Z(t,e)||(o=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:o,type:ye.INVALID_RULE_OVERRIDE,ruleName:e})),n}function Of(e,t,r,n=[]){let o=[],i=za(t.definition);if(M(i))return[];{let a=e.name;Z(i,e)&&o.push({message:r.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:n}),type:ye.LEFT_RECURSION,ruleName:a});let c=Mr(i,n.concat([e])),f=De(c,u=>{let l=q(n);return l.push(u),Of(e,u,r,l)});return o.concat(f)}}function za(e){let t=[];if(M(e))return t;let r=xe(e);if(r instanceof B)t.push(r.referencedRule);else if(r instanceof Y||r instanceof F||r instanceof z||r instanceof X||r instanceof H||r instanceof k)t=t.concat(za(r.definition));else if(r instanceof K)t=ge(O(r.definition,i=>za(i.definition)));else if(!(r instanceof P))throw Error("non exhaustive match");let n=cn(r),o=e.length>1;if(n&&o){let i=fe(e);return t.concat(za(i))}else return t}var fi=class extends Ge{constructor(){super(...arguments),this.alternations=[]}visitAlternation(t){this.alternations.push(t)}};function Qh(e,t){let r=new fi;e.accept(r);let n=r.alternations;return De(n,i=>{let a=Yt(i.definition);return De(a,(s,c)=>{let f=Wa([s],[],Xt,1);return M(f)?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:i,emptyChoiceIdx:c}),type:ye.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:i.idx,alternative:c+1}]:[]})})}function Zh(e,t,r){let n=new fi;e.accept(n);let o=n.alternations;return o=wr(o,a=>a.ignoreAmbiguities===!0),De(o,a=>{let s=a.idx,c=a.maxLookahead||t,f=co(s,e,c,a),u=iv(f,a,e,r),l=av(f,a,e,r);return u.concat(l)})}var Rf=class extends Ge{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(t){this.allProductions.push(t)}visitRepetitionMandatory(t){this.allProductions.push(t)}visitRepetitionMandatoryWithSeparator(t){this.allProductions.push(t)}visitRepetition(t){this.allProductions.push(t)}};function ov(e,t){let r=new fi;e.accept(r);let n=r.alternations;return De(n,i=>i.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:i}),type:ye.TOO_MANY_ALTS,ruleName:e.name,occurrence:i.idx}]:[])}function $h(e,t,r){let n=[];return L(e,o=>{let i=new Rf;o.accept(i);let a=i.allProductions;L(a,s=>{let c=ci(s),f=s.maxLookahead||t,u=s.idx,p=fo(u,o,c,f)[0];if(M(ge(p))){let m=r.buildEmptyRepetitionError({topLevelRule:o,repetition:s});n.push({message:m,type:ye.NO_NON_EMPTY_LOOKAHEAD,ruleName:o.name})}})}),n}function iv(e,t,r,n){let o=[],i=de(e,(s,c,f)=>(t.definition[f].ignoreAmbiguities===!0||L(c,u=>{let l=[f];L(e,(p,m)=>{f!==m&&Ya(p,u)&&t.definition[m].ignoreAmbiguities!==!0&&l.push(m)}),l.length>1&&!Ya(o,u)&&(o.push(u),s.push({alts:l,path:u}))}),s),[]);return O(i,s=>{let c=O(s.alts,u=>u+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:c,prefixPath:s.path}),type:ye.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:t.idx,alternatives:s.alts}})}function av(e,t,r,n){let o=de(e,(a,s,c)=>{let f=O(s,u=>({idx:c,path:u}));return a.concat(f)},[]);return Nt(De(o,a=>{if(t.definition[a.idx].ignoreAmbiguities===!0)return[];let c=a.idx,f=a.path,u=Pe(o,p=>t.definition[p.idx].ignoreAmbiguities!==!0&&p.idx<c&&Vh(p.path,f));return O(u,p=>{let m=[p.idx+1,c+1],E=t.idx===0?"":t.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:m,prefixPath:p.path}),type:ye.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:E,alternatives:m}})}))}function sv(e,t,r){let n=[],o=O(t,i=>i.name);return L(e,i=>{let a=i.name;if(Z(o,a)){let s=r.buildNamespaceConflictError(i);n.push({message:s,type:ye.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),n}function eg(e){let t=Zn(e,{errMsgProvider:Bh}),r={};return L(e.rules,n=>{r[n.name]=n}),Fh(r,t.errMsgProvider)}function tg(e){return e=Zn(e,{errMsgProvider:ht}),zh(e.rules,e.tokenTypes,e.errMsgProvider,e.grammarName)}var rg="MismatchedTokenException",ng="NoViableAltException",og="EarlyExitException",ig="NotAllInputParsedException",ag=[rg,ng,og,ig];Object.freeze(ag);function Pt(e){return Z(ag,e.name)}var uo=class extends Error{constructor(t,r){super(t),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},mn=class extends uo{constructor(t,r,n){super(t,r),this.previousToken=n,this.name=rg}},ui=class extends uo{constructor(t,r,n){super(t,r),this.previousToken=n,this.name=ng}},li=class extends uo{constructor(t,r){super(t,r),this.name=ig}},pi=class extends uo{constructor(t,r,n){super(t,r),this.previousToken=n,this.name=og}};var Lf={},Uf="InRuleRecoveryException",Af=class extends Error{constructor(t){super(t),this.name=Uf}},Xa=class{initRecoverable(t){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=U(t,"recoveryEnabled")?t.recoveryEnabled:He.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=cv)}getTokenToInsert(t){let r=dn(t,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(t){return!0}canTokenTypeBeDeletedInRecovery(t){return!0}tryInRepetitionRecovery(t,r,n,o){let i=this.findReSyncTokenType(),a=this.exportLexerState(),s=[],c=!1,f=this.LA(1),u=this.LA(1),l=()=>{let p=this.LA(0),m=this.errorMessageProvider.buildMismatchTokenMessage({expected:o,actual:f,previous:p,ruleName:this.getCurrRuleFullName()}),E=new mn(m,f,this.LA(0));E.resyncedTokens=Yt(s),this.SAVE_ERROR(E)};for(;!c;)if(this.tokenMatcher(u,o)){l();return}else if(n.call(this)){l(),t.apply(this,r);return}else this.tokenMatcher(u,i)?c=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,s));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(t,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),t)||this.isBackTracking()||this.canPerformInRuleRecovery(t,this.getFollowsForInRuleRecovery(t,r)))}getFollowsForInRuleRecovery(t,r){let n=this.getCurrentGrammarPath(t,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(t,r){if(this.canRecoverWithSingleTokenInsertion(t,r))return this.getTokenToInsert(t);if(this.canRecoverWithSingleTokenDeletion(t)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new Af("sad sad panda")}canPerformInRuleRecovery(t,r){return this.canRecoverWithSingleTokenInsertion(t,r)||this.canRecoverWithSingleTokenDeletion(t)}canRecoverWithSingleTokenInsertion(t,r){if(!this.canTokenTypeBeInsertedInRecovery(t)||M(r))return!1;let n=this.LA(1);return It(r,i=>this.tokenMatcher(n,i))!==void 0}canRecoverWithSingleTokenDeletion(t){return this.canTokenTypeBeDeletedInRecovery(t)?this.tokenMatcher(this.LA(2),t):!1}isInCurrentRuleReSyncSet(t){let r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return Z(n,t)}findReSyncTokenType(){let t=this.flattenFollowSet(),r=this.LA(1),n=2;for(;;){let o=It(t,i=>v(r,i));if(o!==void 0)return o;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Lf;let t=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(t),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let t=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return O(t,(n,o)=>o===0?Lf:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[o],inRule:this.shortRuleNameToFullName(t[o-1])})}flattenFollowSet(){let t=O(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return ge(t)}getFollowSetFromFollowKey(t){if(t===Lf)return[$e];let r=t.ruleName+t.idxInCallingRule+va+t.inRule;return this.resyncFollows[r]}addToResyncTokens(t,r){return this.tokenMatcher(t,$e)||r.push(t),r}reSyncTo(t){let r=[],n=this.LA(1);for(;this.tokenMatcher(n,t)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return Yt(r)}attemptInRepetitionRecovery(t,r,n,o,i,a,s){}getCurrentGrammarPath(t,r){let n=this.getHumanReadableRuleStack(),o=q(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:o,lastTok:t,lastTokOccurrence:r}}getHumanReadableRuleStack(){return O(this.RULE_STACK,t=>this.shortRuleNameToFullName(t))}};function cv(e,t,r,n,o,i,a){let s=this.getKeyForAutomaticLookahead(n,o),c=this.firstAfterRepMap[s];if(c===void 0){let p=this.getCurrRuleFullName(),m=this.getGAstProductions()[p];c=new i(m,o).startWalking(),this.firstAfterRepMap[s]=c}let f=c.token,u=c.occurrence,l=c.isEndOfRule;this.RULE_STACK.length===1&&l&&f===void 0&&(f=$e,u=1),!(f===void 0||u===void 0)&&this.shouldInRepetitionRecoveryBeTried(f,u,a)&&this.tryInRepetitionRecovery(e,t,r,f)}function Ja(e,t,r){return r|t|e}var hn=class{constructor(t){var r;this.maxLookahead=(r=t?.maxLookahead)!==null&&r!==void 0?r:He.maxLookahead}validate(t){let r=this.validateNoLeftRecursion(t.rules);if(M(r)){let n=this.validateEmptyOrAlternatives(t.rules),o=this.validateAmbiguousAlternationAlternatives(t.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(t.rules,this.maxLookahead);return[...r,...n,...o,...i]}return r}validateNoLeftRecursion(t){return De(t,r=>Of(r,r,ht))}validateEmptyOrAlternatives(t){return De(t,r=>Qh(r,ht))}validateAmbiguousAlternationAlternatives(t,r){return De(t,n=>Zh(n,r,ht))}validateSomeNonEmptyLookaheadPath(t,r){return $h(t,r,ht)}buildLookaheadForAlternation(t){return jh(t.prodOccurrence,t.rule,t.maxLookahead,t.hasPredicates,t.dynamicTokensEnabled,Hh)}buildLookaheadForOptional(t){return Gh(t.prodOccurrence,t.rule,t.maxLookahead,t.dynamicTokensEnabled,ci(t.prodType),Kh)}};var Za=class{initLooksAhead(t){this.dynamicTokensEnabled=U(t,"dynamicTokensEnabled")?t.dynamicTokensEnabled:He.dynamicTokensEnabled,this.maxLookahead=U(t,"maxLookahead")?t.maxLookahead:He.maxLookahead,this.lookaheadStrategy=U(t,"lookaheadStrategy")?t.lookaheadStrategy:new hn({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(t){L(t,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{let{alternation:n,repetition:o,option:i,repetitionMandatory:a,repetitionMandatoryWithSeparator:s,repetitionWithSeparator:c}=fv(r);L(n,f=>{let u=f.idx===0?"":f.idx;this.TRACE_INIT(`${Xe(f)}${u}`,()=>{let l=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:f.idx,rule:r,maxLookahead:f.maxLookahead||this.maxLookahead,hasPredicates:f.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),p=Ja(this.fullRuleNameToShort[r.name],256,f.idx);this.setLaFuncCache(p,l)})}),L(o,f=>{this.computeLookaheadFunc(r,f.idx,768,"Repetition",f.maxLookahead,Xe(f))}),L(i,f=>{this.computeLookaheadFunc(r,f.idx,512,"Option",f.maxLookahead,Xe(f))}),L(a,f=>{this.computeLookaheadFunc(r,f.idx,1024,"RepetitionMandatory",f.maxLookahead,Xe(f))}),L(s,f=>{this.computeLookaheadFunc(r,f.idx,1536,"RepetitionMandatoryWithSeparator",f.maxLookahead,Xe(f))}),L(c,f=>{this.computeLookaheadFunc(r,f.idx,1280,"RepetitionWithSeparator",f.maxLookahead,Xe(f))})})})}computeLookaheadFunc(t,r,n,o,i,a){this.TRACE_INIT(`${a}${r===0?"":r}`,()=>{let s=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:t,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:o}),c=Ja(this.fullRuleNameToShort[t.name],n,r);this.setLaFuncCache(c,s)})}getKeyForAutomaticLookahead(t,r){let n=this.getLastExplicitRuleShortName();return Ja(n,t,r)}getLaFuncFromCache(t){return this.lookAheadFuncsCache.get(t)}setLaFuncCache(t,r){this.lookAheadFuncsCache.set(t,r)}},bf=class extends Ge{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(t){this.dslMethods.option.push(t)}visitRepetitionWithSeparator(t){this.dslMethods.repetitionWithSeparator.push(t)}visitRepetitionMandatory(t){this.dslMethods.repetitionMandatory.push(t)}visitRepetitionMandatoryWithSeparator(t){this.dslMethods.repetitionMandatoryWithSeparator.push(t)}visitRepetition(t){this.dslMethods.repetition.push(t)}visitAlternation(t){this.dslMethods.alternation.push(t)}},Qa=new bf;function fv(e){Qa.reset(),e.accept(Qa);let t=Qa.dslMethods;return Qa.reset(),t}function If(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset)}function vf(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.startColumn=t.startColumn,e.startLine=t.startLine,e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)}function sg(e,t,r){e.children[r]===void 0?e.children[r]=[t]:e.children[r].push(t)}function cg(e,t,r){e.children[t]===void 0?e.children[t]=[r]:e.children[t].push(r)}var uv="name";function Pf(e,t){Object.defineProperty(e,uv,{enumerable:!1,configurable:!0,writable:!1,value:t})}function lv(e,t){let r=W(e),n=r.length;for(let o=0;o<n;o++){let i=r[o],a=e[i],s=a.length;for(let c=0;c<s;c++){let f=a[c];f.tokenTypeIdx===void 0&&this[f.name](f.children,t)}}}function fg(e,t){let r=function(){};Pf(r,e+"BaseSemantics");let n={visit:function(o,i){if(b(o)&&(o=o[0]),!Me(o))return this[o.name](o.children,i)},validateVisitor:function(){let o=pv(this,t);if(!M(o)){let i=O(o,a=>a.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
|
124
|
+
${i.join(`
|
|
125
|
+
|
|
126
|
+
`).replace(/\n/g,`
|
|
127
|
+
`)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=t,r}function ug(e,t,r){let n=function(){};Pf(n,e+"BaseSemanticsWithDefaults");let o=Object.create(r.prototype);return L(t,i=>{o[i]=lv}),n.prototype=o,n.prototype.constructor=n,n}var Mf;(function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"})(Mf||(Mf={}));function pv(e,t){return dv(e,t)}function dv(e,t){let r=Pe(t,o=>Fe(e[o])===!1),n=O(r,o=>({msg:`Missing visitor method: <${o}> on ${e.constructor.name} CST Visitor.`,type:Mf.MISSING_METHOD,methodName:o}));return Nt(n)}var rs=class{initTreeBuilder(t){if(this.CST_STACK=[],this.outputCst=t.outputCst,this.nodeLocationTracking=U(t,"nodeLocationTracking")?t.nodeLocationTracking:He.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=re,this.cstFinallyStateUpdate=re,this.cstPostTerminal=re,this.cstPostNonTerminal=re,this.cstPostRule=re;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=vf,this.setNodeLocationFromNode=vf,this.cstPostRule=re,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=re,this.setNodeLocationFromNode=re,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=If,this.setNodeLocationFromNode=If,this.cstPostRule=re,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=re,this.setNodeLocationFromNode=re,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=re,this.setNodeLocationFromNode=re,this.cstPostRule=re,this.setInitialNodeLocation=re;else throw Error(`Invalid <nodeLocationTracking> config option: "${t.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(t){t.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(t){t.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(t){t.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(t){let r=this.LA(1);t.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(t){let r={name:t,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(t){let r=this.LA(0),n=t.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(t){let r=this.LA(0),n=t.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(t,r){let n=this.CST_STACK[this.CST_STACK.length-1];sg(n,r,t),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(t,r){let n=this.CST_STACK[this.CST_STACK.length-1];cg(n,r,t),this.setNodeLocationFromNode(n.location,t.location)}getBaseCstVisitorConstructor(){if(Me(this.baseCstVisitorConstructor)){let t=fg(this.className,W(this.gastProductionsCache));return this.baseCstVisitorConstructor=t,t}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Me(this.baseCstVisitorWithDefaultsConstructor)){let t=ug(this.className,W(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=t,t}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let t=this.RULE_STACK;return t[t.length-1]}getPreviousExplicitRuleShortName(){let t=this.RULE_STACK;return t[t.length-2]}getLastExplicitRuleOccurrenceIndex(){let t=this.RULE_OCCURRENCE_STACK;return t[t.length-1]}};var ns=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(t){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=t,this.tokVectorLength=t.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):lo}LA(t){let r=this.currIdx+t;return r<0||this.tokVectorLength<=r?lo:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(t){this.currIdx=t}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}};var os=class{ACTION(t){return t.call(this)}consume(t,r,n){return this.consumeInternal(r,t,n)}subrule(t,r,n){return this.subruleInternal(r,t,n)}option(t,r){return this.optionInternal(r,t)}or(t,r){return this.orInternal(r,t)}many(t,r){return this.manyInternal(t,r)}atLeastOne(t,r){return this.atLeastOneInternal(t,r)}CONSUME(t,r){return this.consumeInternal(t,0,r)}CONSUME1(t,r){return this.consumeInternal(t,1,r)}CONSUME2(t,r){return this.consumeInternal(t,2,r)}CONSUME3(t,r){return this.consumeInternal(t,3,r)}CONSUME4(t,r){return this.consumeInternal(t,4,r)}CONSUME5(t,r){return this.consumeInternal(t,5,r)}CONSUME6(t,r){return this.consumeInternal(t,6,r)}CONSUME7(t,r){return this.consumeInternal(t,7,r)}CONSUME8(t,r){return this.consumeInternal(t,8,r)}CONSUME9(t,r){return this.consumeInternal(t,9,r)}SUBRULE(t,r){return this.subruleInternal(t,0,r)}SUBRULE1(t,r){return this.subruleInternal(t,1,r)}SUBRULE2(t,r){return this.subruleInternal(t,2,r)}SUBRULE3(t,r){return this.subruleInternal(t,3,r)}SUBRULE4(t,r){return this.subruleInternal(t,4,r)}SUBRULE5(t,r){return this.subruleInternal(t,5,r)}SUBRULE6(t,r){return this.subruleInternal(t,6,r)}SUBRULE7(t,r){return this.subruleInternal(t,7,r)}SUBRULE8(t,r){return this.subruleInternal(t,8,r)}SUBRULE9(t,r){return this.subruleInternal(t,9,r)}OPTION(t){return this.optionInternal(t,0)}OPTION1(t){return this.optionInternal(t,1)}OPTION2(t){return this.optionInternal(t,2)}OPTION3(t){return this.optionInternal(t,3)}OPTION4(t){return this.optionInternal(t,4)}OPTION5(t){return this.optionInternal(t,5)}OPTION6(t){return this.optionInternal(t,6)}OPTION7(t){return this.optionInternal(t,7)}OPTION8(t){return this.optionInternal(t,8)}OPTION9(t){return this.optionInternal(t,9)}OR(t){return this.orInternal(t,0)}OR1(t){return this.orInternal(t,1)}OR2(t){return this.orInternal(t,2)}OR3(t){return this.orInternal(t,3)}OR4(t){return this.orInternal(t,4)}OR5(t){return this.orInternal(t,5)}OR6(t){return this.orInternal(t,6)}OR7(t){return this.orInternal(t,7)}OR8(t){return this.orInternal(t,8)}OR9(t){return this.orInternal(t,9)}MANY(t){this.manyInternal(0,t)}MANY1(t){this.manyInternal(1,t)}MANY2(t){this.manyInternal(2,t)}MANY3(t){this.manyInternal(3,t)}MANY4(t){this.manyInternal(4,t)}MANY5(t){this.manyInternal(5,t)}MANY6(t){this.manyInternal(6,t)}MANY7(t){this.manyInternal(7,t)}MANY8(t){this.manyInternal(8,t)}MANY9(t){this.manyInternal(9,t)}MANY_SEP(t){this.manySepFirstInternal(0,t)}MANY_SEP1(t){this.manySepFirstInternal(1,t)}MANY_SEP2(t){this.manySepFirstInternal(2,t)}MANY_SEP3(t){this.manySepFirstInternal(3,t)}MANY_SEP4(t){this.manySepFirstInternal(4,t)}MANY_SEP5(t){this.manySepFirstInternal(5,t)}MANY_SEP6(t){this.manySepFirstInternal(6,t)}MANY_SEP7(t){this.manySepFirstInternal(7,t)}MANY_SEP8(t){this.manySepFirstInternal(8,t)}MANY_SEP9(t){this.manySepFirstInternal(9,t)}AT_LEAST_ONE(t){this.atLeastOneInternal(0,t)}AT_LEAST_ONE1(t){return this.atLeastOneInternal(1,t)}AT_LEAST_ONE2(t){this.atLeastOneInternal(2,t)}AT_LEAST_ONE3(t){this.atLeastOneInternal(3,t)}AT_LEAST_ONE4(t){this.atLeastOneInternal(4,t)}AT_LEAST_ONE5(t){this.atLeastOneInternal(5,t)}AT_LEAST_ONE6(t){this.atLeastOneInternal(6,t)}AT_LEAST_ONE7(t){this.atLeastOneInternal(7,t)}AT_LEAST_ONE8(t){this.atLeastOneInternal(8,t)}AT_LEAST_ONE9(t){this.atLeastOneInternal(9,t)}AT_LEAST_ONE_SEP(t){this.atLeastOneSepFirstInternal(0,t)}AT_LEAST_ONE_SEP1(t){this.atLeastOneSepFirstInternal(1,t)}AT_LEAST_ONE_SEP2(t){this.atLeastOneSepFirstInternal(2,t)}AT_LEAST_ONE_SEP3(t){this.atLeastOneSepFirstInternal(3,t)}AT_LEAST_ONE_SEP4(t){this.atLeastOneSepFirstInternal(4,t)}AT_LEAST_ONE_SEP5(t){this.atLeastOneSepFirstInternal(5,t)}AT_LEAST_ONE_SEP6(t){this.atLeastOneSepFirstInternal(6,t)}AT_LEAST_ONE_SEP7(t){this.atLeastOneSepFirstInternal(7,t)}AT_LEAST_ONE_SEP8(t){this.atLeastOneSepFirstInternal(8,t)}AT_LEAST_ONE_SEP9(t){this.atLeastOneSepFirstInternal(9,t)}RULE(t,r,n=po){if(Z(this.definedRulesNames,t)){let a={message:ht.buildDuplicateRuleNameError({topLevelRule:t,grammarName:this.className}),type:ye.DUPLICATE_RULE_NAME,ruleName:t};this.definitionErrors.push(a)}this.definedRulesNames.push(t);let o=this.defineRule(t,r,n);return this[t]=o,o}OVERRIDE_RULE(t,r,n=po){let o=Jh(t,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(o);let i=this.defineRule(t,r,n);return this[t]=i,i}BACKTRACK(t,r){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return t.apply(this,r),!0}catch(o){if(Pt(o))return!1;throw o}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Ia(G(this.gastProductionsCache))}};var is=class{initRecognizerEngine(t,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=ao,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},U(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
128
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
129
|
+
For Further details.`);if(b(t)){if(M(t))throw Error(`A Token Vocabulary cannot be empty.
|
|
130
|
+
Note that the first argument for the parser constructor
|
|
131
|
+
is no longer a Token vector (since v4.0).`);if(typeof t[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
|
|
132
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
133
|
+
For Further details.`)}if(b(t))this.tokensMap=de(t,(i,a)=>(i[a.name]=a,i),{});else if(U(t,"modes")&&ve(ge(G(t.modes)),Nh)){let i=ge(G(t.modes)),a=$n(i);this.tokensMap=de(a,(s,c)=>(s[c.name]=c,s),{})}else if(te(t))this.tokensMap=q(t);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=$e;let n=U(t,"modes")?ge(G(t.modes)):G(t),o=ve(n,i=>M(i.categoryMatches));this.tokenMatcher=o?ao:Xt,Jt(G(this.tokensMap))}defineRule(t,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${t}> may not be defined after the 'performSelfAnalysis' method has been called'
|
|
134
|
+
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let o=U(n,"resyncEnabled")?n.resyncEnabled:po.resyncEnabled,i=U(n,"recoveryValueFunc")?n.recoveryValueFunc:po.recoveryValueFunc,a=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=t,this.fullRuleNameToShort[t]=a;let s;return this.outputCst===!0?s=function(...u){try{this.ruleInvocationStateUpdate(a,t,this.subruleIdx),r.apply(this,u);let l=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(l),l}catch(l){return this.invokeRuleCatch(l,o,i)}finally{this.ruleFinallyStateUpdate()}}:s=function(...u){try{return this.ruleInvocationStateUpdate(a,t,this.subruleIdx),r.apply(this,u)}catch(l){return this.invokeRuleCatch(l,o,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(s,{ruleName:t,originalGrammarAction:r})}invokeRuleCatch(t,r,n){let o=this.RULE_STACK.length===1,i=r&&!this.isBackTracking()&&this.recoveryEnabled;if(Pt(t)){let a=t;if(i){let s=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(s))if(a.resyncedTokens=this.reSyncTo(s),this.outputCst){let c=this.CST_STACK[this.CST_STACK.length-1];return c.recoveredNode=!0,c}else return n(t);else{if(this.outputCst){let c=this.CST_STACK[this.CST_STACK.length-1];c.recoveredNode=!0,a.partialCstResult=c}throw a}}else{if(o)return this.moveToTerminatedState(),n(t);throw a}}else throw t}optionInternal(t,r){let n=this.getKeyForAutomaticLookahead(512,r);return this.optionInternalLogic(t,r,n)}optionInternalLogic(t,r,n){let o=this.getLaFuncFromCache(n),i;if(typeof t!="function"){i=t.DEF;let a=t.GATE;if(a!==void 0){let s=o;o=()=>a.call(this)&&s.call(this)}}else i=t;if(o.call(this)===!0)return i.call(this)}atLeastOneInternal(t,r){let n=this.getKeyForAutomaticLookahead(1024,t);return this.atLeastOneInternalLogic(t,r,n)}atLeastOneInternalLogic(t,r,n){let o=this.getLaFuncFromCache(n),i;if(typeof r!="function"){i=r.DEF;let a=r.GATE;if(a!==void 0){let s=o;o=()=>a.call(this)&&s.call(this)}}else i=r;if(o.call(this)===!0){let a=this.doSingleRepetition(i);for(;o.call(this)===!0&&a===!0;)a=this.doSingleRepetition(i)}else throw this.raiseEarlyExitException(t,ee.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[t,r],o,1024,t,Ha)}atLeastOneSepFirstInternal(t,r){let n=this.getKeyForAutomaticLookahead(1536,t);this.atLeastOneSepFirstInternalLogic(t,r,n)}atLeastOneSepFirstInternalLogic(t,r,n){let o=r.DEF,i=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){o.call(this);let s=()=>this.tokenMatcher(this.LA(1),i);for(;this.tokenMatcher(this.LA(1),i)===!0;)this.CONSUME(i),o.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,i,s,o,si],s,1536,t,si)}else throw this.raiseEarlyExitException(t,ee.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(t,r){let n=this.getKeyForAutomaticLookahead(768,t);return this.manyInternalLogic(t,r,n)}manyInternalLogic(t,r,n){let o=this.getLaFuncFromCache(n),i;if(typeof r!="function"){i=r.DEF;let s=r.GATE;if(s!==void 0){let c=o;o=()=>s.call(this)&&c.call(this)}}else i=r;let a=!0;for(;o.call(this)===!0&&a===!0;)a=this.doSingleRepetition(i);this.attemptInRepetitionRecovery(this.manyInternal,[t,r],o,768,t,Ga,a)}manySepFirstInternal(t,r){let n=this.getKeyForAutomaticLookahead(1280,t);this.manySepFirstInternalLogic(t,r,n)}manySepFirstInternalLogic(t,r,n){let o=r.DEF,i=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){o.call(this);let s=()=>this.tokenMatcher(this.LA(1),i);for(;this.tokenMatcher(this.LA(1),i)===!0;)this.CONSUME(i),o.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,i,s,o,ai],s,1280,t,ai)}}repetitionSepSecondInternal(t,r,n,o,i){for(;n();)this.CONSUME(r),o.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,r,n,o,i],n,1536,t,i)}doSingleRepetition(t){let r=this.getLexerPosition();return t.call(this),this.getLexerPosition()>r}orInternal(t,r){let n=this.getKeyForAutomaticLookahead(256,r),o=b(t)?t:t.DEF,a=this.getLaFuncFromCache(n).call(this,o);if(a!==void 0)return o[a].ALT.call(this);this.raiseNoAltException(r,t.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){let t=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:t,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new li(r,t))}}subruleInternal(t,r,n){let o;try{let i=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,o=t.apply(this,i),this.cstPostNonTerminal(o,n!==void 0&&n.LABEL!==void 0?n.LABEL:t.ruleName),o}catch(i){throw this.subruleInternalError(i,n,t.ruleName)}}subruleInternalError(t,r,n){throw Pt(t)&&t.partialCstResult!==void 0&&(this.cstPostNonTerminal(t.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete t.partialCstResult),t}consumeInternal(t,r,n){let o;try{let i=this.LA(1);this.tokenMatcher(i,t)===!0?(this.consumeToken(),o=i):this.consumeInternalError(t,i,n)}catch(i){o=this.consumeInternalRecovery(t,r,i)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:t.name,o),o}consumeInternalError(t,r,n){let o,i=this.LA(0);throw n!==void 0&&n.ERR_MSG?o=n.ERR_MSG:o=this.errorMessageProvider.buildMismatchTokenMessage({expected:t,actual:r,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new mn(o,r,i))}consumeInternalRecovery(t,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){let o=this.getFollowsForInRuleRecovery(t,r);try{return this.tryInRuleRecovery(t,o)}catch(i){throw i.name===Uf?n:i}}else throw n}saveRecogState(){let t=this.errors,r=q(this.RULE_STACK);return{errors:t,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(t){this.errors=t.errors,this.importLexerState(t.lexerState),this.RULE_STACK=t.RULE_STACK}ruleInvocationStateUpdate(t,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(t),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let t=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[t]}shortRuleNameToFullName(t){return this.shortRuleNameToFull[t]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),$e)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}};var as=class{initErrorHandler(t){this._errors=[],this.errorMessageProvider=U(t,"errorMessageProvider")?t.errorMessageProvider:He.errorMessageProvider}SAVE_ERROR(t){if(Pt(t))return t.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:q(this.RULE_OCCURRENCE_STACK)},this._errors.push(t),t;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return q(this._errors)}set errors(t){this._errors=t}raiseEarlyExitException(t,r,n){let o=this.getCurrRuleFullName(),i=this.getGAstProductions()[o],s=fo(t,i,r,this.maxLookahead)[0],c=[];for(let u=1;u<=this.maxLookahead;u++)c.push(this.LA(u));let f=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:s,actual:c,previous:this.LA(0),customUserDescription:n,ruleName:o});throw this.SAVE_ERROR(new pi(f,this.LA(1),this.LA(0)))}raiseNoAltException(t,r){let n=this.getCurrRuleFullName(),o=this.getGAstProductions()[n],i=co(t,o,this.maxLookahead),a=[];for(let f=1;f<=this.maxLookahead;f++)a.push(this.LA(f));let s=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:i,actual:a,previous:s,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new ui(c,this.LA(1),s))}};var ss=class{initContentAssist(){}computeContentAssist(t,r){let n=this.gastProductionsCache[t];if(Me(n))throw Error(`Rule ->${t}<- does not exist in this grammar.`);return Wa([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(t){let r=xe(t.ruleStack),o=this.getGAstProductions()[r];return new ja(o,t).startWalking()}};var us={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(us);var lg=!0,pg=Math.pow(2,8)-1,mg=pn({name:"RECORDING_PHASE_TOKEN",pattern:D.NA});Jt([mg]);var hg=dn(mg,`This IToken indicates the Parser is in Recording Phase
|
|
135
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(hg);var hv={name:`This CSTNode indicates the Parser is in Recording Phase
|
|
136
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},cs=class{initGastRecorder(t){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let t=0;t<10;t++){let r=t>0?t:"";this[`CONSUME${r}`]=function(n,o){return this.consumeInternalRecord(n,t,o)},this[`SUBRULE${r}`]=function(n,o){return this.subruleInternalRecord(n,t,o)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,t)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,t)},this[`MANY${r}`]=function(n){this.manyInternalRecord(t,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(t,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(t,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(t,n)}}this.consume=function(t,r,n){return this.consumeInternalRecord(r,t,n)},this.subrule=function(t,r,n){return this.subruleInternalRecord(r,t,n)},this.option=function(t,r){return this.optionInternalRecord(r,t)},this.or=function(t,r){return this.orInternalRecord(r,t)},this.many=function(t,r){this.manyInternalRecord(t,r)},this.atLeastOne=function(t,r){this.atLeastOneInternalRecord(t,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{let t=this;for(let r=0;r<10;r++){let n=r>0?r:"";delete t[`CONSUME${n}`],delete t[`SUBRULE${n}`],delete t[`OPTION${n}`],delete t[`OR${n}`],delete t[`MANY${n}`],delete t[`MANY_SEP${n}`],delete t[`AT_LEAST_ONE${n}`],delete t[`AT_LEAST_ONE_SEP${n}`]}delete t.consume,delete t.subrule,delete t.option,delete t.or,delete t.many,delete t.atLeastOne,delete t.ACTION,delete t.BACKTRACK,delete t.LA})}ACTION_RECORD(t){}BACKTRACK_RECORD(t,r){return()=>!0}LA_RECORD(t){return lo}topLevelRuleRecord(t,r){try{let n=new je({definition:[],name:t});return n.name=t,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
|
|
137
|
+
This error was thrown during the "grammar recording phase" For more info see:
|
|
138
|
+
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(t,r){return mi.call(this,F,t,r)}atLeastOneInternalRecord(t,r){mi.call(this,z,r,t)}atLeastOneSepFirstInternalRecord(t,r){mi.call(this,X,r,t,lg)}manyInternalRecord(t,r){mi.call(this,k,r,t)}manySepFirstInternalRecord(t,r){mi.call(this,H,r,t,lg)}orInternalRecord(t,r){return gv.call(this,t,r)}subruleInternalRecord(t,r,n){if(fs(r),!t||U(t,"ruleName")===!1){let s=new Error(`<SUBRULE${dg(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(t)}>
|
|
139
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}let o=Ct(this.recordingProdStack),i=t.ruleName,a=new B({idx:r,nonTerminalName:i,label:n?.LABEL,referencedRule:void 0});return o.definition.push(a),this.outputCst?hv:us}consumeInternalRecord(t,r,n){if(fs(r),!mf(t)){let a=new Error(`<CONSUME${dg(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(t)}>
|
|
140
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}let o=Ct(this.recordingProdStack),i=new P({idx:r,terminalType:t,label:n?.LABEL});return o.definition.push(i),hg}};function mi(e,t,r,n=!1){fs(r);let o=Ct(this.recordingProdStack),i=Fe(t)?t:t.DEF,a=new e({definition:[],idx:r});return n&&(a.separator=t.SEP),U(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(a),i.call(this),o.definition.push(a),this.recordingProdStack.pop(),us}function gv(e,t){fs(t);let r=Ct(this.recordingProdStack),n=b(e)===!1,o=n===!1?e:e.DEF,i=new K({definition:[],idx:t,ignoreAmbiguities:n&&e.IGNORE_AMBIGUITIES===!0});U(e,"MAX_LOOKAHEAD")&&(i.maxLookahead=e.MAX_LOOKAHEAD);let a=Jo(o,s=>Fe(s.GATE));return i.hasPredicates=a,r.definition.push(i),L(o,s=>{let c=new Y({definition:[]});i.definition.push(c),U(s,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=s.IGNORE_AMBIGUITIES:U(s,"GATE")&&(c.ignoreAmbiguities=!0),this.recordingProdStack.push(c),s.ALT.call(this),this.recordingProdStack.pop()}),us}function dg(e){return e===0?"":`${e}`}function fs(e){if(e<0||e>pg){let t=new Error(`Invalid DSL Method idx value: <${e}>
|
|
141
|
+
Idx value must be a none negative value smaller than ${pg+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}var ls=class{initPerformanceTracer(t){if(U(t,"traceInitPerf")){let r=t.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=He.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(t,r){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${t}>`);let{time:o,value:i}=Zo(r),a=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${n}<-- <${t}> time: ${o}ms`),this.traceInitIndent--,i}else return r()}};function gg(e,t){t.forEach(r=>{let n=r.prototype;Object.getOwnPropertyNames(n).forEach(o=>{if(o==="constructor")return;let i=Object.getOwnPropertyDescriptor(n,o);i&&(i.get||i.set)?Object.defineProperty(e.prototype,o,i):e.prototype[o]=r.prototype[o]})})}var lo=dn($e,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(lo);var He=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Da,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),po=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0}),ye;(function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(ye||(ye={}));var hi=class e{static performSelfAnalysis(t){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let t;this.selfAnalysisDone=!0;let r=this.className;this.TRACE_INIT("toFastProps",()=>{$o(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),L(this.definedRulesNames,o=>{let a=this[o].originalGrammarAction,s;this.TRACE_INIT(`${o} Rule`,()=>{s=this.topLevelRuleRecord(o,a)}),this.gastProductionsCache[o]=s})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=eg({rules:G(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(M(n)&&this.skipValidations===!1){let o=tg({rules:G(this.gastProductionsCache),tokenTypes:G(this.tokensMap),errMsgProvider:ht,grammarName:r}),i=Yh({lookaheadStrategy:this.lookaheadStrategy,rules:G(this.gastProductionsCache),tokenTypes:G(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(o,i)}}),M(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{let o=ch(G(this.gastProductionsCache));this.resyncFollows=o}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var o,i;(i=(o=this.lookaheadStrategy).initialize)===null||i===void 0||i.call(o,{rules:G(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(G(this.gastProductionsCache))})),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!M(this.definitionErrors))throw t=O(this.definitionErrors,o=>o.message),new Error(`Parser Definition Errors detected:
|
|
142
|
+
${t.join(`
|
|
143
|
+
-------------------------------
|
|
144
|
+
`)}`)})}constructor(t,r){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(t,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),U(r,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|
145
|
+
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
146
|
+
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
147
|
+
For further details.`);this.skipValidations=U(r,"skipValidations")?r.skipValidations:He.skipValidations}};hi.DEFER_DEFINITION_ERRORS_HANDLING=!1;gg(hi,[Xa,Za,rs,ns,is,os,as,ss,cs,ls]);var gi=class extends hi{constructor(t,r=He){let n=q(r);n.outputCst=!0,super(t,n)}};var ey=jt(ZE(),1);var Ff=(e,t)=>{for(let r=0;r<t.length;r++){let n=t[r],o=n[0],i=n[1];for(let a=o;a<=i;a++)e.add(a)}},Si=new Set([181,257,259,261,263,265,267,269,271,273,275,277,279,281,283,285,287,289,291,293,295,297,299,301,303,305,307,309,314,316,318,320,322,324,326,331,333,335,337,339,341,343,345,347,349,351,353,355,357,359,361,363,365,367,369,371,373,375,378,380,387,389,392,402,405,414,417,419,421,424,429,432,436,438,454,457,460,462,464,466,468,470,472,474,479,481,483,485,487,489,491,493,499,501,505,507,509,511,513,515,517,519,521,523,525,527,529,531,533,535,537,539,541,543,545,547,549,551,553,555,557,559,561,572,578,583,585,587,589,881,883,887,912,985,987,989,991,993,995,997,999,1001,1003,1005,1013,1016,1121,1123,1125,1127,1129,1131,1133,1135,1137,1139,1141,1143,1145,1147,1149,1151,1153,1163,1165,1167,1169,1171,1173,1175,1177,1179,1181,1183,1185,1187,1189,1191,1193,1195,1197,1199,1201,1203,1205,1207,1209,1211,1213,1215,1218,1220,1222,1224,1226,1228,1233,1235,1237,1239,1241,1243,1245,1247,1249,1251,1253,1255,1257,1259,1261,1263,1265,1267,1269,1271,1273,1275,1277,1279,1281,1283,1285,1287,1289,1291,1293,1295,1297,1299,1301,1303,1305,1307,1309,1311,1313,1315,1317,1319,1321,1323,1325,1327,7681,7683,7685,7687,7689,7691,7693,7695,7697,7699,7701,7703,7705,7707,7709,7711,7713,7715,7717,7719,7721,7723,7725,7727,7729,7731,7733,7735,7737,7739,7741,7743,7745,7747,7749,7751,7753,7755,7757,7759,7761,7763,7765,7767,7769,7771,7773,7775,7777,7779,7781,7783,7785,7787,7789,7791,7793,7795,7797,7799,7801,7803,7805,7807,7809,7811,7813,7815,7817,7819,7821,7823,7825,7827,7839,7841,7843,7845,7847,7849,7851,7853,7855,7857,7859,7861,7863,7865,7867,7869,7871,7873,7875,7877,7879,7881,7883,7885,7887,7889,7891,7893,7895,7897,7899,7901,7903,7905,7907,7909,7911,7913,7915,7917,7919,7921,7923,7925,7927,7929,7931,7933,8126,8458,8467,8495,8500,8505,8526,8580,11361,11368,11370,11372,11377,11393,11395,11397,11399,11401,11403,11405,11407,11409,11411,11413,11415,11417,11419,11421,11423,11425,11427,11429,11431,11433,11435,11437,11439,11441,11443,11445,11447,11449,11451,11453,11455,11457,11459,11461,11463,11465,11467,11469,11471,11473,11475,11477,11479,11481,11483,11485,11487,11489,11500,11502,11507,11559,11565,42561,42563,42565,42567,42569,42571,42573,42575,42577,42579,42581,42583,42585,42587,42589,42591,42593,42595,42597,42599,42601,42603,42605,42625,42627,42629,42631,42633,42635,42637,42639,42641,42643,42645,42647,42649,42651,42787,42789,42791,42793,42795,42797,42803,42805,42807,42809,42811,42813,42815,42817,42819,42821,42823,42825,42827,42829,42831,42833,42835,42837,42839,42841,42843,42845,42847,42849,42851,42853,42855,42857,42859,42861,42863,42874,42876,42879,42881,42883,42885,42887,42892,42894,42897,42903,42905,42907,42909,42911,42913,42915,42917,42919,42921,42927,42933,42935,42937,42939,42941,42943,42947,43002,119995,120779,748,750,884,890,1369,1600,2042,2074,2084,2088,2417,3654,3782,4348,6103,6211,6823,7544,8305,8319,11631,11823,12293,12347,40981,42508,42623,42864,42888,43471,43494,43632,43741,65392,94179,125259,170,186,443,660,1749,1791,1808,1969,2365,2384,2482,2493,2510,2556,2654,2749,2768,2809,2877,2929,2947,2972,3024,3133,3200,3261,3294,3389,3406,3517,3716,3749,3773,3840,4159,4193,4238,4696,4800,6108,6314,7418,12294,12348,12447,12543,13312,19968,42606,42895,42999,43259,43642,43697,43712,43714,43762,44032,64285,64318,67592,67644,68096,69415,69956,70006,70106,70108,70280,70461,70480,70751,70855,71236,71352,71935,72161,72163,72192,72250,72272,72349,72768,73030,73112,94032,94208,123214,126500,126503,126521,126523,126530,126535,126537,126539,126548,126551,126553,126555,126557,126559,126564,126590,131072,173824,177984,178208,183984,453,456,459,498,8124,8140,8188,256,258,260,262,264,266,268,270,272,274,276,278,280,282,284,286,288,290,292,294,296,298,300,302,304,306,308,310,313,315,317,319,321,323,325,327,330,332,334,336,338,340,342,344,346,348,350,352,354,356,358,360,362,364,366,368,370,372,374,379,381,388,418,420,425,428,437,444,452,455,458,461,463,465,467,469,471,473,475,478,480,482,484,486,488,490,492,494,497,500,506,508,510,512,514,516,518,520,522,524,526,528,530,532,534,536,538,540,542,544,546,548,550,552,554,556,558,560,562,577,584,586,588,590,880,882,886,895,902,908,975,984,986,988,990,992,994,996,998,1e3,1002,1004,1006,1012,1015,1120,1122,1124,1126,1128,1130,1132,1134,1136,1138,1140,1142,1144,1146,1148,1150,1152,1162,1164,1166,1168,1170,1172,1174,1176,1178,1180,1182,1184,1186,1188,1190,1192,1194,1196,1198,1200,1202,1204,1206,1208,1210,1212,1214,1219,1221,1223,1225,1227,1229,1232,1234,1236,1238,1240,1242,1244,1246,1248,1250,1252,1254,1256,1258,1260,1262,1264,1266,1268,1270,1272,1274,1276,1278,1280,1282,1284,1286,1288,1290,1292,1294,1296,1298,1300,1302,1304,1306,1308,1310,1312,1314,1316,1318,1320,1322,1324,1326,4295,4301,7680,7682,7684,7686,7688,7690,7692,7694,7696,7698,7700,7702,7704,7706,7708,7710,7712,7714,7716,7718,7720,7722,7724,7726,7728,7730,7732,7734,7736,7738,7740,7742,7744,7746,7748,7750,7752,7754,7756,7758,7760,7762,7764,7766,7768,7770,7772,7774,7776,7778,7780,7782,7784,7786,7788,7790,7792,7794,7796,7798,7800,7802,7804,7806,7808,7810,7812,7814,7816,7818,7820,7822,7824,7826,7828,7838,7840,7842,7844,7846,7848,7850,7852,7854,7856,7858,7860,7862,7864,7866,7868,7870,7872,7874,7876,7878,7880,7882,7884,7886,7888,7890,7892,7894,7896,7898,7900,7902,7904,7906,7908,7910,7912,7914,7916,7918,7920,7922,7924,7926,7928,7930,7932,7934,8025,8027,8029,8031,8450,8455,8469,8484,8486,8488,8517,8579,11360,11367,11369,11371,11378,11381,11394,11396,11398,11400,11402,11404,11406,11408,11410,11412,11414,11416,11418,11420,11422,11424,11426,11428,11430,11432,11434,11436,11438,11440,11442,11444,11446,11448,11450,11452,11454,11456,11458,11460,11462,11464,11466,11468,11470,11472,11474,11476,11478,11480,11482,11484,11486,11488,11490,11499,11501,11506,42560,42562,42564,42566,42568,42570,42572,42574,42576,42578,42580,42582,42584,42586,42588,42590,42592,42594,42596,42598,42600,42602,42604,42624,42626,42628,42630,42632,42634,42636,42638,42640,42642,42644,42646,42648,42650,42786,42788,42790,42792,42794,42796,42798,42802,42804,42806,42808,42810,42812,42814,42816,42818,42820,42822,42824,42826,42828,42830,42832,42834,42836,42838,42840,42842,42844,42846,42848,42850,42852,42854,42856,42858,42860,42862,42873,42875,42880,42882,42884,42886,42891,42893,42896,42898,42902,42904,42906,42908,42910,42912,42914,42916,42918,42920,42934,42936,42938,42940,42942,42946,119964,119970,120134,120778,12295,66369,66378,36,1423,1547,2555,2801,3065,3647,6107,43064,65020,65129,65284,123647,126128,95,8276,65343]),_4=[[97,122],[223,246],[248,255],[311,312],[328,329],[382,384],[396,397],[409,411],[426,427],[441,442],[445,447],[476,477],[495,496],[563,569],[575,576],[591,659],[661,687],[891,893],[940,974],[976,977],[981,983],[1007,1011],[1019,1020],[1072,1119],[1230,1231],[1376,1416],[4304,4346],[4349,4351],[5112,5117],[7296,7304],[7424,7467],[7531,7543],[7545,7578],[7829,7837],[7935,7943],[7952,7957],[7968,7975],[7984,7991],[8e3,8005],[8016,8023],[8032,8039],[8048,8061],[8064,8071],[8080,8087],[8096,8103],[8112,8116],[8118,8119],[8130,8132],[8134,8135],[8144,8147],[8150,8151],[8160,8167],[8178,8180],[8182,8183],[8462,8463],[8508,8509],[8518,8521],[11312,11358],[11365,11366],[11379,11380],[11382,11387],[11491,11492],[11520,11557],[42799,42801],[42865,42872],[42899,42901],[43824,43866],[43872,43879],[43888,43967],[64256,64262],[64275,64279],[65345,65370],[66600,66639],[66776,66811],[68800,68850],[71872,71903],[93792,93823],[119834,119859],[119886,119892],[119894,119911],[119938,119963],[119990,119993],[119997,120003],[120005,120015],[120042,120067],[120094,120119],[120146,120171],[120198,120223],[120250,120275],[120302,120327],[120354,120379],[120406,120431],[120458,120485],[120514,120538],[120540,120545],[120572,120596],[120598,120603],[120630,120654],[120656,120661],[120688,120712],[120714,120719],[120746,120770],[120772,120777],[125218,125251],[688,705],[710,721],[736,740],[1765,1766],[2036,2037],[7288,7293],[7468,7530],[7579,7615],[8336,8348],[11388,11389],[12337,12341],[12445,12446],[12540,12542],[42232,42237],[42652,42653],[42775,42783],[43e3,43001],[43763,43764],[43868,43871],[65438,65439],[92992,92995],[94099,94111],[94176,94177],[123191,123197],[13313,19893],[19969,40943],[44033,55203],[94209,100343],[131073,173782],[173825,177972],[177985,178205],[178209,183969],[183985,191456],[448,451],[1488,1514],[1519,1522],[1568,1599],[1601,1610],[1646,1647],[1649,1747],[1774,1775],[1786,1788],[1810,1839],[1869,1957],[1994,2026],[2048,2069],[2112,2136],[2144,2154],[2208,2228],[2230,2237],[2308,2361],[2392,2401],[2418,2432],[2437,2444],[2447,2448],[2451,2472],[2474,2480],[2486,2489],[2524,2525],[2527,2529],[2544,2545],[2565,2570],[2575,2576],[2579,2600],[2602,2608],[2610,2611],[2613,2614],[2616,2617],[2649,2652],[2674,2676],[2693,2701],[2703,2705],[2707,2728],[2730,2736],[2738,2739],[2741,2745],[2784,2785],[2821,2828],[2831,2832],[2835,2856],[2858,2864],[2866,2867],[2869,2873],[2908,2909],[2911,2913],[2949,2954],[2958,2960],[2962,2965],[2969,2970],[2974,2975],[2979,2980],[2984,2986],[2990,3001],[3077,3084],[3086,3088],[3090,3112],[3114,3129],[3160,3162],[3168,3169],[3205,3212],[3214,3216],[3218,3240],[3242,3251],[3253,3257],[3296,3297],[3313,3314],[3333,3340],[3342,3344],[3346,3386],[3412,3414],[3423,3425],[3450,3455],[3461,3478],[3482,3505],[3507,3515],[3520,3526],[3585,3632],[3634,3635],[3648,3653],[3713,3714],[3718,3722],[3724,3747],[3751,3760],[3762,3763],[3776,3780],[3804,3807],[3904,3911],[3913,3948],[3976,3980],[4096,4138],[4176,4181],[4186,4189],[4197,4198],[4206,4208],[4213,4225],[4352,4680],[4682,4685],[4688,4694],[4698,4701],[4704,4744],[4746,4749],[4752,4784],[4786,4789],[4792,4798],[4802,4805],[4808,4822],[4824,4880],[4882,4885],[4888,4954],[4992,5007],[5121,5740],[5743,5759],[5761,5786],[5792,5866],[5873,5880],[5888,5900],[5902,5905],[5920,5937],[5952,5969],[5984,5996],[5998,6e3],[6016,6067],[6176,6210],[6212,6264],[6272,6276],[6279,6312],[6320,6389],[6400,6430],[6480,6509],[6512,6516],[6528,6571],[6576,6601],[6656,6678],[6688,6740],[6917,6963],[6981,6987],[7043,7072],[7086,7087],[7098,7141],[7168,7203],[7245,7247],[7258,7287],[7401,7404],[7406,7411],[7413,7414],[8501,8504],[11568,11623],[11648,11670],[11680,11686],[11688,11694],[11696,11702],[11704,11710],[11712,11718],[11720,11726],[11728,11734],[11736,11742],[12353,12438],[12449,12538],[12549,12591],[12593,12686],[12704,12730],[12784,12799],[40960,40980],[40982,42124],[42192,42231],[42240,42507],[42512,42527],[42538,42539],[42656,42725],[43003,43009],[43011,43013],[43015,43018],[43020,43042],[43072,43123],[43138,43187],[43250,43255],[43261,43262],[43274,43301],[43312,43334],[43360,43388],[43396,43442],[43488,43492],[43495,43503],[43514,43518],[43520,43560],[43584,43586],[43588,43595],[43616,43631],[43633,43638],[43646,43695],[43701,43702],[43705,43709],[43739,43740],[43744,43754],[43777,43782],[43785,43790],[43793,43798],[43808,43814],[43816,43822],[43968,44002],[55216,55238],[55243,55291],[63744,64109],[64112,64217],[64287,64296],[64298,64310],[64312,64316],[64320,64321],[64323,64324],[64326,64433],[64467,64829],[64848,64911],[64914,64967],[65008,65019],[65136,65140],[65142,65276],[65382,65391],[65393,65437],[65440,65470],[65474,65479],[65482,65487],[65490,65495],[65498,65500],[65536,65547],[65549,65574],[65576,65594],[65596,65597],[65599,65613],[65616,65629],[65664,65786],[66176,66204],[66208,66256],[66304,66335],[66349,66368],[66370,66377],[66384,66421],[66432,66461],[66464,66499],[66504,66511],[66640,66717],[66816,66855],[66864,66915],[67072,67382],[67392,67413],[67424,67431],[67584,67589],[67594,67637],[67639,67640],[67647,67669],[67680,67702],[67712,67742],[67808,67826],[67828,67829],[67840,67861],[67872,67897],[67968,68023],[68030,68031],[68112,68115],[68117,68119],[68121,68149],[68192,68220],[68224,68252],[68288,68295],[68297,68324],[68352,68405],[68416,68437],[68448,68466],[68480,68497],[68608,68680],[68864,68899],[69376,69404],[69424,69445],[69600,69622],[69635,69687],[69763,69807],[69840,69864],[69891,69926],[69968,70002],[70019,70066],[70081,70084],[70144,70161],[70163,70187],[70272,70278],[70282,70285],[70287,70301],[70303,70312],[70320,70366],[70405,70412],[70415,70416],[70419,70440],[70442,70448],[70450,70451],[70453,70457],[70493,70497],[70656,70708],[70727,70730],[70784,70831],[70852,70853],[71040,71086],[71128,71131],[71168,71215],[71296,71338],[71424,71450],[71680,71723],[72096,72103],[72106,72144],[72203,72242],[72284,72329],[72384,72440],[72704,72712],[72714,72750],[72818,72847],[72960,72966],[72968,72969],[72971,73008],[73056,73061],[73063,73064],[73066,73097],[73440,73458],[73728,74649],[74880,75075],[77824,78894],[82944,83526],[92160,92728],[92736,92766],[92880,92909],[92928,92975],[93027,93047],[93053,93071],[93952,94026],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[113664,113770],[113776,113788],[113792,113800],[113808,113817],[123136,123180],[123584,123627],[124928,125124],[126464,126467],[126469,126495],[126497,126498],[126505,126514],[126516,126519],[126541,126543],[126545,126546],[126561,126562],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[194560,195101],[8072,8079],[8088,8095],[8104,8111],[65,90],[192,214],[216,222],[376,377],[385,386],[390,391],[393,395],[398,401],[403,404],[406,408],[412,413],[415,416],[422,423],[430,431],[433,435],[439,440],[502,504],[570,571],[573,574],[579,582],[904,906],[910,911],[913,929],[931,939],[978,980],[1017,1018],[1021,1071],[1216,1217],[1329,1366],[4256,4293],[5024,5109],[7312,7354],[7357,7359],[7944,7951],[7960,7965],[7976,7983],[7992,7999],[8008,8013],[8040,8047],[8120,8123],[8136,8139],[8152,8155],[8168,8172],[8184,8187],[8459,8461],[8464,8466],[8473,8477],[8490,8493],[8496,8499],[8510,8511],[11264,11310],[11362,11364],[11373,11376],[11390,11392],[42877,42878],[42922,42926],[42928,42932],[42948,42950],[65313,65338],[66560,66599],[66736,66771],[68736,68786],[71840,71871],[93760,93791],[119808,119833],[119860,119885],[119912,119937],[119966,119967],[119973,119974],[119977,119980],[119982,119989],[120016,120041],[120068,120069],[120071,120074],[120077,120084],[120086,120092],[120120,120121],[120123,120126],[120128,120132],[120138,120144],[120172,120197],[120224,120249],[120276,120301],[120328,120353],[120380,120405],[120432,120457],[120488,120512],[120546,120570],[120604,120628],[120662,120686],[120720,120744],[125184,125217],[5870,5872],[8544,8578],[8581,8584],[12321,12329],[12344,12346],[42726,42735],[65856,65908],[66513,66517],[74752,74862],[162,165],[2046,2047],[2546,2547],[8352,8383],[65504,65505],[65509,65510],[73693,73696],[8255,8256],[65075,65076],[65101,65103]];Ff(Si,_4);var Df=new Set([1471,1479,1648,1809,2045,2362,2364,2381,2433,2492,2509,2558,2620,2641,2677,2748,2765,2817,2876,2879,2893,2902,2946,3008,3021,3072,3076,3201,3260,3263,3270,3405,3530,3542,3633,3761,3893,3895,3897,4038,4226,4237,4253,6086,6109,6313,6450,6683,6742,6752,6754,6783,6964,6972,6978,7142,7149,7405,7412,8417,11647,42607,43010,43014,43019,43263,43443,43493,43587,43596,43644,43696,43713,43766,44005,44008,44013,64286,66045,66272,68159,69633,70003,70196,70206,70367,70464,70726,70750,70842,71229,71339,71341,71351,72160,72263,72767,73018,73031,73109,73111,94031,121461,121476,173,1564,1757,1807,2274,6158,65279,69821,69837,917505]),B4=[[768,879],[1155,1159],[1425,1469],[1473,1474],[1476,1477],[1552,1562],[1611,1631],[1750,1756],[1759,1764],[1767,1768],[1770,1773],[1840,1866],[1958,1968],[2027,2035],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2273],[2275,2306],[2369,2376],[2385,2391],[2402,2403],[2497,2500],[2530,2531],[2561,2562],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2753,2757],[2759,2760],[2786,2787],[2810,2815],[2881,2884],[2914,2915],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3426,3427],[3538,3540],[3636,3642],[3655,3662],[3764,3772],[3784,3789],[3864,3865],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4229,4230],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6089,6099],[6155,6157],[6277,6278],[6432,6434],[6439,6440],[6457,6459],[6679,6680],[6744,6750],[6757,6764],[6771,6780],[6832,6845],[6912,6915],[6966,6970],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7144,7145],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7416,7417],[7616,7673],[7675,7679],[8400,8412],[8421,8432],[11503,11505],[11744,11775],[12330,12333],[12441,12442],[42612,42621],[42654,42655],[42736,42737],[43045,43046],[43204,43205],[43232,43249],[43302,43309],[43335,43345],[43392,43394],[43446,43449],[43452,43453],[43561,43566],[43569,43570],[43573,43574],[43698,43700],[43703,43704],[43710,43711],[43756,43757],[65024,65039],[65056,65071],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68325,68326],[68900,68903],[69446,69456],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69888,69890],[69927,69931],[69933,69940],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70198,70199],[70371,70378],[70400,70401],[70459,70460],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70835,70840],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71231,71232],[71344,71349],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72193,72202],[72243,72248],[72251,72254],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73020,73021],[73023,73029],[73104,73105],[73459,73460],[92912,92916],[92976,92982],[94095,94098],[113821,113822],[119143,119145],[119163,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917760,917999],[1536,1541],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[65529,65531],[78896,78904],[113824,113827],[119155,119162],[917536,917631]];Ff(Df,B4);var F4=[[0,8],[14,27],[127,159],[768,879],[6832,6911],[7616,7679],[8400,8447],[65056,65071],[48,57]];Ff(Df,F4);var $E=new Set((function*(){yield*Si,yield*Df})());var jf={};function ty(e){let t=e;return Object.keys(jf).forEach(r=>{let n=jf[r],o=new RegExp(`{{${r}}}`,"g");t=t.replace(o,n)}),t}function we(e,t){jf[e]=ty(t)}function et(e,t){let r=ty(e);return new RegExp(r,t)}we("Digits","[0-9]([0-9_]*[0-9])?");we("ExponentPart","[eE][+-]?{{Digits}}");we("HexDigit","[0-9a-fA-F]");we("HexDigits","{{HexDigit}}(({{HexDigit}}|'_')*{{HexDigit}})?");we("FloatTypeSuffix","[fFdD]");we("LineTerminator","(\\x0A|(\\x0D(\\x0A)?))");we("UnicodeMarker","uu*");we("UnicodeEscape","\\\\{{UnicodeMarker}}{{HexDigit}}{4}");we("RawInputCharacter","\\\\{{UnicodeMarker}}[0-9a-fA-F]{4}");we("UnicodeInputCharacter","({{UnicodeEscape}}|{{RawInputCharacter}})");we("OctalDigit","[0-7]");we("ZeroToThree","[0-3]");we("OctalEscape","\\\\({{OctalDigit}}|{{ZeroToThree}}?{{OctalDigit}}{2})");we("EscapeSequence",`\\\\[bstnfr"'\\\\]|{{OctalEscape}}`);we("StringCharacter",'(?:(?:{{EscapeSequence}})|{{UnicodeEscape}}|(?!["\\\\]).)');we("TextBlockCharacter","(?:(?:{{EscapeSequence}})|{{UnicodeEscape}}|(?!\\\\).|\\\\?{{LineTerminator}})");function j4(e,t){let r=t,n=e.codePointAt(r);for(Si.has(n)&&(r++,n>65535&&r++,n=e.codePointAt(r));$E.has(n);)r++,n>65535&&r++,n=e.codePointAt(r);return r===t?null:[e.substring(t,r)]}var gn=pn({name:"Identifier",pattern:{exec:j4},line_breaks:!1,start_chars_hint:Array.from(Si,e=>String.fromCharCode(e))}),Zt={modes:{global:[],stringTemplate:[],textBlockTemplate:[]},defaultMode:"global"},ry=Object.keys(Zt.modes),tt={};function R(e,t=ry){e.label||(typeof e.pattern=="string"?e.label=`'${e.pattern}'`:e.pattern instanceof RegExp&&(e.label=`'${e.name}'`));let r=pn(e);return t.forEach(n=>Zt.modes[n].push(r)),tt[e.name]=r,r}function $t(e){return e.longer_alt=gn,R(e)}var G4=R({name:"RestrictedKeyword",pattern:D.NA}),ny=R({name:"Keyword",pattern:D.NA}),ft=R({name:"AssignmentOperator",pattern:D.NA}),Re=R({name:"BinaryOperator",pattern:D.NA}),ho=R({name:"UnaryPrefixOperator",pattern:D.NA}),ds=R({name:"UnaryPrefixOperatorNotPlusMinus",pattern:D.NA}),oy=R({name:"UnarySuffixOperator",pattern:D.NA}),ut=R({name:"Separators",pattern:D.NA});R({name:"WhiteSpace",pattern:et("[\\x09\\x20\\x0C]|{{LineTerminator}}"),group:D.SKIPPED});R({name:"LineComment",pattern:/\/\/[^\n\r]*/,group:"comments"});R({name:"TraditionalComment",pattern:/\/\*([^*]|\*(?!\/))*\*\//,group:"comments"});R({name:"BinaryLiteral",pattern:/0[bB][01]([01_]*[01])?[lL]?/});R({name:"FloatLiteral",pattern:et("{{Digits}}\\.({{Digits}})?({{ExponentPart}})?({{FloatTypeSuffix}})?|\\.{{Digits}}({{ExponentPart}})?({{FloatTypeSuffix}})?|{{Digits}}{{ExponentPart}}({{FloatTypeSuffix}})?|{{Digits}}({{ExponentPart}})?{{FloatTypeSuffix}}")});R({name:"OctalLiteral",pattern:/0_*[0-7]([0-7_]*[0-7])?[lL]?/});R({name:"HexFloatLiteral",pattern:et("0[xX]({{HexDigits}}\\.?|({{HexDigits}})?\\.{{HexDigits}})[pP][+-]?{{Digits}}[fFdD]?")});R({name:"HexLiteral",pattern:/0[xX][0-9a-fA-F]([0-9a-fA-F_]*[0-9a-fA-F])?[lL]?/});R({name:"DecimalLiteral",pattern:et("(0|[1-9](_+{{Digits}}|({{Digits}})?))[lL]?")});R({name:"CharLiteral",pattern:et("'(?:[^\\\\']|(?:(?:{{EscapeSequence}})|{{UnicodeInputCharacter}}))'")});R({name:"TextBlock",pattern:et('"""[\\x09\\x20\\x0C]*{{LineTerminator}}{{TextBlockCharacter}}*?"""')});R({name:"TextBlockTemplateBegin",pattern:et('"""{{LineTerminator}}{{TextBlockCharacter}}*?\\\\\\{'),push_mode:"textBlockTemplate"});R({name:"TextBlockTemplateEnd",pattern:et('\\}{{TextBlockCharacter}}*?"""'),pop_mode:!0},["textBlockTemplate"]);R({name:"StringLiteral",pattern:et('"{{StringCharacter}}*?"')});R({name:"StringTemplateBegin",pattern:et('"{{StringCharacter}}*?\\\\\\{'),push_mode:"stringTemplate"});R({name:"StringTemplateEnd",pattern:et('\\}{{StringCharacter}}*?"'),pop_mode:!0},["stringTemplate"]);R({name:"StringTemplateMid",pattern:et("\\}{{StringCharacter}}*?\\\\\\{")},["stringTemplate"]);R({name:"TextBlockTemplateMid",pattern:et("\\}{{TextBlockCharacter}}*?\\\\\\{")},["textBlockTemplate"]);var H4=["open","module","requires","transitive","exports","opens","to","uses","provides","when","with","sealed","non-sealed","permits"];iy(H4).forEach(e=>{$t({name:e[0].toUpperCase()+(0,ey.default)(e.substr(1)),pattern:e,categories:[gn,G4]})});var K4=["abstract","continue","for","new","switch","assert","default","if","package","synchronized","boolean","do","goto","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while",["_","underscore"]];iy(K4).forEach(e=>{let t=Array.isArray(e),r=t?e[1]:e,n=t?e[0]:e,o={name:r[0].toUpperCase()+r.substr(1),pattern:n,categories:ny};t&&(o.label=`'${r}'`),$t(o)});$t({name:"Instanceof",pattern:"instanceof",categories:[ny,Re]});$t({name:"Var",pattern:"var",categories:gn});$t({name:"Yield",pattern:"yield",categories:gn});$t({name:"Record",pattern:"record",categories:gn});$t({name:"True",pattern:"true"});$t({name:"False",pattern:"false"});$t({name:"Null",pattern:"null"});R({name:"At",pattern:"@",categories:[ut]});R({name:"Arrow",pattern:"->"});R({name:"DotDotDot",pattern:"...",categories:[ut]});R({name:"Dot",pattern:".",categories:[ut]});R({name:"Comma",pattern:",",categories:[ut]});R({name:"Semicolon",pattern:";",categories:[ut]});R({name:"ColonColon",pattern:"::",categories:[ut]});R({name:"Colon",pattern:":"});R({name:"QuestionMark",pattern:"?"});R({name:"LBrace",pattern:"(",categories:[ut]});R({name:"RBrace",pattern:")",categories:[ut]});R({name:"LCurly",pattern:"{",categories:[ut],push_mode:Zt.defaultMode});R({name:"RCurly",pattern:"}",categories:[ut],pop_mode:!0},[Zt.defaultMode]);R({name:"LSquare",pattern:"[",categories:[ut]});R({name:"RSquare",pattern:"]",categories:[ut]});R({name:"MinusMinus",pattern:"--",categories:[ho,oy,ds]});R({name:"PlusPlus",pattern:"++",categories:[ho,oy,ds]});R({name:"Complement",pattern:"~",categories:[ho,ds]});R({name:"LessEquals",pattern:"<=",categories:[Re]});R({name:"LessLessEquals",pattern:"<<=",categories:[ft]});R({name:"Less",pattern:"<",categories:[Re]});R({name:"GreaterEquals",pattern:">=",categories:[Re]});R({name:"GreaterGreaterEquals",pattern:">>=",categories:[ft]});R({name:"GreaterGreaterGreaterEquals",pattern:">>>=",categories:[ft]});R({name:"Greater",pattern:">",categories:[Re]});R({name:"EqualsEquals",pattern:"==",categories:[Re]});R({name:"Equals",pattern:"=",categories:[Re,ft]});R({name:"MinusEquals",pattern:"-=",categories:[ft]});R({name:"Minus",pattern:"-",categories:[Re,ho]});R({name:"PlusEquals",pattern:"+=",categories:[ft]});R({name:"Plus",pattern:"+",categories:[Re,ho]});R({name:"AndAnd",pattern:"&&",categories:[Re]});R({name:"AndEquals",pattern:"&=",categories:[ft]});R({name:"And",pattern:"&",categories:[Re]});R({name:"XorEquals",pattern:"^=",categories:[ft]});R({name:"Xor",pattern:"^",categories:[Re]});R({name:"NotEquals",pattern:"!=",categories:[Re]});R({name:"OrOr",pattern:"||",categories:[Re]});R({name:"OrEquals",pattern:"|=",categories:[ft]});R({name:"Or",pattern:"|",categories:[Re]});R({name:"MultiplyEquals",pattern:"*=",categories:[ft]});R({name:"Star",pattern:"*",categories:[Re]});R({name:"DivideEquals",pattern:"/=",categories:[ft]});R({name:"Divide",pattern:"/",categories:[Re]});R({name:"ModuloEquals",pattern:"%=",categories:[ft]});R({name:"Modulo",pattern:"%",categories:[Re]});R({name:"Not",pattern:"!",categories:[ho,ds]});ry.forEach(e=>Zt.modes[e].push(gn));tt.Identifier=gn;function iy(e){return e.sort((t,r)=>r.length-t.length)}function Ti(){return(typeof process<"u"&&process.env&&process.env["prettier-java-development-mode"]==="enabled")===!1}var ay=new D(Zt,{ensureOptimizations:!0,skipValidations:Ti()});function W4(e,t){for(var r=-1,n=e==null?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}var ms=W4;function V4(){this.__data__=[],this.size=0}var sy=V4;function q4(e,t){return e===t||e!==e&&t!==t}var hs=q4;function Y4(e,t){for(var r=e.length;r--;)if(hs(e[r][0],t))return r;return-1}var _r=Y4;var z4=Array.prototype,X4=z4.splice;function J4(e){var t=this.__data__,r=_r(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():X4.call(t,r,1),--this.size,!0}var cy=J4;function Q4(e){var t=this.__data__,r=_r(t,e);return r<0?void 0:t[r][1]}var fy=Q4;function Z4(e){return _r(this.__data__,e)>-1}var uy=Z4;function $4(e,t){var r=this.__data__,n=_r(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var ly=$4;function go(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}go.prototype.clear=sy;go.prototype.delete=cy;go.prototype.get=fy;go.prototype.has=uy;go.prototype.set=ly;var Br=go;function e7(){this.__data__=new Br,this.size=0}var py=e7;function t7(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var dy=t7;function r7(e){return this.__data__.get(e)}var my=r7;function n7(e){return this.__data__.has(e)}var hy=n7;var o7=typeof global=="object"&&global&&global.Object===Object&&global,gs=o7;var i7=typeof self=="object"&&self&&self.Object===Object&&self,a7=gs||i7||Function("return this")(),Oe=a7;var s7=Oe.Symbol,Ke=s7;var gy=Object.prototype,c7=gy.hasOwnProperty,f7=gy.toString,xi=Ke?Ke.toStringTag:void 0;function u7(e){var t=c7.call(e,xi),r=e[xi];try{e[xi]=void 0;var n=!0}catch{}var o=f7.call(e);return n&&(t?e[xi]=r:delete e[xi]),o}var Ey=u7;var l7=Object.prototype,p7=l7.toString;function d7(e){return p7.call(e)}var yy=d7;var m7="[object Null]",h7="[object Undefined]",Sy=Ke?Ke.toStringTag:void 0;function g7(e){return e==null?e===void 0?h7:m7:Sy&&Sy in Object(e)?Ey(e):yy(e)}var gt=g7;function E7(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Eo=E7;var y7="[object AsyncFunction]",S7="[object Function]",T7="[object GeneratorFunction]",x7="[object Proxy]";function R7(e){if(!Eo(e))return!1;var t=gt(e);return t==S7||t==T7||t==y7||t==x7}var Es=R7;var O7=Oe["__core-js_shared__"],ys=O7;var Ty=(function(){var e=/[^.]+$/.exec(ys&&ys.keys&&ys.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function L7(e){return!!Ty&&Ty in e}var xy=L7;var A7=Function.prototype,U7=A7.toString;function b7(e){if(e!=null){try{return U7.call(e)}catch{}try{return e+""}catch{}}return""}var er=b7;var N7=/[\\^$.*+?()[\]{}|]/g,C7=/^\[object .+?Constructor\]$/,I7=Function.prototype,v7=Object.prototype,P7=I7.toString,M7=v7.hasOwnProperty,w7=RegExp("^"+P7.call(M7).replace(N7,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function k7(e){if(!Eo(e)||xy(e))return!1;var t=Es(e)?w7:C7;return t.test(er(e))}var Ry=k7;function _7(e,t){return e?.[t]}var Oy=_7;function B7(e,t){var r=Oy(e,t);return Ry(r)?r:void 0}var lt=B7;var F7=lt(Oe,"Map"),Fr=F7;var D7=lt(Object,"create"),tr=D7;function j7(){this.__data__=tr?tr(null):{},this.size=0}var Ly=j7;function G7(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ay=G7;var H7="__lodash_hash_undefined__",K7=Object.prototype,W7=K7.hasOwnProperty;function V7(e){var t=this.__data__;if(tr){var r=t[e];return r===H7?void 0:r}return W7.call(t,e)?t[e]:void 0}var Uy=V7;var q7=Object.prototype,Y7=q7.hasOwnProperty;function z7(e){var t=this.__data__;return tr?t[e]!==void 0:Y7.call(t,e)}var by=z7;var X7="__lodash_hash_undefined__";function J7(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=tr&&t===void 0?X7:t,this}var Ny=J7;function yo(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}yo.prototype.clear=Ly;yo.prototype.delete=Ay;yo.prototype.get=Uy;yo.prototype.has=by;yo.prototype.set=Ny;var Gf=yo;function Q7(){this.size=0,this.__data__={hash:new Gf,map:new(Fr||Br),string:new Gf}}var Cy=Q7;function Z7(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Iy=Z7;function $7(e,t){var r=e.__data__;return Iy(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Dr=$7;function eM(e){var t=Dr(this,e).delete(e);return this.size-=t?1:0,t}var vy=eM;function tM(e){return Dr(this,e).get(e)}var Py=tM;function rM(e){return Dr(this,e).has(e)}var My=rM;function nM(e,t){var r=Dr(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var wy=nM;function So(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}So.prototype.clear=Cy;So.prototype.delete=vy;So.prototype.get=Py;So.prototype.has=My;So.prototype.set=wy;var En=So;var oM=200;function iM(e,t){var r=this.__data__;if(r instanceof Br){var n=r.__data__;if(!Fr||n.length<oM-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new En(n)}return r.set(e,t),this.size=r.size,this}var ky=iM;function To(e){var t=this.__data__=new Br(e);this.size=t.size}To.prototype.clear=py;To.prototype.delete=dy;To.prototype.get=my;To.prototype.has=hy;To.prototype.set=ky;var xo=To;var aM="__lodash_hash_undefined__";function sM(e){return this.__data__.set(e,aM),this}var _y=sM;function cM(e){return this.__data__.has(e)}var By=cM;function Ss(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new En;++t<r;)this.add(e[t])}Ss.prototype.add=Ss.prototype.push=_y;Ss.prototype.has=By;var Ts=Ss;function fM(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var Fy=fM;function uM(e,t){return e.has(t)}var xs=uM;var lM=1,pM=2;function dM(e,t,r,n,o,i){var a=r&lM,s=e.length,c=t.length;if(s!=c&&!(a&&c>s))return!1;var f=i.get(e),u=i.get(t);if(f&&u)return f==t&&u==e;var l=-1,p=!0,m=r&pM?new Ts:void 0;for(i.set(e,t),i.set(t,e);++l<s;){var E=e[l],y=t[l];if(n)var S=a?n(y,E,l,t,e,i):n(E,y,l,e,t,i);if(S!==void 0){if(S)continue;p=!1;break}if(m){if(!Fy(t,function(d,g){if(!xs(m,g)&&(E===d||o(E,d,r,n,i)))return m.push(g)})){p=!1;break}}else if(!(E===y||o(E,y,r,n,i))){p=!1;break}}return i.delete(e),i.delete(t),p}var Rs=dM;var mM=Oe.Uint8Array,Hf=mM;function hM(e){var t=-1,r=Array(e.size);return e.forEach(function(n,o){r[++t]=[o,n]}),r}var Dy=hM;function gM(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Ro=gM;var EM=1,yM=2,SM="[object Boolean]",TM="[object Date]",xM="[object Error]",RM="[object Map]",OM="[object Number]",LM="[object RegExp]",AM="[object Set]",UM="[object String]",bM="[object Symbol]",NM="[object ArrayBuffer]",CM="[object DataView]",jy=Ke?Ke.prototype:void 0,Kf=jy?jy.valueOf:void 0;function IM(e,t,r,n,o,i,a){switch(r){case CM:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case NM:return!(e.byteLength!=t.byteLength||!i(new Hf(e),new Hf(t)));case SM:case TM:case OM:return hs(+e,+t);case xM:return e.name==t.name&&e.message==t.message;case LM:case UM:return e==t+"";case RM:var s=Dy;case AM:var c=n&EM;if(s||(s=Ro),e.size!=t.size&&!c)return!1;var f=a.get(e);if(f)return f==t;n|=yM,a.set(e,t);var u=Rs(s(e),s(t),n,o,i,a);return a.delete(e),u;case bM:if(Kf)return Kf.call(e)==Kf.call(t)}return!1}var Gy=IM;function vM(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}var Os=vM;var PM=Array.isArray,j=PM;function MM(e,t,r){var n=t(e);return j(e)?n:Os(n,r(e))}var Hy=MM;function wM(e,t){for(var r=-1,n=e==null?0:e.length,o=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[o++]=a)}return i}var Ls=wM;function kM(){return[]}var Ky=kM;var _M=Object.prototype,BM=_M.propertyIsEnumerable,Wy=Object.getOwnPropertySymbols,FM=Wy?function(e){return e==null?[]:(e=Object(e),Ls(Wy(e),function(t){return BM.call(e,t)}))}:Ky,Vy=FM;function DM(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var qy=DM;function jM(e){return e!=null&&typeof e=="object"}var Et=jM;var GM="[object Arguments]";function HM(e){return Et(e)&>(e)==GM}var Wf=HM;var Yy=Object.prototype,KM=Yy.hasOwnProperty,WM=Yy.propertyIsEnumerable,VM=Wf((function(){return arguments})())?Wf:function(e){return Et(e)&&KM.call(e,"callee")&&!WM.call(e,"callee")},jr=VM;function qM(){return!1}var zy=qM;var Qy=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Xy=Qy&&typeof module=="object"&&module&&!module.nodeType&&module,YM=Xy&&Xy.exports===Qy,Jy=YM?Oe.Buffer:void 0,zM=Jy?Jy.isBuffer:void 0,XM=zM||zy,yn=XM;var JM=9007199254740991,QM=/^(?:0|[1-9]\d*)$/;function ZM(e,t){var r=typeof e;return t=t??JM,!!t&&(r=="number"||r!="symbol"&&QM.test(e))&&e>-1&&e%1==0&&e<t}var As=ZM;var $M=9007199254740991;function ew(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=$M}var Oo=ew;var tw="[object Arguments]",rw="[object Array]",nw="[object Boolean]",ow="[object Date]",iw="[object Error]",aw="[object Function]",sw="[object Map]",cw="[object Number]",fw="[object Object]",uw="[object RegExp]",lw="[object Set]",pw="[object String]",dw="[object WeakMap]",mw="[object ArrayBuffer]",hw="[object DataView]",gw="[object Float32Array]",Ew="[object Float64Array]",yw="[object Int8Array]",Sw="[object Int16Array]",Tw="[object Int32Array]",xw="[object Uint8Array]",Rw="[object Uint8ClampedArray]",Ow="[object Uint16Array]",Lw="[object Uint32Array]",Q={};Q[gw]=Q[Ew]=Q[yw]=Q[Sw]=Q[Tw]=Q[xw]=Q[Rw]=Q[Ow]=Q[Lw]=!0;Q[tw]=Q[rw]=Q[mw]=Q[nw]=Q[hw]=Q[ow]=Q[iw]=Q[aw]=Q[sw]=Q[cw]=Q[fw]=Q[uw]=Q[lw]=Q[pw]=Q[dw]=!1;function Aw(e){return Et(e)&&Oo(e.length)&&!!Q[gt(e)]}var Zy=Aw;function Uw(e){return function(t){return e(t)}}var $y=Uw;var e1=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ri=e1&&typeof module=="object"&&module&&!module.nodeType&&module,bw=Ri&&Ri.exports===e1,Vf=bw&&gs.process,Nw=(function(){try{var e=Ri&&Ri.require&&Ri.require("util").types;return e||Vf&&Vf.binding&&Vf.binding("util")}catch{}})(),qf=Nw;var t1=qf&&qf.isTypedArray,Cw=t1?$y(t1):Zy,Lo=Cw;var Iw=Object.prototype,vw=Iw.hasOwnProperty;function Pw(e,t){var r=j(e),n=!r&&jr(e),o=!r&&!n&&yn(e),i=!r&&!n&&!o&&Lo(e),a=r||n||o||i,s=a?qy(e.length,String):[],c=s.length;for(var f in e)(t||vw.call(e,f))&&!(a&&(f=="length"||o&&(f=="offset"||f=="parent")||i&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||As(f,c)))&&s.push(f);return s}var r1=Pw;var Mw=Object.prototype;function ww(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Mw;return e===r}var Us=ww;function kw(e,t){return function(r){return e(t(r))}}var n1=kw;var _w=n1(Object.keys,Object),o1=_w;var Bw=Object.prototype,Fw=Bw.hasOwnProperty;function Dw(e){if(!Us(e))return o1(e);var t=[];for(var r in Object(e))Fw.call(e,r)&&r!="constructor"&&t.push(r);return t}var bs=Dw;function jw(e){return e!=null&&Oo(e.length)&&!Es(e)}var Gr=jw;function Gw(e){return Gr(e)?r1(e):bs(e)}var Ao=Gw;function Hw(e){return Hy(e,Ao,Vy)}var Yf=Hw;var Kw=1,Ww=Object.prototype,Vw=Ww.hasOwnProperty;function qw(e,t,r,n,o,i){var a=r&Kw,s=Yf(e),c=s.length,f=Yf(t),u=f.length;if(c!=u&&!a)return!1;for(var l=c;l--;){var p=s[l];if(!(a?p in t:Vw.call(t,p)))return!1}var m=i.get(e),E=i.get(t);if(m&&E)return m==t&&E==e;var y=!0;i.set(e,t),i.set(t,e);for(var S=a;++l<c;){p=s[l];var d=e[p],g=t[p];if(n)var h=a?n(g,d,p,t,e,i):n(d,g,p,e,t,i);if(!(h===void 0?d===g||o(d,g,r,n,i):h)){y=!1;break}S||(S=p=="constructor")}if(y&&!S){var x=e.constructor,N=t.constructor;x!=N&&"constructor"in e&&"constructor"in t&&!(typeof x=="function"&&x instanceof x&&typeof N=="function"&&N instanceof N)&&(y=!1)}return i.delete(e),i.delete(t),y}var i1=qw;var Yw=lt(Oe,"DataView"),Ns=Yw;var zw=lt(Oe,"Promise"),Cs=zw;var Xw=lt(Oe,"Set"),Hr=Xw;var Jw=lt(Oe,"WeakMap"),Is=Jw;var a1="[object Map]",Qw="[object Object]",s1="[object Promise]",c1="[object Set]",f1="[object WeakMap]",u1="[object DataView]",Zw=er(Ns),$w=er(Fr),e3=er(Cs),t3=er(Hr),r3=er(Is),Sn=gt;(Ns&&Sn(new Ns(new ArrayBuffer(1)))!=u1||Fr&&Sn(new Fr)!=a1||Cs&&Sn(Cs.resolve())!=s1||Hr&&Sn(new Hr)!=c1||Is&&Sn(new Is)!=f1)&&(Sn=function(e){var t=gt(e),r=t==Qw?e.constructor:void 0,n=r?er(r):"";if(n)switch(n){case Zw:return u1;case $w:return a1;case e3:return s1;case t3:return c1;case r3:return f1}return t});var Oi=Sn;var n3=1,l1="[object Arguments]",p1="[object Array]",vs="[object Object]",o3=Object.prototype,d1=o3.hasOwnProperty;function i3(e,t,r,n,o,i){var a=j(e),s=j(t),c=a?p1:Oi(e),f=s?p1:Oi(t);c=c==l1?vs:c,f=f==l1?vs:f;var u=c==vs,l=f==vs,p=c==f;if(p&&yn(e)){if(!yn(t))return!1;a=!0,u=!1}if(p&&!u)return i||(i=new xo),a||Lo(e)?Rs(e,t,r,n,o,i):Gy(e,t,c,r,n,o,i);if(!(r&n3)){var m=u&&d1.call(e,"__wrapped__"),E=l&&d1.call(t,"__wrapped__");if(m||E){var y=m?e.value():e,S=E?t.value():t;return i||(i=new xo),o(y,S,r,n,i)}}return p?(i||(i=new xo),i1(e,t,r,n,o,i)):!1}var m1=i3;function h1(e,t,r,n,o){return e===t?!0:e==null||t==null||!Et(e)&&!Et(t)?e!==e&&t!==t:m1(e,t,r,n,h1,o)}var Ps=h1;var a3=1,s3=2;function c3(e,t,r,n){var o=r.length,i=o,a=!n;if(e==null)return!i;for(e=Object(e);o--;){var s=r[o];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<i;){s=r[o];var c=s[0],f=e[c],u=s[1];if(a&&s[2]){if(f===void 0&&!(c in e))return!1}else{var l=new xo;if(n)var p=n(f,u,c,e,t,l);if(!(p===void 0?Ps(u,f,a3|s3,n,l):p))return!1}}return!0}var g1=c3;function f3(e){return e===e&&!Eo(e)}var Ms=f3;function u3(e){for(var t=Ao(e),r=t.length;r--;){var n=t[r],o=e[n];t[r]=[n,o,Ms(o)]}return t}var E1=u3;function l3(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var ws=l3;function p3(e){var t=E1(e);return t.length==1&&t[0][2]?ws(t[0][0],t[0][1]):function(r){return r===e||g1(r,e,t)}}var y1=p3;var d3="[object Symbol]";function m3(e){return typeof e=="symbol"||Et(e)&>(e)==d3}var Kr=m3;var h3=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,g3=/^\w*$/;function E3(e,t){if(j(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Kr(e)?!0:g3.test(e)||!h3.test(e)||t!=null&&e in Object(t)}var Uo=E3;var y3="Expected a function";function zf(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(y3);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(zf.Cache||En),r}zf.Cache=En;var S1=zf;var S3=500;function T3(e){var t=S1(e,function(n){return r.size===S3&&r.clear(),n}),r=t.cache;return t}var T1=T3;var x3=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,R3=/\\(\\)?/g,O3=T1(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(x3,function(r,n,o,i){t.push(o?i.replace(R3,"$1"):n||r)}),t}),x1=O3;var L3=1/0,R1=Ke?Ke.prototype:void 0,O1=R1?R1.toString:void 0;function L1(e){if(typeof e=="string")return e;if(j(e))return ms(e,L1)+"";if(Kr(e))return O1?O1.call(e):"";var t=e+"";return t=="0"&&1/e==-L3?"-0":t}var A1=L1;function A3(e){return e==null?"":A1(e)}var U1=A3;function U3(e,t){return j(e)?e:Uo(e,t)?[e]:x1(U1(e))}var ks=U3;var b3=1/0;function N3(e){if(typeof e=="string"||Kr(e))return e;var t=e+"";return t=="0"&&1/e==-b3?"-0":t}var Wr=N3;function C3(e,t){t=ks(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[Wr(t[r++])];return r&&r==n?e:void 0}var _s=C3;function I3(e,t,r){var n=e==null?void 0:_s(e,t);return n===void 0?r:n}var b1=I3;function v3(e,t){return e!=null&&t in Object(e)}var N1=v3;function P3(e,t,r){t=ks(t,e);for(var n=-1,o=t.length,i=!1;++n<o;){var a=Wr(t[n]);if(!(i=e!=null&&r(e,a)))break;e=e[a]}return i||++n!=o?i:(o=e==null?0:e.length,!!o&&Oo(o)&&As(a,o)&&(j(e)||jr(e)))}var C1=P3;function M3(e,t){return e!=null&&C1(e,t,N1)}var I1=M3;var w3=1,k3=2;function _3(e,t){return Uo(e)&&Ms(t)?ws(Wr(e),t):function(r){var n=b1(r,e);return n===void 0&&n===t?I1(r,e):Ps(t,n,w3|k3)}}var v1=_3;function B3(e){return e}var bo=B3;function F3(e){return function(t){return t?.[e]}}var P1=F3;function D3(e){return function(t){return _s(t,e)}}var M1=D3;function j3(e){return Uo(e)?P1(Wr(e)):M1(e)}var w1=j3;function G3(e){return typeof e=="function"?e:e==null?bo:typeof e=="object"?j(e)?v1(e[0],e[1]):y1(e):w1(e)}var Vr=G3;function H3(e){return function(t,r,n){for(var o=-1,i=Object(t),a=n(t),s=a.length;s--;){var c=a[e?s:++o];if(r(i[c],c,i)===!1)break}return t}}var k1=H3;var K3=k1(),_1=K3;function W3(e,t){return e&&_1(e,t,Ao)}var B1=W3;function V3(e,t){return function(r,n){if(r==null)return r;if(!Gr(r))return e(r,n);for(var o=r.length,i=t?o:-1,a=Object(r);(t?i--:++i<o)&&n(a[i],i,a)!==!1;);return r}}var F1=V3;var q3=F1(B1),qr=q3;function Y3(e,t){var r=-1,n=Gr(e)?Array(e.length):[];return qr(e,function(o,i,a){n[++r]=t(o,i,a)}),n}var D1=Y3;function z3(e,t){var r=j(e)?ms:D1;return r(e,Vr(t,3))}var rt=z3;function X3(e,t){var r=[];return qr(e,function(n,o,i){t(n,o,i)&&r.push(n)}),r}var j1=X3;function J3(e,t){var r=j(e)?Ls:j1;return r(e,Vr(t,3))}var G1=J3;function Tn(e,t,r){return`${e.name}_${t}_${r}`}var Yr=1,Q3=2,H1=4,K1=5;var Io=7,Z3=8,$3=9,ek=10,tk=11,W1=12,Li=class{constructor(t){this.target=t}isEpsilon(){return!1}},No=class extends Li{constructor(t,r){super(t),this.tokenType=r}},Ai=class extends Li{constructor(t){super(t)}isEpsilon(){return!0}},Co=class extends Li{constructor(t,r,n){super(t),this.rule=r,this.followState=n}isEpsilon(){return!0}};function V1(e){let t={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};rk(t,e);let r=e.length;for(let n=0;n<r;n++){let o=e[n],i=xn(t,o,o);i!==void 0&&dk(t,o,i)}return t}function rk(e,t){let r=t.length;for(let n=0;n<r;n++){let o=t[n],i=Le(e,o,void 0,{type:Q3}),a=Le(e,o,void 0,{type:Io});i.stop=a,e.ruleToStartState.set(o,i),e.ruleToStopState.set(o,a)}}function q1(e,t,r){return r instanceof P?Xf(e,t,r.terminalType,r):r instanceof B?pk(e,t,r):r instanceof K?sk(e,t,r):r instanceof F?ck(e,t,r):r instanceof k?nk(e,t,r):r instanceof H?ok(e,t,r):r instanceof z?ik(e,t,r):r instanceof X?ak(e,t,r):xn(e,t,r)}function nk(e,t,r){let n=Le(e,t,r,{type:K1});zr(e,n);let o=vo(e,t,n,r,xn(e,t,r));return z1(e,t,r,o)}function ok(e,t,r){let n=Le(e,t,r,{type:K1});zr(e,n);let o=vo(e,t,n,r,xn(e,t,r)),i=Xf(e,t,r.separator,r);return z1(e,t,r,o,i)}function ik(e,t,r){let n=Le(e,t,r,{type:H1});zr(e,n);let o=vo(e,t,n,r,xn(e,t,r));return Y1(e,t,r,o)}function ak(e,t,r){let n=Le(e,t,r,{type:H1});zr(e,n);let o=vo(e,t,n,r,xn(e,t,r)),i=Xf(e,t,r.separator,r);return Y1(e,t,r,o,i)}function sk(e,t,r){let n=Le(e,t,r,{type:Yr});zr(e,n);let o=rt(r.definition,a=>q1(e,t,a));return vo(e,t,n,r,...o)}function ck(e,t,r){let n=Le(e,t,r,{type:Yr});zr(e,n);let o=vo(e,t,n,r,xn(e,t,r));return fk(e,t,r,o)}function xn(e,t,r){let n=G1(rt(r.definition,o=>q1(e,t,o)),o=>o!==void 0);return n.length===1?n[0]:n.length===0?void 0:lk(e,n)}function Y1(e,t,r,n,o){let i=n.left,a=n.right,s=Le(e,t,r,{type:tk});zr(e,s);let c=Le(e,t,r,{type:W1});return i.loopback=s,c.loopback=s,e.decisionMap[Tn(t,o?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=s,me(a,s),o===void 0?(me(s,i),me(s,c)):(me(s,c),me(s,o.left),me(o.right,i)),{left:i,right:c}}function z1(e,t,r,n,o){let i=n.left,a=n.right,s=Le(e,t,r,{type:ek});zr(e,s);let c=Le(e,t,r,{type:W1}),f=Le(e,t,r,{type:$3});return s.loopback=f,c.loopback=f,me(s,i),me(s,c),me(a,f),o!==void 0?(me(f,c),me(f,o.left),me(o.right,i)):me(f,s),e.decisionMap[Tn(t,o?"RepetitionWithSeparator":"Repetition",r.idx)]=s,{left:s,right:c}}function fk(e,t,r,n){let o=n.left,i=n.right;return me(o,i),e.decisionMap[Tn(t,"Option",r.idx)]=o,n}function zr(e,t){return e.decisionStates.push(t),t.decision=e.decisionStates.length-1,t.decision}function vo(e,t,r,n,...o){let i=Le(e,t,n,{type:Z3,start:r});r.end=i;for(let s of o)s!==void 0?(me(r,s.left),me(s.right,i)):me(r,i);let a={left:r,right:i};return e.decisionMap[Tn(t,uk(n),n.idx)]=r,a}function uk(e){if(e instanceof K)return"Alternation";if(e instanceof F)return"Option";if(e instanceof k)return"Repetition";if(e instanceof H)return"RepetitionWithSeparator";if(e instanceof z)return"RepetitionMandatory";if(e instanceof X)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function lk(e,t){let r=t.length;for(let i=0;i<r-1;i++){let a=t[i],s;a.left.transitions.length===1&&(s=a.left.transitions[0]);let c=s instanceof Co,f=s,u=t[i+1].left;a.left.type===Yr&&a.right.type===Yr&&s!==void 0&&(c&&f.followState===a.right||s.target===a.right)?(c?f.followState=u:s.target=u,mk(e,a.right)):me(a.right,u)}let n=t[0],o=t[r-1];return{left:n.left,right:o.right}}function Xf(e,t,r,n){let o=Le(e,t,n,{type:Yr}),i=Le(e,t,n,{type:Yr});return Jf(o,new No(i,r)),{left:o,right:i}}function pk(e,t,r){let n=r.referencedRule,o=e.ruleToStartState.get(n),i=Le(e,t,r,{type:Yr}),a=Le(e,t,r,{type:Yr}),s=new Co(o,n,a);return Jf(i,s),{left:i,right:a}}function dk(e,t,r){let n=e.ruleToStartState.get(t);me(n,r.left);let o=e.ruleToStopState.get(t);return me(r.right,o),{left:n,right:o}}function me(e,t){let r=new Ai(t);Jf(e,r)}function Le(e,t,r,n){let o=Object.assign({atn:e,production:r,epsilonOnlyTransitions:!1,rule:t,transitions:[],nextTokenWithinRule:[],stateNumber:e.states.length},n);return e.states.push(o),o}function Jf(e,t){e.transitions.length===0&&(e.epsilonOnlyTransitions=t.isEpsilon()),e.transitions.push(t)}function mk(e,t){e.states.splice(e.states.indexOf(t),1)}var Ui={},Po=class{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(t){let r=Qf(t);r in this.map||(this.map[r]=this.configs.length,this.configs.push(t))}get elements(){return this.configs}get alts(){return rt(this.configs,t=>t.alt)}get key(){let t="";for(let r in this.map)t+=r+":";return t}};function Qf(e,t=!0){return`${t?`a${e.alt}`:""}s${e.state.stateNumber}:${e.stack.map(r=>r.stateNumber.toString()).join("_")}`}function hk(e,t,r){for(var n=-1,o=e.length;++n<o;){var i=e[n],a=t(i);if(a!=null&&(s===void 0?a===a&&!Kr(a):r(a,s)))var s=a,c=i}return c}var X1=hk;function gk(e,t){return e<t}var J1=gk;function Ek(e){return e&&e.length?X1(e,bo,J1):void 0}var Q1=Ek;var Z1=Ke?Ke.isConcatSpreadable:void 0;function yk(e){return j(e)||jr(e)||!!(Z1&&e&&e[Z1])}var $1=yk;function eS(e,t,r,n,o){var i=-1,a=e.length;for(r||(r=$1),o||(o=[]);++i<a;){var s=e[i];t>0&&r(s)?t>1?eS(s,t-1,r,n,o):Os(o,s):n||(o[o.length]=s)}return o}var Bs=eS;function Sk(e,t){return Bs(rt(e,t),1)}var tS=Sk;function Tk(e,t,r,n){for(var o=e.length,i=r+(n?1:-1);n?i--:++i<o;)if(t(e[i],i,e))return i;return-1}var rS=Tk;function xk(e){return e!==e}var nS=xk;function Rk(e,t,r){for(var n=r-1,o=e.length;++n<o;)if(e[n]===t)return n;return-1}var oS=Rk;function Ok(e,t,r){return t===t?oS(e,t,r):rS(e,nS,r)}var iS=Ok;function Lk(e,t){var r=e==null?0:e.length;return!!r&&iS(e,t,0)>-1}var aS=Lk;function Ak(e,t,r){for(var n=-1,o=e==null?0:e.length;++n<o;)if(r(t,e[n]))return!0;return!1}var sS=Ak;function Uk(){}var cS=Uk;var bk=1/0,Nk=Hr&&1/Ro(new Hr([,-0]))[1]==bk?function(e){return new Hr(e)}:cS,fS=Nk;var Ck=200;function Ik(e,t,r){var n=-1,o=aS,i=e.length,a=!0,s=[],c=s;if(r)a=!1,o=sS;else if(i>=Ck){var f=t?null:fS(e);if(f)return Ro(f);a=!1,o=xs,c=new Ts}else c=t?[]:s;e:for(;++n<i;){var u=e[n],l=t?t(u):u;if(u=r||u!==0?u:0,a&&l===l){for(var p=c.length;p--;)if(c[p]===l)continue e;t&&c.push(l),s.push(u)}else o(c,l,r)||(c!==s&&c.push(l),s.push(u))}return s}var uS=Ik;function vk(e,t){return e&&e.length?uS(e,Vr(t,2)):[]}var lS=vk;function Pk(e){var t=e==null?0:e.length;return t?Bs(e,1):[]}var pS=Pk;function Mk(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var dS=Mk;function wk(e){return typeof e=="function"?e:bo}var mS=wk;function kk(e,t){var r=j(e)?dS:qr;return r(e,mS(t))}var Fs=kk;var _k="[object Map]",Bk="[object Set]",Fk=Object.prototype,Dk=Fk.hasOwnProperty;function jk(e){if(e==null)return!0;if(Gr(e)&&(j(e)||typeof e=="string"||typeof e.splice=="function"||yn(e)||Lo(e)||jr(e)))return!e.length;var t=Oi(e);if(t==_k||t==Bk)return!e.size;if(Us(e))return!bs(e).length;for(var r in e)if(Dk.call(e,r))return!1;return!0}var hS=jk;function Gk(e,t,r,n){var o=-1,i=e==null?0:e.length;for(n&&i&&(r=e[++o]);++o<i;)r=t(r,e[o],o,e);return r}var gS=Gk;function Hk(e,t,r,n,o){return o(e,function(i,a,s){r=n?(n=!1,i):t(r,i,a,s)}),r}var ES=Hk;function Kk(e,t,r){var n=j(e)?gS:ES,o=arguments.length<3;return n(e,Vr(t,4),r,o,qr)}var Zf=Kk;function Wk(e,t){let r={};return n=>{let o=n.toString(),i=r[o];return i!==void 0||(i={atnStartState:e,decision:t,states:{}},r[o]=i),i}}var Ds=class{constructor(){this.predicates=[]}is(t){return t>=this.predicates.length||this.predicates[t]}set(t,r){this.predicates[t]=r}toString(){let t="",r=this.predicates.length;for(let n=0;n<r;n++)t+=this.predicates[n]===!0?"1":"0";return t}},yS=new Ds,bi=class extends hn{constructor(t){var r;super(),this.logging=(r=t?.logging)!==null&&r!==void 0?r:(n=>console.log(n))}initialize(t){this.atn=V1(t.rules),this.dfas=Vk(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(t){let{prodOccurrence:r,rule:n,hasPredicates:o,dynamicTokensEnabled:i}=t,a=this.dfas,s=this.logging,c=Tn(n,"Alternation",r),u=this.atn.decisionMap[c].decision,l=rt(qa({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),p=>rt(p,m=>m[0]));if(SS(l,!1)&&!i){let p=Zf(l,(m,E,y)=>(Fs(E,S=>{S&&(m[S.tokenTypeIdx]=y,Fs(S.categoryMatches,d=>{m[d]=y}))}),m),{});return o?function(m){var E;let y=this.LA(1),S=p[y.tokenTypeIdx];if(m!==void 0&&S!==void 0){let d=(E=m[S])===null||E===void 0?void 0:E.GATE;if(d!==void 0&&d.call(this)===!1)return}return S}:function(){let m=this.LA(1);return p[m.tokenTypeIdx]}}else return o?function(p){let m=new Ds,E=p===void 0?0:p.length;for(let S=0;S<E;S++){let d=p?.[S].GATE;m.set(S,d===void 0||d.call(this))}let y=$f.call(this,a,u,m,s);return typeof y=="number"?y:void 0}:function(){let p=$f.call(this,a,u,yS,s);return typeof p=="number"?p:void 0}}buildLookaheadForOptional(t){let{prodOccurrence:r,rule:n,prodType:o,dynamicTokensEnabled:i}=t,a=this.dfas,s=this.logging,c=Tn(n,o,r),u=this.atn.decisionMap[c].decision,l=rt(qa({maxLookahead:1,occurrence:r,prodType:o,rule:n}),p=>rt(p,m=>m[0]));if(SS(l)&&l[0][0]&&!i){let p=l[0],m=pS(p);if(m.length===1&&hS(m[0].categoryMatches)){let y=m[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===y}}else{let E=Zf(m,(y,S)=>(S!==void 0&&(y[S.tokenTypeIdx]=!0,Fs(S.categoryMatches,d=>{y[d]=!0})),y),{});return function(){let y=this.LA(1);return E[y.tokenTypeIdx]===!0}}}return function(){let p=$f.call(this,a,u,yS,s);return typeof p=="object"?!1:p===0}}};function SS(e,t=!0){let r=new Set;for(let n of e){let o=new Set;for(let i of n){if(i===void 0){if(t)break;return!1}let a=[i.tokenTypeIdx].concat(i.categoryMatches);for(let s of a)if(r.has(s)){if(!o.has(s))return!1}else r.add(s),o.add(s)}}return!0}function Vk(e){let t=e.decisionStates.length,r=Array(t);for(let n=0;n<t;n++)r[n]=Wk(e.decisionStates[n],n);return r}function $f(e,t,r,n){let o=e[t](r),i=o.start;if(i===void 0){let s=r6(o.atnStartState);i=RS(o,xS(s)),o.start=i}return qk.apply(this,[o,i,r,n])}function qk(e,t,r,n){let o=t,i=1,a=[],s=this.LA(i++);for(;;){let c=Zk(o,s);if(c===void 0&&(c=Yk.apply(this,[e,o,s,i,r,n])),c===Ui)return Qk(a,o,s);if(c.isAcceptState===!0)return c.prediction;o=c,a.push(s),s=this.LA(i++)}}function Yk(e,t,r,n,o,i){let a=$k(t.configs,r,o);if(a.size===0)return TS(e,t,r,Ui),Ui;let s=xS(a),c=t6(a,o);if(c!==void 0)s.isAcceptState=!0,s.prediction=c,s.configs.uniqueAlt=c;else if(a6(a)){let f=Q1(a.alts);s.isAcceptState=!0,s.prediction=f,s.configs.uniqueAlt=f,zk.apply(this,[e,n,a.alts,i])}return s=TS(e,t,r,s),s}function zk(e,t,r,n){let o=[];for(let f=1;f<=t;f++)o.push(this.LA(f).tokenType);let i=e.atnStartState,a=i.rule,s=i.production,c=Xk({topLevelRule:a,ambiguityIndices:r,production:s,prefixPath:o});n(c)}function Xk(e){let t=rt(e.prefixPath,o=>Qt(o)).join(", "),r=e.production.idx===0?"":e.production.idx,n=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(", ")}> in <${Jk(e.production)}${r}> inside <${e.topLevelRule.name}> Rule,
|
|
148
|
+
<${t}> may appears as a prefix path in all these alternatives.
|
|
149
|
+
`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
150
|
+
For Further details.`,n}function Jk(e){if(e instanceof B)return"SUBRULE";if(e instanceof F)return"OPTION";if(e instanceof K)return"OR";if(e instanceof z)return"AT_LEAST_ONE";if(e instanceof X)return"AT_LEAST_ONE_SEP";if(e instanceof H)return"MANY_SEP";if(e instanceof k)return"MANY";if(e instanceof P)return"CONSUME";throw Error("non exhaustive match")}function Qk(e,t,r){let n=tS(t.configs.elements,i=>i.state.transitions),o=lS(n.filter(i=>i instanceof No).map(i=>i.tokenType),i=>i.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:o,tokenPath:e}}function Zk(e,t){return e.edges[t.tokenTypeIdx]}function $k(e,t,r){let n=new Po,o=[];for(let a of e.elements){if(r.is(a.alt)===!1)continue;if(a.state.type===Io){o.push(a);continue}let s=a.state.transitions.length;for(let c=0;c<s;c++){let f=a.state.transitions[c],u=e6(f,t);u!==void 0&&n.add({state:u,alt:a.alt,stack:a.stack})}}let i;if(o.length===0&&n.size===1&&(i=n),i===void 0){i=new Po;for(let a of n.elements)js(a,i)}if(o.length>0&&!o6(i))for(let a of o)i.add(a);return i}function e6(e,t){if(e instanceof No&&v(t,e.tokenType))return e.target}function t6(e,t){let r;for(let n of e.elements)if(t.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}function xS(e){return{configs:e,edges:{},isAcceptState:!1,prediction:-1}}function TS(e,t,r,n){return n=RS(e,n),t.edges[r.tokenTypeIdx]=n,n}function RS(e,t){if(t===Ui)return t;let r=t.configs.key,n=e.states[r];return n!==void 0?n:(t.configs.finalize(),e.states[r]=t,t)}function r6(e){let t=new Po,r=e.transitions.length;for(let n=0;n<r;n++){let i={state:e.transitions[n].target,alt:n,stack:[]};js(i,t)}return t}function js(e,t){let r=e.state;if(r.type===Io){if(e.stack.length>0){let o=[...e.stack],a={state:o.pop(),alt:e.alt,stack:o};js(a,t)}else t.add(e);return}r.epsilonOnlyTransitions||t.add(e);let n=r.transitions.length;for(let o=0;o<n;o++){let i=r.transitions[o],a=n6(e,i);a!==void 0&&js(a,t)}}function n6(e,t){if(t instanceof Ai)return{state:t.target,alt:e.alt,stack:e.stack};if(t instanceof Co){let r=[...e.stack,t.followState];return{state:t.target,alt:e.alt,stack:r}}}function o6(e){for(let t of e.elements)if(t.state.type===Io)return!0;return!1}function i6(e){for(let t of e.elements)if(t.state.type!==Io)return!1;return!0}function a6(e){if(i6(e))return!0;let t=s6(e.elements);return c6(t)&&!f6(t)}function s6(e){let t=new Map;for(let r of e){let n=Qf(r,!1),o=t.get(n);o===void 0&&(o={},t.set(n,o)),o[r.alt]=!0}return t}function c6(e){for(let t of Array.from(e.values()))if(Object.keys(t).length>1)return!0;return!1}function f6(e){for(let t of Array.from(e.values()))if(Object.keys(t).length===1)return!0;return!1}function OS(e,t){e.RULE("literal",()=>{e.OR([{ALT:()=>e.SUBRULE(e.integerLiteral)},{ALT:()=>e.SUBRULE(e.floatingPointLiteral)},{ALT:()=>e.SUBRULE(e.booleanLiteral)},{ALT:()=>e.CONSUME(t.CharLiteral)},{ALT:()=>e.CONSUME(t.TextBlock)},{ALT:()=>e.CONSUME(t.StringLiteral)},{ALT:()=>e.CONSUME(t.Null)}])}),e.RULE("integerLiteral",()=>{e.OR([{ALT:()=>e.CONSUME(t.DecimalLiteral)},{ALT:()=>e.CONSUME(t.HexLiteral)},{ALT:()=>e.CONSUME(t.OctalLiteral)},{ALT:()=>e.CONSUME(t.BinaryLiteral)}])}),e.RULE("floatingPointLiteral",()=>{e.OR([{ALT:()=>e.CONSUME(t.FloatLiteral)},{ALT:()=>e.CONSUME(t.HexFloatLiteral)}])}),e.RULE("booleanLiteral",()=>{e.OR([{ALT:()=>e.CONSUME(t.True)},{ALT:()=>e.CONSUME(t.False)}])}),e.RULE("shiftOperator",()=>{e.OR([{GATE:()=>e.LA(1).startOffset+1===e.LA(2).startOffset,ALT:()=>{e.CONSUME(t.Less),e.CONSUME2(t.Less)}},{GATE:()=>e.LA(1).startOffset+1===e.LA(2).startOffset,ALT:()=>{e.CONSUME(t.Greater),e.CONSUME2(t.Greater),e.OPTION({GATE:()=>e.LA(0).startOffset+1===e.LA(1).startOffset,DEF:()=>e.CONSUME3(t.Greater)})}}])})}function LS(e,t){e.RULE("primitiveType",()=>{e.MANY(()=>{e.SUBRULE(e.annotation)}),e.OR([{ALT:()=>e.SUBRULE(e.numericType)},{ALT:()=>e.CONSUME(t.Boolean)}])}),e.RULE("numericType",()=>{e.OR([{ALT:()=>e.SUBRULE(e.integralType)},{ALT:()=>e.SUBRULE(e.floatingPointType)}])}),e.RULE("integralType",()=>{e.OR([{ALT:()=>e.CONSUME(t.Byte)},{ALT:()=>e.CONSUME(t.Short)},{ALT:()=>e.CONSUME(t.Int)},{ALT:()=>e.CONSUME(t.Long)},{ALT:()=>e.CONSUME(t.Char)}])}),e.RULE("floatingPointType",()=>{e.OR([{ALT:()=>e.CONSUME(t.Float)},{ALT:()=>e.CONSUME(t.Double)}])}),e.RULE("referenceType",()=>{e.MANY(()=>{e.SUBRULE(e.annotation)}),e.OR({DEF:[{ALT:()=>{e.SUBRULE(e.primitiveType),e.SUBRULE(e.dims)}},{ALT:()=>{e.SUBRULE(e.classOrInterfaceType),e.OPTION(()=>{e.SUBRULE2(e.dims)})}}],IGNORE_AMBIGUITIES:!0})}),e.RULE("classOrInterfaceType",()=>{e.SUBRULE(e.classType)}),e.RULE("classType",()=>{e.MANY(()=>{e.SUBRULE(e.annotation)}),e.CONSUME(t.Identifier),e.OPTION(()=>{e.SUBRULE(e.typeArguments)}),e.MANY2(()=>{e.CONSUME(t.Dot),e.MANY3(()=>{e.SUBRULE2(e.annotation)}),e.CONSUME2(t.Identifier),e.OPTION2(()=>e.SUBRULE2(e.typeArguments))})}),e.RULE("interfaceType",()=>{e.SUBRULE(e.classType)}),e.RULE("typeVariable",()=>{e.MANY(()=>{e.SUBRULE(e.annotation)}),e.CONSUME(t.Identifier)}),e.RULE("dims",()=>{e.MANY(()=>{e.SUBRULE(e.annotation)}),e.CONSUME(t.LSquare),e.CONSUME(t.RSquare),e.MANY2({GATE:()=>e.BACKTRACK_LOOKAHEAD(e.isDims),DEF:()=>{e.MANY3(()=>{e.SUBRULE2(e.annotation)}),e.CONSUME2(t.LSquare),e.CONSUME2(t.RSquare)}})}),e.RULE("typeParameter",()=>{e.MANY(()=>{e.SUBRULE(e.typeParameterModifier)}),e.SUBRULE(e.typeIdentifier),e.OPTION(()=>{e.SUBRULE(e.typeBound)})}),e.RULE("typeParameterModifier",()=>{e.SUBRULE(e.annotation)}),e.RULE("typeBound",()=>{e.CONSUME(t.Extends),e.SUBRULE(e.classOrInterfaceType),e.MANY(()=>{e.SUBRULE(e.additionalBound)})}),e.RULE("additionalBound",()=>{e.CONSUME(t.And),e.SUBRULE(e.interfaceType)}),e.RULE("typeArguments",()=>{e.CONSUME(t.Less),e.SUBRULE(e.typeArgumentList),e.CONSUME(t.Greater)}),e.RULE("typeArgumentList",()=>{e.SUBRULE(e.typeArgument),e.MANY(()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.typeArgument)})}),e.RULE("typeArgument",()=>{e.OR([{ALT:()=>e.SUBRULE(e.referenceType)},{ALT:()=>e.SUBRULE(e.wildcard)}])}),e.RULE("wildcard",()=>{e.MANY(()=>{e.SUBRULE(e.annotation)}),e.CONSUME(t.QuestionMark),e.OPTION(()=>{e.SUBRULE(e.wildcardBounds)})}),e.RULE("wildcardBounds",()=>{e.OR([{ALT:()=>e.CONSUME(t.Extends)},{ALT:()=>e.CONSUME(t.Super)}]),e.SUBRULE(e.referenceType)})}function AS(e,t){e.RULE("moduleName",()=>{e.CONSUME(t.Identifier),e.MANY(()=>{e.CONSUME(t.Dot),e.CONSUME2(t.Identifier)})}),e.RULE("packageName",()=>{e.CONSUME(t.Identifier),e.MANY(()=>{e.CONSUME(t.Dot),e.CONSUME2(t.Identifier)})}),e.RULE("typeName",()=>{e.CONSUME(t.Identifier),e.MANY(()=>{e.CONSUME(t.Dot),e.CONSUME2(t.Identifier)})}),e.RULE("expressionName",()=>{e.CONSUME(t.Identifier),e.MANY({GATE:()=>v(this.LA(2).tokenType,t.Identifier),DEF:()=>{e.CONSUME(t.Dot),e.CONSUME2(t.Identifier)}})}),e.RULE("methodName",()=>{e.CONSUME(t.Identifier)}),e.RULE("packageOrTypeName",()=>{e.CONSUME(t.Identifier),e.MANY({GATE:()=>v(this.LA(2).tokenType,t.Star)===!1,DEF:()=>{e.CONSUME(t.Dot),e.CONSUME2(t.Identifier)}})}),e.RULE("ambiguousName",()=>{e.CONSUME(t.Identifier),e.MANY(()=>{e.CONSUME(t.Dot),e.CONSUME2(t.Identifier)})})}function US(e,t){e.RULE("compilationUnit",()=>{e.OR([{ALT:()=>e.SUBRULE(e.ordinaryCompilationUnit)},{ALT:()=>e.SUBRULE(e.modularCompilationUnit)},{ALT:()=>e.CONSUME($e)}])}),e.RULE("ordinaryCompilationUnit",()=>{e.OPTION(()=>e.SUBRULE(e.packageDeclaration)),e.MANY(()=>{e.SUBRULE3(e.importDeclaration)}),e.MANY2(()=>{e.SUBRULE(e.typeDeclaration)})}),e.RULE("modularCompilationUnit",()=>{e.MANY(()=>{e.SUBRULE(e.importDeclaration)}),e.SUBRULE(e.moduleDeclaration)}),e.RULE("packageDeclaration",()=>{e.MANY(()=>{e.SUBRULE(e.packageModifier)}),e.CONSUME(t.Package),e.CONSUME(t.Identifier),e.MANY2(()=>{e.CONSUME(t.Dot),e.CONSUME2(t.Identifier)}),e.CONSUME2(t.Semicolon)}),e.RULE("packageModifier",()=>{e.SUBRULE(e.annotation)}),e.RULE("importDeclaration",()=>{e.OR([{ALT:()=>{e.CONSUME(t.Import),e.OPTION(()=>{e.CONSUME(t.Static)}),e.SUBRULE(e.packageOrTypeName),e.OPTION2(()=>{e.CONSUME(t.Dot),e.CONSUME(t.Star)}),e.CONSUME(t.Semicolon)}},{ALT:()=>e.SUBRULE(e.emptyStatement)}])}),e.RULE("typeDeclaration",()=>{e.OR([{ALT:()=>e.CONSUME(t.Semicolon)},{ALT:()=>e.SUBRULE(e.classDeclaration)},{ALT:()=>e.SUBRULE(e.interfaceDeclaration)},{ALT:()=>e.SUBRULE(e.fieldDeclaration)},{ALT:()=>e.SUBRULE(e.methodDeclaration)}])}),e.RULE("moduleDeclaration",()=>{e.MANY(()=>{e.SUBRULE(e.annotation)}),e.OPTION(()=>{e.CONSUME(t.Open)}),e.CONSUME(t.Module),e.CONSUME(t.Identifier),e.MANY2(()=>{e.CONSUME(t.Dot),e.CONSUME2(t.Identifier)}),e.CONSUME(t.LCurly),e.MANY3(()=>{e.SUBRULE(e.moduleDirective)}),e.CONSUME(t.RCurly)}),e.RULE("moduleDirective",()=>{e.OR([{ALT:()=>e.SUBRULE(e.requiresModuleDirective)},{ALT:()=>e.SUBRULE(e.exportsModuleDirective)},{ALT:()=>e.SUBRULE(e.opensModuleDirective)},{ALT:()=>e.SUBRULE(e.usesModuleDirective)},{ALT:()=>e.SUBRULE(e.providesModuleDirective)}])}),e.RULE("requiresModuleDirective",()=>{e.CONSUME(t.Requires),e.MANY({GATE:()=>(v(e.LA(1).tokenType,t.Transitive)&&v(e.LA(2).tokenType,t.Separators))===!1,DEF:()=>{e.SUBRULE(e.requiresModifier)}}),e.SUBRULE(e.moduleName),e.CONSUME(t.Semicolon)}),e.RULE("exportsModuleDirective",()=>{e.CONSUME(t.Exports),e.SUBRULE(e.packageName),e.OPTION(()=>{e.CONSUME(t.To),e.SUBRULE(e.moduleName),e.MANY(()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.moduleName)})}),e.CONSUME(t.Semicolon)}),e.RULE("opensModuleDirective",()=>{e.CONSUME(t.Opens),e.SUBRULE(e.packageName),e.OPTION(()=>{e.CONSUME(t.To),e.SUBRULE(e.moduleName),e.MANY(()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.moduleName)})}),e.CONSUME(t.Semicolon)}),e.RULE("usesModuleDirective",()=>{e.CONSUME(t.Uses),e.SUBRULE(e.typeName),e.CONSUME(t.Semicolon)}),e.RULE("providesModuleDirective",()=>{e.CONSUME(t.Provides),e.SUBRULE(e.typeName),e.CONSUME(t.With),e.SUBRULE2(e.typeName),e.MANY(()=>{e.CONSUME(t.Comma),e.SUBRULE3(e.typeName)}),e.CONSUME(t.Semicolon)}),e.RULE("requiresModifier",()=>{e.OR([{ALT:()=>e.CONSUME(t.Transitive)},{ALT:()=>e.CONSUME(t.Static)}])})}function bS(e,t){e.RULE("classDeclaration",()=>{e.MANY(()=>{e.SUBRULE(e.classModifier)}),e.OR([{ALT:()=>e.SUBRULE(e.normalClassDeclaration)},{ALT:()=>e.SUBRULE(e.enumDeclaration)},{ALT:()=>e.SUBRULE(e.recordDeclaration)}])}),e.RULE("normalClassDeclaration",()=>{e.CONSUME(t.Class),e.SUBRULE(e.typeIdentifier),e.OPTION(()=>{e.SUBRULE(e.typeParameters)}),e.OPTION2(()=>{e.SUBRULE(e.classExtends)}),e.OPTION3(()=>{e.SUBRULE(e.classImplements)}),e.OPTION4(()=>{e.SUBRULE(e.classPermits)}),e.SUBRULE(e.classBody)}),e.RULE("classModifier",()=>{e.OR([{ALT:()=>e.SUBRULE(e.annotation)},{ALT:()=>e.CONSUME(t.Public)},{ALT:()=>e.CONSUME(t.Protected)},{ALT:()=>e.CONSUME(t.Private)},{ALT:()=>e.CONSUME(t.Abstract)},{ALT:()=>e.CONSUME(t.Static)},{ALT:()=>e.CONSUME(t.Final)},{ALT:()=>e.CONSUME(t.Sealed)},{ALT:()=>e.CONSUME(t.NonSealed)},{ALT:()=>e.CONSUME(t.Strictfp)}])}),e.RULE("typeParameters",()=>{e.CONSUME(t.Less),e.SUBRULE(e.typeParameterList),e.CONSUME(t.Greater)}),e.RULE("typeParameterList",()=>{e.SUBRULE(e.typeParameter),e.MANY(()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.typeParameter)})}),e.RULE("classExtends",()=>{e.CONSUME(t.Extends),e.SUBRULE(e.classType)}),e.RULE("classImplements",()=>{e.CONSUME(t.Implements),e.SUBRULE(e.interfaceTypeList)}),e.RULE("interfaceTypeList",()=>{e.SUBRULE(e.interfaceType),e.MANY(()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.interfaceType)})}),e.RULE("classPermits",()=>{e.CONSUME(t.Permits),e.SUBRULE(e.typeName),e.MANY(()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.typeName)})}),e.RULE("classBody",()=>{e.CONSUME(t.LCurly),e.MANY(()=>{e.SUBRULE(e.classBodyDeclaration)}),e.CONSUME(t.RCurly)}),e.RULE("classBodyDeclaration",()=>{e.OR([{ALT:()=>e.SUBRULE(e.classMemberDeclaration)},{ALT:()=>e.SUBRULE(e.instanceInitializer)},{ALT:()=>e.SUBRULE(e.staticInitializer)},{ALT:()=>e.SUBRULE(e.constructorDeclaration)}])}),e.RULE("classMemberDeclaration",()=>{e.OR([{ALT:()=>e.SUBRULE(e.fieldDeclaration)},{ALT:()=>e.SUBRULE(e.methodDeclaration)},{ALT:()=>e.SUBRULE(e.classDeclaration)},{ALT:()=>e.SUBRULE(e.interfaceDeclaration)},{ALT:()=>e.CONSUME(t.Semicolon)}])}),e.RULE("fieldDeclaration",()=>{e.MANY(()=>{e.SUBRULE(e.fieldModifier)}),e.SUBRULE(e.unannType),e.SUBRULE(e.variableDeclaratorList),e.CONSUME(t.Semicolon)}),e.RULE("fieldModifier",()=>{e.OR([{ALT:()=>e.SUBRULE(e.annotation)},{ALT:()=>e.CONSUME(t.Public)},{ALT:()=>e.CONSUME(t.Protected)},{ALT:()=>e.CONSUME(t.Private)},{ALT:()=>e.CONSUME(t.Static)},{ALT:()=>e.CONSUME(t.Final)},{ALT:()=>e.CONSUME(t.Transient)},{ALT:()=>e.CONSUME(t.Volatile)}])}),e.RULE("variableDeclaratorList",r=>{e.SUBRULE(e.variableDeclarator),e.MANY({GATE:()=>!r,DEF:()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.variableDeclarator)}})}),e.RULE("variableDeclarator",()=>{e.SUBRULE(e.variableDeclaratorId),e.OPTION(()=>{e.CONSUME(t.Equals),e.SUBRULE(e.variableInitializer)})}),e.RULE("variableDeclaratorId",()=>{e.OR([{ALT:()=>{e.CONSUME(t.Identifier),e.OPTION(()=>{e.SUBRULE(e.dims)})}},{ALT:()=>e.CONSUME(t.Underscore)}])}),e.RULE("variableInitializer",()=>{e.OR([{ALT:()=>e.SUBRULE(e.expression)},{ALT:()=>e.SUBRULE(e.arrayInitializer)}])}),e.RULE("unannType",()=>{e.OR([{ALT:()=>e.SUBRULE(e.unannPrimitiveTypeWithOptionalDimsSuffix)},{ALT:()=>e.SUBRULE(e.unannReferenceType)}])}),e.RULE("unannPrimitiveTypeWithOptionalDimsSuffix",()=>{e.SUBRULE(e.unannPrimitiveType),e.OPTION({GATE:()=>this.BACKTRACK_LOOKAHEAD(e.isDims),DEF:()=>e.SUBRULE2(e.dims)})}),e.RULE("unannPrimitiveType",()=>{e.OR([{ALT:()=>e.SUBRULE(e.numericType)},{ALT:()=>e.CONSUME(t.Boolean)}])}),e.RULE("unannReferenceType",()=>{e.SUBRULE(e.unannClassOrInterfaceType),e.OPTION({GATE:()=>this.BACKTRACK_LOOKAHEAD(e.isDims),DEF:()=>e.SUBRULE2(e.dims)})}),e.RULE("unannClassOrInterfaceType",()=>{e.SUBRULE(e.unannClassType)}),e.RULE("unannClassType",()=>{e.CONSUME(t.Identifier),e.OPTION(()=>{e.SUBRULE(e.typeArguments)}),e.MANY2(()=>{e.CONSUME(t.Dot),e.MANY3(()=>{e.SUBRULE2(e.annotation)}),e.CONSUME2(t.Identifier),e.OPTION2(()=>{e.SUBRULE2(e.typeArguments)})})}),e.RULE("unannInterfaceType",()=>{e.SUBRULE(e.unannClassType)}),e.RULE("unannTypeVariable",()=>{e.CONSUME(t.Identifier)}),e.RULE("methodDeclaration",()=>{e.MANY(()=>{e.SUBRULE(e.methodModifier)}),e.SUBRULE(e.methodHeader),e.SUBRULE(e.methodBody)}),e.RULE("methodModifier",()=>{e.OR([{ALT:()=>e.SUBRULE(e.annotation)},{ALT:()=>e.CONSUME(t.Public)},{ALT:()=>e.CONSUME(t.Protected)},{ALT:()=>e.CONSUME(t.Private)},{ALT:()=>e.CONSUME(t.Abstract)},{ALT:()=>e.CONSUME(t.Static)},{ALT:()=>e.CONSUME(t.Final)},{ALT:()=>e.CONSUME(t.Synchronized)},{ALT:()=>e.CONSUME(t.Native)},{ALT:()=>e.CONSUME(t.Strictfp)}])}),e.RULE("methodHeader",()=>{e.OPTION(()=>{e.SUBRULE(e.typeParameters),e.MANY(()=>{e.SUBRULE(e.annotation)})}),e.SUBRULE(e.result),e.SUBRULE(e.methodDeclarator),e.OPTION2(()=>{e.SUBRULE(e.throws)})}),e.RULE("result",()=>{e.OR([{ALT:()=>e.SUBRULE(e.unannType)},{ALT:()=>e.CONSUME(t.Void)}])}),e.RULE("methodDeclarator",()=>{e.CONSUME(t.Identifier),e.CONSUME(t.LBrace),e.OR([{ALT:()=>{e.SUBRULE(e.receiverParameter),e.OPTION(()=>{e.CONSUME(t.Comma),e.SUBRULE(e.formalParameterList)})}},{ALT:()=>e.OPTION1(()=>e.SUBRULE1(e.formalParameterList))}]),e.CONSUME(t.RBrace),e.OPTION2(()=>{e.SUBRULE(e.dims)})}),e.RULE("receiverParameter",()=>{e.MANY(()=>{e.SUBRULE(e.annotation)}),e.SUBRULE(e.unannType),e.OPTION(()=>{e.CONSUME(t.Identifier),e.CONSUME(t.Dot)}),e.CONSUME(t.This)}),e.RULE("formalParameterList",()=>{e.SUBRULE(e.formalParameter),e.MANY(()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.formalParameter)})}),e.RULE("formalParameter",()=>{e.OR([{ALT:()=>e.SUBRULE(e.variableParaRegularParameter)},{ALT:()=>e.SUBRULE(e.variableArityParameter)}])}),e.RULE("variableParaRegularParameter",()=>{e.MANY(()=>{e.SUBRULE(e.variableModifier)}),e.SUBRULE(e.unannType),e.SUBRULE(e.variableDeclaratorId)}),e.RULE("variableArityParameter",()=>{e.MANY(()=>{e.SUBRULE(e.variableModifier)}),e.SUBRULE(e.unannType),e.MANY2(()=>{e.SUBRULE(e.annotation)}),e.CONSUME(t.DotDotDot),e.CONSUME(t.Identifier)}),e.RULE("variableModifier",()=>{e.OR([{ALT:()=>e.SUBRULE(e.annotation)},{ALT:()=>e.CONSUME(t.Final)}])}),e.RULE("throws",()=>{e.CONSUME(t.Throws),e.SUBRULE(e.exceptionTypeList)}),e.RULE("exceptionTypeList",()=>{e.SUBRULE(e.exceptionType),e.MANY(()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.exceptionType)})}),e.RULE("exceptionType",()=>{e.SUBRULE(e.classType)}),e.RULE("methodBody",()=>{e.OR([{ALT:()=>e.SUBRULE(e.block)},{ALT:()=>e.CONSUME(t.Semicolon)}])}),e.RULE("instanceInitializer",()=>{e.SUBRULE(e.block)}),e.RULE("staticInitializer",()=>{e.CONSUME(t.Static),e.SUBRULE(e.block)}),e.RULE("constructorDeclaration",()=>{e.MANY(()=>{e.SUBRULE(e.constructorModifier)}),e.SUBRULE(e.constructorDeclarator),e.OPTION(()=>{e.SUBRULE(e.throws)}),e.SUBRULE(e.constructorBody)}),e.RULE("constructorModifier",()=>{e.OR([{ALT:()=>e.SUBRULE(e.annotation)},{ALT:()=>e.CONSUME(t.Public)},{ALT:()=>e.CONSUME(t.Protected)},{ALT:()=>e.CONSUME(t.Private)}])}),e.RULE("constructorDeclarator",()=>{e.OPTION(()=>{e.SUBRULE(e.typeParameters)}),e.SUBRULE(e.simpleTypeName),e.CONSUME(t.LBrace),e.OR([{ALT:()=>{e.SUBRULE(e.receiverParameter),e.OPTION1(()=>{e.CONSUME(t.Comma),e.SUBRULE(e.formalParameterList)})}},{ALT:()=>e.OPTION2(()=>e.SUBRULE1(e.formalParameterList))}]),e.CONSUME(t.RBrace)}),e.RULE("simpleTypeName",()=>{e.SUBRULE(e.typeIdentifier)}),e.RULE("constructorBody",()=>{e.CONSUME(t.LCurly),e.OPTION(()=>{e.SUBRULE(e.explicitConstructorInvocation)}),e.OPTION2(()=>{e.SUBRULE(e.blockStatements)}),e.CONSUME(t.RCurly)}),e.RULE("explicitConstructorInvocation",()=>{e.OR([{ALT:()=>e.SUBRULE(e.unqualifiedExplicitConstructorInvocation)},{ALT:()=>e.SUBRULE(e.qualifiedExplicitConstructorInvocation)}])}),e.RULE("unqualifiedExplicitConstructorInvocation",()=>{e.OPTION(()=>{e.SUBRULE(e.typeArguments)}),e.OR([{ALT:()=>e.CONSUME(t.This)},{ALT:()=>e.CONSUME(t.Super)}]),e.CONSUME(t.LBrace),e.OPTION2(()=>{e.SUBRULE(e.argumentList)}),e.CONSUME(t.RBrace),e.CONSUME(t.Semicolon)}),e.RULE("qualifiedExplicitConstructorInvocation",()=>{e.SUBRULE(e.expressionName),e.CONSUME(t.Dot),e.OPTION(()=>{e.SUBRULE(e.typeArguments)}),e.CONSUME(t.Super),e.CONSUME(t.LBrace),e.OPTION2(()=>{e.SUBRULE(e.argumentList)}),e.CONSUME(t.RBrace),e.CONSUME(t.Semicolon)}),e.RULE("enumDeclaration",()=>{e.MANY(()=>{e.SUBRULE(e.classModifier)}),e.CONSUME(t.Enum),e.SUBRULE(e.typeIdentifier),e.OPTION(()=>{e.SUBRULE(e.classImplements)}),e.SUBRULE(e.enumBody)}),e.RULE("enumBody",()=>{e.CONSUME(t.LCurly),e.OPTION(()=>{e.SUBRULE(e.enumConstantList)}),e.OPTION2(()=>{e.CONSUME(t.Comma)}),e.OPTION3(()=>{e.SUBRULE(e.enumBodyDeclarations)}),e.CONSUME(t.RCurly)}),e.RULE("enumConstantList",()=>{e.SUBRULE(e.enumConstant),e.MANY({GATE:()=>{let r=e.LA(2);return v(r,t.Identifier)||v(r,t.At)},DEF:()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.enumConstant)}})}),e.RULE("enumConstant",()=>{e.MANY(()=>{e.SUBRULE(e.enumConstantModifier)}),e.CONSUME(t.Identifier),e.OPTION(()=>{e.CONSUME(t.LBrace),e.OPTION2(()=>{e.SUBRULE(e.argumentList)}),e.CONSUME(t.RBrace)}),e.OPTION3(()=>{e.SUBRULE(e.classBody)})}),e.RULE("enumConstantModifier",()=>{e.SUBRULE(e.annotation)}),e.RULE("enumBodyDeclarations",()=>{e.CONSUME(t.Semicolon),e.MANY(()=>{e.SUBRULE(e.classBodyDeclaration)})}),e.RULE("recordDeclaration",()=>{e.CONSUME(t.Record),e.SUBRULE(e.typeIdentifier),e.OPTION(()=>{e.SUBRULE(e.typeParameters)}),e.SUBRULE(e.recordHeader),e.OPTION2(()=>{e.SUBRULE(e.classImplements)}),e.SUBRULE(e.recordBody)}),e.RULE("recordHeader",()=>{e.CONSUME(t.LBrace),e.OPTION(()=>{e.SUBRULE(e.recordComponentList)}),e.CONSUME(t.RBrace)}),e.RULE("recordComponentList",()=>{e.SUBRULE(e.recordComponent),e.MANY(()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.recordComponent)})}),e.RULE("recordComponent",()=>{e.MANY(()=>{e.SUBRULE(e.recordComponentModifier)}),e.SUBRULE(e.unannType),e.OR([{ALT:()=>e.CONSUME(t.Identifier)},{ALT:()=>e.SUBRULE(e.variableArityRecordComponent)}])}),e.RULE("variableArityRecordComponent",()=>{e.MANY(()=>{e.SUBRULE(e.annotation)}),e.CONSUME(t.DotDotDot),e.CONSUME(t.Identifier)}),e.RULE("recordComponentModifier",()=>{e.SUBRULE(e.annotation)}),e.RULE("recordBody",()=>{e.CONSUME(t.LCurly),e.MANY(()=>{e.SUBRULE(e.recordBodyDeclaration)}),e.CONSUME(t.RCurly)}),e.RULE("recordBodyDeclaration",()=>{e.OR([{ALT:()=>e.SUBRULE(e.compactConstructorDeclaration)},{ALT:()=>e.SUBRULE(e.classBodyDeclaration)}])}),e.RULE("compactConstructorDeclaration",()=>{e.MANY(()=>{e.SUBRULE(e.constructorModifier)}),e.SUBRULE(e.simpleTypeName),e.SUBRULE(e.constructorBody)}),e.RULE("isDims",()=>(e.MANY(e.annotation),v(this.LA(1),t.LSquare)&&v(this.LA(2),t.RSquare)))}function NS(e,t){e.RULE("interfaceDeclaration",()=>{e.MANY(()=>{e.SUBRULE(e.interfaceModifier)}),e.OR([{ALT:()=>e.SUBRULE(e.normalInterfaceDeclaration)},{ALT:()=>e.SUBRULE(e.annotationInterfaceDeclaration)}])}),e.RULE("normalInterfaceDeclaration",()=>{e.CONSUME(t.Interface),e.SUBRULE(e.typeIdentifier),e.OPTION(()=>{e.SUBRULE(e.typeParameters)}),e.OPTION2(()=>{e.SUBRULE(e.interfaceExtends)}),e.OPTION3(()=>{e.SUBRULE(e.interfacePermits)}),e.SUBRULE(e.interfaceBody)}),e.RULE("interfaceModifier",()=>{e.OR([{ALT:()=>e.SUBRULE(e.annotation)},{ALT:()=>e.CONSUME(t.Public)},{ALT:()=>e.CONSUME(t.Protected)},{ALT:()=>e.CONSUME(t.Private)},{ALT:()=>e.CONSUME(t.Abstract)},{ALT:()=>e.CONSUME(t.Static)},{ALT:()=>e.CONSUME(t.Sealed)},{ALT:()=>e.CONSUME(t.NonSealed)},{ALT:()=>e.CONSUME(t.Strictfp)}])}),e.RULE("interfaceExtends",()=>{e.CONSUME(t.Extends),e.SUBRULE(e.interfaceTypeList)}),e.RULE("interfacePermits",()=>{e.CONSUME(t.Permits),e.SUBRULE(e.typeName),e.MANY(()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.typeName)})}),e.RULE("interfaceBody",()=>{e.CONSUME(t.LCurly),e.MANY(()=>{e.SUBRULE(e.interfaceMemberDeclaration)}),e.CONSUME(t.RCurly)}),e.RULE("interfaceMemberDeclaration",()=>{e.OR([{ALT:()=>e.SUBRULE(e.constantDeclaration)},{ALT:()=>e.SUBRULE(e.interfaceMethodDeclaration)},{ALT:()=>e.SUBRULE(e.classDeclaration)},{ALT:()=>e.SUBRULE(e.interfaceDeclaration)},{ALT:()=>e.CONSUME(t.Semicolon)}])}),e.RULE("constantDeclaration",()=>{e.MANY(()=>{e.SUBRULE(e.constantModifier)}),e.SUBRULE(e.unannType),e.SUBRULE(e.variableDeclaratorList),e.CONSUME(t.Semicolon)}),e.RULE("constantModifier",()=>{e.OR([{ALT:()=>e.SUBRULE(e.annotation)},{ALT:()=>e.CONSUME(t.Public)},{ALT:()=>e.CONSUME(t.Static)},{ALT:()=>e.CONSUME(t.Final)}])}),e.RULE("interfaceMethodDeclaration",()=>{e.MANY(()=>{e.SUBRULE(e.interfaceMethodModifier)}),e.SUBRULE(e.methodHeader),e.SUBRULE(e.methodBody)}),e.RULE("interfaceMethodModifier",()=>{e.OR([{ALT:()=>e.SUBRULE(e.annotation)},{ALT:()=>e.CONSUME(t.Public)},{ALT:()=>e.CONSUME(t.Private)},{ALT:()=>e.CONSUME(t.Abstract)},{ALT:()=>e.CONSUME(t.Default)},{ALT:()=>e.CONSUME(t.Static)},{ALT:()=>e.CONSUME(t.Strictfp)}])}),e.RULE("annotationInterfaceDeclaration",()=>{e.CONSUME(t.At),e.CONSUME(t.Interface),e.SUBRULE(e.typeIdentifier),e.SUBRULE(e.annotationInterfaceBody)}),e.RULE("annotationInterfaceBody",()=>{e.CONSUME(t.LCurly),e.MANY(()=>{e.SUBRULE(e.annotationInterfaceMemberDeclaration)}),e.CONSUME(t.RCurly)}),e.RULE("annotationInterfaceMemberDeclaration",()=>{e.OR([{ALT:()=>e.SUBRULE(e.annotationInterfaceElementDeclaration)},{ALT:()=>e.SUBRULE(e.constantDeclaration)},{ALT:()=>e.SUBRULE(e.classDeclaration)},{ALT:()=>e.SUBRULE(e.interfaceDeclaration)},{ALT:()=>e.CONSUME(t.Semicolon)}])}),e.RULE("annotationInterfaceElementDeclaration",()=>{e.MANY(()=>{e.SUBRULE(e.annotationInterfaceElementModifier)}),e.SUBRULE(e.unannType),e.CONSUME(t.Identifier),e.CONSUME(t.LBrace),e.CONSUME(t.RBrace),e.OPTION(()=>{e.SUBRULE(e.dims)}),e.OPTION2(()=>{e.SUBRULE(e.defaultValue)}),e.CONSUME(t.Semicolon)}),e.RULE("annotationInterfaceElementModifier",()=>{e.OR([{ALT:()=>e.SUBRULE(e.annotation)},{ALT:()=>e.CONSUME(t.Public)},{ALT:()=>e.CONSUME(t.Abstract)}])}),e.RULE("defaultValue",()=>{e.CONSUME(t.Default),e.SUBRULE(e.elementValue)}),e.RULE("annotation",()=>{e.CONSUME(t.At),e.SUBRULE(e.typeName),e.OPTION(()=>{e.CONSUME(t.LBrace),e.OR({DEF:[{ALT:()=>e.SUBRULE(e.elementValuePairList)},{ALT:()=>e.SUBRULE(e.elementValue)},{ALT:()=>{}}],IGNORE_AMBIGUITIES:!0}),e.CONSUME(t.RBrace)})}),e.RULE("elementValuePairList",()=>{e.SUBRULE(e.elementValuePair),e.MANY(()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.elementValuePair)})}),e.RULE("elementValuePair",()=>{e.CONSUME(t.Identifier),e.CONSUME(t.Equals),e.SUBRULE(e.elementValue)}),e.RULE("elementValue",()=>{e.OR([{ALT:()=>e.SUBRULE(e.conditionalExpression)},{ALT:()=>e.SUBRULE(e.elementValueArrayInitializer)},{ALT:()=>e.SUBRULE(e.annotation)}])}),e.RULE("elementValueArrayInitializer",()=>{e.CONSUME(t.LCurly),e.OPTION(()=>{e.SUBRULE(e.elementValueList)}),e.OPTION2(()=>{e.CONSUME(t.Comma)}),e.CONSUME(t.RCurly)}),e.RULE("elementValueList",()=>{e.SUBRULE(e.elementValue),e.MANY({GATE:()=>v(e.LA(2).tokenType,t.RCurly)===!1,DEF:()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.elementValue)}})})}function CS(e,t){e.RULE("arrayInitializer",()=>{e.CONSUME(t.LCurly),e.OPTION(()=>{e.SUBRULE(e.variableInitializerList)}),e.OPTION2(()=>{e.CONSUME(t.Comma)}),e.CONSUME(t.RCurly)}),e.RULE("variableInitializerList",()=>{e.SUBRULE(e.variableInitializer),e.MANY({GATE:()=>v(this.LA(2).tokenType,t.RCurly)===!1,DEF:()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.variableInitializer)}})})}function IS(e,t){e.RULE("block",()=>{e.CONSUME(t.LCurly),e.OPTION(()=>{e.SUBRULE(e.blockStatements)}),e.CONSUME(t.RCurly)}),e.RULE("blockStatements",()=>{e.SUBRULE(e.blockStatement),e.MANY(()=>{e.SUBRULE2(e.blockStatement)})}),e.RULE("blockStatement",()=>{e.OR({DEF:[{ALT:()=>e.SUBRULE(e.localVariableDeclarationStatement)},{ALT:()=>e.SUBRULE(e.classDeclaration)},{ALT:()=>e.SUBRULE(e.interfaceDeclaration)},{ALT:()=>e.SUBRULE(e.statement)}],IGNORE_AMBIGUITIES:!0})}),e.RULE("localVariableDeclarationStatement",()=>{e.SUBRULE(e.localVariableDeclaration),e.CONSUME(t.Semicolon)}),e.RULE("localVariableDeclaration",r=>{e.MANY(()=>{e.SUBRULE(e.variableModifier)}),e.SUBRULE(e.localVariableType),e.SUBRULE(e.variableDeclaratorList,{ARGS:[r]})}),e.RULE("localVariableType",()=>{e.OR({DEF:[{ALT:()=>e.SUBRULE(e.unannType)},{ALT:()=>e.CONSUME(t.Var)}],IGNORE_AMBIGUITIES:!0})}),e.RULE("statement",()=>{e.OR([{ALT:()=>e.SUBRULE(e.statementWithoutTrailingSubstatement)},{ALT:()=>e.SUBRULE(e.labeledStatement)},{ALT:()=>e.SUBRULE(e.ifStatement)},{ALT:()=>e.SUBRULE(e.whileStatement)},{ALT:()=>e.SUBRULE(e.forStatement)}])}),e.RULE("statementWithoutTrailingSubstatement",()=>{e.OR({DEF:[{ALT:()=>e.SUBRULE(e.block)},{ALT:()=>e.SUBRULE(e.yieldStatement)},{ALT:()=>e.SUBRULE(e.emptyStatement)},{GATE:()=>!v(this.LA(1).tokenType,t.Switch),ALT:()=>e.SUBRULE(e.expressionStatement)},{ALT:()=>e.SUBRULE(e.assertStatement)},{ALT:()=>e.SUBRULE(e.switchStatement)},{ALT:()=>e.SUBRULE(e.doStatement)},{ALT:()=>e.SUBRULE(e.breakStatement)},{ALT:()=>e.SUBRULE(e.continueStatement)},{ALT:()=>e.SUBRULE(e.returnStatement)},{ALT:()=>e.SUBRULE(e.synchronizedStatement)},{ALT:()=>e.SUBRULE(e.throwStatement)},{ALT:()=>e.SUBRULE(e.tryStatement)}],IGNORE_AMBIGUITIES:!0})}),e.RULE("emptyStatement",()=>{e.CONSUME(t.Semicolon)}),e.RULE("labeledStatement",()=>{e.CONSUME(t.Identifier),e.CONSUME(t.Colon),e.SUBRULE(e.statement)}),e.RULE("expressionStatement",()=>{e.SUBRULE(e.statementExpression),e.CONSUME(t.Semicolon)}),e.RULE("statementExpression",()=>{e.SUBRULE(e.expression)}),e.RULE("ifStatement",()=>{e.CONSUME(t.If),e.CONSUME(t.LBrace),e.SUBRULE(e.expression),e.CONSUME(t.RBrace),e.SUBRULE(e.statement),e.OPTION(()=>{e.CONSUME(t.Else),e.SUBRULE2(e.statement)})}),e.RULE("assertStatement",()=>{e.CONSUME(t.Assert),e.SUBRULE(e.expression),e.OPTION(()=>{e.CONSUME(t.Colon),e.SUBRULE2(e.expression)}),e.CONSUME(t.Semicolon)}),e.RULE("switchStatement",()=>{e.CONSUME(t.Switch),e.CONSUME(t.LBrace),e.SUBRULE(e.expression),e.CONSUME(t.RBrace),e.SUBRULE(e.switchBlock)}),e.RULE("switchBlock",()=>{e.CONSUME(t.LCurly),e.OR([{ALT:()=>{e.SUBRULE(e.switchRule),e.MANY(()=>e.SUBRULE2(e.switchRule))}},{ALT:()=>e.MANY2(()=>e.SUBRULE(e.switchBlockStatementGroup))}]),e.CONSUME(t.RCurly)}),e.RULE("switchBlockStatementGroup",()=>{e.SUBRULE(e.switchLabel),e.CONSUME(t.Colon),e.OPTION(()=>{e.SUBRULE(e.blockStatements)})}),e.RULE("switchLabel",()=>{e.OR([{ALT:()=>{e.CONSUME(t.Case),e.OR2([{ALT:()=>{e.CONSUME(t.Null),e.OPTION2(()=>{e.CONSUME3(t.Comma),e.CONSUME(t.Default)})}},{ALT:()=>{e.SUBRULE(e.casePattern),e.MANY(()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.casePattern)}),e.OPTION(()=>{e.SUBRULE(e.guard)})}},{GATE:()=>!v(e.LA(1).tokenType,t.Null),ALT:()=>{e.SUBRULE(e.caseConstant),e.MANY2(()=>{e.CONSUME2(t.Comma),e.SUBRULE2(e.caseConstant)})}}])}},{ALT:()=>e.CONSUME2(t.Default)}])}),e.RULE("switchRule",()=>{e.SUBRULE(e.switchLabel),e.CONSUME(t.Arrow),e.OR([{ALT:()=>e.SUBRULE(e.throwStatement)},{ALT:()=>e.SUBRULE(e.block)},{ALT:()=>{e.SUBRULE(e.expression),e.CONSUME(t.Semicolon)}}])}),e.RULE("caseConstant",()=>{e.SUBRULE(e.conditionalExpression)}),e.RULE("casePattern",()=>{e.SUBRULE(e.pattern)}),e.RULE("whileStatement",()=>{e.CONSUME(t.While),e.CONSUME(t.LBrace),e.SUBRULE(e.expression),e.CONSUME(t.RBrace),e.SUBRULE(e.statement)}),e.RULE("doStatement",()=>{e.CONSUME(t.Do),e.SUBRULE(e.statement),e.CONSUME(t.While),e.CONSUME(t.LBrace),e.SUBRULE(e.expression),e.CONSUME(t.RBrace),e.CONSUME(t.Semicolon)}),e.RULE("forStatement",()=>{e.OR([{ALT:()=>e.SUBRULE(e.basicForStatement)},{ALT:()=>e.SUBRULE(e.enhancedForStatement)}])}),e.RULE("basicForStatement",()=>{e.CONSUME(t.For),e.CONSUME(t.LBrace),e.OPTION(()=>{e.SUBRULE(e.forInit)}),e.CONSUME(t.Semicolon),e.OPTION2(()=>{e.SUBRULE(e.expression)}),e.CONSUME2(t.Semicolon),e.OPTION3(()=>{e.SUBRULE(e.forUpdate)}),e.CONSUME(t.RBrace),e.SUBRULE(e.statement)}),e.RULE("forInit",()=>{e.OR([{ALT:()=>e.SUBRULE(e.localVariableDeclaration)},{ALT:()=>e.SUBRULE(e.statementExpressionList)}])}),e.RULE("forUpdate",()=>{e.SUBRULE(e.statementExpressionList)}),e.RULE("statementExpressionList",()=>{e.SUBRULE(e.statementExpression),e.MANY(()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.statementExpression)})}),e.RULE("enhancedForStatement",()=>{e.CONSUME(t.For),e.CONSUME(t.LBrace),e.SUBRULE(e.localVariableDeclaration),e.CONSUME(t.Colon),e.SUBRULE(e.expression),e.CONSUME(t.RBrace),e.SUBRULE(e.statement)}),e.RULE("breakStatement",()=>{e.CONSUME(t.Break),e.OPTION(()=>{e.CONSUME(t.Identifier)}),e.CONSUME(t.Semicolon)}),e.RULE("continueStatement",()=>{e.CONSUME(t.Continue),e.OPTION(()=>{e.CONSUME(t.Identifier)}),e.CONSUME(t.Semicolon)}),e.RULE("returnStatement",()=>{e.CONSUME(t.Return),e.OPTION(()=>{e.SUBRULE(e.expression)}),e.CONSUME(t.Semicolon)}),e.RULE("throwStatement",()=>{e.CONSUME(t.Throw),e.SUBRULE(e.expression),e.CONSUME(t.Semicolon)}),e.RULE("synchronizedStatement",()=>{e.CONSUME(t.Synchronized),e.CONSUME(t.LBrace),e.SUBRULE(e.expression),e.CONSUME(t.RBrace),e.SUBRULE(e.block)}),e.RULE("tryStatement",()=>{e.OR([{ALT:()=>{e.CONSUME(t.Try),e.SUBRULE(e.block),e.OR2([{ALT:()=>{e.SUBRULE(e.catches),e.OPTION(()=>{e.SUBRULE(e.finally)})}},{ALT:()=>e.SUBRULE2(e.finally)}])}},{ALT:()=>e.SUBRULE(e.tryWithResourcesStatement)}])}),e.RULE("catches",()=>{e.SUBRULE(e.catchClause),e.MANY(()=>{e.SUBRULE2(e.catchClause)})}),e.RULE("catchClause",()=>{e.CONSUME(t.Catch),e.CONSUME(t.LBrace),e.SUBRULE(e.catchFormalParameter),e.CONSUME(t.RBrace),e.SUBRULE(e.block)}),e.RULE("catchFormalParameter",()=>{e.MANY(()=>{e.SUBRULE(e.variableModifier)}),e.SUBRULE(e.catchType),e.SUBRULE(e.variableDeclaratorId)}),e.RULE("catchType",()=>{e.SUBRULE(e.unannClassType),e.MANY(()=>{e.CONSUME(t.Or),e.SUBRULE2(e.classType)})}),e.RULE("finally",()=>{e.CONSUME(t.Finally),e.SUBRULE(e.block)}),e.RULE("tryWithResourcesStatement",()=>{e.CONSUME(t.Try),e.SUBRULE(e.resourceSpecification),e.SUBRULE(e.block),e.OPTION(()=>{e.SUBRULE(e.catches)}),e.OPTION2(()=>{e.SUBRULE(e.finally)})}),e.RULE("resourceSpecification",()=>{e.CONSUME(t.LBrace),e.SUBRULE(e.resourceList),e.OPTION(()=>{e.CONSUME(t.Semicolon)}),e.CONSUME(t.RBrace)}),e.RULE("resourceList",()=>{e.SUBRULE(e.resource),e.MANY({GATE:()=>v(e.LA(2).tokenType,t.RBrace)===!1,DEF:()=>{e.CONSUME(t.Semicolon),e.SUBRULE2(e.resource)}})}),e.RULE("resource",()=>{e.OR([{ALT:()=>e.SUBRULE(e.localVariableDeclaration)},{ALT:()=>e.SUBRULE(e.variableAccess)}])}),e.RULE("yieldStatement",()=>{e.CONSUME(t.Yield),e.SUBRULE(e.expression),e.CONSUME(t.Semicolon)}),e.RULE("variableAccess",()=>{e.SUBRULE(e.primary)})}function vS(e,t){e.RULE("expression",()=>{e.OR([{ALT:()=>e.SUBRULE(e.lambdaExpression)},{ALT:()=>e.SUBRULE(e.conditionalExpression)}])}),e.RULE("lambdaExpression",()=>{e.SUBRULE(e.lambdaParameters),e.CONSUME(t.Arrow),e.SUBRULE(e.lambdaBody)}),e.RULE("lambdaParameters",()=>{e.OR([{ALT:()=>e.SUBRULE(e.lambdaParametersWithBraces)},{ALT:()=>e.CONSUME(t.Identifier)},{ALT:()=>e.CONSUME(t.Underscore)}])}),e.RULE("lambdaParametersWithBraces",()=>{e.CONSUME(t.LBrace),e.OPTION(()=>{e.SUBRULE(e.lambdaParameterList)}),e.CONSUME(t.RBrace)}),e.RULE("lambdaParameterList",()=>{e.OR([{GATE:()=>{let r=this.LA(1).tokenType,n=this.LA(2).tokenType;return(v(r,t.Identifier)||v(r,t.Underscore))&&(v(n,t.RBrace)||v(n,t.Comma))},ALT:()=>e.SUBRULE(e.conciseLambdaParameterList)},{ALT:()=>e.SUBRULE(e.normalLambdaParameterList)}])}),e.RULE("conciseLambdaParameterList",()=>{e.SUBRULE(e.conciseLambdaParameter),e.MANY(()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.conciseLambdaParameter)})}),e.RULE("normalLambdaParameterList",()=>{e.SUBRULE(e.normalLambdaParameter),e.MANY(()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.normalLambdaParameter)})}),e.RULE("normalLambdaParameter",()=>{e.OR([{ALT:()=>e.SUBRULE(e.regularLambdaParameter)},{ALT:()=>e.SUBRULE(e.variableArityParameter)}])}),e.RULE("regularLambdaParameter",()=>{e.MANY(()=>{e.SUBRULE(e.variableModifier)}),e.SUBRULE(e.lambdaParameterType),e.SUBRULE(e.variableDeclaratorId)}),e.RULE("lambdaParameterType",()=>{e.OR({DEF:[{ALT:()=>e.SUBRULE(e.unannType)},{ALT:()=>e.CONSUME(t.Var)}],IGNORE_AMBIGUITIES:!0})}),e.RULE("conciseLambdaParameter",()=>{e.OR([{ALT:()=>e.CONSUME(t.Identifier)},{ALT:()=>e.CONSUME(t.Underscore)}])}),e.RULE("lambdaBody",()=>{e.OR([{ALT:()=>e.SUBRULE(e.expression)},{ALT:()=>e.SUBRULE(e.block)}])}),e.RULE("conditionalExpression",()=>{e.SUBRULE(e.binaryExpression),e.OPTION(()=>{e.CONSUME(t.QuestionMark),e.SUBRULE(e.expression),e.CONSUME(t.Colon),e.SUBRULE2(e.expression)})}),e.RULE("binaryExpression",()=>{e.SUBRULE(e.unaryExpression),e.MANY(()=>{e.OR({DEF:[{ALT:()=>{e.CONSUME(t.Instanceof),e.OR1([{ALT:()=>e.SUBRULE(e.pattern)},{ALT:()=>e.SUBRULE(e.referenceType)}])}},{ALT:()=>{e.CONSUME(t.AssignmentOperator),e.SUBRULE2(e.expression)}},{GATE:()=>v(e.LA(2).tokenType,t.Less)||v(e.LA(2).tokenType,t.Greater),ALT:()=>{e.SUBRULE(e.shiftOperator),e.SUBRULE2(e.unaryExpression)}},{ALT:()=>{e.CONSUME(t.BinaryOperator),e.SUBRULE3(e.unaryExpression)}}],IGNORE_AMBIGUITIES:!0})})}),e.RULE("unaryExpression",()=>{e.MANY(()=>{e.CONSUME(t.UnaryPrefixOperator)}),e.SUBRULE(e.primary),e.MANY2(()=>{e.CONSUME(t.UnarySuffixOperator)})}),e.RULE("unaryExpressionNotPlusMinus",()=>{e.MANY(()=>{e.CONSUME(t.UnaryPrefixOperatorNotPlusMinus)}),e.SUBRULE(e.primary),e.MANY2(()=>{e.CONSUME(t.UnarySuffixOperator)})}),e.RULE("primary",()=>{e.SUBRULE(e.primaryPrefix),e.MANY(()=>{e.SUBRULE(e.primarySuffix)})}),e.RULE("primaryPrefix",()=>{e.OR([{ALT:()=>e.SUBRULE(e.literal)},{ALT:()=>e.CONSUME(t.This)},{ALT:()=>e.CONSUME(t.Void)},{ALT:()=>e.SUBRULE(e.unannPrimitiveTypeWithOptionalDimsSuffix)},{ALT:()=>e.SUBRULE(e.fqnOrRefType)},{ALT:()=>e.SUBRULE(e.castExpression)},{ALT:()=>e.SUBRULE(e.parenthesisExpression)},{ALT:()=>e.SUBRULE(e.newExpression)},{ALT:()=>e.SUBRULE(e.switchStatement)}])}),e.RULE("primarySuffix",()=>{e.OR([{ALT:()=>{e.CONSUME(t.Dot),e.OR2([{ALT:()=>e.CONSUME(t.This)},{ALT:()=>e.SUBRULE(e.unqualifiedClassInstanceCreationExpression)},{ALT:()=>{e.OPTION(()=>{e.SUBRULE(e.typeArguments)}),e.CONSUME(t.Identifier)}},{ALT:()=>e.SUBRULE(e.templateArgument)}])}},{ALT:()=>e.SUBRULE(e.methodInvocationSuffix)},{ALT:()=>e.SUBRULE(e.classLiteralSuffix)},{ALT:()=>e.SUBRULE(e.arrayAccessSuffix)},{ALT:()=>e.SUBRULE(e.methodReferenceSuffix)}])}),e.RULE("fqnOrRefType",()=>{e.SUBRULE(e.fqnOrRefTypePartFirst),e.MANY({GATE:()=>{let r=e.LA(2);return!(v(r,t.Class)||v(r,t.This)||v(r,t.New)||v(r,t.StringLiteral)||v(r,t.TextBlock)||v(r,t.StringTemplateBegin)||v(r,t.TextBlockTemplateBegin))},DEF:()=>{e.CONSUME(t.Dot),e.SUBRULE2(e.fqnOrRefTypePartRest)}}),e.OPTION({GATE:()=>v(e.LA(1).tokenType,t.At)||v(e.LA(2).tokenType,t.RSquare),DEF:()=>{e.SUBRULE(e.dims)}})}),e.RULE("fqnOrRefTypePartRest",()=>{e.MANY(()=>{e.SUBRULE(e.annotation)}),e.OPTION(()=>e.SUBRULE2(e.typeArguments)),e.SUBRULE(e.fqnOrRefTypePartCommon)}),e.RULE("fqnOrRefTypePartCommon",()=>{e.OR([{ALT:()=>e.CONSUME(t.Identifier)},{ALT:()=>e.CONSUME(t.Super)}]);let r=!1;v(e.LA(1).tokenType,t.Less)&&(r=this.BACKTRACK_LOOKAHEAD(e.isRefTypeInMethodRef)),e.OPTION2({GATE:()=>r,DEF:()=>{e.SUBRULE3(e.typeArguments)}})}),e.RULE("fqnOrRefTypePartFirst",()=>{e.MANY(()=>{e.SUBRULE(e.annotation)}),e.SUBRULE(e.fqnOrRefTypePartCommon)}),e.RULE("parenthesisExpression",()=>{e.CONSUME(t.LBrace),e.SUBRULE(e.expression),e.CONSUME(t.RBrace)}),e.RULE("castExpression",()=>{e.OR([{ALT:()=>e.SUBRULE(e.primitiveCastExpression)},{ALT:()=>e.SUBRULE(e.referenceTypeCastExpression)}])}),e.RULE("primitiveCastExpression",()=>{e.CONSUME(t.LBrace),e.SUBRULE(e.primitiveType),e.CONSUME(t.RBrace),e.SUBRULE(e.unaryExpression)}),e.RULE("referenceTypeCastExpression",()=>{e.CONSUME(t.LBrace),e.SUBRULE(e.referenceType),e.MANY(()=>{e.SUBRULE(e.additionalBound)}),e.CONSUME(t.RBrace),e.OR([{ALT:()=>e.SUBRULE(e.lambdaExpression)},{ALT:()=>e.SUBRULE(e.unaryExpressionNotPlusMinus)}])}),e.RULE("newExpression",()=>{e.OR([{ALT:()=>e.SUBRULE(e.arrayCreationExpression)},{ALT:()=>e.SUBRULE(e.unqualifiedClassInstanceCreationExpression)}])}),e.RULE("unqualifiedClassInstanceCreationExpression",()=>{e.CONSUME(t.New),e.OPTION(()=>{e.SUBRULE(e.typeArguments)}),e.SUBRULE(e.classOrInterfaceTypeToInstantiate),e.CONSUME(t.LBrace),e.OPTION2(()=>{e.SUBRULE(e.argumentList)}),e.CONSUME(t.RBrace),e.OPTION3(()=>{e.SUBRULE(e.classBody)})}),e.RULE("classOrInterfaceTypeToInstantiate",()=>{e.MANY(()=>{e.SUBRULE(e.annotation)}),e.CONSUME(t.Identifier),e.MANY2(()=>{e.CONSUME(t.Dot),e.MANY3(()=>{e.SUBRULE2(e.annotation)}),e.CONSUME2(t.Identifier)}),e.OPTION(()=>{e.SUBRULE(e.typeArgumentsOrDiamond)})}),e.RULE("typeArgumentsOrDiamond",()=>{e.OR([{ALT:()=>e.SUBRULE(e.diamond)},{ALT:()=>e.SUBRULE(e.typeArguments)}])}),e.RULE("diamond",()=>{e.CONSUME(t.Less),e.CONSUME(t.Greater)}),e.RULE("methodInvocationSuffix",()=>{e.CONSUME(t.LBrace),e.OPTION2(()=>{e.SUBRULE(e.argumentList)}),e.CONSUME(t.RBrace)}),e.RULE("argumentList",()=>{e.SUBRULE(e.expression),e.MANY(()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.expression)})}),e.RULE("arrayCreationExpression",()=>{e.CONSUME(t.New),e.OR([{ALT:()=>e.SUBRULE(e.primitiveType)},{ALT:()=>e.SUBRULE(e.classOrInterfaceType)}]),e.OR2([{ALT:()=>e.SUBRULE(e.arrayCreationExpressionWithoutInitializerSuffix)},{ALT:()=>e.SUBRULE(e.arrayCreationWithInitializerSuffix)}])}),e.RULE("arrayCreationExpressionWithoutInitializerSuffix",()=>{e.SUBRULE(e.dimExprs),e.OPTION(()=>{e.SUBRULE(e.dims)})}),e.RULE("arrayCreationWithInitializerSuffix",()=>{e.SUBRULE(e.dims),e.SUBRULE(e.arrayInitializer)}),e.RULE("dimExprs",()=>{e.SUBRULE(e.dimExpr),e.MANY({GATE:()=>v(e.LA(2).tokenType,t.RSquare)===!1,DEF:()=>e.SUBRULE2(e.dimExpr)})}),e.RULE("dimExpr",()=>{e.MANY(()=>{e.SUBRULE(e.annotation)}),e.CONSUME(t.LSquare),e.SUBRULE(e.expression),e.CONSUME(t.RSquare)}),e.RULE("classLiteralSuffix",()=>{e.MANY(()=>{e.CONSUME(t.LSquare),e.CONSUME(t.RSquare)}),e.CONSUME(t.Dot),e.CONSUME(t.Class)}),e.RULE("arrayAccessSuffix",()=>{e.CONSUME(t.LSquare),e.SUBRULE(e.expression),e.CONSUME(t.RSquare)}),e.RULE("methodReferenceSuffix",()=>{e.CONSUME(t.ColonColon),e.OPTION(()=>{e.SUBRULE(e.typeArguments)}),e.OR([{ALT:()=>e.CONSUME(t.Identifier)},{ALT:()=>e.CONSUME(t.New)}])}),e.RULE("templateArgument",()=>{e.OR([{ALT:()=>e.SUBRULE(e.template)},{ALT:()=>e.CONSUME(t.StringLiteral)},{ALT:()=>e.CONSUME(t.TextBlock)}])}),e.RULE("template",()=>{e.OR([{ALT:()=>e.SUBRULE(e.stringTemplate)},{ALT:()=>e.SUBRULE(e.textBlockTemplate)}])}),e.RULE("stringTemplate",()=>{e.CONSUME(t.StringTemplateBegin),e.SUBRULE(e.embeddedExpression),e.MANY(()=>{e.CONSUME(t.StringTemplateMid),e.SUBRULE1(e.embeddedExpression)}),e.CONSUME(t.StringTemplateEnd)}),e.RULE("textBlockTemplate",()=>{e.CONSUME(t.TextBlockTemplateBegin),e.SUBRULE(e.embeddedExpression),e.MANY(()=>{e.CONSUME(t.TextBlockTemplateMid),e.SUBRULE1(e.embeddedExpression)}),e.CONSUME(t.TextBlockTemplateEnd)}),e.RULE("embeddedExpression",()=>{e.OPTION(()=>{e.SUBRULE(e.expression)})}),e.RULE("pattern",()=>{e.OR([{ALT:()=>e.SUBRULE(e.typePattern)},{ALT:()=>e.SUBRULE(e.recordPattern)}])}),e.RULE("typePattern",()=>{e.SUBRULE(e.localVariableDeclaration,{ARGS:[!0]})}),e.RULE("recordPattern",()=>{e.SUBRULE(e.referenceType),e.CONSUME(t.LBrace),e.OPTION(()=>{e.SUBRULE(e.componentPatternList)}),e.CONSUME(t.RBrace)}),e.RULE("componentPatternList",()=>{e.SUBRULE(e.componentPattern),e.MANY(()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.componentPattern)})}),e.RULE("componentPattern",()=>{e.OR([{ALT:()=>e.SUBRULE(e.pattern)},{ALT:()=>e.SUBRULE(e.matchAllPattern)}])}),e.RULE("matchAllPattern",()=>{e.CONSUME(t.Underscore)}),e.RULE("guard",()=>{e.CONSUME(t.When),e.SUBRULE(e.expression)}),e.RULE("isRefTypeInMethodRef",()=>{let r;e.SUBRULE(e.typeArguments);let n=e.OPTION(()=>{e.SUBRULE(e.dims)}),o=this.LA(1).tokenType;if(v(o,t.ColonColon)?r=!0:n&&(r=!1),e.OPTION2(()=>{e.CONSUME(t.Dot),e.SUBRULE(e.classOrInterfaceType)}),r!==void 0)return r;let i=this.LA(1).tokenType;return v(i,t.ColonColon)})}function PS(){return this.computeContentAssist("unaryExpressionNotPlusMinus",[]).map(r=>r.nextTokenType).filter((r,n,o)=>o.indexOf(r)===n)}var Ni=class extends gi{constructor(){super(Zt,{lookaheadStrategy:new bi({logging:Ti()?()=>{}:void 0}),nodeLocationTracking:"full",skipValidations:Ti()});let t=this;t.RULE("typeIdentifier",()=>{t.CONSUME(tt.Identifier)}),OS.call(this,t,tt),LS.call(this,t,tt),AS.call(this,t,tt),bS.call(this,t,tt),US.call(this,t,tt),NS.call(this,t,tt),CS.call(this,t,tt),IS.call(this,t,tt),vS.call(this,t,tt),this.firstForUnaryExpressionNotPlusMinus=[],this.performSelfAnalysis(),this.firstForUnaryExpressionNotPlusMinus=PS.call(this)}cstPostNonTerminal(t,r){this.isBackTracking()||super.cstPostNonTerminal(t,r)}BACKTRACK_LOOKAHEAD(t,r=!1){return this.ACTION(()=>{this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{let{ruleName:o,originalGrammarAction:i}=t;try{return this.ruleInvocationStateUpdate(this.fullRuleNameToShort[o],o,this.subruleIdx),i.call(this)}catch(a){return this.invokeRuleCatch(a,!0,()=>{})}finally{this.ruleFinallyStateUpdate()}}catch(o){if(Pt(o))return r;throw o}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}})}};var Mo=new Ni,pse=Mo.getBaseCstVisitorConstructor(),MS=Mo.getBaseCstVisitorConstructorWithDefaults();function S6(e,t="compilationUnit"){let r=ay.tokenize(e);if(r.errors.length>0){let i=r.errors[0];throw Error("Sad sad panda, lexing errors detected in line: "+i.line+", column: "+i.column+`!
|
|
151
|
+
`+i.message)}let n=r.tokens;Mo.input=n;let o=Mo[t]();if(Mo.errors.length>0){let i=Mo.errors[0];throw Error("Sad sad panda, parsing errors detected in line: "+i.token.startLine+", column: "+i.token.startColumn+`!
|
|
152
|
+
`+i.message+`!
|
|
153
|
+
->`+i.context.ruleStack.join(`
|
|
154
|
+
->`))}return o.comments=r.groups.comments,{cst:o,tokens:n}}function wS(e,t="compilationUnit"){return S6(e,t).cst}var eu=class extends MS{content="";parsed=null;contextStack=[];package="";imports=[];info={...structuredClone(kc),pathChainFields:[]};constructor(){super(),this.validateVisitor()}async loadFile(t){this.info.container={fileName:t};try{let r=await kS.promises.readFile(t,"utf-8");return this.parseContent(r)}catch(r){return`Could not read file: ${t} - ${r}`}}parseContent(t){try{this.content=t,this.parsed=wS(this.content)}catch(r){return`Could not parse content - ${r}`}try{this.visit(this.parsed)}catch(r){return`Could not visit parsed CST for file: ${this.info.name} - ${r}`}return!0}packageDeclaration(t){this.package=We(t.Identifier)||"",super.packageDeclaration(t)}importDeclaration(t){let r=We(T(t.packageOrTypeName)?.Identifier);I(r)&&!r.startsWith("com.pedropathing.")&&!r.startsWith("com.bylazar.")&&!r.startsWith("com.technototes.library.")&&this.imports.push(r),super.importDeclaration(t)}fieldDeclaration(t){let r=T6(t);if(I(r))return this.info.values.push(r),super.fieldDeclaration(t);let n=O6(t);if(I(n))return this.info.poses.push(n),super.fieldDeclaration(t);let o=L6(t);if(I(o))return this.info.beziers.push(o),super.fieldDeclaration(t);let i=A6(t);return I(i)&&this.info.pathChainFields.push(i),super.fieldDeclaration(t)}constructorDeclaration(t){return this.info.pathChainHelpers.push(...I6(t)),this.info.pathChains.push(...v6(t)),super.constructorDeclaration(t)}classDeclaration(t,r){let n=We(T(T(t?.normalClassDeclaration)?.typeIdentifier)?.Identifier);if(A(n))return;if(this.contextStack.length!==0){let i=this.info;this.info={...structuredClone(kc),container:{className:i.name},pathChainFields:[]},i.children[n]=this.info}this.info.name=n,this.contextStack.push(this.info);let o=super.classDeclaration(t,r);return this.info.name=this.contextStack.map(i=>i.name).join("."),this.contextStack.pop(),this.contextStack.length>0&&(this.info=this.contextStack[this.contextStack.length-1]),o}};function Gs(e){if(!(!dr(e)||e.length!==1))return e[0]}function T(e){return Gs(e)?.children}function We(e){return dr(e)?e.map(t=>t.image).join("."):e?.image}function _S(e){switch(e){case"BezierLine":return Un.Line;case"BezierCurve":return Un.Curve}}function tu(e){return!(!e.fieldModifier||e.fieldModifier.length!==2||!e.fieldModifier.every(t=>t.children.Public||t.children.Static))}function BS(e){return!e.fieldModifier||e.fieldModifier.length!==1?!1:I(e.fieldModifier[0].children.Public)}function T6(e){if(!tu(e))return;let t=T(T(T(T(e.unannType)?.unannPrimitiveTypeWithOptionalDimsSuffix)?.unannPrimitiveType)?.numericType);if(!t)return;let r="double";if(t.floatingPointType){if(!T(t.floatingPointType)?.Double)return}else if(t.integralType){if(!T(t.integralType)?.Int)return;r="int"}if(e.variableDeclaratorList.length!==1)return;let n=T(T(e.variableDeclaratorList)?.variableDeclarator);if(!n)return;let o=We(T(n.variableDeclaratorId)?.Identifier);if(!o)return;let i=o,a=Gs(T(n.variableInitializer)?.expression);if(A(a))return;let s=Jr(a);if(w(s))return{name:i,value:s};if(_c(s)||Ji(s))return{name:i,value:s}}function FS(e){let t=T(T(T(e.children.conditionalExpression)?.binaryExpression)?.unaryExpression),r=We(t?.UnaryPrefixOperator)==="-"?-1:1,n=T(T(T(t?.primary)?.primaryPrefix)?.literal);if(I(n?.integerLiteral)){let o=We(T(n.integerLiteral)?.DecimalLiteral);if(I(o))return{int:parseInt(o)*r}}else if(I(n?.floatingPointLiteral)){let o=We(T(n.floatingPointLiteral)?.FloatLiteral);if(I(o))return{double:parseFloat(o)*r}}}function ru(e){let t=We(T(T(T(e)?.fqnOrRefTypePartFirst)?.fqnOrRefTypePartCommon)?.Identifier);if(A(t))return;let r=T(e)?.fqnOrRefTypePartRest;if(I(r))for(let n of r.map(o=>o.children.fqnOrRefTypePartCommon)){let o=We(Gs(n)?.children.Identifier);I(o)&&(t=t+"."+o)}return t}function DS(e){let t=T(T(T(e.children.conditionalExpression)?.binaryExpression)?.unaryExpression),r=T(T(t?.primary)?.primaryPrefix);if(I(r?.fqnOrRefType))return ru(r.fqnOrRefType)}function Hs(e,t){if(A(e))return;let r=DS(e);return w(r)?r:t(e)}function jS(e){let t=T(e.primaryPrefix)?.fqnOrRefType;if(!A(t))return ru(t)}function x6(e){let t=T(T(T(T(e.children.conditionalExpression)?.binaryExpression)?.unaryExpression)?.primary);if(A(t))return;let r=jS(t);if(A(r)||r!=="Math.toRadians"||A(e.children.conditionalExpression))return;let n=T(T(T(T(e.children.conditionalExpression)?.binaryExpression)?.unaryExpression)?.primary)?.primarySuffix;if(A(n)||n.length===0)return;let o=rr(n[0]);if(A(o)||o.length!==1)return;let i=Xr(o[0]);if(w(i))return{radians:i};if(I(i))return{radians:i}}function Xr(e){if(!A(e))return Hs(e,FS)}function R6(e){if(A(e))return;let t=x6(e);return I(t)?t:Hs(e,FS)}function nu(e){return We(T(T(T(T(e)?.unannReferenceType)?.unannClassOrInterfaceType)?.unannClassType)?.Identifier)}function Ks(e){return We(T(e?.variableDeclaratorId)?.Identifier)}function ou(e){return T(T(e.variableDeclaratorList)?.variableDeclarator)}function GS(e){return T(T(T(T(T(T(T(e?.conditionalExpression)?.binaryExpression)?.unaryExpression)?.primary)?.primaryPrefix)?.newExpression)?.unqualifiedClassInstanceCreationExpression)}function iu(e,t){let r;if(oe(e,"name"))r=e;else{let i=Gs(T(e.variableInitializer)?.expression);if(A(i))return["",void 0];r=i}let n=GS(r?.children),o=We(T(n?.classOrInterfaceTypeToInstantiate)?.Identifier);return I(t)&&o!==t?["",void 0]:[t||o||"",T(n?.argumentList)?.expression]}function O6(e){if(!tu(e)&&!BS(e)||nu(e.unannType)!=="Pose")return;let r=ou(e);if(A(r))return;let n=Ks(r);if(A(n))return;let o=HS(r);return I(o)?{name:n,pose:o}:void 0}function HS(e){let[,t]=iu(e,"Pose");if(A(t)||t.length!==3&&t.length!==2)return;let r=Xr(t[0]),n=Xr(t[1]);if(A(r)||A(n))return;let o=t.length===3?Jr(t[2]):void 0;return A(o)?{x:r,y:n}:{x:r,y:n,heading:o}}function KS(e){return Hs(e,HS)}function WS(e,t){let r=dr(e)?e[0]:e;if(A(r))return;let[n,o]=iu(r,t);if(A(o))return;let i=_S(n);if(A(i))return;let a=o.map(KS);if(a.every(I))return{type:i,points:a}}function L6(e){if(!tu(e))return;let t=nu(e.unannType);if(A(t))return;let r=_S(t),n=ou(e);if(A(n)||A(r))return;let o=Ks(n);if(A(o))return;let i=o,a=WS(T(n.variableInitializer)?.expression);if(I(a))return{name:i,points:a}}function A6(e){if(!BS(e)||nu(e.unannType)!=="PathChain")return;let t=ou(e);if(!A(t))return Ks(t)}function rr(e){return dr(e)?rr(e[0]):T(T(e?.children.methodInvocationSuffix)?.argumentList)?.expression}function Jr(e,t=!1){let r=R6(e);return I(r)&&t&&Nl(r)&&r.endsWith(".getHeading")?r.substring(0,r.length-11):r}function U6(e){return Hs(e,WS)}function b6(e){let[t,r]=iu(e);if(A(r)||t!=="HeadingInterpolator.PiecewiseNode"||r.length!==3)return;let n=Xr(r[0]),o=Xr(r[1]),i=VS(r[2],!0);if(!(A(n)||A(o)||A(i)))return{timing:{start:n,end:o},heading:i}}function VS(e,t){let r=DS(e);if(A(r))return;let n=rr(T(T(T(T(e.children.conditionalExpression)?.binaryExpression)?.unaryExpression)?.primary)?.primarySuffix);switch(r){case"HeadingInterpolator.piecewise":if(t||A(n))break;let o=n.map(b6);if(o.every(I))return{type:he.Piecewise,pieces:o};break;case"HeadingInterpolator.facingPoint":if(I(n)&&n.length>0&&n.length<3){if(n.length===1){let f=KS(n[0]);if(I(f))return{type:he.Point,point:f}}else if(n.length===2){let f=Xr(n[0]),u=Xr(n[1]);if(I(f)&&I(u))return{type:he.Point,point:{x:f,y:u}}}}return;case"HeadingInterpolator.tangent":return I(n)?void 0:{type:he.Tangent};case"HeadingInterpolator.constant":if(I(n)){let f=Jr(n[0]);if(I(f))return{type:he.Constant,heading:f}}return;case"HeadingInterpolator.linear":case"HeadingInterpolator.reversedLinear":if(A(n)||n.length<2)return;let i=Jr(n[0]),a=Jr(n[1]);if(A(i)||A(a)||n.length>3)return;let s=n.length===3?Xr(n[3]):void 0,c={type:he.Linear,start:i,end:a};return r.indexOf("v")<0?c:{type:he.Reversed,facing:c};case"HeadingInterpolator.reverse":console.error("NYI: HeadingInterpolator.reverse");return;case"HeadingInterpolator.offset":console.error("NYI: HeadingInterpolator.offset");return}}function N6(e){let t=T(T(T(T(T(T(T(e.children.statement)?.statementWithoutTrailingSubstatement)?.expressionStatement)?.statementExpression)?.expression)?.conditionalExpression)?.binaryExpression);if(A(t)||A(t.AssignmentOperator))return;let r=T(T(T(t.unaryExpression)?.primary)?.primaryPrefix);if(A(r)||A(r.fqnOrRefType))return;let n=ru(r.fqnOrRefType),o=T(T(T(T(T(t.expression)?.conditionalExpression)?.binaryExpression)?.unaryExpression)?.primary);if(A(o))return;let i=jS(o);if(A(i)||i!=="follower.pathBuilder")return;let a=o.primarySuffix;if(A(a)||a.length<5)return;let s=[],c=null,f="pathBuilder";for(let u=0;u<a.length;u++){let l=a[u];if(u%2===1){if(A(l?.children?.Dot))return;switch(f=We(l.children.Identifier),f){case"pathBuilder":case"addPath":case"setTangentHeadingInterpolation":case"setLinearHeadingInterpolation":case"setConstantHeadingInterpolation":case"setHeadingInterpolation":case"setReversed":case"build":continue;default:return}}else switch(f){case"pathBuilder":case"build":if(I(rr(l)))return;continue;case"setTangentHeadingInterpolation":if(I(rr(l)))return;c={type:he.Tangent};continue;case"setLinearHeadingInterpolation":let p=rr(l);if(p?.length!==2)return;let m=Jr(p[0],!0),E=Jr(p[1],!0);if(A(m)||A(E))return;c={type:he.Linear,start:m,end:E};continue;case"setConstantHeadingInterpolation":let y=rr(l);if(y?.length!==1)return;let S=Jr(y[0],!0);if(A(S))return;c={type:he.Constant,heading:S};continue;case"setReversed":if(c===null)return;c={type:he.Reversed,facing:c};continue;case"setHeadingInterpolation":let d=rr(l);if(A(d)||d.length!==1)return;let g=VS(d[0]);if(A(g))return;c=g;continue;case"addPath":let h=rr(l);if(h?.length!==1)return;let x=U6(h[0]);if(A(x))return;s.push(x);continue;default:return}}if(c!==null)return{name:n,paths:s,heading:c}}function C6(e){let t=T(T(e.children.localVariableDeclarationStatement)?.localVariableDeclaration);if(A(t))return;let r=T(T(T(T(T(t.localVariableType)?.unannType)?.unannReferenceType)?.unannClassOrInterfaceType)?.unannClassType)?.Identifier;if(A(r)||r.length===0)return;let n=T(T(t.variableDeclaratorList)?.variableDeclarator);if(A(n))return;let o=We(r),i=Ks(n);if(A(i)||A(o))return;let a=GS(T(T(n.variableInitializer)?.expression));if(A(a))return;let s=T(a.classOrInterfaceTypeToInstantiate)?.Identifier;if(!(A(s)||We(s)!==o)&&!(I(a.argumentList)||I(a.classBody)||I(a.typeArguments)))return{name:i,staticType:o}}function I6(e){let t=T(T(e.constructorBody)?.blockStatements)?.blockStatement;return A(t)?[]:t.map(C6).filter(I)}function v6(e){let t=T(T(e.constructorBody)?.blockStatements)?.blockStatement;return A(t)?[]:t.map(N6).filter(I)}async function qS(e){let t=new eu,r=await t.loadFile(e);if(w(r))return Ho(r);let n={...t.info};if(delete n.pathChainFields,au(n)){let o=[...t.imports];Ci(n,i=>{let a=[...o];oe(i.container,"className")?a.push(t.package+"."+i.container.className):a.push(t.package),i.imports=a,i.fullName=`${t.package}.${i.name}`})}return n}function au(e){let t=!1;return Ci(e,r=>{if(r.beziers.length||r.poses.length||r.pathChains.length||r.values.length)return t=!0,!0}),t}var nt={HasFieldImage:!1,TeamPaths:Ht(),PathClasses:Ht(),ParsedClasses:new Map};function Ci(e,t){let r=[e];for(;r.length>0;){let n=r.pop();if(t(n)===!0)return;r.push(...Object.values(n.children))}}async function P6(e,t){let r=Xl(e,t),n=await qS(r);if(pr(n))return n;let o=[];return Ci(n,i=>o.push(i.name)),[o,n]}function M6(e,t,r,n){if(!au(n))return;let o=bn(e,t);nt.TeamPaths.set(e,o),Ci(n,i=>{let a=Dc(o,i.name);nt.PathClasses.set(o,a),nt.ParsedClasses.set(a,i)})}async function Ws(){k6();let e=await zl();for(let[t,r]of e)for(let n of r){let o=Dl(n),i=await P6(t,o);pr(i)||M6(t,o,i[0],i[1])}return nt.HasFieldImage=await mp(),w6()}function w6(){return nt}function k6(){nt.TeamPaths.clear(),nt.PathClasses.clear(),nt.ParsedClasses.clear()}function YS(e){nt.TeamPaths=e.TeamPaths,nt.PathClasses=e.PathClasses,nt.ParsedClasses=e.ParsedClasses}function _6(e,t){let r=nt.PathClasses.get(bn(e,t));return A(r)?Ho(`List: ${e}:${t} no Pedro pathing classes found`):[...r.keys()].map(jl)}function zS(e,t){let r=_6(e,t);if(pr(r))return r;let n=r.reduce((a,s)=>a.length<s.length?a:s),o=Dc(bn(e,t),n),i=nt.ParsedClasses.get(o);return A(i)?Ho(`Root: ${e}:${t} no Pedro pathing classes found`):i}var XS=jt(require("node:child_process"),1);function JS(e){let t="",r=process.platform;if(/^darwin/.test(r))t="open";else if(/^win/.test(r))t="start";else if(/^linux/.test(r))t="xdg-open";else{console.log(`open a brower to ${e} to launch the application`);return}XS.exec(t+" "+e,(n,o,i)=>{n!=null&&console.log(`exec error: ${JSON.stringify(n)}`)})}async function QS(e){console.log("Parsing code: Please wait..."),await Ws(),console.log(`\u{1F680} Server running at ${e}`),await pp(1500),JS(e.toString())}var ZS="x-hono-already-sent";var Zs=require("node:http"),yt=require("node:http2"),cu=require("node:stream");var $S=e=>((...t)=>{if(typeof t[0]=="function"){let[r,n]=t;return async function(i,a){let s=await r(i),c=await e(i,s,n);if(c)return c;await a()}}else{let[r,n,o]=t;return(async()=>{let i=await e(r,n,o);if(!i)throw new Error("Failed to upgrade WebSocket");return i})()}});var Mt=class extends Error{constructor(e,t){super(e,t),this.name="RequestError"}},B6=new Set(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","server","user-agent"]),F6=/^[!#$%&'*+\-.^_`|~\dA-Za-z]+$/,Vs=e=>e===9||e===10||e===13||e===32,eT=e=>{if(!Vs(e.charCodeAt(0))&&!Vs(e.charCodeAt(e.length-1)))return e;let t=0,r=e.length;for(;t<r&&Vs(e.charCodeAt(t));)t++;for(;r>t&&Vs(e.charCodeAt(r-1));)r--;return e.slice(t,r)},tT=/[\0\r\n]/,hu=globalThis.Headers,fT=(e,t=hu)=>{let r=new t;for(let n=0;n<e.length;n+=2){let o=e[n];o.startsWith(":")||r.append(o,e[n+1])}return r},gu=class{#e;#t;#r;#i;constructor(e){this.#e=e,e instanceof yt.Http2ServerRequest&&(this.#t=e.rawHeaders.slice())}get#o(){return this.#t??=this.#e.rawHeaders.slice()}get#n(){return this.#r||(this.#r=fT(this.#o),this.#t=void 0),this.#r}#c(e){if(typeof e=="string"){if(!F6.test(e))throw new TypeError(`Invalid header name: ${e}`);return e.toLowerCase()}}#a(e){let t=this.#e instanceof yt.Http2ServerRequest?void 0:this.#e.headers;if(!t||B6.has(e)||e==="set-cookie"||e==="__proto__")return;if(!Object.hasOwn(t,e))return null;let r=t[e];if(typeof r=="string"){let n=eT(r);return tT.test(n)?void 0:n}}#s(e,t){let r=t==="cookie"?"; ":", ",n=null;for(let o=0;o<e.length;o+=2){let i=e[o];if(i.length===t.length&&i.toLowerCase()===t){let a=eT(e[o+1]);if(tT.test(a)){this.#i=!0;return}n=n===null?a:n+r+a}}return n}append(e,t){this.#n.append(e,t)}delete(e){this.#n.delete(e)}get(e){let t=this.#c(e);if(t&&!this.#r&&!this.#i){let r=this.#a(t);if(r!==void 0)return r;let n=this.#s(this.#o,t);if(n!==void 0)return n}return this.#n.get(e)}has(e){let t=this.#c(e);if(t&&!this.#r&&!this.#i){let r=this.#a(t);if(r!==void 0)return r!==null;let n=this.#s(this.#o,t);if(n!==void 0)return n!==null}return this.#n.has(e)}set(e,t){this.#n.set(e,t)}getSetCookie(){return this.#n.getSetCookie()}keys(){return this.#n.keys()}values(){return this.#n.values()}entries(){return this.#n.entries()}forEach(e,t){this.#n.forEach((r,n)=>{e.call(t,r,n,this)})}[Symbol.iterator](){return this.entries()}};Object.defineProperty(gu.prototype,Symbol.for("nodejs.util.inspect.custom"),{value:function(e,t,r){return`Headers (lightweight) ${r(Object.fromEntries(this),{...t,depth:e==null?null:e-1})}`}});Object.setPrototypeOf(gu.prototype,hu.prototype);var uT=e=>globalThis.Headers===hu?new gu(e):fT(e.rawHeaders,globalThis.Headers),D6=/^\/[!#$&-;=?-\[\]_a-z~]*$/,j6=/\/\.\.?(?:[/?#]|$)/,G6=/^[a-z0-9._-]+(?::(?:[1-5]\d{3,4}|[6-9]\d{3}))?$/,H6=(e,t,r)=>{let n=`${e}://${t}${r}`;if(G6.test(t)){if(r.length===0)return n+"/";if(r.charCodeAt(0)!==47)throw new Mt("Invalid URL");return!D6.test(r)||j6.test(r)?new URL(n).href:n}else{let o=new URL(n);if(o.hostname.length!==t.length&&o.hostname!==(t.includes(":")?t.replace(/:\d+$/,""):t).toLowerCase())throw new Mt("Invalid host header");return o.href}},K6=e=>e instanceof Mt?e:new Mt(e.message,{cause:e}),W6=global.Request,ko=class extends W6{constructor(e,t){if(typeof e=="object"&&$r in e){let r=t!==void 0&&"body"in t&&t.body!=null;if(e[ir]&&!r)throw new TypeError("Cannot construct a Request with a Request object that has already been used.");e=e[$r]()}typeof t?.body?.getReader<"u"&&(t.duplex??="half"),super(e,t)}},lT=Symbol("wrapBodyStream"),V6=new Set(["latin1","binary","hex","base64","base64url"]),q6=e=>e===null||V6.has(e),su=Symbol("bodyBufferedBeforeDisconnect"),fu=Symbol("bodyBufferedLengthBeforeDisconnect"),pT=(e,t)=>Buffer.isBuffer(e)?e:Buffer.from(e,t??"utf8"),Eu=e=>!(e instanceof yt.Http2ServerRequest)&&!!e.complete&&!!e.readableAborted&&typeof e.read=="function"&&q6(e.readableEncoding),rT=e=>{if(e.readableDidRead||!Eu(e))return;let t=e;t[fu]??=e.readableLength},Ys=(e,t)=>{if(e.readableDidRead&&!t||!Eu(e))return;let r=e;if(r[su]!==void 0)return r[su];let n,o=e.errored;if(o&&o.code!=="ECONNRESET")n=o;else if(r[fu]!==void 0&&e.readableLength!==r[fu])n=zs();else{let i=t??[],a=e.read();a!==null&&i.push(pT(a,e.readableEncoding));let s=i.length===1?i[0]:Buffer.concat(i);n=s;let c=e.headers["content-length"];if(typeof c=="string"&&/^\d+$/.test(c)){let f=Number(c);Number.isSafeInteger(f)&&s.length!==f&&(n=zs())}}return r[su]=n,n},nT=(e,t)=>{if(t instanceof Error){e.error(t);return}t.length>0&&e.enqueue(t),e.close()},Y6=(e,t,r,n,o)=>{let i={method:e,headers:r,signal:o.signal};if(e==="TRACE"){i.method="GET";let a=new ko(t,i);return Object.defineProperty(a,"method",{get(){return"TRACE"}}),a}if(!(e==="GET"||e==="HEAD"))if("rawBody"in n&&n.rawBody instanceof Buffer)i.body=new ReadableStream({start(a){a.enqueue(n.rawBody),a.close()}});else if(n[lT]){let a;i.body=new ReadableStream({async pull(s){try{if(!a){let u=Ys(n);if(u!==void 0){nT(s,u);return}}a||=cu.Readable.toWeb(n).getReader();let{done:c,value:f}=await a.read();c?s.close():s.enqueue(f)}catch(c){s.error(c)}}})}else{let a=Ys(n);a!==void 0?i.body=new ReadableStream({start(s){nT(s,a)}}):i.body=cu.Readable.toWeb(n)}return new ko(t,i)},$r=Symbol("getRequestCache"),nr=Symbol("requestCache"),_o=Symbol("incomingKey"),Pi=Symbol("urlKey"),dT=Symbol("methodKey"),mT=Symbol("headersKey"),Ii=Symbol("abortControllerKey"),uu=Symbol("getAbortController"),lu=Symbol("abortRequest"),Zr=Symbol("bodyBuffer"),qs=Symbol("bodyReadPromise"),ir=Symbol("bodyConsumedDirectly"),oT=Symbol("bodyLockReader"),vi=Symbol("abortReason"),zs=()=>new TypeError("Body is unusable"),Mi=()=>Promise.reject(zs()),z6=new TextDecoder,X6=e=>{if(e[ir])return Mi();e[ir]=!0},J6=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),Q6=e=>(e[mT]||=uT(e[_o])).get("content-type")||"",Z6=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,$6=e=>{if(typeof e!="string"||e.length===0)return"GET";switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"PATCH":case"POST":case"PUT":case"QUERY":return e}let t=e.toUpperCase();switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"POST":case"PUT":return t;default:return e}},e_=e=>{if(!Z6.test(e))return new TypeError(`'${e}' is not a valid HTTP method.`);let t=e.toUpperCase();if(t==="CONNECT"||t==="TRACK"||t==="TRACE"&&e!=="TRACE")return new TypeError(`'${e}' HTTP method is unsupported.`)},yu=(e,t,r)=>{if(e[ir])return Mi();let n=e.method;if(n==="GET"||n==="HEAD")return e[$r]()[t]();let o=e_(n);if(o)return Promise.reject(o);if(e[nr]&&n!=="TRACE")return e[nr][t]();let i=X6(e);if(i)return i;let a=t_(e);if(a){let s=Promise.resolve(r(a,e));return e[Zr]=void 0,s}return r_(e).then(s=>{let c=r(s,e);return e[Zr]=void 0,c})},t_=e=>{let t=e[_o];if("rawBody"in t&&t.rawBody instanceof Buffer)return t.rawBody},iT=(e,t)=>{if(t.errored)return t.errored;let r=e[vi];return r!==void 0?r instanceof Error?r:new Error(String(r)):new Error("Client connection prematurely closed.")},r_=e=>{if(e[Zr])return Promise.resolve(e[Zr]);if(e[qs])return e[qs];let t=e[_o];if(t.readableDidRead)return Mi();let r=Ys(t);if(r!==void 0)return r instanceof Error?Promise.reject(r):(e[Zr]=r,Promise.resolve(r));let n=new Promise((o,i)=>{let a=[],s=!1,c=y=>{s||(s=!0,E(),y())},f=y=>{let S=t.errored??y;return!Eu(t)||S&&S.code!=="ECONNRESET"?!1:(c(()=>{let d=Ys(t,a);d instanceof Error?i(d):d===void 0?i(y??iT(e,t)):(e[Zr]=d,o(d))}),!0)},u=y=>{a.push(pT(y,t.readableEncoding))},l=()=>{c(()=>{let y=a.length===1?a[0]:Buffer.concat(a);e[Zr]=y,o(y)})},p=y=>{f(y)||c(()=>{i(y)})},m=()=>{if(t.readableEnded){l();return}f()||c(()=>{i(iT(e,t))})},E=()=>{t.off("data",u),t.off("end",l),t.off("error",p),t.off("close",m),e[qs]=void 0};t.on("data",u),t.on("end",l),t.on("error",p),t.on("close",m),queueMicrotask(()=>{s||(t.readableEnded?l():t.errored?p(t.errored):t.destroyed&&m())})});return e[qs]=n,n},kt={get method(){return this[dT]},get url(){return this[Pi]},get headers(){return this[mT]||=uT(this[_o])},[lu](e){this[vi]===void 0&&(this[vi]=e);let t=this[Ii];t&&!t.signal.aborted&&t.abort(e)},[uu](){return this[Ii]||=new AbortController,this[vi]!==void 0&&!this[Ii].signal.aborted&&this[Ii].abort(this[vi]),this[Ii]},[$r](){let e=this[uu]();if(this[nr])return this[nr];let t=this.method;if(this[ir]&&!(t==="GET"||t==="HEAD")){this[Zr]=void 0;let r={method:t==="TRACE"?"GET":t,headers:this.headers,signal:e.signal};t!=="TRACE"&&(r.body=new ReadableStream({start(o){o.close()}}),r.duplex="half");let n=new ko(this[Pi],r);return t==="TRACE"&&Object.defineProperty(n,"method",{get(){return"TRACE"}}),this[nr]=n}return this[nr]=Y6(this.method,this[Pi],this.headers,this[_o],e)},get body(){if(!this[ir])return this[$r]().body;let e=this[$r]();return!this[oT]&&e.body&&(this[oT]=e.body.getReader()),e.body},get bodyUsed(){return this[ir]?!0:this[nr]?this[nr].bodyUsed:!1}};Object.defineProperty(kt,"signal",{get(){return this[uu]().signal}});["cache","credentials","destination","integrity","mode","redirect","referrer","referrerPolicy","keepalive"].forEach(e=>{Object.defineProperty(kt,e,{get(){return this[$r]()[e]}})});["clone","formData"].forEach(e=>{Object.defineProperty(kt,e,{value:function(){if(this[ir]){if(e==="clone")throw zs();return Mi()}return this[$r]()[e]()}})});Object.defineProperty(kt,"text",{value:function(){return yu(this,"text",e=>z6.decode(e))}});Object.defineProperty(kt,"arrayBuffer",{value:function(){return yu(this,"arrayBuffer",e=>J6(e))}});Object.defineProperty(kt,"blob",{value:function(){return yu(this,"blob",(e,t)=>{let r=Q6(t),n=r?{headers:{"content-type":r}}:void 0;return new Response(e,n).blob()})}});Object.defineProperty(kt,"json",{value:function(){return this[ir]?Mi():this.text().then(JSON.parse)}});Object.defineProperty(kt,Symbol.for("nodejs.util.inspect.custom"),{value:function(e,t,r){return`Request (lightweight) ${r({method:this.method,url:this.url,headers:this.headers,nativeRequest:this[nr]},{...t,depth:e==null?null:e-1})}`}});Object.setPrototypeOf(kt,ko.prototype);var n_=(e,t)=>{let r=Object.create(kt);r[_o]=e,r[dT]=$6(e.method);let n=e.url||"";if(n[0]!=="/"&&(n.startsWith("http://")||n.startsWith("https://"))){if(e instanceof yt.Http2ServerRequest)throw new Mt("Absolute URL for :path is not allowed in HTTP/2");try{r[Pi]=new URL(n).href}catch(a){throw new Mt("Invalid absolute URL",{cause:a})}return r}let o=(e instanceof yt.Http2ServerRequest?e.authority:e.headers.host)||t;if(!o)throw new Mt("Missing host header");let i;if(e instanceof yt.Http2ServerRequest){if(i=e.scheme,!(i==="http"||i==="https"))throw new Mt("Unsupported scheme")}else i=e.socket&&e.socket.encrypted?"https":"http";try{r[Pi]=H6(i,o,n)}catch(a){throw a instanceof Mt?a:new Mt("Invalid URL",{cause:a})}return r},Qr="text/plain; charset=UTF-8",pu=Symbol("responseCache"),wo=Symbol("getResponseCache"),or=Symbol("cache"),Xs=global.Response,wt=class hT{#e;#t;[wo](){let t=this[or],r=t&&t[2]instanceof Headers?t[2]:void 0;return delete this[or],this[pu]||=new Xs(this.#e,r?{status:this.#t?.status,statusText:this.#t?.statusText,headers:r}:this.#t)}constructor(t,r){let n;if(this.#e=t,r instanceof Xs){let o=r[pu];if(o){this.#t=o,this[wo]();return}this.#t=r instanceof hT?r.#t:r,n=new Headers(r.headers)}else this.#t=r;(t==null||typeof t=="string"||typeof t?.getReader<"u"||t instanceof Blob||t instanceof Uint8Array)&&(this[or]=[r?.status||200,t??null,n||r?.headers])}get headers(){let t=this[or];return t?(t[2]instanceof Headers||(t[2]=new Headers(t[2]||(t[1]===null?void 0:{"content-type":Qr}))),t[2]):this[wo]().headers}get status(){return this[or]?.[0]??this[wo]().status}get ok(){let t=this.status;return t>=200&&t<300}};["body","bodyUsed","redirected","statusText","trailers","type","url"].forEach(e=>{Object.defineProperty(wt.prototype,e,{get(){return this[wo]()[e]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(wt.prototype,e,{value:function(){return this[wo]()[e]()}})});Object.defineProperty(wt.prototype,Symbol.for("nodejs.util.inspect.custom"),{value:function(e,t,r){return`Response (lightweight) ${r({status:this.status,headers:this.headers,ok:this.ok,nativeResponse:this[pu]},{...t,depth:e==null?null:e-1})}`}});Object.setPrototypeOf(wt,Xs);Object.setPrototypeOf(wt.prototype,Xs.prototype);var o_=/^https?:\/\/[!#-;=?-[\]_a-z~A-Z]+$/,i_=e=>e instanceof URL?e.href:o_.test(e)?e:new URL(e).href,a_=new Set([301,302,303,307,308]);Object.defineProperty(wt,"redirect",{value:function(t,r=302){if(!a_.has(r))throw new RangeError("Invalid status code");return new wt(null,{status:r,headers:{location:i_(t)}})},writable:!0,configurable:!0});Object.defineProperty(wt,"json",{value:function(t,r){let n=JSON.stringify(t);if(n===void 0)throw new TypeError("The data is not JSON serializable");let o=r?.headers,i;return o?(i=new Headers(o),i.has("content-type")||i.set("content-type","application/json")):i={"content-type":"application/json"},new wt(n,{status:r?.status??200,statusText:r?.statusText,headers:i})},writable:!0,configurable:!0});async function s_(e){return Promise.race([e,Promise.resolve().then(()=>Promise.resolve(void 0))])}function gT(e,t,r){let n=s=>{e.cancel(s).catch(()=>{})};return t.on("close",n),t.on("error",n),(r??e.read()).then(a,o),e.closed.finally(()=>{t.off("close",n),t.off("error",n)});function o(s){s&&t.destroy(s)}function i(){e.read().then(a,o)}function a({done:s,value:c}){try{if(s)t.end();else if(!t.write(c))t.once("drain",i);else return e.read().then(a,o)}catch(f){o(f)}}}function aT(e,t){if(e.locked)throw new TypeError("ReadableStream is locked.");return t.destroyed?void 0:gT(e.getReader(),t)}var du=(e,t)=>{let r={};if(e instanceof Headers||(e=new Headers(e??void 0)),e.has("set-cookie")){let n=[];for(let[o,i]of e)o==="set-cookie"?n.push(i):r[o]=i;n.length>0&&(r["set-cookie"]=n)}else for(let[n,o]of e)r[n]=o;return t&&(r["content-type"]??=t),r},Js=Symbol("outgoingEnded"),sT=Symbol("incomingDraining"),c_=500,f_=64*1024*1024,ET=e=>{let t=e;if(e.destroyed||t[sT])return;if(t[sT]=!0,e instanceof yt.Http2ServerRequest){try{e.stream?.close?.(yt.constants.NGHTTP2_NO_ERROR)}catch{}return}let r=0,n=()=>{clearTimeout(i),e.off("data",a),e.off("end",n),e.off("error",n)},o=()=>{n();let s=e.socket;s&&!s.destroyed&&(typeof s.destroySoon=="function"?s.destroySoon():typeof s.destroy=="function"&&s.destroy())},i=setTimeout(o,c_);i.unref?.();let a=s=>{r+=s.length,r>f_&&o()};e.on("data",a),e.on("end",n),e.on("error",n),e.resume()},u_=(e,t,r,n)=>()=>{t.errored?(rT(t),e[lu](t.errored.toString())):r.writableFinished||(rT(t),e[lu]("Client connection prematurely closed.")),n&&!t.readableEnded&&setTimeout(()=>{t.readableEnded||setTimeout(()=>{ET(t)})})},l_=e=>{if(!(or in e))return!1;let t=e[or][1];return t===null||typeof t=="string"||t instanceof Uint8Array},p_=()=>new Response(null,{status:400}),yT=e=>new Response(null,{status:e instanceof Error&&(e.name==="TimeoutError"||e.constructor.name==="TimeoutError")?504:500}),Qs=(e,t)=>{let r=e instanceof Error?e:new Error("unknown error",{cause:e});r.code==="ERR_STREAM_PREMATURE_CLOSE"?console.info("The user aborted a request."):(console.error(e),t.headersSent||t.writeHead(500,{"Content-Type":"text/plain"}),t.end(`Error: ${r.message}`),t.destroy(r))},mu=e=>{"flushHeaders"in e&&e.writable&&e.flushHeaders()},ST=async(e,t)=>{let[r,n,o]=e[or];if(!o){n===null?(t.writeHead(r),t.end()):typeof n=="string"?(t.writeHead(r,{"Content-Type":Qr,"Content-Length":Buffer.byteLength(n)}),t.end(n)):n instanceof Uint8Array?(t.writeHead(r,{"Content-Type":Qr,"Content-Length":n.byteLength}),t.end(n)):n instanceof Blob?(t.writeHead(r,{"Content-Type":Qr,"Content-Length":n.size}),t.end(new Uint8Array(await n.arrayBuffer()))):(t.writeHead(r,{"Content-Type":Qr}),mu(t),await aT(n,t)?.catch(a=>Qs(a,t))),t[Js]?.();return}let i=!1;if(o instanceof Headers)i=o.has("content-length"),o=du(o,n===null?void 0:Qr);else if(Array.isArray(o)){let a=new Headers(o);i=a.has("content-length"),o=du(a,n===null?void 0:Qr)}else for(let a in o)if(a.length===14&&a.toLowerCase()==="content-length"){i=!0;break}i||(typeof n=="string"?o["Content-Length"]=Buffer.byteLength(n):n instanceof Uint8Array?o["Content-Length"]=n.byteLength:n instanceof Blob&&(o["Content-Length"]=n.size)),t.writeHead(r,o),n==null?t.end():typeof n=="string"||n instanceof Uint8Array?t.end(n):n instanceof Blob?t.end(new Uint8Array(await n.arrayBuffer())):(mu(t),await aT(n,t)?.catch(a=>Qs(a,t))),t[Js]?.()},TT=e=>typeof e.then=="function",d_=async(e,t,r={})=>{if(TT(e))if(r.errorHandler)try{e=await e}catch(o){let i=await r.errorHandler(o);if(!i)return;e=i}else e=await e.catch(yT);if(or in e)return ST(e,t);let n=du(e.headers,e.body===null?void 0:Qr);if(e.body){let o=e.body.getReader(),i=[],a=!1,s;if(n["transfer-encoding"]!=="chunked"){let c=2;for(let f=0;f<c;f++){s||=o.read();let u=await s_(s).catch(l=>{console.error(l),a=!0});if(!u){if(f===1){await new Promise(l=>setTimeout(l)),c=3;continue}break}if(s=void 0,u.value&&i.push(u.value),u.done){a=!0;break}}a&&!("content-length"in n)&&(n["content-length"]=i.reduce((f,u)=>f+u.length,0))}t.writeHead(e.status,n),i.forEach(c=>{t.write(c)}),a?t.end():(i.length===0&&mu(t),await gT(o,t,s))}else n[ZS]||(t.writeHead(e.status,n),t.end());t[Js]?.()},m_=(e,t={})=>{let r=t.autoCleanupIncoming??!0;return t.overrideGlobalObjects!==!1&&global.Request!==ko&&(Object.defineProperty(global,"Request",{value:ko}),Object.defineProperty(global,"Response",{value:wt})),async(n,o)=>{let i,a,s=!1,c=!1,f=()=>{!a||c||(c=!0,o.on("close",u_(a,n,o,s)))};try{if(a=n_(n,t.hostname),s=r&&!(n.method==="GET"||n.method==="HEAD"),s&&(n[lT]=!0,n instanceof yt.Http2ServerRequest&&(o[Js]=()=>{n.readableEnded||setTimeout(()=>{n.readableEnded||setTimeout(()=>{n.destroy(),o.destroy()})})})),i=e(a,{incoming:n,outgoing:o}),!TT(i)&&l_(i))return s&&!n.readableEnded&&o.once("finish",()=>{n.readableEnded||ET(n)}),ST(i,o);f()}catch(u){if(i)return Qs(u,o);if(t.errorHandler){if(f(),i=await t.errorHandler(a?u:K6(u)),!i)return}else a?i=yT(u):i=p_()}try{return await d_(i,o,t)}catch(u){return Qs(u,o)}}},h_=globalThis.CloseEvent??class extends Event{#e;constructor(e,t={}){super(e,t),this.#e=t}get wasClean(){return this.#e.wasClean??!1}get code(){return this.#e.code??0}get reason(){return this.#e.reason??""}},g_=globalThis.ErrorEvent??class extends Event{#e;constructor(e,t={}){super(e,t),this.#e=t}get message(){return this.#e.message??""}get filename(){return this.#e.filename??""}get lineno(){return this.#e.lineno??0}get colno(){return this.#e.colno??0}get error(){return this.#e.error??null}},E_=()=>Symbol("connection"),xT=Symbol("CONNECTION_SYMBOL_KEY"),RT=Symbol("WAIT_FOR_WEBSOCKET_SYMBOL"),y_=new Set(["connection","content-length","keep-alive","proxy-authenticate","proxy-authorization","te","trailer","transfer-encoding","upgrade","sec-websocket-accept","sec-websocket-extensions","sec-websocket-protocol"]),OT=(e,t)=>{t&&t.forEach((r,n)=>{y_.has(n.toLowerCase())||e.push(`${n}: ${r}`)})},cT=(e,t,r)=>{let n=["Connection: close","Content-Length: 0"];OT(n,r),e.end(`HTTP/1.1 ${t.toString()} ${Zs.STATUS_CODES[t]??""}\r
|
|
155
|
+
${n.join(`\r
|
|
156
|
+
`)}\r
|
|
157
|
+
\r
|
|
158
|
+
`)},S_=e=>{let t=e.socket.encrypted?"https":"http",r=new URL(e.url??"/",`${t}://${e.headers.host??"localhost"}`),n=new Headers;for(let o in e.headers){let i=e.headers[o];i&&n.append(o,Array.isArray(i)?i[0]:i)}return new Request(r,{headers:n})},T_=e=>{let{server:t,fetchCallback:r,wss:n}=e,o=new Map;n.on("connection",(s,c)=>{let f=o.get(c);f&&(f.resolve(s),o.delete(c))});let i=s=>{let c=o.get(s);c&&(o.delete(s),c.reject(new Error("WebSocket handshake aborted")))},a=(s,c)=>new Promise((f,u)=>{o.set(s,{resolve:f,reject:u,connectionSymbol:c})});t.on("upgrade",async(s,c,f)=>{if(s.headers.upgrade?.toLowerCase()!=="websocket")return;let u={incoming:s,outgoing:void 0,wss:n,[RT]:a},l=400,p;try{let S=await r(S_(s),u);S instanceof Response&&(l=S.status,p=S.headers)}catch{t.listenerCount("upgrade")===1&&cT(c,500);return}let m=o.get(s);if(!m||m.connectionSymbol!==u[xT]){i(s),t.listenerCount("upgrade")===1&&cT(c,l,p);return}let E=S=>{OT(S,p)},y=()=>i(s);c.once("close",y),n.on("headers",E);try{n.handleUpgrade(s,c,f,S=>{c.off("close",y),n.emit("connection",S,s)})}finally{n.off("headers",E)}}),t.on("close",()=>{n.close()})},Oce=$S(async(e,t,r)=>{if(e.req.header("upgrade")?.toLowerCase()!=="websocket")return;let n=e.env,o=n[RT];if(!o||!n.incoming)return new Response(null,{status:500});let i=E_();return n[xT]=i,(async()=>{let a;try{a=await o(n.incoming,i)}catch{return}let s=[],c=(l,p)=>{s.push([l,p])};a.on("message",c);let f={binaryType:"arraybuffer",close(l,p){a.close(l,p)},protocol:a.protocol,raw:a,get readyState(){return a.readyState},send(l,p){a.send(l,{compress:p?.compress})},url:new URL(e.req.url)};try{t?.onOpen?.(new Event("open"),f)}catch(l){(r?.onError??console.error)(l)}let u=(l,p)=>{let m=Array.isArray(l)?l:[l];for(let E of m)try{t?.onMessage?.(new MessageEvent("message",{data:p?E instanceof ArrayBuffer?E:E.buffer.slice(E.byteOffset,E.byteOffset+E.byteLength):typeof E=="string"?E:Buffer.from(E).toString("utf-8")}),f)}catch(y){(r?.onError??console.error)(y)}};a.off("message",c);for(let l of s)u(...l);a.on("message",(l,p)=>{u(l,p)}),a.on("close",(l,p)=>{try{t?.onClose?.(new h_("close",{code:l,reason:p.toString()}),f)}catch(m){(r?.onError??console.error)(m)}}),a.on("error",l=>{try{t?.onError?.(new g_("error",{error:l}),f)}catch(p){(r?.onError??console.error)(p)}})})(),new Response}),x_=e=>{let t=e.fetch,r=m_(t,{hostname:e.hostname,overrideGlobalObjects:e.overrideGlobalObjects,autoCleanupIncoming:e.autoCleanupIncoming}),n=(e.createServer||Zs.createServer)(e.serverOptions||{},r);if(e.websocket&&e.websocket.server){if(e.websocket.server.options.noServer!==!0)throw new Error("WebSocket server must be created with { noServer: true } option");T_({server:n,fetchCallback:t,wss:e.websocket.server})}return n},LT=(e,t)=>{let r=x_(e);return r.listen(e?.port??3e3,e.hostname,()=>{let n=r.address();t&&t(n)}),r};var AT=require("node:stream"),UT=require("node:process"),R_=()=>{let[e,t]=UT.versions.node.split(".").map(r=>parseInt(r));return e>=23||e===22&&t>=7||e===20&&t>=18},O_=R_(),Su=(e,t=O_)=>{if(t)return AT.Readable.toWeb(e);let r,n=!1,o=()=>{e.off("data",a),e.off("error",s),e.off("end",c),e.off("close",c)},i=f=>{n||(n=!0,o(),f?.())},a=f=>{n||!r||(r.enqueue(f),(r.desiredSize??0)<=0&&e.pause())},s=f=>{i(()=>{r?.error(f)})},c=()=>{i(()=>{r?.close()})};return new ReadableStream({start(f){r=f,e.on("data",a),e.on("error",s),e.on("end",c),e.on("close",c),e.pause()},pull(){n||e.resume()},cancel(){i();let f=()=>{};e.on("error",f),e.once("close",()=>e.off("error",f)),e.destroy()}})};var bT=(e,t=A_)=>{let r=/\.([a-zA-Z0-9]+?)$/,n=e.match(r);if(n)return t[n[1].toLowerCase()]};var L_={aac:"audio/aac",avi:"video/x-msvideo",avif:"image/avif",av1:"video/av1",bin:"application/octet-stream",bmp:"image/bmp",css:"text/css; charset=utf-8",csv:"text/csv; charset=utf-8",eot:"application/vnd.ms-fontobject",epub:"application/epub+zip",gif:"image/gif",gz:"application/gzip",htm:"text/html; charset=utf-8",html:"text/html; charset=utf-8",ico:"image/x-icon",ics:"text/calendar; charset=utf-8",jpeg:"image/jpeg",jpg:"image/jpeg",js:"text/javascript; charset=utf-8",json:"application/json",jsonld:"application/ld+json",map:"application/json",mid:"audio/x-midi",midi:"audio/x-midi",mjs:"text/javascript; charset=utf-8",mp3:"audio/mpeg",mp4:"video/mp4",mpeg:"video/mpeg",oga:"audio/ogg",ogv:"video/ogg",ogx:"application/ogg",opus:"audio/opus",otf:"font/otf",pdf:"application/pdf",png:"image/png",rtf:"application/rtf",svg:"image/svg+xml; charset=utf-8",tif:"image/tiff",tiff:"image/tiff",ts:"video/mp2t",ttf:"font/ttf",txt:"text/plain; charset=utf-8",wasm:"application/wasm",webm:"video/webm",weba:"audio/webm",webmanifest:"application/manifest+json",webp:"image/webp",woff:"font/woff",woff2:"font/woff2",xhtml:"application/xhtml+xml; charset=utf-8",xml:"application/xml; charset=utf-8",zip:"application/zip","3gp":"video/3gpp","3g2":"video/3gpp2",gltf:"model/gltf+json",glb:"model/gltf-binary"},A_=L_;var Rn=require("node:fs"),xu=require("node:path"),U_=/^\s*(?:text\/[^;\s]+|application\/(?:javascript|json|xml|xml-dtd|ecmascript|dart|postscript|rtf|tar|toml|vnd\.dart|vnd\.ms-fontobject|vnd\.ms-opentype|wasm|x-httpd-php|x-javascript|x-ns-proxy-autoconfig|x-sh|x-tar|x-virtualbox-hdd|x-virtualbox-ova|x-virtualbox-ovf|x-virtualbox-vbox|x-virtualbox-vdi|x-virtualbox-vhd|x-virtualbox-vmdk|x-www-form-urlencoded)|font\/(?:otf|ttf)|image\/(?:bmp|vnd\.adobe\.photoshop|vnd\.microsoft\.icon|vnd\.ms-dds|x-icon|x-ms-bmp)|message\/rfc822|model\/gltf-binary|x-shader\/x-fragment|x-shader\/x-vertex|[^;\s]+?\+(?:json|text|xml|yaml))(?:[;\s]|$)/i,Ru={br:".br",zstd:".zst",gzip:".gz"},b_=Object.keys(Ru),Tu=e=>{let t;try{t=(0,Rn.statSync)(e)}catch{}return t},N_=/^(?:bytes=)?(?!-$)(\d*)-(\d*)$/,C_=e=>{let t=e.match(N_);if(!t)return;let[,r,n]=t;return r===""?{type:"suffix",length:Number(n)}:n===""?{type:"open-ended",start:Number(r)}:{type:"bounded",start:Number(r),end:Number(n)}},I_=(e,t)=>{if(t===0)return;if(e.type==="suffix")return e.length===0?void 0:{start:Math.max(t-e.length,0),end:t-1};let r=e.type==="bounded"?Math.min(e.end,t-1):t-1;if(!(e.start>=t||e.start>r))return{start:e.start,end:r}},v_=(e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[0-9A-Fa-f]{2})+/g,r=>{try{return t(r)}catch{return r}})}},P_=e=>v_(e,decodeURI),Ou=(e={root:""})=>{let t=e.root||"",r=e.path;return t!==""&&!(0,Rn.existsSync)(t)&&console.error(`serveStatic: root path '${t}' is not found, are you sure it's correct?`),async(n,o)=>{if(n.finalized)return o();let i;if(r)i=r;else try{if(i=P_(n.req.path),/(?:^|[\/\\])\.{1,2}(?:$|[\/\\])|[\/\\]{2,}|\\/.test(i))throw new Error}catch{return await e.onNotFound?.(n.req.path,n),o()}let a=(0,xu.join)(t,!r&&e.rewriteRequestPath?e.rewriteRequestPath(i,n):i),s=Tu(a);if(s&&s.isDirectory()){let p=e.index??"index.html";a=(0,xu.join)(a,p),s=Tu(a)}if(!s)return await e.onNotFound?.(a,n),o();let c=bT(a);if(n.header("Content-Type",c||"application/octet-stream"),e.precompressed&&(!c||c==="application/octet-stream"||U_.test(c))){let p=new Set(n.req.header("Accept-Encoding")?.split(",").map(m=>m.trim()));for(let m of b_){if(!p.has(m))continue;let E=Tu(a+Ru[m]);if(E){n.header("Content-Encoding",m),n.header("Vary","Accept-Encoding",{append:!0}),s=E,a=a+Ru[m];break}}}let f,u=s.size,l=n.req.header("range")||"";if(n.header("Last-Modified",s.mtime.toUTCString()),n.req.method=="HEAD"||n.req.method=="OPTIONS")n.header("Content-Length",u.toString()),n.status(200),f=n.body(null);else if(!l)n.header("Content-Length",u.toString()),f=n.body(Su((0,Rn.createReadStream)(a)),200);else{n.header("Accept-Ranges","bytes");let p=I_(C_(l)??{type:"open-ended",start:0},u);if(!p)n.header("Content-Range",`bytes */${u}`),f=n.body(null,416);else{let{start:m,end:E}=p,y=E-m+1,S=(0,Rn.createReadStream)(a,{start:m,end:E});n.header("Content-Length",y.toString()),n.header("Content-Range",`bytes ${m}-${E}/${u}`),f=n.body(Su(S),206)}}return await e.onFound?.(a,n),f}};var Lu=(e,t,r)=>(n,o)=>{let i=-1;return a(0);async function a(s){if(s<=i)throw new Error("next() called multiple times");i=s;let c,f=!1,u;if(e[s]?(u=e[s][0][0],n.req.routeIndex=s):u=s===e.length&&o||void 0,u)try{c=await u(n,()=>a(s+1))}catch(l){if(l instanceof Error&&t)n.error=l,c=await t(l,n),f=!0;else throw l}else n.finalized===!1&&r&&(c=await r(n));return c&&(n.finalized===!1||f)&&(n.res=c),n}};var NT=Symbol();var CT=(e,t)=>new Response(e,{headers:{"Content-Type":t.replace(/^[^;]+/,n=>n.toLowerCase())}}).formData();var IT=32,M_=1e4,$s=e=>"headers"in e,MT=async(e,t=Object.create(null))=>{let{all:r=!1,dot:n=!1}=t,a=($s(e)?e.headers:e.raw.headers).get("Content-Type")?.split(";")[0].trim().toLowerCase();return a==="multipart/form-data"||a==="application/x-www-form-urlencoded"?w_(e,{all:r,dot:n}):{}};async function w_(e,t){if(!$s(e)&&e.bodyCache.formData)return vT(await e.bodyCache.formData,t);let r=$s(e)?e.headers:e.raw.headers,n=await e.arrayBuffer(),o=CT(n,r.get("Content-Type")||"");$s(e)||(e.bodyCache.formData=o);let i=await o;return i?vT(i,t):{}}function vT(e,t){let r=Object.create(null),n={count:0};return e.forEach((o,i)=>{t.all||i.endsWith("[]")?k_(r,i,o):r[i]=o}),t.dot&&Object.entries(r).forEach(([o,i])=>{o.includes(".")&&(__(r,o,i,n),delete r[o])}),r}var k_=(e,t,r)=>{e[t]!==void 0?Array.isArray(e[t])?e[t].push(r):e[t]=[e[t],r]:t.endsWith("[]")?e[t]=[r]:e[t]=r},__=(e,t,r,n)=>{if(/(?:^|\.)__proto__\./.test(t))return;let o=e,i=t.split(".",IT+2);i.length>IT+1&&PT(),i.forEach((a,s)=>{s===i.length-1?o[a]=r:((!o[a]||typeof o[a]!="object"||Array.isArray(o[a])||o[a]instanceof File)&&(n.count++>=M_&&PT(),o[a]=Object.create(null)),o=o[a])})},PT=()=>{throw new Error("Nesting limit exceeded")};var Uu=e=>{let t=e.split("/");return t[0]===""&&t.shift(),t},wT=e=>{let{groups:t,path:r}=B_(e),n=Uu(r);return F_(n,t)},B_=e=>{let t=[];return e=e.replace(/\{[^}]+\}/g,(r,n)=>{let o=`@${n}`;return t.push([o,r]),o}),{groups:t,path:e}},F_=(e,t)=>{for(let r=t.length-1;r>=0;r--){let[n]=t[r];for(let o=e.length-1;o>=0;o--)if(e[o].includes(n)){e[o]=e[o].replace(n,t[r][1]);break}}return e},ec={},kT=(e,t)=>{if(e==="*")return"*";let r=e.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);if(r){let n=`${e}#${t}`;return ec[n]||(r[2]?ec[n]=t&&t[0]!==":"&&t[0]!=="*"?[n,r[1],new RegExp(`^${r[2]}(?=/${t})`)]:[e,r[1],new RegExp(`^${r[2]}$`)]:ec[n]=[e,r[1],!0]),ec[n]}return null},_T=(e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[0-9A-Fa-f]{2})+/g,r=>{try{return t(r)}catch{return r}})}},D_=e=>_T(e,decodeURI),bu=e=>{let t=e.url,r=t.indexOf("/",t.indexOf(":")+4),n=r;for(;n<t.length;n++){let o=t.charCodeAt(n);if(o===37){let i=t.indexOf("?",n),a=t.indexOf("#",n),s=i===-1?a===-1?void 0:a:a===-1?i:Math.min(i,a),c=t.slice(r,s);return D_(c.includes("%25")?c.replace(/%25/g,"%2525"):c)}else if(o===63||o===35)break}return t.slice(r,n)};var BT=e=>{let t=bu(e);return t.length>1&&t.at(-1)==="/"?t.slice(0,-1):t},en=(e,t,...r)=>(r.length&&(t=en(t,...r)),`${e?.[0]==="/"?"":"/"}${e}${t==="/"?"":`${e?.at(-1)==="/"?"":"/"}${t?.[0]==="/"?t.slice(1):t}`}`),tc=e=>{if(e.charCodeAt(e.length-1)!==63||!e.includes(":"))return null;let t=e.split("/"),r=[],n="";return t.forEach(o=>{if(o!==""&&!/\:/.test(o))n+="/"+o;else if(/\:/.test(o))if(o.charCodeAt(o.length-1)===63){r.length===0&&n===""?r.push("/"):r.push(n);let i=o.slice(0,-1);n+="/"+i,r.push(n)}else n+="/"+o}),r.filter((o,i,a)=>a.indexOf(o)===i)},rc=e=>e.indexOf("%")!==-1?_T(e,j_):e,Au=e=>(e.indexOf("+")!==-1&&(e=e.replace(/\+/g," ")),rc(e)),FT=(e,t,r)=>{let n=e.indexOf("#",8);n!==-1&&(e=e.slice(0,n));let o;if(!r&&t&&t.indexOf("%")===-1&&t.indexOf("+")===-1){let s=e.indexOf("?",8);if(s===-1)return;for(e.startsWith(t,s+1)||(s=e.indexOf(`&${t}`,s+1));s!==-1;){let c=e.charCodeAt(s+t.length+1);if(c===61){let f=s+t.length+2,u=e.indexOf("&",f);return Au(e.slice(f,u===-1?void 0:u))}else if(c==38||isNaN(c))return"";s=e.indexOf(`&${t}`,s+1)}if(o=/[%+]/.test(e),!o)return}let i=Object.create(null);o??=/[%+]/.test(e);let a=e.indexOf("?",8);for(;a!==-1;){let s=e.indexOf("&",a+1),c=e.indexOf("=",a);c>s&&s!==-1&&(c=-1);let f=e.slice(a+1,c===-1?s===-1?void 0:s:c);if(o&&(f=Au(f)),a=s,f==="")continue;let u;c===-1?u="":(u=e.slice(c+1,s===-1?void 0:s),o&&(u=Au(u))),r?(i[f]&&Array.isArray(i[f])||(i[f]=[]),i[f].push(u)):i[f]??=u}return t?i[t]:i},DT=FT,jT=(e,t)=>FT(e,t,!0),j_=decodeURIComponent;var GT=class{raw;#e;#t;routeIndex=0;path;bodyCache={};constructor(e,t="/",r=[[]]){this.raw=e,this.path=t,this.#t=r}param(e){return e?this.#r(e):this.#i()}#r(e){let t=this.#t[0][this.routeIndex]?.[1][e],r=this.#o(t);return r&&rc(r)}#i(){let e={},t=Object.keys(this.#t[0][this.routeIndex]?.[1]??{});for(let r of t){let n=this.#o(this.#t[0][this.routeIndex][1][r]);n!==void 0&&(e[r]=rc(n))}return e}#o(e){return this.#t[1]?this.#t[1][e]:e}query(e){return DT(this.url,e)}queries(e){return jT(this.url,e)}header(e){if(e)return this.raw.headers.get(e)??void 0;let t=Object.create(null);return this.raw.headers.forEach((r,n)=>{t[n]=r}),t}async parseBody(e){return MT(this,e)}#n=e=>{let{bodyCache:t,raw:r}=this,n=t[e];if(n)return n;for(let o in t)return t[o].then(i=>(o==="json"&&(i=JSON.stringify(i)),new Response(i)[e]()));return t[e]=r[e]()};json(){return this.#n("text").then(e=>JSON.parse(e))}text(){return this.#n("text")}arrayBuffer(){return this.#n("arrayBuffer")}bytes(){return this.#n("arrayBuffer").then(e=>new Uint8Array(e))}blob(){return this.#n("blob")}formData(){return this.#n("formData")}addValidatedData(e,t){(this.#e??={})[e]=t}valid(e){return this.#e?.[e]}get url(){return this.raw.url}get method(){return this.raw.method}get[NT](){return this.#t}get matchedRoutes(){return this.#t[0].map(([[,e]])=>e)}get routePath(){return this.#t[0].map(([[,e]])=>e)[this.routeIndex].path}};var HT={Stringify:1,BeforeStream:2,Stream:3},G_=(e,t)=>{let r=new String(e);return r.isEscaped=!0,r.callbacks=t,r};var Nu=async(e,t,r,n,o)=>{typeof e=="object"&&!(e instanceof String)&&(e instanceof Promise||(e=e.toString()),e instanceof Promise&&(e=await e));let i=e.callbacks;if(!i?.length)return Promise.resolve(e);o?o[0]+=e:o=[e];let a=Promise.all(i.map(s=>s({phase:t,buffer:o,context:n}))).then(s=>Promise.all(s.filter(Boolean).map(c=>Nu(c,t,!1,n,o))).then(()=>o[0]));return r?G_(await a,i):a};var H_="text/plain; charset=UTF-8",Cu=(e,t)=>({"Content-Type":e,...t}),wi=(e,t)=>new Response(e,t),Iu=class{#e;#t;env={};#r;finalized=!1;error;#i;#o;#n;#c;#a;#s;#u;#l;#p;constructor(e,t){this.#e=e,t&&(this.#o=t.executionCtx,this.env=t.env,this.#s=t.notFoundHandler,this.#p=t.path,this.#l=t.matchResult)}get req(){return this.#t??=new GT(this.#e,this.#p,this.#l),this.#t}get event(){if(this.#o&&"respondWith"in this.#o)return this.#o;throw Error("This context has no FetchEvent")}get executionCtx(){if(this.#o)return this.#o;throw Error("This context has no ExecutionContext")}get res(){return this.#n||=wi(null,{headers:this.#u??=new Headers})}set res(e){if(this.#n&&e){e=wi(e.body,e);for(let[t,r]of this.#n.headers.entries())if(t!=="content-type")if(t==="set-cookie"){let n=this.#n.headers.getSetCookie();e.headers.delete("set-cookie");for(let o of n)e.headers.append("set-cookie",o)}else e.headers.set(t,r)}this.#n=e,this.finalized=!0}render=(...e)=>(this.#a??=t=>this.html(t),this.#a(...e));setLayout=e=>this.#c=e;getLayout=()=>this.#c;setRenderer=e=>{this.#a=e};header=(e,t,r)=>{this.finalized&&(this.#n=wi(this.#n.body,this.#n));let n=this.#n?this.#n.headers:this.#u??=new Headers;t===void 0?n.delete(e):r?.append?n.append(e,t):n.set(e,t)};status=e=>{this.#i=e};set=(e,t)=>{this.#r??=new Map,this.#r.set(e,t)};get=e=>this.#r?this.#r.get(e):void 0;get var(){return this.#r?Object.fromEntries(this.#r):{}}#f(e,t,r){let n=this.#n?new Headers(this.#n.headers):this.#u;if(typeof t=="object"&&t.headers){n??=new Headers;for(let[i,a]of new Headers(t.headers))i==="set-cookie"?n.append(i,a):n.set(i,a)}if(r){if(!n){let i=0;for(let a in r)if(++i>1||typeof r[a]!="string"){n=new Headers;break}}if(n)for(let i in r){let a=r[i];if(typeof a=="string")n.set(i,a);else{n.delete(i);for(let s of a)n.append(i,s)}}}let o=typeof t=="number"?t:t?.status??this.#i;return wi(e,{status:o,headers:n??r})}newResponse=(...e)=>this.#f(...e);body=(e,t,r)=>this.#f(e,t,r);text=(e,t,r)=>!this.#u&&!this.#i&&!t&&!r&&!this.finalized?new Response(e):this.#f(e,t,Cu(H_,r));json=(e,t,r)=>this.#f(JSON.stringify(e),t,Cu("application/json",r));html=(e,t,r)=>{let n=o=>this.#f(o,t,Cu("text/html; charset=UTF-8",r));return typeof e=="object"?Nu(e,HT.Stringify,!1,{}).then(n):n(e)};redirect=(e,t)=>{let r=String(e);return this.header("Location",/[^\x00-\xFF]/.test(r)?encodeURI(r):r),this.newResponse(null,t??302)};notFound=()=>(this.#s??=()=>wi(),this.#s(this))};var Ne="ALL",KT="all",WT=["get","post","put","delete","options","patch","query"],nc="Can not add a route since the matcher is already built.",oc=class extends Error{};var VT="__COMPOSED_HANDLER";var K_=e=>e.text("404 Not Found",404),qT=(e,t)=>{if("getResponse"in e){let r=e.getResponse();return t.newResponse(r.body,r)}return console.error(e),t.text("Internal Server Error",500)},YT=class zT{get;post;put;delete;options;patch;query;all;on;use;router;getPath;_basePath="/";#e="/";routes=[];constructor(t={}){[...WT,KT].forEach(i=>{this[i]=(a,...s)=>(typeof a=="string"?this.#e=a:this.#i(i,this.#e,a),s.forEach(c=>{this.#i(i,this.#e,c)}),this)}),this.on=(i,a,...s)=>{for(let c of[a].flat()){this.#e=c;for(let f of[i].flat())s.map(u=>{this.#i(f.toUpperCase(),this.#e,u)})}return this},this.use=(i,...a)=>(typeof i=="string"?this.#e=i:(this.#e="*",a.unshift(i)),a.forEach(s=>{this.#i(Ne,this.#e,s)}),this);let{strict:n,...o}=t;Object.assign(this,o),this.getPath=n??!0?t.getPath??bu:BT}#t(){let t=new zT({router:this.router,getPath:this.getPath});return t.errorHandler=this.errorHandler,t.#r=this.#r,t.routes=this.routes,t}#r=K_;errorHandler=qT;route(t,r){let n=this.basePath(t);return r.routes.map(o=>{let i;r.errorHandler===qT?i=o.handler:(i=async(a,s)=>(await Lu([],r.errorHandler)(a,()=>o.handler(a,s))).res,i[VT]=o.handler),n.#i(o.method,o.path,i,o.basePath)}),this}basePath(t){let r=this.#t();return r._basePath=en(this._basePath,t),r}onError=t=>(this.errorHandler=t,this);notFound=t=>(this.#r=t,this);mount(t,r,n){let o,i;n&&(typeof n=="function"?i=n:(i=n.optionHandler,n.replaceRequest===!1?o=c=>c:o=n.replaceRequest));let a=i?c=>{let f=i(c);return Array.isArray(f)?f:[f]}:c=>{let f;try{f=c.executionCtx}catch{}return[c.env,f]};o||=(()=>{let c=en(this._basePath,t),f=c==="/"?0:c.length;return u=>{let l=new URL(u.url);return l.pathname=this.getPath(u).slice(f)||"/",new Request(l,u)}})();let s=async(c,f)=>{let u=await r(o(c.req.raw),...a(c));if(u)return u;await f()};return this.#i(Ne,en(t,"*"),s),this}#i(t,r,n,o){t=t.toUpperCase(),r=en(this._basePath,r);let i={basePath:o!==void 0?en(this._basePath,o):this._basePath,path:r,method:t,handler:n};this.router.add(t,r,[n,i]),this.routes.push(i)}#o(t,r){if(t instanceof Error)return this.errorHandler(t,r);throw t}#n(t,r,n,o){if(o==="HEAD")return(async()=>new Response(null,await this.#n(t,r,n,"GET")))();let i=this.getPath(t,{env:n}),a=this.router.match(o,i),s=new Iu(t,{path:i,matchResult:a,env:n,executionCtx:r,notFoundHandler:this.#r});if(a[0].length===1){let f;try{f=a[0][0][0][0](s,async()=>{s.res=await this.#r(s)})}catch(u){return this.#o(u,s)}return f instanceof Promise?f.then(u=>u||(s.finalized?s.res:this.#r(s))).catch(u=>this.#o(u,s)):f??this.#r(s)}let c=Lu(a[0],this.errorHandler,this.#r);return(async()=>{try{let f=await c(s);if(!f.finalized)throw new Error("Context is not finalized. Did you forget to return a Response object or `await next()`?");return f.res}catch(f){return this.#o(f,s)}})()}fetch=(t,...r)=>this.#n(t,r[1],r[0],t.method);request=(t,r,n,o)=>t instanceof Request?this.fetch(r?new Request(t,r):t,n,o):(t=t.toString(),this.fetch(new Request(/^https?:\/\//.test(t)?t:`http://localhost${en("/",t)}`,r),n,o));fire=()=>{addEventListener("fetch",t=>{t.respondWith(this.#n(t.request,t,void 0,t.request.method))})}};var Ae=()=>Object.create(null);var ic=[];function vu(e,t){let r=this.buildAllMatchers(),n=((o,i)=>{let a=r[o]||r[Ne],s=a[2][i];if(s)return s;let c=i.match(a[0]);if(!c)return[[],ic];let f=c.indexOf("",1);return[a[1][f],c]});return this.match=n,n(e,t)}var Bo="[^/]+",rn=".*",ar="(?:|/.*)",tn=Symbol(),XT=new Set(".\\+*[^]$()");function W_(e,t){return e.length===1?t.length===1?e<t?-1:1:-1:t.length===1?1:e===rn||e===ar?t===ar?-1:1:t===rn||t===ar?-1:e===Bo?1:t===Bo?-1:e.length===t.length?e<t?-1:1:t.length-e.length}var JT=class Pu{#e;#t;#r=Ae();insert(t,r,n,o,i){let a=this;for(let s=0,c=t.length;s<c;s++){let f=t[s],u=f.length===1?f==="*"?s===c-1?["","",rn]:["","",Bo]:null:f==="/*"?["","",ar]:f.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/),l;if(u){let p=u[1],m=u[2]||Bo;if(p&&u[2]&&(m===".*"||(m=m.replace(/^\((?!\?:)(?=[^)]+\)$)/,"(?:"),/\((?!\?:)/.test(m))||m.length===1&&XT.has(m)))throw tn;if(l=a.#r[m],!l){if(m!==rn&&m!==ar){for(let E in a.#r)if((m.length>1||E.length>1)&&E!==rn&&E!==ar)throw tn}l=a.#r[m]=new Pu}p!==""&&(l.#t??=o.varIndex++,n.push([p,l.#t]))}else if(l=a.#r[f],!l){for(let p in a.#r)if(p.length>1&&p!==rn&&p!==ar)throw tn;l=a.#r[f]=new Pu}a=l}if(a.#e!==void 0)throw tn;a.#e=i?-1:r}buildRegExpStr(){let r=Object.keys(this.#r).sort(W_).map(n=>{let o=this.#r[n],i=o.buildRegExpStr();return i===""?"":(typeof o.#t=="number"?`(${n})@${o.#t}`:XT.has(n)?`\\${n}`:n)+i}).filter(Boolean);return typeof this.#e=="number"&&this.#e!==-1&&r.unshift(`#${this.#e}`),r.length===0?"":r.length===1?r[0]:"(?:"+r.join("|")+")"}};var Mu=class{#e={varIndex:0};#t=new JT;#r=0;paths=Ae();insert(e,t){if(t){this.#t.insert(e.split(""),0,[],this.#e,!0);return}let r=[],n=[],o=e;for(let a=0;;){let s=!1;if(o=o.replace(/\{[^}]+\}/g,c=>{let f=`@\\${a}`;return n[a]=[f,c],a++,s=!0,f}),!s)break}let i=o.match(/(?::[^\/]+)|(?:\/\*$)|./g)||[];for(let a=n.length-1;a>=0;a--){let[s]=n[a];for(let c=i.length-1;c>=0;c--)if(i[c].indexOf(s)!==-1){i[c]=i[c].replace(s,n[a][1]);break}}this.#t.insert(i,this.#r,r,this.#e,!1),this.paths[e]=[this.#r++,r]}buildRegExp(){let e=this.#t.buildRegExpStr();if(e==="")return[/^$/,[],[]];let t=0,r=[],n=[];return e=e.replace(/#(\d+)|@(\d+)|\.\*\$/g,(o,i,a)=>i!==void 0?(r[++t]=Number(i),"$()"):(a!==void 0&&(n[Number(a)]=++t),"")),[new RegExp(`^${e}`),r,n]}};var QT=Ae();function ZT(e){return QT[e]??=new RegExp(`^${e.replace(/\/:[^/{}]+(?:\{\[\^\/]\+})?(?=[/{]|$)|\/?\*$|([.\\+*[^\]$()?{}|])/g,(t,r)=>r?`\\${r}`:t==="/*"?ar:t==="*"?rn:`/:${Bo}`)}$`)}function ac(e,t){for(let r of Object.keys(e).sort((n,o)=>o.length-n.length))if(ZT(r).test(t))return[...e[r]]}var sc=class{name="RegExpRouter";#e;#t;#r;constructor(){this.#e={[Ne]:Ae()},this.#t={[Ne]:Ae()},this.#r={[Ne]:new Mu}}#i(e,t){try{this.#r[e].insert(t,!/\*|\/:/.test(t))}catch(r){throw r===tn?new oc(t):r}}add(e,t,r){let n=this.#e,o=this.#t;if(!n)throw new Error(nc);if(!n[e]){this.#r[e]=new Mu;for(let s of[n,o]){s[e]=Ae();for(let c in s[Ne])s[e][c]=[...s[Ne][c]],this.#i(e,c)}}t==="/*"&&(t="*");let i=e===Ne?Object.keys(n):[e];if(/\*$/.test(t)){let s=ZT(t);for(let c of i)n[c][t]||(this.#i(c,t),n[c][t]=ac(n[c],t)||ac(n[Ne],t)||[]);for(let c of[n,o])for(let f of i)for(let u in c[f])s.test(u)&&c[f][u].push([r,t]);return}let a=tc(t)||[t];for(let s of a)for(let c of i)o[c][s]||(this.#i(c,s),o[c][s]=ac(n[c],s)||ac(n[Ne],s)||[]),o[c][s].push([r,s])}match=vu;buildAllMatchers(){let e=Ae();for(let t of Object.keys(this.#t))e[t]=this.#o(t);return this.#e=this.#t=this.#r=void 0,QT=Ae(),e}#o(e){let t=this.#e[e],r=this.#t[e],n=this.#r[e],o=Ae(),i=[],[a,s,c]=n.buildRegExp();for(let f of[t,r])for(let u in f){let l=f[u],p=n.paths[u];if(!p){o[u]=[l.map(([m])=>[m,Ae()]),ic];continue}i[p[0]]=l.map(([m,E])=>[m,n.paths[E][1].reduceRight((y,[S],d)=>(y[S]=c[p[1][d][1]],y),Ae())])}return[a,s.map(f=>i[f]),o]}};var wu=class{name="SmartRouter";#e=[];#t=[];constructor(e){this.#e=e.routers}add(e,t,r){if(!this.#t)throw new Error(nc);this.#t.push([e,t,r])}match(e,t){if(!this.#t)throw new Error("Fatal error");let r=this.#e,n=this.#t,o=r.length,i=0,a;for(;i<o;i++){let s=r[i];try{for(let c=0,f=n.length;c<f;c++)s.add(...n[c]);a=s.match(e,t)}catch(c){if(c instanceof oc)continue;throw c}this.match=s.match.bind(s),this.#e=[s],this.#t=void 0;break}if(i===o)throw new Error("Fatal error");return this.name=`SmartRouter + ${this.activeRouter.name}`,a}get activeRouter(){if(this.#t||this.#e.length!==1)throw new Error("No active router has been determined yet.");return this.#e[0]}};var ku=Ae(),V_=0,$T=class ex{#e=[];#t=Ae();#r=[];#i;#o=ku;insert(t,r,n){let o=this,i=wT(r),a=new Set,s=0;for(let c of i){let f=i[++s],u=kT(c,f)||(f===void 0&&c&&c.indexOf("*")===c.length-1?c:null),l=Array.isArray(u),p=l?u[0]:u||c,m=o.#t[p]||=new ex;u&&!m.#i&&(m.#i=u,o.#r.push(m)),o=m,l&&a.add(u[1])}o.#e.push({[t]:{handler:n,possibleKeys:[...a],score:++V_}})}#n(t,r,n,o,i){for(let a=0,s=r.#e.length;a<s;a++){let c=r.#e[a],f=c[n]||c[Ne];if(f){f.params=Ae(),t.push(f);for(let u=0,l=f.possibleKeys.length;u<l;u++){let p=f.possibleKeys[u];f.params[p]=i?.[p]&&!u?i[p]:o[p]??i?.[p]}}}}search(t,r){let n=[];this.#o=ku;let i=[this],a=Uu(r),s=[],c=a.length,f=null;for(let u=0;u<c;u++){let l=a[u],p=u===c-1,m=[];for(let y=0,S=i.length;y<S;y++){let d=i[y],g=d.#t[l];g&&(g.#o=d.#o,p?(g.#t["*"]&&this.#n(n,g.#t["*"],t,d.#o),this.#n(n,g,t,d.#o)):m.push(g));for(let h of d.#r){let x=h.#i,N=d.#o===ku?{}:{...d.#o};if(typeof x=="string"){(x==="*"||l.startsWith(x.slice(0,-1)))&&(this.#n(n,h,t,d.#o),x==="*"&&(h.#o=N,m.push(h)));continue}let[,Ce,_t]=x;if(!(!l&&_t===!0)){if(_t!==!0){if(!f){f=[];let Bt=r[0]==="/"?1:0;for(let ke=0;ke<c;ke++)f[ke]=Bt,Bt+=a[ke].length+1}let Je=r.slice(f[u]),cr=_t.exec(Je);if(cr){N[Ce]=cr[0],this.#n(n,h,t,d.#o,N),cr[0].length===Je.length&&h.#t["*"]&&this.#n(n,h.#t["*"],t,d.#o,N);for(let Bt in h.#t){h.#o=N;let ke=cr[0].match(/\//g)?.length??0;(s[ke]||=[]).push(h);break}continue}}(_t===!0||_t.test(l))&&(N[Ce]=l,p?(this.#n(n,h,t,N,d.#o),h.#t["*"]&&this.#n(n,h.#t["*"],t,N,d.#o)):(h.#o=N,m.push(h)))}}}let E=s.shift();i=E?m.concat(E):m}return n[1]&&n.sort((u,l)=>u.score-l.score),[n.map(({handler:u,params:l})=>[u,l])]}};var _u=class{name="TrieRouter";#e=new $T;add(e,t,r){for(let n of tc(t)||[t])this.#e.insert(e,n,r)}match(e,t){return this.#e.search(e,t)}};var Bu=class extends YT{constructor(e={}){super(e),this.router=e.router??new wu({routers:[new sc,new _u]})}};function tx(e,t,r){return Response.json({message:`Data received for ${e}: ${r}`})}async function rx(e){let t=e!=="dark"&&e!=="light"?"dark":e,r=hp(t);return console.log("Image Path: ",r),I(r)?new Response(Bun.file(r)):(console.log("Replying with SVG field"),new Response(Xc(t),{headers:{"Content-Type":"image/svg+xml"}}))}async function nx(e){let t=e!=="dark"&&e!=="light"?"dark":e;return console.log("SVG field requested"),new Response(Xc(t),{headers:{"Content-Type":"image/svg+xml"}})}async function ox(e,t){let r=zS(e,t);return pr(r)?Response.json({error:r.errors().join(`
|
|
159
|
+
`)}):Response.json(JSON.parse(Oc(r)))}async function ix(){let e=await Ws();return Response.json(JSON.parse(Oc(e)))}async function ax(e){console.log("Saving DB");try{let t=Zu(e,Gl);if(I(t))YS(t);else return Response.json({error:"Failed to unpickle database"})}catch{return Response.json({error:"Crashed while unpickle database"})}return Response.json({success:1})}var sr=new Bu;sr.get("/img/field/:theme",async e=>rx(e.req.param("theme")));sr.get("/img/svg/:theme",async e=>nx(e.req.param("theme")));sr.get("/api/loadpath/:team/:path",async e=>{let{team:t,path:r}=e.req.param();return ox(t,r)});sr.get("/api/savepath/:team/:path/:data",async e=>{let{team:t,path:r,data:n}=e.req.param();return tx(t,r,n)});sr.get("/api/db",async()=>ix());sr.put("/api/putdb",async e=>ax(JSON.stringify(e.req.json())));sr.get("/",Ou({path:"./index.html",onNotFound:(e,t)=>{console.log("/ FNF: ",e)}}));sr.get("/*",Ou({root:Cn(),onNotFound:(e,t)=>{console.log(`File not found: ${e}`)}}));var q_=58888,sx=Number(process.env.PORT)||q_,cx,Fu,fx=new Promise((e,t)=>{cx=e,Fu=t}),Y_=LT({fetch:sr.fetch,port:sx},e=>{console.log(`App running at http://localhost:${e.port}`),cx(`http://localhost:${e.port}`)});Y_.on("error",e=>{e.code==="EADDRINUSE"?Fu(`Port ${sx} already in use`):Fu(e.name+": "+e.message)});I(__dirname)&&Wl(__dirname);var z_=[...cc.default.argv.slice(2),cc.default.cwd()].map(e=>ux.default.resolve(e));Yl(z_);cc.default.chdir(Cn());fx.then(QS).catch(console.error);
|
|
160
|
+
/*! Bundled license information:
|
|
161
|
+
|
|
162
|
+
lodash-es/lodash.js:
|
|
163
|
+
(**
|
|
164
|
+
* @license
|
|
165
|
+
* Lodash (Custom Build) <https://lodash.com/>
|
|
166
|
+
* Build: `lodash modularize exports="es" -o ./`
|
|
167
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
168
|
+
* Released under MIT license <https://lodash.com/license>
|
|
169
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
170
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
171
|
+
*)
|
|
172
|
+
*/
|