@xano/xanoscript-monaco-editor 0.1.10 → 0.1.12
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/logic-assistant-script.js +41 -41
- package/dist/worker.js +74 -74
- package/package.json +2 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
(()=>{var fx=Object.defineProperty;var r=(e,t)=>fx(e,"name",{value:t,configurable:!0});var dx=typeof global=="object"&&global&&global.Object===Object&&global,Ta=dx;var Tx=typeof self=="object"&&self&&self.Object===Object&&self,Ex=Ta||Tx||Function("return this")(),Te=Ex;var hx=Te.Symbol,xe=hx;var cf=Object.prototype,Sx=cf.hasOwnProperty,Ax=cf.toString,Sn=xe?xe.toStringTag:void 0;function Ux(e){var t=Sx.call(e,Sn),o=e[Sn];try{e[Sn]=void 0;var n=!0}catch{}var i=Ax.call(e);return n&&(t?e[Sn]=o:delete e[Sn]),i}r(Ux,"getRawTag");var lf=Ux;var gx=Object.prototype,kx=gx.toString;function Rx(e){return kx.call(e)}r(Rx,"objectToString");var uf=Rx;var Lx="[object Null]",xx="[object Undefined]",pf=xe?xe.toStringTag:void 0;function Cx(e){return e==null?e===void 0?xx:Lx:pf&&pf in Object(e)?lf(e):uf(e)}r(Cx,"baseGetTag");var ye=Cx;function Ox(e){return e!=null&&typeof e=="object"}r(Ox,"isObjectLike");var ne=Ox;var Nx="[object Symbol]";function bx(e){return typeof e=="symbol"||ne(e)&&ye(e)==Nx}r(bx,"isSymbol");var Vt=bx;function Mx(e,t){for(var o=-1,n=e==null?0:e.length,i=Array(n);++o<n;)i[o]=t(e[o],o,e);return i}r(Mx,"arrayMap");var dt=Mx;var yx=Array.isArray,b=yx;var Fx=1/0,mf=xe?xe.prototype:void 0,ff=mf?mf.toString:void 0;function df(e){if(typeof e=="string")return e;if(b(e))return dt(e,df)+"";if(Vt(e))return ff?ff.call(e):"";var t=e+"";return t=="0"&&1/e==-Fx?"-0":t}r(df,"baseToString");var Tf=df;var _x=/\s/;function Ix(e){for(var t=e.length;t--&&_x.test(e.charAt(t)););return t}r(Ix,"trimmedEndIndex");var Ef=Ix;var vx=/^\s+/;function wx(e){return e&&e.slice(0,Ef(e)+1).replace(vx,"")}r(wx,"baseTrim");var hf=wx;function Bx(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}r(Bx,"isObject");var ae=Bx;var Sf=NaN,Px=/^[-+]0x[0-9a-f]+$/i,Gx=/^0b[01]+$/i,Dx=/^0o[0-7]+$/i,Vx=parseInt;function qx(e){if(typeof e=="number")return e;if(Vt(e))return Sf;if(ae(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ae(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=hf(e);var o=Gx.test(e);return o||Dx.test(e)?Vx(e.slice(2),o?2:8):Px.test(e)?Sf:+e}r(qx,"toNumber");var Af=qx;var Uf=1/0,jx=17976931348623157e292;function Wx(e){if(!e)return e===0?e:0;if(e=Af(e),e===Uf||e===-Uf){var t=e<0?-1:1;return t*jx}return e===e?e:0}r(Wx,"toFinite");var gf=Wx;function Yx(e){var t=gf(e),o=t%1;return t===t?o?t-o:t:0}r(Yx,"toInteger");var Tt=Yx;function Kx(e){return e}r(Kx,"identity");var rt=Kx;var Hx="[object AsyncFunction]",zx="[object Function]",Jx="[object GeneratorFunction]",Xx="[object Proxy]";function Qx(e){if(!ae(e))return!1;var t=ye(e);return t==zx||t==Jx||t==Hx||t==Xx}r(Qx,"isFunction");var Pe=Qx;var Zx=Te["__core-js_shared__"],Ea=Zx;var kf=(function(){var e=/[^.]+$/.exec(Ea&&Ea.keys&&Ea.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function $x(e){return!!kf&&kf in e}r($x,"isMasked");var Rf=$x;var eC=Function.prototype,tC=eC.toString;function rC(e){if(e!=null){try{return tC.call(e)}catch{}try{return e+""}catch{}}return""}r(rC,"toSource");var bt=rC;var oC=/[\\^$.*+?()[\]{}|]/g,nC=/^\[object .+?Constructor\]$/,aC=Function.prototype,iC=Object.prototype,sC=aC.toString,cC=iC.hasOwnProperty,lC=RegExp("^"+sC.call(cC).replace(oC,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function uC(e){if(!ae(e)||Rf(e))return!1;var t=Pe(e)?lC:nC;return t.test(bt(e))}r(uC,"baseIsNative");var Lf=uC;function pC(e,t){return e?.[t]}r(pC,"getValue");var xf=pC;function mC(e,t){var o=xf(e,t);return Lf(o)?o:void 0}r(mC,"getNative");var We=mC;var fC=We(Te,"WeakMap"),ha=fC;var Cf=Object.create,dC=(function(){function e(){}return r(e,"object"),function(t){if(!ae(t))return{};if(Cf)return Cf(t);e.prototype=t;var o=new e;return e.prototype=void 0,o}})(),Of=dC;function TC(e,t,o){switch(o.length){case 0:return e.call(t);case 1:return e.call(t,o[0]);case 2:return e.call(t,o[0],o[1]);case 3:return e.call(t,o[0],o[1],o[2])}return e.apply(t,o)}r(TC,"apply");var Nf=TC;function EC(){}r(EC,"noop");var ie=EC;function hC(e,t){var o=-1,n=e.length;for(t||(t=Array(n));++o<n;)t[o]=e[o];return t}r(hC,"copyArray");var bf=hC;var SC=800,AC=16,UC=Date.now;function gC(e){var t=0,o=0;return function(){var n=UC(),i=AC-(n-o);if(o=n,i>0){if(++t>=SC)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}r(gC,"shortOut");var Mf=gC;function kC(e){return function(){return e}}r(kC,"constant");var yf=kC;var RC=(function(){try{var e=We(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Dr=RC;var LC=Dr?function(e,t){return Dr(e,"toString",{configurable:!0,enumerable:!1,value:yf(t),writable:!0})}:rt,Ff=LC;var xC=Mf(Ff),_f=xC;function CC(e,t){for(var o=-1,n=e==null?0:e.length;++o<n&&t(e[o],o,e)!==!1;);return e}r(CC,"arrayEach");var Sa=CC;function OC(e,t,o,n){for(var i=e.length,s=o+(n?1:-1);n?s--:++s<i;)if(t(e[s],s,e))return s;return-1}r(OC,"baseFindIndex");var Aa=OC;function NC(e){return e!==e}r(NC,"baseIsNaN");var If=NC;function bC(e,t,o){for(var n=o-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}r(bC,"strictIndexOf");var vf=bC;function MC(e,t,o){return t===t?vf(e,t,o):Aa(e,If,o)}r(MC,"baseIndexOf");var Vr=MC;function yC(e,t){var o=e==null?0:e.length;return!!o&&Vr(e,t,0)>-1}r(yC,"arrayIncludes");var Ua=yC;var FC=9007199254740991,_C=/^(?:0|[1-9]\d*)$/;function IC(e,t){var o=typeof e;return t=t??FC,!!t&&(o=="number"||o!="symbol"&&_C.test(e))&&e>-1&&e%1==0&&e<t}r(IC,"isIndex");var qt=IC;function vC(e,t,o){t=="__proto__"&&Dr?Dr(e,t,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[t]=o}r(vC,"baseAssignValue");var qr=vC;function wC(e,t){return e===t||e!==e&&t!==t}r(wC,"eq");var Et=wC;var BC=Object.prototype,PC=BC.hasOwnProperty;function GC(e,t,o){var n=e[t];(!(PC.call(e,t)&&Et(n,o))||o===void 0&&!(t in e))&&qr(e,t,o)}r(GC,"assignValue");var jt=GC;function DC(e,t,o,n){var i=!o;o||(o={});for(var s=-1,c=t.length;++s<c;){var l=t[s],p=n?n(o[l],e[l],l,o,e):void 0;p===void 0&&(p=e[l]),i?qr(o,l,p):jt(o,l,p)}return o}r(DC,"copyObject");var ht=DC;var wf=Math.max;function VC(e,t,o){return t=wf(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=wf(n.length-t,0),c=Array(s);++i<s;)c[i]=n[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=n[i];return l[t]=o(c),Nf(e,this,l)}}r(VC,"overRest");var Bf=VC;function qC(e,t){return _f(Bf(e,t,rt),e+"")}r(qC,"baseRest");var Wt=qC;var jC=9007199254740991;function WC(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=jC}r(WC,"isLength");var jr=WC;function YC(e){return e!=null&&jr(e.length)&&!Pe(e)}r(YC,"isArrayLike");var Ee=YC;function KC(e,t,o){if(!ae(o))return!1;var n=typeof t;return(n=="number"?Ee(o)&&qt(t,o.length):n=="string"&&t in o)?Et(o[t],e):!1}r(KC,"isIterateeCall");var Yt=KC;function HC(e){return Wt(function(t,o){var n=-1,i=o.length,s=i>1?o[i-1]:void 0,c=i>2?o[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,c&&Yt(o[0],o[1],c)&&(s=i<3?void 0:s,i=1),t=Object(t);++n<i;){var l=o[n];l&&e(t,l,n,s)}return t})}r(HC,"createAssigner");var Pf=HC;var zC=Object.prototype;function JC(e){var t=e&&e.constructor,o=typeof t=="function"&&t.prototype||zC;return e===o}r(JC,"isPrototype");var St=JC;function XC(e,t){for(var o=-1,n=Array(e);++o<e;)n[o]=t(o);return n}r(XC,"baseTimes");var Gf=XC;var QC="[object Arguments]";function ZC(e){return ne(e)&&ye(e)==QC}r(ZC,"baseIsArguments");var nm=ZC;var Df=Object.prototype,$C=Df.hasOwnProperty,eO=Df.propertyIsEnumerable,tO=nm((function(){return arguments})())?nm:function(e){return ne(e)&&$C.call(e,"callee")&&!eO.call(e,"callee")},Kt=tO;function rO(){return!1}r(rO,"stubFalse");var Vf=rO;var Wf=typeof exports=="object"&&exports&&!exports.nodeType&&exports,qf=Wf&&typeof module=="object"&&module&&!module.nodeType&&module,oO=qf&&qf.exports===Wf,jf=oO?Te.Buffer:void 0,nO=jf?jf.isBuffer:void 0,aO=nO||Vf,Mt=aO;var iO="[object Arguments]",sO="[object Array]",cO="[object Boolean]",lO="[object Date]",uO="[object Error]",pO="[object Function]",mO="[object Map]",fO="[object Number]",dO="[object Object]",TO="[object RegExp]",EO="[object Set]",hO="[object String]",SO="[object WeakMap]",AO="[object ArrayBuffer]",UO="[object DataView]",gO="[object Float32Array]",kO="[object Float64Array]",RO="[object Int8Array]",LO="[object Int16Array]",xO="[object Int32Array]",CO="[object Uint8Array]",OO="[object Uint8ClampedArray]",NO="[object Uint16Array]",bO="[object Uint32Array]",Q={};Q[gO]=Q[kO]=Q[RO]=Q[LO]=Q[xO]=Q[CO]=Q[OO]=Q[NO]=Q[bO]=!0;Q[iO]=Q[sO]=Q[AO]=Q[cO]=Q[UO]=Q[lO]=Q[uO]=Q[pO]=Q[mO]=Q[fO]=Q[dO]=Q[TO]=Q[EO]=Q[hO]=Q[SO]=!1;function MO(e){return ne(e)&&jr(e.length)&&!!Q[ye(e)]}r(MO,"baseIsTypedArray");var Yf=MO;function yO(e){return function(t){return e(t)}}r(yO,"baseUnary");var At=yO;var Kf=typeof exports=="object"&&exports&&!exports.nodeType&&exports,An=Kf&&typeof module=="object"&&module&&!module.nodeType&&module,FO=An&&An.exports===Kf,am=FO&&Ta.process,_O=(function(){try{var e=An&&An.require&&An.require("util").types;return e||am&&am.binding&&am.binding("util")}catch{}})(),ot=_O;var Hf=ot&&ot.isTypedArray,IO=Hf?At(Hf):Yf,Wr=IO;var vO=Object.prototype,wO=vO.hasOwnProperty;function BO(e,t){var o=b(e),n=!o&&Kt(e),i=!o&&!n&&Mt(e),s=!o&&!n&&!i&&Wr(e),c=o||n||i||s,l=c?Gf(e.length,String):[],p=l.length;for(var f in e)(t||wO.call(e,f))&&!(c&&(f=="length"||i&&(f=="offset"||f=="parent")||s&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||qt(f,p)))&&l.push(f);return l}r(BO,"arrayLikeKeys");var ga=BO;function PO(e,t){return function(o){return e(t(o))}}r(PO,"overArg");var ka=PO;var GO=ka(Object.keys,Object),zf=GO;var DO=Object.prototype,VO=DO.hasOwnProperty;function qO(e){if(!St(e))return zf(e);var t=[];for(var o in Object(e))VO.call(e,o)&&o!="constructor"&&t.push(o);return t}r(qO,"baseKeys");var Ra=qO;function jO(e){return Ee(e)?ga(e):Ra(e)}r(jO,"keys");var j=jO;var WO=Object.prototype,YO=WO.hasOwnProperty,KO=Pf(function(e,t){if(St(t)||Ee(t)){ht(t,j(t),e);return}for(var o in t)YO.call(t,o)&&jt(e,o,t[o])}),Fe=KO;function HO(e){var t=[];if(e!=null)for(var o in Object(e))t.push(o);return t}r(HO,"nativeKeysIn");var Jf=HO;var zO=Object.prototype,JO=zO.hasOwnProperty;function XO(e){if(!ae(e))return Jf(e);var t=St(e),o=[];for(var n in e)n=="constructor"&&(t||!JO.call(e,n))||o.push(n);return o}r(XO,"baseKeysIn");var Xf=XO;function QO(e){return Ee(e)?ga(e,!0):Xf(e)}r(QO,"keysIn");var Ht=QO;var ZO=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$O=/^\w*$/;function eN(e,t){if(b(e))return!1;var o=typeof e;return o=="number"||o=="symbol"||o=="boolean"||e==null||Vt(e)?!0:$O.test(e)||!ZO.test(e)||t!=null&&e in Object(t)}r(eN,"isKey");var Yr=eN;var tN=We(Object,"create"),yt=tN;function rN(){this.__data__=yt?yt(null):{},this.size=0}r(rN,"hashClear");var Qf=rN;function oN(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}r(oN,"hashDelete");var Zf=oN;var nN="__lodash_hash_undefined__",aN=Object.prototype,iN=aN.hasOwnProperty;function sN(e){var t=this.__data__;if(yt){var o=t[e];return o===nN?void 0:o}return iN.call(t,e)?t[e]:void 0}r(sN,"hashGet");var $f=sN;var cN=Object.prototype,lN=cN.hasOwnProperty;function uN(e){var t=this.__data__;return yt?t[e]!==void 0:lN.call(t,e)}r(uN,"hashHas");var ed=uN;var pN="__lodash_hash_undefined__";function mN(e,t){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=yt&&t===void 0?pN:t,this}r(mN,"hashSet");var td=mN;function Kr(e){var t=-1,o=e==null?0:e.length;for(this.clear();++t<o;){var n=e[t];this.set(n[0],n[1])}}r(Kr,"Hash");Kr.prototype.clear=Qf;Kr.prototype.delete=Zf;Kr.prototype.get=$f;Kr.prototype.has=ed;Kr.prototype.set=td;var im=Kr;function fN(){this.__data__=[],this.size=0}r(fN,"listCacheClear");var rd=fN;function dN(e,t){for(var o=e.length;o--;)if(Et(e[o][0],t))return o;return-1}r(dN,"assocIndexOf");var zt=dN;var TN=Array.prototype,EN=TN.splice;function hN(e){var t=this.__data__,o=zt(t,e);if(o<0)return!1;var n=t.length-1;return o==n?t.pop():EN.call(t,o,1),--this.size,!0}r(hN,"listCacheDelete");var od=hN;function SN(e){var t=this.__data__,o=zt(t,e);return o<0?void 0:t[o][1]}r(SN,"listCacheGet");var nd=SN;function AN(e){return zt(this.__data__,e)>-1}r(AN,"listCacheHas");var ad=AN;function UN(e,t){var o=this.__data__,n=zt(o,e);return n<0?(++this.size,o.push([e,t])):o[n][1]=t,this}r(UN,"listCacheSet");var id=UN;function Hr(e){var t=-1,o=e==null?0:e.length;for(this.clear();++t<o;){var n=e[t];this.set(n[0],n[1])}}r(Hr,"ListCache");Hr.prototype.clear=rd;Hr.prototype.delete=od;Hr.prototype.get=nd;Hr.prototype.has=ad;Hr.prototype.set=id;var Jt=Hr;var gN=We(Te,"Map"),Xt=gN;function kN(){this.size=0,this.__data__={hash:new im,map:new(Xt||Jt),string:new im}}r(kN,"mapCacheClear");var sd=kN;function RN(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}r(RN,"isKeyable");var cd=RN;function LN(e,t){var o=e.__data__;return cd(t)?o[typeof t=="string"?"string":"hash"]:o.map}r(LN,"getMapData");var Qt=LN;function xN(e){var t=Qt(this,e).delete(e);return this.size-=t?1:0,t}r(xN,"mapCacheDelete");var ld=xN;function CN(e){return Qt(this,e).get(e)}r(CN,"mapCacheGet");var ud=CN;function ON(e){return Qt(this,e).has(e)}r(ON,"mapCacheHas");var pd=ON;function NN(e,t){var o=Qt(this,e),n=o.size;return o.set(e,t),this.size+=o.size==n?0:1,this}r(NN,"mapCacheSet");var md=NN;function zr(e){var t=-1,o=e==null?0:e.length;for(this.clear();++t<o;){var n=e[t];this.set(n[0],n[1])}}r(zr,"MapCache");zr.prototype.clear=sd;zr.prototype.delete=ld;zr.prototype.get=ud;zr.prototype.has=pd;zr.prototype.set=md;var br=zr;var bN="Expected a function";function sm(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(bN);var o=r(function(){var n=arguments,i=t?t.apply(this,n):n[0],s=o.cache;if(s.has(i))return s.get(i);var c=e.apply(this,n);return o.cache=s.set(i,c)||s,c},"memoized");return o.cache=new(sm.Cache||br),o}r(sm,"memoize");sm.Cache=br;var fd=sm;var MN=500;function yN(e){var t=fd(e,function(n){return o.size===MN&&o.clear(),n}),o=t.cache;return t}r(yN,"memoizeCapped");var dd=yN;var FN=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_N=/\\(\\)?/g,IN=dd(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(FN,function(o,n,i,s){t.push(i?s.replace(_N,"$1"):n||o)}),t}),Td=IN;function vN(e){return e==null?"":Tf(e)}r(vN,"toString");var Ed=vN;function wN(e,t){return b(e)?e:Yr(e,t)?[e]:Td(Ed(e))}r(wN,"castPath");var Zt=wN;var BN=1/0;function PN(e){if(typeof e=="string"||Vt(e))return e;var t=e+"";return t=="0"&&1/e==-BN?"-0":t}r(PN,"toKey");var Ut=PN;function GN(e,t){t=Zt(t,e);for(var o=0,n=t.length;e!=null&&o<n;)e=e[Ut(t[o++])];return o&&o==n?e:void 0}r(GN,"baseGet");var Jr=GN;function DN(e,t,o){var n=e==null?void 0:Jr(e,t);return n===void 0?o:n}r(DN,"get");var Mr=DN;function VN(e,t){for(var o=-1,n=t.length,i=e.length;++o<n;)e[i+o]=t[o];return e}r(VN,"arrayPush");var Xr=VN;var hd=xe?xe.isConcatSpreadable:void 0;function qN(e){return b(e)||Kt(e)||!!(hd&&e&&e[hd])}r(qN,"isFlattenable");var Sd=qN;function Ad(e,t,o,n,i){var s=-1,c=e.length;for(o||(o=Sd),i||(i=[]);++s<c;){var l=e[s];t>0&&o(l)?t>1?Ad(l,t-1,o,n,i):Xr(i,l):n||(i[i.length]=l)}return i}r(Ad,"baseFlatten");var Qr=Ad;function jN(e){var t=e==null?0:e.length;return t?Qr(e,1):[]}r(jN,"flatten");var ke=jN;var WN=ka(Object.getPrototypeOf,Object),Zr=WN;var YN="[object Object]",KN=Function.prototype,HN=Object.prototype,Ud=KN.toString,zN=HN.hasOwnProperty,JN=Ud.call(Object);function XN(e){if(!ne(e)||ye(e)!=YN)return!1;var t=Zr(e);if(t===null)return!0;var o=zN.call(t,"constructor")&&t.constructor;return typeof o=="function"&&o instanceof o&&Ud.call(o)==JN}r(XN,"isPlainObject");var La=XN;function QN(e,t,o){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),o=o>i?i:o,o<0&&(o+=i),i=t>o?0:o-t>>>0,t>>>=0;for(var s=Array(i);++n<i;)s[n]=e[n+t];return s}r(QN,"baseSlice");var xa=QN;function ZN(e,t,o,n){var i=-1,s=e==null?0:e.length;for(n&&s&&(o=e[++i]);++i<s;)o=t(o,e[i],i,e);return o}r(ZN,"arrayReduce");var gd=ZN;function $N(){this.__data__=new Jt,this.size=0}r($N,"stackClear");var kd=$N;function eb(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o}r(eb,"stackDelete");var Rd=eb;function tb(e){return this.__data__.get(e)}r(tb,"stackGet");var Ld=tb;function rb(e){return this.__data__.has(e)}r(rb,"stackHas");var xd=rb;var ob=200;function nb(e,t){var o=this.__data__;if(o instanceof Jt){var n=o.__data__;if(!Xt||n.length<ob-1)return n.push([e,t]),this.size=++o.size,this;o=this.__data__=new br(n)}return o.set(e,t),this.size=o.size,this}r(nb,"stackSet");var Cd=nb;function $r(e){var t=this.__data__=new Jt(e);this.size=t.size}r($r,"Stack");$r.prototype.clear=kd;$r.prototype.delete=Rd;$r.prototype.get=Ld;$r.prototype.has=xd;$r.prototype.set=Cd;var $t=$r;function ab(e,t){return e&&ht(t,j(t),e)}r(ab,"baseAssign");var Od=ab;function ib(e,t){return e&&ht(t,Ht(t),e)}r(ib,"baseAssignIn");var Nd=ib;var Fd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,bd=Fd&&typeof module=="object"&&module&&!module.nodeType&&module,sb=bd&&bd.exports===Fd,Md=sb?Te.Buffer:void 0,yd=Md?Md.allocUnsafe:void 0;function cb(e,t){if(t)return e.slice();var o=e.length,n=yd?yd(o):new e.constructor(o);return e.copy(n),n}r(cb,"cloneBuffer");var _d=cb;function lb(e,t){for(var o=-1,n=e==null?0:e.length,i=0,s=[];++o<n;){var c=e[o];t(c,o,e)&&(s[i++]=c)}return s}r(lb,"arrayFilter");var eo=lb;function ub(){return[]}r(ub,"stubArray");var Ca=ub;var pb=Object.prototype,mb=pb.propertyIsEnumerable,Id=Object.getOwnPropertySymbols,fb=Id?function(e){return e==null?[]:(e=Object(e),eo(Id(e),function(t){return mb.call(e,t)}))}:Ca,to=fb;function db(e,t){return ht(e,to(e),t)}r(db,"copySymbols");var vd=db;var Tb=Object.getOwnPropertySymbols,Eb=Tb?function(e){for(var t=[];e;)Xr(t,to(e)),e=Zr(e);return t}:Ca,Oa=Eb;function hb(e,t){return ht(e,Oa(e),t)}r(hb,"copySymbolsIn");var wd=hb;function Sb(e,t,o){var n=t(e);return b(e)?n:Xr(n,o(e))}r(Sb,"baseGetAllKeys");var Na=Sb;function Ab(e){return Na(e,j,to)}r(Ab,"getAllKeys");var Un=Ab;function Ub(e){return Na(e,Ht,Oa)}r(Ub,"getAllKeysIn");var ba=Ub;var gb=We(Te,"DataView"),Ma=gb;var kb=We(Te,"Promise"),ya=kb;var Rb=We(Te,"Set"),er=Rb;var Bd="[object Map]",Lb="[object Object]",Pd="[object Promise]",Gd="[object Set]",Dd="[object WeakMap]",Vd="[object DataView]",xb=bt(Ma),Cb=bt(Xt),Ob=bt(ya),Nb=bt(er),bb=bt(ha),yr=ye;(Ma&&yr(new Ma(new ArrayBuffer(1)))!=Vd||Xt&&yr(new Xt)!=Bd||ya&&yr(ya.resolve())!=Pd||er&&yr(new er)!=Gd||ha&&yr(new ha)!=Dd)&&(yr=r(function(e){var t=ye(e),o=t==Lb?e.constructor:void 0,n=o?bt(o):"";if(n)switch(n){case xb:return Vd;case Cb:return Bd;case Ob:return Pd;case Nb:return Gd;case bb:return Dd}return t},"getTag"));var st=yr;var Mb=Object.prototype,yb=Mb.hasOwnProperty;function Fb(e){var t=e.length,o=new e.constructor(t);return t&&typeof e[0]=="string"&&yb.call(e,"index")&&(o.index=e.index,o.input=e.input),o}r(Fb,"initCloneArray");var qd=Fb;var _b=Te.Uint8Array,ro=_b;function Ib(e){var t=new e.constructor(e.byteLength);return new ro(t).set(new ro(e)),t}r(Ib,"cloneArrayBuffer");var oo=Ib;function vb(e,t){var o=t?oo(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.byteLength)}r(vb,"cloneDataView");var jd=vb;var wb=/\w*$/;function Bb(e){var t=new e.constructor(e.source,wb.exec(e));return t.lastIndex=e.lastIndex,t}r(Bb,"cloneRegExp");var Wd=Bb;var Yd=xe?xe.prototype:void 0,Kd=Yd?Yd.valueOf:void 0;function Pb(e){return Kd?Object(Kd.call(e)):{}}r(Pb,"cloneSymbol");var Hd=Pb;function Gb(e,t){var o=t?oo(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}r(Gb,"cloneTypedArray");var zd=Gb;var Db="[object Boolean]",Vb="[object Date]",qb="[object Map]",jb="[object Number]",Wb="[object RegExp]",Yb="[object Set]",Kb="[object String]",Hb="[object Symbol]",zb="[object ArrayBuffer]",Jb="[object DataView]",Xb="[object Float32Array]",Qb="[object Float64Array]",Zb="[object Int8Array]",$b="[object Int16Array]",eM="[object Int32Array]",tM="[object Uint8Array]",rM="[object Uint8ClampedArray]",oM="[object Uint16Array]",nM="[object Uint32Array]";function aM(e,t,o){var n=e.constructor;switch(t){case zb:return oo(e);case Db:case Vb:return new n(+e);case Jb:return jd(e,o);case Xb:case Qb:case Zb:case $b:case eM:case tM:case rM:case oM:case nM:return zd(e,o);case qb:return new n;case jb:case Kb:return new n(e);case Wb:return Wd(e);case Yb:return new n;case Hb:return Hd(e)}}r(aM,"initCloneByTag");var Jd=aM;function iM(e){return typeof e.constructor=="function"&&!St(e)?Of(Zr(e)):{}}r(iM,"initCloneObject");var Xd=iM;var sM="[object Map]";function cM(e){return ne(e)&&st(e)==sM}r(cM,"baseIsMap");var Qd=cM;var Zd=ot&&ot.isMap,lM=Zd?At(Zd):Qd,$d=lM;var uM="[object Set]";function pM(e){return ne(e)&&st(e)==uM}r(pM,"baseIsSet");var eT=pM;var tT=ot&&ot.isSet,mM=tT?At(tT):eT,rT=mM;var fM=1,dM=2,TM=4,oT="[object Arguments]",EM="[object Array]",hM="[object Boolean]",SM="[object Date]",AM="[object Error]",nT="[object Function]",UM="[object GeneratorFunction]",gM="[object Map]",kM="[object Number]",aT="[object Object]",RM="[object RegExp]",LM="[object Set]",xM="[object String]",CM="[object Symbol]",OM="[object WeakMap]",NM="[object ArrayBuffer]",bM="[object DataView]",MM="[object Float32Array]",yM="[object Float64Array]",FM="[object Int8Array]",_M="[object Int16Array]",IM="[object Int32Array]",vM="[object Uint8Array]",wM="[object Uint8ClampedArray]",BM="[object Uint16Array]",PM="[object Uint32Array]",K={};K[oT]=K[EM]=K[NM]=K[bM]=K[hM]=K[SM]=K[MM]=K[yM]=K[FM]=K[_M]=K[IM]=K[gM]=K[kM]=K[aT]=K[RM]=K[LM]=K[xM]=K[CM]=K[vM]=K[wM]=K[BM]=K[PM]=!0;K[AM]=K[nT]=K[OM]=!1;function Fa(e,t,o,n,i,s){var c,l=t&fM,p=t&dM,f=t&TM;if(o&&(c=i?o(e,n,i,s):o(e)),c!==void 0)return c;if(!ae(e))return e;var d=b(e);if(d){if(c=qd(e),!l)return bf(e,c)}else{var T=st(e),U=T==nT||T==UM;if(Mt(e))return _d(e,l);if(T==aT||T==oT||U&&!i){if(c=p||U?{}:Xd(e),!l)return p?wd(e,Nd(c,e)):vd(e,Od(c,e))}else{if(!K[T])return i?e:{};c=Jd(e,T,l)}}s||(s=new $t);var k=s.get(e);if(k)return k;s.set(e,c),rT(e)?e.forEach(function(_){c.add(Fa(_,t,o,_,e,s))}):$d(e)&&e.forEach(function(_,N){c.set(N,Fa(_,t,o,N,e,s))});var C=f?p?ba:Un:p?Ht:j,L=d?void 0:C(e);return Sa(L||e,function(_,N){L&&(N=_,_=e[N]),jt(c,N,Fa(_,t,o,N,e,s))}),c}r(Fa,"baseClone");var iT=Fa;var GM=4;function DM(e){return iT(e,GM)}r(DM,"clone");var H=DM;function VM(e){for(var t=-1,o=e==null?0:e.length,n=0,i=[];++t<o;){var s=e[t];s&&(i[n++]=s)}return i}r(VM,"compact");var gt=VM;var qM="__lodash_hash_undefined__";function jM(e){return this.__data__.set(e,qM),this}r(jM,"setCacheAdd");var sT=jM;function WM(e){return this.__data__.has(e)}r(WM,"setCacheHas");var cT=WM;function _a(e){var t=-1,o=e==null?0:e.length;for(this.__data__=new br;++t<o;)this.add(e[t])}r(_a,"SetCache");_a.prototype.add=_a.prototype.push=sT;_a.prototype.has=cT;var no=_a;function YM(e,t){for(var o=-1,n=e==null?0:e.length;++o<n;)if(t(e[o],o,e))return!0;return!1}r(YM,"arraySome");var Ia=YM;function KM(e,t){return e.has(t)}r(KM,"cacheHas");var ao=KM;var HM=1,zM=2;function JM(e,t,o,n,i,s){var c=o&HM,l=e.length,p=t.length;if(l!=p&&!(c&&p>l))return!1;var f=s.get(e),d=s.get(t);if(f&&d)return f==t&&d==e;var T=-1,U=!0,k=o&zM?new no:void 0;for(s.set(e,t),s.set(t,e);++T<l;){var C=e[T],L=t[T];if(n)var _=c?n(L,C,T,t,e,s):n(C,L,T,e,t,s);if(_!==void 0){if(_)continue;U=!1;break}if(k){if(!Ia(t,function(N,O){if(!ao(k,O)&&(C===N||i(C,N,o,n,s)))return k.push(O)})){U=!1;break}}else if(!(C===L||i(C,L,o,n,s))){U=!1;break}}return s.delete(e),s.delete(t),U}r(JM,"equalArrays");var va=JM;function XM(e){var t=-1,o=Array(e.size);return e.forEach(function(n,i){o[++t]=[i,n]}),o}r(XM,"mapToArray");var lT=XM;function QM(e){var t=-1,o=Array(e.size);return e.forEach(function(n){o[++t]=n}),o}r(QM,"setToArray");var io=QM;var ZM=1,$M=2,ey="[object Boolean]",ty="[object Date]",ry="[object Error]",oy="[object Map]",ny="[object Number]",ay="[object RegExp]",iy="[object Set]",sy="[object String]",cy="[object Symbol]",ly="[object ArrayBuffer]",uy="[object DataView]",uT=xe?xe.prototype:void 0,cm=uT?uT.valueOf:void 0;function py(e,t,o,n,i,s,c){switch(o){case uy:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case ly:return!(e.byteLength!=t.byteLength||!s(new ro(e),new ro(t)));case ey:case ty:case ny:return Et(+e,+t);case ry:return e.name==t.name&&e.message==t.message;case ay:case sy:return e==t+"";case oy:var l=lT;case iy:var p=n&ZM;if(l||(l=io),e.size!=t.size&&!p)return!1;var f=c.get(e);if(f)return f==t;n|=$M,c.set(e,t);var d=va(l(e),l(t),n,i,s,c);return c.delete(e),d;case cy:if(cm)return cm.call(e)==cm.call(t)}return!1}r(py,"equalByTag");var pT=py;var my=1,fy=Object.prototype,dy=fy.hasOwnProperty;function Ty(e,t,o,n,i,s){var c=o&my,l=Un(e),p=l.length,f=Un(t),d=f.length;if(p!=d&&!c)return!1;for(var T=p;T--;){var U=l[T];if(!(c?U in t:dy.call(t,U)))return!1}var k=s.get(e),C=s.get(t);if(k&&C)return k==t&&C==e;var L=!0;s.set(e,t),s.set(t,e);for(var _=c;++T<p;){U=l[T];var N=e[U],O=t[U];if(n)var x=c?n(O,N,U,t,e,s):n(N,O,U,e,t,s);if(!(x===void 0?N===O||i(N,O,o,n,s):x)){L=!1;break}_||(_=U=="constructor")}if(L&&!_){var v=e.constructor,w=t.constructor;v!=w&&"constructor"in e&&"constructor"in t&&!(typeof v=="function"&&v instanceof v&&typeof w=="function"&&w instanceof w)&&(L=!1)}return s.delete(e),s.delete(t),L}r(Ty,"equalObjects");var mT=Ty;var Ey=1,fT="[object Arguments]",dT="[object Array]",wa="[object Object]",hy=Object.prototype,TT=hy.hasOwnProperty;function Sy(e,t,o,n,i,s){var c=b(e),l=b(t),p=c?dT:st(e),f=l?dT:st(t);p=p==fT?wa:p,f=f==fT?wa:f;var d=p==wa,T=f==wa,U=p==f;if(U&&Mt(e)){if(!Mt(t))return!1;c=!0,d=!1}if(U&&!d)return s||(s=new $t),c||Wr(e)?va(e,t,o,n,i,s):pT(e,t,p,o,n,i,s);if(!(o&Ey)){var k=d&&TT.call(e,"__wrapped__"),C=T&&TT.call(t,"__wrapped__");if(k||C){var L=k?e.value():e,_=C?t.value():t;return s||(s=new $t),i(L,_,o,n,s)}}return U?(s||(s=new $t),mT(e,t,o,n,i,s)):!1}r(Sy,"baseIsEqualDeep");var ET=Sy;function hT(e,t,o,n,i){return e===t?!0:e==null||t==null||!ne(e)&&!ne(t)?e!==e&&t!==t:ET(e,t,o,n,hT,i)}r(hT,"baseIsEqual");var Ba=hT;var Ay=1,Uy=2;function gy(e,t,o,n){var i=o.length,s=i,c=!n;if(e==null)return!s;for(e=Object(e);i--;){var l=o[i];if(c&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<s;){l=o[i];var p=l[0],f=e[p],d=l[1];if(c&&l[2]){if(f===void 0&&!(p in e))return!1}else{var T=new $t;if(n)var U=n(f,d,p,e,t,T);if(!(U===void 0?Ba(d,f,Ay|Uy,n,T):U))return!1}}return!0}r(gy,"baseIsMatch");var ST=gy;function ky(e){return e===e&&!ae(e)}r(ky,"isStrictComparable");var Pa=ky;function Ry(e){for(var t=j(e),o=t.length;o--;){var n=t[o],i=e[n];t[o]=[n,i,Pa(i)]}return t}r(Ry,"getMatchData");var AT=Ry;function Ly(e,t){return function(o){return o==null?!1:o[e]===t&&(t!==void 0||e in Object(o))}}r(Ly,"matchesStrictComparable");var Ga=Ly;function xy(e){var t=AT(e);return t.length==1&&t[0][2]?Ga(t[0][0],t[0][1]):function(o){return o===e||ST(o,e,t)}}r(xy,"baseMatches");var UT=xy;function Cy(e,t){return e!=null&&t in Object(e)}r(Cy,"baseHasIn");var gT=Cy;function Oy(e,t,o){t=Zt(t,e);for(var n=-1,i=t.length,s=!1;++n<i;){var c=Ut(t[n]);if(!(s=e!=null&&o(e,c)))break;e=e[c]}return s||++n!=i?s:(i=e==null?0:e.length,!!i&&jr(i)&&qt(c,i)&&(b(e)||Kt(e)))}r(Oy,"hasPath");var Da=Oy;function Ny(e,t){return e!=null&&Da(e,t,gT)}r(Ny,"hasIn");var kT=Ny;var by=1,My=2;function yy(e,t){return Yr(e)&&Pa(t)?Ga(Ut(e),t):function(o){var n=Mr(o,e);return n===void 0&&n===t?kT(o,e):Ba(t,n,by|My)}}r(yy,"baseMatchesProperty");var RT=yy;function Fy(e){return function(t){return t?.[e]}}r(Fy,"baseProperty");var LT=Fy;function _y(e){return function(t){return Jr(t,e)}}r(_y,"basePropertyDeep");var xT=_y;function Iy(e){return Yr(e)?LT(Ut(e)):xT(e)}r(Iy,"property");var CT=Iy;function vy(e){return typeof e=="function"?e:e==null?rt:typeof e=="object"?b(e)?RT(e[0],e[1]):UT(e):CT(e)}r(vy,"baseIteratee");var he=vy;function wy(e,t,o,n){for(var i=-1,s=e==null?0:e.length;++i<s;){var c=e[i];t(n,c,o(c),e)}return n}r(wy,"arrayAggregator");var OT=wy;function By(e){return function(t,o,n){for(var i=-1,s=Object(t),c=n(t),l=c.length;l--;){var p=c[e?l:++i];if(o(s[p],p,s)===!1)break}return t}}r(By,"createBaseFor");var NT=By;var Py=NT(),bT=Py;function Gy(e,t){return e&&bT(e,t,j)}r(Gy,"baseForOwn");var MT=Gy;function Dy(e,t){return function(o,n){if(o==null)return o;if(!Ee(o))return e(o,n);for(var i=o.length,s=t?i:-1,c=Object(o);(t?s--:++s<i)&&n(c[s],s,c)!==!1;);return o}}r(Dy,"createBaseEach");var yT=Dy;var Vy=yT(MT),Ye=Vy;function qy(e,t,o,n){return Ye(e,function(i,s,c){t(n,i,o(i),c)}),n}r(qy,"baseAggregator");var FT=qy;function jy(e,t){return function(o,n){var i=b(o)?OT:FT,s=t?t():{};return i(o,e,he(n,2),s)}}r(jy,"createAggregator");var Va=jy;var _T=Object.prototype,Wy=_T.hasOwnProperty,Yy=Wt(function(e,t){e=Object(e);var o=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&Yt(t[0],t[1],i)&&(n=1);++o<n;)for(var s=t[o],c=Ht(s),l=-1,p=c.length;++l<p;){var f=c[l],d=e[f];(d===void 0||Et(d,_T[f])&&!Wy.call(e,f))&&(e[f]=s[f])}return e}),so=Yy;function Ky(e){return ne(e)&&Ee(e)}r(Ky,"isArrayLikeObject");var gn=Ky;function Hy(e,t,o){for(var n=-1,i=e==null?0:e.length;++n<i;)if(o(t,e[n]))return!0;return!1}r(Hy,"arrayIncludesWith");var qa=Hy;var zy=200;function Jy(e,t,o,n){var i=-1,s=Ua,c=!0,l=e.length,p=[],f=t.length;if(!l)return p;o&&(t=dt(t,At(o))),n?(s=qa,c=!1):t.length>=zy&&(s=ao,c=!1,t=new no(t));e:for(;++i<l;){var d=e[i],T=o==null?d:o(d);if(d=n||d!==0?d:0,c&&T===T){for(var U=f;U--;)if(t[U]===T)continue e;p.push(d)}else s(t,T,n)||p.push(d)}return p}r(Jy,"baseDifference");var ja=Jy;var Xy=Wt(function(e,t){return gn(e)?ja(e,Qr(t,1,gn,!0)):[]}),tr=Xy;function Qy(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}r(Qy,"last");var ct=Qy;function Zy(e,t,o){var n=e==null?0:e.length;return n?(t=o||t===void 0?1:Tt(t),xa(e,t<0?0:t,n)):[]}r(Zy,"drop");var me=Zy;function $y(e,t,o){var n=e==null?0:e.length;return n?(t=o||t===void 0?1:Tt(t),t=n-t,xa(e,0,t<0?0:t)):[]}r($y,"dropRight");var Ft=$y;function eF(e){return typeof e=="function"?e:rt}r(eF,"castFunction");var IT=eF;function tF(e,t){var o=b(e)?Sa:Ye;return o(e,IT(t))}r(tF,"forEach");var y=tF;function rF(e,t){for(var o=-1,n=e==null?0:e.length;++o<n;)if(!t(e[o],o,e))return!1;return!0}r(rF,"arrayEvery");var vT=rF;function oF(e,t){var o=!0;return Ye(e,function(n,i,s){return o=!!t(n,i,s),o}),o}r(oF,"baseEvery");var wT=oF;function nF(e,t,o){var n=b(e)?vT:wT;return o&&Yt(e,t,o)&&(t=void 0),n(e,he(t,3))}r(nF,"every");var Ce=nF;function aF(e,t){var o=[];return Ye(e,function(n,i,s){t(n,i,s)&&o.push(n)}),o}r(aF,"baseFilter");var Wa=aF;function iF(e,t){var o=b(e)?eo:Wa;return o(e,he(t,3))}r(iF,"filter");var ve=iF;function sF(e){return function(t,o,n){var i=Object(t);if(!Ee(t)){var s=he(o,3);t=j(t),o=r(function(l){return s(i[l],l,i)},"predicate")}var c=e(t,o,n);return c>-1?i[s?t[c]:c]:void 0}}r(sF,"createFind");var BT=sF;var cF=Math.max;function lF(e,t,o){var n=e==null?0:e.length;if(!n)return-1;var i=o==null?0:Tt(o);return i<0&&(i=cF(n+i,0)),Aa(e,he(t,3),i)}r(lF,"findIndex");var PT=lF;var uF=BT(PT),kt=uF;function pF(e){return e&&e.length?e[0]:void 0}r(pF,"head");var Se=pF;function mF(e,t){var o=-1,n=Ee(e)?Array(e.length):[];return Ye(e,function(i,s,c){n[++o]=t(i,s,c)}),n}r(mF,"baseMap");var GT=mF;function fF(e,t){var o=b(e)?dt:GT;return o(e,he(t,3))}r(fF,"map");var M=fF;function dF(e,t){return Qr(M(e,t),1)}r(dF,"flatMap");var Ge=dF;var TF=Object.prototype,EF=TF.hasOwnProperty,hF=Va(function(e,t,o){EF.call(e,o)?e[o].push(t):qr(e,o,[t])}),lm=hF;var SF=Object.prototype,AF=SF.hasOwnProperty;function UF(e,t){return e!=null&&AF.call(e,t)}r(UF,"baseHas");var DT=UF;function gF(e,t){return e!=null&&Da(e,t,DT)}r(gF,"has");var F=gF;var kF="[object String]";function RF(e){return typeof e=="string"||!b(e)&&ne(e)&&ye(e)==kF}r(RF,"isString");var Re=RF;function LF(e,t){return dt(t,function(o){return e[o]})}r(LF,"baseValues");var VT=LF;function xF(e){return e==null?[]:VT(e,j(e))}r(xF,"values");var Y=xF;var CF=Math.max;function OF(e,t,o,n){e=Ee(e)?e:Y(e),o=o&&!n?Tt(o):0;var i=e.length;return o<0&&(o=CF(i+o,0)),Re(e)?o<=i&&e.indexOf(t,o)>-1:!!i&&Vr(e,t,o)>-1}r(OF,"includes");var ee=OF;var NF=Math.max;function bF(e,t,o){var n=e==null?0:e.length;if(!n)return-1;var i=o==null?0:Tt(o);return i<0&&(i=NF(n+i,0)),Vr(e,t,i)}r(bF,"indexOf");var Ya=bF;var MF="[object Map]",yF="[object Set]",FF=Object.prototype,_F=FF.hasOwnProperty;function IF(e){if(e==null)return!0;if(Ee(e)&&(b(e)||typeof e=="string"||typeof e.splice=="function"||Mt(e)||Wr(e)||Kt(e)))return!e.length;var t=st(e);if(t==MF||t==yF)return!e.size;if(St(e))return!Ra(e).length;for(var o in e)if(_F.call(e,o))return!1;return!0}r(IF,"isEmpty");var D=IF;var vF="[object RegExp]";function wF(e){return ne(e)&&ye(e)==vF}r(wF,"baseIsRegExp");var qT=wF;var jT=ot&&ot.isRegExp,BF=jT?At(jT):qT,nt=BF;function PF(e){return e===void 0}r(PF,"isUndefined");var we=PF;var GF="Expected a function";function DF(e){if(typeof e!="function")throw new TypeError(GF);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)}}r(DF,"negate");var WT=DF;function VF(e,t,o,n){if(!ae(e))return e;t=Zt(t,e);for(var i=-1,s=t.length,c=s-1,l=e;l!=null&&++i<s;){var p=Ut(t[i]),f=o;if(p==="__proto__"||p==="constructor"||p==="prototype")return e;if(i!=c){var d=l[p];f=n?n(d,p,l):void 0,f===void 0&&(f=ae(d)?d:qt(t[i+1])?[]:{})}jt(l,p,f),l=l[p]}return e}r(VF,"baseSet");var YT=VF;function qF(e,t,o){for(var n=-1,i=t.length,s={};++n<i;){var c=t[n],l=Jr(e,c);o(l,c)&&YT(s,Zt(c,e),l)}return s}r(qF,"basePickBy");var KT=qF;function jF(e,t){if(e==null)return{};var o=dt(ba(e),function(n){return[n]});return t=he(t),KT(e,o,function(n,i){return t(n,i[0])})}r(jF,"pickBy");var Ke=jF;var WF=Va(function(e,t,o){e[o?0:1].push(t)},function(){return[[],[]]}),um=WF;function YF(e,t,o,n,i){return i(e,function(s,c,l){o=n?(n=!1,s):t(o,s,c,l)}),o}r(YF,"baseReduce");var HT=YF;function KF(e,t,o){var n=b(e)?gd:HT,i=arguments.length<3;return n(e,he(t,4),o,i,Ye)}r(KF,"reduce");var Ae=KF;function HF(e,t){var o=b(e)?eo:Wa;return o(e,WT(he(t,3)))}r(HF,"reject");var rr=HF;function zF(e,t){var o;return Ye(e,function(n,i,s){return o=t(n,i,s),!o}),!!o}r(zF,"baseSome");var zT=zF;function JF(e,t,o){var n=b(e)?Ia:zT;return o&&Yt(e,t,o)&&(t=void 0),n(e,he(t,3))}r(JF,"some");var lt=JF;var XF=1/0,QF=er&&1/io(new er([,-0]))[1]==XF?function(e){return new er(e)}:ie,JT=QF;var ZF=200;function $F(e,t,o){var n=-1,i=Ua,s=e.length,c=!0,l=[],p=l;if(o)c=!1,i=qa;else if(s>=ZF){var f=t?null:JT(e);if(f)return io(f);c=!1,i=ao,p=new no}else p=t?[]:l;e:for(;++n<s;){var d=e[n],T=t?t(d):d;if(d=o||d!==0?d:0,c&&T===T){for(var U=p.length;U--;)if(p[U]===T)continue e;t&&p.push(T),l.push(d)}else i(p,T,o)||(p!==l&&p.push(T),l.push(d))}return l}r($F,"baseUniq");var XT=$F;function e_(e){return e&&e.length?XT(e):[]}r(e_,"uniq");var or=e_;var t_=Wt(function(e,t){return gn(e)?ja(e,t):[]}),pm=t_;function co(e){console&&console.error&&console.error(`Error: ${e}`)}r(co,"PRINT_ERROR");function kn(e){console&&console.warn&&console.warn(`Warning: ${e}`)}r(kn,"PRINT_WARNING");function Rn(e){let t=new Date().getTime(),o=e();return{time:new Date().getTime()-t,value:o}}r(Rn,"timer");function Ln(e){function t(){}r(t,"FakeConstructor"),t.prototype=e;let o=new t;function n(){return typeof o.bar}return r(n,"fakeAccess"),n(),n(),e;(0,eval)(e)}r(Ln,"toFastProperties");function r_(e){return o_(e)?e.LABEL:e.name}r(r_,"tokenLabel");function o_(e){return Re(e.LABEL)&&e.LABEL!==""}r(o_,"hasTokenLabel");var $e=class{static{r(this,"AbstractProduction")}get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){this._definition=t}accept(t){t.visit(this),y(this.definition,o=>{o.accept(t)})}},z=class extends $e{static{r(this,"NonTerminal")}constructor(t){super([]),this.idx=1,Fe(this,Ke(t,o=>o!==void 0))}set definition(t){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(t){t.visit(this)}},De=class extends $e{static{r(this,"Rule")}constructor(t){super(t.definition),this.orgText="",Fe(this,Ke(t,o=>o!==void 0))}},J=class extends $e{static{r(this,"Alternative")}constructor(t){super(t.definition),this.ignoreAmbiguities=!1,Fe(this,Ke(t,o=>o!==void 0))}},Z=class extends $e{static{r(this,"Option")}constructor(t){super(t.definition),this.idx=1,Fe(this,Ke(t,o=>o!==void 0))}},fe=class extends $e{static{r(this,"RepetitionMandatory")}constructor(t){super(t.definition),this.idx=1,Fe(this,Ke(t,o=>o!==void 0))}},de=class extends $e{static{r(this,"RepetitionMandatoryWithSeparator")}constructor(t){super(t.definition),this.idx=1,Fe(this,Ke(t,o=>o!==void 0))}},W=class extends $e{static{r(this,"Repetition")}constructor(t){super(t.definition),this.idx=1,Fe(this,Ke(t,o=>o!==void 0))}},ue=class extends $e{static{r(this,"RepetitionWithSeparator")}constructor(t){super(t.definition),this.idx=1,Fe(this,Ke(t,o=>o!==void 0))}},pe=class extends $e{static{r(this,"Alternation")}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,Fe(this,Ke(t,o=>o!==void 0))}},q=class{static{r(this,"Terminal")}constructor(t){this.idx=1,Fe(this,Ke(t,o=>o!==void 0))}accept(t){t.visit(this)}};function Ka(e){return M(e,lo)}r(Ka,"serializeGrammar");function lo(e){function t(o){return M(o,lo)}if(r(t,"convertDefinition"),e instanceof z){let o={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return Re(e.label)&&(o.label=e.label),o}else{if(e instanceof J)return{type:"Alternative",definition:t(e.definition)};if(e instanceof Z)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof fe)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof de)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:lo(new q({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ue)return{type:"RepetitionWithSeparator",idx:e.idx,separator:lo(new q({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof W)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof pe)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof q){let o={type:"Terminal",name:e.terminalType.name,label:r_(e.terminalType),idx:e.idx};Re(e.label)&&(o.terminalLabel=e.label);let n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(o.pattern=nt(n)?n.source:n),o}else{if(e instanceof De)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}}}r(lo,"serializeProduction");var Ve=class{static{r(this,"GAstVisitor")}visit(t){let o=t;switch(o.constructor){case z:return this.visitNonTerminal(o);case J:return this.visitAlternative(o);case Z:return this.visitOption(o);case fe:return this.visitRepetitionMandatory(o);case de:return this.visitRepetitionMandatoryWithSeparator(o);case ue:return this.visitRepetitionWithSeparator(o);case W:return this.visitRepetition(o);case pe:return this.visitAlternation(o);case q:return this.visitTerminal(o);case De:return this.visitRule(o);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 mm(e){return e instanceof J||e instanceof Z||e instanceof W||e instanceof fe||e instanceof de||e instanceof ue||e instanceof q||e instanceof De}r(mm,"isSequenceProd");function Fr(e,t=[]){return e instanceof Z||e instanceof W||e instanceof ue?!0:e instanceof pe?lt(e.definition,n=>Fr(n,t)):e instanceof z&&ee(t,e)?!1:e instanceof $e?(e instanceof z&&t.push(e),Ce(e.definition,n=>Fr(n,t))):!1}r(Fr,"isOptionalProd");function fm(e){return e instanceof pe}r(fm,"isBranchingProd");function He(e){if(e instanceof z)return"SUBRULE";if(e instanceof Z)return"OPTION";if(e instanceof pe)return"OR";if(e instanceof fe)return"AT_LEAST_ONE";if(e instanceof de)return"AT_LEAST_ONE_SEP";if(e instanceof ue)return"MANY_SEP";if(e instanceof W)return"MANY";if(e instanceof q)return"CONSUME";throw Error("non exhaustive match")}r(He,"getProductionDslName");var _t=class{static{r(this,"RestWalker")}walk(t,o=[]){y(t.definition,(n,i)=>{let s=me(t.definition,i+1);if(n instanceof z)this.walkProdRef(n,s,o);else if(n instanceof q)this.walkTerminal(n,s,o);else if(n instanceof J)this.walkFlat(n,s,o);else if(n instanceof Z)this.walkOption(n,s,o);else if(n instanceof fe)this.walkAtLeastOne(n,s,o);else if(n instanceof de)this.walkAtLeastOneSep(n,s,o);else if(n instanceof ue)this.walkManySep(n,s,o);else if(n instanceof W)this.walkMany(n,s,o);else if(n instanceof pe)this.walkOr(n,s,o);else throw Error("non exhaustive match")})}walkTerminal(t,o,n){}walkProdRef(t,o,n){}walkFlat(t,o,n){let i=o.concat(n);this.walk(t,i)}walkOption(t,o,n){let i=o.concat(n);this.walk(t,i)}walkAtLeastOne(t,o,n){let i=[new Z({definition:t.definition})].concat(o,n);this.walk(t,i)}walkAtLeastOneSep(t,o,n){let i=QT(t,o,n);this.walk(t,i)}walkMany(t,o,n){let i=[new Z({definition:t.definition})].concat(o,n);this.walk(t,i)}walkManySep(t,o,n){let i=QT(t,o,n);this.walk(t,i)}walkOr(t,o,n){let i=o.concat(n);y(t.definition,s=>{let c=new J({definition:[s]});this.walk(c,i)})}};function QT(e,t,o){return[new Z({definition:[new q({terminalType:e.separator})].concat(e.definition)})].concat(t,o)}r(QT,"restForRepetitionWithSeparator");function _r(e){if(e instanceof z)return _r(e.referencedRule);if(e instanceof q)return i_(e);if(mm(e))return n_(e);if(fm(e))return a_(e);throw Error("non exhaustive match")}r(_r,"first");function n_(e){let t=[],o=e.definition,n=0,i=o.length>n,s,c=!0;for(;i&&c;)s=o[n],c=Fr(s),t=t.concat(_r(s)),n=n+1,i=o.length>n;return or(t)}r(n_,"firstForSequence");function a_(e){let t=M(e.definition,o=>_r(o));return or(ke(t))}r(a_,"firstForBranching");function i_(e){return[e.terminalType]}r(i_,"firstForTerminal");var Ha="_~IN~_";var dm=class extends _t{static{r(this,"ResyncFollowsWalker")}constructor(t){super(),this.topProd=t,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(t,o,n){}walkProdRef(t,o,n){let i=s_(t.referencedRule,t.idx)+this.topProd.name,s=o.concat(n),c=new J({definition:s}),l=_r(c);this.follows[i]=l}};function ZT(e){let t={};return y(e,o=>{let n=new dm(o).startWalking();Fe(t,n)}),t}r(ZT,"computeAllProdsFollows");function s_(e,t){return e.name+t+Ha}r(s_,"buildBetweenProdsFollowPrefix");function I(e){return e.charCodeAt(0)}r(I,"cc");function za(e,t){Array.isArray(e)?e.forEach(function(o){t.push(o)}):t.push(e)}r(za,"insertToSet");function uo(e,t){if(e[t]===!0)throw"duplicate flag "+t;let o=e[t];e[t]=!0}r(uo,"addFlag");function Ir(e){if(e===void 0)throw Error("Internal Error - Should never get here!");return!0}r(Ir,"ASSERT_EXISTS");function xn(){throw Error("Internal Error - Should never get here!")}r(xn,"ASSERT_NEVER_REACH_HERE");function Tm(e){return e.type==="Character"}r(Tm,"isCharacter");var Cn=[];for(let e=I("0");e<=I("9");e++)Cn.push(e);var On=[I("_")].concat(Cn);for(let e=I("a");e<=I("z");e++)On.push(e);for(let e=I("A");e<=I("Z");e++)On.push(e);var Em=[I(" "),I("\f"),I(`
|
|
2
|
-
`),I("\r"),I(" "),I("\v"),I(" "),I("\xA0"),I("\u1680"),I("\u2000"),I("\u2001"),I("\u2002"),I("\u2003"),I("\u2004"),I("\u2005"),I("\u2006"),I("\u2007"),I("\u2008"),I("\u2009"),I("\u200A"),I("\u2028"),I("\u2029"),I("\u202F"),I("\u205F"),I("\u3000"),I("\uFEFF")];var
|
|
3
|
-
`),I("\r"),I("\u2028"),I("\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,o=!1;switch(this.popChar()){case"d":t=Cn;break;case"D":t=Cn,o=!0;break;case"s":t=
|
|
1
|
+
(()=>{var dx=Object.defineProperty;var r=(e,t)=>dx(e,"name",{value:t,configurable:!0});var Tx=typeof global=="object"&&global&&global.Object===Object&&global,Ta=Tx;var Ex=typeof self=="object"&&self&&self.Object===Object&&self,hx=Ta||Ex||Function("return this")(),Ee=hx;var Sx=Ee.Symbol,Ce=Sx;var lf=Object.prototype,Ax=lf.hasOwnProperty,gx=lf.toString,Sn=Ce?Ce.toStringTag:void 0;function Ux(e){var t=Ax.call(e,Sn),o=e[Sn];try{e[Sn]=void 0;var n=!0}catch{}var i=gx.call(e);return n&&(t?e[Sn]=o:delete e[Sn]),i}r(Ux,"getRawTag");var uf=Ux;var kx=Object.prototype,Rx=kx.toString;function Lx(e){return Rx.call(e)}r(Lx,"objectToString");var pf=Lx;var xx="[object Null]",Cx="[object Undefined]",mf=Ce?Ce.toStringTag:void 0;function Ox(e){return e==null?e===void 0?Cx:xx:mf&&mf in Object(e)?uf(e):pf(e)}r(Ox,"baseGetTag");var ye=Ox;function Nx(e){return e!=null&&typeof e=="object"}r(Nx,"isObjectLike");var ne=Nx;var bx="[object Symbol]";function Mx(e){return typeof e=="symbol"||ne(e)&&ye(e)==bx}r(Mx,"isSymbol");var Vt=Mx;function yx(e,t){for(var o=-1,n=e==null?0:e.length,i=Array(n);++o<n;)i[o]=t(e[o],o,e);return i}r(yx,"arrayMap");var dt=yx;var Fx=Array.isArray,b=Fx;var _x=1/0,ff=Ce?Ce.prototype:void 0,df=ff?ff.toString:void 0;function Tf(e){if(typeof e=="string")return e;if(b(e))return dt(e,Tf)+"";if(Vt(e))return df?df.call(e):"";var t=e+"";return t=="0"&&1/e==-_x?"-0":t}r(Tf,"baseToString");var Ef=Tf;var Ix=/\s/;function vx(e){for(var t=e.length;t--&&Ix.test(e.charAt(t)););return t}r(vx,"trimmedEndIndex");var hf=vx;var wx=/^\s+/;function Bx(e){return e&&e.slice(0,hf(e)+1).replace(wx,"")}r(Bx,"baseTrim");var Sf=Bx;function Px(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}r(Px,"isObject");var ae=Px;var Af=NaN,Gx=/^[-+]0x[0-9a-f]+$/i,Dx=/^0b[01]+$/i,Vx=/^0o[0-7]+$/i,qx=parseInt;function jx(e){if(typeof e=="number")return e;if(Vt(e))return Af;if(ae(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ae(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Sf(e);var o=Dx.test(e);return o||Vx.test(e)?qx(e.slice(2),o?2:8):Gx.test(e)?Af:+e}r(jx,"toNumber");var gf=jx;var Uf=1/0,Wx=17976931348623157e292;function Yx(e){if(!e)return e===0?e:0;if(e=gf(e),e===Uf||e===-Uf){var t=e<0?-1:1;return t*Wx}return e===e?e:0}r(Yx,"toFinite");var kf=Yx;function Kx(e){var t=kf(e),o=t%1;return t===t?o?t-o:t:0}r(Kx,"toInteger");var Tt=Kx;function Hx(e){return e}r(Hx,"identity");var rt=Hx;var zx="[object AsyncFunction]",Jx="[object Function]",Xx="[object GeneratorFunction]",Qx="[object Proxy]";function Zx(e){if(!ae(e))return!1;var t=ye(e);return t==Jx||t==Xx||t==zx||t==Qx}r(Zx,"isFunction");var Pe=Zx;var $x=Ee["__core-js_shared__"],Ea=$x;var Rf=(function(){var e=/[^.]+$/.exec(Ea&&Ea.keys&&Ea.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function eC(e){return!!Rf&&Rf in e}r(eC,"isMasked");var Lf=eC;var tC=Function.prototype,rC=tC.toString;function oC(e){if(e!=null){try{return rC.call(e)}catch{}try{return e+""}catch{}}return""}r(oC,"toSource");var bt=oC;var nC=/[\\^$.*+?()[\]{}|]/g,aC=/^\[object .+?Constructor\]$/,iC=Function.prototype,sC=Object.prototype,cC=iC.toString,lC=sC.hasOwnProperty,uC=RegExp("^"+cC.call(lC).replace(nC,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function pC(e){if(!ae(e)||Lf(e))return!1;var t=Pe(e)?uC:aC;return t.test(bt(e))}r(pC,"baseIsNative");var xf=pC;function mC(e,t){return e?.[t]}r(mC,"getValue");var Cf=mC;function fC(e,t){var o=Cf(e,t);return xf(o)?o:void 0}r(fC,"getNative");var We=fC;var dC=We(Ee,"WeakMap"),ha=dC;var Of=Object.create,TC=(function(){function e(){}return r(e,"object"),function(t){if(!ae(t))return{};if(Of)return Of(t);e.prototype=t;var o=new e;return e.prototype=void 0,o}})(),Nf=TC;function EC(e,t,o){switch(o.length){case 0:return e.call(t);case 1:return e.call(t,o[0]);case 2:return e.call(t,o[0],o[1]);case 3:return e.call(t,o[0],o[1],o[2])}return e.apply(t,o)}r(EC,"apply");var bf=EC;function hC(){}r(hC,"noop");var ie=hC;function SC(e,t){var o=-1,n=e.length;for(t||(t=Array(n));++o<n;)t[o]=e[o];return t}r(SC,"copyArray");var Mf=SC;var AC=800,gC=16,UC=Date.now;function kC(e){var t=0,o=0;return function(){var n=UC(),i=gC-(n-o);if(o=n,i>0){if(++t>=AC)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}r(kC,"shortOut");var yf=kC;function RC(e){return function(){return e}}r(RC,"constant");var Ff=RC;var LC=(function(){try{var e=We(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Dr=LC;var xC=Dr?function(e,t){return Dr(e,"toString",{configurable:!0,enumerable:!1,value:Ff(t),writable:!0})}:rt,_f=xC;var CC=yf(_f),If=CC;function OC(e,t){for(var o=-1,n=e==null?0:e.length;++o<n&&t(e[o],o,e)!==!1;);return e}r(OC,"arrayEach");var Sa=OC;function NC(e,t,o,n){for(var i=e.length,s=o+(n?1:-1);n?s--:++s<i;)if(t(e[s],s,e))return s;return-1}r(NC,"baseFindIndex");var Aa=NC;function bC(e){return e!==e}r(bC,"baseIsNaN");var vf=bC;function MC(e,t,o){for(var n=o-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}r(MC,"strictIndexOf");var wf=MC;function yC(e,t,o){return t===t?wf(e,t,o):Aa(e,vf,o)}r(yC,"baseIndexOf");var Vr=yC;function FC(e,t){var o=e==null?0:e.length;return!!o&&Vr(e,t,0)>-1}r(FC,"arrayIncludes");var ga=FC;var _C=9007199254740991,IC=/^(?:0|[1-9]\d*)$/;function vC(e,t){var o=typeof e;return t=t??_C,!!t&&(o=="number"||o!="symbol"&&IC.test(e))&&e>-1&&e%1==0&&e<t}r(vC,"isIndex");var qt=vC;function wC(e,t,o){t=="__proto__"&&Dr?Dr(e,t,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[t]=o}r(wC,"baseAssignValue");var qr=wC;function BC(e,t){return e===t||e!==e&&t!==t}r(BC,"eq");var Et=BC;var PC=Object.prototype,GC=PC.hasOwnProperty;function DC(e,t,o){var n=e[t];(!(GC.call(e,t)&&Et(n,o))||o===void 0&&!(t in e))&&qr(e,t,o)}r(DC,"assignValue");var jt=DC;function VC(e,t,o,n){var i=!o;o||(o={});for(var s=-1,c=t.length;++s<c;){var l=t[s],p=n?n(o[l],e[l],l,o,e):void 0;p===void 0&&(p=e[l]),i?qr(o,l,p):jt(o,l,p)}return o}r(VC,"copyObject");var ht=VC;var Bf=Math.max;function qC(e,t,o){return t=Bf(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=Bf(n.length-t,0),c=Array(s);++i<s;)c[i]=n[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=n[i];return l[t]=o(c),bf(e,this,l)}}r(qC,"overRest");var Pf=qC;function jC(e,t){return If(Pf(e,t,rt),e+"")}r(jC,"baseRest");var Wt=jC;var WC=9007199254740991;function YC(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=WC}r(YC,"isLength");var jr=YC;function KC(e){return e!=null&&jr(e.length)&&!Pe(e)}r(KC,"isArrayLike");var he=KC;function HC(e,t,o){if(!ae(o))return!1;var n=typeof t;return(n=="number"?he(o)&&qt(t,o.length):n=="string"&&t in o)?Et(o[t],e):!1}r(HC,"isIterateeCall");var Yt=HC;function zC(e){return Wt(function(t,o){var n=-1,i=o.length,s=i>1?o[i-1]:void 0,c=i>2?o[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,c&&Yt(o[0],o[1],c)&&(s=i<3?void 0:s,i=1),t=Object(t);++n<i;){var l=o[n];l&&e(t,l,n,s)}return t})}r(zC,"createAssigner");var Gf=zC;var JC=Object.prototype;function XC(e){var t=e&&e.constructor,o=typeof t=="function"&&t.prototype||JC;return e===o}r(XC,"isPrototype");var St=XC;function QC(e,t){for(var o=-1,n=Array(e);++o<e;)n[o]=t(o);return n}r(QC,"baseTimes");var Df=QC;var ZC="[object Arguments]";function $C(e){return ne(e)&&ye(e)==ZC}r($C,"baseIsArguments");var am=$C;var Vf=Object.prototype,eO=Vf.hasOwnProperty,tO=Vf.propertyIsEnumerable,rO=am((function(){return arguments})())?am:function(e){return ne(e)&&eO.call(e,"callee")&&!tO.call(e,"callee")},Kt=rO;function oO(){return!1}r(oO,"stubFalse");var qf=oO;var Yf=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jf=Yf&&typeof module=="object"&&module&&!module.nodeType&&module,nO=jf&&jf.exports===Yf,Wf=nO?Ee.Buffer:void 0,aO=Wf?Wf.isBuffer:void 0,iO=aO||qf,Mt=iO;var sO="[object Arguments]",cO="[object Array]",lO="[object Boolean]",uO="[object Date]",pO="[object Error]",mO="[object Function]",fO="[object Map]",dO="[object Number]",TO="[object Object]",EO="[object RegExp]",hO="[object Set]",SO="[object String]",AO="[object WeakMap]",gO="[object ArrayBuffer]",UO="[object DataView]",kO="[object Float32Array]",RO="[object Float64Array]",LO="[object Int8Array]",xO="[object Int16Array]",CO="[object Int32Array]",OO="[object Uint8Array]",NO="[object Uint8ClampedArray]",bO="[object Uint16Array]",MO="[object Uint32Array]",Q={};Q[kO]=Q[RO]=Q[LO]=Q[xO]=Q[CO]=Q[OO]=Q[NO]=Q[bO]=Q[MO]=!0;Q[sO]=Q[cO]=Q[gO]=Q[lO]=Q[UO]=Q[uO]=Q[pO]=Q[mO]=Q[fO]=Q[dO]=Q[TO]=Q[EO]=Q[hO]=Q[SO]=Q[AO]=!1;function yO(e){return ne(e)&&jr(e.length)&&!!Q[ye(e)]}r(yO,"baseIsTypedArray");var Kf=yO;function FO(e){return function(t){return e(t)}}r(FO,"baseUnary");var At=FO;var Hf=typeof exports=="object"&&exports&&!exports.nodeType&&exports,An=Hf&&typeof module=="object"&&module&&!module.nodeType&&module,_O=An&&An.exports===Hf,im=_O&&Ta.process,IO=(function(){try{var e=An&&An.require&&An.require("util").types;return e||im&&im.binding&&im.binding("util")}catch{}})(),ot=IO;var zf=ot&&ot.isTypedArray,vO=zf?At(zf):Kf,Wr=vO;var wO=Object.prototype,BO=wO.hasOwnProperty;function PO(e,t){var o=b(e),n=!o&&Kt(e),i=!o&&!n&&Mt(e),s=!o&&!n&&!i&&Wr(e),c=o||n||i||s,l=c?Df(e.length,String):[],p=l.length;for(var f in e)(t||BO.call(e,f))&&!(c&&(f=="length"||i&&(f=="offset"||f=="parent")||s&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||qt(f,p)))&&l.push(f);return l}r(PO,"arrayLikeKeys");var Ua=PO;function GO(e,t){return function(o){return e(t(o))}}r(GO,"overArg");var ka=GO;var DO=ka(Object.keys,Object),Jf=DO;var VO=Object.prototype,qO=VO.hasOwnProperty;function jO(e){if(!St(e))return Jf(e);var t=[];for(var o in Object(e))qO.call(e,o)&&o!="constructor"&&t.push(o);return t}r(jO,"baseKeys");var Ra=jO;function WO(e){return he(e)?Ua(e):Ra(e)}r(WO,"keys");var j=WO;var YO=Object.prototype,KO=YO.hasOwnProperty,HO=Gf(function(e,t){if(St(t)||he(t)){ht(t,j(t),e);return}for(var o in t)KO.call(t,o)&&jt(e,o,t[o])}),Fe=HO;function zO(e){var t=[];if(e!=null)for(var o in Object(e))t.push(o);return t}r(zO,"nativeKeysIn");var Xf=zO;var JO=Object.prototype,XO=JO.hasOwnProperty;function QO(e){if(!ae(e))return Xf(e);var t=St(e),o=[];for(var n in e)n=="constructor"&&(t||!XO.call(e,n))||o.push(n);return o}r(QO,"baseKeysIn");var Qf=QO;function ZO(e){return he(e)?Ua(e,!0):Qf(e)}r(ZO,"keysIn");var Ht=ZO;var $O=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,eN=/^\w*$/;function tN(e,t){if(b(e))return!1;var o=typeof e;return o=="number"||o=="symbol"||o=="boolean"||e==null||Vt(e)?!0:eN.test(e)||!$O.test(e)||t!=null&&e in Object(t)}r(tN,"isKey");var Yr=tN;var rN=We(Object,"create"),yt=rN;function oN(){this.__data__=yt?yt(null):{},this.size=0}r(oN,"hashClear");var Zf=oN;function nN(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}r(nN,"hashDelete");var $f=nN;var aN="__lodash_hash_undefined__",iN=Object.prototype,sN=iN.hasOwnProperty;function cN(e){var t=this.__data__;if(yt){var o=t[e];return o===aN?void 0:o}return sN.call(t,e)?t[e]:void 0}r(cN,"hashGet");var ed=cN;var lN=Object.prototype,uN=lN.hasOwnProperty;function pN(e){var t=this.__data__;return yt?t[e]!==void 0:uN.call(t,e)}r(pN,"hashHas");var td=pN;var mN="__lodash_hash_undefined__";function fN(e,t){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=yt&&t===void 0?mN:t,this}r(fN,"hashSet");var rd=fN;function Kr(e){var t=-1,o=e==null?0:e.length;for(this.clear();++t<o;){var n=e[t];this.set(n[0],n[1])}}r(Kr,"Hash");Kr.prototype.clear=Zf;Kr.prototype.delete=$f;Kr.prototype.get=ed;Kr.prototype.has=td;Kr.prototype.set=rd;var sm=Kr;function dN(){this.__data__=[],this.size=0}r(dN,"listCacheClear");var od=dN;function TN(e,t){for(var o=e.length;o--;)if(Et(e[o][0],t))return o;return-1}r(TN,"assocIndexOf");var zt=TN;var EN=Array.prototype,hN=EN.splice;function SN(e){var t=this.__data__,o=zt(t,e);if(o<0)return!1;var n=t.length-1;return o==n?t.pop():hN.call(t,o,1),--this.size,!0}r(SN,"listCacheDelete");var nd=SN;function AN(e){var t=this.__data__,o=zt(t,e);return o<0?void 0:t[o][1]}r(AN,"listCacheGet");var ad=AN;function gN(e){return zt(this.__data__,e)>-1}r(gN,"listCacheHas");var id=gN;function UN(e,t){var o=this.__data__,n=zt(o,e);return n<0?(++this.size,o.push([e,t])):o[n][1]=t,this}r(UN,"listCacheSet");var sd=UN;function Hr(e){var t=-1,o=e==null?0:e.length;for(this.clear();++t<o;){var n=e[t];this.set(n[0],n[1])}}r(Hr,"ListCache");Hr.prototype.clear=od;Hr.prototype.delete=nd;Hr.prototype.get=ad;Hr.prototype.has=id;Hr.prototype.set=sd;var Jt=Hr;var kN=We(Ee,"Map"),Xt=kN;function RN(){this.size=0,this.__data__={hash:new sm,map:new(Xt||Jt),string:new sm}}r(RN,"mapCacheClear");var cd=RN;function LN(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}r(LN,"isKeyable");var ld=LN;function xN(e,t){var o=e.__data__;return ld(t)?o[typeof t=="string"?"string":"hash"]:o.map}r(xN,"getMapData");var Qt=xN;function CN(e){var t=Qt(this,e).delete(e);return this.size-=t?1:0,t}r(CN,"mapCacheDelete");var ud=CN;function ON(e){return Qt(this,e).get(e)}r(ON,"mapCacheGet");var pd=ON;function NN(e){return Qt(this,e).has(e)}r(NN,"mapCacheHas");var md=NN;function bN(e,t){var o=Qt(this,e),n=o.size;return o.set(e,t),this.size+=o.size==n?0:1,this}r(bN,"mapCacheSet");var fd=bN;function zr(e){var t=-1,o=e==null?0:e.length;for(this.clear();++t<o;){var n=e[t];this.set(n[0],n[1])}}r(zr,"MapCache");zr.prototype.clear=cd;zr.prototype.delete=ud;zr.prototype.get=pd;zr.prototype.has=md;zr.prototype.set=fd;var br=zr;var MN="Expected a function";function cm(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(MN);var o=r(function(){var n=arguments,i=t?t.apply(this,n):n[0],s=o.cache;if(s.has(i))return s.get(i);var c=e.apply(this,n);return o.cache=s.set(i,c)||s,c},"memoized");return o.cache=new(cm.Cache||br),o}r(cm,"memoize");cm.Cache=br;var dd=cm;var yN=500;function FN(e){var t=dd(e,function(n){return o.size===yN&&o.clear(),n}),o=t.cache;return t}r(FN,"memoizeCapped");var Td=FN;var _N=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,IN=/\\(\\)?/g,vN=Td(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(_N,function(o,n,i,s){t.push(i?s.replace(IN,"$1"):n||o)}),t}),Ed=vN;function wN(e){return e==null?"":Ef(e)}r(wN,"toString");var hd=wN;function BN(e,t){return b(e)?e:Yr(e,t)?[e]:Ed(hd(e))}r(BN,"castPath");var Zt=BN;var PN=1/0;function GN(e){if(typeof e=="string"||Vt(e))return e;var t=e+"";return t=="0"&&1/e==-PN?"-0":t}r(GN,"toKey");var gt=GN;function DN(e,t){t=Zt(t,e);for(var o=0,n=t.length;e!=null&&o<n;)e=e[gt(t[o++])];return o&&o==n?e:void 0}r(DN,"baseGet");var Jr=DN;function VN(e,t,o){var n=e==null?void 0:Jr(e,t);return n===void 0?o:n}r(VN,"get");var Mr=VN;function qN(e,t){for(var o=-1,n=t.length,i=e.length;++o<n;)e[i+o]=t[o];return e}r(qN,"arrayPush");var Xr=qN;var Sd=Ce?Ce.isConcatSpreadable:void 0;function jN(e){return b(e)||Kt(e)||!!(Sd&&e&&e[Sd])}r(jN,"isFlattenable");var Ad=jN;function gd(e,t,o,n,i){var s=-1,c=e.length;for(o||(o=Ad),i||(i=[]);++s<c;){var l=e[s];t>0&&o(l)?t>1?gd(l,t-1,o,n,i):Xr(i,l):n||(i[i.length]=l)}return i}r(gd,"baseFlatten");var Qr=gd;function WN(e){var t=e==null?0:e.length;return t?Qr(e,1):[]}r(WN,"flatten");var Re=WN;var YN=ka(Object.getPrototypeOf,Object),Zr=YN;var KN="[object Object]",HN=Function.prototype,zN=Object.prototype,Ud=HN.toString,JN=zN.hasOwnProperty,XN=Ud.call(Object);function QN(e){if(!ne(e)||ye(e)!=KN)return!1;var t=Zr(e);if(t===null)return!0;var o=JN.call(t,"constructor")&&t.constructor;return typeof o=="function"&&o instanceof o&&Ud.call(o)==XN}r(QN,"isPlainObject");var La=QN;function ZN(e,t,o){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),o=o>i?i:o,o<0&&(o+=i),i=t>o?0:o-t>>>0,t>>>=0;for(var s=Array(i);++n<i;)s[n]=e[n+t];return s}r(ZN,"baseSlice");var xa=ZN;function $N(e,t,o,n){var i=-1,s=e==null?0:e.length;for(n&&s&&(o=e[++i]);++i<s;)o=t(o,e[i],i,e);return o}r($N,"arrayReduce");var kd=$N;function eb(){this.__data__=new Jt,this.size=0}r(eb,"stackClear");var Rd=eb;function tb(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o}r(tb,"stackDelete");var Ld=tb;function rb(e){return this.__data__.get(e)}r(rb,"stackGet");var xd=rb;function ob(e){return this.__data__.has(e)}r(ob,"stackHas");var Cd=ob;var nb=200;function ab(e,t){var o=this.__data__;if(o instanceof Jt){var n=o.__data__;if(!Xt||n.length<nb-1)return n.push([e,t]),this.size=++o.size,this;o=this.__data__=new br(n)}return o.set(e,t),this.size=o.size,this}r(ab,"stackSet");var Od=ab;function $r(e){var t=this.__data__=new Jt(e);this.size=t.size}r($r,"Stack");$r.prototype.clear=Rd;$r.prototype.delete=Ld;$r.prototype.get=xd;$r.prototype.has=Cd;$r.prototype.set=Od;var $t=$r;function ib(e,t){return e&&ht(t,j(t),e)}r(ib,"baseAssign");var Nd=ib;function sb(e,t){return e&&ht(t,Ht(t),e)}r(sb,"baseAssignIn");var bd=sb;var _d=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Md=_d&&typeof module=="object"&&module&&!module.nodeType&&module,cb=Md&&Md.exports===_d,yd=cb?Ee.Buffer:void 0,Fd=yd?yd.allocUnsafe:void 0;function lb(e,t){if(t)return e.slice();var o=e.length,n=Fd?Fd(o):new e.constructor(o);return e.copy(n),n}r(lb,"cloneBuffer");var Id=lb;function ub(e,t){for(var o=-1,n=e==null?0:e.length,i=0,s=[];++o<n;){var c=e[o];t(c,o,e)&&(s[i++]=c)}return s}r(ub,"arrayFilter");var eo=ub;function pb(){return[]}r(pb,"stubArray");var Ca=pb;var mb=Object.prototype,fb=mb.propertyIsEnumerable,vd=Object.getOwnPropertySymbols,db=vd?function(e){return e==null?[]:(e=Object(e),eo(vd(e),function(t){return fb.call(e,t)}))}:Ca,to=db;function Tb(e,t){return ht(e,to(e),t)}r(Tb,"copySymbols");var wd=Tb;var Eb=Object.getOwnPropertySymbols,hb=Eb?function(e){for(var t=[];e;)Xr(t,to(e)),e=Zr(e);return t}:Ca,Oa=hb;function Sb(e,t){return ht(e,Oa(e),t)}r(Sb,"copySymbolsIn");var Bd=Sb;function Ab(e,t,o){var n=t(e);return b(e)?n:Xr(n,o(e))}r(Ab,"baseGetAllKeys");var Na=Ab;function gb(e){return Na(e,j,to)}r(gb,"getAllKeys");var gn=gb;function Ub(e){return Na(e,Ht,Oa)}r(Ub,"getAllKeysIn");var ba=Ub;var kb=We(Ee,"DataView"),Ma=kb;var Rb=We(Ee,"Promise"),ya=Rb;var Lb=We(Ee,"Set"),er=Lb;var Pd="[object Map]",xb="[object Object]",Gd="[object Promise]",Dd="[object Set]",Vd="[object WeakMap]",qd="[object DataView]",Cb=bt(Ma),Ob=bt(Xt),Nb=bt(ya),bb=bt(er),Mb=bt(ha),yr=ye;(Ma&&yr(new Ma(new ArrayBuffer(1)))!=qd||Xt&&yr(new Xt)!=Pd||ya&&yr(ya.resolve())!=Gd||er&&yr(new er)!=Dd||ha&&yr(new ha)!=Vd)&&(yr=r(function(e){var t=ye(e),o=t==xb?e.constructor:void 0,n=o?bt(o):"";if(n)switch(n){case Cb:return qd;case Ob:return Pd;case Nb:return Gd;case bb:return Dd;case Mb:return Vd}return t},"getTag"));var st=yr;var yb=Object.prototype,Fb=yb.hasOwnProperty;function _b(e){var t=e.length,o=new e.constructor(t);return t&&typeof e[0]=="string"&&Fb.call(e,"index")&&(o.index=e.index,o.input=e.input),o}r(_b,"initCloneArray");var jd=_b;var Ib=Ee.Uint8Array,ro=Ib;function vb(e){var t=new e.constructor(e.byteLength);return new ro(t).set(new ro(e)),t}r(vb,"cloneArrayBuffer");var oo=vb;function wb(e,t){var o=t?oo(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.byteLength)}r(wb,"cloneDataView");var Wd=wb;var Bb=/\w*$/;function Pb(e){var t=new e.constructor(e.source,Bb.exec(e));return t.lastIndex=e.lastIndex,t}r(Pb,"cloneRegExp");var Yd=Pb;var Kd=Ce?Ce.prototype:void 0,Hd=Kd?Kd.valueOf:void 0;function Gb(e){return Hd?Object(Hd.call(e)):{}}r(Gb,"cloneSymbol");var zd=Gb;function Db(e,t){var o=t?oo(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}r(Db,"cloneTypedArray");var Jd=Db;var Vb="[object Boolean]",qb="[object Date]",jb="[object Map]",Wb="[object Number]",Yb="[object RegExp]",Kb="[object Set]",Hb="[object String]",zb="[object Symbol]",Jb="[object ArrayBuffer]",Xb="[object DataView]",Qb="[object Float32Array]",Zb="[object Float64Array]",$b="[object Int8Array]",eM="[object Int16Array]",tM="[object Int32Array]",rM="[object Uint8Array]",oM="[object Uint8ClampedArray]",nM="[object Uint16Array]",aM="[object Uint32Array]";function iM(e,t,o){var n=e.constructor;switch(t){case Jb:return oo(e);case Vb:case qb:return new n(+e);case Xb:return Wd(e,o);case Qb:case Zb:case $b:case eM:case tM:case rM:case oM:case nM:case aM:return Jd(e,o);case jb:return new n;case Wb:case Hb:return new n(e);case Yb:return Yd(e);case Kb:return new n;case zb:return zd(e)}}r(iM,"initCloneByTag");var Xd=iM;function sM(e){return typeof e.constructor=="function"&&!St(e)?Nf(Zr(e)):{}}r(sM,"initCloneObject");var Qd=sM;var cM="[object Map]";function lM(e){return ne(e)&&st(e)==cM}r(lM,"baseIsMap");var Zd=lM;var $d=ot&&ot.isMap,uM=$d?At($d):Zd,eT=uM;var pM="[object Set]";function mM(e){return ne(e)&&st(e)==pM}r(mM,"baseIsSet");var tT=mM;var rT=ot&&ot.isSet,fM=rT?At(rT):tT,oT=fM;var dM=1,TM=2,EM=4,nT="[object Arguments]",hM="[object Array]",SM="[object Boolean]",AM="[object Date]",gM="[object Error]",aT="[object Function]",UM="[object GeneratorFunction]",kM="[object Map]",RM="[object Number]",iT="[object Object]",LM="[object RegExp]",xM="[object Set]",CM="[object String]",OM="[object Symbol]",NM="[object WeakMap]",bM="[object ArrayBuffer]",MM="[object DataView]",yM="[object Float32Array]",FM="[object Float64Array]",_M="[object Int8Array]",IM="[object Int16Array]",vM="[object Int32Array]",wM="[object Uint8Array]",BM="[object Uint8ClampedArray]",PM="[object Uint16Array]",GM="[object Uint32Array]",K={};K[nT]=K[hM]=K[bM]=K[MM]=K[SM]=K[AM]=K[yM]=K[FM]=K[_M]=K[IM]=K[vM]=K[kM]=K[RM]=K[iT]=K[LM]=K[xM]=K[CM]=K[OM]=K[wM]=K[BM]=K[PM]=K[GM]=!0;K[gM]=K[aT]=K[NM]=!1;function Fa(e,t,o,n,i,s){var c,l=t&dM,p=t&TM,f=t&EM;if(o&&(c=i?o(e,n,i,s):o(e)),c!==void 0)return c;if(!ae(e))return e;var d=b(e);if(d){if(c=jd(e),!l)return Mf(e,c)}else{var T=st(e),g=T==aT||T==UM;if(Mt(e))return Id(e,l);if(T==iT||T==nT||g&&!i){if(c=p||g?{}:Qd(e),!l)return p?Bd(e,bd(c,e)):wd(e,Nd(c,e))}else{if(!K[T])return i?e:{};c=Xd(e,T,l)}}s||(s=new $t);var k=s.get(e);if(k)return k;s.set(e,c),oT(e)?e.forEach(function(_){c.add(Fa(_,t,o,_,e,s))}):eT(e)&&e.forEach(function(_,N){c.set(N,Fa(_,t,o,N,e,s))});var C=f?p?ba:gn:p?Ht:j,L=d?void 0:C(e);return Sa(L||e,function(_,N){L&&(N=_,_=e[N]),jt(c,N,Fa(_,t,o,N,e,s))}),c}r(Fa,"baseClone");var sT=Fa;var DM=4;function VM(e){return sT(e,DM)}r(VM,"clone");var H=VM;function qM(e){for(var t=-1,o=e==null?0:e.length,n=0,i=[];++t<o;){var s=e[t];s&&(i[n++]=s)}return i}r(qM,"compact");var Ut=qM;var jM="__lodash_hash_undefined__";function WM(e){return this.__data__.set(e,jM),this}r(WM,"setCacheAdd");var cT=WM;function YM(e){return this.__data__.has(e)}r(YM,"setCacheHas");var lT=YM;function _a(e){var t=-1,o=e==null?0:e.length;for(this.__data__=new br;++t<o;)this.add(e[t])}r(_a,"SetCache");_a.prototype.add=_a.prototype.push=cT;_a.prototype.has=lT;var no=_a;function KM(e,t){for(var o=-1,n=e==null?0:e.length;++o<n;)if(t(e[o],o,e))return!0;return!1}r(KM,"arraySome");var Ia=KM;function HM(e,t){return e.has(t)}r(HM,"cacheHas");var ao=HM;var zM=1,JM=2;function XM(e,t,o,n,i,s){var c=o&zM,l=e.length,p=t.length;if(l!=p&&!(c&&p>l))return!1;var f=s.get(e),d=s.get(t);if(f&&d)return f==t&&d==e;var T=-1,g=!0,k=o&JM?new no:void 0;for(s.set(e,t),s.set(t,e);++T<l;){var C=e[T],L=t[T];if(n)var _=c?n(L,C,T,t,e,s):n(C,L,T,e,t,s);if(_!==void 0){if(_)continue;g=!1;break}if(k){if(!Ia(t,function(N,O){if(!ao(k,O)&&(C===N||i(C,N,o,n,s)))return k.push(O)})){g=!1;break}}else if(!(C===L||i(C,L,o,n,s))){g=!1;break}}return s.delete(e),s.delete(t),g}r(XM,"equalArrays");var va=XM;function QM(e){var t=-1,o=Array(e.size);return e.forEach(function(n,i){o[++t]=[i,n]}),o}r(QM,"mapToArray");var uT=QM;function ZM(e){var t=-1,o=Array(e.size);return e.forEach(function(n){o[++t]=n}),o}r(ZM,"setToArray");var io=ZM;var $M=1,ey=2,ty="[object Boolean]",ry="[object Date]",oy="[object Error]",ny="[object Map]",ay="[object Number]",iy="[object RegExp]",sy="[object Set]",cy="[object String]",ly="[object Symbol]",uy="[object ArrayBuffer]",py="[object DataView]",pT=Ce?Ce.prototype:void 0,lm=pT?pT.valueOf:void 0;function my(e,t,o,n,i,s,c){switch(o){case py:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case uy:return!(e.byteLength!=t.byteLength||!s(new ro(e),new ro(t)));case ty:case ry:case ay:return Et(+e,+t);case oy:return e.name==t.name&&e.message==t.message;case iy:case cy:return e==t+"";case ny:var l=uT;case sy:var p=n&$M;if(l||(l=io),e.size!=t.size&&!p)return!1;var f=c.get(e);if(f)return f==t;n|=ey,c.set(e,t);var d=va(l(e),l(t),n,i,s,c);return c.delete(e),d;case ly:if(lm)return lm.call(e)==lm.call(t)}return!1}r(my,"equalByTag");var mT=my;var fy=1,dy=Object.prototype,Ty=dy.hasOwnProperty;function Ey(e,t,o,n,i,s){var c=o&fy,l=gn(e),p=l.length,f=gn(t),d=f.length;if(p!=d&&!c)return!1;for(var T=p;T--;){var g=l[T];if(!(c?g in t:Ty.call(t,g)))return!1}var k=s.get(e),C=s.get(t);if(k&&C)return k==t&&C==e;var L=!0;s.set(e,t),s.set(t,e);for(var _=c;++T<p;){g=l[T];var N=e[g],O=t[g];if(n)var x=c?n(O,N,g,t,e,s):n(N,O,g,e,t,s);if(!(x===void 0?N===O||i(N,O,o,n,s):x)){L=!1;break}_||(_=g=="constructor")}if(L&&!_){var v=e.constructor,w=t.constructor;v!=w&&"constructor"in e&&"constructor"in t&&!(typeof v=="function"&&v instanceof v&&typeof w=="function"&&w instanceof w)&&(L=!1)}return s.delete(e),s.delete(t),L}r(Ey,"equalObjects");var fT=Ey;var hy=1,dT="[object Arguments]",TT="[object Array]",wa="[object Object]",Sy=Object.prototype,ET=Sy.hasOwnProperty;function Ay(e,t,o,n,i,s){var c=b(e),l=b(t),p=c?TT:st(e),f=l?TT:st(t);p=p==dT?wa:p,f=f==dT?wa:f;var d=p==wa,T=f==wa,g=p==f;if(g&&Mt(e)){if(!Mt(t))return!1;c=!0,d=!1}if(g&&!d)return s||(s=new $t),c||Wr(e)?va(e,t,o,n,i,s):mT(e,t,p,o,n,i,s);if(!(o&hy)){var k=d&&ET.call(e,"__wrapped__"),C=T&&ET.call(t,"__wrapped__");if(k||C){var L=k?e.value():e,_=C?t.value():t;return s||(s=new $t),i(L,_,o,n,s)}}return g?(s||(s=new $t),fT(e,t,o,n,i,s)):!1}r(Ay,"baseIsEqualDeep");var hT=Ay;function ST(e,t,o,n,i){return e===t?!0:e==null||t==null||!ne(e)&&!ne(t)?e!==e&&t!==t:hT(e,t,o,n,ST,i)}r(ST,"baseIsEqual");var Ba=ST;var gy=1,Uy=2;function ky(e,t,o,n){var i=o.length,s=i,c=!n;if(e==null)return!s;for(e=Object(e);i--;){var l=o[i];if(c&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<s;){l=o[i];var p=l[0],f=e[p],d=l[1];if(c&&l[2]){if(f===void 0&&!(p in e))return!1}else{var T=new $t;if(n)var g=n(f,d,p,e,t,T);if(!(g===void 0?Ba(d,f,gy|Uy,n,T):g))return!1}}return!0}r(ky,"baseIsMatch");var AT=ky;function Ry(e){return e===e&&!ae(e)}r(Ry,"isStrictComparable");var Pa=Ry;function Ly(e){for(var t=j(e),o=t.length;o--;){var n=t[o],i=e[n];t[o]=[n,i,Pa(i)]}return t}r(Ly,"getMatchData");var gT=Ly;function xy(e,t){return function(o){return o==null?!1:o[e]===t&&(t!==void 0||e in Object(o))}}r(xy,"matchesStrictComparable");var Ga=xy;function Cy(e){var t=gT(e);return t.length==1&&t[0][2]?Ga(t[0][0],t[0][1]):function(o){return o===e||AT(o,e,t)}}r(Cy,"baseMatches");var UT=Cy;function Oy(e,t){return e!=null&&t in Object(e)}r(Oy,"baseHasIn");var kT=Oy;function Ny(e,t,o){t=Zt(t,e);for(var n=-1,i=t.length,s=!1;++n<i;){var c=gt(t[n]);if(!(s=e!=null&&o(e,c)))break;e=e[c]}return s||++n!=i?s:(i=e==null?0:e.length,!!i&&jr(i)&&qt(c,i)&&(b(e)||Kt(e)))}r(Ny,"hasPath");var Da=Ny;function by(e,t){return e!=null&&Da(e,t,kT)}r(by,"hasIn");var RT=by;var My=1,yy=2;function Fy(e,t){return Yr(e)&&Pa(t)?Ga(gt(e),t):function(o){var n=Mr(o,e);return n===void 0&&n===t?RT(o,e):Ba(t,n,My|yy)}}r(Fy,"baseMatchesProperty");var LT=Fy;function _y(e){return function(t){return t?.[e]}}r(_y,"baseProperty");var xT=_y;function Iy(e){return function(t){return Jr(t,e)}}r(Iy,"basePropertyDeep");var CT=Iy;function vy(e){return Yr(e)?xT(gt(e)):CT(e)}r(vy,"property");var OT=vy;function wy(e){return typeof e=="function"?e:e==null?rt:typeof e=="object"?b(e)?LT(e[0],e[1]):UT(e):OT(e)}r(wy,"baseIteratee");var Se=wy;function By(e,t,o,n){for(var i=-1,s=e==null?0:e.length;++i<s;){var c=e[i];t(n,c,o(c),e)}return n}r(By,"arrayAggregator");var NT=By;function Py(e){return function(t,o,n){for(var i=-1,s=Object(t),c=n(t),l=c.length;l--;){var p=c[e?l:++i];if(o(s[p],p,s)===!1)break}return t}}r(Py,"createBaseFor");var bT=Py;var Gy=bT(),MT=Gy;function Dy(e,t){return e&&MT(e,t,j)}r(Dy,"baseForOwn");var yT=Dy;function Vy(e,t){return function(o,n){if(o==null)return o;if(!he(o))return e(o,n);for(var i=o.length,s=t?i:-1,c=Object(o);(t?s--:++s<i)&&n(c[s],s,c)!==!1;);return o}}r(Vy,"createBaseEach");var FT=Vy;var qy=FT(yT),Ye=qy;function jy(e,t,o,n){return Ye(e,function(i,s,c){t(n,i,o(i),c)}),n}r(jy,"baseAggregator");var _T=jy;function Wy(e,t){return function(o,n){var i=b(o)?NT:_T,s=t?t():{};return i(o,e,Se(n,2),s)}}r(Wy,"createAggregator");var Va=Wy;var IT=Object.prototype,Yy=IT.hasOwnProperty,Ky=Wt(function(e,t){e=Object(e);var o=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&Yt(t[0],t[1],i)&&(n=1);++o<n;)for(var s=t[o],c=Ht(s),l=-1,p=c.length;++l<p;){var f=c[l],d=e[f];(d===void 0||Et(d,IT[f])&&!Yy.call(e,f))&&(e[f]=s[f])}return e}),so=Ky;function Hy(e){return ne(e)&&he(e)}r(Hy,"isArrayLikeObject");var Un=Hy;function zy(e,t,o){for(var n=-1,i=e==null?0:e.length;++n<i;)if(o(t,e[n]))return!0;return!1}r(zy,"arrayIncludesWith");var qa=zy;var Jy=200;function Xy(e,t,o,n){var i=-1,s=ga,c=!0,l=e.length,p=[],f=t.length;if(!l)return p;o&&(t=dt(t,At(o))),n?(s=qa,c=!1):t.length>=Jy&&(s=ao,c=!1,t=new no(t));e:for(;++i<l;){var d=e[i],T=o==null?d:o(d);if(d=n||d!==0?d:0,c&&T===T){for(var g=f;g--;)if(t[g]===T)continue e;p.push(d)}else s(t,T,n)||p.push(d)}return p}r(Xy,"baseDifference");var ja=Xy;var Qy=Wt(function(e,t){return Un(e)?ja(e,Qr(t,1,Un,!0)):[]}),tr=Qy;function Zy(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}r(Zy,"last");var ct=Zy;function $y(e,t,o){var n=e==null?0:e.length;return n?(t=o||t===void 0?1:Tt(t),xa(e,t<0?0:t,n)):[]}r($y,"drop");var fe=$y;function eF(e,t,o){var n=e==null?0:e.length;return n?(t=o||t===void 0?1:Tt(t),t=n-t,xa(e,0,t<0?0:t)):[]}r(eF,"dropRight");var Ft=eF;function tF(e){return typeof e=="function"?e:rt}r(tF,"castFunction");var vT=tF;function rF(e,t){var o=b(e)?Sa:Ye;return o(e,vT(t))}r(rF,"forEach");var y=rF;function oF(e,t){for(var o=-1,n=e==null?0:e.length;++o<n;)if(!t(e[o],o,e))return!1;return!0}r(oF,"arrayEvery");var wT=oF;function nF(e,t){var o=!0;return Ye(e,function(n,i,s){return o=!!t(n,i,s),o}),o}r(nF,"baseEvery");var BT=nF;function aF(e,t,o){var n=b(e)?wT:BT;return o&&Yt(e,t,o)&&(t=void 0),n(e,Se(t,3))}r(aF,"every");var Oe=aF;function iF(e,t){var o=[];return Ye(e,function(n,i,s){t(n,i,s)&&o.push(n)}),o}r(iF,"baseFilter");var Wa=iF;function sF(e,t){var o=b(e)?eo:Wa;return o(e,Se(t,3))}r(sF,"filter");var ve=sF;function cF(e){return function(t,o,n){var i=Object(t);if(!he(t)){var s=Se(o,3);t=j(t),o=r(function(l){return s(i[l],l,i)},"predicate")}var c=e(t,o,n);return c>-1?i[s?t[c]:c]:void 0}}r(cF,"createFind");var PT=cF;var lF=Math.max;function uF(e,t,o){var n=e==null?0:e.length;if(!n)return-1;var i=o==null?0:Tt(o);return i<0&&(i=lF(n+i,0)),Aa(e,Se(t,3),i)}r(uF,"findIndex");var GT=uF;var pF=PT(GT),kt=pF;function mF(e){return e&&e.length?e[0]:void 0}r(mF,"head");var Ae=mF;function fF(e,t){var o=-1,n=he(e)?Array(e.length):[];return Ye(e,function(i,s,c){n[++o]=t(i,s,c)}),n}r(fF,"baseMap");var DT=fF;function dF(e,t){var o=b(e)?dt:DT;return o(e,Se(t,3))}r(dF,"map");var M=dF;function TF(e,t){return Qr(M(e,t),1)}r(TF,"flatMap");var Ge=TF;var EF=Object.prototype,hF=EF.hasOwnProperty,SF=Va(function(e,t,o){hF.call(e,o)?e[o].push(t):qr(e,o,[t])}),um=SF;var AF=Object.prototype,gF=AF.hasOwnProperty;function UF(e,t){return e!=null&&gF.call(e,t)}r(UF,"baseHas");var VT=UF;function kF(e,t){return e!=null&&Da(e,t,VT)}r(kF,"has");var F=kF;var RF="[object String]";function LF(e){return typeof e=="string"||!b(e)&&ne(e)&&ye(e)==RF}r(LF,"isString");var Le=LF;function xF(e,t){return dt(t,function(o){return e[o]})}r(xF,"baseValues");var qT=xF;function CF(e){return e==null?[]:qT(e,j(e))}r(CF,"values");var Y=CF;var OF=Math.max;function NF(e,t,o,n){e=he(e)?e:Y(e),o=o&&!n?Tt(o):0;var i=e.length;return o<0&&(o=OF(i+o,0)),Le(e)?o<=i&&e.indexOf(t,o)>-1:!!i&&Vr(e,t,o)>-1}r(NF,"includes");var ee=NF;var bF=Math.max;function MF(e,t,o){var n=e==null?0:e.length;if(!n)return-1;var i=o==null?0:Tt(o);return i<0&&(i=bF(n+i,0)),Vr(e,t,i)}r(MF,"indexOf");var Ya=MF;var yF="[object Map]",FF="[object Set]",_F=Object.prototype,IF=_F.hasOwnProperty;function vF(e){if(e==null)return!0;if(he(e)&&(b(e)||typeof e=="string"||typeof e.splice=="function"||Mt(e)||Wr(e)||Kt(e)))return!e.length;var t=st(e);if(t==yF||t==FF)return!e.size;if(St(e))return!Ra(e).length;for(var o in e)if(IF.call(e,o))return!1;return!0}r(vF,"isEmpty");var D=vF;var wF="[object RegExp]";function BF(e){return ne(e)&&ye(e)==wF}r(BF,"baseIsRegExp");var jT=BF;var WT=ot&&ot.isRegExp,PF=WT?At(WT):jT,nt=PF;function GF(e){return e===void 0}r(GF,"isUndefined");var we=GF;var DF="Expected a function";function VF(e){if(typeof e!="function")throw new TypeError(DF);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)}}r(VF,"negate");var YT=VF;function qF(e,t,o,n){if(!ae(e))return e;t=Zt(t,e);for(var i=-1,s=t.length,c=s-1,l=e;l!=null&&++i<s;){var p=gt(t[i]),f=o;if(p==="__proto__"||p==="constructor"||p==="prototype")return e;if(i!=c){var d=l[p];f=n?n(d,p,l):void 0,f===void 0&&(f=ae(d)?d:qt(t[i+1])?[]:{})}jt(l,p,f),l=l[p]}return e}r(qF,"baseSet");var KT=qF;function jF(e,t,o){for(var n=-1,i=t.length,s={};++n<i;){var c=t[n],l=Jr(e,c);o(l,c)&&KT(s,Zt(c,e),l)}return s}r(jF,"basePickBy");var HT=jF;function WF(e,t){if(e==null)return{};var o=dt(ba(e),function(n){return[n]});return t=Se(t),HT(e,o,function(n,i){return t(n,i[0])})}r(WF,"pickBy");var Ke=WF;var YF=Va(function(e,t,o){e[o?0:1].push(t)},function(){return[[],[]]}),pm=YF;function KF(e,t,o,n,i){return i(e,function(s,c,l){o=n?(n=!1,s):t(o,s,c,l)}),o}r(KF,"baseReduce");var zT=KF;function HF(e,t,o){var n=b(e)?kd:zT,i=arguments.length<3;return n(e,Se(t,4),o,i,Ye)}r(HF,"reduce");var ge=HF;function zF(e,t){var o=b(e)?eo:Wa;return o(e,YT(Se(t,3)))}r(zF,"reject");var rr=zF;function JF(e,t){var o;return Ye(e,function(n,i,s){return o=t(n,i,s),!o}),!!o}r(JF,"baseSome");var JT=JF;function XF(e,t,o){var n=b(e)?Ia:JT;return o&&Yt(e,t,o)&&(t=void 0),n(e,Se(t,3))}r(XF,"some");var lt=XF;var QF=1/0,ZF=er&&1/io(new er([,-0]))[1]==QF?function(e){return new er(e)}:ie,XT=ZF;var $F=200;function e_(e,t,o){var n=-1,i=ga,s=e.length,c=!0,l=[],p=l;if(o)c=!1,i=qa;else if(s>=$F){var f=t?null:XT(e);if(f)return io(f);c=!1,i=ao,p=new no}else p=t?[]:l;e:for(;++n<s;){var d=e[n],T=t?t(d):d;if(d=o||d!==0?d:0,c&&T===T){for(var g=p.length;g--;)if(p[g]===T)continue e;t&&p.push(T),l.push(d)}else i(p,T,o)||(p!==l&&p.push(T),l.push(d))}return l}r(e_,"baseUniq");var QT=e_;function t_(e){return e&&e.length?QT(e):[]}r(t_,"uniq");var or=t_;var r_=Wt(function(e,t){return Un(e)?ja(e,t):[]}),mm=r_;function co(e){console&&console.error&&console.error(`Error: ${e}`)}r(co,"PRINT_ERROR");function kn(e){console&&console.warn&&console.warn(`Warning: ${e}`)}r(kn,"PRINT_WARNING");function Rn(e){let t=new Date().getTime(),o=e();return{time:new Date().getTime()-t,value:o}}r(Rn,"timer");function Ln(e){function t(){}r(t,"FakeConstructor"),t.prototype=e;let o=new t;function n(){return typeof o.bar}return r(n,"fakeAccess"),n(),n(),e;(0,eval)(e)}r(Ln,"toFastProperties");function o_(e){return n_(e)?e.LABEL:e.name}r(o_,"tokenLabel");function n_(e){return Le(e.LABEL)&&e.LABEL!==""}r(n_,"hasTokenLabel");var $e=class{static{r(this,"AbstractProduction")}get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){this._definition=t}accept(t){t.visit(this),y(this.definition,o=>{o.accept(t)})}},z=class extends $e{static{r(this,"NonTerminal")}constructor(t){super([]),this.idx=1,Fe(this,Ke(t,o=>o!==void 0))}set definition(t){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(t){t.visit(this)}},De=class extends $e{static{r(this,"Rule")}constructor(t){super(t.definition),this.orgText="",Fe(this,Ke(t,o=>o!==void 0))}},J=class extends $e{static{r(this,"Alternative")}constructor(t){super(t.definition),this.ignoreAmbiguities=!1,Fe(this,Ke(t,o=>o!==void 0))}},Z=class extends $e{static{r(this,"Option")}constructor(t){super(t.definition),this.idx=1,Fe(this,Ke(t,o=>o!==void 0))}},de=class extends $e{static{r(this,"RepetitionMandatory")}constructor(t){super(t.definition),this.idx=1,Fe(this,Ke(t,o=>o!==void 0))}},Te=class extends $e{static{r(this,"RepetitionMandatoryWithSeparator")}constructor(t){super(t.definition),this.idx=1,Fe(this,Ke(t,o=>o!==void 0))}},W=class extends $e{static{r(this,"Repetition")}constructor(t){super(t.definition),this.idx=1,Fe(this,Ke(t,o=>o!==void 0))}},ue=class extends $e{static{r(this,"RepetitionWithSeparator")}constructor(t){super(t.definition),this.idx=1,Fe(this,Ke(t,o=>o!==void 0))}},pe=class extends $e{static{r(this,"Alternation")}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,Fe(this,Ke(t,o=>o!==void 0))}},q=class{static{r(this,"Terminal")}constructor(t){this.idx=1,Fe(this,Ke(t,o=>o!==void 0))}accept(t){t.visit(this)}};function Ka(e){return M(e,lo)}r(Ka,"serializeGrammar");function lo(e){function t(o){return M(o,lo)}if(r(t,"convertDefinition"),e instanceof z){let o={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return Le(e.label)&&(o.label=e.label),o}else{if(e instanceof J)return{type:"Alternative",definition:t(e.definition)};if(e instanceof Z)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof de)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof Te)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:lo(new q({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ue)return{type:"RepetitionWithSeparator",idx:e.idx,separator:lo(new q({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof W)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof pe)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof q){let o={type:"Terminal",name:e.terminalType.name,label:o_(e.terminalType),idx:e.idx};Le(e.label)&&(o.terminalLabel=e.label);let n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(o.pattern=nt(n)?n.source:n),o}else{if(e instanceof De)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}}}r(lo,"serializeProduction");var Ve=class{static{r(this,"GAstVisitor")}visit(t){let o=t;switch(o.constructor){case z:return this.visitNonTerminal(o);case J:return this.visitAlternative(o);case Z:return this.visitOption(o);case de:return this.visitRepetitionMandatory(o);case Te:return this.visitRepetitionMandatoryWithSeparator(o);case ue:return this.visitRepetitionWithSeparator(o);case W:return this.visitRepetition(o);case pe:return this.visitAlternation(o);case q:return this.visitTerminal(o);case De:return this.visitRule(o);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 fm(e){return e instanceof J||e instanceof Z||e instanceof W||e instanceof de||e instanceof Te||e instanceof ue||e instanceof q||e instanceof De}r(fm,"isSequenceProd");function Fr(e,t=[]){return e instanceof Z||e instanceof W||e instanceof ue?!0:e instanceof pe?lt(e.definition,n=>Fr(n,t)):e instanceof z&&ee(t,e)?!1:e instanceof $e?(e instanceof z&&t.push(e),Oe(e.definition,n=>Fr(n,t))):!1}r(Fr,"isOptionalProd");function dm(e){return e instanceof pe}r(dm,"isBranchingProd");function He(e){if(e instanceof z)return"SUBRULE";if(e instanceof Z)return"OPTION";if(e instanceof pe)return"OR";if(e instanceof de)return"AT_LEAST_ONE";if(e instanceof Te)return"AT_LEAST_ONE_SEP";if(e instanceof ue)return"MANY_SEP";if(e instanceof W)return"MANY";if(e instanceof q)return"CONSUME";throw Error("non exhaustive match")}r(He,"getProductionDslName");var _t=class{static{r(this,"RestWalker")}walk(t,o=[]){y(t.definition,(n,i)=>{let s=fe(t.definition,i+1);if(n instanceof z)this.walkProdRef(n,s,o);else if(n instanceof q)this.walkTerminal(n,s,o);else if(n instanceof J)this.walkFlat(n,s,o);else if(n instanceof Z)this.walkOption(n,s,o);else if(n instanceof de)this.walkAtLeastOne(n,s,o);else if(n instanceof Te)this.walkAtLeastOneSep(n,s,o);else if(n instanceof ue)this.walkManySep(n,s,o);else if(n instanceof W)this.walkMany(n,s,o);else if(n instanceof pe)this.walkOr(n,s,o);else throw Error("non exhaustive match")})}walkTerminal(t,o,n){}walkProdRef(t,o,n){}walkFlat(t,o,n){let i=o.concat(n);this.walk(t,i)}walkOption(t,o,n){let i=o.concat(n);this.walk(t,i)}walkAtLeastOne(t,o,n){let i=[new Z({definition:t.definition})].concat(o,n);this.walk(t,i)}walkAtLeastOneSep(t,o,n){let i=ZT(t,o,n);this.walk(t,i)}walkMany(t,o,n){let i=[new Z({definition:t.definition})].concat(o,n);this.walk(t,i)}walkManySep(t,o,n){let i=ZT(t,o,n);this.walk(t,i)}walkOr(t,o,n){let i=o.concat(n);y(t.definition,s=>{let c=new J({definition:[s]});this.walk(c,i)})}};function ZT(e,t,o){return[new Z({definition:[new q({terminalType:e.separator})].concat(e.definition)})].concat(t,o)}r(ZT,"restForRepetitionWithSeparator");function _r(e){if(e instanceof z)return _r(e.referencedRule);if(e instanceof q)return s_(e);if(fm(e))return a_(e);if(dm(e))return i_(e);throw Error("non exhaustive match")}r(_r,"first");function a_(e){let t=[],o=e.definition,n=0,i=o.length>n,s,c=!0;for(;i&&c;)s=o[n],c=Fr(s),t=t.concat(_r(s)),n=n+1,i=o.length>n;return or(t)}r(a_,"firstForSequence");function i_(e){let t=M(e.definition,o=>_r(o));return or(Re(t))}r(i_,"firstForBranching");function s_(e){return[e.terminalType]}r(s_,"firstForTerminal");var Ha="_~IN~_";var Tm=class extends _t{static{r(this,"ResyncFollowsWalker")}constructor(t){super(),this.topProd=t,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(t,o,n){}walkProdRef(t,o,n){let i=c_(t.referencedRule,t.idx)+this.topProd.name,s=o.concat(n),c=new J({definition:s}),l=_r(c);this.follows[i]=l}};function $T(e){let t={};return y(e,o=>{let n=new Tm(o).startWalking();Fe(t,n)}),t}r($T,"computeAllProdsFollows");function c_(e,t){return e.name+t+Ha}r(c_,"buildBetweenProdsFollowPrefix");function I(e){return e.charCodeAt(0)}r(I,"cc");function za(e,t){Array.isArray(e)?e.forEach(function(o){t.push(o)}):t.push(e)}r(za,"insertToSet");function uo(e,t){if(e[t]===!0)throw"duplicate flag "+t;let o=e[t];e[t]=!0}r(uo,"addFlag");function Ir(e){if(e===void 0)throw Error("Internal Error - Should never get here!");return!0}r(Ir,"ASSERT_EXISTS");function xn(){throw Error("Internal Error - Should never get here!")}r(xn,"ASSERT_NEVER_REACH_HERE");function Em(e){return e.type==="Character"}r(Em,"isCharacter");var Cn=[];for(let e=I("0");e<=I("9");e++)Cn.push(e);var On=[I("_")].concat(Cn);for(let e=I("a");e<=I("z");e++)On.push(e);for(let e=I("A");e<=I("Z");e++)On.push(e);var hm=[I(" "),I("\f"),I(`
|
|
2
|
+
`),I("\r"),I(" "),I("\v"),I(" "),I("\xA0"),I("\u1680"),I("\u2000"),I("\u2001"),I("\u2002"),I("\u2003"),I("\u2004"),I("\u2005"),I("\u2006"),I("\u2007"),I("\u2008"),I("\u2009"),I("\u200A"),I("\u2028"),I("\u2029"),I("\u202F"),I("\u205F"),I("\u3000"),I("\uFEFF")];var l_=/[0-9a-fA-F]/,Ja=/[0-9]/,u_=/[1-9]/,Nn=class{static{r(this,"RegExpParser")}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 o=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":uo(n,"global");break;case"i":uo(n,"ignoreCase");break;case"m":uo(n,"multiLine");break;case"u":uo(n,"unicode");break;case"y":uo(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:o,loc:this.loc(0)}}disjunction(){let t=[],o=this.idx;for(t.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),t.push(this.alternative());return{type:"Disjunction",value:t,loc:this.loc(o)}}alternative(){let t=[],o=this.idx;for(;this.isTerm();)t.push(this.term());return{type:"Alternative",value:t,loc:this.loc(o)}}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 o;switch(this.popChar()){case"=":o="Lookahead";break;case"!":o="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":o="Lookbehind";break;case"!":o="NegativeLookbehind"}break}}Ir(o);let n=this.disjunction();return this.consumeChar(")"),{type:o,value:n,loc:this.loc(t)}}return xn()}quantifier(t=!1){let o,n=this.idx;switch(this.popChar()){case"*":o={atLeast:0,atMost:1/0};break;case"+":o={atLeast:1,atMost:1/0};break;case"?":o={atLeast:0,atMost:1};break;case"{":let i=this.integerIncludingZero();switch(this.popChar()){case"}":o={atLeast:i,atMost:i};break;case",":let s;this.isDigit()?(s=this.integerIncludingZero(),o={atLeast:i,atMost:s}):o={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(t===!0&&o===void 0)return;Ir(o);break}if(!(t===!0&&o===void 0)&&Ir(o))return this.peekChar(0)==="?"?(this.consumeChar("?"),o.greedy=!1):o.greedy=!0,o.type="Quantifier",o.loc=this.loc(n),o}atom(){let t,o=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()),Ir(t)?(t.loc=this.loc(o),this.isQuantifier()&&(t.quantifier=this.quantifier()),t):xn()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[I(`
|
|
3
|
+
`),I("\r"),I("\u2028"),I("\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,o=!1;switch(this.popChar()){case"d":t=Cn;break;case"D":t=Cn,o=!0;break;case"s":t=hm;break;case"S":t=hm,o=!0;break;case"w":t=On;break;case"W":t=On,o=!0;break}return Ir(t)?{type:"Set",value:t,complement:o}:xn()}controlEscapeAtom(){let t;switch(this.popChar()){case"f":t=I("\f");break;case"n":t=I(`
|
|
4
4
|
`);break;case"r":t=I("\r");break;case"t":t=I(" ");break;case"v":t=I("\v");break}return Ir(t)?{type:"Character",value:t}:xn()}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:I("\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:I(t)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
5
|
-
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let t=this.popChar();return{type:"Character",value:I(t)}}}characterClass(){let t=[],o=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),o=!0);this.isClassAtom();){let n=this.classAtom(),i=n.type==="Character";if(
|
|
6
|
-
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:I("\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;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),t=!1;break;default:this.groupIdx++;break}let o=this.disjunction();this.consumeChar(")");let n={type:"Group",capturing:t,value:o};return t&&(n.idx=this.groupIdx),n}positiveInteger(){let t=this.popChar();if(
|
|
5
|
+
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let t=this.popChar();return{type:"Character",value:I(t)}}}characterClass(){let t=[],o=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),o=!0);this.isClassAtom();){let n=this.classAtom(),i=n.type==="Character";if(Em(n)&&this.isRangeDash()){this.consumeChar("-");let s=this.classAtom(),c=s.type==="Character";if(Em(s)){if(s.value<n.value)throw Error("Range out of order in character class");t.push({from:n.value,to:s.value})}else za(n.value,t),t.push(I("-")),za(s.value,t)}else za(n.value,t)}return this.consumeChar("]"),{type:"Set",complement:o,value:t}}classAtom(){switch(this.peekChar()){case"]":case`
|
|
6
|
+
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:I("\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;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),t=!1;break;default:this.groupIdx++;break}let o=this.disjunction();this.consumeChar(")");let n={type:"Group",capturing:t,value:o};return t&&(n.idx=this.groupIdx),n}positiveInteger(){let t=this.popChar();if(u_.test(t)===!1)throw Error("Expecting a positive integer");for(;Ja.test(this.peekChar(0));)t+=this.popChar();return parseInt(t,10)}integerIncludingZero(){let t=this.popChar();if(Ja.test(t)===!1)throw Error("Expecting an integer");for(;Ja.test(this.peekChar(0));)t+=this.popChar();return parseInt(t,10)}patternCharacter(){let t=this.popChar();switch(t){case`
|
|
7
7
|
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:I(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 Ja.test(this.peekChar(0))}isClassAtom(t=0){switch(this.peekChar(t)){case"]":case`
|
|
8
8
|
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!"||this.peekChar(2)==="<"&&(this.peekChar(3)==="="||this.peekChar(3)==="!"));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`
|
|
9
|
-
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(t){let o="";for(let i=0;i<t;i++){let s=this.popChar();if(
|
|
10
|
-
`;function
|
|
9
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(t){let o="";for(let i=0;i<t;i++){let s=this.popChar();if(l_.test(s)===!1)throw Error("Expecting a HexDecimal digits");o+=s}return{type:"Character",value:parseInt(o,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 nr=class{static{r(this,"BaseRegExpVisitor")}visitChildren(t){for(let o in t){let n=t[o];t.hasOwnProperty(o)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},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"Lookbehind":this.visitLookbehind(t);break;case"NegativeLookbehind":this.visitNegativeLookbehind(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){}visitLookbehind(t){}visitNegativeLookbehind(t){}visitCharacter(t){}visitSet(t){}visitGroup(t){}visitGroupBackReference(t){}visitQuantifier(t){}};var Xa={},p_=new Nn;function po(e){let t=e.toString();if(Xa.hasOwnProperty(t))return Xa[t];{let o=p_.pattern(t);return Xa[t]=o,o}}r(po,"getRegExpAst");function eE(){Xa={}}r(eE,"clearRegExpParserCache");var rE="Complement Sets are not supported for first char optimization",bn=`Unable to use "first char" lexer optimizations:
|
|
10
|
+
`;function oE(e,t=!1){try{let o=po(e);return Sm(o.value,{},o.flags.ignoreCase)}catch(o){if(o.message===rE)t&&kn(`${bn} Unable to optimize: < ${e.toString()} >
|
|
11
11
|
Complement Sets cannot be automatically optimized.
|
|
12
12
|
This will disable the lexer's first char optimizations.
|
|
13
13
|
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n=`
|
|
@@ -15,49 +15,49 @@
|
|
|
15
15
|
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),co(`${bn}
|
|
16
16
|
Failed parsing: < ${e.toString()} >
|
|
17
17
|
Using the @chevrotain/regexp-to-ast library
|
|
18
|
-
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}r(
|
|
19
|
-
`],tracer:r((O,x)=>x(),"tracer")});let o=t.tracer;o("initCharCodeToOptimizedIndexMap",()=>{
|
|
18
|
+
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}r(oE,"getOptimizedStartCodesIndices");function Sm(e,t,o){switch(e.type){case"Disjunction":for(let i=0;i<e.value.length;i++)Sm(e.value[i],t,o);break;case"Alternative":let n=e.value;for(let i=0;i<n.length;i++){let s=n[i];switch(s.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"Lookbehind":case"NegativeLookbehind":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}let c=s;switch(c.type){case"Character":Qa(c.value,t,o);break;case"Set":if(c.complement===!0)throw Error(rE);y(c.value,p=>{if(typeof p=="number")Qa(p,t,o);else{let f=p;if(o===!0)for(let d=f.from;d<=f.to;d++)Qa(d,t,o);else{for(let d=f.from;d<=f.to&&d<mo;d++)Qa(d,t,o);if(f.to>=mo){let d=f.from>=mo?f.from:mo,T=f.to,g=Rt(d),k=Rt(T);for(let C=g;C<=k;C++)t[C]=C}}}});break;case"Group":Sm(c.value,t,o);break;default:throw Error("Non Exhaustive Match")}let l=c.quantifier!==void 0&&c.quantifier.atLeast===0;if(c.type==="Group"&&Am(c)===!1||c.type!=="Group"&&l===!1)break}break;default:throw Error("non exhaustive match!")}return Y(t)}r(Sm,"firstCharOptimizedIndices");function Qa(e,t,o){let n=Rt(e);t[n]=n,o===!0&&m_(e,t)}r(Qa,"addOptimizedIdxToResult");function m_(e,t){let o=String.fromCharCode(e),n=o.toUpperCase();if(n!==o){let i=Rt(n.charCodeAt(0));t[i]=i}else{let i=o.toLowerCase();if(i!==o){let s=Rt(i.charCodeAt(0));t[s]=s}}}r(m_,"handleIgnoreCase");function tE(e,t){return kt(e.value,o=>{if(typeof o=="number")return ee(t,o);{let n=o;return kt(t,i=>n.from<=i&&i<=n.to)!==void 0}})}r(tE,"findCode");function Am(e){let t=e.quantifier;return t&&t.atLeast===0?!0:e.value?b(e.value)?Oe(e.value,Am):Am(e.value):!1}r(Am,"isWholeOptional");var gm=class extends nr{static{r(this,"CharCodeFinder")}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;case"Lookbehind":this.visitLookbehind(t);return;case"NegativeLookbehind":this.visitNegativeLookbehind(t);return}super.visitChildren(t)}}visitCharacter(t){ee(this.targetCharCodes,t.value)&&(this.found=!0)}visitSet(t){t.complement?tE(t,this.targetCharCodes)===void 0&&(this.found=!0):tE(t,this.targetCharCodes)!==void 0&&(this.found=!0)}};function Za(e,t){if(t instanceof RegExp){let o=po(t),n=new gm(e);return n.visit(o),n.found}else return kt(t,o=>ee(e,o.charCodeAt(0)))!==void 0}r(Za,"canMatchCharCode");var vr="PATTERN",fo="defaultMode",$a="modes",km=typeof new RegExp("(?:)").sticky=="boolean";function iE(e,t){t=so(t,{useSticky:km,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
19
|
+
`],tracer:r((O,x)=>x(),"tracer")});let o=t.tracer;o("initCharCodeToOptimizedIndexMap",()=>{y_()});let n;o("Reject Lexer.NA",()=>{n=rr(e,O=>O[vr]===se.NA)});let i=!1,s;o("Transform Patterns",()=>{i=!1,s=M(n,O=>{let x=O[vr];if(nt(x)){let v=x.source;return v.length===1&&v!=="^"&&v!=="$"&&v!=="."&&!x.ignoreCase?v:v.length===2&&v[0]==="\\"&&!ee(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],v[1])?v[1]:t.useSticky?aE(x):nE(x)}else{if(Pe(x))return i=!0,{exec:x};if(typeof x=="object")return i=!0,x;if(typeof x=="string"){if(x.length===1)return x;{let v=x.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),w=new RegExp(v);return t.useSticky?aE(w):nE(w)}}else throw Error("non exhaustive match")}})});let c,l,p,f,d;o("misc mapping",()=>{c=M(n,O=>O.tokenTypeIdx),l=M(n,O=>{let x=O.GROUP;if(x!==se.SKIPPED){if(Le(x))return x;if(we(x))return!1;throw Error("non exhaustive match")}}),p=M(n,O=>{let x=O.LONGER_ALT;if(x)return b(x)?M(x,w=>Ya(n,w)):[Ya(n,x)]}),f=M(n,O=>O.PUSH_MODE),d=M(n,O=>F(O,"POP_MODE"))});let T;o("Line Terminator Handling",()=>{let O=dE(t.lineTerminatorCharacters);T=M(n,x=>!1),t.positionTracking!=="onlyOffset"&&(T=M(n,x=>F(x,"LINE_BREAKS")?!!x.LINE_BREAKS:fE(x,O)===!1&&Za(O,x.PATTERN)))});let g,k,C,L;o("Misc Mapping #2",()=>{g=M(n,pE),k=M(s,b_),C=ge(n,(O,x)=>{let v=x.GROUP;return Le(v)&&v!==se.SKIPPED&&(O[v]=[]),O},{}),L=M(s,(O,x)=>({pattern:s[x],longerAlt:p[x],canLineTerminator:T[x],isCustom:g[x],short:k[x],group:l[x],push:f[x],pop:d[x],tokenTypeIdx:c[x],tokenType:n[x]}))});let _=!0,N=[];return t.safeMode||o("First Char Optimization",()=>{N=ge(n,(O,x,v)=>{if(typeof x.PATTERN=="string"){let w=x.PATTERN.charCodeAt(0),Qe=Rt(w);Um(O,Qe,L[v])}else if(b(x.START_CHARS_HINT)){let w;y(x.START_CHARS_HINT,Qe=>{let tm=typeof Qe=="string"?Qe.charCodeAt(0):Qe,ft=Rt(tm);w!==ft&&(w=ft,Um(O,ft,L[v]))})}else if(nt(x.PATTERN))if(x.PATTERN.unicode)_=!1,t.ensureOptimizations&&co(`${bn} Unable to analyze < ${x.PATTERN.toString()} > pattern.
|
|
20
20
|
The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
|
21
21
|
This will disable the lexer's first char optimizations.
|
|
22
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let w=
|
|
22
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let w=oE(x.PATTERN,t.ensureOptimizations);D(w)&&(_=!1),y(w,Qe=>{Um(O,Qe,L[v])})}else t.ensureOptimizations&&co(`${bn} TokenType: <${x.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
|
|
23
23
|
This will disable the lexer's first char optimizations.
|
|
24
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),_=!1;return O},[])}),{emptyGroups:C,patternIdxToConfig:L,charCodeToPatternIdxToConfig:N,hasCustom:i,canBeOptimized:_}}r(
|
|
24
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),_=!1;return O},[])}),{emptyGroups:C,patternIdxToConfig:L,charCodeToPatternIdxToConfig:N,hasCustom:i,canBeOptimized:_}}r(iE,"analyzeTokenTypes");function sE(e,t){let o=[],n=d_(e);o=o.concat(n.errors);let i=T_(n.valid),s=i.valid;return o=o.concat(i.errors),o=o.concat(f_(s)),o=o.concat(R_(s)),o=o.concat(L_(s,t)),o=o.concat(x_(s)),o}r(sE,"validatePatterns");function f_(e){let t=[],o=ve(e,n=>nt(n[vr]));return t=t.concat(h_(o)),t=t.concat(g_(o)),t=t.concat(U_(o)),t=t.concat(k_(o)),t=t.concat(S_(o)),t}r(f_,"validateRegExpPattern");function d_(e){let t=ve(e,i=>!F(i,vr)),o=M(t,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:te.MISSING_PATTERN,tokenTypes:[i]})),n=tr(e,t);return{errors:o,valid:n}}r(d_,"findMissingPatterns");function T_(e){let t=ve(e,i=>{let s=i[vr];return!nt(s)&&!Pe(s)&&!F(s,"exec")&&!Le(s)}),o=M(t,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:te.INVALID_PATTERN,tokenTypes:[i]})),n=tr(e,t);return{errors:o,valid:n}}r(T_,"findInvalidPatterns");var E_=/[^\\][$]/;function h_(e){class t extends nr{static{r(this,"EndAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}let o=ve(e,i=>{let s=i.PATTERN;try{let c=po(s),l=new t;return l.visit(c),l.found}catch{return E_.test(s.source)}});return M(o,i=>({message:`Unexpected RegExp Anchor Error:
|
|
25
25
|
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
26
|
-
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:te.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}r(
|
|
26
|
+
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:te.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}r(h_,"findEndOfInputAnchor");function S_(e){let t=ve(e,n=>n.PATTERN.test(""));return M(t,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:te.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}r(S_,"findEmptyMatchRegExps");var A_=/[^\\[][\^]|^\^/;function g_(e){class t extends nr{static{r(this,"StartAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}let o=ve(e,i=>{let s=i.PATTERN;try{let c=po(s),l=new t;return l.visit(c),l.found}catch{return A_.test(s.source)}});return M(o,i=>({message:`Unexpected RegExp Anchor Error:
|
|
27
27
|
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
28
|
-
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:te.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}r(
|
|
28
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:te.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}r(g_,"findStartOfInputAnchor");function U_(e){let t=ve(e,n=>{let i=n[vr];return i instanceof RegExp&&(i.multiline||i.global)});return M(t,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:te.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}r(U_,"findUnsupportedFlags");function k_(e){let t=[],o=M(e,s=>ge(e,(c,l)=>(s.PATTERN.source===l.PATTERN.source&&!ee(t,l)&&l.PATTERN!==se.NA&&(t.push(l),c.push(l)),c),[]));o=Ut(o);let n=ve(o,s=>s.length>1);return M(n,s=>{let c=M(s,p=>p.name);return{message:`The same RegExp pattern ->${Ae(s).PATTERN}<-has been used in all of the following Token Types: ${c.join(", ")} <-`,type:te.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}r(k_,"findDuplicatePatterns");function R_(e){let t=ve(e,n=>{if(!F(n,"GROUP"))return!1;let i=n.GROUP;return i!==se.SKIPPED&&i!==se.NA&&!Le(i)});return M(t,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:te.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}r(R_,"findInvalidGroupType");function L_(e,t){let o=ve(e,i=>i.PUSH_MODE!==void 0&&!ee(t,i.PUSH_MODE));return M(o,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:te.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}r(L_,"findModesThatDoNotExist");function x_(e){let t=[],o=ge(e,(n,i,s)=>{let c=i.PATTERN;return c===se.NA||(Le(c)?n.push({str:c,idx:s,tokenType:i}):nt(c)&&O_(c)&&n.push({str:c.source,idx:s,tokenType:i})),n},[]);return y(e,(n,i)=>{y(o,({str:s,idx:c,tokenType:l})=>{if(i<c&&C_(s,n.PATTERN)){let p=`Token: ->${l.name}<- can never be matched.
|
|
29
29
|
Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition.
|
|
30
|
-
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:p,type:te.UNREACHABLE_PATTERN,tokenTypes:[n,l]})}})}),t}r(
|
|
30
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:p,type:te.UNREACHABLE_PATTERN,tokenTypes:[n,l]})}})}),t}r(x_,"findUnreachablePatterns");function C_(e,t){if(nt(t)){if(N_(t))return!1;let o=t.exec(e);return o!==null&&o.index===0}else{if(Pe(t))return t(e,0,[],{});if(F(t,"exec"))return t.exec(e,0,[],{});if(typeof t=="string")return t===e;throw Error("non exhaustive match")}}r(C_,"tryToMatchStrToPattern");function O_(e){return kt([".","\\","[","]","|","^","$","(",")","?","*","+","{"],o=>e.source.indexOf(o)!==-1)===void 0}r(O_,"noMetaChar");function N_(e){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(e.source)}r(N_,"usesLookAheadOrBehind");function nE(e){let t=e.ignoreCase?"i":"";return new RegExp(`^(?:${e.source})`,t)}r(nE,"addStartOfInput");function aE(e){let t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}r(aE,"addStickyFlag");function cE(e,t,o){let n=[];return F(e,fo)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+fo+`> property in its definition
|
|
31
31
|
`,type:te.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),F(e,$a)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+$a+`> property in its definition
|
|
32
32
|
`,type:te.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),F(e,$a)&&F(e,fo)&&!F(e.modes,e.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${fo}: <${e.defaultMode}>which does not exist
|
|
33
33
|
`,type:te.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),F(e,$a)&&y(e.modes,(i,s)=>{y(i,(c,l)=>{if(we(c))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${l}>
|
|
34
34
|
`,type:te.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(F(c,"LONGER_ALT")){let p=b(c.LONGER_ALT)?c.LONGER_ALT:[c.LONGER_ALT];y(p,f=>{!we(f)&&!ee(i,f)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${f.name}> on token <${c.name}> outside of mode <${s}>
|
|
35
|
-
`,type:te.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}r(
|
|
35
|
+
`,type:te.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}r(cE,"performRuntimeChecks");function lE(e,t,o){let n=[],i=!1,s=Ut(Re(Y(e.modes))),c=rr(s,p=>p[vr]===se.NA),l=dE(o);return t&&y(c,p=>{let f=fE(p,l);if(f!==!1){let T={message:M_(p,f),type:f.issue,tokenType:p};n.push(T)}else F(p,"LINE_BREAKS")?p.LINE_BREAKS===!0&&(i=!0):Za(l,p.PATTERN)&&(i=!0)}),t&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
|
|
36
36
|
This Lexer has been defined to track line and column information,
|
|
37
37
|
But none of the Token Types can be identified as matching a line terminator.
|
|
38
38
|
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
39
|
-
for details.`,type:te.NO_LINE_BREAKS_FLAGS}),n}r(
|
|
39
|
+
for details.`,type:te.NO_LINE_BREAKS_FLAGS}),n}r(lE,"performWarningRuntimeChecks");function uE(e){let t={},o=j(e);return y(o,n=>{let i=e[n];if(b(i))t[n]=[];else throw Error("non exhaustive match")}),t}r(uE,"cloneEmptyGroups");function pE(e){let t=e.PATTERN;if(nt(t))return!1;if(Pe(t))return!0;if(F(t,"exec"))return!0;if(Le(t))return!1;throw Error("non exhaustive match")}r(pE,"isCustomPattern");function b_(e){return Le(e)&&e.length===1?e.charCodeAt(0):!1}r(b_,"isShortPattern");var mE={test:r(function(e){let t=e.length;for(let o=this.lastIndex;o<t;o++){let n=e.charCodeAt(o);if(n===10)return this.lastIndex=o+1,!0;if(n===13)return e.charCodeAt(o+1)===10?this.lastIndex=o+2:this.lastIndex=o+1,!0}return!1},"test"),lastIndex:0};function fE(e,t){if(F(e,"LINE_BREAKS"))return!1;if(nt(e.PATTERN)){try{Za(t,e.PATTERN)}catch(o){return{issue:te.IDENTIFY_TERMINATOR,errMsg:o.message}}return!1}else{if(Le(e.PATTERN))return!1;if(pE(e))return{issue:te.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}r(fE,"checkLineBreaksIssues");function M_(e,t){if(t.issue===te.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|
40
40
|
The problem is in the <${e.name}> Token Type
|
|
41
41
|
Root cause: ${t.errMsg}.
|
|
42
42
|
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===te.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
43
43
|
The problem is in the <${e.name}> Token Type
|
|
44
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}r(
|
|
45
|
-
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:
|
|
46
|
-
a boolean 2nd argument is no longer supported`);this.config=Fe({},Mn,o);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 i,s=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Mn.lineTerminatorsPattern)this.config.lineTerminatorsPattern=
|
|
47
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(o.safeMode&&o.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)?i={modes:{defaultMode:H(t)},defaultMode:fo}:(s=!1,i=H(t))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(
|
|
44
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}r(M_,"buildLineBreakIssueMessage");function dE(e){return M(e,o=>Le(o)?o.charCodeAt(0):o)}r(dE,"getCharCodes");function Um(e,t,o){e[t]===void 0?e[t]=[o]:e[t].push(o)}r(Um,"addToMapOfArrays");var mo=256,ei=[];function Rt(e){return e<mo?e:ei[e]}r(Rt,"charCodeToOptimizedIndex");function y_(){if(D(ei)){ei=new Array(65536);for(let e=0;e<65536;e++)ei[e]=e>255?255+~~(e/255):e}}r(y_,"initCharCodeToOptimizedIndexMap");function It(e,t){let o=e.tokenTypeIdx;return o===t.tokenTypeIdx?!0:t.isParent===!0&&t.categoryMatchesMap[o]===!0}r(It,"tokenStructuredMatcher");function To(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}r(To,"tokenStructuredMatcherNoCategories");var TE=1,hE={};function vt(e){let t=F_(e);__(t),v_(t),I_(t),y(t,o=>{o.isParent=o.categoryMatches.length>0})}r(vt,"augmentTokenTypes");function F_(e){let t=H(e),o=e,n=!0;for(;n;){o=Ut(Re(M(o,s=>s.CATEGORIES)));let i=tr(o,t);t=t.concat(i),D(i)?n=!1:o=i}return t}r(F_,"expandCategories");function __(e){y(e,t=>{Rm(t)||(hE[TE]=t,t.tokenTypeIdx=TE++),EE(t)&&!b(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),EE(t)||(t.CATEGORIES=[]),w_(t)||(t.categoryMatches=[]),B_(t)||(t.categoryMatchesMap={})})}r(__,"assignTokenDefaultProps");function I_(e){y(e,t=>{t.categoryMatches=[],y(t.categoryMatchesMap,(o,n)=>{t.categoryMatches.push(hE[n].tokenTypeIdx)})})}r(I_,"assignCategoriesTokensProp");function v_(e){y(e,t=>{SE([],t)})}r(v_,"assignCategoriesMapProp");function SE(e,t){y(e,o=>{t.categoryMatchesMap[o.tokenTypeIdx]=!0}),y(t.CATEGORIES,o=>{let n=e.concat(t);ee(n,o)||SE(n,o)})}r(SE,"singleAssignCategoriesToksMap");function Rm(e){return F(e,"tokenTypeIdx")}r(Rm,"hasShortKeyProperty");function EE(e){return F(e,"CATEGORIES")}r(EE,"hasCategoriesProperty");function w_(e){return F(e,"categoryMatches")}r(w_,"hasExtendingTokensTypesProperty");function B_(e){return F(e,"categoryMatchesMap")}r(B_,"hasExtendingTokensTypesMapProperty");function AE(e){return F(e,"tokenTypeIdx")}r(AE,"isTokenType");var Lm={buildUnableToPopLexerModeMessage(e){return`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(e,t,o,n,i,s){return`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${o} characters.`}};var te;(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"})(te||(te={}));var Mn={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
45
|
+
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Lm,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Mn);var se=class{static{r(this,"Lexer")}constructor(t,o=Mn){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=(i,s)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let c=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${c}--> <${i}>`);let{time:l,value:p}=Rn(s),f=l>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&f(`${c}<-- <${i}> time: ${l}ms`),this.traceInitIndent--,p}else return s()},typeof o=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
46
|
+
a boolean 2nd argument is no longer supported`);this.config=Fe({},Mn,o);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 i,s=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Mn.lineTerminatorsPattern)this.config.lineTerminatorsPattern=mE;else if(this.config.lineTerminatorCharacters===Mn.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
47
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(o.safeMode&&o.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)?i={modes:{defaultMode:H(t)},defaultMode:fo}:(s=!1,i=H(t))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(cE(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(lE(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},y(i.modes,(l,p)=>{i.modes[p]=rr(l,f=>we(f))});let c=j(i.modes);if(y(i.modes,(l,p)=>{this.TRACE_INIT(`Mode: <${p}> processing`,()=>{if(this.modes.push(p),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(sE(l,c))}),D(this.lexerDefinitionErrors)){vt(l);let f;this.TRACE_INIT("analyzeTokenTypes",()=>{f=iE(l,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:o.positionTracking,ensureOptimizations:o.ensureOptimizations,safeMode:o.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[p]=f.patternIdxToConfig,this.charCodeToPatternIdxToConfig[p]=f.charCodeToPatternIdxToConfig,this.emptyGroups=Fe({},this.emptyGroups,f.emptyGroups),this.hasCustom=f.hasCustom||this.hasCustom,this.canModeBeOptimized[p]=f.canBeOptimized}})}),this.defaultMode=i.defaultMode,!D(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let p=M(this.lexerDefinitionErrors,f=>f.message).join(`-----------------------
|
|
48
48
|
`);throw new Error(`Errors detected in definition of Lexer:
|
|
49
|
-
`+p)}y(this.lexerDefinitionWarning,l=>{kn(l.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(
|
|
49
|
+
`+p)}y(this.lexerDefinitionWarning,l=>{kn(l.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(km?(this.chopInput=rt,this.match=this.matchWithTest):(this.updateLastIndex=ie,this.match=this.matchWithExec),s&&(this.handleModes=ie),this.trackStartLines===!1&&(this.computeNewColumn=rt),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=ie),/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 l=ge(this.canModeBeOptimized,(p,f,d)=>(f===!1&&p.push(d),p),[]);if(o.ensureOptimizations&&!D(l))throw Error(`Lexer Modes: < ${l.join(", ")} > cannot be optimized.
|
|
50
50
|
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
51
|
-
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{
|
|
51
|
+
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{eE()}),this.TRACE_INIT("toFastProperties",()=>{Ln(this)})})}tokenize(t,o=this.defaultMode){if(!D(this.lexerDefinitionErrors)){let i=M(this.lexerDefinitionErrors,s=>s.message).join(`-----------------------
|
|
52
52
|
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
53
|
-
`+i)}return this.tokenizeInternal(t,o)}tokenizeInternal(t,o){let n,i,s,c,l,p,f,d,T,
|
|
54
|
-
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return F(e,
|
|
55
|
-
but found: '`+
|
|
56
|
-
${M(f,(
|
|
53
|
+
`+i)}return this.tokenizeInternal(t,o)}tokenizeInternal(t,o){let n,i,s,c,l,p,f,d,T,g,k,C,L,_,N,O,x=t,v=x.length,w=0,Qe=0,tm=this.hasCustom?0:Math.floor(t.length/10),ft=new Array(tm),rm=[],fn=this.trackStartLines?1:void 0,Pt=this.trackStartLines?1:void 0,dn=uE(this.emptyGroups),mx=this.trackStartLines,om=this.config.lineTerminatorsPattern,da=0,Gt=[],Tn=[],En=[],rf=[];Object.freeze(rf);let hn;function of(){return Gt}r(of,"getPossiblePatternsSlow");function nf(Ie){let tt=Rt(Ie),Gr=Tn[tt];return Gr===void 0?rf:Gr}r(nf,"getPossiblePatternsOptimized");let fx=r(Ie=>{if(En.length===1&&Ie.tokenType.PUSH_MODE===void 0){let tt=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Ie);rm.push({offset:Ie.startOffset,line:Ie.startLine,column:Ie.startColumn,length:Ie.image.length,message:tt})}else{En.pop();let tt=ct(En);Gt=this.patternIdxToConfig[tt],Tn=this.charCodeToPatternIdxToConfig[tt],da=Gt.length;let Gr=this.canModeBeOptimized[tt]&&this.config.safeMode===!1;Tn&&Gr?hn=nf:hn=of}},"pop_mode");function af(Ie){En.push(Ie),Tn=this.charCodeToPatternIdxToConfig[Ie],Gt=this.patternIdxToConfig[Ie],da=Gt.length,da=Gt.length;let tt=this.canModeBeOptimized[Ie]&&this.config.safeMode===!1;Tn&&tt?hn=nf:hn=of}r(af,"push_mode"),af.call(this,o);let it,sf=this.config.recoveryEnabled;for(;w<v;){p=null;let Ie=x.charCodeAt(w),tt=hn(Ie),Gr=tt.length;for(n=0;n<Gr;n++){it=tt[n];let Ze=it.pattern;f=null;let Ot=it.short;if(Ot!==!1?Ie===Ot&&(p=Ze):it.isCustom===!0?(O=Ze.exec(x,w,ft,dn),O!==null?(p=O[0],O.payload!==void 0&&(f=O.payload)):p=null):(this.updateLastIndex(Ze,w),p=this.match(Ze,t,w)),p!==null){if(l=it.longerAlt,l!==void 0){let Dt=l.length;for(s=0;s<Dt;s++){let Nt=Gt[l[s]],Nr=Nt.pattern;if(d=null,Nt.isCustom===!0?(O=Nr.exec(x,w,ft,dn),O!==null?(c=O[0],O.payload!==void 0&&(d=O.payload)):c=null):(this.updateLastIndex(Nr,w),c=this.match(Nr,t,w)),c&&c.length>p.length){p=c,f=d,it=Nt;break}}}break}}if(p!==null){if(T=p.length,g=it.group,g!==void 0&&(k=it.tokenTypeIdx,C=this.createTokenInstance(p,w,k,it.tokenType,fn,Pt,T),this.handlePayload(C,f),g===!1?Qe=this.addToken(ft,Qe,C):dn[g].push(C)),t=this.chopInput(t,T),w=w+T,Pt=this.computeNewColumn(Pt,T),mx===!0&&it.canLineTerminator===!0){let Ze=0,Ot,Dt;om.lastIndex=0;do Ot=om.test(p),Ot===!0&&(Dt=om.lastIndex-1,Ze++);while(Ot===!0);Ze!==0&&(fn=fn+Ze,Pt=T-Dt,this.updateTokenEndLineColumnLocation(C,g,Dt,Ze,fn,Pt,T))}this.handleModes(it,fx,af,C)}else{let Ze=w,Ot=fn,Dt=Pt,Nt=sf===!1;for(;Nt===!1&&w<v;)for(t=this.chopInput(t,1),w++,i=0;i<da;i++){let Nr=Gt[i],nm=Nr.pattern,cf=Nr.short;if(cf!==!1?x.charCodeAt(w)===cf&&(Nt=!0):Nr.isCustom===!0?Nt=nm.exec(x,w,ft,dn)!==null:(this.updateLastIndex(nm,w),Nt=nm.exec(t)!==null),Nt===!0)break}if(L=w-Ze,Pt=this.computeNewColumn(Pt,L),N=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(x,Ze,L,Ot,Dt,ct(En)),rm.push({offset:Ze,line:Ot,column:Dt,length:L,message:N}),sf===!1)break}}return this.hasCustom||(ft.length=Qe),{tokens:ft,groups:dn,errors:rm}}handleModes(t,o,n,i){if(t.pop===!0){let s=t.push;o(i),s!==void 0&&n.call(this,s)}else t.push!==void 0&&n.call(this,t.push)}chopInput(t,o){return t.substring(o)}updateLastIndex(t,o){t.lastIndex=o}updateTokenEndLineColumnLocation(t,o,n,i,s,c,l){let p,f;o!==void 0&&(p=n===l-1,f=p?-1:0,i===1&&p===!0||(t.endLine=s+f,t.endColumn=c-1+-f))}computeNewColumn(t,o){return t+o}createOffsetOnlyToken(t,o,n,i){return{image:t,startOffset:o,tokenTypeIdx:n,tokenType:i}}createStartOnlyToken(t,o,n,i,s,c){return{image:t,startOffset:o,startLine:s,startColumn:c,tokenTypeIdx:n,tokenType:i}}createFullToken(t,o,n,i,s,c,l){return{image:t,startOffset:o,endOffset:o+l-1,startLine:s,endLine:s,startColumn:c,endColumn:c+l-1,tokenTypeIdx:n,tokenType:i}}addTokenUsingPush(t,o,n){return t.push(n),o}addTokenUsingMemberAccess(t,o,n){return t[o]=n,o++,o}handlePayloadNoCustom(t,o){}handlePayloadWithCustom(t,o){o!==null&&(t.payload=o)}matchWithTest(t,o,n){return t.test(o)===!0?o.substring(n,t.lastIndex):null}matchWithExec(t,o){let n=t.exec(o);return n!==null?n[0]:null}};se.SKIPPED="This marks a skipped Token pattern, this means each token identified by it will be consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";se.NA=/NOT_APPLICABLE/;function wr(e){return xm(e)?e.LABEL:e.name}r(wr,"tokenLabel");function xm(e){return Le(e.LABEL)&&e.LABEL!==""}r(xm,"hasTokenLabel");var P_="parent",gE="categories",UE="label",kE="group",RE="push_mode",LE="pop_mode",xE="longer_alt",CE="line_breaks",OE="start_chars_hint";function wt(e){return G_(e)}r(wt,"createToken");function G_(e){let t=e.pattern,o={};if(o.name=e.name,we(t)||(o.PATTERN=t),F(e,P_))throw`The parent property is no longer supported.
|
|
54
|
+
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return F(e,gE)&&(o.CATEGORIES=e[gE]),vt([o]),F(e,UE)&&(o.LABEL=e[UE]),F(e,kE)&&(o.GROUP=e[kE]),F(e,LE)&&(o.POP_MODE=e[LE]),F(e,RE)&&(o.PUSH_MODE=e[RE]),F(e,xE)&&(o.LONGER_ALT=e[xE]),F(e,CE)&&(o.LINE_BREAKS=e[CE]),F(e,OE)&&(o.START_CHARS_HINT=e[OE]),o}r(G_,"createTokenInternal");var ut=wt({name:"EOF",pattern:se.NA});vt([ut]);function Br(e,t,o,n,i,s,c,l){return{image:t,startOffset:o,endOffset:n,startLine:i,endLine:s,startColumn:c,endColumn:l,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}r(Br,"createTokenInstance");function Cm(e,t){return It(e,t)}r(Cm,"tokenMatcher");var Bt={buildMismatchTokenMessage({expected:e,actual:t,previous:o,ruleName:n}){return`Expecting ${xm(e)?`--> ${wr(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:o,customUserDescription:n,ruleName:i}){let s="Expecting: ",l=`
|
|
55
|
+
but found: '`+Ae(t).image+"'";if(n)return s+n+l;{let p=ge(e,(g,k)=>g.concat(k),[]),f=M(p,g=>`[${M(g,k=>wr(k)).join(", ")}]`),T=`one of these possible Token sequences:
|
|
56
|
+
${M(f,(g,k)=>` ${k+1}. ${g}`).join(`
|
|
57
57
|
`)}`;return s+T+l}},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:o,ruleName:n}){let i="Expecting: ",c=`
|
|
58
|
-
but found: '`+
|
|
59
|
-
<${M(e,f=>`[${M(f,d=>wr(d)).join(",")}]`).join(" ,")}>`;return i+p+c}}};Object.freeze(Bt);var
|
|
60
|
-
inside top level rule: ->`+e.name+"<-"}},pt={buildDuplicateFoundError(e,t){function o(d){return d instanceof q?d.terminalType.name:d instanceof z?d.nonTerminalName:""}r(o,"getExtraProductionArgument");let n=e.name,i=
|
|
58
|
+
but found: '`+Ae(t).image+"'";if(o)return i+o+c;{let p=`expecting at least one iteration which starts with one of these possible Token sequences::
|
|
59
|
+
<${M(e,f=>`[${M(f,d=>wr(d)).join(",")}]`).join(" ,")}>`;return i+p+c}}};Object.freeze(Bt);var NE={buildRuleNotFoundError(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+`<-
|
|
60
|
+
inside top level rule: ->`+e.name+"<-"}},pt={buildDuplicateFoundError(e,t){function o(d){return d instanceof q?d.terminalType.name:d instanceof z?d.nonTerminalName:""}r(o,"getExtraProductionArgument");let n=e.name,i=Ae(t),s=i.idx,c=He(i),l=o(i),p=s>0,f=`->${c}${p?s:""}<- ${l?`with argument: ->${l}<-`:""}
|
|
61
61
|
appears more than once (${t.length} times) in the top level rule: ->${n}<-.
|
|
62
62
|
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
63
63
|
`;return f=f.replace(/[ \t]+/g," "),f=f.replace(/\s\s+/g,`
|
|
@@ -81,34 +81,34 @@ rule: <${t}> can be invoked from itself (directly or indirectly)
|
|
|
81
81
|
without consuming any Tokens. The grammar path that causes this is:
|
|
82
82
|
${n}
|
|
83
83
|
To fix this refactor your grammar to remove the left recursion.
|
|
84
|
-
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(e){return"deprecated"},buildDuplicateRuleNameError(e){let t;return e.topLevelRule instanceof De?t=e.topLevelRule.name:t=e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};function NE(e,t){let o=new Cm(e,t);return o.resolveRefs(),o.errors}r(NE,"resolveGrammar");var Cm=class extends Ve{static{r(this,"GastRefResolverVisitor")}constructor(t,o){super(),this.nameToTopRule=t,this.errMsgProvider=o,this.errors=[]}resolveRefs(){y(Y(this.nameToTopRule),t=>{this.currTopLevel=t,t.accept(this)})}visitNonTerminal(t){let o=this.nameToTopRule[t.nonTerminalName];if(o)t.referencedRule=o;else{let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:n,type:Le.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}}};var Om=class extends _t{static{r(this,"AbstractNextPossibleTokensWalker")}constructor(t,o){super(),this.topProd=t,this.path=o,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=H(this.path.ruleStack).reverse(),this.occurrenceStack=H(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(t,o=[]){this.found||super.walk(t,o)}walkProdRef(t,o,n){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){let i=o.concat(n);this.updateExpectedNext(),this.walk(t.referencedRule,i)}}updateExpectedNext(){D(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},ti=class extends Om{static{r(this,"NextAfterTokenWalker")}constructor(t,o){super(t,o),this.path=o,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(t,o,n){if(this.isAtEndOfPath&&t.terminalType.name===this.nextTerminalName&&t.idx===this.nextTerminalOccurrence&&!this.found){let i=o.concat(n),s=new J({definition:i});this.possibleTokTypes=_r(s),this.found=!0}}},Eo=class extends _t{static{r(this,"AbstractNextTerminalAfterProductionWalker")}constructor(t,o){super(),this.topRule=t,this.occurrence=o,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},ri=class extends Eo{static{r(this,"NextTerminalAfterManyWalker")}walkMany(t,o,n){if(t.idx===this.occurrence){let i=Se(o.concat(n));this.result.isEndOfRule=i===void 0,i instanceof q&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(t,o,n)}},yn=class extends Eo{static{r(this,"NextTerminalAfterManySepWalker")}walkManySep(t,o,n){if(t.idx===this.occurrence){let i=Se(o.concat(n));this.result.isEndOfRule=i===void 0,i instanceof q&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(t,o,n)}},oi=class extends Eo{static{r(this,"NextTerminalAfterAtLeastOneWalker")}walkAtLeastOne(t,o,n){if(t.idx===this.occurrence){let i=Se(o.concat(n));this.result.isEndOfRule=i===void 0,i instanceof q&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(t,o,n)}},Fn=class extends Eo{static{r(this,"NextTerminalAfterAtLeastOneSepWalker")}walkAtLeastOneSep(t,o,n){if(t.idx===this.occurrence){let i=Se(o.concat(n));this.result.isEndOfRule=i===void 0,i instanceof q&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(t,o,n)}};function ni(e,t,o=[]){o=H(o);let n=[],i=0;function s(l){return l.concat(me(e,i+1))}r(s,"remainingPathWith");function c(l){let p=ni(s(l),t,o);return n.concat(p)}for(r(c,"getAlternativesForProd");o.length<t&&i<e.length;){let l=e[i];if(l instanceof J)return c(l.definition);if(l instanceof z)return c(l.definition);if(l instanceof Z)n=c(l.definition);else if(l instanceof fe){let p=l.definition.concat([new W({definition:l.definition})]);return c(p)}else if(l instanceof de){let p=[new J({definition:l.definition}),new W({definition:[new q({terminalType:l.separator})].concat(l.definition)})];return c(p)}else if(l instanceof ue){let p=l.definition.concat([new W({definition:[new q({terminalType:l.separator})].concat(l.definition)})]);n=c(p)}else if(l instanceof W){let p=l.definition.concat([new W({definition:l.definition})]);n=c(p)}else{if(l instanceof pe)return y(l.definition,p=>{D(p.definition)===!1&&(n=c(p.definition))}),n;if(l instanceof q)o.push(l.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:o,suffixDef:me(e,i)}),n}r(ni,"possiblePathsFrom");function ai(e,t,o,n){let i="EXIT_NONE_TERMINAL",s=[i],c="EXIT_ALTERNATIVE",l=!1,p=t.length,f=p-n-1,d=[],T=[];for(T.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!D(T);){let U=T.pop();if(U===c){l&&ct(T).idx<=f&&T.pop();continue}let k=U.def,C=U.idx,L=U.ruleStack,_=U.occurrenceStack;if(D(k))continue;let N=k[0];if(N===i){let O={idx:C,def:me(k),ruleStack:Ft(L),occurrenceStack:Ft(_)};T.push(O)}else if(N instanceof q)if(C<p-1){let O=C+1,x=t[O];if(o(x,N.terminalType)){let v={idx:O,def:me(k),ruleStack:L,occurrenceStack:_};T.push(v)}}else if(C===p-1)d.push({nextTokenType:N.terminalType,nextTokenOccurrence:N.idx,ruleStack:L,occurrenceStack:_}),l=!0;else throw Error("non exhaustive match");else if(N instanceof z){let O=H(L);O.push(N.nonTerminalName);let x=H(_);x.push(N.idx);let v={idx:C,def:N.definition.concat(s,me(k)),ruleStack:O,occurrenceStack:x};T.push(v)}else if(N instanceof Z){let O={idx:C,def:me(k),ruleStack:L,occurrenceStack:_};T.push(O),T.push(c);let x={idx:C,def:N.definition.concat(me(k)),ruleStack:L,occurrenceStack:_};T.push(x)}else if(N instanceof fe){let O=new W({definition:N.definition,idx:N.idx}),x=N.definition.concat([O],me(k)),v={idx:C,def:x,ruleStack:L,occurrenceStack:_};T.push(v)}else if(N instanceof de){let O=new q({terminalType:N.separator}),x=new W({definition:[O].concat(N.definition),idx:N.idx}),v=N.definition.concat([x],me(k)),w={idx:C,def:v,ruleStack:L,occurrenceStack:_};T.push(w)}else if(N instanceof ue){let O={idx:C,def:me(k),ruleStack:L,occurrenceStack:_};T.push(O),T.push(c);let x=new q({terminalType:N.separator}),v=new W({definition:[x].concat(N.definition),idx:N.idx}),w=N.definition.concat([v],me(k)),Qe={idx:C,def:w,ruleStack:L,occurrenceStack:_};T.push(Qe)}else if(N instanceof W){let O={idx:C,def:me(k),ruleStack:L,occurrenceStack:_};T.push(O),T.push(c);let x=new W({definition:N.definition,idx:N.idx}),v=N.definition.concat([x],me(k)),w={idx:C,def:v,ruleStack:L,occurrenceStack:_};T.push(w)}else if(N instanceof pe)for(let O=N.definition.length-1;O>=0;O--){let x=N.definition[O],v={idx:C,def:x.definition.concat(me(k)),ruleStack:L,occurrenceStack:_};T.push(v),T.push(c)}else if(N instanceof J)T.push({idx:C,def:N.definition.concat(me(k)),ruleStack:L,occurrenceStack:_});else if(N instanceof De)T.push(G_(N,C,L,_));else throw Error("non exhaustive match")}return d}r(ai,"nextPossibleTokensAfter");function G_(e,t,o,n){let i=H(o);i.push(e.name);let s=H(n);return s.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:s}}r(G_,"expandTopLevelRule");var ce;(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"})(ce||(ce={}));function si(e){if(e instanceof Z||e==="Option")return ce.OPTION;if(e instanceof W||e==="Repetition")return ce.REPETITION;if(e instanceof fe||e==="RepetitionMandatory")return ce.REPETITION_MANDATORY;if(e instanceof de||e==="RepetitionMandatoryWithSeparator")return ce.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ue||e==="RepetitionWithSeparator")return ce.REPETITION_WITH_SEPARATOR;if(e instanceof pe||e==="Alternation")return ce.ALTERNATION;throw Error("non exhaustive match")}r(si,"getProdType");function ME(e,t,o,n,i,s){let c=_n(e,t,o),l=wE(c)?To:It;return s(c,n,l,i)}r(ME,"buildLookaheadFuncForOr");function yE(e,t,o,n,i,s){let c=In(e,t,i,o),l=wE(c)?To:It;return s(c[0],l,n)}r(yE,"buildLookaheadFuncForOptionalProd");function FE(e,t,o,n){let i=e.length,s=Ce(e,c=>Ce(c,l=>l.length===1));if(t)return function(c){let l=M(c,p=>p.GATE);for(let p=0;p<i;p++){let f=e[p],d=f.length,T=l[p];if(!(T!==void 0&&T.call(this)===!1))e:for(let U=0;U<d;U++){let k=f[U],C=k.length;for(let L=0;L<C;L++){let _=this.LA(L+1);if(o(_,k[L])===!1)continue e}return p}}};if(s&&!n){let c=M(e,p=>ke(p)),l=Ae(c,(p,f,d)=>(y(f,T=>{F(p,T.tokenTypeIdx)||(p[T.tokenTypeIdx]=d),y(T.categoryMatches,U=>{F(p,U)||(p[U]=d)})}),p),{});return function(){let p=this.LA(1);return l[p.tokenTypeIdx]}}else return function(){for(let c=0;c<i;c++){let l=e[c],p=l.length;e:for(let f=0;f<p;f++){let d=l[f],T=d.length;for(let U=0;U<T;U++){let k=this.LA(U+1);if(o(k,d[U])===!1)continue e}return c}}}}r(FE,"buildAlternativesLookAheadFunc");function _E(e,t,o){let n=Ce(e,s=>s.length===1),i=e.length;if(n&&!o){let s=ke(e);if(s.length===1&&D(s[0].categoryMatches)){let l=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===l}}else{let c=Ae(s,(l,p,f)=>(l[p.tokenTypeIdx]=!0,y(p.categoryMatches,d=>{l[d]=!0}),l),[]);return function(){let l=this.LA(1);return c[l.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;s<i;s++){let c=e[s],l=c.length;for(let p=0;p<l;p++){let f=this.LA(p+1);if(t(f,c[p])===!1)continue e}return!0}return!1}}r(_E,"buildSingleAlternativeLookaheadFunction");var bm=class extends _t{static{r(this,"RestDefinitionFinderWalker")}constructor(t,o,n){super(),this.topProd=t,this.targetOccurrence=o,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(t,o,n,i){return t.idx===this.targetOccurrence&&this.targetProdType===o?(this.restDef=n.concat(i),!0):!1}walkOption(t,o,n){this.checkIsTarget(t,ce.OPTION,o,n)||super.walkOption(t,o,n)}walkAtLeastOne(t,o,n){this.checkIsTarget(t,ce.REPETITION_MANDATORY,o,n)||super.walkOption(t,o,n)}walkAtLeastOneSep(t,o,n){this.checkIsTarget(t,ce.REPETITION_MANDATORY_WITH_SEPARATOR,o,n)||super.walkOption(t,o,n)}walkMany(t,o,n){this.checkIsTarget(t,ce.REPETITION,o,n)||super.walkOption(t,o,n)}walkManySep(t,o,n){this.checkIsTarget(t,ce.REPETITION_WITH_SEPARATOR,o,n)||super.walkOption(t,o,n)}},ii=class extends Ve{static{r(this,"InsideDefinitionFinderVisitor")}constructor(t,o,n){super(),this.targetOccurrence=t,this.targetProdType=o,this.targetRef=n,this.result=[]}checkIsTarget(t,o){t.idx===this.targetOccurrence&&this.targetProdType===o&&(this.targetRef===void 0||t===this.targetRef)&&(this.result=t.definition)}visitOption(t){this.checkIsTarget(t,ce.OPTION)}visitRepetition(t){this.checkIsTarget(t,ce.REPETITION)}visitRepetitionMandatory(t){this.checkIsTarget(t,ce.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(t){this.checkIsTarget(t,ce.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(t){this.checkIsTarget(t,ce.REPETITION_WITH_SEPARATOR)}visitAlternation(t){this.checkIsTarget(t,ce.ALTERNATION)}};function bE(e){let t=new Array(e);for(let o=0;o<e;o++)t[o]=[];return t}r(bE,"initializeArrayOfArrays");function Nm(e){let t=[""];for(let o=0;o<e.length;o++){let n=e[o],i=[];for(let s=0;s<t.length;s++){let c=t[s];i.push(c+"_"+n.tokenTypeIdx);for(let l=0;l<n.categoryMatches.length;l++){let p="_"+n.categoryMatches[l];i.push(c+p)}}t=i}return t}r(Nm,"pathToHashKeys");function D_(e,t,o){for(let n=0;n<e.length;n++){if(n===o)continue;let i=e[n];for(let s=0;s<t.length;s++){let c=t[s];if(i[c]===!0)return!1}}return!0}r(D_,"isUniquePrefixHash");function IE(e,t){let o=M(e,c=>ni([c],1)),n=bE(o.length),i=M(o,c=>{let l={};return y(c,p=>{let f=Nm(p.partialPath);y(f,d=>{l[d]=!0})}),l}),s=o;for(let c=1;c<=t;c++){let l=s;s=bE(l.length);for(let p=0;p<l.length;p++){let f=l[p];for(let d=0;d<f.length;d++){let T=f[d].partialPath,U=f[d].suffixDef,k=Nm(T);if(D_(i,k,p)||D(U)||T.length===t){let L=n[p];if(ci(L,T)===!1){L.push(T);for(let _=0;_<k.length;_++){let N=k[_];i[p][N]=!0}}}else{let L=ni(U,c+1,T);s[p]=s[p].concat(L),y(L,_=>{let N=Nm(_.partialPath);y(N,O=>{i[p][O]=!0})})}}}}return n}r(IE,"lookAheadSequenceFromAlternatives");function _n(e,t,o,n){let i=new ii(e,ce.ALTERNATION,n);return t.accept(i),IE(i.result,o)}r(_n,"getLookaheadPathsForOr");function In(e,t,o,n){let i=new ii(e,o);t.accept(i);let s=i.result,l=new bm(t,e,o).startWalking(),p=new J({definition:s}),f=new J({definition:l});return IE([p,f],n)}r(In,"getLookaheadPathsForOptionalProd");function ci(e,t){e:for(let o=0;o<e.length;o++){let n=e[o];if(n.length===t.length){for(let i=0;i<n.length;i++){let s=t[i],c=n[i];if((s===c||c.categoryMatchesMap[s.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}r(ci,"containsPath");function vE(e,t){return e.length<t.length&&Ce(e,(o,n)=>{let i=t[n];return o===i||i.categoryMatchesMap[o.tokenTypeIdx]})}r(vE,"isStrictPrefixOfPath");function wE(e){return Ce(e,t=>Ce(t,o=>Ce(o,n=>D(n.categoryMatches))))}r(wE,"areTokenCategoriesNotUsed");function BE(e){let t=e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName});return M(t,o=>Object.assign({type:Le.CUSTOM_LOOKAHEAD_VALIDATION},o))}r(BE,"validateLookahead");function PE(e,t,o,n){let i=Ge(e,p=>V_(p,o)),s=H_(e,t,o),c=Ge(e,p=>W_(p,o)),l=Ge(e,p=>j_(p,e,n,o));return i.concat(s,c,l)}r(PE,"validateGrammar");function V_(e,t){let o=new Mm;e.accept(o);let n=o.allProductions,i=lm(n,q_),s=Ke(i,l=>l.length>1);return M(Y(s),l=>{let p=Se(l),f=t.buildDuplicateFoundError(e,l),d=He(p),T={message:f,type:Le.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:d,occurrence:p.idx},U=GE(p);return U&&(T.parameter=U),T})}r(V_,"validateDuplicateProductions");function q_(e){return`${He(e)}_#_${e.idx}_#_${GE(e)}`}r(q_,"identifyProductionForDuplicates");function GE(e){return e instanceof q?e.terminalType.name:e instanceof z?e.nonTerminalName:""}r(GE,"getExtraProductionArgument");var Mm=class extends Ve{static{r(this,"OccurrenceValidationCollector")}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 j_(e,t,o,n){let i=[];if(Ae(t,(c,l)=>l.name===e.name?c+1:c,0)>1){let c=n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:o});i.push({message:c,type:Le.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}r(j_,"validateRuleDoesNotAlreadyExist");function DE(e,t,o){let n=[],i;return ee(t,e)||(i=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${o}<-as it is not defined in any of the super grammars `,n.push({message:i,type:Le.INVALID_RULE_OVERRIDE,ruleName:e})),n}r(DE,"validateRuleIsOverridden");function Fm(e,t,o,n=[]){let i=[],s=li(t.definition);if(D(s))return[];{let c=e.name;ee(s,e)&&i.push({message:o.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:n}),type:Le.LEFT_RECURSION,ruleName:c});let p=tr(s,n.concat([e])),f=Ge(p,d=>{let T=H(n);return T.push(d),Fm(e,d,o,T)});return i.concat(f)}}r(Fm,"validateNoLeftRecursion");function li(e){let t=[];if(D(e))return t;let o=Se(e);if(o instanceof z)t.push(o.referencedRule);else if(o instanceof J||o instanceof Z||o instanceof fe||o instanceof de||o instanceof ue||o instanceof W)t=t.concat(li(o.definition));else if(o instanceof pe)t=ke(M(o.definition,s=>li(s.definition)));else if(!(o instanceof q))throw Error("non exhaustive match");let n=Fr(o),i=e.length>1;if(n&&i){let s=me(e);return t.concat(li(s))}else return t}r(li,"getFirstNoneTerminal");var vn=class extends Ve{static{r(this,"OrCollector")}constructor(){super(...arguments),this.alternations=[]}visitAlternation(t){this.alternations.push(t)}};function VE(e,t){let o=new vn;e.accept(o);let n=o.alternations;return Ge(n,s=>{let c=Ft(s.definition);return Ge(c,(l,p)=>{let f=ai([l],[],It,1);return D(f)?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:s,emptyChoiceIdx:p}),type:Le.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:s.idx,alternative:p+1}]:[]})})}r(VE,"validateEmptyOrAlternative");function qE(e,t,o){let n=new vn;e.accept(n);let i=n.alternations;return i=rr(i,c=>c.ignoreAmbiguities===!0),Ge(i,c=>{let l=c.idx,p=c.maxLookahead||t,f=_n(l,e,p,c),d=Y_(f,c,e,o),T=K_(f,c,e,o);return d.concat(T)})}r(qE,"validateAmbiguousAlternationAlternatives");var ym=class extends Ve{static{r(this,"RepetitionCollector")}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 W_(e,t){let o=new vn;e.accept(o);let n=o.alternations;return Ge(n,s=>s.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:s}),type:Le.TOO_MANY_ALTS,ruleName:e.name,occurrence:s.idx}]:[])}r(W_,"validateTooManyAlts");function jE(e,t,o){let n=[];return y(e,i=>{let s=new ym;i.accept(s);let c=s.allProductions;y(c,l=>{let p=si(l),f=l.maxLookahead||t,d=l.idx,U=In(d,i,p,f)[0];if(D(ke(U))){let k=o.buildEmptyRepetitionError({topLevelRule:i,repetition:l});n.push({message:k,type:Le.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}r(jE,"validateSomeNonEmptyLookaheadPath");function Y_(e,t,o,n){let i=[],s=Ae(e,(l,p,f)=>(t.definition[f].ignoreAmbiguities===!0||y(p,d=>{let T=[f];y(e,(U,k)=>{f!==k&&ci(U,d)&&t.definition[k].ignoreAmbiguities!==!0&&T.push(k)}),T.length>1&&!ci(i,d)&&(i.push(d),l.push({alts:T,path:d}))}),l),[]);return M(s,l=>{let p=M(l.alts,d=>d+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:o,alternation:t,ambiguityIndices:p,prefixPath:l.path}),type:Le.AMBIGUOUS_ALTS,ruleName:o.name,occurrence:t.idx,alternatives:l.alts}})}r(Y_,"checkAlternativesAmbiguities");function K_(e,t,o,n){let i=Ae(e,(c,l,p)=>{let f=M(l,d=>({idx:p,path:d}));return c.concat(f)},[]);return gt(Ge(i,c=>{if(t.definition[c.idx].ignoreAmbiguities===!0)return[];let p=c.idx,f=c.path,d=ve(i,U=>t.definition[U.idx].ignoreAmbiguities!==!0&&U.idx<p&&vE(U.path,f));return M(d,U=>{let k=[U.idx+1,p+1],C=t.idx===0?"":t.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:o,alternation:t,ambiguityIndices:k,prefixPath:U.path}),type:Le.AMBIGUOUS_PREFIX_ALTS,ruleName:o.name,occurrence:C,alternatives:k}})}))}r(K_,"checkPrefixAlternativesAmbiguities");function H_(e,t,o){let n=[],i=M(t,s=>s.name);return y(e,s=>{let c=s.name;if(ee(i,c)){let l=o.buildNamespaceConflictError(s);n.push({message:l,type:Le.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:c})}}),n}r(H_,"checkTerminalAndNoneTerminalsNameSpace");function WE(e){let t=so(e,{errMsgProvider:OE}),o={};return y(e.rules,n=>{o[n.name]=n}),NE(o,t.errMsgProvider)}r(WE,"resolveGrammar");function YE(e){return e=so(e,{errMsgProvider:pt}),PE(e.rules,e.tokenTypes,e.errMsgProvider,e.grammarName)}r(YE,"validateGrammar");var KE="MismatchedTokenException",HE="NoViableAltException",zE="EarlyExitException",JE="NotAllInputParsedException",XE=[KE,HE,zE,JE];Object.freeze(XE);function ar(e){return ee(XE,e.name)}r(ar,"isRecognitionException");var ho=class extends Error{static{r(this,"RecognitionException")}constructor(t,o){super(t),this.token=o,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},Oe=class extends ho{static{r(this,"MismatchedTokenException")}constructor(t,o,n){super(t,o),this.previousToken=n,this.name=KE}},wn=class extends ho{static{r(this,"NoViableAltException")}constructor(t,o,n){super(t,o),this.previousToken=n,this.name=HE}},Bn=class extends ho{static{r(this,"NotAllInputParsedException")}constructor(t,o){super(t,o),this.name=JE}},Pn=class extends ho{static{r(this,"EarlyExitException")}constructor(t,o,n){super(t,o),this.previousToken=n,this.name=zE}};var _m={},vm="InRuleRecoveryException",Im=class extends Error{static{r(this,"InRuleRecoveryException")}constructor(t){super(t),this.name=vm}},ui=class{static{r(this,"Recoverable")}initRecoverable(t){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=F(t,"recoveryEnabled")?t.recoveryEnabled:qe.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=z_)}getTokenToInsert(t){let o=Br(t,"",NaN,NaN,NaN,NaN,NaN,NaN);return o.isInsertedInRecovery=!0,o}canTokenTypeBeInsertedInRecovery(t){return!0}canTokenTypeBeDeletedInRecovery(t){return!0}tryInRepetitionRecovery(t,o,n,i){let s=this.findReSyncTokenType(),c=this.exportLexerState(),l=[],p=!1,f=this.LA(1),d=this.LA(1),T=r(()=>{let U=this.LA(0),k=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:f,previous:U,ruleName:this.getCurrRuleFullName()}),C=new Oe(k,f,this.LA(0));C.resyncedTokens=Ft(l),this.SAVE_ERROR(C)},"generateErrorMessage");for(;!p;)if(this.tokenMatcher(d,i)){T();return}else if(n.call(this)){T(),t.apply(this,o);return}else this.tokenMatcher(d,s)?p=!0:(d=this.SKIP_TOKEN(),this.addToResyncTokens(d,l));this.importLexerState(c)}shouldInRepetitionRecoveryBeTried(t,o,n){return!(n===!1||this.tokenMatcher(this.LA(1),t)||this.isBackTracking()||this.canPerformInRuleRecovery(t,this.getFollowsForInRuleRecovery(t,o)))}getFollowsForInRuleRecovery(t,o){let n=this.getCurrentGrammarPath(t,o);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(t,o){if(this.canRecoverWithSingleTokenInsertion(t,o))return this.getTokenToInsert(t);if(this.canRecoverWithSingleTokenDeletion(t)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new Im("sad sad panda")}canPerformInRuleRecovery(t,o){return this.canRecoverWithSingleTokenInsertion(t,o)||this.canRecoverWithSingleTokenDeletion(t)}canRecoverWithSingleTokenInsertion(t,o){if(!this.canTokenTypeBeInsertedInRecovery(t)||D(o))return!1;let n=this.LA(1);return kt(o,s=>this.tokenMatcher(n,s))!==void 0}canRecoverWithSingleTokenDeletion(t){return this.canTokenTypeBeDeletedInRecovery(t)?this.tokenMatcher(this.LA(2),t):!1}isInCurrentRuleReSyncSet(t){let o=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(o);return ee(n,t)}findReSyncTokenType(){let t=this.flattenFollowSet(),o=this.LA(1),n=2;for(;;){let i=kt(t,s=>xm(o,s));if(i!==void 0)return i;o=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return _m;let t=this.getLastExplicitRuleShortName(),o=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(t),idxInCallingRule:o,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let t=this.RULE_STACK,o=this.RULE_OCCURRENCE_STACK;return M(t,(n,i)=>i===0?_m:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:o[i],inRule:this.shortRuleNameToFullName(t[i-1])})}flattenFollowSet(){let t=M(this.buildFullFollowKeyStack(),o=>this.getFollowSetFromFollowKey(o));return ke(t)}getFollowSetFromFollowKey(t){if(t===_m)return[ut];let o=t.ruleName+t.idxInCallingRule+Ha+t.inRule;return this.resyncFollows[o]}addToResyncTokens(t,o){return this.tokenMatcher(t,ut)||o.push(t),o}reSyncTo(t){let o=[],n=this.LA(1);for(;this.tokenMatcher(n,t)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,o);return Ft(o)}attemptInRepetitionRecovery(t,o,n,i,s,c,l){}getCurrentGrammarPath(t,o){let n=this.getHumanReadableRuleStack(),i=H(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:t,lastTokOccurrence:o}}getHumanReadableRuleStack(){return M(this.RULE_STACK,t=>this.shortRuleNameToFullName(t))}};function z_(e,t,o,n,i,s,c){let l=this.getKeyForAutomaticLookahead(n,i),p=this.firstAfterRepMap[l];if(p===void 0){let U=this.getCurrRuleFullName(),k=this.getGAstProductions()[U];p=new s(k,i).startWalking(),this.firstAfterRepMap[l]=p}let f=p.token,d=p.occurrence,T=p.isEndOfRule;this.RULE_STACK.length===1&&T&&f===void 0&&(f=ut,d=1),!(f===void 0||d===void 0)&&this.shouldInRepetitionRecoveryBeTried(f,d,c)&&this.tryInRepetitionRecovery(e,t,o,f)}r(z_,"attemptInRepetitionRecovery");function pi(e,t,o){return o|t|e}r(pi,"getKeyForAutomaticLookahead");var Gn=class{static{r(this,"LLkLookaheadStrategy")}constructor(t){var o;this.maxLookahead=(o=t?.maxLookahead)!==null&&o!==void 0?o:qe.maxLookahead}validate(t){let o=this.validateNoLeftRecursion(t.rules);if(D(o)){let n=this.validateEmptyOrAlternatives(t.rules),i=this.validateAmbiguousAlternationAlternatives(t.rules,this.maxLookahead),s=this.validateSomeNonEmptyLookaheadPath(t.rules,this.maxLookahead);return[...o,...n,...i,...s]}return o}validateNoLeftRecursion(t){return Ge(t,o=>Fm(o,o,pt))}validateEmptyOrAlternatives(t){return Ge(t,o=>VE(o,pt))}validateAmbiguousAlternationAlternatives(t,o){return Ge(t,n=>qE(n,o,pt))}validateSomeNonEmptyLookaheadPath(t,o){return jE(t,o,pt)}buildLookaheadForAlternation(t){return ME(t.prodOccurrence,t.rule,t.maxLookahead,t.hasPredicates,t.dynamicTokensEnabled,FE)}buildLookaheadForOptional(t){return yE(t.prodOccurrence,t.rule,t.maxLookahead,t.dynamicTokensEnabled,si(t.prodType),_E)}};var fi=class{static{r(this,"LooksAhead")}initLooksAhead(t){this.dynamicTokensEnabled=F(t,"dynamicTokensEnabled")?t.dynamicTokensEnabled:qe.dynamicTokensEnabled,this.maxLookahead=F(t,"maxLookahead")?t.maxLookahead:qe.maxLookahead,this.lookaheadStrategy=F(t,"lookaheadStrategy")?t.lookaheadStrategy:new Gn({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(t){y(t,o=>{this.TRACE_INIT(`${o.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:s,repetitionMandatory:c,repetitionMandatoryWithSeparator:l,repetitionWithSeparator:p}=J_(o);y(n,f=>{let d=f.idx===0?"":f.idx;this.TRACE_INIT(`${He(f)}${d}`,()=>{let T=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:f.idx,rule:o,maxLookahead:f.maxLookahead||this.maxLookahead,hasPredicates:f.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),U=pi(this.fullRuleNameToShort[o.name],256,f.idx);this.setLaFuncCache(U,T)})}),y(i,f=>{this.computeLookaheadFunc(o,f.idx,768,"Repetition",f.maxLookahead,He(f))}),y(s,f=>{this.computeLookaheadFunc(o,f.idx,512,"Option",f.maxLookahead,He(f))}),y(c,f=>{this.computeLookaheadFunc(o,f.idx,1024,"RepetitionMandatory",f.maxLookahead,He(f))}),y(l,f=>{this.computeLookaheadFunc(o,f.idx,1536,"RepetitionMandatoryWithSeparator",f.maxLookahead,He(f))}),y(p,f=>{this.computeLookaheadFunc(o,f.idx,1280,"RepetitionWithSeparator",f.maxLookahead,He(f))})})})}computeLookaheadFunc(t,o,n,i,s,c){this.TRACE_INIT(`${c}${o===0?"":o}`,()=>{let l=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:o,rule:t,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),p=pi(this.fullRuleNameToShort[t.name],n,o);this.setLaFuncCache(p,l)})}getKeyForAutomaticLookahead(t,o){let n=this.getLastExplicitRuleShortName();return pi(n,t,o)}getLaFuncFromCache(t){return this.lookAheadFuncsCache.get(t)}setLaFuncCache(t,o){this.lookAheadFuncsCache.set(t,o)}},wm=class extends Ve{static{r(this,"DslMethodsCollectorVisitor")}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)}},mi=new wm;function J_(e){mi.reset(),e.accept(mi);let t=mi.dslMethods;return mi.reset(),t}r(J_,"collectMethods");function Gm(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset)}r(Gm,"setNodeLocationOnlyOffset");function Dm(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)}r(Dm,"setNodeLocationFull");function QE(e,t,o){e.children[o]===void 0?e.children[o]=[t]:e.children[o].push(t)}r(QE,"addTerminalToCst");function ZE(e,t,o){e.children[t]===void 0?e.children[t]=[o]:e.children[t].push(o)}r(ZE,"addNoneTerminalToCst");var X_="name";function Vm(e,t){Object.defineProperty(e,X_,{enumerable:!1,configurable:!0,writable:!1,value:t})}r(Vm,"defineNameProp");function Q_(e,t){let o=j(e),n=o.length;for(let i=0;i<n;i++){let s=o[i],c=e[s],l=c.length;for(let p=0;p<l;p++){let f=c[p];f.tokenTypeIdx===void 0&&this[f.name](f.children,t)}}}r(Q_,"defaultVisit");function $E(e,t){let o=r(function(){},"derivedConstructor");Vm(o,e+"BaseSemantics");let n={visit:r(function(i,s){if(b(i)&&(i=i[0]),!we(i))return this[i.name](i.children,s)},"visit"),validateVisitor:r(function(){let i=Z_(this,t);if(!D(i)){let s=M(i,c=>c.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
|
84
|
+
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(e){return"deprecated"},buildDuplicateRuleNameError(e){let t;return e.topLevelRule instanceof De?t=e.topLevelRule.name:t=e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};function bE(e,t){let o=new Om(e,t);return o.resolveRefs(),o.errors}r(bE,"resolveGrammar");var Om=class extends Ve{static{r(this,"GastRefResolverVisitor")}constructor(t,o){super(),this.nameToTopRule=t,this.errMsgProvider=o,this.errors=[]}resolveRefs(){y(Y(this.nameToTopRule),t=>{this.currTopLevel=t,t.accept(this)})}visitNonTerminal(t){let o=this.nameToTopRule[t.nonTerminalName];if(o)t.referencedRule=o;else{let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:n,type:xe.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}}};var Nm=class extends _t{static{r(this,"AbstractNextPossibleTokensWalker")}constructor(t,o){super(),this.topProd=t,this.path=o,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=H(this.path.ruleStack).reverse(),this.occurrenceStack=H(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(t,o=[]){this.found||super.walk(t,o)}walkProdRef(t,o,n){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){let i=o.concat(n);this.updateExpectedNext(),this.walk(t.referencedRule,i)}}updateExpectedNext(){D(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},ti=class extends Nm{static{r(this,"NextAfterTokenWalker")}constructor(t,o){super(t,o),this.path=o,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(t,o,n){if(this.isAtEndOfPath&&t.terminalType.name===this.nextTerminalName&&t.idx===this.nextTerminalOccurrence&&!this.found){let i=o.concat(n),s=new J({definition:i});this.possibleTokTypes=_r(s),this.found=!0}}},Eo=class extends _t{static{r(this,"AbstractNextTerminalAfterProductionWalker")}constructor(t,o){super(),this.topRule=t,this.occurrence=o,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},ri=class extends Eo{static{r(this,"NextTerminalAfterManyWalker")}walkMany(t,o,n){if(t.idx===this.occurrence){let i=Ae(o.concat(n));this.result.isEndOfRule=i===void 0,i instanceof q&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(t,o,n)}},yn=class extends Eo{static{r(this,"NextTerminalAfterManySepWalker")}walkManySep(t,o,n){if(t.idx===this.occurrence){let i=Ae(o.concat(n));this.result.isEndOfRule=i===void 0,i instanceof q&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(t,o,n)}},oi=class extends Eo{static{r(this,"NextTerminalAfterAtLeastOneWalker")}walkAtLeastOne(t,o,n){if(t.idx===this.occurrence){let i=Ae(o.concat(n));this.result.isEndOfRule=i===void 0,i instanceof q&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(t,o,n)}},Fn=class extends Eo{static{r(this,"NextTerminalAfterAtLeastOneSepWalker")}walkAtLeastOneSep(t,o,n){if(t.idx===this.occurrence){let i=Ae(o.concat(n));this.result.isEndOfRule=i===void 0,i instanceof q&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(t,o,n)}};function ni(e,t,o=[]){o=H(o);let n=[],i=0;function s(l){return l.concat(fe(e,i+1))}r(s,"remainingPathWith");function c(l){let p=ni(s(l),t,o);return n.concat(p)}for(r(c,"getAlternativesForProd");o.length<t&&i<e.length;){let l=e[i];if(l instanceof J)return c(l.definition);if(l instanceof z)return c(l.definition);if(l instanceof Z)n=c(l.definition);else if(l instanceof de){let p=l.definition.concat([new W({definition:l.definition})]);return c(p)}else if(l instanceof Te){let p=[new J({definition:l.definition}),new W({definition:[new q({terminalType:l.separator})].concat(l.definition)})];return c(p)}else if(l instanceof ue){let p=l.definition.concat([new W({definition:[new q({terminalType:l.separator})].concat(l.definition)})]);n=c(p)}else if(l instanceof W){let p=l.definition.concat([new W({definition:l.definition})]);n=c(p)}else{if(l instanceof pe)return y(l.definition,p=>{D(p.definition)===!1&&(n=c(p.definition))}),n;if(l instanceof q)o.push(l.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:o,suffixDef:fe(e,i)}),n}r(ni,"possiblePathsFrom");function ai(e,t,o,n){let i="EXIT_NONE_TERMINAL",s=[i],c="EXIT_ALTERNATIVE",l=!1,p=t.length,f=p-n-1,d=[],T=[];for(T.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!D(T);){let g=T.pop();if(g===c){l&&ct(T).idx<=f&&T.pop();continue}let k=g.def,C=g.idx,L=g.ruleStack,_=g.occurrenceStack;if(D(k))continue;let N=k[0];if(N===i){let O={idx:C,def:fe(k),ruleStack:Ft(L),occurrenceStack:Ft(_)};T.push(O)}else if(N instanceof q)if(C<p-1){let O=C+1,x=t[O];if(o(x,N.terminalType)){let v={idx:O,def:fe(k),ruleStack:L,occurrenceStack:_};T.push(v)}}else if(C===p-1)d.push({nextTokenType:N.terminalType,nextTokenOccurrence:N.idx,ruleStack:L,occurrenceStack:_}),l=!0;else throw Error("non exhaustive match");else if(N instanceof z){let O=H(L);O.push(N.nonTerminalName);let x=H(_);x.push(N.idx);let v={idx:C,def:N.definition.concat(s,fe(k)),ruleStack:O,occurrenceStack:x};T.push(v)}else if(N instanceof Z){let O={idx:C,def:fe(k),ruleStack:L,occurrenceStack:_};T.push(O),T.push(c);let x={idx:C,def:N.definition.concat(fe(k)),ruleStack:L,occurrenceStack:_};T.push(x)}else if(N instanceof de){let O=new W({definition:N.definition,idx:N.idx}),x=N.definition.concat([O],fe(k)),v={idx:C,def:x,ruleStack:L,occurrenceStack:_};T.push(v)}else if(N instanceof Te){let O=new q({terminalType:N.separator}),x=new W({definition:[O].concat(N.definition),idx:N.idx}),v=N.definition.concat([x],fe(k)),w={idx:C,def:v,ruleStack:L,occurrenceStack:_};T.push(w)}else if(N instanceof ue){let O={idx:C,def:fe(k),ruleStack:L,occurrenceStack:_};T.push(O),T.push(c);let x=new q({terminalType:N.separator}),v=new W({definition:[x].concat(N.definition),idx:N.idx}),w=N.definition.concat([v],fe(k)),Qe={idx:C,def:w,ruleStack:L,occurrenceStack:_};T.push(Qe)}else if(N instanceof W){let O={idx:C,def:fe(k),ruleStack:L,occurrenceStack:_};T.push(O),T.push(c);let x=new W({definition:N.definition,idx:N.idx}),v=N.definition.concat([x],fe(k)),w={idx:C,def:v,ruleStack:L,occurrenceStack:_};T.push(w)}else if(N instanceof pe)for(let O=N.definition.length-1;O>=0;O--){let x=N.definition[O],v={idx:C,def:x.definition.concat(fe(k)),ruleStack:L,occurrenceStack:_};T.push(v),T.push(c)}else if(N instanceof J)T.push({idx:C,def:N.definition.concat(fe(k)),ruleStack:L,occurrenceStack:_});else if(N instanceof De)T.push(D_(N,C,L,_));else throw Error("non exhaustive match")}return d}r(ai,"nextPossibleTokensAfter");function D_(e,t,o,n){let i=H(o);i.push(e.name);let s=H(n);return s.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:s}}r(D_,"expandTopLevelRule");var ce;(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"})(ce||(ce={}));function si(e){if(e instanceof Z||e==="Option")return ce.OPTION;if(e instanceof W||e==="Repetition")return ce.REPETITION;if(e instanceof de||e==="RepetitionMandatory")return ce.REPETITION_MANDATORY;if(e instanceof Te||e==="RepetitionMandatoryWithSeparator")return ce.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ue||e==="RepetitionWithSeparator")return ce.REPETITION_WITH_SEPARATOR;if(e instanceof pe||e==="Alternation")return ce.ALTERNATION;throw Error("non exhaustive match")}r(si,"getProdType");function yE(e,t,o,n,i,s){let c=_n(e,t,o),l=BE(c)?To:It;return s(c,n,l,i)}r(yE,"buildLookaheadFuncForOr");function FE(e,t,o,n,i,s){let c=In(e,t,i,o),l=BE(c)?To:It;return s(c[0],l,n)}r(FE,"buildLookaheadFuncForOptionalProd");function _E(e,t,o,n){let i=e.length,s=Oe(e,c=>Oe(c,l=>l.length===1));if(t)return function(c){let l=M(c,p=>p.GATE);for(let p=0;p<i;p++){let f=e[p],d=f.length,T=l[p];if(!(T!==void 0&&T.call(this)===!1))e:for(let g=0;g<d;g++){let k=f[g],C=k.length;for(let L=0;L<C;L++){let _=this.LA(L+1);if(o(_,k[L])===!1)continue e}return p}}};if(s&&!n){let c=M(e,p=>Re(p)),l=ge(c,(p,f,d)=>(y(f,T=>{F(p,T.tokenTypeIdx)||(p[T.tokenTypeIdx]=d),y(T.categoryMatches,g=>{F(p,g)||(p[g]=d)})}),p),{});return function(){let p=this.LA(1);return l[p.tokenTypeIdx]}}else return function(){for(let c=0;c<i;c++){let l=e[c],p=l.length;e:for(let f=0;f<p;f++){let d=l[f],T=d.length;for(let g=0;g<T;g++){let k=this.LA(g+1);if(o(k,d[g])===!1)continue e}return c}}}}r(_E,"buildAlternativesLookAheadFunc");function IE(e,t,o){let n=Oe(e,s=>s.length===1),i=e.length;if(n&&!o){let s=Re(e);if(s.length===1&&D(s[0].categoryMatches)){let l=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===l}}else{let c=ge(s,(l,p,f)=>(l[p.tokenTypeIdx]=!0,y(p.categoryMatches,d=>{l[d]=!0}),l),[]);return function(){let l=this.LA(1);return c[l.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;s<i;s++){let c=e[s],l=c.length;for(let p=0;p<l;p++){let f=this.LA(p+1);if(t(f,c[p])===!1)continue e}return!0}return!1}}r(IE,"buildSingleAlternativeLookaheadFunction");var Mm=class extends _t{static{r(this,"RestDefinitionFinderWalker")}constructor(t,o,n){super(),this.topProd=t,this.targetOccurrence=o,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(t,o,n,i){return t.idx===this.targetOccurrence&&this.targetProdType===o?(this.restDef=n.concat(i),!0):!1}walkOption(t,o,n){this.checkIsTarget(t,ce.OPTION,o,n)||super.walkOption(t,o,n)}walkAtLeastOne(t,o,n){this.checkIsTarget(t,ce.REPETITION_MANDATORY,o,n)||super.walkOption(t,o,n)}walkAtLeastOneSep(t,o,n){this.checkIsTarget(t,ce.REPETITION_MANDATORY_WITH_SEPARATOR,o,n)||super.walkOption(t,o,n)}walkMany(t,o,n){this.checkIsTarget(t,ce.REPETITION,o,n)||super.walkOption(t,o,n)}walkManySep(t,o,n){this.checkIsTarget(t,ce.REPETITION_WITH_SEPARATOR,o,n)||super.walkOption(t,o,n)}},ii=class extends Ve{static{r(this,"InsideDefinitionFinderVisitor")}constructor(t,o,n){super(),this.targetOccurrence=t,this.targetProdType=o,this.targetRef=n,this.result=[]}checkIsTarget(t,o){t.idx===this.targetOccurrence&&this.targetProdType===o&&(this.targetRef===void 0||t===this.targetRef)&&(this.result=t.definition)}visitOption(t){this.checkIsTarget(t,ce.OPTION)}visitRepetition(t){this.checkIsTarget(t,ce.REPETITION)}visitRepetitionMandatory(t){this.checkIsTarget(t,ce.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(t){this.checkIsTarget(t,ce.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(t){this.checkIsTarget(t,ce.REPETITION_WITH_SEPARATOR)}visitAlternation(t){this.checkIsTarget(t,ce.ALTERNATION)}};function ME(e){let t=new Array(e);for(let o=0;o<e;o++)t[o]=[];return t}r(ME,"initializeArrayOfArrays");function bm(e){let t=[""];for(let o=0;o<e.length;o++){let n=e[o],i=[];for(let s=0;s<t.length;s++){let c=t[s];i.push(c+"_"+n.tokenTypeIdx);for(let l=0;l<n.categoryMatches.length;l++){let p="_"+n.categoryMatches[l];i.push(c+p)}}t=i}return t}r(bm,"pathToHashKeys");function V_(e,t,o){for(let n=0;n<e.length;n++){if(n===o)continue;let i=e[n];for(let s=0;s<t.length;s++){let c=t[s];if(i[c]===!0)return!1}}return!0}r(V_,"isUniquePrefixHash");function vE(e,t){let o=M(e,c=>ni([c],1)),n=ME(o.length),i=M(o,c=>{let l={};return y(c,p=>{let f=bm(p.partialPath);y(f,d=>{l[d]=!0})}),l}),s=o;for(let c=1;c<=t;c++){let l=s;s=ME(l.length);for(let p=0;p<l.length;p++){let f=l[p];for(let d=0;d<f.length;d++){let T=f[d].partialPath,g=f[d].suffixDef,k=bm(T);if(V_(i,k,p)||D(g)||T.length===t){let L=n[p];if(ci(L,T)===!1){L.push(T);for(let _=0;_<k.length;_++){let N=k[_];i[p][N]=!0}}}else{let L=ni(g,c+1,T);s[p]=s[p].concat(L),y(L,_=>{let N=bm(_.partialPath);y(N,O=>{i[p][O]=!0})})}}}}return n}r(vE,"lookAheadSequenceFromAlternatives");function _n(e,t,o,n){let i=new ii(e,ce.ALTERNATION,n);return t.accept(i),vE(i.result,o)}r(_n,"getLookaheadPathsForOr");function In(e,t,o,n){let i=new ii(e,o);t.accept(i);let s=i.result,l=new Mm(t,e,o).startWalking(),p=new J({definition:s}),f=new J({definition:l});return vE([p,f],n)}r(In,"getLookaheadPathsForOptionalProd");function ci(e,t){e:for(let o=0;o<e.length;o++){let n=e[o];if(n.length===t.length){for(let i=0;i<n.length;i++){let s=t[i],c=n[i];if((s===c||c.categoryMatchesMap[s.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}r(ci,"containsPath");function wE(e,t){return e.length<t.length&&Oe(e,(o,n)=>{let i=t[n];return o===i||i.categoryMatchesMap[o.tokenTypeIdx]})}r(wE,"isStrictPrefixOfPath");function BE(e){return Oe(e,t=>Oe(t,o=>Oe(o,n=>D(n.categoryMatches))))}r(BE,"areTokenCategoriesNotUsed");function PE(e){let t=e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName});return M(t,o=>Object.assign({type:xe.CUSTOM_LOOKAHEAD_VALIDATION},o))}r(PE,"validateLookahead");function GE(e,t,o,n){let i=Ge(e,p=>q_(p,o)),s=z_(e,t,o),c=Ge(e,p=>Y_(p,o)),l=Ge(e,p=>W_(p,e,n,o));return i.concat(s,c,l)}r(GE,"validateGrammar");function q_(e,t){let o=new ym;e.accept(o);let n=o.allProductions,i=um(n,j_),s=Ke(i,l=>l.length>1);return M(Y(s),l=>{let p=Ae(l),f=t.buildDuplicateFoundError(e,l),d=He(p),T={message:f,type:xe.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:d,occurrence:p.idx},g=DE(p);return g&&(T.parameter=g),T})}r(q_,"validateDuplicateProductions");function j_(e){return`${He(e)}_#_${e.idx}_#_${DE(e)}`}r(j_,"identifyProductionForDuplicates");function DE(e){return e instanceof q?e.terminalType.name:e instanceof z?e.nonTerminalName:""}r(DE,"getExtraProductionArgument");var ym=class extends Ve{static{r(this,"OccurrenceValidationCollector")}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 W_(e,t,o,n){let i=[];if(ge(t,(c,l)=>l.name===e.name?c+1:c,0)>1){let c=n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:o});i.push({message:c,type:xe.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}r(W_,"validateRuleDoesNotAlreadyExist");function VE(e,t,o){let n=[],i;return ee(t,e)||(i=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${o}<-as it is not defined in any of the super grammars `,n.push({message:i,type:xe.INVALID_RULE_OVERRIDE,ruleName:e})),n}r(VE,"validateRuleIsOverridden");function _m(e,t,o,n=[]){let i=[],s=li(t.definition);if(D(s))return[];{let c=e.name;ee(s,e)&&i.push({message:o.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:n}),type:xe.LEFT_RECURSION,ruleName:c});let p=tr(s,n.concat([e])),f=Ge(p,d=>{let T=H(n);return T.push(d),_m(e,d,o,T)});return i.concat(f)}}r(_m,"validateNoLeftRecursion");function li(e){let t=[];if(D(e))return t;let o=Ae(e);if(o instanceof z)t.push(o.referencedRule);else if(o instanceof J||o instanceof Z||o instanceof de||o instanceof Te||o instanceof ue||o instanceof W)t=t.concat(li(o.definition));else if(o instanceof pe)t=Re(M(o.definition,s=>li(s.definition)));else if(!(o instanceof q))throw Error("non exhaustive match");let n=Fr(o),i=e.length>1;if(n&&i){let s=fe(e);return t.concat(li(s))}else return t}r(li,"getFirstNoneTerminal");var vn=class extends Ve{static{r(this,"OrCollector")}constructor(){super(...arguments),this.alternations=[]}visitAlternation(t){this.alternations.push(t)}};function qE(e,t){let o=new vn;e.accept(o);let n=o.alternations;return Ge(n,s=>{let c=Ft(s.definition);return Ge(c,(l,p)=>{let f=ai([l],[],It,1);return D(f)?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:s,emptyChoiceIdx:p}),type:xe.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:s.idx,alternative:p+1}]:[]})})}r(qE,"validateEmptyOrAlternative");function jE(e,t,o){let n=new vn;e.accept(n);let i=n.alternations;return i=rr(i,c=>c.ignoreAmbiguities===!0),Ge(i,c=>{let l=c.idx,p=c.maxLookahead||t,f=_n(l,e,p,c),d=K_(f,c,e,o),T=H_(f,c,e,o);return d.concat(T)})}r(jE,"validateAmbiguousAlternationAlternatives");var Fm=class extends Ve{static{r(this,"RepetitionCollector")}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 Y_(e,t){let o=new vn;e.accept(o);let n=o.alternations;return Ge(n,s=>s.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:s}),type:xe.TOO_MANY_ALTS,ruleName:e.name,occurrence:s.idx}]:[])}r(Y_,"validateTooManyAlts");function WE(e,t,o){let n=[];return y(e,i=>{let s=new Fm;i.accept(s);let c=s.allProductions;y(c,l=>{let p=si(l),f=l.maxLookahead||t,d=l.idx,g=In(d,i,p,f)[0];if(D(Re(g))){let k=o.buildEmptyRepetitionError({topLevelRule:i,repetition:l});n.push({message:k,type:xe.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}r(WE,"validateSomeNonEmptyLookaheadPath");function K_(e,t,o,n){let i=[],s=ge(e,(l,p,f)=>(t.definition[f].ignoreAmbiguities===!0||y(p,d=>{let T=[f];y(e,(g,k)=>{f!==k&&ci(g,d)&&t.definition[k].ignoreAmbiguities!==!0&&T.push(k)}),T.length>1&&!ci(i,d)&&(i.push(d),l.push({alts:T,path:d}))}),l),[]);return M(s,l=>{let p=M(l.alts,d=>d+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:o,alternation:t,ambiguityIndices:p,prefixPath:l.path}),type:xe.AMBIGUOUS_ALTS,ruleName:o.name,occurrence:t.idx,alternatives:l.alts}})}r(K_,"checkAlternativesAmbiguities");function H_(e,t,o,n){let i=ge(e,(c,l,p)=>{let f=M(l,d=>({idx:p,path:d}));return c.concat(f)},[]);return Ut(Ge(i,c=>{if(t.definition[c.idx].ignoreAmbiguities===!0)return[];let p=c.idx,f=c.path,d=ve(i,g=>t.definition[g.idx].ignoreAmbiguities!==!0&&g.idx<p&&wE(g.path,f));return M(d,g=>{let k=[g.idx+1,p+1],C=t.idx===0?"":t.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:o,alternation:t,ambiguityIndices:k,prefixPath:g.path}),type:xe.AMBIGUOUS_PREFIX_ALTS,ruleName:o.name,occurrence:C,alternatives:k}})}))}r(H_,"checkPrefixAlternativesAmbiguities");function z_(e,t,o){let n=[],i=M(t,s=>s.name);return y(e,s=>{let c=s.name;if(ee(i,c)){let l=o.buildNamespaceConflictError(s);n.push({message:l,type:xe.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:c})}}),n}r(z_,"checkTerminalAndNoneTerminalsNameSpace");function YE(e){let t=so(e,{errMsgProvider:NE}),o={};return y(e.rules,n=>{o[n.name]=n}),bE(o,t.errMsgProvider)}r(YE,"resolveGrammar");function KE(e){return e=so(e,{errMsgProvider:pt}),GE(e.rules,e.tokenTypes,e.errMsgProvider,e.grammarName)}r(KE,"validateGrammar");var HE="MismatchedTokenException",zE="NoViableAltException",JE="EarlyExitException",XE="NotAllInputParsedException",QE=[HE,zE,JE,XE];Object.freeze(QE);function ar(e){return ee(QE,e.name)}r(ar,"isRecognitionException");var ho=class extends Error{static{r(this,"RecognitionException")}constructor(t,o){super(t),this.token=o,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},me=class extends ho{static{r(this,"MismatchedTokenException")}constructor(t,o,n){super(t,o),this.previousToken=n,this.name=HE}},wn=class extends ho{static{r(this,"NoViableAltException")}constructor(t,o,n){super(t,o),this.previousToken=n,this.name=zE}},Bn=class extends ho{static{r(this,"NotAllInputParsedException")}constructor(t,o){super(t,o),this.name=XE}},Pn=class extends ho{static{r(this,"EarlyExitException")}constructor(t,o,n){super(t,o),this.previousToken=n,this.name=JE}};var Im={},wm="InRuleRecoveryException",vm=class extends Error{static{r(this,"InRuleRecoveryException")}constructor(t){super(t),this.name=wm}},ui=class{static{r(this,"Recoverable")}initRecoverable(t){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=F(t,"recoveryEnabled")?t.recoveryEnabled:qe.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=J_)}getTokenToInsert(t){let o=Br(t,"",NaN,NaN,NaN,NaN,NaN,NaN);return o.isInsertedInRecovery=!0,o}canTokenTypeBeInsertedInRecovery(t){return!0}canTokenTypeBeDeletedInRecovery(t){return!0}tryInRepetitionRecovery(t,o,n,i){let s=this.findReSyncTokenType(),c=this.exportLexerState(),l=[],p=!1,f=this.LA(1),d=this.LA(1),T=r(()=>{let g=this.LA(0),k=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:f,previous:g,ruleName:this.getCurrRuleFullName()}),C=new me(k,f,this.LA(0));C.resyncedTokens=Ft(l),this.SAVE_ERROR(C)},"generateErrorMessage");for(;!p;)if(this.tokenMatcher(d,i)){T();return}else if(n.call(this)){T(),t.apply(this,o);return}else this.tokenMatcher(d,s)?p=!0:(d=this.SKIP_TOKEN(),this.addToResyncTokens(d,l));this.importLexerState(c)}shouldInRepetitionRecoveryBeTried(t,o,n){return!(n===!1||this.tokenMatcher(this.LA(1),t)||this.isBackTracking()||this.canPerformInRuleRecovery(t,this.getFollowsForInRuleRecovery(t,o)))}getFollowsForInRuleRecovery(t,o){let n=this.getCurrentGrammarPath(t,o);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(t,o){if(this.canRecoverWithSingleTokenInsertion(t,o))return this.getTokenToInsert(t);if(this.canRecoverWithSingleTokenDeletion(t)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new vm("sad sad panda")}canPerformInRuleRecovery(t,o){return this.canRecoverWithSingleTokenInsertion(t,o)||this.canRecoverWithSingleTokenDeletion(t)}canRecoverWithSingleTokenInsertion(t,o){if(!this.canTokenTypeBeInsertedInRecovery(t)||D(o))return!1;let n=this.LA(1);return kt(o,s=>this.tokenMatcher(n,s))!==void 0}canRecoverWithSingleTokenDeletion(t){return this.canTokenTypeBeDeletedInRecovery(t)?this.tokenMatcher(this.LA(2),t):!1}isInCurrentRuleReSyncSet(t){let o=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(o);return ee(n,t)}findReSyncTokenType(){let t=this.flattenFollowSet(),o=this.LA(1),n=2;for(;;){let i=kt(t,s=>Cm(o,s));if(i!==void 0)return i;o=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Im;let t=this.getLastExplicitRuleShortName(),o=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(t),idxInCallingRule:o,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let t=this.RULE_STACK,o=this.RULE_OCCURRENCE_STACK;return M(t,(n,i)=>i===0?Im:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:o[i],inRule:this.shortRuleNameToFullName(t[i-1])})}flattenFollowSet(){let t=M(this.buildFullFollowKeyStack(),o=>this.getFollowSetFromFollowKey(o));return Re(t)}getFollowSetFromFollowKey(t){if(t===Im)return[ut];let o=t.ruleName+t.idxInCallingRule+Ha+t.inRule;return this.resyncFollows[o]}addToResyncTokens(t,o){return this.tokenMatcher(t,ut)||o.push(t),o}reSyncTo(t){let o=[],n=this.LA(1);for(;this.tokenMatcher(n,t)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,o);return Ft(o)}attemptInRepetitionRecovery(t,o,n,i,s,c,l){}getCurrentGrammarPath(t,o){let n=this.getHumanReadableRuleStack(),i=H(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:t,lastTokOccurrence:o}}getHumanReadableRuleStack(){return M(this.RULE_STACK,t=>this.shortRuleNameToFullName(t))}};function J_(e,t,o,n,i,s,c){let l=this.getKeyForAutomaticLookahead(n,i),p=this.firstAfterRepMap[l];if(p===void 0){let g=this.getCurrRuleFullName(),k=this.getGAstProductions()[g];p=new s(k,i).startWalking(),this.firstAfterRepMap[l]=p}let f=p.token,d=p.occurrence,T=p.isEndOfRule;this.RULE_STACK.length===1&&T&&f===void 0&&(f=ut,d=1),!(f===void 0||d===void 0)&&this.shouldInRepetitionRecoveryBeTried(f,d,c)&&this.tryInRepetitionRecovery(e,t,o,f)}r(J_,"attemptInRepetitionRecovery");function pi(e,t,o){return o|t|e}r(pi,"getKeyForAutomaticLookahead");var Gn=class{static{r(this,"LLkLookaheadStrategy")}constructor(t){var o;this.maxLookahead=(o=t?.maxLookahead)!==null&&o!==void 0?o:qe.maxLookahead}validate(t){let o=this.validateNoLeftRecursion(t.rules);if(D(o)){let n=this.validateEmptyOrAlternatives(t.rules),i=this.validateAmbiguousAlternationAlternatives(t.rules,this.maxLookahead),s=this.validateSomeNonEmptyLookaheadPath(t.rules,this.maxLookahead);return[...o,...n,...i,...s]}return o}validateNoLeftRecursion(t){return Ge(t,o=>_m(o,o,pt))}validateEmptyOrAlternatives(t){return Ge(t,o=>qE(o,pt))}validateAmbiguousAlternationAlternatives(t,o){return Ge(t,n=>jE(n,o,pt))}validateSomeNonEmptyLookaheadPath(t,o){return WE(t,o,pt)}buildLookaheadForAlternation(t){return yE(t.prodOccurrence,t.rule,t.maxLookahead,t.hasPredicates,t.dynamicTokensEnabled,_E)}buildLookaheadForOptional(t){return FE(t.prodOccurrence,t.rule,t.maxLookahead,t.dynamicTokensEnabled,si(t.prodType),IE)}};var fi=class{static{r(this,"LooksAhead")}initLooksAhead(t){this.dynamicTokensEnabled=F(t,"dynamicTokensEnabled")?t.dynamicTokensEnabled:qe.dynamicTokensEnabled,this.maxLookahead=F(t,"maxLookahead")?t.maxLookahead:qe.maxLookahead,this.lookaheadStrategy=F(t,"lookaheadStrategy")?t.lookaheadStrategy:new Gn({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(t){y(t,o=>{this.TRACE_INIT(`${o.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:s,repetitionMandatory:c,repetitionMandatoryWithSeparator:l,repetitionWithSeparator:p}=X_(o);y(n,f=>{let d=f.idx===0?"":f.idx;this.TRACE_INIT(`${He(f)}${d}`,()=>{let T=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:f.idx,rule:o,maxLookahead:f.maxLookahead||this.maxLookahead,hasPredicates:f.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),g=pi(this.fullRuleNameToShort[o.name],256,f.idx);this.setLaFuncCache(g,T)})}),y(i,f=>{this.computeLookaheadFunc(o,f.idx,768,"Repetition",f.maxLookahead,He(f))}),y(s,f=>{this.computeLookaheadFunc(o,f.idx,512,"Option",f.maxLookahead,He(f))}),y(c,f=>{this.computeLookaheadFunc(o,f.idx,1024,"RepetitionMandatory",f.maxLookahead,He(f))}),y(l,f=>{this.computeLookaheadFunc(o,f.idx,1536,"RepetitionMandatoryWithSeparator",f.maxLookahead,He(f))}),y(p,f=>{this.computeLookaheadFunc(o,f.idx,1280,"RepetitionWithSeparator",f.maxLookahead,He(f))})})})}computeLookaheadFunc(t,o,n,i,s,c){this.TRACE_INIT(`${c}${o===0?"":o}`,()=>{let l=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:o,rule:t,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),p=pi(this.fullRuleNameToShort[t.name],n,o);this.setLaFuncCache(p,l)})}getKeyForAutomaticLookahead(t,o){let n=this.getLastExplicitRuleShortName();return pi(n,t,o)}getLaFuncFromCache(t){return this.lookAheadFuncsCache.get(t)}setLaFuncCache(t,o){this.lookAheadFuncsCache.set(t,o)}},Bm=class extends Ve{static{r(this,"DslMethodsCollectorVisitor")}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)}},mi=new Bm;function X_(e){mi.reset(),e.accept(mi);let t=mi.dslMethods;return mi.reset(),t}r(X_,"collectMethods");function Dm(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset)}r(Dm,"setNodeLocationOnlyOffset");function Vm(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)}r(Vm,"setNodeLocationFull");function ZE(e,t,o){e.children[o]===void 0?e.children[o]=[t]:e.children[o].push(t)}r(ZE,"addTerminalToCst");function $E(e,t,o){e.children[t]===void 0?e.children[t]=[o]:e.children[t].push(o)}r($E,"addNoneTerminalToCst");var Q_="name";function qm(e,t){Object.defineProperty(e,Q_,{enumerable:!1,configurable:!0,writable:!1,value:t})}r(qm,"defineNameProp");function Z_(e,t){let o=j(e),n=o.length;for(let i=0;i<n;i++){let s=o[i],c=e[s],l=c.length;for(let p=0;p<l;p++){let f=c[p];f.tokenTypeIdx===void 0&&this[f.name](f.children,t)}}}r(Z_,"defaultVisit");function eh(e,t){let o=r(function(){},"derivedConstructor");qm(o,e+"BaseSemantics");let n={visit:r(function(i,s){if(b(i)&&(i=i[0]),!we(i))return this[i.name](i.children,s)},"visit"),validateVisitor:r(function(){let i=$_(this,t);if(!D(i)){let s=M(i,c=>c.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
|
85
85
|
${s.join(`
|
|
86
86
|
|
|
87
87
|
`).replace(/\n/g,`
|
|
88
|
-
`)}`)}},"validateVisitor")};return o.prototype=n,o.prototype.constructor=o,o._RULE_NAMES=t,o}r($E,"createBaseSemanticVisitorConstructor");function eh(e,t,o){let n=r(function(){},"derivedConstructor");Vm(n,e+"BaseSemanticsWithDefaults");let i=Object.create(o.prototype);return y(t,s=>{i[s]=Q_}),n.prototype=i,n.prototype.constructor=n,n}r(eh,"createBaseVisitorConstructorWithDefaults");var qm;(function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"})(qm||(qm={}));function Z_(e,t){return $_(e,t)}r(Z_,"validateVisitor");function $_(e,t){let o=ve(t,i=>Pe(e[i])===!1),n=M(o,i=>({msg:`Missing visitor method: <${i}> on ${e.constructor.name} CST Visitor.`,type:qm.MISSING_METHOD,methodName:i}));return gt(n)}r($_,"validateMissingCstMethods");var hi=class{static{r(this,"TreeBuilder")}initTreeBuilder(t){if(this.CST_STACK=[],this.outputCst=t.outputCst,this.nodeLocationTracking=F(t,"nodeLocationTracking")?t.nodeLocationTracking:qe.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ie,this.cstFinallyStateUpdate=ie,this.cstPostTerminal=ie,this.cstPostNonTerminal=ie,this.cstPostRule=ie;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Dm,this.setNodeLocationFromNode=Dm,this.cstPostRule=ie,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ie,this.setNodeLocationFromNode=ie,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Gm,this.setNodeLocationFromNode=Gm,this.cstPostRule=ie,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ie,this.setNodeLocationFromNode=ie,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ie,this.setNodeLocationFromNode=ie,this.cstPostRule=ie,this.setInitialNodeLocation=ie;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 o=this.LA(1);t.location={startOffset:o.startOffset,startLine:o.startLine,startColumn:o.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(t){let o={name:t,children:Object.create(null)};this.setInitialNodeLocation(o),this.CST_STACK.push(o)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(t){let o=this.LA(0),n=t.location;n.startOffset<=o.startOffset?(n.endOffset=o.endOffset,n.endLine=o.endLine,n.endColumn=o.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(t){let o=this.LA(0),n=t.location;n.startOffset<=o.startOffset?n.endOffset=o.endOffset:n.startOffset=NaN}cstPostTerminal(t,o){let n=this.CST_STACK[this.CST_STACK.length-1];QE(n,o,t),this.setNodeLocationFromToken(n.location,o)}cstPostNonTerminal(t,o){let n=this.CST_STACK[this.CST_STACK.length-1];ZE(n,o,t),this.setNodeLocationFromNode(n.location,t.location)}getBaseCstVisitorConstructor(){if(we(this.baseCstVisitorConstructor)){let t=$E(this.className,j(this.gastProductionsCache));return this.baseCstVisitorConstructor=t,t}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(we(this.baseCstVisitorWithDefaultsConstructor)){let t=eh(this.className,j(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 Si=class{static{r(this,"LexerAdapter")}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)):So}LA(t){let o=this.currIdx+t;return o<0||this.tokVectorLength<=o?So:this.tokVector[o]}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 Ai=class{static{r(this,"RecognizerApi")}ACTION(t){return t.call(this)}consume(t,o,n){return this.consumeInternal(o,t,n)}subrule(t,o,n){return this.subruleInternal(o,t,n)}option(t,o){return this.optionInternal(o,t)}or(t,o){return this.orInternal(o,t)}many(t,o){return this.manyInternal(t,o)}atLeastOne(t,o){return this.atLeastOneInternal(t,o)}CONSUME(t,o){return this.consumeInternal(t,0,o)}CONSUME1(t,o){return this.consumeInternal(t,1,o)}CONSUME2(t,o){return this.consumeInternal(t,2,o)}CONSUME3(t,o){return this.consumeInternal(t,3,o)}CONSUME4(t,o){return this.consumeInternal(t,4,o)}CONSUME5(t,o){return this.consumeInternal(t,5,o)}CONSUME6(t,o){return this.consumeInternal(t,6,o)}CONSUME7(t,o){return this.consumeInternal(t,7,o)}CONSUME8(t,o){return this.consumeInternal(t,8,o)}CONSUME9(t,o){return this.consumeInternal(t,9,o)}SUBRULE(t,o){return this.subruleInternal(t,0,o)}SUBRULE1(t,o){return this.subruleInternal(t,1,o)}SUBRULE2(t,o){return this.subruleInternal(t,2,o)}SUBRULE3(t,o){return this.subruleInternal(t,3,o)}SUBRULE4(t,o){return this.subruleInternal(t,4,o)}SUBRULE5(t,o){return this.subruleInternal(t,5,o)}SUBRULE6(t,o){return this.subruleInternal(t,6,o)}SUBRULE7(t,o){return this.subruleInternal(t,7,o)}SUBRULE8(t,o){return this.subruleInternal(t,8,o)}SUBRULE9(t,o){return this.subruleInternal(t,9,o)}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,o,n=Ao){if(ee(this.definedRulesNames,t)){let c={message:pt.buildDuplicateRuleNameError({topLevelRule:t,grammarName:this.className}),type:Le.DUPLICATE_RULE_NAME,ruleName:t};this.definitionErrors.push(c)}this.definedRulesNames.push(t);let i=this.defineRule(t,o,n);return this[t]=i,i}OVERRIDE_RULE(t,o,n=Ao){let i=DE(t,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let s=this.defineRule(t,o,n);return this[t]=s,s}BACKTRACK(t,o){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return t.apply(this,o),!0}catch(i){if(ar(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Ka(Y(this.gastProductionsCache))}};var Ui=class{static{r(this,"RecognizerEngine")}initRecognizerEngine(t,o){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=To,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},F(o,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
88
|
+
`)}`)}},"validateVisitor")};return o.prototype=n,o.prototype.constructor=o,o._RULE_NAMES=t,o}r(eh,"createBaseSemanticVisitorConstructor");function th(e,t,o){let n=r(function(){},"derivedConstructor");qm(n,e+"BaseSemanticsWithDefaults");let i=Object.create(o.prototype);return y(t,s=>{i[s]=Z_}),n.prototype=i,n.prototype.constructor=n,n}r(th,"createBaseVisitorConstructorWithDefaults");var jm;(function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"})(jm||(jm={}));function $_(e,t){return eI(e,t)}r($_,"validateVisitor");function eI(e,t){let o=ve(t,i=>Pe(e[i])===!1),n=M(o,i=>({msg:`Missing visitor method: <${i}> on ${e.constructor.name} CST Visitor.`,type:jm.MISSING_METHOD,methodName:i}));return Ut(n)}r(eI,"validateMissingCstMethods");var hi=class{static{r(this,"TreeBuilder")}initTreeBuilder(t){if(this.CST_STACK=[],this.outputCst=t.outputCst,this.nodeLocationTracking=F(t,"nodeLocationTracking")?t.nodeLocationTracking:qe.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ie,this.cstFinallyStateUpdate=ie,this.cstPostTerminal=ie,this.cstPostNonTerminal=ie,this.cstPostRule=ie;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Vm,this.setNodeLocationFromNode=Vm,this.cstPostRule=ie,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ie,this.setNodeLocationFromNode=ie,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Dm,this.setNodeLocationFromNode=Dm,this.cstPostRule=ie,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ie,this.setNodeLocationFromNode=ie,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ie,this.setNodeLocationFromNode=ie,this.cstPostRule=ie,this.setInitialNodeLocation=ie;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 o=this.LA(1);t.location={startOffset:o.startOffset,startLine:o.startLine,startColumn:o.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(t){let o={name:t,children:Object.create(null)};this.setInitialNodeLocation(o),this.CST_STACK.push(o)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(t){let o=this.LA(0),n=t.location;n.startOffset<=o.startOffset?(n.endOffset=o.endOffset,n.endLine=o.endLine,n.endColumn=o.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(t){let o=this.LA(0),n=t.location;n.startOffset<=o.startOffset?n.endOffset=o.endOffset:n.startOffset=NaN}cstPostTerminal(t,o){let n=this.CST_STACK[this.CST_STACK.length-1];ZE(n,o,t),this.setNodeLocationFromToken(n.location,o)}cstPostNonTerminal(t,o){let n=this.CST_STACK[this.CST_STACK.length-1];$E(n,o,t),this.setNodeLocationFromNode(n.location,t.location)}getBaseCstVisitorConstructor(){if(we(this.baseCstVisitorConstructor)){let t=eh(this.className,j(this.gastProductionsCache));return this.baseCstVisitorConstructor=t,t}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(we(this.baseCstVisitorWithDefaultsConstructor)){let t=th(this.className,j(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 Si=class{static{r(this,"LexerAdapter")}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)):So}LA(t){let o=this.currIdx+t;return o<0||this.tokVectorLength<=o?So:this.tokVector[o]}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 Ai=class{static{r(this,"RecognizerApi")}ACTION(t){return t.call(this)}consume(t,o,n){return this.consumeInternal(o,t,n)}subrule(t,o,n){return this.subruleInternal(o,t,n)}option(t,o){return this.optionInternal(o,t)}or(t,o){return this.orInternal(o,t)}many(t,o){return this.manyInternal(t,o)}atLeastOne(t,o){return this.atLeastOneInternal(t,o)}CONSUME(t,o){return this.consumeInternal(t,0,o)}CONSUME1(t,o){return this.consumeInternal(t,1,o)}CONSUME2(t,o){return this.consumeInternal(t,2,o)}CONSUME3(t,o){return this.consumeInternal(t,3,o)}CONSUME4(t,o){return this.consumeInternal(t,4,o)}CONSUME5(t,o){return this.consumeInternal(t,5,o)}CONSUME6(t,o){return this.consumeInternal(t,6,o)}CONSUME7(t,o){return this.consumeInternal(t,7,o)}CONSUME8(t,o){return this.consumeInternal(t,8,o)}CONSUME9(t,o){return this.consumeInternal(t,9,o)}SUBRULE(t,o){return this.subruleInternal(t,0,o)}SUBRULE1(t,o){return this.subruleInternal(t,1,o)}SUBRULE2(t,o){return this.subruleInternal(t,2,o)}SUBRULE3(t,o){return this.subruleInternal(t,3,o)}SUBRULE4(t,o){return this.subruleInternal(t,4,o)}SUBRULE5(t,o){return this.subruleInternal(t,5,o)}SUBRULE6(t,o){return this.subruleInternal(t,6,o)}SUBRULE7(t,o){return this.subruleInternal(t,7,o)}SUBRULE8(t,o){return this.subruleInternal(t,8,o)}SUBRULE9(t,o){return this.subruleInternal(t,9,o)}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,o,n=Ao){if(ee(this.definedRulesNames,t)){let c={message:pt.buildDuplicateRuleNameError({topLevelRule:t,grammarName:this.className}),type:xe.DUPLICATE_RULE_NAME,ruleName:t};this.definitionErrors.push(c)}this.definedRulesNames.push(t);let i=this.defineRule(t,o,n);return this[t]=i,i}OVERRIDE_RULE(t,o,n=Ao){let i=VE(t,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let s=this.defineRule(t,o,n);return this[t]=s,s}BACKTRACK(t,o){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return t.apply(this,o),!0}catch(i){if(ar(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Ka(Y(this.gastProductionsCache))}};var gi=class{static{r(this,"RecognizerEngine")}initRecognizerEngine(t,o){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=To,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},F(o,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
89
89
|
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
90
90
|
For Further details.`);if(b(t)){if(D(t))throw Error(`A Token Vocabulary cannot be empty.
|
|
91
91
|
Note that the first argument for the parser constructor
|
|
92
92
|
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.
|
|
93
93
|
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
94
|
-
For Further details.`)}if(b(t))this.tokensMap=
|
|
95
|
-
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=F(n,"resyncEnabled")?n.resyncEnabled:Ao.resyncEnabled,s=F(n,"recoveryValueFunc")?n.recoveryValueFunc:Ao.recoveryValueFunc,c=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[c]=t,this.fullRuleNameToShort[t]=c;let l;return this.outputCst===!0?l=r(function(...d){try{this.ruleInvocationStateUpdate(c,t,this.subruleIdx),o.apply(this,d);let T=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(T),T}catch(T){return this.invokeRuleCatch(T,i,s)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTry"):l=r(function(...d){try{return this.ruleInvocationStateUpdate(c,t,this.subruleIdx),o.apply(this,d)}catch(T){return this.invokeRuleCatch(T,i,s)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTryCst"),Object.assign(l,{ruleName:t,originalGrammarAction:o})}invokeRuleCatch(t,o,n){let i=this.RULE_STACK.length===1,s=o&&!this.isBackTracking()&&this.recoveryEnabled;if(ar(t)){let c=t;if(s){let l=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(l))if(c.resyncedTokens=this.reSyncTo(l),this.outputCst){let p=this.CST_STACK[this.CST_STACK.length-1];return p.recoveredNode=!0,p}else return n(t);else{if(this.outputCst){let p=this.CST_STACK[this.CST_STACK.length-1];p.recoveredNode=!0,c.partialCstResult=p}throw c}}else{if(i)return this.moveToTerminatedState(),n(t);throw c}}else throw t}optionInternal(t,o){let n=this.getKeyForAutomaticLookahead(512,o);return this.optionInternalLogic(t,o,n)}optionInternalLogic(t,o,n){let i=this.getLaFuncFromCache(n),s;if(typeof t!="function"){s=t.DEF;let c=t.GATE;if(c!==void 0){let l=i;i=r(()=>c.call(this)&&l.call(this),"lookAheadFunc")}}else s=t;if(i.call(this)===!0)return s.call(this)}atLeastOneInternal(t,o){let n=this.getKeyForAutomaticLookahead(1024,t);return this.atLeastOneInternalLogic(t,o,n)}atLeastOneInternalLogic(t,o,n){let i=this.getLaFuncFromCache(n),s;if(typeof o!="function"){s=o.DEF;let c=o.GATE;if(c!==void 0){let l=i;i=r(()=>c.call(this)&&l.call(this),"lookAheadFunc")}}else s=o;if(i.call(this)===!0){let c=this.doSingleRepetition(s);for(;i.call(this)===!0&&c===!0;)c=this.doSingleRepetition(s)}else throw this.raiseEarlyExitException(t,ce.REPETITION_MANDATORY,o.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[t,o],i,1024,t,oi)}atLeastOneSepFirstInternal(t,o){let n=this.getKeyForAutomaticLookahead(1536,t);this.atLeastOneSepFirstInternalLogic(t,o,n)}atLeastOneSepFirstInternalLogic(t,o,n){let i=o.DEF,s=o.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let l=r(()=>this.tokenMatcher(this.LA(1),s),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,s,l,i,Fn],l,1536,t,Fn)}else throw this.raiseEarlyExitException(t,ce.REPETITION_MANDATORY_WITH_SEPARATOR,o.ERR_MSG)}manyInternal(t,o){let n=this.getKeyForAutomaticLookahead(768,t);return this.manyInternalLogic(t,o,n)}manyInternalLogic(t,o,n){let i=this.getLaFuncFromCache(n),s;if(typeof o!="function"){s=o.DEF;let l=o.GATE;if(l!==void 0){let p=i;i=r(()=>l.call(this)&&p.call(this),"lookaheadFunction")}}else s=o;let c=!0;for(;i.call(this)===!0&&c===!0;)c=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[t,o],i,768,t,ri,c)}manySepFirstInternal(t,o){let n=this.getKeyForAutomaticLookahead(1280,t);this.manySepFirstInternalLogic(t,o,n)}manySepFirstInternalLogic(t,o,n){let i=o.DEF,s=o.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let l=r(()=>this.tokenMatcher(this.LA(1),s),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,s,l,i,yn],l,1280,t,yn)}}repetitionSepSecondInternal(t,o,n,i,s){for(;n();)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,o,n,i,s],n,1536,t,s)}doSingleRepetition(t){let o=this.getLexerPosition();return t.call(this),this.getLexerPosition()>o}orInternal(t,o){let n=this.getKeyForAutomaticLookahead(256,o),i=b(t)?t:t.DEF,c=this.getLaFuncFromCache(n).call(this,i);if(c!==void 0)return i[c].ALT.call(this);this.raiseNoAltException(o,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),o=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:t,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Bn(o,t))}}subruleInternal(t,o,n){let i;try{let s=n!==void 0?n.ARGS:void 0;return this.subruleIdx=o,i=t.apply(this,s),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:t.ruleName),i}catch(s){throw this.subruleInternalError(s,n,t.ruleName)}}subruleInternalError(t,o,n){throw ar(t)&&t.partialCstResult!==void 0&&(this.cstPostNonTerminal(t.partialCstResult,o!==void 0&&o.LABEL!==void 0?o.LABEL:n),delete t.partialCstResult),t}consumeInternal(t,o,n){let i;try{let s=this.LA(1);this.tokenMatcher(s,t)===!0?(this.consumeToken(),i=s):this.consumeInternalError(t,s,n)}catch(s){i=this.consumeInternalRecovery(t,o,s)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:t.name,i),i}consumeInternalError(t,o,n){let i,s=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:t,actual:o,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new
|
|
96
|
-
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(
|
|
94
|
+
For Further details.`)}if(b(t))this.tokensMap=ge(t,(s,c)=>(s[c.name]=c,s),{});else if(F(t,"modes")&&Oe(Re(Y(t.modes)),AE)){let s=Re(Y(t.modes)),c=or(s);this.tokensMap=ge(c,(l,p)=>(l[p.name]=p,l),{})}else if(ae(t))this.tokensMap=H(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=ut;let n=F(t,"modes")?Re(Y(t.modes)):Y(t),i=Oe(n,s=>D(s.categoryMatches));this.tokenMatcher=i?To:It,vt(Y(this.tokensMap))}defineRule(t,o,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${t}> may not be defined after the 'performSelfAnalysis' method has been called'
|
|
95
|
+
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=F(n,"resyncEnabled")?n.resyncEnabled:Ao.resyncEnabled,s=F(n,"recoveryValueFunc")?n.recoveryValueFunc:Ao.recoveryValueFunc,c=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[c]=t,this.fullRuleNameToShort[t]=c;let l;return this.outputCst===!0?l=r(function(...d){try{this.ruleInvocationStateUpdate(c,t,this.subruleIdx),o.apply(this,d);let T=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(T),T}catch(T){return this.invokeRuleCatch(T,i,s)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTry"):l=r(function(...d){try{return this.ruleInvocationStateUpdate(c,t,this.subruleIdx),o.apply(this,d)}catch(T){return this.invokeRuleCatch(T,i,s)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTryCst"),Object.assign(l,{ruleName:t,originalGrammarAction:o})}invokeRuleCatch(t,o,n){let i=this.RULE_STACK.length===1,s=o&&!this.isBackTracking()&&this.recoveryEnabled;if(ar(t)){let c=t;if(s){let l=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(l))if(c.resyncedTokens=this.reSyncTo(l),this.outputCst){let p=this.CST_STACK[this.CST_STACK.length-1];return p.recoveredNode=!0,p}else return n(t);else{if(this.outputCst){let p=this.CST_STACK[this.CST_STACK.length-1];p.recoveredNode=!0,c.partialCstResult=p}throw c}}else{if(i)return this.moveToTerminatedState(),n(t);throw c}}else throw t}optionInternal(t,o){let n=this.getKeyForAutomaticLookahead(512,o);return this.optionInternalLogic(t,o,n)}optionInternalLogic(t,o,n){let i=this.getLaFuncFromCache(n),s;if(typeof t!="function"){s=t.DEF;let c=t.GATE;if(c!==void 0){let l=i;i=r(()=>c.call(this)&&l.call(this),"lookAheadFunc")}}else s=t;if(i.call(this)===!0)return s.call(this)}atLeastOneInternal(t,o){let n=this.getKeyForAutomaticLookahead(1024,t);return this.atLeastOneInternalLogic(t,o,n)}atLeastOneInternalLogic(t,o,n){let i=this.getLaFuncFromCache(n),s;if(typeof o!="function"){s=o.DEF;let c=o.GATE;if(c!==void 0){let l=i;i=r(()=>c.call(this)&&l.call(this),"lookAheadFunc")}}else s=o;if(i.call(this)===!0){let c=this.doSingleRepetition(s);for(;i.call(this)===!0&&c===!0;)c=this.doSingleRepetition(s)}else throw this.raiseEarlyExitException(t,ce.REPETITION_MANDATORY,o.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[t,o],i,1024,t,oi)}atLeastOneSepFirstInternal(t,o){let n=this.getKeyForAutomaticLookahead(1536,t);this.atLeastOneSepFirstInternalLogic(t,o,n)}atLeastOneSepFirstInternalLogic(t,o,n){let i=o.DEF,s=o.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let l=r(()=>this.tokenMatcher(this.LA(1),s),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,s,l,i,Fn],l,1536,t,Fn)}else throw this.raiseEarlyExitException(t,ce.REPETITION_MANDATORY_WITH_SEPARATOR,o.ERR_MSG)}manyInternal(t,o){let n=this.getKeyForAutomaticLookahead(768,t);return this.manyInternalLogic(t,o,n)}manyInternalLogic(t,o,n){let i=this.getLaFuncFromCache(n),s;if(typeof o!="function"){s=o.DEF;let l=o.GATE;if(l!==void 0){let p=i;i=r(()=>l.call(this)&&p.call(this),"lookaheadFunction")}}else s=o;let c=!0;for(;i.call(this)===!0&&c===!0;)c=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[t,o],i,768,t,ri,c)}manySepFirstInternal(t,o){let n=this.getKeyForAutomaticLookahead(1280,t);this.manySepFirstInternalLogic(t,o,n)}manySepFirstInternalLogic(t,o,n){let i=o.DEF,s=o.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let l=r(()=>this.tokenMatcher(this.LA(1),s),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,s,l,i,yn],l,1280,t,yn)}}repetitionSepSecondInternal(t,o,n,i,s){for(;n();)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,o,n,i,s],n,1536,t,s)}doSingleRepetition(t){let o=this.getLexerPosition();return t.call(this),this.getLexerPosition()>o}orInternal(t,o){let n=this.getKeyForAutomaticLookahead(256,o),i=b(t)?t:t.DEF,c=this.getLaFuncFromCache(n).call(this,i);if(c!==void 0)return i[c].ALT.call(this);this.raiseNoAltException(o,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),o=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:t,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Bn(o,t))}}subruleInternal(t,o,n){let i;try{let s=n!==void 0?n.ARGS:void 0;return this.subruleIdx=o,i=t.apply(this,s),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:t.ruleName),i}catch(s){throw this.subruleInternalError(s,n,t.ruleName)}}subruleInternalError(t,o,n){throw ar(t)&&t.partialCstResult!==void 0&&(this.cstPostNonTerminal(t.partialCstResult,o!==void 0&&o.LABEL!==void 0?o.LABEL:n),delete t.partialCstResult),t}consumeInternal(t,o,n){let i;try{let s=this.LA(1);this.tokenMatcher(s,t)===!0?(this.consumeToken(),i=s):this.consumeInternalError(t,s,n)}catch(s){i=this.consumeInternalRecovery(t,o,s)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:t.name,i),i}consumeInternalError(t,o,n){let i,s=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:t,actual:o,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new me(i,o,s))}consumeInternalRecovery(t,o,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){let i=this.getFollowsForInRuleRecovery(t,o);try{return this.tryInRuleRecovery(t,i)}catch(s){throw s.name===wm?n:s}}else throw n}saveRecogState(){let t=this.errors,o=H(this.RULE_STACK);return{errors:t,lexerState:this.exportLexerState(),RULE_STACK:o,CST_STACK:this.CST_STACK}}reloadRecogState(t){this.errors=t.errors,this.importLexerState(t.lexerState),this.RULE_STACK=t.RULE_STACK}ruleInvocationStateUpdate(t,o,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(t),this.cstInvocationStateUpdate(o)}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),ut)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}};var Ui=class{static{r(this,"ErrorHandler")}initErrorHandler(t){this._errors=[],this.errorMessageProvider=F(t,"errorMessageProvider")?t.errorMessageProvider:qe.errorMessageProvider}SAVE_ERROR(t){if(ar(t))return t.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:H(this.RULE_OCCURRENCE_STACK)},this._errors.push(t),t;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return H(this._errors)}set errors(t){this._errors=t}raiseEarlyExitException(t,o,n){let i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],l=In(t,s,o,this.maxLookahead)[0],p=[];for(let d=1;d<=this.maxLookahead;d++)p.push(this.LA(d));let f=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:l,actual:p,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new Pn(f,this.LA(1),this.LA(0)))}raiseNoAltException(t,o){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],s=_n(t,i,this.maxLookahead),c=[];for(let f=1;f<=this.maxLookahead;f++)c.push(this.LA(f));let l=this.LA(0),p=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:c,previous:l,customUserDescription:o,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new wn(p,this.LA(1),l))}};var ki=class{static{r(this,"ContentAssist")}initContentAssist(){}computeContentAssist(t,o){let n=this.gastProductionsCache[t];if(we(n))throw Error(`Rule ->${t}<- does not exist in this grammar.`);return ai([n],o,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(t){let o=Ae(t.ruleStack),i=this.getGAstProductions()[o];return new ti(i,t).startWalking()}};var xi={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(xi);var rh=!0,oh=Math.pow(2,8)-1,ah=wt({name:"RECORDING_PHASE_TOKEN",pattern:se.NA});vt([ah]);var ih=Br(ah,`This IToken indicates the Parser is in Recording Phase
|
|
96
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(ih);var rI={name:`This CSTNode indicates the Parser is in Recording Phase
|
|
97
97
|
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Ri=class{static{r(this,"GastRecorder")}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 o=t>0?t:"";this[`CONSUME${o}`]=function(n,i){return this.consumeInternalRecord(n,t,i)},this[`SUBRULE${o}`]=function(n,i){return this.subruleInternalRecord(n,t,i)},this[`OPTION${o}`]=function(n){return this.optionInternalRecord(n,t)},this[`OR${o}`]=function(n){return this.orInternalRecord(n,t)},this[`MANY${o}`]=function(n){this.manyInternalRecord(t,n)},this[`MANY_SEP${o}`]=function(n){this.manySepFirstInternalRecord(t,n)},this[`AT_LEAST_ONE${o}`]=function(n){this.atLeastOneInternalRecord(t,n)},this[`AT_LEAST_ONE_SEP${o}`]=function(n){this.atLeastOneSepFirstInternalRecord(t,n)}}this.consume=function(t,o,n){return this.consumeInternalRecord(o,t,n)},this.subrule=function(t,o,n){return this.subruleInternalRecord(o,t,n)},this.option=function(t,o){return this.optionInternalRecord(o,t)},this.or=function(t,o){return this.orInternalRecord(o,t)},this.many=function(t,o){this.manyInternalRecord(t,o)},this.atLeastOne=function(t,o){this.atLeastOneInternalRecord(t,o)},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 o=0;o<10;o++){let n=o>0?o:"";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,o){return()=>!0}LA_RECORD(t){return So}topLevelRuleRecord(t,o){try{let n=new De({definition:[],name:t});return n.name=t,this.recordingProdStack.push(n),o.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
|
|
98
98
|
This error was thrown during the "grammar recording phase" For more info see:
|
|
99
|
-
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(t,o){return Vn.call(this,Z,t,o)}atLeastOneInternalRecord(t,o){Vn.call(this,
|
|
100
|
-
inside top level rule: <${this.recordingProdStack[0].name}>`);throw l.KNOWN_RECORDER_ERROR=!0,l}let i=ct(this.recordingProdStack),s=t.ruleName,c=new z({idx:o,nonTerminalName:s,label:n?.LABEL,referencedRule:void 0});return i.definition.push(c),this.outputCst?
|
|
101
|
-
inside top level rule: <${this.recordingProdStack[0].name}>`);throw c.KNOWN_RECORDER_ERROR=!0,c}let i=ct(this.recordingProdStack),s=new q({idx:o,terminalType:t,label:n?.LABEL});return i.definition.push(s),
|
|
102
|
-
Idx value must be a none negative value smaller than ${
|
|
99
|
+
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(t,o){return Vn.call(this,Z,t,o)}atLeastOneInternalRecord(t,o){Vn.call(this,de,o,t)}atLeastOneSepFirstInternalRecord(t,o){Vn.call(this,Te,o,t,rh)}manyInternalRecord(t,o){Vn.call(this,W,o,t)}manySepFirstInternalRecord(t,o){Vn.call(this,ue,o,t,rh)}orInternalRecord(t,o){return oI.call(this,t,o)}subruleInternalRecord(t,o,n){if(Li(o),!t||F(t,"ruleName")===!1){let l=new Error(`<SUBRULE${nh(o)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(t)}>
|
|
100
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw l.KNOWN_RECORDER_ERROR=!0,l}let i=ct(this.recordingProdStack),s=t.ruleName,c=new z({idx:o,nonTerminalName:s,label:n?.LABEL,referencedRule:void 0});return i.definition.push(c),this.outputCst?rI:xi}consumeInternalRecord(t,o,n){if(Li(o),!Rm(t)){let c=new Error(`<CONSUME${nh(o)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(t)}>
|
|
101
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw c.KNOWN_RECORDER_ERROR=!0,c}let i=ct(this.recordingProdStack),s=new q({idx:o,terminalType:t,label:n?.LABEL});return i.definition.push(s),ih}};function Vn(e,t,o,n=!1){Li(o);let i=ct(this.recordingProdStack),s=Pe(t)?t:t.DEF,c=new e({definition:[],idx:o});return n&&(c.separator=t.SEP),F(t,"MAX_LOOKAHEAD")&&(c.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(c),s.call(this),i.definition.push(c),this.recordingProdStack.pop(),xi}r(Vn,"recordProd");function oI(e,t){Li(t);let o=ct(this.recordingProdStack),n=b(e)===!1,i=n===!1?e:e.DEF,s=new pe({definition:[],idx:t,ignoreAmbiguities:n&&e.IGNORE_AMBIGUITIES===!0});F(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD);let c=lt(i,l=>Pe(l.GATE));return s.hasPredicates=c,o.definition.push(s),y(i,l=>{let p=new J({definition:[]});s.definition.push(p),F(l,"IGNORE_AMBIGUITIES")?p.ignoreAmbiguities=l.IGNORE_AMBIGUITIES:F(l,"GATE")&&(p.ignoreAmbiguities=!0),this.recordingProdStack.push(p),l.ALT.call(this),this.recordingProdStack.pop()}),xi}r(oI,"recordOrProd");function nh(e){return e===0?"":`${e}`}r(nh,"getIdxSuffix");function Li(e){if(e<0||e>oh){let t=new Error(`Invalid DSL Method idx value: <${e}>
|
|
102
|
+
Idx value must be a none negative value smaller than ${oh+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}r(Li,"assertMethodIdxIsValid");var Ci=class{static{r(this,"PerformanceTracer")}initPerformanceTracer(t){if(F(t,"traceInitPerf")){let o=t.traceInitPerf,n=typeof o=="number";this.traceInitMaxIdent=n?o:1/0,this.traceInitPerf=n?o>0:o}else this.traceInitMaxIdent=0,this.traceInitPerf=qe.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(t,o){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${t}>`);let{time:i,value:s}=Rn(o),c=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&c(`${n}<-- <${t}> time: ${i}ms`),this.traceInitIndent--,s}else return o()}};function sh(e,t){t.forEach(o=>{let n=o.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;let s=Object.getOwnPropertyDescriptor(n,i);s&&(s.get||s.set)?Object.defineProperty(e.prototype,i,s):e.prototype[i]=o.prototype[i]})})}r(sh,"applyMixins");var So=Br(ut,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(So);var qe=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Bt,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Ao=Object.freeze({recoveryValueFunc:r(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),xe;(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"})(xe||(xe={}));var qn=class e{static{r(this,"Parser")}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 o=this.className;this.TRACE_INIT("toFastProps",()=>{Ln(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),y(this.definedRulesNames,i=>{let c=this[i].originalGrammarAction,l;this.TRACE_INIT(`${i} Rule`,()=>{l=this.topLevelRuleRecord(i,c)}),this.gastProductionsCache[i]=l})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=YE({rules:Y(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(D(n)&&this.skipValidations===!1){let i=KE({rules:Y(this.gastProductionsCache),tokenTypes:Y(this.tokensMap),errMsgProvider:pt,grammarName:o}),s=PE({lookaheadStrategy:this.lookaheadStrategy,rules:Y(this.gastProductionsCache),tokenTypes:Y(this.tokensMap),grammarName:o});this.definitionErrors=this.definitionErrors.concat(i,s)}}),D(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{let i=$T(Y(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,s;(s=(i=this.lookaheadStrategy).initialize)===null||s===void 0||s.call(i,{rules:Y(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Y(this.gastProductionsCache))})),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!D(this.definitionErrors))throw t=M(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
|
|
103
103
|
${t.join(`
|
|
104
104
|
-------------------------------
|
|
105
105
|
`)}`)})}constructor(t,o){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(o),n.initLexerAdapter(),n.initLooksAhead(o),n.initRecognizerEngine(t,o),n.initRecoverable(o),n.initTreeBuilder(o),n.initContentAssist(),n.initGastRecorder(o),n.initPerformanceTracer(o),F(o,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|
106
106
|
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
107
107
|
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
108
|
-
For further details.`);this.skipValidations=F(o,"skipValidations")?o.skipValidations:qe.skipValidations}};qn.DEFER_DEFINITION_ERRORS_HANDLING=!1;
|
|
109
|
-
`||n==="\r")return e.slice(t).match(/.*(?=\n|$)/);if(n!==" "&&n!==" ")return null;o--}return e.slice(t).match(/.*(?=\n|$)/)},"exec")},line_breaks:!1}),Dh=[$];function Vh(e){switch(e){case $.name:return"comment";default:return}}r(Vh,"mapTokenToType");var cc=R({name:"ExpressionLiteral",label:"`...`",pattern:/`([^`\\]|\\.)*`/}),E=R({name:"StringLiteral",label:'"..."',pattern:/"([^"\\]|\\.)*"/}),Lt=R({name:"SingleQuotedStringLiteral",pattern:/'([^'\\]|\\.)*'/,label:"''"}),_e=R({name:"FloatLiteral",label:"floating point number",pattern:/-?\d+\.\d+([eE][+-]?\d+)?/}),X=R({name:"IntegerLiteral",label:"integer",pattern:/-?\d+/,longer_alt:_e}),s4=R({name:"DoubleDollar",label:"$$",pattern:/\$\$/}),lc=R({name:"TimestampLiteral",pattern:/\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])\s([01]\d|2[0-3]):([0-5]\d):([0-5]\d)[+-]\d{4}/}),qh=[lc,cc,E,Lt,_e,X];function jh(e){switch(e){case cc.name:return"macro";case E.name:case lc.name:return"doubleString";case Lt.name:return"singleString";case X.name:case _e.name:return"number";default:return null}}r(jh,"mapTokenToType");var uc=u("conditional",{longer_alt:a,categories:[a]}),Oo=u("if",{longer_alt:a,categories:[a]}),pc=u("else",{longer_alt:a,categories:[a]}),mc=u("elseif",{longer_alt:a,categories:[a]}),fc=u("for",{longer_alt:a,categories:[a]}),dc=u("foreach",{longer_alt:a,categories:[a]}),Tc=u("remove",{longer_alt:a,categories:[a]}),Ec=u("await",{longer_alt:a,categories:[a]}),mt=u("each",{longer_alt:a,categories:[a]}),hc=u("try_catch",{longer_alt:a,categories:[a]}),Wn=u("try",{longer_alt:a,categories:[a]}),Yn=u("catch",{longer_alt:a,categories:[a]}),Sc=u("finally",{longer_alt:a,categories:[a]}),at=u("as",{longer_alt:a,categories:[a]}),Ac=u("return",{longer_alt:a,categories:[a]}),Uc=u("switch",{longer_alt:a,categories:[a]}),gc=u("case",{longer_alt:a,categories:[a]}),kc=u("default",{longer_alt:a,categories:[a]}),Rc=u("while",{longer_alt:a,categories:[a]}),Lc=u("group",{longer_alt:a,categories:[a]}),xc=u("throw",{longer_alt:a,categories:[a]}),No=u("break",{longer_alt:a,categories:[a]}),Cc=u("continue",{longer_alt:a,categories:[a]}),Kn=R({name:"GreaterThan",pattern:/>/,label:">"}),Hn=R({name:"GreaterThanOrEqual",pattern:/>=/,label:">="}),zn=R({name:"SmallerThan",pattern:/</,label:"<"}),Jn=R({name:"SmallerThanOrEq",pattern:/<=/,label:"<="}),Oc=R({name:"Minus",pattern:/-/,label:"-",longer_alt:X}),Nc=R({name:"Plus",pattern:/\+/,label:"+"}),bc=R({name:"Multiply",pattern:/\*/,label:"*"}),Mc=R({name:"Divide",pattern:/\//,label:"/"}),yc=R({name:"Modulus",pattern:/%/,label:"%"}),Xn=R({name:"IsEqual",label:"==",pattern:/==/}),Fc=R({name:"IsStrictEqual",label:"===",pattern:/===/}),Qn=R({name:"IsNotEqual",label:"!=",pattern:/!=/}),_c=R({name:"IsStrictNotEqual",label:"!==",pattern:/!==/}),h=R({name:"EqualToken",label:"=",pattern:/=/}),S=R({name:"LCurly",pattern:/{/,label:"{"}),A=R({name:"RCurly",pattern:/}/,label:"}"}),re=R({name:"LSquare",pattern:/\[/,label:"["}),oe=R({name:"RSquare",pattern:/]/,label:"]"}),B=R({name:"LParent",pattern:/\(/,label:"("}),P=R({name:"RParent",pattern:/\)/,label:")"}),et=R({name:"Question",pattern:/\?/,label:"?"}),be=R({name:"ColonToken",pattern:/:/,label:":"}),Me=R({name:"PipeToken",pattern:/\|/,label:"|"}),je=R({name:"CommaToken",pattern:/,/,label:","}),Ic=R({name:"AndTestToken",pattern:/&&/,label:"&&"}),vc=R({name:"NullishCoalescingToken",pattern:/\?\?/,label:"??"}),wc=R({name:"OrTestToken",pattern:/\|\|/,label:"||"}),Zn=R({name:"JsonBetweenToken",pattern:/between/,label:"between",longer_alt:a,categories:[a]}),$n=R({name:"JsonContainsToken",pattern:/@>/,label:"@>"}),ea=R({name:"JsonContainsStringToken",pattern:/contains/,label:"contains",longer_alt:a,categories:[a]}),Km=R({name:"JsonEqualToken",pattern:/=/,label:"="}),ta=R({name:"JsonILikeToken",pattern:/ilike/,label:"ilike",longer_alt:a,categories:[a]}),ra=R({name:"JsonIncludesToken",pattern:/includes/,label:"includes",longer_alt:a,categories:[a]}),oa=R({name:"JsonLikeToken",pattern:/like/,label:"like",longer_alt:a,categories:[a]}),na=R({name:"JsonNotBetweenToken",pattern:/not between/,label:"not between"}),aa=R({name:"JsonNotContainsToken",pattern:/not contains/,label:"not contains"}),ia=R({name:"JsonNotILikeToken",pattern:/not ilike/,label:"not ilike"}),sa=R({name:"JsonNotInToken",pattern:/not in/,label:"not in"}),ca=R({name:"JsonNotIncludesToken",pattern:/not includes/,label:"not includes"}),la=R({name:"JsonNotLikeToken",pattern:/not like/,label:"not like"}),ua=R({name:"JsonNotOverlapsToken",pattern:/not overlaps/,label:"not overlaps"}),pa=R({name:"JsonNotRegexToken",pattern:/!~/,label:"!~"}),ma=R({name:"JsonOverlapsToken",pattern:/overlaps/,label:"overlaps",longer_alt:a,categories:[a]}),Bc=R({name:"JsonRegexToken",pattern:/~/,label:"~"}),Pc=R({name:"JsonSearchToken",pattern:/search/,label:"search",longer_alt:a,categories:[a]}),Wh=[na,aa,ia,ca,sa,Zn,$n,ea,ta,ra,oa,la,ua,pa,ma,Bc,Pc,vc,Ic,wc,uc,Oo,mc,pc,dc,fc,mt,Tc,Ec,at,Ac,Uc,gc,kc,Rc,Lc,xc,No,Cc,Hn,Kn,Jn,zn,Oc,Nc,bc,Mc,yc,Fc,Xn,_c,Qn,h,S,A,re,oe,B,P,et,be,Me,je,hc,Wn,Yn,Sc,Km];function Yh(e){switch(e){case Oo.name:case pc.name:case mc.name:case mt.name:case at.name:case Wn.name:case Yn.name:case Sc.name:return"keyword";case uc.name:case Ec.name:case Ac.name:case Lc.name:case xc.name:case No.name:case Cc.name:case fc.name:case Uc.name:case Tc.name:case dc.name:case Rc.name:case gc.name:case kc.name:case hc.name:return"function";case S.name:return"operator.openingCurly";case A.name:return"operator.closingCurly";case re.name:return"operator.openingSquare";case oe.name:return"operator.closingSquare";case B.name:return"operator.openingParenthesis";case P.name:return"operator.closingParenthesis";case Kn.name:case Hn.name:case zn.name:case Jn.name:case Oc.name:case Nc.name:case Ic.name:case wc.name:case bc.name:case Mc.name:case yc.name:case h.name:case Xn.name:case Qn.name:case vc.name:case na.name:case aa.name:case ia.name:case ca.name:case sa.name:case Zn.name:case $n.name:case ea.name:case ta.name:case ra.name:case oa.name:case la.name:case ua.name:case pa.name:case ma.name:case Bc.name:return"operator";case Pc.name:return"variable";case et.name:case be.name:case Me.name:case je.name:return"punctuation";default:return null}}r(Yh,"mapTokenToType");var bo=u("db",{longer_alt:a,categories:[a]}),Gc=u("query",{longer_alt:a,categories:[a]}),Dc=u("get",{longer_alt:a,categories:[a]}),Mo=u("add",{longer_alt:a,categories:[a]}),Vc=u("add_or_edit",{longer_alt:a,categories:[a]}),qc=u("del",{longer_alt:a,categories:[a]}),jc=u("delete",{longer_alt:a,categories:[a]}),Wc=u("edit",{longer_alt:a,categories:[a]}),Yc=u("update",{longer_alt:a,categories:[a]}),Kc=u("has",{longer_alt:a,categories:[a]}),yo=u("patch",{longer_alt:a,categories:[a]}),Hc=u("schema",{longer_alt:a,categories:[a]}),zc=u("transaction",{longer_alt:a,categories:[a]}),Jc=u("truncate",{longer_alt:a,categories:[a]}),Fo=u("direct_query",{longer_alt:a,categories:[a]}),Xc=u("set_datasource",{longer_alt:a,categories:[a]}),Qc=u("bulk",{longer_alt:a,categories:[a]}),Zc=u("external",{longer_alt:a,categories:[a]}),$c=u("mssql",{longer_alt:a,categories:[a]}),el=u("mysql",{longer_alt:a,categories:[a]}),tl=u("postgres",{longer_alt:a,categories:[a]}),rl=u("oracle",{longer_alt:a,categories:[a]}),Kh=[bo,Gc,Dc,Vc,Mo,jc,qc,Wc,Yc,Kc,yo,Hc,zc,Jc,Fo,Xc,Qc,Zc,$c,el,tl,rl];function Hh(e){switch(e){case Hc.name:return"keyword";case bo.name:case Qc.name:case Zc.name:case $c.name:case el.name:case tl.name:case rl.name:case Gc.name:case Dc.name:case Mo.name:case Vc.name:case jc.name:case qc.name:case Wc.name:case Yc.name:case Kc.name:case yo.name:case zc.name:case Jc.name:case Fo.name:case Xc.name:return"function";default:return null}}r(Hh,"mapTokenToType");var ol=u("debug",{longer_alt:a,categories:[a]}),nl=u("stop",{longer_alt:a,categories:[a]}),al=u("log",{longer_alt:a,categories:[a]}),zh=[ol,nl,al];function Jh(e){switch(e){case ol.name:case nl.name:case al.name:return"function";default:return null}}r(Jh,"mapTokenToType");var _o=u("expect",{longer_alt:a,categories:[a]}),Io=u("to_be_true",{longer_alt:a,categories:[a]}),vo=u("to_be_false",{longer_alt:a,categories:[a]}),wo=u("to_be_in_the_past",{longer_alt:a,categories:[a]}),Bo=u("to_be_in_the_future",{longer_alt:a,categories:[a]}),Po=u("to_be_defined",{longer_alt:a,categories:[a]}),Go=u("to_not_be_defined",{longer_alt:a,categories:[a]}),Do=u("to_be_null",{longer_alt:a,categories:[a]}),Vo=u("to_not_be_null",{longer_alt:a,categories:[a]}),qo=u("to_be_empty",{longer_alt:a,categories:[a]}),jo=u("to_start_with",{longer_alt:a,categories:[a]}),Wo=u("to_end_with",{longer_alt:a,categories:[a]}),Yo=u("to_be_greater_than",{longer_alt:a,categories:[a]}),Ko=u("to_be_less_than",{longer_alt:a,categories:[a]}),Ho=u("to_match",{longer_alt:a,categories:[a]}),zo=u("to_equal",{longer_alt:a,categories:[a]}),Jo=u("to_not_equal",{longer_alt:a,categories:[a]}),Xo=u("to_contain",{longer_alt:a,categories:[a]}),Qo=u("to_be_within",{longer_alt:a,categories:[a]}),Zo=u("to_throw",{longer_alt:a,categories:[a]}),Xh=[_o,Io,vo,wo,Bo,Po,Go,Do,Vo,qo,jo,Wo,Yo,Ko,Ho,zo,Jo,Xo,Qo,Zo];function Qh(e){switch(e){case _o.name:case Io.name:case vo.name:case wo.name:case Bo.name:case Po.name:case Go.name:case Do.name:case Vo.name:case qo.name:case jo.name:case Wo.name:case Yo.name:case Ko.name:case Ho.name:case zo.name:case Jo.name:case Xo.name:case Qo.name:case Zo.name:return"function";default:return null}}r(Qh,"mapTokenToType");var sr=u("function",{longer_alt:a,categories:[a]}),il=u("run",{longer_alt:a,categories:[a]}),sl=u("call",{longer_alt:a,categories:[a]}),Zh=[sr,il,sl];function $h(e){switch(e){case sr.name:return"keyword";case il.name:case sl.name:return"function";default:return null}}r($h,"mapTokenToType");var cl=u("math",{longer_alt:a,categories:[a]}),ll=u("add",{longer_alt:a,categories:[a]}),ul=u("div",{longer_alt:a,categories:[a]}),pl=u("mod",{longer_alt:a,categories:[a]}),ml=u("mul",{longer_alt:a,categories:[a]}),fl=u("sub",{longer_alt:a,categories:[a]}),dl=u("bitwise",{longer_alt:a,categories:[a]}),Tl=u("and",{longer_alt:a,categories:[a]}),El=u("or",{longer_alt:a,categories:[a]}),hl=u("xor",{longer_alt:a,categories:[a]}),eS=[cl,ll,ul,pl,ml,fl,dl,Tl,El,hl];function tS(e){switch(e){case cl.name:case ll.name:case ul.name:case pl.name:case ml.name:case fl.name:case dl.name:case Tl.name:case El.name:case hl.name:return"function";default:return null}}r(tS,"mapTokenToType");var Sl=u("instructions",{longer_alt:a,categories:[a]}),cr=u("tool",{longer_alt:a,categories:[a]}),rS=u("call",{longer_alt:a,categories:[a]}),oS=[Sl,cr,rS];function nS(e){switch(e){case cr.name:return"keyword";case Sl.name:return"variable";case rS.name:return"function";default:return null}}r(nS,"mapTokenToType");var Al=u("active",{longer_alt:a,categories:[a]}),Ul=u("instructions",{longer_alt:a,categories:[a]}),gl=u("mcp_server",{longer_alt:a,categories:[a]}),kl=u("tools",{longer_alt:cr,categories:[a]}),aS=[Al,Ul,gl,kl];function iS(e){switch(e){case Al.name:case gl.name:case kl.name:return"keyword";case Ul.name:return"variable";default:return null}}r(iS,"mapTokenToType");var Rl=u("actions",{longer_alt:a,categories:[a]}),Ll=u("active",{longer_alt:a,categories:[a]}),xl=u("mcp_server_trigger",{longer_alt:a,categories:[a]}),sS=[Rl,Ll,xl];function cS(e){switch(e){case Rl.name:case xl.name:return"keyword";case Ll.name:return"variable";default:return null}}r(cS,"mapTokenToType");var Cl=u("exception_policy",{longer_alt:a,categories:[a]}),$o=u("middleware",{longer_alt:a,categories:[a]}),Ol=u("response_strategy",{longer_alt:a,categories:[a]}),lS=[Cl,$o,Ol];function uS(e){switch(e){case $o.name:return"keyword";case Cl.name:case Ol.name:return"variable";default:return null}}r(uS,"mapTokenToType");var ze=wt({name:'"""..."""',pattern:/("""\r?\n(?:[\s\S]*?\r?\n)?[ ]*""")|('''\r?\n(?:[\s\S]*?\r?\n)?[ ]*''')/}),Nl=wt({name:"MultiLineExpression",pattern:/```\r?\n(?:[\s\S]*?\r?\n)?[ ]*```/}),pS=[ze,Nl];function mS(e){switch(e){case ze.name:return"tripleString";case Nl.name:return"tripleMacro";default:return null}}r(mS,"mapTokenToType");var bl=u("object",{longer_alt:a,categories:[a]}),Ml=u("entries",{longer_alt:a,categories:[a]}),yl=u("keys",{longer_alt:a,categories:[a]}),Fl=u("values",{longer_alt:a,categories:[a]}),fS=[bl,Ml,yl,Fl];function dS(e){switch(e){case bl.name:case Ml.name:case yl.name:case Fl.name:return"function";default:return null}}r(dS,"mapTokenToType");var _l=u("query",{longer_alt:a,categories:[a]}),en=u("verb",{longer_alt:a,categories:[a]}),tn=u("GET",{longer_alt:a,categories:[a]}),rn=u("PATCH",{longer_alt:a,categories:[a]}),on=u("POST",{longer_alt:a,categories:[a]}),nn=u("PUT",{longer_alt:a,categories:[a]}),an=u("DELETE",{categories:[a],longer_alt:a}),Il=u("response_type",{longer_alt:a,categories:[a]}),TS=u("dblink",{longer_alt:a,categories:[a]}),vl=u("output",{longer_alt:a,categories:[a]}),ES=u("addon",{longer_alt:a,categories:[a]}),hS=[Il,_l,en,tn,rn,on,nn,an,TS,vl,ES];function SS(e){switch(e){case _l.name:case en.name:case Il.name:return"keyword";case tn.name:case rn.name:case on.name:case nn.name:case an.name:return"enumMember";case TS.name:case vl.name:case ES.name:return"property";default:return null}}r(SS,"mapTokenToType");var wl=u("actions",{longer_alt:a,categories:[a]}),Bl=u("active",{longer_alt:a,categories:[a]}),Pl=u("realtime_trigger",{longer_alt:a,categories:[a]}),Gl=u("realtime_channel",{longer_alt:a,categories:[a]}),AS=[wl,Bl,Pl,Gl];function US(e){switch(e){case wl.name:case Pl.name:case Gl.name:return"keyword";case Bl.name:return"variable";default:return null}}r(US,"mapTokenToType");var Dl=u("redis",{longer_alt:a,categories:[a]}),Vl=u("count",{longer_alt:a,categories:[a]}),ql=u("decr",{longer_alt:a,categories:[a]}),jl=u("del",{longer_alt:a,categories:[a]}),Wl=u("get",{longer_alt:a,categories:[a]}),Yl=u("has",{longer_alt:a,categories:[a]}),Kl=u("incr",{longer_alt:a,categories:[a]}),Hl=u("keys",{longer_alt:a,categories:[a]}),zl=u("pop",{longer_alt:a,categories:[a]}),Jl=u("push",{longer_alt:a,categories:[a]}),Xl=u("range",{longer_alt:a,categories:[a]}),Ql=u("ratelimit",{longer_alt:a,categories:[a]}),Zl=u("remove",{longer_alt:a,categories:[a]}),$l=u("set",{longer_alt:a,categories:[a]}),eu=u("shift",{longer_alt:a,categories:[a]}),tu=u("unshift",{longer_alt:a,categories:[a]}),gS=[Dl,Vl,ql,jl,Wl,Yl,Kl,Hl,zl,Jl,Xl,Ql,Zl,$l,eu,tu];function kS(e){switch(e){case Dl.name:case Vl.name:case ql.name:case jl.name:case Wl.name:case Yl.name:case Kl.name:case Hl.name:case zl.name:case Jl.name:case Xl.name:case Ql.name:case Zl.name:case $l.name:case eu.name:case tu.name:return"function";default:return null}}r(kS,"mapTokenToType");var ru=u("run",{longer_alt:a,categories:[a]}),ou=u("job",{longer_alt:a,categories:[a]}),nu=u("service",{longer_alt:a,categories:[a]}),RS=[ru,ou,nu];function LS(e){switch(e){case ru.name:case ou.name:case nu.name:return"keyword";default:return null}}r(LS,"mapTokenToType");var au=u("security",{longer_alt:a,categories:[a]}),iu=u("check_password",{longer_alt:a,categories:[a]}),su=u("create_password",{longer_alt:a,categories:[a]}),cu=u("create_uuid",{longer_alt:a,categories:[a]}),lu=u("create_auth_token",{longer_alt:a,categories:[a]}),uu=u("create_curve_key",{longer_alt:a,categories:[a]}),pu=u("create_rsa_key",{longer_alt:a,categories:[a]}),mu=u("create_secret_key",{longer_alt:a,categories:[a]}),fu=u("decrypt",{llt:a,categories:[a]}),du=u("encrypt",{llt:a,categories:[a]}),xS=u("generate_pass",{longer_alt:a,categories:[a]}),CS=u("generate_uuid",{longer_alt:a,categories:[a]}),Tu=u("jwe_decode",{longer_alt:a,categories:[a]}),Eu=u("jwe_encode",{longer_alt:a,categories:[a]}),hu=u("jws_decode",{longer_alt:a,categories:[a]}),Su=u("jws_encode",{longer_alt:a,categories:[a]}),Au=u("random_bytes",{longer_alt:a,categories:[a]}),Uu=u("random_number",{longer_alt:a,categories:[a]}),OS=[iu,su,cu,lu,uu,pu,mu,fu,du,xS,CS,Tu,Eu,hu,Su,Au,Uu,au];function NS(e){switch(e){case au.name:case iu.name:case su.name:case cu.name:case lu.name:case uu.name:case pu.name:case mu.name:case fu.name:case du.name:case xS.name:case CS.name:case Tu.name:case Eu.name:case hu.name:case Su.name:case Au.name:case Uu.name:return"function";default:return null}}r(NS,"mapTokenToType");var gu=u("storage",{longer_alt:a,categories:[a]}),ku=u("create_image",{longer_alt:a,categories:[a]}),Ru=u("create_attachment",{longer_alt:a,categories:[a]}),Lu=u("read_file_resource",{longer_alt:a,categories:[a]}),xu=u("create_file_resource",{longer_alt:a,categories:[a]}),bS=u("read_file",{longer_alt:a,categories:[a]}),Cu=u("create_audio",{longer_alt:a,categories:[a]}),Ou=u("create_video",{longer_alt:a,categories:[a]}),Nu=u("delete_file",{longer_alt:a,categories:[a]}),bu=u("sign_private_url",{longer_alt:a,categories:[a]}),MS=[gu,ku,Ru,Lu,xu,bS,Cu,Ou,Nu,bu];function yS(e){switch(e){case gu.name:case ku.name:case Ru.name:case Lu.name:case xu.name:case bS.name:case Nu.name:case bu.name:case Cu.name:case Ou.name:return"function";default:return null}}r(yS,"mapTokenToType");var Mu=u("stream",{longer_alt:a,categories:[a]}),yu=u("from_csv",{longer_alt:a,categories:[a]}),Fu=u("from_jsonl",{longer_alt:a,categories:[a]}),_u=u("from_request",{longer_alt:a,categories:[a]}),FS=[Mu,yu,Fu,_u];function _S(e){switch(e){case Mu.name:case yu.name:case Fu.name:case _u.name:return"function";default:return null}}r(_S,"mapTokenToType");var lr=u("table",{longer_alt:a,categories:[a]}),Iu=u("autocomplete",{longer_alt:a,categories:[a]}),vu=u("items",{longer_alt:a,categories:[a]}),IS=[lr,Iu,vu];function vS(e){switch(e){case lr.name:return"keyword";case Iu.name:case vu.name:return"identifier";default:return null}}r(vS,"mapTokenToType");var wu=u("actions",{longer_alt:a,categories:[a]}),Bu=u("active",{longer_alt:a,categories:[a]}),Pu=u("datasources",{longer_alt:a,categories:[a]}),Gu=u("table_trigger",{longer_alt:a,categories:[a]}),wS=[wu,Bu,Pu,Gu];function BS(e){switch(e){case wu.name:case Gu.name:return"keyword";case Bu.name:case Pu.name:return"variable";default:return null}}r(BS,"mapTokenToType");var Du=u("call",{longer_alt:a,categories:[a]}),Vu=u("datasource",{longer_alt:a,categories:[a]}),PS=u("ends_on",{longer_alt:a,categories:[a]}),GS=u("events",{longer_alt:a,categories:[a]}),DS=u("freq",{longer_alt:a,categories:[a]}),qu=u("schedule",{longer_alt:a,categories:[a]}),VS=u("starts_on",{longer_alt:a,categories:[a]}),sn=u("task",{longer_alt:a,categories:[a]}),qS=[Du,Vu,PS,GS,DS,qu,VS,sn];function jS(e){switch(e){case Vu.name:case qu.name:case sn.name:return"keyword";case PS.name:case GS.name:case DS.name:case VS.name:return"variable";case Du.name:return"function";default:return null}}r(jS,"mapTokenToType");var WS=u("text",{longer_alt:a,categories:[a]}),ju=u("append",{longer_alt:a,categories:[a]}),Wu=u("contains",{longer_alt:a,categories:[a]}),Yu=u("ends_with",{longer_alt:a,categories:[a]}),Ku=u("icontains",{longer_alt:a,categories:[a]}),Hu=u("iends_with",{longer_alt:a,categories:[a]}),zu=u("istarts_with",{longer_alt:a,categories:[a]}),Ju=u("ltrim",{longer_alt:a,categories:[a]}),Xu=u("prepend",{longer_alt:a,categories:[a]}),Qu=u("rtrim",{longer_alt:a,categories:[a]}),Zu=u("starts_with",{longer_alt:a,categories:[a]}),$u=u("trim",{longer_alt:a,categories:[a]}),YS=[WS,ju,Wu,Yu,Ku,Hu,zu,Ju,Xu,Qu,Zu,$u];function KS(e){switch(e){case WS.name:return"namespace";case ju.name:case Wu.name:case Yu.name:case Ku.name:case Hu.name:case zu.name:case Ju.name:case Xu.name:case Qu.name:case Zu.name:case $u.name:return"method";default:return null}}r(KS,"mapTokenToType");var ep=u("util",{longer_alt:a,categories:[a]}),tp=u("send_email",{longer_alt:a,categories:[a]}),rp=u("geo_distance",{longer_alt:a,categories:[a]}),op=u("get_all_input",{longer_alt:a,categories:[a]}),np=u("template_engine",{longer_alt:a,categories:[a]}),ap=u("get_env",{longer_alt:a,categories:[a]}),ip=u("get_raw_input",{longer_alt:a,categories:[a]}),sp=u("get_vars",{longer_alt:a,categories:[a]}),cp=u("ip_lookup",{longer_alt:a,categories:[a]}),lp=u("post_process",{longer_alt:a,categories:[a]}),up=u("precondition",{longer_alt:a,categories:[a]}),pp=u("set_header",{longer_alt:a,categories:[a]}),mp=u("sleep",{longer_alt:a,categories:[a]}),HS=[ep,np,rp,tp,op,ap,ip,sp,cp,lp,up,pp,mp];function zS(e){switch(e){case ep.name:case rp.name:case op.name:case ap.name:case ip.name:case sp.name:case cp.name:case lp.name:case up.name:case pp.name:case mp.name:case np.name:case tp.name:return"function";default:return null}}r(zS,"mapTokenToType");var fp=u("var",{longer_alt:a,categories:[a]}),dp=u("update",{longer_alt:a,categories:[a]}),JS=[fp,dp];function XS(e){switch(e){case fp.name:case dp.name:return"function";default:return null}}r(XS,"mapTokenToType");var V=R({name:"ShortFormVariable",pattern:/(\$[a-zA-Z_]\w*)|(\$\$)/,label:"$"}),ur=R({name:"ResponseVariable",pattern:/\$response/,label:"$response",categories:[V],longer_alt:V}),pr=R({name:"LongFormVariable",pattern:/\$var/,label:"$var",longer_alt:V}),QS=R({name:"$this",pattern:/\$this/,longer_alt:V,categories:[V]}),Tp=R({name:"InputVariable",pattern:/\$input/,longer_alt:V}),Ep=R({name:"EnvVariable",pattern:/\$env/,label:"$env",longer_alt:V}),hp=R({name:"AuthVariable",pattern:/\$auth/,label:"$auth",longer_alt:V}),mr=R({name:"$remote_ip",pattern:/\$remote_ip/,longer_alt:V}),fr=R({name:"$tenant",pattern:/\$tenant/,longer_alt:V}),Sp=R({name:"$error",pattern:/\$error/,longer_alt:V}),dr=R({name:"$remote_port",pattern:/\$remote_port/,longer_alt:V}),Tr=R({name:"$remote_user",pattern:/\$remote_user/,longer_alt:V}),Er=R({name:"$http_headers",pattern:/\$http_headers/,longer_alt:V}),hr=R({name:"$webflow",pattern:/\$webflow/,longer_alt:V}),Sr=R({name:"$api_baseurl",pattern:/\$api_baseurl/,longer_alt:V}),Ar=R({name:"$request_uri",pattern:/\$request_uri/,longer_alt:V}),Ur=R({name:"$request_querystring",pattern:/\$request_querystring/,longer_alt:V}),gr=R({name:"$request_auth_token",pattern:/\$request_auth_token/,longer_alt:V}),kr=R({name:"$datasource",pattern:/\$datasource/,longer_alt:V}),Rr=R({name:"$branch",pattern:/\$branch/,longer_alt:V}),Lr=R({name:"$remote_passwd",pattern:/\$remote_passwd/,longer_alt:V}),xr=R({name:"$remote_host",pattern:/\$remote_host/,longer_alt:V}),Cr=R({name:"$request_method",pattern:/\$request_method/,longer_alt:V}),ZS=[ur,QS,pr,Tp,Ep,hp,Sp,mr,fr,dr,Tr,Lr,xr,Cr,Er,hr,Sr,Ar,Ur,gr,kr,Rr,V];function $S(e){switch(e){case Tp.name:case Sp.name:case Ep.name:case hp.name:case mr.name:case fr.name:case dr.name:case Tr.name:case Lr.name:case xr.name:case Cr.name:case ur.name:case pr.name:case Er.name:case hr.name:case Sr.name:case Ar.name:case Ur.name:case gr.name:case kr.name:case Rr.name:return"enumMember";case QS.name:case V.name:return"variable";default:return null}}r($S,"mapTokenToType");var cn=u("datasource",{longer_alt:a,categories:[a]}),Ap=u("workflow_test",{longer_alt:a,categories:[a]}),eA=u("exception",{longer_alt:a,categories:[a]}),tA=[cn,Ap,eA];function rA(e){switch(e){case Ap.name:return"keyword";case eA.name:case cn.name:return"variable";default:return null}}r(rA,"mapTokenToType");var Up=u("workspace",{longer_alt:a,categories:[a]}),oA=[Up];function nA(e){switch(e){case Up.name:return"keyword";default:return null}}r(nA,"mapTokenToType");var gp=u("actions",{longer_alt:a,categories:[a]}),kp=u("active",{longer_alt:a,categories:[a]}),Rp=u("workspace_trigger",{longer_alt:a,categories:[a]}),aA=[gp,kp,Rp];function iA(e){switch(e){case gp.name:case Rp.name:return"keyword";case kp.name:return"variable";default:return null}}r(iA,"mapTokenToType");var Lp=u("zip",{longer_alt:a,categories:[a]}),xp=u("add_to_archive",{longer_alt:a,categories:[a]}),Cp=u("create_archive",{longer_alt:a,categories:[a]}),Op=u("delete_from_archive",{longer_alt:a,categories:[a]}),Np=u("extract",{longer_alt:a,categories:[a]}),bp=u("view_contents",{longer_alt:a,categories:[a]}),sA=[Lp,xp,Cp,Op,Np,bp];function cA(e){switch(e){case Lp.name:case xp.name:case Cp.name:case Op.name:case Np.name:case bp.name:return"function"}}r(cA,"mapTokenToType");var x5=R({name:"ObjectIdentifier",pattern:/[0-9a-zA-Z_]\w*/});var g=R({name:"Dot",pattern:/\./,label:"."}),Mp=u("tags",{longer_alt:a,categories:[a]}),Or=u("now",{longer_alt:a}),xt=u("null",{longer_alt:a}),yp=R({name:"RegExpToken",label:"regexp",pattern:/\/(?:[^/\n\\]|\\.)+\//}),lA=R({name:"WhiteSpace",pattern:/[ \t]+/,group:se.SKIPPED,label:"whitespace"}),m=R({name:"NewlineToken",pattern:/(\r?\n)/}),uA=u("type",{longer_alt:a,categories:[a]}),pA=u("field",{longer_alt:a,categories:[a]}),Ue=u("true",{longer_alt:a}),ge=u("false",{longer_alt:a}),ln=u("input",{longer_alt:a,categories:[a]}),un=u("stack",{longer_alt:a,categories:[a]}),Fp=u("test",{longer_alt:a,categories:[a]}),_p=u("response",{longer_alt:a,categories:[a]}),Ip=u("view",{longer_alt:a,categories:[a]}),vp=u("middleware",{longer_alt:a,categories:[a]}),mA=u("return_aggregate",{pattern:/return_aggregate/}),pn=u("auth",{longer_alt:a,categories:[a]}),fA=u("security",{longer_alt:a,categories:[a]}),wp=u("history",{longer_alt:a,categories:[a]}),Bp=u("cache",{longer_alt:a,categories:[a]}),dA=u("guid",{longer_alt:a,categories:[a]}),Pp=u("schema",{longer_alt:a,categories:[a]}),Gp=u("index",{longer_alt:a,categories:[a]}),Dp=u("values",{longer_alt:a,categories:[a]}),Vp=u("value",{longer_alt:a,categories:[a]}),qp=u("filters",{longer_alt:a,categories:[a]}),jp=R({name:"DbLinkFilter",label:"@",pattern:/@/}),Wp=u("sensitive",{longer_alt:a,categories:[a]}),Yp=u("description",{longer_alt:a,categories:[a]}),Kp=u("disabled",{longer_alt:a,categories:[a]}),Hp=u("mock",{longer_alt:a,categories:[a]}),zp=u("docs",{longer_alt:a,categories:[a]}),Jp=R({name:"DbIdentifier",label:"db.identifier",pattern:/dbo=\d+/}),fa=R({name:"JsonInToken",pattern:/in/,label:"in",longer_alt:a,categories:[a]}),mn=or([lA,m,...pS,...Dh,yp,Gp,ln,mA,qp,...kh,...sS,...aS,...AS,...yh,...Ph,...qh,...Wh,...hS,...Oi,jp,Jp,Dp,Vp,Ue,ge,uA,pA,pn,dA,Wp,Mp,Yp,zp,Kp,Hp,Pp,un,Fp,vp,...lS,_p,xt,Or,wp,Bp,fA,...MS,...sA,...Zh,...OS,...HS,...wS,...aA,...qS,...tA,...bh,...Oh,...ZS,...IS,...wh,...Kh,...gS,...YS,...RS,...fS,...FS,...zh,...Xh,...JS,...eS,...Lh,...Uh,...oS,...Sh,...Eh,...Ih,...oA,Ip,fa,g,a]),nI=[Ah,hh,xh,gh,Rh,Mh,Nh,Fh,vh,Th,Bh,Gh,Vh,Yh,Hh,Jh,Qh,$h,jh,tS,iS,cS,uS,mS,dS,SS,US,kS,LS,NS,yS,_S,vS,BS,jS,KS,nS,zS,XS,$S,rA,nA,iA,cA],Hm=new Map;function aI(){let e={[Bp.name]:"keyword",[wp.name]:"keyword",[Gp.name]:"keyword",[ln.name]:"keyword",[vp.name]:"keyword",[Hp.name]:"keyword",[_p.name]:"keyword",[Ip.name]:"keyword",[Pp.name]:"keyword",[fA.name]:"keyword",[un.name]:"keyword",[Fp.name]:"keyword",[qp.name]:"keyword",[jp.name]:"function",[pn.name]:"variable",[Jp.name]:"variable",[mA.name]:"variable",[Yp.name]:"variable",[Kp.name]:"variable",[zp.name]:"variable",[pA.name]:"variable",[dA.name]:"variable",[Wp.name]:"variable",[Mp.name]:"variable",[uA.name]:"variable",[Vp.name]:"variable",[Dp.name]:"variable",[a.name]:"property",[ge.name]:"enumMember",[Or.name]:"enumMember",[xt.name]:"enumMember",[Ue.name]:"enumMember",[g.name]:"punctuation",[yp.name]:"regexp",[fa.name]:"operator",[m.name]:null,[lA.name]:null};for(let[t,o]of Object.entries(e))Hm.set(t,o);for(let t of mn)if(!Hm.has(t.name))for(let o of nI){let n=o(t.name);if(n){Hm.set(t.name,n);break}}}r(aI,"buildTokenTypeMap");aI();var iI=new se(mn),sI=new se([...pm(mn,Ne),Ym]);function TA(e,t=!1){return t?sI.tokenize(e):iI.tokenize(e)}r(TA,"lexDocument");var cI={addon:"addon",agent:"agent",agent_trigger:"agent_trigger",api_group:"api_group",branch:"branch",function:"cfn",mcp_server:"mcp_server",mcp_server_trigger:"mcp_server_trigger",middleware:"middleware",query:"api",realtime_trigger:"realtime_trigger",realtime_channel:"realtime_channel",run:"run",table:"db",table_trigger:"table_trigger",task:"task",tool:"tool",workflow_test:"workflow_test",workspace:"workspace",workspace_trigger:"workspace_trigger"},lI=/^(?:\s|\/\/[^\n]*\n)*(\w+)/;function Xp(e){let t=e.match(lI)?.[1];return cI[t]||"cfn"}r(Xp,"getSchemeFromContent");function EA(e){return()=>{let t=!1,o=!1,n=!1,i=!1;e.sectionStack.push("addonDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let s=e.CONSUME(Uo);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.CONSUME($),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.SUBRULE(e.inputClause)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.CONSUME(un),e.CONSUME1(S),e.OPTION(()=>{e.AT_LEAST_ONE1(()=>e.CONSUME3(m)),e.CONSUME(bo),e.CONSUME(g),e.SUBRULE(e.dbQueryFn)}),e.AT_LEAST_ONE2(()=>e.CONSUME4(m)),e.CONSUME1(A)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.tagsAttribute)},"ALT")}])}),o||e.addMissingError(s,"{} is missing an input clause"),n||e.addMissingError(s,"{} is missing a stack clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(EA,"addonDeclaration");var le=r(e=>e?e.tokenType===E?e.image.slice(1,-1):e.image:"","getVarName");function hA(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1;e.sectionStack.push("agentDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let f=e.CONSUME(Mi);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.MANY4(()=>e.CONSUME5($)),e.MANY5(()=>e.CONSUME6(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.commentBlockFn),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.SUBRULE(e.canonicalClause)},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.docsFieldAttribute)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0;let d=e.CONSUME(yi);e.CONSUME(h);let T={anthropic:["type","max_steps","model","temperature","headers"],"google-genai":["type","max_steps","model","temperature","headers","search_grounding","include_thoughts"],openai:["type","max_steps","model","temperature","reasoning_effort"],xano_free:["type","max_steps","temperature","search_grounding"]},U={anthropic:[...T.anthropic,"system_prompt","prompt","messages","api_key","reasoning","thinking_tokens","baseURL"],"google-genai":[...T["google-genai"],"system_prompt","prompt","messages","api_key","thinking_tokens","baseURL","safety_settings","dynamic_retrival","reasoning"],openai:[...T.openai,"system_prompt","prompt","messages","api_key","baseURL","headers","organization","project","compatibility"],"xano-free":[...T.xano_free,"system_prompt","prompt","messages","baseURL","headers","safety_settings","dynamic_retrival","thinking_tokens","include_thoughts"]},k={};e.SUBRULE(e.schemaParseObjectFn,{ARGS:[d,{type:["anthropic","google-genai","openai","xano-free"],max_steps:"[number]","prompt?":"[string]","messages?":"[string]","api_key?":"[string]","baseURL?":"[string]","compatibility?":["strict","compatible",""],"dynamic_retrival?":["enabled","disabled",""],"headers?":"[string]","include_thoughts?":"[boolean]","model?":"[string]","organization?":"[string]","project?":"[string]","reasoning_effort?":"[string]","reasoning?":"[boolean]","safety_settings?":"[string]","search_grounding?":"[boolean]","system_prompt?":"[string]","temperature?":"[number]","thinking_tokens?":"[number]"},k]}),e.ACTION(()=>{let C=le(k.type?.value),L=T[C]||[];for(let v of L)Object.prototype.hasOwnProperty.call(k,v)||e.addMissingError(d,`llm of type "${C}" requires a "${v}" field`);let _=U[C]||[],N=[];for(let v in k){let w=le(k[v].key);N.push(w),_.includes(w)||e.addIllegalAttributeError(k[v].key)}let O=N.includes("prompt"),x=N.includes("messages");O&&x?e.addIllegalAttributeError(k.messages.key,`llm of type "${C}" cannot have both "prompt" and "messages" fields`):!O&&!x&&e.addMissingError(d,`llm of type "${C}" requires either a "prompt" or "messages" field`)})},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.tagsAttribute)},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.outputClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0;let d=e.CONSUME(Fi);e.CONSUME2(h),e.SUBRULE(e.schemaParseArrayFn,{ARGS:[d,[{name:"[string]","active?":"[boolean]","auth?":"[string]"}]]})},"ALT")}])}),s||e.addMissingError(f,"{} is missing llm clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(hA,"agentDeclaration");function SA(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1,f=!1,d=!1;e.sectionStack.push("agentTriggerDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let T=e.CONSUME(vi);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.CONSUME($),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0;let U=e.CONSUME(_i);e.CONSUME(h),e.SUBRULE(e.schemaParseObjectFn,{ARGS:[U,{"connection?":"[boolean]"}]})},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.CONSUME(Ii),e.CONSUME2(h),e.SUBRULE(e.booleanValue)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.agentClause)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.docsFieldAttribute)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.SUBRULE(e.inputClause)},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.responseClause)},"ALT")},{GATE:r(()=>!f,"GATE"),ALT:r(()=>{f=!0,e.SUBRULE(e.stackClause)},"ALT")},{GATE:r(()=>!d,"GATE"),ALT:r(()=>{d=!0,e.SUBRULE(e.tagsAttribute)},"ALT")}])}),n||e.addMissingError(T,"{} is missing agent clause"),l||e.addMissingError(T,"{} is missing an input clause"),f||e.addMissingError(T,"{} is missing a stack clause"),p||e.addMissingError(T,"{} is missing a response clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(SA,"agentTriggerDeclaration");function AA(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1;e.sectionStack.push("apiGroupDeclaration"),e.SUBRULE(e.optionalCommentBlockFn),e.CONSUME(Lo),e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.CONSUME($),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.CONSUME(Ro),e.CONSUME1(h),e.SUBRULE(e.booleanValue)},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.CONSUME(Ji),e.CONSUME2(h),e.CONSUME2(E)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0;let f=e.CONSUME(Xi);e.CONSUME3(h),e.SUBRULE(e.schemaParseObjectFn,{ARGS:[f,{"mode?":"[string]","origins?":["[string]"],"methods?":["[string]"],"headers?":["[string]"],"credentials?":"[boolean]","max_age?":"[number]"}]})},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.docsFieldAttribute)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0;let f=e.CONSUME(Qi);e.CONSUME4(h),e.SUBRULE2(e.schemaParseObjectFn,{ARGS:[f,{"active?":"[boolean]","token?":"[string]"}]})},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.tagsAttribute)},"ALT")}])}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(AA,"apiGroupDeclaration");function UA(e){return()=>{e.sectionStack.push("columnDefaultValueAttribute"),e.CONSUME(h),e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(_e),"ALT")},{ALT:r(()=>e.CONSUME(X),"ALT")},{ALT:r(()=>e.CONSUME(Ue),"ALT")},{ALT:r(()=>e.CONSUME(ge),"ALT")},{ALT:r(()=>e.CONSUME(Or),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.sectionStack.pop()}}r(UA,"columnDefaultValueAttribute");function gA(e){return()=>{e.sectionStack.push("descriptionFieldAttribute"),e.CONSUME(Yp),e.CONSUME(h),e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(ze),"ALT")}]),e.sectionStack.pop()}}r(gA,"descriptionFieldAttribute");function kA(e){return()=>{e.sectionStack.push("disabledFieldAttribute"),e.CONSUME(Kp),e.CONSUME(h),e.OR([{ALT:r(()=>e.CONSUME(Ue),"ALT")},{ALT:r(()=>e.CONSUME(ge),"ALT")}]),e.sectionStack.pop()}}r(kA,"disabledFieldAttribute");function RA(e){return()=>{e.sectionStack.push("docsFieldAttribute"),e.CONSUME(zp),e.CONSUME(h),e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(ze),"ALT")}]),e.sectionStack.pop()}}r(RA,"docsFieldAttribute");var LA=["deg2rad","rad2deg","number_format","sin","asin","asinh","cos","acos","acosh","tan","atan","atanh","floor","ceil","round","first","last","count","range","reverse","unique","safe_array","flatten","filter_empty","filter_empty_text","filter_null","filter_empty_array","filter_empty_object","filter_zero","filter_false","sort","shuffle","diff","diff_assoc","intersect","intersect_assoc","merge","merge_recursive","index_by","push","pop","unshift","shift","remove","append","prepend","abs","sqrt","exp","log","log10","ln","pow","array_min","min","array_max","max","sum","avg","product","equals","not_equals","greater_than","greater_than_or_equal","less_than","less_than_or_equal","odd","even","in","add","subtract","multiply","modulus","divide","bitwise_and","bitwise_or","bitwise_xor","not","bitwise_not","is_null","is_empty","is_object","is_array","is_int","is_decimal","is_bool","is_text","addslashes","escape","list_encodings","detect_encoding","to_utf8","from_utf8","convert_encoding","to_lower","to_upper","trim","ltrim","rtrim","capitalize","substr","split","join","slice","strlen","strip_html","unaccent","index","iindex","starts_with","istarts_with","ends_with","iends_with","contains","icontains","set","set_conditional","set_ifnotempty","set_ifnotnull","first_notnull","first_notempty","unset","transform","get","has","fill","fill_keys","keys","values","entries","to_expr","to_text","to_int","to_decimal","to_bool","to_timestamp","to_ms","to_seconds","to_minutes","to_hours","to_days","create_object","create_object_from_entries","json_decode","json_encode","xml_decode","csv_parse","csv_decode","csv_encode","csv_create","url_decode","url_decode_rfc3986","url_encode","url_encode_rfc3986","url_addarg","url_delarg","url_hasarg","url_getarg","url_parse","querystring_parse","yaml_decode","yaml_encode","hex2bin","bin2hex","dechex","hexdec","decbin","bindec","decoct","octdec","base_convert","base64_decode","base64_encode","base64_decode_urlsafe","base64_encode_urlsafe","encrypt","decrypt","jws_encode","jws_decode","jwe_encode","jwe_decode","concat","sprintf","replace","secureid_encode","secureid_decode","md5","sha1","sha256","sha384","sha512","hmac_md5","hmac_sha1","hmac_sha256","hmac_sha384","hmac_sha512","create_uid","uuid","parse_timestamp","format_timestamp","transform_timestamp","add_secs_to_timestamp","add_ms_to_timestamp","regex_matches","regex_get_first_match","regex_get_all_matches","regex_quote","regex_replace","map","filter","filter_null","filter_empty_text","filter_empty_object","filter_empty_array","some","every","find","findIndex","reduce","pick","unpick","text_unescape","text_escape","sql_esc","sql_alias","is_uuid"],zm={text:["trim","min","max","startsWith","prevent","lower","upper","alphaOk","digitOk","ok","pattern"],decimal:["min","max"],int:["min","max"],email:["trim","lower"],password:["min","max","minAlpha","minLowerAlpha","minUpperAlpha","minDigit","minSymbol"],blob:[],blob_img:[],blob_video:[],blob_audio:[],enum:[],file:[],json:[],obj:[],epochms:[]},xA=["covers","l1_distance_manhattan","l2_distance_euclidean","inner_product","negative_inner_product","cosine_distance","cosine_similarity","distance","within","between","length","floor","ceil","round","to_lower","to_upper","concat","substr","coalesce","unaccent","add","sub","mul","div","search_rank","timestamp_month","timestamp_year","timestamp_week","timestamp_hour","timestamp_minute","timestamp_day_of_month","timestamp_day_of_week","timestamp_day_of_year","timestamp_epoch_day","timestamp_epoch_hour","timestamp_epoch_minute","timestamp_epoch_sec","timestamp_add_seconds","timestamp_subtract_seconds","timestamp_add_minutes","timestamp_subtract_minutes","timestamp_add_hours","timestamp_subtract_hours","timestamp_add_days","timestamp_subtract_days","timestamp_add_months","timestamp_subtract_months","timestamp_add_years","timestamp_subtract_years"];function CA(e){return t=>{e.sectionStack.push("inputFilterFn"),e.OR([{ALT:r(()=>{e.OPTION(()=>e.CONSUME(Ne));let o=e.CONSUME(a);e.MANY1(()=>{e.CONSUME1(be),e.OR2([{ALT:r(()=>e.CONSUME2(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")},{ALT:r(()=>e.CONSUME1(yp),"ALT")},{ALT:r(()=>e.CONSUME1(X),"ALT")},{ALT:r(()=>e.CONSUME1(_e),"ALT")},{ALT:r(()=>e.CONSUME1(ge),"ALT")},{ALT:r(()=>e.CONSUME1(Ue),"ALT")}])}),t&&zm[t.image]&&!zm[t.image].includes(o.image)&&e.addInvalidValueError(o,`Filter '${o.image}' cannot be applied to input of type '${t.image}'`)},"ALT")},{ALT:r(()=>{e.CONSUME(jp),e.CONSUME2(be),e.CONSUME(Jp)},"ALT")}]),e.sectionStack.pop()}}r(CA,"inputFilterFn");var OA=r(e=>()=>{e.sectionStack.push("sensitiveFieldAttribute"),e.CONSUME(Wp),e.CONSUME(h),e.OR([{ALT:r(()=>e.CONSUME(Ue),"ALT")},{ALT:r(()=>e.CONSUME(ge),"ALT")}]),e.sectionStack.pop()},"sensitiveFieldAttribute");function NA(e){return()=>{e.sectionStack.push("valueFieldAttribute");let t=e.CONSUME(Vp);e.CONSUME(h),e.SUBRULE(e.expressionFn,{ARGS:[t,{allowIdentifier:!1}]}),e.sectionStack.pop()}}r(NA,"valueFieldAttribute");function bA(e){return()=>{e.sectionStack.push("valuesFieldAttribute"),e.CONSUME(Dp),e.CONSUME(h),e.SUBRULE(e.stringArray),e.sectionStack.pop()}}r(bA,"valuesFieldAttribute");var MA=r(e=>{e.columnDefaultValueAttribute=e.RULE("columnDefaultValueAttribute",UA(e)),e.descriptionFieldAttribute=e.RULE("descriptionFieldAttribute",gA(e)),e.disabledFieldAttribute=e.RULE("disabledFieldAttribute",kA(e)),e.docsFieldAttribute=e.RULE("docsFieldAttribute",RA(e)),e.inputFilterFn=e.RULE("inputFilterFn",CA(e)),e.sensitiveFieldAttribute=e.RULE("sensitiveFieldAttribute",OA(e)),e.valueFieldAttribute=e.RULE("valueFieldAttribute",NA(e)),e.valuesFieldAttribute=e.RULE("valuesFieldAttribute",bA(e))},"register");function yA(e){return()=>{e.sectionStack.push("branchDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let t=e.CONSUME(Es);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]);let o={pre:[{name:"[string]"}],post:[{name:"[string]"}]};e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{color:"[string]","description?":"[string]",middleware:{function:o,query:o,task:o,tool:o},history:{function:[!1,10,100,1e3,1e4,"all"],query:[!1,10,100,1e3,1e4,"all"],task:[!1,10,100,1e3,1e4,"all"],tool:[!1,10,100,1e3,1e4,"all"],trigger:[!1,10,100,1e3,1e4,"all"],middleware:[!1,10,100,1e3,1e4,"all"]}}]}),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(yA,"branchDeclaration");var FA=r(e=>()=>{e.sectionStack.push("agentClause");let t=e.CONSUME(nc);e.CONSUME(h),e.CONSUME(E).image==='""'&&e.addMissingError(t,"agent cannot be empty"),e.sectionStack.pop()},"agentClause");var _A=r(e=>()=>{e.sectionStack.push("authClause"),e.CONSUME(pn),e.CONSUME(h),e.OR([{ALT:r(()=>e.CONSUME(Ue),"ALT")},{ALT:r(()=>e.CONSUME(ge),"ALT")}]),e.sectionStack.pop()},"authClause");function IA(e){return()=>{e.sectionStack.push("cacheClause");let t=e.CONSUME(Bp);e.CONSUME(h),e.SUBRULE(e.schemaParseObjectFn,{ARGS:[t,{ttl:"[number]",input:"[boolean]",auth:"[boolean]",datasource:"[boolean]",ip:"[boolean]","headers?":["[string]"],"env?":["[string]"]}]}),e.sectionStack.pop()}}r(IA,"cacheClause");var vA=r(e=>()=>{e.sectionStack.push("canonicalClause");let t=e.CONSUME(sc);e.CONSUME(h),e.CONSUME(E).image==='""'&&e.addMissingError(t,"canonical cannot be empty"),e.sectionStack.pop()},"canonicalClause");var wA=r(e=>()=>{e.sectionStack.push("channelClause");let t=e.CONSUME(ic);e.CONSUME(h),e.CONSUME(E).image==='""'&&e.addMissingError(t,"channel cannot be empty"),e.sectionStack.pop()},"channelClause");var BA=r(e=>()=>{e.sectionStack.push("dbTableClause");let t=e.CONSUME(lr);e.CONSUME(h),e.CONSUME(E).image==='""'&&e.addMissingError(t,"table cannot be empty"),e.sectionStack.pop()},"dbTableClause");function PA(e){return t=>{let o=t?.[0]||a,n=t?.[1]??!0;e.sectionStack.push(o.name+"Clause"),e.CONSUME(o),e.CONSUME(h);let i=e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(ze),"ALT")}]);n||i.image==='""'&&e.addMissingError(i,"value cannot be empty"),e.sectionStack.pop()}}r(PA,"flexibleStringClause");function GA(e){return()=>{e.sectionStack.push("historyClause");let t=e.CONSUME(wp);e.CONSUME(h),e.SUBRULE(e.schemaParseEnumFn,{ARGS:[t,[!1,"inherit",0,10,100,1e3,1e4,"all"]]}),e.sectionStack.pop()}}r(GA,"historyClause");function DA(e){return()=>{e.sectionStack.push("indexClause");let t=e.CONSUME(Gp);e.CONSUME(h),e.SUBRULE(e.schemaFn,{ARGS:[t,[{type:["primary","btree","gin","btree|unique","search","vector"],field:[{name:"[string]","op?":"[string]"}],"lang?":"[string]","name?":"[string]"}]]}),e.sectionStack.pop()}}r(DA,"indexClause");function VA(e){return()=>{e.sectionStack.push("inputClause"),e.CONSUME(ln),e.OPTION(()=>{e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE1(()=>e.CONSUME1(m)),e.SUBRULE(e.optionalCommentBlockFn),e.OR([{ALT:r(()=>e.SUBRULE(e.objectColumnDefinition),"ALT")},{ALT:r(()=>e.SUBRULE(e.enumColumnDefinition),"ALT")},{ALT:r(()=>e.SUBRULE(e.columnDefinition,{ARGS:[{include_file:!0}]}),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbLinkColumnDefinition),"ALT")}])}),e.AT_LEAST_ONE2(()=>e.CONSUME2(m)),e.CONSUME(A)}),e.sectionStack.pop()}}r(VA,"inputClause");var qA=r(e=>()=>{e.sectionStack.push("mcpServerClause");let t=e.CONSUME(ac);e.CONSUME(h),e.CONSUME(E).image==='""'&&e.addMissingError(t,"mcp_server cannot be empty"),e.sectionStack.pop()},"mcpServerClause");function jA(e){return()=>{e.sectionStack.push("middlewareClause");let t=e.CONSUME(vp);e.CONSUME(h),e.SUBRULE(e.schemaParseObjectFn,{ARGS:[t,{"pre?":[{name:"[string]","active?":"[boolean]","required?":"[boolean]"}],"post?":[{name:"[string]","active?":"[boolean]","required?":"[boolean]"}]}]}),e.sectionStack.pop()}}r(jA,"middlewareClause");var Jm={allowExpectStatements:!1,allowCallStatements:!1};function WA(e){return(t={})=>{t={...Jm,...t},e.sectionStack.push("nakedStackFn"),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE1(()=>e.CONSUME1(m)),e.OPTION(()=>e.CONSUME(Ne)),e.OR([{ALT:r(()=>e.CONSUME($),"ALT")},{ALT:r(()=>e.SUBRULE(e.aiFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.varFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.mathFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.textFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.preconditionFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.zipFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.objectFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.apiFn,{ARGS:[t]}),"ALT")},{ALT:r(()=>e.SUBRULE(e.webflowFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.controlFn,{ARGS:[t]}),"ALT")},{ALT:r(()=>e.SUBRULE(e.debugFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.storageFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.streamFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.actionCallFn),"ALT")},{GATE:r(()=>t.allowCallStatements,"GATE"),ALT:r(()=>e.SUBRULE(e.toolCallFn),"ALT")},{GATE:r(()=>t.allowCallStatements,"GATE"),ALT:r(()=>e.SUBRULE(e.addonCallFn),"ALT")},{GATE:r(()=>t.allowCallStatements,"GATE"),ALT:r(()=>e.SUBRULE(e.middlewareCallFn),"ALT")},{GATE:r(()=>t.allowExpectStatements,"GATE"),ALT:r(()=>e.SUBRULE(e.workflowExpectFn),"ALT")}])}),e.AT_LEAST_ONE2(()=>e.CONSUME2(m)),e.CONSUME(A),e.sectionStack.pop()}}r(WA,"nakedStackFn");function YA(e){return()=>{e.sectionStack.push("outputClause"),e.CONSUME(vl),e.OPTION(()=>{e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE1(()=>e.CONSUME1(m)),e.OR([{ALT:r(()=>e.SUBRULE(e.objectColumnDefinition),"ALT")},{ALT:r(()=>e.SUBRULE(e.enumColumnDefinition),"ALT")},{ALT:r(()=>e.SUBRULE(e.columnDefinition,{ARGS:[{include_file:!1}]}),"ALT")}])}),e.AT_LEAST_ONE2(()=>e.CONSUME2(m)),e.CONSUME(A)}),e.sectionStack.pop()}}r(YA,"outputClause");function KA(e){return()=>{e.sectionStack.push("responseClause");let t=e.CONSUME(_p);e.CONSUME(h),e.SUBRULE(e.expressionFn,{ARGS:[t,{allowDisabledKeys:!0}]}),e.sectionStack.pop()}}r(KA,"responseClause");function HA(e){return()=>{e.sectionStack.push("scheduleClause");let t=e.CONSUME(qu);e.CONSUME(h),e.SUBRULE(e.schemaFn,{ARGS:[t,[{starts_on:"[timestamp]","ends_on?":"[timestamp]","freq?":"[number]"}]]}),e.sectionStack.pop()}}r(HA,"scheduleClause");var uI={include_file:!0,isTableSchema:!1};function zA(e){return(t={},o={})=>{t={...uI,...t},e.sectionStack.push("schemaClause");let n=e.CONSUME(Pp);if(e.OPTION(()=>{e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE1(()=>e.CONSUME1(m)),e.OR([{ALT:r(()=>e.CONSUME($),"ALT")},{ALT:r(()=>e.SUBRULE(e.objectColumnDefinition,{ARGS:[o]}),"ALT")},{ALT:r(()=>e.SUBRULE(e.enumColumnDefinition,{ARGS:[o]}),"ALT")},{ALT:r(()=>e.SUBRULE(e.columnDefinition,{ARGS:[{include_file:t.include_file,isTableSchema:t.isTableSchema},o]}),"ALT")}])}),e.MANY1(()=>e.CONSUME2(m)),e.CONSUME(A)}),t.isTableSchema){let i=o.id;i?["int","uuid"].includes(i.typeToken.image)||e.addInvalidValueError(i.typeToken,'The "id" column can only be of type "int" or "uuid"'):e.addMissingError(n,"{} must have an 'id' of type uuid or int column defined")}e.sectionStack.pop()}}r(zA,"schemaClause");function JA(e){return(t={})=>{t={...Jm,...t},e.sectionStack.push("stackClause"),e.CONSUME(un),e.OPTION(()=>e.SUBRULE(e.nakedStackFn,{ARGS:[t]})),e.sectionStack.pop()}}r(JA,"stackClause");function XA(e){return t=>{let o=!1,n=!1;t=t||[],e.sectionStack.push("testClause"),e.CONSUME(Fp);let i=e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]);if(i&&i.image){let s=i.image.replaceAll('"',"");t.includes(s)&&e.addDuplicateNameError(i,"test"),t.push(i.image.replaceAll('"',""))}e.CONSUME(S),e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.MANY(()=>{e.OR1([{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.CONSUME(ln),e.CONSUME(h),e.SUBRULE(e.objectWithAttributes)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.CONSUME(cn),e.CONSUME1(h),e.CONSUME1(E)},"ALT")},{ALT:r(()=>e.SUBRULE(e.unitExpectFn),"ALT")}]),e.AT_LEAST_ONE1(()=>e.CONSUME1(m))}),e.CONSUME(A),e.sectionStack.pop()}}r(XA,"testClause");function QA(e){return()=>{e.sectionStack.push("viewClause");let t=e.CONSUME(Ip);e.CONSUME(h);let o={};e.SUBRULE(e.schemaParseObjectFn,{ARGS:[t,{"[string]":{"search?":"[query]","hide?":["[string]"],sort:{"[string]":["asc","desc","rand"]},id:"[string]","alias?":"[string]"}},o]});for(let n in o)!o[n].search&&!o[n].hide&&e.addMissingError(t,`view ${n} must have either a search or hide criteria`);e.sectionStack.pop()}}r(QA,"viewClause");var ZA=r(e=>{e.agentClause=e.RULE("agentClause",FA(e)),e.authClause=e.RULE("authClause",_A(e)),e.cacheClause=e.RULE("cacheClause",IA(e)),e.canonicalClause=e.RULE("canonicalClause",vA(e)),e.channelClause=e.RULE("channelClause",wA(e)),e.dbTableClause=e.RULE("dbTableClause",BA(e)),e.flexibleStringClause=e.RULE("flexibleStringClause",PA(e)),e.historyClause=e.RULE("historyClause",GA(e)),e.indexClause=e.RULE("indexClause",DA(e)),e.inputClause=e.RULE("inputClause",VA(e)),e.outputClause=e.RULE("outputClause",YA(e)),e.mcpServerClause=e.RULE("mcpServerClause",qA(e)),e.middlewareClause=e.RULE("middlewareClause",jA(e)),e.nakedStackFn=e.RULE("nakedStackFn",WA(e)),e.responseClause=e.RULE("responseClause",KA(e)),e.scheduleClause=e.RULE("scheduleClause",HA(e)),e.schemaClause=e.RULE("schemaClause",zA(e)),e.stackClause=e.RULE("stackClause",JA(e)),e.testClause=e.RULE("testClause",XA(e)),e.viewClause=e.RULE("viewClause",QA(e))},"register");function $A(e){return()=>{e.sectionStack.push("arraySlice");let t=null,o=null;if(e.OR([{ALT:r(()=>{e.CONSUME(re),e.CONSUME(oe)},"ALT")},{ALT:r(()=>{e.CONSUME1(re),t=e.CONSUME1(X),e.CONSUME1(be),e.OPTION(()=>o=e.CONSUME3(X)),e.CONSUME1(oe)},"ALT")},{ALT:r(()=>{e.CONSUME2(re),e.CONSUME2(be),o=e.CONSUME2(X),e.CONSUME2(oe)},"ALT")}]),t&&t.image.startsWith("-")&&e.addInvalidValueError(t,"Array slice start index cannot be negative"),o&&o.image.startsWith("-")&&e.addInvalidValueError(o,"Array slice end index cannot be negative"),t&&o){let n=parseInt(t.image,10);parseInt(o.image,10)<n&&e.addInvalidValueError(o,"Array slice end index cannot be less than start index")}e.sectionStack.pop()}}r($A,"arraySlice");var pI={include_file:!1,isTableSchema:!1};function eU(e){return(t={},o={})=>{t={...pI,...t};let n=!1,i=!1,s=!1;e.sectionStack.push("columnDefinition");let c=e.OR([{ALT:r(()=>e.CONSUME(Is),"ALT")},{ALT:r(()=>e.CONSUME(vs),"ALT")},{ALT:r(()=>e.CONSUME(Co),"ALT")},{ALT:r(()=>e.CONSUME(ws),"ALT")},{ALT:r(()=>e.CONSUME(Bs),"ALT")},{ALT:r(()=>e.CONSUME(Gs),"ALT")},{ALT:r(()=>e.CONSUME(Ds),"ALT")},{ALT:r(()=>e.CONSUME(Vs),"ALT")},{ALT:r(()=>e.CONSUME(qs),"ALT")},{ALT:r(()=>e.CONSUME(js),"ALT")},{ALT:r(()=>e.CONSUME(Ws),"ALT")},{ALT:r(()=>e.CONSUME(Hs),"ALT")},{ALT:r(()=>e.CONSUME(zs),"ALT")},{ALT:r(()=>e.CONSUME(Js),"ALT")},{ALT:r(()=>e.CONSUME(Xs),"ALT")},{ALT:r(()=>e.CONSUME(Qs),"ALT")},{ALT:r(()=>e.CONSUME(Zs),"ALT")},{ALT:r(()=>e.CONSUME($s),"ALT")},{ALT:r(()=>e.CONSUME(ec),"ALT")},{ALT:r(()=>e.CONSUME(tc),"ALT")},{ALT:r(()=>e.CONSUME(rc),"ALT")},{GATE:r(()=>!!t.include_file,"GATE"),ALT:r(()=>e.CONSUME(Ys),"ALT")}]);e.OPTION1(()=>{i=!0,e.SUBRULE(e.arraySlice)}),e.OPTION2(()=>{n=!0,e.CONSUME(et)});let l=e.CONSUME(a);e.OPTION6(()=>{s=!0,e.CONSUME1(et)}),e.OPTION3(()=>e.SUBRULE(e.columnDefaultValueAttribute)),e.OPTION4(()=>e.SUBRULE(e.filterDefinition,{ARGS:[c]}));let p={};e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[l,{"description?":"[string]","table?":"[string]","size?":"[number]","sensitive?":"[boolean]"},p]}),c.image=="vector"&&!p.size&&e.addWarning('Column named "vector" should have a size attribute defining its length.',l),o[le(l)]={typeToken:c,nameToken:l},e.addInput(l.image,c.image,i,n,s),e.sectionStack.pop()}}r(eU,"columnDefinition");function tU(e){return()=>{e.sectionStack.push("dbLinkColumnDefinition");let t=e.CONSUME(oc);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{table:"[string]","override?":{"[string]":{hidden:"[boolean]"}}}]}),e.sectionStack.pop()}}r(tU,"dbLinkColumnDefinition");function rU(e){return(t={})=>{e.sectionStack.push("enumColumnDefinition");let o=e.CONSUME(Ps),n=!1,i=!1,s=!1;e.OPTION1(()=>{n=!0,e.SUBRULE(e.arraySlice)}),e.OPTION2(()=>{i=!0,e.CONSUME(et)});let c=e.CONSUME(a);t[le(c)]={typeToken:o,nameToken:c},e.OPTION(()=>{s=!0,e.CONSUME1(et)}),e.OPTION3(()=>e.SUBRULE(e.columnDefaultValueAttribute)),e.SUBRULE(e.enumColumnMetadataDefinition,{ARGS:[o]}),e.addInput(c.image,"enum",n,i,s),e.sectionStack.pop()}}r(rU,"enumColumnDefinition");function oU(e){return(t=null)=>{e.sectionStack.push("filterDefinition"),e.CONSUME(qp),e.CONSUME(h),e.AT_LEAST_ONE_SEP({SEP:Me,DEF:r(()=>e.SUBRULE(e.inputFilterFn,{ARGS:[t]}),"DEF")}),e.sectionStack.pop()}}r(oU,"filterDefinition");function nU(e){return(t={})=>{e.sectionStack.push("objectColumnDefinition");let o=e.CONSUME(Ks),n=!1,i=!1,s=!1;e.OPTION2(()=>{n=!0,e.SUBRULE(e.arraySlice)});let c=e.CONSUME(a);t[le(c)]={typeToken:o,nameToken:c},e.OPTION(()=>{s=!0,e.CONSUME(et)}),e.SUBRULE(e.objectColumnMetadataDefinition),e.addInput(c.image,"enum",n,i,s),e.sectionStack.pop()}}r(nU,"objectColumnDefinition");var aU=r(e=>{e.arraySlice=e.RULE("arraySlice",$A(e)),e.columnDefinition=e.RULE("columnDefinition",eU(e)),e.dbLinkColumnDefinition=e.RULE("dbLinkColumnDefinition",tU(e)),e.enumColumnDefinition=e.RULE("enumColumnDefinition",rU(e)),e.filterDefinition=e.RULE("filterDefinition",oU(e)),e.objectColumnDefinition=e.RULE("objectColumnDefinition",nU(e))},"register");function iU(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1,f=!1,d=[];e.sectionStack.push("functionDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let T=e.CONSUME(sr);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME(E),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.CONSUME($),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.SUBRULE(e.cacheClause)},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.docsFieldAttribute)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.inputClause)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.middlewareClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.SUBRULE(e.responseClause)},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.stackClause)},"ALT")},{GATE:r(()=>!f,"GATE"),ALT:r(()=>{f=!0,e.SUBRULE(e.tagsAttribute)},"ALT")},{ALT:r(()=>{e.SUBRULE(e.testClause,{ARGS:[d]})},"ALT")}])}),s||e.addMissingError(T,"{} is missing an input clause"),p||e.addMissingError(T,"{} is missing a stack clause"),l||e.addMissingError(T,"{} is missing a response clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(iU,"functionDeclaration");function sU(e){return()=>{e.sectionStack.push("actionCallFn"),e.CONSUME(Ni),e.CONSUME(g);let t=e.CONSUME(ir);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}]),e.OPTION(()=>{e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"package?":"[string]","input?":{"[string]":"[expression]"},"mock?":{"![string]":"[expression]"},"registry?":{"[string]":"[expression]"},"description?":"[string]","disabled?":"[boolean]"}]})}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(sU,"actionCallFn");function cU(e){return()=>{e.sectionStack.push("addonCallFn"),e.CONSUME(Uo),e.CONSUME(g);let t=e.CONSUME(bi);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}]),e.OPTION(()=>{e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"input?":{"[string]":"[expression]"},"mock?":{"![string]":"[expression]"},"description?":"[string]","disabled?":"[boolean]"}]})}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(cU,"addonCallFn");function lU(e){return()=>{e.sectionStack.push("aiAgentRunFn");let t=e.CONSUME(go);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME(E),"ALT")}],ERR_MSG:"Expected an agent name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"args?":"[expression]","runtime_mode?":["async-shared","async-dedicated"],"allow_tool_execution?":"[expression]","description?":"[string]","disabled?":"[boolean]","version?":"[string]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(lU,"aiAgentRunFn");function uU(e){return()=>{e.sectionStack.push("aiExternalMcpServerDetailsFn");let t=e.CONSUME(qi);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{url:"[expression]",bearer_token:"[expression]",connection_type:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(uU,"aiExternalMcpServerDetailsFn");function pU(e){return()=>{e.sectionStack.push("aiExternalMcpToolListFn");let t=e.CONSUME(Vi);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{url:"[expression]",bearer_token:"[expression]",connection_type:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(pU,"aiExternalMcpToolListFn");function mU(e){return()=>{e.sectionStack.push("aiExternalMcpToolRunFn");let t=e.CONSUME(go);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{url:"[expression]",bearer_token:"[expression]",connection_type:"[expression]",tool:"[expression]",args:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(mU,"aiExternalMcpToolRunFn");var fU=r(e=>{e.aiAgentRunFn=e.RULE("aiAgentRunFn",lU(e)),e.aiExternalMcpToolListFn=e.RULE("aiExternalMcpToolListFn",pU(e)),e.aiExternalMcpToolRunFn=e.RULE("aiExternalMcpToolRunFn",mU(e)),e.aiExternalMcpServerDetailsFn=e.RULE("aiExternalMcpServerDetailsFn",uU(e))},"register");function dU(e){return()=>{e.sectionStack.push("ai"),e.CONSUME(wi),e.CONSUME(g),e.OR([{ALT:r(()=>{e.CONSUME(Bi),e.CONSUME1(g),e.SUBRULE(e.aiAgentRunFn)},"ALT")},{ALT:r(()=>{e.CONSUME(Pi),e.CONSUME2(g),e.CONSUME(Gi),e.CONSUME3(g),e.OR1([{ALT:r(()=>e.SUBRULE(e.aiExternalMcpServerDetailsFn),"ALT")},{ALT:r(()=>{e.CONSUME(Di),e.CONSUME4(g),e.OR2([{ALT:r(()=>e.SUBRULE(e.aiExternalMcpToolListFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.aiExternalMcpToolRunFn),"ALT")}])},"ALT")}])},"ALT")}]),e.sectionStack.pop()}}r(dU,"aiFn");function TU(e){return()=>{e.sectionStack.push("apiCallFn");let t=e.CONSUME(Yi);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(en),e.CONSUME(h),e.OR1([{ALT:r(()=>e.CONSUME(an),"ALT")},{ALT:r(()=>e.CONSUME(tn),"ALT")},{ALT:r(()=>e.CONSUME(rn),"ALT")},{ALT:r(()=>e.CONSUME(on),"ALT")},{ALT:r(()=>e.CONSUME(nn),"ALT")}]),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{api_group:"[string]","description?":"[string]","disabled?":"[boolean]","headers?":"[expression]","input?":{"[string]":"[expression]"}}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(TU,"apiCallFn");function EU(e){let t=["code","timeout"],o=["description","disabled"];return()=>{e.sectionStack.push("apiLambdaFn");let n=e.CONSUME(zi);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(EU,"apiLambdaFn");function hU(e){let t=["channel","data","auth_table","auth_id"],o=["description","disabled"];return()=>{e.sectionStack.push("apiRealtimeEventFn");let n=e.CONSUME(Ki);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(hU,"apiRealtimeEventFn");function SU(e){return()=>{e.sectionStack.push("apiRequestFn");let t=e.CONSUME(ko);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{url:"[expression]",method:"[expression]","description?":"[string]","disabled?":"[boolean]","params?":"[expression]","headers?":"[expression]","timeout?":"[number]","follow_location?":"[expression]","ca_certificate?":"[string]","certificate?":"[string]","certificate_pass?":"[string]","private_key?":"[string]","verify_host?":"[boolean]","verify_peer?":"[boolean]","mock?":{"![string]":"[expression]"}}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(SU,"apiRequestFn");function AU(e){let t=["value"],o=["description","disabled"];return()=>{e.sectionStack.push("apiStreamFn");let n=e.CONSUME(Hi);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(AU,"apiStreamFn");function UU(e){return()=>{e.sectionStack.push("webflowRequestFn");let t=e.CONSUME(ko);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{path:"[expression]",method:"[expression]","description?":"[string]","disabled?":"[boolean]","params?":"[expression]","headers?":"[expression]","timeout?":"[number]","follow_location?":"[expression]","ca_certificate?":"[string]","certificate?":"[string]","certificate_pass?":"[string]","private_key?":"[string]","verify_host?":"[boolean]","verify_peer?":"[boolean]","mock?":{"![string]":"[expression]"}}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(UU,"webflowRequestFn");var gU=r(e=>{e.apiLambdaFn=e.RULE("apiLambdaFn",EU(e)),e.apiRealtimeEventFn=e.RULE("apiRealtimeEventFn",hU(e)),e.apiRequestFn=e.RULE("apiRequestFn",SU(e)),e.apiStreamFn=e.RULE("apiStreamFn",AU(e)),e.apiCallFn=e.RULE("apiCallFn",TU(e)),e.webflowRequestFn=e.RULE("webflowRequestFn",UU(e))},"register");function kU(e){return(t={})=>{e.sectionStack.push("api"),e.CONSUME(ji),e.CONSUME(g),e.OR([{GATE:r(()=>t.allowCallStatements,"GATE"),ALT:r(()=>e.SUBRULE(e.apiCallFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.apiLambdaFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.apiRequestFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.apiRealtimeEventFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.apiStreamFn),"ALT")}]),e.sectionStack.pop()}}r(kU,"apiFn");function RU(e){return()=>{e.sectionStack.push("arrayDifferenceFn");let t=e.CONSUME(fs);e.CONSUME(B),e.SUBRULE(e.expressionFn),e.OPTION(()=>e.CONSUME(m)),e.CONSUME(P),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{value:"[expression]",by:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(RU,"arrayDifferenceFn");function LU(e){return()=>{e.sectionStack.push("arrayEveryFn");let t=e.CONSUME($i);e.SUBRULE(e.arrayValueIfAs,{ARGS:[t]}),e.sectionStack.pop()}}r(LU,"arrayEveryFn");function xU(e){return()=>{e.sectionStack.push("arrayFilterCountFn");let t=e.CONSUME(es);e.SUBRULE(e.arrayValueIfAs,{ARGS:[t]}),e.sectionStack.pop()}}r(xU,"arrayFilterCountFn");function CU(e){return()=>{e.sectionStack.push("arrayFilterFn");let t=e.CONSUME(ts);e.SUBRULE(e.arrayValueIfAs,{ARGS:[t]}),e.sectionStack.pop()}}r(CU,"arrayFilterFn");function OU(e){return()=>{e.sectionStack.push("arrayFindFn");let t=e.CONSUME(rs);e.SUBRULE(e.arrayValueIfAs,{ARGS:[t]}),e.sectionStack.pop()}}r(OU,"arrayFindFn");function NU(e){return()=>{e.sectionStack.push("arrayFindIndexFn");let t=e.CONSUME(os);e.SUBRULE(e.arrayValueIfAs,{ARGS:[t]}),e.sectionStack.pop()}}r(NU,"arrayFindIndexFn");function bU(e){return()=>{e.sectionStack.push("arrayGroupByFn");let t=e.CONSUME(ms);e.CONSUME(B),e.SUBRULE(e.expressionFn),e.OPTION(()=>e.CONSUME(m)),e.CONSUME(P),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{by:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(bU,"arrayGroupByFn");function MU(e){return()=>{e.sectionStack.push("arrayHasFn");let t=e.CONSUME(ns);e.SUBRULE(e.arrayValueIfAs,{ARGS:[t]}),e.sectionStack.pop()}}r(MU,"arrayHasFn");function yU(e){return()=>{e.sectionStack.push("arrayIntersectionFn");let t=e.CONSUME(ds);e.CONSUME(B),e.SUBRULE(e.expressionFn),e.OPTION(()=>e.CONSUME(m)),e.CONSUME(P),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{value:"[expression]",by:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(yU,"arrayIntersectionFn");function FU(e){return()=>{e.sectionStack.push("arrayMapFn");let t=e.CONSUME(us);e.CONSUME(B),e.SUBRULE(e.expressionFn),e.OPTION(()=>e.CONSUME(m)),e.CONSUME(P),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{by:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(FU,"arrayMapFn");function _U(e){return()=>{e.sectionStack.push("arrayMergeFn"),e.CONSUME(as),e.SUBRULE(e.variableOnly),e.SUBRULE(e.arrayValueOnly),e.sectionStack.pop()}}r(_U,"arrayMergeFn");function IU(e){return()=>{e.sectionStack.push("arrayNoValueAs"),e.OPTION(()=>{e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")}])}),e.OPTION1(()=>e.CONSUME1(m)),e.CONSUME(A)}),e.CONSUME(at),e.SUBRULE(e.variableOnly),e.sectionStack.pop()}}r(IU,"arrayNoValueAs");function vU(e){return()=>{e.sectionStack.push("arrayPartitionFn");let t=e.CONSUME(ps);e.SUBRULE(e.arrayValueIfAs,{ARGS:[t]}),e.sectionStack.pop()}}r(vU,"arrayPartitionFn");function wU(e){return()=>{e.sectionStack.push("arrayPopFn"),e.CONSUME(is),e.SUBRULE(e.variableOnly),e.SUBRULE(e.arrayNoValueAs),e.sectionStack.pop()}}r(wU,"arrayPopFn");function BU(e){return()=>{e.sectionStack.push("arrayPushFn"),e.CONSUME(ss),e.SUBRULE(e.variableOnly),e.SUBRULE(e.arrayValueOnly),e.sectionStack.pop()}}r(BU,"arrayPushFn");function PU(e){return()=>{e.sectionStack.push("arrayShiftFn"),e.CONSUME(cs),e.SUBRULE(e.variableOnly),e.SUBRULE(e.arrayNoValueAs),e.sectionStack.pop()}}r(PU,"arrayShiftFn");function GU(e){return()=>{e.sectionStack.push("arrayUnionFn");let t=e.CONSUME(Ts);e.CONSUME(B),e.SUBRULE(e.expressionFn),e.OPTION(()=>e.CONSUME(m)),e.CONSUME(P),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{value:"[expression]",by:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(GU,"arrayUnionFn");function DU(e){return()=>{e.sectionStack.push("arrayUnshiftFn"),e.CONSUME(ls),e.SUBRULE(e.variableOnly),e.SUBRULE(e.arrayValueOnly),e.sectionStack.pop()}}r(DU,"arrayUnshiftFn");function VU(e){return(t,o={})=>{e.sectionStack.push("arrayValueIfAs");let n=!1;e.CONSUME(B),e.MANY(()=>e.CONSUME(m)),e.SUBRULE(e.expressionFn),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(P),e.OPTION(()=>{n=!0,e.CONSUME(Oo),e.CONSUME1(B),e.SUBRULE1(e.expressionFn),e.CONSUME1(P)}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"description?":"[string]","disabled?":"[boolean]",...o}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),n||e.addWarning("`if (...)` conditional statement is missing",t),e.sectionStack.pop()}}r(VU,"arrayValueIfAs");function qU(e){return()=>{e.sectionStack.push("arrayValueOnly");let t=!1;e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>{t=!0,e.SUBRULE(e.valueFieldAttribute)},"ALT")},{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")}])}),t||e.SUBRULE(e.valueFieldAttribute),e.OPTION1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(qU,"arrayValueOnly");function jU(e){return t=>{e.sectionStack.push("valueAttrOnly");let o=!1,n=!1,i=!1;e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>{o=!0,e.SUBRULE(e.valueFieldAttribute)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")}])}),o||e.addMissingError(t,"{} is missing a stack clause"),e.OPTION1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(jU,"valueAttrOnly");var WU=r(e=>{e.arrayEveryFn=e.RULE("arrayEveryFn",LU(e)),e.arrayFilterCountFn=e.RULE("arrayFilterCountFn",xU(e)),e.arrayFilterFn=e.RULE("arrayFilterFn",CU(e)),e.arrayFindFn=e.RULE("arrayFindFn",OU(e)),e.arrayFindIndexFn=e.RULE("arrayFindIndexFn",NU(e)),e.arrayHasFn=e.RULE("arrayHasFn",MU(e)),e.arrayMergeFn=e.RULE("arrayMergeFn",_U(e)),e.arrayNoValueAs=e.RULE("arrayNoValueAs",IU(e)),e.arrayPopFn=e.RULE("arrayPopFn",wU(e)),e.arrayPushFn=e.RULE("arrayPushFn",BU(e)),e.arrayShiftFn=e.RULE("arrayShiftFn",PU(e)),e.arrayUnshiftFn=e.RULE("arrayUnshiftFn",DU(e)),e.arrayValueIfAs=e.RULE("arrayValueIfAs",VU(e)),e.arrayValueOnly=e.RULE("arrayValueOnly",qU(e)),e.valueAttrOnly=e.RULE("valueAttrOnly",jU(e)),e.arrayMapFn=e.RULE("arrayMapFn",FU(e)),e.arrayPartitionFn=e.RULE("arrayPartitionFn",vU(e)),e.arrayGroupByFn=e.RULE("arrayGroupByFn",bU(e)),e.arrayUnionFn=e.RULE("arrayUnionFn",GU(e)),e.arrayDifferenceFn=e.RULE("arrayDifferenceFn",RU(e)),e.arrayIntersectionFn=e.RULE("arrayIntersectionFn",yU(e))},"register");function YU(e){return()=>{e.sectionStack.push("array"),e.CONSUME(Zi),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.arrayEveryFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayFilterCountFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayFilterFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayFindFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayFindIndexFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayHasFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayShiftFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayPopFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayUnshiftFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayPushFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayMergeFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayMapFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayPartitionFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayGroupByFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayUnionFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayDifferenceFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayIntersectionFn),"ALT")}]),e.sectionStack.pop()}}r(YU,"arrayFn");function KU(e){return()=>{e.sectionStack.push("cloudAlgoliaFn"),e.CONSUME(Ss),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.cloudAlgoliaRequestFn),"ALT")}]),e.sectionStack.pop()}}r(KU,"cloudAlgoliaFn");function HU(e){return()=>{e.sectionStack.push("cloudAlgoliaRequestFn");let t=e.CONSUME(xo);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"description?":"[string]","application_id?":"[expression]","api_key?":"[expression]",url:"[expression]","method?":["POST","GET"],payload:"[expression]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(HU,"cloudAlgoliaRequestFn");function zU(e){return()=>{e.sectionStack.push("cloudAwsFn"),e.CONSUME(Us),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.cloudAwsS3Fn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudAwsOpenSearchFn),"ALT")}]),e.sectionStack.pop()}}r(zU,"cloudAwsFn");function JU(e){return()=>{e.sectionStack.push("cloudAwsOpenSearchFn"),e.CONSUME(ys),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.cloudSearchDocumentFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudSearchQueryFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudSearchRequestFn),"ALT")}]),e.sectionStack.pop()}}r(JU,"cloudAwsOpenSearchFn");function XU(e){return()=>{e.sectionStack.push("cloudAwsS3Fn"),e.CONSUME(Ns),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.cloudListDirectoryFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudSignUrlFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudUploadFileFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudDeleteFileFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudReadFileFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudGetFileInfoFn),"ALT")}]),e.sectionStack.pop()}}r(XU,"cloudAwsS3Fn");function QU(e){return()=>{e.sectionStack.push("cloudAzureFn"),e.CONSUME(ks),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.cloudStorageFn),"ALT")}]),e.sectionStack.pop()}}r(QU,"cloudAzureFn");function ZU(e){return()=>{e.sectionStack.push("cloudDeleteFileFn"),e.CONSUME(xs),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(ZU,"cloudDeleteFileFn");function $U(e){return()=>{e.sectionStack.push("cloudElasticSearchFn"),e.CONSUME(gs),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.cloudSearchDocumentFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudSearchQueryFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudSearchRequestFn),"ALT")}]),e.sectionStack.pop()}}r($U,"cloudElasticSearchFn");function eg(e){return()=>{e.sectionStack.push("cloudGetFileInfoFn");let t=e.CONSUME(Cs);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(eg,"cloudGetFileInfoFn");function tg(e){return()=>{e.sectionStack.push("cloudGoogleFn"),e.CONSUME(As),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.cloudStorageFn),"ALT")}]),e.sectionStack.pop()}}r(tg,"cloudGoogleFn");function rg(e){return()=>{e.sectionStack.push("cloudListDirectoryFn");let t=e.CONSUME(Os);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(rg,"cloudListDirectoryFn");function og(e){return()=>{e.sectionStack.push("cloudReadFileFn");let t=e.CONSUME(Ls);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(og,"cloudReadFileFn");function ng(e){return()=>{e.sectionStack.push("cloudSearchDocumentFn");let t=e.CONSUME(Fs);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(ng,"cloudSearchDocumentFn");function ag(e){return()=>{e.sectionStack.push("cloudSearchQueryFn");let t=e.CONSUME(_s);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(ag,"cloudSearchQueryFn");function ig(e){return()=>{e.sectionStack.push("cloudSearchRequestFn");let t=e.CONSUME(xo);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(ig,"cloudSearchRequestFn");function sg(e){return()=>{e.sectionStack.push("cloudSignUrlFn");let t=e.CONSUME(bs);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(sg,"cloudSignUrlFn");function cg(e){return()=>{e.sectionStack.push("cloudStorageFn"),e.CONSUME(Rs),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.cloudListDirectoryFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudSignUrlFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudUploadFileFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudDeleteFileFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudReadFileFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudGetFileInfoFn),"ALT")}]),e.sectionStack.pop()}}r(cg,"cloudStorageFn");function lg(e){return()=>{e.sectionStack.push("cloudUploadFileFn");let t=e.CONSUME(Ms);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(lg,"cloudUploadFileFn");var ug=r(e=>{e.cloudAlgoliaFn=e.RULE("cloudAlgoliaFn",KU(e)),e.cloudAlgoliaRequestFn=e.RULE("cloudAlgoliaRequestFn",HU(e)),e.cloudAwsFn=e.RULE("cloudAwsFn",zU(e)),e.cloudAwsOpenSearchFn=e.RULE("cloudAwsOpenSearchFn",JU(e)),e.cloudAwsS3Fn=e.RULE("cloudAwsS3Fn",XU(e)),e.cloudAzureFn=e.RULE("cloudAzureFn",QU(e)),e.cloudDeleteFileFn=e.RULE("cloudDeleteFileFn",ZU(e)),e.cloudElasticSearchFn=e.RULE("cloudElasticSearchFn",$U(e)),e.cloudGetFileInfoFn=e.RULE("cloudGetFileInfoFn",eg(e)),e.cloudGoogleFn=e.RULE("cloudGoogleFn",tg(e)),e.cloudListDirectoryFn=e.RULE("cloudListDirectoryFn",rg(e)),e.cloudReadFileFn=e.RULE("cloudReadFileFn",og(e)),e.cloudSearchDocumentFn=e.RULE("cloudSearchDocumentFn",ng(e)),e.cloudSearchQueryFn=e.RULE("cloudSearchQueryFn",ag(e)),e.cloudSearchRequestFn=e.RULE("cloudSearchRequestFn",ig(e)),e.cloudSignUrlFn=e.RULE("cloudSignUrlFn",sg(e)),e.cloudStorageFn=e.RULE("cloudStorageFn",cg(e)),e.cloudUploadFileFn=e.RULE("cloudUploadFileFn",lg(e))},"register");function pg(e){return()=>{e.sectionStack.push("cloud"),e.CONSUME(hs),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.cloudGoogleFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudAwsFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudElasticSearchFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudAzureFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudAlgoliaFn),"ALT")}]),e.sectionStack.pop()}}r(pg,"cloudFn");function mg(e){return(t={})=>{e.OR([{ALT:r(()=>e.CONSUME(No),"ALT")},{ALT:r(()=>e.CONSUME(Cc),"ALT")},{ALT:r(()=>e.SUBRULE(e.awaitFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.conditionalFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.forEachFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.forFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.functionRunFn),"ALT")},{GATE:r(()=>t.allowFunctionCalls,"GATE"),ALT:r(()=>e.SUBRULE(e.functionCallFn),"ALT")},{GATE:r(()=>t.allowFunctionCalls,"GATE"),ALT:r(()=>e.SUBRULE(e.taskCallFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.groupFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.returnFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.switchFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.whileFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.throwFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.tryCatchFn),"ALT")}]),e.sectionStack.pop()}}r(mg,"controlFn");function fg(e){let t=["ids","timeout"],o=["description","disabled"];return()=>{e.sectionStack.push("awaitFn");let n=e.CONSUME(Ec);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(fg,"awaitFn");function dg(e){return()=>{e.sectionStack.push("conditionalElifFn"),e.CONSUME(mc),e.CONSUME(B),e.MANY(()=>e.CONSUME(m)),e.SUBRULE(e.expressionFn),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(P),e.OPTION(()=>e.SUBRULE(e.nakedStackFn)),e.sectionStack.pop()}}r(dg,"conditionalElifFn");function Tg(e){return()=>{e.sectionStack.push("conditionalElseFn"),e.CONSUME(pc),e.SUBRULE(e.nakedStackFn),e.sectionStack.pop()}}r(Tg,"conditionalElseFn");function Eg(e){return()=>{let t=!1,o=!1,n=!1;e.sectionStack.push("conditionalFn");let i=e.CONSUME(uc);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>e.CONSUME($),"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.disabledFieldAttribute)},"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.SUBRULE(e.conditionalIfFn),e.MANY1(()=>{e.AT_LEAST_ONE1(()=>e.CONSUME3(m)),e.SUBRULE(e.conditionalElifFn)}),e.OPTION(()=>{e.AT_LEAST_ONE2(()=>e.CONSUME4(m)),e.SUBRULE(e.conditionalElseFn)})},"ALT")}])}),t||e.addMissingError(i,"{} is missing the if statement"),e.MANY2(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(Eg,"conditionalFn");function hg(e){return()=>{e.sectionStack.push("conditionalIfFn"),e.CONSUME(Oo),e.CONSUME(B),e.MANY(()=>e.CONSUME(m)),e.SUBRULE(e.expressionFn),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(P),e.OPTION(()=>e.SUBRULE(e.nakedStackFn)),e.sectionStack.pop()}}r(hg,"conditionalIfFn");function Sg(e){return()=>{let t=!1;e.sectionStack.push("forEachFn"),e.CONSUME(dc),e.OR([{ALT:r(()=>{e.CONSUME(g),e.CONSUME(Tc)},"ALT")},{ALT:r(()=>{e.CONSUME(B),e.SUBRULE(e.expressionFn),e.CONSUME(P),e.OPTION(()=>{e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR1([{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")},{ALT:r(()=>{t=!0,e.CONSUME(mt),e.CONSUME(at),e.SUBRULE(e.assignableVariableAs),e.OPTION1(()=>e.SUBRULE1(e.nakedStackFn))},"ALT")}])}),t||(e.CONSUME1(mt),e.CONSUME1(at),e.SUBRULE(e.assignableVariableAs),e.OPTION2(()=>e.SUBRULE2(e.nakedStackFn))),e.MANY2(()=>e.CONSUME1(m)),e.CONSUME(A)})},"ALT")}]),e.sectionStack.pop()}}r(Sg,"forEachFn");function Ag(e){return()=>{let t=!1;e.sectionStack.push("forFn"),e.CONSUME(fc),e.CONSUME(B),e.SUBRULE(e.expressionFn),e.CONSUME(P),e.OPTION(()=>{e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")},{ALT:r(()=>{t=!0,e.CONSUME(mt),e.CONSUME(at),e.SUBRULE(e.assignableVariableAs),e.OPTION1(()=>e.SUBRULE1(e.nakedStackFn))},"ALT")}])}),t||(e.CONSUME1(mt),e.CONSUME1(at),e.SUBRULE(e.assignableVariableAs),e.OPTION2(()=>e.SUBRULE2(e.nakedStackFn))),e.MANY2(()=>e.CONSUME1(m)),e.CONSUME(A)}),e.sectionStack.pop()}}r(Ag,"forFn");function Ug(e){let t=[],o=["input","description","disabled"];return()=>{e.sectionStack.push("functionCallFn"),e.CONSUME(sr),e.CONSUME(g);let n=e.CONSUME(sl);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}]),e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o,{allowObject:["input"]}]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(Ug,"functionCallFn");function gg(e){return()=>{e.sectionStack.push("functionRunFn"),e.CONSUME(sr),e.CONSUME(g);let t=e.CONSUME(il);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}]),e.OPTION(()=>{e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"input?":{"[string]?":"[expression]"},"description?":"[string]","disabled?":"[boolean]","runtime_mode?":["async-shared","async-dedicated"],"mock?":{"![string]":"[expression]"}}]})}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(gg,"functionRunFn");function kg(e){return()=>{let t=!1;e.sectionStack.push("groupFn"),e.CONSUME(Lc),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")},{ALT:r(()=>{t=!0,e.SUBRULE(e.stackClause)},"ALT")}])}),t||e.SUBRULE(e.stackClause),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(kg,"groupFn");function Rg(e){return()=>{e.sectionStack.push("preconditionFn");let t=e.CONSUME(up);e.CONSUME(B),e.SUBRULE(e.expressionFn),e.CONSUME(P),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"description?":"[string]","disabled?":"[boolean]","payload?":"[expression]","error?":"[expression]","error_type?":["standard","notfound","accessdenied","toomanyrequests","unauthorized","badrequest","inputerror"]}]}),e.sectionStack.pop()}}r(Rg,"preconditionFn");function Lg(e){let t=["value"],o=["description","disabled"];return()=>{e.sectionStack.push("return");let n=e.CONSUME(Ac);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(Lg,"returnFn");function xg(e){return()=>{e.sectionStack.push("switchCaseFn"),e.CONSUME(gc),e.CONSUME(B),e.SUBRULE(e.expressionFn),e.CONSUME(P),e.OPTION(()=>e.SUBRULE(e.nakedStackFn)),e.OPTION1(()=>e.CONSUME(No)),e.sectionStack.pop()}}r(xg,"switchCaseFn");function Cg(e){return()=>{e.sectionStack.push("switchDefaultFn"),e.CONSUME(kc),e.SUBRULE(e.nakedStackFn),e.sectionStack.pop()}}r(Cg,"switchDefaultFn");function Og(e){return()=>{e.sectionStack.push("switchFn"),e.CONSUME(Uc),e.CONSUME(B),e.SUBRULE(e.expressionFn),e.CONSUME(P),e.OPTION(()=>{e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")},{ALT:r(()=>{e.MANY1(()=>{e.MANY3(()=>e.CONSUME3(m)),e.SUBRULE(e.switchCaseFn)})},"ALT")}])}),e.OPTION1(()=>{e.MANY4(()=>e.CONSUME4(m)),e.SUBRULE(e.switchDefaultFn)}),e.MANY2(()=>e.CONSUME1(m)),e.CONSUME(A)}),e.sectionStack.pop()}}r(Og,"switchFn");function Ng(e){let t=[],o=["description","disabled"];return()=>{e.sectionStack.push("taskCallFn"),e.CONSUME(sn),e.CONSUME(g);let n=e.CONSUME(Du);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}]),e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(Ng,"taskCallFn");function bg(e){let t=["value","name"],o=["description","disabled"];return()=>{e.sectionStack.push("throw");let n=e.CONSUME(xc);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(bg,"throwFn");function Mg(e){return()=>{let t=!1,o=!1;e.sectionStack.push("tryCatchFn"),e.CONSUME(hc),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")},{ALT:r(()=>{t=!0,e.CONSUME(Wn),e.OPTION(()=>e.SUBRULE(e.nakedStackFn))},"ALT")},{ALT:r(()=>{o=!0,e.CONSUME(Yn),e.sectionStack.push("catchFn"),e.OPTION1(()=>e.SUBRULE1(e.nakedStackFn)),e.sectionStack.pop()},"ALT")},{ALT:r(()=>{e.CONSUME(Sc),e.OPTION2(()=>e.SUBRULE2(e.nakedStackFn))},"ALT")}])}),t||(e.CONSUME(Wn),e.SUBRULE(e.nakedStackFn)),o||(e.CONSUME(Yn),e.SUBRULE(e.nakedStackFn)),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(Mg,"tryCatchFn");function yg(e){return()=>{let t=!1;e.sectionStack.push("whileFn"),e.CONSUME(Rc),e.CONSUME(B),e.MANY(()=>e.CONSUME(m)),e.SUBRULE(e.expressionFn),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(P),e.OPTION(()=>{e.CONSUME(S),e.MANY2(()=>{e.AT_LEAST_ONE(()=>e.CONSUME2(m)),e.OR([{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")},{ALT:r(()=>{t=!0,e.CONSUME(mt),e.OPTION1(()=>e.SUBRULE(e.nakedStackFn))},"ALT")}])}),t||(e.CONSUME(mt),e.SUBRULE(e.nakedStackFn)),e.MANY3(()=>e.CONSUME3(m)),e.CONSUME(A)}),e.sectionStack.pop()}}r(yg,"whileFn");var Fg=r(e=>{e.awaitFn=e.RULE("awaitFn",fg(e)),e.conditionalElifFn=e.RULE("conditionalElifFn",dg(e)),e.conditionalElseFn=e.RULE("conditionalElseFn",Tg(e)),e.conditionalFn=e.RULE("conditionalFn",Eg(e)),e.conditionalIfFn=e.RULE("conditionalIfFn",hg(e)),e.forEachFn=e.RULE("forEachFn",Sg(e)),e.forFn=e.RULE("forFn",Ag(e)),e.functionRunFn=e.RULE("functionRunFn",gg(e)),e.functionCallFn=e.RULE("functionCallFn",Ug(e)),e.taskCallFn=e.RULE("taskCallFn",Ng(e)),e.groupFn=e.RULE("groupFn",kg(e)),e.preconditionFn=e.RULE("preconditionFn",Rg(e)),e.returnFn=e.RULE("returnFn",Lg(e)),e.switchCaseFn=e.RULE("switchCaseFn",xg(e)),e.switchDefaultFn=e.RULE("switchDefaultFn",Cg(e)),e.switchFn=e.RULE("switchFn",Og(e)),e.throwFn=e.RULE("throwFn",bg(e)),e.tryCatchFn=e.RULE("tryCatchFn",Mg(e)),e.whileFn=e.RULE("whileFn",yg(e))},"register");var Be={name:"[string]","input?":{"[string]":"[expression]"},"as?":"[string]","output?":["[string]"]};Be["addon?"]=[Be];function _g(e){return()=>{e.sectionStack.push("dbAddFn");let t=e.CONSUME(Mo);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{data:{"[string]":"[expression]"},"description?":"[string]","disabled?":"[boolean]","addon?":[Be],"mock?":{"![string]":"[expression]"},"output?":["[string]"]}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(_g,"dbAddFn");function Ig(e){return t=>{e.sectionStack.push("dbAddonAttr"),e.SUBRULE(e.schemaFn,{ARGS:[t,[Be]]}),e.sectionStack.pop()}}r(Ig,"dbAddonAttr");function vg(e){return()=>{e.sectionStack.push("dbAddOrEditFn");let t=e.CONSUME(Vc);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{field_name:"[expression]",field_value:"[expression]",data:{"[string]":"[expression]"},"description?":"[string]","disabled?":"[boolean]","addon?":[Be],"mock?":{"![string]":"[expression]"}}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(vg,"dbAddOrEditFn");function wg(e){return()=>{e.sectionStack.push("dbBulkAddFn");let t=e.CONSUME(Mo);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"});let o={};e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"items?":"[expression]","allow_id_field?":"[boolean]","description?":"[string]","disabled?":"[boolean]"},o]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(wg,"dbBulkAddFn");function Bg(e){return()=>{e.sectionStack.push("dbBulkDeleteFn");let t=e.CONSUME(jc);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"where?":"[query]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Bg,"dbBulkDeleteFn");function Pg(e){return()=>{e.sectionStack.push("db.bulk"),e.CONSUME(Qc),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.dbBulkDeleteFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbBulkUpdateFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbBulkPatchFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbBulkAddFn),"ALT")}]),e.sectionStack.pop()}}r(Pg,"dbBulkFn");function Gg(e){return()=>{e.sectionStack.push("dbBulkPatchFn");let t=e.CONSUME(yo);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"items?":"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Gg,"dbBulkPatchFn");function Dg(e){return()=>{e.sectionStack.push("dbBulkUpdateFn");let t=e.CONSUME(Yc);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"items?":"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Dg,"dbBulkUpdateFn");function Vg(e){return()=>{e.sectionStack.push("dbDelFn");let t=e.CONSUME(qc);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{field_name:"[expression]",field_value:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.sectionStack.pop()}}r(Vg,"dbDelFn");function qg(e){return()=>{e.sectionStack.push("dbDirectQueryFn");let t=e.CONSUME(Fo);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{sql:"[expression]","response_type?":["list","single"],"parser?":["template_engine","prepared"],"description?":"[string]","disabled?":"[boolean]","arg*":"[expression]","mock?":{"![string]":"[expression]"}}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(qg,"dbDirectQueryFn");function jg(e){return()=>{e.sectionStack.push("dbEditFn");let t=e.CONSUME(Wc);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{field_name:"[expression]",field_value:"[expression]",data:{"[string]":"[expression]"},"description?":"[string]","disabled?":"[boolean]","output?":["[string]"],"addon?":[Be],"mock?":{"![string]":"[expression]"}}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(jg,"dbEditFn");function Wg(e){return()=>{e.sectionStack.push("dbExternalDirectQueryFn");let t=e.CONSUME(Fo);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{sql:"[expression]",response_type:["list","single"],connection_string:"[expression]","description?":"[string]","disabled?":"[boolean]","arg*":"[expression]","mock?":{"![string]":"[expression]"}}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Wg,"dbExternalDirectQueryFn");function Yg(e){return()=>{e.sectionStack.push("dbExternalFn"),e.CONSUME(Zc),e.CONSUME(g),e.OR([{ALT:r(()=>e.CONSUME($c),"ALT")},{ALT:r(()=>e.CONSUME(el),"ALT")},{ALT:r(()=>e.CONSUME(rl),"ALT")},{ALT:r(()=>e.CONSUME(tl),"ALT")}]),e.CONSUME1(g),e.SUBRULE(e.dbExternalDirectQueryFn),e.sectionStack.pop()}}r(Yg,"dbExternalFn");function Kg(e){return()=>{e.sectionStack.push("dbGetFn");let t=e.CONSUME(Dc);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{field_name:"[expression]",field_value:"[expression]","description?":"[string]","disabled?":"[boolean]","output?":["[string]"],"lock?":"[boolean]","addon?":[Be],"mock?":{"![string]":"[expression]"}}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Kg,"dbGetFn");function Hg(e){return()=>{e.sectionStack.push("dbHasFn");let t=e.CONSUME(Kc);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{field_name:"[expression]",field_value:"[expression]","description?":"[string]","disabled?":"[boolean]","mock?":{"![string]":"[expression]"}}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Hg,"dbHasFn");function zg(e){return()=>{e.sectionStack.push("dbPatchFn");let t=e.CONSUME(yo);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{field_name:"[expression]",field_value:"[expression]",data:"[expression]","description?":"[string]","disabled?":"[boolean]","addon?":[Be],"mock?":{"![string]":"[expression]"}}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(zg,"dbPatchFn");function Jg(e){return()=>{e.sectionStack.push("dbQueryFn");let t=e.CONSUME(Gc);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}]),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"eval?":{"[string]":"[query]"},"return?":{type:["list","stream","exists","count","single","aggregate"],"paging?":{"page?":"[expression]","per_page?":"[expression]","offset?":"[expression]","totals?":"[boolean]","metadata?":"[boolean]"},"distinct?":["yes","no"],"group?":{"[string]":"[query]"},"eval?":{"[string]":"[expression]"}},"join?":{"[string]":{table:"[string]","type?":["inner","left","right"],"where?":"[query]"}},"lock?":"[boolean]","disabled?":"[boolean]","description?":"[string]","mock?":{"![string]":"[expression]"},"addon?":[Be],"sort?":{"[string]":["asc","desc","rand"]},"override_sort?":"[expression]","output?":["[string]"],"where?":"[query]","additional_where?":"[query]"}]});let o=e.sectionStack.includes("addonDeclaration");e.OR1([{GATE:r(()=>!o,"GATE"),ALT:r(()=>e.SUBRULE(e.asVariable,{ARGS:[t]}),"ALT")},{GATE:r(()=>o,"GATE"),ALT:r(()=>{},"ALT")}]),e.sectionStack.pop()}}r(Jg,"dbQueryFn");function Xg(e){return()=>{let t=[],o=["description","disabled","path"];e.sectionStack.push("dbSchemaFn");let n=e.CONSUME(Hc);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}]),e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(Xg,"dbSchemaFn");function Qg(e){let t=["value"],o=["description","disabled"];return()=>{e.sectionStack.push("dbSetDatasourceFn");let n=e.CONSUME(Xc);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(Qg,"dbSetDatasourceFn");function Zg(e){return()=>{let t=!1;e.sectionStack.push("dbTransactionFn"),e.CONSUME(zc),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")},{ALT:r(()=>{t=!0,e.SUBRULE(e.stackClause)},"ALT")}])}),t||e.SUBRULE(e.stackClause),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(Zg,"dbTransactionFn");function $g(e){return()=>{e.sectionStack.push("dbTruncateFn");let t=e.CONSUME(Jc);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"reset?":"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.sectionStack.pop()}}r($g,"dbTruncateFn");var ek=r(e=>{e.dbAddFn=e.RULE("dbAddFn",_g(e)),e.dbBulkFn=e.RULE("dbBulkFn",Pg(e)),e.dbBulkAddFn=e.RULE("dbBulkAddFn",wg(e)),e.dbBulkDeleteFn=e.RULE("dbBulkDeleteFn",Bg(e)),e.dbBulkUpdateFn=e.RULE("dbBulkUpdateFn",Dg(e)),e.dbBulkPatchFn=e.RULE("dbBulkPatchFn",Gg(e)),e.dbDelFn=e.RULE("dbDelFn",Vg(e)),e.dbDirectQueryFn=e.RULE("dbDirectQueryFn",qg(e)),e.dbEditFn=e.RULE("dbEditFn",jg(e)),e.dbExternalDirectQueryFn=e.RULE("dbExternalDirectQueryFn",Wg(e)),e.dbExternalFn=e.RULE("dbExternalFn",Yg(e)),e.dbGetFn=e.RULE("dbGetFn",Kg(e)),e.dbHasFn=e.RULE("dbHasnpmFn",Hg(e)),e.dbPatchFn=e.RULE("dbPatchFn",zg(e)),e.dbQueryFn=e.RULE("dbQueryFn",Jg(e)),e.dbSchemaFn=e.RULE("dbSchemaFn",Xg(e)),e.dbSetDatasourceFn=e.RULE("dbSetDatasourceFn",Qg(e)),e.dbTransactionFn=e.RULE("dbTransactionFn",Zg(e)),e.dbTruncateFn=e.RULE("dbTruncateFn",$g(e)),e.dbAddOrEditFn=e.RULE("dbAddOrEditFn",vg(e)),e.dbAddonAttr=e.RULE("dbAddonAttr",Ig(e))},"register");function tk(e){return()=>{e.sectionStack.push("db"),e.CONSUME(bo),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.dbExternalFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbGetFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbHasFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbEditFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbDelFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbAddFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbDirectQueryFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbSetDatasourceFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbQueryFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbSchemaFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbTruncateFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbTransactionFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbPatchFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbBulkFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbAddOrEditFn),"ALT")}]),e.sectionStack.pop()}}r(tk,"dbFn");function rk(e){let t=["value"],o=["description","disabled"];return()=>{e.sectionStack.push("debugLog");let n=e.CONSUME(al);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(rk,"debugLogFn");function ok(e){let t=["value"],o=["description","disabled"];return()=>{e.sectionStack.push("debugStop");let n=e.CONSUME(nl);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(ok,"debugStopFn");var nk=r(e=>{e.debugLogFn=e.RULE("debugLogFn",rk(e)),e.debugStopFn=e.RULE("debugStopFn",ok(e))},"register");function ak(e){return()=>{e.sectionStack.push("debug"),e.CONSUME(ol),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.debugLogFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.debugStopFn),"ALT")}]),e.sectionStack.pop()}}r(ak,"debugFn");function ik(e){let t=["min","max"],o=[];return()=>{e.sectionStack.push("unitExpectToBeWithinFn");let n=e.CONSUME(Qo);e.CONSUME(B),e.CONSUME(ur),e.MANY(()=>{e.CONSUME(g),e.CONSUME(a)}),e.CONSUME(P),e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(ik,"unitExpectToBeWithinFn");function sk(e){return()=>{e.sectionStack.push("unitExpectToThrowFn");let t=e.CONSUME(Zo);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"exception?":"[string]"}]}),e.sectionStack.pop()}}r(sk,"unitExpectToThrowFn");function ck(e){return()=>{e.sectionStack.push("unitExpectWithArgumentsFn");let t=e.OR([{ALT:r(()=>e.CONSUME(zo),"ALT")},{ALT:r(()=>e.CONSUME(jo),"ALT")},{ALT:r(()=>e.CONSUME(Wo),"ALT")},{ALT:r(()=>e.CONSUME(Yo),"ALT")},{ALT:r(()=>e.CONSUME(Ko),"ALT")},{ALT:r(()=>e.CONSUME(Ho),"ALT")},{ALT:r(()=>e.CONSUME(Jo),"ALT")},{ALT:r(()=>e.CONSUME(Xo),"ALT")}]);e.CONSUME(B),e.CONSUME(ur),e.MANY(()=>{e.CONSUME(g),e.CONSUME(a)}),e.CONSUME(P),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{value:"[constant]"}]}),e.sectionStack.pop()}}r(ck,"unitExpectWithArgumentsFn");function lk(e){return()=>{e.sectionStack.push("unitExpectWithoutArgumentsFn"),e.OR([{ALT:r(()=>e.CONSUME(Io),"ALT")},{ALT:r(()=>e.CONSUME(vo),"ALT")},{ALT:r(()=>e.CONSUME(wo),"ALT")},{ALT:r(()=>e.CONSUME(Bo),"ALT")},{ALT:r(()=>e.CONSUME(Po),"ALT")},{ALT:r(()=>e.CONSUME(Go),"ALT")},{ALT:r(()=>e.CONSUME(Do),"ALT")},{ALT:r(()=>e.CONSUME(Vo),"ALT")},{ALT:r(()=>e.CONSUME(qo),"ALT")}]),e.CONSUME(B),e.CONSUME(ur),e.MANY(()=>{e.CONSUME(g),e.CONSUME(a)}),e.CONSUME(P),e.sectionStack.pop()}}r(lk,"unitExpectWithoutArgumentsFn");function uk(e){let t=["min","max"],o=["description","disabled"];return()=>{e.sectionStack.push("workflowExpectToBeWithinFn");let n=e.CONSUME(Qo);e.CONSUME(B),e.SUBRULE(e.expressionFn),e.CONSUME(P),e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(uk,"workflowExpectToBeWithinFn");function pk(e){return()=>{e.sectionStack.push("workflowExpectToThrowFn");let t=e.CONSUME(Zo);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"stack?":"[test-stack]","exception?":"[string]"}]}),e.sectionStack.pop()}}r(pk,"workflowExpectToThrowFn");function mk(e){let t=["value"],o=["description","disabled"];return()=>{e.sectionStack.push("workflowExpectWithArgumentsFn");let n=e.OR([{ALT:r(()=>e.CONSUME(zo),"ALT")},{ALT:r(()=>e.CONSUME(jo),"ALT")},{ALT:r(()=>e.CONSUME(Wo),"ALT")},{ALT:r(()=>e.CONSUME(Yo),"ALT")},{ALT:r(()=>e.CONSUME(Ko),"ALT")},{ALT:r(()=>e.CONSUME(Ho),"ALT")},{ALT:r(()=>e.CONSUME(Jo),"ALT")},{ALT:r(()=>e.CONSUME(Xo),"ALT")}]);e.CONSUME(B),e.SUBRULE(e.expressionFn),e.CONSUME(P),e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(mk,"workflowExpectWithArgumentsFn");function fk(e){return()=>{e.sectionStack.push("workflowExpectWithoutArgumentsFn");let t=e.OR([{ALT:r(()=>e.CONSUME(Io),"ALT")},{ALT:r(()=>e.CONSUME(vo),"ALT")},{ALT:r(()=>e.CONSUME(wo),"ALT")},{ALT:r(()=>e.CONSUME(Bo),"ALT")},{ALT:r(()=>e.CONSUME(Po),"ALT")},{ALT:r(()=>e.CONSUME(Go),"ALT")},{ALT:r(()=>e.CONSUME(Do),"ALT")},{ALT:r(()=>e.CONSUME(Vo),"ALT")},{ALT:r(()=>e.CONSUME(qo),"ALT")}]);e.CONSUME(B),e.SUBRULE(e.expressionFn),e.CONSUME(P),e.SUBRULE(e.functionAttrReq,{ARGS:[t,[],["description","disabled"]]}),e.sectionStack.pop()}}r(fk,"workflowExpectWithoutArgumentsFn");var dk=r(e=>{e.unitExpectWithArgumentsFn=e.RULE("unitExpectWithArgumentsFn",ck(e)),e.unitExpectWithoutArgumentsFn=e.RULE("unitExpectWithoutArgumentsFn",lk(e)),e.unitExpectToThrowFn=e.RULE("unitExpectToThrowFn",sk(e)),e.unitExpectToBeWithinFn=e.RULE("unitExpectToBeWithinFn",ik(e)),e.workflowExpectWithArgumentsFn=e.RULE("workflowExpectWithArgumentsFn",mk(e)),e.workflowExpectWithoutArgumentsFn=e.RULE("workflowExpectWithoutArgumentsFn",fk(e)),e.workflowExpectToThrowFn=e.RULE("workflowExpectToThrowFn",pk(e)),e.workflowExpectToBeWithinFn=e.RULE("workflowExpectToBeWithinFn",uk(e))},"register");function Tk(e){return()=>{let t=!1;e.sectionStack.push("allMathFn"),e.OR([{ALT:r(()=>e.CONSUME(ll),"ALT")},{ALT:r(()=>e.CONSUME(ul),"ALT")},{ALT:r(()=>e.CONSUME(pl),"ALT")},{ALT:r(()=>e.CONSUME(ml),"ALT")},{ALT:r(()=>e.CONSUME(fl),"ALT")},{ALT:r(()=>{e.CONSUME(dl),e.CONSUME(g),e.OR1([{ALT:r(()=>e.CONSUME(Tl),"ALT")},{ALT:r(()=>e.CONSUME(El),"ALT")},{ALT:r(()=>e.CONSUME(hl),"ALT")}])},"ALT")}]),e.SUBRULE(e.assignableVariableProperty),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>{t=!0,e.SUBRULE(e.valueFieldAttribute)},"ALT")},{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")}])}),t||e.SUBRULE(e.valueFieldAttribute),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(Tk,"allMathFn");var Ek=r(e=>{e.allMathFn=e.RULE("allMathFn",Tk(e))},"register");function hk(e){return()=>{e.sectionStack.push("math"),e.CONSUME(cl),e.CONSUME(g),e.SUBRULE(e.allMathFn),e.sectionStack.pop()}}r(hk,"mathFn");function Sk(e){return()=>{e.sectionStack.push("middlewareCallFn"),e.CONSUME($o),e.CONSUME(g);let t=e.CONSUME(ir);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}]),e.OPTION(()=>{e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{input:{vars:"[expression]",type:"[expression]"},"mock?":{"![string]":"[expression]"},"description?":"[string]","disabled?":"[boolean]"}]})}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Sk,"middlewareCallFn");function Ak(e){return()=>{let t=["value"],o=["description","disabled"];e.sectionStack.push("objectEntriesFn");let n=e.CONSUME(Ml);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(Ak,"objectEntriesFn");function Uk(e){return()=>{let t=["value"],o=["description","disabled"];e.sectionStack.push("objectKeysFn");let n=e.CONSUME(yl);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(Uk,"objectKeysFn");function gk(e){return()=>{let t=["value"],o=["description","disabled"];e.sectionStack.push("objectValuesFn");let n=e.CONSUME(Fl);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(gk,"objectValuesFn");var kk=r(e=>{e.objectEntriesFn=e.RULE("objectEntriesFn",Ak(e)),e.objectKeysFn=e.RULE("objectKeysFn",Uk(e)),e.objectValuesFn=e.RULE("objectValuesFn",gk(e))},"register");function Rk(e){return()=>{e.sectionStack.push("object"),e.CONSUME(bl),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.objectEntriesFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.objectKeysFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.objectValuesFn),"ALT")}]),e.sectionStack.pop()}}r(Rk,"objectFn");function Lk(e){return()=>{e.sectionStack.push("redisCountFn");let t=e.CONSUME(Vl);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Lk,"redisCountFn");function xk(e){return()=>{e.sectionStack.push("redisDecrFn");let t=e.CONSUME(ql);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]",by:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(xk,"redisDecrFn");function Ck(e){return()=>{e.sectionStack.push("redisDelFn");let t=e.CONSUME(jl);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.sectionStack.pop()}}r(Ck,"redisDelFn");function Ok(e){return()=>{e.sectionStack.push("redisGetFn");let t=e.CONSUME(Wl);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Ok,"redisGetFn");function Nk(e){return()=>{e.sectionStack.push("redisHasFn");let t=e.CONSUME(Yl);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Nk,"redisHasFn");function bk(e){return()=>{e.sectionStack.push("redisIncrFn");let t=e.CONSUME(Kl);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]",by:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(bk,"redisIncrFn");function Mk(e){return()=>{e.sectionStack.push("redisKeysFn");let t=e.CONSUME(Hl);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{search:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Mk,"redisKeysFn");function yk(e){return()=>{e.sectionStack.push("redisPopFn");let t=e.CONSUME(zl);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(yk,"redisPopFn");function Fk(e){return()=>{e.sectionStack.push("redisPushFn");let t=e.CONSUME(Jl);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]",value:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Fk,"redisPushFn");function _k(e){return()=>{e.sectionStack.push("redisRangeFn");let t=e.CONSUME(Xl);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]",start:"[expression]",stop:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(_k,"redisRangeFn");function Ik(e){return()=>{e.sectionStack.push("redisRateLimitFn");let t=e.CONSUME(Ql);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]",max:"[expression]",ttl:"[expression]",error:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Ik,"redisRateLimitFn");function vk(e){return()=>{e.sectionStack.push("redisRemoveFn");let t=e.CONSUME(Zl);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]",value:"[expression]",count:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.sectionStack.pop()}}r(vk,"redisRemoveFn");function wk(e){return()=>{e.sectionStack.push("redisSetFn");let t=e.CONSUME($l);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]",data:"[expression]",ttl:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.sectionStack.pop()}}r(wk,"redisSetFn");function Bk(e){return()=>{e.sectionStack.push("redisShiftFn");let t=e.CONSUME(eu);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Bk,"redisShiftFn");function Pk(e){return()=>{e.sectionStack.push("redisUnshiftFn");let t=e.CONSUME(tu);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]",value:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Pk,"redisUnshiftFn");var Gk=r(e=>{e.redisCountFn=e.RULE("redisCountFn",Lk(e)),e.redisDecrFn=e.RULE("redisDecrFn",xk(e)),e.redisDelFn=e.RULE("redisDelFn",Ck(e)),e.redisGetFn=e.RULE("redisGetFn",Ok(e)),e.redisHasFn=e.RULE("redisHasFn",Nk(e)),e.redisIncrFn=e.RULE("redisIncrFn",bk(e)),e.redisKeysFn=e.RULE("redisKeysFn",Mk(e)),e.redisPopFn=e.RULE("redisPopFn",yk(e)),e.redisPushFn=e.RULE("redisPushFn",Fk(e)),e.redisRangeFn=e.RULE("redisRangeFn",_k(e)),e.redisRateLimitFn=e.RULE("redisRateLimitFn",Ik(e)),e.redisRemoveFn=e.RULE("redisRemoveFn",vk(e)),e.redisSetFn=e.RULE("redisSetFn",wk(e)),e.redisShiftFn=e.RULE("redisShiftFn",Bk(e)),e.redisUnshiftFn=e.RULE("redisUnshiftFn",Pk(e))},"register");function Dk(e){return()=>{e.sectionStack.push("redis"),e.CONSUME(Dl),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.redisDelFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisSetFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisGetFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisHasFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisIncrFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisDecrFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisKeysFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisPushFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisUnshiftFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisPopFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisShiftFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisRemoveFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisCountFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisRangeFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisRateLimitFn),"ALT")}]),e.sectionStack.pop()}}r(Dk,"redisFn");function Vk(e){return(t,o,n={},i)=>{let s=!1;n.value=[],e.CONSUME(re),e.MANY1(()=>e.CONSUME(m)),e.MANY(()=>{let c={};e.SUBRULE(e.schemaFn,{ARGS:[t,Se(o),c,i]}),s&&e.addInvalidValueError("Expected a comma, a new line or closing bracket"),n.value.push(c),s=!0,e.OPTION(()=>(s=!1,e.CONSUME1(je))),e.MANY2(()=>{s=!1,e.CONSUME1(m)})}),e.CONSUME(oe)}}r(Vk,"schemaParseArrayFn");function Xm(e){return typeof e!="object"||!Array.isArray(e)?!1:e.length==1}r(Xm,"schemaExpectArray");function Ct(e){return!e||typeof e!="string"?!1:e.endsWith("?")||e.endsWith("*")}r(Ct,"isOptionalAttribute");function Qp(e){return!e||typeof e!="string"?!1:e.endsWith("*")}r(Qp,"isMultiAttribute");function Pr(e){return!e||typeof e!="string"?!1:e.startsWith("!")}r(Pr,"canBeDisabledAttribute");function Je(e){return!e||typeof e!="string"?!1:(Ct(e)&&(e=e.slice(0,-1)),Pr(e)&&(e=e.slice(1)),e.startsWith("[")&&e.endsWith("]"))}r(Je,"isSchemaGenericType");function mI(e){return Pr(e)&&(e=e.slice(1)),Ct(e)&&(e=e.slice(0,-1)),e}r(mI,"getSchemaConstantValue");function qk(e){return Je(e)?(Ct(e)&&(e=e.slice(0,-1)),Pr(e)&&(e=e.slice(1)),e.slice(1,-1)):null}r(qk,"getSchemaGenericTypeName");function Xe(e,t){return Je(e)?t.includes(qk(e)):!1}r(Xe,"schemaExpectOneOf");var Zp=r((e,t)=>{for(let o of t)if(Je(o))switch(qk(o)){case"string":if(typeof e=="string")return o;break;case"number":if(!isNaN(Number(e)))return o;break;case"boolean":if(e==="true"||e==="false")return o;break}else{if(mI(o)===e)return o;if(e===o)return o}return!1},"valueMatchRequirements");function jk(e){return(t,o,n={})=>{let i=null,s=e.OR({IGNORE_AMBIGUITIES:!0,DEF:[{ALT:r(()=>(i="string",e.CONSUME(E)),"ALT")},{ALT:r(()=>(i="string",e.CONSUME(ze)),"ALT")},{ALT:r(()=>(i="string",e.CONSUME(Lt)),"ALT")},{ALT:r(()=>(i="number",e.CONSUME(X)),"ALT")},{ALT:r(()=>(i="number",e.CONSUME(_e)),"ALT")},{ALT:r(()=>(i="boolean",e.CONSUME(Ue)),"ALT")},{ALT:r(()=>(i="boolean",e.CONSUME(ge)),"ALT")},{ALT:r(()=>(i="null",e.CONSUME(xt)),"ALT")}]});n.value=s,e.ACTION(()=>{Wk(i,s.image,o)||e.addExpectedValueError(t,o)})}}r(jk,"schemaParseConstantFn");function Wk(e,t,o){let n=o!==null?o.toString():o;if(b(o))return lt(o,i=>Wk(e,t,i));switch(e){case"string":return(t.startsWith('"""')||t.startsWith("'''"))&&(t=t.slice(4,-4).trim()),(t.startsWith('"')||t.startsWith("'"))&&(t=t.slice(1,-1)),t===n;case"number":case"boolean":return t===n;case"null":return n===null;default:throw new Error(`schemaParseConstantFn called with non-constant attribute: ${o}`)}}r(Wk,"matchValueToSchema");function Qm(e){return Je(e)?!1:typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null}r(Qm,"schemaExpectConstant");function Yk(e){return(t,o,n={})=>{let[i,s]=um(o,Je);e.ACTION(()=>{if(s.length>0&&i.length>0)throw new Error("schemaParseEnumFn does not support mixing constant and immutable types in the same enum, received: "+JSON.stringify(o))}),e.OR({IGNORE_AMBIGUITIES:!0,DEF:[{GATE:r(()=>s.length>0,"GATE"),ALT:r(()=>e.SUBRULE(e.schemaParseConstantFn,{ARGS:[t,s,n]}),"ALT")},{GATE:r(()=>i.length>0,"GATE"),ALT:r(()=>e.SUBRULE(e.schemaParseImmutableFn,{ARGS:[t,i,n]}),"ALT")}]})}}r(Yk,"schemaParseEnumFn");function Zm(e){return!!(b(e)&&e.length>1)}r(Zm,"schemaExpectEnum");function Kk(e){return(t,o,n={},i)=>{let s=!1,c=null,l=j(o),p=[...l],f=[];if(e.ACTION(()=>{if(l.length>1&<(l,d=>Je(d)))throw new Error("schemaParseObjectFn supports only one generic type when multiple keys are defined")}),e.CONSUME(S),e.MANY(()=>{e.MANY1(()=>{s=!1,e.CONSUME(m)}),s&&e.addInvalidValueError(c,"Expected a comma, a new line or closing bracket");let d=e.OPTION1(()=>e.CONSUME(Ne)),T,U=e.OR([{ALT:r(()=>{T=e.CONSUME(a);let L=[T];return e.MANY3(()=>{L.push(e.CONSUME(g)),L.push(e.CONSUME1(a))}),L.map(N=>N.image).join(".")},"ALT")},{ALT:r(()=>e.CONSUME(E).image.slice(1,-1),"ALT")}]),k=Zp(U,l);k?d&&!Pr(k)&&e.addInvalidValueError(d,`The key '${U}' cannot be disabled`):e.addInvalidValueError(T,`The key '${U}' is not valid in this context`),f.includes(U)&&!Qp(k)?e.addInvalidValueError(T,`Duplicate key '${U}' found`):(f.push(U),n[U]={key:T,value:null}),p.splice(p.indexOf(k),1),e.CONSUME(be);let C=Mr(o,k,null);e.SUBRULE(e.schemaFn,{ARGS:[T,C,n[U],i]}),s=!0,e.OPTION(()=>{s=!1,e.CONSUME1(je)}),e.MANY2(()=>{s=!1,e.CONSUME1(m)})}),e.CONSUME(A),p.length){let d=p.filter(T=>!Ct(T));d.length>1?e.addMissingError(c||t,`{} is missing the following required entries: ${d.join(", ")}`):d.length===1&&(Je(d[0])?e.addMissingError(c||t,"{} requires a least one entry"):e.addMissingError(c||t,`{} is missing required key '${d[0]}'`))}return{foo:"foo-bar"}}}r(Kk,"schemaParseObjectFn");function $m(e){return La(e)}r($m,"schemaExpectObject");var fI=r(e=>Xe(e,["string","number","boolean","timestamp","null"])?b(e)?`Expected one of the following types: ${e.join(", ")}`:`Expected a ${e}`:Qm(e)?b(e)?`Expected one of the following constants: ${e.join(", ")}`:`Expected a ${e}`:Xm(e)?`Expected an array of ${e[0]}`:$m(e)?"Expected an object {}":Zm(e)?`Expected one of the following enum values: ${e.join(", ")}`:Xe(e,["mock"])?"Expected a mock":Xe(e,["expression"])?"Expected an expression":Xe(e,["query"])?"Expected a database query expression":Xe(e,["constant"])?"Expected a value expression (no variables allowed)":Xe(e,["stack"])?"Expected a stack definition":`Invalid schema: received ${JSON.stringify(e)}`,"getErrorMessageForSchema");function Hk(e){return(t,o,n={},i)=>{e.sectionStack.push("schema"),e.OR({IGNORE_AMBIGUITIES:!0,ERR_MSG:fI(o),DEF:[{GATE:r(()=>Xe(o,["string","number","boolean","timestamp"],n),"GATE"),ALT:r(()=>(e.SUBRULE(e.schemaParseImmutableFn,{ARGS:[t,o,n]}),!0),"ALT")},{GATE:r(()=>Qm(o),"GATE"),ALT:r(()=>(e.SUBRULE(e.schemaParseConstantFn,{ARGS:[t,o,n]}),!0),"ALT")},{GATE:r(()=>Xm(o),"GATE"),ALT:r(()=>(e.SUBRULE(e.schemaParseArrayFn,{ARGS:[t,o,n]}),!0),"ALT")},{GATE:r(()=>$m(o),"GATE"),ALT:r(()=>(e.SUBRULE(e.schemaParseObjectFn,{ARGS:[t,o,n]}),!0),"ALT")},{GATE:r(()=>Zm(o),"GATE"),ALT:r(()=>(e.SUBRULE(e.schemaParseEnumFn,{ARGS:[t,o,n]}),!0),"ALT")},{GATE:r(()=>Xe(o,["expression","constant","query","stack","test-stack"]),"GATE"),ALT:r(()=>{e.OR1({IGNORE_AMBIGUITIES:!0,DEF:[{GATE:r(()=>Xe(o,["stack","test-stack"]),"GATE"),ALT:r(()=>{let s=Xe(o,["test-stack"]);e.SUBRULE(e.nakedStackFn,{ARGS:[{allowExpectStatements:s,allowCallStatements:s}]})},"ALT")},{GATE:r(()=>Xe(o,["expression","query","constant"]),"GATE"),ALT:r(()=>{let s=Xe(o,["query"]),c=Xe(o,["constant"]);e.SUBRULE(e.expressionFn,{ARGS:[t,i||{allowQueryExpression:s,allowVariable:!c,allowExpression:!c,allowComparison:!c}]})},"ALT")}]})},"ALT")}]}),e.sectionStack.pop()}}r(Hk,"schemaFn");function zk(e){return e.requireRules(dI),(t,o,n={})=>{let i=j(o).every(s=>Ct(s));e.OR([{GATE:r(()=>i,"GATE"),ALT:r(()=>{e.OPTION(()=>e.SUBRULE(e._schemaParseAttributeFn,{ARGS:[t,o,n]}))},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>e.SUBRULE1(e._schemaParseAttributeFn,{ARGS:[t,o,n]}),"ALT")}])}}r(zk,"schemaParseAttributeFn");function dI(e){return(t,o,n={})=>{let i=!1,s=null,c=j(o),l=[...c],p=[];if(e.ACTION(()=>{if(c.length>1&<(c,f=>Je(f)))throw new Error("schemaParseAttributeFn supports only one generic type when multiple keys are defined")}),e.CONSUME(S),e.MANY(()=>{e.MANY1(()=>{i=!1,e.CONSUME(m)}),i&&e.addInvalidValueError(s,"Expected a comma, a new line or closing bracket");let f=e.OPTION1(()=>e.CONSUME(Ne)),d,T=e.OR([{ALT:r(()=>(d=e.CONSUME1(a),d.image),"ALT")},{ALT:r(()=>e.CONSUME1(E).image.slice(1,-1),"ALT")}]),U=Zp(T,c);U?f&&!Pr(U)&&e.addInvalidValueError(f,`The argument '${T}' cannot be disabled`):e.addInvalidValueError(d,`The argument '${T}' is not valid in this context`),p.includes(T)&&!Qp(U)?e.addInvalidValueError(d,`Duplicate argument '${T}' found`):(p.push(T),n[T]={key:d,value:null}),l.splice(l.indexOf(U),1);let k=Mr(o,U,null),C=["[stack]","[test-stack]"].includes(k);e.OR1([{GATE:r(()=>!C,"GATE"),ALT:r(()=>e.CONSUME(h),"ALT")},{GATE:r(()=>C,"GATE"),ALT:r(()=>!1,"ALT")}]),e.SUBRULE(e.schemaFn,{ARGS:[d,k,n[T]]}),i=!0,e.MANY2(()=>{i=!1,e.CONSUME1(m)}),e.OPTION(()=>{i=!1,e.CONSUME1(je)})}),e.CONSUME(A),l.length){let f=l.filter(d=>!Ct(d));f.length>1?e.addInvalidValueError(s||t,`The following required arguments are missing: ${f.join(", ")}`):f.length===1&&e.addInvalidValueError(s||t,`Missing required argument '${f[0]}'`)}}}r(dI,"_schemaParseAttributeFn");function Xk(e){return(t,o,n={})=>{let i,s=e.OR({DEF:[{ALT:r(()=>(i="string",e.CONSUME(E)),"ALT")},{ALT:r(()=>(i="string",e.CONSUME(Lt)),"ALT")},{ALT:r(()=>(i="string",e.CONSUME(ze)),"ALT")},{ALT:r(()=>(i="number",e.CONSUME(_e)),"ALT")},{ALT:r(()=>(i="number",e.CONSUME(X)),"ALT")},{ALT:r(()=>{i="boolean",e.SUBRULE(e.booleanValue)},"ALT")},{ALT:r(()=>(i="timestamp",e.CONSUME(lc)),"ALT")},{ALT:r(()=>(i="null",e.CONSUME(xt)),"ALT")},{ALT:r(()=>!1,"ALT")}]});e.OPTION({GATE:r(()=>!s,"GATE"),DEF:r(()=>{e.addExpectedValueTypeError(i,"invalid immutable value"),e.CONSUME(a)},"DEF")}),n.value=s,e.ACTION(()=>{let c=b(o),l=c?o.map(Jk):Jk(o);if(c){if(!Ce(l))throw new Error(`schemaParseImmutableFn called with invalid enum attribute: ${o}`);l.includes(i)||e.addExpectedValueTypeError(t,l.join(" or "))}else{if(!l)throw new Error(`schemaParseImmutableFn called with invalid attribute: ${o}`);i!==l&&e.addExpectedValueTypeError(t,l)}})}}r(Xk,"schemaParseImmutableFn");function Jk(e){let t=["string","number","boolean","timestamp","null"];if(Je(e)){let o=Ct(e)?e.slice(1,-2):e.slice(1,-1);if(t.includes(o))return o}return null}r(Jk,"getImmutableAttributeType");var Qk=r(e=>{e.schemaFn=e.RULE("schemaFn",Hk(e)),e.schemaParseImmutableFn=e.RULE("schemaParseImmutableFn",Xk(e)),e.schemaParseEnumFn=e.RULE("schemaParseEnumFn",Yk(e)),e.schemaParseConstantFn=e.RULE("schemaParseConstantFn",jk(e)),e.schemaParseArrayFn=e.RULE("schemaParseArrayFn",Vk(e)),e.schemaParseObjectFn=e.RULE("schemaParseObjectFn",Kk(e)),e.schemaParseAttributeFn=e.RULE("schemaParseAttributeFn",zk(e))},"register");function Zk(e){return()=>{e.sectionStack.push("securityCheckPasswordFn");let t=e.CONSUME(iu);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Zk,"securityCheckPasswordFn");function $k(e){return()=>{e.sectionStack.push("securityCreateAuthTokenFn");let t=e.CONSUME(lu);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{extras:"[expression]",table:"[expression]",expiration:"[expression]",id:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r($k,"securityCreateAuthTokenFn");function eR(e){let t=["curve","format"],o=["description","disabled"];return()=>{e.sectionStack.push("securityCreateCurveKeyFn");let n=e.CONSUME(uu);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(eR,"securityCreateCurveKeyFn");function tR(e){let t=["character_count","require_lowercase","require_uppercase","require_digit","require_symbol","symbol_whitelist"],o=["description","disabled"];return()=>{e.sectionStack.push("securityCreatePasswordFn");let n=e.CONSUME(su);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(tR,"securityCreatePasswordFn");function rR(e){let t=["bits","format"],o=["description","disabled"];return()=>{e.sectionStack.push("securityCreateRsaKeyFn");let n=e.CONSUME(pu);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(rR,"securityCreateRsaKeyFn");function oR(e){return()=>{e.sectionStack.push("securityCreateSecretKeyFn");let t=e.CONSUME(mu);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(oR,"securityCreateSecretKeyFn");function nR(e){return()=>{e.sectionStack.push("securityCreateUuidFn");let t=e.CONSUME(cu);e.OPTION(()=>{e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A)}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(nR,"securityCreateUuidFn");function aR(e){return()=>{e.sectionStack.push("securityDecryptFn");let t=e.CONSUME(fu);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(aR,"securityDecryptFn");function iR(e){return()=>{e.sectionStack.push("securityEncryptFn");let t=e.CONSUME(du);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(iR,"securityEncryptFn");function sR(e){return()=>{e.sectionStack.push("securityJweDecodeFn");let t=e.CONSUME(Tu);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(sR,"securityJweDecodeFn");function cR(e){return()=>{e.sectionStack.push("securityJweEncodeFn");let t=e.CONSUME(Eu);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(cR,"securityJweEncodeFn");function lR(e){return()=>{e.sectionStack.push("securityJwsDecodeFn");let t=e.CONSUME(hu);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(lR,"securityJwsDecodeFn");function uR(e){return()=>{e.sectionStack.push("securityJwsEncodeFn");let t=e.CONSUME(Su);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(uR,"securityJwsEncodeFn");function pR(e){return()=>{e.sectionStack.push("securityRandomBytesFn");let t=e.CONSUME(Au);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(pR,"securityRandomBytesFn");function mR(e){return()=>{e.sectionStack.push("securityRandomNumberFn");let t=e.CONSUME(Uu);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(mR,"securityRandomNumberFn");var fR=r(e=>{e.securityCheckPasswordFn=e.RULE("securityCheckPasswordFn",Zk(e)),e.securityCreateAuthTokenFn=e.RULE("securityCreateAuthTokenFn",$k(e)),e.securityCreateCurveKeyFn=e.RULE("securityCreateCurveKeyFn",eR(e)),e.securityCreatePasswordFn=e.RULE("securityCreatePasswordFn",tR(e)),e.securityCreateRsaKeyFn=e.RULE("securityCreateRsaKeyFn",rR(e)),e.securityCreateSecretKeyFn=e.RULE("securityCreateSecretKeyFn",oR(e)),e.securityCreateUuidFn=e.RULE("securityCreateUuidFn",nR(e)),e.securityDecryptFn=e.RULE("securityDecryptFn",aR(e)),e.securityEncryptFn=e.RULE("securityEncryptFn",iR(e)),e.securityJweDecodeFn=e.RULE("securityJweDecodeFn",sR(e)),e.securityJweEncodeFn=e.RULE("securityJweEncodeFn",cR(e)),e.securityJwsDecodeFn=e.RULE("securityJwsDecodeFn",lR(e)),e.securityJwsEncodeFn=e.RULE("securityJwsEncodeFn",uR(e)),e.securityRandomBytesFn=e.RULE("securityRandomBytesFn",pR(e)),e.securityRandomNumberFn=e.RULE("securityRandomNumberFn",mR(e))},"register");function dR(e){return()=>{e.sectionStack.push("security"),e.CONSUME(au),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.securityCheckPasswordFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityCreateAuthTokenFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityCreateCurveKeyFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityCreatePasswordFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityCreateRsaKeyFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityCreateSecretKeyFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityCreateUuidFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityDecryptFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityEncryptFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityJweDecodeFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityJweEncodeFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityJwsDecodeFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityJwsEncodeFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityRandomBytesFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityRandomNumberFn),"ALT")}]),e.sectionStack.pop()}}r(dR,"securityFn");function TR(e){return()=>{e.sectionStack.push("storageCreateAttachmentFn");let t=e.CONSUME(Ru);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{value:"[expression]",access:["public","private"],filename:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(TR,"storageCreateAttachmentFn");function ER(e){return()=>{e.sectionStack.push("storageCreateAudioFn");let t=e.CONSUME(Cu);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{value:"[expression]","access?":["public","private"],"filename?":"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(ER,"storageCreateAudioFn");function hR(e){return()=>{let t=["filename","filedata"],o=["description","disabled"];e.sectionStack.push("storageCreateFileResourceFn");let n=e.CONSUME(xu);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(hR,"storageCreateFileResourceFn");function SR(e){return()=>{e.sectionStack.push("storageCreateImageFn");let t=e.CONSUME(ku);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{value:"[expression]",access:["public","private"],filename:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(SR,"storageCreateImageFn");function AR(e){return()=>{e.sectionStack.push("storageCreateVideoFn");let t=e.CONSUME(Ou);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{value:"[expression]","access?":["public","private"],"filename?":"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(AR,"storageCreateVideoFn");function UR(e){return()=>{let t=["pathname"],o=["description","disabled"];e.sectionStack.push("storageDeleteFileFn");let n=e.CONSUME(Nu);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(UR,"storageDeleteFileFn");function gR(e){return()=>{let t=["value"],o=["description","disabled"];e.sectionStack.push("storageReadFileResourceFn");let n=e.CONSUME(Lu);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(gR,"storageReadFileResourceFn");function kR(e){return()=>{let t=["pathname","ttl"],o=["description","disabled"];e.sectionStack.push("storageSignPrivateUrlFn");let n=e.CONSUME(bu);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(kR,"storageSignPrivateUrlFn");var RR=r(e=>{e.storageCreateAttachmentFn=e.RULE("storageCreateAttachmentFn",TR(e)),e.storageCreateFileResourceFn=e.RULE("storageCreateFileResourceFn",hR(e)),e.storageCreateImageFn=e.RULE("storageCreateImageFn",SR(e)),e.storageDeleteFileFn=e.RULE("storageDeleteFileFn",UR(e)),e.storageReadFileResourceFn=e.RULE("storageReadFileResourceFn",gR(e)),e.storageSignPrivateUrlFn=e.RULE("storageSignPrivateUrlFn",kR(e)),e.storageCreateAudioFn=e.RULE("storageCreateAudioFn",ER(e)),e.storageCreateVideoFn=e.RULE("storageCreateVideoFn",AR(e))},"register");function LR(e){return()=>{e.sectionStack.push("storage"),e.CONSUME(gu),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.storageCreateAttachmentFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.storageCreateFileResourceFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.storageCreateImageFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.storageDeleteFileFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.storageReadFileResourceFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.storageSignPrivateUrlFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.storageCreateAudioFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.storageCreateVideoFn),"ALT")}]),e.sectionStack.pop()}}r(LR,"storageFn");function xR(e){let t=["value","separator","enclosure","escape_char"],o=["description","disabled"];return()=>{e.sectionStack.push("streamFromCsv");let n=e.CONSUME(yu);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(xR,"streamFromCsvFn");function CR(e){let t=["value"],o=["description","disabled"];return()=>{e.sectionStack.push("streamFromJsonl");let n=e.CONSUME(Fu);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(CR,"streamFromJsonlFn");function OR(e){return()=>{e.sectionStack.push("streamFromRequest");let t=e.CONSUME(_u);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{url:"[expression]",method:"[expression]","params?":"[expression]","headers?":"[expression]","timeout?":"[expression]","follow_location?":"[expression]","description?":"[string]","disabled?":"[boolean]","verify_host?":"[expression]","verify_peer?":"[expression]","ca_certificate?":"[expression]","certificate?":"[expression]","certificate_pass?":"[expression]","private_key?":"[expression]","private_key_pass?":"[expression]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(OR,"streamFromRequestFn");var NR=r(e=>{e.streamFromCsvFn=e.RULE("streamFromCsvFn",xR(e)),e.streamFromJsonlFn=e.RULE("streamFromJsonlFn",CR(e)),e.streamFromRequestFn=e.RULE("streamFromRequestFn",OR(e))},"register");function bR(e){return()=>{e.sectionStack.push("stream"),e.CONSUME(Mu),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.streamFromCsvFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.streamFromJsonlFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.streamFromRequestFn),"ALT")}]),e.sectionStack.pop()}}r(bR,"streamFn");function MR(e){return()=>{let t=["value"],o=["description","disabled"];e.sectionStack.push("allTextWithoutReturnValueFn");let n=e.OR([{ALT:r(()=>e.CONSUME(ju),"ALT")},{ALT:r(()=>e.CONSUME(Ju),"ALT")},{ALT:r(()=>e.CONSUME(Xu),"ALT")},{ALT:r(()=>e.CONSUME(Qu),"ALT")},{ALT:r(()=>e.CONSUME($u),"ALT")}]);e.SUBRULE(e.assignableVariableProperty),e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(MR,"allTextWithoutReturnValueFn");function yR(e){return()=>{let t=["value"],o=["description","disabled"];e.sectionStack.push("allTextWithReturnValueFn");let n=e.OR([{ALT:r(()=>e.CONSUME(Wu),"ALT")},{ALT:r(()=>e.CONSUME(Yu),"ALT")},{ALT:r(()=>e.CONSUME(Ku),"ALT")},{ALT:r(()=>e.CONSUME(Hu),"ALT")},{ALT:r(()=>e.CONSUME(zu),"ALT")},{ALT:r(()=>e.CONSUME(Zu),"ALT")}]);e.SUBRULE(e.assignableVariableProperty),e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(yR,"allTextWithReturnValueFn");var FR=r(e=>{e.allTextWithoutReturnValueFn=e.RULE("allTextWithoutReturnValueFn",MR(e)),e.allTextWithReturnValueFn=e.RULE("allTextWithReturnValueFn",yR(e))},"register");function _R(e){return()=>{e.sectionStack.push("text"),e.CONSUME(Co),e.CONSUME(g);let t=e.LA(1).image,o=["contains","ends_with","icontains","iends_with","istarts_with","starts_with"],n=["append","ltrim","prepend","rtrim","trim"];o.includes(t)?e.SUBRULE(e.allTextWithReturnValueFn):n.includes(t)&&e.SUBRULE(e.allTextWithoutReturnValueFn),e.sectionStack.pop()}}r(_R,"textFn");function IR(e){return()=>{e.sectionStack.push("toolCallFn"),e.CONSUME(cr),e.CONSUME(g);let t=e.CONSUME(ir);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}]),e.OPTION(()=>{e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"input?":{"[string]":"[expression]"},"mock?":{"![string]":"[expression]"},"description?":"[string]","disabled?":"[boolean]"}]})}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(IR,"toolCallFn");function vR(e){return()=>{e.sectionStack.push("unitExpect"),e.CONSUME(_o),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.unitExpectWithArgumentsFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.unitExpectWithoutArgumentsFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.unitExpectToThrowFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.unitExpectToBeWithinFn),"ALT")}]),e.sectionStack.pop()}}r(vR,"unitExpectFn");function wR(e){return()=>{let t=["latitude_1","longitude_1","latitude_2","longitude_2"],o=["description","disabled"];e.sectionStack.push("utilGeoDistanceFn");let n=e.CONSUME(rp);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(wR,"utilGeoDistanceFn");function BR(e){let t=[],o=["description","disabled"];return()=>{e.sectionStack.push("utilGetAllInputFn");let n=e.CONSUME(op);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(BR,"utilGetAllInputFn");function PR(e){return()=>{let t=[],o=["description","disabled"];e.sectionStack.push("utilGetEnvFn");let n=e.CONSUME(ap);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(PR,"utilGetEnvFn");function GR(e){return()=>{e.sectionStack.push("utilGetRawInputFn");let t=e.CONSUME(ip);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"encoding?":["json","none","yaml","x-www-form-urlencoded",""],"description?":"[string]","disabled?":"[boolean]","exclude_middleware?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(GR,"utilGetRawInputFn");function DR(e){return()=>{let t=[],o=["description","disabled"];e.sectionStack.push("utilGetVarsFn");let n=e.CONSUME(sp);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(DR,"utilGetVarsFn");function VR(e){return()=>{let t=["value"],o=["description","disabled"];e.sectionStack.push("utilIpLookupFn");let n=e.CONSUME(cp);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(VR,"utilIpLookupFn");function qR(e){return()=>{let t=!1;e.sectionStack.push("utilPostProcessFn"),e.CONSUME(lp),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")},{ALT:r(()=>{t=!0,e.SUBRULE(e.stackClause)},"ALT")}])}),t||e.SUBRULE(e.stackClause),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(qR,"utilPostProcessFn");function jR(e){return()=>{e.sectionStack.push("utilSendEmailFn");let t=e.CONSUME(tp),o={};e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"description?":"[string]","disabled?":"[boolean]","service_provider?":["resend","xano"],"api_key?":"[expression]","subject?":"[expression]","message?":"[expression]","to?":"[expression]","bcc?":"[expression]","cc?":"[expression]","from?":"[expression]","reply_to?":"[expression]","scheduled_at?":"[expression]","mock?":{"![string]":"[expression]"}},o]}),e.SUBRULE(e.asVariable,{ARGS:[t]});let n={xano:["description","disabled","service_provider","subject","message","mock"],resend:["description","disabled","service_provider","api_key","subject","message","to","bcc","cc","from","reply_to","scheduled_at","mock"]},i={xano:["subject","message"],resend:["api_key","subject","message","from","to"]};e.ACTION(()=>{let s=le(o.service_provider?.value),c=i[s]||[];for(let d of c)Object.prototype.hasOwnProperty.call(o,d)||e.addMissingError(t,`Missing required field '${d}' for service_provider '${s}'`);let l=n[s]||[],p=new Set([...n.xano,...n.resend]),f=[];for(let d in o){let T=le(o[d].key);f.push(T),p.has(T)?l.includes(T)||e.addWarning(`${T} is not used with service_provider '${s}'`,o[d].key):e.addIllegalAttributeError(o[d].key,`Field '${T}' is not allowed in send_email`)}}),e.sectionStack.pop()}}r(jR,"utilSendEmailFn");function WR(e){return()=>{let t=["value","duplicates"],o=["description","disabled"];e.sectionStack.push("utilSetHeaderFn");let n=e.CONSUME(pp);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(WR,"utilSetHeaderFn");function YR(e){return()=>{let t=["value"],o=["description","disabled"];e.sectionStack.push("utilSleepFn");let n=e.CONSUME(mp);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(YR,"utilSleepFn");function KR(e){let t=["value"],o=["description","disabled"];return()=>{e.sectionStack.push("utilTemplateFn");let n=e.CONSUME(np);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(KR,"utilTemplateFn");var HR=r(e=>{e.utilGeoDistanceFn=e.RULE("utilGeoDistanceFn",wR(e)),e.utilGetAllInputFn=e.RULE("utilGetAllInputFn",BR(e)),e.utilGetEnvFn=e.RULE("utilGetEnvFn",PR(e)),e.utilGetRawInputFn=e.RULE("utilGetRawInputFn",GR(e)),e.utilGetVarsFn=e.RULE("utilGetVarsFn",DR(e)),e.utilIpLookupFn=e.RULE("utilIpLookupFn",VR(e)),e.utilPostProcessFn=e.RULE("utilPostProcessFn",qR(e)),e.utilSetHeaderFn=e.RULE("utilSetHeaderFn",WR(e)),e.utilSleepFn=e.RULE("utilSleepFn",YR(e)),e.utilTemplateFn=e.RULE("utilTemplateFn",KR(e)),e.utilSendEmailFn=e.RULE("utilSendEmailFn",jR(e))},"register");function zR(e){return()=>{e.sectionStack.push("util"),e.CONSUME(ep),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.utilIpLookupFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilGetEnvFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilSleepFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilGetAllInputFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilGetRawInputFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilGetVarsFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilGeoDistanceFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilPostProcessFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilSetHeaderFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilTemplateFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilSendEmailFn),"ALT")}]),e.sectionStack.pop()}}r(zR,"utilFn");function JR(e){return()=>{e.sectionStack.push("var");let t=e.CONSUME(fp);e.OR([{ALT:r(()=>{let o=e.OR1([{ALT:r(()=>e.CONSUME(V),"ALT")},{ALT:r(()=>e.CONSUME(Sr),"ALT")},{ALT:r(()=>e.CONSUME(Rr),"ALT")},{ALT:r(()=>e.CONSUME(kr),"ALT")},{ALT:r(()=>e.CONSUME(Er),"ALT")},{ALT:r(()=>e.CONSUME(xr),"ALT")},{ALT:r(()=>e.CONSUME(mr),"ALT")},{ALT:r(()=>e.CONSUME(Lr),"ALT")},{ALT:r(()=>e.CONSUME(dr),"ALT")},{ALT:r(()=>e.CONSUME(Tr),"ALT")},{ALT:r(()=>e.CONSUME(gr),"ALT")},{ALT:r(()=>e.CONSUME(Cr),"ALT")},{ALT:r(()=>e.CONSUME(Ur),"ALT")},{ALT:r(()=>e.CONSUME(Ar),"ALT")},{ALT:r(()=>e.CONSUME(fr),"ALT")},{ALT:r(()=>e.CONSUME(hr),"ALT")}]);o.image&&e.addVariable(o.image,"unknown")},"ALT")},{ALT:r(()=>{e.CONSUME(g),e.CONSUME(dp),e.SUBRULE(e.assignableVariableProperty)},"ALT")}]),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{value:"[expression]","description?":"[string]","disabled?":"[boolean]","mock?":{"![string]":"[expression]"}}]}),e.sectionStack.pop()}}r(JR,"varFn");function XR(e){return()=>{e.sectionStack.push("webflow"),e.CONSUME(Wi),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.webflowRequestFn),"ALT")}]),e.sectionStack.pop()}}r(XR,"webflowFn");function QR(e){return()=>{e.sectionStack.push("workflowExpect"),e.CONSUME(_o),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.workflowExpectWithArgumentsFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.workflowExpectWithoutArgumentsFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.workflowExpectToThrowFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.workflowExpectToBeWithinFn),"ALT")}]),e.sectionStack.pop()}}r(QR,"workflowExpectFn");function ZR(e){return()=>{let t=["file","zip"],o=["description","disabled","password","password_encryption","filename"];e.sectionStack.push("zipAddToArchiveFn");let n=e.CONSUME(xp);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(ZR,"zipAddToArchiveFn");function $R(e){return()=>{let t=["filename"],o=["description","disabled","password","password_encryption"];e.sectionStack.push("zipCreateArchiveFn");let n=e.CONSUME(Cp);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r($R,"zipCreateArchiveFn");function eL(e){return()=>{let t=["filename","zip"],o=["description","disabled","password"];e.sectionStack.push("zipDeleteFromArchiveFn");let n=e.CONSUME(Op);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(eL,"zipDeleteFromArchiveFn");function tL(e){return()=>{let t=["zip"],o=["description","disabled","password"];e.sectionStack.push("zipExtractFn");let n=e.CONSUME(Np);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(tL,"zipExtractFn");function rL(e){return()=>{let t=["zip"],o=["description","disabled","password"];e.sectionStack.push("zipViewContentsFn");let n=e.CONSUME(bp);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(rL,"zipViewContentsFn");var oL=r(e=>{e.zipAddToArchiveFn=e.RULE("zipAddToArchiveFn",ZR(e)),e.zipCreateArchiveFn=e.RULE("zipCreateArchiveFn",$R(e)),e.zipDeleteFromArchiveFn=e.RULE("zipDeleteFromArchiveFn",eL(e)),e.zipExtractFn=e.RULE("zipExtractFn",tL(e)),e.zipViewContentsFn=e.RULE("zipViewContentsFn",rL(e))},"register");function nL(e){return()=>{e.sectionStack.push("zip"),e.CONSUME(Lp),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.zipCreateArchiveFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.zipAddToArchiveFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.zipDeleteFromArchiveFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.zipExtractFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.zipViewContentsFn),"ALT")}]),e.sectionStack.pop()}}r(nL,"zipFn");var aL=r(e=>{e.addonCallFn=e.RULE("addonCallFn",cU(e)),e.actionCallFn=e.RULE("actionCallFn",sU(e)),e.middlewareCallFn=e.RULE("middlewareCallFn",Sk(e)),e.aiFn=e.RULE("aiFn",dU(e)),e.apiFn=e.RULE("apiFn",kU(e)),e.webflowFn=e.RULE("webflowFn",XR(e)),e.arrayFn=e.RULE("arrayFn",YU(e)),e.cloudFn=e.RULE("cloudFn",pg(e)),e.controlFn=e.RULE("controlFn",mg(e)),e.dbFn=e.RULE("dbFn",tk(e)),e.debugFn=e.RULE("debugFn",ak(e)),e.mathFn=e.RULE("mathFn",hk(e)),e.objectFn=e.RULE("objectFn",Rk(e)),e.redisFn=e.RULE("redisFn",Dk(e)),e.securityFn=e.RULE("securityFn",dR(e)),e.storageFn=e.RULE("storageFn",LR(e)),e.streamFn=e.RULE("streamFn",bR(e)),e.textFn=e.RULE("textFn",_R(e)),e.utilFn=e.RULE("utilFn",zR(e)),e.varFn=e.RULE("varFn",JR(e)),e.zipFn=e.RULE("zipFn",nL(e)),e.unitExpectFn=e.RULE("unitExpectFn",vR(e)),e.workflowExpectFn=e.RULE("workflowExpectFn",QR(e)),e.toolCallFn=e.RULE("toolCallFn",IR(e)),fU(e),Qk(e),gU(e),WU(e),ug(e),Fg(e),ek(e),nk(e),Ek(e),kk(e),Gk(e),fR(e),RR(e),NR(e),FR(e),HR(e),oL(e),dk(e)},"register");function iL(e){return(t={})=>{let o=!1,n=e.CONSUME(re);e.MANY(()=>{e.MANY1(()=>{o=!1,e.CONSUME(m)}),o&&e.addMissingError(je,"Expected ',' between array values"),e.SUBRULE(e.expressionFn,{ARGS:[n,{...t,allowObject:!0,allowArray:!0}]}),o=!0,e.OPTION1(()=>{o=!1,e.CONSUME1(je)}),e.MANY2(()=>{o=!1,e.CONSUME1(m)})}),e.CONSUME(oe)}}r(iL,"arrayWithValues");function sL(e){return()=>{e.OR([{ALT:r(()=>{e.CONSUME(V)},"ALT")},{ALT:r(()=>{e.CONSUME(pr),e.CONSUME(g),e.CONSUME(a)},"ALT")}])}}r(sL,"assignableVariableAs");function cL(e){return()=>{let t="";e.OR({DEF:[{ALT:r(()=>{t=e.OR1([{ALT:r(()=>e.CONSUME(V),"ALT")},{ALT:r(()=>e.CONSUME(Sr),"ALT")},{ALT:r(()=>e.CONSUME(Rr),"ALT")},{ALT:r(()=>e.CONSUME(kr),"ALT")},{ALT:r(()=>e.CONSUME(Er),"ALT")},{ALT:r(()=>e.CONSUME(xr),"ALT")},{ALT:r(()=>e.CONSUME(mr),"ALT")},{ALT:r(()=>e.CONSUME(Lr),"ALT")},{ALT:r(()=>e.CONSUME(dr),"ALT")},{ALT:r(()=>e.CONSUME(Tr),"ALT")},{ALT:r(()=>e.CONSUME(gr),"ALT")},{ALT:r(()=>e.CONSUME(Cr),"ALT")},{ALT:r(()=>e.CONSUME(Ur),"ALT")},{ALT:r(()=>e.CONSUME(Ar),"ALT")},{ALT:r(()=>e.CONSUME(fr),"ALT")},{ALT:r(()=>e.CONSUME(hr),"ALT")}]).image},"ALT")},{ALT:r(()=>{e.CONSUME(pr),e.CONSUME(g),t=`$${e.CONSUME(a).image}`},"ALT")}],ERR_MSG:"expecting variable (e.g. $variable or $var.variable)"}),e.SUBRULE(e.chainedIdentifier),e.MANY({GATE:r(()=>e.LA(1).tokenType===Me||e.LA(1).tokenType===m&&e.LA(2).tokenType===Me,"GATE"),DEF:r(()=>{e.SUBRULE(e.filterFn)},"DEF")}),t&&e.addVariable(t,"unknown")}}r(cL,"assignableVariableProperty");function lL(e){return t=>{let o=!1;e.OPTION(()=>{o=!0,e.CONSUME(at),e.SUBRULE(e.assignableVariableProperty)}),!o&&t&&e.addWarning("`as <variable>` is missing",t)}}r(lL,"asVariable");function uL(e){return()=>{e.OR([{ALT:r(()=>{e.CONSUME(Ue)},"ALT")},{ALT:r(()=>{e.CONSUME(ge)},"ALT")}])}}r(uL,"booleanValue");function pL(e){return()=>{e.CONSUME(re),e.SUBRULE(e.expressionFn),e.CONSUME(oe)}}r(pL,"bracketAccessor");function mL(e){return()=>{e.OR([{ALT:r(()=>{e.CONSUME(re),e.SUBRULE(e.expressionFn),e.CONSUME(oe)},"ALT")},{ALT:r(()=>{e.CONSUME(g),e.OR1([{ALT:r(()=>e.CONSUME(X),"ALT")},{ALT:r(()=>{e.CONSUME1(re),e.SUBRULE1(e.expressionFn),e.CONSUME1(oe)},"ALT")}])},"ALT")}])}}r(mL,"bracketArrayAccessor");function fL(e){return()=>{e.OR(Oi.map(t=>({ALT:r(()=>e.CONSUME(t),"ALT")}))),e.CONSUME(E)}}r(fL,"castedValue");function dL(e){return()=>{e.MANY(()=>e.SUBRULE(e.singleChainedIdentifier))}}r(dL,"chainedIdentifier");function TL(e){return()=>{e.OR([{ALT:r(()=>{e.CONSUME(g),e.OR1([{ALT:r(()=>{let t=e.CONSUME(V);e.addWarning(`Using \`$\` prefixed properties '${t.image}' is discouraged.`,t)},"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME2(X),"ALT")},{ALT:r(()=>e.SUBRULE(e.bracketAccessor),"ALT")}])},"ALT")},{ALT:r(()=>e.SUBRULE1(e.bracketAccessor),"ALT")}])}}r(TL,"singleChainedIdentifier");function EL(e){return()=>{e.CONSUME(hp),e.SUBRULE(e.chainedIdentifier)}}r(EL,"completeAuthVariable");function hL(e){return()=>{e.CONSUME(Ep),e.OR([{ALT:r(()=>{e.CONSUME(g),e.OR1([{ALT:r(()=>e.CONSUME(Sr),"ALT")},{ALT:r(()=>e.CONSUME(Rr),"ALT")},{ALT:r(()=>e.CONSUME(kr),"ALT")},{ALT:r(()=>{e.CONSUME(Er),e.OPTION(()=>e.SUBRULE(e.singleChainedIdentifier))},"ALT")},{ALT:r(()=>e.CONSUME(xr),"ALT")},{ALT:r(()=>e.CONSUME(mr),"ALT")},{ALT:r(()=>e.CONSUME(Lr),"ALT")},{ALT:r(()=>e.CONSUME(dr),"ALT")},{ALT:r(()=>e.CONSUME(Tr),"ALT")},{ALT:r(()=>e.CONSUME(gr),"ALT")},{ALT:r(()=>e.CONSUME(Cr),"ALT")},{ALT:r(()=>e.CONSUME(Ur),"ALT")},{ALT:r(()=>e.CONSUME(Ar),"ALT")},{ALT:r(()=>e.CONSUME(fr),"ALT")},{ALT:r(()=>{e.CONSUME(hr),e.SUBRULE1(e.singleChainedIdentifier)},"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>{let t=e.CONSUME(V);e.addWarning(`Using \`$\` prefixed environment variables '${t.image}' is discouraged.`,t)},"ALT")},{ALT:r(()=>e.SUBRULE(e.bracketAccessor),"ALT")}])},"ALT")},{ALT:r(()=>e.SUBRULE1(e.bracketAccessor),"ALT")}])}}r(hL,"completeEnvVariable");function SL(e){let t=new Set(["name","code","message","result"]);return()=>{let o=e.CONSUME(Sp);e.sectionStack.includes("catchFn")||e.addInvalidValueError(o,"Invalid use of $error variable outside of a catch block."),e.OPTION(()=>{e.CONSUME(g);let n=e.CONSUME(a);t.has(n.image)||e.addInvalidValueError(n,`Invalid property '${n.image}' for $error variable. Allowed properties are: ${Array.from(t).join(", ")}.`),e.SUBRULE(e.chainedIdentifier)})}}r(SL,"completeErrorVariable");function AL(e){return()=>{e.CONSUME(Tp),e.OR([{ALT:r(()=>{e.CONSUME(g),e.OR1([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>{e.CONSUME(re),e.CONSUME(E),e.CONSUME(oe)},"ALT")}])},"ALT")},{ALT:r(()=>{e.CONSUME2(re),e.CONSUME2(E),e.CONSUME2(oe)},"ALT")}]),e.SUBRULE(e.chainedIdentifier)}}r(AL,"completeInputVariable");function UL(e){return(...t)=>{let o=t||[],n=e.CONSUME3(E),i=le(n);o.includes(i)||e.addMissingError(n,`Invalid value "${i}". Must be one of: ${o.map(s=>`"${s}"`).join(", ")}`)}}r(UL,"enumValue");var TI={allowQueryExpression:!1,allowExpression:!0,allowIdentifier:!0,allowVariable:!0,allowFilter:!0,allowComparison:!0,allowDisabledKeys:!1},EI=[Kn,Hn,zn,Jn,Fc,Xn,_c,Qn,fa,na,aa,ia,ca,sa,Zn,$n,ea,ta,ra,oa,la,ua,pa,ma];function gL(e){return(t,o={})=>{o={...TI,...o};let n=!1,i=!1,s=!1;e.OR([{ALT:r(()=>{e.MANY1(()=>e.CONSUME(Ne)),e.OR2([{ALT:r(()=>{e.CONSUME(B),e.OR3([{ALT:r(()=>e.SUBRULE(e.expressionFn,{ARGS:[t,o]}),"ALT")},{ALT:r(()=>e.SUBRULE(e.multilineFilterFn,{ARGS:[o]}),"ALT")}]),e.OPTION(()=>e.CONSUME1(m)),e.CONSUME(P),e.MANY(()=>{e.CONSUME(g),e.CONSUME(a)})},"ALT")},{ALT:r(()=>e.SUBRULE(e.simpleExpressionFn,{ARGS:[t,o]}),"ALT")}])},"ALT")},{ALT:r(()=>{e.SUBRULE(e.schemaParseArrayFn,{ARGS:[t,o.allowQueryExpression?["[query]"]:["[expression]"],{},o]})},"ALT")},{ALT:r(()=>{let l=o.allowDisabledKeys?"![string]?":"[string]?";e.SUBRULE(e.schemaParseObjectFn,{ARGS:[t,{[l]:o.allowQueryExpression?"[query]":"[expression]"},{},o]}),e.SUBRULE(e.chainedIdentifier)},"ALT")}]),e.MANY2(()=>{e.SUBRULE(e.bracketArrayAccessor)}),e.MANY3({GATE:r(()=>o.allowFilter&&e.LA(1).tokenType===Me||e.LA(1).tokenType===m&&e.LA(2).tokenType===Me,"GATE"),DEF:r(()=>{n=!0,e.SUBRULE(e.filterFn,{ARGS:[o]})},"DEF")});let c=e.OPTION1({GATE:r(()=>o.allowComparison,"GATE"),DEF:r(()=>(i=!0,e.OR1([{ALT:r(()=>e.SUBRULE(e.expressionTestFn,{ARGS:[t,o]}),"ALT")},{ALT:r(()=>{s=!0;let l=e.CONSUME(et);return e.SUBRULE2(e.expressionFn,{ARGS:[l,o]}),e.OPTION2(()=>{e.CONSUME2(be),e.SUBRULE3(e.expressionFn,{ARGS:[l,o]})}),l},"ALT")}])),"DEF")});n&&i&&e.addInvalidValueError(t,"An expression should be wrapped in parentheses when combining filters and tests"),o.allowQueryExpression&&s&&e.addInvalidValueError(c,"Ternary expressions are not allowed in a where clause")}}r(gL,"expressionFn");function kL(e){return(t,o={})=>{let n=e.OR([{ALT:r(()=>e.CONSUME(Kn),"ALT")},{ALT:r(()=>e.CONSUME(Hn),"ALT")},{ALT:r(()=>e.CONSUME(zn),"ALT")},{ALT:r(()=>e.CONSUME(Jn),"ALT")},{ALT:r(()=>e.CONSUME(Fc),"ALT")},{ALT:r(()=>e.CONSUME(Xn),"ALT")},{ALT:r(()=>e.CONSUME(_c),"ALT")},{ALT:r(()=>e.CONSUME(Qn),"ALT")},{ALT:r(()=>e.CONSUME(Nc),"ALT")},{ALT:r(()=>e.CONSUME(Oc),"ALT")},{ALT:r(()=>e.CONSUME(bc),"ALT")},{ALT:r(()=>e.CONSUME(Mc),"ALT")},{ALT:r(()=>e.CONSUME(yc),"ALT")},{ALT:r(()=>e.CONSUME(vc),"ALT")},{ALT:r(()=>e.CONSUME(Ic),"ALT")},{ALT:r(()=>e.CONSUME(wc),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(Km),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(fa),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(na),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(aa),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(ia),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(ca),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(sa),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(Zn),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME($n),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(ea),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(ta),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(ra),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(oa),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(la),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(ua),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(pa),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(ma),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(Pc),"ALT")},{ALT:r(()=>e.CONSUME(Bc),"ALT")}]);e.OPTION({GATE:r(()=>o.allowQueryExpression&&EI.includes(n.tokenType),"GATE"),DEF:r(()=>e.CONSUME1(et),"DEF")}),e.SUBRULE(e.expressionFn,{ARGS:[t,o]})}}r(kL,"expressionTestFn");function RL(e){return(t,o)=>{e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(Lt),"ALT")},{ALT:r(()=>e.CONSUME(X),"ALT")},{ALT:r(()=>e.CONSUME(_e),"ALT")},{ALT:r(()=>e.CONSUME(Ue),"ALT")},{ALT:r(()=>e.CONSUME(ge),"ALT")},{ALT:r(()=>e.CONSUME(xt),"ALT")},{ALT:r(()=>e.CONSUME(Or),"ALT")},{GATE:r(()=>o.allowExpression,"GATE"),ALT:r(()=>e.CONSUME(ze),"ALT")},{GATE:r(()=>o.allowExpression,"GATE"),ALT:r(()=>e.CONSUME(Nl),"ALT")},{GATE:r(()=>o.allowExpression,"GATE"),ALT:r(()=>e.CONSUME(cc),"ALT")},{GATE:r(()=>o.allowVariable,"GATE"),ALT:r(()=>e.SUBRULE(e.longFormVariable),"ALT")},{GATE:r(()=>o.allowVariable,"GATE"),ALT:r(()=>e.SUBRULE(e.completeAuthVariable),"ALT")},{GATE:r(()=>o.allowVariable,"GATE"),ALT:r(()=>e.SUBRULE(e.completeEnvVariable),"ALT")},{GATE:r(()=>o.allowVariable,"GATE"),ALT:r(()=>e.SUBRULE(e.completeInputVariable),"ALT")},{GATE:r(()=>o.allowVariable,"GATE"),ALT:r(()=>e.SUBRULE(e.completeErrorVariable),"ALT")},{GATE:r(()=>o.allowVariable,"GATE"),ALT:r(()=>e.SUBRULE(e.shortFormVariable),"ALT")},{ALT:r(()=>e.SUBRULE(e.castedValue),"ALT")}])}}r(RL,"simpleExpressionFn");function LL(e){return(t={},o=null)=>{e.OR([{ALT:r(()=>{e.CONSUME(m),e.CONSUME(Me)},"ALT")},{ALT:r(()=>e.CONSUME1(Me),"ALT")}]);let n=t.allowQueryExpression===!0?xA:LA;e.OPTION(()=>e.CONSUME(Ne));let i=e.CONSUME(a);n.includes(i.image)||e.addInvalidValueError(i,`Unknown filter function '${i.image}'`),e.MANY1(()=>{e.CONSUME(be),e.SUBRULE(e.expressionFn,{ARGS:[i,t,o]})})}}r(LL,"filterFn");var hI={allowDuplicates:[],allowQueryExpression:!1,allowDisabledKeys:!1,types:{}};function xL(e){return(t,o,n,i={})=>{o=o||[],n=n||[];let s=!1,c=!1;i={...hI,...i};let l=[],p=[...o,...n];e.OR({IGNORE_AMBIGUITIES:!0,DEF:[{GATE:r(()=>o.length===0,"GATE"),ALT:r(()=>{e.OPTION(()=>{e.CONSUME(S),e.MANY(()=>{e.OR1([{GATE:r(()=>!s,"GATE"),ALT:r(()=>e.MANY1(()=>e.CONSUME1(m)),"ALT")},{GATE:r(()=>s,"GATE"),ALT:r(()=>e.AT_LEAST_ONE(()=>e.CONSUME2(m)),"ALT")}]),e.OR2([{ALT:r(()=>{let k=e.CONSUME(a);l.push(k),e.CONSUME(h);let C=le(k),L=i.types[C];if(typeof L=="function")L.call(null,e,k);else if(Array.isArray(L)){let _=e.CONSUME3(E),N=le(_);L.includes(N)||e.addMissingError(_,`Invalid value "${N}". Must be one of: ${L.map(O=>`"${O}"`).join(", ")}`)}else e.OR4({DEF:[{GATE:r(()=>L==="boolean","GATE"),ALT:r(()=>e.SUBRULE(e.booleanValue),"ALT")},{GATE:r(()=>L==="number","GATE"),ALT:r(()=>e.SUBRULE(e.numberValue),"ALT")},{GATE:r(()=>L==="string","GATE"),ALT:r(()=>e.CONSUME1(E),"ALT")},{GATE:r(()=>L==="object","GATE"),ALT:r(()=>e.SUBRULE1(e.objectWithAttributes,{ARGS:[i]}),"ALT")},{GATE:r(()=>!L,"GATE"),ALT:r(()=>e.SUBRULE(e.expressionFn,{ARGS:[k,i]}),"ALT")}],ERR_MSG:L?`${L} for attribute ${k.image}`:void 0});s=!0},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.mockAttribute),s=!0},"ALT")}])}),e.MANY2(()=>e.CONSUME3(m)),e.CONSUME(A)})},"ALT")},{GATE:r(()=>o.length>0,"GATE"),ALT:r(()=>{e.CONSUME1(S),e.MANY4(()=>{e.OR3([{GATE:r(()=>!s,"GATE"),ALT:r(()=>e.MANY5(()=>e.CONSUME4(m)),"ALT")},{GATE:r(()=>s,"GATE"),ALT:r(()=>e.AT_LEAST_ONE1(()=>e.CONSUME5(m)),"ALT")}]),e.OR5([{ALT:r(()=>{let k=e.CONSUME1(a);l.push(k),e.CONSUME1(h);let C=le(k),L=i.types[C];if(typeof L=="function")L.call(null,e,k);else if(Array.isArray(L)){let _=e.CONSUME3(E),N=le(_);L.includes(N)||e.addMissingError(_,`Invalid value "${N}". Must be one of: ${L.map(O=>`"${O}"`).join(", ")}`)}else e.OR6({DEF:[{GATE:r(()=>L==="boolean","GATE"),ALT:r(()=>e.SUBRULE2(e.booleanValue),"ALT")},{GATE:r(()=>L==="number","GATE"),ALT:r(()=>e.SUBRULE2(e.numberValue),"ALT")},{GATE:r(()=>L==="string","GATE"),ALT:r(()=>e.CONSUME2(E),"ALT")},{GATE:r(()=>L==="object","GATE"),ALT:r(()=>e.SUBRULE2(e.objectWithAttributes,{ARGS:[i]}),"ALT")},{GATE:r(()=>!L,"GATE"),ALT:r(()=>e.SUBRULE2(e.expressionFn,{ARGS:[k,i]}),"ALT")}],ERR_MSG:L?`${L} for attribute ${k.image}`:void 0});s=!0},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{e.SUBRULE2(e.mockAttribute),c=!0,s=!0},"ALT")}])}),e.MANY6(()=>e.CONSUME6(m)),e.CONSUME1(A)},"ALT")}]});let f=l.filter((k,C)=>!i.allowDuplicates.includes(k.image)&&l.findIndex(L=>L.image===k.image)!==C);for(let k of f)e.addDuplicateAttributeError(k);let d=l.filter(k=>!p.includes(k.image));for(let k of d)e.addIllegalAttributeError(k);let T=l.map(k=>k.image),U=o.filter(k=>!T.includes(k));U.length>0&&e.addMissingAttributeError(t,U),e.sectionStack.pop()}}r(xL,"functionAttrReq");function CL(e){return()=>{e.CONSUME(pr),e.OR([{ALT:r(()=>{e.CONSUME(g),e.OR1([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>{e.CONSUME(re),e.CONSUME(E),e.CONSUME(oe)},"ALT")}])},"ALT")},{ALT:r(()=>{e.CONSUME2(re),e.CONSUME2(E),e.CONSUME2(oe)},"ALT")}]),e.SUBRULE(e.chainedIdentifier)}}r(CL,"longFormVariable");function OL(e){return()=>{e.sectionStack.push("minimalFnBody"),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")}])}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(OL,"minimalFnBody");function NL(e){return()=>{e.sectionStack.push("mockAttribute");let t=e.CONSUME(Hp);e.CONSUME(h),e.SUBRULE(e.schemaParseObjectFn,{ARGS:[t,{"![string]":"[expression]"}]}),e.MANY(()=>e.CONSUME(m)),e.sectionStack.pop()}}r(NL,"mockAttribute");function bL(e){return(t={})=>{e.SUBRULE(e.filterFn,{ARGS:[t]}),e.MANY({GATE:r(()=>e.LA(1).tokenType===Me||e.LA(1).tokenType===m&&e.LA(2).tokenType===Me,"GATE"),DEF:r(()=>{e.SUBRULE1(e.filterFn,{ARGS:[t]})},"DEF")})}}r(bL,"multilineFilterFn");function ML(e){return()=>{e.OR([{ALT:r(()=>{e.CONSUME(X,{ERR_MSG:"Integer literal expected"})},"ALT")},{ALT:r(()=>{e.CONSUME(_e,{ERR_MSG:"Float literal expected"})},"ALT")}],{ERR_MSG:"Number literal expected"})}}r(ML,"numberValue");function yL(e){return(t={})=>{let o=[],n=e.CONSUME(S);e.MANY(()=>e.CONSUME(m)),e.MANY_SEP({SEP:m,DEF:r(()=>{let i=!1,s=!1;e.MANY1(()=>{i&&!s&&e.addMissingError(n,"Expected a separator between attributes"),e.OPTION1({GATE:r(()=>t.allowDisabledKeys===!0,"GATE"),DEF:r(()=>e.CONSUME(Ne),"DEF")});let c=e.OR1([{ALT:r(()=>e.CONSUME2(a),"ALT")},{ALT:r(()=>e.CONSUME2(E),"ALT")}]),l=le(c);o.includes(l)?e.addDuplicateAttributeError(c):o.push(l),e.CONSUME(be),e.SUBRULE(e.expressionFn,{ARGS:[c,t]}),e.OPTION(()=>{e.CONSUME(je),s=!0}),i=!0})},"DEF")}),e.MANY3(()=>e.CONSUME3(m)),e.CONSUME(A)}}r(yL,"objectWithAttributes");function FL(e){return()=>{e.sectionStack.push("optionalCommentBlockFn"),e.MANY(()=>{e.CONSUME($),e.CONSUME(m)}),e.sectionStack.pop()}}r(FL,"optionalCommentBlockFn");function _L(e){return()=>{e.sectionStack.push("commentBlockFn"),e.AT_LEAST_ONE(()=>{e.CONSUME($),e.CONSUME(m)}),e.sectionStack.pop()}}r(_L,"commentBlockFn");function IL(e){return()=>{e.AT_LEAST_ONE(()=>{e.CONSUME(Me),e.CONSUME(a),e.MANY1(()=>{e.CONSUME(be),e.SUBRULE(e.expressionFn)})})}}r(IL,"pipedFilter");function vL(e){return()=>{e.sectionStack.push("requiredValueFnBody");let t=!1;e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>{t=!0,e.SUBRULE(e.valueFieldAttribute)},"ALT")},{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")}])}),t||e.SUBRULE(e.valueFieldAttribute),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(vL,"requiredValueFnBody");function wL(e){return()=>{e.CONSUME(V),e.SUBRULE(e.chainedIdentifier)}}r(wL,"shortFormVariable");var BL=r(e=>()=>{let t=!0,o=e.CONSUME(re);e.MANY(()=>e.CONSUME(m)),e.MANY1(()=>{t||e.addMissingError(o,"Missing comma or newline between string values in the array"),o=e.CONSUME(E),t=!1,e.OPTION(()=>{e.CONSUME(je),t=!0}),e.MANY2(()=>{e.CONSUME1(m),t=!0})}),e.CONSUME(oe)},"stringArray");function PL(e){return()=>{e.CONSUME(Mp),e.CONSUME(h),e.SUBRULE(e.stringArray)}}r(PL,"tagsAttribute");function GL(e){return Object.hasOwn(e,"emptyArray")||(e.emptyArray=e.RULE("emptyArray",()=>{e.CONSUME(re),e.CONSUME(oe)})),()=>{e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(Lt),"ALT")},{ALT:r(()=>e.CONSUME(_e),"ALT")},{ALT:r(()=>e.CONSUME(X),"ALT")},{ALT:r(()=>e.CONSUME(Ue),"ALT")},{ALT:r(()=>e.CONSUME(ge),"ALT")},{ALT:r(()=>e.CONSUME(Or),"ALT")},{ALT:r(()=>e.CONSUME(xt),"ALT")},{ALT:r(()=>e.SUBRULE(e.longFormVariable),"ALT")},{ALT:r(()=>e.SUBRULE(e.completeAuthVariable),"ALT")},{ALT:r(()=>e.SUBRULE(e.completeEnvVariable),"ALT")},{ALT:r(()=>e.SUBRULE(e.completeInputVariable),"ALT")},{ALT:r(()=>e.SUBRULE(e.shortFormVariable),"ALT")},{ALT:r(()=>e.SUBRULE(e.castedValue),"ALT")},{ALT:r(()=>e.SUBRULE(e.emptyArray),"ALT")}]),e.OPTION(()=>{e.SUBRULE(e.pipedFilter)})}}r(GL,"valueExpressionForResponse");function DL(e){return()=>{e.OR([{ALT:r(()=>e.SUBRULE(e.longFormVariable),"ALT")},{ALT:r(()=>e.SUBRULE(e.shortFormVariable),"ALT")}]),e.OPTION(()=>e.SUBRULE(e.pipedFilter))}}r(DL,"variableOnly");var VL=r(e=>{e.mockAttribute=e.RULE("mockAttribute",NL(e)),e.arrayWithValues=e.RULE("arrayWithValues",iL(e)),e.assignableVariableAs=e.RULE("assignableVariableAs",sL(e)),e.assignableVariableProperty=e.RULE("assignableVariableProperty",cL(e)),e.booleanValue=e.RULE("booleanValue",uL(e)),e.castedValue=e.RULE("castedValue",fL(e)),e.chainedIdentifier=e.RULE("chainedIdentifier",dL(e)),e.singleChainedIdentifier=e.RULE("singleChainedIdentifier",TL(e)),e.enumValue=e.RULE("enumValue",UL(e)),e.expressionFn=e.RULE("expressionFn",gL(e)),e.simpleExpressionFn=e.RULE("simpleExpressionFn",RL(e)),e.expressionTestFn=e.RULE("expressionTestFn",kL(e)),e.functionAttrReq=e.RULE("functionAttrReq",xL(e)),e.filterFn=e.RULE("filterFn",LL(e)),e.multilineFilterFn=e.RULE("multilineFilterFn",bL(e)),e.longFormVariable=e.RULE("longFormVariable",CL(e)),e.minimalFnBody=e.RULE("minimalFnBody",OL(e)),e.numberValue=e.RULE("numberValue",ML(e)),e.objectWithAttributes=e.RULE("objectWithAttributes",yL(e)),e.pipedFilter=e.RULE("pipedFilter",IL(e)),e.requiredValueFnBody=e.RULE("requiredValueFnBody",vL(e)),e.shortFormVariable=e.RULE("shortFormVariable",wL(e)),e.stringArray=e.RULE("stringArray",BL(e)),e.tagsAttribute=e.RULE("tagsAttribute",PL(e)),e.expressionFnForResponse=e.RULE("valueExpressionForResponse",GL(e)),e.variableOnly=e.RULE("variableOnly",DL(e)),e.completeAuthVariable=e.RULE("completeAuthVariable",EL(e)),e.bracketAccessor=e.RULE("bracketAccessor",pL(e)),e.bracketArrayAccessor=e.RULE("bracketArrayAccessor",mL(e)),e.completeInputVariable=e.RULE("completeInputVariable",AL(e)),e.completeErrorVariable=e.RULE("completeErrorVariable",SL(e)),e.completeEnvVariable=e.RULE("completeEnvVariable",hL(e)),e.asVariable=e.RULE("asVariable",lL(e)),e.optionalCommentBlockFn=e.RULE("optionalCommentBlockFn",FL(e)),e.commentBlockFn=e.RULE("commentBlockFn",_L(e))},"register");function qL(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1;e.sectionStack.push("mcpServerDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let f=e.CONSUME(gl);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.commentBlockFn),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.CONSUME(Al),e.CONSUME(h),e.SUBRULE(e.booleanValue)},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.SUBRULE(e.canonicalClause)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.docsFieldAttribute)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE1(e.flexibleStringClause,{ARGS:[Ul]})},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.SUBRULE(e.tagsAttribute)},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0;let d=e.CONSUME(kl);e.CONSUME2(h),e.SUBRULE(e.schemaParseArrayFn,{ARGS:[d,[{name:"[string]","active?":"[boolean]","auth?":"[string]"}]]})},"ALT")}])}),p||e.addMissingError(f,"{} is missing tools clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(qL,"mcpServerDeclaration");function jL(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1,f=!1;e.sectionStack.push("mcpServerTriggerDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let d=e.CONSUME(xl);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.commentBlockFn),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0;let T=e.CONSUME(Rl);e.CONSUME(h),e.SUBRULE(e.schemaParseObjectFn,{ARGS:[T,{connection:"[boolean]"}]})},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.CONSUME(Ll),e.CONSUME2(h),e.SUBRULE(e.booleanValue)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.inputClause)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.mcpServerClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.SUBRULE(e.responseClause)},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.stackClause)},"ALT")},{GATE:r(()=>!f,"GATE"),ALT:r(()=>{f=!0,e.SUBRULE(e.tagsAttribute)},"ALT")}])}),c||e.addMissingError(d,"{} is missing mcp_server clause"),s||e.addMissingError(d,"{} is missing an input clause"),p||e.addMissingError(d,"{} is missing a stack clause"),l||e.addMissingError(d,"{} is missing a response clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(jL,"mcpServerTriggerDeclaration");function WL(e){return()=>{e.sectionStack.push("columnMetadataDefinition"),e.CONSUME(S),e.AT_LEAST_ONE(()=>{e.CONSUME(m),e.OR([{ALT:r(()=>e.SUBRULE(e.sensitiveFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>{e.CONSUME(lr),e.CONSUME(h),e.CONSUME(E)},"ALT")}])}),e.AT_LEAST_ONE1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(WL,"columnMetadataDefinition");function YL(e){return t=>{e.sectionStack.push("enumColumnMetadataDefinition"),e.CONSUME(S);let o=!1,n=!1,i=!1;e.MANY(()=>{e.AT_LEAST_ONE1(()=>e.CONSUME1(m)),e.OR([{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.SUBRULE(e.valuesFieldAttribute)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>e.SUBRULE(e.sensitiveFieldAttribute),"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")}])}),o||e.addMissingError(t,"{} is missing the values attribute"),e.AT_LEAST_ONE2(()=>e.CONSUME2(m)),e.CONSUME(A),e.sectionStack.pop()}}r(YL,"enumColumnMetadataDefinition");function KL(e){return()=>{e.sectionStack.push("objectColumnMetadataDefinition"),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>e.SUBRULE(e.sensitiveFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.schemaClause,{ARGS:[{include_file:!1}]}),"ALT")}])}),e.AT_LEAST_ONE1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(KL,"objectColumnMetadataDefinition");function HL(e){e.columnMetadataDefinition=e.RULE("columnMetadataDefinition",WL(e)),e.enumColumnMetadataDefinition=e.RULE("enumColumnMetadataDefinition",YL(e)),e.objectColumnMetadataDefinition=e.RULE("objectColumnMetadataDefinition",KL(e))}r(HL,"register");function zL(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1,f=!1,d=[];e.sectionStack.push("middlewareDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let T=e.CONSUME($o);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME(E),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.commentBlockFn),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.SUBRULE(e.docsFieldAttribute)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.CONSUME(Cl),e.CONSUME(h),e.SUBRULE(e.enumValue,{ARGS:["silent","rethrow","critical"]})},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.inputClause)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.responseClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.CONSUME(Ol),e.CONSUME2(h),e.SUBRULE2(e.enumValue,{ARGS:["merge","replace"]})},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.stackClause)},"ALT")},{GATE:r(()=>!f,"GATE"),ALT:r(()=>{f=!0,e.SUBRULE(e.tagsAttribute)},"ALT")},{ALT:r(()=>{e.SUBRULE(e.testClause,{ARGS:[d]})},"ALT")}])}),s||e.addMissingError(T,"{} is missing an input clause"),p||e.addMissingError(T,"{} is missing a stack clause"),c||e.addMissingError(T,"{} is missing a response clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(zL,"middlewareDeclaration");function JL(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1,f=!1,d=!1,T=!1,U=!1,k=[];e.sectionStack.push("queryDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let C=e.CONSUME(_l);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(en),e.CONSUME(h),e.OR1([{ALT:r(()=>e.CONSUME(an),"ALT")},{ALT:r(()=>e.CONSUME(tn),"ALT")},{ALT:r(()=>e.CONSUME(rn),"ALT")},{ALT:r(()=>e.CONSUME(on),"ALT")},{ALT:r(()=>e.CONSUME(nn),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.CONSUME($),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.CONSUME(pn),e.CONSUME1(h),e.CONSUME1(E)},"ALT")},{GATE:r(()=>!U,"GATE"),ALT:r(()=>{U=!0,e.CONSUME(Il),e.CONSUME8(h);let L=e.CONSUME2(E),_=le(L);["stream","standard"].includes(_)||e.addInvalidValueError(L,"response_type must be either 'stream' or 'standard'")},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.SUBRULE(e.cacheClause)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!T,"GATE"),ALT:r(()=>{T=!0,e.CONSUME(Lo),e.CONSUME2(h),e.CONSUME3(E)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.docsFieldAttribute)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.inputClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.SUBRULE(e.middlewareClause)},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.responseClause)},"ALT")},{GATE:r(()=>!f,"GATE"),ALT:r(()=>{f=!0,e.SUBRULE(e.stackClause)},"ALT")},{GATE:r(()=>!d,"GATE"),ALT:r(()=>{d=!0,e.SUBRULE(e.tagsAttribute)},"ALT")},{ALT:r(()=>{e.SUBRULE(e.testClause,{ARGS:[k]})},"ALT")}])}),T||e.addWarning("api_group is not provided, defaulting to api_group.xs defined in the same folder",C),c||e.addMissingError(C,"{} is missing an input clause"),f||e.addMissingError(C,"{} is missing a stack clause"),p||e.addMissingError(C,"{} is missing a response clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(JL,"queryDeclaration");function XL(e){return()=>{e.sectionStack.push("realtimeChannelDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let t=e.CONSUME(Gl);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"description?":"[string]","active?":"[boolean]","public_messaging?":{"active?":"[boolean]","auth?":"[boolean]"},"private_messaging?":{"active?":"[boolean]","auth?":"[boolean]"},"settings?":{anonymous_clients:"[boolean]",nested_channels:"[boolean]",message_history:[0,25,50,100,250,1e3],auth_channel:"[boolean]",presence:"[boolean]"}}]}),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(XL,"realtimeChannelDeclaration");function QL(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1,f=!1;e.sectionStack.push("realtimeTriggerDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let d=e.CONSUME(Pl);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.commentBlockFn),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0;let T=e.CONSUME(wl);e.CONSUME(h),e.SUBRULE(e.schemaParseObjectFn,{ARGS:[T,{"join?":"[boolean]","message?":"[boolean]"}]})},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.CONSUME(Bl),e.CONSUME2(h),e.SUBRULE(e.booleanValue)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.channelClause)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.inputClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.SUBRULE(e.responseClause)},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.stackClause)},"ALT")},{GATE:r(()=>!f,"GATE"),ALT:r(()=>{f=!0,e.SUBRULE(e.tagsAttribute)},"ALT")}])}),n||e.addMissingError(d,"{} is missing channel clause"),c||e.addMissingError(d,"{} is missing an input clause"),p||e.addMissingError(d,"{} is missing a stack clause"),l||e.addMissingError(d,"{} is missing a response clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(QL,"realtimeTriggerDeclaration");function ZL(e){return()=>{e.sectionStack.push("runDeclaration"),e.SUBRULE(e.optionalCommentBlockFn),e.CONSUME(ru),e.CONSUME(g),e.OR([{ALT:r(()=>e.SUBRULE(e.runJobClause),"ALT")},{ALT:r(()=>e.SUBRULE(e.runServiceClause),"ALT")}]),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(ZL,"runDeclaration");function $L(e){return()=>{let t=e.CONSUME(ou);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{main:{name:"[string]",input:{"[string]?":"[constant]"}},"env?":["[string]"]}]})}}r($L,"runJobClause");function ex(e){return()=>{let t=e.CONSUME(nu);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"pre?":{name:"[string]",input:{"[string]?":"[constant]"}},"env?":["[string]"]}]})}}r(ex,"runServiceClause");function tx(e){return()=>{e.sectionStack.push("tableDeclaration"),e.SUBRULE(e.optionalCommentBlockFn),e.CONSUME(lr),e.OR1([{ALT:r(()=>e.CONSUME(E,{ERR_MSG:"expected table name after table statement"}),"ALT")},{ALT:r(()=>e.CONSUME(a,{ERR_MSG:"expected table name after table statement"}),"ALT")}]);let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1,f={};e.CONSUME(S),e.sectionStack.push("tableBody"),e.MANY(()=>e.CONSUME(m)),e.MANY1(()=>{e.OR([{ALT:r(()=>e.CONSUME($),"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>e.SUBRULE(e.tagsAttribute),"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>e.SUBRULE(e.authClause),"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>e.SUBRULE(e.viewClause),"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0;let d=e.CONSUME(vu);e.CONSUME(h),e.SUBRULE(e.schemaParseArrayFn,{ARGS:[d,[{"[string]":"[expression]"}]]})},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0;let d=e.CONSUME(Iu);e.CONSUME1(h),e.SUBRULE1(e.schemaParseArrayFn,{ARGS:[d,[{"[string]":"[string]"}]]})},"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>e.SUBRULE(e.schemaClause,{ARGS:[{isTableSchema:!0},f]}),"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>e.SUBRULE(e.indexClause),"ALT")}]),e.AT_LEAST_ONE1(()=>e.CONSUME1(m))}),e.sectionStack.pop(),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(tx,"tableDeclaration");function rx(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1,f=!1;e.sectionStack.push("tableTriggerDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let d=e.CONSUME(Gu);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.commentBlockFn),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0;let T=e.CONSUME(wu);e.CONSUME(h),e.SUBRULE(e.schemaParseObjectFn,{ARGS:[T,{"delete?":"[boolean]","insert?":"[boolean]","truncate?":"[boolean]","update?":"[boolean]"}]})},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.CONSUME(Bu),e.CONSUME2(h),e.SUBRULE(e.booleanValue)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0;let T=e.CONSUME(Pu);e.CONSUME3(h),e.SUBRULE(e.schemaFn,{ARGS:[T,["[string]"]]})},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.dbTableClause)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.SUBRULE(e.inputClause)},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.stackClause)},"ALT")},{GATE:r(()=>!f,"GATE"),ALT:r(()=>{f=!0,e.SUBRULE(e.tagsAttribute)},"ALT")}])}),i||e.addMissingError(d,"{} is missing table clause"),l||e.addMissingError(d,"{} is missing an input clause"),p||e.addMissingError(d,"{} is missing a stack clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(rx,"tableTriggerDeclaration");function ox(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1,f=!1,d=[];e.sectionStack.push("taskDeclaration"),e.SUBRULE(e.optionalCommentBlockFn),e.CONSUME(sn),e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.commentBlockFn),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.CONSUME(Ro),e.CONSUME(h),e.SUBRULE(e.booleanValue)},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.CONSUME(Vu),e.CONSUME2(h),e.CONSUME2(E)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.docsFieldAttribute)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.middlewareClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.SUBRULE(e.scheduleClause)},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.stackClause)},"ALT")},{GATE:r(()=>!f,"GATE"),ALT:r(()=>{f=!0,e.SUBRULE(e.tagsAttribute)},"ALT")},{ALT:r(()=>{e.SUBRULE(e.testClause,{ARGS:[d]})},"ALT")}])}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(ox,"taskDeclaration");function nx(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1,f=!1;e.sectionStack.push("toolDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let d=e.CONSUME(cr);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.commentBlockFn),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.SUBRULE(e.docsFieldAttribute)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.inputClause)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.flexibleStringClause,{ARGS:[Sl]})},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.middlewareClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.SUBRULE(e.responseClause)},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.stackClause,{ARGS:[{allowCallStatements:!0}]})},"ALT")},{GATE:r(()=>!f,"GATE"),ALT:r(()=>{f=!0,e.SUBRULE(e.tagsAttribute)},"ALT")}])}),i||e.addMissingError(d,"{} is missing an input clause"),p||e.addMissingError(d,"{} is missing a stack clause"),l||e.addMissingError(d,"{} is missing a response clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(nx,"toolDeclaration");function ax(e){return()=>{let t=!1,o=!1,n=!1,i=!1;e.sectionStack.push("workflowTestDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let s=e.CONSUME(Ap);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.commentBlockFn),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.CONSUME(cn),e.CONSUME(h),e.CONSUME2(E)},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.stackClause,{ARGS:[{allowExpectStatements:!0,allowCallStatements:!0}]})},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.tagsAttribute)},"ALT")}])}),n||e.addMissingError(s,"{} is missing a stack clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(ax,"workflowTestDeclaration");function ix(e){return()=>{e.sectionStack.push("workspaceDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let t=e.CONSUME(Up);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"env?":{"[string]":"[string]"},"acceptance?":{"ai_terms?":"[boolean]"},"description?":"[string]","preferences?":{"internal_docs?":"[boolean]","sql_columns?":"[boolean]","sql_names?":"[boolean]","track_performance?":"[boolean]"},"realtime?":{"canonical?":"[string]"}}]}),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(ix,"workspaceDeclaration");function sx(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1;e.sectionStack.push("workspaceTriggerDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let p=e.CONSUME(Rp);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.commentBlockFn),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0;let f=e.CONSUME(gp);e.CONSUME(h),e.SUBRULE(e.schemaParseObjectFn,{ARGS:[f,{"branch_live?":"[boolean]","branch_merge?":"[boolean]","branch_new?":"[boolean]"}]})},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.CONSUME(kp),e.CONSUME2(h),e.SUBRULE(e.booleanValue)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.inputClause)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.stackClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.SUBRULE(e.tagsAttribute)},"ALT")}])}),s||e.addMissingError(p,"{} is missing an input clause"),c||e.addMissingError(p,"{} is missing a stack clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(sx,"workspaceTriggerDeclaration");var cx=r(e=>{VL(e),aU(e),MA(e),aL(e),HL(e),ZA(e),e.addonDeclaration=e.RULE("addonDeclaration",EA(e)),e.agentDeclaration=e.RULE("agentDeclaration",hA(e)),e.agentTriggerDeclaration=e.RULE("agentTriggerDeclaration",SA(e)),e.queryDeclaration=e.RULE("queryDeclaration",JL(e)),e.apiGroupDeclaration=e.RULE("apiGroupDeclaration",AA(e)),e.branchDeclaration=e.RULE("branchDeclaration",yA(e)),e.tableDeclaration=e.RULE("tableDeclaration",tx(e)),e.mcpServerDeclaration=e.RULE("mcpServerDeclaration",qL(e)),e.mcpServerTriggerDeclaration=e.RULE("mcpServerTriggerDeclaration",jL(e)),e.middlewareDeclaration=e.RULE("middlewareDeclaration",zL(e)),e.realtimeTriggerDeclaration=e.RULE("realtimeTriggerDeclaration",QL(e)),e.realtimeChannelDeclaration=e.RULE("realtimeChannelDeclaration",XL(e)),e.runDeclaration=e.RULE("runDeclaration",ZL(e)),e.runJobClause=e.RULE("runJobClause",$L(e)),e.runServiceClause=e.RULE("runServiceClause",ex(e)),e.tableTriggerDeclaration=e.RULE("tableTriggerDeclaration",rx(e)),e.taskDeclaration=e.RULE("taskDeclaration",ox(e)),e.toolDeclaration=e.RULE("toolDeclaration",nx(e)),e.workflowTestDeclaration=e.RULE("workflowTestDeclaration",ax(e)),e.workspaceDeclaration=e.RULE("workspaceDeclaration",ix(e)),e.workspaceTriggerDeclaration=e.RULE("workspaceTriggerDeclaration",sx(e)),e.functionDeclaration=e.RULE("functionDeclaration",iU(e))},"register");var SI={buildMismatchTokenMessage:Bt.buildMismatchTokenMessage,buildEarlyExitMessage:Bt.buildEarlyExitMessage,buildNotAllInputParsedMessage:Bt.buildNotAllInputParsedMessage,buildNoViableAltMessage:Bt.buildNoViableAltMessage},$p=class extends jn{static{r(this,"XanoBaseParser")}constructor(t){super(t,{errorMessageProvider:SI,recoveryEnabled:!1}),cx(this),this.sectionStack=[],this.warnings=[],this.reset()}functionAttrReq(){}addVariable(t,o,n=null){this.__symbolTable.var[t]={type:o,value:n}}addInput(t,o,n=!1,i=!1,s=!1){this.__symbolTable.input[t]={type:o,iterable:n,nullable:i,optional:s}}addWarning(t,o){o=o||this.LA(0),this.warnings.push({message:t,token:o})}addInformation(t,o){o=o||this.LA(0),this.informations.push({message:t,token:o})}addHint(t,o){o=o||this.LA(0),this.hints.push({message:t,token:o})}addMissingError(t,o){t=t||this.LA(0),this.SAVE_ERROR(new Oe(o.replaceAll("{}",t.image),t))}addMissingAttributeError(t,o){t=t||this.LA(0),o=[].concat(o);let n=o.join(", "),i=o.length===1?`${t.image} is missing the ${n} attribute`:`${t.image} is missing the following attributes: ${n}`;this.SAVE_ERROR(new Oe(i,t))}addIllegalAttributeError(t,o){t=t||this.LA(0),o||(o=`Attribute \`${t.image}\` is not allowed`),this.SAVE_ERROR(new Oe(o,t))}addExpectedValueTypeError(t,o){t=t||this.LA(0),this.SAVE_ERROR(new Oe(`Expected value of \`${t.image}\` to be of type \`${o}\``,t))}addExpectedValueError(t,o){t=t||this.LA(0),b(o)&&o.length>1?this.SAVE_ERROR(new Oe(`Expected value of \`${t.image}\` to be one of ${o.map(n=>`\`${n}\``).join(", ")}`,t)):this.SAVE_ERROR(new Oe(`Expected value of \`${t.image}\` to be \`${o}\``,t))}addDuplicateAttributeError(t){t=t||this.LA(0),this.SAVE_ERROR(new Oe(`Duplicate attribute \`${t.image}\``,t))}addDuplicateNameError(t,o){t=t||this.LA(0),o?this.SAVE_ERROR(new Oe(`Duplicate ${o} name '${t.image}'`,t)):this.SAVE_ERROR(new Oe(`Duplicate name '${t.image}'`,t))}addInvalidValueError(t,o){t=t||this.LA(0),this.SAVE_ERROR(new Oe(o,t))}requireRules(...t){for(let o of t){if(typeof o!="function")throw new Error(`requireRules only accepts functions, ${typeof o} given`);Object.hasOwn(this,o.name)||(this[o.name]=this.RULE(o.name,o(this)))}}reset(){super.reset(),this.sectionStack=[],this.warnings=[],this.informations=[],this.hints=[],this.__symbolTable={input:{},var:{},auth:{},env:{}}}};function lx(e,t,o=null){t||(t=Xp(e));let n=o||TA(e);switch(G.input=n.tokens,t.toLowerCase()){case"addon":return G.addonDeclaration(),G;case"agent":return G.agentDeclaration(),G;case"agent_trigger":return G.agentTriggerDeclaration(),G;case"api":return G.queryDeclaration(),G;case"api_group":return G.apiGroupDeclaration(),G;case"branch":return G.branchDeclaration(),G;case"db":return G.tableDeclaration(),G;case"mcp_server":return G.mcpServerDeclaration(),G;case"mcp_server_trigger":return G.mcpServerTriggerDeclaration(),G;case"middleware":return G.middlewareDeclaration(),G;case"realtime_trigger":return G.realtimeTriggerDeclaration(),G;case"realtime_channel":return G.realtimeChannelDeclaration(),G;case"run":return G.runDeclaration(),G;case"table_trigger":return G.tableTriggerDeclaration(),G;case"task":return G.taskDeclaration(),G;case"tool":return G.toolDeclaration(),G;case"workflow_test":return G.workflowTestDeclaration(),G;case"workspace":return G.workspaceDeclaration(),G;case"workspace_trigger":return G.workspaceTriggerDeclaration(),G;case"cfn":default:return G.functionDeclaration(),G}}r(lx,"xanoscriptParser");var ef=class extends $p{static{r(this,"XanoScriptParser")}constructor(){super(mn),this.performSelfAnalysis()}},G=new ef;function ux(e,t){let o=Xp(t??e);try{let n=lx(e,o);return n.errors.length===0?[]:n.errors.map(s=>{let c=s.token?.startOffset??0,l=s.token?.endOffset??5,p=e.substring(0,c).split(`
|
|
108
|
+
For further details.`);this.skipValidations=F(o,"skipValidations")?o.skipValidations:qe.skipValidations}};qn.DEFER_DEFINITION_ERRORS_HANDLING=!1;sh(qn,[ui,fi,hi,Si,gi,Ai,Ui,ki,Ri,Ci]);var jn=class extends qn{static{r(this,"CstParser")}constructor(t,o=qe){let n=H(o);n.outputCst=!0,super(t,n)}};var Ym=new Map;function R(e){let{pattern:t}=e,o=t.toString();if(Ym.has(o))return Ym.get(o);let n=wt(e);return Ym.set(o,n),n}r(R,"createUniqToken");function u(e,t){return R({name:`${e} token`,pattern:new RegExp(e),label:e,...t})}r(u,"createTokenByName");var Km=R({name:"DisabledStatementToken",pattern:/![a-zA-Z][\w.]*/}),ch=R({name:"IntCast",pattern:/!int/,label:"!int"}),lh=R({name:"BoolCast",pattern:/!bool/,label:"!bool"}),uh=R({name:"ArrayCast",pattern:/!array/,label:"!array"}),ph=R({name:"TextCast",pattern:/!text/,label:"!text"}),mh=R({name:"ExpressionCast",pattern:/!expr/,label:"!expr"}),fh=R({name:"DecimalCast",pattern:/!decimal/,label:"!decimal"}),dh=R({name:"ObjectCast",pattern:/!object/,label:"!object"}),Th=R({name:"TimestampCast",pattern:/!timestamp/,label:"!timestamp"}),Ne=R({name:"ExclamationToken",pattern:/!/}),Oi=[ch,uh,ph,mh,fh,dh,Th,lh,Ne];function Eh(e){switch(e){case ch.name:case uh.name:case ph.name:case mh.name:case fh.name:case dh.name:case Th.name:case lh.name:return"type";case Km.name:return"comment";case Ne.name:return"operator";default:return null}}r(Eh,"mapTokenToType");var a=R({name:"Identifier",pattern:/[a-zA-Z_]\w*/});var Ni=u("action",{longer_alt:a,categories:[a]}),ir=u("call",{longer_alt:a,categories:[a]}),hh=[Ni,ir];function Sh(e){switch(e){case Ni.name:return"keyword";case ir.name:return"function";default:return null}}r(Sh,"mapTokenToType");var go=u("addon",{longer_alt:a,categories:[a]}),bi=u("call",{longer_alt:a,categories:[a]}),Ah=[go,bi];function gh(e){switch(e){case go.name:return"keyword";case bi.name:return"function";default:return null}}r(gh,"mapTokenToType");var Mi=u("agent",{longer_alt:a,categories:[a]}),yi=u("llm",{longer_alt:a,categories:[a]}),Fi=u("tools",{longer_alt:a,categories:[a]}),Uh=[Mi,yi,Fi];function kh(e){switch(e){case Mi.name:case yi.name:case Fi.name:return"keyword";default:return null}}r(kh,"mapTokenToType");var _i=u("actions",{longer_alt:a,categories:[a]}),Ii=u("active",{longer_alt:a,categories:[a]}),vi=u("agent_trigger",{longer_alt:a,categories:[a]}),Rh=[_i,Ii,vi];function Lh(e){switch(e){case _i.name:case vi.name:return"keyword";case Ii.name:return"variable";default:return null}}r(Lh,"mapTokenToType");var wi=u("ai",{longer_alt:a,categories:[a]}),Bi=u("agent",{longer_alt:a,categories:[a]}),Uo=u("run",{longer_alt:a,categories:[a]}),Pi=u("external",{longer_alt:a,categories:[a]}),Gi=u("mcp",{longer_alt:a,categories:[a]}),Di=u("tool",{longer_alt:a,categories:[a]}),Vi=u("list",{longer_alt:a,categories:[a]}),qi=u("server_details",{longer_alt:a,categories:[a]}),xh=[wi,Bi,Uo,Pi,Gi,Di,Vi,qi];function Ch(e){switch(e){case wi.name:case Bi.name:case Uo.name:case Pi.name:case Gi.name:case Di.name:case Vi.name:case qi.name:return"keyword";default:return null}}r(Ch,"mapTokenToType");var ji=u("api",{longer_alt:a,categories:[a]}),Wi=u("webflow",{longer_alt:a,categories:[a]}),ko=u("request",{longer_alt:a,categories:[a]}),Yi=u("call",{longer_alt:a,categories:[a]}),Ki=u("realtime_event",{longer_alt:a,categories:[a]}),Hi=u("stream",{longer_alt:a,categories:[a]}),zi=u("lambda",{longer_alt:a,categories:[a]}),Oh=u("microservice",{longer_alt:a,categories:[a]}),Nh=[ji,Wi,ko,Yi,Ki,Hi,zi,Oh];function bh(e){switch(e){case ji.name:case Wi.name:case ko.name:case zi.name:case Ki.name:case Hi.name:case Oh.name:case Yi.name:return"function";default:return null}}r(bh,"mapTokenToType");var Ro=u("active",{longer_alt:a,categories:[a]}),Lo=u("api_group",{longer_alt:a,categories:[a]}),Ji=u("canonical",{longer_alt:a,categories:[a]}),Xi=u("cors",{longer_alt:a,categories:[a]}),Qi=u("swagger",{longer_alt:a,categories:[a]}),Mh=[Ro,Lo,Ji,Xi,Qi];function yh(e){switch(e){case Lo.name:return"keyword";case Ro.name:case Ji.name:case Xi.name:case Qi.name:return"variable";default:return null}}r(yh,"mapTokenToType");var Zi=u("array",{longer_alt:a,categories:[a]}),$i=u("every",{longer_alt:a,categories:[a]}),es=u("filter_count",{longer_alt:a,categories:[a]}),ts=u("filter",{longer_alt:a,categories:[a]}),rs=u("find",{longer_alt:a,categories:[a]}),os=u("find_index",{longer_alt:a,categories:[a]}),ns=u("has",{longer_alt:a,categories:[a]}),as=u("merge",{longer_alt:a,categories:[a]}),is=u("pop",{longer_alt:a,categories:[a]}),ss=u("push",{longer_alt:a,categories:[a]}),cs=u("shift",{longer_alt:a,categories:[a]}),ls=u("unshift",{longer_alt:a,categories:[a]}),us=u("map",{longer_alt:a,categories:[a]}),ps=u("partition",{longer_alt:a,categories:[a]}),ms=u("group_by",{longer_alt:a,categories:[a]}),fs=u("difference",{longer_alt:a,categories:[a]}),ds=u("intersection",{longer_alt:a,categories:[a]}),Ts=u("union",{longer_alt:a,categories:[a]}),Fh=[Zi,$i,es,ts,os,rs,ns,as,is,ss,cs,ls,us,ps,ms,fs,ds,Ts];function _h(e){switch(e){case Zi.name:case $i.name:case es.name:case ts.name:case rs.name:case os.name:case ns.name:case as.name:case is.name:case ss.name:case cs.name:case ls.name:case us.name:case ps.name:case ms.name:case fs.name:case ds.name:case Ts.name:return"function";default:return null}}r(_h,"mapTokenToType");var Es=u("branch",{longer_alt:a,categories:[a]}),Ih=u("color",{longer_alt:a,categories:[a]}),vh=[Es,Ih];function wh(e){switch(e){case Es.name:return"keyword";case Ih.name:return"variable";default:return null}}r(wh,"mapTokenToType");var hs=u("cloud",{longer_alt:a,categories:[a]}),Ss=u("algolia",{longer_alt:a,categories:[a]}),As=u("google",{longer_alt:a,categories:[a]}),gs=u("aws",{longer_alt:a,categories:[a]}),Us=u("elasticsearch",{longer_alt:a,categories:[a]}),ks=u("azure",{longer_alt:a,categories:[a]}),Rs=u("storage",{longer_alt:a,categories:[a]}),Ls=u("read_file",{longer_alt:a,categories:[a]}),xs=u("delete_file",{longer_alt:a,categories:[a]}),Cs=u("get_file_info",{longer_alt:a,categories:[a]}),Os=u("list_directory",{longer_alt:a,categories:[a]}),Ns=u("s3",{longer_alt:a,categories:[a]}),bs=u("sign_url",{longer_alt:a,categories:[a]}),Ms=u("upload_file",{longer_alt:a,categories:[a]}),ys=u("opensearch",{longer_alt:a,categories:[a]}),Fs=u("document",{longer_alt:a,categories:[a]}),_s=u("query",{longer_alt:a,categories:[a]}),xo=u("request",{longer_alt:a,categories:[a]}),Bh=[hs,Ss,As,gs,Us,ks,Rs,Ls,xs,Cs,Os,Ns,bs,Ms,ys,Fs,_s,xo];function Ph(e){switch(e){case hs.name:case Ss.name:case As.name:case gs.name:case Us.name:case ks.name:case Rs.name:case Ns.name:case ys.name:case Ls.name:case xs.name:case Cs.name:case Os.name:case bs.name:case Ms.name:case Fs.name:case _s.name:case xo.name:return"function";default:return null}}r(Ph,"mapTokenToType");var Is=u("int",{longer_alt:a,categories:[a]}),vs=u("timestamp",{longer_alt:a,categories:[a]}),Co=u("text",{longer_alt:a,categories:[a]}),ws=u("uuid",{longer_alt:a,categories:[a]}),Bs=u("vector",{longer_alt:a,categories:[a]}),Ps=u("enum",{longer_alt:a,categories:[a]}),Gs=u("date",{longer_alt:a,categories:[a]}),Ds=u("bool",{longer_alt:a,categories:[a]}),Vs=u("decimal",{longer_alt:a,categories:[a]}),qs=u("email",{longer_alt:a,categories:[a]}),js=u("password",{longer_alt:a,categories:[a]}),Ws=u("json",{longer_alt:a,categories:[a]}),Ys=u("file",{longer_alt:a,categories:[a]}),Ks=u("object",{longer_alt:a,categories:[a]}),Hs=u("image",{longer_alt:a,categories:[a]}),zs=u("video",{longer_alt:a,categories:[a]}),Js=u("audio",{longer_alt:a,categories:[a]}),Xs=u("attachment",{longer_alt:a,categories:[a]}),Qs=u("geo_point",{longer_alt:a,categories:[a]}),Zs=u("geo_multipoint",{longer_alt:a,categories:[a]}),$s=u("geo_linestring",{longer_alt:a,categories:[a]}),ec=u("geo_multilinestring",{longer_alt:a,categories:[a]}),tc=u("geo_polygon",{longer_alt:a,categories:[a]}),rc=u("geo_multipolygon",{longer_alt:a,categories:[a]}),oc=u("dblink",{longer_alt:a,categories:[a]}),nc=u("agent",{longer_alt:a,categories:[a]}),ac=u("mcp_server",{longer_alt:a,categories:[a]}),ic=u("channel",{longer_alt:a,categories:[a]}),sc=u("canonical",{longer_alt:a,categories:[a]}),Gh=[nc,sc,ac,ic,oc,Is,vs,Co,ws,Bs,Ps,Gs,Ds,Vs,qs,js,Ws,Ys,Ks,Hs,zs,Js,Xs,Qs,Zs,$s,ec,tc,rc];function Dh(e){switch(e){case nc.name:case sc.name:case ac.name:case ic.name:case oc.name:case Is.name:case vs.name:case Co.name:case ws.name:case Bs.name:case Ps.name:case Gs.name:case Ds.name:case Vs.name:case qs.name:case js.name:case Ws.name:case Ys.name:case Ks.name:case Hs.name:case zs.name:case Js.name:case Xs.name:case Qs.name:case Zs.name:case $s.name:case ec.name:case tc.name:case rc.name:return"type";default:return null}}r(Dh,"mapTokenToType");var $=R({name:"CommentToken",label:"// comment",pattern:{exec:r((e,t)=>{if(!e.slice(t).startsWith("//"))return null;if(t===0)return e.slice(t).match(/.*(?=\n|$)/);let o=t-1;for(;o>=0;){let n=e[o];if(n===`
|
|
109
|
+
`||n==="\r")return e.slice(t).match(/.*(?=\n|$)/);if(n!==" "&&n!==" ")return null;o--}return e.slice(t).match(/.*(?=\n|$)/)},"exec")},line_breaks:!1}),Vh=[$];function qh(e){switch(e){case $.name:return"comment";default:return}}r(qh,"mapTokenToType");var cc=R({name:"ExpressionLiteral",label:"`...`",pattern:/`([^`\\]|\\.)*`/}),E=R({name:"StringLiteral",label:'"..."',pattern:/"([^"\\]|\\.)*"/}),Lt=R({name:"SingleQuotedStringLiteral",pattern:/'([^'\\]|\\.)*'/,label:"''"}),_e=R({name:"FloatLiteral",label:"floating point number",pattern:/-?\d+\.\d+([eE][+-]?\d+)?/}),X=R({name:"IntegerLiteral",label:"integer",pattern:/-?\d+/,longer_alt:_e}),l4=R({name:"DoubleDollar",label:"$$",pattern:/\$\$/}),lc=R({name:"TimestampLiteral",pattern:/\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])\s([01]\d|2[0-3]):([0-5]\d):([0-5]\d)[+-]\d{4}/}),jh=[lc,cc,E,Lt,_e,X];function Wh(e){switch(e){case cc.name:return"macro";case E.name:case lc.name:return"doubleString";case Lt.name:return"singleString";case X.name:case _e.name:return"number";default:return null}}r(Wh,"mapTokenToType");var uc=u("conditional",{longer_alt:a,categories:[a]}),Oo=u("if",{longer_alt:a,categories:[a]}),pc=u("else",{longer_alt:a,categories:[a]}),mc=u("elseif",{longer_alt:a,categories:[a]}),fc=u("for",{longer_alt:a,categories:[a]}),dc=u("foreach",{longer_alt:a,categories:[a]}),Tc=u("remove",{longer_alt:a,categories:[a]}),Ec=u("await",{longer_alt:a,categories:[a]}),mt=u("each",{longer_alt:a,categories:[a]}),hc=u("try_catch",{longer_alt:a,categories:[a]}),Wn=u("try",{longer_alt:a,categories:[a]}),Sc=u("catch",{longer_alt:a,categories:[a]}),Ac=u("finally",{longer_alt:a,categories:[a]}),at=u("as",{longer_alt:a,categories:[a]}),gc=u("return",{longer_alt:a,categories:[a]}),Uc=u("switch",{longer_alt:a,categories:[a]}),kc=u("case",{longer_alt:a,categories:[a]}),Rc=u("default",{longer_alt:a,categories:[a]}),Lc=u("while",{longer_alt:a,categories:[a]}),xc=u("group",{longer_alt:a,categories:[a]}),Cc=u("throw",{longer_alt:a,categories:[a]}),No=u("break",{longer_alt:a,categories:[a]}),Oc=u("continue",{longer_alt:a,categories:[a]}),Yn=R({name:"GreaterThan",pattern:/>/,label:">"}),Kn=R({name:"GreaterThanOrEqual",pattern:/>=/,label:">="}),Hn=R({name:"SmallerThan",pattern:/</,label:"<"}),zn=R({name:"SmallerThanOrEq",pattern:/<=/,label:"<="}),Nc=R({name:"Minus",pattern:/-/,label:"-",longer_alt:X}),bc=R({name:"Plus",pattern:/\+/,label:"+"}),Mc=R({name:"Multiply",pattern:/\*/,label:"*"}),yc=R({name:"Divide",pattern:/\//,label:"/"}),Fc=R({name:"Modulus",pattern:/%/,label:"%"}),Jn=R({name:"IsEqual",label:"==",pattern:/==/}),_c=R({name:"IsStrictEqual",label:"===",pattern:/===/}),Xn=R({name:"IsNotEqual",label:"!=",pattern:/!=/}),Ic=R({name:"IsStrictNotEqual",label:"!==",pattern:/!==/}),h=R({name:"EqualToken",label:"=",pattern:/=/}),S=R({name:"LCurly",pattern:/{/,label:"{"}),A=R({name:"RCurly",pattern:/}/,label:"}"}),re=R({name:"LSquare",pattern:/\[/,label:"["}),oe=R({name:"RSquare",pattern:/]/,label:"]"}),B=R({name:"LParent",pattern:/\(/,label:"("}),P=R({name:"RParent",pattern:/\)/,label:")"}),et=R({name:"Question",pattern:/\?/,label:"?"}),be=R({name:"ColonToken",pattern:/:/,label:":"}),Me=R({name:"PipeToken",pattern:/\|/,label:"|"}),je=R({name:"CommaToken",pattern:/,/,label:","}),vc=R({name:"AndTestToken",pattern:/&&/,label:"&&"}),wc=R({name:"NullishCoalescingToken",pattern:/\?\?/,label:"??"}),Bc=R({name:"OrTestToken",pattern:/\|\|/,label:"||"}),Qn=R({name:"JsonBetweenToken",pattern:/between/,label:"between",longer_alt:a,categories:[a]}),Zn=R({name:"JsonContainsToken",pattern:/@>/,label:"@>"}),$n=R({name:"JsonContainsStringToken",pattern:/contains/,label:"contains",longer_alt:a,categories:[a]}),Hm=R({name:"JsonEqualToken",pattern:/=/,label:"="}),ea=R({name:"JsonILikeToken",pattern:/ilike/,label:"ilike",longer_alt:a,categories:[a]}),ta=R({name:"JsonIncludesToken",pattern:/includes/,label:"includes",longer_alt:a,categories:[a]}),ra=R({name:"JsonLikeToken",pattern:/like/,label:"like",longer_alt:a,categories:[a]}),oa=R({name:"JsonNotBetweenToken",pattern:/not between/,label:"not between"}),na=R({name:"JsonNotContainsToken",pattern:/not contains/,label:"not contains"}),aa=R({name:"JsonNotILikeToken",pattern:/not ilike/,label:"not ilike"}),ia=R({name:"JsonNotInToken",pattern:/not in/,label:"not in"}),sa=R({name:"JsonNotIncludesToken",pattern:/not includes/,label:"not includes"}),ca=R({name:"JsonNotLikeToken",pattern:/not like/,label:"not like"}),la=R({name:"JsonNotOverlapsToken",pattern:/not overlaps/,label:"not overlaps"}),ua=R({name:"JsonNotRegexToken",pattern:/!~/,label:"!~"}),pa=R({name:"JsonOverlapsToken",pattern:/overlaps/,label:"overlaps",longer_alt:a,categories:[a]}),Pc=R({name:"JsonRegexToken",pattern:/~/,label:"~"}),Gc=R({name:"JsonSearchToken",pattern:/search/,label:"search",longer_alt:a,categories:[a]}),Yh=[oa,na,aa,sa,ia,Qn,Zn,$n,ea,ta,ra,ca,la,ua,pa,Pc,Gc,wc,vc,Bc,uc,Oo,mc,pc,dc,fc,mt,Tc,Ec,at,gc,Uc,kc,Rc,Lc,xc,Cc,No,Oc,Kn,Yn,zn,Hn,Nc,bc,Mc,yc,Fc,_c,Jn,Ic,Xn,h,S,A,re,oe,B,P,et,be,Me,je,hc,Wn,Sc,Ac,Hm];function Kh(e){switch(e){case Oo.name:case pc.name:case mc.name:case mt.name:case at.name:case Wn.name:case Sc.name:case Ac.name:return"keyword";case uc.name:case Ec.name:case gc.name:case xc.name:case Cc.name:case No.name:case Oc.name:case fc.name:case Uc.name:case Tc.name:case dc.name:case Lc.name:case kc.name:case Rc.name:case hc.name:return"function";case S.name:return"operator.openingCurly";case A.name:return"operator.closingCurly";case re.name:return"operator.openingSquare";case oe.name:return"operator.closingSquare";case B.name:return"operator.openingParenthesis";case P.name:return"operator.closingParenthesis";case Yn.name:case Kn.name:case Hn.name:case zn.name:case Nc.name:case bc.name:case vc.name:case Bc.name:case Mc.name:case yc.name:case Fc.name:case h.name:case Jn.name:case Xn.name:case wc.name:case oa.name:case na.name:case aa.name:case sa.name:case ia.name:case Qn.name:case Zn.name:case $n.name:case ea.name:case ta.name:case ra.name:case ca.name:case la.name:case ua.name:case pa.name:case Pc.name:return"operator";case Gc.name:return"variable";case et.name:case be.name:case Me.name:case je.name:return"punctuation";default:return null}}r(Kh,"mapTokenToType");var bo=u("db",{longer_alt:a,categories:[a]}),Dc=u("query",{longer_alt:a,categories:[a]}),Vc=u("get",{longer_alt:a,categories:[a]}),Mo=u("add",{longer_alt:a,categories:[a]}),qc=u("add_or_edit",{longer_alt:a,categories:[a]}),jc=u("del",{longer_alt:a,categories:[a]}),Wc=u("delete",{longer_alt:a,categories:[a]}),Yc=u("edit",{longer_alt:a,categories:[a]}),Kc=u("update",{longer_alt:a,categories:[a]}),Hc=u("has",{longer_alt:a,categories:[a]}),yo=u("patch",{longer_alt:a,categories:[a]}),zc=u("schema",{longer_alt:a,categories:[a]}),Jc=u("transaction",{longer_alt:a,categories:[a]}),Xc=u("truncate",{longer_alt:a,categories:[a]}),Fo=u("direct_query",{longer_alt:a,categories:[a]}),Qc=u("set_datasource",{longer_alt:a,categories:[a]}),Zc=u("bulk",{longer_alt:a,categories:[a]}),$c=u("external",{longer_alt:a,categories:[a]}),el=u("mssql",{longer_alt:a,categories:[a]}),tl=u("mysql",{longer_alt:a,categories:[a]}),rl=u("postgres",{longer_alt:a,categories:[a]}),ol=u("oracle",{longer_alt:a,categories:[a]}),Hh=[bo,Dc,Vc,qc,Mo,Wc,jc,Yc,Kc,Hc,yo,zc,Jc,Xc,Fo,Qc,Zc,$c,el,tl,rl,ol];function zh(e){switch(e){case zc.name:return"keyword";case bo.name:case Zc.name:case $c.name:case el.name:case tl.name:case rl.name:case ol.name:case Dc.name:case Vc.name:case Mo.name:case qc.name:case Wc.name:case jc.name:case Yc.name:case Kc.name:case Hc.name:case yo.name:case Jc.name:case Xc.name:case Fo.name:case Qc.name:return"function";default:return null}}r(zh,"mapTokenToType");var nl=u("debug",{longer_alt:a,categories:[a]}),al=u("stop",{longer_alt:a,categories:[a]}),il=u("log",{longer_alt:a,categories:[a]}),Jh=[nl,al,il];function Xh(e){switch(e){case nl.name:case al.name:case il.name:return"function";default:return null}}r(Xh,"mapTokenToType");var _o=u("expect",{longer_alt:a,categories:[a]}),Io=u("to_be_true",{longer_alt:a,categories:[a]}),vo=u("to_be_false",{longer_alt:a,categories:[a]}),wo=u("to_be_in_the_past",{longer_alt:a,categories:[a]}),Bo=u("to_be_in_the_future",{longer_alt:a,categories:[a]}),Po=u("to_be_defined",{longer_alt:a,categories:[a]}),Go=u("to_not_be_defined",{longer_alt:a,categories:[a]}),Do=u("to_be_null",{longer_alt:a,categories:[a]}),Vo=u("to_not_be_null",{longer_alt:a,categories:[a]}),qo=u("to_be_empty",{longer_alt:a,categories:[a]}),jo=u("to_start_with",{longer_alt:a,categories:[a]}),Wo=u("to_end_with",{longer_alt:a,categories:[a]}),Yo=u("to_be_greater_than",{longer_alt:a,categories:[a]}),Ko=u("to_be_less_than",{longer_alt:a,categories:[a]}),Ho=u("to_match",{longer_alt:a,categories:[a]}),zo=u("to_equal",{longer_alt:a,categories:[a]}),Jo=u("to_not_equal",{longer_alt:a,categories:[a]}),Xo=u("to_contain",{longer_alt:a,categories:[a]}),Qo=u("to_be_within",{longer_alt:a,categories:[a]}),Zo=u("to_throw",{longer_alt:a,categories:[a]}),Qh=[_o,Io,vo,wo,Bo,Po,Go,Do,Vo,qo,jo,Wo,Yo,Ko,Ho,zo,Jo,Xo,Qo,Zo];function Zh(e){switch(e){case _o.name:case Io.name:case vo.name:case wo.name:case Bo.name:case Po.name:case Go.name:case Do.name:case Vo.name:case qo.name:case jo.name:case Wo.name:case Yo.name:case Ko.name:case Ho.name:case zo.name:case Jo.name:case Xo.name:case Qo.name:case Zo.name:return"function";default:return null}}r(Zh,"mapTokenToType");var sr=u("function",{longer_alt:a,categories:[a]}),sl=u("run",{longer_alt:a,categories:[a]}),cl=u("call",{longer_alt:a,categories:[a]}),$h=[sr,sl,cl];function eS(e){switch(e){case sr.name:return"keyword";case sl.name:case cl.name:return"function";default:return null}}r(eS,"mapTokenToType");var ll=u("math",{longer_alt:a,categories:[a]}),ul=u("add",{longer_alt:a,categories:[a]}),pl=u("div",{longer_alt:a,categories:[a]}),ml=u("mod",{longer_alt:a,categories:[a]}),fl=u("mul",{longer_alt:a,categories:[a]}),dl=u("sub",{longer_alt:a,categories:[a]}),Tl=u("bitwise",{longer_alt:a,categories:[a]}),El=u("and",{longer_alt:a,categories:[a]}),hl=u("or",{longer_alt:a,categories:[a]}),Sl=u("xor",{longer_alt:a,categories:[a]}),tS=[ll,ul,pl,ml,fl,dl,Tl,El,hl,Sl];function rS(e){switch(e){case ll.name:case ul.name:case pl.name:case ml.name:case fl.name:case dl.name:case Tl.name:case El.name:case hl.name:case Sl.name:return"function";default:return null}}r(rS,"mapTokenToType");var Al=u("instructions",{longer_alt:a,categories:[a]}),cr=u("tool",{longer_alt:a,categories:[a]}),oS=u("call",{longer_alt:a,categories:[a]}),nS=[Al,cr,oS];function aS(e){switch(e){case cr.name:return"keyword";case Al.name:return"variable";case oS.name:return"function";default:return null}}r(aS,"mapTokenToType");var gl=u("active",{longer_alt:a,categories:[a]}),Ul=u("instructions",{longer_alt:a,categories:[a]}),kl=u("mcp_server",{longer_alt:a,categories:[a]}),Rl=u("tools",{longer_alt:cr,categories:[a]}),iS=[gl,Ul,kl,Rl];function sS(e){switch(e){case gl.name:case kl.name:case Rl.name:return"keyword";case Ul.name:return"variable";default:return null}}r(sS,"mapTokenToType");var Ll=u("actions",{longer_alt:a,categories:[a]}),xl=u("active",{longer_alt:a,categories:[a]}),Cl=u("mcp_server_trigger",{longer_alt:a,categories:[a]}),cS=[Ll,xl,Cl];function lS(e){switch(e){case Ll.name:case Cl.name:return"keyword";case xl.name:return"variable";default:return null}}r(lS,"mapTokenToType");var Ol=u("exception_policy",{longer_alt:a,categories:[a]}),$o=u("middleware",{longer_alt:a,categories:[a]}),Nl=u("response_strategy",{longer_alt:a,categories:[a]}),uS=[Ol,$o,Nl];function pS(e){switch(e){case $o.name:return"keyword";case Ol.name:case Nl.name:return"variable";default:return null}}r(pS,"mapTokenToType");var ze=wt({name:'"""..."""',pattern:/("""\r?\n(?:[\s\S]*?\r?\n)?[ ]*""")|('''\r?\n(?:[\s\S]*?\r?\n)?[ ]*''')/}),bl=wt({name:"MultiLineExpression",pattern:/```\r?\n(?:[\s\S]*?\r?\n)?[ ]*```/}),mS=[ze,bl];function fS(e){switch(e){case ze.name:return"tripleString";case bl.name:return"tripleMacro";default:return null}}r(fS,"mapTokenToType");var Ml=u("object",{longer_alt:a,categories:[a]}),yl=u("entries",{longer_alt:a,categories:[a]}),Fl=u("keys",{longer_alt:a,categories:[a]}),_l=u("values",{longer_alt:a,categories:[a]}),dS=[Ml,yl,Fl,_l];function TS(e){switch(e){case Ml.name:case yl.name:case Fl.name:case _l.name:return"function";default:return null}}r(TS,"mapTokenToType");var Il=u("query",{longer_alt:a,categories:[a]}),en=u("verb",{longer_alt:a,categories:[a]}),tn=u("GET",{longer_alt:a,categories:[a]}),rn=u("PATCH",{longer_alt:a,categories:[a]}),on=u("POST",{longer_alt:a,categories:[a]}),nn=u("PUT",{longer_alt:a,categories:[a]}),an=u("DELETE",{categories:[a],longer_alt:a}),vl=u("response_type",{longer_alt:a,categories:[a]}),ES=u("dblink",{longer_alt:a,categories:[a]}),wl=u("output",{longer_alt:a,categories:[a]}),hS=u("addon",{longer_alt:a,categories:[a]}),SS=[vl,Il,en,tn,rn,on,nn,an,ES,wl,hS];function AS(e){switch(e){case Il.name:case en.name:case vl.name:return"keyword";case tn.name:case rn.name:case on.name:case nn.name:case an.name:return"enumMember";case ES.name:case wl.name:case hS.name:return"property";default:return null}}r(AS,"mapTokenToType");var Bl=u("actions",{longer_alt:a,categories:[a]}),Pl=u("active",{longer_alt:a,categories:[a]}),Gl=u("realtime_trigger",{longer_alt:a,categories:[a]}),Dl=u("realtime_channel",{longer_alt:a,categories:[a]}),gS=[Bl,Pl,Gl,Dl];function US(e){switch(e){case Bl.name:case Gl.name:case Dl.name:return"keyword";case Pl.name:return"variable";default:return null}}r(US,"mapTokenToType");var Vl=u("redis",{longer_alt:a,categories:[a]}),ql=u("count",{longer_alt:a,categories:[a]}),jl=u("decr",{longer_alt:a,categories:[a]}),Wl=u("del",{longer_alt:a,categories:[a]}),Yl=u("get",{longer_alt:a,categories:[a]}),Kl=u("has",{longer_alt:a,categories:[a]}),Hl=u("incr",{longer_alt:a,categories:[a]}),zl=u("keys",{longer_alt:a,categories:[a]}),Jl=u("pop",{longer_alt:a,categories:[a]}),Xl=u("push",{longer_alt:a,categories:[a]}),Ql=u("range",{longer_alt:a,categories:[a]}),Zl=u("ratelimit",{longer_alt:a,categories:[a]}),$l=u("remove",{longer_alt:a,categories:[a]}),eu=u("set",{longer_alt:a,categories:[a]}),tu=u("shift",{longer_alt:a,categories:[a]}),ru=u("unshift",{longer_alt:a,categories:[a]}),kS=[Vl,ql,jl,Wl,Yl,Kl,Hl,zl,Jl,Xl,Ql,Zl,$l,eu,tu,ru];function RS(e){switch(e){case Vl.name:case ql.name:case jl.name:case Wl.name:case Yl.name:case Kl.name:case Hl.name:case zl.name:case Jl.name:case Xl.name:case Ql.name:case Zl.name:case $l.name:case eu.name:case tu.name:case ru.name:return"function";default:return null}}r(RS,"mapTokenToType");var ou=u("run",{longer_alt:a,categories:[a]}),nu=u("job",{longer_alt:a,categories:[a]}),au=u("service",{longer_alt:a,categories:[a]}),LS=[ou,nu,au];function xS(e){switch(e){case ou.name:case nu.name:case au.name:return"keyword";default:return null}}r(xS,"mapTokenToType");var iu=u("security",{longer_alt:a,categories:[a]}),su=u("check_password",{longer_alt:a,categories:[a]}),cu=u("create_password",{longer_alt:a,categories:[a]}),lu=u("create_uuid",{longer_alt:a,categories:[a]}),uu=u("create_auth_token",{longer_alt:a,categories:[a]}),pu=u("create_curve_key",{longer_alt:a,categories:[a]}),mu=u("create_rsa_key",{longer_alt:a,categories:[a]}),fu=u("create_secret_key",{longer_alt:a,categories:[a]}),du=u("decrypt",{llt:a,categories:[a]}),Tu=u("encrypt",{llt:a,categories:[a]}),CS=u("generate_pass",{longer_alt:a,categories:[a]}),OS=u("generate_uuid",{longer_alt:a,categories:[a]}),Eu=u("jwe_decode",{longer_alt:a,categories:[a]}),hu=u("jwe_encode",{longer_alt:a,categories:[a]}),Su=u("jws_decode",{longer_alt:a,categories:[a]}),Au=u("jws_encode",{longer_alt:a,categories:[a]}),gu=u("random_bytes",{longer_alt:a,categories:[a]}),Uu=u("random_number",{longer_alt:a,categories:[a]}),NS=[su,cu,lu,uu,pu,mu,fu,du,Tu,CS,OS,Eu,hu,Su,Au,gu,Uu,iu];function bS(e){switch(e){case iu.name:case su.name:case cu.name:case lu.name:case uu.name:case pu.name:case mu.name:case fu.name:case du.name:case Tu.name:case CS.name:case OS.name:case Eu.name:case hu.name:case Su.name:case Au.name:case gu.name:case Uu.name:return"function";default:return null}}r(bS,"mapTokenToType");var ku=u("storage",{longer_alt:a,categories:[a]}),Ru=u("create_image",{longer_alt:a,categories:[a]}),Lu=u("create_attachment",{longer_alt:a,categories:[a]}),xu=u("read_file_resource",{longer_alt:a,categories:[a]}),Cu=u("create_file_resource",{longer_alt:a,categories:[a]}),MS=u("read_file",{longer_alt:a,categories:[a]}),Ou=u("create_audio",{longer_alt:a,categories:[a]}),Nu=u("create_video",{longer_alt:a,categories:[a]}),bu=u("delete_file",{longer_alt:a,categories:[a]}),Mu=u("sign_private_url",{longer_alt:a,categories:[a]}),yS=[ku,Ru,Lu,xu,Cu,MS,Ou,Nu,bu,Mu];function FS(e){switch(e){case ku.name:case Ru.name:case Lu.name:case xu.name:case Cu.name:case MS.name:case bu.name:case Mu.name:case Ou.name:case Nu.name:return"function";default:return null}}r(FS,"mapTokenToType");var yu=u("stream",{longer_alt:a,categories:[a]}),Fu=u("from_csv",{longer_alt:a,categories:[a]}),_u=u("from_jsonl",{longer_alt:a,categories:[a]}),Iu=u("from_request",{longer_alt:a,categories:[a]}),_S=[yu,Fu,_u,Iu];function IS(e){switch(e){case yu.name:case Fu.name:case _u.name:case Iu.name:return"function";default:return null}}r(IS,"mapTokenToType");var lr=u("table",{longer_alt:a,categories:[a]}),vu=u("autocomplete",{longer_alt:a,categories:[a]}),wu=u("items",{longer_alt:a,categories:[a]}),vS=[lr,vu,wu];function wS(e){switch(e){case lr.name:return"keyword";case vu.name:case wu.name:return"identifier";default:return null}}r(wS,"mapTokenToType");var Bu=u("actions",{longer_alt:a,categories:[a]}),Pu=u("active",{longer_alt:a,categories:[a]}),Gu=u("datasources",{longer_alt:a,categories:[a]}),Du=u("table_trigger",{longer_alt:a,categories:[a]}),BS=[Bu,Pu,Gu,Du];function PS(e){switch(e){case Bu.name:case Du.name:return"keyword";case Pu.name:case Gu.name:return"variable";default:return null}}r(PS,"mapTokenToType");var Vu=u("call",{longer_alt:a,categories:[a]}),qu=u("datasource",{longer_alt:a,categories:[a]}),GS=u("ends_on",{longer_alt:a,categories:[a]}),DS=u("events",{longer_alt:a,categories:[a]}),VS=u("freq",{longer_alt:a,categories:[a]}),ju=u("schedule",{longer_alt:a,categories:[a]}),qS=u("starts_on",{longer_alt:a,categories:[a]}),sn=u("task",{longer_alt:a,categories:[a]}),jS=[Vu,qu,GS,DS,VS,ju,qS,sn];function WS(e){switch(e){case qu.name:case ju.name:case sn.name:return"keyword";case GS.name:case DS.name:case VS.name:case qS.name:return"variable";case Vu.name:return"function";default:return null}}r(WS,"mapTokenToType");var YS=u("text",{longer_alt:a,categories:[a]}),Wu=u("append",{longer_alt:a,categories:[a]}),Yu=u("contains",{longer_alt:a,categories:[a]}),Ku=u("ends_with",{longer_alt:a,categories:[a]}),Hu=u("icontains",{longer_alt:a,categories:[a]}),zu=u("iends_with",{longer_alt:a,categories:[a]}),Ju=u("istarts_with",{longer_alt:a,categories:[a]}),Xu=u("ltrim",{longer_alt:a,categories:[a]}),Qu=u("prepend",{longer_alt:a,categories:[a]}),Zu=u("rtrim",{longer_alt:a,categories:[a]}),$u=u("starts_with",{longer_alt:a,categories:[a]}),ep=u("trim",{longer_alt:a,categories:[a]}),KS=[YS,Wu,Yu,Ku,Hu,zu,Ju,Xu,Qu,Zu,$u,ep];function HS(e){switch(e){case YS.name:return"namespace";case Wu.name:case Yu.name:case Ku.name:case Hu.name:case zu.name:case Ju.name:case Xu.name:case Qu.name:case Zu.name:case $u.name:case ep.name:return"method";default:return null}}r(HS,"mapTokenToType");var tp=u("util",{longer_alt:a,categories:[a]}),rp=u("send_email",{longer_alt:a,categories:[a]}),op=u("geo_distance",{longer_alt:a,categories:[a]}),np=u("get_all_input",{longer_alt:a,categories:[a]}),ap=u("template_engine",{longer_alt:a,categories:[a]}),ip=u("get_env",{longer_alt:a,categories:[a]}),sp=u("get_raw_input",{longer_alt:a,categories:[a]}),cp=u("get_vars",{longer_alt:a,categories:[a]}),lp=u("ip_lookup",{longer_alt:a,categories:[a]}),up=u("post_process",{longer_alt:a,categories:[a]}),pp=u("precondition",{longer_alt:a,categories:[a]}),mp=u("set_header",{longer_alt:a,categories:[a]}),fp=u("sleep",{longer_alt:a,categories:[a]}),zS=[tp,ap,op,rp,np,ip,sp,cp,lp,up,pp,mp,fp];function JS(e){switch(e){case tp.name:case op.name:case np.name:case ip.name:case sp.name:case cp.name:case lp.name:case up.name:case pp.name:case mp.name:case fp.name:case ap.name:case rp.name:return"function";default:return null}}r(JS,"mapTokenToType");var dp=u("var",{longer_alt:a,categories:[a]}),Tp=u("update",{longer_alt:a,categories:[a]}),XS=[dp,Tp];function QS(e){switch(e){case dp.name:case Tp.name:return"function";default:return null}}r(QS,"mapTokenToType");var V=R({name:"ShortFormVariable",pattern:/(\$[a-zA-Z_]\w*)|(\$\$)/,label:"$"}),ur=R({name:"ResponseVariable",pattern:/\$response/,label:"$response",categories:[V],longer_alt:V}),pr=R({name:"LongFormVariable",pattern:/\$var/,label:"$var",longer_alt:V}),ZS=R({name:"$this",pattern:/\$this/,longer_alt:V,categories:[V]}),Ep=R({name:"InputVariable",pattern:/\$input/,longer_alt:V}),hp=R({name:"EnvVariable",pattern:/\$env/,label:"$env",longer_alt:V}),Sp=R({name:"AuthVariable",pattern:/\$auth/,label:"$auth",longer_alt:V}),mr=R({name:"$remote_ip",pattern:/\$remote_ip/,longer_alt:V}),fr=R({name:"$tenant",pattern:/\$tenant/,longer_alt:V}),Ap=R({name:"$error",pattern:/\$error/,longer_alt:V}),dr=R({name:"$remote_port",pattern:/\$remote_port/,longer_alt:V}),Tr=R({name:"$remote_user",pattern:/\$remote_user/,longer_alt:V}),Er=R({name:"$http_headers",pattern:/\$http_headers/,longer_alt:V}),hr=R({name:"$webflow",pattern:/\$webflow/,longer_alt:V}),Sr=R({name:"$api_baseurl",pattern:/\$api_baseurl/,longer_alt:V}),Ar=R({name:"$request_uri",pattern:/\$request_uri/,longer_alt:V}),gr=R({name:"$request_querystring",pattern:/\$request_querystring/,longer_alt:V}),Ur=R({name:"$request_auth_token",pattern:/\$request_auth_token/,longer_alt:V}),kr=R({name:"$datasource",pattern:/\$datasource/,longer_alt:V}),Rr=R({name:"$branch",pattern:/\$branch/,longer_alt:V}),Lr=R({name:"$remote_passwd",pattern:/\$remote_passwd/,longer_alt:V}),xr=R({name:"$remote_host",pattern:/\$remote_host/,longer_alt:V}),Cr=R({name:"$request_method",pattern:/\$request_method/,longer_alt:V}),$S=[ur,ZS,pr,Ep,hp,Sp,Ap,mr,fr,dr,Tr,Lr,xr,Cr,Er,hr,Sr,Ar,gr,Ur,kr,Rr,V];function eA(e){switch(e){case Ep.name:case Ap.name:case hp.name:case Sp.name:case mr.name:case fr.name:case dr.name:case Tr.name:case Lr.name:case xr.name:case Cr.name:case ur.name:case pr.name:case Er.name:case hr.name:case Sr.name:case Ar.name:case gr.name:case Ur.name:case kr.name:case Rr.name:return"enumMember";case ZS.name:case V.name:return"variable";default:return null}}r(eA,"mapTokenToType");var cn=u("datasource",{longer_alt:a,categories:[a]}),gp=u("workflow_test",{longer_alt:a,categories:[a]}),tA=u("exception",{longer_alt:a,categories:[a]}),rA=[cn,gp,tA];function oA(e){switch(e){case gp.name:return"keyword";case tA.name:case cn.name:return"variable";default:return null}}r(oA,"mapTokenToType");var Up=u("workspace",{longer_alt:a,categories:[a]}),nA=[Up];function aA(e){switch(e){case Up.name:return"keyword";default:return null}}r(aA,"mapTokenToType");var kp=u("actions",{longer_alt:a,categories:[a]}),Rp=u("active",{longer_alt:a,categories:[a]}),Lp=u("workspace_trigger",{longer_alt:a,categories:[a]}),iA=[kp,Rp,Lp];function sA(e){switch(e){case kp.name:case Lp.name:return"keyword";case Rp.name:return"variable";default:return null}}r(sA,"mapTokenToType");var xp=u("zip",{longer_alt:a,categories:[a]}),Cp=u("add_to_archive",{longer_alt:a,categories:[a]}),Op=u("create_archive",{longer_alt:a,categories:[a]}),Np=u("delete_from_archive",{longer_alt:a,categories:[a]}),bp=u("extract",{longer_alt:a,categories:[a]}),Mp=u("view_contents",{longer_alt:a,categories:[a]}),cA=[xp,Cp,Op,Np,bp,Mp];function lA(e){switch(e){case xp.name:case Cp.name:case Op.name:case Np.name:case bp.name:case Mp.name:return"function"}}r(lA,"mapTokenToType");var O5=R({name:"ObjectIdentifier",pattern:/[0-9a-zA-Z_]\w*/});var U=R({name:"Dot",pattern:/\./,label:"."}),yp=u("tags",{longer_alt:a,categories:[a]}),Or=u("now",{longer_alt:a}),xt=u("null",{longer_alt:a}),Fp=R({name:"RegExpToken",label:"regexp",pattern:/\/(?:[^/\n\\]|\\.)+\//}),uA=R({name:"WhiteSpace",pattern:/[ \t]+/,group:se.SKIPPED,label:"whitespace"}),m=R({name:"NewlineToken",pattern:/(\r?\n)/}),pA=u("type",{longer_alt:a,categories:[a]}),mA=u("field",{longer_alt:a,categories:[a]}),Ue=u("true",{longer_alt:a}),ke=u("false",{longer_alt:a}),ln=u("input",{longer_alt:a,categories:[a]}),un=u("stack",{longer_alt:a,categories:[a]}),_p=u("test",{longer_alt:a,categories:[a]}),Ip=u("response",{longer_alt:a,categories:[a]}),vp=u("view",{longer_alt:a,categories:[a]}),wp=u("middleware",{longer_alt:a,categories:[a]}),fA=u("return_aggregate",{pattern:/return_aggregate/}),pn=u("auth",{longer_alt:a,categories:[a]}),dA=u("security",{longer_alt:a,categories:[a]}),Bp=u("history",{longer_alt:a,categories:[a]}),Pp=u("cache",{longer_alt:a,categories:[a]}),TA=u("guid",{longer_alt:a,categories:[a]}),Gp=u("schema",{longer_alt:a,categories:[a]}),Dp=u("index",{longer_alt:a,categories:[a]}),Vp=u("values",{longer_alt:a,categories:[a]}),qp=u("value",{longer_alt:a,categories:[a]}),jp=u("filters",{longer_alt:a,categories:[a]}),Wp=R({name:"DbLinkFilter",label:"@",pattern:/@/}),Yp=u("sensitive",{longer_alt:a,categories:[a]}),Kp=u("description",{longer_alt:a,categories:[a]}),Hp=u("disabled",{longer_alt:a,categories:[a]}),zp=u("mock",{longer_alt:a,categories:[a]}),Jp=u("docs",{longer_alt:a,categories:[a]}),Xp=R({name:"DbIdentifier",label:"db.identifier",pattern:/dbo=\d+/}),ma=R({name:"JsonInToken",pattern:/in/,label:"in",longer_alt:a,categories:[a]}),mn=or([uA,m,...mS,...Vh,Fp,Dp,ln,fA,jp,...Rh,...cS,...iS,...gS,...Fh,...Gh,...jh,...Yh,...SS,...Oi,Wp,Xp,Vp,qp,Ue,ke,pA,mA,pn,TA,Yp,yp,Kp,Jp,Hp,zp,Gp,un,_p,wp,...uS,Ip,xt,Or,Bp,Pp,dA,...yS,...cA,...$h,...NS,...zS,...BS,...iA,...jS,...rA,...Mh,...Nh,...$S,...vS,...Bh,...Hh,...kS,...KS,...LS,...dS,..._S,...Jh,...Qh,...XS,...tS,...xh,...Uh,...nS,...Ah,...hh,...vh,...nA,vp,ma,U,a]),aI=[gh,Sh,Ch,kh,Lh,yh,bh,_h,wh,Eh,Ph,Dh,qh,Kh,zh,Xh,Zh,eS,Wh,rS,sS,lS,pS,fS,TS,AS,US,RS,xS,bS,FS,IS,wS,PS,WS,HS,aS,JS,QS,eA,oA,aA,sA,lA],zm=new Map;function iI(){let e={[Pp.name]:"keyword",[Bp.name]:"keyword",[Dp.name]:"keyword",[ln.name]:"keyword",[wp.name]:"keyword",[zp.name]:"keyword",[Ip.name]:"keyword",[vp.name]:"keyword",[Gp.name]:"keyword",[dA.name]:"keyword",[un.name]:"keyword",[_p.name]:"keyword",[jp.name]:"keyword",[Wp.name]:"function",[pn.name]:"variable",[Xp.name]:"variable",[fA.name]:"variable",[Kp.name]:"variable",[Hp.name]:"variable",[Jp.name]:"variable",[mA.name]:"variable",[TA.name]:"variable",[Yp.name]:"variable",[yp.name]:"variable",[pA.name]:"variable",[qp.name]:"variable",[Vp.name]:"variable",[a.name]:"property",[ke.name]:"enumMember",[Or.name]:"enumMember",[xt.name]:"enumMember",[Ue.name]:"enumMember",[U.name]:"punctuation",[Fp.name]:"regexp",[ma.name]:"operator",[m.name]:null,[uA.name]:null};for(let[t,o]of Object.entries(e))zm.set(t,o);for(let t of mn)if(!zm.has(t.name))for(let o of aI){let n=o(t.name);if(n){zm.set(t.name,n);break}}}r(iI,"buildTokenTypeMap");iI();var sI=new se(mn),cI=new se([...mm(mn,Ne),Km]);function EA(e,t=!1){return t?cI.tokenize(e):sI.tokenize(e)}r(EA,"lexDocument");var lI={addon:"addon",agent:"agent",agent_trigger:"agent_trigger",api_group:"api_group",branch:"branch",function:"cfn",mcp_server:"mcp_server",mcp_server_trigger:"mcp_server_trigger",middleware:"middleware",query:"api",realtime_trigger:"realtime_trigger",realtime_channel:"realtime_channel",run:"run",table:"db",table_trigger:"table_trigger",task:"task",tool:"tool",workflow_test:"workflow_test",workspace:"workspace",workspace_trigger:"workspace_trigger"},uI=/^(?:\s|\/\/[^\n]*\n)*(\w+)/;function Qp(e){let t=e.match(uI)?.[1];return lI[t]||"cfn"}r(Qp,"getSchemeFromContent");function hA(e){return()=>{let t=!1,o=!1,n=!1,i=!1;e.sectionStack.push("addonDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let s=e.CONSUME(go);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.CONSUME($),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.SUBRULE(e.inputClause)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.CONSUME(un),e.CONSUME1(S),e.OPTION(()=>{e.AT_LEAST_ONE1(()=>e.CONSUME3(m)),e.CONSUME(bo),e.CONSUME(U),e.SUBRULE(e.dbQueryFn)}),e.AT_LEAST_ONE2(()=>e.CONSUME4(m)),e.CONSUME1(A)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.tagsAttribute)},"ALT")}])}),o||e.addMissingError(s,"{} is missing an input clause"),n||e.addMissingError(s,"{} is missing a stack clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(hA,"addonDeclaration");var le=r(e=>e?e.tokenType===E?e.image.slice(1,-1):e.image:"","getVarName");function SA(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1;e.sectionStack.push("agentDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let f=e.CONSUME(Mi);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.MANY4(()=>e.CONSUME5($)),e.MANY5(()=>e.CONSUME6(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.commentBlockFn),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.SUBRULE(e.canonicalClause)},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.docsFieldAttribute)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0;let d=e.CONSUME(yi);e.CONSUME(h);let T={anthropic:["type","max_steps","model","temperature","headers"],"google-genai":["type","max_steps","model","temperature","headers","search_grounding","include_thoughts"],openai:["type","max_steps","model","temperature","reasoning_effort"],xano_free:["type","max_steps","temperature","search_grounding"]},g={anthropic:[...T.anthropic,"system_prompt","prompt","messages","api_key","reasoning","thinking_tokens","baseURL"],"google-genai":[...T["google-genai"],"system_prompt","prompt","messages","api_key","thinking_tokens","baseURL","safety_settings","dynamic_retrival","reasoning"],openai:[...T.openai,"system_prompt","prompt","messages","api_key","baseURL","headers","organization","project","compatibility"],"xano-free":[...T.xano_free,"system_prompt","prompt","messages","baseURL","headers","safety_settings","dynamic_retrival","thinking_tokens","include_thoughts"]},k={};e.SUBRULE(e.schemaParseObjectFn,{ARGS:[d,{type:["anthropic","google-genai","openai","xano-free"],max_steps:"[number]","prompt?":"[string]","messages?":"[string]","api_key?":"[string]","baseURL?":"[string]","compatibility?":["strict","compatible",""],"dynamic_retrival?":["enabled","disabled",""],"headers?":"[string]","include_thoughts?":"[boolean]","model?":"[string]","organization?":"[string]","project?":"[string]","reasoning_effort?":"[string]","reasoning?":"[boolean]","safety_settings?":"[string]","search_grounding?":"[boolean]","system_prompt?":"[string]","temperature?":"[number]","thinking_tokens?":"[number]"},k]}),e.ACTION(()=>{let C=le(k.type?.value),L=T[C]||[];for(let v of L)Object.prototype.hasOwnProperty.call(k,v)||e.addMissingError(d,`llm of type "${C}" requires a "${v}" field`);let _=g[C]||[],N=[];for(let v in k){let w=le(k[v].key);N.push(w),_.includes(w)||e.addIllegalAttributeError(k[v].key)}let O=N.includes("prompt"),x=N.includes("messages");O&&x?e.addIllegalAttributeError(k.messages.key,`llm of type "${C}" cannot have both "prompt" and "messages" fields`):!O&&!x&&e.addMissingError(d,`llm of type "${C}" requires either a "prompt" or "messages" field`)})},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.tagsAttribute)},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.outputClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0;let d=e.CONSUME(Fi);e.CONSUME2(h),e.SUBRULE(e.schemaParseArrayFn,{ARGS:[d,[{name:"[string]","active?":"[boolean]","auth?":"[string]"}]]})},"ALT")}])}),s||e.addMissingError(f,"{} is missing llm clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(SA,"agentDeclaration");function AA(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1,f=!1,d=!1;e.sectionStack.push("agentTriggerDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let T=e.CONSUME(vi);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.CONSUME($),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0;let g=e.CONSUME(_i);e.CONSUME(h),e.SUBRULE(e.schemaParseObjectFn,{ARGS:[g,{"connection?":"[boolean]"}]})},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.CONSUME(Ii),e.CONSUME2(h),e.SUBRULE(e.booleanValue)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.agentClause)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.docsFieldAttribute)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.SUBRULE(e.inputClause)},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.responseClause)},"ALT")},{GATE:r(()=>!f,"GATE"),ALT:r(()=>{f=!0,e.SUBRULE(e.stackClause)},"ALT")},{GATE:r(()=>!d,"GATE"),ALT:r(()=>{d=!0,e.SUBRULE(e.tagsAttribute)},"ALT")}])}),n||e.addMissingError(T,"{} is missing agent clause"),l||e.addMissingError(T,"{} is missing an input clause"),f||e.addMissingError(T,"{} is missing a stack clause"),p||e.addMissingError(T,"{} is missing a response clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(AA,"agentTriggerDeclaration");function gA(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1;e.sectionStack.push("apiGroupDeclaration"),e.SUBRULE(e.optionalCommentBlockFn),e.CONSUME(Lo),e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.CONSUME($),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.CONSUME(Ro),e.CONSUME1(h),e.SUBRULE(e.booleanValue)},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.CONSUME(Ji),e.CONSUME2(h),e.CONSUME2(E)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0;let f=e.CONSUME(Xi);e.CONSUME3(h),e.SUBRULE(e.schemaParseObjectFn,{ARGS:[f,{"mode?":"[string]","origins?":["[string]"],"methods?":["[string]"],"headers?":["[string]"],"credentials?":"[boolean]","max_age?":"[number]"}]})},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.docsFieldAttribute)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0;let f=e.CONSUME(Qi);e.CONSUME4(h),e.SUBRULE2(e.schemaParseObjectFn,{ARGS:[f,{"active?":"[boolean]","token?":"[string]"}]})},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.tagsAttribute)},"ALT")}])}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(gA,"apiGroupDeclaration");function UA(e){return()=>{e.sectionStack.push("columnDefaultValueAttribute"),e.CONSUME(h),e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(_e),"ALT")},{ALT:r(()=>e.CONSUME(X),"ALT")},{ALT:r(()=>e.CONSUME(Ue),"ALT")},{ALT:r(()=>e.CONSUME(ke),"ALT")},{ALT:r(()=>e.CONSUME(Or),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.sectionStack.pop()}}r(UA,"columnDefaultValueAttribute");function kA(e){return()=>{e.sectionStack.push("descriptionFieldAttribute"),e.CONSUME(Kp),e.CONSUME(h),e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(ze),"ALT")}]),e.sectionStack.pop()}}r(kA,"descriptionFieldAttribute");function RA(e){return()=>{e.sectionStack.push("disabledFieldAttribute"),e.CONSUME(Hp),e.CONSUME(h),e.OR([{ALT:r(()=>e.CONSUME(Ue),"ALT")},{ALT:r(()=>e.CONSUME(ke),"ALT")}]),e.sectionStack.pop()}}r(RA,"disabledFieldAttribute");function LA(e){return()=>{e.sectionStack.push("docsFieldAttribute"),e.CONSUME(Jp),e.CONSUME(h),e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(ze),"ALT")}]),e.sectionStack.pop()}}r(LA,"docsFieldAttribute");var xA=["deg2rad","rad2deg","number_format","sin","asin","asinh","cos","acos","acosh","tan","atan","atanh","floor","ceil","round","first","last","count","range","reverse","unique","safe_array","flatten","filter_empty","filter_empty_text","filter_null","filter_empty_array","filter_empty_object","filter_zero","filter_false","sort","shuffle","diff","diff_assoc","intersect","intersect_assoc","merge","merge_recursive","index_by","push","pop","unshift","shift","remove","append","prepend","abs","sqrt","exp","log","log10","ln","pow","array_min","min","array_max","max","sum","avg","product","equals","not_equals","greater_than","greater_than_or_equal","less_than","less_than_or_equal","odd","even","in","add","subtract","multiply","modulus","divide","bitwise_and","bitwise_or","bitwise_xor","not","bitwise_not","is_null","is_empty","is_object","is_array","is_int","is_decimal","is_bool","is_text","addslashes","escape","list_encodings","detect_encoding","to_utf8","from_utf8","convert_encoding","to_lower","to_upper","trim","ltrim","rtrim","capitalize","substr","split","join","slice","strlen","strip_html","unaccent","index","iindex","starts_with","istarts_with","ends_with","iends_with","contains","icontains","set","set_conditional","set_ifnotempty","set_ifnotnull","first_notnull","first_notempty","unset","transform","get","has","fill","fill_keys","keys","values","entries","to_expr","to_text","to_int","to_decimal","to_bool","to_timestamp","to_ms","to_seconds","to_minutes","to_hours","to_days","create_object","create_object_from_entries","json_decode","json_encode","xml_decode","csv_parse","csv_decode","csv_encode","csv_create","url_decode","url_decode_rfc3986","url_encode","url_encode_rfc3986","url_addarg","url_delarg","url_hasarg","url_getarg","url_parse","querystring_parse","yaml_decode","yaml_encode","hex2bin","bin2hex","dechex","hexdec","decbin","bindec","decoct","octdec","base_convert","base64_decode","base64_encode","base64_decode_urlsafe","base64_encode_urlsafe","encrypt","decrypt","jws_encode","jws_decode","jwe_encode","jwe_decode","concat","sprintf","replace","secureid_encode","secureid_decode","md5","sha1","sha256","sha384","sha512","hmac_md5","hmac_sha1","hmac_sha256","hmac_sha384","hmac_sha512","create_uid","uuid","parse_timestamp","format_timestamp","transform_timestamp","add_secs_to_timestamp","add_ms_to_timestamp","regex_matches","regex_get_first_match","regex_get_all_matches","regex_quote","regex_replace","map","filter","filter_null","filter_empty_text","filter_empty_object","filter_empty_array","some","every","find","findIndex","reduce","pick","unpick","text_unescape","text_escape","sql_esc","sql_alias","is_uuid"],Jm={text:["trim","min","max","startsWith","prevent","lower","upper","alphaOk","digitOk","ok","pattern"],decimal:["min","max"],int:["min","max"],email:["trim","lower"],password:["min","max","minAlpha","minLowerAlpha","minUpperAlpha","minDigit","minSymbol"],blob:[],blob_img:[],blob_video:[],blob_audio:[],enum:[],file:[],json:[],obj:[],epochms:[]},CA=["covers","l1_distance_manhattan","l2_distance_euclidean","inner_product","negative_inner_product","cosine_distance","cosine_similarity","distance","within","between","length","floor","ceil","round","to_lower","to_upper","concat","substr","coalesce","unaccent","add","sub","mul","div","search_rank","timestamp_month","timestamp_year","timestamp_week","timestamp_hour","timestamp_minute","timestamp_day_of_month","timestamp_day_of_week","timestamp_day_of_year","timestamp_epoch_day","timestamp_epoch_hour","timestamp_epoch_minute","timestamp_epoch_sec","timestamp_add_seconds","timestamp_subtract_seconds","timestamp_add_minutes","timestamp_subtract_minutes","timestamp_add_hours","timestamp_subtract_hours","timestamp_add_days","timestamp_subtract_days","timestamp_add_months","timestamp_subtract_months","timestamp_add_years","timestamp_subtract_years"];function OA(e){return t=>{e.sectionStack.push("inputFilterFn"),e.OR([{ALT:r(()=>{e.OPTION(()=>e.CONSUME(Ne));let o=e.CONSUME(a);e.MANY1(()=>{e.CONSUME1(be),e.OR2([{ALT:r(()=>e.CONSUME2(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")},{ALT:r(()=>e.CONSUME1(Fp),"ALT")},{ALT:r(()=>e.CONSUME1(X),"ALT")},{ALT:r(()=>e.CONSUME1(_e),"ALT")},{ALT:r(()=>e.CONSUME1(ke),"ALT")},{ALT:r(()=>e.CONSUME1(Ue),"ALT")}])}),t&&Jm[t.image]&&!Jm[t.image].includes(o.image)&&e.addInvalidValueError(o,`Filter '${o.image}' cannot be applied to input of type '${t.image}'`)},"ALT")},{ALT:r(()=>{e.CONSUME(Wp),e.CONSUME2(be),e.CONSUME(Xp)},"ALT")}]),e.sectionStack.pop()}}r(OA,"inputFilterFn");var NA=r(e=>()=>{e.sectionStack.push("sensitiveFieldAttribute"),e.CONSUME(Yp),e.CONSUME(h),e.OR([{ALT:r(()=>e.CONSUME(Ue),"ALT")},{ALT:r(()=>e.CONSUME(ke),"ALT")}]),e.sectionStack.pop()},"sensitiveFieldAttribute");function bA(e){return()=>{e.sectionStack.push("valueFieldAttribute");let t=e.CONSUME(qp);e.CONSUME(h),e.SUBRULE(e.expressionFn,{ARGS:[t,{allowIdentifier:!1}]}),e.sectionStack.pop()}}r(bA,"valueFieldAttribute");function MA(e){return()=>{e.sectionStack.push("valuesFieldAttribute"),e.CONSUME(Vp),e.CONSUME(h),e.SUBRULE(e.stringArray),e.sectionStack.pop()}}r(MA,"valuesFieldAttribute");var yA=r(e=>{e.columnDefaultValueAttribute=e.RULE("columnDefaultValueAttribute",UA(e)),e.descriptionFieldAttribute=e.RULE("descriptionFieldAttribute",kA(e)),e.disabledFieldAttribute=e.RULE("disabledFieldAttribute",RA(e)),e.docsFieldAttribute=e.RULE("docsFieldAttribute",LA(e)),e.inputFilterFn=e.RULE("inputFilterFn",OA(e)),e.sensitiveFieldAttribute=e.RULE("sensitiveFieldAttribute",NA(e)),e.valueFieldAttribute=e.RULE("valueFieldAttribute",bA(e)),e.valuesFieldAttribute=e.RULE("valuesFieldAttribute",MA(e))},"register");function FA(e){return()=>{e.sectionStack.push("branchDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let t=e.CONSUME(Es);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]);let o={pre:[{name:"[string]"}],post:[{name:"[string]"}]};e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{color:"[string]","description?":"[string]",middleware:{function:o,query:o,task:o,tool:o},history:{function:[!1,10,100,1e3,1e4,"all"],query:[!1,10,100,1e3,1e4,"all"],task:[!1,10,100,1e3,1e4,"all"],tool:[!1,10,100,1e3,1e4,"all"],trigger:[!1,10,100,1e3,1e4,"all"],middleware:[!1,10,100,1e3,1e4,"all"]}}]}),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(FA,"branchDeclaration");var _A=r(e=>()=>{e.sectionStack.push("agentClause");let t=e.CONSUME(nc);e.CONSUME(h),e.CONSUME(E).image==='""'&&e.addMissingError(t,"agent cannot be empty"),e.sectionStack.pop()},"agentClause");var IA=r(e=>()=>{e.sectionStack.push("authClause"),e.CONSUME(pn),e.CONSUME(h),e.OR([{ALT:r(()=>e.CONSUME(Ue),"ALT")},{ALT:r(()=>e.CONSUME(ke),"ALT")}]),e.sectionStack.pop()},"authClause");function vA(e){return()=>{e.sectionStack.push("cacheClause");let t=e.CONSUME(Pp);e.CONSUME(h),e.SUBRULE(e.schemaParseObjectFn,{ARGS:[t,{ttl:"[number]",input:"[boolean]",auth:"[boolean]",datasource:"[boolean]",ip:"[boolean]","headers?":["[string]"],"env?":["[string]"]}]}),e.sectionStack.pop()}}r(vA,"cacheClause");var wA=r(e=>()=>{e.sectionStack.push("canonicalClause");let t=e.CONSUME(sc);e.CONSUME(h),e.CONSUME(E).image==='""'&&e.addMissingError(t,"canonical cannot be empty"),e.sectionStack.pop()},"canonicalClause");var BA=r(e=>()=>{e.sectionStack.push("channelClause");let t=e.CONSUME(ic);e.CONSUME(h),e.CONSUME(E).image==='""'&&e.addMissingError(t,"channel cannot be empty"),e.sectionStack.pop()},"channelClause");var PA=r(e=>()=>{e.sectionStack.push("dbTableClause");let t=e.CONSUME(lr);e.CONSUME(h),e.CONSUME(E).image==='""'&&e.addMissingError(t,"table cannot be empty"),e.sectionStack.pop()},"dbTableClause");function GA(e){return t=>{let o=t?.[0]||a,n=t?.[1]??!0;e.sectionStack.push(o.name+"Clause"),e.CONSUME(o),e.CONSUME(h);let i=e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(ze),"ALT")}]);n||i.image==='""'&&e.addMissingError(i,"value cannot be empty"),e.sectionStack.pop()}}r(GA,"flexibleStringClause");function DA(e){return()=>{e.sectionStack.push("historyClause");let t=e.CONSUME(Bp);e.CONSUME(h),e.SUBRULE(e.schemaParseEnumFn,{ARGS:[t,[!1,"inherit",0,10,100,1e3,1e4,"all"]]}),e.sectionStack.pop()}}r(DA,"historyClause");function VA(e){return()=>{e.sectionStack.push("indexClause");let t=e.CONSUME(Dp);e.CONSUME(h),e.SUBRULE(e.schemaFn,{ARGS:[t,[{type:["primary","btree","gin","btree|unique","search","vector"],field:[{name:"[string]","op?":"[string]"}],"lang?":"[string]","name?":"[string]"}]]}),e.sectionStack.pop()}}r(VA,"indexClause");function qA(e){return()=>{e.sectionStack.push("inputClause"),e.CONSUME(ln),e.OPTION(()=>{e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE1(()=>e.CONSUME1(m)),e.SUBRULE(e.optionalCommentBlockFn),e.OR([{ALT:r(()=>e.SUBRULE(e.objectColumnDefinition),"ALT")},{ALT:r(()=>e.SUBRULE(e.enumColumnDefinition),"ALT")},{ALT:r(()=>e.SUBRULE(e.columnDefinition,{ARGS:[{include_file:!0}]}),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbLinkColumnDefinition),"ALT")}])}),e.AT_LEAST_ONE2(()=>e.CONSUME2(m)),e.CONSUME(A)}),e.sectionStack.pop()}}r(qA,"inputClause");var jA=r(e=>()=>{e.sectionStack.push("mcpServerClause");let t=e.CONSUME(ac);e.CONSUME(h),e.CONSUME(E).image==='""'&&e.addMissingError(t,"mcp_server cannot be empty"),e.sectionStack.pop()},"mcpServerClause");function WA(e){return()=>{e.sectionStack.push("middlewareClause");let t=e.CONSUME(wp);e.CONSUME(h),e.SUBRULE(e.schemaParseObjectFn,{ARGS:[t,{"pre?":[{name:"[string]","active?":"[boolean]","required?":"[boolean]"}],"post?":[{name:"[string]","active?":"[boolean]","required?":"[boolean]"}]}]}),e.sectionStack.pop()}}r(WA,"middlewareClause");var Xm={allowExpectStatements:!1,allowCallStatements:!1};function YA(e){return(t={})=>{t={...Xm,...t},e.sectionStack.push("nakedStackFn"),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE1(()=>e.CONSUME1(m)),e.OPTION(()=>e.CONSUME(Ne)),e.OR([{ALT:r(()=>e.CONSUME($),"ALT")},{ALT:r(()=>e.SUBRULE(e.aiFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.varFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.mathFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.textFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.preconditionFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.zipFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.objectFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.apiFn,{ARGS:[t]}),"ALT")},{ALT:r(()=>e.SUBRULE(e.webflowFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.controlFn,{ARGS:[t]}),"ALT")},{ALT:r(()=>e.SUBRULE(e.debugFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.storageFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.streamFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.actionCallFn),"ALT")},{GATE:r(()=>t.allowCallStatements,"GATE"),ALT:r(()=>e.SUBRULE(e.toolCallFn),"ALT")},{GATE:r(()=>t.allowCallStatements,"GATE"),ALT:r(()=>e.SUBRULE(e.addonCallFn),"ALT")},{GATE:r(()=>t.allowCallStatements,"GATE"),ALT:r(()=>e.SUBRULE(e.middlewareCallFn),"ALT")},{GATE:r(()=>t.allowExpectStatements,"GATE"),ALT:r(()=>e.SUBRULE(e.workflowExpectFn),"ALT")}])}),e.AT_LEAST_ONE2(()=>e.CONSUME2(m)),e.CONSUME(A),e.sectionStack.pop()}}r(YA,"nakedStackFn");function KA(e){return()=>{e.sectionStack.push("outputClause"),e.CONSUME(wl),e.OPTION(()=>{e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE1(()=>e.CONSUME1(m)),e.OR([{ALT:r(()=>e.SUBRULE(e.objectColumnDefinition),"ALT")},{ALT:r(()=>e.SUBRULE(e.enumColumnDefinition),"ALT")},{ALT:r(()=>e.SUBRULE(e.columnDefinition,{ARGS:[{include_file:!1}]}),"ALT")}])}),e.AT_LEAST_ONE2(()=>e.CONSUME2(m)),e.CONSUME(A)}),e.sectionStack.pop()}}r(KA,"outputClause");function HA(e){return()=>{e.sectionStack.push("responseClause");let t=e.CONSUME(Ip);e.CONSUME(h),e.SUBRULE(e.expressionFn,{ARGS:[t,{allowDisabledKeys:!0}]}),e.sectionStack.pop()}}r(HA,"responseClause");function zA(e){return()=>{e.sectionStack.push("scheduleClause");let t=e.CONSUME(ju);e.CONSUME(h),e.SUBRULE(e.schemaFn,{ARGS:[t,[{starts_on:"[timestamp]","ends_on?":"[timestamp]","freq?":"[number]"}]]}),e.sectionStack.pop()}}r(zA,"scheduleClause");var pI={include_file:!0,isTableSchema:!1};function JA(e){return(t={},o={})=>{t={...pI,...t},e.sectionStack.push("schemaClause");let n=e.CONSUME(Gp);if(e.OPTION(()=>{e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE1(()=>e.CONSUME1(m)),e.OR([{ALT:r(()=>e.CONSUME($),"ALT")},{ALT:r(()=>e.SUBRULE(e.objectColumnDefinition,{ARGS:[o]}),"ALT")},{ALT:r(()=>e.SUBRULE(e.enumColumnDefinition,{ARGS:[o]}),"ALT")},{ALT:r(()=>e.SUBRULE(e.columnDefinition,{ARGS:[{include_file:t.include_file,isTableSchema:t.isTableSchema},o]}),"ALT")}])}),e.MANY1(()=>e.CONSUME2(m)),e.CONSUME(A)}),t.isTableSchema){let i=o.id;i?["int","uuid"].includes(i.typeToken.image)||e.addInvalidValueError(i.typeToken,'The "id" column can only be of type "int" or "uuid"'):e.addMissingError(n,"{} must have an 'id' of type uuid or int column defined")}e.sectionStack.pop()}}r(JA,"schemaClause");function XA(e){return(t={})=>{t={...Xm,...t},e.sectionStack.push("stackClause"),e.CONSUME(un),e.OPTION(()=>e.SUBRULE(e.nakedStackFn,{ARGS:[t]})),e.sectionStack.pop()}}r(XA,"stackClause");function QA(e){return t=>{let o=!1,n=!1;t=t||[],e.sectionStack.push("testClause"),e.CONSUME(_p);let i=e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]);if(i&&i.image){let s=i.image.replaceAll('"',"");t.includes(s)&&e.addDuplicateNameError(i,"test"),t.push(i.image.replaceAll('"',""))}e.CONSUME(S),e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.MANY(()=>{e.OR1([{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.CONSUME(ln),e.CONSUME(h),e.SUBRULE(e.objectWithAttributes)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.CONSUME(cn),e.CONSUME1(h),e.CONSUME1(E)},"ALT")},{ALT:r(()=>e.SUBRULE(e.unitExpectFn),"ALT")}]),e.AT_LEAST_ONE1(()=>e.CONSUME1(m))}),e.CONSUME(A),e.sectionStack.pop()}}r(QA,"testClause");function ZA(e){return()=>{e.sectionStack.push("viewClause");let t=e.CONSUME(vp);e.CONSUME(h);let o={};e.SUBRULE(e.schemaParseObjectFn,{ARGS:[t,{"[string]":{"search?":"[query]","hide?":["[string]"],sort:{"[string]":["asc","desc","rand"]},id:"[string]","alias?":"[string]"}},o]});for(let n in o)!o[n].search&&!o[n].hide&&e.addMissingError(t,`view ${n} must have either a search or hide criteria`);e.sectionStack.pop()}}r(ZA,"viewClause");var $A=r(e=>{e.agentClause=e.RULE("agentClause",_A(e)),e.authClause=e.RULE("authClause",IA(e)),e.cacheClause=e.RULE("cacheClause",vA(e)),e.canonicalClause=e.RULE("canonicalClause",wA(e)),e.channelClause=e.RULE("channelClause",BA(e)),e.dbTableClause=e.RULE("dbTableClause",PA(e)),e.flexibleStringClause=e.RULE("flexibleStringClause",GA(e)),e.historyClause=e.RULE("historyClause",DA(e)),e.indexClause=e.RULE("indexClause",VA(e)),e.inputClause=e.RULE("inputClause",qA(e)),e.outputClause=e.RULE("outputClause",KA(e)),e.mcpServerClause=e.RULE("mcpServerClause",jA(e)),e.middlewareClause=e.RULE("middlewareClause",WA(e)),e.nakedStackFn=e.RULE("nakedStackFn",YA(e)),e.responseClause=e.RULE("responseClause",HA(e)),e.scheduleClause=e.RULE("scheduleClause",zA(e)),e.schemaClause=e.RULE("schemaClause",JA(e)),e.stackClause=e.RULE("stackClause",XA(e)),e.testClause=e.RULE("testClause",QA(e)),e.viewClause=e.RULE("viewClause",ZA(e))},"register");function eg(e){return()=>{e.sectionStack.push("arraySlice");let t=null,o=null;if(e.OR([{ALT:r(()=>{e.CONSUME(re),e.CONSUME(oe)},"ALT")},{ALT:r(()=>{e.CONSUME1(re),t=e.CONSUME1(X),e.CONSUME1(be),e.OPTION(()=>o=e.CONSUME3(X)),e.CONSUME1(oe)},"ALT")},{ALT:r(()=>{e.CONSUME2(re),e.CONSUME2(be),o=e.CONSUME2(X),e.CONSUME2(oe)},"ALT")}]),t&&t.image.startsWith("-")&&e.addInvalidValueError(t,"Array slice start index cannot be negative"),o&&o.image.startsWith("-")&&e.addInvalidValueError(o,"Array slice end index cannot be negative"),t&&o){let n=parseInt(t.image,10);parseInt(o.image,10)<n&&e.addInvalidValueError(o,"Array slice end index cannot be less than start index")}e.sectionStack.pop()}}r(eg,"arraySlice");var mI={include_file:!1,isTableSchema:!1};function tg(e){return(t={},o={})=>{t={...mI,...t};let n=!1,i=!1,s=!1;e.sectionStack.push("columnDefinition");let c=e.OR([{ALT:r(()=>e.CONSUME(Is),"ALT")},{ALT:r(()=>e.CONSUME(vs),"ALT")},{ALT:r(()=>e.CONSUME(Co),"ALT")},{ALT:r(()=>e.CONSUME(ws),"ALT")},{ALT:r(()=>e.CONSUME(Bs),"ALT")},{ALT:r(()=>e.CONSUME(Gs),"ALT")},{ALT:r(()=>e.CONSUME(Ds),"ALT")},{ALT:r(()=>e.CONSUME(Vs),"ALT")},{ALT:r(()=>e.CONSUME(qs),"ALT")},{ALT:r(()=>e.CONSUME(js),"ALT")},{ALT:r(()=>e.CONSUME(Ws),"ALT")},{ALT:r(()=>e.CONSUME(Hs),"ALT")},{ALT:r(()=>e.CONSUME(zs),"ALT")},{ALT:r(()=>e.CONSUME(Js),"ALT")},{ALT:r(()=>e.CONSUME(Xs),"ALT")},{ALT:r(()=>e.CONSUME(Qs),"ALT")},{ALT:r(()=>e.CONSUME(Zs),"ALT")},{ALT:r(()=>e.CONSUME($s),"ALT")},{ALT:r(()=>e.CONSUME(ec),"ALT")},{ALT:r(()=>e.CONSUME(tc),"ALT")},{ALT:r(()=>e.CONSUME(rc),"ALT")},{GATE:r(()=>!!t.include_file,"GATE"),ALT:r(()=>e.CONSUME(Ys),"ALT")}]);e.OPTION1(()=>{i=!0,e.SUBRULE(e.arraySlice)}),e.OPTION2(()=>{n=!0,e.CONSUME(et)});let l=e.CONSUME(a);e.OPTION6(()=>{s=!0,e.CONSUME1(et)}),e.OPTION3(()=>e.SUBRULE(e.columnDefaultValueAttribute)),e.OPTION4(()=>e.SUBRULE(e.filterDefinition,{ARGS:[c]}));let p={};e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[l,{"description?":"[string]","table?":"[string]","size?":"[number]","sensitive?":"[boolean]"},p]}),c.image=="vector"&&!p.size&&e.addWarning('Column named "vector" should have a size attribute defining its length.',l),o[le(l)]={typeToken:c,nameToken:l},e.addInput(l.image,c.image,i,n,s),e.sectionStack.pop()}}r(tg,"columnDefinition");function rg(e){return()=>{e.sectionStack.push("dbLinkColumnDefinition");let t=e.CONSUME(oc);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{table:"[string]","override?":{"[string]":{hidden:"[boolean]"}}}]}),e.sectionStack.pop()}}r(rg,"dbLinkColumnDefinition");function og(e){return(t={})=>{e.sectionStack.push("enumColumnDefinition");let o=e.CONSUME(Ps),n=!1,i=!1,s=!1;e.OPTION1(()=>{n=!0,e.SUBRULE(e.arraySlice)}),e.OPTION2(()=>{i=!0,e.CONSUME(et)});let c=e.CONSUME(a);t[le(c)]={typeToken:o,nameToken:c},e.OPTION(()=>{s=!0,e.CONSUME1(et)}),e.OPTION3(()=>e.SUBRULE(e.columnDefaultValueAttribute)),e.SUBRULE(e.enumColumnMetadataDefinition,{ARGS:[o]}),e.addInput(c.image,"enum",n,i,s),e.sectionStack.pop()}}r(og,"enumColumnDefinition");function ng(e){return(t=null)=>{e.sectionStack.push("filterDefinition"),e.CONSUME(jp),e.CONSUME(h),e.AT_LEAST_ONE_SEP({SEP:Me,DEF:r(()=>e.SUBRULE(e.inputFilterFn,{ARGS:[t]}),"DEF")}),e.sectionStack.pop()}}r(ng,"filterDefinition");function ag(e){return(t={})=>{e.sectionStack.push("objectColumnDefinition");let o=e.CONSUME(Ks),n=!1,i=!1,s=!1;e.OPTION2(()=>{n=!0,e.SUBRULE(e.arraySlice)});let c=e.CONSUME(a);t[le(c)]={typeToken:o,nameToken:c},e.OPTION(()=>{s=!0,e.CONSUME(et)}),e.SUBRULE(e.objectColumnMetadataDefinition),e.addInput(c.image,"enum",n,i,s),e.sectionStack.pop()}}r(ag,"objectColumnDefinition");var ig=r(e=>{e.arraySlice=e.RULE("arraySlice",eg(e)),e.columnDefinition=e.RULE("columnDefinition",tg(e)),e.dbLinkColumnDefinition=e.RULE("dbLinkColumnDefinition",rg(e)),e.enumColumnDefinition=e.RULE("enumColumnDefinition",og(e)),e.filterDefinition=e.RULE("filterDefinition",ng(e)),e.objectColumnDefinition=e.RULE("objectColumnDefinition",ag(e))},"register");function sg(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1,f=!1,d=[];e.sectionStack.push("functionDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let T=e.CONSUME(sr);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME(E),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.CONSUME($),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.SUBRULE(e.cacheClause)},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.docsFieldAttribute)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.inputClause)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.middlewareClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.SUBRULE(e.responseClause)},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.stackClause)},"ALT")},{GATE:r(()=>!f,"GATE"),ALT:r(()=>{f=!0,e.SUBRULE(e.tagsAttribute)},"ALT")},{ALT:r(()=>{e.SUBRULE(e.testClause,{ARGS:[d]})},"ALT")}])}),s||e.addMissingError(T,"{} is missing an input clause"),p||e.addMissingError(T,"{} is missing a stack clause"),l||e.addMissingError(T,"{} is missing a response clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(sg,"functionDeclaration");function cg(e){return()=>{e.sectionStack.push("actionCallFn"),e.CONSUME(Ni),e.CONSUME(U);let t=e.CONSUME(ir);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}]),e.OPTION(()=>{e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"package?":"[string]","input?":{"[string]":"[expression]"},"mock?":{"![string]":"[expression]"},"registry?":{"[string]":"[expression]"},"description?":"[string]","disabled?":"[boolean]"}]})}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(cg,"actionCallFn");function lg(e){return()=>{e.sectionStack.push("addonCallFn"),e.CONSUME(go),e.CONSUME(U);let t=e.CONSUME(bi);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}]),e.OPTION(()=>{e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"input?":{"[string]":"[expression]"},"mock?":{"![string]":"[expression]"},"description?":"[string]","disabled?":"[boolean]"}]})}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(lg,"addonCallFn");function ug(e){return()=>{e.sectionStack.push("aiAgentRunFn");let t=e.CONSUME(Uo);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME(E),"ALT")}],ERR_MSG:"Expected an agent name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"args?":"[expression]","runtime_mode?":["async-shared","async-dedicated"],"allow_tool_execution?":"[expression]","description?":"[string]","disabled?":"[boolean]","version?":"[string]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(ug,"aiAgentRunFn");function pg(e){return()=>{e.sectionStack.push("aiExternalMcpServerDetailsFn");let t=e.CONSUME(qi);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{url:"[expression]",bearer_token:"[expression]",connection_type:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(pg,"aiExternalMcpServerDetailsFn");function mg(e){return()=>{e.sectionStack.push("aiExternalMcpToolListFn");let t=e.CONSUME(Vi);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{url:"[expression]",bearer_token:"[expression]",connection_type:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(mg,"aiExternalMcpToolListFn");function fg(e){return()=>{e.sectionStack.push("aiExternalMcpToolRunFn");let t=e.CONSUME(Uo);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{url:"[expression]",bearer_token:"[expression]",connection_type:"[expression]",tool:"[expression]",args:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(fg,"aiExternalMcpToolRunFn");var dg=r(e=>{e.aiAgentRunFn=e.RULE("aiAgentRunFn",ug(e)),e.aiExternalMcpToolListFn=e.RULE("aiExternalMcpToolListFn",mg(e)),e.aiExternalMcpToolRunFn=e.RULE("aiExternalMcpToolRunFn",fg(e)),e.aiExternalMcpServerDetailsFn=e.RULE("aiExternalMcpServerDetailsFn",pg(e))},"register");function Tg(e){return()=>{e.sectionStack.push("ai"),e.CONSUME(wi),e.CONSUME(U),e.OR([{ALT:r(()=>{e.CONSUME(Bi),e.CONSUME1(U),e.SUBRULE(e.aiAgentRunFn)},"ALT")},{ALT:r(()=>{e.CONSUME(Pi),e.CONSUME2(U),e.CONSUME(Gi),e.CONSUME3(U),e.OR1([{ALT:r(()=>e.SUBRULE(e.aiExternalMcpServerDetailsFn),"ALT")},{ALT:r(()=>{e.CONSUME(Di),e.CONSUME4(U),e.OR2([{ALT:r(()=>e.SUBRULE(e.aiExternalMcpToolListFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.aiExternalMcpToolRunFn),"ALT")}])},"ALT")}])},"ALT")}]),e.sectionStack.pop()}}r(Tg,"aiFn");function Eg(e){return()=>{e.sectionStack.push("apiCallFn");let t=e.CONSUME(Yi);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(en),e.CONSUME(h),e.OR1([{ALT:r(()=>e.CONSUME(an),"ALT")},{ALT:r(()=>e.CONSUME(tn),"ALT")},{ALT:r(()=>e.CONSUME(rn),"ALT")},{ALT:r(()=>e.CONSUME(on),"ALT")},{ALT:r(()=>e.CONSUME(nn),"ALT")}]),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{api_group:"[string]","description?":"[string]","disabled?":"[boolean]","headers?":"[expression]","input?":{"[string]":"[expression]"}}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Eg,"apiCallFn");function hg(e){let t=["code","timeout"],o=["description","disabled"];return()=>{e.sectionStack.push("apiLambdaFn");let n=e.CONSUME(zi);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(hg,"apiLambdaFn");function Sg(e){let t=["channel","data","auth_table","auth_id"],o=["description","disabled"];return()=>{e.sectionStack.push("apiRealtimeEventFn");let n=e.CONSUME(Ki);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(Sg,"apiRealtimeEventFn");function Ag(e){return()=>{e.sectionStack.push("apiRequestFn");let t=e.CONSUME(ko);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{url:"[expression]",method:"[expression]","description?":"[string]","disabled?":"[boolean]","params?":"[expression]","headers?":"[expression]","timeout?":"[number]","follow_location?":"[expression]","ca_certificate?":"[string]","certificate?":"[string]","certificate_pass?":"[string]","private_key?":"[string]","verify_host?":"[boolean]","verify_peer?":"[boolean]","mock?":{"![string]":"[expression]"}}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Ag,"apiRequestFn");function gg(e){let t=["value"],o=["description","disabled"];return()=>{e.sectionStack.push("apiStreamFn");let n=e.CONSUME(Hi);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(gg,"apiStreamFn");function Ug(e){return()=>{e.sectionStack.push("webflowRequestFn");let t=e.CONSUME(ko);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{path:"[expression]",method:"[expression]","description?":"[string]","disabled?":"[boolean]","params?":"[expression]","headers?":"[expression]","timeout?":"[number]","follow_location?":"[expression]","ca_certificate?":"[string]","certificate?":"[string]","certificate_pass?":"[string]","private_key?":"[string]","verify_host?":"[boolean]","verify_peer?":"[boolean]","mock?":{"![string]":"[expression]"}}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Ug,"webflowRequestFn");var kg=r(e=>{e.apiLambdaFn=e.RULE("apiLambdaFn",hg(e)),e.apiRealtimeEventFn=e.RULE("apiRealtimeEventFn",Sg(e)),e.apiRequestFn=e.RULE("apiRequestFn",Ag(e)),e.apiStreamFn=e.RULE("apiStreamFn",gg(e)),e.apiCallFn=e.RULE("apiCallFn",Eg(e)),e.webflowRequestFn=e.RULE("webflowRequestFn",Ug(e))},"register");function Rg(e){return(t={})=>{e.sectionStack.push("api"),e.CONSUME(ji),e.CONSUME(U),e.OR([{GATE:r(()=>t.allowCallStatements,"GATE"),ALT:r(()=>e.SUBRULE(e.apiCallFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.apiLambdaFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.apiRequestFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.apiRealtimeEventFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.apiStreamFn),"ALT")}]),e.sectionStack.pop()}}r(Rg,"apiFn");function Lg(e){return()=>{e.sectionStack.push("arrayDifferenceFn");let t=e.CONSUME(fs);e.CONSUME(B),e.SUBRULE(e.expressionFn),e.OPTION(()=>e.CONSUME(m)),e.CONSUME(P),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{value:"[expression]",by:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Lg,"arrayDifferenceFn");function xg(e){return()=>{e.sectionStack.push("arrayEveryFn");let t=e.CONSUME($i);e.SUBRULE(e.arrayValueIfAs,{ARGS:[t]}),e.sectionStack.pop()}}r(xg,"arrayEveryFn");function Cg(e){return()=>{e.sectionStack.push("arrayFilterCountFn");let t=e.CONSUME(es);e.SUBRULE(e.arrayValueIfAs,{ARGS:[t]}),e.sectionStack.pop()}}r(Cg,"arrayFilterCountFn");function Og(e){return()=>{e.sectionStack.push("arrayFilterFn");let t=e.CONSUME(ts);e.SUBRULE(e.arrayValueIfAs,{ARGS:[t]}),e.sectionStack.pop()}}r(Og,"arrayFilterFn");function Ng(e){return()=>{e.sectionStack.push("arrayFindFn");let t=e.CONSUME(rs);e.SUBRULE(e.arrayValueIfAs,{ARGS:[t]}),e.sectionStack.pop()}}r(Ng,"arrayFindFn");function bg(e){return()=>{e.sectionStack.push("arrayFindIndexFn");let t=e.CONSUME(os);e.SUBRULE(e.arrayValueIfAs,{ARGS:[t]}),e.sectionStack.pop()}}r(bg,"arrayFindIndexFn");function Mg(e){return()=>{e.sectionStack.push("arrayGroupByFn");let t=e.CONSUME(ms);e.CONSUME(B),e.SUBRULE(e.expressionFn),e.OPTION(()=>e.CONSUME(m)),e.CONSUME(P),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{by:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Mg,"arrayGroupByFn");function yg(e){return()=>{e.sectionStack.push("arrayHasFn");let t=e.CONSUME(ns);e.SUBRULE(e.arrayValueIfAs,{ARGS:[t]}),e.sectionStack.pop()}}r(yg,"arrayHasFn");function Fg(e){return()=>{e.sectionStack.push("arrayIntersectionFn");let t=e.CONSUME(ds);e.CONSUME(B),e.SUBRULE(e.expressionFn),e.OPTION(()=>e.CONSUME(m)),e.CONSUME(P),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{value:"[expression]",by:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Fg,"arrayIntersectionFn");function _g(e){return()=>{e.sectionStack.push("arrayMapFn");let t=e.CONSUME(us);e.CONSUME(B),e.SUBRULE(e.expressionFn),e.OPTION(()=>e.CONSUME(m)),e.CONSUME(P),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{by:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(_g,"arrayMapFn");function Ig(e){return()=>{e.sectionStack.push("arrayMergeFn"),e.CONSUME(as),e.SUBRULE(e.variableOnly),e.SUBRULE(e.arrayValueOnly),e.sectionStack.pop()}}r(Ig,"arrayMergeFn");function vg(e){return()=>{e.sectionStack.push("arrayNoValueAs"),e.OPTION(()=>{e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")}])}),e.OPTION1(()=>e.CONSUME1(m)),e.CONSUME(A)}),e.CONSUME(at),e.SUBRULE(e.variableOnly),e.sectionStack.pop()}}r(vg,"arrayNoValueAs");function wg(e){return()=>{e.sectionStack.push("arrayPartitionFn");let t=e.CONSUME(ps);e.SUBRULE(e.arrayValueIfAs,{ARGS:[t]}),e.sectionStack.pop()}}r(wg,"arrayPartitionFn");function Bg(e){return()=>{e.sectionStack.push("arrayPopFn"),e.CONSUME(is),e.SUBRULE(e.variableOnly),e.SUBRULE(e.arrayNoValueAs),e.sectionStack.pop()}}r(Bg,"arrayPopFn");function Pg(e){return()=>{e.sectionStack.push("arrayPushFn"),e.CONSUME(ss),e.SUBRULE(e.variableOnly),e.SUBRULE(e.arrayValueOnly),e.sectionStack.pop()}}r(Pg,"arrayPushFn");function Gg(e){return()=>{e.sectionStack.push("arrayShiftFn"),e.CONSUME(cs),e.SUBRULE(e.variableOnly),e.SUBRULE(e.arrayNoValueAs),e.sectionStack.pop()}}r(Gg,"arrayShiftFn");function Dg(e){return()=>{e.sectionStack.push("arrayUnionFn");let t=e.CONSUME(Ts);e.CONSUME(B),e.SUBRULE(e.expressionFn),e.OPTION(()=>e.CONSUME(m)),e.CONSUME(P),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{value:"[expression]",by:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Dg,"arrayUnionFn");function Vg(e){return()=>{e.sectionStack.push("arrayUnshiftFn"),e.CONSUME(ls),e.SUBRULE(e.variableOnly),e.SUBRULE(e.arrayValueOnly),e.sectionStack.pop()}}r(Vg,"arrayUnshiftFn");function qg(e){return(t,o={})=>{e.sectionStack.push("arrayValueIfAs");let n=!1;e.CONSUME(B),e.MANY(()=>e.CONSUME(m)),e.SUBRULE(e.expressionFn),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(P),e.OPTION(()=>{n=!0,e.CONSUME(Oo),e.CONSUME1(B),e.SUBRULE1(e.expressionFn),e.CONSUME1(P)}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"description?":"[string]","disabled?":"[boolean]",...o}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),n||e.addWarning("`if (...)` conditional statement is missing",t),e.sectionStack.pop()}}r(qg,"arrayValueIfAs");function jg(e){return()=>{e.sectionStack.push("arrayValueOnly");let t=!1;e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>{t=!0,e.SUBRULE(e.valueFieldAttribute)},"ALT")},{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")}])}),t||e.SUBRULE(e.valueFieldAttribute),e.OPTION1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(jg,"arrayValueOnly");function Wg(e){return t=>{e.sectionStack.push("valueAttrOnly");let o=!1,n=!1,i=!1;e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>{o=!0,e.SUBRULE(e.valueFieldAttribute)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")}])}),o||e.addMissingError(t,"{} is missing a stack clause"),e.OPTION1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(Wg,"valueAttrOnly");var Yg=r(e=>{e.arrayEveryFn=e.RULE("arrayEveryFn",xg(e)),e.arrayFilterCountFn=e.RULE("arrayFilterCountFn",Cg(e)),e.arrayFilterFn=e.RULE("arrayFilterFn",Og(e)),e.arrayFindFn=e.RULE("arrayFindFn",Ng(e)),e.arrayFindIndexFn=e.RULE("arrayFindIndexFn",bg(e)),e.arrayHasFn=e.RULE("arrayHasFn",yg(e)),e.arrayMergeFn=e.RULE("arrayMergeFn",Ig(e)),e.arrayNoValueAs=e.RULE("arrayNoValueAs",vg(e)),e.arrayPopFn=e.RULE("arrayPopFn",Bg(e)),e.arrayPushFn=e.RULE("arrayPushFn",Pg(e)),e.arrayShiftFn=e.RULE("arrayShiftFn",Gg(e)),e.arrayUnshiftFn=e.RULE("arrayUnshiftFn",Vg(e)),e.arrayValueIfAs=e.RULE("arrayValueIfAs",qg(e)),e.arrayValueOnly=e.RULE("arrayValueOnly",jg(e)),e.valueAttrOnly=e.RULE("valueAttrOnly",Wg(e)),e.arrayMapFn=e.RULE("arrayMapFn",_g(e)),e.arrayPartitionFn=e.RULE("arrayPartitionFn",wg(e)),e.arrayGroupByFn=e.RULE("arrayGroupByFn",Mg(e)),e.arrayUnionFn=e.RULE("arrayUnionFn",Dg(e)),e.arrayDifferenceFn=e.RULE("arrayDifferenceFn",Lg(e)),e.arrayIntersectionFn=e.RULE("arrayIntersectionFn",Fg(e))},"register");function Kg(e){return()=>{e.sectionStack.push("array"),e.CONSUME(Zi),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.arrayEveryFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayFilterCountFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayFilterFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayFindFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayFindIndexFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayHasFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayShiftFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayPopFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayUnshiftFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayPushFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayMergeFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayMapFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayPartitionFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayGroupByFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayUnionFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayDifferenceFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.arrayIntersectionFn),"ALT")}]),e.sectionStack.pop()}}r(Kg,"arrayFn");function Hg(e){return()=>{e.sectionStack.push("cloudAlgoliaFn"),e.CONSUME(Ss),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.cloudAlgoliaRequestFn),"ALT")}]),e.sectionStack.pop()}}r(Hg,"cloudAlgoliaFn");function zg(e){return()=>{e.sectionStack.push("cloudAlgoliaRequestFn");let t=e.CONSUME(xo);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"description?":"[string]","application_id?":"[expression]","api_key?":"[expression]",url:"[expression]","method?":["POST","GET"],payload:"[expression]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(zg,"cloudAlgoliaRequestFn");function Jg(e){return()=>{e.sectionStack.push("cloudAwsFn"),e.CONSUME(gs),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.cloudAwsS3Fn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudAwsOpenSearchFn),"ALT")}]),e.sectionStack.pop()}}r(Jg,"cloudAwsFn");function Xg(e){return()=>{e.sectionStack.push("cloudAwsOpenSearchFn"),e.CONSUME(ys),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.cloudSearchDocumentFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudSearchQueryFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudSearchRequestFn),"ALT")}]),e.sectionStack.pop()}}r(Xg,"cloudAwsOpenSearchFn");function Qg(e){return()=>{e.sectionStack.push("cloudAwsS3Fn"),e.CONSUME(Ns),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.cloudListDirectoryFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudSignUrlFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudUploadFileFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudDeleteFileFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudReadFileFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudGetFileInfoFn),"ALT")}]),e.sectionStack.pop()}}r(Qg,"cloudAwsS3Fn");function Zg(e){return()=>{e.sectionStack.push("cloudAzureFn"),e.CONSUME(ks),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.cloudStorageFn),"ALT")}]),e.sectionStack.pop()}}r(Zg,"cloudAzureFn");function $g(e){return()=>{e.sectionStack.push("cloudDeleteFileFn"),e.CONSUME(xs),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r($g,"cloudDeleteFileFn");function eU(e){return()=>{e.sectionStack.push("cloudElasticSearchFn"),e.CONSUME(Us),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.cloudSearchDocumentFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudSearchQueryFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudSearchRequestFn),"ALT")}]),e.sectionStack.pop()}}r(eU,"cloudElasticSearchFn");function tU(e){return()=>{e.sectionStack.push("cloudGetFileInfoFn");let t=e.CONSUME(Cs);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(tU,"cloudGetFileInfoFn");function rU(e){return()=>{e.sectionStack.push("cloudGoogleFn"),e.CONSUME(As),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.cloudStorageFn),"ALT")}]),e.sectionStack.pop()}}r(rU,"cloudGoogleFn");function oU(e){return()=>{e.sectionStack.push("cloudListDirectoryFn");let t=e.CONSUME(Os);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(oU,"cloudListDirectoryFn");function nU(e){return()=>{e.sectionStack.push("cloudReadFileFn");let t=e.CONSUME(Ls);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(nU,"cloudReadFileFn");function aU(e){return()=>{e.sectionStack.push("cloudSearchDocumentFn");let t=e.CONSUME(Fs);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(aU,"cloudSearchDocumentFn");function iU(e){return()=>{e.sectionStack.push("cloudSearchQueryFn");let t=e.CONSUME(_s);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(iU,"cloudSearchQueryFn");function sU(e){return()=>{e.sectionStack.push("cloudSearchRequestFn");let t=e.CONSUME(xo);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(sU,"cloudSearchRequestFn");function cU(e){return()=>{e.sectionStack.push("cloudSignUrlFn");let t=e.CONSUME(bs);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(cU,"cloudSignUrlFn");function lU(e){return()=>{e.sectionStack.push("cloudStorageFn"),e.CONSUME(Rs),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.cloudListDirectoryFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudSignUrlFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudUploadFileFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudDeleteFileFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudReadFileFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudGetFileInfoFn),"ALT")}]),e.sectionStack.pop()}}r(lU,"cloudStorageFn");function uU(e){return()=>{e.sectionStack.push("cloudUploadFileFn");let t=e.CONSUME(Ms);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(uU,"cloudUploadFileFn");var pU=r(e=>{e.cloudAlgoliaFn=e.RULE("cloudAlgoliaFn",Hg(e)),e.cloudAlgoliaRequestFn=e.RULE("cloudAlgoliaRequestFn",zg(e)),e.cloudAwsFn=e.RULE("cloudAwsFn",Jg(e)),e.cloudAwsOpenSearchFn=e.RULE("cloudAwsOpenSearchFn",Xg(e)),e.cloudAwsS3Fn=e.RULE("cloudAwsS3Fn",Qg(e)),e.cloudAzureFn=e.RULE("cloudAzureFn",Zg(e)),e.cloudDeleteFileFn=e.RULE("cloudDeleteFileFn",$g(e)),e.cloudElasticSearchFn=e.RULE("cloudElasticSearchFn",eU(e)),e.cloudGetFileInfoFn=e.RULE("cloudGetFileInfoFn",tU(e)),e.cloudGoogleFn=e.RULE("cloudGoogleFn",rU(e)),e.cloudListDirectoryFn=e.RULE("cloudListDirectoryFn",oU(e)),e.cloudReadFileFn=e.RULE("cloudReadFileFn",nU(e)),e.cloudSearchDocumentFn=e.RULE("cloudSearchDocumentFn",aU(e)),e.cloudSearchQueryFn=e.RULE("cloudSearchQueryFn",iU(e)),e.cloudSearchRequestFn=e.RULE("cloudSearchRequestFn",sU(e)),e.cloudSignUrlFn=e.RULE("cloudSignUrlFn",cU(e)),e.cloudStorageFn=e.RULE("cloudStorageFn",lU(e)),e.cloudUploadFileFn=e.RULE("cloudUploadFileFn",uU(e))},"register");function mU(e){return()=>{e.sectionStack.push("cloud"),e.CONSUME(hs),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.cloudGoogleFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudAwsFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudElasticSearchFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudAzureFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.cloudAlgoliaFn),"ALT")}]),e.sectionStack.pop()}}r(mU,"cloudFn");function fU(e){return(t={})=>{e.OR([{ALT:r(()=>e.CONSUME(No),"ALT")},{ALT:r(()=>e.CONSUME(Oc),"ALT")},{ALT:r(()=>e.SUBRULE(e.awaitFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.conditionalFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.forEachFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.forFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.functionRunFn),"ALT")},{GATE:r(()=>t.allowFunctionCalls,"GATE"),ALT:r(()=>e.SUBRULE(e.functionCallFn),"ALT")},{GATE:r(()=>t.allowFunctionCalls,"GATE"),ALT:r(()=>e.SUBRULE(e.taskCallFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.groupFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.returnFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.switchFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.whileFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.throwFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.tryCatchFn),"ALT")}]),e.sectionStack.pop()}}r(fU,"controlFn");function dU(e){let t=["ids","timeout"],o=["description","disabled"];return()=>{e.sectionStack.push("awaitFn");let n=e.CONSUME(Ec);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(dU,"awaitFn");function TU(e){return()=>{e.sectionStack.push("conditionalElifFn"),e.CONSUME(mc),e.CONSUME(B),e.MANY(()=>e.CONSUME(m)),e.SUBRULE(e.expressionFn),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(P),e.OPTION(()=>e.SUBRULE(e.nakedStackFn)),e.sectionStack.pop()}}r(TU,"conditionalElifFn");function EU(e){return()=>{e.sectionStack.push("conditionalElseFn"),e.CONSUME(pc),e.SUBRULE(e.nakedStackFn),e.sectionStack.pop()}}r(EU,"conditionalElseFn");function hU(e){return()=>{let t=!1,o=!1,n=!1;e.sectionStack.push("conditionalFn");let i=e.CONSUME(uc);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>e.CONSUME($),"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.disabledFieldAttribute)},"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.SUBRULE(e.conditionalIfFn),e.MANY1(()=>{e.AT_LEAST_ONE1(()=>e.CONSUME3(m)),e.SUBRULE(e.conditionalElifFn)}),e.OPTION(()=>{e.AT_LEAST_ONE2(()=>e.CONSUME4(m)),e.SUBRULE(e.conditionalElseFn)})},"ALT")}])}),t||e.addMissingError(i,"{} is missing the if statement"),e.MANY2(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(hU,"conditionalFn");function SU(e){return()=>{e.sectionStack.push("conditionalIfFn"),e.CONSUME(Oo),e.CONSUME(B),e.MANY(()=>e.CONSUME(m)),e.SUBRULE(e.expressionFn),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(P),e.OPTION(()=>e.SUBRULE(e.nakedStackFn)),e.sectionStack.pop()}}r(SU,"conditionalIfFn");function AU(e){return()=>{let t=!1;e.sectionStack.push("forEachFn"),e.CONSUME(dc),e.OR([{ALT:r(()=>{e.CONSUME(U),e.CONSUME(Tc)},"ALT")},{ALT:r(()=>{e.CONSUME(B),e.SUBRULE(e.expressionFn),e.CONSUME(P),e.OPTION(()=>{e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR1([{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")},{ALT:r(()=>{t=!0,e.CONSUME(mt),e.CONSUME(at),e.SUBRULE(e.assignableVariableAs),e.OPTION1(()=>e.SUBRULE1(e.nakedStackFn))},"ALT")}])}),t||(e.CONSUME1(mt),e.CONSUME1(at),e.SUBRULE(e.assignableVariableAs),e.OPTION2(()=>e.SUBRULE2(e.nakedStackFn))),e.MANY2(()=>e.CONSUME1(m)),e.CONSUME(A)})},"ALT")}]),e.sectionStack.pop()}}r(AU,"forEachFn");function gU(e){return()=>{let t=!1;e.sectionStack.push("forFn"),e.CONSUME(fc),e.CONSUME(B),e.SUBRULE(e.expressionFn),e.CONSUME(P),e.OPTION(()=>{e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")},{ALT:r(()=>{t=!0,e.CONSUME(mt),e.CONSUME(at),e.SUBRULE(e.assignableVariableAs),e.OPTION1(()=>e.SUBRULE1(e.nakedStackFn))},"ALT")}])}),t||(e.CONSUME1(mt),e.CONSUME1(at),e.SUBRULE(e.assignableVariableAs),e.OPTION2(()=>e.SUBRULE2(e.nakedStackFn))),e.MANY2(()=>e.CONSUME1(m)),e.CONSUME(A)}),e.sectionStack.pop()}}r(gU,"forFn");function UU(e){let t=[],o=["input","description","disabled"];return()=>{e.sectionStack.push("functionCallFn"),e.CONSUME(sr),e.CONSUME(U);let n=e.CONSUME(cl);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}]),e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o,{allowObject:["input"]}]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(UU,"functionCallFn");function kU(e){return()=>{e.sectionStack.push("functionRunFn"),e.CONSUME(sr),e.CONSUME(U);let t=e.CONSUME(sl);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}]),e.OPTION(()=>{e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"input?":{"[string]?":"[expression]"},"description?":"[string]","disabled?":"[boolean]","runtime_mode?":["async-shared","async-dedicated"],"mock?":{"![string]":"[expression]"}}]})}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(kU,"functionRunFn");function RU(e){return()=>{let t=!1;e.sectionStack.push("groupFn"),e.CONSUME(xc),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")},{ALT:r(()=>{t=!0,e.SUBRULE(e.stackClause)},"ALT")}])}),t||e.SUBRULE(e.stackClause),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(RU,"groupFn");function LU(e){return()=>{e.sectionStack.push("preconditionFn");let t=e.CONSUME(pp);e.CONSUME(B),e.SUBRULE(e.expressionFn),e.CONSUME(P),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"description?":"[string]","disabled?":"[boolean]","payload?":"[expression]","error?":"[expression]","error_type?":["standard","notfound","accessdenied","toomanyrequests","unauthorized","badrequest","inputerror"]}]}),e.sectionStack.pop()}}r(LU,"preconditionFn");function xU(e){let t=["value"],o=["description","disabled"];return()=>{e.sectionStack.push("return");let n=e.CONSUME(gc);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(xU,"returnFn");function CU(e){return()=>{e.sectionStack.push("switchCaseFn"),e.SUBRULE(e.optionalCommentBlockFn),e.CONSUME(kc),e.CONSUME(B),e.SUBRULE(e.expressionFn),e.CONSUME(P),e.OPTION(()=>e.SUBRULE(e.nakedStackFn)),e.OPTION1(()=>e.CONSUME(No)),e.sectionStack.pop()}}r(CU,"switchCaseFn");function OU(e){return()=>{e.sectionStack.push("switchDefaultFn"),e.CONSUME(Rc),e.SUBRULE(e.nakedStackFn),e.sectionStack.pop()}}r(OU,"switchDefaultFn");function NU(e){return()=>{e.sectionStack.push("switchFn"),e.CONSUME(Uc),e.CONSUME(B),e.SUBRULE(e.expressionFn),e.CONSUME(P),e.OPTION(()=>{e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")},{ALT:r(()=>{e.MANY1(()=>{e.MANY3(()=>e.CONSUME3(m)),e.SUBRULE(e.switchCaseFn)})},"ALT")}])}),e.OPTION1(()=>{e.MANY4(()=>e.CONSUME4(m)),e.SUBRULE(e.switchDefaultFn)}),e.MANY2(()=>e.CONSUME1(m)),e.CONSUME(A)}),e.sectionStack.pop()}}r(NU,"switchFn");function bU(e){let t=[],o=["description","disabled"];return()=>{e.sectionStack.push("taskCallFn"),e.CONSUME(sn),e.CONSUME(U);let n=e.CONSUME(Vu);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}]),e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(bU,"taskCallFn");function MU(e){let t=["value","name"],o=["description","disabled"];return()=>{e.sectionStack.push("throw");let n=e.CONSUME(Cc);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(MU,"throwFn");function yU(e){return()=>{let t=!1,o=!1;e.sectionStack.push("tryCatchFn"),e.CONSUME(hc),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")},{ALT:r(()=>{t=!0,e.CONSUME(Wn),e.OPTION(()=>e.SUBRULE(e.nakedStackFn))},"ALT")},{ALT:r(()=>{o=!0,e.CONSUME(Sc),e.sectionStack.push("catchFn"),e.OPTION1(()=>e.SUBRULE1(e.nakedStackFn)),e.sectionStack.pop()},"ALT")},{ALT:r(()=>{e.CONSUME(Ac),e.OPTION2(()=>e.SUBRULE2(e.nakedStackFn))},"ALT")}])}),t||(e.CONSUME(Wn),e.SUBRULE(e.nakedStackFn)),o||e.addWarning("try_catch without a catch block will not handle errors"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(yU,"tryCatchFn");function FU(e){return()=>{let t=!1;e.sectionStack.push("whileFn"),e.CONSUME(Lc),e.CONSUME(B),e.MANY(()=>e.CONSUME(m)),e.SUBRULE(e.expressionFn),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(P),e.OPTION(()=>{e.CONSUME(S),e.MANY2(()=>{e.AT_LEAST_ONE(()=>e.CONSUME2(m)),e.OR([{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")},{ALT:r(()=>{t=!0,e.CONSUME(mt),e.OPTION1(()=>e.SUBRULE(e.nakedStackFn))},"ALT")}])}),t||(e.CONSUME(mt),e.SUBRULE(e.nakedStackFn)),e.MANY3(()=>e.CONSUME3(m)),e.CONSUME(A)}),e.sectionStack.pop()}}r(FU,"whileFn");var _U=r(e=>{e.awaitFn=e.RULE("awaitFn",dU(e)),e.conditionalElifFn=e.RULE("conditionalElifFn",TU(e)),e.conditionalElseFn=e.RULE("conditionalElseFn",EU(e)),e.conditionalFn=e.RULE("conditionalFn",hU(e)),e.conditionalIfFn=e.RULE("conditionalIfFn",SU(e)),e.forEachFn=e.RULE("forEachFn",AU(e)),e.forFn=e.RULE("forFn",gU(e)),e.functionRunFn=e.RULE("functionRunFn",kU(e)),e.functionCallFn=e.RULE("functionCallFn",UU(e)),e.taskCallFn=e.RULE("taskCallFn",bU(e)),e.groupFn=e.RULE("groupFn",RU(e)),e.preconditionFn=e.RULE("preconditionFn",LU(e)),e.returnFn=e.RULE("returnFn",xU(e)),e.switchCaseFn=e.RULE("switchCaseFn",CU(e)),e.switchDefaultFn=e.RULE("switchDefaultFn",OU(e)),e.switchFn=e.RULE("switchFn",NU(e)),e.throwFn=e.RULE("throwFn",MU(e)),e.tryCatchFn=e.RULE("tryCatchFn",yU(e)),e.whileFn=e.RULE("whileFn",FU(e))},"register");var Be={name:"[string]","input?":{"[string]":"[expression]"},"as?":"[string]","output?":["[string]"]};Be["addon?"]=[Be];function IU(e){return()=>{e.sectionStack.push("dbAddFn");let t=e.CONSUME(Mo);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{data:{"[string]":"[expression]"},"description?":"[string]","disabled?":"[boolean]","addon?":[Be],"mock?":{"![string]":"[expression]"},"output?":["[string]"]}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(IU,"dbAddFn");function vU(e){return t=>{e.sectionStack.push("dbAddonAttr"),e.SUBRULE(e.schemaFn,{ARGS:[t,[Be]]}),e.sectionStack.pop()}}r(vU,"dbAddonAttr");function wU(e){return()=>{e.sectionStack.push("dbAddOrEditFn");let t=e.CONSUME(qc);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{field_name:"[expression]",field_value:"[expression]",data:{"[string]":"[expression]"},"description?":"[string]","disabled?":"[boolean]","addon?":[Be],"mock?":{"![string]":"[expression]"}}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(wU,"dbAddOrEditFn");function BU(e){return()=>{e.sectionStack.push("dbBulkAddFn");let t=e.CONSUME(Mo);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"});let o={};e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"items?":"[expression]","allow_id_field?":"[boolean]","description?":"[string]","disabled?":"[boolean]"},o]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(BU,"dbBulkAddFn");function PU(e){return()=>{e.sectionStack.push("dbBulkDeleteFn");let t=e.CONSUME(Wc);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"where?":"[query]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(PU,"dbBulkDeleteFn");function GU(e){return()=>{e.sectionStack.push("db.bulk"),e.CONSUME(Zc),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.dbBulkDeleteFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbBulkUpdateFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbBulkPatchFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbBulkAddFn),"ALT")}]),e.sectionStack.pop()}}r(GU,"dbBulkFn");function DU(e){return()=>{e.sectionStack.push("dbBulkPatchFn");let t=e.CONSUME(yo);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"items?":"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(DU,"dbBulkPatchFn");function VU(e){return()=>{e.sectionStack.push("dbBulkUpdateFn");let t=e.CONSUME(Kc);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"items?":"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(VU,"dbBulkUpdateFn");function qU(e){return()=>{e.sectionStack.push("dbDelFn");let t=e.CONSUME(jc);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{field_name:"[expression]",field_value:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.sectionStack.pop()}}r(qU,"dbDelFn");function jU(e){return()=>{e.sectionStack.push("dbDirectQueryFn");let t=e.CONSUME(Fo);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{sql:"[expression]","response_type?":["list","single"],"parser?":["template_engine","prepared"],"description?":"[string]","disabled?":"[boolean]","arg*":"[expression]","mock?":{"![string]":"[expression]"}}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(jU,"dbDirectQueryFn");function WU(e){return()=>{e.sectionStack.push("dbEditFn");let t=e.CONSUME(Yc);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{field_name:"[expression]",field_value:"[expression]",data:{"[string]":"[expression]"},"description?":"[string]","disabled?":"[boolean]","output?":["[string]"],"addon?":[Be],"mock?":{"![string]":"[expression]"}}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(WU,"dbEditFn");function YU(e){return()=>{e.sectionStack.push("dbExternalDirectQueryFn");let t=e.CONSUME(Fo);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{sql:"[expression]",response_type:["list","single"],connection_string:"[expression]","description?":"[string]","disabled?":"[boolean]","arg*":"[expression]","mock?":{"![string]":"[expression]"}}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(YU,"dbExternalDirectQueryFn");function KU(e){return()=>{e.sectionStack.push("dbExternalFn"),e.CONSUME($c),e.CONSUME(U),e.OR([{ALT:r(()=>e.CONSUME(el),"ALT")},{ALT:r(()=>e.CONSUME(tl),"ALT")},{ALT:r(()=>e.CONSUME(ol),"ALT")},{ALT:r(()=>e.CONSUME(rl),"ALT")}]),e.CONSUME1(U),e.SUBRULE(e.dbExternalDirectQueryFn),e.sectionStack.pop()}}r(KU,"dbExternalFn");function HU(e){return()=>{e.sectionStack.push("dbGetFn");let t=e.CONSUME(Vc);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{field_name:"[expression]",field_value:"[expression]","description?":"[string]","disabled?":"[boolean]","output?":["[string]"],"lock?":"[boolean]","addon?":[Be],"mock?":{"![string]":"[expression]"}}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(HU,"dbGetFn");function zU(e){return()=>{e.sectionStack.push("dbHasFn");let t=e.CONSUME(Hc);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{field_name:"[expression]",field_value:"[expression]","description?":"[string]","disabled?":"[boolean]","mock?":{"![string]":"[expression]"}}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(zU,"dbHasFn");function JU(e){return()=>{e.sectionStack.push("dbPatchFn");let t=e.CONSUME(yo);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{field_name:"[expression]",field_value:"[expression]",data:"[expression]","description?":"[string]","disabled?":"[boolean]","addon?":[Be],"mock?":{"![string]":"[expression]"}}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(JU,"dbPatchFn");function XU(e){return()=>{e.sectionStack.push("dbQueryFn");let t=e.CONSUME(Dc);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}]),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"eval?":{"[string]":"[query]"},"return?":{type:["list","stream","exists","count","single","aggregate"],"paging?":{"page?":"[expression]","per_page?":"[expression]","offset?":"[expression]","totals?":"[boolean]","metadata?":"[boolean]"},"distinct?":["yes","no"],"group?":{"[string]":"[query]"},"eval?":{"[string]":"[expression]"}},"join?":{"[string]":{table:"[string]","type?":["inner","left","right"],"where?":"[query]"}},"lock?":"[boolean]","disabled?":"[boolean]","description?":"[string]","mock?":{"![string]":"[expression]"},"addon?":[Be],"sort?":{"[string]":["asc","desc","rand"]},"override_sort?":"[expression]","output?":["[string]"],"where?":"[query]","additional_where?":"[query]"}]});let o=e.sectionStack.includes("addonDeclaration");e.OR1([{GATE:r(()=>!o,"GATE"),ALT:r(()=>e.SUBRULE(e.asVariable,{ARGS:[t]}),"ALT")},{GATE:r(()=>o,"GATE"),ALT:r(()=>{},"ALT")}]),e.sectionStack.pop()}}r(XU,"dbQueryFn");function QU(e){return()=>{let t=[],o=["description","disabled","path"];e.sectionStack.push("dbSchemaFn");let n=e.CONSUME(zc);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}]),e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(QU,"dbSchemaFn");function ZU(e){let t=["value"],o=["description","disabled"];return()=>{e.sectionStack.push("dbSetDatasourceFn");let n=e.CONSUME(Qc);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(ZU,"dbSetDatasourceFn");function $U(e){return()=>{let t=!1;e.sectionStack.push("dbTransactionFn"),e.CONSUME(Jc),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")},{ALT:r(()=>{t=!0,e.SUBRULE(e.stackClause)},"ALT")}])}),t||e.SUBRULE(e.stackClause),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r($U,"dbTransactionFn");function ek(e){return()=>{e.sectionStack.push("dbTruncateFn");let t=e.CONSUME(Xc);e.OR({DEF:[{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}],ERR_MSG:"Expected a table name"}),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"reset?":"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.sectionStack.pop()}}r(ek,"dbTruncateFn");var tk=r(e=>{e.dbAddFn=e.RULE("dbAddFn",IU(e)),e.dbBulkFn=e.RULE("dbBulkFn",GU(e)),e.dbBulkAddFn=e.RULE("dbBulkAddFn",BU(e)),e.dbBulkDeleteFn=e.RULE("dbBulkDeleteFn",PU(e)),e.dbBulkUpdateFn=e.RULE("dbBulkUpdateFn",VU(e)),e.dbBulkPatchFn=e.RULE("dbBulkPatchFn",DU(e)),e.dbDelFn=e.RULE("dbDelFn",qU(e)),e.dbDirectQueryFn=e.RULE("dbDirectQueryFn",jU(e)),e.dbEditFn=e.RULE("dbEditFn",WU(e)),e.dbExternalDirectQueryFn=e.RULE("dbExternalDirectQueryFn",YU(e)),e.dbExternalFn=e.RULE("dbExternalFn",KU(e)),e.dbGetFn=e.RULE("dbGetFn",HU(e)),e.dbHasFn=e.RULE("dbHasnpmFn",zU(e)),e.dbPatchFn=e.RULE("dbPatchFn",JU(e)),e.dbQueryFn=e.RULE("dbQueryFn",XU(e)),e.dbSchemaFn=e.RULE("dbSchemaFn",QU(e)),e.dbSetDatasourceFn=e.RULE("dbSetDatasourceFn",ZU(e)),e.dbTransactionFn=e.RULE("dbTransactionFn",$U(e)),e.dbTruncateFn=e.RULE("dbTruncateFn",ek(e)),e.dbAddOrEditFn=e.RULE("dbAddOrEditFn",wU(e)),e.dbAddonAttr=e.RULE("dbAddonAttr",vU(e))},"register");function rk(e){return()=>{e.sectionStack.push("db"),e.CONSUME(bo),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.dbExternalFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbGetFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbHasFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbEditFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbDelFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbAddFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbDirectQueryFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbSetDatasourceFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbQueryFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbSchemaFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbTruncateFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbTransactionFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbPatchFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbBulkFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.dbAddOrEditFn),"ALT")}]),e.sectionStack.pop()}}r(rk,"dbFn");function ok(e){let t=["value"],o=["description","disabled"];return()=>{e.sectionStack.push("debugLog");let n=e.CONSUME(il);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(ok,"debugLogFn");function nk(e){let t=["value"],o=["description","disabled"];return()=>{e.sectionStack.push("debugStop");let n=e.CONSUME(al);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(nk,"debugStopFn");var ak=r(e=>{e.debugLogFn=e.RULE("debugLogFn",ok(e)),e.debugStopFn=e.RULE("debugStopFn",nk(e))},"register");function ik(e){return()=>{e.sectionStack.push("debug"),e.CONSUME(nl),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.debugLogFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.debugStopFn),"ALT")}]),e.sectionStack.pop()}}r(ik,"debugFn");function sk(e){let t=["min","max"],o=[];return()=>{e.sectionStack.push("unitExpectToBeWithinFn");let n=e.CONSUME(Qo);e.CONSUME(B),e.CONSUME(ur),e.MANY(()=>{e.CONSUME(U),e.CONSUME(a)}),e.CONSUME(P),e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(sk,"unitExpectToBeWithinFn");function ck(e){return()=>{e.sectionStack.push("unitExpectToThrowFn");let t=e.CONSUME(Zo);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"exception?":"[string]"}]}),e.sectionStack.pop()}}r(ck,"unitExpectToThrowFn");function lk(e){return()=>{e.sectionStack.push("unitExpectWithArgumentsFn");let t=e.OR([{ALT:r(()=>e.CONSUME(zo),"ALT")},{ALT:r(()=>e.CONSUME(jo),"ALT")},{ALT:r(()=>e.CONSUME(Wo),"ALT")},{ALT:r(()=>e.CONSUME(Yo),"ALT")},{ALT:r(()=>e.CONSUME(Ko),"ALT")},{ALT:r(()=>e.CONSUME(Ho),"ALT")},{ALT:r(()=>e.CONSUME(Jo),"ALT")},{ALT:r(()=>e.CONSUME(Xo),"ALT")}]);e.CONSUME(B),e.CONSUME(ur),e.MANY(()=>{e.CONSUME(U),e.CONSUME(a)}),e.CONSUME(P),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{value:"[constant]"}]}),e.sectionStack.pop()}}r(lk,"unitExpectWithArgumentsFn");function uk(e){return()=>{e.sectionStack.push("unitExpectWithoutArgumentsFn"),e.OR([{ALT:r(()=>e.CONSUME(Io),"ALT")},{ALT:r(()=>e.CONSUME(vo),"ALT")},{ALT:r(()=>e.CONSUME(wo),"ALT")},{ALT:r(()=>e.CONSUME(Bo),"ALT")},{ALT:r(()=>e.CONSUME(Po),"ALT")},{ALT:r(()=>e.CONSUME(Go),"ALT")},{ALT:r(()=>e.CONSUME(Do),"ALT")},{ALT:r(()=>e.CONSUME(Vo),"ALT")},{ALT:r(()=>e.CONSUME(qo),"ALT")}]),e.CONSUME(B),e.CONSUME(ur),e.MANY(()=>{e.CONSUME(U),e.CONSUME(a)}),e.CONSUME(P),e.sectionStack.pop()}}r(uk,"unitExpectWithoutArgumentsFn");function pk(e){let t=["min","max"],o=["description","disabled"];return()=>{e.sectionStack.push("workflowExpectToBeWithinFn");let n=e.CONSUME(Qo);e.CONSUME(B),e.SUBRULE(e.expressionFn),e.CONSUME(P),e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(pk,"workflowExpectToBeWithinFn");function mk(e){return()=>{e.sectionStack.push("workflowExpectToThrowFn");let t=e.CONSUME(Zo);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"stack?":"[test-stack]","exception?":"[string]"}]}),e.sectionStack.pop()}}r(mk,"workflowExpectToThrowFn");function fk(e){let t=["value"],o=["description","disabled"];return()=>{e.sectionStack.push("workflowExpectWithArgumentsFn");let n=e.OR([{ALT:r(()=>e.CONSUME(zo),"ALT")},{ALT:r(()=>e.CONSUME(jo),"ALT")},{ALT:r(()=>e.CONSUME(Wo),"ALT")},{ALT:r(()=>e.CONSUME(Yo),"ALT")},{ALT:r(()=>e.CONSUME(Ko),"ALT")},{ALT:r(()=>e.CONSUME(Ho),"ALT")},{ALT:r(()=>e.CONSUME(Jo),"ALT")},{ALT:r(()=>e.CONSUME(Xo),"ALT")}]);e.CONSUME(B),e.SUBRULE(e.expressionFn),e.CONSUME(P),e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(fk,"workflowExpectWithArgumentsFn");function dk(e){return()=>{e.sectionStack.push("workflowExpectWithoutArgumentsFn");let t=e.OR([{ALT:r(()=>e.CONSUME(Io),"ALT")},{ALT:r(()=>e.CONSUME(vo),"ALT")},{ALT:r(()=>e.CONSUME(wo),"ALT")},{ALT:r(()=>e.CONSUME(Bo),"ALT")},{ALT:r(()=>e.CONSUME(Po),"ALT")},{ALT:r(()=>e.CONSUME(Go),"ALT")},{ALT:r(()=>e.CONSUME(Do),"ALT")},{ALT:r(()=>e.CONSUME(Vo),"ALT")},{ALT:r(()=>e.CONSUME(qo),"ALT")}]);e.CONSUME(B),e.SUBRULE(e.expressionFn),e.CONSUME(P),e.SUBRULE(e.functionAttrReq,{ARGS:[t,[],["description","disabled"]]}),e.sectionStack.pop()}}r(dk,"workflowExpectWithoutArgumentsFn");var Tk=r(e=>{e.unitExpectWithArgumentsFn=e.RULE("unitExpectWithArgumentsFn",lk(e)),e.unitExpectWithoutArgumentsFn=e.RULE("unitExpectWithoutArgumentsFn",uk(e)),e.unitExpectToThrowFn=e.RULE("unitExpectToThrowFn",ck(e)),e.unitExpectToBeWithinFn=e.RULE("unitExpectToBeWithinFn",sk(e)),e.workflowExpectWithArgumentsFn=e.RULE("workflowExpectWithArgumentsFn",fk(e)),e.workflowExpectWithoutArgumentsFn=e.RULE("workflowExpectWithoutArgumentsFn",dk(e)),e.workflowExpectToThrowFn=e.RULE("workflowExpectToThrowFn",mk(e)),e.workflowExpectToBeWithinFn=e.RULE("workflowExpectToBeWithinFn",pk(e))},"register");function Ek(e){return()=>{let t=!1;e.sectionStack.push("allMathFn"),e.OR([{ALT:r(()=>e.CONSUME(ul),"ALT")},{ALT:r(()=>e.CONSUME(pl),"ALT")},{ALT:r(()=>e.CONSUME(ml),"ALT")},{ALT:r(()=>e.CONSUME(fl),"ALT")},{ALT:r(()=>e.CONSUME(dl),"ALT")},{ALT:r(()=>{e.CONSUME(Tl),e.CONSUME(U),e.OR1([{ALT:r(()=>e.CONSUME(El),"ALT")},{ALT:r(()=>e.CONSUME(hl),"ALT")},{ALT:r(()=>e.CONSUME(Sl),"ALT")}])},"ALT")}]),e.SUBRULE(e.assignableVariableProperty),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>{t=!0,e.SUBRULE(e.valueFieldAttribute)},"ALT")},{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")}])}),t||e.SUBRULE(e.valueFieldAttribute),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(Ek,"allMathFn");var hk=r(e=>{e.allMathFn=e.RULE("allMathFn",Ek(e))},"register");function Sk(e){return()=>{e.sectionStack.push("math"),e.CONSUME(ll),e.CONSUME(U),e.SUBRULE(e.allMathFn),e.sectionStack.pop()}}r(Sk,"mathFn");function Ak(e){return()=>{e.sectionStack.push("middlewareCallFn"),e.CONSUME($o),e.CONSUME(U);let t=e.CONSUME(ir);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}]),e.OPTION(()=>{e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{input:{vars:"[expression]",type:"[expression]"},"mock?":{"![string]":"[expression]"},"description?":"[string]","disabled?":"[boolean]"}]})}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Ak,"middlewareCallFn");function gk(e){return()=>{let t=["value"],o=["description","disabled"];e.sectionStack.push("objectEntriesFn");let n=e.CONSUME(yl);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(gk,"objectEntriesFn");function Uk(e){return()=>{let t=["value"],o=["description","disabled"];e.sectionStack.push("objectKeysFn");let n=e.CONSUME(Fl);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(Uk,"objectKeysFn");function kk(e){return()=>{let t=["value"],o=["description","disabled"];e.sectionStack.push("objectValuesFn");let n=e.CONSUME(_l);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(kk,"objectValuesFn");var Rk=r(e=>{e.objectEntriesFn=e.RULE("objectEntriesFn",gk(e)),e.objectKeysFn=e.RULE("objectKeysFn",Uk(e)),e.objectValuesFn=e.RULE("objectValuesFn",kk(e))},"register");function Lk(e){return()=>{e.sectionStack.push("object"),e.CONSUME(Ml),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.objectEntriesFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.objectKeysFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.objectValuesFn),"ALT")}]),e.sectionStack.pop()}}r(Lk,"objectFn");function xk(e){return()=>{e.sectionStack.push("redisCountFn");let t=e.CONSUME(ql);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(xk,"redisCountFn");function Ck(e){return()=>{e.sectionStack.push("redisDecrFn");let t=e.CONSUME(jl);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]",by:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Ck,"redisDecrFn");function Ok(e){return()=>{e.sectionStack.push("redisDelFn");let t=e.CONSUME(Wl);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.sectionStack.pop()}}r(Ok,"redisDelFn");function Nk(e){return()=>{e.sectionStack.push("redisGetFn");let t=e.CONSUME(Yl);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Nk,"redisGetFn");function bk(e){return()=>{e.sectionStack.push("redisHasFn");let t=e.CONSUME(Kl);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(bk,"redisHasFn");function Mk(e){return()=>{e.sectionStack.push("redisIncrFn");let t=e.CONSUME(Hl);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]",by:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Mk,"redisIncrFn");function yk(e){return()=>{e.sectionStack.push("redisKeysFn");let t=e.CONSUME(zl);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{search:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(yk,"redisKeysFn");function Fk(e){return()=>{e.sectionStack.push("redisPopFn");let t=e.CONSUME(Jl);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Fk,"redisPopFn");function _k(e){return()=>{e.sectionStack.push("redisPushFn");let t=e.CONSUME(Xl);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]",value:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(_k,"redisPushFn");function Ik(e){return()=>{e.sectionStack.push("redisRangeFn");let t=e.CONSUME(Ql);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]",start:"[expression]",stop:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Ik,"redisRangeFn");function vk(e){return()=>{e.sectionStack.push("redisRateLimitFn");let t=e.CONSUME(Zl);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]",max:"[expression]",ttl:"[expression]",error:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(vk,"redisRateLimitFn");function wk(e){return()=>{e.sectionStack.push("redisRemoveFn");let t=e.CONSUME($l);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]",value:"[expression]",count:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.sectionStack.pop()}}r(wk,"redisRemoveFn");function Bk(e){return()=>{e.sectionStack.push("redisSetFn");let t=e.CONSUME(eu);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]",data:"[expression]",ttl:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.sectionStack.pop()}}r(Bk,"redisSetFn");function Pk(e){return()=>{e.sectionStack.push("redisShiftFn");let t=e.CONSUME(tu);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Pk,"redisShiftFn");function Gk(e){return()=>{e.sectionStack.push("redisUnshiftFn");let t=e.CONSUME(ru);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{key:"[expression]",value:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(Gk,"redisUnshiftFn");var Dk=r(e=>{e.redisCountFn=e.RULE("redisCountFn",xk(e)),e.redisDecrFn=e.RULE("redisDecrFn",Ck(e)),e.redisDelFn=e.RULE("redisDelFn",Ok(e)),e.redisGetFn=e.RULE("redisGetFn",Nk(e)),e.redisHasFn=e.RULE("redisHasFn",bk(e)),e.redisIncrFn=e.RULE("redisIncrFn",Mk(e)),e.redisKeysFn=e.RULE("redisKeysFn",yk(e)),e.redisPopFn=e.RULE("redisPopFn",Fk(e)),e.redisPushFn=e.RULE("redisPushFn",_k(e)),e.redisRangeFn=e.RULE("redisRangeFn",Ik(e)),e.redisRateLimitFn=e.RULE("redisRateLimitFn",vk(e)),e.redisRemoveFn=e.RULE("redisRemoveFn",wk(e)),e.redisSetFn=e.RULE("redisSetFn",Bk(e)),e.redisShiftFn=e.RULE("redisShiftFn",Pk(e)),e.redisUnshiftFn=e.RULE("redisUnshiftFn",Gk(e))},"register");function Vk(e){return()=>{e.sectionStack.push("redis"),e.CONSUME(Vl),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.redisDelFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisSetFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisGetFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisHasFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisIncrFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisDecrFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisKeysFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisPushFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisUnshiftFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisPopFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisShiftFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisRemoveFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisCountFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisRangeFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.redisRateLimitFn),"ALT")}]),e.sectionStack.pop()}}r(Vk,"redisFn");function qk(e){return(t,o,n={},i)=>{let s=!1;n.value=[],e.CONSUME(re),e.MANY1(()=>e.CONSUME(m)),e.MANY(()=>{let c={};e.SUBRULE(e.schemaFn,{ARGS:[t,Ae(o),c,i]}),s&&e.addInvalidValueError("Expected a comma, a new line or closing bracket"),n.value.push(c),s=!0,e.OPTION(()=>(s=!1,e.CONSUME1(je))),e.MANY2(()=>{s=!1,e.CONSUME1(m)})}),e.CONSUME(oe)}}r(qk,"schemaParseArrayFn");function Qm(e){return typeof e!="object"||!Array.isArray(e)?!1:e.length==1}r(Qm,"schemaExpectArray");function Ct(e){return!e||typeof e!="string"?!1:e.endsWith("?")||e.endsWith("*")}r(Ct,"isOptionalAttribute");function Zp(e){return!e||typeof e!="string"?!1:e.endsWith("*")}r(Zp,"isMultiAttribute");function Pr(e){return!e||typeof e!="string"?!1:e.startsWith("!")}r(Pr,"canBeDisabledAttribute");function Je(e){return!e||typeof e!="string"?!1:(Ct(e)&&(e=e.slice(0,-1)),Pr(e)&&(e=e.slice(1)),e.startsWith("[")&&e.endsWith("]"))}r(Je,"isSchemaGenericType");function fI(e){return Pr(e)&&(e=e.slice(1)),Ct(e)&&(e=e.slice(0,-1)),e}r(fI,"getSchemaConstantValue");function jk(e){return Je(e)?(Ct(e)&&(e=e.slice(0,-1)),Pr(e)&&(e=e.slice(1)),e.slice(1,-1)):null}r(jk,"getSchemaGenericTypeName");function Xe(e,t){return Je(e)?t.includes(jk(e)):!1}r(Xe,"schemaExpectOneOf");var $p=r((e,t)=>{for(let o of t)if(Je(o))switch(jk(o)){case"string":if(typeof e=="string")return o;break;case"number":if(!isNaN(Number(e)))return o;break;case"boolean":if(e==="true"||e==="false")return o;break}else{if(fI(o)===e)return o;if(e===o)return o}return!1},"valueMatchRequirements");function Wk(e){return(t,o,n={})=>{let i=null,s=e.OR({IGNORE_AMBIGUITIES:!0,DEF:[{ALT:r(()=>(i="string",e.CONSUME(E)),"ALT")},{ALT:r(()=>(i="string",e.CONSUME(ze)),"ALT")},{ALT:r(()=>(i="string",e.CONSUME(Lt)),"ALT")},{ALT:r(()=>(i="number",e.CONSUME(X)),"ALT")},{ALT:r(()=>(i="number",e.CONSUME(_e)),"ALT")},{ALT:r(()=>(i="boolean",e.CONSUME(Ue)),"ALT")},{ALT:r(()=>(i="boolean",e.CONSUME(ke)),"ALT")},{ALT:r(()=>(i="null",e.CONSUME(xt)),"ALT")}]});n.value=s,e.ACTION(()=>{Yk(i,s.image,o)||e.addExpectedValueError(t,o)})}}r(Wk,"schemaParseConstantFn");function Yk(e,t,o){let n=o!==null?o.toString():o;if(b(o))return lt(o,i=>Yk(e,t,i));switch(e){case"string":return(t.startsWith('"""')||t.startsWith("'''"))&&(t=t.slice(4,-4).trim()),(t.startsWith('"')||t.startsWith("'"))&&(t=t.slice(1,-1)),t===n;case"number":case"boolean":return t===n;case"null":return n===null;default:throw new Error(`schemaParseConstantFn called with non-constant attribute: ${o}`)}}r(Yk,"matchValueToSchema");function Zm(e){return Je(e)?!1:typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null}r(Zm,"schemaExpectConstant");function Kk(e){return(t,o,n={})=>{let[i,s]=pm(o,Je);e.ACTION(()=>{if(s.length>0&&i.length>0)throw new Error("schemaParseEnumFn does not support mixing constant and immutable types in the same enum, received: "+JSON.stringify(o))}),e.OR({IGNORE_AMBIGUITIES:!0,DEF:[{GATE:r(()=>s.length>0,"GATE"),ALT:r(()=>e.SUBRULE(e.schemaParseConstantFn,{ARGS:[t,s,n]}),"ALT")},{GATE:r(()=>i.length>0,"GATE"),ALT:r(()=>e.SUBRULE(e.schemaParseImmutableFn,{ARGS:[t,i,n]}),"ALT")}]})}}r(Kk,"schemaParseEnumFn");function $m(e){return!!(b(e)&&e.length>1)}r($m,"schemaExpectEnum");function Hk(e){return(t,o,n={},i)=>{let s=!1,c=null,l=j(o),p=[...l],f=[];if(e.ACTION(()=>{if(l.length>1&<(l,d=>Je(d)))throw new Error("schemaParseObjectFn supports only one generic type when multiple keys are defined")}),e.CONSUME(S),e.MANY(()=>{e.MANY1(()=>{s=!1,e.CONSUME(m)}),s&&e.addInvalidValueError(c,"Expected a comma, a new line or closing bracket");let d=e.OPTION1(()=>e.CONSUME(Ne)),T,g=e.OR([{ALT:r(()=>{T=e.CONSUME(a);let L=[T];return e.MANY3(()=>{L.push(e.CONSUME(U)),L.push(e.CONSUME1(a))}),L.map(N=>N.image).join(".")},"ALT")},{ALT:r(()=>e.CONSUME(E).image.slice(1,-1),"ALT")}]),k=$p(g,l);k?d&&!Pr(k)&&e.addInvalidValueError(d,`The key '${g}' cannot be disabled`):e.addInvalidValueError(T,`The key '${g}' is not valid in this context`),f.includes(g)&&!Zp(k)?e.addInvalidValueError(T,`Duplicate key '${g}' found`):(f.push(g),n[g]={key:T,value:null}),p.splice(p.indexOf(k),1),e.CONSUME(be);let C=Mr(o,k,null);e.SUBRULE(e.schemaFn,{ARGS:[T,C,n[g],i]}),s=!0,e.OPTION(()=>{s=!1,e.CONSUME1(je)}),e.MANY2(()=>{s=!1,e.CONSUME1(m)})}),e.CONSUME(A),p.length){let d=p.filter(T=>!Ct(T));d.length>1?e.addMissingError(c||t,`{} is missing the following required entries: ${d.join(", ")}`):d.length===1&&(Je(d[0])?e.addMissingError(c||t,"{} requires a least one entry"):e.addMissingError(c||t,`{} is missing required key '${d[0]}'`))}return{foo:"foo-bar"}}}r(Hk,"schemaParseObjectFn");function ef(e){return La(e)}r(ef,"schemaExpectObject");var dI=r(e=>Xe(e,["string","number","boolean","timestamp","null"])?b(e)?`Expected one of the following types: ${e.join(", ")}`:`Expected a ${e}`:Zm(e)?b(e)?`Expected one of the following constants: ${e.join(", ")}`:`Expected a ${e}`:Qm(e)?`Expected an array of ${e[0]}`:ef(e)?"Expected an object {}":$m(e)?`Expected one of the following enum values: ${e.join(", ")}`:Xe(e,["mock"])?"Expected a mock":Xe(e,["expression"])?"Expected an expression":Xe(e,["query"])?"Expected a database query expression":Xe(e,["constant"])?"Expected a value expression (no variables allowed)":Xe(e,["stack"])?"Expected a stack definition":`Invalid schema: received ${JSON.stringify(e)}`,"getErrorMessageForSchema");function zk(e){return(t,o,n={},i)=>{e.sectionStack.push("schema"),e.OR({IGNORE_AMBIGUITIES:!0,ERR_MSG:dI(o),DEF:[{GATE:r(()=>Xe(o,["string","number","boolean","timestamp"],n),"GATE"),ALT:r(()=>(e.SUBRULE(e.schemaParseImmutableFn,{ARGS:[t,o,n]}),!0),"ALT")},{GATE:r(()=>Zm(o),"GATE"),ALT:r(()=>(e.SUBRULE(e.schemaParseConstantFn,{ARGS:[t,o,n]}),!0),"ALT")},{GATE:r(()=>Qm(o),"GATE"),ALT:r(()=>(e.SUBRULE(e.schemaParseArrayFn,{ARGS:[t,o,n]}),!0),"ALT")},{GATE:r(()=>ef(o),"GATE"),ALT:r(()=>(e.SUBRULE(e.schemaParseObjectFn,{ARGS:[t,o,n]}),!0),"ALT")},{GATE:r(()=>$m(o),"GATE"),ALT:r(()=>(e.SUBRULE(e.schemaParseEnumFn,{ARGS:[t,o,n]}),!0),"ALT")},{GATE:r(()=>Xe(o,["expression","constant","query","stack","test-stack"]),"GATE"),ALT:r(()=>{e.OR1({IGNORE_AMBIGUITIES:!0,DEF:[{GATE:r(()=>Xe(o,["stack","test-stack"]),"GATE"),ALT:r(()=>{let s=Xe(o,["test-stack"]);e.SUBRULE(e.nakedStackFn,{ARGS:[{allowExpectStatements:s,allowCallStatements:s}]})},"ALT")},{GATE:r(()=>Xe(o,["expression","query","constant"]),"GATE"),ALT:r(()=>{let s=Xe(o,["query"]),c=Xe(o,["constant"]);e.SUBRULE(e.expressionFn,{ARGS:[t,i||{allowQueryExpression:s,allowVariable:!c,allowExpression:!c,allowComparison:!c}]})},"ALT")}]})},"ALT")}]}),e.sectionStack.pop()}}r(zk,"schemaFn");function Jk(e){return e.requireRules(TI),(t,o,n={})=>{let i=j(o).every(s=>Ct(s));e.OR([{GATE:r(()=>i,"GATE"),ALT:r(()=>{e.OPTION(()=>e.SUBRULE(e._schemaParseAttributeFn,{ARGS:[t,o,n]}))},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>e.SUBRULE1(e._schemaParseAttributeFn,{ARGS:[t,o,n]}),"ALT")}])}}r(Jk,"schemaParseAttributeFn");function TI(e){return(t,o,n={})=>{let i=!1,s=null,c=j(o),l=[...c],p=[];if(e.ACTION(()=>{if(c.length>1&<(c,f=>Je(f)))throw new Error("schemaParseAttributeFn supports only one generic type when multiple keys are defined")}),e.CONSUME(S),e.MANY(()=>{e.MANY1(()=>{i=!1,e.CONSUME(m)}),i&&e.addInvalidValueError(s,"Expected a comma, a new line or closing bracket");let f=e.OPTION1(()=>e.CONSUME(Ne)),d,T=e.OR([{ALT:r(()=>(d=e.CONSUME1(a),d.image),"ALT")},{ALT:r(()=>e.CONSUME1(E).image.slice(1,-1),"ALT")}]),g=$p(T,c);g?f&&!Pr(g)&&e.addInvalidValueError(f,`The argument '${T}' cannot be disabled`):e.addInvalidValueError(d,`The argument '${T}' is not valid in this context`),p.includes(T)&&!Zp(g)?e.addInvalidValueError(d,`Duplicate argument '${T}' found`):(p.push(T),n[T]={key:d,value:null}),l.splice(l.indexOf(g),1);let k=Mr(o,g,null),C=["[stack]","[test-stack]"].includes(k);e.OR1([{GATE:r(()=>!C,"GATE"),ALT:r(()=>e.CONSUME(h),"ALT")},{GATE:r(()=>C,"GATE"),ALT:r(()=>!1,"ALT")}]),e.SUBRULE(e.schemaFn,{ARGS:[d,k,n[T]]}),i=!0,e.MANY2(()=>{i=!1,e.CONSUME1(m)}),e.OPTION(()=>{i=!1,e.CONSUME1(je)})}),e.CONSUME(A),l.length){let f=l.filter(d=>!Ct(d));f.length>1?e.addInvalidValueError(s||t,`The following required arguments are missing: ${f.join(", ")}`):f.length===1&&e.addInvalidValueError(s||t,`Missing required argument '${f[0]}'`)}}}r(TI,"_schemaParseAttributeFn");function Qk(e){return(t,o,n={})=>{let i,s=e.OR({DEF:[{ALT:r(()=>(i="string",e.CONSUME(E)),"ALT")},{ALT:r(()=>(i="string",e.CONSUME(Lt)),"ALT")},{ALT:r(()=>(i="string",e.CONSUME(ze)),"ALT")},{ALT:r(()=>(i="number",e.CONSUME(_e)),"ALT")},{ALT:r(()=>(i="number",e.CONSUME(X)),"ALT")},{ALT:r(()=>{i="boolean",e.SUBRULE(e.booleanValue)},"ALT")},{ALT:r(()=>(i="timestamp",e.CONSUME(lc)),"ALT")},{ALT:r(()=>(i="null",e.CONSUME(xt)),"ALT")},{ALT:r(()=>!1,"ALT")}]});e.OPTION({GATE:r(()=>!s,"GATE"),DEF:r(()=>{e.addExpectedValueTypeError(i,"invalid immutable value"),e.CONSUME(a)},"DEF")}),n.value=s,e.ACTION(()=>{let c=b(o),l=c?o.map(Xk):Xk(o);if(c){if(!Oe(l))throw new Error(`schemaParseImmutableFn called with invalid enum attribute: ${o}`);l.includes(i)||e.addExpectedValueTypeError(t,l.join(" or "))}else{if(!l)throw new Error(`schemaParseImmutableFn called with invalid attribute: ${o}`);i!==l&&e.addExpectedValueTypeError(t,l)}})}}r(Qk,"schemaParseImmutableFn");function Xk(e){let t=["string","number","boolean","timestamp","null"];if(Je(e)){let o=Ct(e)?e.slice(1,-2):e.slice(1,-1);if(t.includes(o))return o}return null}r(Xk,"getImmutableAttributeType");var Zk=r(e=>{e.schemaFn=e.RULE("schemaFn",zk(e)),e.schemaParseImmutableFn=e.RULE("schemaParseImmutableFn",Qk(e)),e.schemaParseEnumFn=e.RULE("schemaParseEnumFn",Kk(e)),e.schemaParseConstantFn=e.RULE("schemaParseConstantFn",Wk(e)),e.schemaParseArrayFn=e.RULE("schemaParseArrayFn",qk(e)),e.schemaParseObjectFn=e.RULE("schemaParseObjectFn",Hk(e)),e.schemaParseAttributeFn=e.RULE("schemaParseAttributeFn",Jk(e))},"register");function $k(e){return()=>{e.sectionStack.push("securityCheckPasswordFn");let t=e.CONSUME(su);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r($k,"securityCheckPasswordFn");function eR(e){return()=>{e.sectionStack.push("securityCreateAuthTokenFn");let t=e.CONSUME(uu);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{extras:"[expression]",table:"[expression]",expiration:"[expression]",id:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(eR,"securityCreateAuthTokenFn");function tR(e){let t=["curve","format"],o=["description","disabled"];return()=>{e.sectionStack.push("securityCreateCurveKeyFn");let n=e.CONSUME(pu);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(tR,"securityCreateCurveKeyFn");function rR(e){let t=["character_count","require_lowercase","require_uppercase","require_digit","require_symbol","symbol_whitelist"],o=["description","disabled"];return()=>{e.sectionStack.push("securityCreatePasswordFn");let n=e.CONSUME(cu);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(rR,"securityCreatePasswordFn");function oR(e){let t=["bits","format"],o=["description","disabled"];return()=>{e.sectionStack.push("securityCreateRsaKeyFn");let n=e.CONSUME(mu);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(oR,"securityCreateRsaKeyFn");function nR(e){return()=>{e.sectionStack.push("securityCreateSecretKeyFn");let t=e.CONSUME(fu);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(nR,"securityCreateSecretKeyFn");function aR(e){return()=>{e.sectionStack.push("securityCreateUuidFn");let t=e.CONSUME(lu);e.OPTION(()=>{e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A)}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(aR,"securityCreateUuidFn");function iR(e){return()=>{e.sectionStack.push("securityDecryptFn");let t=e.CONSUME(du);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(iR,"securityDecryptFn");function sR(e){return()=>{e.sectionStack.push("securityEncryptFn");let t=e.CONSUME(Tu);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(sR,"securityEncryptFn");function cR(e){return()=>{e.sectionStack.push("securityJweDecodeFn");let t=e.CONSUME(Eu);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(cR,"securityJweDecodeFn");function lR(e){return()=>{e.sectionStack.push("securityJweEncodeFn");let t=e.CONSUME(hu);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(lR,"securityJweEncodeFn");function uR(e){return()=>{e.sectionStack.push("securityJwsDecodeFn");let t=e.CONSUME(Su);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(uR,"securityJwsDecodeFn");function pR(e){return()=>{e.sectionStack.push("securityJwsEncodeFn");let t=e.CONSUME(Au);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(pR,"securityJwsEncodeFn");function mR(e){return()=>{e.sectionStack.push("securityRandomBytesFn");let t=e.CONSUME(gu);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(mR,"securityRandomBytesFn");function fR(e){return()=>{e.sectionStack.push("securityRandomNumberFn");let t=e.CONSUME(Uu);e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.CONSUME1(a),e.CONSUME(h),e.SUBRULE(e.expressionFn)}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(fR,"securityRandomNumberFn");var dR=r(e=>{e.securityCheckPasswordFn=e.RULE("securityCheckPasswordFn",$k(e)),e.securityCreateAuthTokenFn=e.RULE("securityCreateAuthTokenFn",eR(e)),e.securityCreateCurveKeyFn=e.RULE("securityCreateCurveKeyFn",tR(e)),e.securityCreatePasswordFn=e.RULE("securityCreatePasswordFn",rR(e)),e.securityCreateRsaKeyFn=e.RULE("securityCreateRsaKeyFn",oR(e)),e.securityCreateSecretKeyFn=e.RULE("securityCreateSecretKeyFn",nR(e)),e.securityCreateUuidFn=e.RULE("securityCreateUuidFn",aR(e)),e.securityDecryptFn=e.RULE("securityDecryptFn",iR(e)),e.securityEncryptFn=e.RULE("securityEncryptFn",sR(e)),e.securityJweDecodeFn=e.RULE("securityJweDecodeFn",cR(e)),e.securityJweEncodeFn=e.RULE("securityJweEncodeFn",lR(e)),e.securityJwsDecodeFn=e.RULE("securityJwsDecodeFn",uR(e)),e.securityJwsEncodeFn=e.RULE("securityJwsEncodeFn",pR(e)),e.securityRandomBytesFn=e.RULE("securityRandomBytesFn",mR(e)),e.securityRandomNumberFn=e.RULE("securityRandomNumberFn",fR(e))},"register");function TR(e){return()=>{e.sectionStack.push("security"),e.CONSUME(iu),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.securityCheckPasswordFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityCreateAuthTokenFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityCreateCurveKeyFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityCreatePasswordFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityCreateRsaKeyFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityCreateSecretKeyFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityCreateUuidFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityDecryptFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityEncryptFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityJweDecodeFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityJweEncodeFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityJwsDecodeFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityJwsEncodeFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityRandomBytesFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.securityRandomNumberFn),"ALT")}]),e.sectionStack.pop()}}r(TR,"securityFn");function ER(e){return()=>{e.sectionStack.push("storageCreateAttachmentFn");let t=e.CONSUME(Lu);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{value:"[expression]",access:["public","private"],filename:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(ER,"storageCreateAttachmentFn");function hR(e){return()=>{e.sectionStack.push("storageCreateAudioFn");let t=e.CONSUME(Ou);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{value:"[expression]","access?":["public","private"],"filename?":"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(hR,"storageCreateAudioFn");function SR(e){return()=>{let t=["filename","filedata"],o=["description","disabled"];e.sectionStack.push("storageCreateFileResourceFn");let n=e.CONSUME(Cu);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(SR,"storageCreateFileResourceFn");function AR(e){return()=>{e.sectionStack.push("storageCreateImageFn");let t=e.CONSUME(Ru);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{value:"[expression]",access:["public","private"],filename:"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(AR,"storageCreateImageFn");function gR(e){return()=>{e.sectionStack.push("storageCreateVideoFn");let t=e.CONSUME(Nu);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{value:"[expression]","access?":["public","private"],"filename?":"[expression]","description?":"[string]","disabled?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(gR,"storageCreateVideoFn");function UR(e){return()=>{let t=["pathname"],o=["description","disabled"];e.sectionStack.push("storageDeleteFileFn");let n=e.CONSUME(bu);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(UR,"storageDeleteFileFn");function kR(e){return()=>{let t=["value"],o=["description","disabled"];e.sectionStack.push("storageReadFileResourceFn");let n=e.CONSUME(xu);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(kR,"storageReadFileResourceFn");function RR(e){return()=>{let t=["pathname","ttl"],o=["description","disabled"];e.sectionStack.push("storageSignPrivateUrlFn");let n=e.CONSUME(Mu);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(RR,"storageSignPrivateUrlFn");var LR=r(e=>{e.storageCreateAttachmentFn=e.RULE("storageCreateAttachmentFn",ER(e)),e.storageCreateFileResourceFn=e.RULE("storageCreateFileResourceFn",SR(e)),e.storageCreateImageFn=e.RULE("storageCreateImageFn",AR(e)),e.storageDeleteFileFn=e.RULE("storageDeleteFileFn",UR(e)),e.storageReadFileResourceFn=e.RULE("storageReadFileResourceFn",kR(e)),e.storageSignPrivateUrlFn=e.RULE("storageSignPrivateUrlFn",RR(e)),e.storageCreateAudioFn=e.RULE("storageCreateAudioFn",hR(e)),e.storageCreateVideoFn=e.RULE("storageCreateVideoFn",gR(e))},"register");function xR(e){return()=>{e.sectionStack.push("storage"),e.CONSUME(ku),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.storageCreateAttachmentFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.storageCreateFileResourceFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.storageCreateImageFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.storageDeleteFileFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.storageReadFileResourceFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.storageSignPrivateUrlFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.storageCreateAudioFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.storageCreateVideoFn),"ALT")}]),e.sectionStack.pop()}}r(xR,"storageFn");function CR(e){let t=["value","separator","enclosure","escape_char"],o=["description","disabled"];return()=>{e.sectionStack.push("streamFromCsv");let n=e.CONSUME(Fu);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(CR,"streamFromCsvFn");function OR(e){let t=["value"],o=["description","disabled"];return()=>{e.sectionStack.push("streamFromJsonl");let n=e.CONSUME(_u);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(OR,"streamFromJsonlFn");function NR(e){return()=>{e.sectionStack.push("streamFromRequest");let t=e.CONSUME(Iu);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{url:"[expression]",method:"[expression]","params?":"[expression]","headers?":"[expression]","timeout?":"[expression]","follow_location?":"[expression]","description?":"[string]","disabled?":"[boolean]","verify_host?":"[expression]","verify_peer?":"[expression]","ca_certificate?":"[expression]","certificate?":"[expression]","certificate_pass?":"[expression]","private_key?":"[expression]","private_key_pass?":"[expression]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(NR,"streamFromRequestFn");var bR=r(e=>{e.streamFromCsvFn=e.RULE("streamFromCsvFn",CR(e)),e.streamFromJsonlFn=e.RULE("streamFromJsonlFn",OR(e)),e.streamFromRequestFn=e.RULE("streamFromRequestFn",NR(e))},"register");function MR(e){return()=>{e.sectionStack.push("stream"),e.CONSUME(yu),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.streamFromCsvFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.streamFromJsonlFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.streamFromRequestFn),"ALT")}]),e.sectionStack.pop()}}r(MR,"streamFn");function yR(e){return()=>{let t=["value"],o=["description","disabled"];e.sectionStack.push("allTextWithoutReturnValueFn");let n=e.OR([{ALT:r(()=>e.CONSUME(Wu),"ALT")},{ALT:r(()=>e.CONSUME(Xu),"ALT")},{ALT:r(()=>e.CONSUME(Qu),"ALT")},{ALT:r(()=>e.CONSUME(Zu),"ALT")},{ALT:r(()=>e.CONSUME(ep),"ALT")}]);e.SUBRULE(e.assignableVariableProperty),e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(yR,"allTextWithoutReturnValueFn");function FR(e){return()=>{let t=["value"],o=["description","disabled"];e.sectionStack.push("allTextWithReturnValueFn");let n=e.OR([{ALT:r(()=>e.CONSUME(Yu),"ALT")},{ALT:r(()=>e.CONSUME(Ku),"ALT")},{ALT:r(()=>e.CONSUME(Hu),"ALT")},{ALT:r(()=>e.CONSUME(zu),"ALT")},{ALT:r(()=>e.CONSUME(Ju),"ALT")},{ALT:r(()=>e.CONSUME($u),"ALT")}]);e.SUBRULE(e.assignableVariableProperty),e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(FR,"allTextWithReturnValueFn");var _R=r(e=>{e.allTextWithoutReturnValueFn=e.RULE("allTextWithoutReturnValueFn",yR(e)),e.allTextWithReturnValueFn=e.RULE("allTextWithReturnValueFn",FR(e))},"register");function IR(e){return()=>{e.sectionStack.push("text"),e.CONSUME(Co),e.CONSUME(U);let t=e.LA(1).image,o=["contains","ends_with","icontains","iends_with","istarts_with","starts_with"],n=["append","ltrim","prepend","rtrim","trim"];o.includes(t)?e.SUBRULE(e.allTextWithReturnValueFn):n.includes(t)&&e.SUBRULE(e.allTextWithoutReturnValueFn),e.sectionStack.pop()}}r(IR,"textFn");function vR(e){return()=>{e.sectionStack.push("toolCallFn"),e.CONSUME(cr),e.CONSUME(U);let t=e.CONSUME(ir);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME1(E),"ALT")}]),e.OPTION(()=>{e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"input?":{"[string]":"[expression]"},"mock?":{"![string]":"[expression]"},"description?":"[string]","disabled?":"[boolean]"}]})}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(vR,"toolCallFn");function wR(e){return()=>{e.sectionStack.push("unitExpect"),e.CONSUME(_o),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.unitExpectWithArgumentsFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.unitExpectWithoutArgumentsFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.unitExpectToThrowFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.unitExpectToBeWithinFn),"ALT")}]),e.sectionStack.pop()}}r(wR,"unitExpectFn");function BR(e){return()=>{let t=["latitude_1","longitude_1","latitude_2","longitude_2"],o=["description","disabled"];e.sectionStack.push("utilGeoDistanceFn");let n=e.CONSUME(op);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(BR,"utilGeoDistanceFn");function PR(e){let t=[],o=["description","disabled"];return()=>{e.sectionStack.push("utilGetAllInputFn");let n=e.CONSUME(np);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(PR,"utilGetAllInputFn");function GR(e){return()=>{let t=[],o=["description","disabled"];e.sectionStack.push("utilGetEnvFn");let n=e.CONSUME(ip);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(GR,"utilGetEnvFn");function DR(e){return()=>{e.sectionStack.push("utilGetRawInputFn");let t=e.CONSUME(sp);e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"encoding?":["json","none","yaml","x-www-form-urlencoded",""],"description?":"[string]","disabled?":"[boolean]","exclude_middleware?":"[boolean]"}]}),e.SUBRULE(e.asVariable,{ARGS:[t]}),e.sectionStack.pop()}}r(DR,"utilGetRawInputFn");function VR(e){return()=>{let t=[],o=["description","disabled"];e.sectionStack.push("utilGetVarsFn");let n=e.CONSUME(cp);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(VR,"utilGetVarsFn");function qR(e){return()=>{let t=["value"],o=["description","disabled"];e.sectionStack.push("utilIpLookupFn");let n=e.CONSUME(lp);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(qR,"utilIpLookupFn");function jR(e){return()=>{let t=!1;e.sectionStack.push("utilPostProcessFn"),e.CONSUME(up),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")},{ALT:r(()=>{t=!0,e.SUBRULE(e.stackClause)},"ALT")}])}),t||e.SUBRULE(e.stackClause),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(jR,"utilPostProcessFn");function WR(e){return()=>{e.sectionStack.push("utilSendEmailFn");let t=e.CONSUME(rp),o={};e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"description?":"[string]","disabled?":"[boolean]","service_provider?":["resend","xano"],"api_key?":"[expression]","subject?":"[expression]","message?":"[expression]","to?":"[expression]","bcc?":"[expression]","cc?":"[expression]","from?":"[expression]","reply_to?":"[expression]","scheduled_at?":"[expression]","mock?":{"![string]":"[expression]"}},o]}),e.SUBRULE(e.asVariable,{ARGS:[t]});let n={xano:["description","disabled","service_provider","subject","message","mock"],resend:["description","disabled","service_provider","api_key","subject","message","to","bcc","cc","from","reply_to","scheduled_at","mock"]},i={xano:["subject","message"],resend:["api_key","subject","message","from","to"]};e.ACTION(()=>{let s=le(o.service_provider?.value),c=i[s]||[];for(let d of c)Object.prototype.hasOwnProperty.call(o,d)||e.addMissingError(t,`Missing required field '${d}' for service_provider '${s}'`);let l=n[s]||[],p=new Set([...n.xano,...n.resend]),f=[];for(let d in o){let T=le(o[d].key);f.push(T),p.has(T)?l.includes(T)||e.addWarning(`${T} is not used with service_provider '${s}'`,o[d].key):e.addIllegalAttributeError(o[d].key,`Field '${T}' is not allowed in send_email`)}}),e.sectionStack.pop()}}r(WR,"utilSendEmailFn");function YR(e){return()=>{let t=["value","duplicates"],o=["description","disabled"];e.sectionStack.push("utilSetHeaderFn");let n=e.CONSUME(mp);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(YR,"utilSetHeaderFn");function KR(e){return()=>{let t=["value"],o=["description","disabled"];e.sectionStack.push("utilSleepFn");let n=e.CONSUME(fp);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(KR,"utilSleepFn");function HR(e){let t=["value"],o=["description","disabled"];return()=>{e.sectionStack.push("utilTemplateFn");let n=e.CONSUME(ap);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(HR,"utilTemplateFn");var zR=r(e=>{e.utilGeoDistanceFn=e.RULE("utilGeoDistanceFn",BR(e)),e.utilGetAllInputFn=e.RULE("utilGetAllInputFn",PR(e)),e.utilGetEnvFn=e.RULE("utilGetEnvFn",GR(e)),e.utilGetRawInputFn=e.RULE("utilGetRawInputFn",DR(e)),e.utilGetVarsFn=e.RULE("utilGetVarsFn",VR(e)),e.utilIpLookupFn=e.RULE("utilIpLookupFn",qR(e)),e.utilPostProcessFn=e.RULE("utilPostProcessFn",jR(e)),e.utilSetHeaderFn=e.RULE("utilSetHeaderFn",YR(e)),e.utilSleepFn=e.RULE("utilSleepFn",KR(e)),e.utilTemplateFn=e.RULE("utilTemplateFn",HR(e)),e.utilSendEmailFn=e.RULE("utilSendEmailFn",WR(e))},"register");function JR(e){return()=>{e.sectionStack.push("util"),e.CONSUME(tp),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.utilIpLookupFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilGetEnvFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilSleepFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilGetAllInputFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilGetRawInputFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilGetVarsFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilGeoDistanceFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilPostProcessFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilSetHeaderFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilTemplateFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.utilSendEmailFn),"ALT")}]),e.sectionStack.pop()}}r(JR,"utilFn");var EI=["auth","input","env","response","output","var","db","error","toolset","this"];function fa(e){return EI.includes(e)}r(fa,"isBlacklistedVariableName");function XR(e){return()=>{let t="",o=null;if(e.OR({DEF:[{ALT:r(()=>{let n=e.OR1([{ALT:r(()=>e.CONSUME(V),"ALT")},{ALT:r(()=>e.CONSUME(Sr),"ALT")},{ALT:r(()=>e.CONSUME(Rr),"ALT")},{ALT:r(()=>e.CONSUME(kr),"ALT")},{ALT:r(()=>e.CONSUME(Er),"ALT")},{ALT:r(()=>e.CONSUME(xr),"ALT")},{ALT:r(()=>e.CONSUME(mr),"ALT")},{ALT:r(()=>e.CONSUME(Lr),"ALT")},{ALT:r(()=>e.CONSUME(dr),"ALT")},{ALT:r(()=>e.CONSUME(Tr),"ALT")},{ALT:r(()=>e.CONSUME(Ur),"ALT")},{ALT:r(()=>e.CONSUME(Cr),"ALT")},{ALT:r(()=>e.CONSUME(gr),"ALT")},{ALT:r(()=>e.CONSUME(Ar),"ALT")},{ALT:r(()=>e.CONSUME(fr),"ALT")},{ALT:r(()=>e.CONSUME(hr),"ALT")}]);t=n.image,o=n},"ALT")},{ALT:r(()=>{e.CONSUME(pr),e.CONSUME(U);let n=e.CONSUME(a);t=`$${n.image}`,o=n},"ALT")}],ERR_MSG:"expecting variable (e.g. $variable or $var.variable)"}),t&&o){let n=t.startsWith("$")?t.slice(1):t;fa(n)&&e.SAVE_ERROR(new me(`'${t}' is a reserved variable name and cannot be used`,o))}e.SUBRULE(e.chainedIdentifier),e.MANY({GATE:r(()=>e.LA(1).tokenType===Me||e.LA(1).tokenType===m&&e.LA(2).tokenType===Me,"GATE"),DEF:r(()=>{e.SUBRULE(e.filterFn)},"DEF")}),t&&e.addVariable(t,"unknown")}}r(XR,"assignableVariableProperty");function QR(e){return()=>{e.sectionStack.push("var");let t=e.CONSUME(dp);e.OR([{ALT:r(()=>{let o=e.OR1([{ALT:r(()=>e.CONSUME(V),"ALT")},{ALT:r(()=>e.CONSUME(Sr),"ALT")},{ALT:r(()=>e.CONSUME(Rr),"ALT")},{ALT:r(()=>e.CONSUME(kr),"ALT")},{ALT:r(()=>e.CONSUME(Er),"ALT")},{ALT:r(()=>e.CONSUME(xr),"ALT")},{ALT:r(()=>e.CONSUME(mr),"ALT")},{ALT:r(()=>e.CONSUME(Lr),"ALT")},{ALT:r(()=>e.CONSUME(dr),"ALT")},{ALT:r(()=>e.CONSUME(Tr),"ALT")},{ALT:r(()=>e.CONSUME(Ur),"ALT")},{ALT:r(()=>e.CONSUME(Cr),"ALT")},{ALT:r(()=>e.CONSUME(gr),"ALT")},{ALT:r(()=>e.CONSUME(Ar),"ALT")},{ALT:r(()=>e.CONSUME(fr),"ALT")},{ALT:r(()=>e.CONSUME(hr),"ALT")}]);if(o.image){let n=o.image.startsWith("$")?o.image.slice(1):o.image;fa(n)&&e.addInvalidValueError(o,`'${o.image}' is a reserved variable name and should not be used as a variable.`),e.addVariable(o.image,"unknown")}},"ALT")},{ALT:r(()=>{e.CONSUME(U),e.CONSUME(Tp),e.SUBRULE(e.assignableVariableProperty)},"ALT")}]),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{value:"[expression]","description?":"[string]","disabled?":"[boolean]","mock?":{"![string]":"[expression]"}}]}),e.sectionStack.pop()}}r(QR,"varFn");function ZR(e){return()=>{e.sectionStack.push("webflow"),e.CONSUME(Wi),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.webflowRequestFn),"ALT")}]),e.sectionStack.pop()}}r(ZR,"webflowFn");function $R(e){return()=>{e.sectionStack.push("workflowExpect"),e.CONSUME(_o),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.workflowExpectWithArgumentsFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.workflowExpectWithoutArgumentsFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.workflowExpectToThrowFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.workflowExpectToBeWithinFn),"ALT")}]),e.sectionStack.pop()}}r($R,"workflowExpectFn");function eL(e){return()=>{let t=["file","zip"],o=["description","disabled","password","password_encryption","filename"];e.sectionStack.push("zipAddToArchiveFn");let n=e.CONSUME(Cp);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(eL,"zipAddToArchiveFn");function tL(e){return()=>{let t=["filename"],o=["description","disabled","password","password_encryption"];e.sectionStack.push("zipCreateArchiveFn");let n=e.CONSUME(Op);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(tL,"zipCreateArchiveFn");function rL(e){return()=>{let t=["filename","zip"],o=["description","disabled","password"];e.sectionStack.push("zipDeleteFromArchiveFn");let n=e.CONSUME(Np);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.sectionStack.pop()}}r(rL,"zipDeleteFromArchiveFn");function oL(e){return()=>{let t=["zip"],o=["description","disabled","password"];e.sectionStack.push("zipExtractFn");let n=e.CONSUME(bp);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(oL,"zipExtractFn");function nL(e){return()=>{let t=["zip"],o=["description","disabled","password"];e.sectionStack.push("zipViewContentsFn");let n=e.CONSUME(Mp);e.SUBRULE(e.functionAttrReq,{ARGS:[n,t,o]}),e.SUBRULE(e.asVariable,{ARGS:[n]}),e.sectionStack.pop()}}r(nL,"zipViewContentsFn");var aL=r(e=>{e.zipAddToArchiveFn=e.RULE("zipAddToArchiveFn",eL(e)),e.zipCreateArchiveFn=e.RULE("zipCreateArchiveFn",tL(e)),e.zipDeleteFromArchiveFn=e.RULE("zipDeleteFromArchiveFn",rL(e)),e.zipExtractFn=e.RULE("zipExtractFn",oL(e)),e.zipViewContentsFn=e.RULE("zipViewContentsFn",nL(e))},"register");function iL(e){return()=>{e.sectionStack.push("zip"),e.CONSUME(xp),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.zipCreateArchiveFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.zipAddToArchiveFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.zipDeleteFromArchiveFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.zipExtractFn),"ALT")},{ALT:r(()=>e.SUBRULE(e.zipViewContentsFn),"ALT")}]),e.sectionStack.pop()}}r(iL,"zipFn");var sL=r(e=>{e.addonCallFn=e.RULE("addonCallFn",lg(e)),e.actionCallFn=e.RULE("actionCallFn",cg(e)),e.middlewareCallFn=e.RULE("middlewareCallFn",Ak(e)),e.aiFn=e.RULE("aiFn",Tg(e)),e.apiFn=e.RULE("apiFn",Rg(e)),e.webflowFn=e.RULE("webflowFn",ZR(e)),e.arrayFn=e.RULE("arrayFn",Kg(e)),e.cloudFn=e.RULE("cloudFn",mU(e)),e.controlFn=e.RULE("controlFn",fU(e)),e.dbFn=e.RULE("dbFn",rk(e)),e.debugFn=e.RULE("debugFn",ik(e)),e.mathFn=e.RULE("mathFn",Sk(e)),e.objectFn=e.RULE("objectFn",Lk(e)),e.redisFn=e.RULE("redisFn",Vk(e)),e.securityFn=e.RULE("securityFn",TR(e)),e.storageFn=e.RULE("storageFn",xR(e)),e.streamFn=e.RULE("streamFn",MR(e)),e.textFn=e.RULE("textFn",IR(e)),e.utilFn=e.RULE("utilFn",JR(e)),e.varFn=e.RULE("varFn",QR(e)),e.zipFn=e.RULE("zipFn",iL(e)),e.unitExpectFn=e.RULE("unitExpectFn",wR(e)),e.workflowExpectFn=e.RULE("workflowExpectFn",$R(e)),e.toolCallFn=e.RULE("toolCallFn",vR(e)),dg(e),Zk(e),kg(e),Yg(e),pU(e),_U(e),tk(e),ak(e),hk(e),Rk(e),Dk(e),dR(e),LR(e),bR(e),_R(e),zR(e),aL(e),Tk(e)},"register");function cL(e){return(t={})=>{let o=!1,n=e.CONSUME(re);e.MANY(()=>{e.MANY1(()=>{o=!1,e.CONSUME(m)}),o&&e.addMissingError(je,"Expected ',' between array values"),e.SUBRULE(e.expressionFn,{ARGS:[n,{...t,allowObject:!0,allowArray:!0}]}),o=!0,e.OPTION1(()=>{o=!1,e.CONSUME1(je)}),e.MANY2(()=>{o=!1,e.CONSUME1(m)})}),e.CONSUME(oe)}}r(cL,"arrayWithValues");function lL(e){return()=>{let t="",o=null;if(e.OR([{ALT:r(()=>{let n=e.CONSUME(V);t=n.image,o=n},"ALT")},{ALT:r(()=>{e.CONSUME(pr),e.CONSUME(U);let n=e.CONSUME(a);t=`$${n.image}`,o=n},"ALT")}]),t&&o){let n=t.startsWith("$")?t.slice(1):t;fa(n)&&e.SAVE_ERROR(new me(`'${t}' is a reserved variable name and cannot be used`,o))}}}r(lL,"assignableVariableAs");function uL(e){return t=>{let o=!1;e.OPTION(()=>{o=!0,e.CONSUME(at),e.SUBRULE(e.assignableVariableProperty)}),!o&&t&&e.addWarning("`as <variable>` is missing",t)}}r(uL,"asVariable");function pL(e){return()=>{e.OR([{ALT:r(()=>{e.CONSUME(Ue)},"ALT")},{ALT:r(()=>{e.CONSUME(ke)},"ALT")}])}}r(pL,"booleanValue");function mL(e){return()=>{e.CONSUME(re),e.SUBRULE(e.expressionFn),e.CONSUME(oe)}}r(mL,"bracketAccessor");function fL(e){return()=>{e.OR([{ALT:r(()=>{e.CONSUME(re),e.SUBRULE(e.expressionFn),e.CONSUME(oe)},"ALT")},{ALT:r(()=>{e.CONSUME(U),e.OR1([{ALT:r(()=>e.CONSUME(X),"ALT")},{ALT:r(()=>{e.CONSUME1(re),e.SUBRULE1(e.expressionFn),e.CONSUME1(oe)},"ALT")}])},"ALT")}])}}r(fL,"bracketArrayAccessor");function dL(e){return()=>{e.OR(Oi.map(t=>({ALT:r(()=>e.CONSUME(t),"ALT")}))),e.CONSUME(E)}}r(dL,"castedValue");function TL(e){return()=>{e.MANY(()=>e.SUBRULE(e.singleChainedIdentifier))}}r(TL,"chainedIdentifier");function EL(e){return()=>{e.OR([{ALT:r(()=>{e.CONSUME(U),e.OR1([{ALT:r(()=>{let t=e.CONSUME(V);e.addWarning(`Using \`$\` prefixed properties '${t.image}' is discouraged.`,t)},"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME2(X),"ALT")},{ALT:r(()=>e.SUBRULE(e.bracketAccessor),"ALT")}])},"ALT")},{ALT:r(()=>e.SUBRULE1(e.bracketAccessor),"ALT")}])}}r(EL,"singleChainedIdentifier");function hL(e){return()=>{e.CONSUME(Sp),e.SUBRULE(e.chainedIdentifier)}}r(hL,"completeAuthVariable");function SL(e){return()=>{e.CONSUME(hp),e.OR([{ALT:r(()=>{e.CONSUME(U),e.OR1([{ALT:r(()=>e.CONSUME(Sr),"ALT")},{ALT:r(()=>e.CONSUME(Rr),"ALT")},{ALT:r(()=>e.CONSUME(kr),"ALT")},{ALT:r(()=>{e.CONSUME(Er),e.OPTION(()=>e.SUBRULE(e.singleChainedIdentifier))},"ALT")},{ALT:r(()=>e.CONSUME(xr),"ALT")},{ALT:r(()=>e.CONSUME(mr),"ALT")},{ALT:r(()=>e.CONSUME(Lr),"ALT")},{ALT:r(()=>e.CONSUME(dr),"ALT")},{ALT:r(()=>e.CONSUME(Tr),"ALT")},{ALT:r(()=>e.CONSUME(Ur),"ALT")},{ALT:r(()=>e.CONSUME(Cr),"ALT")},{ALT:r(()=>e.CONSUME(gr),"ALT")},{ALT:r(()=>e.CONSUME(Ar),"ALT")},{ALT:r(()=>e.CONSUME(fr),"ALT")},{ALT:r(()=>{e.CONSUME(hr),e.SUBRULE1(e.singleChainedIdentifier)},"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>{let t=e.CONSUME(V);e.addWarning(`Using \`$\` prefixed environment variables '${t.image}' is discouraged.`,t)},"ALT")},{ALT:r(()=>e.SUBRULE(e.bracketAccessor),"ALT")}])},"ALT")},{ALT:r(()=>e.SUBRULE1(e.bracketAccessor),"ALT")}])}}r(SL,"completeEnvVariable");function AL(e){let t=new Set(["name","code","message","result"]);return()=>{let o=e.CONSUME(Ap);e.sectionStack.includes("catchFn")||e.addInvalidValueError(o,"Invalid use of $error variable outside of a catch block."),e.OPTION(()=>{e.CONSUME(U);let n=e.CONSUME(a);t.has(n.image)||e.addInvalidValueError(n,`Invalid property '${n.image}' for $error variable. Allowed properties are: ${Array.from(t).join(", ")}.`),e.SUBRULE(e.chainedIdentifier)})}}r(AL,"completeErrorVariable");function gL(e){return()=>{e.CONSUME(Ep),e.OR([{ALT:r(()=>{e.CONSUME(U),e.OR1([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>{e.CONSUME(re),e.CONSUME(E),e.CONSUME(oe)},"ALT")}])},"ALT")},{ALT:r(()=>{e.CONSUME2(re),e.CONSUME2(E),e.CONSUME2(oe)},"ALT")}]),e.SUBRULE(e.chainedIdentifier)}}r(gL,"completeInputVariable");function UL(e){return(...t)=>{let o=t||[],n=e.CONSUME3(E),i=le(n);o.includes(i)||e.addMissingError(n,`Invalid value "${i}". Must be one of: ${o.map(s=>`"${s}"`).join(", ")}`)}}r(UL,"enumValue");var hI={allowQueryExpression:!1,allowExpression:!0,allowIdentifier:!0,allowVariable:!0,allowFilter:!0,allowComparison:!0,allowDisabledKeys:!1},SI=[Yn,Kn,Hn,zn,_c,Jn,Ic,Xn,ma,oa,na,aa,sa,ia,Qn,Zn,$n,ea,ta,ra,ca,la,ua,pa];function kL(e){return(t,o={})=>{o={...hI,...o};let n=!1,i=!1,s=!1;e.OR([{ALT:r(()=>{e.MANY1(()=>e.CONSUME(Ne)),e.OR2([{ALT:r(()=>{e.CONSUME(B),e.OR3([{ALT:r(()=>e.SUBRULE(e.expressionFn,{ARGS:[t,o]}),"ALT")},{ALT:r(()=>e.SUBRULE(e.multilineFilterFn,{ARGS:[o]}),"ALT")}]),e.OPTION(()=>e.CONSUME1(m)),e.CONSUME(P),e.MANY(()=>{e.CONSUME(U),e.CONSUME(a)})},"ALT")},{ALT:r(()=>e.SUBRULE(e.simpleExpressionFn,{ARGS:[t,o]}),"ALT")}])},"ALT")},{ALT:r(()=>{e.SUBRULE(e.schemaParseArrayFn,{ARGS:[t,o.allowQueryExpression?["[query]"]:["[expression]"],{},o]})},"ALT")},{ALT:r(()=>{let l=o.allowDisabledKeys?"![string]?":"[string]?";e.SUBRULE(e.schemaParseObjectFn,{ARGS:[t,{[l]:o.allowQueryExpression?"[query]":"[expression]"},{},o]}),e.SUBRULE(e.chainedIdentifier)},"ALT")}]),e.MANY2(()=>{e.SUBRULE(e.bracketArrayAccessor)}),e.MANY3({GATE:r(()=>o.allowFilter&&e.LA(1).tokenType===Me||e.LA(1).tokenType===m&&e.LA(2).tokenType===Me,"GATE"),DEF:r(()=>{n=!0,e.SUBRULE(e.filterFn,{ARGS:[o]})},"DEF")});let c=e.OPTION1({GATE:r(()=>o.allowComparison,"GATE"),DEF:r(()=>(i=!0,e.OR1([{ALT:r(()=>e.SUBRULE(e.expressionTestFn,{ARGS:[t,o]}),"ALT")},{ALT:r(()=>{s=!0;let l=e.CONSUME(et);return e.SUBRULE2(e.expressionFn,{ARGS:[l,o]}),e.OPTION2(()=>{e.CONSUME2(be),e.SUBRULE3(e.expressionFn,{ARGS:[l,o]})}),l},"ALT")}])),"DEF")});n&&i&&e.addInvalidValueError(t,"An expression should be wrapped in parentheses when combining filters and tests"),o.allowQueryExpression&&s&&e.addInvalidValueError(c,"Ternary expressions are not allowed in a where clause")}}r(kL,"expressionFn");function RL(e){return(t,o={})=>{let n=e.OR([{ALT:r(()=>e.CONSUME(Yn),"ALT")},{ALT:r(()=>e.CONSUME(Kn),"ALT")},{ALT:r(()=>e.CONSUME(Hn),"ALT")},{ALT:r(()=>e.CONSUME(zn),"ALT")},{ALT:r(()=>e.CONSUME(_c),"ALT")},{ALT:r(()=>e.CONSUME(Jn),"ALT")},{ALT:r(()=>e.CONSUME(Ic),"ALT")},{ALT:r(()=>e.CONSUME(Xn),"ALT")},{ALT:r(()=>e.CONSUME(bc),"ALT")},{ALT:r(()=>e.CONSUME(Nc),"ALT")},{ALT:r(()=>e.CONSUME(Mc),"ALT")},{ALT:r(()=>e.CONSUME(yc),"ALT")},{ALT:r(()=>e.CONSUME(Fc),"ALT")},{ALT:r(()=>e.CONSUME(wc),"ALT")},{ALT:r(()=>e.CONSUME(vc),"ALT")},{ALT:r(()=>e.CONSUME(Bc),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(Hm),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(ma),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(oa),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(na),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(aa),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(sa),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(ia),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(Qn),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(Zn),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME($n),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(ea),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(ta),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(ra),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(ca),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(la),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(ua),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(pa),"ALT")},{GATE:r(()=>o.allowQueryExpression,"GATE"),ALT:r(()=>e.CONSUME(Gc),"ALT")},{ALT:r(()=>e.CONSUME(Pc),"ALT")}]);e.OPTION({GATE:r(()=>o.allowQueryExpression&&SI.includes(n.tokenType),"GATE"),DEF:r(()=>e.CONSUME1(et),"DEF")}),e.SUBRULE(e.expressionFn,{ARGS:[t,o]})}}r(RL,"expressionTestFn");function LL(e){return(t,o)=>{e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(Lt),"ALT")},{ALT:r(()=>e.CONSUME(X),"ALT")},{ALT:r(()=>e.CONSUME(_e),"ALT")},{ALT:r(()=>e.CONSUME(Ue),"ALT")},{ALT:r(()=>e.CONSUME(ke),"ALT")},{ALT:r(()=>e.CONSUME(xt),"ALT")},{ALT:r(()=>e.CONSUME(Or),"ALT")},{GATE:r(()=>o.allowExpression,"GATE"),ALT:r(()=>e.CONSUME(ze),"ALT")},{GATE:r(()=>o.allowExpression,"GATE"),ALT:r(()=>e.CONSUME(bl),"ALT")},{GATE:r(()=>o.allowExpression,"GATE"),ALT:r(()=>e.CONSUME(cc),"ALT")},{GATE:r(()=>o.allowVariable,"GATE"),ALT:r(()=>e.SUBRULE(e.longFormVariable),"ALT")},{GATE:r(()=>o.allowVariable,"GATE"),ALT:r(()=>e.SUBRULE(e.completeAuthVariable),"ALT")},{GATE:r(()=>o.allowVariable,"GATE"),ALT:r(()=>e.SUBRULE(e.completeEnvVariable),"ALT")},{GATE:r(()=>o.allowVariable,"GATE"),ALT:r(()=>e.SUBRULE(e.completeInputVariable),"ALT")},{GATE:r(()=>o.allowVariable,"GATE"),ALT:r(()=>e.SUBRULE(e.completeErrorVariable),"ALT")},{GATE:r(()=>o.allowVariable,"GATE"),ALT:r(()=>e.SUBRULE(e.shortFormVariable),"ALT")},{ALT:r(()=>e.SUBRULE(e.castedValue),"ALT")}])}}r(LL,"simpleExpressionFn");function xL(e){return(t={},o=null)=>{e.OR([{ALT:r(()=>{e.CONSUME(m),e.CONSUME(Me)},"ALT")},{ALT:r(()=>e.CONSUME1(Me),"ALT")}]);let n=t.allowQueryExpression===!0?CA:xA;e.OPTION(()=>e.CONSUME(Ne));let i=e.CONSUME(a);n.includes(i.image)||e.addInvalidValueError(i,`Unknown filter function '${i.image}'`),e.MANY1(()=>{e.CONSUME(be),e.SUBRULE(e.expressionFn,{ARGS:[i,t,o]})})}}r(xL,"filterFn");var AI={allowDuplicates:[],allowQueryExpression:!1,allowDisabledKeys:!1,types:{}};function CL(e){return(t,o,n,i={})=>{o=o||[],n=n||[];let s=!1,c=!1;i={...AI,...i};let l=[],p=[...o,...n];e.OR({IGNORE_AMBIGUITIES:!0,DEF:[{GATE:r(()=>o.length===0,"GATE"),ALT:r(()=>{e.OPTION(()=>{e.CONSUME(S),e.MANY(()=>{e.OR1([{GATE:r(()=>!s,"GATE"),ALT:r(()=>e.MANY1(()=>e.CONSUME1(m)),"ALT")},{GATE:r(()=>s,"GATE"),ALT:r(()=>e.AT_LEAST_ONE(()=>e.CONSUME2(m)),"ALT")}]),e.OR2([{ALT:r(()=>{let k=e.CONSUME(a);l.push(k),e.CONSUME(h);let C=le(k),L=i.types[C];if(typeof L=="function")L.call(null,e,k);else if(Array.isArray(L)){let _=e.CONSUME3(E),N=le(_);L.includes(N)||e.addMissingError(_,`Invalid value "${N}". Must be one of: ${L.map(O=>`"${O}"`).join(", ")}`)}else e.OR4({DEF:[{GATE:r(()=>L==="boolean","GATE"),ALT:r(()=>e.SUBRULE(e.booleanValue),"ALT")},{GATE:r(()=>L==="number","GATE"),ALT:r(()=>e.SUBRULE(e.numberValue),"ALT")},{GATE:r(()=>L==="string","GATE"),ALT:r(()=>e.CONSUME1(E),"ALT")},{GATE:r(()=>L==="object","GATE"),ALT:r(()=>e.SUBRULE1(e.objectWithAttributes,{ARGS:[i]}),"ALT")},{GATE:r(()=>!L,"GATE"),ALT:r(()=>e.SUBRULE(e.expressionFn,{ARGS:[k,i]}),"ALT")}],ERR_MSG:L?`${L} for attribute ${k.image}`:void 0});s=!0},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.mockAttribute),s=!0},"ALT")}])}),e.MANY2(()=>e.CONSUME3(m)),e.CONSUME(A)})},"ALT")},{GATE:r(()=>o.length>0,"GATE"),ALT:r(()=>{e.CONSUME1(S),e.MANY4(()=>{e.OR3([{GATE:r(()=>!s,"GATE"),ALT:r(()=>e.MANY5(()=>e.CONSUME4(m)),"ALT")},{GATE:r(()=>s,"GATE"),ALT:r(()=>e.AT_LEAST_ONE1(()=>e.CONSUME5(m)),"ALT")}]),e.OR5([{ALT:r(()=>{let k=e.CONSUME1(a);l.push(k),e.CONSUME1(h);let C=le(k),L=i.types[C];if(typeof L=="function")L.call(null,e,k);else if(Array.isArray(L)){let _=e.CONSUME3(E),N=le(_);L.includes(N)||e.addMissingError(_,`Invalid value "${N}". Must be one of: ${L.map(O=>`"${O}"`).join(", ")}`)}else e.OR6({DEF:[{GATE:r(()=>L==="boolean","GATE"),ALT:r(()=>e.SUBRULE2(e.booleanValue),"ALT")},{GATE:r(()=>L==="number","GATE"),ALT:r(()=>e.SUBRULE2(e.numberValue),"ALT")},{GATE:r(()=>L==="string","GATE"),ALT:r(()=>e.CONSUME2(E),"ALT")},{GATE:r(()=>L==="object","GATE"),ALT:r(()=>e.SUBRULE2(e.objectWithAttributes,{ARGS:[i]}),"ALT")},{GATE:r(()=>!L,"GATE"),ALT:r(()=>e.SUBRULE2(e.expressionFn,{ARGS:[k,i]}),"ALT")}],ERR_MSG:L?`${L} for attribute ${k.image}`:void 0});s=!0},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{e.SUBRULE2(e.mockAttribute),c=!0,s=!0},"ALT")}])}),e.MANY6(()=>e.CONSUME6(m)),e.CONSUME1(A)},"ALT")}]});let f=l.filter((k,C)=>!i.allowDuplicates.includes(k.image)&&l.findIndex(L=>L.image===k.image)!==C);for(let k of f)e.addDuplicateAttributeError(k);let d=l.filter(k=>!p.includes(k.image));for(let k of d)e.addIllegalAttributeError(k);let T=l.map(k=>k.image),g=o.filter(k=>!T.includes(k));g.length>0&&e.addMissingAttributeError(t,g),e.sectionStack.pop()}}r(CL,"functionAttrReq");function OL(e){return()=>{e.CONSUME(pr),e.OR([{ALT:r(()=>{e.CONSUME(U),e.OR1([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>{e.CONSUME(re),e.CONSUME(E),e.CONSUME(oe)},"ALT")}])},"ALT")},{ALT:r(()=>{e.CONSUME2(re),e.CONSUME2(E),e.CONSUME2(oe)},"ALT")}]),e.SUBRULE(e.chainedIdentifier)}}r(OL,"longFormVariable");function NL(e){return()=>{e.sectionStack.push("minimalFnBody"),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")}])}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(NL,"minimalFnBody");function bL(e){return()=>{e.sectionStack.push("mockAttribute");let t=e.CONSUME(zp);e.CONSUME(h),e.SUBRULE(e.schemaParseObjectFn,{ARGS:[t,{"![string]":"[expression]"}]}),e.MANY(()=>e.CONSUME(m)),e.sectionStack.pop()}}r(bL,"mockAttribute");function ML(e){return(t={})=>{e.SUBRULE(e.filterFn,{ARGS:[t]}),e.MANY({GATE:r(()=>e.LA(1).tokenType===Me||e.LA(1).tokenType===m&&e.LA(2).tokenType===Me,"GATE"),DEF:r(()=>{e.SUBRULE1(e.filterFn,{ARGS:[t]})},"DEF")})}}r(ML,"multilineFilterFn");function yL(e){return()=>{e.OR([{ALT:r(()=>{e.CONSUME(X,{ERR_MSG:"Integer literal expected"})},"ALT")},{ALT:r(()=>{e.CONSUME(_e,{ERR_MSG:"Float literal expected"})},"ALT")}],{ERR_MSG:"Number literal expected"})}}r(yL,"numberValue");function FL(e){return(t={})=>{let o=[],n=e.CONSUME(S);e.MANY(()=>e.CONSUME(m)),e.MANY_SEP({SEP:m,DEF:r(()=>{let i=!1,s=!1;e.MANY1(()=>{i&&!s&&e.addMissingError(n,"Expected a separator between attributes"),e.OPTION1({GATE:r(()=>t.allowDisabledKeys===!0,"GATE"),DEF:r(()=>e.CONSUME(Ne),"DEF")});let c=e.OR1([{ALT:r(()=>e.CONSUME2(a),"ALT")},{ALT:r(()=>e.CONSUME2(E),"ALT")}]),l=le(c);o.includes(l)?e.addDuplicateAttributeError(c):o.push(l),e.CONSUME(be),e.SUBRULE(e.expressionFn,{ARGS:[c,t]}),e.OPTION(()=>{e.CONSUME(je),s=!0}),i=!0})},"DEF")}),e.MANY3(()=>e.CONSUME3(m)),e.CONSUME(A)}}r(FL,"objectWithAttributes");function _L(e){return()=>{e.sectionStack.push("optionalCommentBlockFn"),e.MANY(()=>{e.CONSUME($),e.CONSUME(m)}),e.sectionStack.pop()}}r(_L,"optionalCommentBlockFn");function IL(e){return()=>{e.sectionStack.push("commentBlockFn"),e.AT_LEAST_ONE(()=>{e.CONSUME($),e.CONSUME(m)}),e.sectionStack.pop()}}r(IL,"commentBlockFn");function vL(e){return()=>{e.AT_LEAST_ONE(()=>{e.CONSUME(Me),e.CONSUME(a),e.MANY1(()=>{e.CONSUME(be),e.SUBRULE(e.expressionFn)})})}}r(vL,"pipedFilter");function wL(e){return()=>{e.sectionStack.push("requiredValueFnBody");let t=!1;e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>{t=!0,e.SUBRULE(e.valueFieldAttribute)},"ALT")},{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.disabledFieldAttribute),"ALT")}])}),t||e.SUBRULE(e.valueFieldAttribute),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(wL,"requiredValueFnBody");function BL(e){return()=>{e.CONSUME(V),e.SUBRULE(e.chainedIdentifier)}}r(BL,"shortFormVariable");var PL=r(e=>()=>{let t=!0,o=e.CONSUME(re);e.MANY(()=>e.CONSUME(m)),e.MANY1(()=>{t||e.addMissingError(o,"Missing comma or newline between string values in the array"),o=e.CONSUME(E),t=!1,e.OPTION(()=>{e.CONSUME(je),t=!0}),e.MANY2(()=>{e.CONSUME1(m),t=!0})}),e.CONSUME(oe)},"stringArray");function GL(e){return()=>{e.CONSUME(yp),e.CONSUME(h),e.SUBRULE(e.stringArray)}}r(GL,"tagsAttribute");function DL(e){return Object.hasOwn(e,"emptyArray")||(e.emptyArray=e.RULE("emptyArray",()=>{e.CONSUME(re),e.CONSUME(oe)})),()=>{e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(Lt),"ALT")},{ALT:r(()=>e.CONSUME(_e),"ALT")},{ALT:r(()=>e.CONSUME(X),"ALT")},{ALT:r(()=>e.CONSUME(Ue),"ALT")},{ALT:r(()=>e.CONSUME(ke),"ALT")},{ALT:r(()=>e.CONSUME(Or),"ALT")},{ALT:r(()=>e.CONSUME(xt),"ALT")},{ALT:r(()=>e.SUBRULE(e.longFormVariable),"ALT")},{ALT:r(()=>e.SUBRULE(e.completeAuthVariable),"ALT")},{ALT:r(()=>e.SUBRULE(e.completeEnvVariable),"ALT")},{ALT:r(()=>e.SUBRULE(e.completeInputVariable),"ALT")},{ALT:r(()=>e.SUBRULE(e.shortFormVariable),"ALT")},{ALT:r(()=>e.SUBRULE(e.castedValue),"ALT")},{ALT:r(()=>e.SUBRULE(e.emptyArray),"ALT")}]),e.OPTION(()=>{e.SUBRULE(e.pipedFilter)})}}r(DL,"valueExpressionForResponse");function VL(e){return()=>{e.OR([{ALT:r(()=>e.SUBRULE(e.longFormVariable),"ALT")},{ALT:r(()=>e.SUBRULE(e.shortFormVariable),"ALT")}]),e.OPTION(()=>e.SUBRULE(e.pipedFilter))}}r(VL,"variableOnly");var qL=r(e=>{e.mockAttribute=e.RULE("mockAttribute",bL(e)),e.arrayWithValues=e.RULE("arrayWithValues",cL(e)),e.assignableVariableAs=e.RULE("assignableVariableAs",lL(e)),e.assignableVariableProperty=e.RULE("assignableVariableProperty",XR(e)),e.booleanValue=e.RULE("booleanValue",pL(e)),e.castedValue=e.RULE("castedValue",dL(e)),e.chainedIdentifier=e.RULE("chainedIdentifier",TL(e)),e.singleChainedIdentifier=e.RULE("singleChainedIdentifier",EL(e)),e.enumValue=e.RULE("enumValue",UL(e)),e.expressionFn=e.RULE("expressionFn",kL(e)),e.simpleExpressionFn=e.RULE("simpleExpressionFn",LL(e)),e.expressionTestFn=e.RULE("expressionTestFn",RL(e)),e.functionAttrReq=e.RULE("functionAttrReq",CL(e)),e.filterFn=e.RULE("filterFn",xL(e)),e.multilineFilterFn=e.RULE("multilineFilterFn",ML(e)),e.longFormVariable=e.RULE("longFormVariable",OL(e)),e.minimalFnBody=e.RULE("minimalFnBody",NL(e)),e.numberValue=e.RULE("numberValue",yL(e)),e.objectWithAttributes=e.RULE("objectWithAttributes",FL(e)),e.pipedFilter=e.RULE("pipedFilter",vL(e)),e.requiredValueFnBody=e.RULE("requiredValueFnBody",wL(e)),e.shortFormVariable=e.RULE("shortFormVariable",BL(e)),e.stringArray=e.RULE("stringArray",PL(e)),e.tagsAttribute=e.RULE("tagsAttribute",GL(e)),e.expressionFnForResponse=e.RULE("valueExpressionForResponse",DL(e)),e.variableOnly=e.RULE("variableOnly",VL(e)),e.completeAuthVariable=e.RULE("completeAuthVariable",hL(e)),e.bracketAccessor=e.RULE("bracketAccessor",mL(e)),e.bracketArrayAccessor=e.RULE("bracketArrayAccessor",fL(e)),e.completeInputVariable=e.RULE("completeInputVariable",gL(e)),e.completeErrorVariable=e.RULE("completeErrorVariable",AL(e)),e.completeEnvVariable=e.RULE("completeEnvVariable",SL(e)),e.asVariable=e.RULE("asVariable",uL(e)),e.optionalCommentBlockFn=e.RULE("optionalCommentBlockFn",_L(e)),e.commentBlockFn=e.RULE("commentBlockFn",IL(e))},"register");function jL(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1;e.sectionStack.push("mcpServerDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let f=e.CONSUME(kl);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.commentBlockFn),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.CONSUME(gl),e.CONSUME(h),e.SUBRULE(e.booleanValue)},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.SUBRULE(e.canonicalClause)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.docsFieldAttribute)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE1(e.flexibleStringClause,{ARGS:[Ul]})},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.SUBRULE(e.tagsAttribute)},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0;let d=e.CONSUME(Rl);e.CONSUME2(h),e.SUBRULE(e.schemaParseArrayFn,{ARGS:[d,[{name:"[string]","active?":"[boolean]","auth?":"[string]"}]]})},"ALT")}])}),p||e.addMissingError(f,"{} is missing tools clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(jL,"mcpServerDeclaration");function WL(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1,f=!1;e.sectionStack.push("mcpServerTriggerDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let d=e.CONSUME(Cl);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.commentBlockFn),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0;let T=e.CONSUME(Ll);e.CONSUME(h),e.SUBRULE(e.schemaParseObjectFn,{ARGS:[T,{connection:"[boolean]"}]})},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.CONSUME(xl),e.CONSUME2(h),e.SUBRULE(e.booleanValue)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.inputClause)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.mcpServerClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.SUBRULE(e.responseClause)},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.stackClause)},"ALT")},{GATE:r(()=>!f,"GATE"),ALT:r(()=>{f=!0,e.SUBRULE(e.tagsAttribute)},"ALT")}])}),c||e.addMissingError(d,"{} is missing mcp_server clause"),s||e.addMissingError(d,"{} is missing an input clause"),p||e.addMissingError(d,"{} is missing a stack clause"),l||e.addMissingError(d,"{} is missing a response clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(WL,"mcpServerTriggerDeclaration");function YL(e){return()=>{e.sectionStack.push("columnMetadataDefinition"),e.CONSUME(S),e.AT_LEAST_ONE(()=>{e.CONSUME(m),e.OR([{ALT:r(()=>e.SUBRULE(e.sensitiveFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>{e.CONSUME(lr),e.CONSUME(h),e.CONSUME(E)},"ALT")}])}),e.AT_LEAST_ONE1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(YL,"columnMetadataDefinition");function KL(e){return t=>{e.sectionStack.push("enumColumnMetadataDefinition"),e.CONSUME(S);let o=!1,n=!1,i=!1;e.MANY(()=>{e.AT_LEAST_ONE1(()=>e.CONSUME1(m)),e.OR([{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.SUBRULE(e.valuesFieldAttribute)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>e.SUBRULE(e.sensitiveFieldAttribute),"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")}])}),o||e.addMissingError(t,"{} is missing the values attribute"),e.AT_LEAST_ONE2(()=>e.CONSUME2(m)),e.CONSUME(A),e.sectionStack.pop()}}r(KL,"enumColumnMetadataDefinition");function HL(e){return()=>{e.sectionStack.push("objectColumnMetadataDefinition"),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR([{ALT:r(()=>e.SUBRULE(e.sensitiveFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{ALT:r(()=>e.SUBRULE(e.schemaClause,{ARGS:[{include_file:!1}]}),"ALT")}])}),e.AT_LEAST_ONE1(()=>e.CONSUME1(m)),e.CONSUME(A),e.sectionStack.pop()}}r(HL,"objectColumnMetadataDefinition");function zL(e){e.columnMetadataDefinition=e.RULE("columnMetadataDefinition",YL(e)),e.enumColumnMetadataDefinition=e.RULE("enumColumnMetadataDefinition",KL(e)),e.objectColumnMetadataDefinition=e.RULE("objectColumnMetadataDefinition",HL(e))}r(zL,"register");function JL(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1,f=!1,d=[];e.sectionStack.push("middlewareDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let T=e.CONSUME($o);e.OR([{ALT:r(()=>e.CONSUME(a),"ALT")},{ALT:r(()=>e.CONSUME(E),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.commentBlockFn),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.SUBRULE(e.docsFieldAttribute)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.CONSUME(Ol),e.CONSUME(h),e.SUBRULE(e.enumValue,{ARGS:["silent","rethrow","critical"]})},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.inputClause)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.responseClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.CONSUME(Nl),e.CONSUME2(h),e.SUBRULE2(e.enumValue,{ARGS:["merge","replace"]})},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.stackClause)},"ALT")},{GATE:r(()=>!f,"GATE"),ALT:r(()=>{f=!0,e.SUBRULE(e.tagsAttribute)},"ALT")},{ALT:r(()=>{e.SUBRULE(e.testClause,{ARGS:[d]})},"ALT")}])}),s||e.addMissingError(T,"{} is missing an input clause"),p||e.addMissingError(T,"{} is missing a stack clause"),c||e.addMissingError(T,"{} is missing a response clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(JL,"middlewareDeclaration");function XL(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1,f=!1,d=!1,T=!1,g=!1,k=[];e.sectionStack.push("queryDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let C=e.CONSUME(Il);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(en),e.CONSUME(h),e.OR1([{ALT:r(()=>e.CONSUME(an),"ALT")},{ALT:r(()=>e.CONSUME(tn),"ALT")},{ALT:r(()=>e.CONSUME(rn),"ALT")},{ALT:r(()=>e.CONSUME(on),"ALT")},{ALT:r(()=>e.CONSUME(nn),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.CONSUME($),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.CONSUME(pn),e.CONSUME1(h),e.CONSUME1(E)},"ALT")},{GATE:r(()=>!g,"GATE"),ALT:r(()=>{g=!0,e.CONSUME(vl),e.CONSUME8(h);let L=e.CONSUME2(E),_=le(L);["stream","standard"].includes(_)||e.addInvalidValueError(L,"response_type must be either 'stream' or 'standard'")},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.SUBRULE(e.cacheClause)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!T,"GATE"),ALT:r(()=>{T=!0,e.CONSUME(Lo),e.CONSUME2(h),e.CONSUME3(E)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.docsFieldAttribute)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.inputClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.SUBRULE(e.middlewareClause)},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.responseClause)},"ALT")},{GATE:r(()=>!f,"GATE"),ALT:r(()=>{f=!0,e.SUBRULE(e.stackClause)},"ALT")},{GATE:r(()=>!d,"GATE"),ALT:r(()=>{d=!0,e.SUBRULE(e.tagsAttribute)},"ALT")},{ALT:r(()=>{e.SUBRULE(e.testClause,{ARGS:[k]})},"ALT")}])}),T||e.addWarning("api_group is not provided, defaulting to api_group.xs defined in the same folder",C),c||e.addMissingError(C,"{} is missing an input clause"),f||e.addMissingError(C,"{} is missing a stack clause"),p||e.addMissingError(C,"{} is missing a response clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(XL,"queryDeclaration");function QL(e){return()=>{e.sectionStack.push("realtimeChannelDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let t=e.CONSUME(Dl);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"description?":"[string]","active?":"[boolean]","public_messaging?":{"active?":"[boolean]","auth?":"[boolean]"},"private_messaging?":{"active?":"[boolean]","auth?":"[boolean]"},"settings?":{anonymous_clients:"[boolean]",nested_channels:"[boolean]",message_history:[0,25,50,100,250,1e3],auth_channel:"[boolean]",presence:"[boolean]"}}]}),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(QL,"realtimeChannelDeclaration");function ZL(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1,f=!1;e.sectionStack.push("realtimeTriggerDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let d=e.CONSUME(Gl);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.commentBlockFn),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0;let T=e.CONSUME(Bl);e.CONSUME(h),e.SUBRULE(e.schemaParseObjectFn,{ARGS:[T,{"join?":"[boolean]","message?":"[boolean]"}]})},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.CONSUME(Pl),e.CONSUME2(h),e.SUBRULE(e.booleanValue)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.channelClause)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.inputClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.SUBRULE(e.responseClause)},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.stackClause)},"ALT")},{GATE:r(()=>!f,"GATE"),ALT:r(()=>{f=!0,e.SUBRULE(e.tagsAttribute)},"ALT")}])}),n||e.addMissingError(d,"{} is missing channel clause"),c||e.addMissingError(d,"{} is missing an input clause"),p||e.addMissingError(d,"{} is missing a stack clause"),l||e.addMissingError(d,"{} is missing a response clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(ZL,"realtimeTriggerDeclaration");function $L(e){return()=>{e.sectionStack.push("runDeclaration"),e.SUBRULE(e.optionalCommentBlockFn),e.CONSUME(ou),e.CONSUME(U),e.OR([{ALT:r(()=>e.SUBRULE(e.runJobClause),"ALT")},{ALT:r(()=>e.SUBRULE(e.runServiceClause),"ALT")}]),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r($L,"runDeclaration");function ex(e){return()=>{let t=e.CONSUME(nu);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{main:{name:"[string]",input:{"[string]?":"[constant]"}},"env?":["[string]"]}]})}}r(ex,"runJobClause");function tx(e){return()=>{let t=e.CONSUME(au);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"pre?":{name:"[string]",input:{"[string]?":"[constant]"}},"env?":["[string]"]}]})}}r(tx,"runServiceClause");function rx(e){return()=>{e.sectionStack.push("tableDeclaration"),e.SUBRULE(e.optionalCommentBlockFn),e.CONSUME(lr),e.OR1([{ALT:r(()=>e.CONSUME(E,{ERR_MSG:"expected table name after table statement"}),"ALT")},{ALT:r(()=>e.CONSUME(a,{ERR_MSG:"expected table name after table statement"}),"ALT")}]);let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1,f={};e.CONSUME(S),e.sectionStack.push("tableBody"),e.MANY(()=>e.CONSUME(m)),e.MANY1(()=>{e.OR([{ALT:r(()=>e.CONSUME($),"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>e.SUBRULE(e.descriptionFieldAttribute),"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>e.SUBRULE(e.tagsAttribute),"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>e.SUBRULE(e.authClause),"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>e.SUBRULE(e.viewClause),"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0;let d=e.CONSUME(wu);e.CONSUME(h),e.SUBRULE(e.schemaParseArrayFn,{ARGS:[d,[{"[string]":"[expression]"}]]})},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0;let d=e.CONSUME(vu);e.CONSUME1(h),e.SUBRULE1(e.schemaParseArrayFn,{ARGS:[d,[{"[string]":"[string]"}]]})},"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>e.SUBRULE(e.schemaClause,{ARGS:[{isTableSchema:!0},f]}),"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>e.SUBRULE(e.indexClause),"ALT")}]),e.AT_LEAST_ONE1(()=>e.CONSUME1(m))}),e.sectionStack.pop(),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(rx,"tableDeclaration");function ox(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1,f=!1;e.sectionStack.push("tableTriggerDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let d=e.CONSUME(Du);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.commentBlockFn),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0;let T=e.CONSUME(Bu);e.CONSUME(h),e.SUBRULE(e.schemaParseObjectFn,{ARGS:[T,{"delete?":"[boolean]","insert?":"[boolean]","truncate?":"[boolean]","update?":"[boolean]"}]})},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.CONSUME(Pu),e.CONSUME2(h),e.SUBRULE(e.booleanValue)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0;let T=e.CONSUME(Gu);e.CONSUME3(h),e.SUBRULE(e.schemaFn,{ARGS:[T,["[string]"]]})},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.dbTableClause)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.SUBRULE(e.inputClause)},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.stackClause)},"ALT")},{GATE:r(()=>!f,"GATE"),ALT:r(()=>{f=!0,e.SUBRULE(e.tagsAttribute)},"ALT")}])}),i||e.addMissingError(d,"{} is missing table clause"),l||e.addMissingError(d,"{} is missing an input clause"),p||e.addMissingError(d,"{} is missing a stack clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(ox,"tableTriggerDeclaration");function nx(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1,f=!1,d=[];e.sectionStack.push("taskDeclaration"),e.SUBRULE(e.optionalCommentBlockFn),e.CONSUME(sn),e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.commentBlockFn),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.CONSUME(Ro),e.CONSUME(h),e.SUBRULE(e.booleanValue)},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.CONSUME(qu),e.CONSUME2(h),e.CONSUME2(E)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.docsFieldAttribute)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.middlewareClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.SUBRULE(e.scheduleClause)},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.stackClause)},"ALT")},{GATE:r(()=>!f,"GATE"),ALT:r(()=>{f=!0,e.SUBRULE(e.tagsAttribute)},"ALT")},{ALT:r(()=>{e.SUBRULE(e.testClause,{ARGS:[d]})},"ALT")}])}),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(nx,"taskDeclaration");function ax(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1,p=!1,f=!1;e.sectionStack.push("toolDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let d=e.CONSUME(cr);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.commentBlockFn),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.SUBRULE(e.docsFieldAttribute)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.inputClause)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.flexibleStringClause,{ARGS:[Al]})},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.middlewareClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.SUBRULE(e.responseClause)},"ALT")},{GATE:r(()=>!p,"GATE"),ALT:r(()=>{p=!0,e.SUBRULE(e.stackClause,{ARGS:[{allowCallStatements:!0}]})},"ALT")},{GATE:r(()=>!f,"GATE"),ALT:r(()=>{f=!0,e.SUBRULE(e.tagsAttribute)},"ALT")}])}),i||e.addMissingError(d,"{} is missing an input clause"),p||e.addMissingError(d,"{} is missing a stack clause"),l||e.addMissingError(d,"{} is missing a response clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(ax,"toolDeclaration");function ix(e){return()=>{let t=!1,o=!1,n=!1,i=!1;e.sectionStack.push("workflowTestDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let s=e.CONSUME(gp);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.commentBlockFn),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0,e.CONSUME(cn),e.CONSUME(h),e.CONSUME2(E)},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.stackClause,{ARGS:[{allowExpectStatements:!0,allowCallStatements:!0}]})},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.tagsAttribute)},"ALT")}])}),n||e.addMissingError(s,"{} is missing a stack clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(ix,"workflowTestDeclaration");function sx(e){return()=>{e.sectionStack.push("workspaceDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let t=e.CONSUME(Up);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.SUBRULE(e.schemaParseAttributeFn,{ARGS:[t,{"env?":{"[string]":"[string]"},"acceptance?":{"ai_terms?":"[boolean]"},"description?":"[string]","preferences?":{"internal_docs?":"[boolean]","sql_columns?":"[boolean]","sql_names?":"[boolean]","track_performance?":"[boolean]"},"realtime?":{"canonical?":"[string]"}}]}),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(sx,"workspaceDeclaration");function cx(e){return()=>{let t=!1,o=!1,n=!1,i=!1,s=!1,c=!1,l=!1;e.sectionStack.push("workspaceTriggerDeclaration"),e.SUBRULE(e.optionalCommentBlockFn);let p=e.CONSUME(Lp);e.OR([{ALT:r(()=>e.CONSUME(E),"ALT")},{ALT:r(()=>e.CONSUME(a),"ALT")}]),e.CONSUME(S),e.MANY(()=>{e.AT_LEAST_ONE(()=>e.CONSUME(m)),e.OR2([{ALT:r(()=>e.SUBRULE(e.commentBlockFn),"ALT")},{GATE:r(()=>!t,"GATE"),ALT:r(()=>{t=!0;let f=e.CONSUME(kp);e.CONSUME(h),e.SUBRULE(e.schemaParseObjectFn,{ARGS:[f,{"branch_live?":"[boolean]","branch_merge?":"[boolean]","branch_new?":"[boolean]"}]})},"ALT")},{GATE:r(()=>!o,"GATE"),ALT:r(()=>{o=!0,e.CONSUME(Rp),e.CONSUME2(h),e.SUBRULE(e.booleanValue)},"ALT")},{GATE:r(()=>!n,"GATE"),ALT:r(()=>{n=!0,e.SUBRULE(e.descriptionFieldAttribute)},"ALT")},{GATE:r(()=>!i,"GATE"),ALT:r(()=>{i=!0,e.SUBRULE(e.historyClause)},"ALT")},{GATE:r(()=>!s,"GATE"),ALT:r(()=>{s=!0,e.SUBRULE(e.inputClause)},"ALT")},{GATE:r(()=>!c,"GATE"),ALT:r(()=>{c=!0,e.SUBRULE(e.stackClause)},"ALT")},{GATE:r(()=>!l,"GATE"),ALT:r(()=>{l=!0,e.SUBRULE(e.tagsAttribute)},"ALT")}])}),s||e.addMissingError(p,"{} is missing an input clause"),c||e.addMissingError(p,"{} is missing a stack clause"),e.MANY1(()=>e.CONSUME1(m)),e.CONSUME(A),e.MANY2(()=>e.CONSUME2(m)),e.sectionStack.pop()}}r(cx,"workspaceTriggerDeclaration");var lx=r(e=>{qL(e),ig(e),yA(e),sL(e),zL(e),$A(e),e.addonDeclaration=e.RULE("addonDeclaration",hA(e)),e.agentDeclaration=e.RULE("agentDeclaration",SA(e)),e.agentTriggerDeclaration=e.RULE("agentTriggerDeclaration",AA(e)),e.queryDeclaration=e.RULE("queryDeclaration",XL(e)),e.apiGroupDeclaration=e.RULE("apiGroupDeclaration",gA(e)),e.branchDeclaration=e.RULE("branchDeclaration",FA(e)),e.tableDeclaration=e.RULE("tableDeclaration",rx(e)),e.mcpServerDeclaration=e.RULE("mcpServerDeclaration",jL(e)),e.mcpServerTriggerDeclaration=e.RULE("mcpServerTriggerDeclaration",WL(e)),e.middlewareDeclaration=e.RULE("middlewareDeclaration",JL(e)),e.realtimeTriggerDeclaration=e.RULE("realtimeTriggerDeclaration",ZL(e)),e.realtimeChannelDeclaration=e.RULE("realtimeChannelDeclaration",QL(e)),e.runDeclaration=e.RULE("runDeclaration",$L(e)),e.runJobClause=e.RULE("runJobClause",ex(e)),e.runServiceClause=e.RULE("runServiceClause",tx(e)),e.tableTriggerDeclaration=e.RULE("tableTriggerDeclaration",ox(e)),e.taskDeclaration=e.RULE("taskDeclaration",nx(e)),e.toolDeclaration=e.RULE("toolDeclaration",ax(e)),e.workflowTestDeclaration=e.RULE("workflowTestDeclaration",ix(e)),e.workspaceDeclaration=e.RULE("workspaceDeclaration",sx(e)),e.workspaceTriggerDeclaration=e.RULE("workspaceTriggerDeclaration",cx(e)),e.functionDeclaration=e.RULE("functionDeclaration",sg(e))},"register");var gI={buildMismatchTokenMessage:Bt.buildMismatchTokenMessage,buildEarlyExitMessage:Bt.buildEarlyExitMessage,buildNotAllInputParsedMessage:Bt.buildNotAllInputParsedMessage,buildNoViableAltMessage:Bt.buildNoViableAltMessage},em=class extends jn{static{r(this,"XanoBaseParser")}constructor(t){super(t,{errorMessageProvider:gI,recoveryEnabled:!1}),lx(this),this.sectionStack=[],this.warnings=[],this.reset()}functionAttrReq(){}addVariable(t,o,n=null){this.__symbolTable.var[t]={type:o,value:n}}addInput(t,o,n=!1,i=!1,s=!1){this.__symbolTable.input[t]={type:o,iterable:n,nullable:i,optional:s}}addWarning(t,o){o=o||this.LA(0),this.warnings.push({message:t,token:o})}addInformation(t,o){o=o||this.LA(0),this.informations.push({message:t,token:o})}addHint(t,o){o=o||this.LA(0),this.hints.push({message:t,token:o})}addMissingError(t,o){t=t||this.LA(0),this.SAVE_ERROR(new me(o.replaceAll("{}",t.image),t))}addMissingAttributeError(t,o){t=t||this.LA(0),o=[].concat(o);let n=o.join(", "),i=o.length===1?`${t.image} is missing the ${n} attribute`:`${t.image} is missing the following attributes: ${n}`;this.SAVE_ERROR(new me(i,t))}addIllegalAttributeError(t,o){t=t||this.LA(0),o||(o=`Attribute \`${t.image}\` is not allowed`),this.SAVE_ERROR(new me(o,t))}addExpectedValueTypeError(t,o){t=t||this.LA(0),this.SAVE_ERROR(new me(`Expected value of \`${t.image}\` to be of type \`${o}\``,t))}addExpectedValueError(t,o){t=t||this.LA(0),b(o)&&o.length>1?this.SAVE_ERROR(new me(`Expected value of \`${t.image}\` to be one of ${o.map(n=>`\`${n}\``).join(", ")}`,t)):this.SAVE_ERROR(new me(`Expected value of \`${t.image}\` to be \`${o}\``,t))}addDuplicateAttributeError(t){t=t||this.LA(0),this.SAVE_ERROR(new me(`Duplicate attribute \`${t.image}\``,t))}addDuplicateNameError(t,o){t=t||this.LA(0),o?this.SAVE_ERROR(new me(`Duplicate ${o} name '${t.image}'`,t)):this.SAVE_ERROR(new me(`Duplicate name '${t.image}'`,t))}addInvalidValueError(t,o){t=t||this.LA(0),this.SAVE_ERROR(new me(o,t))}requireRules(...t){for(let o of t){if(typeof o!="function")throw new Error(`requireRules only accepts functions, ${typeof o} given`);Object.hasOwn(this,o.name)||(this[o.name]=this.RULE(o.name,o(this)))}}reset(){super.reset(),this.sectionStack=[],this.warnings=[],this.informations=[],this.hints=[],this.__symbolTable={input:{},var:{},auth:{},env:{}}}};function ux(e,t,o=null){t||(t=Qp(e));let n=o||EA(e);switch(G.input=n.tokens,t.toLowerCase()){case"addon":return G.addonDeclaration(),G;case"agent":return G.agentDeclaration(),G;case"agent_trigger":return G.agentTriggerDeclaration(),G;case"api":return G.queryDeclaration(),G;case"api_group":return G.apiGroupDeclaration(),G;case"branch":return G.branchDeclaration(),G;case"db":return G.tableDeclaration(),G;case"mcp_server":return G.mcpServerDeclaration(),G;case"mcp_server_trigger":return G.mcpServerTriggerDeclaration(),G;case"middleware":return G.middlewareDeclaration(),G;case"realtime_trigger":return G.realtimeTriggerDeclaration(),G;case"realtime_channel":return G.realtimeChannelDeclaration(),G;case"run":return G.runDeclaration(),G;case"table_trigger":return G.tableTriggerDeclaration(),G;case"task":return G.taskDeclaration(),G;case"tool":return G.toolDeclaration(),G;case"workflow_test":return G.workflowTestDeclaration(),G;case"workspace":return G.workspaceDeclaration(),G;case"workspace_trigger":return G.workspaceTriggerDeclaration(),G;case"cfn":default:return G.functionDeclaration(),G}}r(ux,"xanoscriptParser");var tf=class extends em{static{r(this,"XanoScriptParser")}constructor(){super(mn),this.performSelfAnalysis()}},G=new tf;function px(e,t){let o=Qp(t??e);try{let n=ux(e,o);return n.errors.length===0?[]:n.errors.map(s=>{let c=s.token?.startOffset??0,l=s.token?.endOffset??5,p=e.substring(0,c).split(`
|
|
110
110
|
`),f=p.length-1,d=p[p.length-1].length,T=e.substring(0,l+1).split(`
|
|
111
|
-
`),
|
|
111
|
+
`),g=T.length-1,k=T[T.length-1].length;return{range:{start:{line:f,character:d},end:{line:g,character:k}},message:s.message,source:s.name||"XanoScript Parser"}})}catch(n){console.error("Error checking for XanoScripterrors:",n)}}r(px,"onCheckError");function UI(e,t){return px(e,t)}r(UI,"checkError");window.xsLanguageServer={checkError:UI};})();
|
|
112
112
|
/*! Bundled license information:
|
|
113
113
|
|
|
114
114
|
lodash-es/lodash.js:
|