@guihz/trading-vue-editor-tes 0.0.47 → 0.0.49

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,7 +8,7 @@ var Ug=Object.defineProperty;var Vg=(lo,li,Tr)=>li in lo?Ug(lo,li,{enumerable:!0
8
8
  `+i.toString(E,k))}return S}},{key:"addDFAState",value:function(i,s){if(s===Ai.ERROR)return s;var v=i.states.get(s);return v!==null?(this.trace_atn_sim&&console.log("addDFAState "+s+" exists"),v):(s.stateNumber=i.states.length,s.configs.readOnly||(s.configs.optimizeConfigs(this),s.configs.setReadonly(!0)),this.trace_atn_sim&&console.log("addDFAState new "+s),i.states.add(s),this.debug&&console.log("adding new DFA state: "+s),s)}},{key:"reportAttemptingFullContext",value:function(i,s,v,S,E){if(this.debug||this.retry_debug){var k=new _e(S,E+1);console.log("reportAttemptingFullContext decision="+i.decision+":"+v+", input="+this.parser.getTokenStream().getText(k))}this.parser!==null&&this.parser.getErrorListenerDispatch().reportAttemptingFullContext(this.parser,i,S,E,s,v)}},{key:"reportContextSensitivity",value:function(i,s,v,S,E){if(this.debug||this.retry_debug){var k=new _e(S,E+1);console.log("reportContextSensitivity decision="+i.decision+":"+v+", input="+this.parser.getTokenStream().getText(k))}this.parser!==null&&this.parser.getErrorListenerDispatch().reportContextSensitivity(this.parser,i,S,E,s,v)}},{key:"reportAmbiguity",value:function(i,s,v,S,E,k,ee){if(this.debug||this.retry_debug){var Ce=new _e(v,S+1);console.log("reportAmbiguity "+k+":"+ee+", input="+this.parser.getTokenStream().getText(Ce))}this.parser!==null&&this.parser.getErrorListenerDispatch().reportAmbiguity(this.parser,i,v,S,E,k,ee)}}],p&&ag(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(Ai);function Vs(l){return Vs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Vs(l)}function sg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Vs(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Vs(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Vs(f)==="symbol"?f:String(f)),a)}var f}var vy=function(){function l(){(function(a,f){if(!(a instanceof f))throw new TypeError("Cannot call a class as a function")})(this,l),this.cache=new Xi}var r,p;return r=l,(p=[{key:"add",value:function(a){if(a===it.EMPTY)return it.EMPTY;var f=this.cache.get(a)||null;return f!==null?f:(this.cache.set(a,a),a)}},{key:"get",value:function(a){return this.cache.get(a)||null}},{key:"length",get:function(){return this.cache.length}}])&&sg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),l}();const ug={ATN:dn,ATNDeserializer:oh,LexerATNSimulator:Ba,ParserATNSimulator:by,PredictionMode:Hn,PredictionContextCache:vy};function js(l){return js=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},js(l)}function cg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(js(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(js(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),js(f)==="symbol"?f:String(f)),a)}var f}var Dh=function(){function l(a,f,c){(function(d,i){if(!(d instanceof i))throw new TypeError("Cannot call a class as a function")})(this,l),this.dfa=a,this.literalNames=f||[],this.symbolicNames=c||[]}var r,p;return r=l,(p=[{key:"toString",value:function(){if(this.dfa.s0===null)return null;for(var a="",f=this.dfa.sortedStates(),c=0;c<f.length;c++){var d=f[c];if(d.edges!==null)for(var i=d.edges.length,s=0;s<i;s++){var v=d.edges[s]||null;v!==null&&v.stateNumber!==2147483647&&(a=(a=(a=(a=(a=(a=a.concat(this.getStateString(d))).concat("-")).concat(this.getEdgeLabel(s))).concat("->")).concat(this.getStateString(v))).concat(`
9
9
  `))}}return a.length===0?null:a}},{key:"getEdgeLabel",value:function(a){return a===0?"EOF":this.literalNames!==null||this.symbolicNames!==null?this.literalNames[a-1]||this.symbolicNames[a-1]:String.fromCharCode(a-1)}},{key:"getStateString",value:function(a){var f=(a.isAcceptState?":":"")+"s"+a.stateNumber+(a.requiresFullContext?"^":"");return a.isAcceptState?a.predicates!==null?f+"=>"+$(a.predicates):f+"=>"+a.prediction.toString():f}}])&&cg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),l}();function Va(l){return Va=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Va(l)}function lg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Va(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Va(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Va(f)==="symbol"?f:String(f)),a)}var f}function Ch(l,r){return Ch=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Ch(l,r)}function Ic(l){return Ic=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ic(l)}var Ey=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&Ch(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=Ic(a);if(f){var v=Ic(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(Va(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(i){return function(s,v){if(!(s instanceof v))throw new TypeError("Cannot call a class as a function")}(this,d),c.call(this,i,null)}return r=d,(p=[{key:"getEdgeLabel",value:function(i){return"'"+String.fromCharCode(i)+"'"}}])&&lg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(Dh);function Hs(l){return Hs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Hs(l)}function fg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Hs(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Hs(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Hs(f)==="symbol"?f:String(f)),a)}var f}var Sy=function(){function l(a,f){if(function(d,i){if(!(d instanceof i))throw new TypeError("Cannot call a class as a function")}(this,l),f===void 0&&(f=0),this.atnStartState=a,this.decision=f,this._states=new g,this.s0=null,this.precedenceDfa=!1,a instanceof Mo&&a.isPrecedenceDecision){this.precedenceDfa=!0;var c=new Bo(null,new Ir);c.edges=[],c.isAcceptState=!1,c.requiresFullContext=!1,this.s0=c}}var r,p;return r=l,(p=[{key:"getPrecedenceStartState",value:function(a){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";return a<0||a>=this.s0.edges.length?null:this.s0.edges[a]||null}},{key:"setPrecedenceStartState",value:function(a,f){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";a<0||(this.s0.edges[a]=f)}},{key:"setPrecedenceDfa",value:function(a){if(this.precedenceDfa!==a){if(this._states=new g,a){var f=new Bo(null,new Ir);f.edges=[],f.isAcceptState=!1,f.requiresFullContext=!1,this.s0=f}else this.s0=null;this.precedenceDfa=a}}},{key:"sortedStates",value:function(){return this._states.values().sort(function(a,f){return a.stateNumber-f.stateNumber})}},{key:"toString",value:function(a,f){return a=a||null,f=f||null,this.s0===null?"":new Dh(this,a,f).toString()}},{key:"toLexerString",value:function(){return this.s0===null?"":new Ey(this).toString()}},{key:"states",get:function(){return this._states}}])&&fg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),l}();const hg={DFA:Sy,DFASerializer:Dh,LexerDFASerializer:Ey,PredPrediction:gy},pg={PredictionContext:it},dg={Interval:_e,IntervalSet:ne};function Gs(l){return Gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Gs(l)}function yg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Gs(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Gs(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Gs(f)==="symbol"?f:String(f)),a)}var f}var kh=function(){function l(){(function(a,f){if(!(a instanceof f))throw new TypeError("Cannot call a class as a function")})(this,l)}var r,p;return r=l,(p=[{key:"visitTerminal",value:function(a){}},{key:"visitErrorNode",value:function(a){}},{key:"enterEveryRule",value:function(a){}},{key:"exitEveryRule",value:function(a){}}])&&yg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),l}();function Ks(l){return Ks=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ks(l)}function mg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Ks(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Ks(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ks(f)==="symbol"?f:String(f)),a)}var f}var Ty=function(){function l(){(function(a,f){if(!(a instanceof f))throw new TypeError("Cannot call a class as a function")})(this,l)}var r,p;return r=l,(p=[{key:"visit",value:function(a){return Array.isArray(a)?a.map(function(f){return f.accept(this)},this):a.accept(this)}},{key:"visitChildren",value:function(a){return a.children?this.visit(a.children):null}},{key:"visitTerminal",value:function(a){}},{key:"visitErrorNode",value:function(a){}}])&&mg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),l}();function zs(l){return zs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},zs(l)}function _g(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(zs(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(zs(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),zs(f)==="symbol"?f:String(f)),a)}var f}var Fc=function(){function l(){(function(a,f){if(!(a instanceof f))throw new TypeError("Cannot call a class as a function")})(this,l)}var r,p;return r=l,(p=[{key:"walk",value:function(a,f){if(f instanceof zr||f.isErrorNode!==void 0&&f.isErrorNode())a.visitErrorNode(f);else if(f instanceof on)a.visitTerminal(f);else{this.enterRule(a,f);for(var c=0;c<f.getChildCount();c++){var d=f.getChild(c);this.walk(a,d)}this.exitRule(a,f)}}},{key:"enterRule",value:function(a,f){var c=f.ruleContext;a.enterEveryRule(c),c.enterRule(a)}},{key:"exitRule",value:function(a,f){var c=f.ruleContext;c.exitRule(a),a.exitEveryRule(c)}}])&&_g(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),l}();Fc.DEFAULT=new Fc;const gg={Trees:Hu,RuleNode:Fe,ErrorNode:zr,TerminalNode:on,ParseTreeListener:kh,ParseTreeVisitor:Ty,ParseTreeWalker:Fc};function Rh(l){return Rh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Rh(l)}function wh(l,r){return wh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},wh(l,r)}function Mc(l){return Mc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Mc(l)}var $s=function(l){(function(d,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(i&&i.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),Object.defineProperty(d,"prototype",{writable:!1}),i&&wh(d,i)})(c,l);var r,p,a,f=(p=c,a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var d,i=Mc(p);if(a){var s=Mc(this).constructor;d=Reflect.construct(i,arguments,s)}else d=i.apply(this,arguments);return function(v,S){if(S&&(Rh(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}(v)}(this,d)});function c(d){var i;return function(s,v){if(!(s instanceof v))throw new TypeError("Cannot call a class as a function")}(this,c),(i=f.call(this,{message:"",recognizer:d,input:d.getInputStream(),ctx:d._ctx})).offendingToken=d.getCurrentToken(),i}return r=c,Object.defineProperty(r,"prototype",{writable:!1}),r}(Lo);function Nh(l){return Nh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Nh(l)}function Ph(l,r){return Ph=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Ph(l,r)}function Lc(l){return Lc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Lc(l)}var Ih=function(l){(function(d,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(i&&i.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),Object.defineProperty(d,"prototype",{writable:!1}),i&&Ph(d,i)})(c,l);var r,p,a,f=(p=c,a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var d,i=Lc(p);if(a){var s=Lc(this).constructor;d=Reflect.construct(i,arguments,s)}else d=i.apply(this,arguments);return function(v,S){if(S&&(Nh(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}(v)}(this,d)});function c(d,i,s){var v;(function(E,k){if(!(E instanceof k))throw new TypeError("Cannot call a class as a function")})(this,c),v=f.call(this,{message:bg(i,s||null),recognizer:d,input:d.getInputStream(),ctx:d._ctx});var S=d._interp.atn.states[d.state].transitions[0];return S instanceof Qd?(v.ruleIndex=S.ruleIndex,v.predicateIndex=S.predIndex):(v.ruleIndex=0,v.predicateIndex=0),v.predicate=i,v.offendingToken=d.getCurrentToken(),v}return r=c,Object.defineProperty(r,"prototype",{writable:!1}),r}(Lo);function bg(l,r){return r!==null?r:"failed predicate: {"+l+"}?"}function ja(l){return ja=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ja(l)}function vg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(ja(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(ja(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),ja(f)==="symbol"?f:String(f)),a)}var f}function Fh(l,r){return Fh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Fh(l,r)}function Bc(l){return Bc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Bc(l)}var Ay=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&Fh(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=Bc(a);if(f){var v=Bc(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(ja(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(i){var s;return function(v,S){if(!(v instanceof S))throw new TypeError("Cannot call a class as a function")}(this,d),i=i||!0,(s=c.call(this)).exactOnly=i,s}return r=d,p=[{key:"reportAmbiguity",value:function(i,s,v,S,E,k,ee){if(!this.exactOnly||E){var Ce="reportAmbiguity d="+this.getDecisionDescription(i,s)+": ambigAlts="+this.getConflictingAlts(k,ee)+", input='"+i.getTokenStream().getText(new _e(v,S))+"'";i.notifyErrorListeners(Ce)}}},{key:"reportAttemptingFullContext",value:function(i,s,v,S,E,k){var ee="reportAttemptingFullContext d="+this.getDecisionDescription(i,s)+", input='"+i.getTokenStream().getText(new _e(v,S))+"'";i.notifyErrorListeners(ee)}},{key:"reportContextSensitivity",value:function(i,s,v,S,E,k){var ee="reportContextSensitivity d="+this.getDecisionDescription(i,s)+", input='"+i.getTokenStream().getText(new _e(v,S))+"'";i.notifyErrorListeners(ee)}},{key:"getDecisionDescription",value:function(i,s){var v=s.decision,S=s.atnStartState.ruleIndex,E=i.ruleNames;if(S<0||S>=E.length)return""+v;var k=E[S]||null;return k===null||k.length===0?""+v:"".concat(v," (").concat(k,")")}},{key:"getConflictingAlts",value:function(i,s){if(i!==null)return i;for(var v=new Pr,S=0;S<s.items.length;S++)v.add(s.items[S].alt);return"{".concat(v.values().join(", "),"}")}}],p&&vg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(Cs);function Mh(l){return Mh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Mh(l)}function xy(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}function Lh(l){var r=typeof Map=="function"?new Map:void 0;return Lh=function(p){if(p===null||(a=p,Function.toString.call(a).indexOf("[native code]")===-1))return p;var a;if(typeof p!="function")throw new TypeError("Super expression must either be null or a function");if(r!==void 0){if(r.has(p))return r.get(p);r.set(p,f)}function f(){return Bh(p,arguments,Xs(this).constructor)}return f.prototype=Object.create(p.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),Ws(f,p)},Lh(l)}function Bh(l,r,p){return Bh=Oy()?Reflect.construct.bind():function(a,f,c){var d=[null];d.push.apply(d,f);var i=new(Function.bind.apply(a,d));return c&&Ws(i,c.prototype),i},Bh.apply(null,arguments)}function Oy(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ws(l,r){return Ws=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Ws(l,r)}function Xs(l){return Xs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Xs(l)}var Eg=function(l){(function(d,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(i&&i.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),Object.defineProperty(d,"prototype",{writable:!1}),i&&Ws(d,i)})(c,l);var r,p,a,f=(p=c,a=Oy(),function(){var d,i=Xs(p);if(a){var s=Xs(this).constructor;d=Reflect.construct(i,arguments,s)}else d=i.apply(this,arguments);return function(v,S){if(S&&(Mh(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xy(v)}(this,d)});function c(){var d;return function(i,s){if(!(i instanceof s))throw new TypeError("Cannot call a class as a function")}(this,c),d=f.call(this),Error.captureStackTrace(xy(d),c),d}return r=c,Object.defineProperty(r,"prototype",{writable:!1}),r}(Lh(Error));function qs(l){return qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},qs(l)}function Sg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(qs(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(qs(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),qs(f)==="symbol"?f:String(f)),a)}var f}function Ha(l){return Ha=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ha(l)}function Tg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Ha(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Ha(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ha(f)==="symbol"?f:String(f)),a)}var f}function Uh(l,r){return Uh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Uh(l,r)}function Uc(l){return Uc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Uc(l)}var Vh=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&Uh(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=Uc(a);if(f){var v=Uc(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(Ha(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(){var i;return function(s,v){if(!(s instanceof v))throw new TypeError("Cannot call a class as a function")}(this,d),(i=c.call(this)).errorRecoveryMode=!1,i.lastErrorIndex=-1,i.lastErrorStates=null,i.nextTokensContext=null,i.nextTokenState=0,i}return r=d,p=[{key:"reset",value:function(i){this.endErrorCondition(i)}},{key:"beginErrorCondition",value:function(i){this.errorRecoveryMode=!0}},{key:"inErrorRecoveryMode",value:function(i){return this.errorRecoveryMode}},{key:"endErrorCondition",value:function(i){this.errorRecoveryMode=!1,this.lastErrorStates=null,this.lastErrorIndex=-1}},{key:"reportMatch",value:function(i){this.endErrorCondition(i)}},{key:"reportError",value:function(i,s){this.inErrorRecoveryMode(i)||(this.beginErrorCondition(i),s instanceof Nc?this.reportNoViableAlternative(i,s):s instanceof $s?this.reportInputMismatch(i,s):s instanceof Ih?this.reportFailedPredicate(i,s):(console.log("unknown recognition error type: "+s.constructor.name),console.log(s.stack),i.notifyErrorListeners(s.getOffendingToken(),s.getMessage(),s)))}},{key:"recover",value:function(i,s){this.lastErrorIndex===i.getInputStream().index&&this.lastErrorStates!==null&&this.lastErrorStates.indexOf(i.state)>=0&&i.consume(),this.lastErrorIndex=i._input.index,this.lastErrorStates===null&&(this.lastErrorStates=[]),this.lastErrorStates.push(i.state);var v=this.getErrorRecoverySet(i);this.consumeUntil(i,v)}},{key:"sync",value:function(i){if(!this.inErrorRecoveryMode(i)){var s=i._interp.atn.states[i.state],v=i.getTokenStream().LA(1),S=i.atn.nextTokens(s);if(S.contains(v))return this.nextTokensContext=null,void(this.nextTokenState=me.INVALID_STATE_NUMBER);if(S.contains(n.EPSILON))this.nextTokensContext===null&&(this.nextTokensContext=i._ctx,this.nextTokensState=i._stateNumber);else switch(s.stateType){case me.BLOCK_START:case me.STAR_BLOCK_START:case me.PLUS_BLOCK_START:case me.STAR_LOOP_ENTRY:if(this.singleTokenDeletion(i)!==null)return;throw new $s(i);case me.PLUS_LOOP_BACK:case me.STAR_LOOP_BACK:this.reportUnwantedToken(i);var E=new ne;E.addSet(i.getExpectedTokens());var k=E.addSet(this.getErrorRecoverySet(i));this.consumeUntil(i,k)}}}},{key:"reportNoViableAlternative",value:function(i,s){var v,S=i.getTokenStream();v=S!==null?s.startToken.type===n.EOF?"<EOF>":S.getText(new _e(s.startToken.tokenIndex,s.offendingToken.tokenIndex)):"<unknown input>";var E="no viable alternative at input "+this.escapeWSAndQuote(v);i.notifyErrorListeners(E,s.offendingToken,s)}},{key:"reportInputMismatch",value:function(i,s){var v="mismatched input "+this.getTokenErrorDisplay(s.offendingToken)+" expecting "+s.getExpectedTokens().toString(i.literalNames,i.symbolicNames);i.notifyErrorListeners(v,s.offendingToken,s)}},{key:"reportFailedPredicate",value:function(i,s){var v="rule "+i.ruleNames[i._ctx.ruleIndex]+" "+s.message;i.notifyErrorListeners(v,s.offendingToken,s)}},{key:"reportUnwantedToken",value:function(i){if(!this.inErrorRecoveryMode(i)){this.beginErrorCondition(i);var s=i.getCurrentToken(),v="extraneous input "+this.getTokenErrorDisplay(s)+" expecting "+this.getExpectedTokens(i).toString(i.literalNames,i.symbolicNames);i.notifyErrorListeners(v,s,null)}}},{key:"reportMissingToken",value:function(i){if(!this.inErrorRecoveryMode(i)){this.beginErrorCondition(i);var s=i.getCurrentToken(),v="missing "+this.getExpectedTokens(i).toString(i.literalNames,i.symbolicNames)+" at "+this.getTokenErrorDisplay(s);i.notifyErrorListeners(v,s,null)}}},{key:"recoverInline",value:function(i){var s=this.singleTokenDeletion(i);if(s!==null)return i.consume(),s;if(this.singleTokenInsertion(i))return this.getMissingSymbol(i);throw new $s(i)}},{key:"singleTokenInsertion",value:function(i){var s=i.getTokenStream().LA(1),v=i._interp.atn,S=v.states[i.state].transitions[0].target;return!!v.nextTokens(S,i._ctx).contains(s)&&(this.reportMissingToken(i),!0)}},{key:"singleTokenDeletion",value:function(i){var s=i.getTokenStream().LA(2);if(this.getExpectedTokens(i).contains(s)){this.reportUnwantedToken(i),i.consume();var v=i.getCurrentToken();return this.reportMatch(i),v}return null}},{key:"getMissingSymbol",value:function(i){var s,v=i.getCurrentToken(),S=this.getExpectedTokens(i).first();s=S===n.EOF?"<missing EOF>":"<missing "+i.literalNames[S]+">";var E=v,k=i.getTokenStream().LT(-1);return E.type===n.EOF&&k!==null&&(E=k),i.getTokenFactory().create(E.source,S,s,n.DEFAULT_CHANNEL,-1,-1,E.line,E.column)}},{key:"getExpectedTokens",value:function(i){return i.getExpectedTokens()}},{key:"getTokenErrorDisplay",value:function(i){if(i===null)return"<no token>";var s=i.text;return s===null&&(s=i.type===n.EOF?"<EOF>":"<"+i.type+">"),this.escapeWSAndQuote(s)}},{key:"escapeWSAndQuote",value:function(i){return"'"+(i=(i=(i=i.replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t"))+"'"}},{key:"getErrorRecoverySet",value:function(i){for(var s=i._interp.atn,v=i._ctx,S=new ne;v!==null&&v.invokingState>=0;){var E=s.states[v.invokingState].transitions[0],k=s.nextTokens(E.followState);S.addSet(k),v=v.parentCtx}return S.removeOne(n.EPSILON),S}},{key:"consumeUntil",value:function(i,s){for(var v=i.getTokenStream().LA(1);v!==n.EOF&&!s.contains(v);)i.consume(),v=i.getTokenStream().LA(1)}}],p&&Tg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(function(){function l(){(function(a,f){if(!(a instanceof f))throw new TypeError("Cannot call a class as a function")})(this,l)}var r,p;return r=l,(p=[{key:"reset",value:function(a){}},{key:"recoverInline",value:function(a){}},{key:"recover",value:function(a,f){}},{key:"sync",value:function(a){}},{key:"inErrorRecoveryMode",value:function(a){}},{key:"reportError",value:function(a){}}])&&Sg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),l}());function Ga(l){return Ga=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ga(l)}function Ag(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Ga(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Ga(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ga(f)==="symbol"?f:String(f)),a)}var f}function jh(l,r){return jh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},jh(l,r)}function Vc(l){return Vc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Vc(l)}var Dy=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&jh(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=Vc(a);if(f){var v=Vc(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(Ga(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(){return function(i,s){if(!(i instanceof s))throw new TypeError("Cannot call a class as a function")}(this,d),c.call(this)}return r=d,p=[{key:"recover",value:function(i,s){for(var v=i._ctx;v!==null;)v.exception=s,v=v.parentCtx;throw new Eg(s)}},{key:"recoverInline",value:function(i){this.recover(i,new $s(i))}},{key:"sync",value:function(i){}}],p&&Ag(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(Vh);const xg={RecognitionException:Lo,NoViableAltException:Nc,LexerNoViableAltException:yh,InputMismatchException:$s,FailedPredicateException:Ih,DiagnosticErrorListener:Ay,BailErrorStrategy:Dy,DefaultErrorStrategy:Vh,ErrorListener:Cs};function Ys(l){return Ys=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ys(l)}function Og(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Ys(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Ys(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ys(f)==="symbol"?f:String(f)),a)}var f}var Js=function(){function l(a,f){if(function(s,v){if(!(s instanceof v))throw new TypeError("Cannot call a class as a function")}(this,l),this.name="<empty>",this.strdata=a,this.decodeToUnicodeCodePoints=f||!1,this._index=0,this.data=[],this.decodeToUnicodeCodePoints)for(var c=0;c<this.strdata.length;){var d=this.strdata.codePointAt(c);this.data.push(d),c+=d<=65535?1:2}else{this.data=new Array(this.strdata.length);for(var i=0;i<this.strdata.length;i++)this.data[i]=this.strdata.charCodeAt(i)}this._size=this.data.length}var r,p;return r=l,(p=[{key:"reset",value:function(){this._index=0}},{key:"consume",value:function(){if(this._index>=this._size)throw"cannot consume EOF";this._index+=1}},{key:"LA",value:function(a){if(a===0)return 0;a<0&&(a+=1);var f=this._index+a-1;return f<0||f>=this._size?n.EOF:this.data[f]}},{key:"LT",value:function(a){return this.LA(a)}},{key:"mark",value:function(){return-1}},{key:"release",value:function(a){}},{key:"seek",value:function(a){a<=this._index?this._index=a:this._index=Math.min(a,this._size)}},{key:"getText",value:function(a,f){if(f>=this._size&&(f=this._size-1),a>=this._size)return"";if(this.decodeToUnicodeCodePoints){for(var c="",d=a;d<=f;d++)c+=String.fromCodePoint(this.data[d]);return c}return this.strdata.slice(a,f+1)}},{key:"toString",value:function(){return this.strdata}},{key:"index",get:function(){return this._index}},{key:"size",get:function(){return this._size}}])&&Og(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),l}();function Hh(l){return Hh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Hh(l)}function Gh(l,r){return Gh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Gh(l,r)}function jc(l){return jc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},jc(l)}var Zs=function(l){(function(d,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(i&&i.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),Object.defineProperty(d,"prototype",{writable:!1}),i&&Gh(d,i)})(c,l);var r,p,a,f=(p=c,a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var d,i=jc(p);if(a){var s=jc(this).constructor;d=Reflect.construct(i,arguments,s)}else d=i.apply(this,arguments);return function(v,S){if(S&&(Hh(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}(v)}(this,d)});function c(d,i){return function(s,v){if(!(s instanceof v))throw new TypeError("Cannot call a class as a function")}(this,c),f.call(this,d,i)}return r=c,Object.defineProperty(r,"prototype",{writable:!1}),r}(Js),Cy=Tr(92);function Ka(l){return Ka=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ka(l)}function Dg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Ka(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Ka(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ka(f)==="symbol"?f:String(f)),a)}var f}function Kh(l,r){return Kh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Kh(l,r)}function Hc(l){return Hc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Hc(l)}var ky=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Ry=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&Kh(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=Hc(a);if(f){var v=Hc(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(Ka(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(i,s,v){var S;if(function(k,ee){if(!(k instanceof ee))throw new TypeError("Cannot call a class as a function")}(this,d),!ky)throw new Error("FileStream is only available when running in Node!");var E=Cy.readFileSync(i,s||"utf-8");return(S=c.call(this,E,v)).fileName=i,S}return r=d,p=[{key:"fromPath",value:function(i,s,v){if(!ky)throw new Error("FileStream is only available when running in Node!");Cy.readFile(i,s,function(S,E){var k=null;E!==null&&(k=new Js(E,!0)),v(S,k)})}}],p&&Dg(r,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(Zs);const wy={fromString:function(l){return new Js(l,!0)},fromBlob:function(l,r,p,a){var f=new window.FileReader;f.onload=function(c){var d=new Js(c.target.result,!0);p(d)},f.onerror=a,f.readAsText(l,r)},fromBuffer:function(l,r){return new Js(l.toString(r),!0)},fromPath:function(l,r,p){Ry.fromPath(l,r,p)},fromPathSync:function(l,r){return new Ry(l,r)}},Cg={arrayToString:$,stringToCharArray:function(l){for(var r=new Uint16Array(l.length),p=0;p<l.length;p++)r[p]=l.charCodeAt(p);return r}};function Qs(l){return Qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Qs(l)}function Ny(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Qs(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Qs(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Qs(f)==="symbol"?f:String(f)),a)}var f}function kg(l,r,p){return r&&Ny(l.prototype,r),p&&Ny(l,p),Object.defineProperty(l,"prototype",{writable:!1}),l}function za(l){return za=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},za(l)}function Rg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(za(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(za(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),za(f)==="symbol"?f:String(f)),a)}var f}function zh(l,r){return zh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},zh(l,r)}function Gc(l){return Gc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Gc(l)}var Py=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&zh(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=Gc(a);if(f){var v=Gc(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(za(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(i){var s;return function(v,S){if(!(v instanceof S))throw new TypeError("Cannot call a class as a function")}(this,d),(s=c.call(this)).tokenSource=i,s.tokens=[],s.index=-1,s.fetchedEOF=!1,s}return r=d,(p=[{key:"mark",value:function(){return 0}},{key:"release",value:function(i){}},{key:"reset",value:function(){this.seek(0)}},{key:"seek",value:function(i){this.lazyInit(),this.index=this.adjustSeekIndex(i)}},{key:"size",get:function(){return this.tokens.length}},{key:"get",value:function(i){return this.lazyInit(),this.tokens[i]}},{key:"consume",value:function(){if(!(this.index>=0&&(this.fetchedEOF?this.index<this.tokens.length-1:this.index<this.tokens.length))&&this.LA(1)===n.EOF)throw"cannot consume EOF";this.sync(this.index+1)&&(this.index=this.adjustSeekIndex(this.index+1))}},{key:"sync",value:function(i){var s=i-this.tokens.length+1;return!(s>0)||this.fetch(s)>=s}},{key:"fetch",value:function(i){if(this.fetchedEOF)return 0;for(var s=0;s<i;s++){var v=this.tokenSource.nextToken();if(v.tokenIndex=this.tokens.length,this.tokens.push(v),v.type===n.EOF)return this.fetchedEOF=!0,s+1}return i}},{key:"getTokens",value:function(i,s,v){if(v===void 0&&(v=null),i<0||s<0)return null;this.lazyInit();var S=[];s>=this.tokens.length&&(s=this.tokens.length-1);for(var E=i;E<s;E++){var k=this.tokens[E];if(k.type===n.EOF)break;(v===null||v.contains(k.type))&&S.push(k)}return S}},{key:"LA",value:function(i){return this.LT(i).type}},{key:"LB",value:function(i){return this.index-i<0?null:this.tokens[this.index-i]}},{key:"LT",value:function(i){if(this.lazyInit(),i===0)return null;if(i<0)return this.LB(-i);var s=this.index+i-1;return this.sync(s),s>=this.tokens.length?this.tokens[this.tokens.length-1]:this.tokens[s]}},{key:"adjustSeekIndex",value:function(i){return i}},{key:"lazyInit",value:function(){this.index===-1&&this.setup()}},{key:"setup",value:function(){this.sync(0),this.index=this.adjustSeekIndex(0)}},{key:"setTokenSource",value:function(i){this.tokenSource=i,this.tokens=[],this.index=-1,this.fetchedEOF=!1}},{key:"nextTokenOnChannel",value:function(i,s){if(this.sync(i),i>=this.tokens.length)return-1;for(var v=this.tokens[i];v.channel!==this.channel;){if(v.type===n.EOF)return-1;i+=1,this.sync(i),v=this.tokens[i]}return i}},{key:"previousTokenOnChannel",value:function(i,s){for(;i>=0&&this.tokens[i].channel!==s;)i-=1;return i}},{key:"getHiddenTokensToRight",value:function(i,s){if(s===void 0&&(s=-1),this.lazyInit(),i<0||i>=this.tokens.length)throw i+" not in 0.."+this.tokens.length-1;var v=this.nextTokenOnChannel(i+1,rr.DEFAULT_TOKEN_CHANNEL),S=i+1,E=v===-1?this.tokens.length-1:v;return this.filterForChannel(S,E,s)}},{key:"getHiddenTokensToLeft",value:function(i,s){if(s===void 0&&(s=-1),this.lazyInit(),i<0||i>=this.tokens.length)throw i+" not in 0.."+this.tokens.length-1;var v=this.previousTokenOnChannel(i-1,rr.DEFAULT_TOKEN_CHANNEL);if(v===i-1)return null;var S=v+1,E=i-1;return this.filterForChannel(S,E,s)}},{key:"filterForChannel",value:function(i,s,v){for(var S=[],E=i;E<s+1;E++){var k=this.tokens[E];v===-1?k.channel!==rr.DEFAULT_TOKEN_CHANNEL&&S.push(k):k.channel===v&&S.push(k)}return S.length===0?null:S}},{key:"getSourceName",value:function(){return this.tokenSource.getSourceName()}},{key:"getText",value:function(i){this.lazyInit(),this.fill(),i||(i=new _e(0,this.tokens.length-1));var s=i.start;s instanceof n&&(s=s.tokenIndex);var v=i.stop;if(v instanceof n&&(v=v.tokenIndex),s===null||v===null||s<0||v<0)return"";v>=this.tokens.length&&(v=this.tokens.length-1);for(var S="",E=s;E<v+1;E++){var k=this.tokens[E];if(k.type===n.EOF)break;S+=k.text}return S}},{key:"fill",value:function(){for(this.lazyInit();this.fetch(1e3)===1e3;);}}])&&Rg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(kg(function l(){(function(r,p){if(!(r instanceof p))throw new TypeError("Cannot call a class as a function")})(this,l)}));function $a(l){return $a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},$a(l)}function wg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if($a(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if($a(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),$a(f)==="symbol"?f:String(f)),a)}var f}function $h(l,r){return $h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},$h(l,r)}function Kc(l){return Kc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Kc(l)}Object.defineProperty(Py,"size",{get:function(){return this.tokens.length}});var Iy=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&$h(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=Kc(a);if(f){var v=Kc(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&($a(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(i,s){var v;return function(S,E){if(!(S instanceof E))throw new TypeError("Cannot call a class as a function")}(this,d),(v=c.call(this,i)).channel=s===void 0?n.DEFAULT_CHANNEL:s,v}return r=d,(p=[{key:"adjustSeekIndex",value:function(i){return this.nextTokenOnChannel(i,this.channel)}},{key:"LB",value:function(i){if(i===0||this.index-i<0)return null;for(var s=this.index,v=1;v<=i;)s=this.previousTokenOnChannel(s-1,this.channel),v+=1;return s<0?null:this.tokens[s]}},{key:"LT",value:function(i){if(this.lazyInit(),i===0)return null;if(i<0)return this.LB(-i);for(var s=this.index,v=1;v<i;)this.sync(s+1)&&(s=this.nextTokenOnChannel(s+1,this.channel)),v+=1;return this.tokens[s]}},{key:"getNumberOfOnChannelTokens",value:function(){var i=0;this.fill();for(var s=0;s<this.tokens.length;s++){var v=this.tokens[s];if(v.channel===this.channel&&(i+=1),v.type===n.EOF)break}return i}}])&&wg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(Py);function Wa(l){return Wa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Wa(l)}function Ng(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Wa(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Wa(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Wa(f)==="symbol"?f:String(f)),a)}var f}function Wh(l,r){return Wh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Wh(l,r)}function zc(l){return zc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zc(l)}var Pg=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&Wh(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=zc(a);if(f){var v=zc(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(Wa(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(i){var s;return function(v,S){if(!(v instanceof S))throw new TypeError("Cannot call a class as a function")}(this,d),(s=c.call(this)).parser=i,s}return r=d,(p=[{key:"enterEveryRule",value:function(i){console.log("enter "+this.parser.ruleNames[i.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)}},{key:"visitTerminal",value:function(i){console.log("consume "+i.symbol+" rule "+this.parser.ruleNames[this.parser._ctx.ruleIndex])}},{key:"exitEveryRule",value:function(i){console.log("exit "+this.parser.ruleNames[i.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)}}])&&Ng(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(kh);function Xa(l){return Xa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Xa(l)}function Ig(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Xa(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Xa(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Xa(f)==="symbol"?f:String(f)),a)}var f}function Xh(l,r){return Xh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Xh(l,r)}function $c(l){return $c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$c(l)}var qh=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&Xh(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=$c(a);if(f){var v=$c(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(Xa(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(i){var s;return function(v,S){if(!(v instanceof S))throw new TypeError("Cannot call a class as a function")}(this,d),(s=c.call(this))._input=null,s._errHandler=new Vh,s._precedenceStack=[],s._precedenceStack.push(0),s._ctx=null,s.buildParseTrees=!0,s._tracer=null,s._parseListeners=null,s._syntaxErrors=0,s.setInputStream(i),s}return r=d,p=[{key:"reset",value:function(){this._input!==null&&this._input.seek(0),this._errHandler.reset(this),this._ctx=null,this._syntaxErrors=0,this.setTrace(!1),this._precedenceStack=[],this._precedenceStack.push(0),this._interp!==null&&this._interp.reset()}},{key:"match",value:function(i){var s=this.getCurrentToken();return s.type===i?(this._errHandler.reportMatch(this),this.consume()):(s=this._errHandler.recoverInline(this),this.buildParseTrees&&s.tokenIndex===-1&&this._ctx.addErrorNode(s)),s}},{key:"matchWildcard",value:function(){var i=this.getCurrentToken();return i.type>0?(this._errHandler.reportMatch(this),this.consume()):(i=this._errHandler.recoverInline(this),this.buildParseTrees&&i.tokenIndex===-1&&this._ctx.addErrorNode(i)),i}},{key:"getParseListeners",value:function(){return this._parseListeners||[]}},{key:"addParseListener",value:function(i){if(i===null)throw"listener";this._parseListeners===null&&(this._parseListeners=[]),this._parseListeners.push(i)}},{key:"removeParseListener",value:function(i){if(this._parseListeners!==null){var s=this._parseListeners.indexOf(i);s>=0&&this._parseListeners.splice(s,1),this._parseListeners.length===0&&(this._parseListeners=null)}}},{key:"removeParseListeners",value:function(){this._parseListeners=null}},{key:"triggerEnterRuleEvent",value:function(){if(this._parseListeners!==null){var i=this._ctx;this._parseListeners.forEach(function(s){s.enterEveryRule(i),i.enterRule(s)})}}},{key:"triggerExitRuleEvent",value:function(){if(this._parseListeners!==null){var i=this._ctx;this._parseListeners.slice(0).reverse().forEach(function(s){i.exitRule(s),s.exitEveryRule(i)})}}},{key:"getTokenFactory",value:function(){return this._input.tokenSource._factory}},{key:"setTokenFactory",value:function(i){this._input.tokenSource._factory=i}},{key:"getATNWithBypassAlts",value:function(){var i=this.getSerializedATN();if(i===null)throw"The current parser does not support an ATN with bypass alternatives.";var s=this.bypassAltsAtnCache[i];if(s===null){var v=new As;v.generateRuleBypassTransitions=!0,s=new oh(v).deserialize(i),this.bypassAltsAtnCache[i]=s}return s}},{key:"getInputStream",value:function(){return this.getTokenStream()}},{key:"setInputStream",value:function(i){this.setTokenStream(i)}},{key:"getTokenStream",value:function(){return this._input}},{key:"setTokenStream",value:function(i){this._input=null,this.reset(),this._input=i}},{key:"syntaxErrorsCount",get:function(){return this._syntaxErrors}},{key:"getCurrentToken",value:function(){return this._input.LT(1)}},{key:"notifyErrorListeners",value:function(i,s,v){v=v||null,(s=s||null)===null&&(s=this.getCurrentToken()),this._syntaxErrors+=1;var S=s.line,E=s.column;this.getErrorListenerDispatch().syntaxError(this,s,S,E,i,v)}},{key:"consume",value:function(){var i=this.getCurrentToken();i.type!==n.EOF&&this.getInputStream().consume();var s,v=this._parseListeners!==null&&this._parseListeners.length>0;return(this.buildParseTrees||v)&&((s=this._errHandler.inErrorRecoveryMode(this)?this._ctx.addErrorNode(i):this._ctx.addTokenNode(i)).invokingState=this.state,v&&this._parseListeners.forEach(function(S){s instanceof zr||s.isErrorNode!==void 0&&s.isErrorNode()?S.visitErrorNode(s):s instanceof on&&S.visitTerminal(s)})),i}},{key:"addContextToParseTree",value:function(){this._ctx.parentCtx!==null&&this._ctx.parentCtx.addChild(this._ctx)}},{key:"enterRule",value:function(i,s,v){this.state=s,this._ctx=i,this._ctx.start=this._input.LT(1),this.buildParseTrees&&this.addContextToParseTree(),this.triggerEnterRuleEvent()}},{key:"exitRule",value:function(){this._ctx.stop=this._input.LT(-1),this.triggerExitRuleEvent(),this.state=this._ctx.invokingState,this._ctx=this._ctx.parentCtx}},{key:"enterOuterAlt",value:function(i,s){i.setAltNumber(s),this.buildParseTrees&&this._ctx!==i&&this._ctx.parentCtx!==null&&(this._ctx.parentCtx.removeLastChild(),this._ctx.parentCtx.addChild(i)),this._ctx=i}},{key:"getPrecedence",value:function(){return this._precedenceStack.length===0?-1:this._precedenceStack[this._precedenceStack.length-1]}},{key:"enterRecursionRule",value:function(i,s,v,S){this.state=s,this._precedenceStack.push(S),this._ctx=i,this._ctx.start=this._input.LT(1),this.triggerEnterRuleEvent()}},{key:"pushNewRecursionContext",value:function(i,s,v){var S=this._ctx;S.parentCtx=i,S.invokingState=s,S.stop=this._input.LT(-1),this._ctx=i,this._ctx.start=S.start,this.buildParseTrees&&this._ctx.addChild(S),this.triggerEnterRuleEvent()}},{key:"unrollRecursionContexts",value:function(i){this._precedenceStack.pop(),this._ctx.stop=this._input.LT(-1);var s=this._ctx,v=this.getParseListeners();if(v!==null&&v.length>0)for(;this._ctx!==i;)this.triggerExitRuleEvent(),this._ctx=this._ctx.parentCtx;else this._ctx=i;s.parentCtx=i,this.buildParseTrees&&i!==null&&i.addChild(s)}},{key:"getInvokingContext",value:function(i){for(var s=this._ctx;s!==null;){if(s.ruleIndex===i)return s;s=s.parentCtx}return null}},{key:"precpred",value:function(i,s){return s>=this._precedenceStack[this._precedenceStack.length-1]}},{key:"inContext",value:function(i){return!1}},{key:"isExpectedToken",value:function(i){var s=this._interp.atn,v=this._ctx,S=s.states[this.state],E=s.nextTokens(S);if(E.contains(i))return!0;if(!E.contains(n.EPSILON))return!1;for(;v!==null&&v.invokingState>=0&&E.contains(n.EPSILON);){var k=s.states[v.invokingState].transitions[0];if((E=s.nextTokens(k.followState)).contains(i))return!0;v=v.parentCtx}return!(!E.contains(n.EPSILON)||i!==n.EOF)}},{key:"getExpectedTokens",value:function(){return this._interp.atn.getExpectedTokens(this.state,this._ctx)}},{key:"getExpectedTokensWithinCurrentRule",value:function(){var i=this._interp.atn,s=i.states[this.state];return i.nextTokens(s)}},{key:"getRuleIndex",value:function(i){var s=this.getRuleIndexMap()[i];return s!==null?s:-1}},{key:"getRuleInvocationStack",value:function(i){(i=i||null)===null&&(i=this._ctx);for(var s=[];i!==null;){var v=i.ruleIndex;v<0?s.push("n/a"):s.push(this.ruleNames[v]),i=i.parentCtx}return s}},{key:"getDFAStrings",value:function(){return this._interp.decisionToDFA.toString()}},{key:"dumpDFA",value:function(){for(var i=!1,s=0;s<this._interp.decisionToDFA.length;s++){var v=this._interp.decisionToDFA[s];v.states.length>0&&(i&&console.log(),this.printer.println("Decision "+v.decision+":"),this.printer.print(v.toString(this.literalNames,this.symbolicNames)),i=!0)}}},{key:"getSourceName",value:function(){return this._input.sourceName}},{key:"setTrace",value:function(i){i?(this._tracer!==null&&this.removeParseListener(this._tracer),this._tracer=new Pg(this),this.addParseListener(this._tracer)):(this.removeParseListener(this._tracer),this._tracer=null)}}],p&&Ig(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(Tc);function qa(l){return qa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},qa(l)}function Fg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(qa(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(qa(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),qa(f)==="symbol"?f:String(f)),a)}var f}function Yh(l,r){return Yh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Yh(l,r)}function Wc(l){return Wc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Wc(l)}qh.bypassAltsAtnCache={};var Fy=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&Yh(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=Wc(a);if(f){var v=Wc(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(qa(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(i){var s;return function(v,S){if(!(v instanceof S))throw new TypeError("Cannot call a class as a function")}(this,d),(s=c.call(this)).parentCtx=null,s.symbol=i,s}return r=d,(p=[{key:"getChild",value:function(i){return null}},{key:"getSymbol",value:function(){return this.symbol}},{key:"getParent",value:function(){return this.parentCtx}},{key:"getPayload",value:function(){return this.symbol}},{key:"getSourceInterval",value:function(){if(this.symbol===null)return _e.INVALID_INTERVAL;var i=this.symbol.tokenIndex;return new _e(i,i)}},{key:"getChildCount",value:function(){return 0}},{key:"accept",value:function(i){return i.visitTerminal(this)}},{key:"getText",value:function(){return this.symbol.text}},{key:"toString",value:function(){return this.symbol.type===n.EOF?"<EOF>":this.symbol.text}}])&&Fg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(on);function Ya(l){return Ya=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ya(l)}function Mg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Ya(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Ya(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ya(f)==="symbol"?f:String(f)),a)}var f}function Jh(l,r){return Jh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Jh(l,r)}function Xc(l){return Xc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Xc(l)}var My=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&Jh(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=Xc(a);if(f){var v=Xc(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(Ya(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(i){return function(s,v){if(!(s instanceof v))throw new TypeError("Cannot call a class as a function")}(this,d),c.call(this,i)}return r=d,(p=[{key:"isErrorNode",value:function(){return!0}},{key:"accept",value:function(i){return i.visitErrorNode(this)}}])&&Mg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(Fy);function Ja(l){return Ja=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ja(l)}function Lg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Ja(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Ja(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ja(f)==="symbol"?f:String(f)),a)}var f}function Zh(l,r){return Zh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Zh(l,r)}function qc(l){return qc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},qc(l)}var Qh=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&Zh(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=qc(a);if(f){var v=qc(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(Ja(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(i,s){var v;return function(S,E){if(!(S instanceof E))throw new TypeError("Cannot call a class as a function")}(this,d),(v=c.call(this,i,s)).children=null,v.start=null,v.stop=null,v.exception=null,v}return r=d,(p=[{key:"copyFrom",value:function(i){this.parentCtx=i.parentCtx,this.invokingState=i.invokingState,this.children=null,this.start=i.start,this.stop=i.stop,i.children&&(this.children=[],i.children.map(function(s){s instanceof My&&(this.children.push(s),s.parentCtx=this)},this))}},{key:"enterRule",value:function(i){}},{key:"exitRule",value:function(i){}},{key:"addChild",value:function(i){return this.children===null&&(this.children=[]),this.children.push(i),i}},{key:"removeLastChild",value:function(){this.children!==null&&this.children.pop()}},{key:"addTokenNode",value:function(i){var s=new Fy(i);return this.addChild(s),s.parentCtx=this,s}},{key:"addErrorNode",value:function(i){var s=new My(i);return this.addChild(s),s.parentCtx=this,s}},{key:"getChild",value:function(i,s){if(s=s||null,this.children===null||i<0||i>=this.children.length)return null;if(s===null)return this.children[i];for(var v=0;v<this.children.length;v++){var S=this.children[v];if(S instanceof s){if(i===0)return S;i-=1}}return null}},{key:"getToken",value:function(i,s){if(this.children===null||s<0||s>=this.children.length)return null;for(var v=0;v<this.children.length;v++){var S=this.children[v];if(S instanceof on&&S.symbol.type===i){if(s===0)return S;s-=1}}return null}},{key:"getTokens",value:function(i){if(this.children===null)return[];for(var s=[],v=0;v<this.children.length;v++){var S=this.children[v];S instanceof on&&S.symbol.type===i&&s.push(S)}return s}},{key:"getTypedRuleContext",value:function(i,s){return this.getChild(s,i)}},{key:"getTypedRuleContexts",value:function(i){if(this.children===null)return[];for(var s=[],v=0;v<this.children.length;v++){var S=this.children[v];S instanceof i&&s.push(S)}return s}},{key:"getChildCount",value:function(){return this.children===null?0:this.children.length}},{key:"getSourceInterval",value:function(){return this.start===null||this.stop===null?_e.INVALID_INTERVAL:new _e(this.start.tokenIndex,this.stop.tokenIndex)}}])&&Lg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(Wi);function ep(l,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");l.prototype=Object.create(r&&r.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),Object.defineProperty(l,"prototype",{writable:!1}),r&&tp(l,r)}function tp(l,r){return tp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},tp(l,r)}function np(l){var r=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var p,a=Yc(l);if(r){var f=Yc(this).constructor;p=Reflect.construct(a,arguments,f)}else p=a.apply(this,arguments);return function(c,d){if(d&&(Za(d)==="object"||typeof d=="function"))return d;if(d!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}(c)}(this,p)}}function Yc(l){return Yc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Yc(l)}function Za(l){return Za=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Za(l)}function Qa(l,r){var p=typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(!p){if(Array.isArray(l)||(p=function(s,v){if(s){if(typeof s=="string")return Ly(s,v);var S=Object.prototype.toString.call(s).slice(8,-1);return S==="Object"&&s.constructor&&(S=s.constructor.name),S==="Map"||S==="Set"?Array.from(s):S==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(S)?Ly(s,v):void 0}}(l))||r&&l&&typeof l.length=="number"){p&&(l=p);var a=0,f=function(){};return{s:f,n:function(){return a>=l.length?{done:!0}:{done:!1,value:l[a++]}},e:function(s){throw s},f}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
10
10
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c,d=!0,i=!1;return{s:function(){p=p.call(l)},n:function(){var s=p.next();return d=s.done,s},e:function(s){i=!0,c=s},f:function(){try{d||p.return==null||p.return()}finally{if(i)throw c}}}}function Ly(l,r){(r==null||r>l.length)&&(r=l.length);for(var p=0,a=new Array(r);p<r;p++)a[p]=l[p];return a}function eu(l,r){if(!(l instanceof r))throw new TypeError("Cannot call a class as a function")}function By(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,Uy(a.key),a)}}function tu(l,r,p){return r&&By(l.prototype,r),p&&By(l,p),Object.defineProperty(l,"prototype",{writable:!1}),l}function Uy(l){var r=function(p,a){if(Za(p)!=="object"||p===null)return p;var f=p[Symbol.toPrimitive];if(f!==void 0){var c=f.call(p,"string");if(Za(c)!=="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(p)}(l);return Za(r)==="symbol"?r:String(r)}Wi.EMPTY=new Qh;var Jc,Zc,rp,Vy=function(){function l(r){eu(this,l),this.tokens=r,this.programs=new Map}return tu(l,[{key:"getTokenStream",value:function(){return this.tokens}},{key:"insertAfter",value:function(r,p){var a,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.DEFAULT_PROGRAM_NAME;a=typeof r=="number"?r:r.tokenIndex;var c=this.getProgram(f),d=new Hy(this.tokens,a,c.length,p);c.push(d)}},{key:"insertBefore",value:function(r,p){var a,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.DEFAULT_PROGRAM_NAME;a=typeof r=="number"?r:r.tokenIndex;var c=this.getProgram(f),d=new es(this.tokens,a,c.length,p);c.push(d)}},{key:"replaceSingle",value:function(r,p){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.DEFAULT_PROGRAM_NAME;this.replace(r,r,p,a)}},{key:"replace",value:function(r,p,a){var f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:l.DEFAULT_PROGRAM_NAME;if(typeof r!="number"&&(r=r.tokenIndex),typeof p!="number"&&(p=p.tokenIndex),r>p||r<0||p<0||p>=this.tokens.size)throw new RangeError("replace: range invalid: ".concat(r,"..").concat(p,"(size=").concat(this.tokens.size,")"));var c=this.getProgram(f),d=new Qc(this.tokens,r,p,c.length,a);c.push(d)}},{key:"delete",value:function(r,p){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.DEFAULT_PROGRAM_NAME;p===void 0&&(p=r),this.replace(r,p,null,a)}},{key:"getProgram",value:function(r){var p=this.programs.get(r);return p==null&&(p=this.initializeProgram(r)),p}},{key:"initializeProgram",value:function(r){var p=[];return this.programs.set(r,p),p}},{key:"getText",value:function(r){var p,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l.DEFAULT_PROGRAM_NAME;p=r instanceof _e?r:new _e(0,this.tokens.size-1),typeof r=="string"&&(a=r);var f=this.programs.get(a),c=p.start,d=p.stop;if(d>this.tokens.size-1&&(d=this.tokens.size-1),c<0&&(c=0),f==null||f.length===0)return this.tokens.getText(new _e(c,d));for(var i=[],s=this.reduceToSingleOperationPerIndex(f),v=c;v<=d&&v<this.tokens.size;){var S=s.get(v);s.delete(v);var E=this.tokens.get(v);S==null?(E.type!==n.EOF&&i.push(String(E.text)),v++):v=S.execute(i)}if(d===this.tokens.size-1){var k,ee=Qa(s.values());try{for(ee.s();!(k=ee.n()).done;){var Ce=k.value;Ce.index>=this.tokens.size-1&&i.push(Ce.text.toString())}}catch(xe){ee.e(xe)}finally{ee.f()}}return i.join("")}},{key:"reduceToSingleOperationPerIndex",value:function(r){for(var p=0;p<r.length;p++){var a=r[p];if(a!=null&&a instanceof Qc){var f,c=a,d=Qa(this.getKindOfOps(r,es,p));try{for(d.s();!(f=d.n()).done;){var i=f.value;i.index===c.index?(r[i.instructionIndex]=void 0,c.text=i.text.toString()+(c.text!=null?c.text.toString():"")):i.index>c.index&&i.index<=c.lastIndex&&(r[i.instructionIndex]=void 0)}}catch(Sr){d.e(Sr)}finally{d.f()}var s,v=Qa(this.getKindOfOps(r,Qc,p));try{for(v.s();!(s=v.n()).done;){var S=s.value;if(S.index>=c.index&&S.lastIndex<=c.lastIndex)r[S.instructionIndex]=void 0;else{var E=S.lastIndex<c.index||S.index>c.lastIndex;if(S.text!=null||c.text!=null||E){if(!E)throw new Error("replace op boundaries of ".concat(c," overlap with previous ").concat(S))}else r[S.instructionIndex]=void 0,c.index=Math.min(S.index,c.index),c.lastIndex=Math.max(S.lastIndex,c.lastIndex)}}}catch(Sr){v.e(Sr)}finally{v.f()}}}for(var k=0;k<r.length;k++){var ee=r[k];if(ee!=null&&ee instanceof es){var Ce,xe=ee,Ge=Qa(this.getKindOfOps(r,es,k));try{for(Ge.s();!(Ce=Ge.n()).done;){var at=Ce.value;at.index===xe.index&&(at instanceof Hy?(xe.text=this.catOpText(at.text,xe.text),r[at.instructionIndex]=void 0):at instanceof es&&(xe.text=this.catOpText(xe.text,at.text),r[at.instructionIndex]=void 0))}}catch(Sr){Ge.e(Sr)}finally{Ge.f()}var $e,yn=Qa(this.getKindOfOps(r,Qc,k));try{for(yn.s();!($e=yn.n()).done;){var hn=$e.value;if(xe.index!==hn.index){if(xe.index>=hn.index&&xe.index<=hn.lastIndex)throw new Error("insert op ".concat(xe," within boundaries of previous ").concat(hn))}else hn.text=this.catOpText(xe.text,hn.text),r[k]=void 0}}catch(Sr){yn.e(Sr)}finally{yn.f()}}}var Gn,Fr=new Map,Di=Qa(r);try{for(Di.s();!(Gn=Di.n()).done;){var Ci=Gn.value;if(Ci!=null){if(Fr.get(Ci.index)!=null)throw new Error("should only be one op per index");Fr.set(Ci.index,Ci)}}}catch(Sr){Di.e(Sr)}finally{Di.f()}return Fr}},{key:"catOpText",value:function(r,p){var a="",f="";return r!=null&&(a=r.toString()),p!=null&&(f=p.toString()),a+f}},{key:"getKindOfOps",value:function(r,p,a){return r.slice(0,a).filter(function(f){return f&&f instanceof p})}}]),l}();Jc=Vy,rp="default",(Zc=Uy(Zc="DEFAULT_PROGRAM_NAME"))in Jc?Object.defineProperty(Jc,Zc,{value:rp,enumerable:!0,configurable:!0,writable:!0}):Jc[Zc]=rp;var jy=function(){function l(r,p,a,f){eu(this,l),this.tokens=r,this.instructionIndex=a,this.index=p,this.text=f===void 0?"":f}return tu(l,[{key:"toString",value:function(){var r=this.constructor.name,p=r.indexOf("$");return"<"+(r=r.substring(p+1,r.length))+"@"+this.tokens.get(this.index)+':"'+this.text+'">'}}]),l}(),es=function(l){ep(p,l);var r=np(p);function p(a,f,c,d){return eu(this,p),r.call(this,a,f,c,d)}return tu(p,[{key:"execute",value:function(a){return this.text&&a.push(this.text.toString()),this.tokens.get(this.index).type!==n.EOF&&a.push(String(this.tokens.get(this.index).text)),this.index+1}}]),p}(jy),Hy=function(l){ep(p,l);var r=np(p);function p(a,f,c,d){return eu(this,p),r.call(this,a,f+1,c,d)}return tu(p)}(es),Qc=function(l){ep(p,l);var r=np(p);function p(a,f,c,d,i){var s;return eu(this,p),(s=r.call(this,a,f,d,i)).lastIndex=c,s}return tu(p,[{key:"execute",value:function(a){return this.text&&a.push(this.text.toString()),this.lastIndex+1}},{key:"toString",value:function(){return this.text==null?"<DeleteOp@"+this.tokens.get(this.index)+".."+this.tokens.get(this.lastIndex)+">":"<ReplaceOp@"+this.tokens.get(this.index)+".."+this.tokens.get(this.lastIndex)+':"'+this.text+'">'}}]),p}(jy);const Bg={atn:ug,dfa:hg,context:pg,misc:dg,tree:gg,error:xg,Token:n,CommonToken:Rs,CharStreams:wy,CharStream:Zs,InputStream:Zs,CommonTokenStream:Iy,Lexer:rr,Parser:qh,ParserRuleContext:Qh,Interval:_e,IntervalSet:ne,LL1Analyzer:Fo,Utils:Cg,TokenStreamRewriter:Vy}})();var Mr=kt.dx,ip=kt.q2;kt.FO,kt.xf,kt.Gy;var Gy=kt.s4,Ky=kt.c7,op=kt._7;kt.gp;var zy=kt.cK,$y=kt.zs,Wy=kt.AV;kt.Xp,kt.VS,kt.ul;var Xy=kt.hW,qy=kt.x1,fi=kt.z5;kt.oN;var Yy=kt.TB;kt.u1;var Jy=kt._b,Zy=kt.$F,Qe=kt._T,ap=kt.db,Qy=kt.Zx,et=kt._x;kt.r8,kt.JI,kt.TP;var sp=kt.WU;kt.Nj,kt.ZP;const M=class M extends Jy{get grammarFileName(){return"tccScriptParser.g4"}get literalNames(){return M.literalNames}get symbolicNames(){return M.symbolicNames}get ruleNames(){return M.ruleNames}get serializedATN(){return M._serializedATN}createFailedPredicateException(e,n){return new $y(this,e,n)}constructor(e){super(e),this._interp=new Zy(this,M._ATN,M.DecisionsToDFA,new ap)}program(){let e=new em(this,this._ctx,this.state);this.enterRule(e,0,M.RULE_program);let n;try{this.enterOuterAlt(e,1);{for(this.state=102,this._errHandler.sync(this),n=this._input.LA(1);n===4||n===6||!(n-36&-32)&&1<<n-36&19237111;){switch(this.state=100,this._errHandler.sync(this),this._input.LA(1)){case 60:this.state=98,this.match(M.NEWLINE);break;case 4:case 6:case 36:case 37:case 38:case 40:case 41:case 42:case 43:case 47:case 51:case 52:case 54:case 57:this.state=99,this.globalStmt();break;default:throw new fi(this)}this.state=104,this._errHandler.sync(this),n=this._input.LA(1)}this.state=105,this.match(M.EOF)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}globalStmt(){let e=new el(this,this._ctx,this.state);this.enterRule(e,2,M.RULE_globalStmt);let n;try{switch(this.state=118,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,3,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=107,this.variableDeclarationStmt(),this.state=109,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=108,this.match(M.Comma)),this.state=111,this.match(M.NEWLINE);break;case 2:this.enterOuterAlt(e,2),this.state=113,this.blockStmt();break;case 3:this.enterOuterAlt(e,3),this.state=114,this.importStmt();break;case 4:this.enterOuterAlt(e,4),this.state=115,this.arrowFunction();break;case 5:this.enterOuterAlt(e,5),this.state=116,this.arrowMethod();break;case 6:this.enterOuterAlt(e,6),this.state=117,this.typeStatement();break}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}blockStmt(){let e=new up(this,this._ctx,this.state);this.enterRule(e,4,M.RULE_blockStmt);try{let n;this.enterOuterAlt(e,1);{for(this.state=125,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,4,this._ctx);n!==2&&n!==Mr.INVALID_ALT_NUMBER;)n===1&&(this.state=120,this.variableDeclarationStmt(),this.state=121,this.match(M.Comma)),this.state=127,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,4,this._ctx);switch(this.state=130,this._errHandler.sync(this),this._input.LA(1)){case 4:case 6:case 38:case 40:case 51:case 54:case 57:this.state=128,this.varBlockStmt();break;case 37:case 41:case 42:case 43:this.state=129,this.blockExpression();break;default:throw new fi(this)}}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}stmt(){let e=new tl(this,this._ctx,this.state);this.enterRule(e,6,M.RULE_stmt);let n;try{switch(this.state=139,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,7,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=132,this.simpleStmt(),this.state=134,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=133,this.match(M.Comma)),this.state=136,this.match(M.NEWLINE);break;case 2:this.enterOuterAlt(e,2),this.state=138,this.expressionBlockSequence();break}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}simpleStmt(){let e=new nl(this,this._ctx,this.state);this.enterRule(e,8,M.RULE_simpleStmt);try{switch(this.state=145,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,8,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=141,this.expressionSequence();break;case 2:this.enterOuterAlt(e,2),this.state=142,this.blockSequence();break;case 3:this.enterOuterAlt(e,3),this.state=143,this.brackethesized();break;case 4:this.enterOuterAlt(e,4),this.state=144,this.flowStmt();break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}flowStmt(){let e=new cp(this,this._ctx,this.state);this.enterRule(e,10,M.RULE_flowStmt);let n;try{this.enterOuterAlt(e,1),this.state=147,n=this._input.LA(1),n===34||n===39?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}block(){let e=new ts(this,this._ctx,this.state);this.enterRule(e,12,M.RULE_block);let n;try{switch(this.state=156,this._errHandler.sync(this),this._input.LA(1)){case 4:case 6:case 12:case 13:case 31:case 32:case 33:case 34:case 38:case 39:case 40:case 46:case 51:case 54:case 55:case 56:case 57:this.enterOuterAlt(e,1),this.state=149,this.simpleStmt(),this.state=151,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=150,this.match(M.Comma)),this.state=153,this.match(M.NEWLINE);break;case 60:this.enterOuterAlt(e,2),this.state=155,this.blockLine();break;default:throw new fi(this)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}blockLine(){let e=new fo(this,this._ctx,this.state);this.enterRule(e,14,M.RULE_blockLine);let n;try{this.enterOuterAlt(e,1);{this.state=158,this.match(M.NEWLINE),this.state=159,this.match(M.INDENT),this.state=161,this._errHandler.sync(this),n=this._input.LA(1);do this.state=160,this.stmt(),this.state=163,this._errHandler.sync(this),n=this._input.LA(1);while(!(n&-32)&&1<<n&2147496016||!(n-32&-32)&&1<<n-32&63459303);this.state=165,this.match(M.DEDENT)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}variableDeclarationStmt(){let e=new nu(this,this._ctx,this.state);this.enterRule(e,16,M.RULE_variableDeclarationStmt);try{let n;this.enterOuterAlt(e,1);{switch(this.state=169,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,12,this._ctx)){case 1:this.state=167,this.methodStmt();break;case 2:this.state=168,this.variableDeclarationList();break}for(this.state=178,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,14,this._ctx);n!==2&&n!==Mr.INVALID_ALT_NUMBER;){if(n===1)switch(this.state=171,this.match(M.Comma),this.state=174,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,13,this._ctx)){case 1:this.state=172,this.methodStmt();break;case 2:this.state=173,this.variableDeclarationList();break}this.state=180,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,14,this._ctx)}}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}variableDeclarationList(){let e=new ki(this,this._ctx,this.state);this.enterRule(e,18,M.RULE_variableDeclarationList);try{switch(this.state=189,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,15,this._ctx)){case 1:e=new nm(this,e),this.enterOuterAlt(e,1),this.state=181,this.varArrayDeclaration(),this.state=182,this.match(M.Assign),this.state=183,this.singleExpression(0);break;case 2:e=new tm(this,e),this.enterOuterAlt(e,2),this.state=185,this.name(),this.state=186,this.assignmentOperator(),this.state=187,this.singleExpression(0);break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}varModifier(){let e=new rl(this,this._ctx,this.state);this.enterRule(e,20,M.RULE_varModifier);let n;try{this.enterOuterAlt(e,1),this.state=191,n=this._input.LA(1),n===38||n===40?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}blockSequence(){let e=new lp(this,this._ctx,this.state);this.enterRule(e,22,M.RULE_blockSequence);try{let n;this.enterOuterAlt(e,1);{switch(this.state=195,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,16,this._ctx)){case 1:this.state=193,this.singleExpression(0);break;case 2:this.state=194,this.variableDeclarationList();break}for(this.state=204,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,18,this._ctx);n!==2&&n!==Mr.INVALID_ALT_NUMBER;){if(n===1)switch(this.state=197,this.match(M.Comma),this.state=200,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,17,this._ctx)){case 1:this.state=198,this.singleExpression(0);break;case 2:this.state=199,this.variableDeclarationList();break}this.state=206,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,18,this._ctx)}}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}expressionSequence(){let e=new il(this,this._ctx,this.state);this.enterRule(e,24,M.RULE_expressionSequence);try{let n;for(this.enterOuterAlt(e,1),this.state=207,this.singleExpression(0),this.state=212,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,19,this._ctx);n!==2&&n!==Mr.INVALID_ALT_NUMBER;)n===1&&(this.state=208,this.match(M.Comma),this.state=209,this.singleExpression(0)),this.state=214,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,19,this._ctx)}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}expressionBlockSequence(){let e=new fp(this,this._ctx,this.state);this.enterRule(e,26,M.RULE_expressionBlockSequence);try{let n;this.enterOuterAlt(e,1);{for(this.state=223,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,21,this._ctx);n!==2&&n!==Mr.INVALID_ALT_NUMBER;){if(n===1){switch(this.state=217,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,20,this._ctx)){case 1:this.state=215,this.singleExpression(0);break;case 2:this.state=216,this.variableDeclarationList();break}this.state=219,this.match(M.Comma)}this.state=225,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,21,this._ctx)}switch(this.state=228,this._errHandler.sync(this),this._input.LA(1)){case 4:case 6:case 38:case 40:case 51:case 54:case 57:this.state=226,this.varBlockStmt();break;case 37:case 41:case 42:case 43:this.state=227,this.blockExpression();break;default:throw new fi(this)}}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}varBlockStmt(){let e=new ol(this,this._ctx,this.state);this.enterRule(e,28,M.RULE_varBlockStmt);try{this.enterOuterAlt(e,1);{switch(this.state=236,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,23,this._ctx)){case 1:this.state=230,this.varArrayDeclaration(),this.state=231,this.match(M.Assign);break;case 2:this.state=233,this.name(),this.state=234,this.assignmentOperator();break}this.state=238,this.blockExpression()}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}varArrayDeclaration(){let e=new ns(this,this._ctx,this.state);this.enterRule(e,30,M.RULE_varArrayDeclaration);let n;try{switch(this.state=258,this._errHandler.sync(this),this._input.LA(1)){case 38:case 40:case 51:case 54:case 57:e=new im(this,e),this.enterOuterAlt(e,1);{switch(this.state=241,this._errHandler.sync(this),n=this._input.LA(1),(n===38||n===40)&&(this.state=240,this.varModifier()),this.state=244,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,25,this._ctx)){case 1:this.state=243,this.typeGather();break}this.state=246,this.identifier()}break;case 4:e=new rm(this,e),this.enterOuterAlt(e,2);{for(this.state=247,this.match(M.OpenBracket),this.state=248,this.identifier(),this.state=253,this._errHandler.sync(this),n=this._input.LA(1);n===8;)this.state=249,this.match(M.Comma),this.state=250,this.identifier(),this.state=255,this._errHandler.sync(this),n=this._input.LA(1);this.state=256,this.match(M.CloseBracket)}break;default:throw new fi(this)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}blockExpression(){let e=new ru(this,this._ctx,this.state);this.enterRule(e,32,M.RULE_blockExpression);try{switch(this.state=264,this._errHandler.sync(this),this._input.LA(1)){case 43:this.enterOuterAlt(e,1),this.state=260,this.ifStatement();break;case 37:this.enterOuterAlt(e,2),this.state=261,this.forStatement();break;case 42:this.enterOuterAlt(e,3),this.state=262,this.whileStatement();break;case 41:this.enterOuterAlt(e,4),this.state=263,this.switchStatement();break;default:throw new fi(this)}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}singleExpression(e){e===void 0&&(e=0);let n=this._ctx,o=this.state,u=new Ve(this,this._ctx,o),h=u,m=34;this.enterRecursionRule(u,34,M.RULE_singleExpression,e);let _;try{let T;this.enterOuterAlt(u,1);{switch(this.state=278,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,29,this._ctx)){case 1:u=new mm(this,u),this._ctx=u,h=u,this.state=267,this.methodStmt();break;case 2:u=new pm(this,u),this._ctx=u,h=u,this.state=268,_=this._input.LA(1),_===12||_===13?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=269,this.singleExpression(12);break;case 3:u=new dm(this,u),this._ctx=u,h=u,this.state=270,this.match(M.Not),this.state=271,this.singleExpression(11);break;case 4:u=new lm(this,u),this._ctx=u,h=u,this.state=272,this.name();break;case 5:u=new fm(this,u),this._ctx=u,h=u,this.state=273,this.literal();break;case 6:u=new om(this,u),this._ctx=u,h=u,this.state=274,this.match(M.OpenParen),this.state=275,this.singleExpression(0),this.state=276,this.match(M.CloseParen);break}for(this._ctx.stop=this._input.LT(-1),this.state=311,this._errHandler.sync(this),T=this._interp.adaptivePredict(this._input,31,this._ctx);T!==2&&T!==Mr.INVALID_ALT_NUMBER;){if(T===1)switch(this._parseListeners!=null&&this.triggerExitRuleEvent(),h=u,this.state=309,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,30,this._ctx)){case 1:{if(u=new gm(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=280,!this.precpred(this._ctx,10))throw this.createFailedPredicateException("this.precpred(this._ctx, 10)");this.state=281,_=this._input.LA(1),!(_&-32)&&1<<_&114688?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=282,this.singleExpression(11)}break;case 2:{if(u=new am(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=283,!this.precpred(this._ctx,9))throw this.createFailedPredicateException("this.precpred(this._ctx, 9)");this.state=284,_=this._input.LA(1),_===12||_===13?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=285,this.singleExpression(10)}break;case 3:{if(u=new sm(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=286,!this.precpred(this._ctx,8))throw this.createFailedPredicateException("this.precpred(this._ctx, 8)");this.state=287,_=this._input.LA(1),!(_&-32)&&1<<_&3932160?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=288,this.singleExpression(9)}break;case 4:{if(u=new _m(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=289,!this.precpred(this._ctx,7))throw this.createFailedPredicateException("this.precpred(this._ctx, 7)");this.state=290,_=this._input.LA(1),_===22||_===23?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=291,this.singleExpression(8)}break;case 5:{if(u=new cm(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=292,!this.precpred(this._ctx,6))throw this.createFailedPredicateException("this.precpred(this._ctx, 6)");this.state=293,this.match(M.And),this.state=294,this.singleExpression(7)}break;case 6:{if(u=new hm(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=295,!this.precpred(this._ctx,5))throw this.createFailedPredicateException("this.precpred(this._ctx, 5)");this.state=296,this.match(M.Or),this.state=297,this.singleExpression(6)}break;case 7:{if(u=new um(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=298,!this.precpred(this._ctx,4))throw this.createFailedPredicateException("this.precpred(this._ctx, 4)");this.state=299,this.match(M.QuestionMark),this.state=300,this.singleExpression(0),this.state=301,this.match(M.Colon),this.state=302,this.singleExpression(4)}break;case 8:{if(u=new ym(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=304,!this.precpred(this._ctx,13))throw this.createFailedPredicateException("this.precpred(this._ctx, 13)");this.state=305,this.match(M.OpenBracket),this.state=306,this.singleExpression(0),this.state=307,this.match(M.CloseBracket)}break}this.state=313,this._errHandler.sync(this),T=this._interp.adaptivePredict(this._input,31,this._ctx)}}}catch(T){if(T instanceof et)u.exception=T,this._errHandler.reportError(this,T),this._errHandler.recover(this,T);else throw T}finally{this.unrollRecursionContexts(n)}return u}brackethesized(){let e=new al(this,this._ctx,this.state);this.enterRule(e,36,M.RULE_brackethesized);try{this.enterOuterAlt(e,1),this.state=314,this.match(M.OpenBracket),this.state=315,this.expressionSequence(),this.state=316,this.match(M.CloseBracket)}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}arguments(){let e=new hp(this,this._ctx,this.state);this.enterRule(e,38,M.RULE_arguments);let n;try{let o;this.enterOuterAlt(e,1);{if(this.state=318,this.match(M.OpenParen),this.state=330,this._errHandler.sync(this),n=this._input.LA(1),!(n&-32)&&1<<n&2147496016||!(n-32&-32)&&1<<n-32&63455235){for(this.state=319,this.argument(),this.state=324,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,32,this._ctx);o!==2&&o!==Mr.INVALID_ALT_NUMBER;)o===1&&(this.state=320,this.match(M.Comma),this.state=321,this.argument()),this.state=326,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,32,this._ctx);this.state=328,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=327,this.match(M.Comma))}this.state=332,this.match(M.CloseParen)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}argument(){let e=new sl(this,this._ctx,this.state);this.enterRule(e,40,M.RULE_argument);try{this.enterOuterAlt(e,1);{switch(this.state=337,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,35,this._ctx)){case 1:this.state=334,this.identifier(),this.state=335,this.match(M.Assign);break}switch(this.state=341,this._errHandler.sync(this),this._input.LA(1)){case 6:case 12:case 13:case 31:case 32:case 33:case 46:case 51:case 54:case 55:case 56:case 57:this.state=339,this.singleExpression(0);break;case 4:this.state=340,this.brackethesized();break;default:throw new fi(this)}}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}ifStatement(){let e=new pp(this,this._ctx,this.state);this.enterRule(e,42,M.RULE_ifStatement);let n;try{let o;this.enterOuterAlt(e,1);{for(this.state=343,this.match(M.If),this.state=344,this.singleExpression(0),this.state=345,this.blockLine(),this.state=353,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,37,this._ctx);o!==2&&o!==Mr.INVALID_ALT_NUMBER;)o===1&&(this.state=346,this.match(M.Else),this.state=347,this.match(M.If),this.state=348,this.singleExpression(0),this.state=349,this.blockLine()),this.state=355,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,37,this._ctx);this.state=358,this._errHandler.sync(this),n=this._input.LA(1),n===48&&(this.state=356,this.match(M.Else),this.state=357,this.blockLine())}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}forStatement(){let e=new iu(this,this._ctx,this.state);this.enterRule(e,44,M.RULE_forStatement);let n;try{switch(this.state=392,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,43,this._ctx)){case 1:e=new bm(this,e),this.enterOuterAlt(e,1);{switch(this.state=360,this.match(M.For),this.state=362,this._errHandler.sync(this),n=this._input.LA(1),(n===38||n===40)&&(this.state=361,this.varModifier()),this.state=365,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,40,this._ctx)){case 1:this.state=364,this.typeGather();break}this.state=367,this.identifier(),this.state=368,this.match(M.Assign),this.state=369,this.singleExpression(0),this.state=370,this.match(M.To),this.state=371,this.singleExpression(0),this.state=374,this._errHandler.sync(this),n=this._input.LA(1),n===50&&(this.state=372,this.match(M.By),this.state=373,this.singleExpression(0)),this.state=376,this.blockLine()}break;case 2:e=new vm(this,e),this.enterOuterAlt(e,2);{switch(this.state=378,this.match(M.For),this.state=386,this._errHandler.sync(this),this._input.LA(1)){case 51:case 54:case 57:this.state=379,this.identifier();break;case 4:this.state=380,this.match(M.OpenBracket),this.state=381,this.identifier(),this.state=382,this.match(M.Comma),this.state=383,this.identifier(),this.state=384,this.match(M.CloseBracket);break;default:throw new fi(this)}this.state=388,this.match(M.In),this.state=389,this.singleExpression(0),this.state=390,this.blockLine()}break}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}switchStatement(){let e=new dp(this,this._ctx,this.state);this.enterRule(e,46,M.RULE_switchStatement);let n;try{this.enterOuterAlt(e,1);{this.state=394,this.match(M.Switch),this.state=396,this._errHandler.sync(this),n=this._input.LA(1),(!(n&-32)&&1<<n&2147496e3||!(n-32&-32)&&1<<n-32&63455235)&&(this.state=395,this.singleExpression(0)),this.state=398,this.match(M.NEWLINE),this.state=399,this.match(M.INDENT);{for(this.state=403,this._errHandler.sync(this),n=this._input.LA(1);!(n&-32)&&1<<n&2147496e3||!(n-32&-32)&&1<<n-32&63455235;)this.state=400,this.caseClause(),this.state=405,this._errHandler.sync(this),n=this._input.LA(1);this.state=407,this._errHandler.sync(this),n=this._input.LA(1),n===29&&(this.state=406,this.defaultCaluse())}this.state=409,this.match(M.DEDENT)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}caseClause(){let e=new ul(this,this._ctx,this.state);this.enterRule(e,48,M.RULE_caseClause);try{this.enterOuterAlt(e,1),this.state=411,this.singleExpression(0),this.state=412,this.match(M.ARROW),this.state=413,this.block()}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}defaultCaluse(){let e=new yp(this,this._ctx,this.state);this.enterRule(e,50,M.RULE_defaultCaluse);try{this.enterOuterAlt(e,1),this.state=415,this.match(M.ARROW),this.state=416,this.block()}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}whileStatement(){let e=new mp(this,this._ctx,this.state);this.enterRule(e,52,M.RULE_whileStatement);try{this.enterOuterAlt(e,1),this.state=418,this.match(M.While),this.state=419,this.singleExpression(0),this.state=420,this.blockLine()}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}importStmt(){let e=new _p(this,this._ctx,this.state);this.enterRule(e,54,M.RULE_importStmt);let n;try{this.enterOuterAlt(e,1);{for(this.state=422,this.importElement(),this.state=427,this._errHandler.sync(this),n=this._input.LA(1);n===8;)this.state=423,this.match(M.Comma),this.state=424,this.importElement(),this.state=429,this._errHandler.sync(this),n=this._input.LA(1);this.state=430,this.match(M.NEWLINE)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}importElement(){let e=new cl(this,this._ctx,this.state);this.enterRule(e,56,M.RULE_importElement);let n;try{this.enterOuterAlt(e,1),this.state=432,this.match(M.Import),this.state=433,this.identifier(),this.state=434,this.match(M.Divide),this.state=435,this.identifier(),this.state=436,this.match(M.Divide),this.state=437,this.match(M.IntegerLiteral),this.state=440,this._errHandler.sync(this),n=this._input.LA(1),n===53&&(this.state=438,this.match(M.As),this.state=439,this.identifier())}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}literal(){let e=new gp(this,this._ctx,this.state);this.enterRule(e,58,M.RULE_literal);let n;try{this.enterOuterAlt(e,1),this.state=442,n=this._input.LA(1),!(n-31&-32)&&1<<n-31&50331655?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}methodStmt(){let e=new ou(this,this._ctx,this.state);this.enterRule(e,60,M.RULE_methodStmt);try{let n;for(this.enterOuterAlt(e,1),this.state=444,this.methodElement(),this.state=449,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,49,this._ctx);n!==2&&n!==Mr.INVALID_ALT_NUMBER;)n===1&&(this.state=445,this.match(M.Point),this.state=446,this.methodElement()),this.state=451,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,49,this._ctx)}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}methodElement(){let e=new rs(this,this._ctx,this.state);this.enterRule(e,62,M.RULE_methodElement);try{this.enterOuterAlt(e,1),this.state=452,this.methodName(),this.state=453,this.arguments()}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}methodName(){let e=new bp(this,this._ctx,this.state);this.enterRule(e,64,M.RULE_methodName);let n;try{let o;this.enterOuterAlt(e,1);{switch(this.state=468,this._errHandler.sync(this),this._input.LA(1)){case 51:case 54:case 57:for(this.state=460,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,50,this._ctx);o!==2&&o!==Mr.INVALID_ALT_NUMBER;)o===1&&(this.state=455,this.identifier(),this.state=456,this.match(M.Point)),this.state=462,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,50,this._ctx);break;case 6:this.state=463,this.match(M.OpenParen),this.state=464,this.singleExpression(0),this.state=465,this.match(M.CloseParen),this.state=466,this.match(M.Point);break;default:throw new fi(this)}this.state=470,this.identifier(),this.state=479,this._errHandler.sync(this),n=this._input.LA(1),n===18&&(this.state=471,this.match(M.LessThan),this.state=472,this.typeName(),this.state=475,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=473,this.match(M.Comma),this.state=474,this.typeName()),this.state=477,this.match(M.MoreThan))}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}arrowFunction(){let e=new vp(this,this._ctx,this.state);this.enterRule(e,66,M.RULE_arrowFunction);let n;try{this.enterOuterAlt(e,1),this.state=482,this._errHandler.sync(this),n=this._input.LA(1),n===36&&(this.state=481,this.match(M.Export)),this.state=484,this.identifier(),this.state=485,this.arrowFunctionParameters(),this.state=486,this.match(M.ARROW),this.state=487,this.block()}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}arrowFunctionParameters(){let e=new Ep(this,this._ctx,this.state);this.enterRule(e,68,M.RULE_arrowFunctionParameters);let n;try{this.enterOuterAlt(e,1),this.state=489,this.match(M.OpenParen),this.state=491,this._errHandler.sync(this),n=this._input.LA(1),!(n-51&-32)&&1<<n-51&73&&(this.state=490,this.formalParameterList()),this.state=493,this.match(M.CloseParen)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}formalParameterList(){let e=new ll(this,this._ctx,this.state);this.enterRule(e,70,M.RULE_formalParameterList);let n;try{for(this.enterOuterAlt(e,1),this.state=495,this.formalParameterArg(),this.state=500,this._errHandler.sync(this),n=this._input.LA(1);n===8;)this.state=496,this.match(M.Comma),this.state=497,this.formalParameterArg(),this.state=502,this._errHandler.sync(this),n=this._input.LA(1)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}formalParameterArg(){let e=new fl(this,this._ctx,this.state);this.enterRule(e,72,M.RULE_formalParameterArg);let n;try{this.enterOuterAlt(e,1);{switch(this.state=504,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,57,this._ctx)){case 1:this.state=503,this.typeGather();break}this.state=506,this.identifier(),this.state=509,this._errHandler.sync(this),n=this._input.LA(1),n===9&&(this.state=507,this.match(M.Assign),this.state=508,this.singleExpression(0))}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}arrowMethod(){let e=new Sp(this,this._ctx,this.state);this.enterRule(e,74,M.RULE_arrowMethod);let n;try{this.enterOuterAlt(e,1),this.state=512,this._errHandler.sync(this),n=this._input.LA(1),n===36&&(this.state=511,this.match(M.Export)),this.state=514,this.match(M.Method),this.state=515,this.identifier(),this.state=516,this.arrowMethodParameters(),this.state=517,this.match(M.ARROW),this.state=518,this.block()}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}arrowMethodParameters(){let e=new Tp(this,this._ctx,this.state);this.enterRule(e,76,M.RULE_arrowMethodParameters);let n;try{this.enterOuterAlt(e,1),this.state=520,this.match(M.OpenParen),this.state=521,this.typeGather(),this.state=522,this.identifier(),this.state=525,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=523,this.match(M.Comma),this.state=524,this.formalParameterList()),this.state=527,this.match(M.CloseParen)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}typeStatement(){let e=new Ap(this,this._ctx,this.state);this.enterRule(e,78,M.RULE_typeStatement);let n;try{this.enterOuterAlt(e,1);{this.state=530,this._errHandler.sync(this),n=this._input.LA(1),n===36&&(this.state=529,this.match(M.Export)),this.state=532,this.match(M.Type),this.state=533,this.identifier(),this.state=534,this.match(M.NEWLINE),this.state=535,this.match(M.INDENT),this.state=537,this._errHandler.sync(this),n=this._input.LA(1);do this.state=536,this.typeElement(),this.state=539,this._errHandler.sync(this),n=this._input.LA(1);while(!(n-40&-32)&&1<<n-40&149505);this.state=541,this.match(M.DEDENT)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}typeElement(){let e=new hl(this,this._ctx,this.state);this.enterRule(e,80,M.RULE_typeElement);let n;try{this.enterOuterAlt(e,1),this.state=544,this._errHandler.sync(this),n=this._input.LA(1),n===40&&(this.state=543,this.match(M.Varip)),this.state=546,this.typeGather(),this.state=547,this.identifier(),this.state=550,this._errHandler.sync(this),n=this._input.LA(1),n===9&&(this.state=548,this.match(M.Assign),this.state=549,this.singleExpression(0)),this.state=552,this.match(M.NEWLINE)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}assignmentOperator(){let e=new pl(this,this._ctx,this.state);this.enterRule(e,82,M.RULE_assignmentOperator);let n;try{this.enterOuterAlt(e,1),this.state=554,n=this._input.LA(1),!(n&-32)&&1<<n&1593835520?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}typeMap(){let e=new dl(this,this._ctx,this.state);this.enterRule(e,84,M.RULE_typeMap);try{this.enterOuterAlt(e,1),this.state=556,this.match(M.Map),this.state=557,this.match(M.LessThan),this.state=558,this.typeName(),this.state=559,this.match(M.Comma),this.state=560,this.typeName(),this.state=561,this.match(M.MoreThan)}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}typeSeries(){let e=new xp(this,this._ctx,this.state);this.enterRule(e,86,M.RULE_typeSeries);try{switch(this.enterOuterAlt(e,1),this.state=563,this.typeName(),this.state=567,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,65,this._ctx)){case 1:this.state=564,this.typeName();break;case 2:this.state=565,this.typeArray();break;case 3:this.state=566,this.typeMap();break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}typeArray(){let e=new yl(this,this._ctx,this.state);this.enterRule(e,88,M.RULE_typeArray);try{switch(this.state=578,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,66,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=569,this.typeName(),this.state=570,this.match(M.LessThan),this.state=571,this.typeName(),this.state=572,this.match(M.MoreThan);break;case 2:this.enterOuterAlt(e,2),this.state=574,this.typeName(),this.state=575,this.match(M.OpenBracket),this.state=576,this.match(M.CloseBracket);break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}typeGather(){let e=new Uo(this,this._ctx,this.state);this.enterRule(e,90,M.RULE_typeGather);try{switch(this.state=584,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,67,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=580,this.typeName();break;case 2:this.enterOuterAlt(e,2),this.state=581,this.typeArray();break;case 3:this.enterOuterAlt(e,3),this.state=582,this.typeMap();break;case 4:this.enterOuterAlt(e,4),this.state=583,this.typeSeries();break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}identifier(){let e=new xn(this,this._ctx,this.state);this.enterRule(e,92,M.RULE_identifier);let n;try{this.enterOuterAlt(e,1),this.state=586,n=this._input.LA(1),!(n-51&-32)&&1<<n-51&73?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}typeName(){let e=new hi(this,this._ctx,this.state);this.enterRule(e,94,M.RULE_typeName);let n;try{this.enterOuterAlt(e,1),this.state=588,this.identifier(),this.state=591,this._errHandler.sync(this),n=this._input.LA(1),n===3&&(this.state=589,this.match(M.Point),this.state=590,this.identifier())}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}name(){let e=new au(this,this._ctx,this.state);this.enterRule(e,96,M.RULE_name);try{let n;switch(this.state=614,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,72,this._ctx)){case 1:this.enterOuterAlt(e,1);{for(this.state=601,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,70,this._ctx);n!==2&&n!==Mr.INVALID_ALT_NUMBER;){if(n===1){switch(this.state=595,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,69,this._ctx)){case 1:this.state=593,this.identifier();break;case 2:this.state=594,this.methodElement();break}this.state=597,this.match(M.Point)}this.state=603,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,70,this._ctx)}this.state=604,this.identifier()}break;case 2:this.enterOuterAlt(e,2);{this.state=605,this.match(M.OpenParen),this.state=606,this.singleExpression(0),this.state=607,this.match(M.CloseParen),this.state=610,this._errHandler.sync(this),n=1;do{switch(n){case 1:this.state=608,this.match(M.Point),this.state=609,this.identifier();break;default:throw new fi(this)}this.state=612,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,71,this._ctx)}while(n!==2&&n!==Mr.INVALID_ALT_NUMBER)}break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}sempred(e,n,o){switch(n){case 17:return this.singleExpression_sempred(e,o)}return!0}singleExpression_sempred(e,n){switch(n){case 0:return this.precpred(this._ctx,10);case 1:return this.precpred(this._ctx,9);case 2:return this.precpred(this._ctx,8);case 3:return this.precpred(this._ctx,7);case 4:return this.precpred(this._ctx,6);case 5:return this.precpred(this._ctx,5);case 6:return this.precpred(this._ctx,4);case 7:return this.precpred(this._ctx,13)}return!0}static get _ATN(){return M.__ATN||(M.__ATN=new ip().deserialize(M._serializedATN)),M.__ATN}};w(M,"INDENT",1),w(M,"DEDENT",2),w(M,"Point",3),w(M,"OpenBracket",4),w(M,"CloseBracket",5),w(M,"OpenParen",6),w(M,"CloseParen",7),w(M,"Comma",8),w(M,"Assign",9),w(M,"QuestionMark",10),w(M,"Colon",11),w(M,"Plus",12),w(M,"Minus",13),w(M,"Multiply",14),w(M,"Divide",15),w(M,"Modulus",16),w(M,"Hashtag",17),w(M,"LessThan",18),w(M,"MoreThan",19),w(M,"LessThanEquals",20),w(M,"GreaterThanEquals",21),w(M,"Equals_",22),w(M,"NotEquals",23),w(M,"MultiplyAssign",24),w(M,"DivideAssign",25),w(M,"ModulusAssign",26),w(M,"PlusAssign",27),w(M,"MinusAssign",28),w(M,"ARROW",29),w(M,"ColonEquals",30),w(M,"BooleanLiteral",31),w(M,"IntegerLiteral",32),w(M,"DecimalLiteral",33),w(M,"Break",34),w(M,"And",35),w(M,"Export",36),w(M,"For",37),w(M,"Var",38),w(M,"Continue",39),w(M,"Varip",40),w(M,"Switch",41),w(M,"While",42),w(M,"If",43),w(M,"In",44),w(M,"Or",45),w(M,"Not",46),w(M,"Method",47),w(M,"Else",48),w(M,"To",49),w(M,"By",50),w(M,"Type",51),w(M,"Import",52),w(M,"As",53),w(M,"Map",54),w(M,"ColorLiteral",55),w(M,"StringLiteral",56),w(M,"Identifier",57),w(M,"HIDDEN_",58),w(M,"SKIP_",59),w(M,"NEWLINE",60),w(M,"EOF",sp.EOF),w(M,"RULE_program",0),w(M,"RULE_globalStmt",1),w(M,"RULE_blockStmt",2),w(M,"RULE_stmt",3),w(M,"RULE_simpleStmt",4),w(M,"RULE_flowStmt",5),w(M,"RULE_block",6),w(M,"RULE_blockLine",7),w(M,"RULE_variableDeclarationStmt",8),w(M,"RULE_variableDeclarationList",9),w(M,"RULE_varModifier",10),w(M,"RULE_blockSequence",11),w(M,"RULE_expressionSequence",12),w(M,"RULE_expressionBlockSequence",13),w(M,"RULE_varBlockStmt",14),w(M,"RULE_varArrayDeclaration",15),w(M,"RULE_blockExpression",16),w(M,"RULE_singleExpression",17),w(M,"RULE_brackethesized",18),w(M,"RULE_arguments",19),w(M,"RULE_argument",20),w(M,"RULE_ifStatement",21),w(M,"RULE_forStatement",22),w(M,"RULE_switchStatement",23),w(M,"RULE_caseClause",24),w(M,"RULE_defaultCaluse",25),w(M,"RULE_whileStatement",26),w(M,"RULE_importStmt",27),w(M,"RULE_importElement",28),w(M,"RULE_literal",29),w(M,"RULE_methodStmt",30),w(M,"RULE_methodElement",31),w(M,"RULE_methodName",32),w(M,"RULE_arrowFunction",33),w(M,"RULE_arrowFunctionParameters",34),w(M,"RULE_formalParameterList",35),w(M,"RULE_formalParameterArg",36),w(M,"RULE_arrowMethod",37),w(M,"RULE_arrowMethodParameters",38),w(M,"RULE_typeStatement",39),w(M,"RULE_typeElement",40),w(M,"RULE_assignmentOperator",41),w(M,"RULE_typeMap",42),w(M,"RULE_typeSeries",43),w(M,"RULE_typeArray",44),w(M,"RULE_typeGather",45),w(M,"RULE_identifier",46),w(M,"RULE_typeName",47),w(M,"RULE_name",48),w(M,"literalNames",[null,null,null,"'.'","'['","']'","'('","')'","','","'='","'?'","':'","'+'","'-'","'*'","'/'","'%'","'#'","'<'","'>'","'<='","'>='","'=='","'!='","'*='","'/='","'%='","'+='","'-='","'=>'","':='",null,null,null,"'break'","'and'","'export'","'for'","'var'","'continue'","'varip'","'switch'","'while'","'if'","'in'","'or'","'not'","'method'","'else'","'to'","'by'","'type'","'import'","'as'","'map'"]),w(M,"symbolicNames",[null,"INDENT","DEDENT","Point","OpenBracket","CloseBracket","OpenParen","CloseParen","Comma","Assign","QuestionMark","Colon","Plus","Minus","Multiply","Divide","Modulus","Hashtag","LessThan","MoreThan","LessThanEquals","GreaterThanEquals","Equals_","NotEquals","MultiplyAssign","DivideAssign","ModulusAssign","PlusAssign","MinusAssign","ARROW","ColonEquals","BooleanLiteral","IntegerLiteral","DecimalLiteral","Break","And","Export","For","Var","Continue","Varip","Switch","While","If","In","Or","Not","Method","Else","To","By","Type","Import","As","Map","ColorLiteral","StringLiteral","Identifier","HIDDEN_","SKIP_","NEWLINE"]),w(M,"ruleNames",["program","globalStmt","blockStmt","stmt","simpleStmt","flowStmt","block","blockLine","variableDeclarationStmt","variableDeclarationList","varModifier","blockSequence","expressionSequence","expressionBlockSequence","varBlockStmt","varArrayDeclaration","blockExpression","singleExpression","brackethesized","arguments","argument","ifStatement","forStatement","switchStatement","caseClause","defaultCaluse","whileStatement","importStmt","importElement","literal","methodStmt","methodElement","methodName","arrowFunction","arrowFunctionParameters","formalParameterList","formalParameterArg","arrowMethod","arrowMethodParameters","typeStatement","typeElement","assignmentOperator","typeMap","typeSeries","typeArray","typeGather","identifier","typeName","name"]),w(M,"_serializedATN",[4,1,60,617,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,2,46,7,46,2,47,7,47,2,48,7,48,1,0,1,0,5,0,101,8,0,10,0,12,0,104,9,0,1,0,1,0,1,1,1,1,3,1,110,8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,119,8,1,1,2,1,2,1,2,5,2,124,8,2,10,2,12,2,127,9,2,1,2,1,2,3,2,131,8,2,1,3,1,3,3,3,135,8,3,1,3,1,3,1,3,3,3,140,8,3,1,4,1,4,1,4,1,4,3,4,146,8,4,1,5,1,5,1,6,1,6,3,6,152,8,6,1,6,1,6,1,6,3,6,157,8,6,1,7,1,7,1,7,4,7,162,8,7,11,7,12,7,163,1,7,1,7,1,8,1,8,3,8,170,8,8,1,8,1,8,1,8,3,8,175,8,8,5,8,177,8,8,10,8,12,8,180,9,8,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,3,9,190,8,9,1,10,1,10,1,11,1,11,3,11,196,8,11,1,11,1,11,1,11,3,11,201,8,11,5,11,203,8,11,10,11,12,11,206,9,11,1,12,1,12,1,12,5,12,211,8,12,10,12,12,12,214,9,12,1,13,1,13,3,13,218,8,13,1,13,1,13,5,13,222,8,13,10,13,12,13,225,9,13,1,13,1,13,3,13,229,8,13,1,14,1,14,1,14,1,14,1,14,1,14,3,14,237,8,14,1,14,1,14,1,15,3,15,242,8,15,1,15,3,15,245,8,15,1,15,1,15,1,15,1,15,1,15,5,15,252,8,15,10,15,12,15,255,9,15,1,15,1,15,3,15,259,8,15,1,16,1,16,1,16,1,16,3,16,265,8,16,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,3,17,279,8,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,5,17,310,8,17,10,17,12,17,313,9,17,1,18,1,18,1,18,1,18,1,19,1,19,1,19,1,19,5,19,323,8,19,10,19,12,19,326,9,19,1,19,3,19,329,8,19,3,19,331,8,19,1,19,1,19,1,20,1,20,1,20,3,20,338,8,20,1,20,1,20,3,20,342,8,20,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,5,21,352,8,21,10,21,12,21,355,9,21,1,21,1,21,3,21,359,8,21,1,22,1,22,3,22,363,8,22,1,22,3,22,366,8,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,3,22,375,8,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,3,22,387,8,22,1,22,1,22,1,22,1,22,3,22,393,8,22,1,23,1,23,3,23,397,8,23,1,23,1,23,1,23,5,23,402,8,23,10,23,12,23,405,9,23,1,23,3,23,408,8,23,1,23,1,23,1,24,1,24,1,24,1,24,1,25,1,25,1,25,1,26,1,26,1,26,1,26,1,27,1,27,1,27,5,27,426,8,27,10,27,12,27,429,9,27,1,27,1,27,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,3,28,441,8,28,1,29,1,29,1,30,1,30,1,30,5,30,448,8,30,10,30,12,30,451,9,30,1,31,1,31,1,31,1,32,1,32,1,32,5,32,459,8,32,10,32,12,32,462,9,32,1,32,1,32,1,32,1,32,1,32,3,32,469,8,32,1,32,1,32,1,32,1,32,1,32,3,32,476,8,32,1,32,1,32,3,32,480,8,32,1,33,3,33,483,8,33,1,33,1,33,1,33,1,33,1,33,1,34,1,34,3,34,492,8,34,1,34,1,34,1,35,1,35,1,35,5,35,499,8,35,10,35,12,35,502,9,35,1,36,3,36,505,8,36,1,36,1,36,1,36,3,36,510,8,36,1,37,3,37,513,8,37,1,37,1,37,1,37,1,37,1,37,1,37,1,38,1,38,1,38,1,38,1,38,3,38,526,8,38,1,38,1,38,1,39,3,39,531,8,39,1,39,1,39,1,39,1,39,1,39,4,39,538,8,39,11,39,12,39,539,1,39,1,39,1,40,3,40,545,8,40,1,40,1,40,1,40,1,40,3,40,551,8,40,1,40,1,40,1,41,1,41,1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,43,1,43,1,43,1,43,3,43,568,8,43,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,3,44,579,8,44,1,45,1,45,1,45,1,45,3,45,585,8,45,1,46,1,46,1,47,1,47,1,47,3,47,592,8,47,1,48,1,48,3,48,596,8,48,1,48,1,48,5,48,600,8,48,10,48,12,48,603,9,48,1,48,1,48,1,48,1,48,1,48,1,48,4,48,611,8,48,11,48,12,48,612,3,48,615,8,48,1,48,0,1,34,49,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,0,9,2,0,34,34,39,39,2,0,38,38,40,40,1,0,12,13,1,0,14,16,1,0,18,21,1,0,22,23,2,0,31,33,55,56,2,0,24,28,30,30,3,0,51,51,54,54,57,57,661,0,102,1,0,0,0,2,118,1,0,0,0,4,125,1,0,0,0,6,139,1,0,0,0,8,145,1,0,0,0,10,147,1,0,0,0,12,156,1,0,0,0,14,158,1,0,0,0,16,169,1,0,0,0,18,189,1,0,0,0,20,191,1,0,0,0,22,195,1,0,0,0,24,207,1,0,0,0,26,223,1,0,0,0,28,236,1,0,0,0,30,258,1,0,0,0,32,264,1,0,0,0,34,278,1,0,0,0,36,314,1,0,0,0,38,318,1,0,0,0,40,337,1,0,0,0,42,343,1,0,0,0,44,392,1,0,0,0,46,394,1,0,0,0,48,411,1,0,0,0,50,415,1,0,0,0,52,418,1,0,0,0,54,422,1,0,0,0,56,432,1,0,0,0,58,442,1,0,0,0,60,444,1,0,0,0,62,452,1,0,0,0,64,468,1,0,0,0,66,482,1,0,0,0,68,489,1,0,0,0,70,495,1,0,0,0,72,504,1,0,0,0,74,512,1,0,0,0,76,520,1,0,0,0,78,530,1,0,0,0,80,544,1,0,0,0,82,554,1,0,0,0,84,556,1,0,0,0,86,563,1,0,0,0,88,578,1,0,0,0,90,584,1,0,0,0,92,586,1,0,0,0,94,588,1,0,0,0,96,614,1,0,0,0,98,101,5,60,0,0,99,101,3,2,1,0,100,98,1,0,0,0,100,99,1,0,0,0,101,104,1,0,0,0,102,100,1,0,0,0,102,103,1,0,0,0,103,105,1,0,0,0,104,102,1,0,0,0,105,106,5,0,0,1,106,1,1,0,0,0,107,109,3,16,8,0,108,110,5,8,0,0,109,108,1,0,0,0,109,110,1,0,0,0,110,111,1,0,0,0,111,112,5,60,0,0,112,119,1,0,0,0,113,119,3,4,2,0,114,119,3,54,27,0,115,119,3,66,33,0,116,119,3,74,37,0,117,119,3,78,39,0,118,107,1,0,0,0,118,113,1,0,0,0,118,114,1,0,0,0,118,115,1,0,0,0,118,116,1,0,0,0,118,117,1,0,0,0,119,3,1,0,0,0,120,121,3,16,8,0,121,122,5,8,0,0,122,124,1,0,0,0,123,120,1,0,0,0,124,127,1,0,0,0,125,123,1,0,0,0,125,126,1,0,0,0,126,130,1,0,0,0,127,125,1,0,0,0,128,131,3,28,14,0,129,131,3,32,16,0,130,128,1,0,0,0,130,129,1,0,0,0,131,5,1,0,0,0,132,134,3,8,4,0,133,135,5,8,0,0,134,133,1,0,0,0,134,135,1,0,0,0,135,136,1,0,0,0,136,137,5,60,0,0,137,140,1,0,0,0,138,140,3,26,13,0,139,132,1,0,0,0,139,138,1,0,0,0,140,7,1,0,0,0,141,146,3,24,12,0,142,146,3,22,11,0,143,146,3,36,18,0,144,146,3,10,5,0,145,141,1,0,0,0,145,142,1,0,0,0,145,143,1,0,0,0,145,144,1,0,0,0,146,9,1,0,0,0,147,148,7,0,0,0,148,11,1,0,0,0,149,151,3,8,4,0,150,152,5,8,0,0,151,150,1,0,0,0,151,152,1,0,0,0,152,153,1,0,0,0,153,154,5,60,0,0,154,157,1,0,0,0,155,157,3,14,7,0,156,149,1,0,0,0,156,155,1,0,0,0,157,13,1,0,0,0,158,159,5,60,0,0,159,161,5,1,0,0,160,162,3,6,3,0,161,160,1,0,0,0,162,163,1,0,0,0,163,161,1,0,0,0,163,164,1,0,0,0,164,165,1,0,0,0,165,166,5,2,0,0,166,15,1,0,0,0,167,170,3,60,30,0,168,170,3,18,9,0,169,167,1,0,0,0,169,168,1,0,0,0,170,178,1,0,0,0,171,174,5,8,0,0,172,175,3,60,30,0,173,175,3,18,9,0,174,172,1,0,0,0,174,173,1,0,0,0,175,177,1,0,0,0,176,171,1,0,0,0,177,180,1,0,0,0,178,176,1,0,0,0,178,179,1,0,0,0,179,17,1,0,0,0,180,178,1,0,0,0,181,182,3,30,15,0,182,183,5,9,0,0,183,184,3,34,17,0,184,190,1,0,0,0,185,186,3,96,48,0,186,187,3,82,41,0,187,188,3,34,17,0,188,190,1,0,0,0,189,181,1,0,0,0,189,185,1,0,0,0,190,19,1,0,0,0,191,192,7,1,0,0,192,21,1,0,0,0,193,196,3,34,17,0,194,196,3,18,9,0,195,193,1,0,0,0,195,194,1,0,0,0,196,204,1,0,0,0,197,200,5,8,0,0,198,201,3,34,17,0,199,201,3,18,9,0,200,198,1,0,0,0,200,199,1,0,0,0,201,203,1,0,0,0,202,197,1,0,0,0,203,206,1,0,0,0,204,202,1,0,0,0,204,205,1,0,0,0,205,23,1,0,0,0,206,204,1,0,0,0,207,212,3,34,17,0,208,209,5,8,0,0,209,211,3,34,17,0,210,208,1,0,0,0,211,214,1,0,0,0,212,210,1,0,0,0,212,213,1,0,0,0,213,25,1,0,0,0,214,212,1,0,0,0,215,218,3,34,17,0,216,218,3,18,9,0,217,215,1,0,0,0,217,216,1,0,0,0,218,219,1,0,0,0,219,220,5,8,0,0,220,222,1,0,0,0,221,217,1,0,0,0,222,225,1,0,0,0,223,221,1,0,0,0,223,224,1,0,0,0,224,228,1,0,0,0,225,223,1,0,0,0,226,229,3,28,14,0,227,229,3,32,16,0,228,226,1,0,0,0,228,227,1,0,0,0,229,27,1,0,0,0,230,231,3,30,15,0,231,232,5,9,0,0,232,237,1,0,0,0,233,234,3,96,48,0,234,235,3,82,41,0,235,237,1,0,0,0,236,230,1,0,0,0,236,233,1,0,0,0,237,238,1,0,0,0,238,239,3,32,16,0,239,29,1,0,0,0,240,242,3,20,10,0,241,240,1,0,0,0,241,242,1,0,0,0,242,244,1,0,0,0,243,245,3,90,45,0,244,243,1,0,0,0,244,245,1,0,0,0,245,246,1,0,0,0,246,259,3,92,46,0,247,248,5,4,0,0,248,253,3,92,46,0,249,250,5,8,0,0,250,252,3,92,46,0,251,249,1,0,0,0,252,255,1,0,0,0,253,251,1,0,0,0,253,254,1,0,0,0,254,256,1,0,0,0,255,253,1,0,0,0,256,257,5,5,0,0,257,259,1,0,0,0,258,241,1,0,0,0,258,247,1,0,0,0,259,31,1,0,0,0,260,265,3,42,21,0,261,265,3,44,22,0,262,265,3,52,26,0,263,265,3,46,23,0,264,260,1,0,0,0,264,261,1,0,0,0,264,262,1,0,0,0,264,263,1,0,0,0,265,33,1,0,0,0,266,267,6,17,-1,0,267,279,3,60,30,0,268,269,7,2,0,0,269,279,3,34,17,12,270,271,5,46,0,0,271,279,3,34,17,11,272,279,3,96,48,0,273,279,3,58,29,0,274,275,5,6,0,0,275,276,3,34,17,0,276,277,5,7,0,0,277,279,1,0,0,0,278,266,1,0,0,0,278,268,1,0,0,0,278,270,1,0,0,0,278,272,1,0,0,0,278,273,1,0,0,0,278,274,1,0,0,0,279,311,1,0,0,0,280,281,10,10,0,0,281,282,7,3,0,0,282,310,3,34,17,11,283,284,10,9,0,0,284,285,7,2,0,0,285,310,3,34,17,10,286,287,10,8,0,0,287,288,7,4,0,0,288,310,3,34,17,9,289,290,10,7,0,0,290,291,7,5,0,0,291,310,3,34,17,8,292,293,10,6,0,0,293,294,5,35,0,0,294,310,3,34,17,7,295,296,10,5,0,0,296,297,5,45,0,0,297,310,3,34,17,6,298,299,10,4,0,0,299,300,5,10,0,0,300,301,3,34,17,0,301,302,5,11,0,0,302,303,3,34,17,4,303,310,1,0,0,0,304,305,10,13,0,0,305,306,5,4,0,0,306,307,3,34,17,0,307,308,5,5,0,0,308,310,1,0,0,0,309,280,1,0,0,0,309,283,1,0,0,0,309,286,1,0,0,0,309,289,1,0,0,0,309,292,1,0,0,0,309,295,1,0,0,0,309,298,1,0,0,0,309,304,1,0,0,0,310,313,1,0,0,0,311,309,1,0,0,0,311,312,1,0,0,0,312,35,1,0,0,0,313,311,1,0,0,0,314,315,5,4,0,0,315,316,3,24,12,0,316,317,5,5,0,0,317,37,1,0,0,0,318,330,5,6,0,0,319,324,3,40,20,0,320,321,5,8,0,0,321,323,3,40,20,0,322,320,1,0,0,0,323,326,1,0,0,0,324,322,1,0,0,0,324,325,1,0,0,0,325,328,1,0,0,0,326,324,1,0,0,0,327,329,5,8,0,0,328,327,1,0,0,0,328,329,1,0,0,0,329,331,1,0,0,0,330,319,1,0,0,0,330,331,1,0,0,0,331,332,1,0,0,0,332,333,5,7,0,0,333,39,1,0,0,0,334,335,3,92,46,0,335,336,5,9,0,0,336,338,1,0,0,0,337,334,1,0,0,0,337,338,1,0,0,0,338,341,1,0,0,0,339,342,3,34,17,0,340,342,3,36,18,0,341,339,1,0,0,0,341,340,1,0,0,0,342,41,1,0,0,0,343,344,5,43,0,0,344,345,3,34,17,0,345,353,3,14,7,0,346,347,5,48,0,0,347,348,5,43,0,0,348,349,3,34,17,0,349,350,3,14,7,0,350,352,1,0,0,0,351,346,1,0,0,0,352,355,1,0,0,0,353,351,1,0,0,0,353,354,1,0,0,0,354,358,1,0,0,0,355,353,1,0,0,0,356,357,5,48,0,0,357,359,3,14,7,0,358,356,1,0,0,0,358,359,1,0,0,0,359,43,1,0,0,0,360,362,5,37,0,0,361,363,3,20,10,0,362,361,1,0,0,0,362,363,1,0,0,0,363,365,1,0,0,0,364,366,3,90,45,0,365,364,1,0,0,0,365,366,1,0,0,0,366,367,1,0,0,0,367,368,3,92,46,0,368,369,5,9,0,0,369,370,3,34,17,0,370,371,5,49,0,0,371,374,3,34,17,0,372,373,5,50,0,0,373,375,3,34,17,0,374,372,1,0,0,0,374,375,1,0,0,0,375,376,1,0,0,0,376,377,3,14,7,0,377,393,1,0,0,0,378,386,5,37,0,0,379,387,3,92,46,0,380,381,5,4,0,0,381,382,3,92,46,0,382,383,5,8,0,0,383,384,3,92,46,0,384,385,5,5,0,0,385,387,1,0,0,0,386,379,1,0,0,0,386,380,1,0,0,0,387,388,1,0,0,0,388,389,5,44,0,0,389,390,3,34,17,0,390,391,3,14,7,0,391,393,1,0,0,0,392,360,1,0,0,0,392,378,1,0,0,0,393,45,1,0,0,0,394,396,5,41,0,0,395,397,3,34,17,0,396,395,1,0,0,0,396,397,1,0,0,0,397,398,1,0,0,0,398,399,5,60,0,0,399,403,5,1,0,0,400,402,3,48,24,0,401,400,1,0,0,0,402,405,1,0,0,0,403,401,1,0,0,0,403,404,1,0,0,0,404,407,1,0,0,0,405,403,1,0,0,0,406,408,3,50,25,0,407,406,1,0,0,0,407,408,1,0,0,0,408,409,1,0,0,0,409,410,5,2,0,0,410,47,1,0,0,0,411,412,3,34,17,0,412,413,5,29,0,0,413,414,3,12,6,0,414,49,1,0,0,0,415,416,5,29,0,0,416,417,3,12,6,0,417,51,1,0,0,0,418,419,5,42,0,0,419,420,3,34,17,0,420,421,3,14,7,0,421,53,1,0,0,0,422,427,3,56,28,0,423,424,5,8,0,0,424,426,3,56,28,0,425,423,1,0,0,0,426,429,1,0,0,0,427,425,1,0,0,0,427,428,1,0,0,0,428,430,1,0,0,0,429,427,1,0,0,0,430,431,5,60,0,0,431,55,1,0,0,0,432,433,5,52,0,0,433,434,3,92,46,0,434,435,5,15,0,0,435,436,3,92,46,0,436,437,5,15,0,0,437,440,5,32,0,0,438,439,5,53,0,0,439,441,3,92,46,0,440,438,1,0,0,0,440,441,1,0,0,0,441,57,1,0,0,0,442,443,7,6,0,0,443,59,1,0,0,0,444,449,3,62,31,0,445,446,5,3,0,0,446,448,3,62,31,0,447,445,1,0,0,0,448,451,1,0,0,0,449,447,1,0,0,0,449,450,1,0,0,0,450,61,1,0,0,0,451,449,1,0,0,0,452,453,3,64,32,0,453,454,3,38,19,0,454,63,1,0,0,0,455,456,3,92,46,0,456,457,5,3,0,0,457,459,1,0,0,0,458,455,1,0,0,0,459,462,1,0,0,0,460,458,1,0,0,0,460,461,1,0,0,0,461,469,1,0,0,0,462,460,1,0,0,0,463,464,5,6,0,0,464,465,3,34,17,0,465,466,5,7,0,0,466,467,5,3,0,0,467,469,1,0,0,0,468,460,1,0,0,0,468,463,1,0,0,0,469,470,1,0,0,0,470,479,3,92,46,0,471,472,5,18,0,0,472,475,3,94,47,0,473,474,5,8,0,0,474,476,3,94,47,0,475,473,1,0,0,0,475,476,1,0,0,0,476,477,1,0,0,0,477,478,5,19,0,0,478,480,1,0,0,0,479,471,1,0,0,0,479,480,1,0,0,0,480,65,1,0,0,0,481,483,5,36,0,0,482,481,1,0,0,0,482,483,1,0,0,0,483,484,1,0,0,0,484,485,3,92,46,0,485,486,3,68,34,0,486,487,5,29,0,0,487,488,3,12,6,0,488,67,1,0,0,0,489,491,5,6,0,0,490,492,3,70,35,0,491,490,1,0,0,0,491,492,1,0,0,0,492,493,1,0,0,0,493,494,5,7,0,0,494,69,1,0,0,0,495,500,3,72,36,0,496,497,5,8,0,0,497,499,3,72,36,0,498,496,1,0,0,0,499,502,1,0,0,0,500,498,1,0,0,0,500,501,1,0,0,0,501,71,1,0,0,0,502,500,1,0,0,0,503,505,3,90,45,0,504,503,1,0,0,0,504,505,1,0,0,0,505,506,1,0,0,0,506,509,3,92,46,0,507,508,5,9,0,0,508,510,3,34,17,0,509,507,1,0,0,0,509,510,1,0,0,0,510,73,1,0,0,0,511,513,5,36,0,0,512,511,1,0,0,0,512,513,1,0,0,0,513,514,1,0,0,0,514,515,5,47,0,0,515,516,3,92,46,0,516,517,3,76,38,0,517,518,5,29,0,0,518,519,3,12,6,0,519,75,1,0,0,0,520,521,5,6,0,0,521,522,3,90,45,0,522,525,3,92,46,0,523,524,5,8,0,0,524,526,3,70,35,0,525,523,1,0,0,0,525,526,1,0,0,0,526,527,1,0,0,0,527,528,5,7,0,0,528,77,1,0,0,0,529,531,5,36,0,0,530,529,1,0,0,0,530,531,1,0,0,0,531,532,1,0,0,0,532,533,5,51,0,0,533,534,3,92,46,0,534,535,5,60,0,0,535,537,5,1,0,0,536,538,3,80,40,0,537,536,1,0,0,0,538,539,1,0,0,0,539,537,1,0,0,0,539,540,1,0,0,0,540,541,1,0,0,0,541,542,5,2,0,0,542,79,1,0,0,0,543,545,5,40,0,0,544,543,1,0,0,0,544,545,1,0,0,0,545,546,1,0,0,0,546,547,3,90,45,0,547,550,3,92,46,0,548,549,5,9,0,0,549,551,3,34,17,0,550,548,1,0,0,0,550,551,1,0,0,0,551,552,1,0,0,0,552,553,5,60,0,0,553,81,1,0,0,0,554,555,7,7,0,0,555,83,1,0,0,0,556,557,5,54,0,0,557,558,5,18,0,0,558,559,3,94,47,0,559,560,5,8,0,0,560,561,3,94,47,0,561,562,5,19,0,0,562,85,1,0,0,0,563,567,3,94,47,0,564,568,3,94,47,0,565,568,3,88,44,0,566,568,3,84,42,0,567,564,1,0,0,0,567,565,1,0,0,0,567,566,1,0,0,0,568,87,1,0,0,0,569,570,3,94,47,0,570,571,5,18,0,0,571,572,3,94,47,0,572,573,5,19,0,0,573,579,1,0,0,0,574,575,3,94,47,0,575,576,5,4,0,0,576,577,5,5,0,0,577,579,1,0,0,0,578,569,1,0,0,0,578,574,1,0,0,0,579,89,1,0,0,0,580,585,3,94,47,0,581,585,3,88,44,0,582,585,3,84,42,0,583,585,3,86,43,0,584,580,1,0,0,0,584,581,1,0,0,0,584,582,1,0,0,0,584,583,1,0,0,0,585,91,1,0,0,0,586,587,7,8,0,0,587,93,1,0,0,0,588,591,3,92,46,0,589,590,5,3,0,0,590,592,3,92,46,0,591,589,1,0,0,0,591,592,1,0,0,0,592,95,1,0,0,0,593,596,3,92,46,0,594,596,3,62,31,0,595,593,1,0,0,0,595,594,1,0,0,0,596,597,1,0,0,0,597,598,5,3,0,0,598,600,1,0,0,0,599,595,1,0,0,0,600,603,1,0,0,0,601,599,1,0,0,0,601,602,1,0,0,0,602,604,1,0,0,0,603,601,1,0,0,0,604,615,3,92,46,0,605,606,5,6,0,0,606,607,3,34,17,0,607,610,5,7,0,0,608,609,5,3,0,0,609,611,3,92,46,0,610,608,1,0,0,0,611,612,1,0,0,0,612,610,1,0,0,0,612,613,1,0,0,0,613,615,1,0,0,0,614,601,1,0,0,0,614,605,1,0,0,0,615,97,1,0,0,0,73,100,102,109,118,125,130,134,139,145,151,156,163,169,174,178,189,195,200,204,212,217,223,228,236,241,244,253,258,264,278,309,311,324,328,330,337,341,353,358,362,365,374,386,392,396,403,407,427,440,449,460,468,475,479,482,491,500,504,509,512,525,530,539,544,550,567,578,584,591,595,601,612,614]),w(M,"__ATN"),w(M,"DecisionsToDFA",M._ATN.decisionToState.map((e,n)=>new op(e,n)));let I=M;class em extends Qe{constructor(e,n,o){super(n,o),this.parser=e}EOF(){return this.getToken(I.EOF,0)}NEWLINE_list(){return this.getTokens(I.NEWLINE)}NEWLINE(e){return this.getToken(I.NEWLINE,e)}globalStmt_list(){return this.getTypedRuleContexts(el)}globalStmt(e){return this.getTypedRuleContext(el,e)}get ruleIndex(){return I.RULE_program}accept(e){return e.visitProgram?e.visitProgram(this):e.visitChildren(this)}}class el extends Qe{constructor(e,n,o){super(n,o),this.parser=e}variableDeclarationStmt(){return this.getTypedRuleContext(nu,0)}NEWLINE(){return this.getToken(I.NEWLINE,0)}Comma(){return this.getToken(I.Comma,0)}blockStmt(){return this.getTypedRuleContext(up,0)}importStmt(){return this.getTypedRuleContext(_p,0)}arrowFunction(){return this.getTypedRuleContext(vp,0)}arrowMethod(){return this.getTypedRuleContext(Sp,0)}typeStatement(){return this.getTypedRuleContext(Ap,0)}get ruleIndex(){return I.RULE_globalStmt}accept(e){return e.visitGlobalStmt?e.visitGlobalStmt(this):e.visitChildren(this)}}class up extends Qe{constructor(e,n,o){super(n,o),this.parser=e}varBlockStmt(){return this.getTypedRuleContext(ol,0)}blockExpression(){return this.getTypedRuleContext(ru,0)}variableDeclarationStmt_list(){return this.getTypedRuleContexts(nu)}variableDeclarationStmt(e){return this.getTypedRuleContext(nu,e)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}get ruleIndex(){return I.RULE_blockStmt}accept(e){return e.visitBlockStmt?e.visitBlockStmt(this):e.visitChildren(this)}}class tl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}simpleStmt(){return this.getTypedRuleContext(nl,0)}NEWLINE(){return this.getToken(I.NEWLINE,0)}Comma(){return this.getToken(I.Comma,0)}expressionBlockSequence(){return this.getTypedRuleContext(fp,0)}get ruleIndex(){return I.RULE_stmt}accept(e){return e.visitStmt?e.visitStmt(this):e.visitChildren(this)}}class nl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}expressionSequence(){return this.getTypedRuleContext(il,0)}blockSequence(){return this.getTypedRuleContext(lp,0)}brackethesized(){return this.getTypedRuleContext(al,0)}flowStmt(){return this.getTypedRuleContext(cp,0)}get ruleIndex(){return I.RULE_simpleStmt}accept(e){return e.visitSimpleStmt?e.visitSimpleStmt(this):e.visitChildren(this)}}class cp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Break(){return this.getToken(I.Break,0)}Continue(){return this.getToken(I.Continue,0)}get ruleIndex(){return I.RULE_flowStmt}accept(e){return e.visitFlowStmt?e.visitFlowStmt(this):e.visitChildren(this)}}class ts extends Qe{constructor(e,n,o){super(n,o),this.parser=e}simpleStmt(){return this.getTypedRuleContext(nl,0)}NEWLINE(){return this.getToken(I.NEWLINE,0)}Comma(){return this.getToken(I.Comma,0)}blockLine(){return this.getTypedRuleContext(fo,0)}get ruleIndex(){return I.RULE_block}accept(e){return e.visitBlock?e.visitBlock(this):e.visitChildren(this)}}class fo extends Qe{constructor(e,n,o){super(n,o),this.parser=e}NEWLINE(){return this.getToken(I.NEWLINE,0)}INDENT(){return this.getToken(I.INDENT,0)}DEDENT(){return this.getToken(I.DEDENT,0)}stmt_list(){return this.getTypedRuleContexts(tl)}stmt(e){return this.getTypedRuleContext(tl,e)}get ruleIndex(){return I.RULE_blockLine}accept(e){return e.visitBlockLine?e.visitBlockLine(this):e.visitChildren(this)}}class nu extends Qe{constructor(e,n,o){super(n,o),this.parser=e}methodStmt_list(){return this.getTypedRuleContexts(ou)}methodStmt(e){return this.getTypedRuleContext(ou,e)}variableDeclarationList_list(){return this.getTypedRuleContexts(ki)}variableDeclarationList(e){return this.getTypedRuleContext(ki,e)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}get ruleIndex(){return I.RULE_variableDeclarationStmt}accept(e){return e.visitVariableDeclarationStmt?e.visitVariableDeclarationStmt(this):e.visitChildren(this)}}class ki extends Qe{constructor(e,n,o){super(n,o),this.parser=e}get ruleIndex(){return I.RULE_variableDeclarationList}copyFrom(e){super.copyFrom(e)}}class tm extends ki{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}name(){return this.getTypedRuleContext(au,0)}assignmentOperator(){return this.getTypedRuleContext(pl,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}accept(e){return e.visitAgainAssign?e.visitAgainAssign(this):e.visitChildren(this)}}class nm extends ki{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}varArrayDeclaration(){return this.getTypedRuleContext(ns,0)}Assign(){return this.getToken(I.Assign,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}accept(e){return e.visitDeclareAssign?e.visitDeclareAssign(this):e.visitChildren(this)}}class rl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Var(){return this.getToken(I.Var,0)}Varip(){return this.getToken(I.Varip,0)}get ruleIndex(){return I.RULE_varModifier}accept(e){return e.visitVarModifier?e.visitVarModifier(this):e.visitChildren(this)}}class lp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}variableDeclarationList_list(){return this.getTypedRuleContexts(ki)}variableDeclarationList(e){return this.getTypedRuleContext(ki,e)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}get ruleIndex(){return I.RULE_blockSequence}accept(e){return e.visitBlockSequence?e.visitBlockSequence(this):e.visitChildren(this)}}class il extends Qe{constructor(e,n,o){super(n,o),this.parser=e}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}get ruleIndex(){return I.RULE_expressionSequence}accept(e){return e.visitExpressionSequence?e.visitExpressionSequence(this):e.visitChildren(this)}}class fp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}varBlockStmt(){return this.getTypedRuleContext(ol,0)}blockExpression(){return this.getTypedRuleContext(ru,0)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}variableDeclarationList_list(){return this.getTypedRuleContexts(ki)}variableDeclarationList(e){return this.getTypedRuleContext(ki,e)}get ruleIndex(){return I.RULE_expressionBlockSequence}accept(e){return e.visitExpressionBlockSequence?e.visitExpressionBlockSequence(this):e.visitChildren(this)}}class ol extends Qe{constructor(e,n,o){super(n,o),this.parser=e}blockExpression(){return this.getTypedRuleContext(ru,0)}varArrayDeclaration(){return this.getTypedRuleContext(ns,0)}Assign(){return this.getToken(I.Assign,0)}name(){return this.getTypedRuleContext(au,0)}assignmentOperator(){return this.getTypedRuleContext(pl,0)}get ruleIndex(){return I.RULE_varBlockStmt}accept(e){return e.visitVarBlockStmt?e.visitVarBlockStmt(this):e.visitChildren(this)}}class ns extends Qe{constructor(e,n,o){super(n,o),this.parser=e}get ruleIndex(){return I.RULE_varArrayDeclaration}copyFrom(e){super.copyFrom(e)}}class rm extends ns{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}OpenBracket(){return this.getToken(I.OpenBracket,0)}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}CloseBracket(){return this.getToken(I.CloseBracket,0)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}accept(e){return e.visitVarMultiple?e.visitVarMultiple(this):e.visitChildren(this)}}class im extends ns{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}identifier(){return this.getTypedRuleContext(xn,0)}varModifier(){return this.getTypedRuleContext(rl,0)}typeGather(){return this.getTypedRuleContext(Uo,0)}accept(e){return e.visitVarSingle?e.visitVarSingle(this):e.visitChildren(this)}}class ru extends Qe{constructor(e,n,o){super(n,o),this.parser=e}ifStatement(){return this.getTypedRuleContext(pp,0)}forStatement(){return this.getTypedRuleContext(iu,0)}whileStatement(){return this.getTypedRuleContext(mp,0)}switchStatement(){return this.getTypedRuleContext(dp,0)}get ruleIndex(){return I.RULE_blockExpression}accept(e){return e.visitBlockExpression?e.visitBlockExpression(this):e.visitChildren(this)}}class Ve extends Qe{constructor(e,n,o){super(n,o),this.parser=e}get ruleIndex(){return I.RULE_singleExpression}copyFrom(e){super.copyFrom(e)}}class om extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}OpenParen(){return this.getToken(I.OpenParen,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}CloseParen(){return this.getToken(I.CloseParen,0)}accept(e){return e.visitParenthesizedExpression?e.visitParenthesizedExpression(this):e.visitChildren(this)}}class am extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}Plus(){return this.getToken(I.Plus,0)}Minus(){return this.getToken(I.Minus,0)}accept(e){return e.visitAdditiveExpression?e.visitAdditiveExpression(this):e.visitChildren(this)}}class sm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}LessThan(){return this.getToken(I.LessThan,0)}MoreThan(){return this.getToken(I.MoreThan,0)}LessThanEquals(){return this.getToken(I.LessThanEquals,0)}GreaterThanEquals(){return this.getToken(I.GreaterThanEquals,0)}accept(e){return e.visitRelationalExpression?e.visitRelationalExpression(this):e.visitChildren(this)}}class um extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}QuestionMark(){return this.getToken(I.QuestionMark,0)}Colon(){return this.getToken(I.Colon,0)}accept(e){return e.visitTernaryExpression?e.visitTernaryExpression(this):e.visitChildren(this)}}class cm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}And(){return this.getToken(I.And,0)}accept(e){return e.visitLogicalAndExpression?e.visitLogicalAndExpression(this):e.visitChildren(this)}}class lm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}name(){return this.getTypedRuleContext(au,0)}accept(e){return e.visitNameExpression?e.visitNameExpression(this):e.visitChildren(this)}}class fm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}literal(){return this.getTypedRuleContext(gp,0)}accept(e){return e.visitLiteralExpression?e.visitLiteralExpression(this):e.visitChildren(this)}}class hm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}Or(){return this.getToken(I.Or,0)}accept(e){return e.visitLogicalOrExpression?e.visitLogicalOrExpression(this):e.visitChildren(this)}}class pm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression(){return this.getTypedRuleContext(Ve,0)}Minus(){return this.getToken(I.Minus,0)}Plus(){return this.getToken(I.Plus,0)}accept(e){return e.visitUnaryExpression?e.visitUnaryExpression(this):e.visitChildren(this)}}class dm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}Not(){return this.getToken(I.Not,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}accept(e){return e.visitNotExpression?e.visitNotExpression(this):e.visitChildren(this)}}class ym extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}OpenBracket(){return this.getToken(I.OpenBracket,0)}CloseBracket(){return this.getToken(I.CloseBracket,0)}accept(e){return e.visitMemberIndexExpression?e.visitMemberIndexExpression(this):e.visitChildren(this)}}class mm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}methodStmt(){return this.getTypedRuleContext(ou,0)}accept(e){return e.visitMethodExpression?e.visitMethodExpression(this):e.visitChildren(this)}}class _m extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}Equals_(){return this.getToken(I.Equals_,0)}NotEquals(){return this.getToken(I.NotEquals,0)}accept(e){return e.visitEqualityExpression?e.visitEqualityExpression(this):e.visitChildren(this)}}class gm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}Multiply(){return this.getToken(I.Multiply,0)}Divide(){return this.getToken(I.Divide,0)}Modulus(){return this.getToken(I.Modulus,0)}accept(e){return e.visitMultiplicativeExpression?e.visitMultiplicativeExpression(this):e.visitChildren(this)}}class al extends Qe{constructor(e,n,o){super(n,o),this.parser=e}OpenBracket(){return this.getToken(I.OpenBracket,0)}expressionSequence(){return this.getTypedRuleContext(il,0)}CloseBracket(){return this.getToken(I.CloseBracket,0)}get ruleIndex(){return I.RULE_brackethesized}accept(e){return e.visitBrackethesized?e.visitBrackethesized(this):e.visitChildren(this)}}class hp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}OpenParen(){return this.getToken(I.OpenParen,0)}CloseParen(){return this.getToken(I.CloseParen,0)}argument_list(){return this.getTypedRuleContexts(sl)}argument(e){return this.getTypedRuleContext(sl,e)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}get ruleIndex(){return I.RULE_arguments}accept(e){return e.visitArguments?e.visitArguments(this):e.visitChildren(this)}}class sl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}singleExpression(){return this.getTypedRuleContext(Ve,0)}brackethesized(){return this.getTypedRuleContext(al,0)}identifier(){return this.getTypedRuleContext(xn,0)}Assign(){return this.getToken(I.Assign,0)}get ruleIndex(){return I.RULE_argument}accept(e){return e.visitArgument?e.visitArgument(this):e.visitChildren(this)}}class pp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}If_list(){return this.getTokens(I.If)}If(e){return this.getToken(I.If,e)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}blockLine_list(){return this.getTypedRuleContexts(fo)}blockLine(e){return this.getTypedRuleContext(fo,e)}Else_list(){return this.getTokens(I.Else)}Else(e){return this.getToken(I.Else,e)}get ruleIndex(){return I.RULE_ifStatement}accept(e){return e.visitIfStatement?e.visitIfStatement(this):e.visitChildren(this)}}class iu extends Qe{constructor(e,n,o){super(n,o),this.parser=e}get ruleIndex(){return I.RULE_forStatement}copyFrom(e){super.copyFrom(e)}}class bm extends iu{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}For(){return this.getToken(I.For,0)}identifier(){return this.getTypedRuleContext(xn,0)}Assign(){return this.getToken(I.Assign,0)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}To(){return this.getToken(I.To,0)}blockLine(){return this.getTypedRuleContext(fo,0)}varModifier(){return this.getTypedRuleContext(rl,0)}typeGather(){return this.getTypedRuleContext(Uo,0)}By(){return this.getToken(I.By,0)}accept(e){return e.visitForToStatement?e.visitForToStatement(this):e.visitChildren(this)}}class vm extends iu{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}For(){return this.getToken(I.For,0)}In(){return this.getToken(I.In,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}blockLine(){return this.getTypedRuleContext(fo,0)}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}OpenBracket(){return this.getToken(I.OpenBracket,0)}Comma(){return this.getToken(I.Comma,0)}CloseBracket(){return this.getToken(I.CloseBracket,0)}accept(e){return e.visitForInStatement?e.visitForInStatement(this):e.visitChildren(this)}}class dp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Switch(){return this.getToken(I.Switch,0)}NEWLINE(){return this.getToken(I.NEWLINE,0)}INDENT(){return this.getToken(I.INDENT,0)}DEDENT(){return this.getToken(I.DEDENT,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}caseClause_list(){return this.getTypedRuleContexts(ul)}caseClause(e){return this.getTypedRuleContext(ul,e)}defaultCaluse(){return this.getTypedRuleContext(yp,0)}get ruleIndex(){return I.RULE_switchStatement}accept(e){return e.visitSwitchStatement?e.visitSwitchStatement(this):e.visitChildren(this)}}class ul extends Qe{constructor(e,n,o){super(n,o),this.parser=e}singleExpression(){return this.getTypedRuleContext(Ve,0)}ARROW(){return this.getToken(I.ARROW,0)}block(){return this.getTypedRuleContext(ts,0)}get ruleIndex(){return I.RULE_caseClause}accept(e){return e.visitCaseClause?e.visitCaseClause(this):e.visitChildren(this)}}class yp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}ARROW(){return this.getToken(I.ARROW,0)}block(){return this.getTypedRuleContext(ts,0)}get ruleIndex(){return I.RULE_defaultCaluse}accept(e){return e.visitDefaultCaluse?e.visitDefaultCaluse(this):e.visitChildren(this)}}class mp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}While(){return this.getToken(I.While,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}blockLine(){return this.getTypedRuleContext(fo,0)}get ruleIndex(){return I.RULE_whileStatement}accept(e){return e.visitWhileStatement?e.visitWhileStatement(this):e.visitChildren(this)}}class _p extends Qe{constructor(e,n,o){super(n,o),this.parser=e}importElement_list(){return this.getTypedRuleContexts(cl)}importElement(e){return this.getTypedRuleContext(cl,e)}NEWLINE(){return this.getToken(I.NEWLINE,0)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}get ruleIndex(){return I.RULE_importStmt}accept(e){return e.visitImportStmt?e.visitImportStmt(this):e.visitChildren(this)}}class cl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Import(){return this.getToken(I.Import,0)}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}Divide_list(){return this.getTokens(I.Divide)}Divide(e){return this.getToken(I.Divide,e)}IntegerLiteral(){return this.getToken(I.IntegerLiteral,0)}As(){return this.getToken(I.As,0)}get ruleIndex(){return I.RULE_importElement}accept(e){return e.visitImportElement?e.visitImportElement(this):e.visitChildren(this)}}class gp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}BooleanLiteral(){return this.getToken(I.BooleanLiteral,0)}ColorLiteral(){return this.getToken(I.ColorLiteral,0)}StringLiteral(){return this.getToken(I.StringLiteral,0)}IntegerLiteral(){return this.getToken(I.IntegerLiteral,0)}DecimalLiteral(){return this.getToken(I.DecimalLiteral,0)}get ruleIndex(){return I.RULE_literal}accept(e){return e.visitLiteral?e.visitLiteral(this):e.visitChildren(this)}}class ou extends Qe{constructor(e,n,o){super(n,o),this.parser=e}methodElement_list(){return this.getTypedRuleContexts(rs)}methodElement(e){return this.getTypedRuleContext(rs,e)}Point_list(){return this.getTokens(I.Point)}Point(e){return this.getToken(I.Point,e)}get ruleIndex(){return I.RULE_methodStmt}accept(e){return e.visitMethodStmt?e.visitMethodStmt(this):e.visitChildren(this)}}class rs extends Qe{constructor(e,n,o){super(n,o),this.parser=e}methodName(){return this.getTypedRuleContext(bp,0)}arguments(){return this.getTypedRuleContext(hp,0)}get ruleIndex(){return I.RULE_methodElement}accept(e){return e.visitMethodElement?e.visitMethodElement(this):e.visitChildren(this)}}class bp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}OpenParen(){return this.getToken(I.OpenParen,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}CloseParen(){return this.getToken(I.CloseParen,0)}Point_list(){return this.getTokens(I.Point)}Point(e){return this.getToken(I.Point,e)}LessThan(){return this.getToken(I.LessThan,0)}typeName_list(){return this.getTypedRuleContexts(hi)}typeName(e){return this.getTypedRuleContext(hi,e)}MoreThan(){return this.getToken(I.MoreThan,0)}Comma(){return this.getToken(I.Comma,0)}get ruleIndex(){return I.RULE_methodName}accept(e){return e.visitMethodName?e.visitMethodName(this):e.visitChildren(this)}}class vp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier(){return this.getTypedRuleContext(xn,0)}arrowFunctionParameters(){return this.getTypedRuleContext(Ep,0)}ARROW(){return this.getToken(I.ARROW,0)}block(){return this.getTypedRuleContext(ts,0)}Export(){return this.getToken(I.Export,0)}get ruleIndex(){return I.RULE_arrowFunction}accept(e){return e.visitArrowFunction?e.visitArrowFunction(this):e.visitChildren(this)}}class Ep extends Qe{constructor(e,n,o){super(n,o),this.parser=e}OpenParen(){return this.getToken(I.OpenParen,0)}CloseParen(){return this.getToken(I.CloseParen,0)}formalParameterList(){return this.getTypedRuleContext(ll,0)}get ruleIndex(){return I.RULE_arrowFunctionParameters}accept(e){return e.visitArrowFunctionParameters?e.visitArrowFunctionParameters(this):e.visitChildren(this)}}class ll extends Qe{constructor(e,n,o){super(n,o),this.parser=e}formalParameterArg_list(){return this.getTypedRuleContexts(fl)}formalParameterArg(e){return this.getTypedRuleContext(fl,e)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}get ruleIndex(){return I.RULE_formalParameterList}accept(e){return e.visitFormalParameterList?e.visitFormalParameterList(this):e.visitChildren(this)}}class fl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier(){return this.getTypedRuleContext(xn,0)}typeGather(){return this.getTypedRuleContext(Uo,0)}Assign(){return this.getToken(I.Assign,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}get ruleIndex(){return I.RULE_formalParameterArg}accept(e){return e.visitFormalParameterArg?e.visitFormalParameterArg(this):e.visitChildren(this)}}class Sp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Method(){return this.getToken(I.Method,0)}identifier(){return this.getTypedRuleContext(xn,0)}arrowMethodParameters(){return this.getTypedRuleContext(Tp,0)}ARROW(){return this.getToken(I.ARROW,0)}block(){return this.getTypedRuleContext(ts,0)}Export(){return this.getToken(I.Export,0)}get ruleIndex(){return I.RULE_arrowMethod}accept(e){return e.visitArrowMethod?e.visitArrowMethod(this):e.visitChildren(this)}}class Tp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}OpenParen(){return this.getToken(I.OpenParen,0)}typeGather(){return this.getTypedRuleContext(Uo,0)}identifier(){return this.getTypedRuleContext(xn,0)}CloseParen(){return this.getToken(I.CloseParen,0)}Comma(){return this.getToken(I.Comma,0)}formalParameterList(){return this.getTypedRuleContext(ll,0)}get ruleIndex(){return I.RULE_arrowMethodParameters}accept(e){return e.visitArrowMethodParameters?e.visitArrowMethodParameters(this):e.visitChildren(this)}}class Ap extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Type(){return this.getToken(I.Type,0)}identifier(){return this.getTypedRuleContext(xn,0)}NEWLINE(){return this.getToken(I.NEWLINE,0)}INDENT(){return this.getToken(I.INDENT,0)}DEDENT(){return this.getToken(I.DEDENT,0)}Export(){return this.getToken(I.Export,0)}typeElement_list(){return this.getTypedRuleContexts(hl)}typeElement(e){return this.getTypedRuleContext(hl,e)}get ruleIndex(){return I.RULE_typeStatement}accept(e){return e.visitTypeStatement?e.visitTypeStatement(this):e.visitChildren(this)}}class hl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}typeGather(){return this.getTypedRuleContext(Uo,0)}identifier(){return this.getTypedRuleContext(xn,0)}NEWLINE(){return this.getToken(I.NEWLINE,0)}Varip(){return this.getToken(I.Varip,0)}Assign(){return this.getToken(I.Assign,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}get ruleIndex(){return I.RULE_typeElement}accept(e){return e.visitTypeElement?e.visitTypeElement(this):e.visitChildren(this)}}class pl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}ColonEquals(){return this.getToken(I.ColonEquals,0)}MultiplyAssign(){return this.getToken(I.MultiplyAssign,0)}DivideAssign(){return this.getToken(I.DivideAssign,0)}ModulusAssign(){return this.getToken(I.ModulusAssign,0)}PlusAssign(){return this.getToken(I.PlusAssign,0)}MinusAssign(){return this.getToken(I.MinusAssign,0)}get ruleIndex(){return I.RULE_assignmentOperator}accept(e){return e.visitAssignmentOperator?e.visitAssignmentOperator(this):e.visitChildren(this)}}class dl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Map(){return this.getToken(I.Map,0)}LessThan(){return this.getToken(I.LessThan,0)}Comma(){return this.getToken(I.Comma,0)}typeName_list(){return this.getTypedRuleContexts(hi)}typeName(e){return this.getTypedRuleContext(hi,e)}MoreThan(){return this.getToken(I.MoreThan,0)}get ruleIndex(){return I.RULE_typeMap}accept(e){return e.visitTypeMap?e.visitTypeMap(this):e.visitChildren(this)}}class xp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}typeName_list(){return this.getTypedRuleContexts(hi)}typeName(e){return this.getTypedRuleContext(hi,e)}typeArray(){return this.getTypedRuleContext(yl,0)}typeMap(){return this.getTypedRuleContext(dl,0)}get ruleIndex(){return I.RULE_typeSeries}accept(e){return e.visitTypeSeries?e.visitTypeSeries(this):e.visitChildren(this)}}class yl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}typeName_list(){return this.getTypedRuleContexts(hi)}typeName(e){return this.getTypedRuleContext(hi,e)}LessThan(){return this.getToken(I.LessThan,0)}MoreThan(){return this.getToken(I.MoreThan,0)}OpenBracket(){return this.getToken(I.OpenBracket,0)}CloseBracket(){return this.getToken(I.CloseBracket,0)}get ruleIndex(){return I.RULE_typeArray}accept(e){return e.visitTypeArray?e.visitTypeArray(this):e.visitChildren(this)}}class Uo extends Qe{constructor(e,n,o){super(n,o),this.parser=e}typeName(){return this.getTypedRuleContext(hi,0)}typeArray(){return this.getTypedRuleContext(yl,0)}typeMap(){return this.getTypedRuleContext(dl,0)}typeSeries(){return this.getTypedRuleContext(xp,0)}get ruleIndex(){return I.RULE_typeGather}accept(e){return e.visitTypeGather?e.visitTypeGather(this):e.visitChildren(this)}}class xn extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Identifier(){return this.getToken(I.Identifier,0)}Map(){return this.getToken(I.Map,0)}Type(){return this.getToken(I.Type,0)}get ruleIndex(){return I.RULE_identifier}accept(e){return e.visitIdentifier?e.visitIdentifier(this):e.visitChildren(this)}}class hi extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}Point(){return this.getToken(I.Point,0)}get ruleIndex(){return I.RULE_typeName}accept(e){return e.visitTypeName?e.visitTypeName(this):e.visitChildren(this)}}class au extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}Point_list(){return this.getTokens(I.Point)}Point(e){return this.getToken(I.Point,e)}methodElement_list(){return this.getTypedRuleContexts(rs)}methodElement(e){return this.getTypedRuleContext(rs,e)}OpenParen(){return this.getToken(I.OpenParen,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}CloseParen(){return this.getToken(I.CloseParen,0)}get ruleIndex(){return I.RULE_name}accept(e){return e.visitName?e.visitName(this):e.visitChildren(this)}}class Em extends Xy{constructor(n){super(n);w(this,"tokens");w(this,"indents");w(this,"opened");this.tokens=[],this.indents=[],this.opened=0}reset(){this.tokens=[],this.indents=[],this.opened=0,super.reset()}emitToken(n){super.emitToken(n),this.tokens.push(n)}nextToken(){if(this._input.LA(1)===I.EOF&&this.indents.length){for(this.tokens=this.tokens.filter(function(o){return o.type!==I.EOF}),this.emitToken(this.commonToken(I.NEWLINE,`
11
- `));this.indents.length;)this.emitToken(this.createDedent()),this.indents.pop();this.emitToken(this.commonToken(I.EOF,"<EOF>"))}const n=super.nextToken();return this.tokens.length?this.tokens.shift():n}createDedent(){return this.commonToken(I.DEDENT,"")}getCharIndex(){return this._input.index}commonToken(n,o){const u=this.getCharIndex()-1,h=o.length?u-o.length+1:u;return new Gy([this,this._input],n,0,h,u)}getIndentationCount(n){let o=0;for(let u=0;u<n.length;u++)n[u]===" "?o+=4-o%4:o++;return o}atStartOfInput(){return this.getCharIndex()===0}openBrace(){this.opened++}closeBrace(){this.opened--}onNewLine(){const n=this.text.replace(/[^\r\n]+/g,""),o=this.text.replace(/[\r\n]+/g,""),u=this._input.LA(1),h=this._input.LA(2),m=this.getIndentationCount(o);if(this.opened>0||h!=-1&&(u===13||u===10||u===47&&h===47||m%4))this.skip();else{this.emitToken(this.commonToken(I.NEWLINE,n));const _=this.indents.length?this.indents[this.indents.length-1]:0;if(m===_)this.skip();else if(m>_)this.indents.push(m),this.emitToken(this.commonToken(I.INDENT,o));else for(;this.indents.length&&this.indents[this.indents.length-1]>m;)this.emitToken(this.createDedent()),this.indents.pop()}}}const Re=class Re extends Em{constructor(e){super(e),this._interp=new qy(this,Re._ATN,Re.DecisionsToDFA,new ap)}get grammarFileName(){return"tccScriptLexer.g4"}get literalNames(){return Re.literalNames}get symbolicNames(){return Re.symbolicNames}get ruleNames(){return Re.ruleNames}get serializedATN(){return Re._serializedATN}get channelNames(){return Re.channelNames}get modeNames(){return Re.modeNames}action(e,n,o){switch(n){case 1:this.OpenBracket_action(e,o);break;case 2:this.CloseBracket_action(e,o);break;case 3:this.OpenParen_action(e,o);break;case 4:this.CloseParen_action(e,o);break;case 57:this.NEWLINE_action(e,o);break}}OpenBracket_action(e,n){switch(n){case 0:this.openBrace();break}}CloseBracket_action(e,n){switch(n){case 1:this.closeBrace();break}}OpenParen_action(e,n){switch(n){case 2:this.openBrace();break}}CloseParen_action(e,n){switch(n){case 3:this.closeBrace();break}}NEWLINE_action(e,n){switch(n){case 4:this.onNewLine();break}}sempred(e,n,o){switch(n){case 57:return this.NEWLINE_sempred(e,o)}return!0}NEWLINE_sempred(e,n){switch(n){case 0:return this.atStartOfInput()}return!0}static get _ATN(){return Re.__ATN||(Re.__ATN=new ip().deserialize(Re._serializedATN)),Re.__ATN}};w(Re,"INDENT",1),w(Re,"DEDENT",2),w(Re,"Point",3),w(Re,"OpenBracket",4),w(Re,"CloseBracket",5),w(Re,"OpenParen",6),w(Re,"CloseParen",7),w(Re,"Comma",8),w(Re,"Assign",9),w(Re,"QuestionMark",10),w(Re,"Colon",11),w(Re,"Plus",12),w(Re,"Minus",13),w(Re,"Multiply",14),w(Re,"Divide",15),w(Re,"Modulus",16),w(Re,"Hashtag",17),w(Re,"LessThan",18),w(Re,"MoreThan",19),w(Re,"LessThanEquals",20),w(Re,"GreaterThanEquals",21),w(Re,"Equals_",22),w(Re,"NotEquals",23),w(Re,"MultiplyAssign",24),w(Re,"DivideAssign",25),w(Re,"ModulusAssign",26),w(Re,"PlusAssign",27),w(Re,"MinusAssign",28),w(Re,"ARROW",29),w(Re,"ColonEquals",30),w(Re,"BooleanLiteral",31),w(Re,"IntegerLiteral",32),w(Re,"DecimalLiteral",33),w(Re,"Break",34),w(Re,"And",35),w(Re,"Export",36),w(Re,"For",37),w(Re,"Var",38),w(Re,"Continue",39),w(Re,"Varip",40),w(Re,"Switch",41),w(Re,"While",42),w(Re,"If",43),w(Re,"In",44),w(Re,"Or",45),w(Re,"Not",46),w(Re,"Method",47),w(Re,"Else",48),w(Re,"To",49),w(Re,"By",50),w(Re,"Type",51),w(Re,"Import",52),w(Re,"As",53),w(Re,"Map",54),w(Re,"ColorLiteral",55),w(Re,"StringLiteral",56),w(Re,"Identifier",57),w(Re,"HIDDEN_",58),w(Re,"SKIP_",59),w(Re,"NEWLINE",60),w(Re,"EOF",sp.EOF),w(Re,"channelNames",["DEFAULT_TOKEN_CHANNEL","HIDDEN"]),w(Re,"literalNames",[null,null,null,"'.'","'['","']'","'('","')'","','","'='","'?'","':'","'+'","'-'","'*'","'/'","'%'","'#'","'<'","'>'","'<='","'>='","'=='","'!='","'*='","'/='","'%='","'+='","'-='","'=>'","':='",null,null,null,"'break'","'and'","'export'","'for'","'var'","'continue'","'varip'","'switch'","'while'","'if'","'in'","'or'","'not'","'method'","'else'","'to'","'by'","'type'","'import'","'as'","'map'"]),w(Re,"symbolicNames",[null,"INDENT","DEDENT","Point","OpenBracket","CloseBracket","OpenParen","CloseParen","Comma","Assign","QuestionMark","Colon","Plus","Minus","Multiply","Divide","Modulus","Hashtag","LessThan","MoreThan","LessThanEquals","GreaterThanEquals","Equals_","NotEquals","MultiplyAssign","DivideAssign","ModulusAssign","PlusAssign","MinusAssign","ARROW","ColonEquals","BooleanLiteral","IntegerLiteral","DecimalLiteral","Break","And","Export","For","Var","Continue","Varip","Switch","While","If","In","Or","Not","Method","Else","To","By","Type","Import","As","Map","ColorLiteral","StringLiteral","Identifier","HIDDEN_","SKIP_","NEWLINE"]),w(Re,"modeNames",["DEFAULT_MODE"]),w(Re,"ruleNames",["Point","OpenBracket","CloseBracket","OpenParen","CloseParen","Comma","Assign","QuestionMark","Colon","Plus","Minus","Multiply","Divide","Modulus","Hashtag","LessThan","MoreThan","LessThanEquals","GreaterThanEquals","Equals_","NotEquals","MultiplyAssign","DivideAssign","ModulusAssign","PlusAssign","MinusAssign","ARROW","ColonEquals","BooleanLiteral","IntegerLiteral","DecimalLiteral","Break","And","Export","For","Var","Continue","Varip","Switch","While","If","In","Or","Not","Method","Else","To","By","Type","Import","As","Map","ColorLiteral","StringLiteral","Identifier","HIDDEN_","SKIP_","NEWLINE","SHORT_STRING","DIGIT","DIGITS","HEX_DIGIT","SPACES","COMMENT","EXP"]),w(Re,"_serializedATN",[4,0,60,440,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,2,46,7,46,2,47,7,47,2,48,7,48,2,49,7,49,2,50,7,50,2,51,7,51,2,52,7,52,2,53,7,53,2,54,7,54,2,55,7,55,2,56,7,56,2,57,7,57,2,58,7,58,2,59,7,59,2,60,7,60,2,61,7,61,2,62,7,62,2,63,7,63,2,64,7,64,1,0,1,0,1,1,1,1,1,1,1,2,1,2,1,2,1,3,1,3,1,3,1,4,1,4,1,4,1,5,1,5,1,6,1,6,1,7,1,7,1,8,1,8,1,9,1,9,1,10,1,10,1,11,1,11,1,12,1,12,1,13,1,13,1,14,1,14,1,15,1,15,1,16,1,16,1,17,1,17,1,17,1,18,1,18,1,18,1,19,1,19,1,19,1,20,1,20,1,20,1,21,1,21,1,21,1,22,1,22,1,22,1,23,1,23,1,23,1,24,1,24,1,24,1,25,1,25,1,25,1,26,1,26,1,26,1,27,1,27,1,27,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,3,28,212,8,28,1,29,1,29,1,30,1,30,1,30,3,30,219,8,30,1,30,1,30,1,30,1,30,3,30,225,8,30,3,30,227,8,30,1,30,3,30,230,8,30,3,30,232,8,30,1,31,1,31,1,31,1,31,1,31,1,31,1,32,1,32,1,32,1,32,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,34,1,34,1,34,1,34,1,35,1,35,1,35,1,35,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,37,1,37,1,37,1,37,1,37,1,37,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,39,1,39,1,39,1,39,1,39,1,39,1,40,1,40,1,40,1,41,1,41,1,41,1,42,1,42,1,42,1,43,1,43,1,43,1,43,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,45,1,45,1,45,1,45,1,45,1,46,1,46,1,46,1,47,1,47,1,47,1,48,1,48,1,48,1,48,1,48,1,49,1,49,1,49,1,49,1,49,1,49,1,49,1,50,1,50,1,50,1,51,1,51,1,51,1,51,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,3,52,355,8,52,1,53,1,53,1,54,1,54,5,54,361,8,54,10,54,12,54,364,9,54,1,55,1,55,1,55,1,55,1,56,1,56,1,56,1,56,1,57,1,57,1,57,3,57,377,8,57,1,57,1,57,3,57,381,8,57,1,57,3,57,384,8,57,3,57,386,8,57,1,57,1,57,1,58,1,58,1,58,1,58,5,58,394,8,58,10,58,12,58,397,9,58,1,58,1,58,1,58,1,58,1,58,5,58,404,8,58,10,58,12,58,407,9,58,1,58,3,58,410,8,58,1,59,1,59,1,60,4,60,415,8,60,11,60,12,60,416,1,61,1,61,1,62,4,62,422,8,62,11,62,12,62,423,1,63,1,63,1,63,1,63,5,63,430,8,63,10,63,12,63,433,9,63,1,64,1,64,3,64,437,8,64,1,64,1,64,0,0,65,1,3,3,4,5,5,7,6,9,7,11,8,13,9,15,10,17,11,19,12,21,13,23,14,25,15,27,16,29,17,31,18,33,19,35,20,37,21,39,22,41,23,43,24,45,25,47,26,49,27,51,28,53,29,55,30,57,31,59,32,61,33,63,34,65,35,67,36,69,37,71,38,73,39,75,40,77,41,79,42,81,43,83,44,85,45,87,46,89,47,91,48,93,49,95,50,97,51,99,52,101,53,103,54,105,55,107,56,109,57,111,58,113,59,115,60,117,0,119,0,121,0,123,0,125,0,127,0,129,0,1,0,10,3,0,65,90,95,95,97,122,4,0,48,57,65,90,95,95,97,122,1,0,39,39,1,0,34,34,1,0,48,57,3,0,48,57,65,70,97,102,2,0,9,9,32,32,2,0,10,10,12,13,2,0,69,69,101,101,2,0,43,43,45,45,453,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,0,0,47,1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0,0,0,57,1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,67,1,0,0,0,0,69,1,0,0,0,0,71,1,0,0,0,0,73,1,0,0,0,0,75,1,0,0,0,0,77,1,0,0,0,0,79,1,0,0,0,0,81,1,0,0,0,0,83,1,0,0,0,0,85,1,0,0,0,0,87,1,0,0,0,0,89,1,0,0,0,0,91,1,0,0,0,0,93,1,0,0,0,0,95,1,0,0,0,0,97,1,0,0,0,0,99,1,0,0,0,0,101,1,0,0,0,0,103,1,0,0,0,0,105,1,0,0,0,0,107,1,0,0,0,0,109,1,0,0,0,0,111,1,0,0,0,0,113,1,0,0,0,0,115,1,0,0,0,1,131,1,0,0,0,3,133,1,0,0,0,5,136,1,0,0,0,7,139,1,0,0,0,9,142,1,0,0,0,11,145,1,0,0,0,13,147,1,0,0,0,15,149,1,0,0,0,17,151,1,0,0,0,19,153,1,0,0,0,21,155,1,0,0,0,23,157,1,0,0,0,25,159,1,0,0,0,27,161,1,0,0,0,29,163,1,0,0,0,31,165,1,0,0,0,33,167,1,0,0,0,35,169,1,0,0,0,37,172,1,0,0,0,39,175,1,0,0,0,41,178,1,0,0,0,43,181,1,0,0,0,45,184,1,0,0,0,47,187,1,0,0,0,49,190,1,0,0,0,51,193,1,0,0,0,53,196,1,0,0,0,55,199,1,0,0,0,57,211,1,0,0,0,59,213,1,0,0,0,61,231,1,0,0,0,63,233,1,0,0,0,65,239,1,0,0,0,67,243,1,0,0,0,69,250,1,0,0,0,71,254,1,0,0,0,73,258,1,0,0,0,75,267,1,0,0,0,77,273,1,0,0,0,79,280,1,0,0,0,81,286,1,0,0,0,83,289,1,0,0,0,85,292,1,0,0,0,87,295,1,0,0,0,89,299,1,0,0,0,91,306,1,0,0,0,93,311,1,0,0,0,95,314,1,0,0,0,97,317,1,0,0,0,99,322,1,0,0,0,101,329,1,0,0,0,103,332,1,0,0,0,105,354,1,0,0,0,107,356,1,0,0,0,109,358,1,0,0,0,111,365,1,0,0,0,113,369,1,0,0,0,115,385,1,0,0,0,117,409,1,0,0,0,119,411,1,0,0,0,121,414,1,0,0,0,123,418,1,0,0,0,125,421,1,0,0,0,127,425,1,0,0,0,129,434,1,0,0,0,131,132,5,46,0,0,132,2,1,0,0,0,133,134,5,91,0,0,134,135,6,1,0,0,135,4,1,0,0,0,136,137,5,93,0,0,137,138,6,2,1,0,138,6,1,0,0,0,139,140,5,40,0,0,140,141,6,3,2,0,141,8,1,0,0,0,142,143,5,41,0,0,143,144,6,4,3,0,144,10,1,0,0,0,145,146,5,44,0,0,146,12,1,0,0,0,147,148,5,61,0,0,148,14,1,0,0,0,149,150,5,63,0,0,150,16,1,0,0,0,151,152,5,58,0,0,152,18,1,0,0,0,153,154,5,43,0,0,154,20,1,0,0,0,155,156,5,45,0,0,156,22,1,0,0,0,157,158,5,42,0,0,158,24,1,0,0,0,159,160,5,47,0,0,160,26,1,0,0,0,161,162,5,37,0,0,162,28,1,0,0,0,163,164,5,35,0,0,164,30,1,0,0,0,165,166,5,60,0,0,166,32,1,0,0,0,167,168,5,62,0,0,168,34,1,0,0,0,169,170,5,60,0,0,170,171,5,61,0,0,171,36,1,0,0,0,172,173,5,62,0,0,173,174,5,61,0,0,174,38,1,0,0,0,175,176,5,61,0,0,176,177,5,61,0,0,177,40,1,0,0,0,178,179,5,33,0,0,179,180,5,61,0,0,180,42,1,0,0,0,181,182,5,42,0,0,182,183,5,61,0,0,183,44,1,0,0,0,184,185,5,47,0,0,185,186,5,61,0,0,186,46,1,0,0,0,187,188,5,37,0,0,188,189,5,61,0,0,189,48,1,0,0,0,190,191,5,43,0,0,191,192,5,61,0,0,192,50,1,0,0,0,193,194,5,45,0,0,194,195,5,61,0,0,195,52,1,0,0,0,196,197,5,61,0,0,197,198,5,62,0,0,198,54,1,0,0,0,199,200,5,58,0,0,200,201,5,61,0,0,201,56,1,0,0,0,202,203,5,116,0,0,203,204,5,114,0,0,204,205,5,117,0,0,205,212,5,101,0,0,206,207,5,102,0,0,207,208,5,97,0,0,208,209,5,108,0,0,209,210,5,115,0,0,210,212,5,101,0,0,211,202,1,0,0,0,211,206,1,0,0,0,212,58,1,0,0,0,213,214,3,121,60,0,214,60,1,0,0,0,215,216,5,46,0,0,216,218,3,121,60,0,217,219,3,129,64,0,218,217,1,0,0,0,218,219,1,0,0,0,219,232,1,0,0,0,220,229,3,121,60,0,221,226,5,46,0,0,222,224,3,121,60,0,223,225,3,129,64,0,224,223,1,0,0,0,224,225,1,0,0,0,225,227,1,0,0,0,226,222,1,0,0,0,226,227,1,0,0,0,227,230,1,0,0,0,228,230,3,129,64,0,229,221,1,0,0,0,229,228,1,0,0,0,230,232,1,0,0,0,231,215,1,0,0,0,231,220,1,0,0,0,232,62,1,0,0,0,233,234,5,98,0,0,234,235,5,114,0,0,235,236,5,101,0,0,236,237,5,97,0,0,237,238,5,107,0,0,238,64,1,0,0,0,239,240,5,97,0,0,240,241,5,110,0,0,241,242,5,100,0,0,242,66,1,0,0,0,243,244,5,101,0,0,244,245,5,120,0,0,245,246,5,112,0,0,246,247,5,111,0,0,247,248,5,114,0,0,248,249,5,116,0,0,249,68,1,0,0,0,250,251,5,102,0,0,251,252,5,111,0,0,252,253,5,114,0,0,253,70,1,0,0,0,254,255,5,118,0,0,255,256,5,97,0,0,256,257,5,114,0,0,257,72,1,0,0,0,258,259,5,99,0,0,259,260,5,111,0,0,260,261,5,110,0,0,261,262,5,116,0,0,262,263,5,105,0,0,263,264,5,110,0,0,264,265,5,117,0,0,265,266,5,101,0,0,266,74,1,0,0,0,267,268,5,118,0,0,268,269,5,97,0,0,269,270,5,114,0,0,270,271,5,105,0,0,271,272,5,112,0,0,272,76,1,0,0,0,273,274,5,115,0,0,274,275,5,119,0,0,275,276,5,105,0,0,276,277,5,116,0,0,277,278,5,99,0,0,278,279,5,104,0,0,279,78,1,0,0,0,280,281,5,119,0,0,281,282,5,104,0,0,282,283,5,105,0,0,283,284,5,108,0,0,284,285,5,101,0,0,285,80,1,0,0,0,286,287,5,105,0,0,287,288,5,102,0,0,288,82,1,0,0,0,289,290,5,105,0,0,290,291,5,110,0,0,291,84,1,0,0,0,292,293,5,111,0,0,293,294,5,114,0,0,294,86,1,0,0,0,295,296,5,110,0,0,296,297,5,111,0,0,297,298,5,116,0,0,298,88,1,0,0,0,299,300,5,109,0,0,300,301,5,101,0,0,301,302,5,116,0,0,302,303,5,104,0,0,303,304,5,111,0,0,304,305,5,100,0,0,305,90,1,0,0,0,306,307,5,101,0,0,307,308,5,108,0,0,308,309,5,115,0,0,309,310,5,101,0,0,310,92,1,0,0,0,311,312,5,116,0,0,312,313,5,111,0,0,313,94,1,0,0,0,314,315,5,98,0,0,315,316,5,121,0,0,316,96,1,0,0,0,317,318,5,116,0,0,318,319,5,121,0,0,319,320,5,112,0,0,320,321,5,101,0,0,321,98,1,0,0,0,322,323,5,105,0,0,323,324,5,109,0,0,324,325,5,112,0,0,325,326,5,111,0,0,326,327,5,114,0,0,327,328,5,116,0,0,328,100,1,0,0,0,329,330,5,97,0,0,330,331,5,115,0,0,331,102,1,0,0,0,332,333,5,109,0,0,333,334,5,97,0,0,334,335,5,112,0,0,335,104,1,0,0,0,336,337,5,35,0,0,337,338,3,123,61,0,338,339,3,123,61,0,339,340,3,123,61,0,340,341,3,123,61,0,341,342,3,123,61,0,342,343,3,123,61,0,343,355,1,0,0,0,344,345,5,35,0,0,345,346,3,123,61,0,346,347,3,123,61,0,347,348,3,123,61,0,348,349,3,123,61,0,349,350,3,123,61,0,350,351,3,123,61,0,351,352,3,123,61,0,352,353,3,123,61,0,353,355,1,0,0,0,354,336,1,0,0,0,354,344,1,0,0,0,355,106,1,0,0,0,356,357,3,117,58,0,357,108,1,0,0,0,358,362,7,0,0,0,359,361,7,1,0,0,360,359,1,0,0,0,361,364,1,0,0,0,362,360,1,0,0,0,362,363,1,0,0,0,363,110,1,0,0,0,364,362,1,0,0,0,365,366,3,125,62,0,366,367,1,0,0,0,367,368,6,55,4,0,368,112,1,0,0,0,369,370,3,127,63,0,370,371,1,0,0,0,371,372,6,56,5,0,372,114,1,0,0,0,373,374,4,57,0,0,374,386,3,125,62,0,375,377,5,13,0,0,376,375,1,0,0,0,376,377,1,0,0,0,377,378,1,0,0,0,378,381,5,10,0,0,379,381,2,12,13,0,380,376,1,0,0,0,380,379,1,0,0,0,381,383,1,0,0,0,382,384,3,125,62,0,383,382,1,0,0,0,383,384,1,0,0,0,384,386,1,0,0,0,385,373,1,0,0,0,385,380,1,0,0,0,386,387,1,0,0,0,387,388,6,57,6,0,388,116,1,0,0,0,389,395,5,39,0,0,390,394,8,2,0,0,391,392,5,92,0,0,392,394,5,39,0,0,393,390,1,0,0,0,393,391,1,0,0,0,394,397,1,0,0,0,395,393,1,0,0,0,395,396,1,0,0,0,396,398,1,0,0,0,397,395,1,0,0,0,398,410,5,39,0,0,399,405,5,34,0,0,400,404,8,3,0,0,401,402,5,92,0,0,402,404,5,34,0,0,403,400,1,0,0,0,403,401,1,0,0,0,404,407,1,0,0,0,405,403,1,0,0,0,405,406,1,0,0,0,406,408,1,0,0,0,407,405,1,0,0,0,408,410,5,34,0,0,409,389,1,0,0,0,409,399,1,0,0,0,410,118,1,0,0,0,411,412,7,4,0,0,412,120,1,0,0,0,413,415,3,119,59,0,414,413,1,0,0,0,415,416,1,0,0,0,416,414,1,0,0,0,416,417,1,0,0,0,417,122,1,0,0,0,418,419,7,5,0,0,419,124,1,0,0,0,420,422,7,6,0,0,421,420,1,0,0,0,422,423,1,0,0,0,423,421,1,0,0,0,423,424,1,0,0,0,424,126,1,0,0,0,425,426,5,47,0,0,426,427,5,47,0,0,427,431,1,0,0,0,428,430,8,7,0,0,429,428,1,0,0,0,430,433,1,0,0,0,431,429,1,0,0,0,431,432,1,0,0,0,432,128,1,0,0,0,433,431,1,0,0,0,434,436,7,8,0,0,435,437,7,9,0,0,436,435,1,0,0,0,436,437,1,0,0,0,437,438,1,0,0,0,438,439,3,121,60,0,439,130,1,0,0,0,22,0,211,218,224,226,229,231,354,362,376,380,383,385,393,395,403,405,409,416,423,431,436,7,1,1,0,1,2,1,1,3,2,1,4,3,0,1,0,6,0,0,1,57,4]),w(Re,"__ATN"),w(Re,"DecisionsToDFA",Re._ATN.decisionToState.map((e,n)=>new op(e,n)));let ml=Re;var W=(t=>(t.BOOL="bool",t.INT="int",t.FLOAT="float",t.ARRAY="array",t.BOX="box",t.CHART_POINT="chart.point",t.COLOR="color",t.CONST="const",t.LABEL="label",t.LINE="line",t.LINEFILL="linefill",t.MAP="map",t.MATRIX="matrix",t.POLYLINE="polyline",t.SERIES="series",t.SIMPLE="simple",t.STRING="string",t.TABLE="table",t.UNDETERMINED="undetermined type",t.INPUT="input",t.NA="na",t.VOID="void",t))(W||{}),Oe=(t=>(t.FlowStmt="FlowStmt",t.DeclareAssign="DeclareAssign",t.VarBlockStmt="VarBlockStmt",t.VarSingle="VarSingle",t.VarMultiple="VarMultiple",t.ParenthesizedExpression="ParenthesizedExpression",t.AdditiveExpression="AdditiveExpression",t.RelationalExpression="RelationalExpression",t.EqualityExpression="EqualityExpression",t.TernaryExpression="TernaryExpression",t.UnaryExpression="UnaryExpression",t.NotExpression="NotExpression",t.MemberIndexExpression="MemberIndexExpression",t.MethodExpression="MethodExpression",t.LogicalAndExpression="LogicalAndExpression",t.LogicalOrExpression="LogicalOrExpression",t.MultiplicativeExpression="MultiplicativeExpression",t.Brackethesized="Brackethesized",t.IfStatement="IfStatement",t.ForToStatement="ForToStatement",t.ForInStatement="ForInStatement",t.SwitchStatement="SwitchStatement",t.CaseClause="CaseClause",t.DefaultCaluse="DefaultCaluse",t.WhileStatement="WhileStatement",t.ImportElement="ImportElement",t.Literal="Literal",t.ArrowFunction="ArrowFunction",t.ArrowMethod="ArrowMethod",t.TypeStatement="TypeStatement",t.Name="Name",t.AgainAssign="AgainAssign",t))(Oe||{});const Pe={onlyInLoop:"'$text' is only allowed inside loops",invalidType:"Invalid argument 'expr$index' in 'operator SQBR' call",typeUseError:"Cannot specify a type form '$text' without also specifying the type.",notTypeKeyword:"'$text' is not a valid type keyword in variable declaration",undeclared:"Undeclared identifier '$name'",repeatVar:"'$name' is already defined",typeMismatch:"Cannot call '$operator' with argument '$index'. An argument of '$typeE' type was used but a '$typeR' is expected.",assignTypeMismatch:"Cannot assign a value of the `$typeE` type to the '$name' variable. The variable is declared with the `$typeR` type.",voidNotVar:"Void expression cannot be assigned to a variable",declareTypeErr:"Declared type '$type' is not compatible with assigned type '$valueType'",mapKeyValErr:"Cannot put <$typeA, $typeB> pairs into a map containing `$typeC` keys and `$typeD` values. The maps passed into the `$name()` function must have the same key types and value types.",inputSourceErr:"Invalid value for the '$name' parameter of the '$funcName' function. Possible values: [open, high, low, close, hl2, hlc3, ohlc4, hlcc4, volume].",buildInUseErr:"Cannot use '$name' as the default value of a type's field. The default value cannot be a function, variable or calculation.",argsLenErr:"Too many arguments passed into the `$name()` function call. Passed $lenA arguments but expected $lenB.",requiredParamErr:"No value assigned to the `$argName` parameter in $name()",argsSyntaxErr:"Syntax error after the argument for `$argName`. Arguments without their parameter name cannot be used after arguments with parameter names.",requestArgsErr:"Type $type cannot be used in $name '$argName' argument",mapKeyErr:"Incorrect `key` type `$type` in the variable. The `key` type must be one of the following: int, float, string, bool, color.",templateErr:"Incorrect number of arguments for the template: $countA expected, $countB passed.",templateNoSupportErr:"The '$name()' function does not support templates",ifOrSwitchTypeErr:"Return type of one of the '$keyword' blocks is not compatible with return type of other block(s) ($types)",argsNameErr:"The '$name' function does not have an argument with the name '$argName'",noFiledErr:"Object has no field $name",methodNotExistErr:"Could not find method or method reference '$methodName' for '$name'",tupleVarErr:"Syntax error: The quantities of tuple elements on each side of the assignment operator do not match. The right side has $indexA but the left side has $indexB.",tupleLeftVarErr:"Invalid assignment. Cannot assign a tuple to a variable '$name'.",tupleRightVarErr:"Cannot assign a variable to a tuple. The right side must be a function call or structure ('if', 'switch', 'for', 'while') returning a tuple with the same number of elements.",tempateTypeErr:"Syntax error: Only templates for arrays and matrices consist of a single type identifier enclosed in angle brackets.",qualifierErr:"'$name' is not a valid type qualifier. Possible values: 'const', 'simple', 'series'",notFindFuncErr:"Could not find function or function reference '$name'",naVarErr:"Value with NA type cannot be assigned to a variable that was defined without type keyword",notHistoryErr:"Variable '$name' doesn't have history values",defaultValueErr:"The default value cannot be a function, variable or calculation.",defaultValueTypeErr:"Default value of type $typeE can not be assigned to an argument of type $typeR",unaryErr:"Syntax error at input '$sign'",funcArgAssignErr:"Function arguments cannot be mutable ('$name')",declaredErr:"A variable declared with the '$prefix' keyword cannot accept values of the '$type' form. Assign a '$prefix' value to this variable or remove the '$prefix' keyword from its declaration.",globalFuncErr:"Cannot use '$name' in local scope",onlyStatementErr:"Scripts must contain one declaration statement: `indicator()`, `strategy()` or `library()`, Your script has $count.",modifyGlobalVarErr:"Cannot modify global variable '$name' in function",inputDefvalErr:"Arguments of input function must be of constant type, or 'source' builtin variables.",objectIsNaErr:"Cannot access the '$name' $type of an undefined object. The object is 'na'.",buidinAssignErr:"Cannot assign a new value to the built-in variable '$name'.",buidinVarErr:"Cannot shadow the built-in variable `$name` because it has already been used as a built-in.",useNaErr:"Cannot use an `na` value of an unspecified type in the `$name` function."},Ri={repeatVar:"Shadowing variable '$name' which exists in parent scope. Did you want to use the ':=' operator instead of '=' ?",typeMismatch:"The `$index` parameter of the `$operator` function accepts a '$type' argument. To avoid potential unexpected results, pass a '$type' value or expression to this parameter.",moreSameArg:"More than one '$arg' arguments are supplied. Only the first one will be used.",localScopeGetHistory:"The variable '$name' is declared in local scope, which may not be executed at every update. So, obtaining its historical values may lead to unexpected results",localScopeWarning:"The function '$name' should be called on each calculation for consistency. It is recommended to extract the call from this scope"},wi=[W.SERIES,W.SIMPLE,W.INPUT,W.CONST],Sm=[W.INT,W.FLOAT,W.BOOL,W.COLOR,W.STRING],_l=["indicator","strategy","library"],Tm=["plot","plotbar","plotchar","plotarrow","plotshape","plotcandle","hline","indicator","alertcondition","barcolor","bgcolor","fill","library","strategy","strategy.risk.max_drawdown","strategy.risk.allow_entry_in","strategy.risk.max_cons_loss_days","max_intraday_filled_orders","strategy.risk.max_intraday_loss","strategy.risk.max_position_size"],Am=["strategy","input","table","color","line","linefill","label","box"],gl=["close","open","high","low","hl2","hlc3","hlcc4","ohlc4","volume"];var Op=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},xm={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(Op,function(){var n=1e3,o=6e4,u=36e5,h="millisecond",m="second",_="minute",T="hour",x="day",P="week",A="month",F="quarter",$="year",V="date",b="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,D={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(ye){var te=["th","st","nd","rd"],he=ye%100;return"["+ye+(te[(he-20)%10]||te[he]||te[0])+"]"}},R=function(ye,te,he){var le=String(ye);return!le||le.length>=te?ye:""+Array(te+1-le.length).join(he)+ye},O={s:R,z:function(ye){var te=-ye.utcOffset(),he=Math.abs(te),le=Math.floor(he/60),Ae=he%60;return(te<=0?"+":"-")+R(le,2,"0")+":"+R(Ae,2,"0")},m:function ye(te,he){if(te.date()<he.date())return-ye(he,te);var le=12*(he.year()-te.year())+(he.month()-te.month()),Ae=te.clone().add(le,A),Ne=he-Ae<0,_e=te.clone().add(le+(Ne?-1:1),A);return+(-(le+(he-Ae)/(Ne?Ae-_e:_e-Ae))||0)},a:function(ye){return ye<0?Math.ceil(ye)||0:Math.floor(ye)},p:function(ye){return{M:A,y:$,w:P,d:x,D:V,h:T,m:_,s:m,ms:h,Q:F}[ye]||String(ye||"").toLowerCase().replace(/s$/,"")},u:function(ye){return ye===void 0}},U="en",X={};X[U]=D;var ue="$isDayjsObject",K=function(ye){return ye instanceof Q||!(!ye||!ye[ue])},Y=function ye(te,he,le){var Ae;if(!te)return U;if(typeof te=="string"){var Ne=te.toLowerCase();X[Ne]&&(Ae=Ne),he&&(X[Ne]=he,Ae=Ne);var _e=te.split("-");if(!Ae&&_e.length>1)return ye(_e[0])}else{var Ue=te.name;X[Ue]=te,Ae=Ue}return!le&&Ae&&(U=Ae),Ae||!le&&U},G=function(ye,te){if(K(ye))return ye.clone();var he=typeof te=="object"?te:{};return he.date=ye,he.args=arguments,new Q(he)},ce=O;ce.l=Y,ce.i=K,ce.w=function(ye,te){return G(ye,{locale:te.$L,utc:te.$u,x:te.$x,$offset:te.$offset})};var Q=function(){function ye(he){this.$L=Y(he.locale,null,!0),this.parse(he),this.$x=this.$x||he.x||{},this[ue]=!0}var te=ye.prototype;return te.parse=function(he){this.$d=function(le){var Ae=le.date,Ne=le.utc;if(Ae===null)return new Date(NaN);if(ce.u(Ae))return new Date;if(Ae instanceof Date)return new Date(Ae);if(typeof Ae=="string"&&!/Z$/i.test(Ae)){var _e=Ae.match(y);if(_e){var Ue=_e[2]-1||0,J=(_e[7]||"0").substring(0,3);return Ne?new Date(Date.UTC(_e[1],Ue,_e[3]||1,_e[4]||0,_e[5]||0,_e[6]||0,J)):new Date(_e[1],Ue,_e[3]||1,_e[4]||0,_e[5]||0,_e[6]||0,J)}}return new Date(Ae)}(he),this.init()},te.init=function(){var he=this.$d;this.$y=he.getFullYear(),this.$M=he.getMonth(),this.$D=he.getDate(),this.$W=he.getDay(),this.$H=he.getHours(),this.$m=he.getMinutes(),this.$s=he.getSeconds(),this.$ms=he.getMilliseconds()},te.$utils=function(){return ce},te.isValid=function(){return this.$d.toString()!==b},te.isSame=function(he,le){var Ae=G(he);return this.startOf(le)<=Ae&&Ae<=this.endOf(le)},te.isAfter=function(he,le){return G(he)<this.startOf(le)},te.isBefore=function(he,le){return this.endOf(le)<G(he)},te.$g=function(he,le,Ae){return ce.u(he)?this[le]:this.set(Ae,he)},te.unix=function(){return Math.floor(this.valueOf()/1e3)},te.valueOf=function(){return this.$d.getTime()},te.startOf=function(he,le){var Ae=this,Ne=!!ce.u(le)||le,_e=ce.p(he),Ue=function(Et,Lt){var gt=ce.w(Ae.$u?Date.UTC(Ae.$y,Lt,Et):new Date(Ae.$y,Lt,Et),Ae);return Ne?gt:gt.endOf(x)},J=function(Et,Lt){return ce.w(Ae.toDate()[Et].apply(Ae.toDate("s"),(Ne?[0,0,0,0]:[23,59,59,999]).slice(Lt)),Ae)},ne=this.$W,ae=this.$M,Ee=this.$D,me="set"+(this.$u?"UTC":"");switch(_e){case $:return Ne?Ue(1,0):Ue(31,11);case A:return Ne?Ue(1,ae):Ue(0,ae+1);case P:var At=this.$locale().weekStart||0,jt=(ne<At?ne+7:ne)-At;return Ue(Ne?Ee-jt:Ee+(6-jt),ae);case x:case V:return J(me+"Hours",0);case T:return J(me+"Minutes",1);case _:return J(me+"Seconds",2);case m:return J(me+"Milliseconds",3);default:return this.clone()}},te.endOf=function(he){return this.startOf(he,!1)},te.$set=function(he,le){var Ae,Ne=ce.p(he),_e="set"+(this.$u?"UTC":""),Ue=(Ae={},Ae[x]=_e+"Date",Ae[V]=_e+"Date",Ae[A]=_e+"Month",Ae[$]=_e+"FullYear",Ae[T]=_e+"Hours",Ae[_]=_e+"Minutes",Ae[m]=_e+"Seconds",Ae[h]=_e+"Milliseconds",Ae)[Ne],J=Ne===x?this.$D+(le-this.$W):le;if(Ne===A||Ne===$){var ne=this.clone().set(V,1);ne.$d[Ue](J),ne.init(),this.$d=ne.set(V,Math.min(this.$D,ne.daysInMonth())).$d}else Ue&&this.$d[Ue](J);return this.init(),this},te.set=function(he,le){return this.clone().$set(he,le)},te.get=function(he){return this[ce.p(he)]()},te.add=function(he,le){var Ae,Ne=this;he=Number(he);var _e=ce.p(le),Ue=function(ae){var Ee=G(Ne);return ce.w(Ee.date(Ee.date()+Math.round(ae*he)),Ne)};if(_e===A)return this.set(A,this.$M+he);if(_e===$)return this.set($,this.$y+he);if(_e===x)return Ue(1);if(_e===P)return Ue(7);var J=(Ae={},Ae[_]=o,Ae[T]=u,Ae[m]=n,Ae)[_e]||1,ne=this.$d.getTime()+he*J;return ce.w(ne,this)},te.subtract=function(he,le){return this.add(-1*he,le)},te.format=function(he){var le=this,Ae=this.$locale();if(!this.isValid())return Ae.invalidDate||b;var Ne=he||"YYYY-MM-DDTHH:mm:ssZ",_e=ce.z(this),Ue=this.$H,J=this.$m,ne=this.$M,ae=Ae.weekdays,Ee=Ae.months,me=Ae.meridiem,At=function(Lt,gt,Dt,Jt){return Lt&&(Lt[gt]||Lt(le,Ne))||Dt[gt].slice(0,Jt)},jt=function(Lt){return ce.s(Ue%12||12,Lt,"0")},Et=me||function(Lt,gt,Dt){var Jt=Lt<12?"AM":"PM";return Dt?Jt.toLowerCase():Jt};return Ne.replace(g,function(Lt,gt){return gt||function(Dt){switch(Dt){case"YY":return String(le.$y).slice(-2);case"YYYY":return ce.s(le.$y,4,"0");case"M":return ne+1;case"MM":return ce.s(ne+1,2,"0");case"MMM":return At(Ae.monthsShort,ne,Ee,3);case"MMMM":return At(Ee,ne);case"D":return le.$D;case"DD":return ce.s(le.$D,2,"0");case"d":return String(le.$W);case"dd":return At(Ae.weekdaysMin,le.$W,ae,2);case"ddd":return At(Ae.weekdaysShort,le.$W,ae,3);case"dddd":return ae[le.$W];case"H":return String(Ue);case"HH":return ce.s(Ue,2,"0");case"h":return jt(1);case"hh":return jt(2);case"a":return Et(Ue,J,!0);case"A":return Et(Ue,J,!1);case"m":return String(J);case"mm":return ce.s(J,2,"0");case"s":return String(le.$s);case"ss":return ce.s(le.$s,2,"0");case"SSS":return ce.s(le.$ms,3,"0");case"Z":return _e}return null}(Lt)||_e.replace(":","")})},te.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},te.diff=function(he,le,Ae){var Ne,_e=this,Ue=ce.p(le),J=G(he),ne=(J.utcOffset()-this.utcOffset())*o,ae=this-J,Ee=function(){return ce.m(_e,J)};switch(Ue){case $:Ne=Ee()/12;break;case A:Ne=Ee();break;case F:Ne=Ee()/3;break;case P:Ne=(ae-ne)/6048e5;break;case x:Ne=(ae-ne)/864e5;break;case T:Ne=ae/u;break;case _:Ne=ae/o;break;case m:Ne=ae/n;break;default:Ne=ae}return Ae?Ne:ce.a(Ne)},te.daysInMonth=function(){return this.endOf(A).$D},te.$locale=function(){return X[this.$L]},te.locale=function(he,le){if(!he)return this.$L;var Ae=this.clone(),Ne=Y(he,le,!0);return Ne&&(Ae.$L=Ne),Ae},te.clone=function(){return ce.w(this.$d,this)},te.toDate=function(){return new Date(this.valueOf())},te.toJSON=function(){return this.isValid()?this.toISOString():null},te.toISOString=function(){return this.$d.toISOString()},te.toString=function(){return this.$d.toUTCString()},ye}(),de=Q.prototype;return G.prototype=de,[["$ms",h],["$s",m],["$m",_],["$H",T],["$W",x],["$M",A],["$y",$],["$D",V]].forEach(function(ye){de[ye[1]]=function(te){return this.$g(te,ye[0],ye[1])}}),G.extend=function(ye,te){return ye.$i||(ye(te,Q,G),ye.$i=!0),G},G.locale=Y,G.isDayjs=K,G.unix=function(ye){return G(1e3*ye)},G.en=X[U],G.Ls=X,G.p={},G})})(xm);function we(t,e){return t.replace(/\$(\w+)/g,(n,o)=>String(e[o])||n)}class Om extends Yy{constructor(){super(...arguments);w(this,"visitProgram");w(this,"visitGlobalStmt");w(this,"visitBlockStmt");w(this,"visitStmt");w(this,"visitSimpleStmt");w(this,"visitFlowStmt");w(this,"visitBlock");w(this,"visitBlockLine");w(this,"visitVariableDeclarationStmt");w(this,"visitDeclareAssign");w(this,"visitAgainAssign");w(this,"visitVarModifier");w(this,"visitBlockSequence");w(this,"visitExpressionSequence");w(this,"visitExpressionBlockSequence");w(this,"visitVarBlockStmt");w(this,"visitVarSingle");w(this,"visitVarMultiple");w(this,"visitBlockExpression");w(this,"visitParenthesizedExpression");w(this,"visitAdditiveExpression");w(this,"visitRelationalExpression");w(this,"visitTernaryExpression");w(this,"visitLogicalAndExpression");w(this,"visitNameExpression");w(this,"visitLiteralExpression");w(this,"visitLogicalOrExpression");w(this,"visitUnaryExpression");w(this,"visitNotExpression");w(this,"visitMemberIndexExpression");w(this,"visitMethodExpression");w(this,"visitEqualityExpression");w(this,"visitMultiplicativeExpression");w(this,"visitBrackethesized");w(this,"visitArguments");w(this,"visitArgument");w(this,"visitIfStatement");w(this,"visitForToStatement");w(this,"visitForInStatement");w(this,"visitSwitchStatement");w(this,"visitCaseClause");w(this,"visitDefaultCaluse");w(this,"visitWhileStatement");w(this,"visitImportStmt");w(this,"visitImportElement");w(this,"visitLiteral");w(this,"visitMethodStmt");w(this,"visitMethodElement");w(this,"visitMethodName");w(this,"visitArrowFunction");w(this,"visitArrowFunctionParameters");w(this,"visitFormalParameterList");w(this,"visitFormalParameterArg");w(this,"visitArrowMethod");w(this,"visitArrowMethodParameters");w(this,"visitTypeStatement");w(this,"visitTypeElement");w(this,"visitAssignmentOperator");w(this,"visitTypeMap");w(this,"visitTypeSeries");w(this,"visitTypeArray");w(this,"visitTypeGather");w(this,"visitIdentifier");w(this,"visitTypeName");w(this,"visitName")}}class Dm extends Om{constructor(n){super();w(this,"_buildinVariables");w(this,"_buildinTypes");w(this,"_buildinConstants");w(this,"_buildinMethods");w(this,"_buildinFunctions");this._buildinVariables=new Map,this._buildinConstants=new Map,this._buildinFunctions=new Map,this._buildinTypes=new Map,this._buildinMethods=new Map,this._buildinHandle(n)}_buildinHandle(n){for(const o in n){const u=new Map(Object.entries(n[o]));switch(o){case"constants":this._buildinConstants=u;break;case"functions":this._buildinFunctions=u;break;case"methods":this._buildinMethods=u;break;case"types":this._buildinTypes=u;break;case"variables":this._buildinVariables=u;break}}}_typeHandle(n=[],o){if(!n.length)return W.UNDETERMINED;if(n=n.filter(m=>!m.endsWith(W.NA)),!n.length)return`${W.SIMPLE} ${W.NA}`;let u=100,h="";for(const m of n){if(m===W.UNDETERMINED)return W.UNDETERMINED;m.startsWith(W.SERIES)?u=0:m.startsWith(W.SIMPLE)&&u>0?u=1:m.startsWith(W.INPUT)&&u>1?u=2:m.startsWith(W.CONST)&&u>2&&(u=3);const _=this._removePrefix(m);(_!==W.INT||!h)&&(h=_)}return u===100?h:`${wi[u]} ${o||h}`}_returnTypesOtherHandle(n,o,u,h){if(!u.length||u[0].includes("<>")){const m=n.type;let _=m;if(!m||m===W.UNDETERMINED)return[W.UNDETERMINED];switch(o){case"series <type>":_=this._getArrayType(m),_||(_=this._removePrefix(m)),u=[this._typeAddSeries(_)];break;case"array<type>":case"matrix<type>":case"type[]":if(this._isMapType(m)){const T=this._getMapType(m)||[];h.includes("keys")?_=T[0]:_=T[1]}else _=this._getArrayType(m),_||(_=this._removePrefix(m));u=[this._typeReplace(o,_)];break;case"<matrix_type>":_=this._getArrayType(m),u=[this._typeAddSeries(_)];break;case"map<keyType, valueType>":u=[_];break;case"<value_type>":_=this._getMapType(m),u=[_[1]];break}}return u}_checkMethodThisType(n,o){if(!n||!n.length||n[0].includes("<>"))return!0;o=this._removePrefix(o);const u=o.replace("int","float");return n.some(h=>h===o||u===h||h.endsWith(o))}_priorityComparison(n,o){if(!n)return!1;if(this._isArrayType(n)||this._isMatrixType(n))return this._getArrayType(o)!==W.INT;{const u=this._getPrefix(n),h=this._getPrefix(o);return u===h?!!n.endsWith(W.INT):!(wi.indexOf(u)<wi.indexOf(h))}}_compareType(n,o){if(n===W.UNDETERMINED||o===W.UNDETERMINED)return!0;const u=[W.FLOAT,W.INT];if(this._isArrayType(n)||this._isMatrixType(n)){const h=this._getArrayType(n)||"",m=this._getArrayType(o)||"";return h===m||u.includes(h)&&u.includes(m)}else if(this._isMapType(n)){const h=this._getMapType(n)||[],m=this._getMapType(o)||[];return(h[0]===m[0]||u.includes(h[0])&&u.includes(m[0]))&&(h[1]===m[1]||u.includes(h[1])&&u.includes(m[1]))}else{const h=this._removePrefix(n),m=this._removePrefix(o);return h===W.NA||m===W.NA||h===m||u.includes(h)&&u.includes(m)}}_typeAddSeries(n){return this._buildinTypes.get(n)&&n!==W.CHART_POINT?`${W.SERIES} ${n}`:n}_typeAddConst(n){return this._buildinTypes.get(n)&&n!==W.CHART_POINT?`${W.CONST} ${n}`:n}_getOriginMethodName(n,o){let u="";return this._isArrayType(n)?u=`${W.ARRAY}.${o}`:this._isMatrixType(n)?u=`${W.MATRIX}.${o}`:this._isMapType(n)?u=`${W.MAP}.${o}`:u=`${this._removePrefix(n)}.${o}`,u}_returnedTypesParse(n){if(!n||!n.length)return[];const o=n[0];return/^\[.+\]$/.test(o)?o.replace(/[[\]]/g,"").split(",").map(u=>u.trim()):n}_removePrefix(n=""){return n.replace(/(series|simple|const|input)\s+([\w\d.]+)/,"$2")}_getPrefix(n){if(!n)return"";const o=n.replace(/(series|simple|const|input).+/,"$1");return wi.includes(o)?o:""}_getArrayType(n){let o=/\w+<([\w\d.]+)>/.exec(n);return o||(o=/([\w\d.]+)\[\]/.exec(n)),o==null?void 0:o[1]}_getMapType(n){const o=/\w+<(\w+),\s*([\w\d.]+)>/.exec(n);return(o==null?void 0:o[1])&&(o==null?void 0:o[2])&&[o==null?void 0:o[1],o==null?void 0:o[2]]}_isMatrixType(n){return/^matrix<[\w\d.]+>$/.test(n)}_isArrayType(n){return/^array<[\w\d.]+>$/.test(n)||/^[\w\d.]+\[\]$/.test(n)}_isMapType(n){return/^map<\w+,\s*[\w\d.]+>$/.test(n)}_arrayTypeConvert(n){return!this._isArrayType(n)||!n.includes("<")?n:`${this._getArrayType(n)}[]`}_getMethodTypeName(n){return this._isArrayType(n)?W.ARRAY:this._isMapType(n)?W.MAP:this._isMatrixType(n)?W.MATRIX:this._removePrefix(n)}_typeReplace(n,o){return o=this._removePrefix(o),this._arrayTypeConvert(n.startsWith(W.SERIES)?n.replace("<type>",o):n.replace("type",o))}}var Lr=(t=>(t[t.Hint=1]="Hint",t[t.Info=2]="Info",t[t.Warning=4]="Warning",t[t.Error=8]="Error",t))(Lr||{});class Cm extends Dm{constructor(n){super(n);w(this,"_loopCount");w(this,"_errors");w(this,"_variables");w(this,"_functions");w(this,"_methods");w(this,"_types");w(this,"_currentBlockVars");w(this,"_currentFuncParams");w(this,"_isNeedCalc");w(this,"_blockCount");w(this,"_isInFunc");w(this,"_onlyStatementsCount");w(this,"_blockRanges");w(this,"_overloadsFuncs");w(this,"_hasMemberIndex");w(this,"_isInLocalScop");w(this,"visitProgram",n=>{const{children:o}=n;let u=0;const h=[];for(this._pushBlockRanges(n);u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_globalStmt&&h.push(this.visit(m))}return this._onlyStatementsCount<=0&&this._errors.push({startColumn:0,endColumn:0,startLineNumber:1,endLineNumber:1,message:we(Pe.onlyStatementErr,{count:this._onlyStatementsCount})}),h});w(this,"visitGlobalStmt",n=>{const{children:o}=n;if(o&&o.length){const u=o[0],h=this.visit(u);return u.ruleIndex===I.RULE_methodStmt&&_l.includes(h.exprs[0].name)&&(this._onlyStatementsCount++,this._onlyStatementsCount>1&&this._errorHandle(we(Pe.onlyStatementErr,{count:this._onlyStatementsCount}),u)),h}return null});w(this,"visitBlockStmt",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_variableDeclarationStmt:h.push(...this.visit(m));break;case I.RULE_varBlockStmt:h.push(this.visit(m));break;case I.RULE_blockExpression:h.push(this.visit(m));break}}return h});w(this,"visitStmt",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitSimpleStmt",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitFlowStmt",n=>{const{children:o}=n,{column:u,line:h,text:m}=o[0].symbol;if(this._loopCount<=0){const _=u+1;this._errors.push({startColumn:_,endColumn:parseInt(_+m.length),startLineNumber:h,endLineNumber:h,message:we(Pe.onlyInLoop,{text:m})})}return{ruleType:Oe.FlowStmt,value:m}});w(this,"visitBlock",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return u.ruleIndex===I.RULE_simpleStmt?this._inBlock(u):this.visit(u)}return null});w(this,"visitBlockLine",n=>{const{children:o}=n;if(!o)return null;let u=0;const h=[];for(this._blockCount++,this._pushBlockRanges(n);u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_stmt&&h.push(this.visit(m))}return this._blockCount--,this._blockRanges.pop(),this._currentBlockVars.splice(this._blockCount+1),h});w(this,"visitDeclareAssign",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.DeclareAssign};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_varArrayDeclaration:h.nameList=this.visit(m);break;case I.RULE_singleExpression:h.value=this.visit(m);break}}return this._variablesHandle(h,n),h});w(this,"visitAgainAssign",n=>{const{children:o}=n;if(o.length>=3){const u=this.visit(o[0]);this._verifyGloablVar(u,o[0]);const h=this.visit(o[2]),m=this.visit(o[1]);return u.type?this._againAssignHandle([u,h],[o[0],o[2]],m):null}return null});w(this,"visitVarModifier",n=>{const{children:o}=n;return o[0].symbol.text});w(this,"visitExpressionSequence",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];if(m.ruleIndex===I.RULE_singleExpression){const _=this.visit(m);_&&(_.ctx=m,h.push(_))}}return h});w(this,"visitExpressionBlockSequence",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_singleExpression:h.push(this.visit(m));break;case I.RULE_variableDeclarationList:h.push(this.visit(m));break;case I.RULE_blockExpression:h.push(this.visit(m));break;case I.RULE_varBlockStmt:h.push(this.visit(m));break}}return h});w(this,"visitBlockSequence",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_variableDeclarationList:h.push(this.visit(m));break;case I.RULE_singleExpression:h.push(this.visit(m));break}}return h});w(this,"visitVariableDeclarationStmt",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_variableDeclarationList:h.push(this.visit(m));break;case I.RULE_methodStmt:const _=this.visit(m);_l.includes(_.exprs[0].name)&&(this._onlyStatementsCount++,this._onlyStatementsCount>1&&this._errorHandle(we(Pe.onlyStatementErr,{count:this._onlyStatementsCount}),m)),h.push(_);break}}return h});w(this,"visitVarBlockStmt",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.VarBlockStmt,ctx:n},m=[];for(;u<o.length;u++){const _=o[u];switch(_.ruleIndex){case I.RULE_varArrayDeclaration:h.nameList=this.visit(_);break;case I.RULE_assignmentOperator:h.operator=this.visit(_);break;case I.RULE_name:m.push(_),h.name=this.visit(_);break;case I.RULE_blockExpression:this._isNeedCalc=!0,h.value=this.visit(_),m.push(_);const T=this._getBlockReturnTypes(h.value);T.length===1?h.value.type=T[0]:h.value.types=T,this._isNeedCalc=!1;break}}return h.name?this._againAssignHandle([h.name,h.value],m,h.operator):(this._variablesHandle(h,n),h)});w(this,"visitVarSingle",n=>{const{children:o}=n,u={ruleType:Oe.VarSingle};let h=0,m={lineNumber:0,column:0};for(;h<o.length;h++){const _=o[h];switch(_.ruleIndex){case I.RULE_varModifier:u.declare=this.visit(_);break;case I.RULE_typeGather:const T=this.visit(_);u.prefix=this._getPrefix(T),u.type=T&&this._typeAddConst(T);break;case I.RULE_identifier:const x=this.visit(_);this._repeatVarJudge(x,_),m={lineNumber:_.start.line,column:_.start.column},u.name=x,u.pos=m;break}}return u});w(this,"visitVarMultiple",n=>{const{children:o}=n;let u=0;const h=[],m=[];for(;u<o.length;u++){const _=o[u];if(_.ruleIndex===I.RULE_identifier){const T=this.visit(_);this._repeatVarJudge(T,_),h.push(T),m.push({lineNumber:_.start.line,column:_.start.column})}}return{ruleType:Oe.VarMultiple,names:h,posList:m}});w(this,"visitBlockExpression",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitParenthesizedExpression",n=>{const{children:o}=n,u=o[1],h=this.visit(u);return{ruleType:Oe.ParenthesizedExpression,type:h.type,ctx:n,exprs:h}});w(this,"visitAdditiveExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const T=o[u];T.ruleIndex===I.RULE_singleExpression?m.push(this.visit(T)):h=T.symbol.text}const _={ruleType:Oe.AdditiveExpression,operator:h,ctx:n,exprs:m};if(["+","-"].includes(h)){const T=[W.UNDETERMINED,W.INT,W.FLOAT];h==="+"&&T.push(W.STRING);const x=this._sameTypeJudge(m,[o[0],o[2]],h,T);_.type=this._typeHandle(x)}else{const T=this._calcTypeJudge(m[0],o[0],h),x=this._calcTypeJudge(m[1],o[2],h,1);_.type=this._typeHandle([T,x])}return _});w(this,"visitRelationalExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const x=o[u];x.ruleIndex===I.RULE_singleExpression?m.push(this.visit(x)):h=x.symbol.text}const _=this._calcTypeJudge(m[0],o[0],h),T=this._calcTypeJudge(m[1],o[2],h,1);return{ruleType:Oe.RelationalExpression,operator:h,ctx:n,type:this._typeHandle([_,T],W.BOOL),exprs:m}});w(this,"visitEqualityExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const T=o[u];T.ruleIndex===I.RULE_singleExpression?m.push(this.visit(T)):h=T.symbol.text}const _=this._sameTypeJudge(m,[o[0],o[2]],h,[W.UNDETERMINED,W.COLOR,W.STRING,W.BOOL,W.INT,W.FLOAT]);return{ruleType:Oe.EqualityExpression,operator:h,ctx:n,type:this._typeHandle(_,W.BOOL),exprs:m}});w(this,"visitTernaryExpression",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const _=o[u];if(_.ruleIndex===I.RULE_singleExpression){const T=this._isInLocalScop;u!==0&&(this._isInLocalScop=!0),h.push(this.visit(_)),this._isInLocalScop=T}}let m=W.UNDETERMINED;if(h.length>=3){this._boolTypeJudge(h[0],o[0],"?:");const _=this._sameTypeJudge(h.slice(1),[o[2],o[4]],"?:",[]),T=this._getPrefix(h[0].type);m=this._typeHandle(_),T&&this._getPrefix(m)&&(m=this._typeHandle([m,`${T} ${this._removePrefix(m)}`]))}return{ruleType:Oe.TernaryExpression,type:m,ctx:n,exprs:h}});w(this,"visitNameExpression",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitLiteralExpression",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitUnaryExpression",n=>{var x;const{children:o}=n,[u,h]=o,m=[this.visit(h)],_=u.symbol.text,T=this._calcTypeJudge(m[0],h,_);return((x=m[0])==null?void 0:x.ruleType)===Oe.UnaryExpression&&this._errors.push({message:we(Pe.unaryErr,{sign:_}),startColumn:u.symbol.column+1,startLineNumber:u.symbol.line,endColumn:u.symbol.column+2,endLineNumber:u.symbol.line}),{ruleType:Oe.UnaryExpression,operator:_,type:T,ctx:n,exprs:m}});w(this,"visitNotExpression",n=>{const{children:o}=n,u=o[1],h=[this.visit(u)],m=this._boolTypeJudge(h[0],u,"not");return{ruleType:Oe.NotExpression,ctx:n,type:this._typeHandle([m],W.BOOL),exprs:h}});w(this,"visitMemberIndexExpression",n=>{var m,_;const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const T=o[u];T.ruleIndex===I.RULE_singleExpression&&h.push(this.visit(T))}if(this._memberIndexVerify(h[0],n),this._hasMemberIndex=!0,((m=h[0])==null?void 0:m.ruleType)===Oe.MemberIndexExpression){const T=o[1];this._errors.push({message:we(Pe.unaryErr,{sign:"["}),startColumn:T.symbol.column+1,startLineNumber:T.symbol.line,endColumn:T.symbol.column+2,endLineNumber:T.symbol.line}),this._hasMemberIndex=!1}return{ruleType:Oe.MemberIndexExpression,type:(_=h[0])==null?void 0:_.type,ctx:n,isInFunc:this._isInFunc,exprs:h}});w(this,"visitMethodStmt",n=>{const{children:o}=n;let u=0;const h=[],m=[];let _;for(;u<o.length;u++){const T=o[u];T.ruleIndex===I.RULE_methodElement&&(h.push(this.visit(T)),m.push(T))}return _=this._getMethodTypes(h,m)||[],{ruleType:Oe.MethodExpression,types:_.length>1||_.isBrackethesized||_.isUnknown?_:void 0,ctx:n,type:_.length===1?_[0]:void 0,exprs:h}});w(this,"visitMethodExpression",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitLogicalAndExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const x=o[u];x.ruleIndex===I.RULE_singleExpression?m.push(this.visit(x)):h=x.symbol.text}const _=this._boolTypeJudge(m[0],o[0],h),T=this._boolTypeJudge(m[1],o[2],h,1);return{ruleType:Oe.LogicalAndExpression,type:this._typeHandle([_,T],W.BOOL),operator:h,ctx:n,exprs:m}});w(this,"visitLogicalOrExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const x=o[u];x.ruleIndex===I.RULE_singleExpression?m.push(this.visit(x)):h=x.symbol.text}const _=this._boolTypeJudge(m[0],o[0],h),T=this._boolTypeJudge(m[1],o[2],h,1);return{ruleType:Oe.LogicalOrExpression,operator:h,ctx:n,type:this._typeHandle([_,T],W.BOOL),exprs:m}});w(this,"visitMultiplicativeExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const x=o[u];x.ruleIndex===I.RULE_singleExpression?m.push(this.visit(x)):h=x.symbol.text}const _=this._calcTypeJudge(m[0],o[0],h),T=this._calcTypeJudge(m[1],o[2],h,1);return{ruleType:Oe.MultiplicativeExpression,operator:h,ctx:n,type:this._typeHandle([_,T]),exprs:m}});w(this,"visitBrackethesized",n=>{const{children:o}=n,u=o[1];return{ruleType:Oe.Brackethesized,ctx:n,exprs:this.visit(u)}});w(this,"visitArguments",n=>{const{children:o}=n;let u=0;const h={params:[]};let m="";for(;u<o.length;u++){const _=o[u];if(_.ruleIndex===I.RULE_argument){const T=this.visit(_),x=T.paramKey;x?(m=x,h[x]?this._errorHandle(we(Ri.moreSameArg,{arg:x}),n.parentCtx,Lr.Warning):(h[x]=T.param,h[x].ctx=_)):m?this._errorHandle(we(Pe.argsSyntaxErr,{argName:m}),_):(T.ctx=_,h.params.push(T))}}return h});w(this,"visitArgument",n=>{const{children:o}=n;return o.length===1?this.visit(o[0]):{paramKey:this.visit(o[0]),param:this.visit(o[2])}});w(this,"visitIfStatement",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.IfStatement,condition:[],block:[],ctx:n,typeList:[]};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_singleExpression:h.condition.push(this.visit(m));break;case I.RULE_blockLine:const _=this._isInLocalScop;this._isInLocalScop=!0;const T=this.visit(m);h.typeList.push(this._getBlockReturnTypes(T)),h.block.push(T),this._isInLocalScop=_;break}}return h});w(this,"visitForToStatement",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.ForToStatement,numerical:[],ctx:n,block:[]};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_varModifier:h.declare=this.visit(m);break;case I.RULE_typeGather:const _=this.visit(m);h.type=_&&this._typeAddSeries(_);break;case I.RULE_identifier:h.name=this.visit(m),this._repeatVarJudge(h.name,m);break;case I.RULE_singleExpression:h.numerical.push(this.visit(m));break;case I.RULE_blockLine:this._blockCount++,this._pushBlockRanges(n),h.name&&this._variablesHandle({nameList:{name:h.name,isForVar:!0,type:h.type},value:{type:h.type||`${W.SERIES} ${W.INT}`}},n),this._blockCount--,this._blockRanges.pop(),this._loopCount++;const T=this._isInLocalScop;this._isInLocalScop=!0,h.block=this.visit(m),this._loopCount--,this._isInLocalScop=T,h.returnedTypes=this._getBlockReturnTypes(h.block);break}}return h});w(this,"visitForInStatement",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.ForInStatement,ctx:n,names:[]};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_identifier:const _=this.visit(m);this._repeatVarJudge(_,m),h.names.push(_);break;case I.RULE_singleExpression:h.array=this.visit(m);const T=h.array.type;this._isArrayType(T)||this._isMatrixType(T)||T===W.UNDETERMINED||this._errorHandle(we(Pe.typeMismatch,{operator:"foreach",index:"id",typeE:T,typeR:"array<fun_arg>"}),m);break;case I.RULE_blockLine:if(this._blockCount++,this._pushBlockRanges(n),h.names.length){let[P,A]=h.names;const F=h.array.type;A?this._variablesHandle({nameList:{name:P,isForVar:!0,type:`${W.SERIES} ${W.INT}`},value:{type:`${W.SERIES} ${W.INT}`}},n):A=P;const $=F===W.UNDETERMINED?F:this._isMatrixType(F)?`${this._getArrayType(F)}[]`:this._typeAddSeries(this._getArrayType(F));this._variablesHandle({nameList:{name:A,isForVar:!0,type:$},value:{type:$}},n)}this._blockCount--,this._blockRanges.pop(),this._loopCount++;const x=this._isInLocalScop;this._isInLocalScop=!0,h.block=this.visit(m),this._isInLocalScop=x,this._loopCount--,h.returnedTypes=this._getBlockReturnTypes(h.block);break}}return h});w(this,"visitSwitchStatement",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.SwitchStatement,condition:!0,ctx:n,cases:[],defaultCase:void 0};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_singleExpression:h.condition=this.visit(m);break;case I.RULE_caseClause:h.cases.push(this.visit(m));break;case I.RULE_defaultCaluse:h.defaultCase=this.visit(m);break}}return h});w(this,"visitCaseClause",n=>{const{children:o}=n,u={ruleType:Oe.CaseClause},h=this._isInLocalScop;return this._isInLocalScop=!0,u.condition=this.visit(o[0]),u.block=this.visit(o[2]),this._isInLocalScop=h,u.returnedTypes=this._getBlockReturnTypes(u.block),u});w(this,"visitDefaultCaluse",n=>{const{children:o}=n,u={ruleType:Oe.DefaultCaluse},h=this._isInLocalScop;return this._isInLocalScop=!0,u.block=this.visit(o[1]),this._isInLocalScop=h,u.returnedTypes=this._getBlockReturnTypes(u.block),u});w(this,"visitWhileStatement",n=>{const{children:o}=n,u={ruleType:Oe.WhileStatement,ctx:n};u.condition=this.visit(o[1]),this._loopCount++;const h=this._isInLocalScop;return this._isInLocalScop=!0,u.block=this.visit(o[2]),this._isInLocalScop=h,this._loopCount--,u.returnedTypes=this._getBlockReturnTypes(u.block),u});w(this,"visitImportStmt",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_importElement&&h.push(this.visit(m))}return h});w(this,"visitImportElement",n=>{const{children:o}=n;let u=0;const h=[],m={ruleType:Oe.ImportElement,ctx:n};for(;u<o.length;u++){const _=o[u];_.ruleIndex===I.RULE_identifier?h.push(this.visit(_)):_.symbol&&_.symbol.type===I.IntegerLiteral&&(m.libraryVersion=_.symbol.text)}return m.username=h[0],m.libraryName=h[1],m.name=h[2],m});w(this,"visitLiteral",n=>{const{children:o}=n,u=o[0],{type:h,text:m}=u.symbol,_={ruleType:Oe.Literal,ctx:n,type:"",value:m};switch(h){case I.ColorLiteral:_.type=W.COLOR;break;case I.BooleanLiteral:_.type=W.BOOL;break;case I.StringLiteral:_.type=W.STRING;break;case I.IntegerLiteral:_.type=W.INT;break;case I.DecimalLiteral:_.type=W.FLOAT;break}return _.type&&(_.type=`${W.CONST} ${_.type}`),_});w(this,"visitMethodElement",n=>{const{children:o}=n,[u,h]=o,[m,_,T]=this.visit(u),x=this.visit(h);return{name:m,type:_,args:x,expr:T}});w(this,"visitMethodName",n=>{const{children:o}=n,u=[],h=[];let m=0,_=null;for(;m<o.length;m++){const x=o[m],P=x.ruleIndex,A=x.symbol;switch(P){case I.RULE_identifier:u.push(this.visit(x));break;case I.RULE_singleExpression:_=this.visit(x);break;case I.RULE_typeName:const F=this.visit(x);h.push(F),this._typeCheck(F,I.RULE_typeName,x);break;default:A&&A.text==="."&&u.push(".")}}return[u.join(""),h,_]});w(this,"visitArrowFunction",n=>{const{children:o}=n,u={ruleType:Oe.ArrowFunction,returnedTypes:[]};let h=0,m={lineNumber:0,column:0};for(;h<o.length;h++){const _=o[h],T=_.ruleIndex,x=_.symbol;switch(T){case I.RULE_identifier:m={lineNumber:_.start.line,column:_.start.column},u.name=this.visit(_);break;case I.RULE_arrowFunctionParameters:u.params=this.visit(_),this._setFuncParams(u);break;case I.RULE_block:this._isInFunc=!0,this._hasMemberIndex=!1,u.block=this.visit(_),u.hasMemberIndex=this._hasMemberIndex,u.returnedTypes=this._getBlockReturnTypes(u.block),this._isInFunc=!1;break;default:x&&x.type===I.Export&&(u.isExport=!0)}}return this._setFunc(u,m),this._currentFuncParams.clear(),u});w(this,"visitArrowFunctionParameters",n=>{const{children:o}=n;let u=0,h=[];for(;u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_formalParameterList&&(h=this.visit(m))}return h});w(this,"visitFormalParameterList",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_formalParameterArg&&h.push(this.visit(m))}return h});w(this,"visitFormalParameterArg",n=>{const{children:o}=n;let u=0;const h={};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_typeGather:const _=this.visit(m);h.type=_&&this._typeAddSeries(_);break;case I.RULE_identifier:h.name=this.visit(m);break;case I.RULE_singleExpression:h.defaultValue=this.visit(m)}}return h.type=h.type||W.UNDETERMINED,h});w(this,"visitArrowMethod",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.ArrowMethod,returnedTypes:[]};let m={lineNumber:0,column:0};for(;u<o.length;u++){const _=o[u];switch(_.ruleIndex){case I.RULE_identifier:m={lineNumber:_.start.line,column:_.start.column},h.name=this.visit(_);break;case I.RULE_arrowMethodParameters:h.params=this.visit(_),this._setFuncParams(h);break;case I.RULE_block:this._isInFunc=!0,this._hasMemberIndex=!1,h.block=this.visit(_),h.hasMemberIndex=this._hasMemberIndex,h.returnedTypes=this._getBlockReturnTypes(h.block),this._isInFunc=!1;break;default:_.symbol&&_.symbol.type===I.Export&&(h.isExport=!0);break}}return this._setFunc(h,m),this._setMethod(h,m),this._currentFuncParams.clear(),h});w(this,"visitArrowMethodParameters",n=>{const{children:o}=n;let u=0;const h={};let m=[];for(;u<o.length;u++){const _=o[u];switch(_.ruleIndex){case I.RULE_typeGather:const T=this.visit(_);h.type=T&&this._typeAddSeries(T);break;case I.RULE_identifier:h.name=this.visit(_);break;case I.RULE_formalParameterList:m=this.visit(_);break}}return[h,...m]});w(this,"visitTypeStatement",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.TypeStatement,fields:[]};let m={lineNumber:0,column:0};for(;u<o.length;u++){const _=o[u];switch(_.ruleIndex){case I.RULE_identifier:m={lineNumber:_.start.line,column:_.start.column},h.name=this.visit(_);break;case I.RULE_typeElement:h.fields.push(this.visit(_));break;default:_.symbol&&_.symbol.type===I.Export&&(h.isExport=!0);break}}return this._setUserType(h,m),this._setNewFunc(h,m),this._setCopyFunc(h,m),this._setCopyMethod(h,m),h});w(this,"visitTypeElement",n=>{const{children:o}=n;let u=0;const h={};let m=null;for(;u<o.length;u++){const _=o[u];switch(_.ruleIndex){case I.RULE_typeGather:const T=this.visit(_);if(_.children[0].ruleIndex===I.RULE_typeSeries){const{column:x,line:P,text:A}=_.start,F=x+1;this._errors.push({startColumn:F,endColumn:parseInt(F+A.length),startLineNumber:P,endLineNumber:P,message:we(this._buildinTypes.has(A)?Pe.typeUseError:Pe.notTypeKeyword,{text:A})}),h.type=W.UNDETERMINED}else h.type=T&&this._typeAddSeries(T);break;case I.RULE_identifier:h.name=this.visit(_);break;case I.RULE_singleExpression:m=_,h.value=this.visit(_);break;default:_.symbol&&_.symbol.type===I.Varip&&(h.isVarip=!0);break}}return this._typeElementVerify(h,m),h});w(this,"visitAssignmentOperator",n=>{const{children:o}=n;return o&&o[0].symbol.text});w(this,"visitTypeMap",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];if(m.ruleIndex===I.RULE_typeName){const _=this.visit(m);h.push(_),this._typeCheck(_,I.RULE_typeName,m)}}return`map<${h[0]},${h[1]}>`});w(this,"visitTypeSeries",n=>{const{children:o}=n,[u,h]=o,m=this.visit(u),_=this.visit(h);return this._typeCheck(m,I.RULE_typeSeries,u),this._typeCheck(_,I.RULE_typeName,h),`${m} ${_}`});w(this,"visitTypeArray",n=>{const{children:o}=n,u=o[0];let h=this.visit(u),m=h;if(o.length===3)h=W.ARRAY;else{this._typeCheck(h,I.RULE_typeArray,u);let _=1;for(;_<o.length;_++){const T=o[_];T.ruleIndex===I.RULE_typeName&&(m=this.visit(T),this._typeCheck(m,I.RULE_typeName,T))}}return this._arrayTypeConvert(`${h}<${m}>`)});w(this,"visitTypeGather",n=>{const{children:o}=n;if(o&&o.length){const u=o[0],h=this.visit(u);return u.ruleIndex===I.RULE_typeName&&this._typeCheck(h,I.RULE_typeName,u),h}return null});w(this,"visitIdentifier",n=>n.children&&n.children[0].symbol.text);w(this,"visitTypeName",n=>{const{children:o}=n;let u=0,h="";for(;u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_identifier?h=`${h}${this.visit(m)}`:h=`${h}.`}return h});w(this,"visitName",n=>{var x,P;const{children:o}=n;let u=0,h=!1;const m=[];let _=null;for(;u<o.length;u++){const A=o[u];switch(A.ruleIndex){case I.RULE_identifier:m.push(this.visit(A));break;case I.RULE_singleExpression:_=this.visit(A);break;case I.RULE_methodElement:h=!0,m.push(this.visit(A));break}}const T={ruleType:Oe.Name,hasMethod:h,exprs:m,expr:_};if(h){let A="";const F=[];for(const V of m)typeof V=="string"?A=A?`${A}.${V}`:V:(A&&(V.name=`${A}.${V.name}`),F.push(V),A="");T.exprs=[...F,A];const $=this._getMethodTypes(F,Array.from(F,()=>n));if($&&$.length){const V=we(Pe.noFiledErr,{name:A});$.length>1&&this._errorHandle(V,n),T.type=((P=this._nameCheck(this._getOriginMethodName($[0],A),n,V))==null?void 0:P.type)||W.UNDETERMINED}}else{let A=m.join(".");if(_&&_.type&&_.type===W.UNDETERMINED)T.type=W.UNDETERMINED,A=`expr0.${A}`;else{_&&_.type&&(A=`${this._getMethodTypeName(_.type)}.${A}`);const F=this._nameCheck(A,n)||{};(x=F.title)!=null&&x.startsWith("built-in")&&(T.isBuiltIn=!0,T.isConst=F.isConst),T.varPos=F.pos,T.declare=F.declare,T.type=(F==null?void 0:F.type)||W.UNDETERMINED,F!=null&&F.isArg&&(T.arg=F),T.scope=this._blockCount}T.name=A}return T});this._loopCount=0,this._errors=[],this._variables=new Map,this._functions=new Map,this._methods=new Map,this._currentFuncParams=new Map,this._types=new Map,this._currentBlockVars=[new Map],this._blockCount=0,this._isInFunc=!1,this._isNeedCalc=!1,this._blockRanges=[],this._overloadsFuncs=[],this._hasMemberIndex=!1,this._isInLocalScop=!1,this._onlyStatementsCount=0}get overloadsFuncs(){return this._overloadsFuncs}get errors(){return this._errors}get userTypes(){return this._types}get userFunctions(){return this._functions}get userVariables(){return this._variables}get userMethods(){return this._methods}_verifyGloablVar(n,o){const{name:u,varPos:h,isBuiltIn:m}=n;if(m&&this._errorHandle(we(Pe.buidinAssignErr,{name:u}),o),!h)return;const _=this._currentBlockVars[0].get(u);if(!_)return;const{column:T,lineNumber:x}=_.pos||{};this._isInFunc&&T===h.column&&x===h.lineNumber&&this._errorHandle(we(Pe.modifyGlobalVarErr,{name:u}),o)}_typeElementVerify(n,o){var _,T;const{type:u,value:h}=n;if(!h)return;if(![Oe.Literal,Oe.UnaryExpression].includes(h.ruleType)&&!h.isBuiltIn){this._errorHandle(Pe.defaultValueErr,o);return}else if(h.ruleType===Oe.UnaryExpression){const{exprs:x}=h;if(![Oe.Literal,Oe.UnaryExpression].includes((_=x[0])==null?void 0:_.ruleType)&&!((T=x[0])!=null&&T.isBuiltIn)){this._errorHandle(Pe.defaultValueErr,o);return}}(!this._compareType(u,h.type)||u.endsWith(W.INT)&&h.type.endsWith(W.FLOAT))&&this._errorHandle(we(Pe.defaultValueTypeErr,{typeE:h.type,typeR:u}),o)}_memberIndexVerify(n,o){if(n.ruleType===Oe.Name&&!n.hasMethod&&this._blockCount){const h=this._currentBlockVars[this._blockCount],m=h&&h.get(n.name);m&&(m.isForVar?this._errorHandle(we(Pe.notHistoryErr,{name:n.name}),o):!(this._blockCount===1&&this._isInFunc)&&this._errorHandle(we(Ri.localScopeGetHistory,{name:n.name}),o,Lr.Warning))}const u=n&&n.type;if(u){const h=this._removePrefix(u);!this._types.has(h)&&!this._buildinTypes.has(h)&&!this._isArrayType(h)&&!this._isMatrixType(h)&&!this._isMapType(h)&&h!==W.UNDETERMINED&&this._errorHandle(we(Pe.invalidType,{index:0}),o)}}_setFuncParams(n){var o;for(const u of n.params){const h=(o=this._types.get(u.type))==null?void 0:o[0];if(h&&h.fields)for(const m of h.fields){const _=`${u.name}.${m.name}`;this._currentFuncParams.set(_,{...m,originName:_})}this._setVariablesMap(u),this._currentFuncParams.set(u.name,u)}}_pushBlockRanges(n){!n||!n.start||!n.stop||this._blockRanges.push({startColumn:n.start.column,endColumn:n.stop.column,startLineNumber:n.start.line,endLineNumber:n.stop.line})}_setUserType(n,o){const{fields:u,name:h}=n;this._types.set(h,[{fields:u.map(m=>({name:m.name,type:m.type})),name:h,pos:o}]),this._addVarToMap(h,h,o,!1,!1)}_againAssignHandle(n,o,u){const h=u!==":="?u.replace("=",""):u,m=u!==":="?[W.UNDETERMINED,W.INT,W.FLOAT]:[];h==="+"&&m.push(W.STRING);const[_,T]=n;_.arg&&!_.name.includes(".")&&this._errorHandle(we(Pe.funcArgAssignErr,{name:_.name}),o[0]);const x=this._sameTypeJudge(n,o,h,m),P=this._typeHandle(x);return this._updateUserVar(_.name,P,T.type),_.type=P,{ruleType:Oe.AgainAssign,name:_,operator:u,type:P,value:T}}_typeCheck(n,o,u){const h=[W.SERIES,W.SIMPLE,W.CONST];switch(o){case I.RULE_typeName:const m=this._buildinTypes.get(n);m&&![...h,W.ARRAY,W.MATRIX,W.MAP].includes(m[0].name)||this._types.get(n)||this._errorHandle(we(Pe.notTypeKeyword,{text:n}),u);break;case I.RULE_typeArray:[W.ARRAY,W.MATRIX].includes(n)||this._errorHandle(Pe.tempateTypeErr,u);break;case I.RULE_typeSeries:h.includes(n)||this._errorHandle(we(Pe.qualifierErr,{name:n}),u);break}}_getBuildVar(n){const o=this._buildinVariables.get(n);if(o&&o[0])return o[0];const u=this._buildinConstants.get(n);if(u&&u[0])return Object.assign(u[0],{isConst:!0})}_verifyName(n,o){var h,m;const u=this._getBuildVar(n);if(u)return u;if(n.includes(".")){const _=n.split("."),T=_.pop(),x=_.join(".");let P=this._blockCount;for(;P>=0;){if(!this._currentBlockVars[P]){P--;continue}const A=this._currentBlockVars[P].get(x);if(o&&this._judgeGatherValue(T||"",o,A==null?void 0:A.valueType,!0),(A==null?void 0:A.type)==="chart.point"){const $=(((m=(h=this._buildinTypes.get(A.type))==null?void 0:h[0])==null?void 0:m.fields)||[]).find(V=>V.name===T);if($)return Object.assign($,{pos:A.pos})}P--}}return this._getUserVar(n)}_judgeGatherValue(n,o,u,h){u===`${W.SIMPLE} ${W.NA}`&&this._errorHandle(we(Pe.objectIsNaErr,{name:n,type:h?"field":"method"}),o)}_nameCheck(n,o,u=we(Pe.undeclared,{name:n})){const h=this._verifyName(n,o);return h||this._errorHandle(u,o),h}_inBlock(n){this._blockCount++,this._pushBlockRanges(n);const o=this.visit(n);return this._blockCount--,this._blockRanges.pop(),this._currentBlockVars.splice(this._blockCount+1),o}_errorHandle(n,o,u=Lr.Error){this._errors.push({message:n,startColumn:o.start.column+1,startLineNumber:o.start.line,endColumn:o.start.column+2+o.stop.stop-o.start.start,endLineNumber:o.stop.line,type:u})}_boolTypeJudge(n,o,u,h=0){return this._typeJudge(n,o,u,W.BOOL,[W.UNDETERMINED,W.INT,W.FLOAT,W.BOOL],h)}_calcTypeJudge(n,o,u,h=0){return this._typeJudge(n,o,u,"int/float",[W.UNDETERMINED,W.INT,W.FLOAT],h)}_typeJudge(n,o,u,h,m,_=0){const T=n&&n.type;if(T){const x=this._removePrefix(T);if(!m.includes(x)&&x!==W.NA)return this._errorHandle(we(Pe.typeMismatch,{operator:`operator ${u}`,index:`expr${_}`,typeE:x,typeR:h}),o),W.UNDETERMINED;h===W.BOOL&&[W.INT,W.FLOAT].includes(x)&&this._errorHandle(we(Ri.typeMismatch,{operator:`operator ${u}`,index:`expr${_}`,type:W.BOOL}),o,Lr.Warning)}return T||W.UNDETERMINED}_sameTypeJudge(n,o,u,h){let m="";const _=[],T=["plot_display","plot_simple_display"];["+","-","+=","-="].includes(u)&&(h=h.concat(T));for(const[x,P]of n.entries()){let A=P&&P.type||W.UNDETERMINED;const F=this._removePrefix(A);if(m||(m=F),!h.includes(F)&&h.length&&F!==W.NA){this._errorHandle(we(Pe.typeMismatch,{operator:`operator ${u}`,index:`expr${x}`,typeE:A,typeR:h.slice(1).join("/")}),o[x]),m=W.UNDETERMINED,_.push(m);continue}if(m===W.UNDETERMINED||F===W.UNDETERMINED)A=m=W.UNDETERMINED;else if(m!==F&&m!==W.NA&&F!==W.NA&&(![W.INT,W.FLOAT].includes(m)||![W.INT,W.FLOAT].includes(F)))if(u===":=")this._errorHandle(we(Pe.assignTypeMismatch,{typeE:F,name:n[0].name,typeR:m}),o[0]),A=m=W.UNDETERMINED;else if(["==","!=","?:"].includes(u)&&[W.INT,W.FLOAT,W.BOOL].includes(m)&&[W.INT,W.FLOAT,W.BOOL].includes(F))this._errorHandle(we(Ri.typeMismatch,{operator:`operator ${u}`,index:`expr${x}`,type:m}),o[x],Lr.Warning),A=m=W.UNDETERMINED;else if(T.includes(m)&&T.includes(F)){if(m!==F){const $=this._getPrefix(A);_[x-1]=`${this._getPrefix(_[x-1])} ${T[0]}`,A=m=`${$} ${T[0]}`}}else this._errorHandle(we(Pe.typeMismatch,{operator:`operator ${u}`,index:`expr${x}`,typeE:F,typeR:m}),o[x]),A=m=W.UNDETERMINED;_.push(A)}return _}_getUserVar(n,o=!1){for(let u=this._blockCount;u>=0;u--){const h=this._currentBlockVars[u];if(u<=0){const m=this._currentFuncParams.get(n);if(m)return m.isArg=!0,m}if(h){const m=h.get(n);if(m)return m}}if(n.includes(".")&&!o){let u=!1,h=null;if(n.split(".").reduce((m,_)=>{let T=m?`${m}.${_}`:_;const x=this._getUserVar(T,!0);return x!=null&&x.type?x.type===W.UNDETERMINED?u=!0:(T=x.type,h=x):h=null,T},""),u)return{name:n,type:W.UNDETERMINED};if(h)return h}return null}_repeatVarJudge(n,o){this._getBuildVar(n)&&this._errorHandle(we(Pe.buidinVarErr,{name:n}),o);for(let h=0;h<=this._blockCount;h++){const m=this._currentBlockVars[h];if(m&&m.get(n)){if(this._blockCount===h)return this._errorHandle(we(Pe.repeatVar,{name:n}),o),!0;this._errorHandle(we(Ri.repeatVar,{name:n}),o,Lr.Warning)}}}_judgeVarBuildIn(n){for(let o=0;o<=this._blockCount;o++){const u=this._currentBlockVars[o];if(u&&u.get(n))return!0}return!1}_updateUserVar(n,o,u){for(let h=0;h<=this._blockCount;h++){const m=this._currentBlockVars[h];if(m){const _=m.get(n);if(_){_.type=o,_.valueType=u;return}}}}_variablesHandle(n,o){var m,_,T,x;if(!(n&&n.nameList))return;const u=n.nameList;if(u.name==="_")return;const h=n.value;if(u.ruleType===Oe.VarMultiple){u.types=[],this._checkVarMultiple(u.names,h,o);for(const[P,A]of u.names.entries()){const F=this._varTypeJudge("",((m=h==null?void 0:h.types)==null?void 0:m[P])||W.UNDETERMINED,o);u.types.push(F),this._addVarToMap(A,F,u.posList[P],!0)}}else{const P=(h==null?void 0:h.type)||((_=h==null?void 0:h.returnedTypes)==null?void 0:_[0]);((T=h==null?void 0:h.types)!=null&&T.isBrackethesized||(x=h==null?void 0:h.returnedTypes)!=null&&x.isBrackethesized)&&this._errorHandle(we(Pe.tupleLeftVarErr,{name:u.name}),o),!u.type&&P===`${W.SIMPLE} ${W.NA}`&&this._errorHandle(Pe.naVarErr,o),u.prefix&&wi.indexOf(u.prefix)>wi.indexOf(this._getPrefix(P))&&this._errorHandle(we(Pe.declaredErr,{prefix:u.prefix,type:P}),o);const A=this._varTypeJudge(u.type,P||W.UNDETERMINED,o);u.type=A,this._addVarToMap(u.name,A,u.pos,!0,u.isForVar,u.declare,h.type)}}_checkVarMultiple(n,o,u){var x,P,A,F;const h=n.length,m=(o.types||o.returnedTypes||[]).length,_=((x=o.types)==null?void 0:x.isBrackethesized)||((P=o.returnedTypes)==null?void 0:P.isBrackethesized);(A=o.types)!=null&&A.isUnknown||(F=o.returnedTypes)!=null&&F.isUnknown||(m===1&&!_||!m?this._errorHandle(Pe.tupleRightVarErr,u):h!==m&&this._errorHandle(we(Pe.tupleVarErr,{indexA:m,indexB:h}),u))}_addVarToMap(n,o,u,h=!0,m=!1,_,T){var F;const x=this._currentBlockVars[this._blockCount]||new Map,P=(F=this._types.get(o))==null?void 0:F[0];if(P&&P.fields)for(const $ of P.fields)x.set(`${n}.${$.name}`,$);const A={name:n,type:o,pos:u,valueType:T};h&&this._setVariablesMap(A),x.set(n,Object.assign(A,{isForVar:m,declare:_})),this._currentBlockVars[this._blockCount]=x}_setVariablesMap(n){const o=this._blockRanges[this._blockCount];n.range=o,n.scope=this._blockCount;const u=this._variables.get(n.name)||[];u.push(n),Object.assign(n,{defaultValue:void 0}),this._variables.set(n.name,u)}_varTypeJudge(n,o,u){if(o===W.VOID)return this._errorHandle(Pe.voidNotVar,u),W.UNDETERMINED;if(n&&o!==W.UNDETERMINED){const h=this._removePrefix(n),m=this._removePrefix(o);return m!==h&&m!==W.NA&&!(h===W.FLOAT&&m===W.INT)?(this._errorHandle(we(Pe.declareTypeErr,{type:n,valueType:o}),u),W.UNDETERMINED):this._typeHandle([n,o])}else if(o===W.UNDETERMINED)return W.UNDETERMINED;return n||o||W.UNDETERMINED}_getAllowTypes(n){const o=[];if(n===W.UNDETERMINED)return o;const u=this._getPrefix(n);if(u){const h=this._removePrefix(n);let m=-1;for(const[_,T]of wi.entries())T===u&&(m=_),m>=0&&m<=_&&(h===W.FLOAT&&o.push(`${T} ${W.INT}`),o.push(`${T} ${h}`))}else n=this._arrayTypeConvert(n)||"",o.push(n),n.includes(W.FLOAT)&&o.push(n.replace(/float/,W.INT));return o}_setNewFunc(n,o){const u=`${n.name}.new`,h=[],m=[];for(const _ of n.fields)h.push({name:_.name,required:!1,allowedTypeIDs:this._getAllowTypes(_.type),displayType:_.type}),m.push(`${_.type} ${_.name}`);this._functions.set(u,[{name:u,args:h,returnedTypes:[n.name],isUser:!0,pos:o,syntax:[`${u}(${m.join(", ")}) → ${n.name}`]}])}_setCopyFunc(n,o){const u=n.name,h=`${u}.copy`;this._functions.set(h,[{name:h,args:[{name:"object",required:!0,allowedTypeIDs:[u],displayType:u}],returnedTypes:[u],isUser:!0,pos:o,info:"The identifier of the object to be copied.",syntax:[`${h}(${u} object) → ${u}`]}])}_setCopyMethod(n,o){const u=n.name,h=`${u}.copy`;this._methods.set(h,[{name:h,args:[],returnedTypes:[u],thisType:[u],isUser:!0,pos:o,syntax:[`${h}() → ${u}`]}])}_setFunc(n,o){const u=[],h=[];for(const x of n.params){const{type:P,name:A,defaultValue:F}=x;u.push({name:A,required:!F,allowedTypeIDs:this._getAllowTypes(P),displayType:P}),h.push(`${P===W.UNDETERMINED?"":`${P} `}${A}`)}const{returnedTypes:m=[]}=n,_=n.name,T=m.length>1?`[${m.join(", ")}]`:m.toString();this._functions.set(_,[{name:_,args:u,syntax:[`${_}(${h.join(", ")}) → ${T||"void"}`],isUser:!0,hasMemberIndex:n.hasMemberIndex,pos:o,returnedTypes:m}])}_setMethod(n,o){const{name:u,returnedTypes:h,params:m}=n,_=m[0].type,T=[],x=[];for(const $ of m.slice(1)){const{type:V,name:b,defaultValue:y}=$;T.push({name:b,required:!y,allowedTypeIDs:this._getAllowTypes(V),displayType:V}),x.push(`${V} ${b}`)}const P=h.length>1?`[${h.join(", ")}]`:h.toString(),A=this._getMethodTypeName(_),F=`${A}.${u}`;n.typeName=A,this._methods.set(F,[{name:u,args:T,originalName:F,syntax:[`${u}(${x.join(", ")}) → ${P||"void"}`],returnedTypes:h,isUser:!0,hasMemberIndex:n.hasMemberIndex,pos:o,thisType:[_]}])}_getMethodTypes(n,o){let u;for(const[h,m]of n.entries()){const{type:_,expr:T,args:x}=m;let{name:P}=m;const A=o[h];if(T){if(T.type===W.UNDETERMINED)return[W.UNDETERMINED];P=`${this._getMethodTypeName(T.type)}${P}`,x.params.unshift(T)}if(u&&u.length>=1)if(u.length===1){const F=u[0];if(F===W.UNDETERMINED)return[W.UNDETERMINED];const $=this._getOriginMethodName(F,P);P.includes(".")?u=this._getOtherNamesMethodType($,u,A,x,m):u=this._expandMethodHandle($,A,x,{type:F},F,m)}else this._errorHandle(we(Pe.noFiledErr,{name:P}),A);else{const[F,$]=this._tempFuncNameHandle(P,A,_);P=$;const V=this._buildinFunctions.get(F);if(V)this._globalFuncVerify(V[0],A),this._hasMemberIndexVerify(V[0],A,m),m.isBuiltIn=!0,u=this._getBuildInReturnTypes(V,x,P,A,void 0,_);else{const b=this._functions.get(P);if(b){this._hasMemberIndexVerify(b[0],A,m),u=b[0].returnedTypes;const{hasErr:y}=this._checkArgs(x,b[0].args||[],P,A,u[0]);if(y)return[W.UNDETERMINED]}else u=this._getOtherNamesMethodType(P,u,A,x,m)}}m.returnTypes=u}return u===void 0&&this._errorHandle(we(Pe.notFindFuncErr,{name:n[0].name}),o[0]),u}_globalFuncVerify(n,o){this._blockCount!==0&&Tm.includes(n.name)&&this._errorHandle(we(Pe.globalFuncErr,{name:n.name}),o)}_hasMemberIndexVerify(n,o,u){(n.hasMemberIndex||n.name.startsWith("ta.")||n.name==="math.sum")&&(this._hasMemberIndex=this._isInFunc,u.hasMemberIndex=!0,u.position=o.start.tokenIndex,this._isInLocalScop&&this._errorHandle(we(Ri.localScopeWarning,{name:u.name}),o,Lr.Warning))}_tempFuncNameHandle(n,o,u){let h=n;if(u&&u.length>=1){const m=["array.new","matrix.new"].includes(n),_=n==="map.new";if(u.length===1)if(m)h=`${n}<type>`,n=`${n}<${u[0]}>`;else return _?this._errorHandle(we(Pe.templateErr,{countA:2,countB:1}),o):this._errorHandle(we(Pe.templateNoSupportErr,{name:n}),o),[W.UNDETERMINED];else{if(!_)return m?this._errorHandle(we(Pe.templateErr,{countA:1,countB:2}),o):this._errorHandle(we(Pe.templateNoSupportErr,{name:n}),o),[W.UNDETERMINED];if(!Sm.includes(u[0]))return this._errorHandle(we(Pe.mapKeyErr,{type:this._typeAddSeries(u[0])}),o),[W.UNDETERMINED];h=`${n}<type,type>`,n=`${n}<${u[0]},${u[1]}>`}}return[h,n]}_getOtherNamesMethodType(n,o,u,h,m){const _=n.split("."),T=_.length-1,x=_.slice(0,T).join("."),P=this._getUserVar(x);this._judgeGatherValue(_[T],u,P==null?void 0:P.valueType);const A=P==null?void 0:P.type;if(A){if(A===W.UNDETERMINED)return o=[W.UNDETERMINED],o.isUnknown=!0,o;const F=this._getOriginMethodName(A,_[T]);o=this._expandMethodHandle(F,u,h,P,x,m)}else{let F="",$="",V="";for(const b of _.slice(0,T)){F?$=this._getOriginMethodName(F,b):$=$?`${$}.${b}`:b;const y=this._verifyName($);y!=null&&y.type?(F=y.type,V=""):this._buildinTypes.get($)?V=we(Pe.methodNotExistErr,{name:$,methodName:_[T]}):V=we(Pe.noFiledErr,{name:b})}V&&this._errorHandle(V,u)}return o}_expandMethodHandle(n,o,u,h,m,_){var P,A;let T;const x=this._buildinMethods.get(n);if(x)T=this._getBuildInReturnTypes(x,u,n,o,h);else{const F=this._methods.get(n);if(F&&F.length){const $=F[0],V=this._getMethodTypeName(((P=$.thisType)==null?void 0:P[0])||"");if(!this._types.get(V)){const g=this._functions.get($.name);g&&(_.selfArg=(A=g[0].args)==null?void 0:A[0])}this._hasMemberIndexVerify($,o,_),T=$.returnedTypes;const{hasErr:y}=this._checkArgs(u,$.args||[],n,o,(T==null?void 0:T[0])||"");if(y)return[W.UNDETERMINED]}else this._errorHandle(we(Pe.methodNotExistErr,{methodName:n.split(".").slice(-1)[0],name:m}),o)}return T}_getBuildInReturnTypes(n,o,u,h,m,_){var x;let T;if(n.length===1){const{returnedTypes:P,syntax:A,args:F=[],thisType:$}=n[0],V=A[0].split("→")[1].trim(),b=m||o.params[0]||((x=F[0])==null?void 0:x.name)&&o[F[0].name];b&&!this._checkMethodThisType($,b.type)&&this._errorHandle(we(Pe.typeMismatch,{operator:u,index:b.name||"id",typeE:b.type,typeR:$[0]}),h);const{hasErr:y,types:g}=this._checkArgs(o,F,u,h,V,b);if(y)return[W.UNDETERMINED];if(T=g.length&&g||this._returnedTypesParse(P),T.length>1)return T;(_==null?void 0:_.length)===1?T=[this._typeReplace(V,_[0])]:(_==null?void 0:_.length)===2&&(T=[`${W.MAP}<${_[0]},${_[1]}>`]),T=this._returnTypesOtherHandle(b,V,T,u)}else{const P=this._overloadsFuncGetTypes(n,o,h,m);T=this._returnedTypesParse([P])}return T}_overloadsFuncGetTypes(n,o,u,h){var F,$;let m="",_=[],T=[],x=0;for(const[V,b]of n.entries()){const{args:y,returnedTypes:g,name:D,thisType:R}=b,O=h||o.params[0]||o[y[0].name],{errMsg:U,warnMsg:X}=this._overloadsCheckArgs(o,y,D,u,O);O&&!this._checkMethodThisType(R,O.type)&&U.unshift({msg:we(Pe.typeMismatch,{operator:D,index:O.name||"id",typeE:O.type,typeR:R[0]}),ctx:u}),V===0?(_=U,T=X,!U.length&&(m=g[0])):U.length?((F=_[0])!=null&&F.isLenErr&&!(($=U[0])!=null&&$.isLenErr)||_.length>U.length)&&(_=U,T=X,x=V):this._priorityComparison(m,g[0])||(g[0]===`${W.ARRAY}<>`?m=`${O.type}[]`:m=g[0],_=U,T=X,x=V)}for(const V of _)this._errorHandle(V.msg,V.ctx);for(const V of T)this._errorHandle(V.msg,V.ctx,Lr.Warning);const P=u.children[0],A=n[0].name;return P&&this._overloadsFuncs.push({name:A,index:x,line:P.start.line,startColumn:P.start.column+1,endColumn:P.start.column+A.length}),this._funcArgsAddOriginName(o,n[x].args,A),m||W.UNDETERMINED}_funcArgsAddOriginName(n,o,u){const h=n.params||[];for(const[m,_]of o.entries())m<h.length&&(h[m].originName=_.name);if(u==="input"){const m=h[0]||n.defval;Object.assign(n,{inputType:{name:`'${m!=null&&m.isSourceType?"source":this._removePrefix(m==null?void 0:m.type)}'`}})}}_overloadsCheckArgs(n,o,u,h,m){const _={...n},T=_.params;delete _.params;const x=Object.keys(_).length+T.length,P=o.length,A=[],F=[];if(x>P&&!o.some(V=>["arg0, arg1, ...","number0, number1, ..."].includes(V.name)))return A.push({msg:we(Pe.argsLenErr,{name:u,lenA:x,lenB:P}),isLenErr:!0,ctx:h}),{errMsg:A,warnMsg:F};for(const[$,V]of o.entries()){let b=_[V.name];if($<T.length&&(b&&F.push({msg:we(Ri.moreSameArg,{arg:V.name}),ctx:h}),b=T[$]),!b)V.required&&A.push({msg:we(Pe.requiredParamErr,{name:u,argName:V.name}),ctx:h});else{const y=b.type!==`${W.SIMPLE} na`?this._checkArg(b,V,u,m,b.ctx,!0):"";y&&A.push({msg:y,ctx:b.ctx}),delete _[V.name]}if(["arg0, arg1, ...","number0, number1, ..."].includes(V.name)&&T.length>$+1){const y=T.slice($+1);let g=T[$];for(const D of y){g.type===`${W.SIMPLE} ${W.NA}`&&(g=D);const R=D.type!==`${W.SIMPLE} ${W.NA}`?this._checkArg(D,V,u,g,D.ctx,!0):"";R&&A.push({msg:R,ctx:D.ctx})}}}if(Object.keys(_).length)for(const $ of Object.keys(_))A.push({msg:we(Pe.argsNameErr,{name:u,argName:$}),ctx:_[$].ctx});return{errMsg:A,warnMsg:F}}_checkArgs(n,o,u,h,m,_){var V;const T={...n},x=T.params;delete T.params;const P=Object.keys(T).length+x.length,A=o.length;let F=!1,$=[];if(P>A&&!o.some(y=>["arg0, arg1, ...","number0, number1, ..."].includes(y.name)))return this._errorHandle(we(Pe.argsLenErr,{name:u,lenA:P,lenB:A}),h),F=!0,{hasErr:F,types:$};for(const[b,y]of o.entries()){let g=T[y.name];if(b<x.length&&(g&&this._errorHandle(we(Ri.moreSameArg,{arg:y.name}),h,Lr.Warning),g=x[b],g.originName=y.name),!g)y.required&&(this._errorHandle(we(Pe.requiredParamErr,{name:u,argName:y.name}),h),F=!0);else{const D=g.type!==`${W.SIMPLE} ${W.NA}`?this._checkArg(g,y,u,_,g.ctx):"";if(D)this._errorHandle(D,g.ctx),F=!0;else if(D===!1)F=!0;else if(u.startsWith("request.")&&y.name==="expression")if(g.ruleType===Oe.Brackethesized)$=g.exprs.map(R=>this._typeReplace(m,R.type));else if((V=g.types||g.returnedTypes)!=null&&V.isBrackethesized)$=(g.types||g.returnedTypes).map(R=>this._typeReplace(m,R));else{const R=this._typeReplace(m,g.type);$.push(R)}delete T[y.name]}}if(Object.keys(T).length)for(const b of Object.keys(T))this._errorHandle(we(Pe.argsNameErr,{name:u,argName:b}),T[b].ctx),F=!0;return{hasErr:F,types:$}}_checkArg(n,o,u,h,m,_){const{ruleType:T,exprs:x,name:P}=n;let A=n.type;T===Oe.Brackethesized&&(A=`[${x.map(b=>b.type).join(", ")}]`);const{allowedTypeIDs:F=[],displayType:$,name:V}=o;if(!(!A||A===W.UNDETERMINED||$===W.UNDETERMINED)&&(u==="input"&&V==="defval"&&gl.includes(P)&&(n.isSourceType=!0),!(this._checkMethodThisType(F,this._arrayTypeConvert(A))&&!(u==="input.source"&&V==="defval")))){if(V==="condition"&&($!=null&&$.endsWith(W.BOOL))&&(A.endsWith(W.INT)||A.endsWith(W.FLOAT))){m&&this._errorHandle(we(Ri.typeMismatch,{index:V,operator:u,type:W.BOOL}),m,Lr.Warning);return}switch($){case"tuple of const string values: [val1, val2, ...]":return this._tupleToCheck(n,o,[`${W.CONST} ${W.STRING}`],u,A);case"tuple of const int/float values: [val1, val2, ...]":return this._tupleToCheck(n,o,[`${W.CONST} ${W.FLOAT}`,`${W.CONST} ${W.INT}`],u,A);case"tuple of const int values: [val1, val2, ...]":return this._tupleToCheck(n,o,[`${W.CONST} ${W.INT}`],u,A);case"open/high/low/close/hl2/hlc3/ohlc4/hlcc4":if(!P||!gl.includes(P))return we(Pe.inputSourceErr,{name:V,funcName:u});if(this._judgeVarBuildIn(P))return we(Pe.buildInUseErr,{name:P});n.isSourceType=!0;break;case"<matrix_type>":case"<array_type>":const b=this._getArrayType(u)||"";if(!A.endsWith(b)&&!(A.endsWith(W.INT)&&b===W.FLOAT))return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:this._typeAddSeries(b)});break;case"any matrix type":if(this._isMatrixType(A)){if(V==="id2"){const O=this._getArrayType(h==null?void 0:h.type);if(!O)return;const U=this._getArrayType(A)||"";if(O!==U)return we(Pe.typeMismatch,{operator:u,index:V,typeE:U,typeR:O})}}else return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:"matrix<fun_arg>"});break;case"any array type":if(this._isArrayType(A)){if(V==="id2"){const O=this._getArrayType(h==null?void 0:h.type);if(!O)return;const U=this._getArrayType(A)||"";if(O!==U)return we(Pe.typeMismatch,{operator:u,index:V,typeE:U,typeR:O})}}else return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:"array<fun_arg>"});break;case"series <type of the matrix's elements>":case"series <type of the array's elements>":const y=this._getArrayType(h==null?void 0:h.type)||"";if(!A.endsWith(y)&&!(A.endsWith(W.INT)&&y===W.FLOAT))return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:this._typeAddSeries(y)});break;case"any map type":if(this._isMapType(A)){if(V==="id2"){const O=this._getMapType(h==null?void 0:h.type);if(!O)return;const U=this._getMapType(A)||[];if(O[0]!==U[0]||O[1]!==U[1])return we(Pe.mapKeyValErr,{typeA:this._typeAddSeries(U[0]),typeB:this._typeAddSeries(U[1]),typeC:this._typeAddSeries(O[0]),typeD:this._typeAddSeries(O[1]),name:u})}}else return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:"map<type, type>"});break;case"series <type of the map's elements>":const g=this._getMapType(h==null?void 0:h.type);if(!g)return;const D=V==="key"?0:1;if(!A.endsWith(g[D])&&!(A.endsWith(W.INT)&&g[D]===W.FLOAT))return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:this._typeAddSeries(g[D])});break;case"<arg_expr_type>":if(T===Oe.Brackethesized)return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:$||""});break;case"<arg_type>":case"variable, function, object, array or matrix of series int/float/bool/string/color, or a tuple of these":break;case"variable, object or function of series int/float/bool/string/color, or a tuple of these":if(T===Oe.Brackethesized){for(const O of x)if(!F.includes(O.type))return this._errorHandle(we(Pe.requestArgsErr,{name:u,argName:V,type:O.type}),O.ctx),!1}break;case"const int/float/bool/string/color or source-type built-ins":if(gl.includes(n.name)&&F[0].endsWith(this._removePrefix(A)))n.isSourceType=!0;else return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:"const int/float/bool/string/color"});break;case"<arg..._type>":if(T===Oe.Brackethesized||this._isArrayType(A)||this._isMapType(A)||this._isMatrixType(A))return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:`${W.SERIES} ${W.INT}`});if(A!==(h==null?void 0:h.type))return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:h==null?void 0:h.type});break;default:const R=this._removePrefix(n.type);if(n.arg&&n.arg.isArg&&!_){const O=F.find(U=>U.endsWith(R));if(O){n.type=O,n.arg.type=O;return}}if(F.length===1&&F[0].endsWith(R)){const O=this._getPrefix(n.type),U=this._getPrefix(F[0]);if(wi.indexOf(O)>=wi.indexOf(U))return}return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:$||""})}}}_tupleToCheck(n,o,u,h,m){var _,T;if(u.push(`${W.SIMPLE} ${W.NA}`),n.ruleType===Oe.Brackethesized){const x=[];let P=!1;for(const A of n.exprs)x.push(A.type),u.includes(A.type)||(P=!0);if(P)return we(Pe.typeMismatch,{operator:h,index:o.name,typeE:`[${x.join(", ")}]`,typeR:((_=o.allowedTypeIDs)==null?void 0:_[0])||""})}else return we(Pe.typeMismatch,{operator:h,index:o.name,typeE:m,typeR:((T=o.allowedTypeIDs)==null?void 0:T[0])||""})}_getBlockReturnTypes(n){var F,$;let o=n;if(Array.isArray(n)&&(o=n.slice(-1)[0],Array.isArray(o)&&(o=o.slice(-1)[0])),!o)return[W.UNDETERMINED];const{ruleType:u,type:h,types:m,returnedTypes:_,exprs:T,nameList:x,typeList:P,block:A}=o;if(m&&m.length)return m;if(_&&_.length)return _;if(h)return[h];switch(u){case Oe.Brackethesized:const V=T.map(ue=>ue.type);return V.isBrackethesized=!0,V;case Oe.VarBlockStmt:case Oe.DeclareAssign:return x?x.ruleType===Oe.VarMultiple?x.types:[x.type]:[((F=o.name)==null?void 0:F.type)||W.UNDETERMINED];case Oe.SwitchStatement:if(!this._isNeedCalc&&!this._isInFunc)return[W.UNDETERMINED];const b=[...o.cases];o.defaultCase&&b.push(o.defaultCase);let y=(($=b[0])==null?void 0:$.returnedTypes)||[],g=y.length<=1?y[0]:`[${y.join(", ")}]`,D=null;for(const ue of b.slice(1)){const K=ue.returnedTypes||[W.UNDETERMINED];g+=K.length<=1?`; ${K[0]}`:`; [${K.join(", ")}]`;const Y=Array.isArray(ue.block)?ue.block.slice(-1)[0]:ue.block;if(K.length!==y.length)D=Y.ctx;else for(const[G,ce]of y.entries())if(this._compareType(K[G],ce))(K[G].includes(W.FLOAT)&&!ce.includes(W.FLOAT)||y[G]===`${W.SIMPLE} ${W.NA}`||y[G]===W.UNDETERMINED)&&(y[G]=K[G]);else{D=Y.ctx;break}}return D&&(this._errorHandle(we(Pe.ifOrSwitchTypeErr,{keyword:"switch",types:g}),D),y=y.map(()=>W.UNDETERMINED)),o.returnedTypes=y,y;case Oe.IfStatement:if(!this._isNeedCalc&&!this._isInFunc)return[W.UNDETERMINED];if(!P.filter(ue=>ue&&ue.length).length)return[W.UNDETERMINED];let R=P[0]||[],O=R.length<=1?R[0]:`[${R.join(", ")}]`,U=0,X=0;for(const ue of P.slice(1))if(ue)if(U++,O+=ue.length<=1?`; ${ue[0]}`:`; [${ue.join(", ")}]`,ue.length!==R.length)X=U;else for(const[K,Y]of R.entries())if(this._compareType(ue[K],Y))(ue[K].includes(W.FLOAT)&&!Y.includes(W.FLOAT)||R[K]===`${W.SIMPLE} ${W.NA}`)&&(R[K]=ue[K]);else{X=U;break}if(X){const ue=A[X].slice(-1)[0],K=Array.isArray(ue)?ue.slice(-1)[0]:ue;this._errorHandle(we(Pe.ifOrSwitchTypeErr,{keyword:"if",types:O}),K.ctx),R=R.map(()=>W.UNDETERMINED)}return o.returnedTypes=R,R}return[W.UNDETERMINED]}}class km{constructor(e){w(this,"_nameMap");w(this,"_prefixNameVar");w(this,"_prefixNameFunc");w(this,"_prefixNameConst");w(this,"_userTypes");w(this,"_isInFunc");w(this,"_varlist");w(this,"_memberIndexList");w(this,"_blockCount");this._nameMap=new Map,this._prefixNameVar=`${e}_var`,this._prefixNameFunc=`${e}_func`,this._prefixNameConst=`${e}_const`,this._userTypes=[],this._isInFunc=!1,this._varlist=[{}],this._memberIndexList=[{}],this._blockCount=0}preParser(e){var o,u;const n=[];for(const h of e){if(!h)return;if(Array.isArray(h)){for(const m of h)if(n.push(this._parserStmt(m)),_l.includes((u=(o=m.exprs)==null?void 0:o[0])==null?void 0:u.name))return n.join(`;
11
+ `));this.indents.length;)this.emitToken(this.createDedent()),this.indents.pop();this.emitToken(this.commonToken(I.EOF,"<EOF>"))}const n=super.nextToken();return this.tokens.length?this.tokens.shift():n}createDedent(){return this.commonToken(I.DEDENT,"")}getCharIndex(){return this._input.index}commonToken(n,o){const u=this.getCharIndex()-1,h=o.length?u-o.length+1:u;return new Gy([this,this._input],n,0,h,u)}getIndentationCount(n){let o=0;for(let u=0;u<n.length;u++)n[u]===" "?o+=4-o%4:o++;return o}atStartOfInput(){return this.getCharIndex()===0}openBrace(){this.opened++}closeBrace(){this.opened--}onNewLine(){const n=this.text.replace(/[^\r\n]+/g,""),o=this.text.replace(/[\r\n]+/g,""),u=this._input.LA(1),h=this._input.LA(2),m=this.getIndentationCount(o);if(this.opened>0||h!=-1&&(u===13||u===10||u===47&&h===47||m%4))this.skip();else{this.emitToken(this.commonToken(I.NEWLINE,n));const _=this.indents.length?this.indents[this.indents.length-1]:0;if(m===_)this.skip();else if(m>_)this.indents.push(m),this.emitToken(this.commonToken(I.INDENT,o));else for(;this.indents.length&&this.indents[this.indents.length-1]>m;)this.emitToken(this.createDedent()),this.indents.pop()}}}const Re=class Re extends Em{constructor(e){super(e),this._interp=new qy(this,Re._ATN,Re.DecisionsToDFA,new ap)}get grammarFileName(){return"tccScriptLexer.g4"}get literalNames(){return Re.literalNames}get symbolicNames(){return Re.symbolicNames}get ruleNames(){return Re.ruleNames}get serializedATN(){return Re._serializedATN}get channelNames(){return Re.channelNames}get modeNames(){return Re.modeNames}action(e,n,o){switch(n){case 1:this.OpenBracket_action(e,o);break;case 2:this.CloseBracket_action(e,o);break;case 3:this.OpenParen_action(e,o);break;case 4:this.CloseParen_action(e,o);break;case 57:this.NEWLINE_action(e,o);break}}OpenBracket_action(e,n){switch(n){case 0:this.openBrace();break}}CloseBracket_action(e,n){switch(n){case 1:this.closeBrace();break}}OpenParen_action(e,n){switch(n){case 2:this.openBrace();break}}CloseParen_action(e,n){switch(n){case 3:this.closeBrace();break}}NEWLINE_action(e,n){switch(n){case 4:this.onNewLine();break}}sempred(e,n,o){switch(n){case 57:return this.NEWLINE_sempred(e,o)}return!0}NEWLINE_sempred(e,n){switch(n){case 0:return this.atStartOfInput()}return!0}static get _ATN(){return Re.__ATN||(Re.__ATN=new ip().deserialize(Re._serializedATN)),Re.__ATN}};w(Re,"INDENT",1),w(Re,"DEDENT",2),w(Re,"Point",3),w(Re,"OpenBracket",4),w(Re,"CloseBracket",5),w(Re,"OpenParen",6),w(Re,"CloseParen",7),w(Re,"Comma",8),w(Re,"Assign",9),w(Re,"QuestionMark",10),w(Re,"Colon",11),w(Re,"Plus",12),w(Re,"Minus",13),w(Re,"Multiply",14),w(Re,"Divide",15),w(Re,"Modulus",16),w(Re,"Hashtag",17),w(Re,"LessThan",18),w(Re,"MoreThan",19),w(Re,"LessThanEquals",20),w(Re,"GreaterThanEquals",21),w(Re,"Equals_",22),w(Re,"NotEquals",23),w(Re,"MultiplyAssign",24),w(Re,"DivideAssign",25),w(Re,"ModulusAssign",26),w(Re,"PlusAssign",27),w(Re,"MinusAssign",28),w(Re,"ARROW",29),w(Re,"ColonEquals",30),w(Re,"BooleanLiteral",31),w(Re,"IntegerLiteral",32),w(Re,"DecimalLiteral",33),w(Re,"Break",34),w(Re,"And",35),w(Re,"Export",36),w(Re,"For",37),w(Re,"Var",38),w(Re,"Continue",39),w(Re,"Varip",40),w(Re,"Switch",41),w(Re,"While",42),w(Re,"If",43),w(Re,"In",44),w(Re,"Or",45),w(Re,"Not",46),w(Re,"Method",47),w(Re,"Else",48),w(Re,"To",49),w(Re,"By",50),w(Re,"Type",51),w(Re,"Import",52),w(Re,"As",53),w(Re,"Map",54),w(Re,"ColorLiteral",55),w(Re,"StringLiteral",56),w(Re,"Identifier",57),w(Re,"HIDDEN_",58),w(Re,"SKIP_",59),w(Re,"NEWLINE",60),w(Re,"EOF",sp.EOF),w(Re,"channelNames",["DEFAULT_TOKEN_CHANNEL","HIDDEN"]),w(Re,"literalNames",[null,null,null,"'.'","'['","']'","'('","')'","','","'='","'?'","':'","'+'","'-'","'*'","'/'","'%'","'#'","'<'","'>'","'<='","'>='","'=='","'!='","'*='","'/='","'%='","'+='","'-='","'=>'","':='",null,null,null,"'break'","'and'","'export'","'for'","'var'","'continue'","'varip'","'switch'","'while'","'if'","'in'","'or'","'not'","'method'","'else'","'to'","'by'","'type'","'import'","'as'","'map'"]),w(Re,"symbolicNames",[null,"INDENT","DEDENT","Point","OpenBracket","CloseBracket","OpenParen","CloseParen","Comma","Assign","QuestionMark","Colon","Plus","Minus","Multiply","Divide","Modulus","Hashtag","LessThan","MoreThan","LessThanEquals","GreaterThanEquals","Equals_","NotEquals","MultiplyAssign","DivideAssign","ModulusAssign","PlusAssign","MinusAssign","ARROW","ColonEquals","BooleanLiteral","IntegerLiteral","DecimalLiteral","Break","And","Export","For","Var","Continue","Varip","Switch","While","If","In","Or","Not","Method","Else","To","By","Type","Import","As","Map","ColorLiteral","StringLiteral","Identifier","HIDDEN_","SKIP_","NEWLINE"]),w(Re,"modeNames",["DEFAULT_MODE"]),w(Re,"ruleNames",["Point","OpenBracket","CloseBracket","OpenParen","CloseParen","Comma","Assign","QuestionMark","Colon","Plus","Minus","Multiply","Divide","Modulus","Hashtag","LessThan","MoreThan","LessThanEquals","GreaterThanEquals","Equals_","NotEquals","MultiplyAssign","DivideAssign","ModulusAssign","PlusAssign","MinusAssign","ARROW","ColonEquals","BooleanLiteral","IntegerLiteral","DecimalLiteral","Break","And","Export","For","Var","Continue","Varip","Switch","While","If","In","Or","Not","Method","Else","To","By","Type","Import","As","Map","ColorLiteral","StringLiteral","Identifier","HIDDEN_","SKIP_","NEWLINE","SHORT_STRING","DIGIT","DIGITS","HEX_DIGIT","SPACES","COMMENT","EXP"]),w(Re,"_serializedATN",[4,0,60,440,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,2,46,7,46,2,47,7,47,2,48,7,48,2,49,7,49,2,50,7,50,2,51,7,51,2,52,7,52,2,53,7,53,2,54,7,54,2,55,7,55,2,56,7,56,2,57,7,57,2,58,7,58,2,59,7,59,2,60,7,60,2,61,7,61,2,62,7,62,2,63,7,63,2,64,7,64,1,0,1,0,1,1,1,1,1,1,1,2,1,2,1,2,1,3,1,3,1,3,1,4,1,4,1,4,1,5,1,5,1,6,1,6,1,7,1,7,1,8,1,8,1,9,1,9,1,10,1,10,1,11,1,11,1,12,1,12,1,13,1,13,1,14,1,14,1,15,1,15,1,16,1,16,1,17,1,17,1,17,1,18,1,18,1,18,1,19,1,19,1,19,1,20,1,20,1,20,1,21,1,21,1,21,1,22,1,22,1,22,1,23,1,23,1,23,1,24,1,24,1,24,1,25,1,25,1,25,1,26,1,26,1,26,1,27,1,27,1,27,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,3,28,212,8,28,1,29,1,29,1,30,1,30,1,30,3,30,219,8,30,1,30,1,30,1,30,1,30,3,30,225,8,30,3,30,227,8,30,1,30,3,30,230,8,30,3,30,232,8,30,1,31,1,31,1,31,1,31,1,31,1,31,1,32,1,32,1,32,1,32,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,34,1,34,1,34,1,34,1,35,1,35,1,35,1,35,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,37,1,37,1,37,1,37,1,37,1,37,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,39,1,39,1,39,1,39,1,39,1,39,1,40,1,40,1,40,1,41,1,41,1,41,1,42,1,42,1,42,1,43,1,43,1,43,1,43,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,45,1,45,1,45,1,45,1,45,1,46,1,46,1,46,1,47,1,47,1,47,1,48,1,48,1,48,1,48,1,48,1,49,1,49,1,49,1,49,1,49,1,49,1,49,1,50,1,50,1,50,1,51,1,51,1,51,1,51,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,3,52,355,8,52,1,53,1,53,1,54,1,54,5,54,361,8,54,10,54,12,54,364,9,54,1,55,1,55,1,55,1,55,1,56,1,56,1,56,1,56,1,57,1,57,1,57,3,57,377,8,57,1,57,1,57,3,57,381,8,57,1,57,3,57,384,8,57,3,57,386,8,57,1,57,1,57,1,58,1,58,1,58,1,58,5,58,394,8,58,10,58,12,58,397,9,58,1,58,1,58,1,58,1,58,1,58,5,58,404,8,58,10,58,12,58,407,9,58,1,58,3,58,410,8,58,1,59,1,59,1,60,4,60,415,8,60,11,60,12,60,416,1,61,1,61,1,62,4,62,422,8,62,11,62,12,62,423,1,63,1,63,1,63,1,63,5,63,430,8,63,10,63,12,63,433,9,63,1,64,1,64,3,64,437,8,64,1,64,1,64,0,0,65,1,3,3,4,5,5,7,6,9,7,11,8,13,9,15,10,17,11,19,12,21,13,23,14,25,15,27,16,29,17,31,18,33,19,35,20,37,21,39,22,41,23,43,24,45,25,47,26,49,27,51,28,53,29,55,30,57,31,59,32,61,33,63,34,65,35,67,36,69,37,71,38,73,39,75,40,77,41,79,42,81,43,83,44,85,45,87,46,89,47,91,48,93,49,95,50,97,51,99,52,101,53,103,54,105,55,107,56,109,57,111,58,113,59,115,60,117,0,119,0,121,0,123,0,125,0,127,0,129,0,1,0,10,3,0,65,90,95,95,97,122,4,0,48,57,65,90,95,95,97,122,1,0,39,39,1,0,34,34,1,0,48,57,3,0,48,57,65,70,97,102,2,0,9,9,32,32,2,0,10,10,12,13,2,0,69,69,101,101,2,0,43,43,45,45,453,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,0,0,47,1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0,0,0,57,1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,67,1,0,0,0,0,69,1,0,0,0,0,71,1,0,0,0,0,73,1,0,0,0,0,75,1,0,0,0,0,77,1,0,0,0,0,79,1,0,0,0,0,81,1,0,0,0,0,83,1,0,0,0,0,85,1,0,0,0,0,87,1,0,0,0,0,89,1,0,0,0,0,91,1,0,0,0,0,93,1,0,0,0,0,95,1,0,0,0,0,97,1,0,0,0,0,99,1,0,0,0,0,101,1,0,0,0,0,103,1,0,0,0,0,105,1,0,0,0,0,107,1,0,0,0,0,109,1,0,0,0,0,111,1,0,0,0,0,113,1,0,0,0,0,115,1,0,0,0,1,131,1,0,0,0,3,133,1,0,0,0,5,136,1,0,0,0,7,139,1,0,0,0,9,142,1,0,0,0,11,145,1,0,0,0,13,147,1,0,0,0,15,149,1,0,0,0,17,151,1,0,0,0,19,153,1,0,0,0,21,155,1,0,0,0,23,157,1,0,0,0,25,159,1,0,0,0,27,161,1,0,0,0,29,163,1,0,0,0,31,165,1,0,0,0,33,167,1,0,0,0,35,169,1,0,0,0,37,172,1,0,0,0,39,175,1,0,0,0,41,178,1,0,0,0,43,181,1,0,0,0,45,184,1,0,0,0,47,187,1,0,0,0,49,190,1,0,0,0,51,193,1,0,0,0,53,196,1,0,0,0,55,199,1,0,0,0,57,211,1,0,0,0,59,213,1,0,0,0,61,231,1,0,0,0,63,233,1,0,0,0,65,239,1,0,0,0,67,243,1,0,0,0,69,250,1,0,0,0,71,254,1,0,0,0,73,258,1,0,0,0,75,267,1,0,0,0,77,273,1,0,0,0,79,280,1,0,0,0,81,286,1,0,0,0,83,289,1,0,0,0,85,292,1,0,0,0,87,295,1,0,0,0,89,299,1,0,0,0,91,306,1,0,0,0,93,311,1,0,0,0,95,314,1,0,0,0,97,317,1,0,0,0,99,322,1,0,0,0,101,329,1,0,0,0,103,332,1,0,0,0,105,354,1,0,0,0,107,356,1,0,0,0,109,358,1,0,0,0,111,365,1,0,0,0,113,369,1,0,0,0,115,385,1,0,0,0,117,409,1,0,0,0,119,411,1,0,0,0,121,414,1,0,0,0,123,418,1,0,0,0,125,421,1,0,0,0,127,425,1,0,0,0,129,434,1,0,0,0,131,132,5,46,0,0,132,2,1,0,0,0,133,134,5,91,0,0,134,135,6,1,0,0,135,4,1,0,0,0,136,137,5,93,0,0,137,138,6,2,1,0,138,6,1,0,0,0,139,140,5,40,0,0,140,141,6,3,2,0,141,8,1,0,0,0,142,143,5,41,0,0,143,144,6,4,3,0,144,10,1,0,0,0,145,146,5,44,0,0,146,12,1,0,0,0,147,148,5,61,0,0,148,14,1,0,0,0,149,150,5,63,0,0,150,16,1,0,0,0,151,152,5,58,0,0,152,18,1,0,0,0,153,154,5,43,0,0,154,20,1,0,0,0,155,156,5,45,0,0,156,22,1,0,0,0,157,158,5,42,0,0,158,24,1,0,0,0,159,160,5,47,0,0,160,26,1,0,0,0,161,162,5,37,0,0,162,28,1,0,0,0,163,164,5,35,0,0,164,30,1,0,0,0,165,166,5,60,0,0,166,32,1,0,0,0,167,168,5,62,0,0,168,34,1,0,0,0,169,170,5,60,0,0,170,171,5,61,0,0,171,36,1,0,0,0,172,173,5,62,0,0,173,174,5,61,0,0,174,38,1,0,0,0,175,176,5,61,0,0,176,177,5,61,0,0,177,40,1,0,0,0,178,179,5,33,0,0,179,180,5,61,0,0,180,42,1,0,0,0,181,182,5,42,0,0,182,183,5,61,0,0,183,44,1,0,0,0,184,185,5,47,0,0,185,186,5,61,0,0,186,46,1,0,0,0,187,188,5,37,0,0,188,189,5,61,0,0,189,48,1,0,0,0,190,191,5,43,0,0,191,192,5,61,0,0,192,50,1,0,0,0,193,194,5,45,0,0,194,195,5,61,0,0,195,52,1,0,0,0,196,197,5,61,0,0,197,198,5,62,0,0,198,54,1,0,0,0,199,200,5,58,0,0,200,201,5,61,0,0,201,56,1,0,0,0,202,203,5,116,0,0,203,204,5,114,0,0,204,205,5,117,0,0,205,212,5,101,0,0,206,207,5,102,0,0,207,208,5,97,0,0,208,209,5,108,0,0,209,210,5,115,0,0,210,212,5,101,0,0,211,202,1,0,0,0,211,206,1,0,0,0,212,58,1,0,0,0,213,214,3,121,60,0,214,60,1,0,0,0,215,216,5,46,0,0,216,218,3,121,60,0,217,219,3,129,64,0,218,217,1,0,0,0,218,219,1,0,0,0,219,232,1,0,0,0,220,229,3,121,60,0,221,226,5,46,0,0,222,224,3,121,60,0,223,225,3,129,64,0,224,223,1,0,0,0,224,225,1,0,0,0,225,227,1,0,0,0,226,222,1,0,0,0,226,227,1,0,0,0,227,230,1,0,0,0,228,230,3,129,64,0,229,221,1,0,0,0,229,228,1,0,0,0,230,232,1,0,0,0,231,215,1,0,0,0,231,220,1,0,0,0,232,62,1,0,0,0,233,234,5,98,0,0,234,235,5,114,0,0,235,236,5,101,0,0,236,237,5,97,0,0,237,238,5,107,0,0,238,64,1,0,0,0,239,240,5,97,0,0,240,241,5,110,0,0,241,242,5,100,0,0,242,66,1,0,0,0,243,244,5,101,0,0,244,245,5,120,0,0,245,246,5,112,0,0,246,247,5,111,0,0,247,248,5,114,0,0,248,249,5,116,0,0,249,68,1,0,0,0,250,251,5,102,0,0,251,252,5,111,0,0,252,253,5,114,0,0,253,70,1,0,0,0,254,255,5,118,0,0,255,256,5,97,0,0,256,257,5,114,0,0,257,72,1,0,0,0,258,259,5,99,0,0,259,260,5,111,0,0,260,261,5,110,0,0,261,262,5,116,0,0,262,263,5,105,0,0,263,264,5,110,0,0,264,265,5,117,0,0,265,266,5,101,0,0,266,74,1,0,0,0,267,268,5,118,0,0,268,269,5,97,0,0,269,270,5,114,0,0,270,271,5,105,0,0,271,272,5,112,0,0,272,76,1,0,0,0,273,274,5,115,0,0,274,275,5,119,0,0,275,276,5,105,0,0,276,277,5,116,0,0,277,278,5,99,0,0,278,279,5,104,0,0,279,78,1,0,0,0,280,281,5,119,0,0,281,282,5,104,0,0,282,283,5,105,0,0,283,284,5,108,0,0,284,285,5,101,0,0,285,80,1,0,0,0,286,287,5,105,0,0,287,288,5,102,0,0,288,82,1,0,0,0,289,290,5,105,0,0,290,291,5,110,0,0,291,84,1,0,0,0,292,293,5,111,0,0,293,294,5,114,0,0,294,86,1,0,0,0,295,296,5,110,0,0,296,297,5,111,0,0,297,298,5,116,0,0,298,88,1,0,0,0,299,300,5,109,0,0,300,301,5,101,0,0,301,302,5,116,0,0,302,303,5,104,0,0,303,304,5,111,0,0,304,305,5,100,0,0,305,90,1,0,0,0,306,307,5,101,0,0,307,308,5,108,0,0,308,309,5,115,0,0,309,310,5,101,0,0,310,92,1,0,0,0,311,312,5,116,0,0,312,313,5,111,0,0,313,94,1,0,0,0,314,315,5,98,0,0,315,316,5,121,0,0,316,96,1,0,0,0,317,318,5,116,0,0,318,319,5,121,0,0,319,320,5,112,0,0,320,321,5,101,0,0,321,98,1,0,0,0,322,323,5,105,0,0,323,324,5,109,0,0,324,325,5,112,0,0,325,326,5,111,0,0,326,327,5,114,0,0,327,328,5,116,0,0,328,100,1,0,0,0,329,330,5,97,0,0,330,331,5,115,0,0,331,102,1,0,0,0,332,333,5,109,0,0,333,334,5,97,0,0,334,335,5,112,0,0,335,104,1,0,0,0,336,337,5,35,0,0,337,338,3,123,61,0,338,339,3,123,61,0,339,340,3,123,61,0,340,341,3,123,61,0,341,342,3,123,61,0,342,343,3,123,61,0,343,355,1,0,0,0,344,345,5,35,0,0,345,346,3,123,61,0,346,347,3,123,61,0,347,348,3,123,61,0,348,349,3,123,61,0,349,350,3,123,61,0,350,351,3,123,61,0,351,352,3,123,61,0,352,353,3,123,61,0,353,355,1,0,0,0,354,336,1,0,0,0,354,344,1,0,0,0,355,106,1,0,0,0,356,357,3,117,58,0,357,108,1,0,0,0,358,362,7,0,0,0,359,361,7,1,0,0,360,359,1,0,0,0,361,364,1,0,0,0,362,360,1,0,0,0,362,363,1,0,0,0,363,110,1,0,0,0,364,362,1,0,0,0,365,366,3,125,62,0,366,367,1,0,0,0,367,368,6,55,4,0,368,112,1,0,0,0,369,370,3,127,63,0,370,371,1,0,0,0,371,372,6,56,5,0,372,114,1,0,0,0,373,374,4,57,0,0,374,386,3,125,62,0,375,377,5,13,0,0,376,375,1,0,0,0,376,377,1,0,0,0,377,378,1,0,0,0,378,381,5,10,0,0,379,381,2,12,13,0,380,376,1,0,0,0,380,379,1,0,0,0,381,383,1,0,0,0,382,384,3,125,62,0,383,382,1,0,0,0,383,384,1,0,0,0,384,386,1,0,0,0,385,373,1,0,0,0,385,380,1,0,0,0,386,387,1,0,0,0,387,388,6,57,6,0,388,116,1,0,0,0,389,395,5,39,0,0,390,394,8,2,0,0,391,392,5,92,0,0,392,394,5,39,0,0,393,390,1,0,0,0,393,391,1,0,0,0,394,397,1,0,0,0,395,393,1,0,0,0,395,396,1,0,0,0,396,398,1,0,0,0,397,395,1,0,0,0,398,410,5,39,0,0,399,405,5,34,0,0,400,404,8,3,0,0,401,402,5,92,0,0,402,404,5,34,0,0,403,400,1,0,0,0,403,401,1,0,0,0,404,407,1,0,0,0,405,403,1,0,0,0,405,406,1,0,0,0,406,408,1,0,0,0,407,405,1,0,0,0,408,410,5,34,0,0,409,389,1,0,0,0,409,399,1,0,0,0,410,118,1,0,0,0,411,412,7,4,0,0,412,120,1,0,0,0,413,415,3,119,59,0,414,413,1,0,0,0,415,416,1,0,0,0,416,414,1,0,0,0,416,417,1,0,0,0,417,122,1,0,0,0,418,419,7,5,0,0,419,124,1,0,0,0,420,422,7,6,0,0,421,420,1,0,0,0,422,423,1,0,0,0,423,421,1,0,0,0,423,424,1,0,0,0,424,126,1,0,0,0,425,426,5,47,0,0,426,427,5,47,0,0,427,431,1,0,0,0,428,430,8,7,0,0,429,428,1,0,0,0,430,433,1,0,0,0,431,429,1,0,0,0,431,432,1,0,0,0,432,128,1,0,0,0,433,431,1,0,0,0,434,436,7,8,0,0,435,437,7,9,0,0,436,435,1,0,0,0,436,437,1,0,0,0,437,438,1,0,0,0,438,439,3,121,60,0,439,130,1,0,0,0,22,0,211,218,224,226,229,231,354,362,376,380,383,385,393,395,403,405,409,416,423,431,436,7,1,1,0,1,2,1,1,3,2,1,4,3,0,1,0,6,0,0,1,57,4]),w(Re,"__ATN"),w(Re,"DecisionsToDFA",Re._ATN.decisionToState.map((e,n)=>new op(e,n)));let ml=Re;var W=(t=>(t.BOOL="bool",t.INT="int",t.FLOAT="float",t.ARRAY="array",t.BOX="box",t.CHART_POINT="chart.point",t.COLOR="color",t.CONST="const",t.LABEL="label",t.LINE="line",t.LINEFILL="linefill",t.MAP="map",t.MATRIX="matrix",t.POLYLINE="polyline",t.SERIES="series",t.SIMPLE="simple",t.STRING="string",t.TABLE="table",t.UNDETERMINED="undetermined type",t.INPUT="input",t.NA="na",t.VOID="void",t))(W||{}),Oe=(t=>(t.FlowStmt="FlowStmt",t.DeclareAssign="DeclareAssign",t.VarBlockStmt="VarBlockStmt",t.VarSingle="VarSingle",t.VarMultiple="VarMultiple",t.ParenthesizedExpression="ParenthesizedExpression",t.AdditiveExpression="AdditiveExpression",t.RelationalExpression="RelationalExpression",t.EqualityExpression="EqualityExpression",t.TernaryExpression="TernaryExpression",t.UnaryExpression="UnaryExpression",t.NotExpression="NotExpression",t.MemberIndexExpression="MemberIndexExpression",t.MethodExpression="MethodExpression",t.LogicalAndExpression="LogicalAndExpression",t.LogicalOrExpression="LogicalOrExpression",t.MultiplicativeExpression="MultiplicativeExpression",t.Brackethesized="Brackethesized",t.IfStatement="IfStatement",t.ForToStatement="ForToStatement",t.ForInStatement="ForInStatement",t.SwitchStatement="SwitchStatement",t.CaseClause="CaseClause",t.DefaultCaluse="DefaultCaluse",t.WhileStatement="WhileStatement",t.ImportElement="ImportElement",t.Literal="Literal",t.ArrowFunction="ArrowFunction",t.ArrowMethod="ArrowMethod",t.TypeStatement="TypeStatement",t.Name="Name",t.AgainAssign="AgainAssign",t))(Oe||{});const Pe={onlyInLoop:"'$text' is only allowed inside loops",invalidType:"Invalid argument 'expr$index' in 'operator SQBR' call",typeUseError:"Cannot specify a type form '$text' without also specifying the type.",notTypeKeyword:"'$text' is not a valid type keyword in variable declaration",undeclared:"Undeclared identifier '$name'",repeatVar:"'$name' is already defined",typeMismatch:"Cannot call '$operator' with argument '$index'. An argument of '$typeE' type was used but a '$typeR' is expected.",assignTypeMismatch:"Cannot assign a value of the `$typeE` type to the '$name' variable. The variable is declared with the `$typeR` type.",voidNotVar:"Void expression cannot be assigned to a variable",declareTypeErr:"Declared type '$type' is not compatible with assigned type '$valueType'",mapKeyValErr:"Cannot put <$typeA, $typeB> pairs into a map containing `$typeC` keys and `$typeD` values. The maps passed into the `$name()` function must have the same key types and value types.",inputSourceErr:"Invalid value for the '$name' parameter of the '$funcName' function. Possible values: [open, high, low, close, hl2, hlc3, ohlc4, hlcc4, volume].",buildInUseErr:"Cannot use '$name' as the default value of a type's field. The default value cannot be a function, variable or calculation.",argsLenErr:"Too many arguments passed into the `$name()` function call. Passed $lenA arguments but expected $lenB.",requiredParamErr:"No value assigned to the `$argName` parameter in $name()",argsSyntaxErr:"Syntax error after the argument for `$argName`. Arguments without their parameter name cannot be used after arguments with parameter names.",requestArgsErr:"Type $type cannot be used in $name '$argName' argument",mapKeyErr:"Incorrect `key` type `$type` in the variable. The `key` type must be one of the following: int, float, string, bool, color.",templateErr:"Incorrect number of arguments for the template: $countA expected, $countB passed.",templateNoSupportErr:"The '$name()' function does not support templates",ifOrSwitchTypeErr:"Return type of one of the '$keyword' blocks is not compatible with return type of other block(s) ($types)",argsNameErr:"The '$name' function does not have an argument with the name '$argName'",noFiledErr:"Object has no field $name",methodNotExistErr:"Could not find method or method reference '$methodName' for '$name'",tupleVarErr:"Syntax error: The quantities of tuple elements on each side of the assignment operator do not match. The right side has $indexA but the left side has $indexB.",tupleLeftVarErr:"Invalid assignment. Cannot assign a tuple to a variable '$name'.",tupleRightVarErr:"Cannot assign a variable to a tuple. The right side must be a function call or structure ('if', 'switch', 'for', 'while') returning a tuple with the same number of elements.",tempateTypeErr:"Syntax error: Only templates for arrays and matrices consist of a single type identifier enclosed in angle brackets.",qualifierErr:"'$name' is not a valid type qualifier. Possible values: 'const', 'simple', 'series'",notFindFuncErr:"Could not find function or function reference '$name'",naVarErr:"Value with NA type cannot be assigned to a variable that was defined without type keyword",notHistoryErr:"Variable '$name' doesn't have history values",defaultValueErr:"The default value cannot be a function, variable or calculation.",defaultValueTypeErr:"Default value of type $typeE can not be assigned to an argument of type $typeR",unaryErr:"Syntax error at input '$sign'",funcArgAssignErr:"Function arguments cannot be mutable ('$name')",declaredErr:"A variable declared with the '$prefix' keyword cannot accept values of the '$type' form. Assign a '$prefix' value to this variable or remove the '$prefix' keyword from its declaration.",globalFuncErr:"Cannot use '$name' in local scope",onlyStatementErr:"Scripts must contain one declaration statement: `indicator()`, `strategy()` or `library()`, Your script has $count.",modifyGlobalVarErr:"Cannot modify global variable '$name' in function",inputDefvalErr:"Arguments of input function must be of constant type, or 'source' builtin variables.",objectIsNaErr:"Cannot access the '$name' $type of an undefined object. The object is 'na'.",buidinAssignErr:"Cannot assign a new value to the built-in variable '$name'.",buidinVarErr:"Cannot shadow the built-in variable `$name` because it has already been used as a built-in.",useNaErr:"Cannot use an `na` value of an unspecified type in the `$name` function."},Ri={repeatVar:"Shadowing variable '$name' which exists in parent scope. Did you want to use the ':=' operator instead of '=' ?",typeMismatch:"The `$index` parameter of the `$operator` function accepts a '$type' argument. To avoid potential unexpected results, pass a '$type' value or expression to this parameter.",moreSameArg:"More than one '$arg' arguments are supplied. Only the first one will be used.",localScopeGetHistory:"The variable '$name' is declared in local scope, which may not be executed at every update. So, obtaining its historical values may lead to unexpected results",localScopeWarning:"The function '$name' should be called on each calculation for consistency. It is recommended to extract the call from this scope"},wi=[W.SERIES,W.SIMPLE,W.INPUT,W.CONST],Sm=[W.INT,W.FLOAT,W.BOOL,W.COLOR,W.STRING],_l=["indicator","strategy","library"],Tm=["plot","plotbar","plotchar","plotarrow","plotshape","plotcandle","hline","indicator","alertcondition","barcolor","bgcolor","fill","library","strategy","strategy.risk.max_drawdown","strategy.risk.allow_entry_in","strategy.risk.max_cons_loss_days","max_intraday_filled_orders","strategy.risk.max_intraday_loss","strategy.risk.max_position_size"],Am=["strategy","input","table","color","line","linefill","label","box"],gl=["close","open","high","low","hl2","hlc3","hlcc4","ohlc4","volume"];var Op=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},xm={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(Op,function(){var n=1e3,o=6e4,u=36e5,h="millisecond",m="second",_="minute",T="hour",x="day",P="week",A="month",F="quarter",$="year",V="date",b="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,D={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(ye){var te=["th","st","nd","rd"],he=ye%100;return"["+ye+(te[(he-20)%10]||te[he]||te[0])+"]"}},R=function(ye,te,he){var le=String(ye);return!le||le.length>=te?ye:""+Array(te+1-le.length).join(he)+ye},O={s:R,z:function(ye){var te=-ye.utcOffset(),he=Math.abs(te),le=Math.floor(he/60),Ae=he%60;return(te<=0?"+":"-")+R(le,2,"0")+":"+R(Ae,2,"0")},m:function ye(te,he){if(te.date()<he.date())return-ye(he,te);var le=12*(he.year()-te.year())+(he.month()-te.month()),Ae=te.clone().add(le,A),Ne=he-Ae<0,_e=te.clone().add(le+(Ne?-1:1),A);return+(-(le+(he-Ae)/(Ne?Ae-_e:_e-Ae))||0)},a:function(ye){return ye<0?Math.ceil(ye)||0:Math.floor(ye)},p:function(ye){return{M:A,y:$,w:P,d:x,D:V,h:T,m:_,s:m,ms:h,Q:F}[ye]||String(ye||"").toLowerCase().replace(/s$/,"")},u:function(ye){return ye===void 0}},U="en",X={};X[U]=D;var ue="$isDayjsObject",K=function(ye){return ye instanceof Q||!(!ye||!ye[ue])},Y=function ye(te,he,le){var Ae;if(!te)return U;if(typeof te=="string"){var Ne=te.toLowerCase();X[Ne]&&(Ae=Ne),he&&(X[Ne]=he,Ae=Ne);var _e=te.split("-");if(!Ae&&_e.length>1)return ye(_e[0])}else{var Ue=te.name;X[Ue]=te,Ae=Ue}return!le&&Ae&&(U=Ae),Ae||!le&&U},G=function(ye,te){if(K(ye))return ye.clone();var he=typeof te=="object"?te:{};return he.date=ye,he.args=arguments,new Q(he)},ce=O;ce.l=Y,ce.i=K,ce.w=function(ye,te){return G(ye,{locale:te.$L,utc:te.$u,x:te.$x,$offset:te.$offset})};var Q=function(){function ye(he){this.$L=Y(he.locale,null,!0),this.parse(he),this.$x=this.$x||he.x||{},this[ue]=!0}var te=ye.prototype;return te.parse=function(he){this.$d=function(le){var Ae=le.date,Ne=le.utc;if(Ae===null)return new Date(NaN);if(ce.u(Ae))return new Date;if(Ae instanceof Date)return new Date(Ae);if(typeof Ae=="string"&&!/Z$/i.test(Ae)){var _e=Ae.match(y);if(_e){var Ue=_e[2]-1||0,J=(_e[7]||"0").substring(0,3);return Ne?new Date(Date.UTC(_e[1],Ue,_e[3]||1,_e[4]||0,_e[5]||0,_e[6]||0,J)):new Date(_e[1],Ue,_e[3]||1,_e[4]||0,_e[5]||0,_e[6]||0,J)}}return new Date(Ae)}(he),this.init()},te.init=function(){var he=this.$d;this.$y=he.getFullYear(),this.$M=he.getMonth(),this.$D=he.getDate(),this.$W=he.getDay(),this.$H=he.getHours(),this.$m=he.getMinutes(),this.$s=he.getSeconds(),this.$ms=he.getMilliseconds()},te.$utils=function(){return ce},te.isValid=function(){return this.$d.toString()!==b},te.isSame=function(he,le){var Ae=G(he);return this.startOf(le)<=Ae&&Ae<=this.endOf(le)},te.isAfter=function(he,le){return G(he)<this.startOf(le)},te.isBefore=function(he,le){return this.endOf(le)<G(he)},te.$g=function(he,le,Ae){return ce.u(he)?this[le]:this.set(Ae,he)},te.unix=function(){return Math.floor(this.valueOf()/1e3)},te.valueOf=function(){return this.$d.getTime()},te.startOf=function(he,le){var Ae=this,Ne=!!ce.u(le)||le,_e=ce.p(he),Ue=function(Et,Lt){var gt=ce.w(Ae.$u?Date.UTC(Ae.$y,Lt,Et):new Date(Ae.$y,Lt,Et),Ae);return Ne?gt:gt.endOf(x)},J=function(Et,Lt){return ce.w(Ae.toDate()[Et].apply(Ae.toDate("s"),(Ne?[0,0,0,0]:[23,59,59,999]).slice(Lt)),Ae)},ne=this.$W,ae=this.$M,Ee=this.$D,me="set"+(this.$u?"UTC":"");switch(_e){case $:return Ne?Ue(1,0):Ue(31,11);case A:return Ne?Ue(1,ae):Ue(0,ae+1);case P:var At=this.$locale().weekStart||0,jt=(ne<At?ne+7:ne)-At;return Ue(Ne?Ee-jt:Ee+(6-jt),ae);case x:case V:return J(me+"Hours",0);case T:return J(me+"Minutes",1);case _:return J(me+"Seconds",2);case m:return J(me+"Milliseconds",3);default:return this.clone()}},te.endOf=function(he){return this.startOf(he,!1)},te.$set=function(he,le){var Ae,Ne=ce.p(he),_e="set"+(this.$u?"UTC":""),Ue=(Ae={},Ae[x]=_e+"Date",Ae[V]=_e+"Date",Ae[A]=_e+"Month",Ae[$]=_e+"FullYear",Ae[T]=_e+"Hours",Ae[_]=_e+"Minutes",Ae[m]=_e+"Seconds",Ae[h]=_e+"Milliseconds",Ae)[Ne],J=Ne===x?this.$D+(le-this.$W):le;if(Ne===A||Ne===$){var ne=this.clone().set(V,1);ne.$d[Ue](J),ne.init(),this.$d=ne.set(V,Math.min(this.$D,ne.daysInMonth())).$d}else Ue&&this.$d[Ue](J);return this.init(),this},te.set=function(he,le){return this.clone().$set(he,le)},te.get=function(he){return this[ce.p(he)]()},te.add=function(he,le){var Ae,Ne=this;he=Number(he);var _e=ce.p(le),Ue=function(ae){var Ee=G(Ne);return ce.w(Ee.date(Ee.date()+Math.round(ae*he)),Ne)};if(_e===A)return this.set(A,this.$M+he);if(_e===$)return this.set($,this.$y+he);if(_e===x)return Ue(1);if(_e===P)return Ue(7);var J=(Ae={},Ae[_]=o,Ae[T]=u,Ae[m]=n,Ae)[_e]||1,ne=this.$d.getTime()+he*J;return ce.w(ne,this)},te.subtract=function(he,le){return this.add(-1*he,le)},te.format=function(he){var le=this,Ae=this.$locale();if(!this.isValid())return Ae.invalidDate||b;var Ne=he||"YYYY-MM-DDTHH:mm:ssZ",_e=ce.z(this),Ue=this.$H,J=this.$m,ne=this.$M,ae=Ae.weekdays,Ee=Ae.months,me=Ae.meridiem,At=function(Lt,gt,Dt,Jt){return Lt&&(Lt[gt]||Lt(le,Ne))||Dt[gt].slice(0,Jt)},jt=function(Lt){return ce.s(Ue%12||12,Lt,"0")},Et=me||function(Lt,gt,Dt){var Jt=Lt<12?"AM":"PM";return Dt?Jt.toLowerCase():Jt};return Ne.replace(g,function(Lt,gt){return gt||function(Dt){switch(Dt){case"YY":return String(le.$y).slice(-2);case"YYYY":return ce.s(le.$y,4,"0");case"M":return ne+1;case"MM":return ce.s(ne+1,2,"0");case"MMM":return At(Ae.monthsShort,ne,Ee,3);case"MMMM":return At(Ee,ne);case"D":return le.$D;case"DD":return ce.s(le.$D,2,"0");case"d":return String(le.$W);case"dd":return At(Ae.weekdaysMin,le.$W,ae,2);case"ddd":return At(Ae.weekdaysShort,le.$W,ae,3);case"dddd":return ae[le.$W];case"H":return String(Ue);case"HH":return ce.s(Ue,2,"0");case"h":return jt(1);case"hh":return jt(2);case"a":return Et(Ue,J,!0);case"A":return Et(Ue,J,!1);case"m":return String(J);case"mm":return ce.s(J,2,"0");case"s":return String(le.$s);case"ss":return ce.s(le.$s,2,"0");case"SSS":return ce.s(le.$ms,3,"0");case"Z":return _e}return null}(Lt)||_e.replace(":","")})},te.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},te.diff=function(he,le,Ae){var Ne,_e=this,Ue=ce.p(le),J=G(he),ne=(J.utcOffset()-this.utcOffset())*o,ae=this-J,Ee=function(){return ce.m(_e,J)};switch(Ue){case $:Ne=Ee()/12;break;case A:Ne=Ee();break;case F:Ne=Ee()/3;break;case P:Ne=(ae-ne)/6048e5;break;case x:Ne=(ae-ne)/864e5;break;case T:Ne=ae/u;break;case _:Ne=ae/o;break;case m:Ne=ae/n;break;default:Ne=ae}return Ae?Ne:ce.a(Ne)},te.daysInMonth=function(){return this.endOf(A).$D},te.$locale=function(){return X[this.$L]},te.locale=function(he,le){if(!he)return this.$L;var Ae=this.clone(),Ne=Y(he,le,!0);return Ne&&(Ae.$L=Ne),Ae},te.clone=function(){return ce.w(this.$d,this)},te.toDate=function(){return new Date(this.valueOf())},te.toJSON=function(){return this.isValid()?this.toISOString():null},te.toISOString=function(){return this.$d.toISOString()},te.toString=function(){return this.$d.toUTCString()},ye}(),de=Q.prototype;return G.prototype=de,[["$ms",h],["$s",m],["$m",_],["$H",T],["$W",x],["$M",A],["$y",$],["$D",V]].forEach(function(ye){de[ye[1]]=function(te){return this.$g(te,ye[0],ye[1])}}),G.extend=function(ye,te){return ye.$i||(ye(te,Q,G),ye.$i=!0),G},G.locale=Y,G.isDayjs=K,G.unix=function(ye){return G(1e3*ye)},G.en=X[U],G.Ls=X,G.p={},G})})(xm);function we(t,e){return t.replace(/\$(\w+)/g,(n,o)=>String(e[o])||n)}class Om extends Yy{constructor(){super(...arguments);w(this,"visitProgram");w(this,"visitGlobalStmt");w(this,"visitBlockStmt");w(this,"visitStmt");w(this,"visitSimpleStmt");w(this,"visitFlowStmt");w(this,"visitBlock");w(this,"visitBlockLine");w(this,"visitVariableDeclarationStmt");w(this,"visitDeclareAssign");w(this,"visitAgainAssign");w(this,"visitVarModifier");w(this,"visitBlockSequence");w(this,"visitExpressionSequence");w(this,"visitExpressionBlockSequence");w(this,"visitVarBlockStmt");w(this,"visitVarSingle");w(this,"visitVarMultiple");w(this,"visitBlockExpression");w(this,"visitParenthesizedExpression");w(this,"visitAdditiveExpression");w(this,"visitRelationalExpression");w(this,"visitTernaryExpression");w(this,"visitLogicalAndExpression");w(this,"visitNameExpression");w(this,"visitLiteralExpression");w(this,"visitLogicalOrExpression");w(this,"visitUnaryExpression");w(this,"visitNotExpression");w(this,"visitMemberIndexExpression");w(this,"visitMethodExpression");w(this,"visitEqualityExpression");w(this,"visitMultiplicativeExpression");w(this,"visitBrackethesized");w(this,"visitArguments");w(this,"visitArgument");w(this,"visitIfStatement");w(this,"visitForToStatement");w(this,"visitForInStatement");w(this,"visitSwitchStatement");w(this,"visitCaseClause");w(this,"visitDefaultCaluse");w(this,"visitWhileStatement");w(this,"visitImportStmt");w(this,"visitImportElement");w(this,"visitLiteral");w(this,"visitMethodStmt");w(this,"visitMethodElement");w(this,"visitMethodName");w(this,"visitArrowFunction");w(this,"visitArrowFunctionParameters");w(this,"visitFormalParameterList");w(this,"visitFormalParameterArg");w(this,"visitArrowMethod");w(this,"visitArrowMethodParameters");w(this,"visitTypeStatement");w(this,"visitTypeElement");w(this,"visitAssignmentOperator");w(this,"visitTypeMap");w(this,"visitTypeSeries");w(this,"visitTypeArray");w(this,"visitTypeGather");w(this,"visitIdentifier");w(this,"visitTypeName");w(this,"visitName")}}class Dm extends Om{constructor(n){super();w(this,"_buildinVariables");w(this,"_buildinTypes");w(this,"_buildinConstants");w(this,"_buildinMethods");w(this,"_buildinFunctions");this._buildinVariables=new Map,this._buildinConstants=new Map,this._buildinFunctions=new Map,this._buildinTypes=new Map,this._buildinMethods=new Map,this._buildinHandle(n)}_buildinHandle(n){for(const o in n){const u=new Map(Object.entries(n[o]));switch(o){case"constants":this._buildinConstants=u;break;case"functions":this._buildinFunctions=u;break;case"methods":this._buildinMethods=u;break;case"types":this._buildinTypes=u;break;case"variables":this._buildinVariables=u;break}}}_typeHandle(n=[],o){if(!n.length)return W.UNDETERMINED;if(n=n.filter(m=>!m.endsWith(W.NA)),!n.length)return`${W.SIMPLE} ${W.NA}`;let u=100,h="";for(const m of n){if(m===W.UNDETERMINED)return W.UNDETERMINED;m.startsWith(W.SERIES)?u=0:m.startsWith(W.SIMPLE)&&u>0?u=1:m.startsWith(W.INPUT)&&u>1?u=2:m.startsWith(W.CONST)&&u>2&&(u=3);const _=this._removePrefix(m);(_!==W.INT||!h)&&(h=_)}return u===100?h:`${wi[u]} ${o||h}`}_returnTypesOtherHandle(n,o,u,h){if(!u.length||u[0].includes("<>")){const m=n.type;let _=m;if(!m||m===W.UNDETERMINED)return[W.UNDETERMINED];switch(o){case"series <type>":_=this._getArrayType(m),_||(_=this._removePrefix(m)),u=[this._typeAddSeries(_)];break;case"array<type>":case"matrix<type>":case"type[]":if(this._isMapType(m)){const T=this._getMapType(m)||[];h.includes("keys")?_=T[0]:_=T[1]}else _=this._getArrayType(m),_||(_=this._removePrefix(m));u=[this._typeReplace(o,_)];break;case"<matrix_type>":_=this._getArrayType(m),u=[this._typeAddSeries(_)];break;case"map<keyType, valueType>":u=[_];break;case"<value_type>":_=this._getMapType(m),u=[_[1]];break}}return u}_checkMethodThisType(n,o){if(!n||!n.length||n[0].includes("<>"))return!0;const u=o.replace("int","float");return n.some(h=>h===o||u===h)}_priorityComparison(n,o){if(!n)return!1;if(this._isArrayType(n)||this._isMatrixType(n))return this._getArrayType(o)!==W.INT;{const u=this._getPrefix(n),h=this._getPrefix(o);return u===h?!!n.endsWith(W.INT):!(wi.indexOf(u)<wi.indexOf(h))}}_compareType(n,o){if(n===W.UNDETERMINED||o===W.UNDETERMINED)return!0;const u=[W.FLOAT,W.INT];if(this._isArrayType(n)||this._isMatrixType(n)){const h=this._getArrayType(n)||"",m=this._getArrayType(o)||"";return h===m||u.includes(h)&&u.includes(m)}else if(this._isMapType(n)){const h=this._getMapType(n)||[],m=this._getMapType(o)||[];return(h[0]===m[0]||u.includes(h[0])&&u.includes(m[0]))&&(h[1]===m[1]||u.includes(h[1])&&u.includes(m[1]))}else{const h=this._removePrefix(n),m=this._removePrefix(o);return h===W.NA||m===W.NA||h===m||u.includes(h)&&u.includes(m)}}_typeAddSeries(n){return this._buildinTypes.get(n)&&n!==W.CHART_POINT?`${W.SERIES} ${n}`:n}_typeAddConst(n){return this._buildinTypes.get(n)&&n!==W.CHART_POINT?`${W.CONST} ${n}`:n}_getOriginMethodName(n,o){let u="";return this._isArrayType(n)?u=`${W.ARRAY}.${o}`:this._isMatrixType(n)?u=`${W.MATRIX}.${o}`:this._isMapType(n)?u=`${W.MAP}.${o}`:u=`${this._removePrefix(n)}.${o}`,u}_returnedTypesParse(n){if(!n||!n.length)return[];const o=n[0];return/^\[.+\]$/.test(o)?o.replace(/[[\]]/g,"").split(",").map(u=>u.trim()):n}_removePrefix(n=""){return n.replace(/(series|simple|const|input)\s+([\w\d.]+)/,"$2")}_getPrefix(n){if(!n)return"";const o=n.replace(/(series|simple|const|input).+/,"$1");return wi.includes(o)?o:""}_getArrayType(n){let o=/\w+<([\w\d.]+)>/.exec(n);return o||(o=/([\w\d.]+)\[\]/.exec(n)),o==null?void 0:o[1]}_getMapType(n){const o=/\w+<(\w+),\s*([\w\d.]+)>/.exec(n);return(o==null?void 0:o[1])&&(o==null?void 0:o[2])&&[o==null?void 0:o[1],o==null?void 0:o[2]]}_isMatrixType(n){return/^matrix<[\w\d.]+>$/.test(n)}_isArrayType(n){return/^array<[\w\d.]+>$/.test(n)||/^[\w\d.]+\[\]$/.test(n)}_isMapType(n){return/^map<\w+,\s*[\w\d.]+>$/.test(n)}_arrayTypeConvert(n){return!this._isArrayType(n)||!n.includes("<")?n:`${this._getArrayType(n)}[]`}_getMethodTypeName(n){return this._isArrayType(n)?W.ARRAY:this._isMapType(n)?W.MAP:this._isMatrixType(n)?W.MATRIX:this._removePrefix(n)}_typeReplace(n,o){return o=this._removePrefix(o),this._arrayTypeConvert(n.startsWith(W.SERIES)?n.replace("<type>",o):n.replace("type",o))}}var Lr=(t=>(t[t.Hint=1]="Hint",t[t.Info=2]="Info",t[t.Warning=4]="Warning",t[t.Error=8]="Error",t))(Lr||{});class Cm extends Dm{constructor(n){super(n);w(this,"_loopCount");w(this,"_errors");w(this,"_variables");w(this,"_functions");w(this,"_methods");w(this,"_types");w(this,"_currentBlockVars");w(this,"_currentFuncParams");w(this,"_isNeedCalc");w(this,"_blockCount");w(this,"_isInFunc");w(this,"_onlyStatementsCount");w(this,"_blockRanges");w(this,"_overloadsFuncs");w(this,"_hasMemberIndex");w(this,"_isInLocalScop");w(this,"visitProgram",n=>{const{children:o}=n;let u=0;const h=[];for(this._pushBlockRanges(n);u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_globalStmt&&h.push(this.visit(m))}return this._onlyStatementsCount<=0&&this._errors.push({startColumn:0,endColumn:0,startLineNumber:1,endLineNumber:1,message:we(Pe.onlyStatementErr,{count:this._onlyStatementsCount})}),h});w(this,"visitGlobalStmt",n=>{const{children:o}=n;if(o&&o.length){const u=o[0],h=this.visit(u);return u.ruleIndex===I.RULE_methodStmt&&_l.includes(h.exprs[0].name)&&(this._onlyStatementsCount++,this._onlyStatementsCount>1&&this._errorHandle(we(Pe.onlyStatementErr,{count:this._onlyStatementsCount}),u)),h}return null});w(this,"visitBlockStmt",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_variableDeclarationStmt:h.push(...this.visit(m));break;case I.RULE_varBlockStmt:h.push(this.visit(m));break;case I.RULE_blockExpression:h.push(this.visit(m));break}}return h});w(this,"visitStmt",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitSimpleStmt",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitFlowStmt",n=>{const{children:o}=n,{column:u,line:h,text:m}=o[0].symbol;if(this._loopCount<=0){const _=u+1;this._errors.push({startColumn:_,endColumn:parseInt(_+m.length),startLineNumber:h,endLineNumber:h,message:we(Pe.onlyInLoop,{text:m})})}return{ruleType:Oe.FlowStmt,value:m}});w(this,"visitBlock",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return u.ruleIndex===I.RULE_simpleStmt?this._inBlock(u):this.visit(u)}return null});w(this,"visitBlockLine",n=>{const{children:o}=n;if(!o)return null;let u=0;const h=[];for(this._blockCount++,this._pushBlockRanges(n);u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_stmt&&h.push(this.visit(m))}return this._blockCount--,this._blockRanges.pop(),this._currentBlockVars.splice(this._blockCount+1),h});w(this,"visitDeclareAssign",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.DeclareAssign};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_varArrayDeclaration:h.nameList=this.visit(m);break;case I.RULE_singleExpression:h.value=this.visit(m);break}}return this._variablesHandle(h,n),h});w(this,"visitAgainAssign",n=>{const{children:o}=n;if(o.length>=3){const u=this.visit(o[0]);this._verifyGloablVar(u,o[0]);const h=this.visit(o[2]),m=this.visit(o[1]);return u.type?this._againAssignHandle([u,h],[o[0],o[2]],m):null}return null});w(this,"visitVarModifier",n=>{const{children:o}=n;return o[0].symbol.text});w(this,"visitExpressionSequence",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];if(m.ruleIndex===I.RULE_singleExpression){const _=this.visit(m);_&&(_.ctx=m,h.push(_))}}return h});w(this,"visitExpressionBlockSequence",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_singleExpression:h.push(this.visit(m));break;case I.RULE_variableDeclarationList:h.push(this.visit(m));break;case I.RULE_blockExpression:h.push(this.visit(m));break;case I.RULE_varBlockStmt:h.push(this.visit(m));break}}return h});w(this,"visitBlockSequence",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_variableDeclarationList:h.push(this.visit(m));break;case I.RULE_singleExpression:h.push(this.visit(m));break}}return h});w(this,"visitVariableDeclarationStmt",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_variableDeclarationList:h.push(this.visit(m));break;case I.RULE_methodStmt:const _=this.visit(m);_l.includes(_.exprs[0].name)&&(this._onlyStatementsCount++,this._onlyStatementsCount>1&&this._errorHandle(we(Pe.onlyStatementErr,{count:this._onlyStatementsCount}),m)),h.push(_);break}}return h});w(this,"visitVarBlockStmt",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.VarBlockStmt,ctx:n},m=[];for(;u<o.length;u++){const _=o[u];switch(_.ruleIndex){case I.RULE_varArrayDeclaration:h.nameList=this.visit(_);break;case I.RULE_assignmentOperator:h.operator=this.visit(_);break;case I.RULE_name:m.push(_),h.name=this.visit(_);break;case I.RULE_blockExpression:this._isNeedCalc=!0,h.value=this.visit(_),m.push(_);const T=this._getBlockReturnTypes(h.value);T.length===1?h.value.type=T[0]:h.value.types=T,this._isNeedCalc=!1;break}}return h.name?this._againAssignHandle([h.name,h.value],m,h.operator):(this._variablesHandle(h,n),h)});w(this,"visitVarSingle",n=>{const{children:o}=n,u={ruleType:Oe.VarSingle};let h=0,m={lineNumber:0,column:0};for(;h<o.length;h++){const _=o[h];switch(_.ruleIndex){case I.RULE_varModifier:u.declare=this.visit(_);break;case I.RULE_typeGather:const T=this.visit(_);u.prefix=this._getPrefix(T),u.type=T&&this._typeAddConst(T);break;case I.RULE_identifier:const x=this.visit(_);this._repeatVarJudge(x,_),m={lineNumber:_.start.line,column:_.start.column},u.name=x,u.pos=m;break}}return u});w(this,"visitVarMultiple",n=>{const{children:o}=n;let u=0;const h=[],m=[];for(;u<o.length;u++){const _=o[u];if(_.ruleIndex===I.RULE_identifier){const T=this.visit(_);this._repeatVarJudge(T,_),h.push(T),m.push({lineNumber:_.start.line,column:_.start.column})}}return{ruleType:Oe.VarMultiple,names:h,posList:m}});w(this,"visitBlockExpression",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitParenthesizedExpression",n=>{const{children:o}=n,u=o[1],h=this.visit(u);return{ruleType:Oe.ParenthesizedExpression,type:h.type,ctx:n,exprs:h}});w(this,"visitAdditiveExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const T=o[u];T.ruleIndex===I.RULE_singleExpression?m.push(this.visit(T)):h=T.symbol.text}const _={ruleType:Oe.AdditiveExpression,operator:h,ctx:n,exprs:m};if(["+","-"].includes(h)){const T=[W.UNDETERMINED,W.INT,W.FLOAT];h==="+"&&T.push(W.STRING);const x=this._sameTypeJudge(m,[o[0],o[2]],h,T);_.type=this._typeHandle(x)}else{const T=this._calcTypeJudge(m[0],o[0],h),x=this._calcTypeJudge(m[1],o[2],h,1);_.type=this._typeHandle([T,x])}return _});w(this,"visitRelationalExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const x=o[u];x.ruleIndex===I.RULE_singleExpression?m.push(this.visit(x)):h=x.symbol.text}const _=this._calcTypeJudge(m[0],o[0],h),T=this._calcTypeJudge(m[1],o[2],h,1);return{ruleType:Oe.RelationalExpression,operator:h,ctx:n,type:this._typeHandle([_,T],W.BOOL),exprs:m}});w(this,"visitEqualityExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const T=o[u];T.ruleIndex===I.RULE_singleExpression?m.push(this.visit(T)):h=T.symbol.text}const _=this._sameTypeJudge(m,[o[0],o[2]],h,[W.UNDETERMINED,W.COLOR,W.STRING,W.BOOL,W.INT,W.FLOAT]);return{ruleType:Oe.EqualityExpression,operator:h,ctx:n,type:this._typeHandle(_,W.BOOL),exprs:m}});w(this,"visitTernaryExpression",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const _=o[u];if(_.ruleIndex===I.RULE_singleExpression){const T=this._isInLocalScop;u!==0&&(this._isInLocalScop=!0),h.push(this.visit(_)),this._isInLocalScop=T}}let m=W.UNDETERMINED;if(h.length>=3){this._boolTypeJudge(h[0],o[0],"?:");const _=this._sameTypeJudge(h.slice(1),[o[2],o[4]],"?:",[]),T=this._getPrefix(h[0].type);m=this._typeHandle(_),T&&this._getPrefix(m)&&(m=this._typeHandle([m,`${T} ${this._removePrefix(m)}`]))}return{ruleType:Oe.TernaryExpression,type:m,ctx:n,exprs:h}});w(this,"visitNameExpression",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitLiteralExpression",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitUnaryExpression",n=>{var x;const{children:o}=n,[u,h]=o,m=[this.visit(h)],_=u.symbol.text,T=this._calcTypeJudge(m[0],h,_);return((x=m[0])==null?void 0:x.ruleType)===Oe.UnaryExpression&&this._errors.push({message:we(Pe.unaryErr,{sign:_}),startColumn:u.symbol.column+1,startLineNumber:u.symbol.line,endColumn:u.symbol.column+2,endLineNumber:u.symbol.line}),{ruleType:Oe.UnaryExpression,operator:_,type:T,ctx:n,exprs:m}});w(this,"visitNotExpression",n=>{const{children:o}=n,u=o[1],h=[this.visit(u)],m=this._boolTypeJudge(h[0],u,"not");return{ruleType:Oe.NotExpression,ctx:n,type:this._typeHandle([m],W.BOOL),exprs:h}});w(this,"visitMemberIndexExpression",n=>{var m,_;const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const T=o[u];T.ruleIndex===I.RULE_singleExpression&&h.push(this.visit(T))}if(this._memberIndexVerify(h[0],n),this._hasMemberIndex=!0,((m=h[0])==null?void 0:m.ruleType)===Oe.MemberIndexExpression){const T=o[1];this._errors.push({message:we(Pe.unaryErr,{sign:"["}),startColumn:T.symbol.column+1,startLineNumber:T.symbol.line,endColumn:T.symbol.column+2,endLineNumber:T.symbol.line}),this._hasMemberIndex=!1}return{ruleType:Oe.MemberIndexExpression,type:(_=h[0])==null?void 0:_.type,ctx:n,isInFunc:this._isInFunc,exprs:h}});w(this,"visitMethodStmt",n=>{const{children:o}=n;let u=0;const h=[],m=[];let _;for(;u<o.length;u++){const T=o[u];T.ruleIndex===I.RULE_methodElement&&(h.push(this.visit(T)),m.push(T))}return _=this._getMethodTypes(h,m)||[],{ruleType:Oe.MethodExpression,types:_.length>1||_.isBrackethesized||_.isUnknown?_:void 0,ctx:n,type:_.length===1?_[0]:void 0,exprs:h}});w(this,"visitMethodExpression",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitLogicalAndExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const x=o[u];x.ruleIndex===I.RULE_singleExpression?m.push(this.visit(x)):h=x.symbol.text}const _=this._boolTypeJudge(m[0],o[0],h),T=this._boolTypeJudge(m[1],o[2],h,1);return{ruleType:Oe.LogicalAndExpression,type:this._typeHandle([_,T],W.BOOL),operator:h,ctx:n,exprs:m}});w(this,"visitLogicalOrExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const x=o[u];x.ruleIndex===I.RULE_singleExpression?m.push(this.visit(x)):h=x.symbol.text}const _=this._boolTypeJudge(m[0],o[0],h),T=this._boolTypeJudge(m[1],o[2],h,1);return{ruleType:Oe.LogicalOrExpression,operator:h,ctx:n,type:this._typeHandle([_,T],W.BOOL),exprs:m}});w(this,"visitMultiplicativeExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const x=o[u];x.ruleIndex===I.RULE_singleExpression?m.push(this.visit(x)):h=x.symbol.text}const _=this._calcTypeJudge(m[0],o[0],h),T=this._calcTypeJudge(m[1],o[2],h,1);return{ruleType:Oe.MultiplicativeExpression,operator:h,ctx:n,type:this._typeHandle([_,T]),exprs:m}});w(this,"visitBrackethesized",n=>{const{children:o}=n,u=o[1];return{ruleType:Oe.Brackethesized,ctx:n,exprs:this.visit(u)}});w(this,"visitArguments",n=>{const{children:o}=n;let u=0;const h={params:[]};let m="";for(;u<o.length;u++){const _=o[u];if(_.ruleIndex===I.RULE_argument){const T=this.visit(_),x=T.paramKey;x?(m=x,h[x]?this._errorHandle(we(Ri.moreSameArg,{arg:x}),n.parentCtx,Lr.Warning):(h[x]=T.param,h[x].ctx=_)):m?this._errorHandle(we(Pe.argsSyntaxErr,{argName:m}),_):(T.ctx=_,h.params.push(T))}}return h});w(this,"visitArgument",n=>{const{children:o}=n;return o.length===1?this.visit(o[0]):{paramKey:this.visit(o[0]),param:this.visit(o[2])}});w(this,"visitIfStatement",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.IfStatement,condition:[],block:[],ctx:n,typeList:[]};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_singleExpression:h.condition.push(this.visit(m));break;case I.RULE_blockLine:const _=this._isInLocalScop;this._isInLocalScop=!0;const T=this.visit(m);h.typeList.push(this._getBlockReturnTypes(T)),h.block.push(T),this._isInLocalScop=_;break}}return h});w(this,"visitForToStatement",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.ForToStatement,numerical:[],ctx:n,block:[]};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_varModifier:h.declare=this.visit(m);break;case I.RULE_typeGather:const _=this.visit(m);h.type=_&&this._typeAddSeries(_);break;case I.RULE_identifier:h.name=this.visit(m),this._repeatVarJudge(h.name,m);break;case I.RULE_singleExpression:h.numerical.push(this.visit(m));break;case I.RULE_blockLine:this._blockCount++,this._pushBlockRanges(n),h.name&&this._variablesHandle({nameList:{name:h.name,isForVar:!0,type:h.type},value:{type:h.type||`${W.SERIES} ${W.INT}`}},n),this._blockCount--,this._blockRanges.pop(),this._loopCount++;const T=this._isInLocalScop;this._isInLocalScop=!0,h.block=this.visit(m),this._loopCount--,this._isInLocalScop=T,h.returnedTypes=this._getBlockReturnTypes(h.block);break}}return h});w(this,"visitForInStatement",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.ForInStatement,ctx:n,names:[]};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_identifier:const _=this.visit(m);this._repeatVarJudge(_,m),h.names.push(_);break;case I.RULE_singleExpression:h.array=this.visit(m);const T=h.array.type;this._isArrayType(T)||this._isMatrixType(T)||T===W.UNDETERMINED||this._errorHandle(we(Pe.typeMismatch,{operator:"foreach",index:"id",typeE:T,typeR:"array<fun_arg>"}),m);break;case I.RULE_blockLine:if(this._blockCount++,this._pushBlockRanges(n),h.names.length){let[P,A]=h.names;const F=h.array.type;A?this._variablesHandle({nameList:{name:P,isForVar:!0,type:`${W.SERIES} ${W.INT}`},value:{type:`${W.SERIES} ${W.INT}`}},n):A=P;const $=F===W.UNDETERMINED?F:this._isMatrixType(F)?`${this._getArrayType(F)}[]`:this._typeAddSeries(this._getArrayType(F));this._variablesHandle({nameList:{name:A,isForVar:!0,type:$},value:{type:$}},n)}this._blockCount--,this._blockRanges.pop(),this._loopCount++;const x=this._isInLocalScop;this._isInLocalScop=!0,h.block=this.visit(m),this._isInLocalScop=x,this._loopCount--,h.returnedTypes=this._getBlockReturnTypes(h.block);break}}return h});w(this,"visitSwitchStatement",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.SwitchStatement,condition:!0,ctx:n,cases:[],defaultCase:void 0};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_singleExpression:h.condition=this.visit(m);break;case I.RULE_caseClause:h.cases.push(this.visit(m));break;case I.RULE_defaultCaluse:h.defaultCase=this.visit(m);break}}return h});w(this,"visitCaseClause",n=>{const{children:o}=n,u={ruleType:Oe.CaseClause},h=this._isInLocalScop;return this._isInLocalScop=!0,u.condition=this.visit(o[0]),u.block=this.visit(o[2]),this._isInLocalScop=h,u.returnedTypes=this._getBlockReturnTypes(u.block),u});w(this,"visitDefaultCaluse",n=>{const{children:o}=n,u={ruleType:Oe.DefaultCaluse},h=this._isInLocalScop;return this._isInLocalScop=!0,u.block=this.visit(o[1]),this._isInLocalScop=h,u.returnedTypes=this._getBlockReturnTypes(u.block),u});w(this,"visitWhileStatement",n=>{const{children:o}=n,u={ruleType:Oe.WhileStatement,ctx:n};u.condition=this.visit(o[1]),this._loopCount++;const h=this._isInLocalScop;return this._isInLocalScop=!0,u.block=this.visit(o[2]),this._isInLocalScop=h,this._loopCount--,u.returnedTypes=this._getBlockReturnTypes(u.block),u});w(this,"visitImportStmt",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_importElement&&h.push(this.visit(m))}return h});w(this,"visitImportElement",n=>{const{children:o}=n;let u=0;const h=[],m={ruleType:Oe.ImportElement,ctx:n};for(;u<o.length;u++){const _=o[u];_.ruleIndex===I.RULE_identifier?h.push(this.visit(_)):_.symbol&&_.symbol.type===I.IntegerLiteral&&(m.libraryVersion=_.symbol.text)}return m.username=h[0],m.libraryName=h[1],m.name=h[2],m});w(this,"visitLiteral",n=>{const{children:o}=n,u=o[0],{type:h,text:m}=u.symbol,_={ruleType:Oe.Literal,ctx:n,type:"",value:m};switch(h){case I.ColorLiteral:_.type=W.COLOR;break;case I.BooleanLiteral:_.type=W.BOOL;break;case I.StringLiteral:_.type=W.STRING;break;case I.IntegerLiteral:_.type=W.INT;break;case I.DecimalLiteral:_.type=W.FLOAT;break}return _.type&&(_.type=`${W.CONST} ${_.type}`),_});w(this,"visitMethodElement",n=>{const{children:o}=n,[u,h]=o,[m,_,T]=this.visit(u),x=this.visit(h);return{name:m,type:_,args:x,expr:T}});w(this,"visitMethodName",n=>{const{children:o}=n,u=[],h=[];let m=0,_=null;for(;m<o.length;m++){const x=o[m],P=x.ruleIndex,A=x.symbol;switch(P){case I.RULE_identifier:u.push(this.visit(x));break;case I.RULE_singleExpression:_=this.visit(x);break;case I.RULE_typeName:const F=this.visit(x);h.push(F),this._typeCheck(F,I.RULE_typeName,x);break;default:A&&A.text==="."&&u.push(".")}}return[u.join(""),h,_]});w(this,"visitArrowFunction",n=>{const{children:o}=n,u={ruleType:Oe.ArrowFunction,returnedTypes:[]};let h=0,m={lineNumber:0,column:0};for(;h<o.length;h++){const _=o[h],T=_.ruleIndex,x=_.symbol;switch(T){case I.RULE_identifier:m={lineNumber:_.start.line,column:_.start.column},u.name=this.visit(_);break;case I.RULE_arrowFunctionParameters:u.params=this.visit(_),this._setFuncParams(u);break;case I.RULE_block:this._isInFunc=!0,this._hasMemberIndex=!1,u.block=this.visit(_),u.hasMemberIndex=this._hasMemberIndex,u.returnedTypes=this._getBlockReturnTypes(u.block),this._isInFunc=!1;break;default:x&&x.type===I.Export&&(u.isExport=!0)}}return this._setFunc(u,m),this._currentFuncParams.clear(),u});w(this,"visitArrowFunctionParameters",n=>{const{children:o}=n;let u=0,h=[];for(;u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_formalParameterList&&(h=this.visit(m))}return h});w(this,"visitFormalParameterList",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_formalParameterArg&&h.push(this.visit(m))}return h});w(this,"visitFormalParameterArg",n=>{const{children:o}=n;let u=0;const h={};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_typeGather:const _=this.visit(m);h.type=_&&this._typeAddSeries(_);break;case I.RULE_identifier:h.name=this.visit(m);break;case I.RULE_singleExpression:h.defaultValue=this.visit(m)}}return h.type=h.type||W.UNDETERMINED,h});w(this,"visitArrowMethod",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.ArrowMethod,returnedTypes:[]};let m={lineNumber:0,column:0};for(;u<o.length;u++){const _=o[u];switch(_.ruleIndex){case I.RULE_identifier:m={lineNumber:_.start.line,column:_.start.column},h.name=this.visit(_);break;case I.RULE_arrowMethodParameters:h.params=this.visit(_),this._setFuncParams(h);break;case I.RULE_block:this._isInFunc=!0,this._hasMemberIndex=!1,h.block=this.visit(_),h.hasMemberIndex=this._hasMemberIndex,h.returnedTypes=this._getBlockReturnTypes(h.block),this._isInFunc=!1;break;default:_.symbol&&_.symbol.type===I.Export&&(h.isExport=!0);break}}return this._setFunc(h,m),this._setMethod(h,m),this._currentFuncParams.clear(),h});w(this,"visitArrowMethodParameters",n=>{const{children:o}=n;let u=0;const h={};let m=[];for(;u<o.length;u++){const _=o[u];switch(_.ruleIndex){case I.RULE_typeGather:const T=this.visit(_);h.type=T&&this._typeAddSeries(T);break;case I.RULE_identifier:h.name=this.visit(_);break;case I.RULE_formalParameterList:m=this.visit(_);break}}return[h,...m]});w(this,"visitTypeStatement",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.TypeStatement,fields:[]};let m={lineNumber:0,column:0};for(;u<o.length;u++){const _=o[u];switch(_.ruleIndex){case I.RULE_identifier:m={lineNumber:_.start.line,column:_.start.column},h.name=this.visit(_);break;case I.RULE_typeElement:h.fields.push(this.visit(_));break;default:_.symbol&&_.symbol.type===I.Export&&(h.isExport=!0);break}}return this._setUserType(h,m),this._setNewFunc(h,m),this._setCopyFunc(h,m),this._setCopyMethod(h,m),h});w(this,"visitTypeElement",n=>{const{children:o}=n;let u=0;const h={};let m=null;for(;u<o.length;u++){const _=o[u];switch(_.ruleIndex){case I.RULE_typeGather:const T=this.visit(_);if(_.children[0].ruleIndex===I.RULE_typeSeries){const{column:x,line:P,text:A}=_.start,F=x+1;this._errors.push({startColumn:F,endColumn:parseInt(F+A.length),startLineNumber:P,endLineNumber:P,message:we(this._buildinTypes.has(A)?Pe.typeUseError:Pe.notTypeKeyword,{text:A})}),h.type=W.UNDETERMINED}else h.type=T&&this._typeAddSeries(T);break;case I.RULE_identifier:h.name=this.visit(_);break;case I.RULE_singleExpression:m=_,h.value=this.visit(_);break;default:_.symbol&&_.symbol.type===I.Varip&&(h.isVarip=!0);break}}return this._typeElementVerify(h,m),h});w(this,"visitAssignmentOperator",n=>{const{children:o}=n;return o&&o[0].symbol.text});w(this,"visitTypeMap",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];if(m.ruleIndex===I.RULE_typeName){const _=this.visit(m);h.push(_),this._typeCheck(_,I.RULE_typeName,m)}}return`map<${h[0]},${h[1]}>`});w(this,"visitTypeSeries",n=>{const{children:o}=n,[u,h]=o,m=this.visit(u),_=this.visit(h);return this._typeCheck(m,I.RULE_typeSeries,u),this._typeCheck(_,I.RULE_typeName,h),`${m} ${_}`});w(this,"visitTypeArray",n=>{const{children:o}=n,u=o[0];let h=this.visit(u),m=h;if(o.length===3)h=W.ARRAY;else{this._typeCheck(h,I.RULE_typeArray,u);let _=1;for(;_<o.length;_++){const T=o[_];T.ruleIndex===I.RULE_typeName&&(m=this.visit(T),this._typeCheck(m,I.RULE_typeName,T))}}return this._arrayTypeConvert(`${h}<${m}>`)});w(this,"visitTypeGather",n=>{const{children:o}=n;if(o&&o.length){const u=o[0],h=this.visit(u);return u.ruleIndex===I.RULE_typeName&&this._typeCheck(h,I.RULE_typeName,u),h}return null});w(this,"visitIdentifier",n=>n.children&&n.children[0].symbol.text);w(this,"visitTypeName",n=>{const{children:o}=n;let u=0,h="";for(;u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_identifier?h=`${h}${this.visit(m)}`:h=`${h}.`}return h});w(this,"visitName",n=>{var x,P;const{children:o}=n;let u=0,h=!1;const m=[];let _=null;for(;u<o.length;u++){const A=o[u];switch(A.ruleIndex){case I.RULE_identifier:m.push(this.visit(A));break;case I.RULE_singleExpression:_=this.visit(A);break;case I.RULE_methodElement:h=!0,m.push(this.visit(A));break}}const T={ruleType:Oe.Name,hasMethod:h,exprs:m,expr:_};if(h){let A="";const F=[];for(const V of m)typeof V=="string"?A=A?`${A}.${V}`:V:(A&&(V.name=`${A}.${V.name}`),F.push(V),A="");T.exprs=[...F,A];const $=this._getMethodTypes(F,Array.from(F,()=>n));if($&&$.length){const V=we(Pe.noFiledErr,{name:A});$.length>1&&this._errorHandle(V,n),T.type=((P=this._nameCheck(this._getOriginMethodName($[0],A),n,V))==null?void 0:P.type)||W.UNDETERMINED}}else{let A=m.join(".");if(_&&_.type&&_.type===W.UNDETERMINED)T.type=W.UNDETERMINED,A=`expr0.${A}`;else{_&&_.type&&(A=`${this._getMethodTypeName(_.type)}.${A}`);const F=this._nameCheck(A,n)||{};(x=F.title)!=null&&x.startsWith("built-in")&&(T.isBuiltIn=!0,T.isConst=F.isConst),T.varPos=F.pos,T.declare=F.declare,T.type=(F==null?void 0:F.type)||W.UNDETERMINED,F!=null&&F.isArg&&(T.arg=F),T.scope=this._blockCount}T.name=A}return T});this._loopCount=0,this._errors=[],this._variables=new Map,this._functions=new Map,this._methods=new Map,this._currentFuncParams=new Map,this._types=new Map,this._currentBlockVars=[new Map],this._blockCount=0,this._isInFunc=!1,this._isNeedCalc=!1,this._blockRanges=[],this._overloadsFuncs=[],this._hasMemberIndex=!1,this._isInLocalScop=!1,this._onlyStatementsCount=0}get overloadsFuncs(){return this._overloadsFuncs}get errors(){return this._errors}get userTypes(){return this._types}get userFunctions(){return this._functions}get userVariables(){return this._variables}get userMethods(){return this._methods}_verifyGloablVar(n,o){const{name:u,varPos:h,isBuiltIn:m}=n;if(m&&this._errorHandle(we(Pe.buidinAssignErr,{name:u}),o),!h)return;const _=this._currentBlockVars[0].get(u);if(!_)return;const{column:T,lineNumber:x}=_.pos||{};this._isInFunc&&T===h.column&&x===h.lineNumber&&this._errorHandle(we(Pe.modifyGlobalVarErr,{name:u}),o)}_typeElementVerify(n,o){var _,T;const{type:u,value:h}=n;if(!h)return;if(![Oe.Literal,Oe.UnaryExpression].includes(h.ruleType)&&!h.isBuiltIn){this._errorHandle(Pe.defaultValueErr,o);return}else if(h.ruleType===Oe.UnaryExpression){const{exprs:x}=h;if(![Oe.Literal,Oe.UnaryExpression].includes((_=x[0])==null?void 0:_.ruleType)&&!((T=x[0])!=null&&T.isBuiltIn)){this._errorHandle(Pe.defaultValueErr,o);return}}(!this._compareType(u,h.type)||u.endsWith(W.INT)&&h.type.endsWith(W.FLOAT))&&this._errorHandle(we(Pe.defaultValueTypeErr,{typeE:h.type,typeR:u}),o)}_memberIndexVerify(n,o){if(n.ruleType===Oe.Name&&!n.hasMethod&&this._blockCount){const h=this._currentBlockVars[this._blockCount],m=h&&h.get(n.name);m&&(m.isForVar?this._errorHandle(we(Pe.notHistoryErr,{name:n.name}),o):!(this._blockCount===1&&this._isInFunc)&&this._errorHandle(we(Ri.localScopeGetHistory,{name:n.name}),o,Lr.Warning))}const u=n&&n.type;if(u){const h=this._removePrefix(u);!this._types.has(h)&&!this._buildinTypes.has(h)&&!this._isArrayType(h)&&!this._isMatrixType(h)&&!this._isMapType(h)&&h!==W.UNDETERMINED&&this._errorHandle(we(Pe.invalidType,{index:0}),o)}}_setFuncParams(n){var o;for(const u of n.params){const h=(o=this._types.get(u.type))==null?void 0:o[0];if(h&&h.fields)for(const m of h.fields){const _=`${u.name}.${m.name}`;this._currentFuncParams.set(_,{...m,originName:_})}this._setVariablesMap(u),this._currentFuncParams.set(u.name,u)}}_pushBlockRanges(n){!n||!n.start||!n.stop||this._blockRanges.push({startColumn:n.start.column,endColumn:n.stop.column,startLineNumber:n.start.line,endLineNumber:n.stop.line})}_setUserType(n,o){const{fields:u,name:h}=n;this._types.set(h,[{fields:u.map(m=>({name:m.name,type:m.type})),name:h,pos:o}]),this._addVarToMap(h,h,o,!1,!1)}_againAssignHandle(n,o,u){const h=u!==":="?u.replace("=",""):u,m=u!==":="?[W.UNDETERMINED,W.INT,W.FLOAT]:[];h==="+"&&m.push(W.STRING);const[_,T]=n;_.arg&&!_.name.includes(".")&&this._errorHandle(we(Pe.funcArgAssignErr,{name:_.name}),o[0]);const x=this._sameTypeJudge(n,o,h,m),P=this._typeHandle(x);return this._updateUserVar(_.name,P,T.type),_.type=P,{ruleType:Oe.AgainAssign,name:_,operator:u,type:P,value:T}}_typeCheck(n,o,u){const h=[W.SERIES,W.SIMPLE,W.CONST];switch(o){case I.RULE_typeName:const m=this._buildinTypes.get(n);m&&![...h,W.ARRAY,W.MATRIX,W.MAP].includes(m[0].name)||this._types.get(n)||this._errorHandle(we(Pe.notTypeKeyword,{text:n}),u);break;case I.RULE_typeArray:[W.ARRAY,W.MATRIX].includes(n)||this._errorHandle(Pe.tempateTypeErr,u);break;case I.RULE_typeSeries:h.includes(n)||this._errorHandle(we(Pe.qualifierErr,{name:n}),u);break}}_getBuildVar(n){const o=this._buildinVariables.get(n);if(o&&o[0])return o[0];const u=this._buildinConstants.get(n);if(u&&u[0])return Object.assign(u[0],{isConst:!0})}_verifyName(n,o){var h,m;const u=this._getBuildVar(n);if(u)return u;if(n.includes(".")){const _=n.split("."),T=_.pop(),x=_.join(".");let P=this._blockCount;for(;P>=0;){if(!this._currentBlockVars[P]){P--;continue}const A=this._currentBlockVars[P].get(x);if(o&&this._judgeGatherValue(T||"",o,A==null?void 0:A.valueType,!0),(A==null?void 0:A.type)==="chart.point"){const $=(((m=(h=this._buildinTypes.get(A.type))==null?void 0:h[0])==null?void 0:m.fields)||[]).find(V=>V.name===T);if($)return Object.assign($,{pos:A.pos})}P--}}return this._getUserVar(n)}_judgeGatherValue(n,o,u,h){u===`${W.SIMPLE} ${W.NA}`&&this._errorHandle(we(Pe.objectIsNaErr,{name:n,type:h?"field":"method"}),o)}_nameCheck(n,o,u=we(Pe.undeclared,{name:n})){const h=this._verifyName(n,o);return h||this._errorHandle(u,o),h}_inBlock(n){this._blockCount++,this._pushBlockRanges(n);const o=this.visit(n);return this._blockCount--,this._blockRanges.pop(),this._currentBlockVars.splice(this._blockCount+1),o}_errorHandle(n,o,u=Lr.Error){this._errors.push({message:n,startColumn:o.start.column+1,startLineNumber:o.start.line,endColumn:o.start.column+2+o.stop.stop-o.start.start,endLineNumber:o.stop.line,type:u})}_boolTypeJudge(n,o,u,h=0){return this._typeJudge(n,o,u,W.BOOL,[W.UNDETERMINED,W.INT,W.FLOAT,W.BOOL],h)}_calcTypeJudge(n,o,u,h=0){return this._typeJudge(n,o,u,"int/float",[W.UNDETERMINED,W.INT,W.FLOAT],h)}_typeJudge(n,o,u,h,m,_=0){const T=n&&n.type;if(T){const x=this._removePrefix(T);if(!m.includes(x)&&x!==W.NA)return this._errorHandle(we(Pe.typeMismatch,{operator:`operator ${u}`,index:`expr${_}`,typeE:x,typeR:h}),o),W.UNDETERMINED;h===W.BOOL&&[W.INT,W.FLOAT].includes(x)&&this._errorHandle(we(Ri.typeMismatch,{operator:`operator ${u}`,index:`expr${_}`,type:W.BOOL}),o,Lr.Warning)}return T||W.UNDETERMINED}_sameTypeJudge(n,o,u,h){let m="";const _=[],T=["plot_display","plot_simple_display"];["+","-","+=","-="].includes(u)&&(h=h.concat(T));for(const[x,P]of n.entries()){let A=P&&P.type||W.UNDETERMINED;const F=this._removePrefix(A);if(m||(m=F),!h.includes(F)&&h.length&&F!==W.NA){this._errorHandle(we(Pe.typeMismatch,{operator:`operator ${u}`,index:`expr${x}`,typeE:A,typeR:h.slice(1).join("/")}),o[x]),m=W.UNDETERMINED,_.push(m);continue}if(m===W.UNDETERMINED||F===W.UNDETERMINED)A=m=W.UNDETERMINED;else if(m!==F&&m!==W.NA&&F!==W.NA&&(![W.INT,W.FLOAT].includes(m)||![W.INT,W.FLOAT].includes(F)))if(u===":=")this._errorHandle(we(Pe.assignTypeMismatch,{typeE:F,name:n[0].name,typeR:m}),o[0]),A=m=W.UNDETERMINED;else if(["==","!=","?:"].includes(u)&&[W.INT,W.FLOAT,W.BOOL].includes(m)&&[W.INT,W.FLOAT,W.BOOL].includes(F))this._errorHandle(we(Ri.typeMismatch,{operator:`operator ${u}`,index:`expr${x}`,type:m}),o[x],Lr.Warning),A=m=W.UNDETERMINED;else if(T.includes(m)&&T.includes(F)){if(m!==F){const $=this._getPrefix(A);_[x-1]=`${this._getPrefix(_[x-1])} ${T[0]}`,A=m=`${$} ${T[0]}`}}else this._errorHandle(we(Pe.typeMismatch,{operator:`operator ${u}`,index:`expr${x}`,typeE:F,typeR:m}),o[x]),A=m=W.UNDETERMINED;_.push(A)}return _}_getUserVar(n,o=!1){for(let u=this._blockCount;u>=0;u--){const h=this._currentBlockVars[u];if(u<=0){const m=this._currentFuncParams.get(n);if(m)return m.isArg=!0,m}if(h){const m=h.get(n);if(m)return m}}if(n.includes(".")&&!o){let u=!1,h=null;if(n.split(".").reduce((m,_)=>{let T=m?`${m}.${_}`:_;const x=this._getUserVar(T,!0);return x!=null&&x.type?x.type===W.UNDETERMINED?u=!0:(T=x.type,h=x):h=null,T},""),u)return{name:n,type:W.UNDETERMINED};if(h)return h}return null}_repeatVarJudge(n,o){this._getBuildVar(n)&&this._errorHandle(we(Pe.buidinVarErr,{name:n}),o);for(let h=0;h<=this._blockCount;h++){const m=this._currentBlockVars[h];if(m&&m.get(n)){if(this._blockCount===h)return this._errorHandle(we(Pe.repeatVar,{name:n}),o),!0;this._errorHandle(we(Ri.repeatVar,{name:n}),o,Lr.Warning)}}}_judgeVarBuildIn(n){for(let o=0;o<=this._blockCount;o++){const u=this._currentBlockVars[o];if(u&&u.get(n))return!0}return!1}_updateUserVar(n,o,u){for(let h=0;h<=this._blockCount;h++){const m=this._currentBlockVars[h];if(m){const _=m.get(n);if(_){_.type=o,_.valueType=u;return}}}}_variablesHandle(n,o){var m,_,T,x;if(!(n&&n.nameList))return;const u=n.nameList;if(u.name==="_")return;const h=n.value;if(u.ruleType===Oe.VarMultiple){u.types=[],this._checkVarMultiple(u.names,h,o);for(const[P,A]of u.names.entries()){const F=this._varTypeJudge("",((m=h==null?void 0:h.types)==null?void 0:m[P])||W.UNDETERMINED,o);u.types.push(F),this._addVarToMap(A,F,u.posList[P],!0)}}else{const P=(h==null?void 0:h.type)||((_=h==null?void 0:h.returnedTypes)==null?void 0:_[0]);((T=h==null?void 0:h.types)!=null&&T.isBrackethesized||(x=h==null?void 0:h.returnedTypes)!=null&&x.isBrackethesized)&&this._errorHandle(we(Pe.tupleLeftVarErr,{name:u.name}),o),!u.type&&P===`${W.SIMPLE} ${W.NA}`&&this._errorHandle(Pe.naVarErr,o),u.prefix&&wi.indexOf(u.prefix)>wi.indexOf(this._getPrefix(P))&&this._errorHandle(we(Pe.declaredErr,{prefix:u.prefix,type:P}),o);const A=this._varTypeJudge(u.type,P||W.UNDETERMINED,o);u.type=A,this._addVarToMap(u.name,A,u.pos,!0,u.isForVar,u.declare,h.type)}}_checkVarMultiple(n,o,u){var x,P,A,F;const h=n.length,m=(o.types||o.returnedTypes||[]).length,_=((x=o.types)==null?void 0:x.isBrackethesized)||((P=o.returnedTypes)==null?void 0:P.isBrackethesized);(A=o.types)!=null&&A.isUnknown||(F=o.returnedTypes)!=null&&F.isUnknown||(m===1&&!_||!m?this._errorHandle(Pe.tupleRightVarErr,u):h!==m&&this._errorHandle(we(Pe.tupleVarErr,{indexA:m,indexB:h}),u))}_addVarToMap(n,o,u,h=!0,m=!1,_,T){var F;const x=this._currentBlockVars[this._blockCount]||new Map,P=(F=this._types.get(o))==null?void 0:F[0];if(P&&P.fields)for(const $ of P.fields)x.set(`${n}.${$.name}`,$);const A={name:n,type:o,pos:u,valueType:T};h&&this._setVariablesMap(A),x.set(n,Object.assign(A,{isForVar:m,declare:_})),this._currentBlockVars[this._blockCount]=x}_setVariablesMap(n){const o=this._blockRanges[this._blockCount];n.range=o,n.scope=this._blockCount;const u=this._variables.get(n.name)||[];u.push(n),Object.assign(n,{defaultValue:void 0}),this._variables.set(n.name,u)}_varTypeJudge(n,o,u){if(o===W.VOID)return this._errorHandle(Pe.voidNotVar,u),W.UNDETERMINED;if(n&&o!==W.UNDETERMINED){const h=this._removePrefix(n),m=this._removePrefix(o);return m!==h&&m!==W.NA&&!(h===W.FLOAT&&m===W.INT)?(this._errorHandle(we(Pe.declareTypeErr,{type:n,valueType:o}),u),W.UNDETERMINED):this._typeHandle([n,o])}else if(o===W.UNDETERMINED)return W.UNDETERMINED;return n||o||W.UNDETERMINED}_getAllowTypes(n){const o=[];if(n===W.UNDETERMINED)return o;const u=this._getPrefix(n);if(u){const h=this._removePrefix(n);let m=-1;for(const[_,T]of wi.entries())T===u&&(m=_),m>=0&&m<=_&&(h===W.FLOAT&&o.push(`${T} ${W.INT}`),o.push(`${T} ${h}`))}else n=this._arrayTypeConvert(n)||"",o.push(n),n.includes(W.FLOAT)&&o.push(n.replace(/float/,W.INT));return o}_setNewFunc(n,o){const u=`${n.name}.new`,h=[],m=[];for(const _ of n.fields)h.push({name:_.name,required:!1,allowedTypeIDs:this._getAllowTypes(_.type),displayType:_.type}),m.push(`${_.type} ${_.name}`);this._functions.set(u,[{name:u,args:h,returnedTypes:[n.name],isUser:!0,pos:o,syntax:[`${u}(${m.join(", ")}) → ${n.name}`]}])}_setCopyFunc(n,o){const u=n.name,h=`${u}.copy`;this._functions.set(h,[{name:h,args:[{name:"object",required:!0,allowedTypeIDs:[u],displayType:u}],returnedTypes:[u],isUser:!0,pos:o,info:"The identifier of the object to be copied.",syntax:[`${h}(${u} object) → ${u}`]}])}_setCopyMethod(n,o){const u=n.name,h=`${u}.copy`;this._methods.set(h,[{name:h,args:[],returnedTypes:[u],thisType:[u],isUser:!0,pos:o,syntax:[`${h}() → ${u}`]}])}_setFunc(n,o){const u=[],h=[];for(const x of n.params){const{type:P,name:A,defaultValue:F}=x;u.push({name:A,required:!F,allowedTypeIDs:this._getAllowTypes(P),displayType:P}),h.push(`${P===W.UNDETERMINED?"":`${P} `}${A}`)}const{returnedTypes:m=[]}=n,_=n.name,T=m.length>1?`[${m.join(", ")}]`:m.toString();this._functions.set(_,[{name:_,args:u,syntax:[`${_}(${h.join(", ")}) → ${T||"void"}`],isUser:!0,hasMemberIndex:n.hasMemberIndex,pos:o,returnedTypes:m}])}_setMethod(n,o){const{name:u,returnedTypes:h,params:m}=n,_=m[0].type,T=[],x=[];for(const $ of m.slice(1)){const{type:V,name:b,defaultValue:y}=$;T.push({name:b,required:!y,allowedTypeIDs:this._getAllowTypes(V),displayType:V}),x.push(`${V} ${b}`)}const P=h.length>1?`[${h.join(", ")}]`:h.toString(),A=this._getMethodTypeName(_),F=`${A}.${u}`;n.typeName=A,this._methods.set(F,[{name:u,args:T,originalName:F,syntax:[`${u}(${x.join(", ")}) → ${P||"void"}`],returnedTypes:h,isUser:!0,hasMemberIndex:n.hasMemberIndex,pos:o,thisType:[_]}])}_getMethodTypes(n,o){let u;for(const[h,m]of n.entries()){const{type:_,expr:T,args:x}=m;let{name:P}=m;const A=o[h];if(T){if(T.type===W.UNDETERMINED)return[W.UNDETERMINED];P=`${this._getMethodTypeName(T.type)}${P}`,x.params.unshift(T)}if(u&&u.length>=1)if(u.length===1){const F=u[0];if(F===W.UNDETERMINED)return[W.UNDETERMINED];const $=this._getOriginMethodName(F,P);P.includes(".")?u=this._getOtherNamesMethodType($,u,A,x,m):u=this._expandMethodHandle($,A,x,{type:F},F,m)}else this._errorHandle(we(Pe.noFiledErr,{name:P}),A);else{const[F,$]=this._tempFuncNameHandle(P,A,_);P=$;const V=this._buildinFunctions.get(F);if(V)this._globalFuncVerify(V[0],A),this._hasMemberIndexVerify(V[0],A,m),m.isBuiltIn=!0,u=this._getBuildInReturnTypes(V,x,P,A,void 0,_);else{const b=this._functions.get(P);if(b){this._hasMemberIndexVerify(b[0],A,m),u=b[0].returnedTypes;const{hasErr:y}=this._checkArgs(x,b[0].args||[],P,A,u[0]);if(y)return[W.UNDETERMINED]}else u=this._getOtherNamesMethodType(P,u,A,x,m)}}m.returnTypes=u}return u===void 0&&this._errorHandle(we(Pe.notFindFuncErr,{name:n[0].name}),o[0]),u}_globalFuncVerify(n,o){this._blockCount!==0&&Tm.includes(n.name)&&this._errorHandle(we(Pe.globalFuncErr,{name:n.name}),o)}_hasMemberIndexVerify(n,o,u){(n.hasMemberIndex||n.name.startsWith("ta.")||n.name==="math.sum")&&(this._hasMemberIndex=this._isInFunc,u.hasMemberIndex=!0,u.position=o.start.tokenIndex,this._isInLocalScop&&this._errorHandle(we(Ri.localScopeWarning,{name:u.name}),o,Lr.Warning))}_tempFuncNameHandle(n,o,u){let h=n;if(u&&u.length>=1){const m=["array.new","matrix.new"].includes(n),_=n==="map.new";if(u.length===1)if(m)h=`${n}<type>`,n=`${n}<${u[0]}>`;else return _?this._errorHandle(we(Pe.templateErr,{countA:2,countB:1}),o):this._errorHandle(we(Pe.templateNoSupportErr,{name:n}),o),[W.UNDETERMINED];else{if(!_)return m?this._errorHandle(we(Pe.templateErr,{countA:1,countB:2}),o):this._errorHandle(we(Pe.templateNoSupportErr,{name:n}),o),[W.UNDETERMINED];if(!Sm.includes(u[0]))return this._errorHandle(we(Pe.mapKeyErr,{type:this._typeAddSeries(u[0])}),o),[W.UNDETERMINED];h=`${n}<type,type>`,n=`${n}<${u[0]},${u[1]}>`}}return[h,n]}_getOtherNamesMethodType(n,o,u,h,m){const _=n.split("."),T=_.length-1,x=_.slice(0,T).join("."),P=this._getUserVar(x);this._judgeGatherValue(_[T],u,P==null?void 0:P.valueType);const A=P==null?void 0:P.type;if(A){if(A===W.UNDETERMINED)return o=[W.UNDETERMINED],o.isUnknown=!0,o;const F=this._getOriginMethodName(A,_[T]);o=this._expandMethodHandle(F,u,h,P,x,m)}else{let F="",$="",V="";for(const b of _.slice(0,T)){F?$=this._getOriginMethodName(F,b):$=$?`${$}.${b}`:b;const y=this._verifyName($);y!=null&&y.type?(F=y.type,V=""):this._buildinTypes.get($)?V=we(Pe.methodNotExistErr,{name:$,methodName:_[T]}):V=we(Pe.noFiledErr,{name:b})}V&&this._errorHandle(V,u)}return o}_expandMethodHandle(n,o,u,h,m,_){var P,A;let T;const x=this._buildinMethods.get(n);if(x)T=this._getBuildInReturnTypes(x,u,n,o,h);else{const F=this._methods.get(n);if(F&&F.length){const $=F[0],V=this._getMethodTypeName(((P=$.thisType)==null?void 0:P[0])||"");if(!this._types.get(V)){const g=this._functions.get($.name);g&&(_.selfArg=(A=g[0].args)==null?void 0:A[0])}this._hasMemberIndexVerify($,o,_),T=$.returnedTypes;const{hasErr:y}=this._checkArgs(u,$.args||[],n,o,(T==null?void 0:T[0])||"");if(y)return[W.UNDETERMINED]}else this._errorHandle(we(Pe.methodNotExistErr,{methodName:n.split(".").slice(-1)[0],name:m}),o)}return T}_getBuildInReturnTypes(n,o,u,h,m,_){var x;let T;if(n.length===1){const{returnedTypes:P,syntax:A,args:F=[],thisType:$}=n[0],V=A[0].split("→")[1].trim(),b=m||o.params[0]||((x=F[0])==null?void 0:x.name)&&o[F[0].name];b&&!this._checkMethodThisType($,b.type)&&this._errorHandle(we(Pe.typeMismatch,{operator:u,index:b.name||"id",typeE:b.type,typeR:$[0]}),h);const{hasErr:y,types:g}=this._checkArgs(o,F,u,h,V,b);if(y)return[W.UNDETERMINED];if(T=g.length&&g||this._returnedTypesParse(P),T.length>1)return T;(_==null?void 0:_.length)===1?T=[this._typeReplace(V,_[0])]:(_==null?void 0:_.length)===2&&(T=[`${W.MAP}<${_[0]},${_[1]}>`]),T=this._returnTypesOtherHandle(b,V,T,u)}else{const P=this._overloadsFuncGetTypes(n,o,h,m);T=this._returnedTypesParse([P])}return T}_overloadsFuncGetTypes(n,o,u,h){var F,$;let m="",_=[],T=[],x=0;for(const[V,b]of n.entries()){const{args:y,returnedTypes:g,name:D,thisType:R}=b,O=h||o.params[0]||o[y[0].name],{errMsg:U,warnMsg:X}=this._overloadsCheckArgs(o,y,D,u,O);O&&!this._checkMethodThisType(R,O.type)&&U.unshift({msg:we(Pe.typeMismatch,{operator:D,index:O.name||"id",typeE:O.type,typeR:R[0]}),ctx:u}),V===0?(_=U,T=X,!U.length&&(m=g[0])):U.length?((F=_[0])!=null&&F.isLenErr&&!(($=U[0])!=null&&$.isLenErr)||_.length>U.length)&&(_=U,T=X,x=V):this._priorityComparison(m,g[0])||(g[0]===`${W.ARRAY}<>`?m=`${O.type}[]`:m=g[0],_=U,T=X,x=V)}for(const V of _)this._errorHandle(V.msg,V.ctx);for(const V of T)this._errorHandle(V.msg,V.ctx,Lr.Warning);const P=u.children[0],A=n[0].name;return P&&this._overloadsFuncs.push({name:A,index:x,line:P.start.line,startColumn:P.start.column+1,endColumn:P.start.column+A.length}),this._funcArgsAddOriginName(o,n[x].args,A),m||W.UNDETERMINED}_funcArgsAddOriginName(n,o,u){const h=n.params||[];for(const[m,_]of o.entries())m<h.length&&(h[m].originName=_.name);if(u==="input"){const m=h[0]||n.defval;Object.assign(n,{inputType:{name:`'${m!=null&&m.isSourceType?"source":this._removePrefix(m==null?void 0:m.type)}'`}})}}_overloadsCheckArgs(n,o,u,h,m){const _={...n},T=_.params;delete _.params;const x=Object.keys(_).length+T.length,P=o.length,A=[],F=[];if(x>P&&!o.some(V=>["arg0, arg1, ...","number0, number1, ..."].includes(V.name)))return A.push({msg:we(Pe.argsLenErr,{name:u,lenA:x,lenB:P}),isLenErr:!0,ctx:h}),{errMsg:A,warnMsg:F};for(const[$,V]of o.entries()){let b=_[V.name];if($<T.length&&(b&&F.push({msg:we(Ri.moreSameArg,{arg:V.name}),ctx:h}),b=T[$]),!b)V.required&&A.push({msg:we(Pe.requiredParamErr,{name:u,argName:V.name}),ctx:h});else{const y=b.type!==`${W.SIMPLE} na`?this._checkArg(b,V,u,m,b.ctx,!0):"";y&&A.push({msg:y,ctx:b.ctx}),delete _[V.name]}if(["arg0, arg1, ...","number0, number1, ..."].includes(V.name)&&T.length>$+1){const y=T.slice($+1);let g=T[$];for(const D of y){g.type===`${W.SIMPLE} ${W.NA}`&&(g=D);const R=D.type!==`${W.SIMPLE} ${W.NA}`?this._checkArg(D,V,u,g,D.ctx,!0):"";R&&A.push({msg:R,ctx:D.ctx})}}}if(Object.keys(_).length)for(const $ of Object.keys(_))A.push({msg:we(Pe.argsNameErr,{name:u,argName:$}),ctx:_[$].ctx});return{errMsg:A,warnMsg:F}}_checkArgs(n,o,u,h,m,_){var V;const T={...n},x=T.params;delete T.params;const P=Object.keys(T).length+x.length,A=o.length;let F=!1,$=[];if(P>A&&!o.some(y=>["arg0, arg1, ...","number0, number1, ..."].includes(y.name)))return this._errorHandle(we(Pe.argsLenErr,{name:u,lenA:P,lenB:A}),h),F=!0,{hasErr:F,types:$};for(const[b,y]of o.entries()){let g=T[y.name];if(b<x.length&&(g&&this._errorHandle(we(Ri.moreSameArg,{arg:y.name}),h,Lr.Warning),g=x[b],g.originName=y.name),!g)y.required&&(this._errorHandle(we(Pe.requiredParamErr,{name:u,argName:y.name}),h),F=!0);else{const D=g.type!==`${W.SIMPLE} ${W.NA}`?this._checkArg(g,y,u,_,g.ctx):"";if(D)this._errorHandle(D,g.ctx),F=!0;else if(D===!1)F=!0;else if(u.startsWith("request.")&&y.name==="expression")if(g.ruleType===Oe.Brackethesized)$=g.exprs.map(R=>this._typeReplace(m,R.type));else if((V=g.types||g.returnedTypes)!=null&&V.isBrackethesized)$=(g.types||g.returnedTypes).map(R=>this._typeReplace(m,R));else{const R=this._typeReplace(m,g.type);$.push(R)}delete T[y.name]}}if(Object.keys(T).length)for(const b of Object.keys(T))this._errorHandle(we(Pe.argsNameErr,{name:u,argName:b}),T[b].ctx),F=!0;return{hasErr:F,types:$}}_checkArg(n,o,u,h,m,_){const{ruleType:T,exprs:x,name:P}=n;let A=n.type;T===Oe.Brackethesized&&(A=`[${x.map(b=>b.type).join(", ")}]`);const{allowedTypeIDs:F=[],displayType:$,name:V}=o;if(!(!A||A===W.UNDETERMINED||$===W.UNDETERMINED)&&(u==="input"&&V==="defval"&&gl.includes(P)&&(n.isSourceType=!0),!(this._checkMethodThisType(F,this._arrayTypeConvert(A))&&!(u==="input.source"&&V==="defval")))){if(V==="condition"&&($!=null&&$.endsWith(W.BOOL))&&(A.endsWith(W.INT)||A.endsWith(W.FLOAT))){m&&this._errorHandle(we(Ri.typeMismatch,{index:V,operator:u,type:W.BOOL}),m,Lr.Warning);return}switch($){case"tuple of const string values: [val1, val2, ...]":return this._tupleToCheck(n,o,[`${W.CONST} ${W.STRING}`],u,A);case"tuple of const int/float values: [val1, val2, ...]":return this._tupleToCheck(n,o,[`${W.CONST} ${W.FLOAT}`,`${W.CONST} ${W.INT}`],u,A);case"tuple of const int values: [val1, val2, ...]":return this._tupleToCheck(n,o,[`${W.CONST} ${W.INT}`],u,A);case"open/high/low/close/hl2/hlc3/ohlc4/hlcc4":if(!P||!gl.includes(P))return we(Pe.inputSourceErr,{name:V,funcName:u});if(this._judgeVarBuildIn(P))return we(Pe.buildInUseErr,{name:P});n.isSourceType=!0;break;case"<matrix_type>":case"<array_type>":const b=this._getArrayType(u)||"";if(!A.endsWith(b)&&!(A.endsWith(W.INT)&&b===W.FLOAT))return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:this._typeAddSeries(b)});break;case"any matrix type":if(this._isMatrixType(A)){if(V==="id2"){const O=this._getArrayType(h==null?void 0:h.type);if(!O)return;const U=this._getArrayType(A)||"";if(O!==U)return we(Pe.typeMismatch,{operator:u,index:V,typeE:U,typeR:O})}}else return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:"matrix<fun_arg>"});break;case"any array type":if(this._isArrayType(A)){if(V==="id2"){const O=this._getArrayType(h==null?void 0:h.type);if(!O)return;const U=this._getArrayType(A)||"";if(O!==U)return we(Pe.typeMismatch,{operator:u,index:V,typeE:U,typeR:O})}}else return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:"array<fun_arg>"});break;case"series <type of the matrix's elements>":case"series <type of the array's elements>":const y=this._getArrayType(h==null?void 0:h.type)||"";if(!A.endsWith(y)&&!(A.endsWith(W.INT)&&y===W.FLOAT))return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:this._typeAddSeries(y)});break;case"any map type":if(this._isMapType(A)){if(V==="id2"){const O=this._getMapType(h==null?void 0:h.type);if(!O)return;const U=this._getMapType(A)||[];if(O[0]!==U[0]||O[1]!==U[1])return we(Pe.mapKeyValErr,{typeA:this._typeAddSeries(U[0]),typeB:this._typeAddSeries(U[1]),typeC:this._typeAddSeries(O[0]),typeD:this._typeAddSeries(O[1]),name:u})}}else return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:"map<type, type>"});break;case"series <type of the map's elements>":const g=this._getMapType(h==null?void 0:h.type);if(!g)return;const D=V==="key"?0:1;if(!A.endsWith(g[D])&&!(A.endsWith(W.INT)&&g[D]===W.FLOAT))return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:this._typeAddSeries(g[D])});break;case"<arg_expr_type>":if(T===Oe.Brackethesized)return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:$||""});break;case"<arg_type>":case"variable, function, object, array or matrix of series int/float/bool/string/color, or a tuple of these":break;case"variable, object or function of series int/float/bool/string/color, or a tuple of these":if(T===Oe.Brackethesized){for(const O of x)if(!F.includes(O.type))return this._errorHandle(we(Pe.requestArgsErr,{name:u,argName:V,type:O.type}),O.ctx),!1}break;case"const int/float/bool/string/color or source-type built-ins":if(gl.includes(n.name)&&F[0].endsWith(this._removePrefix(A)))n.isSourceType=!0;else return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:"const int/float/bool/string/color"});break;case"<arg..._type>":if(T===Oe.Brackethesized||this._isArrayType(A)||this._isMapType(A)||this._isMatrixType(A))return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:`${W.SERIES} ${W.INT}`});if(A!==(h==null?void 0:h.type))return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:h==null?void 0:h.type});break;default:const R=this._removePrefix(n.type);if(n.arg&&n.arg.isArg&&!_){const O=F.find(U=>U.endsWith(R));if(O){n.type=O,n.arg.type=O;return}}if(F.length===1&&F[0].endsWith(R)){const O=this._getPrefix(n.type),U=this._getPrefix(F[0]);if(wi.indexOf(O)>=wi.indexOf(U))return}return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:$||""})}}}_tupleToCheck(n,o,u,h,m){var _,T;if(u.push(`${W.SIMPLE} ${W.NA}`),n.ruleType===Oe.Brackethesized){const x=[];let P=!1;for(const A of n.exprs)x.push(A.type),u.includes(A.type)||(P=!0);if(P)return we(Pe.typeMismatch,{operator:h,index:o.name,typeE:`[${x.join(", ")}]`,typeR:((_=o.allowedTypeIDs)==null?void 0:_[0])||""})}else return we(Pe.typeMismatch,{operator:h,index:o.name,typeE:m,typeR:((T=o.allowedTypeIDs)==null?void 0:T[0])||""})}_getBlockReturnTypes(n){var F,$;let o=n;if(Array.isArray(n)&&(o=n.slice(-1)[0],Array.isArray(o)&&(o=o.slice(-1)[0])),!o)return[W.UNDETERMINED];const{ruleType:u,type:h,types:m,returnedTypes:_,exprs:T,nameList:x,typeList:P,block:A}=o;if(m&&m.length)return m;if(_&&_.length)return _;if(h)return[h];switch(u){case Oe.Brackethesized:const V=T.map(ue=>ue.type);return V.isBrackethesized=!0,V;case Oe.VarBlockStmt:case Oe.DeclareAssign:return x?x.ruleType===Oe.VarMultiple?x.types:[x.type]:[((F=o.name)==null?void 0:F.type)||W.UNDETERMINED];case Oe.SwitchStatement:if(!this._isNeedCalc&&!this._isInFunc)return[W.UNDETERMINED];const b=[...o.cases];o.defaultCase&&b.push(o.defaultCase);let y=(($=b[0])==null?void 0:$.returnedTypes)||[],g=y.length<=1?y[0]:`[${y.join(", ")}]`,D=null;for(const ue of b.slice(1)){const K=ue.returnedTypes||[W.UNDETERMINED];g+=K.length<=1?`; ${K[0]}`:`; [${K.join(", ")}]`;const Y=Array.isArray(ue.block)?ue.block.slice(-1)[0]:ue.block;if(K.length!==y.length)D=Y.ctx;else for(const[G,ce]of y.entries())if(this._compareType(K[G],ce))(K[G].includes(W.FLOAT)&&!ce.includes(W.FLOAT)||y[G]===`${W.SIMPLE} ${W.NA}`||y[G]===W.UNDETERMINED)&&(y[G]=K[G]);else{D=Y.ctx;break}}return D&&(this._errorHandle(we(Pe.ifOrSwitchTypeErr,{keyword:"switch",types:g}),D),y=y.map(()=>W.UNDETERMINED)),o.returnedTypes=y,y;case Oe.IfStatement:if(!this._isNeedCalc&&!this._isInFunc)return[W.UNDETERMINED];if(!P.filter(ue=>ue&&ue.length).length)return[W.UNDETERMINED];let R=P[0]||[],O=R.length<=1?R[0]:`[${R.join(", ")}]`,U=0,X=0;for(const ue of P.slice(1))if(ue)if(U++,O+=ue.length<=1?`; ${ue[0]}`:`; [${ue.join(", ")}]`,ue.length!==R.length)X=U;else for(const[K,Y]of R.entries())if(this._compareType(ue[K],Y))(ue[K].includes(W.FLOAT)&&!Y.includes(W.FLOAT)||R[K]===`${W.SIMPLE} ${W.NA}`)&&(R[K]=ue[K]);else{X=U;break}if(X){const ue=A[X].slice(-1)[0],K=Array.isArray(ue)?ue.slice(-1)[0]:ue;this._errorHandle(we(Pe.ifOrSwitchTypeErr,{keyword:"if",types:O}),K.ctx),R=R.map(()=>W.UNDETERMINED)}return o.returnedTypes=R,R}return[W.UNDETERMINED]}}class km{constructor(e){w(this,"_nameMap");w(this,"_prefixNameVar");w(this,"_prefixNameFunc");w(this,"_prefixNameConst");w(this,"_userTypes");w(this,"_isInFunc");w(this,"_varlist");w(this,"_memberIndexList");w(this,"_blockCount");this._nameMap=new Map,this._prefixNameVar=`${e}_var`,this._prefixNameFunc=`${e}_func`,this._prefixNameConst=`${e}_const`,this._userTypes=[],this._isInFunc=!1,this._varlist=[{}],this._memberIndexList=[{}],this._blockCount=0}preParser(e){var o,u;const n=[];for(const h of e){if(!h)return;if(Array.isArray(h)){for(const m of h)if(n.push(this._parserStmt(m)),_l.includes((u=(o=m.exprs)==null?void 0:o[0])==null?void 0:u.name))return n.join(`;
12
12
  `).replace(/;+/g,";")}else n.push(this._parserStmt(h))}return""}parser(e){const n=[];for(const u of e){if(!u)return;if(Array.isArray(u))for(const h of u)n.push(this._parserStmt(h));else n.push(this._parserStmt(u))}const o=this._memberIndexList[this._blockCount]||{};return n.push(...Object.values(o)),n.join(`;
13
13
  `).replace(/;+/g,";")}_parserStmt(e,n=!1){switch(e==null?void 0:e.ruleType){case Oe.DeclareAssign:return this._parserDeclareAssign(e);case Oe.MethodExpression:return`${this._parserMethodExpression(e)}`;case Oe.ArrowFunction:return this._parserArrowFunction(e);case Oe.ArrowMethod:return this._parserArrowMethod(e);case Oe.IfStatement:return this._parserIfStatement(e,n);case Oe.WhileStatement:return this._parserWhileStatement(e,n);case Oe.SwitchStatement:return this._parserSwitchStatement(e,n);case Oe.ForInStatement:return this._parserForInStatement(e,n);case Oe.ForToStatement:return this._parserForToStatement(e,n);case Oe.AgainAssign:return this._parserAgainAssign(e);case Oe.ImportElement:break;case Oe.TypeStatement:return this._parserTypeStatement(e);case Oe.VarBlockStmt:return this._parserVarBlockStmt(e);case Oe.FlowStmt:return`${e.value};`;case Oe.Brackethesized:return this._parserBrackethesized(e);default:return this._parserSingleExpression(e)}return""}_parserTypeStatement(e){const n=[],o=[];for(const u of e.fields){const{name:h,value:m}=u;u.isVarip&&o.push(`"${h}"`),n.push(`${h}: ${m?this._parserSingleExpression(m):"undefined"}`)}return this._userTypes.push(e.name),`const ${e.name} = ${this._prefixNameVar}.getTypeInstance({${n.join(", ")}}, [${o.join()}])`}_parserVarBlockStmt(e){const{nameList:n,operator:o,name:u,value:h}=e,m=this._parserStmt(h,!0);return u?`${this._parserName(u)} ${o===":="?"=":o} ${m}`:`let ${this._parserDeclareAssignNames(n)} = ${m}`}_parserForToStatement(e,n=!1){const{numerical:o,block:u,name:h}=e,[m,_,T]=o,x=this._parserBlockLine(u,n),P=this._parserSingleExpression(m),A=this._parserSingleExpression(_),F=T?this._parserSingleExpression(T):"",$=`for (let ${h}=${P}; ${h}>=(${A}); ${h}+=(${F||"-1"})){
14
14
  ${x}