@freik/pedroviz 0.2.0 → 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/dist/entry.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env bun
2
- "use strict";var zy=Object.create;var Uu=Object.defineProperty;var Xy=Object.getOwnPropertyDescriptor;var Jy=Object.getOwnPropertyNames;var Qy=Object.getPrototypeOf,Zy=Object.prototype.hasOwnProperty;var _=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var $y=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Jy(t))!Zy.call(e,o)&&o!==r&&Uu(e,o,{get:()=>t[o],enumerable:!(n=Xy(t,o))||n.enumerable});return e};var Mt=(e,t,r)=>(r=e!=null?zy(Qy(e)):{},$y(t||!e||!e.__esModule?Uu(r,"default",{value:e,enumerable:!0}):r,e));var nm=_((KW,rm)=>{var nC=typeof global=="object"&&global&&global.Object===Object&&global;rm.exports=nC});var im=_((WW,om)=>{var oC=nm(),iC=typeof self=="object"&&self&&self.Object===Object&&self,aC=oC||iC||Function("return this")();om.exports=aC});var Ca=_((VW,am)=>{var sC=im(),cC=sC.Symbol;am.exports=cC});var cm=_((qW,sm)=>{function uC(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}sm.exports=uC});var lm=_((YW,um)=>{var lC=Array.isArray;um.exports=lC});var hm=_((zW,dm)=>{var fm=Ca(),pm=Object.prototype,fC=pm.hasOwnProperty,pC=pm.toString,wo=fm?fm.toStringTag:void 0;function dC(e){var t=fC.call(e,wo),r=e[wo];try{e[wo]=void 0;var n=!0}catch{}var o=pC.call(e);return n&&(t?e[wo]=r:delete e[wo]),o}dm.exports=dC});var gm=_((XW,mm)=>{var hC=Object.prototype,mC=hC.toString;function gC(e){return mC.call(e)}mm.exports=gC});var Tm=_((JW,Sm)=>{var Em=Ca(),EC=hm(),yC=gm(),SC="[object Null]",TC="[object Undefined]",ym=Em?Em.toStringTag:void 0;function RC(e){return e==null?e===void 0?TC:SC:ym&&ym in Object(e)?EC(e):yC(e)}Sm.exports=RC});var xm=_((QW,Rm)=>{function xC(e){return e!=null&&typeof e=="object"}Rm.exports=xC});var Lm=_((ZW,Om)=>{var OC=Tm(),LC=xm(),AC="[object Symbol]";function UC(e){return typeof e=="symbol"||LC(e)&&OC(e)==AC}Om.exports=UC});var Im=_(($W,bm)=>{var Am=Ca(),NC=cm(),CC=lm(),bC=Lm(),IC=1/0,Um=Am?Am.prototype:void 0,Nm=Um?Um.toString:void 0;function Cm(e){if(typeof e=="string")return e;if(CC(e))return NC(e,Cm)+"";if(bC(e))return Nm?Nm.call(e):"";var t=e+"";return t=="0"&&1/e==-IC?"-0":t}bm.exports=Cm});var _o=_((eV,Pm)=>{var PC=Im();function vC(e){return e==null?"":PC(e)}Pm.exports=vC});var Mm=_((tV,vm)=>{function MC(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}vm.exports=MC});var wm=_((rV,km)=>{var kC=Mm();function wC(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:kC(e,t,r)}km.exports=wC});var Ac=_((nV,_m)=>{var _C="\\ud800-\\udfff",BC="\\u0300-\\u036f",FC="\\ufe20-\\ufe2f",DC="\\u20d0-\\u20ff",jC=BC+FC+DC,GC="\\ufe0e\\ufe0f",HC="\\u200d",KC=RegExp("["+HC+_C+jC+GC+"]");function WC(e){return KC.test(e)}_m.exports=WC});var Fm=_((oV,Bm)=>{function VC(e){return e.split("")}Bm.exports=VC});var qm=_((iV,Vm)=>{var Dm="\\ud800-\\udfff",qC="\\u0300-\\u036f",YC="\\ufe20-\\ufe2f",zC="\\u20d0-\\u20ff",XC=qC+YC+zC,JC="\\ufe0e\\ufe0f",QC="["+Dm+"]",Uc="["+XC+"]",Nc="\\ud83c[\\udffb-\\udfff]",ZC="(?:"+Uc+"|"+Nc+")",jm="[^"+Dm+"]",Gm="(?:\\ud83c[\\udde6-\\uddff]){2}",Hm="[\\ud800-\\udbff][\\udc00-\\udfff]",$C="\\u200d",Km=ZC+"?",Wm="["+JC+"]?",eb="(?:"+$C+"(?:"+[jm,Gm,Hm].join("|")+")"+Wm+Km+")*",tb=Wm+Km+eb,rb="(?:"+[jm+Uc+"?",Uc,Gm,Hm,QC].join("|")+")",nb=RegExp(Nc+"(?="+Nc+")|"+rb+tb,"g");function ob(e){return e.match(nb)||[]}Vm.exports=ob});var zm=_((aV,Ym)=>{var ib=Fm(),ab=Ac(),sb=qm();function cb(e){return ab(e)?sb(e):ib(e)}Ym.exports=cb});var Jm=_((sV,Xm)=>{var ub=wm(),lb=Ac(),fb=zm(),pb=_o();function db(e){return function(t){t=pb(t);var r=lb(t)?fb(t):void 0,n=r?r[0]:t.charAt(0),o=r?ub(r,1).join(""):t.slice(1);return n[e]()+o}}Xm.exports=db});var Zm=_((cV,Qm)=>{var hb=Jm(),mb=hb("toUpperCase");Qm.exports=mb});var eg=_((uV,$m)=>{var gb=_o(),Eb=Zm();function yb(e){return Eb(gb(e).toLowerCase())}$m.exports=yb});var rg=_((lV,tg)=>{function Sb(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}tg.exports=Sb});var og=_((fV,ng)=>{function Tb(e){return function(t){return e?.[t]}}ng.exports=Tb});var ag=_((pV,ig)=>{var Rb=og(),xb={\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"},Ob=Rb(xb);ig.exports=Ob});var cg=_((dV,sg)=>{var Lb=ag(),Ab=_o(),Ub=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Nb="\\u0300-\\u036f",Cb="\\ufe20-\\ufe2f",bb="\\u20d0-\\u20ff",Ib=Nb+Cb+bb,Pb="["+Ib+"]",vb=RegExp(Pb,"g");function Mb(e){return e=Ab(e),e&&e.replace(Ub,Lb).replace(vb,"")}sg.exports=Mb});var lg=_((hV,ug)=>{var kb=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function wb(e){return e.match(kb)||[]}ug.exports=wb});var pg=_((mV,fg)=>{var _b=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Bb(e){return _b.test(e)}fg.exports=Bb});var Pg=_((gV,Ig)=>{var Eg="\\ud800-\\udfff",Fb="\\u0300-\\u036f",Db="\\ufe20-\\ufe2f",jb="\\u20d0-\\u20ff",Gb=Fb+Db+jb,yg="\\u2700-\\u27bf",Sg="a-z\\xdf-\\xf6\\xf8-\\xff",Hb="\\xac\\xb1\\xd7\\xf7",Kb="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Wb="\\u2000-\\u206f",Vb=" \\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",Tg="A-Z\\xc0-\\xd6\\xd8-\\xde",qb="\\ufe0e\\ufe0f",Rg=Hb+Kb+Wb+Vb,xg="['\u2019]",dg="["+Rg+"]",Yb="["+Gb+"]",Og="\\d+",zb="["+yg+"]",Lg="["+Sg+"]",Ag="[^"+Eg+Rg+Og+yg+Sg+Tg+"]",Xb="\\ud83c[\\udffb-\\udfff]",Jb="(?:"+Yb+"|"+Xb+")",Qb="[^"+Eg+"]",Ug="(?:\\ud83c[\\udde6-\\uddff]){2}",Ng="[\\ud800-\\udbff][\\udc00-\\udfff]",Kn="["+Tg+"]",Zb="\\u200d",hg="(?:"+Lg+"|"+Ag+")",$b="(?:"+Kn+"|"+Ag+")",mg="(?:"+xg+"(?:d|ll|m|re|s|t|ve))?",gg="(?:"+xg+"(?:D|LL|M|RE|S|T|VE))?",Cg=Jb+"?",bg="["+qb+"]?",eI="(?:"+Zb+"(?:"+[Qb,Ug,Ng].join("|")+")"+bg+Cg+")*",tI="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",rI="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",nI=bg+Cg+eI,oI="(?:"+[zb,Ug,Ng].join("|")+")"+nI,iI=RegExp([Kn+"?"+Lg+"+"+mg+"(?="+[dg,Kn,"$"].join("|")+")",$b+"+"+gg+"(?="+[dg,Kn+hg,"$"].join("|")+")",Kn+"?"+hg+"+"+mg,Kn+"+"+gg,rI,tI,Og,oI].join("|"),"g");function aI(e){return e.match(iI)||[]}Ig.exports=aI});var Mg=_((EV,vg)=>{var sI=lg(),cI=pg(),uI=_o(),lI=Pg();function fI(e,t,r){return e=uI(e),t=r?void 0:t,t===void 0?cI(e)?lI(e):sI(e):e.match(t)||[]}vg.exports=fI});var wg=_((yV,kg)=>{var pI=rg(),dI=cg(),hI=Mg(),mI="['\u2019]",gI=RegExp(mI,"g");function EI(e){return function(t){return pI(hI(dI(t).replace(gI,"")),e,"")}}kg.exports=EI});var Bg=_((SV,_g)=>{var yI=eg(),SI=wg(),TI=SI(function(e,t,r){return t=t.toLowerCase(),e+(r?yI(t):t)});_g.exports=TI});var Vy=Mt(require("node:path"),1),$a=Mt(require("node:process"),1);var ns=Symbol.for("freik.typetag");function A(e){return e===void 0}function I(e){return!A(e)}function oo(e){return e===null}function e1(e){return e==null}function t1(e){return!e1(e)}function r1(e,...t){return t.some(r=>r(e))}function ke(...e){return t=>r1(t,...e)}function n1(e,...t){return t.every(r=>r(e))}function st(e){return n1(e,o1,t1)}function o1(e){return typeof e=="object"}function or(e){return Array.isArray(e)}function k(e){return typeof e=="string"}function en(e){return typeof e=="number"&&!isNaN(e-0)}var $7=ke(k,en);function is(e){return typeof e=="boolean"}function i1(e){return e instanceof Date}function a1(e){return typeof e=="bigint"}function rr(e){return typeof e=="function"}function s1(e){return e instanceof RegExp}function Cu(e){return e instanceof Map}function c1(e){return e instanceof Set}function Zo(e,t){if(!or(e))return!1;for(let r of e)if(!t(r))return!1;return!0}function kt(e){return t=>Zo(t,e)}function u1(e,...t){return or(e)&&e.length===t.length&&t.every((r,n)=>r(e[n]))}function l1(...e){return t=>u1(t,...e)}function f1(e,t,r){if(!Cu(e))return!1;for(let[n,o]of e)if(!t(n)||!r(o))return!1;return!0}function $o(e,t){return r=>f1(r,e,t)}function p1(e,t){if(!st(e))return!1;for(let r of[...Object.keys(e),...Object.getOwnPropertySymbols(e)])if(!tt(e,r,t))return!1;return!0}function ei(e){return typeof e=="symbol"}function ne(e,t){return st(e)&&t in e}function ir(e,t,r){return ne(e,t)&&r(e[t])}function as(e,t){return r=>tt(r,e,t)}var tt=ir;function no(e,t){return tt(e,t,k)}function d1(e){return ne(e,Symbol.iterator)}function os(e){return e===null||k(e)||en(e)||is(e)||Zo(e,os)||st(e)&&Zo(Object.keys(e),ke(k,en))&&p1(e,os)}function bu(e,t,r,n){if(!st(t))return!1;let o=Object.keys(r).length,i=Object.keys(t),a=i.length;for(let s of i){if(!ne(t,s))continue;let c=t[s];if(A(c)||t[s]===null){delete t[s],a--;continue}if(tt(n,s,rr)){let u=n[s];if(!u(c))return!1;a--}else if(tt(r,s,rr)){let u=r[s];if(!u(c))return!1;o--,a--}}return o===0&&(a===0||!e)}function h1(e,t={}){return r=>bu(!1,r,e,t)}function oe(e,t={}){return r=>bu(!0,r,e,t)}function m1(e,t,r){if(!st(e))return!1;let n=Object.keys(e),o=n.length;for(let i of n){if(!ne(e,i))continue;let a=e[i];if(!t(i)||!r(a))return!1;o--}return o===0}function Iu(e,t){return r=>m1(r,e,t)}var Pu=Function("try {return this===global;}catch(e){ return false;}"),vu=Function("try {return this===window;}catch(e){ return false;}");function ss(){return typeof globalThis<"u"}function g1(e){return no(e,"@dataType")&&tt(e,"@dataValue",os)}function E1(e,t){return{"@dataType":e,"@dataValue":t}}function y1(e){return[e["@dataType"],e["@dataValue"]]}var cs=Symbol.for("freik.Set"),us=Symbol.for("freik.Map"),ls=Symbol.for("freik.Symbol"),fs=Symbol.for("freik.RegExp"),ps=Symbol.for("freik.Date"),ds=Symbol.for("freik.BigInt");function S1(e){return[...e.entries()]}function T1(e){return Zo(e,l1(I,I))?new Map(e):void 0}function R1(e){return[...e]}function x1(e){return or(e)?new Set(e):void 0}function O1(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 L1(e){return k(e)?Symbol.for(e):void 0}function A1(e){return{source:e.source,flags:e.flags}}function U1(e){if(no(e,"source")&&no(e,"flags"))return new RegExp(e.source,e.flags)}function N1(e){return e.toJSON()}function C1(e){try{return k(e)?new Date(e):void 0}catch{return}}function b1(e){return e.toString()}function I1(e){try{return k(e)?BigInt(e):void 0}catch{return}}var P1=[[Cu,us],[c1,cs],[ei,ls],[s1,fs],[i1,ps],[a1,ds]],v1=new Map([[us,S1],[cs,R1],[ls,O1],[fs,A1],[ps,N1],[ds,b1]]),M1=new Map([[us,T1],[cs,x1],[ls,L1],[fs,U1],[ps,C1],[ds,I1]]),k1;(e=>{e[e.Success=0]="Success",e[e.Already=1]="Already",e[e.Fail=2]="Fail",e[e.DetectionFailure=3]="DetectionFailure"})(k1||={});var re=ns;function rs(e){return ne(e,re)?tt(e,re,h1({to:$o(ke(ei,k),rr),from:$o(ke(ei,k),rr)}))?1:2:(e[re]={to:v1,from:M1},0)}function w1(){return ss()?rs(globalThis):vu()?rs(window):Pu()?rs(global):3}switch(w1()){case 2:throw Error(`Invalid <global>[${String(re)}] object`);case 3:throw Error("Unable to determine environment for pickling");default:break}function _1(){if(ss()&&st(globalThis)&&ne(globalThis,re)&&ne(globalThis[re],"to"))return globalThis[re].to;if(Pu()&&st(global)&&ne(global,re)&&ne(global[re],"to"))return global[re].to;if(vu()&&st(window)&&ne(window,re)&&ne(window[re],"to"))return window[re].to;throw Error("Pickling not registered!")}function Nu(e){return _1().get(e)}function B1(){if(ss()&&st(globalThis)&&ne(globalThis,re)&&ne(globalThis[re],"from"))return globalThis[re].from;if(st(process)&&!ne(process,"browser")&&ne(global,re)&&ne(global[re],"from"))return global[re].from;if(!st(process)&&!ne(process,"browser")&&ne(window,re)&&ne(window[re],"from"))return window[re].from;throw Error("Unpickling not registered!")}function F1(e){return B1().get(e)}function D1(e){if(tt(e,ns,ei)){let t=e[ns],r=Nu(t);if(r)return[t,r];if(tt(e,"toJSON",rr))return[t,n=>tt(n,"toJSON",rr)?n.toJSON():"ERROR"]}for(let[t,r]of P1)if(t(e)){let n=Nu(r);if(n)return[r,n]}}function j1(e){return F1(Symbol.for(e))}function G1(e,t){let r=this[e],n=D1(r);if(n){let[o,i]=n,a=Symbol.keyFor(o);return a?E1(a,i(r)):t}else if(d1(r))return[...r];return t}function H1(e,t){if(g1(t)){let[r,n]=y1(t),o=j1(r);if(o){let i=o(n);if(i!==void 0)return i}}return t}function hs(e){return JSON.stringify(e,G1)}function K1(e){return JSON.parse(e,H1)}function W1(e){return K1(e)}function Mu(e,t){let r=W1(e);return t(r)?r:void 0}var nr=oe({errors:rr,[Symbol.toPrimitive]:rr});function io(e,t){let r=[];return r.push(...k(e)?[e]:nr(e)?e.errors():e),I(t)&&r.push(...k(t)?[t]:nr(t)?t.errors():t),{errors:()=>r,[Symbol.toPrimitive]:n=>n==="string"?r.join(`
3
- `):null}}var ft=Mt(require("node:fs"),1),Ge=Mt(require("node:path"),1);var ao=Symbol.for("freik.typetag");function Fu(e){return e===void 0}function ku(e){return!Fu(e)}function ri(e){return e==null}function ni(e){return!ri(e)}function V1(e,...t){return t.some(r=>r(e))}function gs(...e){return t=>V1(t,...e)}function q1(e,...t){return t.every(r=>r(e))}function ar(e){return q1(e,Y1,ni)}function Y1(e){return typeof e=="object"}function Es(e){return Array.isArray(e)}function sr(e){return typeof e=="string"}function z1(e){return typeof e=="number"&&!isNaN(e-0)}var tP=gs(sr,z1);function so(e){return typeof e=="function"}function X1(e){return e instanceof Map}function oi(e,t){if(!Es(e))return!1;for(let r of e)if(!t(r))return!1;return!0}function Du(e){return t=>oi(t,e)}function J1(e,...t){return Es(e)&&e.length===t.length&&t.every((r,n)=>r(e[n]))}function ys(...e){return t=>J1(t,...e)}function Q1(e,t,r){if(!X1(e))return!1;for(let[n,o]of e)if(!t(n)||!r(o))return!1;return!0}function wu(e,t){return r=>Q1(r,e,t)}function _u(e){return typeof e=="symbol"}function Ee(e,t){return ar(e)&&t in e}function Z1(e,t,r){return Ee(e,t)&&r(e[t])}var ti=Z1;function Bu(e,t){return ti(e,t,sr)}function ju(e,t){return Ee(e,ao)&&e[ao]===t}function $1(e,t,r,n){if(!ar(t))return!1;let o=Object.keys(r).length,i=Object.keys(t),a=i.length;for(let s of i){if(!Ee(t,s))continue;let c=t[s];if(Fu(c)||t[s]===null){delete t[s],a--;continue}if(ti(n,s,so)){let u=n[s];if(!u(c))return!1;a--}else if(ti(r,s,so)){let u=r[s];if(!u(c))return!1;o--,a--}}return o===0&&(a===0||!e)}function eS(e,t={}){return r=>$1(!1,r,e,t)}var Gu=Function("try {return this===global;}catch(e){ return false;}"),Hu=Function("try {return this===window;}catch(e){ return false;}");function Ss(){return typeof globalThis<"u"}var Ku=Symbol.for("freik.Set"),Wu=Symbol.for("freik.Map"),Vu=Symbol.for("freik.Symbol"),qu=Symbol.for("freik.RegExp"),Yu=Symbol.for("freik.Date"),zu=Symbol.for("freik.BigInt");function tS(e){return[...e.entries()]}function rS(e){return oi(e,ys(ku,ku))?new Map(e):void 0}function nS(e){return[...e]}function oS(e){return Es(e)?new Set(e):void 0}function iS(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 aS(e){return sr(e)?Symbol.for(e):void 0}function sS(e){return{source:e.source,flags:e.flags}}function cS(e){if(Bu(e,"source")&&Bu(e,"flags"))return new RegExp(e.source,e.flags)}function uS(e){return e.toJSON()}function lS(e){try{return sr(e)?new Date(e):void 0}catch{return}}function fS(e){return e.toString()}function pS(e){try{return sr(e)?BigInt(e):void 0}catch{return}}var dS=new Map([[Wu,tS],[Ku,nS],[Vu,iS],[qu,sS],[Yu,uS],[zu,fS]]),hS=new Map([[Wu,rS],[Ku,oS],[Vu,aS],[qu,cS],[Yu,lS],[zu,pS]]),mS;(e=>{e[e.Success=0]="Success",e[e.Already=1]="Already",e[e.Fail=2]="Fail",e[e.DetectionFailure=3]="DetectionFailure"})(mS||={});var ie=ao;function ms(e){return Ee(e,ie)?ti(e,ie,eS({to:wu(gs(_u,sr),so),from:wu(gs(_u,sr),so)}))?1:2:(e[ie]={to:dS,from:hS},0)}function gS(){return Ss()?ms(globalThis):Hu()?ms(window):Gu()?ms(global):3}switch(gS()){case 2:throw Error(`Invalid <global>[${String(ie)}] object`);case 3:throw Error("Unable to determine environment for pickling");default:break}function ES(){if(Ss()&&ar(globalThis)&&Ee(globalThis,ie)&&Ee(globalThis[ie],"to"))return globalThis[ie].to;if(Gu()&&ar(global)&&Ee(global,ie)&&Ee(global[ie],"to"))return global[ie].to;if(Hu()&&ar(window)&&Ee(window,ie)&&Ee(window[ie],"to"))return window[ie].to;throw Error("Pickling not registered!")}function yS(e,t){ES().set(e,t)}function SS(){if(Ss()&&ar(globalThis)&&Ee(globalThis,ie)&&Ee(globalThis[ie],"from"))return globalThis[ie].from;if(ar(process)&&!Ee(process,"browser")&&Ee(global,ie)&&Ee(global[ie],"from"))return global[ie].from;if(!ar(process)&&!Ee(process,"browser")&&Ee(window,ie)&&Ee(window[ie],"from"))return window[ie].from;throw Error("Unpickling not registered!")}function TS(e,t){SS().set(e,t)}function Xu(e,t,r){r&&yS(e,r),TS(e,t)}var RS=Symbol.for("freik.typetag");function el(e){return e===void 0}function Ju(e){return!el(e)}function xS(e){return e==null}function OS(e){return!xS(e)}function LS(e,...t){return t.some(r=>r(e))}function Rs(...e){return t=>LS(t,...e)}function AS(e,...t){return t.every(r=>r(e))}function xs(e){return AS(e,US,OS)}function US(e){return typeof e=="object"}function ci(e){return Array.isArray(e)}function cr(e){return typeof e=="string"}function tl(e){return typeof e=="number"&&!isNaN(e-0)}var nP=Rs(cr,tl);function ai(e){return typeof e=="function"}function rl(e){return e instanceof Map}function NS(e,t){if(!ci(e))return!1;for(let r of e)if(!t(r))return!1;return!0}function CS(e,...t){return ci(e)&&e.length===t.length&&t.every((r,n)=>r(e[n]))}function bS(...e){return t=>CS(t,...e)}function IS(e,t,r){if(!rl(e))return!1;for(let[n,o]of e)if(!t(n)||!r(o))return!1;return!0}function Qu(e,t){return r=>IS(r,e,t)}function Zu(e){return typeof e=="symbol"}function Os(e,t){return xs(e)&&t in e}function PS(e,t,r){return Os(e,t)&&r(e[t])}var si=PS;function $u(e,t){return si(e,t,cr)}function vS(e,t,r,n){if(!xs(t))return!1;let o=Object.keys(r).length,i=Object.keys(t),a=i.length;for(let s of i){if(!Os(t,s))continue;let c=t[s];if(el(c)||t[s]===null){delete t[s],a--;continue}if(si(n,s,ai)){let u=n[s];if(!u(c))return!1;a--}else if(si(r,s,ai)){let u=r[s];if(!u(c))return!1;o--,a--}}return o===0&&(a===0||!e)}function MS(e,t={}){return r=>vS(!1,r,e,t)}var kS=Function("try {return this===global;}catch(e){ return false;}"),wS=Function("try {return this===window;}catch(e){ return false;}");function _S(){return typeof globalThis<"u"}var nl=Symbol.for("freik.Set"),ol=Symbol.for("freik.Map"),il=Symbol.for("freik.Symbol"),al=Symbol.for("freik.RegExp"),sl=Symbol.for("freik.Date"),cl=Symbol.for("freik.BigInt");function BS(e){return[...e.entries()]}function FS(e){return NS(e,bS(Ju,Ju))?new Map(e):void 0}function DS(e){return[...e]}function jS(e){return ci(e)?new Set(e):void 0}function GS(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 HS(e){return cr(e)?Symbol.for(e):void 0}function KS(e){return{source:e.source,flags:e.flags}}function WS(e){if($u(e,"source")&&$u(e,"flags"))return new RegExp(e.source,e.flags)}function VS(e){return e.toJSON()}function qS(e){try{return cr(e)?new Date(e):void 0}catch{return}}function YS(e){return e.toString()}function zS(e){try{return cr(e)?BigInt(e):void 0}catch{return}}var XS=new Map([[ol,BS],[nl,DS],[il,GS],[al,KS],[sl,VS],[cl,YS]]),JS=new Map([[ol,FS],[nl,jS],[il,HS],[al,WS],[sl,qS],[cl,zS]]),QS;(e=>{e[e.Success=0]="Success",e[e.Already=1]="Already",e[e.Fail=2]="Fail",e[e.DetectionFailure=3]="DetectionFailure"})(QS||={});var ii=RS;function Ts(e){return Os(e,ii)?si(e,ii,MS({to:Qu(Rs(Zu,cr),ai),from:Qu(Rs(Zu,cr),ai)}))?1:2:(e[ii]={to:XS,from:JS},0)}function ZS(){return _S()?Ts(globalThis):wS()?Ts(window):kS()?Ts(global):3}switch(ZS()){case 2:throw Error(`Invalid <global>[${String(ii)}] object`);case 3:throw Error("Unable to determine environment for pickling");default:break}function ui(e,t){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}var Ls=Symbol.for("freik.MultiMapTypeTag");function wt(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 m=c(d);if(m!==void 0){let x=m.delete(g);return m.size===0&&t.delete(d),x}return!1},i=()=>t.keys(),a=(d,g)=>t.forEach((m,x)=>d(m,x,S),g),s=async(d,g)=>{for(let[m,x]of t)g?await d.apply(g,[x,m,S]):await d(x,m,S)},c=d=>t.get(d),u=d=>t.has(d);function l(d,g){let m=t.get(d);return m===void 0?t.set(d,new Set([g])):m.add(g),S}function f(d,g){let m=t.get(d);if(m===void 0)t.set(d,new Set(g));else for(let x of g)m.add(x);return S}function*p(){for(let[d,g]of t)yield[d,g.values()]}let h=()=>t.size;function E(d){if(h()!==d.size())return!1;for(let[g,m]of t){let x=d.get(g);if(!x||!ui(new Set(m),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:u,set:l,add:f,size:h,[Symbol.iterator]:p,[ao]:Ls,toJSON:y,valueEqual:E};return S}function $S(e){if(oi(e,ys(ni,Du(ni))))return wt(e)}Xu(Ls,$S);function eT(e){return ju(e,Ls)}function tT(e,t,r){if(!eT(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 As(e,t){return r=>tT(r,e,t)}var tn=Object.freeze({Line:"line",Curve:"curve"}),he=Object.freeze({Reversed:"reversed",Tangent:"tangent",Constant:"constant",Linear:"linear",Point:"point",Piecewise:"piecewise"});var Us={name:"",fullName:"",imports:[],container:{fileName:""},children:{},values:[],poses:[],beziers:[],pathChains:[],pathChainHelpers:[]},ul=k,rT=k,nT=oe({int:en}),oT=oe({double:en}),Ns=ke(nT,oT),Br=ke(rT,Ns),fi=oe({radians:Br}),iT=oe({name:k,value:ke(Br,fi)}),li=ke(Br,fi),aT=k,ll=oe({x:Br,y:Br},{heading:li}),sT=oe({name:k,pose:ll}),fl=ke(aT,ll);function cT(e){return e===tn.Line||e===tn.Curve}var uT=k,pl=oe({type:cT,points:kt(fl)}),lT=oe({name:k,points:pl}),fT=ke(uT,pl);function pT(e){return e===he.Tangent}function dT(e){return e===he.Constant}function hT(e){return e===he.Linear}function mT(e){return e===he.Point}function gT(e){return e===he.Reversed}function ET(e){return e===he.Piecewise}var dl=oe({type:pT}),hl=oe({type:dT,heading:li}),ml=oe({type:hT,start:li,end:li}),gl=oe({type:mT,point:fl}),El=ke(dl,hl,ml,gl),yT=oe({start:Br,end:Br}),yl=oe({type:gT,facing:El}),ST=ke(El,yl),TT=oe({timing:yT,heading:ST}),RT=oe({type:ET,pieces:kt(TT)}),xT=e=>ke(dl,hl,ml,gl,RT,yl)(e),OT=oe({name:k,paths:kt(fT),heading:xT}),LT=oe({name:k,staticType:k}),AT=ke(as("fileName",k),as("className",k));function Cs(e){let t=no(e,"name");return t=t&&ir(e,"container",AT),t=t&&ir(e,"values",kt(iT)),t=t&&ir(e,"poses",kt(sT)),t=t&&ir(e,"beziers",kt(lT)),t=t&&ir(e,"pathChains",kt(OT)),t=t&&ir(e,"pathChainHelpers",kt(LT)),t=t&&tt(e,"children",Iu(k,Cs)),t}function rn(e,t){return`${e}*${t}`}function Tl(e){return e.split("*").pop()||""}function bs(e){return k(e)?e.split("*").length===2:!1}function Is(e,t){return`${e};${t}`}function Rl(e){return e.split(";").pop()||""}function Sl(e){if(!k(e))return!1;let t=e.split(";");return t.length===2&&bs(t[0])}var xl=oe({HasFieldImage:is,TeamPaths:As(k,bs),PathClasses:As(bs,Sl),ParsedClasses:$o(Sl,Cs)}),ov=Object.freeze({HasFieldImage:!1,TeamPaths:wt(),PathClasses:wt(),ParsedClasses:new Map});var Ol=Mt(require("node:path"),1),Ll=Mt(require("node:url"),1);var nn={},co=I(__dirname)?__dirname:Ol.default.dirname(Ll.default.fileURLToPath(nn.url));function Al(e){co=e}function on(){return co}console.log("global_dirname:",co);var sv=UT();function UT(){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:",co),process.env.NODE_ENV==="production"||co.endsWith("/dist")}var Ul=require("node:fs");async function Ps(e){try{return(await Ul.promises.stat(e)).isDirectory()}catch{return!1}}var _t=null,Nl=[];function Cl(e){Nl=e}async function NT(e){return await bT(e)?(_t=e,!0):!1}function vs(){if(oo(_t))throw new Error("Unable to find FtcRobotController/TeamCode home");return _t}async function CT(e,t=8){let r="",n=k(e)?[e]:e;for(let o of n){let i=t;for(;o!=r&&i>0;){if(await NT(o))return console.log("Found directory",o),o;r=o,o=Ge.default.dirname(o),i--}}return console.error("Unable to find any potential repositories:",e),null}async function bT(e){return await ft.promises.exists(Ge.default.join(e,"settings.gradle"))&&await ft.promises.exists(Ge.default.join(e,"build.gradle"))&&await ft.promises.exists(Ge.default.join(e,"FtcRobotController"))&&await Ps(Ge.default.join(e,"FtcRobotController"))}async function bl(){if(oo(_t)&&await CT([...Nl,process.cwd(),on()]),oo(_t))throw new Error("Unable to find repository root");let e=await kT(),t=wt();for(let r of e){let o=(await PT(_t,r)).map(i=>rn(r,i));t.add(r,o)}return t}var IT=/[^\/\\]*(Path|Pose)[^\/\\]*\.java$/;async function PT(e,t){let r=Ge.default.join(e,t,Ms,t.toLocaleLowerCase()),n=[],o=[r];for(;o.length>0;){let i=o.pop(),a=await ft.promises.readdir(i,{withFileTypes:!0});for(let s of a){let c=Ge.default.join(i,s.name);s.isDirectory()?o.push(c):await MT(s)&&n.push(Ge.default.relative(r,c))}}return n}var vT=[/^\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 MT(e){return!e.isFile()||!IT.test(e.name)?!1:(await ft.promises.readFile(Ge.default.join(e.parentPath,e.name),"utf-8")).split(`
4
- `).filter(n=>{for(let o of vT)if(o.test(n.trim()))return!0;return!1}).length!==0}async function kT(){if(oo(_t))throw new Error("Unknonw repository location");return(await ft.promises.readdir(_t,{withFileTypes:!0})).filter(r=>wT(_t,r)).map(r=>r.name)}function wT(e,t){if(!t.isDirectory())return!1;let r=t.name;if(r[0]==="."||r==="FtcRobotController")return!1;let n=Ge.default.join(e,t.name,"build.gradle");if(!ft.default.existsSync(n))return!1;let o=Ge.default.join(e,t.name,Ms,t.name.toLocaleLowerCase());return!(!ft.default.existsSync(o)||!Ps(o))}function Il(e,t){return Ge.default.join(vs(),e,Ms,e.toLocaleLowerCase(),t)}var Ms=Ge.default.join("src","main","java","org","firstinspires","ftc");var _s=Symbol.for("freik.typetag");function wl(e){return e===void 0}function Pl(e){return!wl(e)}function di(e){return e==null}function hi(e){return!di(e)}function _T(e,...t){return t.some(r=>r(e))}function ws(...e){return t=>_T(t,...e)}function BT(e,...t){return t.every(r=>r(e))}function ur(e){return BT(e,FT,hi)}function FT(e){return typeof e=="object"}function Bs(e){return Array.isArray(e)}function lr(e){return typeof e=="string"}function DT(e){return typeof e=="number"&&!isNaN(e-0)}var gv=ws(lr,DT);function uo(e){return typeof e=="function"}function jT(e){return e instanceof Map}function mi(e,t){if(!Bs(e))return!1;for(let r of e)if(!t(r))return!1;return!0}function _l(e){return t=>mi(t,e)}function GT(e,...t){return Bs(e)&&e.length===t.length&&t.every((r,n)=>r(e[n]))}function Fs(...e){return t=>GT(t,...e)}function HT(e,t,r){if(!jT(e))return!1;for(let[n,o]of e)if(!t(n)||!r(o))return!1;return!0}function vl(e,t){return r=>HT(r,e,t)}function Ml(e){return typeof e=="symbol"}function Le(e,t){return ur(e)&&t in e}function KT(e,t,r){return Le(e,t)&&r(e[t])}var pi=KT;function kl(e,t){return pi(e,t,lr)}function WT(e,t,r,n){if(!ur(t))return!1;let o=Object.keys(r).length,i=Object.keys(t),a=i.length;for(let s of i){if(!Le(t,s))continue;let c=t[s];if(wl(c)||t[s]===null){delete t[s],a--;continue}if(pi(n,s,uo)){let u=n[s];if(!u(c))return!1;a--}else if(pi(r,s,uo)){let u=r[s];if(!u(c))return!1;o--,a--}}return o===0&&(a===0||!e)}function VT(e,t={}){return r=>WT(!1,r,e,t)}var Bl=Function("try {return this===global;}catch(e){ return false;}"),Fl=Function("try {return this===window;}catch(e){ return false;}");function Ds(){return typeof globalThis<"u"}var Dl=Symbol.for("freik.Set"),jl=Symbol.for("freik.Map"),Gl=Symbol.for("freik.Symbol"),Hl=Symbol.for("freik.RegExp"),Kl=Symbol.for("freik.Date"),Wl=Symbol.for("freik.BigInt");function qT(e){return[...e.entries()]}function YT(e){return mi(e,Fs(Pl,Pl))?new Map(e):void 0}function zT(e){return[...e]}function XT(e){return Bs(e)?new Set(e):void 0}function JT(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 QT(e){return lr(e)?Symbol.for(e):void 0}function ZT(e){return{source:e.source,flags:e.flags}}function $T(e){if(kl(e,"source")&&kl(e,"flags"))return new RegExp(e.source,e.flags)}function eR(e){return e.toJSON()}function tR(e){try{return lr(e)?new Date(e):void 0}catch{return}}function rR(e){return e.toString()}function nR(e){try{return lr(e)?BigInt(e):void 0}catch{return}}var oR=new Map([[jl,qT],[Dl,zT],[Gl,JT],[Hl,ZT],[Kl,eR],[Wl,rR]]),iR=new Map([[jl,YT],[Dl,XT],[Gl,QT],[Hl,$T],[Kl,tR],[Wl,nR]]),aR;(e=>{e[e.Success=0]="Success",e[e.Already=1]="Already",e[e.Fail=2]="Fail",e[e.DetectionFailure=3]="DetectionFailure"})(aR||={});var ae=_s;function ks(e){return Le(e,ae)?pi(e,ae,VT({to:vl(ws(Ml,lr),uo),from:vl(ws(Ml,lr),uo)}))?1:2:(e[ae]={to:oR,from:iR},0)}function sR(){return Ds()?ks(globalThis):Fl()?ks(window):Bl()?ks(global):3}switch(sR()){case 2:throw Error(`Invalid <global>[${String(ae)}] object`);case 3:throw Error("Unable to determine environment for pickling");default:break}function cR(){if(Ds()&&ur(globalThis)&&Le(globalThis,ae)&&Le(globalThis[ae],"to"))return globalThis[ae].to;if(Bl()&&ur(global)&&Le(global,ae)&&Le(global[ae],"to"))return global[ae].to;if(Fl()&&ur(window)&&Le(window,ae)&&Le(window[ae],"to"))return window[ae].to;throw Error("Pickling not registered!")}function uR(e,t){cR().set(e,t)}function lR(){if(Ds()&&ur(globalThis)&&Le(globalThis,ae)&&Le(globalThis[ae],"from"))return globalThis[ae].from;if(ur(process)&&!Le(process,"browser")&&Le(global,ae)&&Le(global[ae],"from"))return global[ae].from;if(!ur(process)&&!Le(process,"browser")&&Le(window,ae)&&Le(window[ae],"from"))return window[ae].from;throw Error("Unpickling not registered!")}function fR(e,t){lR().set(e,t)}function Vl(e,t,r){r&&uR(e,r),fR(e,t)}var ql=Symbol.for("freik.MultiMapTypeTag");function pR(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 m=c(d);if(m!==void 0){let x=m.delete(g);return m.size===0&&t.delete(d),x}return!1},i=()=>t.keys(),a=(d,g)=>t.forEach((m,x)=>d(m,x,S),g),s=async(d,g)=>{for(let[m,x]of t)g?await d.apply(g,[x,m,S]):await d(x,m,S)},c=d=>t.get(d),u=d=>t.has(d);function l(d,g){let m=t.get(d);return m===void 0?t.set(d,new Set([g])):m.add(g),S}function f(d,g){let m=t.get(d);if(m===void 0)t.set(d,new Set(g));else for(let x of g)m.add(x);return S}function*p(){for(let[d,g]of t)yield[d,g.values()]}let h=()=>t.size;function E(d){if(h()!==d.size())return!1;for(let[g,m]of t){let x=d.get(g);if(!x||!ui(new Set(m),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:u,set:l,add:f,size:h,[Symbol.iterator]:p,[_s]:ql,toJSON:y,valueEqual:E};return S}function dR(e){if(mi(e,Fs(hi,_l(hi))))return pR(e)}Vl(ql,dR);function Yl(e){return new Promise(t=>setTimeout(t,Math.max(0,e)))}var zl=require("node:fs"),an=Mt(require("node:path"),1);var pt=new Map;async function Xl(){pt.clear();let e=vs(),t=await zl.promises.readdir(e,{withFileTypes:!0});for(let r of t){let n=an.extname(r.name).toLocaleLowerCase();if(n===".png"||n===".jpg"||n===".jpeg"){let o=an.basename(r.name.toLocaleLowerCase(),n);(o==="field"||o==="field-light"||o==="field-dark")&&pt.set(o+n,an.join(e,r.name))}}return pt.size>0}function hR(){return pt.size!==0}function Jl(e){if(hR())return pt.get(`field-${e}.png`)||pt.get(`field-${e}.jpg`)||pt.get(`field-${e}.jpeg`)||pt.get("field.png")||pt.get("field.jpg")||pt.get("field.jpeg")}var mR="#ccc",gR="#333",ER=`<svg viewBox="5 5 1130 1130" version="1.1" xmlns="http://www.w3.org/2000/svg">
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
5
  <!--
6
6
  Copyright (C) 2026 Kevin Frei
7
7
  Licensed under the GNU Affero General Public License v3.0 or later.
@@ -37,126 +37,126 @@ See https://www.gnu.org/licenses/agpl-3.0.html
37
37
  <use href="#row" y="942.5"/>
38
38
  <use href="#row" y="1131"/>
39
39
  </g>
40
- </svg>`;function js(e){return ER.replace("%%%FG%%%",e==="light"?gR:mR)}var gE=require("node:fs");var yR=typeof global=="object"&&global&&global.Object===Object&&global,gi=yR;var SR=typeof self=="object"&&self&&self.Object===Object&&self,TR=gi||SR||Function("return this")(),fe=TR;var RR=fe.Symbol,ye=RR;var Ql=Object.prototype,xR=Ql.hasOwnProperty,OR=Ql.toString,lo=ye?ye.toStringTag:void 0;function LR(e){var t=xR.call(e,lo),r=e[lo];try{e[lo]=void 0;var n=!0}catch{}var o=OR.call(e);return n&&(t?e[lo]=r:delete e[lo]),o}var Zl=LR;var AR=Object.prototype,UR=AR.toString;function NR(e){return UR.call(e)}var $l=NR;var CR="[object Null]",bR="[object Undefined]",ef=ye?ye.toStringTag:void 0;function IR(e){return e==null?e===void 0?bR:CR:ef&&ef in Object(e)?Zl(e):$l(e)}var we=IR;function PR(e){return e!=null&&typeof e=="object"}var ce=PR;var vR="[object Symbol]";function MR(e){return typeof e=="symbol"||ce(e)&&we(e)==vR}var dt=MR;function kR(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 ht=kR;var wR=Array.isArray,N=wR;var _R=1/0,tf=ye?ye.prototype:void 0,rf=tf?tf.toString:void 0;function nf(e){if(typeof e=="string")return e;if(N(e))return ht(e,nf)+"";if(dt(e))return rf?rf.call(e):"";var t=e+"";return t=="0"&&1/e==-_R?"-0":t}var of=nf;var BR=/\s/;function FR(e){for(var t=e.length;t--&&BR.test(e.charAt(t)););return t}var af=FR;var DR=/^\s+/;function jR(e){return e&&e.slice(0,af(e)+1).replace(DR,"")}var sf=jR;function GR(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var $=GR;var cf=NaN,HR=/^[-+]0x[0-9a-f]+$/i,KR=/^0b[01]+$/i,WR=/^0o[0-7]+$/i,VR=parseInt;function qR(e){if(typeof e=="number")return e;if(dt(e))return cf;if($(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=$(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=sf(e);var r=KR.test(e);return r||WR.test(e)?VR(e.slice(2),r?2:8):HR.test(e)?cf:+e}var uf=qR;var lf=1/0,YR=17976931348623157e292;function zR(e){if(!e)return e===0?e:0;if(e=uf(e),e===lf||e===-lf){var t=e<0?-1:1;return t*YR}return e===e?e:0}var ff=zR;function XR(e){var t=ff(e),r=t%1;return t===t?r?t-r:t:0}var mt=XR;function JR(e){return e}var He=JR;var QR="[object AsyncFunction]",ZR="[object Function]",$R="[object GeneratorFunction]",ex="[object Proxy]";function tx(e){if(!$(e))return!1;var t=we(e);return t==ZR||t==$R||t==QR||t==ex}var _e=tx;var rx=fe["__core-js_shared__"],Ei=rx;var pf=(function(){var e=/[^.]+$/.exec(Ei&&Ei.keys&&Ei.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function nx(e){return!!pf&&pf in e}var df=nx;var ox=Function.prototype,ix=ox.toString;function ax(e){if(e!=null){try{return ix.call(e)}catch{}try{return e+""}catch{}}return""}var Bt=ax;var sx=/[\\^$.*+?()[\]{}|]/g,cx=/^\[object .+?Constructor\]$/,ux=Function.prototype,lx=Object.prototype,fx=ux.toString,px=lx.hasOwnProperty,dx=RegExp("^"+fx.call(px).replace(sx,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function hx(e){if(!$(e)||df(e))return!1;var t=_e(e)?dx:cx;return t.test(Bt(e))}var hf=hx;function mx(e,t){return e?.[t]}var mf=mx;function gx(e,t){var r=mf(e,t);return hf(r)?r:void 0}var Ke=gx;var Ex=Ke(fe,"WeakMap"),yi=Ex;var gf=Object.create,yx=(function(){function e(){}return function(t){if(!$(t))return{};if(gf)return gf(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})(),Ef=yx;function Sx(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 yf=Sx;function Tx(){}var ee=Tx;function Rx(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var Sf=Rx;var xx=800,Ox=16,Lx=Date.now;function Ax(e){var t=0,r=0;return function(){var n=Lx(),o=Ox-(n-r);if(r=n,o>0){if(++t>=xx)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Tf=Ax;function Ux(e){return function(){return e}}var Rf=Ux;var Nx=(function(){try{var e=Ke(Object,"defineProperty");return e({},"",{}),e}catch{}})(),sn=Nx;var Cx=sn?function(e,t){return sn(e,"toString",{configurable:!0,enumerable:!1,value:Rf(t),writable:!0})}:He,xf=Cx;var bx=Tf(xf),Of=bx;function Ix(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var Si=Ix;function Px(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 Ti=Px;function vx(e){return e!==e}var Lf=vx;function Mx(e,t,r){for(var n=r-1,o=e.length;++n<o;)if(e[n]===t)return n;return-1}var Af=Mx;function kx(e,t,r){return t===t?Af(e,t,r):Ti(e,Lf,r)}var cn=kx;function wx(e,t){var r=e==null?0:e.length;return!!r&&cn(e,t,0)>-1}var Ri=wx;var _x=9007199254740991,Bx=/^(?:0|[1-9]\d*)$/;function Fx(e,t){var r=typeof e;return t=t??_x,!!t&&(r=="number"||r!="symbol"&&Bx.test(e))&&e>-1&&e%1==0&&e<t}var fr=Fx;function Dx(e,t,r){t=="__proto__"&&sn?sn(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var un=Dx;function jx(e,t){return e===t||e!==e&&t!==t}var gt=jx;var Gx=Object.prototype,Hx=Gx.hasOwnProperty;function Kx(e,t,r){var n=e[t];(!(Hx.call(e,t)&&gt(n,r))||r===void 0&&!(t in e))&&un(e,t,r)}var pr=Kx;function Wx(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?un(r,s,c):pr(r,s,c)}return r}var Et=Wx;var Uf=Math.max;function Vx(e,t,r){return t=Uf(t===void 0?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=Uf(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),yf(e,this,s)}}var Nf=Vx;function qx(e,t){return Of(Nf(e,t,He),e+"")}var ln=qx;var Yx=9007199254740991;function zx(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Yx}var fn=zx;function Xx(e){return e!=null&&fn(e.length)&&!_e(e)}var pe=Xx;function Jx(e,t,r){if(!$(r))return!1;var n=typeof t;return(n=="number"?pe(r)&&fr(t,r.length):n=="string"&&t in r)?gt(r[t],e):!1}var dr=Jx;function Qx(e){return ln(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&&dr(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 Cf=Qx;var Zx=Object.prototype;function $x(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Zx;return e===r}var yt=$x;function eO(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var bf=eO;var tO="[object Arguments]";function rO(e){return ce(e)&&we(e)==tO}var Gs=rO;var If=Object.prototype,nO=If.hasOwnProperty,oO=If.propertyIsEnumerable,iO=Gs((function(){return arguments})())?Gs:function(e){return ce(e)&&nO.call(e,"callee")&&!oO.call(e,"callee")},hr=iO;function aO(){return!1}var Pf=aO;var kf=typeof exports=="object"&&exports&&!exports.nodeType&&exports,vf=kf&&typeof module=="object"&&module&&!module.nodeType&&module,sO=vf&&vf.exports===kf,Mf=sO?fe.Buffer:void 0,cO=Mf?Mf.isBuffer:void 0,uO=cO||Pf,Ft=uO;var lO="[object Arguments]",fO="[object Array]",pO="[object Boolean]",dO="[object Date]",hO="[object Error]",mO="[object Function]",gO="[object Map]",EO="[object Number]",yO="[object Object]",SO="[object RegExp]",TO="[object Set]",RO="[object String]",xO="[object WeakMap]",OO="[object ArrayBuffer]",LO="[object DataView]",AO="[object Float32Array]",UO="[object Float64Array]",NO="[object Int8Array]",CO="[object Int16Array]",bO="[object Int32Array]",IO="[object Uint8Array]",PO="[object Uint8ClampedArray]",vO="[object Uint16Array]",MO="[object Uint32Array]",X={};X[AO]=X[UO]=X[NO]=X[CO]=X[bO]=X[IO]=X[PO]=X[vO]=X[MO]=!0;X[lO]=X[fO]=X[OO]=X[pO]=X[LO]=X[dO]=X[hO]=X[mO]=X[gO]=X[EO]=X[yO]=X[SO]=X[TO]=X[RO]=X[xO]=!1;function kO(e){return ce(e)&&fn(e.length)&&!!X[we(e)]}var wf=kO;function wO(e){return function(t){return e(t)}}var St=wO;var _f=typeof exports=="object"&&exports&&!exports.nodeType&&exports,fo=_f&&typeof module=="object"&&module&&!module.nodeType&&module,_O=fo&&fo.exports===_f,Hs=_O&&gi.process,BO=(function(){try{var e=fo&&fo.require&&fo.require("util").types;return e||Hs&&Hs.binding&&Hs.binding("util")}catch{}})(),rt=BO;var Bf=rt&&rt.isTypedArray,FO=Bf?St(Bf):wf,pn=FO;var DO=Object.prototype,jO=DO.hasOwnProperty;function GO(e,t){var r=N(e),n=!r&&hr(e),o=!r&&!n&&Ft(e),i=!r&&!n&&!o&&pn(e),a=r||n||o||i,s=a?bf(e.length,String):[],c=s.length;for(var u in e)(t||jO.call(e,u))&&!(a&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||fr(u,c)))&&s.push(u);return s}var xi=GO;function HO(e,t){return function(r){return e(t(r))}}var Oi=HO;var KO=Oi(Object.keys,Object),Ff=KO;var WO=Object.prototype,VO=WO.hasOwnProperty;function qO(e){if(!yt(e))return Ff(e);var t=[];for(var r in Object(e))VO.call(e,r)&&r!="constructor"&&t.push(r);return t}var Li=qO;function YO(e){return pe(e)?xi(e):Li(e)}var K=YO;var zO=Object.prototype,XO=zO.hasOwnProperty,JO=Cf(function(e,t){if(yt(t)||pe(t)){Et(t,K(t),e);return}for(var r in t)XO.call(t,r)&&pr(e,r,t[r])}),Ae=JO;function QO(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var Df=QO;var ZO=Object.prototype,$O=ZO.hasOwnProperty;function eL(e){if(!$(e))return Df(e);var t=yt(e),r=[];for(var n in e)n=="constructor"&&(t||!$O.call(e,n))||r.push(n);return r}var jf=eL;function tL(e){return pe(e)?xi(e,!0):jf(e)}var mr=tL;var rL=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nL=/^\w*$/;function oL(e,t){if(N(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||dt(e)?!0:nL.test(e)||!rL.test(e)||t!=null&&e in Object(t)}var dn=oL;var iL=Ke(Object,"create"),Dt=iL;function aL(){this.__data__=Dt?Dt(null):{},this.size=0}var Gf=aL;function sL(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Hf=sL;var cL="__lodash_hash_undefined__",uL=Object.prototype,lL=uL.hasOwnProperty;function fL(e){var t=this.__data__;if(Dt){var r=t[e];return r===cL?void 0:r}return lL.call(t,e)?t[e]:void 0}var Kf=fL;var pL=Object.prototype,dL=pL.hasOwnProperty;function hL(e){var t=this.__data__;return Dt?t[e]!==void 0:dL.call(t,e)}var Wf=hL;var mL="__lodash_hash_undefined__";function gL(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Dt&&t===void 0?mL:t,this}var Vf=gL;function hn(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])}}hn.prototype.clear=Gf;hn.prototype.delete=Hf;hn.prototype.get=Kf;hn.prototype.has=Wf;hn.prototype.set=Vf;var Ks=hn;function EL(){this.__data__=[],this.size=0}var qf=EL;function yL(e,t){for(var r=e.length;r--;)if(gt(e[r][0],t))return r;return-1}var gr=yL;var SL=Array.prototype,TL=SL.splice;function RL(e){var t=this.__data__,r=gr(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():TL.call(t,r,1),--this.size,!0}var Yf=RL;function xL(e){var t=this.__data__,r=gr(t,e);return r<0?void 0:t[r][1]}var zf=xL;function OL(e){return gr(this.__data__,e)>-1}var Xf=OL;function LL(e,t){var r=this.__data__,n=gr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var Jf=LL;function mn(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])}}mn.prototype.clear=qf;mn.prototype.delete=Yf;mn.prototype.get=zf;mn.prototype.has=Xf;mn.prototype.set=Jf;var Er=mn;var AL=Ke(fe,"Map"),yr=AL;function UL(){this.size=0,this.__data__={hash:new Ks,map:new(yr||Er),string:new Ks}}var Qf=UL;function NL(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Zf=NL;function CL(e,t){var r=e.__data__;return Zf(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Sr=CL;function bL(e){var t=Sr(this,e).delete(e);return this.size-=t?1:0,t}var $f=bL;function IL(e){return Sr(this,e).get(e)}var ep=IL;function PL(e){return Sr(this,e).has(e)}var tp=PL;function vL(e,t){var r=Sr(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var rp=vL;function gn(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])}}gn.prototype.clear=Qf;gn.prototype.delete=$f;gn.prototype.get=ep;gn.prototype.has=tp;gn.prototype.set=rp;var Fr=gn;var ML="Expected a function";function Ws(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(ML);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(Ws.Cache||Fr),r}Ws.Cache=Fr;var np=Ws;var kL=500;function wL(e){var t=np(e,function(n){return r.size===kL&&r.clear(),n}),r=t.cache;return t}var op=wL;var _L=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,BL=/\\(\\)?/g,FL=op(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(_L,function(r,n,o,i){t.push(o?i.replace(BL,"$1"):n||r)}),t}),ip=FL;function DL(e){return e==null?"":of(e)}var ap=DL;function jL(e,t){return N(e)?e:dn(e,t)?[e]:ip(ap(e))}var Tr=jL;var GL=1/0;function HL(e){if(typeof e=="string"||dt(e))return e;var t=e+"";return t=="0"&&1/e==-GL?"-0":t}var Tt=HL;function KL(e,t){t=Tr(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[Tt(t[r++])];return r&&r==n?e:void 0}var En=KL;function WL(e,t,r){var n=e==null?void 0:En(e,t);return n===void 0?r:n}var sp=WL;function VL(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}var yn=VL;var cp=ye?ye.isConcatSpreadable:void 0;function qL(e){return N(e)||hr(e)||!!(cp&&e&&e[cp])}var up=qL;function lp(e,t,r,n,o){var i=-1,a=e.length;for(r||(r=up),o||(o=[]);++i<a;){var s=e[i];t>0&&r(s)?t>1?lp(s,t-1,r,n,o):yn(o,s):n||(o[o.length]=s)}return o}var Sn=lp;function YL(e){var t=e==null?0:e.length;return t?Sn(e,1):[]}var ue=YL;var zL=Oi(Object.getPrototypeOf,Object),Ai=zL;function XL(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 Ui=XL;function JL(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 fp=JL;function QL(){this.__data__=new Er,this.size=0}var pp=QL;function ZL(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var dp=ZL;function $L(e){return this.__data__.get(e)}var hp=$L;function e0(e){return this.__data__.has(e)}var mp=e0;var t0=200;function r0(e,t){var r=this.__data__;if(r instanceof Er){var n=r.__data__;if(!yr||n.length<t0-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Fr(n)}return r.set(e,t),this.size=r.size,this}var gp=r0;function Tn(e){var t=this.__data__=new Er(e);this.size=t.size}Tn.prototype.clear=pp;Tn.prototype.delete=dp;Tn.prototype.get=hp;Tn.prototype.has=mp;Tn.prototype.set=gp;var Rr=Tn;function n0(e,t){return e&&Et(t,K(t),e)}var Ep=n0;function o0(e,t){return e&&Et(t,mr(t),e)}var yp=o0;var xp=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Sp=xp&&typeof module=="object"&&module&&!module.nodeType&&module,i0=Sp&&Sp.exports===xp,Tp=i0?fe.Buffer:void 0,Rp=Tp?Tp.allocUnsafe:void 0;function a0(e,t){if(t)return e.slice();var r=e.length,n=Rp?Rp(r):new e.constructor(r);return e.copy(n),n}var Op=a0;function s0(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 Rn=s0;function c0(){return[]}var Ni=c0;var u0=Object.prototype,l0=u0.propertyIsEnumerable,Lp=Object.getOwnPropertySymbols,f0=Lp?function(e){return e==null?[]:(e=Object(e),Rn(Lp(e),function(t){return l0.call(e,t)}))}:Ni,xn=f0;function p0(e,t){return Et(e,xn(e),t)}var Ap=p0;var d0=Object.getOwnPropertySymbols,h0=d0?function(e){for(var t=[];e;)yn(t,xn(e)),e=Ai(e);return t}:Ni,Ci=h0;function m0(e,t){return Et(e,Ci(e),t)}var Up=m0;function g0(e,t,r){var n=t(e);return N(e)?n:yn(n,r(e))}var bi=g0;function E0(e){return bi(e,K,xn)}var po=E0;function y0(e){return bi(e,mr,Ci)}var Ii=y0;var S0=Ke(fe,"DataView"),Pi=S0;var T0=Ke(fe,"Promise"),vi=T0;var R0=Ke(fe,"Set"),xr=R0;var Np="[object Map]",x0="[object Object]",Cp="[object Promise]",bp="[object Set]",Ip="[object WeakMap]",Pp="[object DataView]",O0=Bt(Pi),L0=Bt(yr),A0=Bt(vi),U0=Bt(xr),N0=Bt(yi),Dr=we;(Pi&&Dr(new Pi(new ArrayBuffer(1)))!=Pp||yr&&Dr(new yr)!=Np||vi&&Dr(vi.resolve())!=Cp||xr&&Dr(new xr)!=bp||yi&&Dr(new yi)!=Ip)&&(Dr=function(e){var t=we(e),r=t==x0?e.constructor:void 0,n=r?Bt(r):"";if(n)switch(n){case O0:return Pp;case L0:return Np;case A0:return Cp;case U0:return bp;case N0:return Ip}return t});var ct=Dr;var C0=Object.prototype,b0=C0.hasOwnProperty;function I0(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&b0.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var vp=I0;var P0=fe.Uint8Array,On=P0;function v0(e){var t=new e.constructor(e.byteLength);return new On(t).set(new On(e)),t}var Ln=v0;function M0(e,t){var r=t?Ln(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var Mp=M0;var k0=/\w*$/;function w0(e){var t=new e.constructor(e.source,k0.exec(e));return t.lastIndex=e.lastIndex,t}var kp=w0;var wp=ye?ye.prototype:void 0,_p=wp?wp.valueOf:void 0;function _0(e){return _p?Object(_p.call(e)):{}}var Bp=_0;function B0(e,t){var r=t?Ln(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var Fp=B0;var F0="[object Boolean]",D0="[object Date]",j0="[object Map]",G0="[object Number]",H0="[object RegExp]",K0="[object Set]",W0="[object String]",V0="[object Symbol]",q0="[object ArrayBuffer]",Y0="[object DataView]",z0="[object Float32Array]",X0="[object Float64Array]",J0="[object Int8Array]",Q0="[object Int16Array]",Z0="[object Int32Array]",$0="[object Uint8Array]",eA="[object Uint8ClampedArray]",tA="[object Uint16Array]",rA="[object Uint32Array]";function nA(e,t,r){var n=e.constructor;switch(t){case q0:return Ln(e);case F0:case D0:return new n(+e);case Y0:return Mp(e,r);case z0:case X0:case J0:case Q0:case Z0:case $0:case eA:case tA:case rA:return Fp(e,r);case j0:return new n;case G0:case W0:return new n(e);case H0:return kp(e);case K0:return new n;case V0:return Bp(e)}}var Dp=nA;function oA(e){return typeof e.constructor=="function"&&!yt(e)?Ef(Ai(e)):{}}var jp=oA;var iA="[object Map]";function aA(e){return ce(e)&&ct(e)==iA}var Gp=aA;var Hp=rt&&rt.isMap,sA=Hp?St(Hp):Gp,Kp=sA;var cA="[object Set]";function uA(e){return ce(e)&&ct(e)==cA}var Wp=uA;var Vp=rt&&rt.isSet,lA=Vp?St(Vp):Wp,qp=lA;var fA=1,pA=2,dA=4,Yp="[object Arguments]",hA="[object Array]",mA="[object Boolean]",gA="[object Date]",EA="[object Error]",zp="[object Function]",yA="[object GeneratorFunction]",SA="[object Map]",TA="[object Number]",Xp="[object Object]",RA="[object RegExp]",xA="[object Set]",OA="[object String]",LA="[object Symbol]",AA="[object WeakMap]",UA="[object ArrayBuffer]",NA="[object DataView]",CA="[object Float32Array]",bA="[object Float64Array]",IA="[object Int8Array]",PA="[object Int16Array]",vA="[object Int32Array]",MA="[object Uint8Array]",kA="[object Uint8ClampedArray]",wA="[object Uint16Array]",_A="[object Uint32Array]",W={};W[Yp]=W[hA]=W[UA]=W[NA]=W[mA]=W[gA]=W[CA]=W[bA]=W[IA]=W[PA]=W[vA]=W[SA]=W[TA]=W[Xp]=W[RA]=W[xA]=W[OA]=W[LA]=W[MA]=W[kA]=W[wA]=W[_A]=!0;W[EA]=W[zp]=W[AA]=!1;function Mi(e,t,r,n,o,i){var a,s=t&fA,c=t&pA,u=t&dA;if(r&&(a=o?r(e,n,o,i):r(e)),a!==void 0)return a;if(!$(e))return e;var l=N(e);if(l){if(a=vp(e),!s)return Sf(e,a)}else{var f=ct(e),p=f==zp||f==yA;if(Ft(e))return Op(e,s);if(f==Xp||f==Yp||p&&!o){if(a=c||p?{}:jp(e),!s)return c?Up(e,yp(a,e)):Ap(e,Ep(a,e))}else{if(!W[f])return o?e:{};a=Dp(e,f,s)}}i||(i=new Rr);var h=i.get(e);if(h)return h;i.set(e,a),qp(e)?e.forEach(function(S){a.add(Mi(S,t,r,S,e,i))}):Kp(e)&&e.forEach(function(S,d){a.set(d,Mi(S,t,r,d,e,i))});var E=u?c?Ii:po:c?mr:K,y=l?void 0:E(e);return Si(y||e,function(S,d){y&&(d=S,S=e[d]),pr(a,d,Mi(S,t,r,d,e,i))}),a}var Jp=Mi;var BA=4;function FA(e){return Jp(e,BA)}var V=FA;function DA(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 Rt=DA;var jA="__lodash_hash_undefined__";function GA(e){return this.__data__.set(e,jA),this}var Qp=GA;function HA(e){return this.__data__.has(e)}var Zp=HA;function ki(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Fr;++t<r;)this.add(e[t])}ki.prototype.add=ki.prototype.push=Qp;ki.prototype.has=Zp;var An=ki;function KA(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 wi=KA;function WA(e,t){return e.has(t)}var Un=WA;var VA=1,qA=2;function YA(e,t,r,n,o,i){var a=r&VA,s=e.length,c=t.length;if(s!=c&&!(a&&c>s))return!1;var u=i.get(e),l=i.get(t);if(u&&l)return u==t&&l==e;var f=-1,p=!0,h=r&qA?new An:void 0;for(i.set(e,t),i.set(t,e);++f<s;){var E=e[f],y=t[f];if(n)var S=a?n(y,E,f,t,e,i):n(E,y,f,e,t,i);if(S!==void 0){if(S)continue;p=!1;break}if(h){if(!wi(t,function(d,g){if(!Un(h,g)&&(E===d||o(E,d,r,n,i)))return h.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 _i=YA;function zA(e){var t=-1,r=Array(e.size);return e.forEach(function(n,o){r[++t]=[o,n]}),r}var $p=zA;function XA(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Nn=XA;var JA=1,QA=2,ZA="[object Boolean]",$A="[object Date]",eU="[object Error]",tU="[object Map]",rU="[object Number]",nU="[object RegExp]",oU="[object Set]",iU="[object String]",aU="[object Symbol]",sU="[object ArrayBuffer]",cU="[object DataView]",ed=ye?ye.prototype:void 0,Vs=ed?ed.valueOf:void 0;function uU(e,t,r,n,o,i,a){switch(r){case cU:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case sU:return!(e.byteLength!=t.byteLength||!i(new On(e),new On(t)));case ZA:case $A:case rU:return gt(+e,+t);case eU:return e.name==t.name&&e.message==t.message;case nU:case iU:return e==t+"";case tU:var s=$p;case oU:var c=n&JA;if(s||(s=Nn),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;n|=QA,a.set(e,t);var l=_i(s(e),s(t),n,o,i,a);return a.delete(e),l;case aU:if(Vs)return Vs.call(e)==Vs.call(t)}return!1}var td=uU;var lU=1,fU=Object.prototype,pU=fU.hasOwnProperty;function dU(e,t,r,n,o,i){var a=r&lU,s=po(e),c=s.length,u=po(t),l=u.length;if(c!=l&&!a)return!1;for(var f=c;f--;){var p=s[f];if(!(a?p in t:pU.call(t,p)))return!1}var h=i.get(e),E=i.get(t);if(h&&E)return h==t&&E==e;var y=!0;i.set(e,t),i.set(t,e);for(var S=a;++f<c;){p=s[f];var d=e[p],g=t[p];if(n)var m=a?n(g,d,p,t,e,i):n(d,g,p,e,t,i);if(!(m===void 0?d===g||o(d,g,r,n,i):m)){y=!1;break}S||(S=p=="constructor")}if(y&&!S){var x=e.constructor,C=t.constructor;x!=C&&"constructor"in e&&"constructor"in t&&!(typeof x=="function"&&x instanceof x&&typeof C=="function"&&C instanceof C)&&(y=!1)}return i.delete(e),i.delete(t),y}var rd=dU;var hU=1,nd="[object Arguments]",od="[object Array]",Bi="[object Object]",mU=Object.prototype,id=mU.hasOwnProperty;function gU(e,t,r,n,o,i){var a=N(e),s=N(t),c=a?od:ct(e),u=s?od:ct(t);c=c==nd?Bi:c,u=u==nd?Bi:u;var l=c==Bi,f=u==Bi,p=c==u;if(p&&Ft(e)){if(!Ft(t))return!1;a=!0,l=!1}if(p&&!l)return i||(i=new Rr),a||pn(e)?_i(e,t,r,n,o,i):td(e,t,c,r,n,o,i);if(!(r&hU)){var h=l&&id.call(e,"__wrapped__"),E=f&&id.call(t,"__wrapped__");if(h||E){var y=h?e.value():e,S=E?t.value():t;return i||(i=new Rr),o(y,S,r,n,i)}}return p?(i||(i=new Rr),rd(e,t,r,n,o,i)):!1}var ad=gU;function sd(e,t,r,n,o){return e===t?!0:e==null||t==null||!ce(e)&&!ce(t)?e!==e&&t!==t:ad(e,t,r,n,sd,o)}var Fi=sd;var EU=1,yU=2;function SU(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],u=e[c],l=s[1];if(a&&s[2]){if(u===void 0&&!(c in e))return!1}else{var f=new Rr;if(n)var p=n(u,l,c,e,t,f);if(!(p===void 0?Fi(l,u,EU|yU,n,f):p))return!1}}return!0}var cd=SU;function TU(e){return e===e&&!$(e)}var Di=TU;function RU(e){for(var t=K(e),r=t.length;r--;){var n=t[r],o=e[n];t[r]=[n,o,Di(o)]}return t}var ud=RU;function xU(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var ji=xU;function OU(e){var t=ud(e);return t.length==1&&t[0][2]?ji(t[0][0],t[0][1]):function(r){return r===e||cd(r,e,t)}}var ld=OU;function LU(e,t){return e!=null&&t in Object(e)}var fd=LU;function AU(e,t,r){t=Tr(t,e);for(var n=-1,o=t.length,i=!1;++n<o;){var a=Tt(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&&fn(o)&&fr(a,o)&&(N(e)||hr(e)))}var Gi=AU;function UU(e,t){return e!=null&&Gi(e,t,fd)}var pd=UU;var NU=1,CU=2;function bU(e,t){return dn(e)&&Di(t)?ji(Tt(e),t):function(r){var n=sp(r,e);return n===void 0&&n===t?pd(r,e):Fi(t,n,NU|CU)}}var dd=bU;function IU(e){return function(t){return t?.[e]}}var hd=IU;function PU(e){return function(t){return En(t,e)}}var md=PU;function vU(e){return dn(e)?hd(Tt(e)):md(e)}var gd=vU;function MU(e){return typeof e=="function"?e:e==null?He:typeof e=="object"?N(e)?dd(e[0],e[1]):ld(e):gd(e)}var se=MU;function kU(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 Ed=kU;function wU(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 yd=wU;var _U=yd(),Sd=_U;function BU(e,t){return e&&Sd(e,t,K)}var Td=BU;function FU(e,t){return function(r,n){if(r==null)return r;if(!pe(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 Rd=FU;var DU=Rd(Td),We=DU;function jU(e,t,r,n){return We(e,function(o,i,a){t(n,o,r(o),a)}),n}var xd=jU;function GU(e,t){return function(r,n){var o=N(r)?Ed:xd,i=t?t():{};return o(r,e,se(n,2),i)}}var Od=GU;var Ld=Object.prototype,HU=Ld.hasOwnProperty,KU=ln(function(e,t){e=Object(e);var r=-1,n=t.length,o=n>2?t[2]:void 0;for(o&&dr(t[0],t[1],o)&&(n=1);++r<n;)for(var i=t[r],a=mr(i),s=-1,c=a.length;++s<c;){var u=a[s],l=e[u];(l===void 0||gt(l,Ld[u])&&!HU.call(e,u))&&(e[u]=i[u])}return e}),Cn=KU;function WU(e){return ce(e)&&pe(e)}var qs=WU;function VU(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 Hi=VU;var qU=200;function YU(e,t,r,n){var o=-1,i=Ri,a=!0,s=e.length,c=[],u=t.length;if(!s)return c;r&&(t=ht(t,St(r))),n?(i=Hi,a=!1):t.length>=qU&&(i=Un,a=!1,t=new An(t));e:for(;++o<s;){var l=e[o],f=r==null?l:r(l);if(l=n||l!==0?l:0,a&&f===f){for(var p=u;p--;)if(t[p]===f)continue e;c.push(l)}else i(t,f,n)||c.push(l)}return c}var Ad=YU;var zU=ln(function(e,t){return qs(e)?Ad(e,Sn(t,1,qs,!0)):[]}),Or=zU;function XU(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var xt=XU;function JU(e,t,r){var n=e==null?0:e.length;return n?(t=r||t===void 0?1:mt(t),Ui(e,t<0?0:t,n)):[]}var le=JU;function QU(e,t,r){var n=e==null?0:e.length;return n?(t=r||t===void 0?1:mt(t),t=n-t,Ui(e,0,t<0?0:t)):[]}var jt=QU;function ZU(e){return typeof e=="function"?e:He}var Ud=ZU;function $U(e,t){var r=N(e)?Si:We;return r(e,Ud(t))}var L=$U;function e2(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 Nd=e2;function t2(e,t){var r=!0;return We(e,function(n,o,i){return r=!!t(n,o,i),r}),r}var Cd=t2;function r2(e,t,r){var n=N(e)?Nd:Cd;return r&&dr(e,t,r)&&(t=void 0),n(e,se(t,3))}var Ie=r2;function n2(e,t){var r=[];return We(e,function(n,o,i){t(n,o,i)&&r.push(n)}),r}var Ki=n2;function o2(e,t){var r=N(e)?Rn:Ki;return r(e,se(t,3))}var Se=o2;function i2(e){return function(t,r,n){var o=Object(t);if(!pe(t)){var i=se(r,3);t=K(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 bd=i2;var a2=Math.max;function s2(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var o=r==null?0:mt(r);return o<0&&(o=a2(n+o,0)),Ti(e,se(t,3),o)}var Id=s2;var c2=bd(Id),Ot=c2;function u2(e){return e&&e.length?e[0]:void 0}var Te=u2;function l2(e,t){var r=-1,n=pe(e)?Array(e.length):[];return We(e,function(o,i,a){n[++r]=t(o,i,a)}),n}var Pd=l2;function f2(e,t){var r=N(e)?ht:Pd;return r(e,se(t,3))}var R=f2;function p2(e,t){return Sn(R(e,t),1)}var Ue=p2;var d2=Object.prototype,h2=d2.hasOwnProperty,m2=Od(function(e,t,r){h2.call(e,r)?e[r].push(t):un(e,r,[t])}),Ys=m2;var g2=Object.prototype,E2=g2.hasOwnProperty;function y2(e,t){return e!=null&&E2.call(e,t)}var vd=y2;function S2(e,t){return e!=null&&Gi(e,t,vd)}var U=S2;var T2="[object String]";function R2(e){return typeof e=="string"||!N(e)&&ce(e)&&we(e)==T2}var me=R2;function x2(e,t){return ht(t,function(r){return e[r]})}var Md=x2;function O2(e){return e==null?[]:Md(e,K(e))}var j=O2;var L2=Math.max;function A2(e,t,r,n){e=pe(e)?e:j(e),r=r&&!n?mt(r):0;var o=e.length;return r<0&&(r=L2(o+r,0)),me(e)?r<=o&&e.indexOf(t,r)>-1:!!o&&cn(e,t,r)>-1}var J=A2;var U2=Math.max;function N2(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var o=r==null?0:mt(r);return o<0&&(o=U2(n+o,0)),cn(e,t,o)}var Wi=N2;var C2="[object Map]",b2="[object Set]",I2=Object.prototype,P2=I2.hasOwnProperty;function v2(e){if(e==null)return!0;if(pe(e)&&(N(e)||typeof e=="string"||typeof e.splice=="function"||Ft(e)||pn(e)||hr(e)))return!e.length;var t=ct(e);if(t==C2||t==b2)return!e.size;if(yt(e))return!Li(e).length;for(var r in e)if(P2.call(e,r))return!1;return!0}var v=v2;var M2="[object RegExp]";function k2(e){return ce(e)&&we(e)==M2}var kd=k2;var wd=rt&&rt.isRegExp,w2=wd?St(wd):kd,nt=w2;function _2(e){return e===void 0}var Pe=_2;function B2(e,t){return e<t}var _d=B2;function F2(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&&!dt(a):r(a,s)))var s=a,c=i}return c}var Bd=F2;function D2(e){return e&&e.length?Bd(e,He,_d):void 0}var Fd=D2;var j2="Expected a function";function G2(e){if(typeof e!="function")throw new TypeError(j2);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 Dd=G2;function H2(e,t,r,n){if(!$(e))return e;t=Tr(t,e);for(var o=-1,i=t.length,a=i-1,s=e;s!=null&&++o<i;){var c=Tt(t[o]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(o!=a){var l=s[c];u=n?n(l,c,s):void 0,u===void 0&&(u=$(l)?l:fr(t[o+1])?[]:{})}pr(s,c,u),s=s[c]}return e}var jd=H2;function K2(e,t,r){for(var n=-1,o=t.length,i={};++n<o;){var a=t[n],s=En(e,a);r(s,a)&&jd(i,Tr(a,e),s)}return i}var Gd=K2;function W2(e,t){if(e==null)return{};var r=ht(Ii(e),function(n){return[n]});return t=se(t),Gd(e,r,function(n,o){return t(n,o[0])})}var Ve=W2;function V2(e,t,r,n,o){return o(e,function(i,a,s){r=n?(n=!1,i):t(r,i,a,s)}),r}var Hd=V2;function q2(e,t,r){var n=N(e)?fp:Hd,o=arguments.length<3;return n(e,se(t,4),r,o,We)}var te=q2;function Y2(e,t){var r=N(e)?Rn:Ki;return r(e,Dd(se(t,3)))}var Lr=Y2;function z2(e,t){var r;return We(e,function(n,o,i){return r=t(n,o,i),!r}),!!r}var Kd=z2;function X2(e,t,r){var n=N(e)?wi:Kd;return r&&dr(e,t,r)&&(t=void 0),n(e,se(t,3))}var ho=X2;var J2=1/0,Q2=xr&&1/Nn(new xr([,-0]))[1]==J2?function(e){return new xr(e)}:ee,Wd=Q2;var Z2=200;function $2(e,t,r){var n=-1,o=Ri,i=e.length,a=!0,s=[],c=s;if(r)a=!1,o=Hi;else if(i>=Z2){var u=t?null:Wd(e);if(u)return Nn(u);a=!1,o=Un,c=new An}else c=t?[]:s;e:for(;++n<i;){var l=e[n],f=t?t(l):l;if(l=r||l!==0?l:0,a&&f===f){for(var p=c.length;p--;)if(c[p]===f)continue e;t&&c.push(f),s.push(l)}else o(c,f,r)||(c!==s&&c.push(f),s.push(l))}return s}var Vi=$2;function eN(e){return e&&e.length?Vi(e):[]}var bn=eN;function tN(e,t){return e&&e.length?Vi(e,se(t,2)):[]}var Vd=tN;function In(e){console&&console.error&&console.error(`Error: ${e}`)}function mo(e){console&&console.warn&&console.warn(`Warning: ${e}`)}function go(e){let t=new Date().getTime(),r=e();return{time:new Date().getTime()-t,value:r}}function Eo(e){function t(){}t.prototype=e;let r=new t;function n(){return typeof r.bar}return n(),n(),e;(0,eval)(e)}function rN(e){return nN(e)?e.LABEL:e.name}function nN(e){return me(e.LABEL)&&e.LABEL!==""}var Xe=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 Xe{constructor(t){super([]),this.idx=1,Ae(this,Ve(t,r=>r!==void 0))}set definition(t){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(t){t.visit(this)}},Be=class extends Xe{constructor(t){super(t.definition),this.orgText="",Ae(this,Ve(t,r=>r!==void 0))}},q=class extends Xe{constructor(t){super(t.definition),this.ignoreAmbiguities=!1,Ae(this,Ve(t,r=>r!==void 0))}},F=class extends Xe{constructor(t){super(t.definition),this.idx=1,Ae(this,Ve(t,r=>r!==void 0))}},Y=class extends Xe{constructor(t){super(t.definition),this.idx=1,Ae(this,Ve(t,r=>r!==void 0))}},z=class extends Xe{constructor(t){super(t.definition),this.idx=1,Ae(this,Ve(t,r=>r!==void 0))}},w=class extends Xe{constructor(t){super(t.definition),this.idx=1,Ae(this,Ve(t,r=>r!==void 0))}},G=class extends Xe{constructor(t){super(t.definition),this.idx=1,Ae(this,Ve(t,r=>r!==void 0))}},H=class extends Xe{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,Ae(this,Ve(t,r=>r!==void 0))}},M=class{constructor(t){this.idx=1,Ae(this,Ve(t,r=>r!==void 0))}accept(t){t.visit(this)}};function qi(e){return R(e,Pn)}function Pn(e){function t(r){return R(r,Pn)}if(e instanceof B){let r={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return me(e.label)&&(r.label=e.label),r}else{if(e instanceof q)return{type:"Alternative",definition:t(e.definition)};if(e instanceof F)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof Y)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof z)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:Pn(new M({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof G)return{type:"RepetitionWithSeparator",idx:e.idx,separator:Pn(new M({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof w)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof H)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof M){let r={type:"Terminal",name:e.terminalType.name,label:rN(e.terminalType),idx:e.idx};me(e.label)&&(r.terminalLabel=e.label);let n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(r.pattern=nt(n)?n.source:n),r}else{if(e instanceof Be)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}}}var Fe=class{visit(t){let r=t;switch(r.constructor){case B:return this.visitNonTerminal(r);case q:return this.visitAlternative(r);case F:return this.visitOption(r);case Y:return this.visitRepetitionMandatory(r);case z:return this.visitRepetitionMandatoryWithSeparator(r);case G:return this.visitRepetitionWithSeparator(r);case w:return this.visitRepetition(r);case H:return this.visitAlternation(r);case M:return this.visitTerminal(r);case Be: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 zs(e){return e instanceof q||e instanceof F||e instanceof w||e instanceof Y||e instanceof z||e instanceof G||e instanceof M||e instanceof Be}function jr(e,t=[]){return e instanceof F||e instanceof w||e instanceof G?!0:e instanceof H?ho(e.definition,n=>jr(n,t)):e instanceof B&&J(t,e)?!1:e instanceof Xe?(e instanceof B&&t.push(e),Ie(e.definition,n=>jr(n,t))):!1}function Xs(e){return e instanceof H}function qe(e){if(e instanceof B)return"SUBRULE";if(e instanceof F)return"OPTION";if(e instanceof H)return"OR";if(e instanceof Y)return"AT_LEAST_ONE";if(e instanceof z)return"AT_LEAST_ONE_SEP";if(e instanceof G)return"MANY_SEP";if(e instanceof w)return"MANY";if(e instanceof M)return"CONSUME";throw Error("non exhaustive match")}var Gt=class{walk(t,r=[]){L(t.definition,(n,o)=>{let i=le(t.definition,o+1);if(n instanceof B)this.walkProdRef(n,i,r);else if(n instanceof M)this.walkTerminal(n,i,r);else if(n instanceof q)this.walkFlat(n,i,r);else if(n instanceof F)this.walkOption(n,i,r);else if(n instanceof Y)this.walkAtLeastOne(n,i,r);else if(n instanceof z)this.walkAtLeastOneSep(n,i,r);else if(n instanceof G)this.walkManySep(n,i,r);else if(n instanceof w)this.walkMany(n,i,r);else if(n instanceof H)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=qd(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=qd(t,r,n);this.walk(t,o)}walkOr(t,r,n){let o=r.concat(n);L(t.definition,i=>{let a=new q({definition:[i]});this.walk(a,o)})}};function qd(e,t,r){return[new F({definition:[new M({terminalType:e.separator})].concat(e.definition)})].concat(t,r)}function Gr(e){if(e instanceof B)return Gr(e.referencedRule);if(e instanceof M)return aN(e);if(zs(e))return oN(e);if(Xs(e))return iN(e);throw Error("non exhaustive match")}function oN(e){let t=[],r=e.definition,n=0,o=r.length>n,i,a=!0;for(;o&&a;)i=r[n],a=jr(i),t=t.concat(Gr(i)),n=n+1,o=r.length>n;return bn(t)}function iN(e){let t=R(e.definition,r=>Gr(r));return bn(ue(t))}function aN(e){return[e.terminalType]}var Yi="_~IN~_";var Js=class extends Gt{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=sN(t.referencedRule,t.idx)+this.topProd.name,i=r.concat(n),a=new q({definition:i}),s=Gr(a);this.follows[o]=s}};function Yd(e){let t={};return L(e,r=>{let n=new Js(r).startWalking();Ae(t,n)}),t}function sN(e,t){return e.name+t+Yi}function b(e){return e.charCodeAt(0)}function zi(e,t){Array.isArray(e)?e.forEach(function(r){t.push(r)}):t.push(e)}function vn(e,t){if(e[t]===!0)throw"duplicate flag "+t;let r=e[t];e[t]=!0}function Hr(e){if(e===void 0)throw Error("Internal Error - Should never get here!");return!0}function yo(){throw Error("Internal Error - Should never get here!")}function Qs(e){return e.type==="Character"}var So=[];for(let e=b("0");e<=b("9");e++)So.push(e);var To=[b("_")].concat(So);for(let e=b("a");e<=b("z");e++)To.push(e);for(let e=b("A");e<=b("Z");e++)To.push(e);var Zs=[b(" "),b("\f"),b(`
41
- `),b("\r"),b(" "),b("\v"),b(" "),b("\xA0"),b("\u1680"),b("\u2000"),b("\u2001"),b("\u2002"),b("\u2003"),b("\u2004"),b("\u2005"),b("\u2006"),b("\u2007"),b("\u2008"),b("\u2009"),b("\u200A"),b("\u2028"),b("\u2029"),b("\u202F"),b("\u205F"),b("\u3000"),b("\uFEFF")];var cN=/[0-9a-fA-F]/,Xi=/[0-9]/,uN=/[1-9]/,Ro=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":vn(n,"global");break;case"i":vn(n,"ignoreCase");break;case"m":vn(n,"multiLine");break;case"u":vn(n,"unicode");break;case"y":vn(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}Hr(r);let n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(t)}}return yo()}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;Hr(r);break}if(!(t===!0&&r===void 0)&&Hr(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()),Hr(t)?(t.loc=this.loc(r),this.isQuantifier()&&(t.quantifier=this.quantifier()),t):yo()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[b(`
42
- `),b("\r"),b("\u2028"),b("\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=So;break;case"D":t=So,r=!0;break;case"s":t=Zs;break;case"S":t=Zs,r=!0;break;case"w":t=To;break;case"W":t=To,r=!0;break}return Hr(t)?{type:"Set",value:t,complement:r}:yo()}controlEscapeAtom(){let t;switch(this.popChar()){case"f":t=b("\f");break;case"n":t=b(`
43
- `);break;case"r":t=b("\r");break;case"t":t=b(" ");break;case"v":t=b("\v");break}return Hr(t)?{type:"Character",value:t}:yo()}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:b("\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:b(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:b(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(Qs(n)&&this.isRangeDash()){this.consumeChar("-");let i=this.classAtom(),a=i.type==="Character";if(Qs(i)){if(i.value<n.value)throw Error("Range out of order in character class");t.push({from:n.value,to:i.value})}else zi(n.value,t),t.push(b("-")),zi(i.value,t)}else zi(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:b("\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(uN.test(t)===!1)throw Error("Expecting a positive integer");for(;Xi.test(this.peekChar(0));)t+=this.popChar();return parseInt(t,10)}integerIncludingZero(){let t=this.popChar();if(Xi.test(t)===!1)throw Error("Expecting an integer");for(;Xi.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:b(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 Xi.test(this.peekChar(0))}isClassAtom(t=0){switch(this.peekChar(t)){case"]":case`
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
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(cN.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 Ar=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 Ji={},lN=new Ro;function Mn(e){let t=e.toString();if(Ji.hasOwnProperty(t))return Ji[t];{let r=lN.pattern(t);return Ji[t]=r,r}}function zd(){Ji={}}var Jd="Complement Sets are not supported for first char optimization",xo=`Unable to use "first char" lexer optimizations:
49
- `;function Qd(e,t=!1){try{let r=Mn(e);return $s(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===Jd)t&&mo(`${xo} Unable to optimize: < ${e.toString()} >
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
50
  Complement Sets cannot be automatically optimized.
51
51
  This will disable the lexer's first char optimizations.
52
52
  See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n=`
53
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.`),In(`${xo}
54
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),eo(`${oi}
55
55
  Failed parsing: < ${e.toString()} >
56
56
  Using the @chevrotain/regexp-to-ast library
57
- Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function $s(e,t,r){switch(e.type){case"Disjunction":for(let o=0;o<e.value.length;o++)$s(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":Qi(a.value,t,r);break;case"Set":if(a.complement===!0)throw Error(Jd);L(a.value,c=>{if(typeof c=="number")Qi(c,t,r);else{let u=c;if(r===!0)for(let l=u.from;l<=u.to;l++)Qi(l,t,r);else{for(let l=u.from;l<=u.to&&l<kn;l++)Qi(l,t,r);if(u.to>=kn){let l=u.from>=kn?u.from:kn,f=u.to,p=Lt(l),h=Lt(f);for(let E=p;E<=h;E++)t[E]=E}}}});break;case"Group":$s(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"&&ec(a)===!1||a.type!=="Group"&&s===!1)break}break;default:throw Error("non exhaustive match!")}return j(t)}function Qi(e,t,r){let n=Lt(e);t[n]=n,r===!0&&fN(e,t)}function fN(e,t){let r=String.fromCharCode(e),n=r.toUpperCase();if(n!==r){let o=Lt(n.charCodeAt(0));t[o]=o}else{let o=r.toLowerCase();if(o!==r){let i=Lt(o.charCodeAt(0));t[i]=i}}}function Xd(e,t){return Ot(e.value,r=>{if(typeof r=="number")return J(t,r);{let n=r;return Ot(t,o=>n.from<=o&&o<=n.to)!==void 0}})}function ec(e){let t=e.quantifier;return t&&t.atLeast===0?!0:e.value?N(e.value)?Ie(e.value,ec):ec(e.value):!1}var tc=class extends Ar{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){J(this.targetCharCodes,t.value)&&(this.found=!0)}visitSet(t){t.complement?Xd(t,this.targetCharCodes)===void 0&&(this.found=!0):Xd(t,this.targetCharCodes)!==void 0&&(this.found=!0)}};function Zi(e,t){if(t instanceof RegExp){let r=Mn(t),n=new tc(e);return n.visit(r),n.found}else return Ot(t,r=>J(e,r.charCodeAt(0)))!==void 0}var Kr="PATTERN",wn="defaultMode",$i="modes",nc=typeof new RegExp("(?:)").sticky=="boolean";function eh(e,t){t=Cn(t,{useSticky:nc,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
58
- `],tracer:(g,m)=>m()});let r=t.tracer;r("initCharCodeToOptimizedIndexMap",()=>{bN()});let n;r("Reject Lexer.NA",()=>{n=Lr(e,g=>g[Kr]===D.NA)});let o=!1,i;r("Transform Patterns",()=>{o=!1,i=R(n,g=>{let m=g[Kr];if(nt(m)){let x=m.source;return x.length===1&&x!=="^"&&x!=="$"&&x!=="."&&!m.ignoreCase?x:x.length===2&&x[0]==="\\"&&!J(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],x[1])?x[1]:t.useSticky?$d(m):Zd(m)}else{if(_e(m))return o=!0,{exec:m};if(typeof m=="object")return o=!0,m;if(typeof m=="string"){if(m.length===1)return m;{let x=m.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),C=new RegExp(x);return t.useSticky?$d(C):Zd(C)}}else throw Error("non exhaustive match")}})});let a,s,c,u,l;r("misc mapping",()=>{a=R(n,g=>g.tokenTypeIdx),s=R(n,g=>{let m=g.GROUP;if(m!==D.SKIPPED){if(me(m))return m;if(Pe(m))return!1;throw Error("non exhaustive match")}}),c=R(n,g=>{let m=g.LONGER_ALT;if(m)return N(m)?R(m,C=>Wi(n,C)):[Wi(n,m)]}),u=R(n,g=>g.PUSH_MODE),l=R(n,g=>U(g,"POP_MODE"))});let f;r("Line Terminator Handling",()=>{let g=ch(t.lineTerminatorCharacters);f=R(n,m=>!1),t.positionTracking!=="onlyOffset"&&(f=R(n,m=>U(m,"LINE_BREAKS")?!!m.LINE_BREAKS:sh(m,g)===!1&&Zi(g,m.PATTERN)))});let p,h,E,y;r("Misc Mapping #2",()=>{p=R(n,ih),h=R(i,NN),E=te(n,(g,m)=>{let x=m.GROUP;return me(x)&&x!==D.SKIPPED&&(g[x]=[]),g},{}),y=R(i,(g,m)=>({pattern:i[m],longerAlt:c[m],canLineTerminator:f[m],isCustom:p[m],short:h[m],group:s[m],push:u[m],pop:l[m],tokenTypeIdx:a[m],tokenType:n[m]}))});let S=!0,d=[];return t.safeMode||r("First Char Optimization",()=>{d=te(n,(g,m,x)=>{if(typeof m.PATTERN=="string"){let C=m.PATTERN.charCodeAt(0),Ce=Lt(C);rc(g,Ce,y[x])}else if(N(m.START_CHARS_HINT)){let C;L(m.START_CHARS_HINT,Ce=>{let bt=typeof Ce=="string"?Ce.charCodeAt(0):Ce,Ye=Lt(bt);C!==Ye&&(C=Ye,rc(g,Ye,y[x]))})}else if(nt(m.PATTERN))if(m.PATTERN.unicode)S=!1,t.ensureOptimizations&&In(`${xo} Unable to analyze < ${m.PATTERN.toString()} > pattern.
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
59
  The regexp unicode flag is not currently supported by the regexp-to-ast library.
60
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 C=Qd(m.PATTERN,t.ensureOptimizations);v(C)&&(S=!1),L(C,Ce=>{rc(g,Ce,y[x])})}else t.ensureOptimizations&&In(`${xo} TokenType: <${m.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
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
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 th(e,t){let r=[],n=dN(e);r=r.concat(n.errors);let o=hN(n.valid),i=o.valid;return r=r.concat(o.errors),r=r.concat(pN(i)),r=r.concat(xN(i)),r=r.concat(ON(i,t)),r=r.concat(LN(i)),r}function pN(e){let t=[],r=Se(e,n=>nt(n[Kr]));return t=t.concat(gN(r)),t=t.concat(SN(r)),t=t.concat(TN(r)),t=t.concat(RN(r)),t=t.concat(EN(r)),t}function dN(e){let t=Se(e,o=>!U(o,Kr)),r=R(t,o=>({message:"Token Type: ->"+o.name+"<- missing static 'PATTERN' property",type:Q.MISSING_PATTERN,tokenTypes:[o]})),n=Or(e,t);return{errors:r,valid:n}}function hN(e){let t=Se(e,o=>{let i=o[Kr];return!nt(i)&&!_e(i)&&!U(i,"exec")&&!me(i)}),r=R(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:Q.INVALID_PATTERN,tokenTypes:[o]})),n=Or(e,t);return{errors:r,valid:n}}var mN=/[^\\][$]/;function gN(e){class t extends Ar{constructor(){super(...arguments),this.found=!1}visitEndAnchor(i){this.found=!0}}let r=Se(e,o=>{let i=o.PATTERN;try{let a=Mn(i),s=new t;return s.visit(a),s.found}catch{return mN.test(i.source)}});return R(r,o=>({message:`Unexpected RegExp Anchor Error:
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
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:Q.EOI_ANCHOR_FOUND,tokenTypes:[o]}))}function EN(e){let t=Se(e,n=>n.PATTERN.test(""));return R(t,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Q.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}var yN=/[^\\[][\^]|^\^/;function SN(e){class t extends Ar{constructor(){super(...arguments),this.found=!1}visitStartAnchor(i){this.found=!0}}let r=Se(e,o=>{let i=o.PATTERN;try{let a=Mn(i),s=new t;return s.visit(a),s.found}catch{return yN.test(i.source)}});return R(r,o=>({message:`Unexpected RegExp Anchor Error:
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
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:Q.SOI_ANCHOR_FOUND,tokenTypes:[o]}))}function TN(e){let t=Se(e,n=>{let o=n[Kr];return o instanceof RegExp&&(o.multiline||o.global)});return R(t,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Q.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function RN(e){let t=[],r=R(e,i=>te(e,(a,s)=>(i.PATTERN.source===s.PATTERN.source&&!J(t,s)&&s.PATTERN!==D.NA&&(t.push(s),a.push(s)),a),[]));r=Rt(r);let n=Se(r,i=>i.length>1);return R(n,i=>{let a=R(i,c=>c.name);return{message:`The same RegExp pattern ->${Te(i).PATTERN}<-has been used in all of the following Token Types: ${a.join(", ")} <-`,type:Q.DUPLICATE_PATTERNS_FOUND,tokenTypes:i}})}function xN(e){let t=Se(e,n=>{if(!U(n,"GROUP"))return!1;let o=n.GROUP;return o!==D.SKIPPED&&o!==D.NA&&!me(o)});return R(t,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Q.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function ON(e,t){let r=Se(e,o=>o.PUSH_MODE!==void 0&&!J(t,o.PUSH_MODE));return R(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:Q.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[o]}))}function LN(e){let t=[],r=te(e,(n,o,i)=>{let a=o.PATTERN;return a===D.NA||(me(a)?n.push({str:a,idx:i,tokenType:o}):nt(a)&&UN(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&&AN(i,n.PATTERN)){let c=`Token: ->${s.name}<- can never be matched.
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
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:Q.UNREACHABLE_PATTERN,tokenTypes:[n,s]})}})}),t}function AN(e,t){if(nt(t)){let r=t.exec(e);return r!==null&&r.index===0}else{if(_e(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 UN(e){return Ot([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>e.source.indexOf(r)!==-1)===void 0}function Zd(e){let t=e.ignoreCase?"i":"";return new RegExp(`^(?:${e.source})`,t)}function $d(e){let t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function rh(e,t,r){let n=[];return U(e,wn)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+wn+`> property in its definition
70
- `,type:Q.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),U(e,$i)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+$i+`> property in its definition
71
- `,type:Q.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),U(e,$i)&&U(e,wn)&&!U(e.modes,e.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${wn}: <${e.defaultMode}>which does not exist
72
- `,type:Q.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),U(e,$i)&&L(e.modes,(o,i)=>{L(o,(a,s)=>{if(Pe(a))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${i}> at index: <${s}>
73
- `,type:Q.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(U(a,"LONGER_ALT")){let c=N(a.LONGER_ALT)?a.LONGER_ALT:[a.LONGER_ALT];L(c,u=>{!Pe(u)&&!J(o,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${a.name}> outside of mode <${i}>
74
- `,type:Q.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function nh(e,t,r){let n=[],o=!1,i=Rt(ue(j(e.modes))),a=Lr(i,c=>c[Kr]===D.NA),s=ch(r);return t&&L(a,c=>{let u=sh(c,s);if(u!==!1){let f={message:CN(c,u),type:u.issue,tokenType:c};n.push(f)}else U(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(o=!0):Zi(s,c.PATTERN)&&(o=!0)}),t&&!o&&n.push({message:`Warning: No LINE_BREAKS Found.
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
75
  This Lexer has been defined to track line and column information,
76
76
  But none of the Token Types can be identified as matching a line terminator.
77
77
  See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
78
- for details.`,type:Q.NO_LINE_BREAKS_FLAGS}),n}function oh(e){let t={},r=K(e);return L(r,n=>{let o=e[n];if(N(o))t[n]=[];else throw Error("non exhaustive match")}),t}function ih(e){let t=e.PATTERN;if(nt(t))return!1;if(_e(t))return!0;if(U(t,"exec"))return!0;if(me(t))return!1;throw Error("non exhaustive match")}function NN(e){return me(e)&&e.length===1?e.charCodeAt(0):!1}var ah={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 sh(e,t){if(U(e,"LINE_BREAKS"))return!1;if(nt(e.PATTERN)){try{Zi(t,e.PATTERN)}catch(r){return{issue:Q.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(me(e.PATTERN))return!1;if(ih(e))return{issue:Q.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function CN(e,t){if(t.issue===Q.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
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
79
  The problem is in the <${e.name}> Token Type
80
80
  Root cause: ${t.errMsg}.
81
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===Q.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
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
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 ch(e){return R(e,r=>me(r)?r.charCodeAt(0):r)}function rc(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}var kn=256,ea=[];function Lt(e){return e<kn?e:ea[e]}function bN(){if(v(ea)){ea=new Array(65536);for(let e=0;e<65536;e++)ea[e]=e>255?255+~~(e/255):e}}function Ht(e,t){let r=e.tokenTypeIdx;return r===t.tokenTypeIdx?!0:t.isParent===!0&&t.categoryMatchesMap[r]===!0}function _n(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}var uh=1,fh={};function Kt(e){let t=IN(e);PN(t),MN(t),vN(t),L(t,r=>{r.isParent=r.categoryMatches.length>0})}function IN(e){let t=V(e),r=e,n=!0;for(;n;){r=Rt(ue(R(r,i=>i.CATEGORIES)));let o=Or(r,t);t=t.concat(o),v(o)?n=!1:r=o}return t}function PN(e){L(e,t=>{oc(t)||(fh[uh]=t,t.tokenTypeIdx=uh++),lh(t)&&!N(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),lh(t)||(t.CATEGORIES=[]),kN(t)||(t.categoryMatches=[]),wN(t)||(t.categoryMatchesMap={})})}function vN(e){L(e,t=>{t.categoryMatches=[],L(t.categoryMatchesMap,(r,n)=>{t.categoryMatches.push(fh[n].tokenTypeIdx)})})}function MN(e){L(e,t=>{ph([],t)})}function ph(e,t){L(e,r=>{t.categoryMatchesMap[r.tokenTypeIdx]=!0}),L(t.CATEGORIES,r=>{let n=e.concat(t);J(n,r)||ph(n,r)})}function oc(e){return U(e,"tokenTypeIdx")}function lh(e){return U(e,"CATEGORIES")}function kN(e){return U(e,"categoryMatches")}function wN(e){return U(e,"categoryMatchesMap")}function dh(e){return U(e,"tokenTypeIdx")}var ic={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 Q;(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"})(Q||(Q={}));var Oo={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
84
- `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:ic,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Oo);var D=class{constructor(t,r=Oo){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}=go(i),u=s>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&u(`${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=Ae({},Oo,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===Oo.lineTerminatorsPattern)this.config.lineTerminatorsPattern=ah;else if(this.config.lineTerminatorCharacters===Oo.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),N(t)?o={modes:{defaultMode:V(t)},defaultMode:wn}:(i=!1,o=V(t))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(rh(o,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(nh(o,this.trackStartLines,this.config.lineTerminatorCharacters))})),o.modes=o.modes?o.modes:{},L(o.modes,(s,c)=>{o.modes[c]=Lr(s,u=>Pe(u))});let a=K(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(th(s,a))}),v(this.lexerDefinitionErrors)){Kt(s);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=eh(s,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[c]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[c]=u.charCodeToPatternIdxToConfig,this.emptyGroups=Ae({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[c]=u.canBeOptimized}})}),this.defaultMode=o.defaultMode,!v(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let c=R(this.lexerDefinitionErrors,u=>u.message).join(`-----------------------
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
87
  `);throw new Error(`Errors detected in definition of Lexer:
88
- `+c)}L(this.lexerDefinitionWarning,s=>{mo(s.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(nc?(this.chopInput=He,this.match=this.matchWithTest):(this.updateLastIndex=ee,this.match=this.matchWithExec),i&&(this.handleModes=ee),this.trackStartLines===!1&&(this.computeNewColumn=He),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=ee),/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=te(this.canModeBeOptimized,(c,u,l)=>(u===!1&&c.push(l),c),[]);if(r.ensureOptimizations&&!v(s))throw Error(`Lexer Modes: < ${s.join(", ")} > cannot be optimized.
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
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",()=>{zd()}),this.TRACE_INIT("toFastProperties",()=>{Eo(this)})})}tokenize(t,r=this.defaultMode){if(!v(this.lexerDefinitionErrors)){let o=R(this.lexerDefinitionErrors,i=>i.message).join(`-----------------------
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
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,u,l,f,p,h,E,y,S,d,g,m=t,x=m.length,C=0,Ce=0,bt=this.hasCustom?0:Math.floor(t.length/10),Ye=new Array(bt),$t=[],It=this.trackStartLines?1:void 0,Me=this.trackStartLines?1:void 0,Zr=oh(this.emptyGroups),qy=this.trackStartLines,es=this.config.lineTerminatorsPattern,Jo=0,er=[],to=[],Qo=[],Tu=[];Object.freeze(Tu);let ro;function Ru(){return er}function xu(be){let et=Lt(be),$r=to[et];return $r===void 0?Tu:$r}let Yy=be=>{if(Qo.length===1&&be.tokenType.PUSH_MODE===void 0){let et=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(be);$t.push({offset:be.startOffset,line:be.startLine,column:be.startColumn,length:be.image.length,message:et})}else{Qo.pop();let et=xt(Qo);er=this.patternIdxToConfig[et],to=this.charCodeToPatternIdxToConfig[et],Jo=er.length;let $r=this.canModeBeOptimized[et]&&this.config.safeMode===!1;to&&$r?ro=xu:ro=Ru}};function Ou(be){Qo.push(be),to=this.charCodeToPatternIdxToConfig[be],er=this.patternIdxToConfig[be],Jo=er.length,Jo=er.length;let et=this.canModeBeOptimized[be]&&this.config.safeMode===!1;to&&et?ro=xu:ro=Ru}Ou.call(this,r);let at,Lu=this.config.recoveryEnabled;for(;C<x;){c=null;let be=m.charCodeAt(C),et=ro(be),$r=et.length;for(n=0;n<$r;n++){at=et[n];let ze=at.pattern;u=null;let Pt=at.short;if(Pt!==!1?be===Pt&&(c=ze):at.isCustom===!0?(g=ze.exec(m,C,Ye,Zr),g!==null?(c=g[0],g.payload!==void 0&&(u=g.payload)):c=null):(this.updateLastIndex(ze,C),c=this.match(ze,t,C)),c!==null){if(s=at.longerAlt,s!==void 0){let tr=s.length;for(i=0;i<tr;i++){let vt=er[s[i]],_r=vt.pattern;if(l=null,vt.isCustom===!0?(g=_r.exec(m,C,Ye,Zr),g!==null?(a=g[0],g.payload!==void 0&&(l=g.payload)):a=null):(this.updateLastIndex(_r,C),a=this.match(_r,t,C)),a&&a.length>c.length){c=a,u=l,at=vt;break}}}break}}if(c!==null){if(f=c.length,p=at.group,p!==void 0&&(h=at.tokenTypeIdx,E=this.createTokenInstance(c,C,h,at.tokenType,It,Me,f),this.handlePayload(E,u),p===!1?Ce=this.addToken(Ye,Ce,E):Zr[p].push(E)),t=this.chopInput(t,f),C=C+f,Me=this.computeNewColumn(Me,f),qy===!0&&at.canLineTerminator===!0){let ze=0,Pt,tr;es.lastIndex=0;do Pt=es.test(c),Pt===!0&&(tr=es.lastIndex-1,ze++);while(Pt===!0);ze!==0&&(It=It+ze,Me=f-tr,this.updateTokenEndLineColumnLocation(E,p,tr,ze,It,Me,f))}this.handleModes(at,Yy,Ou,E)}else{let ze=C,Pt=It,tr=Me,vt=Lu===!1;for(;vt===!1&&C<x;)for(t=this.chopInput(t,1),C++,o=0;o<Jo;o++){let _r=er[o],ts=_r.pattern,Au=_r.short;if(Au!==!1?m.charCodeAt(C)===Au&&(vt=!0):_r.isCustom===!0?vt=ts.exec(m,C,Ye,Zr)!==null:(this.updateLastIndex(ts,C),vt=ts.exec(t)!==null),vt===!0)break}if(y=C-ze,Me=this.computeNewColumn(Me,y),d=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(m,ze,y,Pt,tr),$t.push({offset:ze,line:Pt,column:tr,length:y,message:d}),Lu===!1)break}}return this.hasCustom||(Ye.length=Ce),{tokens:Ye,groups:Zr,errors:$t}}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,u;r!==void 0&&(c=n===s-1,u=c?-1:0,o===1&&c===!0||(t.endLine=i+u,t.endColumn=a-1+-u))}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 Wt(e){return ac(e)?e.LABEL:e.name}function ac(e){return me(e.LABEL)&&e.LABEL!==""}var _N="parent",hh="categories",mh="label",gh="group",Eh="push_mode",yh="pop_mode",Sh="longer_alt",Th="line_breaks",Rh="start_chars_hint";function Wr(e){return BN(e)}function BN(e){let t=e.pattern,r={};if(r.name=e.name,Pe(t)||(r.PATTERN=t),U(e,_N))throw`The parent property is no longer supported.
93
- See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return U(e,hh)&&(r.CATEGORIES=e[hh]),Kt([r]),U(e,mh)&&(r.LABEL=e[mh]),U(e,gh)&&(r.GROUP=e[gh]),U(e,yh)&&(r.POP_MODE=e[yh]),U(e,Eh)&&(r.PUSH_MODE=e[Eh]),U(e,Sh)&&(r.LONGER_ALT=e[Sh]),U(e,Th)&&(r.LINE_BREAKS=e[Th]),U(e,Rh)&&(r.START_CHARS_HINT=e[Rh]),r}var Je=Wr({name:"EOF",pattern:D.NA});Kt([Je]);function Vr(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 P(e,t){return Ht(e,t)}var ta={buildMismatchTokenMessage({expected:e,actual:t,previous:r,ruleName:n}){return`Expecting ${ac(e)?`--> ${Wt(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: '`+Te(t).image+"'";if(n)return i+n+s;{let c=te(e,(p,h)=>p.concat(h),[]),u=R(c,p=>`[${R(p,h=>Wt(h)).join(", ")}]`),f=`one of these possible Token sequences:
95
- ${R(u,(p,h)=>` ${h+1}. ${p}`).join(`
96
- `)}`;return i+f+s}},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:r,ruleName:n}){let o="Expecting: ",a=`
97
- but found: '`+Te(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
- <${R(e,u=>`[${R(u,l=>Wt(l)).join(",")}]`).join(" ,")}>`;return o+c+a}}};Object.freeze(ta);var xh={buildRuleNotFoundError(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+`<-
99
- inside top level rule: ->`+e.name+"<-"}},ut={buildDuplicateFoundError(e,t){function r(l){return l instanceof M?l.terminalType.name:l instanceof B?l.nonTerminalName:""}let n=e.name,o=Te(t),i=o.idx,a=qe(o),s=r(o),c=i>0,u=`->${a}${c?i:""}<- ${s?`with argument: ->${s}<-`:""}
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
100
  appears more than once (${t.length} times) in the top level rule: ->${n}<-.
101
101
  For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
102
- `;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,`
103
- `),u},buildNamespaceConflictError(e){return`Namespace conflict found in grammar.
102
+ `;return f=f.replace(/[ \t]+/g," "),f=f.replace(/\s\s+/g,`
103
+ `),f},buildNamespaceConflictError(e){return`Namespace conflict found in grammar.
104
104
  The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.
105
105
  To resolve this make sure each Terminal and Non-Terminal names are unique
106
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=R(e.prefixPath,o=>Wt(o)).join(", "),r=e.alternation.idx===0?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix
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
108
  in <OR${r}> inside <${e.topLevelRule.name}> Rule,
109
109
  <${t}> may appears as a prefix path in all these alternatives.
110
110
  See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
111
- For Further details.`},buildAlternationAmbiguityError(e){let t=R(e.prefixPath,o=>Wt(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,
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
112
  <${t}> may appears as a prefix path in all these alternatives.
113
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=qe(e.repetition);return e.repetition.idx!==0&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.
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
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
116
  Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(e){return`An Alternation cannot have more than 256 alternatives:
117
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=R(e.leftRecursionPath,i=>i.name),n=`${t} --> ${r.concat([t]).join(" --> ")}`;return`Left Recursion found in grammar.
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
119
  rule: <${t}> can be invoked from itself (directly or indirectly)
120
120
  without consuming any Tokens. The grammar path that causes this is:
121
121
  ${n}
122
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 Be?t=e.topLevelRule.name:t=e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};function Oh(e,t){let r=new sc(e,t);return r.resolveRefs(),r.errors}var sc=class extends Fe{constructor(t,r){super(),this.nameToTopRule=t,this.errMsgProvider=r,this.errors=[]}resolveRefs(){L(j(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:ge.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}}};var cc=class extends Gt{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=V(this.path.ruleStack).reverse(),this.occurrenceStack=V(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(){v(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},ra=class extends cc{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 q({definition:o});this.possibleTokTypes=Gr(i),this.found=!0}}},Bn=class extends Gt{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}},na=class extends Bn{walkMany(t,r,n){if(t.idx===this.occurrence){let o=Te(r.concat(n));this.result.isEndOfRule=o===void 0,o instanceof M&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else super.walkMany(t,r,n)}},Lo=class extends Bn{walkManySep(t,r,n){if(t.idx===this.occurrence){let o=Te(r.concat(n));this.result.isEndOfRule=o===void 0,o instanceof M&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else super.walkManySep(t,r,n)}},oa=class extends Bn{walkAtLeastOne(t,r,n){if(t.idx===this.occurrence){let o=Te(r.concat(n));this.result.isEndOfRule=o===void 0,o instanceof M&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else super.walkAtLeastOne(t,r,n)}},Ao=class extends Bn{walkAtLeastOneSep(t,r,n){if(t.idx===this.occurrence){let o=Te(r.concat(n));this.result.isEndOfRule=o===void 0,o instanceof M&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else super.walkAtLeastOneSep(t,r,n)}};function ia(e,t,r=[]){r=V(r);let n=[],o=0;function i(s){return s.concat(le(e,o+1))}function a(s){let c=ia(i(s),t,r);return n.concat(c)}for(;r.length<t&&o<e.length;){let s=e[o];if(s instanceof q)return a(s.definition);if(s instanceof B)return a(s.definition);if(s instanceof F)n=a(s.definition);else if(s instanceof Y){let c=s.definition.concat([new w({definition:s.definition})]);return a(c)}else if(s instanceof z){let c=[new q({definition:s.definition}),new w({definition:[new M({terminalType:s.separator})].concat(s.definition)})];return a(c)}else if(s instanceof G){let c=s.definition.concat([new w({definition:[new M({terminalType:s.separator})].concat(s.definition)})]);n=a(c)}else if(s instanceof w){let c=s.definition.concat([new w({definition:s.definition})]);n=a(c)}else{if(s instanceof H)return L(s.definition,c=>{v(c.definition)===!1&&(n=a(c.definition))}),n;if(s instanceof M)r.push(s.terminalType);else throw Error("non exhaustive match")}o++}return n.push({partialPath:r,suffixDef:le(e,o)}),n}function aa(e,t,r,n){let o="EXIT_NONE_TERMINAL",i=[o],a="EXIT_ALTERNATIVE",s=!1,c=t.length,u=c-n-1,l=[],f=[];for(f.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!v(f);){let p=f.pop();if(p===a){s&&xt(f).idx<=u&&f.pop();continue}let h=p.def,E=p.idx,y=p.ruleStack,S=p.occurrenceStack;if(v(h))continue;let d=h[0];if(d===o){let g={idx:E,def:le(h),ruleStack:jt(y),occurrenceStack:jt(S)};f.push(g)}else if(d instanceof M)if(E<c-1){let g=E+1,m=t[g];if(r(m,d.terminalType)){let x={idx:g,def:le(h),ruleStack:y,occurrenceStack:S};f.push(x)}}else if(E===c-1)l.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=V(y);g.push(d.nonTerminalName);let m=V(S);m.push(d.idx);let x={idx:E,def:d.definition.concat(i,le(h)),ruleStack:g,occurrenceStack:m};f.push(x)}else if(d instanceof F){let g={idx:E,def:le(h),ruleStack:y,occurrenceStack:S};f.push(g),f.push(a);let m={idx:E,def:d.definition.concat(le(h)),ruleStack:y,occurrenceStack:S};f.push(m)}else if(d instanceof Y){let g=new w({definition:d.definition,idx:d.idx}),m=d.definition.concat([g],le(h)),x={idx:E,def:m,ruleStack:y,occurrenceStack:S};f.push(x)}else if(d instanceof z){let g=new M({terminalType:d.separator}),m=new w({definition:[g].concat(d.definition),idx:d.idx}),x=d.definition.concat([m],le(h)),C={idx:E,def:x,ruleStack:y,occurrenceStack:S};f.push(C)}else if(d instanceof G){let g={idx:E,def:le(h),ruleStack:y,occurrenceStack:S};f.push(g),f.push(a);let m=new M({terminalType:d.separator}),x=new w({definition:[m].concat(d.definition),idx:d.idx}),C=d.definition.concat([x],le(h)),Ce={idx:E,def:C,ruleStack:y,occurrenceStack:S};f.push(Ce)}else if(d instanceof w){let g={idx:E,def:le(h),ruleStack:y,occurrenceStack:S};f.push(g),f.push(a);let m=new w({definition:d.definition,idx:d.idx}),x=d.definition.concat([m],le(h)),C={idx:E,def:x,ruleStack:y,occurrenceStack:S};f.push(C)}else if(d instanceof H)for(let g=d.definition.length-1;g>=0;g--){let m=d.definition[g],x={idx:E,def:m.definition.concat(le(h)),ruleStack:y,occurrenceStack:S};f.push(x),f.push(a)}else if(d instanceof q)f.push({idx:E,def:d.definition.concat(le(h)),ruleStack:y,occurrenceStack:S});else if(d instanceof Be)f.push(FN(d,E,y,S));else throw Error("non exhaustive match")}return l}function FN(e,t,r,n){let o=V(r);o.push(e.name);let i=V(n);return i.push(1),{idx:t,def:e.definition,ruleStack:o,occurrenceStack:i}}var Z;(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"})(Z||(Z={}));function Uo(e){if(e instanceof F||e==="Option")return Z.OPTION;if(e instanceof w||e==="Repetition")return Z.REPETITION;if(e instanceof Y||e==="RepetitionMandatory")return Z.REPETITION_MANDATORY;if(e instanceof z||e==="RepetitionMandatoryWithSeparator")return Z.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof G||e==="RepetitionWithSeparator")return Z.REPETITION_WITH_SEPARATOR;if(e instanceof H||e==="Alternation")return Z.ALTERNATION;throw Error("non exhaustive match")}function ca(e){let{occurrence:t,rule:r,prodType:n,maxLookahead:o}=e,i=Uo(n);return i===Z.ALTERNATION?Fn(t,r,o):Dn(t,r,i,o)}function Ah(e,t,r,n,o,i){let a=Fn(e,t,r),s=Ph(a)?_n:Ht;return i(a,n,s,o)}function Uh(e,t,r,n,o,i){let a=Dn(e,t,o,r),s=Ph(a)?_n:Ht;return i(a[0],s,n)}function Nh(e,t,r,n){let o=e.length,i=Ie(e,a=>Ie(a,s=>s.length===1));if(t)return function(a){let s=R(a,c=>c.GATE);for(let c=0;c<o;c++){let u=e[c],l=u.length,f=s[c];if(!(f!==void 0&&f.call(this)===!1))e:for(let p=0;p<l;p++){let h=u[p],E=h.length;for(let y=0;y<E;y++){let S=this.LA(y+1);if(r(S,h[y])===!1)continue e}return c}}};if(i&&!n){let a=R(e,c=>ue(c)),s=te(a,(c,u,l)=>(L(u,f=>{U(c,f.tokenTypeIdx)||(c[f.tokenTypeIdx]=l),L(f.categoryMatches,p=>{U(c,p)||(c[p]=l)})}),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 u=0;u<c;u++){let l=s[u],f=l.length;for(let p=0;p<f;p++){let h=this.LA(p+1);if(r(h,l[p])===!1)continue e}return a}}}}function Ch(e,t,r){let n=Ie(e,i=>i.length===1),o=e.length;if(n&&!r){let i=ue(e);if(i.length===1&&v(i[0].categoryMatches)){let s=i[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===s}}else{let a=te(i,(s,c,u)=>(s[c.tokenTypeIdx]=!0,L(c.categoryMatches,l=>{s[l]=!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 u=this.LA(c+1);if(t(u,a[c])===!1)continue e}return!0}return!1}}var lc=class extends Gt{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,Z.OPTION,r,n)||super.walkOption(t,r,n)}walkAtLeastOne(t,r,n){this.checkIsTarget(t,Z.REPETITION_MANDATORY,r,n)||super.walkOption(t,r,n)}walkAtLeastOneSep(t,r,n){this.checkIsTarget(t,Z.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(t,r,n)}walkMany(t,r,n){this.checkIsTarget(t,Z.REPETITION,r,n)||super.walkOption(t,r,n)}walkManySep(t,r,n){this.checkIsTarget(t,Z.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(t,r,n)}},sa=class extends Fe{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,Z.OPTION)}visitRepetition(t){this.checkIsTarget(t,Z.REPETITION)}visitRepetitionMandatory(t){this.checkIsTarget(t,Z.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(t){this.checkIsTarget(t,Z.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(t){this.checkIsTarget(t,Z.REPETITION_WITH_SEPARATOR)}visitAlternation(t){this.checkIsTarget(t,Z.ALTERNATION)}};function Lh(e){let t=new Array(e);for(let r=0;r<e;r++)t[r]=[];return t}function uc(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 DN(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 bh(e,t){let r=R(e,a=>ia([a],1)),n=Lh(r.length),o=R(r,a=>{let s={};return L(a,c=>{let u=uc(c.partialPath);L(u,l=>{s[l]=!0})}),s}),i=r;for(let a=1;a<=t;a++){let s=i;i=Lh(s.length);for(let c=0;c<s.length;c++){let u=s[c];for(let l=0;l<u.length;l++){let f=u[l].partialPath,p=u[l].suffixDef,h=uc(f);if(DN(o,h,c)||v(p)||f.length===t){let y=n[c];if(ua(y,f)===!1){y.push(f);for(let S=0;S<h.length;S++){let d=h[S];o[c][d]=!0}}}else{let y=ia(p,a+1,f);i[c]=i[c].concat(y),L(y,S=>{let d=uc(S.partialPath);L(d,g=>{o[c][g]=!0})})}}}}return n}function Fn(e,t,r,n){let o=new sa(e,Z.ALTERNATION,n);return t.accept(o),bh(o.result,r)}function Dn(e,t,r,n){let o=new sa(e,r);t.accept(o);let i=o.result,s=new lc(t,e,r).startWalking(),c=new q({definition:i}),u=new q({definition:s});return bh([c,u],n)}function ua(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 Ih(e,t){return e.length<t.length&&Ie(e,(r,n)=>{let o=t[n];return r===o||o.categoryMatchesMap[r.tokenTypeIdx]})}function Ph(e){return Ie(e,t=>Ie(t,r=>Ie(r,n=>v(n.categoryMatches))))}function vh(e){let t=e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName});return R(t,r=>Object.assign({type:ge.CUSTOM_LOOKAHEAD_VALIDATION},r))}function Mh(e,t,r,n){let o=Ue(e,c=>jN(c,r)),i=qN(e,t,r),a=Ue(e,c=>KN(c,r)),s=Ue(e,c=>HN(c,e,n,r));return o.concat(i,a,s)}function jN(e,t){let r=new fc;e.accept(r);let n=r.allProductions,o=Ys(n,GN),i=Ve(o,s=>s.length>1);return R(j(i),s=>{let c=Te(s),u=t.buildDuplicateFoundError(e,s),l=qe(c),f={message:u,type:ge.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:l,occurrence:c.idx},p=kh(c);return p&&(f.parameter=p),f})}function GN(e){return`${qe(e)}_#_${e.idx}_#_${kh(e)}`}function kh(e){return e instanceof M?e.terminalType.name:e instanceof B?e.nonTerminalName:""}var fc=class extends Fe{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 HN(e,t,r,n){let o=[];if(te(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:ge.DUPLICATE_RULE_NAME,ruleName:e.name})}return o}function wh(e,t,r){let n=[],o;return J(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:ge.INVALID_RULE_OVERRIDE,ruleName:e})),n}function dc(e,t,r,n=[]){let o=[],i=la(t.definition);if(v(i))return[];{let a=e.name;J(i,e)&&o.push({message:r.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:n}),type:ge.LEFT_RECURSION,ruleName:a});let c=Or(i,n.concat([e])),u=Ue(c,l=>{let f=V(n);return f.push(l),dc(e,l,r,f)});return o.concat(u)}}function la(e){let t=[];if(v(e))return t;let r=Te(e);if(r instanceof B)t.push(r.referencedRule);else if(r instanceof q||r instanceof F||r instanceof Y||r instanceof z||r instanceof G||r instanceof w)t=t.concat(la(r.definition));else if(r instanceof H)t=ue(R(r.definition,i=>la(i.definition)));else if(!(r instanceof M))throw Error("non exhaustive match");let n=jr(r),o=e.length>1;if(n&&o){let i=le(e);return t.concat(la(i))}else return t}var No=class extends Fe{constructor(){super(...arguments),this.alternations=[]}visitAlternation(t){this.alternations.push(t)}};function _h(e,t){let r=new No;e.accept(r);let n=r.alternations;return Ue(n,i=>{let a=jt(i.definition);return Ue(a,(s,c)=>{let u=aa([s],[],Ht,1);return v(u)?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:i,emptyChoiceIdx:c}),type:ge.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:i.idx,alternative:c+1}]:[]})})}function Bh(e,t,r){let n=new No;e.accept(n);let o=n.alternations;return o=Lr(o,a=>a.ignoreAmbiguities===!0),Ue(o,a=>{let s=a.idx,c=a.maxLookahead||t,u=Fn(s,e,c,a),l=WN(u,a,e,r),f=VN(u,a,e,r);return l.concat(f)})}var pc=class extends Fe{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 KN(e,t){let r=new No;e.accept(r);let n=r.alternations;return Ue(n,i=>i.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:i}),type:ge.TOO_MANY_ALTS,ruleName:e.name,occurrence:i.idx}]:[])}function Fh(e,t,r){let n=[];return L(e,o=>{let i=new pc;o.accept(i);let a=i.allProductions;L(a,s=>{let c=Uo(s),u=s.maxLookahead||t,l=s.idx,p=Dn(l,o,c,u)[0];if(v(ue(p))){let h=r.buildEmptyRepetitionError({topLevelRule:o,repetition:s});n.push({message:h,type:ge.NO_NON_EMPTY_LOOKAHEAD,ruleName:o.name})}})}),n}function WN(e,t,r,n){let o=[],i=te(e,(s,c,u)=>(t.definition[u].ignoreAmbiguities===!0||L(c,l=>{let f=[u];L(e,(p,h)=>{u!==h&&ua(p,l)&&t.definition[h].ignoreAmbiguities!==!0&&f.push(h)}),f.length>1&&!ua(o,l)&&(o.push(l),s.push({alts:f,path:l}))}),s),[]);return R(i,s=>{let c=R(s.alts,l=>l+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:c,prefixPath:s.path}),type:ge.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:t.idx,alternatives:s.alts}})}function VN(e,t,r,n){let o=te(e,(a,s,c)=>{let u=R(s,l=>({idx:c,path:l}));return a.concat(u)},[]);return Rt(Ue(o,a=>{if(t.definition[a.idx].ignoreAmbiguities===!0)return[];let c=a.idx,u=a.path,l=Se(o,p=>t.definition[p.idx].ignoreAmbiguities!==!0&&p.idx<c&&Ih(p.path,u));return R(l,p=>{let h=[p.idx+1,c+1],E=t.idx===0?"":t.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:h,prefixPath:p.path}),type:ge.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:E,alternatives:h}})}))}function qN(e,t,r){let n=[],o=R(t,i=>i.name);return L(e,i=>{let a=i.name;if(J(o,a)){let s=r.buildNamespaceConflictError(i);n.push({message:s,type:ge.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),n}function Dh(e){let t=Cn(e,{errMsgProvider:xh}),r={};return L(e.rules,n=>{r[n.name]=n}),Oh(r,t.errMsgProvider)}function jh(e){return e=Cn(e,{errMsgProvider:ut}),Mh(e.rules,e.tokenTypes,e.errMsgProvider,e.grammarName)}var Gh="MismatchedTokenException",Hh="NoViableAltException",Kh="EarlyExitException",Wh="NotAllInputParsedException",Vh=[Gh,Hh,Kh,Wh];Object.freeze(Vh);function At(e){return J(Vh,e.name)}var jn=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)}},qr=class extends jn{constructor(t,r,n){super(t,r),this.previousToken=n,this.name=Gh}},Co=class extends jn{constructor(t,r,n){super(t,r),this.previousToken=n,this.name=Hh}},bo=class extends jn{constructor(t,r){super(t,r),this.name=Wh}},Io=class extends jn{constructor(t,r,n){super(t,r),this.previousToken=n,this.name=Kh}};var hc={},gc="InRuleRecoveryException",mc=class extends Error{constructor(t){super(t),this.name=gc}},fa=class{initRecoverable(t){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=U(t,"recoveryEnabled")?t.recoveryEnabled:De.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=YN)}getTokenToInsert(t){let r=Vr(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,u=this.LA(1),l=this.LA(1),f=()=>{let p=this.LA(0),h=this.errorMessageProvider.buildMismatchTokenMessage({expected:o,actual:u,previous:p,ruleName:this.getCurrRuleFullName()}),E=new qr(h,u,this.LA(0));E.resyncedTokens=jt(s),this.SAVE_ERROR(E)};for(;!c;)if(this.tokenMatcher(l,o)){f();return}else if(n.call(this)){f(),t.apply(this,r);return}else this.tokenMatcher(l,i)?c=!0:(l=this.SKIP_TOKEN(),this.addToResyncTokens(l,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 mc("sad sad panda")}canPerformInRuleRecovery(t,r){return this.canRecoverWithSingleTokenInsertion(t,r)||this.canRecoverWithSingleTokenDeletion(t)}canRecoverWithSingleTokenInsertion(t,r){if(!this.canTokenTypeBeInsertedInRecovery(t)||v(r))return!1;let n=this.LA(1);return Ot(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 J(n,t)}findReSyncTokenType(){let t=this.flattenFollowSet(),r=this.LA(1),n=2;for(;;){let o=Ot(t,i=>P(r,i));if(o!==void 0)return o;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return hc;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 R(t,(n,o)=>o===0?hc:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[o],inRule:this.shortRuleNameToFullName(t[o-1])})}flattenFollowSet(){let t=R(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return ue(t)}getFollowSetFromFollowKey(t){if(t===hc)return[Je];let r=t.ruleName+t.idxInCallingRule+Yi+t.inRule;return this.resyncFollows[r]}addToResyncTokens(t,r){return this.tokenMatcher(t,Je)||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 jt(r)}attemptInRepetitionRecovery(t,r,n,o,i,a,s){}getCurrentGrammarPath(t,r){let n=this.getHumanReadableRuleStack(),o=V(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:o,lastTok:t,lastTokOccurrence:r}}getHumanReadableRuleStack(){return R(this.RULE_STACK,t=>this.shortRuleNameToFullName(t))}};function YN(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(),h=this.getGAstProductions()[p];c=new i(h,o).startWalking(),this.firstAfterRepMap[s]=c}let u=c.token,l=c.occurrence,f=c.isEndOfRule;this.RULE_STACK.length===1&&f&&u===void 0&&(u=Je,l=1),!(u===void 0||l===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,l,a)&&this.tryInRepetitionRecovery(e,t,r,u)}function pa(e,t,r){return r|t|e}var Yr=class{constructor(t){var r;this.maxLookahead=(r=t?.maxLookahead)!==null&&r!==void 0?r:De.maxLookahead}validate(t){let r=this.validateNoLeftRecursion(t.rules);if(v(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 Ue(t,r=>dc(r,r,ut))}validateEmptyOrAlternatives(t){return Ue(t,r=>_h(r,ut))}validateAmbiguousAlternationAlternatives(t,r){return Ue(t,n=>Bh(n,r,ut))}validateSomeNonEmptyLookaheadPath(t,r){return Fh(t,r,ut)}buildLookaheadForAlternation(t){return Ah(t.prodOccurrence,t.rule,t.maxLookahead,t.hasPredicates,t.dynamicTokensEnabled,Nh)}buildLookaheadForOptional(t){return Uh(t.prodOccurrence,t.rule,t.maxLookahead,t.dynamicTokensEnabled,Uo(t.prodType),Ch)}};var ha=class{initLooksAhead(t){this.dynamicTokensEnabled=U(t,"dynamicTokensEnabled")?t.dynamicTokensEnabled:De.dynamicTokensEnabled,this.maxLookahead=U(t,"maxLookahead")?t.maxLookahead:De.maxLookahead,this.lookaheadStrategy=U(t,"lookaheadStrategy")?t.lookaheadStrategy:new Yr({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}=zN(r);L(n,u=>{let l=u.idx===0?"":u.idx;this.TRACE_INIT(`${qe(u)}${l}`,()=>{let f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),p=pa(this.fullRuleNameToShort[r.name],256,u.idx);this.setLaFuncCache(p,f)})}),L(o,u=>{this.computeLookaheadFunc(r,u.idx,768,"Repetition",u.maxLookahead,qe(u))}),L(i,u=>{this.computeLookaheadFunc(r,u.idx,512,"Option",u.maxLookahead,qe(u))}),L(a,u=>{this.computeLookaheadFunc(r,u.idx,1024,"RepetitionMandatory",u.maxLookahead,qe(u))}),L(s,u=>{this.computeLookaheadFunc(r,u.idx,1536,"RepetitionMandatoryWithSeparator",u.maxLookahead,qe(u))}),L(c,u=>{this.computeLookaheadFunc(r,u.idx,1280,"RepetitionWithSeparator",u.maxLookahead,qe(u))})})})}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=pa(this.fullRuleNameToShort[t.name],n,r);this.setLaFuncCache(c,s)})}getKeyForAutomaticLookahead(t,r){let n=this.getLastExplicitRuleShortName();return pa(n,t,r)}getLaFuncFromCache(t){return this.lookAheadFuncsCache.get(t)}setLaFuncCache(t,r){this.lookAheadFuncsCache.set(t,r)}},Ec=class extends Fe{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)}},da=new Ec;function zN(e){da.reset(),e.accept(da);let t=da.dslMethods;return da.reset(),t}function Tc(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset)}function Rc(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 qh(e,t,r){e.children[r]===void 0?e.children[r]=[t]:e.children[r].push(t)}function Yh(e,t,r){e.children[t]===void 0?e.children[t]=[r]:e.children[t].push(r)}var XN="name";function xc(e,t){Object.defineProperty(e,XN,{enumerable:!1,configurable:!0,writable:!1,value:t})}function JN(e,t){let r=K(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 u=a[c];u.tokenTypeIdx===void 0&&this[u.name](u.children,t)}}}function zh(e,t){let r=function(){};xc(r,e+"BaseSemantics");let n={visit:function(o,i){if(N(o)&&(o=o[0]),!Pe(o))return this[o.name](o.children,i)},validateVisitor:function(){let o=QN(this,t);if(!v(o)){let i=R(o,a=>a.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
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
124
  ${i.join(`
125
125
 
126
126
  `).replace(/\n/g,`
127
- `)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=t,r}function Xh(e,t,r){let n=function(){};xc(n,e+"BaseSemanticsWithDefaults");let o=Object.create(r.prototype);return L(t,i=>{o[i]=JN}),n.prototype=o,n.prototype.constructor=n,n}var Oc;(function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"})(Oc||(Oc={}));function QN(e,t){return ZN(e,t)}function ZN(e,t){let r=Se(t,o=>_e(e[o])===!1),n=R(r,o=>({msg:`Missing visitor method: <${o}> on ${e.constructor.name} CST Visitor.`,type:Oc.MISSING_METHOD,methodName:o}));return Rt(n)}var ya=class{initTreeBuilder(t){if(this.CST_STACK=[],this.outputCst=t.outputCst,this.nodeLocationTracking=U(t,"nodeLocationTracking")?t.nodeLocationTracking:De.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ee,this.cstFinallyStateUpdate=ee,this.cstPostTerminal=ee,this.cstPostNonTerminal=ee,this.cstPostRule=ee;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Rc,this.setNodeLocationFromNode=Rc,this.cstPostRule=ee,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ee,this.setNodeLocationFromNode=ee,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Tc,this.setNodeLocationFromNode=Tc,this.cstPostRule=ee,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ee,this.setNodeLocationFromNode=ee,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ee,this.setNodeLocationFromNode=ee,this.cstPostRule=ee,this.setInitialNodeLocation=ee;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];qh(n,r,t),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(t,r){let n=this.CST_STACK[this.CST_STACK.length-1];Yh(n,r,t),this.setNodeLocationFromNode(n.location,t.location)}getBaseCstVisitorConstructor(){if(Pe(this.baseCstVisitorConstructor)){let t=zh(this.className,K(this.gastProductionsCache));return this.baseCstVisitorConstructor=t,t}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Pe(this.baseCstVisitorWithDefaultsConstructor)){let t=Xh(this.className,K(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 Sa=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)):Gn}LA(t){let r=this.currIdx+t;return r<0||this.tokVectorLength<=r?Gn: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 Ta=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=Hn){if(J(this.definedRulesNames,t)){let a={message:ut.buildDuplicateRuleNameError({topLevelRule:t,grammarName:this.className}),type:ge.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=Hn){let o=wh(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(At(o))return!1;throw o}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return qi(j(this.gastProductionsCache))}};var Ra=class{initRecognizerEngine(t,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=_n,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.
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
128
  See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
129
- For Further details.`);if(N(t)){if(v(t))throw Error(`A Token Vocabulary cannot be empty.
129
+ For Further details.`);if(b(t)){if(M(t))throw Error(`A Token Vocabulary cannot be empty.
130
130
  Note that the first argument for the parser constructor
131
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
132
  See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
133
- For Further details.`)}if(N(t))this.tokensMap=te(t,(i,a)=>(i[a.name]=a,i),{});else if(U(t,"modes")&&Ie(ue(j(t.modes)),dh)){let i=ue(j(t.modes)),a=bn(i);this.tokensMap=te(a,(s,c)=>(s[c.name]=c,s),{})}else if($(t))this.tokensMap=V(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=Je;let n=U(t,"modes")?ue(j(t.modes)):j(t),o=Ie(n,i=>v(i.categoryMatches));this.tokenMatcher=o?_n:Ht,Kt(j(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:Hn.resyncEnabled,i=U(n,"recoveryValueFunc")?n.recoveryValueFunc:Hn.recoveryValueFunc,a=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=t,this.fullRuleNameToShort[t]=a;let s;return this.outputCst===!0?s=function(...l){try{this.ruleInvocationStateUpdate(a,t,this.subruleIdx),r.apply(this,l);let f=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(f),f}catch(f){return this.invokeRuleCatch(f,o,i)}finally{this.ruleFinallyStateUpdate()}}:s=function(...l){try{return this.ruleInvocationStateUpdate(a,t,this.subruleIdx),r.apply(this,l)}catch(f){return this.invokeRuleCatch(f,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(At(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,Z.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[t,r],o,1024,t,oa)}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,Ao],s,1536,t,Ao)}else throw this.raiseEarlyExitException(t,Z.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,na,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,Lo],s,1280,t,Lo)}}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=N(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 bo(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 At(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 qr(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===gc?n:i}}else throw n}saveRecogState(){let t=this.errors,r=V(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),Je)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}};var xa=class{initErrorHandler(t){this._errors=[],this.errorMessageProvider=U(t,"errorMessageProvider")?t.errorMessageProvider:De.errorMessageProvider}SAVE_ERROR(t){if(At(t))return t.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:V(this.RULE_OCCURRENCE_STACK)},this._errors.push(t),t;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return V(this._errors)}set errors(t){this._errors=t}raiseEarlyExitException(t,r,n){let o=this.getCurrRuleFullName(),i=this.getGAstProductions()[o],s=Dn(t,i,r,this.maxLookahead)[0],c=[];for(let l=1;l<=this.maxLookahead;l++)c.push(this.LA(l));let u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:s,actual:c,previous:this.LA(0),customUserDescription:n,ruleName:o});throw this.SAVE_ERROR(new Io(u,this.LA(1),this.LA(0)))}raiseNoAltException(t,r){let n=this.getCurrRuleFullName(),o=this.getGAstProductions()[n],i=Fn(t,o,this.maxLookahead),a=[];for(let u=1;u<=this.maxLookahead;u++)a.push(this.LA(u));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 Co(c,this.LA(1),s))}};var Oa=class{initContentAssist(){}computeContentAssist(t,r){let n=this.gastProductionsCache[t];if(Pe(n))throw Error(`Rule ->${t}<- does not exist in this grammar.`);return aa([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(t){let r=Te(t.ruleStack),o=this.getGAstProductions()[r];return new ra(o,t).startWalking()}};var Ua={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Ua);var Jh=!0,Qh=Math.pow(2,8)-1,$h=Wr({name:"RECORDING_PHASE_TOKEN",pattern:D.NA});Kt([$h]);var em=Vr($h,`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(em);var eC={name:`This CSTNode indicates the Parser is in Recording Phase
136
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},La=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 Gn}topLevelRuleRecord(t,r){try{let n=new Be({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+`
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
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 vo.call(this,F,t,r)}atLeastOneInternalRecord(t,r){vo.call(this,Y,r,t)}atLeastOneSepFirstInternalRecord(t,r){vo.call(this,z,r,t,Jh)}manyInternalRecord(t,r){vo.call(this,w,r,t)}manySepFirstInternalRecord(t,r){vo.call(this,G,r,t,Jh)}orInternalRecord(t,r){return tC.call(this,t,r)}subruleInternalRecord(t,r,n){if(Aa(r),!t||U(t,"ruleName")===!1){let s=new Error(`<SUBRULE${Zh(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=xt(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?eC:Ua}consumeInternalRecord(t,r,n){if(Aa(r),!oc(t)){let a=new Error(`<CONSUME${Zh(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=xt(this.recordingProdStack),i=new M({idx:r,terminalType:t,label:n?.LABEL});return o.definition.push(i),em}};function vo(e,t,r,n=!1){Aa(r);let o=xt(this.recordingProdStack),i=_e(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(),Ua}function tC(e,t){Aa(t);let r=xt(this.recordingProdStack),n=N(e)===!1,o=n===!1?e:e.DEF,i=new H({definition:[],idx:t,ignoreAmbiguities:n&&e.IGNORE_AMBIGUITIES===!0});U(e,"MAX_LOOKAHEAD")&&(i.maxLookahead=e.MAX_LOOKAHEAD);let a=ho(o,s=>_e(s.GATE));return i.hasPredicates=a,r.definition.push(i),L(o,s=>{let c=new q({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()}),Ua}function Zh(e){return e===0?"":`${e}`}function Aa(e){if(e<0||e>Qh){let t=new Error(`Invalid DSL Method idx value: <${e}>
141
- Idx value must be a none negative value smaller than ${Qh+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}var Na=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=De.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}=go(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 tm(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 Gn=Vr(Je,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Gn);var De=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:ta,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Hn=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0}),ge;(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"})(ge||(ge={}));var Mo=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",()=>{Eo(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=Dh({rules:j(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(v(n)&&this.skipValidations===!1){let o=jh({rules:j(this.gastProductionsCache),tokenTypes:j(this.tokensMap),errMsgProvider:ut,grammarName:r}),i=vh({lookaheadStrategy:this.lookaheadStrategy,rules:j(this.gastProductionsCache),tokenTypes:j(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(o,i)}}),v(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{let o=Yd(j(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:j(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(j(this.gastProductionsCache))})),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!v(this.definitionErrors))throw t=R(this.definitionErrors,o=>o.message),new Error(`Parser Definition Errors detected:
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
142
  ${t.join(`
143
143
  -------------------------------
144
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
145
  Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
146
146
  See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
147
- For further details.`);this.skipValidations=U(r,"skipValidations")?r.skipValidations:De.skipValidations}};Mo.DEFER_DEFINITION_ERRORS_HANDLING=!1;tm(Mo,[fa,ha,ya,Sa,Ra,Ta,xa,Oa,La,Na]);var ko=class extends Mo{constructor(t,r=De){let n=V(r);n.outputCst=!0,super(t,n)}};var Dg=Mt(Bg(),1);var Cc=(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)}},Bo=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]),RI=[[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]];Cc(Bo,RI);var bc=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]),xI=[[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]];Cc(bc,xI);var OI=[[0,8],[14,27],[127,159],[768,879],[6832,6911],[7616,7679],[8400,8447],[65056,65071],[48,57]];Cc(bc,OI);var Fg=new Set((function*(){yield*Bo,yield*bc})());var Ic={};function jg(e){let t=e;return Object.keys(Ic).forEach(r=>{let n=Ic[r],o=new RegExp(`{{${r}}}`,"g");t=t.replace(o,n)}),t}function ve(e,t){Ic[e]=jg(t)}function Qe(e,t){let r=jg(e);return new RegExp(r,t)}ve("Digits","[0-9]([0-9_]*[0-9])?");ve("ExponentPart","[eE][+-]?{{Digits}}");ve("HexDigit","[0-9a-fA-F]");ve("HexDigits","{{HexDigit}}(({{HexDigit}}|'_')*{{HexDigit}})?");ve("FloatTypeSuffix","[fFdD]");ve("LineTerminator","(\\x0A|(\\x0D(\\x0A)?))");ve("UnicodeMarker","uu*");ve("UnicodeEscape","\\\\{{UnicodeMarker}}{{HexDigit}}{4}");ve("RawInputCharacter","\\\\{{UnicodeMarker}}[0-9a-fA-F]{4}");ve("UnicodeInputCharacter","({{UnicodeEscape}}|{{RawInputCharacter}})");ve("OctalDigit","[0-7]");ve("ZeroToThree","[0-3]");ve("OctalEscape","\\\\({{OctalDigit}}|{{ZeroToThree}}?{{OctalDigit}}{2})");ve("EscapeSequence",`\\\\[bstnfr"'\\\\]|{{OctalEscape}}`);ve("StringCharacter",'(?:(?:{{EscapeSequence}})|{{UnicodeEscape}}|(?!["\\\\]).)');ve("TextBlockCharacter","(?:(?:{{EscapeSequence}})|{{UnicodeEscape}}|(?!\\\\).|\\\\?{{LineTerminator}})");function AI(e,t){let r=t,n=e.codePointAt(r);for(Bo.has(n)&&(r++,n>65535&&r++,n=e.codePointAt(r));Fg.has(n);)r++,n>65535&&r++,n=e.codePointAt(r);return r===t?null:[e.substring(t,r)]}var zr=Wr({name:"Identifier",pattern:{exec:AI},line_breaks:!1,start_chars_hint:Array.from(Bo,e=>String.fromCharCode(e))}),Vt={modes:{global:[],stringTemplate:[],textBlockTemplate:[]},defaultMode:"global"},Gg=Object.keys(Vt.modes),Ze={};function O(e,t=Gg){e.label||(typeof e.pattern=="string"?e.label=`'${e.pattern}'`:e.pattern instanceof RegExp&&(e.label=`'${e.name}'`));let r=Wr(e);return t.forEach(n=>Vt.modes[n].push(r)),Ze[e.name]=r,r}function qt(e){return e.longer_alt=zr,O(e)}var UI=O({name:"RestrictedKeyword",pattern:D.NA}),Hg=O({name:"Keyword",pattern:D.NA}),ot=O({name:"AssignmentOperator",pattern:D.NA}),Re=O({name:"BinaryOperator",pattern:D.NA}),Wn=O({name:"UnaryPrefixOperator",pattern:D.NA}),ba=O({name:"UnaryPrefixOperatorNotPlusMinus",pattern:D.NA}),Kg=O({name:"UnarySuffixOperator",pattern:D.NA}),it=O({name:"Separators",pattern:D.NA});O({name:"WhiteSpace",pattern:Qe("[\\x09\\x20\\x0C]|{{LineTerminator}}"),group:D.SKIPPED});O({name:"LineComment",pattern:/\/\/[^\n\r]*/,group:"comments"});O({name:"TraditionalComment",pattern:/\/\*([^*]|\*(?!\/))*\*\//,group:"comments"});O({name:"BinaryLiteral",pattern:/0[bB][01]([01_]*[01])?[lL]?/});O({name:"FloatLiteral",pattern:Qe("{{Digits}}\\.({{Digits}})?({{ExponentPart}})?({{FloatTypeSuffix}})?|\\.{{Digits}}({{ExponentPart}})?({{FloatTypeSuffix}})?|{{Digits}}{{ExponentPart}}({{FloatTypeSuffix}})?|{{Digits}}({{ExponentPart}})?{{FloatTypeSuffix}}")});O({name:"OctalLiteral",pattern:/0_*[0-7]([0-7_]*[0-7])?[lL]?/});O({name:"HexFloatLiteral",pattern:Qe("0[xX]({{HexDigits}}\\.?|({{HexDigits}})?\\.{{HexDigits}})[pP][+-]?{{Digits}}[fFdD]?")});O({name:"HexLiteral",pattern:/0[xX][0-9a-fA-F]([0-9a-fA-F_]*[0-9a-fA-F])?[lL]?/});O({name:"DecimalLiteral",pattern:Qe("(0|[1-9](_+{{Digits}}|({{Digits}})?))[lL]?")});O({name:"CharLiteral",pattern:Qe("'(?:[^\\\\']|(?:(?:{{EscapeSequence}})|{{UnicodeInputCharacter}}))'")});O({name:"TextBlock",pattern:Qe('"""[\\x09\\x20\\x0C]*{{LineTerminator}}{{TextBlockCharacter}}*?"""')});O({name:"TextBlockTemplateBegin",pattern:Qe('"""{{LineTerminator}}{{TextBlockCharacter}}*?\\\\\\{'),push_mode:"textBlockTemplate"});O({name:"TextBlockTemplateEnd",pattern:Qe('\\}{{TextBlockCharacter}}*?"""'),pop_mode:!0},["textBlockTemplate"]);O({name:"StringLiteral",pattern:Qe('"{{StringCharacter}}*?"')});O({name:"StringTemplateBegin",pattern:Qe('"{{StringCharacter}}*?\\\\\\{'),push_mode:"stringTemplate"});O({name:"StringTemplateEnd",pattern:Qe('\\}{{StringCharacter}}*?"'),pop_mode:!0},["stringTemplate"]);O({name:"StringTemplateMid",pattern:Qe("\\}{{StringCharacter}}*?\\\\\\{")},["stringTemplate"]);O({name:"TextBlockTemplateMid",pattern:Qe("\\}{{TextBlockCharacter}}*?\\\\\\{")},["textBlockTemplate"]);var NI=["open","module","requires","transitive","exports","opens","to","uses","provides","when","with","sealed","non-sealed","permits"];Wg(NI).forEach(e=>{qt({name:e[0].toUpperCase()+(0,Dg.default)(e.substr(1)),pattern:e,categories:[zr,UI]})});var CI=["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"]];Wg(CI).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:Hg};t&&(o.label=`'${r}'`),qt(o)});qt({name:"Instanceof",pattern:"instanceof",categories:[Hg,Re]});qt({name:"Var",pattern:"var",categories:zr});qt({name:"Yield",pattern:"yield",categories:zr});qt({name:"Record",pattern:"record",categories:zr});qt({name:"True",pattern:"true"});qt({name:"False",pattern:"false"});qt({name:"Null",pattern:"null"});O({name:"At",pattern:"@",categories:[it]});O({name:"Arrow",pattern:"->"});O({name:"DotDotDot",pattern:"...",categories:[it]});O({name:"Dot",pattern:".",categories:[it]});O({name:"Comma",pattern:",",categories:[it]});O({name:"Semicolon",pattern:";",categories:[it]});O({name:"ColonColon",pattern:"::",categories:[it]});O({name:"Colon",pattern:":"});O({name:"QuestionMark",pattern:"?"});O({name:"LBrace",pattern:"(",categories:[it]});O({name:"RBrace",pattern:")",categories:[it]});O({name:"LCurly",pattern:"{",categories:[it],push_mode:Vt.defaultMode});O({name:"RCurly",pattern:"}",categories:[it],pop_mode:!0},[Vt.defaultMode]);O({name:"LSquare",pattern:"[",categories:[it]});O({name:"RSquare",pattern:"]",categories:[it]});O({name:"MinusMinus",pattern:"--",categories:[Wn,Kg,ba]});O({name:"PlusPlus",pattern:"++",categories:[Wn,Kg,ba]});O({name:"Complement",pattern:"~",categories:[Wn,ba]});O({name:"LessEquals",pattern:"<=",categories:[Re]});O({name:"LessLessEquals",pattern:"<<=",categories:[ot]});O({name:"Less",pattern:"<",categories:[Re]});O({name:"GreaterEquals",pattern:">=",categories:[Re]});O({name:"GreaterGreaterEquals",pattern:">>=",categories:[ot]});O({name:"GreaterGreaterGreaterEquals",pattern:">>>=",categories:[ot]});O({name:"Greater",pattern:">",categories:[Re]});O({name:"EqualsEquals",pattern:"==",categories:[Re]});O({name:"Equals",pattern:"=",categories:[Re,ot]});O({name:"MinusEquals",pattern:"-=",categories:[ot]});O({name:"Minus",pattern:"-",categories:[Re,Wn]});O({name:"PlusEquals",pattern:"+=",categories:[ot]});O({name:"Plus",pattern:"+",categories:[Re,Wn]});O({name:"AndAnd",pattern:"&&",categories:[Re]});O({name:"AndEquals",pattern:"&=",categories:[ot]});O({name:"And",pattern:"&",categories:[Re]});O({name:"XorEquals",pattern:"^=",categories:[ot]});O({name:"Xor",pattern:"^",categories:[Re]});O({name:"NotEquals",pattern:"!=",categories:[Re]});O({name:"OrOr",pattern:"||",categories:[Re]});O({name:"OrEquals",pattern:"|=",categories:[ot]});O({name:"Or",pattern:"|",categories:[Re]});O({name:"MultiplyEquals",pattern:"*=",categories:[ot]});O({name:"Star",pattern:"*",categories:[Re]});O({name:"DivideEquals",pattern:"/=",categories:[ot]});O({name:"Divide",pattern:"/",categories:[Re]});O({name:"ModuloEquals",pattern:"%=",categories:[ot]});O({name:"Modulo",pattern:"%",categories:[Re]});O({name:"Not",pattern:"!",categories:[Wn,ba]});Gg.forEach(e=>Vt.modes[e].push(zr));Ze.Identifier=zr;function Wg(e){return e.sort((t,r)=>r.length-t.length)}function Fo(){return(typeof process<"u"&&process.env&&process.env["prettier-java-development-mode"]==="enabled")===!1}var Vg=new D(Vt,{ensureOptimizations:!0,skipValidations:Fo()});function Xr(e,t,r){return`${e.name}_${t}_${r}`}var Ur=1,bI=2,qg=4,Yg=5;var Yn=7,II=8,PI=9,vI=10,MI=11,zg=12,Do=class{constructor(t){this.target=t}isEpsilon(){return!1}},Vn=class extends Do{constructor(t,r){super(t),this.tokenType=r}},jo=class extends Do{constructor(t){super(t)}isEpsilon(){return!0}},qn=class extends Do{constructor(t,r,n){super(t),this.rule=r,this.followState=n}isEpsilon(){return!0}};function Xg(e){let t={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};kI(t,e);let r=e.length;for(let n=0;n<r;n++){let o=e[n],i=Jr(t,o,o);i!==void 0&&VI(t,o,i)}return t}function kI(e,t){let r=t.length;for(let n=0;n<r;n++){let o=t[n],i=xe(e,o,void 0,{type:bI}),a=xe(e,o,void 0,{type:Yn});i.stop=a,e.ruleToStartState.set(o,i),e.ruleToStopState.set(o,a)}}function Jg(e,t,r){return r instanceof M?Pc(e,t,r.terminalType,r):r instanceof B?WI(e,t,r):r instanceof H?DI(e,t,r):r instanceof F?jI(e,t,r):r instanceof w?wI(e,t,r):r instanceof G?_I(e,t,r):r instanceof Y?BI(e,t,r):r instanceof z?FI(e,t,r):Jr(e,t,r)}function wI(e,t,r){let n=xe(e,t,r,{type:Yg});Nr(e,n);let o=zn(e,t,n,r,Jr(e,t,r));return Zg(e,t,r,o)}function _I(e,t,r){let n=xe(e,t,r,{type:Yg});Nr(e,n);let o=zn(e,t,n,r,Jr(e,t,r)),i=Pc(e,t,r.separator,r);return Zg(e,t,r,o,i)}function BI(e,t,r){let n=xe(e,t,r,{type:qg});Nr(e,n);let o=zn(e,t,n,r,Jr(e,t,r));return Qg(e,t,r,o)}function FI(e,t,r){let n=xe(e,t,r,{type:qg});Nr(e,n);let o=zn(e,t,n,r,Jr(e,t,r)),i=Pc(e,t,r.separator,r);return Qg(e,t,r,o,i)}function DI(e,t,r){let n=xe(e,t,r,{type:Ur});Nr(e,n);let o=R(r.definition,a=>Jg(e,t,a));return zn(e,t,n,r,...o)}function jI(e,t,r){let n=xe(e,t,r,{type:Ur});Nr(e,n);let o=zn(e,t,n,r,Jr(e,t,r));return GI(e,t,r,o)}function Jr(e,t,r){let n=Se(R(r.definition,o=>Jg(e,t,o)),o=>o!==void 0);return n.length===1?n[0]:n.length===0?void 0:KI(e,n)}function Qg(e,t,r,n,o){let i=n.left,a=n.right,s=xe(e,t,r,{type:MI});Nr(e,s);let c=xe(e,t,r,{type:zg});return i.loopback=s,c.loopback=s,e.decisionMap[Xr(t,o?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=s,de(a,s),o===void 0?(de(s,i),de(s,c)):(de(s,c),de(s,o.left),de(o.right,i)),{left:i,right:c}}function Zg(e,t,r,n,o){let i=n.left,a=n.right,s=xe(e,t,r,{type:vI});Nr(e,s);let c=xe(e,t,r,{type:zg}),u=xe(e,t,r,{type:PI});return s.loopback=u,c.loopback=u,de(s,i),de(s,c),de(a,u),o!==void 0?(de(u,c),de(u,o.left),de(o.right,i)):de(u,s),e.decisionMap[Xr(t,o?"RepetitionWithSeparator":"Repetition",r.idx)]=s,{left:s,right:c}}function GI(e,t,r,n){let o=n.left,i=n.right;return de(o,i),e.decisionMap[Xr(t,"Option",r.idx)]=o,n}function Nr(e,t){return e.decisionStates.push(t),t.decision=e.decisionStates.length-1,t.decision}function zn(e,t,r,n,...o){let i=xe(e,t,n,{type:II,start:r});r.end=i;for(let s of o)s!==void 0?(de(r,s.left),de(s.right,i)):de(r,i);let a={left:r,right:i};return e.decisionMap[Xr(t,HI(n),n.idx)]=r,a}function HI(e){if(e instanceof H)return"Alternation";if(e instanceof F)return"Option";if(e instanceof w)return"Repetition";if(e instanceof G)return"RepetitionWithSeparator";if(e instanceof Y)return"RepetitionMandatory";if(e instanceof z)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function KI(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 qn,u=s,l=t[i+1].left;a.left.type===Ur&&a.right.type===Ur&&s!==void 0&&(c&&u.followState===a.right||s.target===a.right)?(c?u.followState=l:s.target=l,qI(e,a.right)):de(a.right,l)}let n=t[0],o=t[r-1];return{left:n.left,right:o.right}}function Pc(e,t,r,n){let o=xe(e,t,n,{type:Ur}),i=xe(e,t,n,{type:Ur});return vc(o,new Vn(i,r)),{left:o,right:i}}function WI(e,t,r){let n=r.referencedRule,o=e.ruleToStartState.get(n),i=xe(e,t,r,{type:Ur}),a=xe(e,t,r,{type:Ur}),s=new qn(o,n,a);return vc(i,s),{left:i,right:a}}function VI(e,t,r){let n=e.ruleToStartState.get(t);de(n,r.left);let o=e.ruleToStopState.get(t);return de(r.right,o),{left:n,right:o}}function de(e,t){let r=new jo(t);vc(e,r)}function xe(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 vc(e,t){e.transitions.length===0&&(e.epsilonOnlyTransitions=t.isEpsilon()),e.transitions.push(t)}function qI(e,t){e.states.splice(e.states.indexOf(t),1)}var Go={},Xn=class{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(t){let r=Mc(t);r in this.map||(this.map[r]=this.configs.length,this.configs.push(t))}get elements(){return this.configs}get alts(){return R(this.configs,t=>t.alt)}get key(){let t="";for(let r in this.map)t+=r+":";return t}};function Mc(e,t=!0){return`${t?`a${e.alt}`:""}s${e.state.stateNumber}:${e.stack.map(r=>r.stateNumber.toString()).join("_")}`}function YI(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 Ia=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}},$g=new Ia,Ho=class extends Yr{constructor(t){var r;super(),this.logging=(r=t?.logging)!==null&&r!==void 0?r:(n=>console.log(n))}initialize(t){this.atn=Xg(t.rules),this.dfas=zI(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=Xr(n,"Alternation",r),l=this.atn.decisionMap[c].decision,f=R(ca({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),p=>R(p,h=>h[0]));if(eE(f,!1)&&!i){let p=te(f,(h,E,y)=>(L(E,S=>{S&&(h[S.tokenTypeIdx]=y,L(S.categoryMatches,d=>{h[d]=y}))}),h),{});return o?function(h){var E;let y=this.LA(1),S=p[y.tokenTypeIdx];if(h!==void 0&&S!==void 0){let d=(E=h[S])===null||E===void 0?void 0:E.GATE;if(d!==void 0&&d.call(this)===!1)return}return S}:function(){let h=this.LA(1);return p[h.tokenTypeIdx]}}else return o?function(p){let h=new Ia,E=p===void 0?0:p.length;for(let S=0;S<E;S++){let d=p?.[S].GATE;h.set(S,d===void 0||d.call(this))}let y=kc.call(this,a,l,h,s);return typeof y=="number"?y:void 0}:function(){let p=kc.call(this,a,l,$g,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=Xr(n,o,r),l=this.atn.decisionMap[c].decision,f=R(ca({maxLookahead:1,occurrence:r,prodType:o,rule:n}),p=>R(p,h=>h[0]));if(eE(f)&&f[0][0]&&!i){let p=f[0],h=ue(p);if(h.length===1&&v(h[0].categoryMatches)){let y=h[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===y}}else{let E=te(h,(y,S)=>(S!==void 0&&(y[S.tokenTypeIdx]=!0,L(S.categoryMatches,d=>{y[d]=!0})),y),{});return function(){let y=this.LA(1);return E[y.tokenTypeIdx]===!0}}}return function(){let p=kc.call(this,a,l,$g,s);return typeof p=="object"?!1:p===0}}};function eE(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 zI(e){let t=e.decisionStates.length,r=Array(t);for(let n=0;n<t;n++)r[n]=YI(e.decisionStates[n],n);return r}function kc(e,t,r,n){let o=e[t](r),i=o.start;if(i===void 0){let s=i4(o.atnStartState);i=nE(o,rE(s)),o.start=i}return XI.apply(this,[o,i,r,n])}function XI(e,t,r,n){let o=t,i=1,a=[],s=this.LA(i++);for(;;){let c=t4(o,s);if(c===void 0&&(c=JI.apply(this,[e,o,s,i,r,n])),c===Go)return e4(a,o,s);if(c.isAcceptState===!0)return c.prediction;o=c,a.push(s),s=this.LA(i++)}}function JI(e,t,r,n,o,i){let a=r4(t.configs,r,o);if(a.size===0)return tE(e,t,r,Go),Go;let s=rE(a),c=o4(a,o);if(c!==void 0)s.isAcceptState=!0,s.prediction=c,s.configs.uniqueAlt=c;else if(u4(a)){let u=Fd(a.alts);s.isAcceptState=!0,s.prediction=u,s.configs.uniqueAlt=u,QI.apply(this,[e,n,a.alts,i])}return s=tE(e,t,r,s),s}function QI(e,t,r,n){let o=[];for(let u=1;u<=t;u++)o.push(this.LA(u).tokenType);let i=e.atnStartState,a=i.rule,s=i.production,c=ZI({topLevelRule:a,ambiguityIndices:r,production:s,prefixPath:o});n(c)}function ZI(e){let t=R(e.prefixPath,o=>Wt(o)).join(", "),r=e.production.idx===0?"":e.production.idx,n=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(", ")}> in <${$I(e.production)}${r}> inside <${e.topLevelRule.name}> Rule,
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)&&gt(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)&&gt(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
148
  <${t}> may appears as a prefix path in all these alternatives.
149
149
  `;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
150
- For Further details.`,n}function $I(e){if(e instanceof B)return"SUBRULE";if(e instanceof F)return"OPTION";if(e instanceof H)return"OR";if(e instanceof Y)return"AT_LEAST_ONE";if(e instanceof z)return"AT_LEAST_ONE_SEP";if(e instanceof G)return"MANY_SEP";if(e instanceof w)return"MANY";if(e instanceof M)return"CONSUME";throw Error("non exhaustive match")}function e4(e,t,r){let n=Ue(t.configs.elements,i=>i.state.transitions),o=Vd(n.filter(i=>i instanceof Vn).map(i=>i.tokenType),i=>i.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:o,tokenPath:e}}function t4(e,t){return e.edges[t.tokenTypeIdx]}function r4(e,t,r){let n=new Xn,o=[];for(let a of e.elements){if(r.is(a.alt)===!1)continue;if(a.state.type===Yn){o.push(a);continue}let s=a.state.transitions.length;for(let c=0;c<s;c++){let u=a.state.transitions[c],l=n4(u,t);l!==void 0&&n.add({state:l,alt:a.alt,stack:a.stack})}}let i;if(o.length===0&&n.size===1&&(i=n),i===void 0){i=new Xn;for(let a of n.elements)Pa(a,i)}if(o.length>0&&!s4(i))for(let a of o)i.add(a);return i}function n4(e,t){if(e instanceof Vn&&P(t,e.tokenType))return e.target}function o4(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 rE(e){return{configs:e,edges:{},isAcceptState:!1,prediction:-1}}function tE(e,t,r,n){return n=nE(e,n),t.edges[r.tokenTypeIdx]=n,n}function nE(e,t){if(t===Go)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 i4(e){let t=new Xn,r=e.transitions.length;for(let n=0;n<r;n++){let i={state:e.transitions[n].target,alt:n,stack:[]};Pa(i,t)}return t}function Pa(e,t){let r=e.state;if(r.type===Yn){if(e.stack.length>0){let o=[...e.stack],a={state:o.pop(),alt:e.alt,stack:o};Pa(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=a4(e,i);a!==void 0&&Pa(a,t)}}function a4(e,t){if(t instanceof jo)return{state:t.target,alt:e.alt,stack:e.stack};if(t instanceof qn){let r=[...e.stack,t.followState];return{state:t.target,alt:e.alt,stack:r}}}function s4(e){for(let t of e.elements)if(t.state.type===Yn)return!0;return!1}function c4(e){for(let t of e.elements)if(t.state.type!==Yn)return!1;return!0}function u4(e){if(c4(e))return!0;let t=l4(e.elements);return f4(t)&&!p4(t)}function l4(e){let t=new Map;for(let r of e){let n=Mc(r,!1),o=t.get(n);o===void 0&&(o={},t.set(n,o)),o[r.alt]=!0}return t}function f4(e){for(let t of Array.from(e.values()))if(Object.keys(t).length>1)return!0;return!1}function p4(e){for(let t of Array.from(e.values()))if(Object.keys(t).length===1)return!0;return!1}function oE(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 iE(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 aE(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:()=>P(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:()=>P(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 sE(e,t){e.RULE("compilationUnit",()=>{e.OR([{ALT:()=>e.SUBRULE(e.ordinaryCompilationUnit)},{ALT:()=>e.SUBRULE(e.modularCompilationUnit)},{ALT:()=>e.CONSUME(Je)}])}),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:()=>(P(e.LA(1).tokenType,t.Transitive)&&P(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 cE(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 P(r,t.Identifier)||P(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),P(this.LA(1),t.LSquare)&&P(this.LA(2),t.RSquare)))}function uE(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:()=>P(e.LA(2).tokenType,t.RCurly)===!1,DEF:()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.elementValue)}})})}function lE(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:()=>P(this.LA(2).tokenType,t.RCurly)===!1,DEF:()=>{e.CONSUME(t.Comma),e.SUBRULE2(e.variableInitializer)}})})}function fE(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:()=>!P(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:()=>!P(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:()=>P(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 pE(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(P(r,t.Identifier)||P(r,t.Underscore))&&(P(n,t.RBrace)||P(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:()=>P(e.LA(2).tokenType,t.Less)||P(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!(P(r,t.Class)||P(r,t.This)||P(r,t.New)||P(r,t.StringLiteral)||P(r,t.TextBlock)||P(r,t.StringTemplateBegin)||P(r,t.TextBlockTemplateBegin))},DEF:()=>{e.CONSUME(t.Dot),e.SUBRULE2(e.fqnOrRefTypePartRest)}}),e.OPTION({GATE:()=>P(e.LA(1).tokenType,t.At)||P(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;P(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:()=>P(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(P(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 P(i,t.ColonColon)})}function dE(){return this.computeContentAssist("unaryExpressionNotPlusMinus",[]).map(r=>r.nextTokenType).filter((r,n,o)=>o.indexOf(r)===n)}var Ko=class extends ko{constructor(){super(Vt,{lookaheadStrategy:new Ho({logging:Fo()?()=>{}:void 0}),nodeLocationTracking:"full",skipValidations:Fo()});let t=this;t.RULE("typeIdentifier",()=>{t.CONSUME(Ze.Identifier)}),oE.call(this,t,Ze),iE.call(this,t,Ze),aE.call(this,t,Ze),cE.call(this,t,Ze),sE.call(this,t,Ze),uE.call(this,t,Ze),lE.call(this,t,Ze),fE.call(this,t,Ze),pE.call(this,t,Ze),this.firstForUnaryExpressionNotPlusMinus=[],this.performSelfAnalysis(),this.firstForUnaryExpressionNotPlusMinus=dE.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(At(o))return r;throw o}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}})}};var Jn=new Ko,sq=Jn.getBaseCstVisitorConstructor(),hE=Jn.getBaseCstVisitorConstructorWithDefaults();function x4(e,t="compilationUnit"){let r=Vg.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;Jn.input=n;let o=Jn[t]();if(Jn.errors.length>0){let i=Jn.errors[0];throw Error("Sad sad panda, parsing errors detected in line: "+i.token.startLine+", column: "+i.token.startColumn+`!
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
152
  `+i.message+`!
153
153
  ->`+i.context.ruleStack.join(`
154
- ->`))}return o.comments=r.groups.comments,{cst:o,tokens:n}}function mE(e,t="compilationUnit"){return x4(e,t).cst}var wc=class extends hE{content="";parsed=null;contextStack=[];package="";imports=[];info={...structuredClone(Us),pathChainFields:[]};constructor(){super(),this.validateVisitor()}async loadFile(t){this.info.container={fileName:t};try{let r=await gE.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=mE(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=je(t.Identifier)||"",super.packageDeclaration(t)}importDeclaration(t){let r=je(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=O4(t);if(I(r))return this.info.values.push(r),super.fieldDeclaration(t);let n=U4(t);if(I(n))return this.info.poses.push(n),super.fieldDeclaration(t);let o=N4(t);if(I(o))return this.info.beziers.push(o),super.fieldDeclaration(t);let i=C4(t);return I(i)&&this.info.pathChainFields.push(i),super.fieldDeclaration(t)}constructorDeclaration(t){return this.info.pathChainHelpers.push(...M4(t)),this.info.pathChains.push(...k4(t)),super.constructorDeclaration(t)}classDeclaration(t,r){let n=je(T(T(t?.normalClassDeclaration)?.typeIdentifier)?.Identifier);if(A(n))return;if(this.contextStack.length!==0){let i=this.info;this.info={...structuredClone(Us),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 va(e){if(!(!or(e)||e.length!==1))return e[0]}function T(e){return va(e)?.children}function je(e){return or(e)?e.map(t=>t.image).join("."):e?.image}function EE(e){switch(e){case"BezierLine":return tn.Line;case"BezierCurve":return tn.Curve}}function _c(e){return!(!e.fieldModifier||e.fieldModifier.length!==2||!e.fieldModifier.every(t=>t.children.Public||t.children.Static))}function yE(e){return!e.fieldModifier||e.fieldModifier.length!==1?!1:I(e.fieldModifier[0].children.Public)}function O4(e){if(!_c(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=je(T(n.variableDeclaratorId)?.Identifier);if(!o)return;let i=o,a=va(T(n.variableInitializer)?.expression);if(A(a))return;let s=br(a);if(k(s))return{name:i,value:s};if(Ns(s)||fi(s))return{name:i,value:s}}function SE(e){let t=T(T(T(e.children.conditionalExpression)?.binaryExpression)?.unaryExpression),r=je(t?.UnaryPrefixOperator)==="-"?-1:1,n=T(T(T(t?.primary)?.primaryPrefix)?.literal);if(I(n?.integerLiteral)){let o=je(T(n.integerLiteral)?.DecimalLiteral);if(I(o))return{int:parseInt(o)*r}}else if(I(n?.floatingPointLiteral)){let o=je(T(n.floatingPointLiteral)?.FloatLiteral);if(I(o))return{double:parseFloat(o)*r}}}function Bc(e){let t=je(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=je(va(n)?.children.Identifier);I(o)&&(t=t+"."+o)}return t}function TE(e){let t=T(T(T(e.children.conditionalExpression)?.binaryExpression)?.unaryExpression),r=T(T(t?.primary)?.primaryPrefix);if(I(r?.fqnOrRefType))return Bc(r.fqnOrRefType)}function Ma(e,t){if(A(e))return;let r=TE(e);return k(r)?r:t(e)}function RE(e){let t=T(e.primaryPrefix)?.fqnOrRefType;if(!A(t))return Bc(t)}function L4(e){let t=T(T(T(T(e.children.conditionalExpression)?.binaryExpression)?.unaryExpression)?.primary);if(A(t))return;let r=RE(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=Yt(n[0]);if(A(o)||o.length!==1)return;let i=Cr(o[0]);if(k(i))return{radians:i};if(I(i))return{radians:i}}function Cr(e){if(!A(e))return Ma(e,SE)}function A4(e){if(A(e))return;let t=L4(e);return I(t)?t:Ma(e,SE)}function Fc(e){return je(T(T(T(T(e)?.unannReferenceType)?.unannClassOrInterfaceType)?.unannClassType)?.Identifier)}function ka(e){return je(T(e?.variableDeclaratorId)?.Identifier)}function Dc(e){return T(T(e.variableDeclaratorList)?.variableDeclarator)}function xE(e){return T(T(T(T(T(T(T(e?.conditionalExpression)?.binaryExpression)?.unaryExpression)?.primary)?.primaryPrefix)?.newExpression)?.unqualifiedClassInstanceCreationExpression)}function jc(e,t){let r;if(ne(e,"name"))r=e;else{let i=va(T(e.variableInitializer)?.expression);if(A(i))return["",void 0];r=i}let n=xE(r?.children),o=je(T(n?.classOrInterfaceTypeToInstantiate)?.Identifier);return I(t)&&o!==t?["",void 0]:[t||o||"",T(n?.argumentList)?.expression]}function U4(e){if(!_c(e)&&!yE(e)||Fc(e.unannType)!=="Pose")return;let r=Dc(e);if(A(r))return;let n=ka(r);if(A(n))return;let o=OE(r);return I(o)?{name:n,pose:o}:void 0}function OE(e){let[,t]=jc(e,"Pose");if(A(t)||t.length!==3&&t.length!==2)return;let r=Cr(t[0]),n=Cr(t[1]);if(A(r)||A(n))return;let o=t.length===3?br(t[2]):void 0;return A(o)?{x:r,y:n}:{x:r,y:n,heading:o}}function LE(e){return Ma(e,OE)}function AE(e,t){let r=or(e)?e[0]:e;if(A(r))return;let[n,o]=jc(r,t);if(A(o))return;let i=EE(n);if(A(i))return;let a=o.map(LE);if(a.every(I))return{type:i,points:a}}function N4(e){if(!_c(e))return;let t=Fc(e.unannType);if(A(t))return;let r=EE(t),n=Dc(e);if(A(n)||A(r))return;let o=ka(n);if(A(o))return;let i=o,a=AE(T(n.variableInitializer)?.expression);if(I(a))return{name:i,points:a}}function C4(e){if(!yE(e)||Fc(e.unannType)!=="PathChain")return;let t=Dc(e);if(!A(t))return ka(t)}function Yt(e){return or(e)?Yt(e[0]):T(T(e?.children.methodInvocationSuffix)?.argumentList)?.expression}function br(e,t=!1){let r=A4(e);return I(r)&&t&&ul(r)&&r.endsWith(".getHeading")?r.substring(0,r.length-11):r}function b4(e){return Ma(e,AE)}function I4(e){let[t,r]=jc(e);if(A(r)||t!=="HeadingInterpolator.PiecewiseNode"||r.length!==3)return;let n=Cr(r[0]),o=Cr(r[1]),i=UE(r[2],!0);if(!(A(n)||A(o)||A(i)))return{timing:{start:n,end:o},heading:i}}function UE(e,t){let r=TE(e);if(A(r))return;let n=Yt(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(I4);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 u=LE(n[0]);if(I(u))return{type:he.Point,point:u}}else if(n.length===2){let u=Cr(n[0]),l=Cr(n[1]);if(I(u)&&I(l))return{type:he.Point,point:{x:u,y:l}}}}return;case"HeadingInterpolator.tangent":return I(n)?void 0:{type:he.Tangent};case"HeadingInterpolator.constant":if(I(n)){let u=br(n[0]);if(I(u))return{type:he.Constant,heading:u}}return;case"HeadingInterpolator.linear":case"HeadingInterpolator.reversedLinear":if(A(n)||n.length<2)return;let i=br(n[0]),a=br(n[1]);if(A(i)||A(a)||n.length>3)return;let s=n.length===3?Cr(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 P4(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=Bc(r.fqnOrRefType),o=T(T(T(T(T(t.expression)?.conditionalExpression)?.binaryExpression)?.unaryExpression)?.primary);if(A(o))return;let i=RE(o);if(A(i)||i!=="follower.pathBuilder")return;let a=o.primarySuffix;if(A(a)||a.length<5)return;let s=[],c=null,u="pathBuilder";for(let l=0;l<a.length;l++){let f=a[l];if(l%2===1){if(A(f?.children?.Dot))return;switch(u=je(f.children.Identifier),u){case"pathBuilder":case"addPath":case"setTangentHeadingInterpolation":case"setLinearHeadingInterpolation":case"setConstantHeadingInterpolation":case"setHeadingInterpolation":case"setReversed":case"build":continue;default:return}}else switch(u){case"pathBuilder":case"build":if(I(Yt(f)))return;continue;case"setTangentHeadingInterpolation":if(I(Yt(f)))return;c={type:he.Tangent};continue;case"setLinearHeadingInterpolation":let p=Yt(f);if(p?.length!==2)return;let h=br(p[0],!0),E=br(p[1],!0);if(A(h)||A(E))return;c={type:he.Linear,start:h,end:E};continue;case"setConstantHeadingInterpolation":let y=Yt(f);if(y?.length!==1)return;let S=br(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=Yt(f);if(A(d)||d.length!==1)return;let g=UE(d[0]);if(A(g))return;c=g;continue;case"addPath":let m=Yt(f);if(m?.length!==1)return;let x=b4(m[0]);if(A(x))return;s.push(x);continue;default:return}}if(c!==null)return{name:n,paths:s,heading:c}}function v4(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=je(r),i=ka(n);if(A(i)||A(o))return;let a=xE(T(T(n.variableInitializer)?.expression));if(A(a))return;let s=T(a.classOrInterfaceTypeToInstantiate)?.Identifier;if(!(A(s)||je(s)!==o)&&!(I(a.argumentList)||I(a.classBody)||I(a.typeArguments)))return{name:i,staticType:o}}function M4(e){let t=T(T(e.constructorBody)?.blockStatements)?.blockStatement;return A(t)?[]:t.map(v4).filter(I)}function k4(e){let t=T(T(e.constructorBody)?.blockStatements)?.blockStatement;return A(t)?[]:t.map(P4).filter(I)}async function NE(e){let t=new wc,r=await t.loadFile(e);if(k(r))return io(r);let n={...t.info};if(delete n.pathChainFields,Gc(n)){let o=[...t.imports];Wo(n,i=>{let a=[...o];ne(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 Gc(e){let t=!1;return Wo(e,r=>{if(r.beziers.length||r.poses.length||r.pathChains.length||r.values.length)return t=!0,!0}),t}var $e={HasFieldImage:!1,TeamPaths:wt(),PathClasses:wt(),ParsedClasses:new Map};function Wo(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 w4(e,t){let r=Il(e,t),n=await NE(r);if(nr(n))return n;let o=[];return Wo(n,i=>o.push(i.name)),[o,n]}function _4(e,t,r,n){if(!Gc(n))return;let o=rn(e,t);$e.TeamPaths.set(e,o),Wo(n,i=>{let a=Is(o,i.name);$e.PathClasses.set(o,a),$e.ParsedClasses.set(a,i)})}async function wa(){F4();let e=await bl();for(let[t,r]of e)for(let n of r){let o=Tl(n),i=await w4(t,o);nr(i)||_4(t,o,i[0],i[1])}return $e.HasFieldImage=await Xl(),B4()}function B4(){return $e}function F4(){$e.TeamPaths.clear(),$e.PathClasses.clear(),$e.ParsedClasses.clear()}function CE(e){$e.TeamPaths=e.TeamPaths,$e.PathClasses=e.PathClasses,$e.ParsedClasses=e.ParsedClasses}function D4(e,t){let r=$e.PathClasses.get(rn(e,t));return A(r)?io(`List: ${e}:${t} no Pedro pathing classes found`):[...r.keys()].map(Rl)}function bE(e,t){let r=D4(e,t);if(nr(r))return r;let n=r.reduce((a,s)=>a.length<s.length?a:s),o=Is(rn(e,t),n),i=$e.ParsedClasses.get(o);return A(i)?io(`Root: ${e}:${t} no Pedro pathing classes found`):i}var IE=Mt(require("node:child_process"),1);function PE(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}IE.exec(t+" "+e,(n,o,i)=>{n!=null&&console.log(`exec error: ${JSON.stringify(n)}`)})}async function vE(e){console.log("Parsing code: Please wait..."),await wa(),console.log(`\u{1F680} Server running at ${e}`),await Yl(1500),PE(e.toString())}var ME="x-hono-already-sent";var Ka=require("node:http"),lt=require("node:http2"),Kc=require("node:stream");var kE=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 Ut=class extends Error{constructor(e,t){super(e,t),this.name="RequestError"}},j4=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"]),G4=/^[!#$%&'*+\-.^_`|~\dA-Za-z]+$/,_a=e=>e===9||e===10||e===13||e===32,wE=e=>{if(!_a(e.charCodeAt(0))&&!_a(e.charCodeAt(e.length-1)))return e;let t=0,r=e.length;for(;t<r&&_a(e.charCodeAt(t));)t++;for(;r>t&&_a(e.charCodeAt(r-1));)r--;return e.slice(t,r)},_E=/[\0\r\n]/,Jc=globalThis.Headers,WE=(e,t=Jc)=>{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},Qc=class{#e;#t;#r;#i;constructor(e){this.#e=e,e instanceof lt.Http2ServerRequest&&(this.#t=e.rawHeaders.slice())}get#o(){return this.#t??=this.#e.rawHeaders.slice()}get#n(){return this.#r||(this.#r=WE(this.#o),this.#t=void 0),this.#r}#c(e){if(typeof e=="string"){if(!G4.test(e))throw new TypeError(`Invalid header name: ${e}`);return e.toLowerCase()}}#a(e){let t=this.#e instanceof lt.Http2ServerRequest?void 0:this.#e.headers;if(!t||j4.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=wE(r);return _E.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=wE(e[o+1]);if(_E.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(Qc.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(Qc.prototype,Jc.prototype);var VE=e=>globalThis.Headers===Jc?new Qc(e):WE(e.rawHeaders,globalThis.Headers),H4=/^\/[!#$&-;=?-\[\]_a-z~]*$/,K4=/\/\.\.?(?:[/?#]|$)/,W4=/^[a-z0-9._-]+(?::(?:[1-5]\d{3,4}|[6-9]\d{3}))?$/,V4=(e,t,r)=>{let n=`${e}://${t}${r}`;if(W4.test(t)){if(r.length===0)return n+"/";if(r.charCodeAt(0)!==47)throw new Ut("Invalid URL");return!H4.test(r)||K4.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 Ut("Invalid host header");return o.href}},q4=e=>e instanceof Ut?e:new Ut(e.message,{cause:e}),Y4=global.Request,Zn=class extends Y4{constructor(e,t){if(typeof e=="object"&&vr in e){let r=t!==void 0&&"body"in t&&t.body!=null;if(e[Jt]&&!r)throw new TypeError("Cannot construct a Request with a Request object that has already been used.");e=e[vr]()}typeof t?.body?.getReader<"u"&&(t.duplex??="half"),super(e,t)}},qE=Symbol("wrapBodyStream"),z4=new Set(["latin1","binary","hex","base64","base64url"]),X4=e=>e===null||z4.has(e),Hc=Symbol("bodyBufferedBeforeDisconnect"),Wc=Symbol("bodyBufferedLengthBeforeDisconnect"),YE=(e,t)=>Buffer.isBuffer(e)?e:Buffer.from(e,t??"utf8"),Zc=e=>!(e instanceof lt.Http2ServerRequest)&&!!e.complete&&!!e.readableAborted&&typeof e.read=="function"&&X4(e.readableEncoding),BE=e=>{if(e.readableDidRead||!Zc(e))return;let t=e;t[Wc]??=e.readableLength},Fa=(e,t)=>{if(e.readableDidRead&&!t||!Zc(e))return;let r=e;if(r[Hc]!==void 0)return r[Hc];let n,o=e.errored;if(o&&o.code!=="ECONNRESET")n=o;else if(r[Wc]!==void 0&&e.readableLength!==r[Wc])n=Da();else{let i=t??[],a=e.read();a!==null&&i.push(YE(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 u=Number(c);Number.isSafeInteger(u)&&s.length!==u&&(n=Da())}}return r[Hc]=n,n},FE=(e,t)=>{if(t instanceof Error){e.error(t);return}t.length>0&&e.enqueue(t),e.close()},J4=(e,t,r,n,o)=>{let i={method:e,headers:r,signal:o.signal};if(e==="TRACE"){i.method="GET";let a=new Zn(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[qE]){let a;i.body=new ReadableStream({async pull(s){try{if(!a){let l=Fa(n);if(l!==void 0){FE(s,l);return}}a||=Kc.Readable.toWeb(n).getReader();let{done:c,value:u}=await a.read();c?s.close():s.enqueue(u)}catch(c){s.error(c)}}})}else{let a=Fa(n);a!==void 0?i.body=new ReadableStream({start(s){FE(s,a)}}):i.body=Kc.Readable.toWeb(n)}return new Zn(t,i)},vr=Symbol("getRequestCache"),zt=Symbol("requestCache"),$n=Symbol("incomingKey"),Yo=Symbol("urlKey"),zE=Symbol("methodKey"),XE=Symbol("headersKey"),Vo=Symbol("abortControllerKey"),Vc=Symbol("getAbortController"),qc=Symbol("abortRequest"),Pr=Symbol("bodyBuffer"),Ba=Symbol("bodyReadPromise"),Jt=Symbol("bodyConsumedDirectly"),DE=Symbol("bodyLockReader"),qo=Symbol("abortReason"),Da=()=>new TypeError("Body is unusable"),zo=()=>Promise.reject(Da()),Q4=new TextDecoder,Z4=e=>{if(e[Jt])return zo();e[Jt]=!0},$4=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),e7=e=>(e[XE]||=VE(e[$n])).get("content-type")||"",t7=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,r7=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}},n7=e=>{if(!t7.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.`)},$c=(e,t,r)=>{if(e[Jt])return zo();let n=e.method;if(n==="GET"||n==="HEAD")return e[vr]()[t]();let o=n7(n);if(o)return Promise.reject(o);if(e[zt]&&n!=="TRACE")return e[zt][t]();let i=Z4(e);if(i)return i;let a=o7(e);if(a){let s=Promise.resolve(r(a,e));return e[Pr]=void 0,s}return i7(e).then(s=>{let c=r(s,e);return e[Pr]=void 0,c})},o7=e=>{let t=e[$n];if("rawBody"in t&&t.rawBody instanceof Buffer)return t.rawBody},jE=(e,t)=>{if(t.errored)return t.errored;let r=e[qo];return r!==void 0?r instanceof Error?r:new Error(String(r)):new Error("Client connection prematurely closed.")},i7=e=>{if(e[Pr])return Promise.resolve(e[Pr]);if(e[Ba])return e[Ba];let t=e[$n];if(t.readableDidRead)return zo();let r=Fa(t);if(r!==void 0)return r instanceof Error?Promise.reject(r):(e[Pr]=r,Promise.resolve(r));let n=new Promise((o,i)=>{let a=[],s=!1,c=y=>{s||(s=!0,E(),y())},u=y=>{let S=t.errored??y;return!Zc(t)||S&&S.code!=="ECONNRESET"?!1:(c(()=>{let d=Fa(t,a);d instanceof Error?i(d):d===void 0?i(y??jE(e,t)):(e[Pr]=d,o(d))}),!0)},l=y=>{a.push(YE(y,t.readableEncoding))},f=()=>{c(()=>{let y=a.length===1?a[0]:Buffer.concat(a);e[Pr]=y,o(y)})},p=y=>{u(y)||c(()=>{i(y)})},h=()=>{if(t.readableEnded){f();return}u()||c(()=>{i(jE(e,t))})},E=()=>{t.off("data",l),t.off("end",f),t.off("error",p),t.off("close",h),e[Ba]=void 0};t.on("data",l),t.on("end",f),t.on("error",p),t.on("close",h),queueMicrotask(()=>{s||(t.readableEnded?f():t.errored?p(t.errored):t.destroyed&&h())})});return e[Ba]=n,n},Ct={get method(){return this[zE]},get url(){return this[Yo]},get headers(){return this[XE]||=VE(this[$n])},[qc](e){this[qo]===void 0&&(this[qo]=e);let t=this[Vo];t&&!t.signal.aborted&&t.abort(e)},[Vc](){return this[Vo]||=new AbortController,this[qo]!==void 0&&!this[Vo].signal.aborted&&this[Vo].abort(this[qo]),this[Vo]},[vr](){let e=this[Vc]();if(this[zt])return this[zt];let t=this.method;if(this[Jt]&&!(t==="GET"||t==="HEAD")){this[Pr]=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 Zn(this[Yo],r);return t==="TRACE"&&Object.defineProperty(n,"method",{get(){return"TRACE"}}),this[zt]=n}return this[zt]=J4(this.method,this[Yo],this.headers,this[$n],e)},get body(){if(!this[Jt])return this[vr]().body;let e=this[vr]();return!this[DE]&&e.body&&(this[DE]=e.body.getReader()),e.body},get bodyUsed(){return this[Jt]?!0:this[zt]?this[zt].bodyUsed:!1}};Object.defineProperty(Ct,"signal",{get(){return this[Vc]().signal}});["cache","credentials","destination","integrity","mode","redirect","referrer","referrerPolicy","keepalive"].forEach(e=>{Object.defineProperty(Ct,e,{get(){return this[vr]()[e]}})});["clone","formData"].forEach(e=>{Object.defineProperty(Ct,e,{value:function(){if(this[Jt]){if(e==="clone")throw Da();return zo()}return this[vr]()[e]()}})});Object.defineProperty(Ct,"text",{value:function(){return $c(this,"text",e=>Q4.decode(e))}});Object.defineProperty(Ct,"arrayBuffer",{value:function(){return $c(this,"arrayBuffer",e=>$4(e))}});Object.defineProperty(Ct,"blob",{value:function(){return $c(this,"blob",(e,t)=>{let r=e7(t),n=r?{headers:{"content-type":r}}:void 0;return new Response(e,n).blob()})}});Object.defineProperty(Ct,"json",{value:function(){return this[Jt]?zo():this.text().then(JSON.parse)}});Object.defineProperty(Ct,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[zt]},{...t,depth:e==null?null:e-1})}`}});Object.setPrototypeOf(Ct,Zn.prototype);var a7=(e,t)=>{let r=Object.create(Ct);r[$n]=e,r[zE]=r7(e.method);let n=e.url||"";if(n[0]!=="/"&&(n.startsWith("http://")||n.startsWith("https://"))){if(e instanceof lt.Http2ServerRequest)throw new Ut("Absolute URL for :path is not allowed in HTTP/2");try{r[Yo]=new URL(n).href}catch(a){throw new Ut("Invalid absolute URL",{cause:a})}return r}let o=(e instanceof lt.Http2ServerRequest?e.authority:e.headers.host)||t;if(!o)throw new Ut("Missing host header");let i;if(e instanceof lt.Http2ServerRequest){if(i=e.scheme,!(i==="http"||i==="https"))throw new Ut("Unsupported scheme")}else i=e.socket&&e.socket.encrypted?"https":"http";try{r[Yo]=V4(i,o,n)}catch(a){throw a instanceof Ut?a:new Ut("Invalid URL",{cause:a})}return r},Ir="text/plain; charset=UTF-8",Yc=Symbol("responseCache"),Qn=Symbol("getResponseCache"),Xt=Symbol("cache"),ja=global.Response,Nt=class JE{#e;#t;[Qn](){let t=this[Xt],r=t&&t[2]instanceof Headers?t[2]:void 0;return delete this[Xt],this[Yc]||=new ja(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 ja){let o=r[Yc];if(o){this.#t=o,this[Qn]();return}this.#t=r instanceof JE?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[Xt]=[r?.status||200,t??null,n||r?.headers])}get headers(){let t=this[Xt];return t?(t[2]instanceof Headers||(t[2]=new Headers(t[2]||(t[1]===null?void 0:{"content-type":Ir}))),t[2]):this[Qn]().headers}get status(){return this[Xt]?.[0]??this[Qn]().status}get ok(){let t=this.status;return t>=200&&t<300}};["body","bodyUsed","redirected","statusText","trailers","type","url"].forEach(e=>{Object.defineProperty(Nt.prototype,e,{get(){return this[Qn]()[e]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(Nt.prototype,e,{value:function(){return this[Qn]()[e]()}})});Object.defineProperty(Nt.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[Yc]},{...t,depth:e==null?null:e-1})}`}});Object.setPrototypeOf(Nt,ja);Object.setPrototypeOf(Nt.prototype,ja.prototype);var s7=/^https?:\/\/[!#-;=?-[\]_a-z~A-Z]+$/,c7=e=>e instanceof URL?e.href:s7.test(e)?e:new URL(e).href,u7=new Set([301,302,303,307,308]);Object.defineProperty(Nt,"redirect",{value:function(t,r=302){if(!u7.has(r))throw new RangeError("Invalid status code");return new Nt(null,{status:r,headers:{location:c7(t)}})},writable:!0,configurable:!0});Object.defineProperty(Nt,"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 Nt(n,{status:r?.status??200,statusText:r?.statusText,headers:i})},writable:!0,configurable:!0});async function l7(e){return Promise.race([e,Promise.resolve().then(()=>Promise.resolve(void 0))])}function QE(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(u){o(u)}}}function GE(e,t){if(e.locked)throw new TypeError("ReadableStream is locked.");return t.destroyed?void 0:QE(e.getReader(),t)}var zc=(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},Ga=Symbol("outgoingEnded"),HE=Symbol("incomingDraining"),f7=500,p7=64*1024*1024,ZE=e=>{let t=e;if(e.destroyed||t[HE])return;if(t[HE]=!0,e instanceof lt.Http2ServerRequest){try{e.stream?.close?.(lt.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,f7);i.unref?.();let a=s=>{r+=s.length,r>p7&&o()};e.on("data",a),e.on("end",n),e.on("error",n),e.resume()},d7=(e,t,r,n)=>()=>{t.errored?(BE(t),e[qc](t.errored.toString())):r.writableFinished||(BE(t),e[qc]("Client connection prematurely closed.")),n&&!t.readableEnded&&setTimeout(()=>{t.readableEnded||setTimeout(()=>{ZE(t)})})},h7=e=>{if(!(Xt in e))return!1;let t=e[Xt][1];return t===null||typeof t=="string"||t instanceof Uint8Array},m7=()=>new Response(null,{status:400}),$E=e=>new Response(null,{status:e instanceof Error&&(e.name==="TimeoutError"||e.constructor.name==="TimeoutError")?504:500}),Ha=(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))},Xc=e=>{"flushHeaders"in e&&e.writable&&e.flushHeaders()},ey=async(e,t)=>{let[r,n,o]=e[Xt];if(!o){n===null?(t.writeHead(r),t.end()):typeof n=="string"?(t.writeHead(r,{"Content-Type":Ir,"Content-Length":Buffer.byteLength(n)}),t.end(n)):n instanceof Uint8Array?(t.writeHead(r,{"Content-Type":Ir,"Content-Length":n.byteLength}),t.end(n)):n instanceof Blob?(t.writeHead(r,{"Content-Type":Ir,"Content-Length":n.size}),t.end(new Uint8Array(await n.arrayBuffer()))):(t.writeHead(r,{"Content-Type":Ir}),Xc(t),await GE(n,t)?.catch(a=>Ha(a,t))),t[Ga]?.();return}let i=!1;if(o instanceof Headers)i=o.has("content-length"),o=zc(o,n===null?void 0:Ir);else if(Array.isArray(o)){let a=new Headers(o);i=a.has("content-length"),o=zc(a,n===null?void 0:Ir)}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())):(Xc(t),await GE(n,t)?.catch(a=>Ha(a,t))),t[Ga]?.()},ty=e=>typeof e.then=="function",g7=async(e,t,r={})=>{if(ty(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($E);if(Xt in e)return ey(e,t);let n=zc(e.headers,e.body===null?void 0:Ir);if(e.body){let o=e.body.getReader(),i=[],a=!1,s;if(n["transfer-encoding"]!=="chunked"){let c=2;for(let u=0;u<c;u++){s||=o.read();let l=await l7(s).catch(f=>{console.error(f),a=!0});if(!l){if(u===1){await new Promise(f=>setTimeout(f)),c=3;continue}break}if(s=void 0,l.value&&i.push(l.value),l.done){a=!0;break}}a&&!("content-length"in n)&&(n["content-length"]=i.reduce((u,l)=>u+l.length,0))}t.writeHead(e.status,n),i.forEach(c=>{t.write(c)}),a?t.end():(i.length===0&&Xc(t),await QE(o,t,s))}else n[ME]||(t.writeHead(e.status,n),t.end());t[Ga]?.()},E7=(e,t={})=>{let r=t.autoCleanupIncoming??!0;return t.overrideGlobalObjects!==!1&&global.Request!==Zn&&(Object.defineProperty(global,"Request",{value:Zn}),Object.defineProperty(global,"Response",{value:Nt})),async(n,o)=>{let i,a,s=!1,c=!1,u=()=>{!a||c||(c=!0,o.on("close",d7(a,n,o,s)))};try{if(a=a7(n,t.hostname),s=r&&!(n.method==="GET"||n.method==="HEAD"),s&&(n[qE]=!0,n instanceof lt.Http2ServerRequest&&(o[Ga]=()=>{n.readableEnded||setTimeout(()=>{n.readableEnded||setTimeout(()=>{n.destroy(),o.destroy()})})})),i=e(a,{incoming:n,outgoing:o}),!ty(i)&&h7(i))return s&&!n.readableEnded&&o.once("finish",()=>{n.readableEnded||ZE(n)}),ey(i,o);u()}catch(l){if(i)return Ha(l,o);if(t.errorHandler){if(u(),i=await t.errorHandler(a?l:q4(l)),!i)return}else a?i=$E(l):i=m7()}try{return await g7(i,o,t)}catch(l){return Ha(l,o)}}},y7=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??""}},S7=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}},T7=()=>Symbol("connection"),ry=Symbol("CONNECTION_SYMBOL_KEY"),ny=Symbol("WAIT_FOR_WEBSOCKET_SYMBOL"),R7=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"]),oy=(e,t)=>{t&&t.forEach((r,n)=>{R7.has(n.toLowerCase())||e.push(`${n}: ${r}`)})},KE=(e,t,r)=>{let n=["Connection: close","Content-Length: 0"];oy(n,r),e.end(`HTTP/1.1 ${t.toString()} ${Ka.STATUS_CODES[t]??""}\r
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
155
  ${n.join(`\r
156
156
  `)}\r
157
157
  \r
158
- `)},x7=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})},O7=e=>{let{server:t,fetchCallback:r,wss:n}=e,o=new Map;n.on("connection",(s,c)=>{let u=o.get(c);u&&(u.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((u,l)=>{o.set(s,{resolve:u,reject:l,connectionSymbol:c})});t.on("upgrade",async(s,c,u)=>{if(s.headers.upgrade?.toLowerCase()!=="websocket")return;let l={incoming:s,outgoing:void 0,wss:n,[ny]:a},f=400,p;try{let S=await r(x7(s),l);S instanceof Response&&(f=S.status,p=S.headers)}catch{t.listenerCount("upgrade")===1&&KE(c,500);return}let h=o.get(s);if(!h||h.connectionSymbol!==l[ry]){i(s),t.listenerCount("upgrade")===1&&KE(c,f,p);return}let E=S=>{oy(S,p)},y=()=>i(s);c.once("close",y),n.on("headers",E);try{n.handleUpgrade(s,c,u,S=>{c.off("close",y),n.emit("connection",S,s)})}finally{n.off("headers",E)}}),t.on("close",()=>{n.close()})},yY=kE(async(e,t,r)=>{if(e.req.header("upgrade")?.toLowerCase()!=="websocket")return;let n=e.env,o=n[ny];if(!o||!n.incoming)return new Response(null,{status:500});let i=T7();return n[ry]=i,(async()=>{let a;try{a=await o(n.incoming,i)}catch{return}let s=[],c=(f,p)=>{s.push([f,p])};a.on("message",c);let u={binaryType:"arraybuffer",close(f,p){a.close(f,p)},protocol:a.protocol,raw:a,get readyState(){return a.readyState},send(f,p){a.send(f,{compress:p?.compress})},url:new URL(e.req.url)};try{t?.onOpen?.(new Event("open"),u)}catch(f){(r?.onError??console.error)(f)}let l=(f,p)=>{let h=Array.isArray(f)?f:[f];for(let E of h)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")}),u)}catch(y){(r?.onError??console.error)(y)}};a.off("message",c);for(let f of s)l(...f);a.on("message",(f,p)=>{l(f,p)}),a.on("close",(f,p)=>{try{t?.onClose?.(new y7("close",{code:f,reason:p.toString()}),u)}catch(h){(r?.onError??console.error)(h)}}),a.on("error",f=>{try{t?.onError?.(new S7("error",{error:f}),u)}catch(p){(r?.onError??console.error)(p)}})})(),new Response}),L7=e=>{let t=e.fetch,r=E7(t,{hostname:e.hostname,overrideGlobalObjects:e.overrideGlobalObjects,autoCleanupIncoming:e.autoCleanupIncoming}),n=(e.createServer||Ka.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");O7({server:n,fetchCallback:t,wss:e.websocket.server})}return n},iy=(e,t)=>{let r=L7(e);return r.listen(e?.port??3e3,e.hostname,()=>{let n=r.address();t&&t(n)}),r};var ay=require("node:stream"),sy=require("node:process"),A7=()=>{let[e,t]=sy.versions.node.split(".").map(r=>parseInt(r));return e>=23||e===22&&t>=7||e===20&&t>=18},U7=A7(),eu=(e,t=U7)=>{if(t)return ay.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=u=>{n||(n=!0,o(),u?.())},a=u=>{n||!r||(r.enqueue(u),(r.desiredSize??0)<=0&&e.pause())},s=u=>{i(()=>{r?.error(u)})},c=()=>{i(()=>{r?.close()})};return new ReadableStream({start(u){r=u,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 u=()=>{};e.on("error",u),e.once("close",()=>e.off("error",u)),e.destroy()}})};var cy=(e,t=C7)=>{let r=/\.([a-zA-Z0-9]+?)$/,n=e.match(r);if(n)return t[n[1].toLowerCase()]};var N7={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"},C7=N7;var Qr=require("node:fs"),ru=require("node:path"),b7=/^\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,nu={br:".br",zstd:".zst",gzip:".gz"},I7=Object.keys(nu),tu=e=>{let t;try{t=(0,Qr.statSync)(e)}catch{}return t},P7=/^(?:bytes=)?(?!-$)(\d*)-(\d*)$/,v7=e=>{let t=e.match(P7);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)}},M7=(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}},k7=(e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[0-9A-Fa-f]{2})+/g,r=>{try{return t(r)}catch{return r}})}},w7=e=>k7(e,decodeURI),ou=(e={root:""})=>{let t=e.root||"",r=e.path;return t!==""&&!(0,Qr.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=w7(n.req.path),/(?:^|[\/\\])\.{1,2}(?:$|[\/\\])|[\/\\]{2,}|\\/.test(i))throw new Error}catch{return await e.onNotFound?.(n.req.path,n),o()}let a=(0,ru.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,ru.join)(a,p),s=tu(a)}if(!s)return await e.onNotFound?.(a,n),o();let c=cy(a);if(n.header("Content-Type",c||"application/octet-stream"),e.precompressed&&(!c||c==="application/octet-stream"||b7.test(c))){let p=new Set(n.req.header("Accept-Encoding")?.split(",").map(h=>h.trim()));for(let h of I7){if(!p.has(h))continue;let E=tu(a+nu[h]);if(E){n.header("Content-Encoding",h),n.header("Vary","Accept-Encoding",{append:!0}),s=E,a=a+nu[h];break}}}let u,l=s.size,f=n.req.header("range")||"";if(n.header("Last-Modified",s.mtime.toUTCString()),n.req.method=="HEAD"||n.req.method=="OPTIONS")n.header("Content-Length",l.toString()),n.status(200),u=n.body(null);else if(!f)n.header("Content-Length",l.toString()),u=n.body(eu((0,Qr.createReadStream)(a)),200);else{n.header("Accept-Ranges","bytes");let p=M7(v7(f)??{type:"open-ended",start:0},l);if(!p)n.header("Content-Range",`bytes */${l}`),u=n.body(null,416);else{let{start:h,end:E}=p,y=E-h+1,S=(0,Qr.createReadStream)(a,{start:h,end:E});n.header("Content-Length",y.toString()),n.header("Content-Range",`bytes ${h}-${E}/${l}`),u=n.body(eu(S),206)}}return await e.onFound?.(a,n),u}};var iu=(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,u=!1,l;if(e[s]?(l=e[s][0][0],n.req.routeIndex=s):l=s===e.length&&o||void 0,l)try{c=await l(n,()=>a(s+1))}catch(f){if(f instanceof Error&&t)n.error=f,c=await t(f,n),u=!0;else throw f}else n.finalized===!1&&r&&(c=await r(n));return c&&(n.finalized===!1||u)&&(n.res=c),n}};var uy=Symbol();var ly=(e,t)=>new Response(e,{headers:{"Content-Type":t.replace(/^[^;]+/,n=>n.toLowerCase())}}).formData();var fy=32,_7=1e4,Wa=e=>"headers"in e,hy=async(e,t=Object.create(null))=>{let{all:r=!1,dot:n=!1}=t,a=(Wa(e)?e.headers:e.raw.headers).get("Content-Type")?.split(";")[0].trim().toLowerCase();return a==="multipart/form-data"||a==="application/x-www-form-urlencoded"?B7(e,{all:r,dot:n}):{}};async function B7(e,t){if(!Wa(e)&&e.bodyCache.formData)return py(await e.bodyCache.formData,t);let r=Wa(e)?e.headers:e.raw.headers,n=await e.arrayBuffer(),o=ly(n,r.get("Content-Type")||"");Wa(e)||(e.bodyCache.formData=o);let i=await o;return i?py(i,t):{}}function py(e,t){let r=Object.create(null),n={count:0};return e.forEach((o,i)=>{t.all||i.endsWith("[]")?F7(r,i,o):r[i]=o}),t.dot&&Object.entries(r).forEach(([o,i])=>{o.includes(".")&&(D7(r,o,i,n),delete r[o])}),r}var F7=(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},D7=(e,t,r,n)=>{if(/(?:^|\.)__proto__\./.test(t))return;let o=e,i=t.split(".",fy+2);i.length>fy+1&&dy(),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++>=_7&&dy(),o[a]=Object.create(null)),o=o[a])})},dy=()=>{throw new Error("Nesting limit exceeded")};var su=e=>{let t=e.split("/");return t[0]===""&&t.shift(),t},my=e=>{let{groups:t,path:r}=j7(e),n=su(r);return G7(n,t)},j7=e=>{let t=[];return e=e.replace(/\{[^}]+\}/g,(r,n)=>{let o=`@${n}`;return t.push([o,r]),o}),{groups:t,path:e}},G7=(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},Va={},gy=(e,t)=>{if(e==="*")return"*";let r=e.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);if(r){let n=`${e}#${t}`;return Va[n]||(r[2]?Va[n]=t&&t[0]!==":"&&t[0]!=="*"?[n,r[1],new RegExp(`^${r[2]}(?=/${t})`)]:[e,r[1],new RegExp(`^${r[2]}$`)]:Va[n]=[e,r[1],!0]),Va[n]}return null},Ey=(e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[0-9A-Fa-f]{2})+/g,r=>{try{return t(r)}catch{return r}})}},H7=e=>Ey(e,decodeURI),cu=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 H7(c.includes("%25")?c.replace(/%25/g,"%2525"):c)}else if(o===63||o===35)break}return t.slice(r,n)};var yy=e=>{let t=cu(e);return t.length>1&&t.at(-1)==="/"?t.slice(0,-1):t},Mr=(e,t,...r)=>(r.length&&(t=Mr(t,...r)),`${e?.[0]==="/"?"":"/"}${e}${t==="/"?"":`${e?.at(-1)==="/"?"":"/"}${t?.[0]==="/"?t.slice(1):t}`}`),qa=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)},Ya=e=>e.indexOf("%")!==-1?Ey(e,K7):e,au=e=>(e.indexOf("+")!==-1&&(e=e.replace(/\+/g," ")),Ya(e)),Sy=(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 u=s+t.length+2,l=e.indexOf("&",u);return au(e.slice(u,l===-1?void 0:l))}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 u=e.slice(a+1,c===-1?s===-1?void 0:s:c);if(o&&(u=au(u)),a=s,u==="")continue;let l;c===-1?l="":(l=e.slice(c+1,s===-1?void 0:s),o&&(l=au(l))),r?(i[u]&&Array.isArray(i[u])||(i[u]=[]),i[u].push(l)):i[u]??=l}return t?i[t]:i},Ty=Sy,Ry=(e,t)=>Sy(e,t,!0),K7=decodeURIComponent;var xy=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&&Ya(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]=Ya(n))}return e}#o(e){return this.#t[1]?this.#t[1][e]:e}query(e){return Ty(this.url,e)}queries(e){return Ry(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 hy(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[uy](){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 Oy={Stringify:1,BeforeStream:2,Stream:3},W7=(e,t)=>{let r=new String(e);return r.isEscaped=!0,r.callbacks=t,r};var uu=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=>uu(c,t,!1,n,o))).then(()=>o[0]));return r?W7(await a,i):a};var V7="text/plain; charset=UTF-8",lu=(e,t)=>({"Content-Type":e,...t}),Xo=(e,t)=>new Response(e,t),fu=class{#e;#t;env={};#r;finalized=!1;error;#i;#o;#n;#c;#a;#s;#l;#f;#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.#f=t.matchResult)}get req(){return this.#t??=new xy(this.#e,this.#p,this.#f),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||=Xo(null,{headers:this.#l??=new Headers})}set res(e){if(this.#n&&e){e=Xo(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=Xo(this.#n.body,this.#n));let n=this.#n?this.#n.headers:this.#l??=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):{}}#u(e,t,r){let n=this.#n?new Headers(this.#n.headers):this.#l;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 Xo(e,{status:o,headers:n??r})}newResponse=(...e)=>this.#u(...e);body=(e,t,r)=>this.#u(e,t,r);text=(e,t,r)=>!this.#l&&!this.#i&&!t&&!r&&!this.finalized?new Response(e):this.#u(e,t,lu(V7,r));json=(e,t,r)=>this.#u(JSON.stringify(e),t,lu("application/json",r));html=(e,t,r)=>{let n=o=>this.#u(o,t,lu("text/html; charset=UTF-8",r));return typeof e=="object"?uu(e,Oy.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??=()=>Xo(),this.#s(this))};var Ne="ALL",Ly="all",Ay=["get","post","put","delete","options","patch","query"],za="Can not add a route since the matcher is already built.",Xa=class extends Error{};var Uy="__COMPOSED_HANDLER";var q7=e=>e.text("404 Not Found",404),Ny=(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)},Cy=class by{get;post;put;delete;options;patch;query;all;on;use;router;getPath;_basePath="/";#e="/";routes=[];constructor(t={}){[...Ay,Ly].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 u of[i].flat())s.map(l=>{this.#i(u.toUpperCase(),this.#e,l)})}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??cu:yy}#t(){let t=new by({router:this.router,getPath:this.getPath});return t.errorHandler=this.errorHandler,t.#r=this.#r,t.routes=this.routes,t}#r=q7;errorHandler=Ny;route(t,r){let n=this.basePath(t);return r.routes.map(o=>{let i;r.errorHandler===Ny?i=o.handler:(i=async(a,s)=>(await iu([],r.errorHandler)(a,()=>o.handler(a,s))).res,i[Uy]=o.handler),n.#i(o.method,o.path,i,o.basePath)}),this}basePath(t){let r=this.#t();return r._basePath=Mr(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 u=i(c);return Array.isArray(u)?u:[u]}:c=>{let u;try{u=c.executionCtx}catch{}return[c.env,u]};o||=(()=>{let c=Mr(this._basePath,t),u=c==="/"?0:c.length;return l=>{let f=new URL(l.url);return f.pathname=this.getPath(l).slice(u)||"/",new Request(f,l)}})();let s=async(c,u)=>{let l=await r(o(c.req.raw),...a(c));if(l)return l;await u()};return this.#i(Ne,Mr(t,"*"),s),this}#i(t,r,n,o){t=t.toUpperCase(),r=Mr(this._basePath,r);let i={basePath:o!==void 0?Mr(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 fu(t,{path:i,matchResult:a,env:n,executionCtx:r,notFoundHandler:this.#r});if(a[0].length===1){let u;try{u=a[0][0][0][0](s,async()=>{s.res=await this.#r(s)})}catch(l){return this.#o(l,s)}return u instanceof Promise?u.then(l=>l||(s.finalized?s.res:this.#r(s))).catch(l=>this.#o(l,s)):u??this.#r(s)}let c=iu(a[0],this.errorHandler,this.#r);return(async()=>{try{let u=await c(s);if(!u.finalized)throw new Error("Context is not finalized. Did you forget to return a Response object or `await next()`?");return u.res}catch(u){return this.#o(u,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${Mr("/",t)}`,r),n,o));fire=()=>{addEventListener("fetch",t=>{t.respondWith(this.#n(t.request,t,void 0,t.request.method))})}};var Oe=()=>Object.create(null);var Ja=[];function pu(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[[],Ja];let u=c.indexOf("",1);return[a[1][u],c]});return this.match=n,n(e,t)}var eo="[^/]+",wr=".*",Qt="(?:|/.*)",kr=Symbol(),Iy=new Set(".\\+*[^]$()");function Y7(e,t){return e.length===1?t.length===1?e<t?-1:1:-1:t.length===1?1:e===wr||e===Qt?t===Qt?-1:1:t===wr||t===Qt?-1:e===eo?1:t===eo?-1:e.length===t.length?e<t?-1:1:t.length-e.length}var Py=class du{#e;#t;#r=Oe();insert(t,r,n,o,i){let a=this;for(let s=0,c=t.length;s<c;s++){let u=t[s],l=u.length===1?u==="*"?s===c-1?["","",wr]:["","",eo]:null:u==="/*"?["","",Qt]:u.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/),f;if(l){let p=l[1],h=l[2]||eo;if(p&&l[2]&&(h===".*"||(h=h.replace(/^\((?!\?:)(?=[^)]+\)$)/,"(?:"),/\((?!\?:)/.test(h))||h.length===1&&Iy.has(h)))throw kr;if(f=a.#r[h],!f){if(h!==wr&&h!==Qt){for(let E in a.#r)if((h.length>1||E.length>1)&&E!==wr&&E!==Qt)throw kr}f=a.#r[h]=new du}p!==""&&(f.#t??=o.varIndex++,n.push([p,f.#t]))}else if(f=a.#r[u],!f){for(let p in a.#r)if(p.length>1&&p!==wr&&p!==Qt)throw kr;f=a.#r[u]=new du}a=f}if(a.#e!==void 0)throw kr;a.#e=i?-1:r}buildRegExpStr(){let r=Object.keys(this.#r).sort(Y7).map(n=>{let o=this.#r[n],i=o.buildRegExpStr();return i===""?"":(typeof o.#t=="number"?`(${n})@${o.#t}`:Iy.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 hu=class{#e={varIndex:0};#t=new Py;#r=0;paths=Oe();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 u=`@\\${a}`;return n[a]=[u,c],a++,s=!0,u}),!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 vy=Oe();function My(e){return vy[e]??=new RegExp(`^${e.replace(/\/:[^/{}]+(?:\{\[\^\/]\+})?(?=[/{]|$)|\/?\*$|([.\\+*[^\]$()?{}|])/g,(t,r)=>r?`\\${r}`:t==="/*"?Qt:t==="*"?wr:`/:${eo}`)}$`)}function Qa(e,t){for(let r of Object.keys(e).sort((n,o)=>o.length-n.length))if(My(r).test(t))return[...e[r]]}var Za=class{name="RegExpRouter";#e;#t;#r;constructor(){this.#e={[Ne]:Oe()},this.#t={[Ne]:Oe()},this.#r={[Ne]:new hu}}#i(e,t){try{this.#r[e].insert(t,!/\*|\/:/.test(t))}catch(r){throw r===kr?new Xa(t):r}}add(e,t,r){let n=this.#e,o=this.#t;if(!n)throw new Error(za);if(!n[e]){this.#r[e]=new hu;for(let s of[n,o]){s[e]=Oe();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=My(t);for(let c of i)n[c][t]||(this.#i(c,t),n[c][t]=Qa(n[c],t)||Qa(n[Ne],t)||[]);for(let c of[n,o])for(let u of i)for(let l in c[u])s.test(l)&&c[u][l].push([r,t]);return}let a=qa(t)||[t];for(let s of a)for(let c of i)o[c][s]||(this.#i(c,s),o[c][s]=Qa(n[c],s)||Qa(n[Ne],s)||[]),o[c][s].push([r,s])}match=pu;buildAllMatchers(){let e=Oe();for(let t of Object.keys(this.#t))e[t]=this.#o(t);return this.#e=this.#t=this.#r=void 0,vy=Oe(),e}#o(e){let t=this.#e[e],r=this.#t[e],n=this.#r[e],o=Oe(),i=[],[a,s,c]=n.buildRegExp();for(let u of[t,r])for(let l in u){let f=u[l],p=n.paths[l];if(!p){o[l]=[f.map(([h])=>[h,Oe()]),Ja];continue}i[p[0]]=f.map(([h,E])=>[h,n.paths[E][1].reduceRight((y,[S],d)=>(y[S]=c[p[1][d][1]],y),Oe())])}return[a,s.map(u=>i[u]),o]}};var mu=class{name="SmartRouter";#e=[];#t=[];constructor(e){this.#e=e.routers}add(e,t,r){if(!this.#t)throw new Error(za);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,u=n.length;c<u;c++)s.add(...n[c]);a=s.match(e,t)}catch(c){if(c instanceof Xa)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 gu=Oe(),z7=0,ky=class wy{#e=[];#t=Oe();#r=[];#i;#o=gu;insert(t,r,n){let o=this,i=my(r),a=new Set,s=0;for(let c of i){let u=i[++s],l=gy(c,u)||(u===void 0&&c&&c.indexOf("*")===c.length-1?c:null),f=Array.isArray(l),p=f?l[0]:l||c,h=o.#t[p]||=new wy;l&&!h.#i&&(h.#i=l,o.#r.push(h)),o=h,f&&a.add(l[1])}o.#e.push({[t]:{handler:n,possibleKeys:[...a],score:++z7}})}#n(t,r,n,o,i){for(let a=0,s=r.#e.length;a<s;a++){let c=r.#e[a],u=c[n]||c[Ne];if(u){u.params=Oe(),t.push(u);for(let l=0,f=u.possibleKeys.length;l<f;l++){let p=u.possibleKeys[l];u.params[p]=i?.[p]&&!l?i[p]:o[p]??i?.[p]}}}}search(t,r){let n=[];this.#o=gu;let i=[this],a=su(r),s=[],c=a.length,u=null;for(let l=0;l<c;l++){let f=a[l],p=l===c-1,h=[];for(let y=0,S=i.length;y<S;y++){let d=i[y],g=d.#t[f];g&&(g.#o=d.#o,p?(g.#t["*"]&&this.#n(n,g.#t["*"],t,d.#o),this.#n(n,g,t,d.#o)):h.push(g));for(let m of d.#r){let x=m.#i,C=d.#o===gu?{}:{...d.#o};if(typeof x=="string"){(x==="*"||f.startsWith(x.slice(0,-1)))&&(this.#n(n,m,t,d.#o),x==="*"&&(m.#o=C,h.push(m)));continue}let[,Ce,bt]=x;if(!(!f&&bt===!0)){if(bt!==!0){if(!u){u=[];let It=r[0]==="/"?1:0;for(let Me=0;Me<c;Me++)u[Me]=It,It+=a[Me].length+1}let Ye=r.slice(u[l]),$t=bt.exec(Ye);if($t){C[Ce]=$t[0],this.#n(n,m,t,d.#o,C),$t[0].length===Ye.length&&m.#t["*"]&&this.#n(n,m.#t["*"],t,d.#o,C);for(let It in m.#t){m.#o=C;let Me=$t[0].match(/\//g)?.length??0;(s[Me]||=[]).push(m);break}continue}}(bt===!0||bt.test(f))&&(C[Ce]=f,p?(this.#n(n,m,t,C,d.#o),m.#t["*"]&&this.#n(n,m.#t["*"],t,C,d.#o)):(m.#o=C,h.push(m)))}}}let E=s.shift();i=E?h.concat(E):h}return n[1]&&n.sort((l,f)=>l.score-f.score),[n.map(({handler:l,params:f})=>[l,f])]}};var Eu=class{name="TrieRouter";#e=new ky;add(e,t,r){for(let n of qa(t)||[t])this.#e.insert(e,n,r)}match(e,t){return this.#e.search(e,t)}};var yu=class extends Cy{constructor(e={}){super(e),this.router=e.router??new mu({routers:[new Za,new Eu]})}};function _y(e,t,r){return Response.json({message:`Data received for ${e}: ${r}`})}async function By(e){let t=e!=="dark"&&e!=="light"?"dark":e,r=Jl(t);return console.log("Image Path: ",r),I(r)?new Response(Bun.file(r)):(console.log("Replying with SVG field"),new Response(js(t),{headers:{"Content-Type":"image/svg+xml"}}))}async function Fy(e){let t=e!=="dark"&&e!=="light"?"dark":e;return console.log("SVG field requested"),new Response(js(t),{headers:{"Content-Type":"image/svg+xml"}})}async function Dy(e,t){let r=bE(e,t);return nr(r)?Response.json({error:r.errors().join(`
159
- `)}):Response.json(JSON.parse(hs(r)))}async function jy(){let e=await wa();return Response.json(JSON.parse(hs(e)))}async function Gy(e){console.log("Saving DB");try{let t=Mu(e,xl);if(I(t))CE(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 Zt=new yu;Zt.get("/img/field/:theme",async e=>By(e.req.param("theme")));Zt.get("/img/svg/:theme",async e=>Fy(e.req.param("theme")));Zt.get("/api/loadpath/:team/:path",async e=>{let{team:t,path:r}=e.req.param();return Dy(t,r)});Zt.get("/api/savepath/:team/:path/:data",async e=>{let{team:t,path:r,data:n}=e.req.param();return _y(t,r,n)});Zt.get("/api/db",async()=>jy());Zt.put("/api/putdb",async e=>Gy(JSON.stringify(e.req.json())));Zt.get("/",ou({path:"./index.html",onNotFound:(e,t)=>{console.log("/ FNF: ",e)}}));Zt.get("/*",ou({root:on(),onNotFound:(e,t)=>{console.log(`File not found: ${e}`)}}));var X7=58888,Hy=Number(process.env.PORT)||X7,Ky,Su,Wy=new Promise((e,t)=>{Ky=e,Su=t}),J7=iy({fetch:Zt.fetch,port:Hy},e=>{console.log(`App running at http://localhost:${e.port}`),Ky(`http://localhost:${e.port}`)});J7.on("error",e=>{e.code==="EADDRINUSE"?Su(`Port ${Hy} already in use`):Su(e.name+": "+e.message)});I(__dirname)&&Al(__dirname);var Q7=[...$a.default.argv.slice(2),$a.default.cwd()].map(e=>Vy.default.resolve(e));Cl(Q7);$a.default.chdir(on());Wy.then(vE).catch(console.error);
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
160
  /*! Bundled license information:
161
161
 
162
162
  lodash-es/lodash.js: